Skip to content

merge queue: checking #1766 on master (d5a1eff), stacked on #1764 - #1769

Closed
mergify[bot] wants to merge 5 commits into
masterfrom
mergify/merge-queue/57ca6d17c0
Closed

mergify[bot] wants to merge 5 commits into
masterfrom
mergify/merge-queue/57ca6d17c0

Conversation

@mergify

@mergify mergify Bot commented Oct 22, 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 waggish-poire-gl828a of the changes queue, to test #1766 before it merges into master.

What this draft tests

Mergify checks that #1766 still passes CI once combined with everything queued ahead of it. CI runs on this draft's code, built in this order:

  1. master at d5a1eff
  2. the pull request queued ahead of this batch, listed below, which brings the tip to d55b64b
  3. #1766, the pull request of this batch

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

✨ Where it stands: closed

Pull request #1764 ahead in the queue was removed (reason: checks failed).

Follow the changes queue in the dashboard

What happens next

  • Mergify closes this draft.
  • #1766 is still in the queue.

Tip

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

Queued ahead of this batch

This pull request entered the queue before this batch and is not part of it.

  • #1764 — shares the scope core
Metadata for CI tooling, read by mergify ci
---
all_scopes: false
checking_base_sha: d55b64b86d49cc9ee82785807474f0f456cd4237
previous_check_retries: []
previous_failed_batches: []
pull_requests:
  - number: 1766
    scopes:
      - core
scopes:
  - core
...
1 scope
  • core
Required conditions of queue rule changes for merge
  • check-success = Queue validation
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-neutral = @github-actions/Rust Test & NAPI Build
    • check-skipped = @github-actions/Rust Test & NAPI Build
    • check-success = @github-actions/Rust Test & NAPI Build
  • check-success = Conventional Commit title
  • 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/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

tignear and others added 5 commits October 23, 2026 01:59
…e time slot

## Summary

IEEE 1800-2023 4.3, 4.5 and 10.4.2 make every change of a variable's value an update event, which schedules the processes sensitive to it, even when a later write in the same time slot restores the old value. Celox compared values only at the end of an evaluation, so it missed these changes in four cases:

| Writer | Reader | Before | Now |
|---|---|---|---|
| process: `a = 1; a = 0;` | `always_comb` (immediate assertion, `$display`) | not run again | runs again |
| process: `a <= 1; a <= 0;` | `always_comb` | not run again | runs again |
| `always_ff`: `a <= 1; a <= 0;` (or blocking) | `@(a)`, `@(posedge a)`, `always_comb` | no event | event |
| the same `always_ff` pulse, in a design without processes | another FF domain clocked by `a` | domain does not fire | fires |

Icarus 13.0 gives the same results on an equivalent design. A glitch between two combinational processes is still allowed, since that ordering is legal.

**Occurrence counters.**
- The SV frontend gives each sensitivity atom of an `always_comb` activation group a counter (`CombObserver::sensitivity_counters`).
- Assembly turns these, and the existing counted signals, into probes (`RuntimeSchema::occurrence_probes`).
- An FF evaluation unit that stores to a probed or counted signal more than once bumps its counter at each store that changes the value.
- Kernel blocking writes and published nonblocking updates bump the counters through `ProbeRefs`, once per counter per write.
- An observer is active when its values or its counters differ from the last snapshot (`RuntimeCombObserver::occurrence_counters`).

**Batch path.** A design with counted signals but no processes now stays on the batch step (`ScheduleModel::timed` is `!processes.is_empty()`). `batch_round` checks the counters after each evaluation and adds their domains to the approved edges. The first version moved such designs to the timed path, which cost 17.8% on the divided-clock design below; this costs 7.0%.

**Observer snapshots.** `comb_activation::ObserverReads` resolves the reads once. A range of a signal of at most 64 bits is read as a `u64` (with its mask plane in four-state), and only wider signals use `BigUint`. Groups are numbered densely, so the activation check is O(observers). The old check read every range as `BigUint`.

## Perf

callgrind instructions inside `SimulationState::step_until`, native backend (cranelift matches). Each design has 64 `always_ff` registers, each writing a default and then overriding it.

