authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-09-04 14:53:13+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-09-04 15:05:23+02:00
log5b46e1f7f4db2ce06b4f150d653d98cf8363f348
treea3e472fa95b3a102162de18f3df0ddf0b69fa501
parent3fdcbc03d43246a39411725b1e4e23e862d32b82
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

Maker: fix RSS accounting when dispatching memory-blocked steps

makeStep() requires that the caller subtracts the step's max_rss from available_rss, and that is indeed done in readyStep(). However, makeStep() *itself* failed to do this when dispatching memory-blocked steps, thus largely undermining the mechanism.

1 files changed, 1 insertions(+), 0 deletions(-)

lib/compiler/Maker.zig+1
...@@ -2730,6 +2730,7 @@ fn makeStep(...@@ -2730,6 +2730,7 @@ fn makeStep(
2730 const candidate_max_rss = candidate_index.ptr(c).max_rss.toBytes();2730 const candidate_max_rss = candidate_index.ptr(c).max_rss.toBytes();
2731 if (maker.available_rss < candidate_max_rss) break;2731 if (maker.available_rss < candidate_max_rss) break;
2732 assert(maker.memory_blocked_steps.pop() == candidate_index);2732 assert(maker.memory_blocked_steps.pop() == candidate_index);
2733 maker.available_rss -= candidate_max_rss;
2733 dispatch_set.appendAssumeCapacity(candidate_index);2734 dispatch_set.appendAssumeCapacity(candidate_index);
2734 }2735 }
2735 }2736 }