Goal
Reduce local compile/link/test feedback time while preserving every correctness, sanitizer, corpus, and evidence gate.
Current cost
Repository guidance records a 4–6 minute test relink after src/ edits, 8–10 minute filtered probe cycles, and roughly 170 seconds for about 1,430 unit tests across ten shards. Compile-time filters still relink the large artifact.
Scope
- Profile Zig compilation, semantic analysis, generated-table parsing, LLVM/codegen/linking where applicable, test discovery, binary size, process startup, and shard imbalance.
- Split or reuse test artifacts by stable subsystems without duplicating production code or losing cross-subsystem/link coverage.
- Add runtime test selection to a reusable binary where Zig permits, preserving deterministic enumeration and leak accounting.
- Improve shard scheduling from measured per-test history and retain per-shard logs/slowest reports.
- Reduce generated-code/table compile cost through owned generator output/layout changes, editing generators rather than generated files.
- Keep one full combined build/link gate that catches integration/ABI drift.
No-workaround rules
- No test deletion/skip, zero-denominator pass, reduced Debug/TSan coverage, stale binary, disabled leak checks, or external build/cache service dependency.
Acceptance
- Reproducible baseline reports wall/CPU/RSS and phase timing for clean/incremental/focused/full/TSan builds.
- Focused source-to-result latency and full local suite latency improve materially on the reference machine.
- Runtime filtering selects exactly the requested tests without relink and reports a nonzero denominator.
- Full unit, ABI, JIT/VM/concurrency, docs, corpus, and CI matrices remain unchanged in semantic coverage.
- Build stays offline and owned under #462.
Foundation
Current test-parallel shard runner and .zig-cache/unit-shards/ logs; tools/unit_test_runner.zig already records slow tests.