| design | base | this PR | change |
|---|---|---|---|
| plain | 115.60M | 115.82M | +0.19% |
| divider: an FF writes a derived clock twice per edge, a second FF counts on it | 155.24M | 166.06M | +7.0% |
| assert: plus 64 `always_comb` immediate assertions | 319.35M | 51.24M | −84% |

- **plain:** the JIT code's cost is identical (9,100,455 in both). The difference comes from inlining in the Rust runtime. A const-generic split and an out-of-line counter check both measured worse (+0.67%, +0.33%).
- **divider:** the counter check that correctness requires. Setting trigger bits from the JIT would remove most of it, but that is a larger change.
- **assert:** the word reads replace `BigUint` snapshots. With `BigUint` counter reads this design was +50%.

## Validation

- New `crates/celox/tests/sv_update_events.rs`: 9 cases on the interpreter, cranelift, native and wasm backends (36 tests). They cover:
  - blocking, process-NBA and FF-NBA restores running `always_comb` again;
  - assertions reporting again;
  - FF NBA and blocking pulses waking `@(a)` and `@(posedge a)`;
  - no event when the value is kept;
  - exclusive branches as one event;
  - an FF pulse firing a domain in a design without processes.
- Cross-checked the expected values against Icarus 13.0.
- `cargo nextest run` on celox, celox-frontend-{core,sv,veryl}, celox-runtime, celox-design, celox-slt, celox-test-suite, celox-vpi and celox-napi with CI's features (`celox/systemverilog,celox-test-suite/verilator,celox-test-suite/icarus`): 14,020 passed, 330 skipped.
- sv-tests conformance (`conformance/sv-tests/run.py`): unchanged from `expected.tsv`.
- `cargo clippy --workspace --all-targets` with CI's features and `-D warnings`, `cargo fmt --check`.

Not covered:
- Veryl observers get no sensitivity counters.
- Targets with both blocking and nonblocking writers (`NbaStage`) are not instrumented.
- Host writes do not bump counters.

## BREAKING CHANGE

New public fields:
- `celox_slt::CombObserver::sensitivity_counters`
- `celox_design::RuntimeCombObserver::occurrence_counters` (serde default: empty)
- `celox_design::RuntimeSchema::occurrence_probes`
- `celox_design::schedule::ScheduleModel::probes`

`ScheduleModel::timed` no longer counts counted signals.

Change-Id: I3c9de5c5bc7e26c31765c9a6d45a9e04287eabaf
Change-Id: Ieb4eecbfe1dd50186a513da2a12cd3147ad7d428
Casts of divisions and remainders could fail with unknown operand signedness
because the internal zero-divisor guard has an untyped unknown arm. Infer the
guard's signedness and width from its operation, and avoid inserting guards
again when binding an enclosing expression. This also preserves signed
arithmetic in four-state lowering instead of creating nested unsigned muxes.

Evaluate signing-cast operands in their original type before changing the
result sign, so unsigned'(a / b) does not turn a signed division unsigned.
Add two shared regressions for mixed signs, parameter divisors, narrowing,
nested divisions, signing/type casts, and four-state zero-divisor results.

Validation:
- Full SV suite: 3952 passed, 20 existing ignored across five backends.
- Analyzer unit tests: 791 passed, 3 existing ignored.
- Shared suite unit tests: 46 passed, 2 existing ignored.
- Icarus: both new cases passed. Verilator: ordinary case passed; the adapter
  reports the four-state case unsupported due to four-state expectations.
- Affected library/harness Clippy (-D warnings), cargo fmt and diff checks pass.
- Unchanged Taxi sources with O1/two-state pass 29 cocotb tests across
  mac_ctrl_rx[8], mac_ctrl_tx[8], and zircon_ip_len_cksum[32], with zero skips.
  Three other previously cast-blocked configurations now reach existing
  $size or SERDES array-range blockers. All 52 resolved SV source fingerprints
  match the original audit; no optimization settings or exclusions changed.

Change-Id: I560b79b58966e9083629921a4dbf6563ff5d09f3
@mergify mergify Bot closed this Oct 22, 2026
@mergify
mergify Bot deleted the mergify/merge-queue/57ca6d17c0 branch October 22, 2026 19:10
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