Commit Graph
6996 Commits
Author SHA1 Message Date
RRFZ fe29cab95a test(ida): compare verifier reads in one database state (#16483)
* test(ida): compare verifier reads in one database state

With IDA Pro 9.5, decompiling a function applies its inferred prototype
and can merge adjacent stack slots in the live database. The verifier
read the dossier before its first pseudocode, then compared
procedure_assembly and read_function_instructions with it after that
pseudocode, so the public fixture's rea_fixture_add failed parity.

Keep the CLI/MCP dossier comparison, which both read before any
decompilation, and compare the later MCP reads with a second dossier
read in the same post-decompilation state. Document the behavior and
the IDA 9.5 Windows x64 headless run.

* test(ida): cover verifier reads after a frame change

The verifier fixture always returned the same assembly, so pointing the
later assembly or instruction comparison back at the first dossier still
passed. The fixture now changes main's assembly once it has been
decompiled a chosen number of times: a change after the MCP dossier's
decompilation must pass, and a change before the assembly or instruction
read must fail in that phase.

Drop the second dossier's address, name and pseudocode assertions.
procedure_pseudo_code already compares later pseudocode with the first
dossier, and a second dossier for another function fails the assembly
comparison.

* test(ida): check the post-decompilation dossier's identity and pseudocode
2026-12-03 17:19:13 -05:00
Vincent Koc 74ecd82a3a test(evaluation): cover all scenario report totals (#16484) 2026-12-04 05:47:45 +08:00
Vincent Koc 5cfc8edb98 refactor(evaluation): summarize scenario totals in one pass (#16481) 2026-12-03 21:37:38 +00:00
RRFZ c80acb9c1d fix(artifacts): read paletted KTX mip chains as one block (#16000) 2026-12-03 20:30:23 +00:00
Vincent Koc 5272a4fc3c test(filesystem): share file format fixture reads (#16459) 2026-12-03 19:58:59 +00:00
RRFZ 2a96f92293 fix(ogg): accept compatible OpusHead minor versions (#16009) 2026-12-03 19:50:31 +00:00
Vincent Koc 35230f2587 test(artifacts): share prefix recognition fixtures (#16453) 2026-12-03 19:41:42 +00:00
Vincent Koc eaec6a9055 test(export): share web script input buffers (#16450) 2026-12-03 19:37:23 +00:00
Vincent Koc 917646c723 test(cli): share managed summary arguments (#16442) 2026-12-03 18:58:32 +00:00
Vincent Koc 1a66acd644 test(lint): share raw file-handle close expectations (#16436) 2026-12-03 18:41:43 +00:00
Vincent Koc 94c0ca874b refactor(test): share required readiness stage summary (#16434) 2026-12-03 18:39:37 +00:00
Vincent Koc 9873058a8d test(ci): share static task context fixtures (#16433) 2026-12-03 18:39:33 +00:00
Vincent Koc 4824a91fa1 test(docs): share README markdown parsing (#16430) 2026-12-03 18:26:45 +00:00
Vincent Koc bf8a092dde refactor(test): share allocation report discovery filter (#16427) 2026-12-03 18:17:24 +00:00
Vincent Koc fdaf644ed1 test(config): share Cursor JSON client fixtures (#16417) 2026-12-03 17:37:06 +00:00
Vincent Koc 00d695c944 test(evaluation): share completed message fixtures (#16414) 2026-12-03 17:24:06 +00:00
Vincent Koc a1e101db1d test(config): share stale DeepSeek Harness registration fixtures (#16411) 2026-12-03 17:21:33 +00:00
Vincent Koc dda05bfa5d test(cli): share command projection context fixtures (#16408) 2026-12-03 17:14:21 +00:00
Vincent Koc fcf976e8aa test(cli): share stream graph output fixtures (#16388) 2026-12-03 15:09:02 +00:00
Vincent Koc 236655afe2 test(mcp): share Rust report validation fixtures (#16371) 2026-12-03 14:04:40 +00:00
Vincent Koc b352b301c7 test(javascript): share CLI and MCP session app fixtures (#16368)
* test(javascript): share CLI and MCP session app fixtures

* test(mcp): remove unused session fixture import
2026-12-03 13:55:28 +00:00
Vincent Koc 66ab6d5e72 test(mcp): reuse keyed archive tool success fixture (#16365) 2026-12-03 13:35:17 +00:00
Vincent Koc 059f129377 test(native): share dispatch environment fixtures (#16357) 2026-12-03 13:25:45 +00:00
gensokyo-dev 766c45de1d feat(firmware)!: replace the literal-pool and split-immediate MMIO tools with inspect_firmware_mmio
inspect_firmware_literal_pools and inspect_firmware_mmio_synthesis answered
the same question and differed only in the instruction idiom they decode.
One tool, inspect_firmware_mmio, now takes a single architecture vocabulary
across all nine ISAs and dispatches to the literal-pool or split-immediate
decoder.

Both decoders write the same report:
- accesses rows: instruction, address register, access kind and width,
  address and MIPS physical address, region kind, architectural block, and
  CMSIS-SVD peripheral and register facts;
- a source object with the decoder's own facts: pool slot and disassembly,
  or pattern and high instruction;
- decoder facts on the report.

firmwareMmioGroups.ts owns grouping MMIO accesses by SVD peripheral,
architectural block or 4 KiB page. mmioAttributionBasis owns the group
basis. The retained view kind is firmware-mmio, with collections accesses,
peripheral_groups and anomalies, and its summary lists the top 16 groups as
compact rows.

max_references and max_syntheses are removed, since max_representation_bytes
already bounds the rows they counted. The literal-pool pre-allocation
measurement now includes an upper bound for each group, so its refusal
reports the exact required bytes. max_scan_bytes defaults to its 16 MiB
maximum, so one call covers a whole application image. mmio_only, default
true, now also drops literal-pool constants that are not MMIO;
counts.candidate_accesses still counts every decoded access.

BREAKING CHANGE: inspect_firmware_literal_pools and
inspect_firmware_mmio_synthesis (CLI inspect-firmware-literal-pools and
inspect-firmware-mmio-synthesis) and the retained view kinds
firmware-literal-pools and firmware-mmio-synthesis are replaced by
inspect_firmware_mmio (inspect-firmware-mmio) and view kind firmware-mmio.
isa becomes architecture, max_svd_nodes becomes max_svd_xml_nodes, and
max_references and max_syntheses are removed. Neither old tool has been
released.

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-12-03 21:19:29 +08:00
Vincent Koc 7a06eba0f5 test(javascript): share literal mapping assertions (#16360) 2026-12-03 13:16:39 +00:00
Vincent Koc 6cf887e72d test(mcp): share LabVIEW retained page fixtures (#16362) 2026-12-03 13:16:35 +00:00
Vincent Koc a095642e2c test(ci): share missing timing history assertions (#16359) 2026-12-03 13:10:36 +00:00
Vincent Koc 80108ae89e test(mcp): share web bundle view fixture calls (#16352) 2026-12-03 13:01:34 +00:00
Vincent Koc 655e939d6e test(nib): share registered object fixture tables (#16350) 2026-12-03 13:00:14 +00:00
Vincent Koc a0d9275951 test(png): share chunk encoding across image fixtures (#16347) 2026-12-03 12:44:47 +00:00
Vincent Koc 085ffaf5f3 test(cli): share failure-output fixture setup (#16344) 2026-12-03 12:34:26 +00:00
Vincent Koc ae19a87dd5 refactor(cli): share help row alignment (#16336)
* refactor(cli): share help row alignment

* test(cli): cover blank help description spacing
2026-12-03 12:19:10 +00:00
Vincent Koc 1b3e3ee83e test(analysis-view): reuse graph binding for source fixtures (#16338) 2026-12-03 12:18:28 +00:00
Vincent Koc aef3fb790d test(api-contract): share retained view fixture calls (#16335) 2026-12-03 12:08:11 +00:00
Vincent Koc 34599ec5ff test(cli): share instructions completion fixtures (#16330) 2026-12-03 12:00:02 +00:00
Vincent Koc b635ff751e test(cli): share timing flag fixture matrix (#16327) 2026-12-03 11:29:03 +00:00
Vincent Koc d3e70b88a2 test(cli): share logged command fixture execution (#16320) 2026-12-03 11:00:55 +00:00
Vincent Koc c41d023097 test(macos): share package resource fork fixtures (#16315) 2026-12-03 10:49:15 +00:00
Vincent Koc baaabb3dfa test(cli): share accessibility comparison result checks (#16317) 2026-12-03 10:46:10 +00:00
Vincent Koc b013a2ff28 test(cli): share analysis view request fixtures (#16314) 2026-12-03 10:36:10 +00:00
Vincent Koc d5ed402722 test(plist): share native CLI fixture invocations (#16310) 2026-12-03 10:30:12 +00:00
Vincent Koc 246f63a304 test(cli): share Unicode output capture setup (#16307) 2026-12-03 09:49:21 +00:00
Vincent Koc 77235a7fd3 test(apple): share archive CLI projection fixtures (#16304) 2026-12-03 09:35:00 +00:00
0af842ad26 feat(firmware): disassemble RISC-V, MIPS32, PowerPC, and ARM64 split-immediate MMIO accesses (#15413)
* feat(firmware): disassemble RISC-V, MIPS32, PowerPC, and ARM64 split-immediate MMIO accesses

* fix(firmware): tighten SVD interval inheritance and split-immediate register tracking

* fix(firmware): bound inherited SVD block expansion and decode exact destination GPRs

* fix(firmware): clear Rs across acquire-ordered ARM64 CAS and CASP variants

* chore(mcp): sync advertised schema summary and budget projection with main

* fix(firmware): bound CMSIS-SVD numeric widths before BigInt and index expansion

* fix(firmware): keep rejected SVD addressBlocks distinct from omitted spans

* fix(firmware): bound MMIO representation growth and preserve SVD ambiguity

* perf(firmware): memoize SVD address lookups and pre-rank peripheral names

* fix(firmware): scan a whole application image by default for MMIO syntheses

On the 1.36 MB IROM segment of the MicroPython 1.24.1 ESP32-C3 image, a
default call scanned 256 KiB and kept 512 of 713 matching accesses. The
omitted rows were not in the retained Evidence, so the agent had to repeat
the call with larger controls or page by scan_offset. Defaults now scan
4 MiB and keep up to 32,768 syntheses within a 16 MiB representation
allowance, matching the literal-pool tool. Retained summary delivery still
sizes what reaches the agent. The image completes in about 1 s with 4,073
syntheses.

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* refactor(firmware): use MMIO synthesis maximums as their defaults directly

The default scan, synthesis and representation constants only repeated
their maximums, which Knip reports as duplicate exports. The budgets and
the parser fallback now name the maximums.

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(firmware): bound SVD match cache weight, exclude RISC-V flash, and report scan-limit stops

---------

Co-authored-by: gensokyo-dev <gensokyo-dev@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-12-03 17:22:49 +08:00
Vincent Koc 753feb550d test(cli): share filtered rows command fixtures (#16301) 2026-12-03 09:21:01 +00:00
Vincent Koc 2ecbb734c8 test(cli): share expected require resolution edges (#16298) 2026-12-03 09:07:45 +00:00
Vincent Koc 30a70b138b test(javascript): reuse package specifier fixture writer (#16296) 2026-12-03 09:07:12 +00:00
04d473ca0b feat(firmware): disassemble ARM and Xtensa PC-relative literal-pool MMIO loads (#14447)
* feat(firmware): disassemble ARM and Xtensa PC-relative literal-pool MMIO loads

Disassemble PC-relative literal-pool load instructions (`arm-thumb` 16-bit
LDR and 32-bit Thumb-2 LDR.W, `arm-a32` LDR, and `xtensa` L32R) from local
firmware images at an explicit `base_address` without target execution:

- Byte-granular `PoolByteBitset` suppresses forward and backward pool byte
  ranges even at `4k + 2` unaligned file offsets (`base_address` ending in 2).
- Two-pass Xtensa pool discovery preserves `L32R` alignment after leading or
  interleaved 4-byte literal pools and preserves valid `21 36 01` encodings.
- Indexed `O(log M)` CMSIS-SVD disjoint `<addressBlock>`/`<register>` matching
  with cycle-safe multi-hop `derivedFrom` resolution, `mapped_image` bounds
  precedence, exact ARMv7-M/v8-M SCS sub-blocks, and `arm-a32` SoC neutrality.
- Cooperative `setImmediate` event-loop yields with `AbortSignal` cancellation,
  complete retained Evidence with `detail: "summary"` and `inspect_analysis_view`
  (`firmware-literal-pools`), `max_svd_nodes` parameter budget, and
  field-specific `invalid_request` validation.

* fix(firmware): bound SVD and candidate memory, preserve overshadowed loads, and report required_value

* fix(firmware): resolve SVD derivedFrom chains iteratively and restore lifecycle test title

* fix(firmware): bound Xtensa trace and SVD representation memory, make Evidence cooperative, and preserve unaligned literal loads

* fix(firmware): retain completed literal-pool scans on late cancellation and avoid repeated SVD string hashing

* fix(firmware): walk SVD register clusters, sweep dense overlaps linearly, and preserve XML depth recovery

* fix(firmware): enforce profile-wide cooperative SVD cluster expansion budget and sync schema

* fix(firmware): pre-parse SVD cluster templates, inherit defaults, and keep Xtensa framing

* fix(firmware): share inherited SVD template chains and count compact arrays as single intervals

* fix(firmware): replace SVD override chain links with persistent O(log K) treap

* fix(firmware): default max_references to the representation-bounded maximum

The IROM segment of the MicroPython 1.24.1 ESP32 image resolves 35,179
literal-pool loads. A default call scanned it and then refused at 16,384
references, so the agent had to repeat the whole scan with a larger
max_references. The count is checked after scanning, and
max_representation_bytes already bounds the Evidence these rows build. The
default is now the maximum; the same image completes in 1.4 s with a 12 MB
complete result.

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* refactor(firmware): use the max_references maximum as its default directly

Knip reported DEFAULT_LITERAL_POOL_MAX_REFERENCES as a duplicate export of
MAX_LITERAL_POOL_REFERENCES. The budget now names the maximum as its
default, and the provider test reads the default from the budget.

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* fix(firmware): preserve inherited SVD register widths and addressBlock spans

---------

Co-authored-by: gensokyo-dev <gensokyo-dev@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-12-03 17:00:14 +08:00
Vincent Koc 553288963f test(ci): share PR health fixture inputs (#16292) 2026-12-03 08:52:06 +00:00
Vincent Koc cf54d0af98 test(cli): share literal Evidence bundle arguments (#16291) 2026-12-03 08:41:32 +00:00