You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
t27c suite: run the in-process phases 1a2-1a7 through the parallel pool, workers on an 8 MiB stack (#8838 follow-up) #8841
Phases 1a2-1a7 (parse completeness, vacuous invariants, vacuous Verilog tests, backend omissions, bare keywords, literal percent) are the last per-spec phases still run one spec at a time: about 17 s of the 167 s suite.
No files, no subprocesses: none of the six writes a file or spawns a process. Each reads its spec and calls Compiler::parse_ast_accounted, compile, compile_verilog or compile_verilog_for_simulation.
No shared mutable state in the compiler: the only global in compiler.rs is an AtomicU64 that makes unique CSE keys (UNCSE:n), and those keys never reach the output. The other globals in bootstrap/src (a lazy_static table in formula_eval.rs, atomic counters in service/catalog_gate/host, a thread_local in service.rs) are thread-safe or not on this path.
Stack: the suite ran these phases on the main thread, 8 MiB on macOS, with no enlarged stack elsewhere in t27c. Spawned threads get 2 MiB by default.
Change
Workers:par_in_order spawns its workers with an 8 MiB stack (std::thread::Builder::stack_size), the main thread's own.
The six phases move to run_phase_par.
suite_jobs.t27's comment names every parallel phase and why the rest stay sequential.
Acceptance criteria
Same stderr, same stdout (apart from the JSON path line) and the same JSON (apart from *_elapsed_ms) with T27_SUITE_JOBS=1 and with the default.
Phases 1a2-1a7 take at least 2x less wall time with the default.
Hand-written foreign lines do not grow.
Boundary
specs/verified/suite_jobs.t27
User Scenarios
Given the test suite runs with the default parallelism, When phases 1a2-1a7 (parse completeness, vacuous invariants, vacuous Verilog tests, backend omissions, bare keywords, literal percent) execute, Then they run through the parallel worker pool with 8 MiB stack per worker instead of sequentially on the main thread.
Given the test suite runs with T27_SUITE_JOBS=1, When phases 1a2-1a7 execute, Then they produce identical stderr, stdout (apart from the JSON path line), and JSON output (apart from *_elapsed_ms) as the default parallel run.
Requirements
FR-001: The six phases 1a2-1a7 MUST be moved from sequential execution to run_phase_par so they run in the parallel worker pool.
FR-002: The parallel worker pool MUST spawn workers with an 8 MiB stack size using std::thread::Builder::stack_size.
FR-003: The comment in specs/verified/suite_jobs.t27 MUST be updated to name every parallel phase and explain why the remaining phases stay sequential.
FR-004: Running the suite with T27_SUITE_JOBS=1 and with the default parallelism MUST produce the same stderr, same stdout (apart from the JSON path line), and same JSON (apart from *_elapsed_ms).
FR-005: Phases 1a2-1a7 MUST complete in at least 2x less wall time with the default parallelism compared to the previous sequential execution.
FR-006: Hand-written foreign lines MUST not increase as a result of this change.
Activity
t27c suite runs the in-process phases 1a2-1a7 through the parallel po…