Crafter.Build/tests
catbot e76f92ae0a
All checks were successful
CI / build-test-release (pull_request) Successful in 6m41s
fix: scope per-build module-state reset to the config being built
Build() resets each Module/ModulePartition's per-build `compiled`/`checked`
flags so a reused Configuration re-evaluates mtimes. That reset recursed into
cfg.dependencies — but dependency Configurations are shared across the build
DAG and each is compiled concurrently by its own Build() call.

A parent/sibling's recursive reset could therefore clear a shared dependency's
module `compiled` atomic *after* that dependency's module-compile thread had
set it true and exited, but before an intra-config waiter (its impl, or a
dependent partition) ran compiled.wait(false). The waiter then blocked forever
on a flag nothing would re-signal: the build froze mid-compile, idle, with no
compiler process alive — exactly the hang in issue #16.

Reset only the current configuration's own modules. Every config in the tree
already gets its own Build() call (the per-PcmDir builder registered in
depResults), which resets its own state at the top of that call, sequenced
before its compile threads spawn. Cross-config module state is consulted only
via PCM file mtimes and the depResults futures, never via these flags, so the
narrower reset is correct and removes the data race entirely.

Adds ConcurrentDependencyReset: builds a static-lib dependency fully, then
builds a consumer that depends on it while the dependency is already cached in
depResults (so it is never rebuilt), and asserts the consumer build leaves the
dependency's module `compiled` flag intact. Fails deterministically on the old
recursive reset; passes with the fix.

Resolves #16

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 11:32:46 +00:00
..
ConcurrentCacheRace fixed build error and file stdpcm lock 2026-05-30 19:28:06 +02:00
ConcurrentDependencyReset fix: scope per-build module-state reset to the config being built 2026-06-01 11:32:46 +00:00
DependencyLink test: broaden self-test coverage beyond the compile smoke test 2026-05-27 19:38:18 +00:00
HelloWorld new tests 2026-05-27 19:45:05 +02:00
ModuleInterface test: broaden self-test coverage beyond the compile smoke test 2026-05-27 19:38:18 +00:00
RunSingleTestExit test: broaden self-test coverage beyond the compile smoke test 2026-05-27 19:38:18 +00:00
ShaderCompile test: broaden self-test coverage beyond the compile smoke test 2026-05-27 19:38:18 +00:00
StandardArgs test: broaden self-test coverage beyond the compile smoke test 2026-05-27 19:38:18 +00:00
StaticLib test: broaden self-test coverage beyond the compile smoke test 2026-05-27 19:38:18 +00:00
TestRunnerSpec test: broaden self-test coverage beyond the compile smoke test 2026-05-27 19:38:18 +00:00
VariantId test: broaden self-test coverage beyond the compile smoke test 2026-05-27 19:38:18 +00:00
WasiBrowserRuntime test: broaden self-test coverage beyond the compile smoke test 2026-05-27 19:38:18 +00:00