Skip to content

perf(runtime)!: defer settles that are a function of their inputs - #2497

Merged
mergify[bot] merged 1 commit into
masterfrom
stack/tignear/perf/rollup-veryl-testbench-execution/defer-settles-func-their-inputs--592604c0
Oct 29, 2026
Merged

mergify[bot] merged 1 commit into
masterfrom
stack/tignear/perf/rollup-veryl-testbench-execution/defer-settles-func-their-inputs--592604c0

Conversation

@tignear

@tignear tignear commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

The compiled scheduler deferred a combinational settle only when every load
of storage the settle writes was covered by an earlier store. A bit-level
schedule may load a whole range before the bits it needs are stored and
discard the stale ones, so designs such as Rica (an instruction cache port
read as {frame, pc} >> 4) settled eagerly in every slot and never used
their fused domain units.

The combinational scheduler now reports which paths keep state from one
settle to the next (previous-value reads, loops, guarded processes), or that
it cannot tell (capture events, partitioned settles). A settle without such
paths is deferred. Otherwise only the part of the settle that computes the
stateful paths runs where the reference settles, as one shared copy, and
the rest stays deferred. The load-coverage check remains the fallback.

A compiled Veryl testbench observes the design itself: before each
expression that reads the DUT, it computes only the part of the settle that
the read needs, and its runs of the shared scheduler leave a deferred settle
pending (defer_limit_settle). Before dispatching edges it computes the
levels of the event signals instead of requiring a settled design. Slices
come from one data and control dependence index of the settle, so each is
linear in what it reaches.

A fatal assertion in a domain run from the compiled testbench now reports its
message instead of the raw error code.

Validation:

  • Workspace nextest with the CI feature set: 19,901 tests; the only failures
    are testbench_reset_polarity (2) and run_diagnostics, which fail on the
    base rollup as well and are fixed there.
  • New tests: comb slicer units, a stale-bit fixture that the load check
    rejects but the scheduler now defers, and the existing differential tests
    for latches and guarded processes, which now take the stateful path.
  • Rica kernel-syscalls: identical cycle and commit counts. Its testbench
    reads now compute 20-82 SIR instructions instead of the 14,245-instruction
    settle. Execution time is unchanged within noise (one combinational
    evaluation per cycle remains); compilation grows about 0.2-0.6 s because
    the fused domain units are now inlined into the scheduler.

BREAKING CHANGE: the scheduler slots gain defer_limit_settle and TB settle
requests carry their reads; appended native images use container version 56
and must be regenerated.

Depends-On: #2484

@tignear

tignear commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 perf(testbench)!: roll up compiled Veryl testbench execution #2484
2 perf(runtime)!: defer settles that are a function of their inputs #2497 👈

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T00:21:57.506337Z 23ea84f New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@tignear
tignear force-pushed the stack/tignear/perf/rollup-veryl-testbench-execution/defer-settles-func-their-inputs--592604c0 branch from 03c0892 to 18070c2 Compare October 28, 2026 23:59
@tignear
tignear force-pushed the stack/tignear/perf/rollup-veryl-testbench-execution/roll-compiled-veryl-testbench-execution--f61ef7bf branch from 0e76169 to 102f3d5 Compare October 28, 2026 23:59
@tignear

tignear commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Revision history

# Type Changes Reason Date
1 initial 03c0892 2026-10-28 23:58 UTC
2 rebase 03c0892 → 18070c2 (rebase only) 2026-10-28 23:58 UTC
3 rebase 18070c2 → 23ea84f (rebase only) Settle before evaluating destination selections (review 4407366153) 2026-10-29 00:18 UTC

The compiled scheduler deferred a combinational settle only when every load
of storage the settle writes was covered by an earlier store. A bit-level
schedule may load a whole range before the bits it needs are stored and
discard the stale ones, so designs such as Rica (an instruction cache port
read as `{frame, pc} >> 4`) settled eagerly in every slot and never used
their fused domain units.

The combinational scheduler now reports which paths keep state from one
settle to the next (previous-value reads, loops, guarded processes), or that
it cannot tell (capture events, partitioned settles). A settle without such
paths is deferred. Otherwise only the part of the settle that computes the
stateful paths runs where the reference settles, as one shared copy, and
the rest stays deferred. The load-coverage check remains the fallback.

