Skip to content

fix(sir-opt): preserve memory and type semantics when hoisting loads - #1665

Merged
mergify[bot] merged 1 commit into
masterfrom
stack/tignear/feat/scalar-floating-point/preserve-memory-type-semantics-hoisting-loads--c942e759
Oct 21, 2026
Merged

mergify[bot] merged 1 commit into
masterfrom
stack/tignear/feat/scalar-floating-point/preserve-memory-type-semantics-hoisting-loads--c942e759

Conversation

@tignear

@tignear tignear commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Common branch-load hoisting could reuse a predecessor load from before an intervening store, so a subsequent display or comparison observed the old value. It also merged different register types and could move definitions across a successor with another predecessor.

Reuse only the latest available matching load, stop across overlapping writes and host interactions, preserve result types, and require the predecessor to dominate both successors. Add direct SIR regressions for intervening stores, bit/logic result types, and multiple predecessors.

Validation: optimizer unit suite and all-target clippy; the complete Celox suite also exercises this fix with the dependent FP changes (12,458 passed before updating the stack base). The dependent PR includes the end-to-end combinational display/assertion reproduction.

Common branch-load hoisting could reuse a predecessor load from before an intervening store, so a subsequent display or comparison observed the old value. It also merged different register types and could move definitions across a successor with another predecessor.

Reuse only the latest available matching load, stop across overlapping writes and host interactions, preserve result types, and require the predecessor to dominate both successors. Add direct SIR regressions for intervening stores, bit/logic result types, and multiple predecessors.

Validation: optimizer unit suite and all-target clippy; the complete Celox suite also exercises this fix with the dependent FP changes (12,458 passed before updating the stack base). The dependent PR includes the end-to-end combinational display/assertion reproduction.
Change-Id: Ic942e7594efecccfac235fdc894549cd151ae4ea
@tignear

tignear commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 fix(sir-opt): preserve memory and type semantics when hoisting loads #1665 👈
2 feat(simulator): support scalar floating-point arithmetic and formatting #1666

@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-20T23:42:52.349189Z
We couldn’t complete this review. Comment @codex review to try again.
82942e3 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.

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

mergify Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 1 hour 55 minutes 43 seconds in the queue, including 1 hour 42 seconds running CI.

Required conditions to merge

@mergify
mergify Bot merged commit 3961115 into master Oct 21, 2026
30 checks passed
@mergify
mergify Bot deleted the stack/tignear/feat/scalar-floating-point/preserve-memory-type-semantics-hoisting-loads--c942e759 branch October 21, 2026 02:34
@mergify mergify Bot removed the queued Mergify queue entry label Oct 21, 2026
tignear added a commit that referenced this pull request Oct 21, 2026
Add Veryl f32/f64 and SystemVerilog shortreal/real/realtime scalar execution across the interpreter, native, Cranelift, and Wasm backends. Preserve IEEE storage while applying numeric arithmetic, comparisons, precision changes, integer conversions through 64 bits, and SV conversion functions at assignments, ports, and subroutine boundaries.

Carry floating-point type metadata through runtime events and testbench arguments so display/write, assertion messages, and file output format numeric values with f/e/g, width, and precision. Include NAPI and browser helper integration and invalidate older native images with container version 22. The stale-load optimization exposed by combinational display capture was fixed in #1665, now included in master.

Validation:
- Pinned official sv-tests, full release-driver runs before/after: 20 fail-to-pass rows across 10 cases, no regressions (2state 462 -> 472 passes; 4state 464 -> 474). Update only those reviewed expectations.
- Full Celox common suite before the master update: 12,458 passed, no failures; known exclusions retained.
- After integrating current master: 776 SV analyzer tests and 3,450 integration tests passed, covering SystemVerilog, FP display/assertions, native image roundtrip in a fresh process, shared JIT cache.
- Affected Rust unit tests and clippy, formatting, Wasm target checks, NAPI rebuild, JS tests and TypeScript checks. Two JS tests timed out under concurrent build load and passed on focused reruns.
- New portable cases exercised through Icarus and Verilator. Known external shortreal/port/format differences are documented in crates/celox-test-suite/LIMITATIONS.md; expected results and retained verification baselines are unchanged.

Veryl analyzer 0.22 mis-evaluates some FP constant expressions before lowering. Those reproductions retain their assertions with targeted ignores; default analyzer folding is preserved to avoid integer generate regressions. Runtime FP display/assertion tests remain enabled. Follow-up: #1657.

Reject real-valued select indices, including parameters and expressions, while preserving integral indices and explicit real-to-integer conversions. A driven-input regression covers the legality check masked by an unrelated undriven-net error in the pinned upstream negative case.

The symbolic bitvector bridge explicitly rejects FP operations rather than treating their payloads as integer arithmetic. The Python proof bridge also reports a typed unsupported result before proof execution. Six FP cases receive explicit reviewed proof-model exceptions, with zero reads and no proof artifacts; malformed IR and transport failures remain hard errors. The integer-folded FP case retains its assertions and receives a targeted known-failure entry for the existing Veryl bug #1657. Existing 771 coverage records were checked against the successful CI proof artifacts and preserved exactly; only the nine newly catalogued cases are added (including two aggregate cases from master). Targeted protocol and gate regressions are run locally; the full proof suite is not rerun locally.

Deferred: wide integer and aggregate numeric conversions (#1653), and direct native FP instruction emission in place of helper calls (#1654).

Refs #1401

Change-Id: Ie4380b73114505db30ac122288d528b078d28a62
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