*************************************************************************
** GenAI was used in the production of this series, it is not intended **
** for merging but an experiment to explore the capabilities of the    **
** current models and perhaps inform future discussions. There is no   **
** obligation to review this code.                                     **
*************************************************************************

This order and layout of this series is a little unusual as I've
included patches for tooling which wouldn't normally be included. This
includes the PLAN.md which obviously wouldn't be something you keep in
the tree.

I've also included fixup patches where I cleaned up after the agent had a
go. I also have noted what tweaks I've made to the agent commits under
the ---. The patches with my s-o-b are pure human generated.

I decided to try this experiment when fixing the WFIT syndrome data
and could see a larger re-factoring would be needed to properly handle
the RN/RD fields of the ISS. In total I've spent about 6 hours (3
idly prompting the agent on a Sunday afternoon and 3 actually
debugging and following up on failures). The total API cost was about
£1.60 which means it didn't need to save much of my time to make it
worthwhile. The model used was gemini-3-flash-preview driven by Editor
Code Assistant (https://eca.dev) in my Emacs session.

My impression is it did help me get something working faster than if
I'd gone from scratch. Even though the agent failed to account for GIC
and page table device mapping it was helped that it was being driven
by someone with a fairly good understanding of QEMU's internals.
Rather than leaving it to figure out why it was seeing data aborts I
was able to quickly theorise the reason (no mapping) and direct it to
add the needed support. I suspect it would have taken me longer to get
through that bit myself because I would be digging into the
kvm-unit-test code or re-reading the page table format documentation.

When IRQs weren't firing feeding results of the test case with the
additional "-d trace:gic\*" debug output gave the model enough context
to figure out what it had missed in the setup.

Despite the plan it smooshed a lot of stuff into each commit which
make them not ideal for review.

>From what I've seen in this example the potential for inadvertent
copyright infringement is fairly low. Certainly the TCG code was
following existing styles for QEMU code and the page table setup was a
straight evolution. I'm not sure if the gic initialisation code would
count as novel enough to be copyrightable anyway.

As a first draft I think it worked quite well. To actually turn it
into a proper series I would break the code apart into much more
discreet steps and include re-factor steps before functionality
changes. For example the addition of the rd field to the helper while
correct missed the fact the timeout from rd is also in the args. I
would have just pushed the reading of rd into the helper instead.

I think it might be worth going through those steps to make a "proper"
series and seeing how different a pure human series would make.
However having a working reference with tests will be pretty helpful.

Any thoughts?

Alex.

Alex Bennée (8):
  target/arm: set the correct TI bits for WFIT traps
  .eca: basic configuration for Editor Code Assistant
  AGENTS.md: add basic AGENTS.md for QEMU
  PLAN.md: add plan for the current work
  target/arm: extend WFX support for A-profile
  tests/tcg/aarch64: Add WFX instructions system test
  tests/tcg/aarch64: fixes for WFX instructions system test
  target/arm: fixes for WFx[T] support

 target/arm/syndrome.h                     |  24 ++++-
 target/arm/tcg/helper-defs.h              |   3 +-
 tests/tcg/aarch64/system/lib/gicv3.h      |  56 ++++++++++
 target/arm/tcg/a64.decode                 |   3 +-
 target/arm/cpu.c                          |   6 +-
 target/arm/tcg/op_helper.c                | 101 +++++++++++------
 target/arm/tcg/translate-a64.c            |  27 +++--
 target/arm/tcg/translate.c                |   4 +-
 tests/tcg/aarch64/system/lib/gicv3.c      |  77 +++++++++++++
 tests/tcg/aarch64/system/wfx.c            | 126 ++++++++++++++++++++++
 .eca/config.json                          |  43 ++++++++
 .eca/skills/checkpatch/SKILL.md           |   9 ++
 .eca/skills/gtags/SKILL.md                |   7 ++
 AGENTS.md                                 |  18 ++++
 PLAN.md                                   |  77 +++++++++++++
 tests/tcg/aarch64/Makefile.softmmu-target |  15 ++-
 tests/tcg/aarch64/system/boot.S           |  55 ++++++----
 17 files changed, 579 insertions(+), 72 deletions(-)
 create mode 100644 tests/tcg/aarch64/system/lib/gicv3.h
 create mode 100644 tests/tcg/aarch64/system/lib/gicv3.c
 create mode 100644 tests/tcg/aarch64/system/wfx.c
 create mode 100644 .eca/config.json
 create mode 100644 .eca/skills/checkpatch/SKILL.md
 create mode 100644 .eca/skills/gtags/SKILL.md
 create mode 100644 AGENTS.md
 create mode 100644 PLAN.md

-- 
2.47.3


Reply via email to