Skip to content

test(sv): timed scheduler boundary cases and scheduler bench - #1717

Merged
mergify[bot] merged 2 commits into
masterfrom
feature/compiled-scheduler-3b1
Oct 22, 2026
Merged

mergify[bot] merged 2 commits into
masterfrom
feature/compiled-scheduler-3b1

Conversation

@tignear

@tignear tignear commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Part of #1123, step 3b-1 (compiled scheduler), PR 1 of 7. This adds test cases and a benchmark only; no runtime code changes.

Boundary cases (timing.vtest)

These are the places where a generated time-slot loop could diverge from the Rust reference loop. Each case's result is independent of the order IEEE 1800-2023 4.5 leaves open between processes of one region.

  • zero_delay_process_ends_a_pulse_after_its_edge_triggers: #0 puts the falling write in the inactive region, after the domain the rising edge triggered.
  • edge_waits_count_generated_clock_edges_in_any_declaration_order: an edge wait declared before or after the clock process, and a negedge wait that no flip-flop domain uses.
  • delay_process_nonblocking_updates_reach_later_edges: NBA from a process that only delays.
  • variable_delay_clock_changes_its_period: a non-constant delay.
  • asynchronous_reset_driven_by_a_delay_process
  • generated_clocks_with_a_common_edge_sample_each_other: two domains firing in one slot.
  • script_writes_between_runs_reach_generated_clock_domains: a host write between run_until calls must reach comb logic (this guards the later settle-skipping PR).
  • edge_waits_on_script_inputs_next_to_a_generated_clock
  • finish_from_a_delay_process_between_clock_edges

Benchmark example

crates/celox/examples/sched_bench.rs (needs systemverilog) measures scheduler overhead per cycle with callgrind: whole-program Ir at 200,000 cycles minus Ir at 20,000, divided by 180,000, median of 5 runs. The design is 64 registers rK <= rK + (seed ^ K).

Baseline at 144bbcc:

Variant Ir/cycle of which JIT
(a) Simulator::tick 662 461
(ac) Simulation + add_clock 6,148 729
(b1) always #5 clk = ~clk + initial forever @(posedge clk) stim = stim + 3 10,285 947
(b5) the same with stim <= stim + 3 13,412 975

Perf effect: none (no runtime change).

Validation

  • cargo test --locked -p celox --features systemverilog --test systemverilog timing:: (native, cranelift, native/cranelift parallel, wasm): 444 passed, 0 ignored (after rebasing onto feat(sv): lower expression events and @* in processes #1681).
  • verify-sv-icarus --filter timing::: 78 passed, 1 ignored (existing).
  • verify-sv-verilator --filter timing::: 75 passed, 1 ignored and 3 unsupported (existing four-state cases).
  • All 9 new cases pass on both oracles. No checked-in oracle result changes (CONTRIBUTING: new passing cases need no refresh).
  • cargo fmt --check, and clippy on the example: clean.

@chatgpt-codex-connector

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 ⚠️ Failed 2026-10-22T02:15:35.815092Z
We couldn’t complete this review. Comment @codex review to try again.
8c2fee8 PR opened
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Cover the points where a compiled scheduler may diverge from the
reference loop: #0 pulses, edge waits by declaration order, NBA from
delay-only processes, variable delays, asynchronous resets and common
edges of generated clocks, host writes between runs and $finish
between edges.

Change-Id: Ie229a32418f7a7f7f9c2142043ad7d08f3760875
Change-Id: Ib9250ea1a74a4470b3f128750cf2cdbdc8439f03
@tignear
tignear force-pushed the feature/compiled-scheduler-3b1 branch from 8c2fee8 to a48aa06 Compare October 22, 2026 02:48
@mergify

mergify Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Queued — the merge queue status continues in this comment ↓.

@tignear tignear added the merge-ready Request merging through Mergify after required checks label Oct 22, 2026
@mergify mergify Bot added the queued Mergify queue entry label Oct 22, 2026
@mergify

mergify Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 1 hour 17 minutes 46 seconds in the queue, including 1 hour 6 minutes 51 seconds running CI.

Required conditions to merge
  • check-success = Conventional Commit title
  • check-success = Queue validation
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/Lint & Format
    • check-neutral = @github-actions/Lint & Format
    • check-skipped = @github-actions/Lint & Format
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/NAPI Build (Linux ARM64 GNU)
    • check-neutral = @github-actions/NAPI Build (Linux ARM64 GNU)
    • check-skipped = @github-actions/NAPI Build (Linux ARM64 GNU)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/NAPI Build (Windows)
    • check-neutral = @github-actions/NAPI Build (Windows)
    • check-skipped = @github-actions/NAPI Build (Windows)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/Rust Test & NAPI Build
    • check-neutral = @github-actions/Rust Test & NAPI Build
    • check-skipped = @github-actions/Rust Test & NAPI Build
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/JS Test (Ubuntu)
    • check-neutral = @github-actions/JS Test (Ubuntu)
    • check-skipped = @github-actions/JS Test (Ubuntu)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/JS Test (Windows)
    • check-neutral = @github-actions/JS Test (Windows)
    • check-skipped = @github-actions/JS Test (Windows)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/Conventional Commit title
    • check-neutral = @github-actions/Conventional Commit title
    • check-skipped = @github-actions/Conventional Commit title

@mergify
mergify Bot merged commit 4467534 into master Oct 22, 2026
32 of 33 checks passed
@mergify
mergify Bot deleted the feature/compiled-scheduler-3b1 branch October 22, 2026 12:04
@mergify mergify Bot removed the queued Mergify queue entry label Oct 22, 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