Repository navigation
Commit 4feb0d2
committed
hir_cfg_get_rpo: un-clamp returns + add resize handlers (D-1775660617)
Fixes the parked bug logged 2026-04-09 (theologian D-1775660617, pythia
D-1775661187, testkeeper D-1775661646) that surfaced this session via
push 42's 150-arm wiring fixture (n=302 BBs > 256 default rpo_cap).
Root cause: hir_cfg_get_rpo + hir_cfg_get_rpo_from in hir_c_api.cpp
returned the count CLAMPED to caller capacity. The standard caller
pattern
size_t rpo_cap = 256;
size_t num_blocks = hir_cfg_get_rpo(cfg, rpo_blocks, rpo_cap);
if (num_blocks > rpo_cap) { resize + refetch }
silently swallows the overflow: when the actual RPO size > 256 the
function returns 256, the resize check never fires, and blocks beyond
the 256th drop out of the iteration. copy_propagation.c stops removing
Assigns in dropped blocks; LIR translation later fires
JIT_CHECK(false, "assign shouldn't be present") at
lir/generator.cpp:1358. SIGABRT at exactly 257 BBs; SIGSEGV beyond.
Fix is a contract harmonization with the sibling hir_cfg_get_rpo_c
(hir_cfg_rpo_c.c:67-75) which already returned the un-clamped post-
order count. Both _cpp and _from variants now match: only `count`
entries written, but the FULL `actual` size is returned so callers
can detect overflow.
Bundled in same commit per supervisor 12:32:56Z bundle directive
(close the bug class, not just the trip):
(1) hir_c_api.cpp: hir_cfg_get_rpo + hir_cfg_get_rpo_from un-clamped
(2) pass_output_type_c.c: 3 callers (hir_reflow_types_c,
hir_optimize_long_decref_runs_c,
hir_remove_unreachable_instructions_c) gain stack-array + heap-
fallback resize+refetch handlers. The fallback malloc only fires
when CFG exceeds 4096 BBs (no allocator pressure for typical
workloads).
clean_cfg.c:75-86 + copy_propagation.c:25-34 already had the resize
handlers (dead until this commit, load-bearing now). No change to
either; the un-clamp activates them.
Falsifier (testkeeper 12:38:23Z): 127/128/150/200/1000/2000-arm
fixtures all PASS post-fix; pre-fix all SIGABRT/SIGSEGV. JIT smoke
(add/mul/fib) PASS — handler additions do not regress the baseline.
Auth chain: librarian known-parked record D-1775660617 + sub-agent
verification (supervisor 12:29:00Z); supervisor escalation-to-proceed
12:28:09Z + bundle directive 12:32:56Z; testkeeper pre-commit BUILD
PASS + 6/6 reproduction 12:38:23Z. Theologian wedged across this
investigation; sub-agent stood in for patch-shape verification.1 parent 154997b commit 4feb0d2
2 files changed
Lines changed: 61 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
245 | 254 | | |
246 | | - | |
| 255 | + | |
| 256 | + | |
247 | 257 | | |
248 | 258 | | |
249 | 259 | | |
250 | | - | |
| 260 | + | |
251 | 261 | | |
252 | 262 | | |
253 | 263 | | |
| |||
2504 | 2514 | | |
2505 | 2515 | | |
2506 | 2516 | | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
2507 | 2521 | | |
2508 | | - | |
| 2522 | + | |
| 2523 | + | |
2509 | 2524 | | |
2510 | | - | |
| 2525 | + | |
2511 | 2526 | | |
2512 | 2527 | | |
2513 | 2528 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
433 | | - | |
434 | | - | |
435 | | - | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
436 | 447 | | |
437 | 448 | | |
438 | 449 | | |
| |||
456 | 467 | | |
457 | 468 | | |
458 | 469 | | |
| 470 | + | |
| 471 | + | |
459 | 472 | | |
460 | 473 | | |
461 | 474 | | |
| |||
874 | 887 | | |
875 | 888 | | |
876 | 889 | | |
877 | | - | |
878 | | - | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
879 | 901 | | |
880 | 902 | | |
881 | 903 | | |
| |||
915 | 937 | | |
916 | 938 | | |
917 | 939 | | |
| 940 | + | |
| 941 | + | |
918 | 942 | | |
919 | 943 | | |
920 | 944 | | |
| |||
936 | 960 | | |
937 | 961 | | |
938 | 962 | | |
939 | | - | |
940 | | - | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
941 | 974 | | |
942 | 975 | | |
943 | 976 | | |
| |||
1083 | 1116 | | |
1084 | 1117 | | |
1085 | 1118 | | |
| 1119 | + | |
| 1120 | + | |
1086 | 1121 | | |
1087 | 1122 | | |
0 commit comments