docs(phase-31): §412 — §323 carve blocker 2 was a regex blind to __attribute__; 5 of 6 carve overlays cleared

This commit is contained in:
Drew T
2026-09-02 01:25:56 -06:00
parent 7bcb3e51ec
commit fecbfac5f8
3 changed files with 72 additions and 2 deletions
+5 -2
View File
@@ -2,7 +2,7 @@
> **Generated by `tools/cookbook_index.py` — do not hand-edit** (R33). Regenerate after adding a cookbook section.
>
> `docs/matching-cookbook.md` is ~716 KB / 1079 sections. Grepping it blind is how three P30 wave-1 agents each "discovered" an idiom that was already written down. **Start here, then read the section.** A section appears under every symptom it addresses.
> `docs/matching-cookbook.md` is ~716 KB / 1080 sections. Grepping it blind is how three P30 wave-1 agents each "discovered" an idiom that was already written down. **Start here, then read the section.** A section appears under every symptom it addresses.
**How to use:** name what you SEE in the diff (a stolen delay slot, an extra `la`, a swapped register pair, a `conflicting types` error), find that symptom below, read those sections first. If nothing fits, THEN grind — and add a section when you win.
@@ -720,7 +720,7 @@
- **§378c** — ★★ — THE FIFTH DECL-BLOCKER VARIANT: THE DRAFT REDECLARES WHAT THE TU ALREADY OWNS (P31 S69) <sub>L32722</sub>
- **§398** — ★★★ — `family_remap` CARRIES THE **SOURCE** TU's DECL ENVIRONMENT INTO A DESTINATION THAT ALREADY OWNS THOSE NAMES (P31 S69; measured 3 banked of 22) <sub>L32835</sub>
### jump tables & switches (57)
### jump tables & switches (58)
- **§8** — rodata island (compiler jump tables) — the `.data→.rodata→.data` sandwich (Phase 7) <sub>L339</sub>
- **§8a** — rodata island in a flat OVERLAY — the tail sandwich, per matched jr-function (Phase 26 — PoC PROVEN) <sub>L361</sub>
@@ -779,6 +779,7 @@
- **§387** — ★★ — **SPLIT-FOLD DISPATCH CLOBBER**: one switch case needs a reload, another must keep the fold (P31 S69; byte-proven main/func_80030F80, 343 ins, escalation 3 → 0) <sub>L32361</sub>
- **§322b** — ★★★ — THE CARVE CLASS IS COMPLETABLE, AND EVERY WORKTREE `CARVE-REFUSED` WAS AN INSTRUMENT VERDICT (P31 S69, Fable-3 audit; byte-proven end-to-end) <sub>L32667</sub>
- **§3-A.** — THE ORACLE HAS A HOLE: match_one cannot see a jump table (§405-A) <sub>L33098</sub>
- **§412** — ★★★ — §323 CARVE BLOCKER 2 WAS A REGEX THAT COULD NOT SEE PAST `__attribute__` (P31 S71) <sub>L33424</sub>
### optimisation level (-O0/-O2) (22)
@@ -2743,6 +2744,7 @@
- **§3-The** — nine laws this wave produced <sub>L33288</sub>
- **§410** — ★★★ — COPY THEN ACCUMULATE ON THE COPY: resolving the birthing-boost vs register-allocation dilemma (P31 S71; byte-proven `ov_SC04_015/func_8017EB78`, 98 ins) <sub>L33353</sub>
- **§411** — ★★★ — THE PACK MUST CARRY THAT FUNCTION'S OWN HISTORY (P31 S71; measured 38/39 vs 124/131) <sub>L33386</sub>
- **§412** — ★★★ — §323 CARVE BLOCKER 2 WAS A REGEX THAT COULD NOT SEE PAST `__attribute__` (P31 S71) <sub>L33424</sub>
---
@@ -3834,3 +3836,4 @@ Notes routinely quote that as a section id. This table resolves it. Grep bait: `
| L33288 | §3-The | nine laws this wave produced |
| L33353 | §410 | ★★★ — COPY THEN ACCUMULATE ON THE COPY: resolving the birthing-boost vs register-allocatio |
| L33386 | §411 | ★★★ — THE PACK MUST CARRY THAT FUNCTION'S OWN HISTORY (P31 S71; measured 38/39 vs 124/131) |
| L33424 | §412 | ★★★ — §323 CARVE BLOCKER 2 WAS A REGEX THAT COULD NOT SEE PAST `__attribute__` (P31 S71) |
+49
View File
@@ -33420,3 +33420,52 @@ target had already refused at least one earlier wave:
item must be handed it.* An archive of your own verified outcomes is training data for your own
tooling — and a corpus you write but never read is indistinguishable, from the outside, from one you
never wrote.
## §412 ★★★ — §323 CARVE BLOCKER 2 WAS A REGEX THAT COULD NOT SEE PAST `__attribute__` (P31 S71)
**The blocker as it presented.** `jr_isolate_all` — the named remedy for the dominant CARVE-REFUSED
class (§322: *"subseg `<ov>_jr_<addr>` would host NON-CONTIGUOUS `.rodata` carves"*) — refused two
overlays outright with a file-scope-decl coverage abort:
```
0 are function PROTOTYPES … base types: {'Blk4_9B4': 2, 'Blk4': 1}
e.g. ['extern Blk4_9B4 aD_801CE7A4[] __asm__("D_801CE7A4");', …]
Fix: carry the naming type (file_scope_types) or add it to src/shared/engine_types.h.
```
The advice was wrong, and the refusal was honest about the wrong thing: `file_scope_types()` **did**
return the typedef. What failed was the NAME extraction downstream of it.
**The cause, one regex.** Every type-name scan in the layer builder is
```python
re.findall(r'\}\s*([A-Za-z_]\w*)\s*;|\b(?:struct|union|enum)\s+([A-Za-z_]\w*)', block)
```
and the type is written
```c
typedef struct { u8 b[4]; } __attribute__((packed, aligned(1))) Blk4_9B4;
```
The attribute sits **between the closing brace and the name**. The first alternative captures
`__attribute__` and then fails on the following `((`; the second needs a tag after `struct`, and this
struct is anonymous. So the scan returns NOTHING, `Blk4_9B4` never enters `carried`, every decl naming
it reads as an unknown type, and the whole overlay is refused. Two overlays, one regex, and an error
message that pointed at the layer that was working.
**The fix** is to strip attributes before any type-name scan (`_ATTR` / `_strip_attrs` in
`jr_isolate_all.py`), applied at BOTH extraction sites — the `carried` pre-pass and `_type_names`.
**Measured result.** `ov_SC07_000` and `ov_SC03_029` both isolate, both build **BYTE-IDENTICAL**, and
`jtbl_carve --probe` moves from `plan-refused` to `tail — standard §8a carve at gate time` on both.
With the S71 static-placement fix (§411 companion) that is **5 of 6** CARVE-REFUSED overlays cleared:
`ov_SC03_010`, `ov_SC03_013`, `ov_SC03_092`, `ov_SC07_000`, `ov_SC03_029`. Only `ov_SC06_029` remains,
and it fails differently — its isolate builds NOT byte-identical, so it is a real resegmentation
question rather than a scanner gap, and the lane's guard reverted it automatically.
**The law.** *An attribute is grammar, not decoration.* Any scan that locates a declarator by its
position relative to a brace or a keyword must strip `__attribute__((…))` first — it can legally
appear between `}` and the name, after the name, and after the parameter list. This is the §134 class
(a scanner that cannot start where the C grammar actually puts things), and it is now the seventh tool
in this project to hit it.
+18
View File
@@ -5406,6 +5406,24 @@ Every one is fuel keyed by BARE NAME or asserted without a freshness check (R48/
reclaim policy. Added `autoMemoryReclaim=gradual` (needs `wsl --shutdown`), reclaimed by hand
(20 GB free → 43.6 GB), and started `.run/memkeeper.sh` as the interim automatic form. SETUP.md updated (R21).
- 2026-09-02 — **S71 CARVE LANE: 5 of 6 CARVE-REFUSED overlays cleared, two tool defects behind them.**
The class's dominant refusal (§322 non-contiguous same-subseg `.rodata`) names `jr_isolate_all` as
its remedy, and the isolate then refused 6 of 6 for two unrelated reasons:
(a) **file-local `static` definitions** (`bandsetup`, `setup_80188D90` — §82.1 inlined helpers) have
no address BY CONSTRUCTION, and the R32 guard was refusing the whole file over them. The isolate now
places such a definition with the ONE region that uses it (two users = hard refusal, R43); and
`overlay_src_split._proto_from_lines` no longer prefixes `extern` to a decl that already carries a
storage class (`extern static inline …` is "multiple storage classes" to cc1).
(b) **§323 blocker 2 was one regex** (cookbook **§412**): every type-name scan matched
`}\s*(\w+)\s*;`, which reads `__attribute__` as the name and dies on the following `((`, so
`typedef struct {…} __attribute__((packed)) Blk4_9B4;` produced NO name, the type never entered
`carried`, and every decl naming it read as unknown. The tool's own error message pointed at the
layer that was working. Strip attributes first.
**Byte-gated, committed, all five BYTE-IDENTICAL:** ov_SC03_010 · ov_SC03_013 · ov_SC03_092 ·
ov_SC07_000 · ov_SC03_029 — and `jtbl_carve --probe` moves `plan-refused` → `tail` on every one.
`ov_SC06_029` alone builds NOT byte-identical after isolation (auto-reverted by the lane's guard) —
a real resegmentation question, not a scanner gap. Cookbook 1080.
## 🛑 SESSION CHECKPOINT — S70 FINAL-5 (2026-09-01, TRUE session close). SUPERSEDES EVERY earlier block in this file, including S70 FINAL-4. Phase 31 T5 CONTINUES. Written for a FRESH SESSION that has none of this context.
**STATE:** tree clean at `commit:3582`, no lanes running, nothing in flight. **145 banked this session.**