Repository navigation
Listing/xref tier PR5: ARM/MIPS context-paint in the walker - #28
Merged
Merged
Conversation
The Listing's recursive-descent walker decodes through `Translate::one_instruction` outside the decompiler's normal `commit_analysis_output` paint path, so an alternate-ISA function (ARM Thumb / MIPS16) was misdecoded: a Thumb `compute` read as A32, a MIPS16 `m16_square` read as MIPS32 garbage. PR5 paints the correct decode-mode context (`TMode` / `ISA_MODE`) into the engine's `ContextDatabase` before the walk decodes, so alt-ISA functions decode correctly. Internal to `Listing::build` (default-OFF behind `--option listing`), so it is parity-safe and only active when the Listing is built. x86-64 (no decode-mode context) is untouched. How the per-address decode mode is obtained (reused, not re-derived): `listing/context.rs::ContextPainter::new(file)` calls into the existing marker logic — `arm_markers::scan_arm_markers` (ARM `$t`/`$a` + STT_FUNC-LSB -> TMode) and `mips_markers::scan_mips_isa_markers` (STT_FUNC-LSB / STO_MIPS_MIPS16 st_other -> ISA_MODE) — and reuses their `ContextPaint` facts verbatim. Both scans were promoted `fn` -> `pub(crate)`; they self-gate on the object architecture (ARM-only / MIPS-only), so on x86-64 the painter collects zero paints and is a no-op. Mechanism mirrors the commit seam exactly: `paint_all` applies every paint via `Architecture::with_context_db_mut` -> `set_variable`/`set_variable_region` (the same calls `engine.rs::commit_analysis_output` step 6 makes), painting once at the start of the walk before any `decode_one`. Gate-safe: an unregistered context variable is a swallowed no-op, the same swallow the commit seam relies on. Proof (specs built; the gate RAN, not skipped): `verify_listing_context.rs` bootstraps each fixture for a real `Translate`, builds the Listing seeded at the alt-ISA entry, and asserts the seed decodes in the alternate ISA — with a control (the same seed via a fresh bootstrap's raw `Translate` = default mode), asserting the painted decode DIFFERS. - ARM Thumb (arm_thumb_linked_le32, compute@0x100b8): Listing decodes `push` (len 2, Thumb); the un-painted A32 control reads `addlt` (len 4). - MIPS16 (mips16_le32, m16_square@0x400130): Listing decodes `mult`(2) -> `mflo`(2) -> `jr`+delay-slot(4); the un-painted MIPS32 control fails to decode the bytes at all. Gates: make test 675/675 PARITY OK; make test-stages 159/159 PARITY OK; make rust-test green (incl. the 2 new verify_listing_context cases). No new `--option`, catalog unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FvRnfTgYKoZvS2TEvdYpWb
mahaloz
added a commit
that referenced
this pull request
Sep 19, 2026
… every target the vararg rule admits A closed format prototype also changes how P4 scores the argument trials of the calls around it. On AArch64 and ARM32 firmware that added more wrong arguments to neighbouring calls than it removed (an x8 of 0 ahead of the real arguments; iproute2 ip's parse_rtattr losing its len), while on x86 every such change removed a phantom. static now resolves at load on x86 only; full still resolves on every target VarargAbi admits. Stage passes 24-26 pin AArch64 default == off and full typed; #13/#19/#23/#28 pin ARM the same way. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
mahaloz
added a commit
that referenced
this pull request
Sep 19, 2026
… every target the vararg rule admits A closed format prototype also changes how P4 scores the argument trials of the calls around it. On AArch64 and ARM32 firmware that added more wrong arguments to neighbouring calls than it removed (an x8 of 0 ahead of the real arguments; iproute2 ip's parse_rtattr losing its len), while on x86 every such change removed a phantom. static now resolves at load on x86 only; full still resolves on every target VarargAbi admits. Stage passes 24-26 pin AArch64 default == off and full typed; #13/#19/#23/#28 pin ARM the same way. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
mahaloz
added a commit
that referenced
this pull request
Sep 20, 2026
libctypes_obstack_import_x86_64 is the twin of the existing obstack fixture on the other channel: _obstack_newchunk imported from glibc rather than linked in from gnulib. Two assertions, off and on, pin `void grow_import(obstack *a0,int4 a1)` against #28's `uint8` -- a table that spelled both channels the same fails one of them. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
mahaloz
added a commit
that referenced
this pull request
Sep 20, 2026
libctypes_obstack_import_x86_64 is the twin of the existing obstack fixture on the other channel: _obstack_newchunk imported from glibc rather than linked in from gnulib. Two assertions, off and on, pin `void grow_import(obstack *a0,int4 a1)` against #28's `uint8` -- a table that spelled both channels the same fails one of them. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
mahaloz
added a commit
that referenced
this pull request
Sep 20, 2026
libctypes_obstack_import_x86_64 is the twin of the existing obstack fixture on the other channel: _obstack_newchunk imported from glibc rather than linked in from gnulib. Two assertions, off and on, pin `void grow_import(obstack *a0,int4 a1)` against #28's `uint8` -- a table that spelled both channels the same fails one of them. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
mahaloz
added a commit
that referenced
this pull request
Sep 21, 2026
libctypes_obstack_import_x86_64 is the twin of the existing obstack fixture on the other channel: _obstack_newchunk imported from glibc rather than linked in from gnulib. Two assertions, off and on, pin `void grow_import(obstack *a0,int4 a1)` against #28's `uint8` -- a table that spelled both channels the same fails one of them. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
mahaloz
added a commit
that referenced
this pull request
Sep 21, 2026
libctypes_obstack_import_x86_64 is the twin of the existing obstack fixture on the other channel: _obstack_newchunk imported from glibc rather than linked in from gnulib. Two assertions, off and on, pin `void grow_import(obstack *a0,int4 a1)` against #28's `uint8` -- a table that spelled both channels the same fails one of them. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
mahaloz
added a commit
that referenced
this pull request
Sep 21, 2026
libctypes_obstack_import_x86_64 is the twin of the existing obstack fixture on the other channel: _obstack_newchunk imported from glibc rather than linked in from gnulib. Two assertions, off and on, pin `void grow_import(obstack *a0,int4 a1)` against #28's `uint8` -- a table that spelled both channels the same fails one of them. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
mahaloz
added a commit
that referenced
this pull request
Sep 21, 2026
libctypes_obstack_import_x86_64 is the twin of the existing obstack fixture on the other channel: _obstack_newchunk imported from glibc rather than linked in from gnulib. Two assertions, off and on, pin `void grow_import(obstack *a0,int4 a1)` against #28's `uint8` -- a table that spelled both channels the same fails one of them. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG
mahaloz
added a commit
that referenced
this pull request
Sep 21, 2026
* [AUTOMATED] wip(analysis): libctypes second round of named libc structs Mined the libc/POSIX-named ptr_struct ground-truth pool from the DWARF twins of the 444-slice corpus and added the slots that pay. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] wip(analysis): obstack fixture, stage passes 11-12, unit tests Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] wip: spec prose, phases.toml summary, options.md, stages baseline Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] wip: probe/test fixtures repointed, feature bundle analysis+plan Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] wip: re-capture phase_catalog fixture, move the ghidra-sim C-line pins Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] wip: feature record.json Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] wip: refresh the module header for the second round Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): cite the twin's debug info for the nl witness Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): record the export compile-error cost Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): tidy the unreachable half of the ranked pool Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): list every newly-wrong row Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): the speed block and the gate results Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): the quieter-moment speed confirmation Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] fix(analysis): the obstack size slots follow the channel, not the corpus gnulib's copy of obstack.c declares its size type size_t; the installed glibc header declares int. The table asserted size_t for both, so an image that IMPORTS _obstack_begin/_obstack_newchunk from glibc (the five dpkg programs at each optimization level, 15 slices of the same results tree) got a false declaration, and the caller of a two-line glibc-obstack program went from `void f(int n)` to `void f(unsigned int n)` with two inserted casts. Split the channel: LIBC_DEFINED_NAMED (size_t) is seeded only from the names the image defines and does not also import, LIBC_IMPORTED_OBSTACK (int) from the import channel by name and by resolver address. Corrects the module and spec prose that claimed obstack is never an import. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): the gzip row in full, and the two obstack channels The single worse typesweep row said "a by-value struct stat local that becomes a byte blob". What it actually is: char v5 [80] handed to an lstat that writes 144 bytes, with st_atim/st_mtim detached into locals the body reads and nothing writes. State that, say what causes it (the timespec * slot on utimensat/futimens -- reverting those two slots brings stat v5 back), and record the measurement it is kept on: over the 30 corpus slices that import either name, 122 functions gain a timespec rendering and this is the only new under-declared stat, against 7 that main already prints in those same slices. Also: rebased onto argclobber (#689), stages baseline re-recorded, PR body cut under a screen, and the statfs/export redeclaration noted beside the option's documented export cost. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] test(stages): pin the imported obstack channel end to end libctypes_obstack_import_x86_64 is the twin of the existing obstack fixture on the other channel: _obstack_newchunk imported from glibc rather than linked in from gnulib. Two assertions, off and on, pin `void grow_import(obstack *a0,int4 a1)` against #28's `uint8` -- a table that spelled both channels the same fails one of them. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): re-measure on the rebased base The 444-slice typesweep was run again in full after the rebase onto argclobber (#689), base arm built from origin/main's kuna_libctypes.rs + protos/mod.rs in this tree. Identical to the first run down to the per-variable tables: 1,349 -> 1,353 perfect, mean .3403 -> .3417, 147 newly correct / 6 newly wrong, 91 improved / 1 worse. Also completes the newly-correct breakdown, which was listing 139 of the 147. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): the channel split's load cost min-of-9 interleaved `kuna functions` over -O2 tar: 0.144s before the extra defined-name walk, 0.142s after. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] style(analysis): shorten the inline note at the obstack seam Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): the channel split's blast radius decompile-all over five whole binaries, the two builds differing only by the split: grep/tar/ls/gzip byte-identical, dpkg-query moves 7 lines. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] style(analysis): present-name set is module-private again Nothing outside protos/mod.rs reads it now that the obstack seam takes the defined-name set. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): disclose the sigaction frame split The `sigfillset(sigset_t *)` slot gives the `sa_mask` sub-object its own identity, so a 152-byte `sigaction` frame slot splits at 136 and the `sa_flags` store lands outside the object handed to `sigaction()`. Measured by ablating that one table row: no `sigaction` declaration moves anywhere in the 444 scored slices (6 of them import `sigfillset`), and in a disjoint openssh -O2 sweep exactly one function per binary changes, all of them `ssh_signal`. The shape already ships through `sigemptyset`, which prints the identical split on the ablated build. Also records the `statfs` name collision as it appears in plain `decompile-all`, not only in a project export. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): the sigaction repro in full The mitigation claim is only checkable with the program it was measured on. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): re-measure the typesweep on the new base Third full run of both arms, this time at 69d252d. The perfect counts, the improved/worse split and every per-variable table are unchanged; only the pooled mean moves, 0.3403 -> 0.3405 off and 0.3417 -> 0.3419 on, which is #694 lifting both arms alike. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): the utmp rows measured, the 32-bit size limit, the re-derived fixture swap Adds three sections to the feature analysis: the utmp/utmpx rows reaching a caller's own local on who/logoutd/runlevel (they ship on a pool count, not a sweep delta, and this is what they buy); the table's sizes being glibc x86-64 with nothing scaling them by word size, and what that is confined to; and the export fixture swap re-derived under #693's callee-first schedule. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): record the rebase onto the callee-first export The gate block now names the base it was run on, and a new section records how the two repointed fixtures were re-derived under that schedule, the nine-binary `libctypes off` identity against a build of the new base, and why the type sweep did not need re-running (`decompile-all --json` is byte-identical between the two bases). The timespec rows are recorded as a decision rather than a disclosure. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] docs(libcstructs): the workspace suite result on the rebased tree Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01YFCA715QE6ZBSnTn7bwabG * [AUTOMATED] feat(analysis): drop the sigfillset row from libctypes It splits a struct sigaction frame slot in openssh's ssh_signal and buys nothing in the mined pool. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_017ei9zqc7XHgZdMAzrk8jAL * [AUTOMATED] feat(analysis): drop the two-element time slots and the sigset_t sub-object rows utimensat/futimens/utimes/futimesat take a two-element array; naming one element shrinks the caller's frame object (gzip lutimens reads a stat tail nothing writes; scp/sftp hand utimes 16 of 32 bytes). sigsuspend, pthread_sigmask, sigdelset, sigismember and sigwait split a struct sigaction local when handed &sa.sa_mask. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_017ei9zqc7XHgZdMAzrk8jAL * [AUTOMATED] docs(libcstructs): the spec and option row say which slots are left out and why Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_017ei9zqc7XHgZdMAzrk8jAL * [AUTOMATED] docs(libcstructs): round-5 measurements, the dropped rows, off-pool notes for every kept row Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_017ei9zqc7XHgZdMAzrk8jAL * [AUTOMATED] docs(libcstructs): the frame checker, the sigset_t repro and the 15-binary hunk classification Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_017ei9zqc7XHgZdMAzrk8jAL * [AUTOMATED] docs(libcstructs): record.json for round 5 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_017ei9zqc7XHgZdMAzrk8jAL * [AUTOMATED] test(analysis): the frame-splitting slots stay out of the libctypes tables Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_017ei9zqc7XHgZdMAzrk8jAL * [AUTOMATED] chore(libcstructs): re-derive counts and generated files after rebase Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_017ei9zqc7XHgZdMAzrk8jAL * [AUTOMATED] docs(libcstructs): round-5 speed block and the gates on the rebased tree Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_017ei9zqc7XHgZdMAzrk8jAL * [AUTOMATED] docs(libcstructs): the gates on the #703-rebased tree Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_017ei9zqc7XHgZdMAzrk8jAL --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
mahaloz
added a commit
to borancar/kuna
that referenced
this pull request
Nov 14, 2026
…load Comparing values lets `mov ecx,esi; mov eax,[esi]; call [eax+k]` pass the object in ECX, since ECX holds it at the call; the vcall fixture gains ecxcopy for it (stage Noelo-Lab#28, Noelo-Lab#29, the custom test) and spec 04 says so. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0179iMKQeLQDThvbHGNoGw8h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Listing's recursive-descent walker decodes through
Translate::one_instructionoutside the decompiler's normalcommit_analysis_outputpaint path, so an alternate-ISA function (ARM Thumb / MIPS16) was misdecoded. PR5 paints the correct decode-mode context (TMode/ISA_MODE) into the engine'sContextDatabasebefore the walk decodes, so alt-ISA functions decode correctly. Internal toListing::build(default-OFF behind--option listing) ⇒ parity-safe; x86-64 (no decode-mode context) is untouched.Before / after
For the vendored
arm_thumb_linked_le32fixture, the Thumbcomputefunction (entry0x100b8):0x100b8decodeaddlt(len 4) — garbage; the same byte stream read as a 4-byte A32 wordTMode=1)push(len 2, Thumb) — correct; body carries the*3shift (lsl)For
mips16_le32, the MIPS16m16_squarefunction (entry0x400130):0x400130decodeISA_MODE=1)mult(len 2, MIPS16) →mflo(2) →jr+delay-slot(4) = the 8-byte bodyHow the per-address decode mode is obtained (reused, not re-derived)
listing/context.rs::ContextPainter::new(file)calls into the existing marker logic —s1_loader::arm_markers::scan_arm_markersands1_loader::mips_markers::scan_mips_isa_markers— and reuses theirContextPaintfacts verbatim (both promotedfn→pub(crate)).paint_allapplies them viaArchitecture::with_context_db_mut→set_variable/set_variable_region— the same callsengine.rs::commit_analysis_outputstep 6 makes — once at the start of the walk, before anydecode_one. Gate-safe: an unregistered context variable is a swallowed no-op.Test (RAN, not skipped — ARM
.slabuilt viamake specs)kuna-console/tests/verify_listing_context.rs— two cases, each with a control (the same seed decoded through a fresh bootstrap's rawTranslate= the un-painted default mode), asserting the painted decode DIFFERS. Captured output:Gates
make test— 675/675 PARITY OKmake test-stages— 159/159 PARITY OKmake rust-test— green (incl. the 2 newverify_listing_contextcases)Internal to a default-OFF build ⇒ no new
--option, catalog unchanged, parity oracles structurally untouched.🤖 Generated with Claude Code
https://claude.ai/code/session_01FvRnfTgYKoZvS2TEvdYpWb