tools(phase-35): T6 part 2 — the dead macro branches dropped from 12 live tools; the macro-form guard in tool_census --check (ast scan of every LIVE tool, FROZEN/retired/6 whitelisted detectors excluded; 0 LIVE tools reference the retired form; --guard-root negative control: the pre-T4 tree flags exactly the 12 fixed + 3 retired); progress.py: an empty-bodied included member is EMPTY, not folded into REAL (the R32 bucket assertion caught the double count) — the fleet denominator 363,221 -> 363,680 (+459: SC03_015's 219 single-site macros, SC03_118 +3, the never-extended members of five groups) and REAL 360,744 -> 350,533 with EMPTY up the same; progress.json + README block + fleet table regenerated; SETUP; kit corpus

This commit is contained in:
Drew T
2026-09-08 20:53:05 -06:00
parent 5a9f455e60
commit db63fcc673
37 changed files with 4615 additions and 954 deletions
+5
View File
@@ -0,0 +1,5 @@
.venv/bin/python tools/tool_census.py --all
tool_census: 295 tool files (find == git ls-files) + 38 retired; classes {'LIVE': 236, 'ORPHAN': 30, 'REFERENCED': 29, 'RETIRED': 38}; dictionary rows 333
tool_census: wrote docs/tool-index.md
tool_census: wrote decomp-architect/tools/MANIFEST.md
tool_census: corpus materialised — 361 verbatim copies, 30 pointers, INDEX.md
+5
View File
@@ -0,0 +1,5 @@
.venv/bin/python tools/tool_census.py --all
tool_census: 295 tool files (find == git ls-files) + 38 retired; classes {'LIVE': 236, 'ORPHAN': 30, 'REFERENCED': 29, 'RETIRED': 38}; dictionary rows 333
tool_census: wrote docs/tool-index.md
tool_census: wrote decomp-architect/tools/MANIFEST.md
tool_census: corpus materialised — 361 verbatim copies, 30 pointers, INDEX.md
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -18,12 +18,12 @@ originals; nothing "functionally equivalent" counts. What the repository claims
<!-- progress:begin -->
| Metric | Matched | Of | % |
|---|---:|---:|---:|
| Functions byte-identical (all binaries) | 363,221 | 363,221 | 100.00% |
| Functions byte-identical (all binaries) | 363,680 | 363,680 | 100.00% |
| Instructions byte-identical (instruction-weighted) | 13,492,113 | 13,492,113 | 100.0% |
| Distinct code byte-identical (each body once) | 5,820,205 | 5,820,205 | 100.0% |
| Main executable game code (excl. Sony objects) | 45,150 | 45,150 | 100.0% |
218 binaries rebuild byte-identical from source · 360,744 functions in C (255,632 of them shared bodies via 2,220 dedup groups) · 1,256 Sony PsyQ library functions linked from the SDK objects, not our C · 5 hand-written-assembly bodies kept verbatim · 0 assembly stubs left · 0 non-matching functions.
218 binaries rebuild byte-identical from source · 350,533 functions in C (249,873 of them shared bodies via 3,135 dedup groups) · 1,256 Sony PsyQ library functions linked from the SDK objects, not our C · 5 hand-written-assembly bodies kept verbatim · 0 assembly stubs left · 0 non-matching functions.
_Generated by `tools/progress.py --readme` from `docs/progress.json` — numbers are never typed by hand._
<!-- progress:end -->
@@ -339,7 +339,7 @@ def main():
'/* src/shared/engine_types.h — shared engine struct/union types + typedefs (Phase 15 §14c,',
' * Phase 20 typedef lift). Generated by tools/build_engine_types.py from the matched bodies',
' * in the source overlay. Defined ONCE here (0 same-name-different-layout collisions) so the',
' * struct/typedef-using shared functions propagate fleet-wide via engine_core.h. Included by',
' * struct/typedef-using shared functions share fleet-wide through the per-function headers under src/shared/ (Phase 35). Included by',
' * common.h consumers. */',
'#include "common.h"', '']
# forward decls first (lets pointer-only references resolve regardless of order)
@@ -33,7 +33,7 @@ import dup_report
import corpus
REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SHARED_INCLUDES = ("shared/engine_core.h", "shared/engine_prelude.h") # the macro-era header, then the Phase-35 prelude
SHARED_INCLUDES = ("shared/engine_prelude.h",) # the Phase-35 prelude (the macro-era header is gone, P35 T4/T6)
def onboarded():
@@ -377,6 +377,59 @@ def check_corpus(recs, files):
return gaps, len(copies), len(pointers)
# ----------------------------------------------------------------------------------------------------------------------------
# The macro-form guard (Phase 35 T6). The dedup macro form (`DEFINE_func_X()` sites expanding bodies from src/shared/engine_core.h)
# is retired: every shared body is a plain-C header included at its site. A LIVE tool that still names the form in CODE (a
# non-docstring string constant — a regex, a path, a message) is a tool that would parse or write the retired form; it must be
# fixed, FROZEN (status FROZEN: its command line refuses) or retired. Comments and docstrings are the record and may say anything.
# The detectors that name the form in order to REFUSE or CENSUS it are whitelisted by name — the list is the guard's own record.
GUARD_TOKENS = ("DEFINE_func_", "engine_core.h")
GUARD_WHITELIST = {
"tools/share_census.py": "the S1 census: counts macro sites so the invariant can assert 0 (and its selftest fixture uses the form)",
"tools/macro_to_header.py": "the T4 converter, kept as share_body's library (naming, banner, alias binding) and for the record",
"tools/share_body.py": "names the form in its refusal texts",
"tools/overlay_src_split.py": "detects a macro site only to REFUSE it (R43)",
"tools/gccmap_cites.py": "a citation datum (`engine_core.h:24926`) in the codegen map's cite table",
"tools/tool_census.py": "this guard",
}
def macro_form_guard(files, by_path, root=REPO):
"""(gaps, counts): every LIVE/STILL-NEEDED tool under `root` (FROZEN and retired excluded, the whitelist excluded) is parsed
with `ast`; a non-docstring string constant carrying a guard token is a gap. `root` is a parameter so the negative control can
point the guard at a worktree of the pre-conversion tree (R39)."""
import ast
gaps, counts = [], {"scanned": 0, "frozen": 0, "whitelisted": 0, "flagged": 0}
for f in files:
if not f.endswith(".py"):
continue
status = by_path.get(f, {}).get("status", "")
if status == "FROZEN":
counts["frozen"] += 1
continue
if f in GUARD_WHITELIST:
counts["whitelisted"] += 1
continue
p = root / f
if not p.exists():
continue
try:
tree = ast.parse(p.read_text(encoding="utf-8", errors="replace"))
except SyntaxError:
continue
counts["scanned"] += 1
docs = {ast.get_docstring(n, clean=False) for n in ast.walk(tree)
if isinstance(n, (ast.Module, ast.FunctionDef, ast.AsyncFunctionDef, ast.ClassDef))}
hits = sorted({n.lineno for n in ast.walk(tree)
if isinstance(n, ast.Constant) and isinstance(n.value, str) and n.value not in docs
and any(tok in n.value for tok in GUARD_TOKENS)})
if hits:
counts["flagged"] += 1
gaps.append(f"macro-form guard: LIVE tool {f} names the retired macro form in code at line(s) {hits[:6]} — fix it, "
f"freeze it (status FROZEN) or retire it")
return gaps, counts
def main():
ap = argparse.ArgumentParser()
ap.add_argument("--check", action="store_true")
@@ -384,7 +437,18 @@ def main():
ap.add_argument("--corpus", action="store_true")
ap.add_argument("--all", action="store_true")
ap.add_argument("--consumers", metavar="FILE")
ap.add_argument("--guard-root", metavar="DIR", help="run ONLY the macro-form guard against the tools/ under DIR (the R39 negative control)")
a = ap.parse_args()
if a.guard_root:
by_path = {r["path"]: r for r in read_dict()}
root = pathlib.Path(a.guard_root).resolve()
files = sorted(p.relative_to(root).as_posix() for p in (root / "tools").glob("*.py"))
g, c = macro_form_guard(files, by_path, root=root)
for x in g:
print(" GAP", x)
print(f"macro-form guard ({root}): {c['flagged']} LIVE tools reference the retired form ({c['scanned']} scanned, "
f"{c['frozen']} frozen, {c['whitelisted']} whitelisted)")
return 1 if g else 0
recs, files, retired, gaps = census()
if a.consumers:
rec = next((r for r in recs if r["path"] == a.consumers or r["path"].endswith("/" + a.consumers) or pathlib.Path(r["path"]).name == a.consumers), None)
@@ -408,6 +472,12 @@ def main():
gaps += cg
for g in cg:
print(" GAP", g)
gg, gc = macro_form_guard(files, {r["path"]: r for r in read_dict()})
gaps += gg
for g in gg:
print(" GAP", g)
print(f"macro-form guard: {gc['flagged']} LIVE tools reference the retired form ({gc['scanned']} scanned, {gc['frozen']} frozen, "
f"{gc['whitelisted']} whitelisted detectors, {len(retired)} retired)")
print(f"tool_census --check: corpus {nc} copies + {npt} pointers checked; {len(gaps)} gap(s)")
print("tool_census --check: OK" if not gaps else "tool_census --check: FAIL")
return 1 if gaps else 0
+4 -70
View File
@@ -106,7 +106,7 @@ GNU = {'__asm__', 'asm', '__attribute__', '__extension__', '__inline__'}
# Macro invocations that are NOT declarations in RAW draft/source text (they become declarations
# only after cpp). An EXPLICIT, NAMED exclusion list — the audit's rule: never let the exclusion set
# be "whatever the parser happened to choke on".
MACRO_STMT = re.compile(r'^\s*(INCLUDE_ASM|DEFINE_func_[0-9A-Fa-f]+|SETTER|RETCONST|CLEAR_TBL40)\b')
MACRO_STMT = re.compile(r'^\s*(INCLUDE_ASM)\b') # P35 T6: the dedup macro forms are gone; INCLUDE_ASM is the one macro statement left
class CDeclError(Exception):
@@ -1294,81 +1294,15 @@ def audit_differential():
scanner it replaces: any symbol an incumbent sees and this one does not is a defect in THIS
tool. The reverse (symbols only this one sees) is the measured size of the hole."""
sys.path.insert(0, os.path.join(REPO, 'tools'))
import gen_harvest_targets as ght
# reconcile_decls RETIRED (S45, R33): its DATA_DECL_LINE_RE row proved the superset for
# 26-A..S44; the incumbent is deleted, so the differential now compares the survivors only.
import sig_unify as su
ec = os.path.join(REPO, 'src/shared/engine_core.h')
if not os.path.exists(ec):
# P35 T6: the macro header is gone for good; the differential's only honest result is the statement below.
if True:
# Phase 35: the macro header is gone (per-function headers under src/shared/<space>/ hold plain C that tu_scope reads
# like any TU). The fifteen-incumbent differential was a comparison OVER MACRO TEXT; without that text it has nothing
# to compare against, and saying so is the honest result (R43 — never fabricate a synthetic TU from the new form).
print('[differential] src/shared/engine_core.h is absent (Phase 35): the macro-era differential no longer applies — OK')
print('[differential] the macro-era shared header is gone (Phase 35): the macro-era differential no longer applies — OK')
return True
text = open(ec).read()
# The incumbents scan engine_core.h's RAW TEXT — i.e. the bodies of 1,801 #define macros. A
# declaration in a macro body declares nothing until the macro is INVOKED (the §8c law), so the
# honest like-for-like comparison is against what cpp produces when every macro IS invoked.
# That synthetic TU is exactly "everything engine_core.h is capable of declaring".
d = os.path.join(REPO, 'src/shared')
tmp = os.path.join(d, '.cdecl_allmacros.c')
macros = re.findall(r'^#define\s+(DEFINE_func_[0-9A-Fa-f]+)\(\)', text, re.M)
with open(tmp, 'w') as f:
f.write('#include "../../include/common.h"\n#include "engine_types.h"\n'
'#include "engine_core.h"\n')
for mac in macros:
f.write(f'{mac}()\n')
try:
stmts = tu_statements(tmp)
mine = scope(stmts, tmp)
expanded = '\n'.join(stmts)
finally:
os.path.exists(tmp) and os.remove(tmp)
print(f'[differential] expanded {len(macros)} DEFINE_ macros through cpp -> {len(mine)} names')
mine_d = {n for n in mine if n.startswith('D_')}
rows = []
for name, rx in (('gen_harvest_targets.DATA_DECL_RE', ght.DATA_DECL_RE),
('sig_unify.DATA_DECL_RE', su.DATA_DECL_RE)):
theirs = set()
for m in rx.finditer(text):
theirs |= set(re.findall(r'\bD_[0-9A-Fa-f]+\b', m.group(0)))
# A symbol I do not report is only MY defect if it is genuinely at FILE scope. A
# block-scope `extern` is private to its function and is NOT part of the TU's namespace —
# reporting it as an authoritative canonical is what produced the §8d
# `conflicting types for D_801812A4` wall. So separate the two, and never let a real defect
# hide behind the excuse.
lost = theirs - mine_d
block = {s for s in lost if re.search(r'\bextern\b[^;]*\b' + s + r'\b', expanded)}
defect = lost - block
rows.append((name, len(theirs), len(mine_d), len(mine_d - theirs), sorted(defect),
sorted(block)))
print('[differential] engine_core.h — D_ symbols (raw-text scan vs cpp-expanded file scope)')
print(f' {"incumbent":<36} {"theirs":>7} {"cdecl":>7} {"cdecl-only":>11} {"MY DEFECT":>10} '
f'{"their block-scope error":>24}')
ok = True
for name, t, m, g, defect, block in rows:
print(f' {name:<36} {t:>7} {m:>7} {g:>11} {len(defect):>10} {len(block):>24}')
if defect:
print(f' DEFECT (file-scope, invisible to cdecl): {defect[:8]}')
if block:
print(f' they count BLOCK-scope externs as file-scope canonicals: {block[:4]}')
ok &= not defect
named = {'D_80127530': 'array', 'D_80127088': 'fnptr', 'D_8011DB28': 'fnptr',
'D_801274D0': 'fnptr', 'D_8018E858': 'fnptr_array'}
print(' the audit\'s named blind symbols (engine_core.h), now resolved WITH THEIR KIND:')
for n, want in named.items():
d = mine.get(n)
got = d.kind if d else 'MISSING'
flag = 'ok' if got == want else 'WRONG'
ok &= (got == want)
print(f' {n:<14} kind={got:<12} (expected {want}) [{flag}]'
+ (f' {d.type}' if d else ''))
return ok
def main():
@@ -55,7 +55,7 @@ TIERS = ("h_exact", "h_norm")
# OVER-APPROXIMATING by design (R32): any C identifier, not just func_<hex> — a curated symbol
# (e.g. listCdBuffer) is a stub too, and a `func_`-only pattern silently misses it.
INCLUDE_ASM_RE = re.compile(r'INCLUDE_ASM\([^)]*,\s*([A-Za-z_]\w*)\s*\)')
MACRO_FUNC_RE = re.compile(r'^(DEFINE_func_[0-9A-Fa-f]+|SETTER|RETCONST|CLEAR_TBL40)$') # the macro-form `func` tokens
PARAM_FUNC_RE = re.compile(r'^SHARED_FN$') # the parameterized include form's `func` token (P35; the macro forms are gone)
SYMBOL_LINE_RE = re.compile(r'^\s*([A-Za-z_]\w*)\s*=\s*(0x[0-9A-Fa-f]+)\s*;')
@@ -193,9 +193,9 @@ def check(groups, binary_filter=None, allow_unsigned=False):
f"body that was never written (the share was registered but never propagated)")
failures += 1; continue
# ---- C2a′ (Phase 35 T2): a PLAIN-C header source must DEFINE `func` (a token occurrence is not a body) --------
# The macro forms (DEFINE_func_*, SETTER/RETCONST/CLEAR_TBL40) define through cpp and keep the token check above;
# the include form is read by share_census.header_defs — the one reader of that form (R33).
if not MACRO_FUNC_RE.match(fn):
# The parameterized form (SHARED_FN) defines through cpp and keeps the token check above; every other source is a
# plain-C header read by share_census.header_defs — the one reader of that form (R33).
if not PARAM_FUNC_RE.match(fn):
sys.path.insert(0, str(ROOT / "tools"))
import share_census
defined = {n for n, _ in share_census.header_defs(ROOT / src)}
@@ -280,11 +280,10 @@ def write_digest(out):
# ---------------------------------------------------------------- wave slate
def seed_body_ref(bin_, addr):
"""Where the seed's C body lives: engine_core.h DEFINE_ macro, or the inline def's src file."""
"""Where the seed's C body lives: a shared per-function header under src/shared/ (Phase 35), or the inline def's src file."""
name = f"func_{addr:08X}"
core = "src/shared/engine_core.h"
if os.path.exists(core) and f"DEFINE_{name}(" in open(core).read():
return dict(kind="macro", path=core, name=name)
for hp in sorted(glob.glob(f"src/shared/*/{name}.h")) + sorted(glob.glob(f"src/shared/*/{name}__*.h")):
return dict(kind="header", path=hp, name=name)
for p in sorted(glob.glob(f"src/{bin_}/*.c")):
txt = open(p).read()
if re.search(rf"^[A-Za-z_][^\n=;]*\b{name}\s*\(", txt, re.M) and f"INCLUDE_ASM" not in \
@@ -38,7 +38,6 @@ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import shared_lock # Stage 1: --apply/--undo-journal write the fleet-shared header
REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
EC = os.path.join(REPO, 'src/shared/engine_core.h')
NARROW = re.compile(r'\b(char|short|signed\s+char|unsigned\s+char|unsigned\s+short|s8|u8|s16|u16|float|f32)\b')
@@ -157,7 +156,7 @@ def main():
'reconciliation for non-(void) conflicting forward-decls; byte-gate filters (G3/P9)')
ap.add_argument('--binary', help='ALSO scan+rewrite this overlay\'s own inline caller decls in '
'src/<binary>/<binary>*.c (a conflicting extern is often in the overlay src, not just '
'engine_core.h — the T6 integration-recovery gap). Default: engine_core.h only.')
'the shared headers under src/shared/ — the T6 integration-recovery gap). Default: the shared headers under src/shared/ only.')
ap.add_argument('--journal', metavar='PATH',
help='(apply) record each substitution\'s literal before/after to this JSON for '
'exact --undo-journal restore; written even when no edits were made')
@@ -177,7 +176,7 @@ def main():
sys.exit('no funcs given')
# target files: engine_core.h always; + the overlay's own src (inline callers) when --binary given.
files = sorted(set(([EC] if os.path.exists(EC) else []) + glob.glob(os.path.join(REPO, 'src/shared/**/*.h'), recursive=True))) # Phase 35: every shared header carries externs
files = sorted(set(glob.glob(os.path.join(REPO, 'src/shared/**/*.h'), recursive=True))) # Phase 35: every shared header carries externs
if a.binary:
# MAIN'S SOURCES DO NOT LIVE IN src/main/ (P31 S69). They are src/*.c — src/800.c, … — so the
# overlay-shaped glob matched NOTHING for --binary main and the tool reported success over an
@@ -641,10 +641,9 @@ def _provided_types(header):
paths = []
for inc in incs:
b = os.path.basename(inc)
if b == "engine_core.h":
# engine_core.h itself is NOT scanned: its typedefs live INSIDE `DEFINE_func_*()` macro
# bodies and reach a region only where that macro is invoked. What every includer gets at
# file scope is what engine_core.h #includes — engine_types.h + common.h (the legacy set).
if b == "engine_prelude.h":
# the Phase-35 prelude: what every overlay/module TU gets at file scope from the shared tree — engine_types.h +
# common.h (the legacy set; the per-function headers are included at their sites, not here)
paths += ["src/shared/engine_types.h", "include/common.h"]
elif b == "engine_types.h":
paths += ["src/shared/engine_types.h", "include/common.h"]
@@ -199,7 +199,7 @@ def main():
help='overlay SPLIT .c the drafts target (e.g. ov_SC01_077_a.c / _o0.c); default = '
'the main .c. Reads cur_stubs + inline/extern canonical sigs from THIS file so '
'split-file drafts are NOT dropped (they are stubs in the split, not the main .c) '
'and get the def-side arity-adopt recovery. engine_core.h is always included.')
'and get the def-side arity-adopt recovery. engine_prelude.h is always included.')
ap.add_argument('--in', dest='indir', required=True)
ap.add_argument('--out', dest='outdir', required=True)
args = ap.parse_args()
@@ -111,7 +111,7 @@ def fleet_pct():
def git_commit(msg):
sh(["git", "add", SRC, "src/shared/engine_core.h", "config/dedup.us.yaml"])
sh(["git", "add", SRC, "src/shared", "config/dedup.us.yaml"]) # P35 T6: the share writes headers under src/shared/
sh(["git", "commit", "-q", "-m", msg])
return sh(["git", "rev-parse", "--short", "HEAD"]).stdout.strip()
@@ -207,7 +207,7 @@ def fleet_pct():
def git_commit(banked_by_bin, propagated, fp):
add = ["src/shared/engine_core.h", "src/shared/engine_types.h", "config/dedup.us.yaml"]
add = ["src/shared", "config/dedup.us.yaml"] # P35 T6: the per-function headers live under src/shared/
for b in banked_by_bin:
add += [os.path.relpath(p, REPO) for p in glob.glob(os.path.join(REPO, "src/%s/%s*.c" % (b, b)))]
add += [os.path.relpath(p, REPO) for p in glob.glob(os.path.join(REPO, "src/ov_*/*.c"))] # propagation
@@ -150,14 +150,13 @@ def main():
region = os.path.relpath(os.path.join(root, f), os.path.join(REPO, 'src'))[:-2]
for fn, body in extract_defs(open(os.path.join(root, f)).read()).items():
defs.setdefault(fn, (body, region))
# corpus-v3: ALSO mine the shared DEFINE_func macro bodies (engine_core.h) — the setters/return-const/
# dispatchers the model is blind to (extract_defs sees only inline col-0 defs, not macro instantiations).
# corpus-v3 mined the shared macro bodies here; since Phase 35 the shared bodies are plain-C headers under src/shared/ —
# (a header body is one definition in one file; mine the headers directly).
n_inline = len(defs)
ec = os.path.join(REPO, 'src/shared/engine_core.h')
if os.path.exists(ec):
for fn, body in extract_macro_defs(open(ec).read()).items():
for hp in sorted(glob.glob(os.path.join(REPO, 'src/shared/*/func_*.h'))):
for fn, (body, _region) in extract_defs(open(hp).read()).items():
defs.setdefault(fn, (body, 'shared'))
print(' %d func defs in src (%d inline + %d shared macros)' % (
print(' %d func defs in src (%d inline + %d shared headers)' % (
len(defs), n_inline, len(defs) - n_inline), file=sys.stderr)
pairs, skipped = [], {'no_asm': 0}
@@ -233,7 +233,7 @@ def main():
if propagate:
if a.max_tier != "fleet" or not a.r22:
raise SystemExit(
"propagation is a FLEET-tier write (src/shared/engine_core.h + up to 138 overlay .c): "
"propagation is a FLEET-tier write (the shared headers under src/shared/ + up to 138 overlay .c): "
"it requires --max-tier fleet AND --r22, or pass --no-propagate (§65a).")
if "demacroize" in stages:
raise SystemExit(
@@ -313,8 +313,7 @@ def main():
# passes — `fix_arity_callers --revert` is LOSSY for --any-proto (it rewrites `()`->`(void)`, not
# back to the original `(a,b,c)`), which corrupts a non-bank whose caller passed args. So we
# snapshot/restore verbatim instead. (Bug caught by the clean-rebuild verify, R22.)
tu_files = [os.path.join(REPO, "src/shared/engine_core.h")] + \
sorted(glob.glob(os.path.join(REPO, f"src/{a.binary}/{a.binary}*.c")))
tu_files = sorted(glob.glob(os.path.join(REPO, f"src/{a.binary}/{a.binary}*.c"))) # P35 T6: no macro header to snapshot
snapshot = {f: open(f).read() for f in tu_files}
def restore():
+4 -1
View File
@@ -819,7 +819,10 @@ def report(binary, audit=False, write=True):
# _INCLUDED); it is still a shared body, so it counts in `shared`. A member parsed as a PRIVATE definition is not shared
# (a demacroized copy) — the registry is advisory, the source authoritative, as before.
members = dedup_members(BINARY)
shared = sorted((members - set(real) - set(stubs)) | (_INCLUDED & members))
# Phase 35 T6: an included member whose header body is EMPTY is classified `empty` by the include rule above and must NOT be
# folded into `real` as "shared" (pre-T4 the macro site was invisible and an empty shared body counted as real through this
# fold; the T6 health run put func_801EF790/func_801EF85C in BOTH buckets — the R32 assertion below caught it).
shared = sorted(((members - set(real) - set(stubs)) | (_INCLUDED & members)) - set(empty))
real = sorted(set(real) | set(shared))
# ---- COVERAGE ASSERTION (the rule ratified 2026-07-14: a scanner over the corpus must assert its
+12
View File
@@ -1539,6 +1539,18 @@ fills fast). Nothing is leaking — but the host does not get the memory back on
`gated N/N` line read, the phase-log entry appended, the bank committed (R42), the clean fleet run every N batches (R22, `218 passed,
0 failed of 218` required); stops on the first red; refuses a dirty `src/`/`config/`. Size a call under the 10-minute foreground cap
(a batch 40–100 s, a fleet run ≈ 90 s).
- **T6 (S96): the macro-era tools frozen or retired; the guard.** `tools/frozen.py` — the one refusal a FROZEN tool prints from its
`main()` (never at import: libraries stay importable — cdecl imports gen_harvest_targets, 18 tools import family_remap). Dictionary
status **FROZEN** (`tool_census` accepts it; the tool stays in `tools/`, its successor in the last column): family_sweep,
gen_harvest_targets, p16_improve, recover_giant, restore_dropped_decls, normalize_self_decls, o0_subsplit, inject_capped_externs,
aprop_autodraft, canon_sig_reconcile, conform_decls, blocker_probe, demacroize, family_remap (its command line; the library is live).
Retired to `tools/sunset/`: dedup_propagate + dedup_extend (→ share_body.py, which absorbed add_members_surgical and the load_sig
library surface verbatim), macro_draft, test_reconcile_ledger. **The macro-form guard** in `tool_census.py --check`: every LIVE
`.py` under tools/ (FROZEN, retired and the six whitelisted detectors excluded) is parsed with `ast`; a non-docstring string constant
carrying `DEFINE_func_` or `engine_core.h` is a gap — comments and docstrings are the record and may say anything. Its line reads
`macro-form guard: 0 LIVE tools reference the retired form (N scanned, 14 frozen, 6 whitelisted detectors, M retired)`.
`--guard-root DIR` runs only the guard against another tree's tools/ — the R39 negative control (a worktree of the pre-T4 commit
`0e38b51a3` flags exactly 15 tools: the twelve whose dead macro branches T6 removed and the three retired; none frozen or whitelisted).
- **Twin binaries (T3).** Five overlay pairs are one payload (equal `config/check.*.sha`): SC01_005/006, SC03_118/119, SC02_000/003,
SC04_018/019, SC03_014/015. The twin has NO source directory: `config/overlays.mk` declares `<twin>_TWIN_OF := <primary>` and
+178 -178
View File
@@ -4,17 +4,17 @@
# cross-binary collapsible-byte leverage: docs/duplicates.cross.md.
# THREE progress metrics (all matter — see the labels):
FLEET fn-count byte-ident: 363221 / 363221 = 100.00% (REAL+LINKED+empties; FUNCTION-count, ×134-inflated — one crack counts per overlay)
FLEET fn-count byte-ident: 363680 / 363680 = 100.00% (REAL+LINKED+empties; FUNCTION-count, ×134-inflated — one crack counts per overlay)
FLEET instr-weighted : 13492113 / 13492113 = 100.0% (shipped .text across main + resident + 216 overlays; the decomp.dev-DISPLAY number)
FLEET distinct-code(uniq): 5820205 / 5820205 = 100.0% (90984/90984 unique fns; the DISTINCT-RE number)
MAIN game-code weighted : 45150 / 45150 = 100.0% (INCLUDED in the fleet numbers above since 2026-07-22 — roadmap §1 metrics contract; build-derived sig (make sig-main) dated 2026-09-08; boundaries INDEPENDENTLY VERIFIED since P31 S77 — `make sig-main-oracle` + `make audit-corpus`: 0 phantom, 0 truncated, 0 pad-tail)
(fleet EXCLUDING main, for continuity with pre-2026-07-22 readings: 13446963 / 13446963 = 100.0%)
FLEET REAL substantive : 360744 (of which dedup-shared 255632 via 2220 groups / 255708 instances)
FLEET REAL substantive : 350533 (of which dedup-shared 249873 via 3135 groups / 260543 instances)
FLEET LINKED PsyQ objs : 1256
FLEET NON_MATCHING : 0 (0 in any default build — G4)
FLEET INCLUDE_ASM stubs : 0
FLEET matchable : 363221
FLEET matchable : 363680
| binary | REAL | shared | LINKED | byte-ident | matchable | byte-ident % |
|---|---:|---:|---:|---:|---:|---:|
@@ -26,34 +26,34 @@ FLEET matchable : 363221
| md_MAIN_008 | 6 | 0 | 0 | 6 | 6 | 100.0% |
| md_MAIN_009 | 11 | 0 | 0 | 12 | 12 | 100.0% |
| md_MAIN_011 | 20 | 0 | 0 | 21 | 21 | 100.0% |
| md_MAIN_013 | 16 | 0 | 0 | 16 | 16 | 100.0% |
| md_MAIN_014 | 12 | 0 | 0 | 13 | 13 | 100.0% |
| md_MAIN_013 | 16 | 1 | 0 | 16 | 16 | 100.0% |
| md_MAIN_014 | 12 | 1 | 0 | 13 | 13 | 100.0% |
| md_MAIN_015 | 20 | 1 | 0 | 20 | 20 | 100.0% |
| md_MAIN_016 | 11 | 0 | 0 | 12 | 12 | 100.0% |
| md_MAIN_017 | 10 | 0 | 0 | 10 | 10 | 100.0% |
| md_MAIN_017 | 10 | 1 | 0 | 10 | 10 | 100.0% |
| md_MAIN_018 | 10 | 0 | 0 | 11 | 11 | 100.0% |
| md_MAIN_019 | 22 | 0 | 0 | 22 | 22 | 100.0% |
| md_MAIN_020 | 13 | 0 | 0 | 14 | 14 | 100.0% |
| md_MAIN_021 | 10 | 0 | 0 | 11 | 11 | 100.0% |
| md_MAIN_022 | 31 | 0 | 0 | 33 | 33 | 100.0% |
| md_MAIN_019 | 22 | 1 | 0 | 22 | 22 | 100.0% |
| md_MAIN_020 | 13 | 1 | 0 | 14 | 14 | 100.0% |
| md_MAIN_021 | 10 | 1 | 0 | 11 | 11 | 100.0% |
| md_MAIN_022 | 31 | 1 | 0 | 33 | 33 | 100.0% |
| md_MAIN_023 | 5 | 1 | 0 | 6 | 6 | 100.0% |
| md_MAIN_024 | 4 | 0 | 0 | 6 | 6 | 100.0% |
| md_MAIN_024 | 4 | 1 | 0 | 6 | 6 | 100.0% |
| md_MAIN_025 | 30 | 0 | 0 | 30 | 30 | 100.0% |
| md_MAIN_026 | 24 | 0 | 0 | 24 | 24 | 100.0% |
| md_MAIN_027 | 27 | 0 | 0 | 29 | 29 | 100.0% |
| md_MAIN_028 | 22 | 0 | 0 | 22 | 22 | 100.0% |
| md_MAIN_026 | 24 | 1 | 0 | 24 | 24 | 100.0% |
| md_MAIN_027 | 27 | 1 | 0 | 29 | 29 | 100.0% |
| md_MAIN_028 | 22 | 1 | 0 | 22 | 22 | 100.0% |
| md_MAIN_029 | 10 | 0 | 0 | 11 | 11 | 100.0% |
| md_MAIN_030 | 10 | 0 | 0 | 10 | 10 | 100.0% |
| md_MAIN_030 | 10 | 1 | 0 | 10 | 10 | 100.0% |
| md_MAIN_031 | 18 | 0 | 0 | 18 | 18 | 100.0% |
| md_MAIN_032 | 10 | 1 | 0 | 10 | 10 | 100.0% |
| md_MAIN_033 | 19 | 0 | 0 | 19 | 19 | 100.0% |
| md_MAIN_033 | 19 | 1 | 0 | 19 | 19 | 100.0% |
| md_MAIN_034 | 27 | 0 | 0 | 28 | 28 | 100.0% |
| md_MAIN_035 | 15 | 0 | 0 | 16 | 16 | 100.0% |
| md_MAIN_036 | 27 | 0 | 0 | 28 | 28 | 100.0% |
| md_MAIN_035 | 15 | 1 | 0 | 16 | 16 | 100.0% |
| md_MAIN_036 | 27 | 1 | 0 | 28 | 28 | 100.0% |
| md_MAIN_037 | 17 | 0 | 0 | 17 | 17 | 100.0% |
| md_MAIN_038 | 20 | 0 | 0 | 20 | 20 | 100.0% |
| md_MAIN_038 | 20 | 1 | 0 | 20 | 20 | 100.0% |
| md_MAIN_039 | 26 | 0 | 0 | 26 | 26 | 100.0% |
| md_MAIN_040 | 19 | 0 | 0 | 19 | 19 | 100.0% |
| md_MAIN_040 | 19 | 1 | 0 | 19 | 19 | 100.0% |
| md_MAIN_041 | 15 | 1 | 0 | 15 | 15 | 100.0% |
| md_MAIN_042 | 4 | 0 | 0 | 4 | 4 | 100.0% |
| md_MAIN_043 | 22 | 0 | 0 | 23 | 23 | 100.0% |
@@ -65,174 +65,174 @@ FLEET matchable : 363221
| md_SC03_053 | 15 | 0 | 0 | 15 | 15 | 100.0% |
| md_SC03_054 | 7 | 0 | 0 | 7 | 7 | 100.0% |
| md_SC03_056 | 4 | 0 | 0 | 4 | 4 | 100.0% |
| md_SC03_073 | 28 | 10 | 0 | 28 | 28 | 100.0% |
| md_SC03_074 | 29 | 10 | 0 | 29 | 29 | 100.0% |
| md_SC03_075 | 41 | 10 | 0 | 41 | 41 | 100.0% |
| md_SC03_073 | 26 | 8 | 0 | 28 | 28 | 100.0% |
| md_SC03_074 | 27 | 8 | 0 | 29 | 29 | 100.0% |
| md_SC03_075 | 39 | 8 | 0 | 41 | 41 | 100.0% |
| md_SC03_076 | 64 | 0 | 0 | 66 | 66 | 100.0% |
| md_SC03_077 | 33 | 0 | 0 | 35 | 35 | 100.0% |
| md_SC03_078 | 27 | 9 | 0 | 27 | 27 | 100.0% |
| md_SC03_078 | 25 | 7 | 0 | 27 | 27 | 100.0% |
| md_SC03_079 | 27 | 0 | 0 | 29 | 29 | 100.0% |
| md_SC03_132 | 26 | 0 | 0 | 28 | 28 | 100.0% |
| md_SC03_133 | 27 | 1 | 0 | 29 | 29 | 100.0% |
| md_SC03_134 | 39 | 1 | 0 | 41 | 41 | 100.0% |
| md_SC03_133 | 27 | 3 | 0 | 29 | 29 | 100.0% |
| md_SC03_134 | 39 | 3 | 0 | 41 | 41 | 100.0% |
| md_SC03_135 | 64 | 0 | 0 | 66 | 66 | 100.0% |
| md_SC03_136 | 33 | 0 | 0 | 35 | 35 | 100.0% |
| md_SC03_137 | 25 | 1 | 0 | 27 | 27 | 100.0% |
| md_SC03_138 | 33 | 1 | 0 | 37 | 37 | 100.0% |
| md_SC03_137 | 25 | 3 | 0 | 27 | 27 | 100.0% |
| md_SC03_138 | 33 | 3 | 0 | 37 | 37 | 100.0% |
| md_SC04_024 | 26 | 0 | 0 | 28 | 28 | 100.0% |
| md_SC04_025 | 27 | 0 | 0 | 29 | 29 | 100.0% |
| md_SC04_026 | 39 | 0 | 0 | 41 | 41 | 100.0% |
| md_SC04_025 | 27 | 4 | 0 | 29 | 29 | 100.0% |
| md_SC04_026 | 39 | 4 | 0 | 41 | 41 | 100.0% |
| md_SC04_027 | 64 | 0 | 0 | 66 | 66 | 100.0% |
| md_SC04_028 | 33 | 0 | 0 | 35 | 35 | 100.0% |
| md_SC04_029 | 25 | 0 | 0 | 27 | 27 | 100.0% |
| md_SC04_030 | 27 | 0 | 0 | 31 | 31 | 100.0% |
| md_SC05_023 | 26 | 0 | 0 | 28 | 28 | 100.0% |
| md_SC05_024 | 27 | 0 | 0 | 29 | 29 | 100.0% |
| md_SC05_025 | 39 | 0 | 0 | 41 | 41 | 100.0% |
| md_SC04_029 | 25 | 3 | 0 | 27 | 27 | 100.0% |
| md_SC04_030 | 27 | 3 | 0 | 31 | 31 | 100.0% |
| md_SC05_023 | 26 | 3 | 0 | 28 | 28 | 100.0% |
| md_SC05_024 | 27 | 4 | 0 | 29 | 29 | 100.0% |
| md_SC05_025 | 39 | 4 | 0 | 41 | 41 | 100.0% |
| md_SC05_026 | 64 | 0 | 0 | 66 | 66 | 100.0% |
| md_SC05_027 | 33 | 0 | 0 | 35 | 35 | 100.0% |
| md_SC05_028 | 25 | 0 | 0 | 27 | 27 | 100.0% |
| md_SC05_029 | 27 | 0 | 0 | 31 | 31 | 100.0% |
| md_SC05_028 | 25 | 3 | 0 | 27 | 27 | 100.0% |
| md_SC05_029 | 27 | 3 | 0 | 31 | 31 | 100.0% |
| md_SC07_003 | 100 | 0 | 0 | 100 | 100 | 100.0% |
| md_SC07_004 | 315 | 0 | 0 | 315 | 315 | 100.0% |
| ov_MAIN_012 | 2323 | 1693 | 0 | 2402 | 2402 | 100.0% |
| ov_SC01_000 | 2403 | 1814 | 0 | 2403 | 2403 | 100.0% |
| ov_SC01_001 | 2464 | 1816 | 0 | 2466 | 2466 | 100.0% |
| ov_SC01_004 | 2413 | 1807 | 0 | 2414 | 2414 | 100.0% |
| ov_SC01_005 | 2503 | 1838 | 0 | 2503 | 2503 | 100.0% |
| ov_SC01_006 | 2503 | 1838 | 0 | 2503 | 2503 | 100.0% |
| ov_SC01_008 | 2424 | 1808 | 0 | 2426 | 2426 | 100.0% |
| ov_SC01_009 | 2506 | 1808 | 0 | 2507 | 2507 | 100.0% |
| ov_SC01_074 | 2424 | 1808 | 0 | 2426 | 2426 | 100.0% |
| ov_SC01_077 | 2584 | 1769 | 0 | 2586 | 2586 | 100.0% |
| ov_SC01_080 | 2512 | 1813 | 0 | 2512 | 2512 | 100.0% |
| ov_SC01_084 | 2574 | 1824 | 0 | 2579 | 2579 | 100.0% |
| ov_SC02_000 | 2683 | 1902 | 0 | 2683 | 2683 | 100.0% |
| ov_SC02_003 | 2683 | 1902 | 0 | 2683 | 2683 | 100.0% |
| ov_SC02_004 | 2401 | 1813 | 0 | 2401 | 2401 | 100.0% |
| ov_SC02_005 | 2916 | 1807 | 0 | 2926 | 2926 | 100.0% |
| ov_SC02_011 | 2883 | 1815 | 0 | 2893 | 2893 | 100.0% |
| ov_SC02_015 | 2414 | 1819 | 0 | 2414 | 2414 | 100.0% |
| ov_SC02_016 | 2542 | 1815 | 0 | 2545 | 2545 | 100.0% |
| ov_SC02_017 | 2724 | 1815 | 0 | 2732 | 2732 | 100.0% |
| ov_SC02_021 | 2437 | 1819 | 0 | 2437 | 2437 | 100.0% |
| ov_SC02_026 | 2566 | 1812 | 0 | 2572 | 2572 | 100.0% |
| ov_SC02_027 | 2683 | 1833 | 0 | 2692 | 2692 | 100.0% |
| ov_SC02_028 | 2691 | 1832 | 0 | 2701 | 2701 | 100.0% |
| ov_SC02_031 | 2557 | 1814 | 0 | 2562 | 2562 | 100.0% |
| ov_SC02_035 | 2517 | 1811 | 0 | 2520 | 2520 | 100.0% |
| ov_SC02_037 | 2434 | 1708 | 0 | 2516 | 2516 | 100.0% |
| ov_SC02_039 | 2416 | 1819 | 0 | 2416 | 2416 | 100.0% |
| ov_SC02_041 | 2558 | 1811 | 0 | 2561 | 2561 | 100.0% |
| ov_SC03_001 | 2852 | 1812 | 0 | 2869 | 2869 | 100.0% |
| ov_SC03_002 | 2616 | 1820 | 0 | 2631 | 2631 | 100.0% |
| ov_SC03_003 | 2422 | 1811 | 0 | 2423 | 2423 | 100.0% |
| ov_SC03_006 | 2758 | 1819 | 0 | 2767 | 2767 | 100.0% |
| ov_SC03_007 | 2619 | 1813 | 0 | 2623 | 2623 | 100.0% |
| ov_SC03_010 | 2471 | 1812 | 0 | 2471 | 2471 | 100.0% |
| ov_SC03_011 | 2521 | 1812 | 0 | 2527 | 2527 | 100.0% |
| ov_SC03_012 | 2405 | 1813 | 0 | 2406 | 2406 | 100.0% |
| ov_SC03_013 | 2493 | 1812 | 0 | 2493 | 2493 | 100.0% |
| ov_SC03_014 | 2685 | 1879 | 0 | 2685 | 2685 | 100.0% |
| ov_SC03_015 | 2468 | 1879 | 0 | 2468 | 2468 | 100.0% |
| ov_SC03_023 | 2434 | 1813 | 0 | 2435 | 2435 | 100.0% |
| ov_SC03_024 | 2634 | 1837 | 0 | 2641 | 2641 | 100.0% |
| ov_SC03_028 | 2660 | 1816 | 0 | 2664 | 2664 | 100.0% |
| ov_SC03_029 | 2634 | 1815 | 0 | 2644 | 2644 | 100.0% |
| ov_SC03_030 | 2493 | 1816 | 0 | 2495 | 2495 | 100.0% |
| ov_SC03_031 | 2511 | 1813 | 0 | 2514 | 2514 | 100.0% |
| ov_SC03_089 | 2574 | 1824 | 0 | 2581 | 2581 | 100.0% |
| ov_SC03_090 | 2617 | 1824 | 0 | 2625 | 2625 | 100.0% |
| ov_SC03_091 | 2632 | 1833 | 0 | 2640 | 2640 | 100.0% |
| ov_SC03_092 | 2576 | 1824 | 0 | 2588 | 2588 | 100.0% |
| ov_SC03_093 | 2560 | 1834 | 0 | 2563 | 2563 | 100.0% |
| ov_SC03_094 | 2571 | 1811 | 0 | 2577 | 2577 | 100.0% |
| ov_SC03_095 | 2471 | 1811 | 0 | 2474 | 2474 | 100.0% |
| ov_SC03_096 | 2462 | 1811 | 0 | 2465 | 2465 | 100.0% |
| ov_SC03_097 | 2596 | 1832 | 0 | 2603 | 2603 | 100.0% |
| ov_SC03_098 | 2538 | 1833 | 0 | 2541 | 2541 | 100.0% |
| ov_SC03_099 | 2501 | 1811 | 0 | 2504 | 2504 | 100.0% |
| ov_SC03_100 | 2535 | 1833 | 0 | 2539 | 2539 | 100.0% |
| ov_SC03_101 | 2524 | 1824 | 0 | 2528 | 2528 | 100.0% |
| ov_SC03_102 | 2489 | 1811 | 0 | 2492 | 2492 | 100.0% |
| ov_SC03_103 | 2507 | 1813 | 0 | 2510 | 2510 | 100.0% |
| ov_SC03_104 | 2609 | 1824 | 0 | 2616 | 2616 | 100.0% |
| ov_SC03_105 | 2590 | 1816 | 0 | 2597 | 2597 | 100.0% |
| ov_SC03_107 | 2414 | 1693 | 0 | 2497 | 2497 | 100.0% |
| ov_SC03_108 | 2443 | 1819 | 0 | 2443 | 2443 | 100.0% |
| ov_SC03_109 | 2422 | 1812 | 0 | 2424 | 2424 | 100.0% |
| ov_SC03_110 | 2468 | 1835 | 0 | 2468 | 2468 | 100.0% |
| ov_SC03_111 | 2507 | 1811 | 0 | 2510 | 2510 | 100.0% |
| ov_SC03_112 | 2524 | 1813 | 0 | 2526 | 2526 | 100.0% |
| ov_SC03_113 | 2465 | 1813 | 0 | 2468 | 2468 | 100.0% |
| ov_SC03_114 | 2413 | 1812 | 0 | 2415 | 2415 | 100.0% |
| ov_SC03_115 | 2470 | 1812 | 0 | 2472 | 2472 | 100.0% |
| ov_SC03_116 | 2435 | 1811 | 0 | 2438 | 2438 | 100.0% |
| ov_SC03_117 | 2551 | 1811 | 0 | 2557 | 2557 | 100.0% |
| ov_SC03_118 | 2683 | 1869 | 0 | 2684 | 2684 | 100.0% |
| ov_SC03_119 | 2684 | 1869 | 0 | 2685 | 2685 | 100.0% |
| ov_SC03_121 | 2457 | 1812 | 0 | 2459 | 2459 | 100.0% |
| ov_SC03_124 | 2721 | 1807 | 0 | 2741 | 2741 | 100.0% |
| ov_SC03_125 | 2576 | 1820 | 0 | 2588 | 2588 | 100.0% |
| ov_SC03_126 | 2423 | 1815 | 0 | 2423 | 2423 | 100.0% |
| ov_SC04_000 | 2537 | 1816 | 0 | 2546 | 2546 | 100.0% |
| ov_SC04_002 | 2632 | 1811 | 0 | 2636 | 2636 | 100.0% |
| ov_SC04_003 | 2499 | 1818 | 0 | 2502 | 2502 | 100.0% |
| ov_SC04_004 | 2556 | 1812 | 0 | 2558 | 2558 | 100.0% |
| ov_SC04_005 | 2606 | 1811 | 0 | 2612 | 2612 | 100.0% |
| ov_SC04_006 | 2452 | 1817 | 0 | 2454 | 2454 | 100.0% |
| ov_SC04_007 | 2565 | 1812 | 0 | 2569 | 2569 | 100.0% |
| ov_SC04_008 | 2415 | 1811 | 0 | 2415 | 2415 | 100.0% |
| ov_SC04_009 | 2438 | 1811 | 0 | 2441 | 2441 | 100.0% |
| ov_SC04_010 | 2418 | 1811 | 0 | 2419 | 2419 | 100.0% |
| ov_SC04_011 | 2798 | 1824 | 0 | 2804 | 2804 | 100.0% |
| ov_SC04_012 | 2419 | 1811 | 0 | 2420 | 2420 | 100.0% |
| ov_SC04_015 | 2600 | 1812 | 0 | 2611 | 2611 | 100.0% |
| ov_SC04_016 | 2438 | 1812 | 0 | 2440 | 2440 | 100.0% |
| ov_SC04_018 | 2857 | 1896 | 0 | 2857 | 2857 | 100.0% |
| ov_SC04_019 | 2857 | 1899 | 0 | 2857 | 2857 | 100.0% |
| ov_SC04_020 | 2555 | 1820 | 0 | 2567 | 2567 | 100.0% |
| ov_SC04_021 | 2423 | 1815 | 0 | 2423 | 2423 | 100.0% |
| ov_SC05_000 | 2419 | 1815 | 0 | 2422 | 2422 | 100.0% |
| ov_SC05_001 | 2569 | 1813 | 0 | 2574 | 2574 | 100.0% |
| ov_SC05_002 | 2439 | 1811 | 0 | 2442 | 2442 | 100.0% |
| ov_SC05_003 | 2480 | 1811 | 0 | 2481 | 2481 | 100.0% |
| ov_SC05_004 | 2462 | 1811 | 0 | 2464 | 2464 | 100.0% |
| ov_SC05_005 | 2490 | 1825 | 0 | 2491 | 2491 | 100.0% |
| ov_SC05_006 | 2430 | 1813 | 0 | 2430 | 2430 | 100.0% |
| ov_SC05_007 | 2477 | 1812 | 0 | 2482 | 2482 | 100.0% |
| ov_SC05_008 | 2541 | 1812 | 0 | 2543 | 2543 | 100.0% |
| ov_SC05_009 | 2434 | 1811 | 0 | 2438 | 2438 | 100.0% |
| ov_SC05_010 | 2584 | 1816 | 0 | 2588 | 2588 | 100.0% |
| ov_SC05_011 | 2408 | 1812 | 0 | 2409 | 2409 | 100.0% |
| ov_SC05_017 | 2831 | 1811 | 0 | 2842 | 2842 | 100.0% |
| ov_SC05_018 | 2660 | 1819 | 0 | 2673 | 2673 | 100.0% |
| ov_SC05_019 | 2423 | 1815 | 0 | 2423 | 2423 | 100.0% |
| ov_SC06_000 | 2688 | 1841 | 0 | 2691 | 2691 | 100.0% |
| ov_SC06_006 | 2510 | 1813 | 0 | 2511 | 2511 | 100.0% |
| ov_SC06_008 | 2536 | 1813 | 0 | 2542 | 2542 | 100.0% |
| ov_SC06_010 | 2512 | 1811 | 0 | 2517 | 2517 | 100.0% |
| ov_SC06_011 | 2464 | 1811 | 0 | 2468 | 2468 | 100.0% |
| ov_SC06_013 | 2424 | 1811 | 0 | 2425 | 2425 | 100.0% |
| ov_SC06_014 | 2451 | 1811 | 0 | 2453 | 2453 | 100.0% |
| ov_SC06_015 | 2421 | 1811 | 0 | 2421 | 2421 | 100.0% |
| ov_SC06_016 | 2547 | 1816 | 0 | 2549 | 2549 | 100.0% |
| ov_SC06_018 | 2658 | 1812 | 0 | 2665 | 2665 | 100.0% |
| ov_SC06_020 | 2517 | 1813 | 0 | 2518 | 2518 | 100.0% |
| ov_SC06_022 | 2634 | 1811 | 0 | 2642 | 2642 | 100.0% |
| ov_SC06_024 | 2661 | 1811 | 0 | 2667 | 2667 | 100.0% |
| ov_SC06_025 | 2567 | 1811 | 0 | 2572 | 2572 | 100.0% |
| ov_SC06_027 | 2407 | 1811 | 0 | 2408 | 2408 | 100.0% |
| ov_SC06_029 | 2651 | 1816 | 0 | 2663 | 2663 | 100.0% |
| ov_SC06_030 | 2456 | 1816 | 0 | 2456 | 2456 | 100.0% |
| ov_SC06_032 | 2651 | 1812 | 0 | 2658 | 2658 | 100.0% |
| ov_SC06_033 | 2623 | 1812 | 0 | 2630 | 2630 | 100.0% |
| ov_SC07_000 | 2519 | 1816 | 0 | 2521 | 2521 | 100.0% |
| ov_SC07_001 | 2452 | 1812 | 0 | 2454 | 2454 | 100.0% |
| ov_SC07_002 | 2575 | 1816 | 0 | 2579 | 2579 | 100.0% |
| ov_SC07_006 | 2378 | 1630 | 0 | 2458 | 2458 | 100.0% |
| ov_SC07_007 | 2530 | 1666 | 0 | 2613 | 2613 | 100.0% |
| ov_SC07_008 | 2386 | 1812 | 0 | 2386 | 2386 | 100.0% |
| ov_SC07_009 | 2428 | 1811 | 0 | 2430 | 2430 | 100.0% |
| ov_SC07_010 | 2442 | 1689 | 0 | 2524 | 2524 | 100.0% |
| ov_SC07_011 | 2369 | 1664 | 0 | 2449 | 2449 | 100.0% |
| ov_MAIN_012 | 2323 | 1720 | 0 | 2402 | 2402 | 100.0% |
| ov_SC01_000 | 2324 | 1747 | 0 | 2403 | 2403 | 100.0% |
| ov_SC01_001 | 2385 | 1749 | 0 | 2466 | 2466 | 100.0% |
| ov_SC01_004 | 2340 | 1748 | 0 | 2416 | 2416 | 100.0% |
| ov_SC01_005 | 2421 | 1767 | 0 | 2503 | 2503 | 100.0% |
| ov_SC01_006 | 2421 | 1767 | 0 | 2503 | 2503 | 100.0% |
| ov_SC01_008 | 2351 | 1749 | 0 | 2428 | 2428 | 100.0% |
| ov_SC01_009 | 2433 | 1749 | 0 | 2509 | 2509 | 100.0% |
| ov_SC01_074 | 2351 | 1749 | 0 | 2428 | 2428 | 100.0% |
| ov_SC01_077 | 2505 | 1748 | 0 | 2586 | 2586 | 100.0% |
| ov_SC01_080 | 2435 | 1752 | 0 | 2514 | 2514 | 100.0% |
| ov_SC01_084 | 2497 | 1761 | 0 | 2581 | 2581 | 100.0% |
| ov_SC02_000 | 2597 | 1830 | 0 | 2683 | 2683 | 100.0% |
| ov_SC02_003 | 2597 | 1830 | 0 | 2683 | 2683 | 100.0% |
| ov_SC02_004 | 2324 | 1752 | 0 | 2403 | 2403 | 100.0% |
| ov_SC02_005 | 2843 | 1748 | 0 | 2928 | 2928 | 100.0% |
| ov_SC02_011 | 2804 | 1750 | 0 | 2895 | 2895 | 100.0% |
| ov_SC02_015 | 2337 | 1756 | 0 | 2416 | 2416 | 100.0% |
| ov_SC02_016 | 2465 | 1764 | 0 | 2547 | 2547 | 100.0% |
| ov_SC02_017 | 2647 | 1764 | 0 | 2734 | 2734 | 100.0% |
| ov_SC02_021 | 2360 | 1756 | 0 | 2439 | 2439 | 100.0% |
| ov_SC02_026 | 2489 | 1750 | 0 | 2574 | 2574 | 100.0% |
| ov_SC02_027 | 2606 | 1770 | 0 | 2694 | 2694 | 100.0% |
| ov_SC02_028 | 2614 | 1769 | 0 | 2703 | 2703 | 100.0% |
| ov_SC02_031 | 2479 | 1764 | 0 | 2564 | 2564 | 100.0% |
| ov_SC02_035 | 2440 | 1750 | 0 | 2522 | 2522 | 100.0% |
| ov_SC02_037 | 2434 | 1741 | 0 | 2516 | 2516 | 100.0% |
| ov_SC02_039 | 2339 | 1756 | 0 | 2418 | 2418 | 100.0% |
| ov_SC02_041 | 2481 | 1750 | 0 | 2563 | 2563 | 100.0% |
| ov_SC03_001 | 2776 | 1750 | 0 | 2869 | 2869 | 100.0% |
| ov_SC03_002 | 2536 | 1753 | 0 | 2631 | 2631 | 100.0% |
| ov_SC03_003 | 2345 | 1756 | 0 | 2425 | 2425 | 100.0% |
| ov_SC03_006 | 2679 | 1764 | 0 | 2767 | 2767 | 100.0% |
| ov_SC03_007 | 2542 | 1752 | 0 | 2625 | 2625 | 100.0% |
| ov_SC03_010 | 2394 | 1759 | 0 | 2473 | 2473 | 100.0% |
| ov_SC03_011 | 2444 | 1757 | 0 | 2529 | 2529 | 100.0% |
| ov_SC03_012 | 2328 | 1752 | 0 | 2408 | 2408 | 100.0% |
| ov_SC03_013 | 2416 | 1759 | 0 | 2495 | 2495 | 100.0% |
| ov_SC03_014 | 2598 | 1808 | 0 | 2687 | 2687 | 100.0% |
| ov_SC03_015 | 2598 | 1808 | 0 | 2687 | 2687 | 100.0% |
| ov_SC03_023 | 2357 | 1752 | 0 | 2437 | 2437 | 100.0% |
| ov_SC03_024 | 2552 | 1771 | 0 | 2643 | 2643 | 100.0% |
| ov_SC03_028 | 2583 | 1754 | 0 | 2666 | 2666 | 100.0% |
| ov_SC03_029 | 2557 | 1764 | 0 | 2646 | 2646 | 100.0% |
| ov_SC03_030 | 2416 | 1754 | 0 | 2497 | 2497 | 100.0% |
| ov_SC03_031 | 2434 | 1764 | 0 | 2516 | 2516 | 100.0% |
| ov_SC03_089 | 2497 | 1761 | 0 | 2583 | 2583 | 100.0% |
| ov_SC03_090 | 2540 | 1761 | 0 | 2627 | 2627 | 100.0% |
| ov_SC03_091 | 2555 | 1770 | 0 | 2642 | 2642 | 100.0% |
| ov_SC03_092 | 2499 | 1763 | 0 | 2590 | 2590 | 100.0% |
| ov_SC03_093 | 2482 | 1770 | 0 | 2565 | 2565 | 100.0% |
| ov_SC03_094 | 2494 | 1748 | 0 | 2579 | 2579 | 100.0% |
| ov_SC03_095 | 2394 | 1750 | 0 | 2476 | 2476 | 100.0% |
| ov_SC03_096 | 2385 | 1750 | 0 | 2467 | 2467 | 100.0% |
| ov_SC03_097 | 2519 | 1769 | 0 | 2605 | 2605 | 100.0% |
| ov_SC03_098 | 2461 | 1770 | 0 | 2543 | 2543 | 100.0% |
| ov_SC03_099 | 2424 | 1750 | 0 | 2506 | 2506 | 100.0% |
| ov_SC03_100 | 2458 | 1770 | 0 | 2541 | 2541 | 100.0% |
| ov_SC03_101 | 2447 | 1761 | 0 | 2530 | 2530 | 100.0% |
| ov_SC03_102 | 2412 | 1748 | 0 | 2494 | 2494 | 100.0% |
| ov_SC03_103 | 2430 | 1750 | 0 | 2512 | 2512 | 100.0% |
| ov_SC03_104 | 2532 | 1761 | 0 | 2618 | 2618 | 100.0% |
| ov_SC03_105 | 2513 | 1754 | 0 | 2599 | 2599 | 100.0% |
| ov_SC03_107 | 2414 | 1720 | 0 | 2497 | 2497 | 100.0% |
| ov_SC03_108 | 2366 | 1756 | 0 | 2445 | 2445 | 100.0% |
| ov_SC03_109 | 2345 | 1750 | 0 | 2426 | 2426 | 100.0% |
| ov_SC03_110 | 2391 | 1772 | 0 | 2470 | 2470 | 100.0% |
| ov_SC03_111 | 2430 | 1748 | 0 | 2512 | 2512 | 100.0% |
| ov_SC03_112 | 2447 | 1750 | 0 | 2528 | 2528 | 100.0% |
| ov_SC03_113 | 2388 | 1750 | 0 | 2470 | 2470 | 100.0% |
| ov_SC03_114 | 2336 | 1751 | 0 | 2417 | 2417 | 100.0% |
| ov_SC03_115 | 2393 | 1751 | 0 | 2474 | 2474 | 100.0% |
| ov_SC03_116 | 2358 | 1748 | 0 | 2440 | 2440 | 100.0% |
| ov_SC03_117 | 2474 | 1748 | 0 | 2559 | 2559 | 100.0% |
| ov_SC03_118 | 2595 | 1796 | 0 | 2687 | 2687 | 100.0% |
| ov_SC03_119 | 2595 | 1796 | 0 | 2687 | 2687 | 100.0% |
| ov_SC03_121 | 2379 | 1749 | 0 | 2461 | 2461 | 100.0% |
| ov_SC03_124 | 2648 | 1750 | 0 | 2743 | 2743 | 100.0% |
| ov_SC03_125 | 2499 | 1758 | 0 | 2590 | 2590 | 100.0% |
| ov_SC03_126 | 2345 | 2252 | 0 | 2425 | 2425 | 100.0% |
| ov_SC04_000 | 2458 | 1761 | 0 | 2546 | 2546 | 100.0% |
| ov_SC04_002 | 2555 | 1763 | 0 | 2638 | 2638 | 100.0% |
| ov_SC04_003 | 2421 | 1754 | 0 | 2504 | 2504 | 100.0% |
| ov_SC04_004 | 2479 | 1763 | 0 | 2560 | 2560 | 100.0% |
| ov_SC04_005 | 2529 | 1763 | 0 | 2614 | 2614 | 100.0% |
| ov_SC04_006 | 2375 | 1754 | 0 | 2456 | 2456 | 100.0% |
| ov_SC04_007 | 2488 | 1763 | 0 | 2571 | 2571 | 100.0% |
| ov_SC04_008 | 2338 | 2031 | 0 | 2417 | 2417 | 100.0% |
| ov_SC04_009 | 2361 | 1748 | 0 | 2443 | 2443 | 100.0% |
| ov_SC04_010 | 2341 | 1749 | 0 | 2421 | 2421 | 100.0% |
| ov_SC04_011 | 2721 | 1761 | 0 | 2806 | 2806 | 100.0% |
| ov_SC04_012 | 2342 | 1748 | 0 | 2422 | 2422 | 100.0% |
| ov_SC04_015 | 2522 | 1748 | 0 | 2613 | 2613 | 100.0% |
| ov_SC04_016 | 2361 | 1752 | 0 | 2442 | 2442 | 100.0% |
| ov_SC04_018 | 2769 | 1825 | 0 | 2857 | 2857 | 100.0% |
| ov_SC04_019 | 2769 | 1825 | 0 | 2857 | 2857 | 100.0% |
| ov_SC04_020 | 2478 | 1758 | 0 | 2569 | 2569 | 100.0% |
| ov_SC04_021 | 2345 | 2253 | 0 | 2425 | 2425 | 100.0% |
| ov_SC05_000 | 2340 | 1749 | 0 | 2422 | 2422 | 100.0% |
| ov_SC05_001 | 2492 | 1764 | 0 | 2576 | 2576 | 100.0% |
| ov_SC05_002 | 2362 | 1750 | 0 | 2444 | 2444 | 100.0% |
| ov_SC05_003 | 2403 | 1750 | 0 | 2483 | 2483 | 100.0% |
| ov_SC05_004 | 2385 | 1749 | 0 | 2466 | 2466 | 100.0% |
| ov_SC05_005 | 2413 | 1764 | 0 | 2493 | 2493 | 100.0% |
| ov_SC05_006 | 2353 | 1762 | 0 | 2432 | 2432 | 100.0% |
| ov_SC05_007 | 2400 | 1751 | 0 | 2484 | 2484 | 100.0% |
| ov_SC05_008 | 2464 | 1749 | 0 | 2545 | 2545 | 100.0% |
| ov_SC05_009 | 2357 | 2030 | 0 | 2440 | 2440 | 100.0% |
| ov_SC05_010 | 2507 | 1754 | 0 | 2590 | 2590 | 100.0% |
| ov_SC05_011 | 2331 | 1752 | 0 | 2411 | 2411 | 100.0% |
| ov_SC05_017 | 2757 | 1753 | 0 | 2844 | 2844 | 100.0% |
| ov_SC05_018 | 2583 | 1757 | 0 | 2675 | 2675 | 100.0% |
| ov_SC05_019 | 2345 | 2253 | 0 | 2425 | 2425 | 100.0% |
| ov_SC06_000 | 2604 | 1771 | 0 | 2691 | 2691 | 100.0% |
| ov_SC06_006 | 2433 | 1750 | 0 | 2513 | 2513 | 100.0% |
| ov_SC06_008 | 2459 | 1750 | 0 | 2544 | 2544 | 100.0% |
| ov_SC06_010 | 2435 | 1748 | 0 | 2519 | 2519 | 100.0% |
| ov_SC06_011 | 2387 | 1748 | 0 | 2470 | 2470 | 100.0% |
| ov_SC06_013 | 2347 | 1748 | 0 | 2427 | 2427 | 100.0% |
| ov_SC06_014 | 2374 | 1750 | 0 | 2455 | 2455 | 100.0% |
| ov_SC06_015 | 2344 | 1750 | 0 | 2423 | 2423 | 100.0% |
| ov_SC06_016 | 2470 | 1754 | 0 | 2551 | 2551 | 100.0% |
| ov_SC06_018 | 2580 | 1750 | 0 | 2667 | 2667 | 100.0% |
| ov_SC06_020 | 2440 | 1754 | 0 | 2520 | 2520 | 100.0% |
| ov_SC06_022 | 2557 | 1748 | 0 | 2644 | 2644 | 100.0% |
| ov_SC06_024 | 2584 | 1748 | 0 | 2669 | 2669 | 100.0% |
| ov_SC06_025 | 2490 | 1748 | 0 | 2574 | 2574 | 100.0% |
| ov_SC06_027 | 2330 | 1748 | 0 | 2410 | 2410 | 100.0% |
| ov_SC06_029 | 2574 | 1754 | 0 | 2665 | 2665 | 100.0% |
| ov_SC06_030 | 2379 | 1754 | 0 | 2458 | 2458 | 100.0% |
| ov_SC06_032 | 2574 | 1753 | 0 | 2660 | 2660 | 100.0% |
| ov_SC06_033 | 2546 | 1751 | 0 | 2632 | 2632 | 100.0% |
| ov_SC07_000 | 2440 | 1750 | 0 | 2521 | 2521 | 100.0% |
| ov_SC07_001 | 2375 | 1750 | 0 | 2456 | 2456 | 100.0% |
| ov_SC07_002 | 2498 | 1754 | 0 | 2581 | 2581 | 100.0% |
| ov_SC07_006 | 2379 | 1714 | 0 | 2459 | 2459 | 100.0% |
| ov_SC07_007 | 2530 | 1728 | 0 | 2614 | 2614 | 100.0% |
| ov_SC07_008 | 2309 | 1749 | 0 | 2388 | 2388 | 100.0% |
| ov_SC07_009 | 2351 | 1748 | 0 | 2432 | 2432 | 100.0% |
| ov_SC07_010 | 2443 | 1739 | 0 | 2526 | 2526 | 100.0% |
| ov_SC07_011 | 2370 | 1727 | 0 | 2450 | 2450 | 100.0% |
+567 -567
View File
File diff suppressed because it is too large Load Diff
+7 -7
View File
@@ -144,7 +144,7 @@ then what proved it. The same data generates the day-one kit's manifest and its
| name the one exemplar to draft per structural family, ranked | `family_manifest.py` | Ranked structural-family target manifest naming the one exemplar to draft per family | family_hseq.py | repo signature files | LIVE |
| normalize a function's own declaration when a templated definition lands in a new unit | `normalize_self_decls.py` | Normalizes a function's own declaration when a templated definition lands in a new unit | family_sweep.py | repo src layout | LIVE |
| parse C declarators once, for every declaration tool to share | `cdecl.py` | The single recursive-descent C declarator parser every declaration tool shares | Makefile, blocker_probe.py, canon_sig_reconcile.py, cast_call_sites.py (+20) | C89 grammar only | LIVE |
| partition a source file at object boundaries, aware of comment state | `overlay_src_split.py` | Comment-state-aware partition of a source file, the oracle for the split chain | jr_isolate_all.py, neighbor_ref.py, o0_subsplit.py, share_census.py (+1) | repo src layout | LIVE |
| partition a source file at object boundaries, aware of comment state | `overlay_src_split.py` | Comment-state-aware partition of a source file, the oracle for the split chain | jr_isolate_all.py, neighbor_ref.py, o0_subsplit.py, share_census.py (+2) | repo src layout | LIVE |
| place a templated body's data externs at a scope the destination accepts | `scope_data_externs.py` | Places a templated body's data externs at the scope the destination unit can accept | family_sweep.py, jtbl_family_bank.py, scope_demote_drafts.py, scope_tu_externs.py | repo src layout | LIVE |
| property-test the signature tool on committed fixtures, needing no compiler | `xsig/tests/test_xsig.py` | Property tests for the signature tool on committed fixtures, needing no compiler | .github/workflows/no-rom.yml, Makefile | fixture paths | LIVE |
| rank clusters of the unmatched frontier by mnemonic-skeleton hash | `family_hseq.py` | Ranked clustering of the unmatched frontier by mnemonic-skeleton hash | Makefile, audit_binaries.py, audit_frontier.py, build_wave_atlas.py (+5) | repo signature files | LIVE |
@@ -165,7 +165,7 @@ then what proved it. The same data generates the day-one kit's manifest and its
| sign every function of a flat image at a known base, without a disassembler | `sig_image.py` | Disassembler-free per-function signer for a flat image at a known base, field-identical to the dumper | Makefile, atlas_features.py, corpus.py, disc_audit.py (+5) | MIPS encodings, repo scratch paths | LIVE |
| sign functions with relocations masked for cross-project code identification | `xsig/xsig.py` | Relocation-masked per-function signatures for cross-project code identification | .github/workflows/no-rom.yml, Makefile, test_xsig.py | MIPS/relocation model only | LIVE |
| sweep a matched exemplar across every same-structure sibling, gate-arbitrated | `family_sweep.py` | Sweeps a matched exemplar across every same-structure sibling, gate-arbitrated | frozen.py, recover_integration.py, twin_sweep.py | repo src/config layout | LIVE |
| unify a draft's callee externs and its own signature to the banked-canonical set | `sig_unify.py` | Unifies a draft's callee externs and its own definition signature to the banked-canonical set | auto_driver.py, cast_call_sites.py, cdecl.py, gate_stage.py (+1) | repo shared-header paths | LIVE |
| unify a draft's callee externs and its own signature to the banked-canonical set | `sig_unify.py` | Unifies a draft's callee externs and its own definition signature to the banked-canonical set | auto_driver.py, cast_call_sites.py, gate_stage.py, p16_improve.py | repo shared-header paths | LIVE |
| validate a code-share registry byte-honestly, failing closed on signature drift | `dedup_integrate.py` | Byte-honesty validator for the code-share registry; fails closed on signature drift | Makefile, macro_to_header.py, progress.py, share_body.py (+1) | repo config registry path | LIVE |
## P7 — the codegen map, the dumps, the permuter
@@ -189,7 +189,7 @@ then what proved it. The same data generates the day-one kit's manifest and its
| run the permuter with a masked scorer rebound, without patching it | `permuter/run_masked.py` | Runs the permuter with the masked scorer rebound before its entry point, without patching it | masked_scorer.py, p16_permute.py | permuter internals, repo module paths | LIVE |
| score permuter candidates on true masked code closeness, not mnemonic diff | `masked_scorer.py` | Drop-in permuter scorer scoring true relocation-masked code closeness instead of mnemonic diff | masked_diff.py, run_masked.py | permuter internals, repo module paths | LIVE |
| steer permuter mutation toward the lever family the residual class implies | `permuter_weights.py` | Directs permuter mutation toward the lever family the residual class implies | autopsy.py, p16_permute.py | permuter settings format | LIVE |
| tag every compiler-source citation with the source tree it refers to | `gccmap_cites.py` | Tags every compiler-source citation in the codegen-map docs with the tree it refers to | .github/workflows/no-rom.yml, Makefile | repo doc/reference paths | LIVE |
| tag every compiler-source citation with the source tree it refers to | `gccmap_cites.py` | Tags every compiler-source citation in the codegen-map docs with the tree it refers to | .github/workflows/no-rom.yml, Makefile, tool_census.py | repo doc/reference paths | LIVE |
| turn a red whole-binary result into a named list of divergent symbols | `main_diff_locate.py` | Turns a red whole-binary result into a named list of divergent symbols | gate_main.py | repo build/config layout | LIVE |
| warm-restart the permuter from its best waypoint each cycle | `permuter_ils.py` | Iterated-local-search wrapper warm-restarting the permuter from the best waypoint each cycle | grinder.py, permuter_sweep.py | permuter layout, repo scratch paths | LIVE |
@@ -227,7 +227,7 @@ then what proved it. The same data generates the day-one kit's manifest and its
| gate many binaries concurrently in isolated worktrees and merge only passers | `parallel_gate.py` | Gates many binaries concurrently in isolated worktrees and merges only the passers | docs/wave-playbook.md, gate_main_parallel.py, gate_wave.py, gater_lane.py (+1) | repo worktree/build layout | LIVE |
| gate pre-staged draft directories across distinct binaries in parallel | `sweep_parallel.py` | Gates pre-staged draft directories across distinct binaries in parallel | family_sweep.py, idiom_serial.py, integration_resolver.py, maintenance.sh (+2) | repo scratch paths | LIVE |
| gate the executable's drafts the only trustworthy way: a clean rebuild with bisect | `gate_main.py` | Gates a batch of executable drafts the only trustworthy way: a clean rebuild with bisect | Makefile, docs/wave-playbook.md, build_wave_atlas.py, decl_prior.py (+12) | repo build/make targets | LIVE |
| generate a callee-signature-aware target manifest with per-function fleet reach | `gen_harvest_targets.py` | Generates a callee-signature-aware target manifest with per-function fleet reach | cast_call_sites.py, cdecl.py, sig_unify.py | canonical source binary, repo paths | LIVE |
| generate a callee-signature-aware target manifest with per-function fleet reach | `gen_harvest_targets.py` | Generates a callee-signature-aware target manifest with per-function fleet reach | cast_call_sites.py, sig_unify.py | canonical source binary, repo paths | LIVE |
| give a wave its own immutable copy of the disassembly its agents read | `wave_snapshot.py` | Gives a wave its own immutable copy of the disassembly files its agents read | build_wave_atlas.py | repo asm paths | LIVE |
| give an external chat model the same multi-turn tool harness an agent gets | `api_agent.py` | Gives an external chat model the same multi-turn tool harness an agent gets | claude_wave_packs.py, idiom_serial.py, jtbl_lane.py, ox_campaign.py | provider endpoint, repo doc paths | LIVE |
| hold one reader/writer lock over the shared source state for concurrent lanes | `shared_lock.py` | One reader/writer lock over the shared source state for concurrent lanes | bulk_harvest.py, fix_arity_callers.py, gate_stage.py | repo lock paths | LIVE |
@@ -322,18 +322,18 @@ then what proved it. The same data generates the day-one kit's manifest and its
|---|---|---|---|---|---|
| add per-site function-pointer casts so a draft can call a differently typed callee | `cast_call_sites.py` | Adds per-site function-pointer casts so a draft can call a differently typed callee | canon_sig_reconcile.py, cast_self_callers.py, family_sweep.py, gate_stage.py (+4) | repo src layout | LIVE |
| apply curated names and signatures inside the analysis tool and save | `ghidra_scripts/ApplySymbols.java` | The in-tool half of that mirror: apply curated names and signatures, save on exit | ghidra_apply_symbols.sh, ghidra_export_annotations.sh, ghidra_rebuild.sh, ExportAnnotations.java (+1) | none | LIVE |
| convert a shared-body macro header into per-function plain-C headers included at each site | `macro_to_header.py` | The Phase-35 converter: every DEFINE_ macro body becomes a plain-C header under src/shared/<space>/ included at its site, the legacy name-parameterized headers converted, the registry text-edited, the macro header deleted; --plan / --apply / --finalize / --verify | share_body.py | the macro form is this project's; a kit-born project shares headers from its first bank | LIVE |
| convert a shared-body macro header into per-function plain-C headers included at each site | `macro_to_header.py` | The Phase-35 converter: every DEFINE_ macro body becomes a plain-C header under src/shared/<space>/ included at its site, the legacy name-parameterized headers converted, the registry text-edited, the macro header deleted; --plan / --apply / --finalize / --verify | share_body.py, tool_census.py | the macro form is this project's; a kit-born project shares headers from its first bank | LIVE |
| emit a function's target assembly as an inline-assembly body | `asm_verbatim.py` | Emits the file-scope inline-assembly body form from a disassembly file | docs/wave-playbook.md, draft_prechecks.py, gate_main.py, recover_route.py | repo asm layout | LIVE |
| extract inline-defined types and typedefs from a source file into a shared header | `build_engine_types.py` | Extracts inline-defined named types and typedefs from a source file into a shared header | inject_capped_externs.py, lift_types.py, uniquify_type.py | repo shared-header path | LIVE |
| flag address-named references whose address now has a curated name | `lint_symbol_refs.py` | Flags address-named references in committed sources whose address now has a curated name | .github/workflows/no-rom.yml, Makefile | repo symbol/src paths | LIVE |
| give each conflicting camp of a same-named type its own name | `uniquify_type.py` | Gives each conflicting camp of a same-named type its own name so every camp becomes liftable | — | repo src layout | REFERENCED |
| guard that every inline-assembly body still reproduces its target bytes | `verbatim_check.py` | Regression guard that every inline-assembly body still reproduces its target bytes | .github/workflows/no-rom.yml, verbatim_target_s.py, verbatim_to_stub.py | repo src layout | LIVE |
| measure duplicate function bodies across the fleet and assert one source per unique function | `share_census.py` | The census of byte-identical function classes across every binary with their source forms and verdicts, plus the S1 invariant check with its exception ledger and a fixture self-test | audit_binaries.py, dedup_integrate.py, gen_harvest_targets.py, macro_to_header.py (+3) | repo paths, the registry and signature schemas | LIVE |
| measure duplicate function bodies across the fleet and assert one source per unique function | `share_census.py` | The census of byte-identical function classes across every binary with their source forms and verdicts, plus the S1 invariant check with its exception ledger and a fixture self-test | audit_binaries.py, dedup_integrate.py, gen_harvest_targets.py, macro_to_header.py (+4) | repo paths, the registry and signature schemas | LIVE |
| mirror the curated symbol file into the analysis database with a real save | `ghidra_apply_symbols.sh` | Mirrors the curated symbol file into the analysis program headlessly, with a real save | — | repo symbol path, project name | REFERENCED |
| refuse, from one place, the command line of a tool the project has frozen | `frozen.py` | The one refusal a FROZEN tool prints from its main(): the tool, the successor and why; imports never exit (libraries stay usable) | aprop_autodraft.py, blocker_probe.py, canon_sig_reconcile.py, conform_decls.py (+10) | nothing | LIVE |
| regenerate a splitter-format target disassembly for a function no longer stubbed | `verbatim_target_s.py` | Regenerates a splitter-format target disassembly for a function that is no longer a stub; --gas emits the assemblable gas-syntax form ($-registers, .L labels, noreorder) that a web diff service accepts as a pasted target | decompme_replica.sh | repo build/asm layout | LIVE |
| run the share-body batch cycle unattended: batch, verify by exit code, log, commit, periodic clean fleet check | `share_body_cycle.sh` | The Phase-35 T5 driver for bucket new: per batch share_body --apply --bucket new --batches 1 --label new<k>, the gated N/N line read, the phase log entry appended, the bank committed (R42), the clean fleet run every N batches (R22) — stops on the first red | — | repo paths, the phase-log format, the fleet count from config/check.*.sha | ORPHAN |
| share one byte-identical function class across its binaries through an include-at-site header, gated per binary | `share_body.py` | The Phase-35 successor of dedup_propagate + dedup_extend for the include-at-site form: exemplar by majority text, the header written once, every private copy replaced by the include at its position, per-binary byte gate with object comparison, bisect on red, the registry appended or extended by text, the exception ledger on refusal; --plan / --apply --bucket extend|new | aprop_autodraft.py, audit_binaries.py, auto_driver.py, blocker_probe.py (+17) | repo paths, the registry and signature schemas | LIVE |
| share one byte-identical function class across its binaries through an include-at-site header, gated per binary | `share_body.py` | The Phase-35 successor of dedup_propagate + dedup_extend for the include-at-site form: exemplar by majority text, the header written once, every private copy replaced by the include at its position, per-binary byte gate with object comparison, bisect on red, the registry appended or extended by text, the exception ledger on refusal; --plan / --apply --bucket extend|new | aprop_autodraft.py, audit_binaries.py, auto_driver.py, blocker_probe.py (+18) | repo paths, the registry and signature schemas | LIVE |
| turn an inline-assembly body back into a stub the toolchain can reach | `verbatim_to_stub.py` | Turns an inline-assembly body back into an include-assembly stub | — | repo src/asm layout | REFERENCED |
## PROJECT-ONLY — project-only in code (the shape is a task; the code does not transfer)
+24
View File
@@ -474,6 +474,30 @@
validate_targets` OK; no live tool names a retired file; `tool_census --check: OK` after `make kit-corpus` (the first chain checked
BEFORE regenerating and a `;` let a partial commit through — R97 again; amended into one commit).
- **S96 — T6 part 2: the dead macro branches dropped + the guard.** Twelve live tools lost their macro-form code: audit_binaries
(`SHARED_INCLUDES` = the prelude only), auto_driver + bulk_harvest (`git add src/shared`), build_engine_types (the generated comment),
cdecl (`MACRO_STMT` = INCLUDE_ASM only; the fifteen-incumbent differential reduced to its honest statement — the macro header is gone —
and its dead body deleted, the gen_harvest_targets import with it), dedup_integrate (`PARAM_FUNC_RE` = SHARED_FN), export_pairs (mines
the shared headers under src/shared/ instead of macro bodies), family_cousins (`seed_body_ref` finds the shared header), fix_arity_callers
(the shared-header glob only), jr_isolate_all (the prelude include maps to engine_types.h + common.h), recover_integration (message +
snapshot list), sig_unify (help text). **The guard** (`tool_census.py --check`, `macro_form_guard`): every LIVE `.py` parsed with `ast`;
a non-docstring string constant carrying `DEFINE_func_` or `engine_core.h` is a gap; FROZEN, retired and six whitelisted detectors
(share_census, macro_to_header, share_body, overlay_src_split, gccmap_cites, tool_census) excluded; `--guard-root DIR` runs it against
another tree. **Verify:** `macro-form guard: 0 LIVE tools reference the retired form (217 scanned, 14 frozen, 6 whitelisted detectors, 38
retired)` · `tool_census --check: OK`. **Negative control (R39):** a worktree of the pre-T4 commit `0e38b51a3` → `15 LIVE tools reference
the retired form (197 scanned, 14 frozen, 4 whitelisted)` — exactly the twelve fixed here + the three retired, none frozen or whitelisted.
**`make tools-health` went red twice, both instrument findings fixed at the cause:** (1) `progress.py`'s R32 bucket assertion —
`func_801EF790`/`func_801EF85C` (md_SC03_073/074/075/078, empty-bodied shared headers) in BOTH `real` and `empty`: the include rule
classifies an empty header body as EMPTY while `report()`'s fold `real ∪= shared` re-added every included member; under the macro
form an empty shared body had been invisible to the classifier and counted as REAL through that fold. Fix: the fold excludes `empty`.
**Two published-number corrections follow (R14/R75; stated here, carried to T7/T8):** the fleet denominator **363,221 → 363,680
(+459)** = ov_SC03_015 +219 (its single-site macros, the plan's expected correction) + ov_SC03_118 +3 + 2 in each of ~118 overlays
(the never-extended members of the five under-listed groups — macro sites invisible until T4 made them includes); and **FLEET REAL
substantive 360,744 → 350,533 (−10,211)** with EMPTY up by the same — empty-bodied shared functions were REAL under the macro form's
fold and are EMPTY now, honestly; the instruction-weighted metrics (13,492,113 / 5,820,205 / 45,150) are unchanged. (2) `timeline.py`'s
self-check: its last row follows the COMMITTED digest (T2's lesson) — this commit carries the corrected `docs/progress.json` + README
block + `progress.fleet.md`; the timeline is regenerated in the next commit and the chain re-run for T6's verify line.
## Approved plan (verbatim, gate 1 — 2026-09-08)
# Phase 35 — Gen3 opens: the dedup phase, "one source per unique function" (v2.0.0 → v2.1.0)
+1 -1
View File
@@ -33,7 +33,7 @@ import dup_report
import corpus
REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SHARED_INCLUDES = ("shared/engine_core.h", "shared/engine_prelude.h") # the macro-era header, then the Phase-35 prelude
SHARED_INCLUDES = ("shared/engine_prelude.h",) # the Phase-35 prelude (the macro-era header is gone, P35 T4/T6)
def onboarded():
+1 -1
View File
@@ -111,7 +111,7 @@ def fleet_pct():
def git_commit(msg):
sh(["git", "add", SRC, "src/shared/engine_core.h", "config/dedup.us.yaml"])
sh(["git", "add", SRC, "src/shared", "config/dedup.us.yaml"]) # P35 T6: the share writes headers under src/shared/
sh(["git", "commit", "-q", "-m", msg])
return sh(["git", "rev-parse", "--short", "HEAD"]).stdout.strip()
+1 -1
View File
@@ -339,7 +339,7 @@ def main():
'/* src/shared/engine_types.h — shared engine struct/union types + typedefs (Phase 15 §14c,',
' * Phase 20 typedef lift). Generated by tools/build_engine_types.py from the matched bodies',
' * in the source overlay. Defined ONCE here (0 same-name-different-layout collisions) so the',
' * struct/typedef-using shared functions propagate fleet-wide via engine_core.h. Included by',
' * struct/typedef-using shared functions share fleet-wide through the per-function headers under src/shared/ (Phase 35). Included by',
' * common.h consumers. */',
'#include "common.h"', '']
# forward decls first (lets pointer-only references resolve regardless of order)
+1 -1
View File
@@ -207,7 +207,7 @@ def fleet_pct():
def git_commit(banked_by_bin, propagated, fp):
add = ["src/shared/engine_core.h", "src/shared/engine_types.h", "config/dedup.us.yaml"]
add = ["src/shared", "config/dedup.us.yaml"] # P35 T6: the per-function headers live under src/shared/
for b in banked_by_bin:
add += [os.path.relpath(p, REPO) for p in glob.glob(os.path.join(REPO, "src/%s/%s*.c" % (b, b)))]
add += [os.path.relpath(p, REPO) for p in glob.glob(os.path.join(REPO, "src/ov_*/*.c"))] # propagation
+4 -70
View File
@@ -106,7 +106,7 @@ GNU = {'__asm__', 'asm', '__attribute__', '__extension__', '__inline__'}
# Macro invocations that are NOT declarations in RAW draft/source text (they become declarations
# only after cpp). An EXPLICIT, NAMED exclusion list — the audit's rule: never let the exclusion set
# be "whatever the parser happened to choke on".
MACRO_STMT = re.compile(r'^\s*(INCLUDE_ASM|DEFINE_func_[0-9A-Fa-f]+|SETTER|RETCONST|CLEAR_TBL40)\b')
MACRO_STMT = re.compile(r'^\s*(INCLUDE_ASM)\b') # P35 T6: the dedup macro forms are gone; INCLUDE_ASM is the one macro statement left
class CDeclError(Exception):
@@ -1294,81 +1294,15 @@ def audit_differential():
scanner it replaces: any symbol an incumbent sees and this one does not is a defect in THIS
tool. The reverse (symbols only this one sees) is the measured size of the hole."""
sys.path.insert(0, os.path.join(REPO, 'tools'))
import gen_harvest_targets as ght
# reconcile_decls RETIRED (S45, R33): its DATA_DECL_LINE_RE row proved the superset for
# 26-A..S44; the incumbent is deleted, so the differential now compares the survivors only.
import sig_unify as su
ec = os.path.join(REPO, 'src/shared/engine_core.h')
if not os.path.exists(ec):
# P35 T6: the macro header is gone for good; the differential's only honest result is the statement below.
if True:
# Phase 35: the macro header is gone (per-function headers under src/shared/<space>/ hold plain C that tu_scope reads
# like any TU). The fifteen-incumbent differential was a comparison OVER MACRO TEXT; without that text it has nothing
# to compare against, and saying so is the honest result (R43 — never fabricate a synthetic TU from the new form).
print('[differential] src/shared/engine_core.h is absent (Phase 35): the macro-era differential no longer applies — OK')
print('[differential] the macro-era shared header is gone (Phase 35): the macro-era differential no longer applies — OK')
return True
text = open(ec).read()
# The incumbents scan engine_core.h's RAW TEXT — i.e. the bodies of 1,801 #define macros. A
# declaration in a macro body declares nothing until the macro is INVOKED (the §8c law), so the
# honest like-for-like comparison is against what cpp produces when every macro IS invoked.
# That synthetic TU is exactly "everything engine_core.h is capable of declaring".
d = os.path.join(REPO, 'src/shared')
tmp = os.path.join(d, '.cdecl_allmacros.c')
macros = re.findall(r'^#define\s+(DEFINE_func_[0-9A-Fa-f]+)\(\)', text, re.M)
with open(tmp, 'w') as f:
f.write('#include "../../include/common.h"\n#include "engine_types.h"\n'
'#include "engine_core.h"\n')
for mac in macros:
f.write(f'{mac}()\n')
try:
stmts = tu_statements(tmp)
mine = scope(stmts, tmp)
expanded = '\n'.join(stmts)
finally:
os.path.exists(tmp) and os.remove(tmp)
print(f'[differential] expanded {len(macros)} DEFINE_ macros through cpp -> {len(mine)} names')
mine_d = {n for n in mine if n.startswith('D_')}
rows = []
for name, rx in (('gen_harvest_targets.DATA_DECL_RE', ght.DATA_DECL_RE),
('sig_unify.DATA_DECL_RE', su.DATA_DECL_RE)):
theirs = set()
for m in rx.finditer(text):
theirs |= set(re.findall(r'\bD_[0-9A-Fa-f]+\b', m.group(0)))
# A symbol I do not report is only MY defect if it is genuinely at FILE scope. A
# block-scope `extern` is private to its function and is NOT part of the TU's namespace —
# reporting it as an authoritative canonical is what produced the §8d
# `conflicting types for D_801812A4` wall. So separate the two, and never let a real defect
# hide behind the excuse.
lost = theirs - mine_d
block = {s for s in lost if re.search(r'\bextern\b[^;]*\b' + s + r'\b', expanded)}
defect = lost - block
rows.append((name, len(theirs), len(mine_d), len(mine_d - theirs), sorted(defect),
sorted(block)))
print('[differential] engine_core.h — D_ symbols (raw-text scan vs cpp-expanded file scope)')
print(f' {"incumbent":<36} {"theirs":>7} {"cdecl":>7} {"cdecl-only":>11} {"MY DEFECT":>10} '
f'{"their block-scope error":>24}')
ok = True
for name, t, m, g, defect, block in rows:
print(f' {name:<36} {t:>7} {m:>7} {g:>11} {len(defect):>10} {len(block):>24}')
if defect:
print(f' DEFECT (file-scope, invisible to cdecl): {defect[:8]}')
if block:
print(f' they count BLOCK-scope externs as file-scope canonicals: {block[:4]}')
ok &= not defect
named = {'D_80127530': 'array', 'D_80127088': 'fnptr', 'D_8011DB28': 'fnptr',
'D_801274D0': 'fnptr', 'D_8018E858': 'fnptr_array'}
print(' the audit\'s named blind symbols (engine_core.h), now resolved WITH THEIR KIND:')
for n, want in named.items():
d = mine.get(n)
got = d.kind if d else 'MISSING'
flag = 'ok' if got == want else 'WRONG'
ok &= (got == want)
print(f' {n:<14} kind={got:<12} (expected {want}) [{flag}]'
+ (f' {d.type}' if d else ''))
return ok
def main():
+4 -4
View File
@@ -55,7 +55,7 @@ TIERS = ("h_exact", "h_norm")
# OVER-APPROXIMATING by design (R32): any C identifier, not just func_<hex> — a curated symbol
# (e.g. listCdBuffer) is a stub too, and a `func_`-only pattern silently misses it.
INCLUDE_ASM_RE = re.compile(r'INCLUDE_ASM\([^)]*,\s*([A-Za-z_]\w*)\s*\)')
MACRO_FUNC_RE = re.compile(r'^(DEFINE_func_[0-9A-Fa-f]+|SETTER|RETCONST|CLEAR_TBL40)$') # the macro-form `func` tokens
PARAM_FUNC_RE = re.compile(r'^SHARED_FN$') # the parameterized include form's `func` token (P35; the macro forms are gone)
SYMBOL_LINE_RE = re.compile(r'^\s*([A-Za-z_]\w*)\s*=\s*(0x[0-9A-Fa-f]+)\s*;')
@@ -193,9 +193,9 @@ def check(groups, binary_filter=None, allow_unsigned=False):
f"body that was never written (the share was registered but never propagated)")
failures += 1; continue
# ---- C2a′ (Phase 35 T2): a PLAIN-C header source must DEFINE `func` (a token occurrence is not a body) --------
# The macro forms (DEFINE_func_*, SETTER/RETCONST/CLEAR_TBL40) define through cpp and keep the token check above;
# the include form is read by share_census.header_defs — the one reader of that form (R33).
if not MACRO_FUNC_RE.match(fn):
# The parameterized form (SHARED_FN) defines through cpp and keeps the token check above; every other source is a
# plain-C header read by share_census.header_defs — the one reader of that form (R33).
if not PARAM_FUNC_RE.match(fn):
sys.path.insert(0, str(ROOT / "tools"))
import share_census
defined = {n for n, _ in share_census.header_defs(ROOT / src)}
+5 -6
View File
@@ -150,14 +150,13 @@ def main():
region = os.path.relpath(os.path.join(root, f), os.path.join(REPO, 'src'))[:-2]
for fn, body in extract_defs(open(os.path.join(root, f)).read()).items():
defs.setdefault(fn, (body, region))
# corpus-v3: ALSO mine the shared DEFINE_func macro bodies (engine_core.h) — the setters/return-const/
# dispatchers the model is blind to (extract_defs sees only inline col-0 defs, not macro instantiations).
# corpus-v3 mined the shared macro bodies here; since Phase 35 the shared bodies are plain-C headers under src/shared/ —
# (a header body is one definition in one file; mine the headers directly).
n_inline = len(defs)
ec = os.path.join(REPO, 'src/shared/engine_core.h')
if os.path.exists(ec):
for fn, body in extract_macro_defs(open(ec).read()).items():
for hp in sorted(glob.glob(os.path.join(REPO, 'src/shared/*/func_*.h'))):
for fn, (body, _region) in extract_defs(open(hp).read()).items():
defs.setdefault(fn, (body, 'shared'))
print(' %d func defs in src (%d inline + %d shared macros)' % (
print(' %d func defs in src (%d inline + %d shared headers)' % (
len(defs), n_inline, len(defs) - n_inline), file=sys.stderr)
pairs, skipped = [], {'no_asm': 0}
+3 -4
View File
@@ -280,11 +280,10 @@ def write_digest(out):
# ---------------------------------------------------------------- wave slate
def seed_body_ref(bin_, addr):
"""Where the seed's C body lives: engine_core.h DEFINE_ macro, or the inline def's src file."""
"""Where the seed's C body lives: a shared per-function header under src/shared/ (Phase 35), or the inline def's src file."""
name = f"func_{addr:08X}"
core = "src/shared/engine_core.h"
if os.path.exists(core) and f"DEFINE_{name}(" in open(core).read():
return dict(kind="macro", path=core, name=name)
for hp in sorted(glob.glob(f"src/shared/*/{name}.h")) + sorted(glob.glob(f"src/shared/*/{name}__*.h")):
return dict(kind="header", path=hp, name=name)
for p in sorted(glob.glob(f"src/{bin_}/*.c")):
txt = open(p).read()
if re.search(rf"^[A-Za-z_][^\n=;]*\b{name}\s*\(", txt, re.M) and f"INCLUDE_ASM" not in \
+2 -3
View File
@@ -38,7 +38,6 @@ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import shared_lock # Stage 1: --apply/--undo-journal write the fleet-shared header
REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
EC = os.path.join(REPO, 'src/shared/engine_core.h')
NARROW = re.compile(r'\b(char|short|signed\s+char|unsigned\s+char|unsigned\s+short|s8|u8|s16|u16|float|f32)\b')
@@ -157,7 +156,7 @@ def main():
'reconciliation for non-(void) conflicting forward-decls; byte-gate filters (G3/P9)')
ap.add_argument('--binary', help='ALSO scan+rewrite this overlay\'s own inline caller decls in '
'src/<binary>/<binary>*.c (a conflicting extern is often in the overlay src, not just '
'engine_core.h — the T6 integration-recovery gap). Default: engine_core.h only.')
'the shared headers under src/shared/ — the T6 integration-recovery gap). Default: the shared headers under src/shared/ only.')
ap.add_argument('--journal', metavar='PATH',
help='(apply) record each substitution\'s literal before/after to this JSON for '
'exact --undo-journal restore; written even when no edits were made')
@@ -177,7 +176,7 @@ def main():
sys.exit('no funcs given')
# target files: engine_core.h always; + the overlay's own src (inline callers) when --binary given.
files = sorted(set(([EC] if os.path.exists(EC) else []) + glob.glob(os.path.join(REPO, 'src/shared/**/*.h'), recursive=True))) # Phase 35: every shared header carries externs
files = sorted(set(glob.glob(os.path.join(REPO, 'src/shared/**/*.h'), recursive=True))) # Phase 35: every shared header carries externs
if a.binary:
# MAIN'S SOURCES DO NOT LIVE IN src/main/ (P31 S69). They are src/*.c — src/800.c, … — so the
# overlay-shaped glob matched NOTHING for --binary main and the tool reported success over an
+3 -4
View File
@@ -641,10 +641,9 @@ def _provided_types(header):
paths = []
for inc in incs:
b = os.path.basename(inc)
if b == "engine_core.h":
# engine_core.h itself is NOT scanned: its typedefs live INSIDE `DEFINE_func_*()` macro
# bodies and reach a region only where that macro is invoked. What every includer gets at
# file scope is what engine_core.h #includes — engine_types.h + common.h (the legacy set).
if b == "engine_prelude.h":
# the Phase-35 prelude: what every overlay/module TU gets at file scope from the shared tree — engine_types.h +
# common.h (the legacy set; the per-function headers are included at their sites, not here)
paths += ["src/shared/engine_types.h", "include/common.h"]
elif b == "engine_types.h":
paths += ["src/shared/engine_types.h", "include/common.h"]
+4 -1
View File
@@ -819,7 +819,10 @@ def report(binary, audit=False, write=True):
# _INCLUDED); it is still a shared body, so it counts in `shared`. A member parsed as a PRIVATE definition is not shared
# (a demacroized copy) — the registry is advisory, the source authoritative, as before.
members = dedup_members(BINARY)
shared = sorted((members - set(real) - set(stubs)) | (_INCLUDED & members))
# Phase 35 T6: an included member whose header body is EMPTY is classified `empty` by the include rule above and must NOT be
# folded into `real` as "shared" (pre-T4 the macro site was invisible and an empty shared body counted as real through this
# fold; the T6 health run put func_801EF790/func_801EF85C in BOTH buckets — the R32 assertion below caught it).
shared = sorted(((members - set(real) - set(stubs)) | (_INCLUDED & members)) - set(empty))
real = sorted(set(real) | set(shared))
# ---- COVERAGE ASSERTION (the rule ratified 2026-07-14: a scanner over the corpus must assert its
+2 -3
View File
@@ -233,7 +233,7 @@ def main():
if propagate:
if a.max_tier != "fleet" or not a.r22:
raise SystemExit(
"propagation is a FLEET-tier write (src/shared/engine_core.h + up to 138 overlay .c): "
"propagation is a FLEET-tier write (the shared headers under src/shared/ + up to 138 overlay .c): "
"it requires --max-tier fleet AND --r22, or pass --no-propagate (§65a).")
if "demacroize" in stages:
raise SystemExit(
@@ -313,8 +313,7 @@ def main():
# passes — `fix_arity_callers --revert` is LOSSY for --any-proto (it rewrites `()`->`(void)`, not
# back to the original `(a,b,c)`), which corrupts a non-bank whose caller passed args. So we
# snapshot/restore verbatim instead. (Bug caught by the clean-rebuild verify, R22.)
tu_files = [os.path.join(REPO, "src/shared/engine_core.h")] + \
sorted(glob.glob(os.path.join(REPO, f"src/{a.binary}/{a.binary}*.c")))
tu_files = sorted(glob.glob(os.path.join(REPO, f"src/{a.binary}/{a.binary}*.c"))) # P35 T6: no macro header to snapshot
snapshot = {f: open(f).read() for f in tu_files}
def restore():
+1 -1
View File
@@ -199,7 +199,7 @@ def main():
help='overlay SPLIT .c the drafts target (e.g. ov_SC01_077_a.c / _o0.c); default = '
'the main .c. Reads cur_stubs + inline/extern canonical sigs from THIS file so '
'split-file drafts are NOT dropped (they are stubs in the split, not the main .c) '
'and get the def-side arity-adopt recovery. engine_core.h is always included.')
'and get the def-side arity-adopt recovery. engine_prelude.h is always included.')
ap.add_argument('--in', dest='indir', required=True)
ap.add_argument('--out', dest='outdir', required=True)
args = ap.parse_args()
+70
View File
@@ -377,6 +377,59 @@ def check_corpus(recs, files):
return gaps, len(copies), len(pointers)
# ----------------------------------------------------------------------------------------------------------------------------
# The macro-form guard (Phase 35 T6). The dedup macro form (`DEFINE_func_X()` sites expanding bodies from src/shared/engine_core.h)
# is retired: every shared body is a plain-C header included at its site. A LIVE tool that still names the form in CODE (a
# non-docstring string constant — a regex, a path, a message) is a tool that would parse or write the retired form; it must be
# fixed, FROZEN (status FROZEN: its command line refuses) or retired. Comments and docstrings are the record and may say anything.
# The detectors that name the form in order to REFUSE or CENSUS it are whitelisted by name — the list is the guard's own record.
GUARD_TOKENS = ("DEFINE_func_", "engine_core.h")
GUARD_WHITELIST = {
"tools/share_census.py": "the S1 census: counts macro sites so the invariant can assert 0 (and its selftest fixture uses the form)",
"tools/macro_to_header.py": "the T4 converter, kept as share_body's library (naming, banner, alias binding) and for the record",
"tools/share_body.py": "names the form in its refusal texts",
"tools/overlay_src_split.py": "detects a macro site only to REFUSE it (R43)",
"tools/gccmap_cites.py": "a citation datum (`engine_core.h:24926`) in the codegen map's cite table",
"tools/tool_census.py": "this guard",
}
def macro_form_guard(files, by_path, root=REPO):
"""(gaps, counts): every LIVE/STILL-NEEDED tool under `root` (FROZEN and retired excluded, the whitelist excluded) is parsed
with `ast`; a non-docstring string constant carrying a guard token is a gap. `root` is a parameter so the negative control can
point the guard at a worktree of the pre-conversion tree (R39)."""
import ast
gaps, counts = [], {"scanned": 0, "frozen": 0, "whitelisted": 0, "flagged": 0}
for f in files:
if not f.endswith(".py"):
continue
status = by_path.get(f, {}).get("status", "")
if status == "FROZEN":
counts["frozen"] += 1
continue
if f in GUARD_WHITELIST:
counts["whitelisted"] += 1
continue
p = root / f
if not p.exists():
continue
try:
tree = ast.parse(p.read_text(encoding="utf-8", errors="replace"))
except SyntaxError:
continue
counts["scanned"] += 1
docs = {ast.get_docstring(n, clean=False) for n in ast.walk(tree)
if isinstance(n, (ast.Module, ast.FunctionDef, ast.AsyncFunctionDef, ast.ClassDef))}
hits = sorted({n.lineno for n in ast.walk(tree)
if isinstance(n, ast.Constant) and isinstance(n.value, str) and n.value not in docs
and any(tok in n.value for tok in GUARD_TOKENS)})
if hits:
counts["flagged"] += 1
gaps.append(f"macro-form guard: LIVE tool {f} names the retired macro form in code at line(s) {hits[:6]} — fix it, "
f"freeze it (status FROZEN) or retire it")
return gaps, counts
def main():
ap = argparse.ArgumentParser()
ap.add_argument("--check", action="store_true")
@@ -384,7 +437,18 @@ def main():
ap.add_argument("--corpus", action="store_true")
ap.add_argument("--all", action="store_true")
ap.add_argument("--consumers", metavar="FILE")
ap.add_argument("--guard-root", metavar="DIR", help="run ONLY the macro-form guard against the tools/ under DIR (the R39 negative control)")
a = ap.parse_args()
if a.guard_root:
by_path = {r["path"]: r for r in read_dict()}
root = pathlib.Path(a.guard_root).resolve()
files = sorted(p.relative_to(root).as_posix() for p in (root / "tools").glob("*.py"))
g, c = macro_form_guard(files, by_path, root=root)
for x in g:
print(" GAP", x)
print(f"macro-form guard ({root}): {c['flagged']} LIVE tools reference the retired form ({c['scanned']} scanned, "
f"{c['frozen']} frozen, {c['whitelisted']} whitelisted)")
return 1 if g else 0
recs, files, retired, gaps = census()
if a.consumers:
rec = next((r for r in recs if r["path"] == a.consumers or r["path"].endswith("/" + a.consumers) or pathlib.Path(r["path"]).name == a.consumers), None)
@@ -408,6 +472,12 @@ def main():
gaps += cg
for g in cg:
print(" GAP", g)
gg, gc = macro_form_guard(files, {r["path"]: r for r in read_dict()})
gaps += gg
for g in gg:
print(" GAP", g)
print(f"macro-form guard: {gc['flagged']} LIVE tools reference the retired form ({gc['scanned']} scanned, {gc['frozen']} frozen, "
f"{gc['whitelisted']} whitelisted detectors, {len(retired)} retired)")
print(f"tool_census --check: corpus {nc} copies + {npt} pointers checked; {len(gaps)} gap(s)")
print("tool_census --check: OK" if not gaps else "tool_census --check: FAIL")
return 1 if gaps else 0