zig/lib/compiler
Matthew Lugg aebd84b525 build runner: refactor step evaluation logic
The previous logic was made really messy by the fact that upon entry to
the step eval worker, the step may not be ready to run, we may be racing
with other workers doing the same check, and we had already acquired our
RSS requirement even though we might not run. It also required iterating
all dependencies each time we were called to check whether we were even
ready to run yet.

A much better strategy is for each step to have an atomic counter
representing how many of its dependencies are yet to complete. When a
step completes (successfully or otherwise), it decrements this value for
all of its dependants, and if it drops any to 0, it schedules that step
to run. This means each step is scheduled exactly once, and only when
all of its dependencies have finished, reducing redundant checks and
hence contention. If the step being scheduled needs to claim RSS which
isn't available, then it is instead added to `memory_blocked_steps`,
which is iterated by the step worker after a step with an RSS claim
finishes.

This logic is more concise than before, simpler to understand, generally
more efficient, and fixes a bug in the RSS tracking. Also, as a nice
side effect, it should also play a little bit nicer with `Io.Threaded`'s
scheduling strategy, because we no longer spawn extremely short-lived
tasks all the time as we previously did.

Resolves: https://codeberg.org/ziglang/zig/issues/30742
2026-01-09 03:16:39 +01:00
..
aro std.fs: deprecate base64 APIs 2026-01-07 17:33:06 -08:00
reduce Remove legacy asm clobbers syntax handling 2025-11-27 20:16:03 +00:00
resinator fix some windows compilation errors 2026-01-04 00:27:09 -08:00
translate-c rename env_map to environ_map 2026-01-04 00:27:09 -08:00
build_runner.zig build runner: refactor step evaluation logic 2026-01-09 03:16:39 +01:00
libc.zig rename env_map to environ_map 2026-01-04 00:27:09 -08:00
objcopy.zig test-standalone: update the rest of the cases to new API 2026-01-04 00:27:08 -08:00
reduce.zig zig libc: fix subcommand 2026-01-04 00:27:08 -08:00
std-docs.zig compiler: update std lib API usage 2026-01-04 00:27:08 -08:00
test_runner.zig std.fs.path: make relative a pure function 2026-01-04 00:27:08 -08:00
util.zig - aroDiagnosticsToErrorBundle: fixup not clearing notes after flushing the current error 2025-10-09 13:34:25 -04:00