A compiled Veryl testbench observes the design itself: before each
expression that reads the DUT, it computes only the part of the settle that
the read needs, and its runs of the shared scheduler leave a deferred settle
pending (`defer_limit_settle`). Before dispatching edges it computes the
levels of the event signals instead of requiring a settled design. Slices
come from one data and control dependence index of the settle, so each is
linear in what it reaches.

A fatal assertion in a domain run from the compiled testbench now reports its
message instead of the raw error code.

Validation:
- Workspace nextest with the CI feature set: 19,901 tests; the only failures
  are testbench_reset_polarity (2) and run_diagnostics, which fail on the
  base rollup as well and are fixed there.
- New tests: comb slicer units, a stale-bit fixture that the load check
  rejects but the scheduler now defers, and the existing differential tests
  for latches and guarded processes, which now take the stateful path.
- Rica kernel-syscalls: identical cycle and commit counts. Its testbench
  reads now compute 20-82 SIR instructions instead of the 14,245-instruction
  settle. Execution time is unchanged within noise (one combinational
  evaluation per cycle remains); compilation grows about 0.2-0.6 s because
  the fused domain units are now inlined into the scheduler.

BREAKING CHANGE: the scheduler slots gain `defer_limit_settle` and TB settle
requests carry their reads; appended native images use container version 56
and must be regenerated.

Change-Id: I592604c0d0cdff07b89cf0054851a136f8369b29
@tignear
tignear force-pushed the stack/tignear/perf/rollup-veryl-testbench-execution/defer-settles-func-their-inputs--592604c0 branch from 18070c2 to 23ea84f Compare October 29, 2026 00:19
@tignear
tignear force-pushed the stack/tignear/perf/rollup-veryl-testbench-execution/roll-compiled-veryl-testbench-execution--f61ef7bf branch from 102f3d5 to 8ade1aa Compare October 29, 2026 00:19
@tignear tignear added the merge-ready Request merging through Mergify after required checks label Oct 29, 2026
@mergify mergify Bot added the queued Mergify queue entry label Oct 29, 2026
@mergify

mergify Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

✅ Merged into master as d31fb10 at 01:03 UTC

Merged together with #2484. 10 min in the queue, 7 min of it CI.

So far

Merge conditions: 8 of 8 met

This pull request

Condition
✅ depends-on = celox-sim/celox#2484

The batch, tested on draft #2504

Condition Required by
✅ check-success = Conventional Commit title —
✅ check-success = Queue validation —
✅ any of: check-success = @github-actions/Lint & Format, check-neutral = @github-actions/Lint & Format, check-skipped = @github-actions/Lint & Format GitHub repository ruleset rule master
✅ any of: check-success = @github-actions/Rust Test & NAPI Build, check-neutral = @github-actions/Rust Test & NAPI Build, check-skipped = @github-actions/Rust Test & NAPI Build GitHub repository ruleset rule master
✅ any of: check-success = @github-actions/JS Test (Ubuntu), check-neutral = @github-actions/JS Test (Ubuntu), check-skipped = @github-actions/JS Test (Ubuntu) GitHub repository ruleset rule master
✅ any of: check-success = @github-actions/Conventional Commit title, check-neutral = @github-actions/Conventional Commit title, check-skipped = @github-actions/Conventional Commit title GitHub repository ruleset rule master
✅ any of: check-success = @github-actions/Queue validation, check-neutral = @github-actions/Queue validation, check-skipped = @github-actions/Queue validation GitHub repository ruleset rule master

Times in UTC · dashboard · how the merge queue works

Base automatically changed from stack/tignear/perf/rollup-veryl-testbench-execution/roll-compiled-veryl-testbench-execution--f61ef7bf to master October 29, 2026 01:02
@mergify
mergify Bot merged commit d31fb10 into master Oct 29, 2026
25 checks passed
@mergify
mergify Bot deleted the stack/tignear/perf/rollup-veryl-testbench-execution/defer-settles-func-their-inputs--592604c0 branch October 29, 2026 01:03
@mergify mergify Bot removed the queued Mergify queue entry label Oct 29, 2026
@github-actions github-actions Bot mentioned this pull request Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-ready Request merging through Mergify after required checks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant