Skip to content

merge queue: checking #1884 + #1838 + #1847 together on master (090052d), stacked on 4 pull requests ahead - #1906

Closed
mergify[bot] wants to merge 16 commits into
masterfrom
mergify/merge-queue/0377d07009
Closed

mergify[bot] wants to merge 16 commits into
masterfrom
mergify/merge-queue/0377d07009

Conversation

@mergify

@mergify mergify Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Note

This is a merge queue draft opened by Mergify. Nobody needs to act on it.
Mergify opened it for batch general-brandade-9x6t89 of the changes queue, to test #1884, #1838 and #1847 before they merge into master. Pushing to this branch or closing this pull request removes them from the queue.

What this draft tests

Mergify checks that #1884, #1838 and #1847 still pass CI once combined with everything queued ahead of them. CI runs on this draft's code, built in this order:

  1. master at 090052d
  2. the 4 pull requests queued ahead of this batch, listed below, which bring the tip to 2740211
  3. #1884 + #1838 + #1847, the pull requests of this batch, tested together as one tip

The check is speculative: it assumes the pull requests ahead will merge, so it starts without waiting for them.

🎉 Where it stands: checks passed

CI passed on this draft.

Follow the changes queue in the dashboard

What happens next

  • Once the pull requests ahead have merged, Mergify merges #1884, #1838 and #1847 into master and closes this draft.
  • If a pull request ahead fails or leaves the queue without merging, this batch is requeued and checked again on a new draft: these checks assumed it would merge.

Tip

A red check is not necessarily caused by this batch. These checks run on a tip that also carries the commits of the 4 pull requests ahead, so a failure here can come from them as much as from #1884 + #1838 + #1847. See only this batch's changes.

Queued ahead of this batch

These pull requests entered the queue before this batch and are not part of it.

Metadata for CI tooling, read by mergify ci
---
all_scopes: false
checking_base_sha: 2740211caafd06934ac3b52415fc2e15171545fc
previous_check_retries: []
previous_failed_batches: []
pull_requests:
  - number: 1884
    scopes:
      - core
  - number: 1838
    scopes:
      - core
  - number: 1847
    scopes:
      - core
scopes:
  - core
...
1 scope
  • core
Required conditions of queue rule changes for merge
  • check-success = Conventional Commit title
  • check-success = Queue validation
  • depends-on = celox-sim/celox#1838 [⛓️ feat(sv): support class enum randomization #1838]
  • 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
Required conditions to stay in the queue
Queue graph

The diagram is not laid out in queue order, so a node's position says nothing about when it merges.

graph LR
    4cf6fd4378e544bcb922d420445e1092["general-brandade-9x6t89<br/>#1884 + #1838 + #1847<br/>scopes: core"]
    0e63e7c109d54f159ca43f2c852590db["thick-gesier-etpr4c<br/>#1907<br/>scopes: core"]
    4cf6fd4378e544bcb922d420445e1092 --> 0e63e7c109d54f159ca43f2c852590db
    style 4cf6fd4378e544bcb922d420445e1092 fill:#6366f1,color:#fff
Loading

tignear and others added 16 commits October 24, 2026 16:18
Add an opt-in shared executor with runtime corpus loading while preserving existing libtest registrations and nextest scheduling. Avoid Rust rebuilds for vtest body edits and retain the embedded in-process path.

Change-Id: I782a196b4d4b952a7c5122984f2f9785cc61d153
Prepare the shared executor once for full and scoped Celox runs, fail when setup is missing, and warm both Cargo profiles under a matching cache key.

Change-Id: I3bc134b06e3bf4fce8f1ed2e8a36ce7e0a6f629b
Allow rand enum properties and randomize(member) selection of enum properties
in unconstrained classes. Preserve declared enum domains through type aliases
and select only their declared values with rejection sampling, including sparse,
negative, implicit, singleton, and 64-bit values. Normalize unbased fill
initializers to the enum base width and signedness before evaluation. Keep rand_mode, inherited
properties, dynamic dispatch, and per-object seeding behavior intact.

Keep unsupported or unresolved enum domains explicit rather than randomizing
the underlying integer. Reject duplicate values, overflowing implicit values,
and X/Z domains. Scope randomization of enums, arrays, and class properties
wider than 64 bits remain outside this change.

Add four shared regression cases and an analyzer rejection test; update the
English and Japanese references. Retain narrow external-tool failure evidence:
Verilator 5.052 passes the direct enum, inheritance, and unbased fill cases but randomizes an
enum typedef alias as raw integer bits. Icarus 13.0 cannot elaborate class
randomization methods in these four cases. Shared assertions are unchanged.

Validation:
- Analyzer unit tests: 796 passed, 3 existing ignores.
- Differential SystemVerilog class suite across backends: 179 passed.
- Retained external evidence checks: 3 passed.
- NAPI build and JavaScript integration: 432 passed.
- Analyzer Clippy, formatting, and diff checks pass.
- Unbased fill regression: all five backend variants fail before the fix and
  pass afterward; Verilator also passes the unchanged assertions.
- All four new shared cases exercised with Verilator and Icarus; the limitations
  above are documented with original diagnostics in verification/repros.

Change-Id: I076dfe023e39722af4f294144ffae2c202085d52
Support scalar enums in randomize(e) and std::randomize(e), selecting only declared values with unbiased rejection sampling from the process RNG. Preserve enum domains through aliases and local variables, allow mixed enum/integer arguments, and retain short-circuit evaluation and checkpoint replay.

Add shared domain and evaluation-order regressions plus Celox checkpoint and forced-rejection tests. Document the observed Icarus 13.0 compile limitation and Verilator 5.052 enum-domain mismatch with narrowly scoped exclusions and reproduction evidence.

Validation: analyzer 796 and frontend 4 unit tests; 708 system-function regressions; 4 forced-rejection backend tests; retained-report checks (3); NAPI build and JS tests (432); affected-crate Clippy, cargo fmt and diff checks. Both new shared cases were exercised with Icarus and Verilator; their failures are retained as the tool limitations described above.

BREAKING CHANGE: The public celox-sv-analyzer SystemFunction enum gains ScopeRandomizeEnum; downstream exhaustive matches must handle this variant.

Change-Id: I2e07aafc25d024b216ce17760324265e3719055d
Change-Id: I28a4e411f6de79c7e30511682cd78111ff7f9490
BitExtractPeephole rewrote `(load >> k) & mask` as a mask-width load and
retyped the And's destination to the mask width. Its users still expected
the And's own width, e.g. `((a >> 4) & 15) == 32'd9` compared a 4-bit
register with a 32-bit one. Cranelift tolerated the ill-typed SIR; the
native merged-chain verifier rejected it at O1/O2 (#1854).

Keep the destination type: load the field into a fresh register and
zero-extend it with a Concat when the mask is narrower than the result,
and load only the result width when the mask is wider.

Fixes #1854

Change-Id: Icc91ce47ea0358c2f3eb597eaf151257a7c536d7
An edge process that writes an unpacked array by a nonblocking assignment
at a run-time element seeded the whole array into its next state and
committed all of it back on every edge. Each edge cost O(array size), and
the generated code and compile time grew with the array (#1855).

Such an array now uses the sparse next-state protocol that shared edge
memories (and Veryl's dynamic writes) already use: element stores mark
dirty 64-bit chunks, and the commit copies only those.

Precondition, decided in `edge_only_memories()` (lowering.rs):
- all local drivers of the array are edge processes of its module, and
- the process writes it only by nonblocking constant-range or element
  writes, at least one at a run-time element (no blocking, whole-array or
  read-modify-write assignment).
Every other array keeps the full next state. The function's doc comment is
the hook for writers outside the module (hierarchical references, #1856).

A write by another process between the evaluation and the NBA region
(e.g. a `#0` resumption of an `initial`) is clobbered by the commit. This
is pre-existing for every edge-process target, not only arrays, and is
tracked and fixed separately in #1864. This change only narrows it: the
sparse commit rewrites the dirty chunks, where the old one rewrote the
whole array.

Performance (100,000 cycles, `celox run --two-state --unlimited --backend
cranelift`, release build, user time, `taskset -c 8-11`):

| b3_mem_sweep | master | this |
|---|---:|---:|
| 2^10 | 0.12 s | 0.07 s |
| 2^12 | 0.20 s | 0.07 s |
| 2^14 | 0.64 s | 0.07 s |
| 2^16 | 4.26 s | 0.09 s |
| 2^22 (heliodor-dev) | 2-cycle startup alone 86.8 s user, 3.7 GB | full run 0.50 s, 125 MB |
| 2^22 four-state (heliodor-dev) | - | full run 0.44 s |

Startup of the 2-cycle variants (heliodor-dev): 2^16 0.88 s -> 0.01 s
user; 2^22 110 s wall / 3.7 GB -> 0.36 s / 125 MB. Compile time and
memory had the same cause.

Unaffected workloads (callgrind, release): b2_vm_dispatch_bit.sv generates
identical JIT code; whole-program 44.51 G -> 44.57 G instructions (+0.12%),
all in compile-time functions this change does not touch, with identical
call counts (e.g. `DriverScan::body` 56,773,692 calls in both). A Veryl
64K-word dynamic-index memory workload: identical JIT code, 188.40 M ->
188.80 M (+0.2%, about 4 host instructions per cycle in
`testbench::clock_periods` and two runtime-event helpers this change does
not touch). Both are code-layout differences of the LTO build.

Validation:
- `cargo test -p celox --features systemverilog --test systemverilog`:
  4372 passed.
- New shared case `procedural::nonblocking_runtime_element_writes_apply_in_order`
  (cranelift, native, wasm, parallel variants), passes on Verilator 5.052
  and Icarus 13.0 (`verify-sv-verilator`, `verify-sv-icarus`).
- New IR test `nonblocking_runtime_element_writes_use_sparse_next_state`
  (sparse for NBA element writes; full next state with a blocking or
  whole-array write).
- A semantics stress design (multiple NBAs to one element, reads of old
  values, part-select merge, constant elements, X index) gives identical
  results to master on cranelift, interpreter, native O0 and wasm, two-
  and four-state; four-state matches xezim.
- `cargo clippy -p celox-frontend-sv -p celox --features
  celox/systemverilog --tests`, `cargo fmt --check`.

Closes #1855

Change-Id: I04824191d94b708b96866eab3e40f39eea515417
An edge process evaluates into a next state seeded from stable state, and
its NBA commit copies the whole written range back. A process kernel that
writes the same variable after the evaluation and before the NBA region,
such as a `#0` resumption or a process the edge's blocking result wakes,
lost its write, even in bits no nonblocking assignment touched and when
no nonblocking assignment executed (#1864). An NBA update changes only the
bits its lvalue names (IEEE 1800-2023 10.4.2), and the NBA region follows
the active and inactive regions (4.4.2.4).

Such a variable now goes through the exact staging that variables written
both by blocking and nonblocking assignments already use: the nonblocking
assignments write a staging value and mark a written-bit mask, and the NBA
region merges `stable = (stable & ~mask) | (value & mask)`. The variable
has no seed or whole-range commit. An unpacked array merges element by
element in a loop, and its mask is cleared by a commit from its zero
stable copy.

The change is per signal. `kernel_window_writes()` (lowering.rs) collects
the variables a process kernel of the module may write after it first
suspends. Code before the first timing control of an `initial` runs at
time zero before any domain evaluates, so memory initialization by
`initial` loops or `$readmemh` does not count. A process stages only
those of its nonblocking targets it does not also write by blocking
assignments or in called subroutines. Every other signal keeps today's
code, and #1855's sparse array publication still applies to arrays
without such a writer. Writers from other modules (hierarchical
references, #1856) have to be added to `kernel_window_writes()`. A staged
array costs O(array size) per edge, as before #1855.

Not covered, keeping the previous behavior: nonblocking assignments in
subroutines the edge process calls, and host writes while a `$stop`
suspends a round after a domain evaluated.

Repros from #1864 (plain `always @(posedge clk)`; with `always_ff` a second
writer is illegal, 9.2.2.4 → 9.2.2.2), `celox run --top <m> --unlimited`
on cranelift, interpreter, native O0 and wasm, two- and four-state, all
now match Icarus 13.0:

| Case | Expected (Icarus) | Before | After |
|---|---|---|---|
| win_c_al | `m0=00001122` | `m0=00001100` | expected |
| win_d_al | `m0=00000011 m1=00000022 m5=00000033` | `m1=00000000 m5=00000000` | expected |
| win_e_al | `q=00000022 r=00100008` | `q=00000000 r=00000008` | expected |
| active-region wake | `q=22 p=44` | `q=00 p=44` | expected |

Performance (callgrind, heliodor-dev, this vs #1855): no signal of these
workloads is staged, and their JIT code executes the same instruction
counts (b2_vm_dispatch_bit 411.55 M, Veryl 64K-word memory workload
15.19 M, b3_mem_sweep_14 0.43 M per run). Whole program: b2 46.686 G ->
46.683 G, Veryl 217.23 M -> 217.26 M, b3_mem_sweep_14 139.07 M -> 139.16 M
(within 0.07%).

Validation:
- New shared cases `timing::edge_nonblocking_updates_keep_later_writes_of_other_bits`,
  `timing::edge_nonblocking_updates_follow_writes_their_blocking_results_wake`
  and `timing::edge_blocking_results_precede_later_process_writes` on
  cranelift, native, wasm and parallel variants. The first two fail
  without this change. All three pass on Verilator 5.052 and Icarus 13.0.
- `cargo test -p celox --features systemverilog --test systemverilog`:
  4462 passed. `cargo test -p celox-frontend-sv`.
- `cargo clippy -p celox-frontend-sv -p celox --features
  celox/systemverilog --tests`, `cargo fmt --check`.

Closes #1864

Change-Id: I8356911ef0608ae6eb0175147ca64ddc8881f7b9
An edge of an event whose derived clock domains have a plan the
derived-edge generator emits (two-state, gated clocks with gate
programs) now runs as one generated unit per edge direction instead of
the Rust walk of DerivedTickPlan: Simulator::edge, and so tick, posedge
and negedge, move the signal, set the scheduler's dirty flag to tell
the unit whether to settle first, and run the unit. Coincident edges
(edges, tick_events) and other plans keep the walk, as do timed
simulations with $finish sites, designs with comb observers or fatal
comb assertions.

The units are on by default from O1 up. A new selector,
SirPass::DerivedEdgeUnits ("derived_edge_units", -sir:derived_edge_units
in pass overrides), turns them off, trading tick speed for build time:
they compile the clock's domain once more. The tiered backend's baseline
image leaves them out and walks the plans until the optimizing image,
which has them, is adopted (SimBackend::runs_derived_edge_units).

tick_semantics now runs every host operation both ways against the
timed reference, with a divider and a gate whose enable the clock's own
domain raises. The coincident case of that gate is checked against
Icarus and ignored until the timed reference sees its edge (#1860).

BREAKING CHANGE: RuntimeSchema has a new field, derived_edges, and
DerivedEdgeUnits is new; SirPass has a new variant, DerivedEdgeUnits. Native images use container format 34; images
written by earlier versions must be rebuilt.

Change-Id: I3436fa1ddc580c66794b40a26866c297ef9cde98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant