Repository navigation
[AUTOMATED] feat(p1): (NOVEL) itaniumrtti - recover the GCC/Clang C++ RTTI graph and its vtables, the analyzer Ghidra does not have - #267
Merged
Conversation
… RTTI graph and its vtables, the analyzer Ghidra does not have (DIV-64)
Ghidra has NO Itanium RTTI analyzer at all: its `RttiAnalyzer` is a Microsoft-PE
analyzer and its GCC class recovery is script-tier (RecoverClassesFromRTTIScript /
RTTIGccClassRecoverer), never auto-analysis, so on a stripped g++ binary it leaves
the Shape vtable as DAT_00107a80. IDA Pro does reconstruct it. kuna had ZERO
_ZTV/_ZTI/__class_type_info/__cxxabiv1 hits anywhere in decompiler/crates: the MSVC
half of C++ RTTI recovery was ported, the Itanium half never was, and the mechanism
does not transfer.
Discovery here is EXACT rather than a byte-pattern scan. The three __cxxabiv1
typeinfo vtables live in libstdc++, so every _ZTI object's leading vptr word is an
undefined-symbol dynamic relocation naming __class_type_info / __si_class_type_info /
__vmi_class_type_info with addend 2*ptr -- the relocation's r_offset IS the typeinfo
address and its symbol IS the flavour, and .rela.dyn is a loader input that
`strip --strip-all` cannot remove. This is not a convenience: in a PIE or shared
object the typeinfo's vptr word is 0 in the file, so the MSVC pass's own discovery
heuristic ("find the vptr the most TypeDescriptors agree on") recovers nothing on a
modern dynamically linked C++ binary.
Vtables are reached FROM the typeinfo rather than guessed -- one scan for pointer
slots holding a typeinfo address, filtered by two exact ABI constraints
(offset-to-top <= 0; at least one slot into an executable section) that reject 4/4
coincidental candidates on the probe. A slot reading 0 that carries a dynamic
relocation is an imported virtual method (__cxa_pure_virtual), so the walk steps over
it instead of truncating an abstract interface's vtable.
(NOVEL) covers the two things no other decompiler showed us the answer to: naming a
SECONDARY sub-vtable for the base subobject its inheritance displacement identifies
(Widget_vtable_for_Drawable, read off the __vmi base list -- the datum the MSVC path
discards with its pmd fields), and attributing an inherited slot to the class that
DEFINES it rather than to whichever vtable the scan reached first.
Witness: stripped g++ -O0 probe, 23 of 23 virtual methods across six classes, every
name matching the unstripped `nm -C` ground truth -- including the three
`non-virtual thunk to ...` entries, recovered as Widget::vtable_for_Drawable_0/1/2.
REACHABILITY (the reason for DIV-64). A default-off option is only half a decision:
`auto` selects `aggressive` below 500 KiB, which is the default path for
decompile-all, the kuna CLI, the web front-end and the benchmark, so an option
outside AGGRESSIVE_OVERRIDES never runs for anyone. This feature was first written in
exactly that state -- measured 0 recovered names under `--mode aggressive`, 29 with
an explicit `--option`. It now joins the preset, which is the preset's own documented
contract ("every off-by-default option flipped ON except v850indirectbranch and
dwarf_lines", with the format-gated no-ops rtti/pdb/objc/macho-arm64e/sparcstructret
named as the safe class); itaniumrtti has a strictly narrower firing condition than
rtti's PE gate. `--mode reliable` stays at 0, so the shipped defaults are untouched.
That invariant turned out to be only SAMPLED by a test, never enforced, which is why
the omission was silent. modes.rs::aggressive_carries_every_default_off_option now
enforces it and immediately found four further default-off options in the same trap
(cortexmvectors, ptrentry, tailcallentry, paramcopyhoist), recorded as an explicit
UNEVALUATED list rather than silently flipped -- each changes emitted C on the
binaries it fires for and needs its own sweep and PR.
No _LOADTIME_GATE_ENV entry is needed in scripts/decompile.py, verified rather than
assumed: #268 added that table because typedepth's DWARF types are CONSUMED inside
`load file`, while itaniumrtti commits its facts at `read symbols`, which every
`option` line precedes. The rule is now documented next to the table.
This does NOT move leveldb and cannot: libleveldb.so is built -fno-rtti (18 _ZTV
symbols, zero _ZTI, zero _ZTS, zero __cxxabiv1 relocations), so the pass emits
nothing -- verified by sweep, 3,962 functions at -O0 and 919 at -O2, 0 changed. The
separable vtable-only half was measured before scoping and rejected: of 126 slots in
the 17 defined _ZTV objects, 59 are __cxa_pure_virtual, 31 are unrelocated header
words, and every one of the remaining 36 already carries a .dynsym name -- zero
recoverable-but-unnamed methods. No benchmark number is claimed.
An adversarial probe (two template instantiations, a deep namespace, an
anonymous-namespace class) found two defects the good-citizen witness could not, and
fixing them took recovery there from 7 of 14 virtual methods to 14 of 14:
Vec<int>/Vec<double> collapsing to one class under name-only demangling (the second
then loses the idempotent name race and stays sub_<addr>, silently), and every
TU-local class being undemangleable because the ABI (2.9.1) prefixes its type-name
string with `*`. Both are now in the shipped fixture.
Sweep (pre-PR default path `--mode aggressive --option itaniumrtti off` vs post-PR
`--mode aggressive`, restricted to the <500 KiB binaries the preset applies to):
plain C 14 binaries / 357 functions 0 changed; C++ 8 binaries / 364 functions,
changed only the fixture and the two probes plus ONE hunk in cppproto_x86_64 that is
strictly better (`*(unsigned long *)this = 0x402028` -> `*(code **)this =
Shape_vptr`). Above the threshold at the option level: leveldb -O0 3,962 / -O2 919
and mcount_x86_64 1,073, all 0 changed. 0 new decompile errors, and the function
ENTRY set is byte-identical everywhere -- the pass names things, it never discovers
them.
Speed (interleaved, minimum of 15 pairs; 31 for the fire row). The number that
matters is the cost where it does NOT fire, which every user pays: +0.24% on
mcount_x86_64 (896 KiB static C, 1,969 symbols), +0.26% on stripped leveldb (1,546
dynamic relocations), +0.28% on regglobal_fmt_x86_64, and -0.38%..+0.25% end-to-end
under `--mode aggressive`. Where it does fire, +0.99% (vs +2.13% pre-preset in
isolation -- same work, larger denominator). Worst no-fire +0.28%, worst overall
+0.99%, budget 5%.
A NEW option rather than a widening of the PE-only `rtti`: the two paths have
different default-ON trajectories -- the MSVC path is a byte-pattern heuristic that
will plausibly stay opt-in forever, while this one is relocation-anchored and exact
with a measured 0-change footprint on 14 plain-C binaries. DIV-64 records the preset
membership, not the option default: `--mode reliable` is byte-identical, but mode
presets are not a datatest surface, so a membership change alters default rendering
where no parity oracle can see it -- exactly why DIV-43 exists for the symmetric
removal of dwarf_lines from the same preset.
Rebased onto d4a3fd2 (#268 typedepth), which added an option and made the identical
`92 -> 93` counter edit. git auto-merged catalog_bytecompat.rs and phase_catalog.json
with no conflict, leaving every counter short by one, and kuna_phases/tests.rs
conflicted only on the comment lines. Every counter was RE-DERIVED from a fresh green
build: settables 94, tiers (20 core, 41 transform, 33 analysis), catalog JSON rows 93;
phase_catalog.json recaptured from a fresh release decomp_dbg rather than hand-edited.
Gates: make test PARITY OK (675/675, no re-pin), make test-stages PARITY OK, make
rust-test green, make check-spec OK (lenient + strict), kuna catalog --check OK.
Covered by kuna-console/tests/verify_itaniumrtti.rs (7 two-pass e2e assertions over a
new stripped hidden-visibility fixture) plus 9 hermetic unit tests and the new
modes.rs preset invariant. No stage XML: the XML <binaryimage> datatest bootstrap
never produces an AnalysisOutput and cannot reach the analyzer tier, the same reason
cppsig / cppproto / fdeinterior / cppcallnames all use Rust integration tests.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01McQC7imaNfzj5k5AVumSYN
mahaloz
force-pushed
the
feat/itaniumrtti
branch
from
August 5, 2026 17:07
3835d5c to
41d338c
Compare
mahaloz
added a commit
that referenced
this pull request
Aug 5, 2026
…, preset decision Rebase onto #267 (`itaniumrtti`), which claimed DIV-64 and added an option. DIV-64 -> DIV-65. The counters are NOT arithmetic: `catalog_bytecompat.rs` auto-merged to 94 with no conflict, because #267 and this branch had each made the identical 93 -> 94 edit, so the committed value was silently short by one. Re-derived by capturing `phase_catalog.json` from a fresh release build and COUNTING it: 95 settables, tiers (20, 41, 34), 94 JSON rows -- and `docs/options.md` independently reports 95 option headings. The two generated artifacts (`phase_catalog.json`, `docs/options.md`) did merge line-by-line correctly; the trap was only in the hard-coded `.rs` counts. Preset decision, stated rather than left implicit: `libcsigs` is deliberately NOT in AGGRESSIVE_OVERRIDES. It ships default-ON, so #267's `aggressive_carries_every_default_off_option` invariant is out of scope for it -- and the liveness was measured, not assumed. On dircolors (55,680 bytes, so `auto` resolves to `aggressive`), default vs `--option libcsigs off` differs in 57/184 functions under auto, 57/184 aggressive, 58/183 reliable, 58/184 fast. Adding it would be worse than redundant: the preset OWNS an option it lists, and every benchmark and sweep number in this PR was produced by `--option libcsigs off` on sub-500 KiB binaries, i.e. straight through auto -> aggressive -- membership would silently re-enable it there and destroy the ablation hook. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01McQC7imaNfzj5k5AVumSYN
mahaloz
added a commit
that referenced
this pull request
Aug 5, 2026
…n (C type_match perfects 143 -> 165 over 2,092 functions, 137 improved / 3 worse) (DIV-65) (#269) * [AUTOMATED] feat(p1): libcsigs - the measured libc signature extension, 27 -> 233 prototypes kuna's built-in libc prototype table carries 27 entries. Its own header calls the shortfall a documented LOSS: Ghidra applies parsed C headers shipped as binary `.gdt` archives, that format is not vendored, and the table is "a faithful, minimal stand-in". The constraint is that no header archive exists in the tree, not licensing - so the table is small because nobody has grown it. Every libc callee outside those 27 leaves its callers' arguments an inferred `unsigned long`, and half of the 1587 cases where IDA scores a perfect C `type_match` and kuna does not have an integer-typed kuna parameter where IDA has a concrete type. `analyzers/protos/kuna_libcsigs.rs` adds the measured remainder: 206 further signatures, chosen by frequency rather than intuition (a PLT call-site histogram over the 547 frozen-decbench C binaries, plus a per-callee ranking of those 1587 cases; the rule is >= 100 sites or >= 3 cases). Every signature is reduced from a machine-readable declaration - `gcc -aux-info` over the platform headers with _GNU_SOURCE + _FORTIFY_SOURCE=2 for the bulk, GCC's builtin types for the FORTIFY `_chk` family, the `<stdio.h>` `__REDIRECT` for the `__isoc99_*` aliases - and a declaration whose every slot is not width-stable across ILP32/LP64 is REJECTED rather than approximated (`lseek`, `time`, `strtoll`, `fseeko`, `mmap`, `signal`, `qsort`), because a wrong prototype asserts a false type where `unsigned long` was merely uninformative. The same principle drives the one novel rule: an entry applies only to a name the image IMPORTS and does not itself define. zlib's `minigzip` declares `void error(const char *msg)` where glibc's is `void error(int,int,const char*,...)`, and typing that call `error(0,0,...)` would be strictly worse than what it replaces. The 27-entry base table's defined-or-imported matching is untouched. Behind `--option libcsigs on|off`, default ON; `off` renders exactly what the base table alone renders. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01McQC7imaNfzj5k5AVumSYN * [AUTOMATED] docs(libcsigs): DIV-64 row and the feature record The measured C `type_match` delta (decbench origin/main @325046f, DECBENCH_NO_CACHE=1, all three optimisation levels, option off vs on): grep 33 -> 37 perfects, diffutils 24 -> 35, gzip 57 -> 62, bzip2 mean 0.2617 -> 0.2712, findutils 21 -> 23. Pooled n=2,092: perfects 143 -> 165 (+22), mean 0.2272 -> 0.2501 (+10.1%), 137 functions improved against 3 worse. Renumbered to DIV-64 on the rebase onto #268, which claimed DIV-63. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01McQC7imaNfzj5k5AVumSYN * [AUTOMATED] fix(libcsigs): DIV-65, counters re-derived from a capture, preset decision Rebase onto #267 (`itaniumrtti`), which claimed DIV-64 and added an option. DIV-64 -> DIV-65. The counters are NOT arithmetic: `catalog_bytecompat.rs` auto-merged to 94 with no conflict, because #267 and this branch had each made the identical 93 -> 94 edit, so the committed value was silently short by one. Re-derived by capturing `phase_catalog.json` from a fresh release build and COUNTING it: 95 settables, tiers (20, 41, 34), 94 JSON rows -- and `docs/options.md` independently reports 95 option headings. The two generated artifacts (`phase_catalog.json`, `docs/options.md`) did merge line-by-line correctly; the trap was only in the hard-coded `.rs` counts. Preset decision, stated rather than left implicit: `libcsigs` is deliberately NOT in AGGRESSIVE_OVERRIDES. It ships default-ON, so #267's `aggressive_carries_every_default_off_option` invariant is out of scope for it -- and the liveness was measured, not assumed. On dircolors (55,680 bytes, so `auto` resolves to `aggressive`), default vs `--option libcsigs off` differs in 57/184 functions under auto, 57/184 aggressive, 58/183 reliable, 58/184 fast. Adding it would be worse than redundant: the preset OWNS an option it lists, and every benchmark and sweep number in this PR was produced by `--option libcsigs off` on sub-500 KiB binaries, i.e. straight through auto -> aggressive -- membership would silently re-enable it there and destroy the ablation hook. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01McQC7imaNfzj5k5AVumSYN --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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
Recovers the Itanium (GCC/Clang) C++ RTTI graph and the vtables it points at,
behind a new default-off
itaniumrttioption.This is a capability Ghidra does not have at all: its
RttiAnalyzeris aMicrosoft-PE analyzer and its GCC class recovery is script-tier
(
RecoverClassesFromRTTIScript/RTTIGccClassRecoverer), never auto-analysis — soon a stripped
g++binary Ghidra leaves theShapevtable asDAT_00107a80. IDAPro does reconstruct it. kuna had zero
_ZTV/_ZTI/__class_type_info/__cxxabiv1hits anywhere indecompiler/cratesbefore this PR: the MSVC half ofC++ RTTI recovery was ported, the Itanium half never was.
(NOVEL)covers the parts no other decompiler showed us the answer to: naming asecondary sub-vtable for the base subobject its inheritance displacement
identifies (
Widget_vtable_for_Drawable), and attributing an inherited slot tothe class that defines it rather than to whichever vtable the scan reached first.
The mechanism — an anchor, not a pattern scan
The MSVC sibling has to guess (byte-search
.rdatafor.?A, assumeref − 12is aCompleteObjectLocator). Itanium does not, because the three__cxxabiv1typeinfovtables live in libstdc++, so every
_ZTI…object's leading vptr word is anundefined-symbol dynamic relocation naming one of them with addend
2 × ptr:Six relocations, six typeinfo objects, zero false positives — and the symbol names
the flavour, which fixes the object's layout.
.rela.dynis a loader input, sostrip --strip-allcannot remove it.This is not a convenience, it is the only anchor that works. In a PIE or shared
object the typeinfo's vptr word is 0 in the file (the loader writes it), so the
MSVC pass's own discovery heuristic — "find the vptr value the most TypeDescriptors
agree on" — recovers nothing on a modern dynamically linked C++ binary.
Vtables are then reached from the typeinfo rather than guessed: one scan for
pointer slots holding a typeinfo address, filtered by two exact ABI constraints
(
offset-to-top ≤ 0; ≥ 1 slot into an executable section) that reject 4/4coincidental candidates on the probe. A slot that reads 0 but carries a dynamic
relocation is an imported virtual method (
__cxa_pure_virtual), so the walk stepsover it instead of truncating an abstract interface's vtable.
Witness — 23/23 against
nmground truthStripped
g++ -O0probe, six classes, every recovered name matching the unstrippednm -C:Shape::vtable_2/vtable_3Shape::area(int) const/Shape::perimeter() constCircle::vtable_2Circle::area(int) constWidget::vtable_2/vtable_3Widget::emit(int)/Widget::render(int)Widget::vtable_for_Drawable_0/1/2non-virtual thunk to …entriesShape::perimetersits at slot 3 ofShape's,Circle's andSquare's tables;the recovered base graph attributes it once, to
Shape.The most legible line is a multiple-inheritance constructor:
The benchmark: this does NOT move leveldb, and here is why
libleveldb.sois built-fno-rtti: 18_ZTVsymbols in.dynsym, zero_ZTI, zero_ZTS, zero__cxxabiv1relocations. No anchor exists, so thepass emits nothing — verified by sweep rather than asserted: leveldb
-O0stripped3,962 functions, 0 changed; leveldb
-O2stripped 919 functions, 0 changed.type_matchstays at 35/525. No benchmark number is claimed.The separable second capability — independent vtable detection from those 18
surviving
_ZTVsymbols — was measured before scoping and rejected:-O0stripped, the vtable half_ZTVobjects__cxa_pure_virtual.dynsymFUNC symbolThey are the abstract interface classes; the concrete implementations' vtables
carry no symbol. And an independent code-pointer-run scan of
.data.rel.roreports37 runs / 231 "functions", none matching any
.dynsymsymbol — on a PIE that scanmeasures relocation residue, which is exactly the mistyping failure mode. It is
deliberately not in this PR.
What an adversarial probe found that the witness could not
A hostile second binary (two template instantiations, a deep namespace, an
anonymous-namespace class) exposed two defects and took recovery there from 7 of 14
virtual methods to 14 of 14. Both are now in the shipped fixture:
Vec<int>andVec<double>both reduce to
Vecunder the module's name-only demangling; since the symbolcommit is an idempotent ADD, the second instantiation lost the name race and every
method stayed
sub_<addr>, silently. Template arguments are now folded into theidentifier (
Vec_int,Vec_double) with a depth-aware::split.anonymous-namespace class's type-name string with
*(compare by pointer, not bystring); that byte is not part of the mangled name, so the class never demangled.
Not a corner case — an anonymous-namespace class is how most C++ spells a concrete
implementation of an exported interface (leveldb's
PosixEnv).Sweep
Baseline is now the pre-PR default path (
--mode aggressive --option itaniumrtti off) versus the post-PR default path (plain--mode aggressive), restricted tobinaries under the 500 KiB
autothreshold — the ones the preset actually appliesto. (
mcount_x86_64at 875 KiB and leveldb at 675 KiB resolve toreliable, so thepreset never reaches them by default; both were swept at the option level anyway.)
0 body-changed, 0 new errors. Structural: a C binary emits no typeinfo, so there
is no relocation to anchor on.
and the two probes (23/30 and 14/17); plus exactly one hunk anywhere else, in
cppproto_x86_64, which is strictly better:-O0stripped 3,962functions 0 changed, leveldb
-O2919 0 changed,mcount_x86_64static C1,073 0 changed.
on every binary swept — the pass names things, it never discovers them.
Wrongness axis (attaching a wrong class name / naming a non-method), bounded
structurally: a candidate is rejected unless its name string demangles as
_ZTS<name>; every base pointer must resolve to an already-accepted typeinfo; andthe function-symbol commit is an idempotent
find_function-gated ADD, so a real.dynsym/.symtabname is never overwritten.Speed
Now that the option is a preset member, the number that matters is what it costs on
the binaries where it does not fire — that is the cost every user pays. Baseline
is the pre-PR default path (
--mode aggressive --option itaniumrtti off), treatmentis the post-PR default path. Interleaved, minimum of 15 pairs (31 for the fire
row), on a box shared with other agents.
functionsmcount_x86_64 (static C, 1,969 syms)functionsleveldb-O0 stripped (1,546 relocs)functionsregglobal_fmt_x86_64 (224 KiB C)decompile-allagg regglobal_fmt_x86_64 (C)decompile-allagg fmt_x86_64 (C)decompile-allagg fauxware (C)decompile-allagg cppsig_x86_64.so (C++, no RTTI)decompile-allagg itaniumrtti_x86_64.so (n=31)Worst no-fire cost +0.28%; worst overall +0.99%; budget 5%. The two rows the
coordinator asked for specifically — the
.rela.dyn/symbol scan on a large binarywith no typeinfo at all — are
mcount_x86_64(896 KiB static C, 1,969 symbols) at+0.24% and stripped leveldb (1,546 dynamic relocations) at +0.26%. The no-fire path
is one relocation-table walk plus one symbol walk, then an early return; discovery
now runs before any other structure is built precisely so that path stays cheap.
The fire row is +0.99% here versus +2.13% measured pre-preset in isolation — same
work, larger denominator, because under
aggressivethe baseline already carrieslisting,aif,funcstart_patternsand the rest. The preset-member figure is thehonest one for a default-path user.
Option + DIV decision
A new option, not a widening of the PE-only
rtti. The two paths have differentdefault-ON trajectories: the MSVC path is a byte-pattern heuristic that will
plausibly stay opt-in forever, while this one is relocation-anchored and exact with a
measured 0-change footprint on 14 plain-C binaries. Sharing one flag would chain the
sound recovery to the unsound one permanently. Secondarily the two are mutually
exclusive by format anyway (MSVC RTTI only in PE, Itanium only in ELF).
DIV-64 (#268 took DIV-63). The option diverges from nothing — its default is
offand--mode reliableis byte-identical. But preset membership makes it thedefault rendering on ELF C++ with RTTI, and mode presets are not a datatest
surface, so that is a default-output change no parity oracle can see. That is
exactly why DIV-43 exists for the symmetric case (removing
dwarf_linesfrom thesame preset). Without preset membership this would correctly carry no DIV row.
Gates
make testmake test-stagesmake rust-testmake check-spec--strict)kuna catalog --checkStructural, because the XML
<binaryimage>datatest bootstrap never runs theanalyzer tier and so cannot reach this pass.
Testing
decompiler/crates/kuna-console/tests/verify_itaniumrtti.rs— 7 two-pass e2eassertions over a new
strip --strip-allped,-fvisibility=hiddenfixture (hiddenvisibility is load-bearing: without it every implicit class method is emitted WEAK and
exported, so
.dynsymalone would name them and the test would prove nothing).Plus 9 hermetic unit tests. No stage XML — the XML datatest bootstrap never
produces an
AnalysisOutput, the same reasoncppsig/cppproto/fdeinterior/cppcallnamesall use Rust integration tests.Catalog counts were read off a fresh green build, never computed: settables 92 → 93,
tiers (20, 41, 31) → (20, 41, 32), catalog JSON rows 91 → 92, and
phase_catalog.jsonrecaptured from a fresh releasedecomp_dbgrather thanhand-edited.
Full bundle:
docs/features/itaniumrtti/{analysis,plan}.md+record.json.Reachability — this feature was first written INERT, and that is now fixed
A default-off option is only half a decision.
autoselectsaggressiveforanything under 500 KiB (DIV-40), which is the default path for
decompile-all, thekunaCLI, the web front-end and the benchmark — so an option outsideAGGRESSIVE_OVERRIDESnever runs for anyone. Measured on the shipped fixture:decompile-allinvocationauto→aggressive)--mode aggressive--mode reliable--option itaniumrtti onSo
itaniumrttijoins the preset. This is not a judgement call: the preset's owndoc-comment already reads "every off-by-default option flipped ON except
v850indirectbranchanddwarf_lines", and names the format-gated no-ops(
rtti/pdb= PE,objc/macho-arm64e= Mach-O,sparcstructret= SPARC) as thesafe class.
itaniumrttiis that shape with a strictly narrower firing conditionthan
rtti's: ELF and a.rela.dyncarrying__cxxabiv1typeinfo relocations.The invariant was sampled, not enforced — and four other options are in the same trap
aggressive_excludes_v850_and_dwarf_lines_but_includes_the_restonly checks fiverepresentative members, so it passes whether or not a newly added option was ever
put in the list. That is exactly how this shipped inert.
aggressive_carries_every_default_off_optionnow enforces the real contract — andimmediately found four further default-off options that are equally unreachable:
cortexmvectors,ptrentry,tailcallentry,paramcopyhoist.They are recorded in an explicit
UNEVALUATEDlist rather than silently flipped on:preset membership changes emitted C on the binaries an option fires for, so each
needs its own sweep and PR (
paramcopyhoist's own catalog row already records thatits flip regresses a stage assertion and was deferred). Shrinking that list is a
follow-up; the test makes each one a deliberate decision instead of an oversight.
No
_LOADTIME_GATE_ENVentry is needed — verified, not assumed#268 added that table because
typedepth's DWARF types are consumed insideload file, upstream of every consoleoptionline, so both arms of a demo renderedidentically.
itaniumrtticomputes its facts at load too, but commits them atread symbols(commit_pending_analysis→engine.rs::analysis_pass_enabled), andscripts/decompile.pyemits everyoptionline beforeread symbols. Thegenerated demo below renders
sub_14b8off andshapes::Shape::vtable_2on, so theconsole line does reach the gate. The rule is now documented next to the table:
consumed at load ⇒ needs an entry; committed at
read symbols⇒ does not.Rebase note — the counter collision with #268
mainmoved tod4a3fd2c(#268typedepth) mid-review. Both PRs add an option andboth made the identical
92 → 93edit to the same assertions. git auto-mergedcatalog_bytecompat.rsandphase_catalog.jsonwith no conflict, leaving everycounter short by one;
kuna_phases/tests.rsconflicted only on the comment lines,with the
assert_eq!numbers sitting outside the markers. Every counter wasre-derived from a fresh green build rather than incremented:
kuna catalog --json},\n)phase_catalog.json"option"/"tier"/"symptoms"phase_catalog.jsonphase_catalog.jsonwas recaptured from a fresh releasedecomp_dbg, nothand-edited.
Before / after —
shapes::Shape::vtable_2initaniumrtti_x86_64.soReal captured kuna output on the function this feature was built for, with
option itaniumrttiflipped. Ported from kuna — Itanium C++ ABI 2.9.5 / 2.5.2 (type_info + vtable layout); IDA Pro's GCC RTTI reconstruction. Ghidra has no equivalent analyzer -- this is NOVEL, not a port..itaniumrtti off(default)itaniumrtti onkuna — before (
option itaniumrtti off)kuna — after (
option itaniumrtti on)