Files
BFM-decomp/phase-ends/current/logs/T5.c2.md
T

4.1 KiB

T5.c2 — rung S I/M recipe ladder (partial: tool committed, pilot not run)

Status: partial (context threshold). Tool commit f476751f9f. Pilot cycle NOT started; tree src/include/config clean.

Changed (tools/restruct.py)

  • Recipes R1/R2/R3 take why=None; refusals via _refuse(why, cause) (R1-NOT-GLOBAL, R1-NO-EDIT; R2-NOT-GLOBAL, R2-HEADER-EXTERN (no extern of the symbol in the TU), R2-NO-SCALAR-EXTERN, R2-MISALIGNED, R2-WIDTH, R2-NO-EDIT; R3-NOT-GLOBAL, R3-NOT-CARVED, R3-NO-SCALAR-EXTERN, R3-NO-BODY, R3-NOT-CONTIGUOUS, R3-NO-EDIT). Return values unchanged ([]), so run_recipes/--try unchanged.
  • New after run_recipes: IM_FORMS, IM_BCLASS, RECIPE_CAUSE_RANK, _site_key, _is_im_global, _im_guard (STILL-RAW / REKEYS before any compile), im_recipe_pass(tu, fn, text, judge, tag) → (text, entries, stats), im_row_merge(row, ents, st, fresh).
  • work_file_S(..., im_only=False, latest=None): im_only = ladder only, done filter bypassed, prior S row merged (im_of), else new no-base row; want_recipes also runs the ladder in normal S (both the no-edit branch and after KEPT recipes). s_macro_rows skips merged rows (they keep prior macro entries). Counters im_drawn/im_residual.
  • residue_cause_im: gaddr → GADDR; ABS-ADDR only for abs.
  • im_mode(a), plan_S_im(headers, batch, only, latest, path), describe_plan_im; apply_batch/--plan route --rung S --forms I,M; batch json im_by_recipe, im_by_cause; verify line gains I/M recipes drawn N {…} / residual N {…}. --forms default now None (residue default P,X unchanged via residue_forms).
  • Docstring usage + cause list; selftest controls: plan selects only fx_im (2 sites), fx_par param site never drawn; R2 draws *(s32 *)&D_80078F00 (extern array), s16 one RESIDUAL(R2-WIDTH) covered by residue_match; merged prior row keeps KEPT/bases, replaces its RESIDUAL entry; DIFFERS stub → RESIDUAL(R2-DIFFERS), UNCHANGED. T10 control updated ABS-ADDR → GADDR.
  • tools/restruct_cycle.sh: RECIPES=1 → --recipes, FORMS=I,M → --forms; usage :14.
  • docs/ops/p39-t5-2026-10-02-restruct-im-recipes.md + INDEX line.

Commands

  • PY tools/restruct.py --selftest → 107/107 OK.
  • make kit-corpus → exit 0; make tools-health → tools-health: OK.
  • PY tools/restruct.py --plan --rung S --forms I,M --batch 40 → 40 of 2325 drawable files · 289 bodies · 2043 uncovered I/M global-base sites.
  • per overlay --plan … --batch 400 --only X: ov_SC07_006 17 files/58 bodies/195 sites; ov_SC04_011 17/66/196; ov_SC01_077 15/60/182.
  • PY tools/restruct.py --selftest --real (before commit) → 109/110, only FAIL calibration not current (calibrated f6f4ae75d0, HEAD ef4507badb).

Next (exact)

  1. PY tools/delever_oracle.py --snapshot-baseline then PY tools/delever_oracle.py --calibrate ov_SC04_011 ov_SC03_015 md_SC07_004 main -j 16 (run.sh), then PY tools/restruct.py --selftest --real → expect 110/110.
  2. Pilot (detached, R115): setsid nohup bash -c 'RECIPES=1 FORMS=I,M LABEL_PREFIX=t5_im TASK=T5 tools/restruct_cycle.sh 1 1 50 S ov_SC07_006; echo "cycle exit=$?"' > .run/P37/restruct/cycle_t5_im.log 2>&1 & (RUNG is positional arg 4, not env). Watch until cycle exit=; needs final 17/17, R22 218/218.
  3. Pilot numbers from .run/P37/restruct/batch_t5_imS1.json (im_by_recipe, im_by_cause) and ledger rows label t5_imS1 (im.seconds per body).
  4. PY tools/type_census.py --check-casts --residue --quiet → I/M uncovered vs T5.c1 baseline (I=35625 M=14762).
  5. Append pilot numbers to this log; commit log.

Notes for the expert

  • Deviation: R1 has no NOT-POINTER refusal (selftest's R1 fixture is a non-pointer extern s32, R1 defaults to void *); for I/M R1 yields R1-NOT-GLOBAL (gaddr) or R1-STILL-RAW (the cast is kept, only the base respelled), never a draw.
  • R2 rewrites every mention of the symbol TU-wide; _im_guard refuses (R2-REKEYS) any candidate that changes another raw/macro site's census key outside the body's I/M global-base set, so covered P/X sites never go uncovered. R3 on I/M → STILL-RAW/REKEYS (&D_A → p37w keeps a cast).
  • Expect R2 to draw only same-width &D_x sites (T5.c1: dominant shape is a narrow scalar read wider → R2-WIDTH).