Repository navigation
Commit faea9ae
committed
fix(tree_walk): D-557 — evalRecur reentrancy (nested lazy-for recur clobbered the pending buf)
Smell-audited: 1: the fix keeps the threadlocal (the loop-frame drain
contract is unchanged) and only moves arg EVALUATION to a local
ArgsFrame-rooted buffer — the scratch is now written solely in the
no-eval window between RecurSignaled and the matching drain, where no
nested recur can fire.
evalRecur evaluated args directly into the threadlocal pending_recur_buf,
but an arg's eval can force a lazy seq whose `for`-lowered iterator loop
RECURS (the :when-miss arm emits `(recur (rest gxs))`) — the inner recur
clobbered the outer's already-evaluated args. Symptom: the cw-arcade
two-list BFS solver's queue slot received a stray :delta Long
(`-nth on Long`); fired only when a :when miss occurred during recur-arg
evaluation (visited-heavy real workloads), which is why synthetic twins
passed. The vm is immune (recur args ride the operand stack).
Verified: the solver repro (direct + shadow-renamed + no-reverse variants
+ the full 3-test suite) green on tree_walk; corpus lazy_eval +2 distilled
goldens (clj-byte-matched) — re-verified per-gate on vm (corpus_regression)
and per-sweep on tree_walk (check_vm_parity).1 parent 9b0321b commit faea9ae
3 files changed
Lines changed: 38 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | 27 | | |
33 | 28 | | |
34 | 29 | | |
| |||
6525 | 6520 | | |
6526 | 6521 | | |
6527 | 6522 | | |
| 6523 | + | |
| 6524 | + | |
| 6525 | + | |
| 6526 | + | |
| 6527 | + | |
| 6528 | + | |
6528 | 6529 | | |
6529 | 6530 | | |
6530 | 6531 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
464 | | - | |
465 | | - | |
466 | | - | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
467 | 467 | | |
468 | 468 | | |
469 | 469 | | |
| |||
1030 | 1030 | | |
1031 | 1031 | | |
1032 | 1032 | | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
1036 | 1044 | | |
1037 | | - | |
1038 | | - | |
1039 | | - | |
1040 | | - | |
| 1045 | + | |
| 1046 | + | |
1041 | 1047 | | |
1042 | | - | |
| 1048 | + | |
1043 | 1049 | | |
1044 | 1050 | | |
1045 | | - | |
| 1051 | + | |
1046 | 1052 | | |
1047 | 1053 | | |
| 1054 | + | |
1048 | 1055 | | |
1049 | 1056 | | |
1050 | 1057 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
0 commit comments