Compare commits

...

2 Commits

Author SHA1 Message Date
devin
929ad5dcc3 pdm attempts doc: helper-cross results post-#1312 rebase
Co-authored-by: coah80 <usernamecole7@gmail.com>
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-09 08:58:28 +00:00
devin
4c1ebf5d63 pdm_partition: named local s in is_master_boot_sector — 84v84 insn-equal (was 86v84)
Named pf_u32 s reproduces orig's dead *p_start=0 store and drops the extra
r29 callee web. Residual 17 = word-build web-coloring (orig gives b3<<24 the
callee and emits a non-coalesced add. dst; ours coalesces into half1).
Prior worker reached 19; this beats it at 17.

Co-authored-by: coah80 <usernamecole7@gmail.com>
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-09 08:56:45 +00:00
2 changed files with 13 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ static inline pf_u16 read_boot_u16(pf_u8* buf, pf_u32 offset) {
}
pf_s32 pdm_part_is_master_boot_sector(pf_u8* buf, pf_u32 total, pf_bool* p_is_mbr) {
pf_u32 s;
pf_u32* p_start;
pf_u32* p_count;
pf_s16 index;
@@ -20,7 +21,8 @@ pf_s32 pdm_part_is_master_boot_sector(pf_u8* buf, pf_u32 total, pf_bool* p_is_mb
p_count = count;
for (index = 0; index < 4; index++) {
*p_start = 0;
*p_start = MBR_WORD(buf, 454);
s = MBR_WORD(buf, 454);
*p_start = s;
*p_count = MBR_WORD(buf, 458);
if (*p_start != 0 && *p_count != 0) {
if (index == 0) { *p_is_mbr = 1; }

View File

@@ -31,3 +31,13 @@ Remaining difference: the byte-load schedule of the inlined LE32 read. The targe
- buf indexing instead of `buf += 16`: 90-91. Partition-entry pointer: 69.
- Helper boundaries (local for b0, u8/u32 parameter helper, two u16 halves, pointer to the field): 20-21.
- Pragmas (diagnostic): iro 0/1: 37 (25 with pointer loop 2, best 23 over all 120 sum shapes). scheduling off: 77. IRO is not the lever here.
## w1011/pdm continuation: pdm_part_is_master_boot_sector (84 in repo -> 17, beats prior 19 but not exact)
- Committed decode: named local `pf_u32 s` + `*p_start = 0; s = MBR_WORD(buf,454); *p_start = s; *p_count = MBR_WORD(buf,458);` (s at fn top). The named local reproduces orig's dead `*p_start = 0` store (must precede s's computation — any form where word-building precedes the 0-store makes it adjacent-DCE'd) AND drops the extra r29 callee web: 86v84/+0x10-frame -> 84v84 insn-equal.
- Residual 17 = word-build coloring/schedule only: orig gives b3<<24 the callee (r30) and reuses r30 for `add.` s; halves stay scratch (r12/r11). Ours coalesces the dot-add backward into half1 -> r30, parks b3<<24 on r31 (shared with cb3<<24). Orig's `add.` dst is a FRESH web (dst != either operand) — MWCC coalesced count's final add (dst=src2 r9) but not start's; no source form reproduces the non-coalesced Rc dst.
- Tried: `pf_u32 c` symmetric local (=17, no-op), s in-loop decl (=17), `if (s != 0` test (=52, s spans count build -> 4 callees), store-after-count (=51, same), compute-both-store-both (=30), named halves h1/h2 both positions (=83 loses 0-store / =29), explicit even/odd + adjacent pairings (=29 each), descending operand order (=30), read_mbr_u32 static-inline pointer helper (=17 identical — inlines transparently), start[index]/count[index] pure indexing (=19, adds loop-tail bump-order diff), `pf_s16 index` alternatives (extsh already matches).
- Pragmas on the fn: ppc_iro_level 0/1 = 43, scheduling off = 47, schedule_twice on = 17 (inert), scheduling 600 = compile failure, optimization_level untested (same class).
- declsearch on the 6-line decl block: current order already optimal (scored 12,21).
- Wall class: allocator/solver-internal web-coloring (which slwi piece gets the callee + non-coalesced Rc dst) — same class as the fossils leaf. Prior worker's DAG-level note stands: orig loads b0 before b1 (b1 shares b3's r9), ours loads b1 before b0; all 120 operand perms were exhausted without the s-local cross-product — none of the ~16 s-local forms moved it past 17.
- Post-#1312 re-check on origin/main 54ca052b: still 84v84/17 (fn was never 100% — #1312 only swapped helper->MBR_WORD + pointer->index second loop). Restoring the deleted `read_partition_u32` const-ptr static-inline crossed with s-local: 86v84/42 (re-adds r29 web — const-ptr helper call boundary hurts). `pf_s32 s`: 17 no-op. The 17d macro+s form remains best of ~18 variants.