Skip to content

Reduce SV case-local packed replay mux allocations - #543

Merged
xtofalex merged 2 commits into
mainfrom
sv-case-packed
Nov 19, 2026
Merged

xtofalex merged 2 commits into
mainfrom
sv-case-packed

Conversation

@xtofalex

Copy link
Copy Markdown
Collaborator

Case replay previously materialized complete packed local values at every arm merge, leaving repeated common-arm muxes for the post-load cleanup. Extend the case-local scalar accumulator to complete integral values using declared width and whole-write eligibility. Keep arm/selector/item/guard evaluation eager, pending values outside active replay environments and caches, and materialization at incompatible merges and each case exit.

Partial writes, subroutine copy-outs, scheduling replay, active loops and uncertain effects retain conservative fallbacks. Both frontend cleanup calls remain enabled; VHDL lowering and primitive semantics are unchanged.

Measured against c9563f30 (#542):

  • Avoids all 26 identified packed case-replay mux allocations / 130 bits in Ibex; actual creation events fall 1,908 → 1,882.
  • Direct cleanup remains necessary: 150 removals / 614 bits in Ibex and 18 / 340 in AES VHDL. Final mux totals are unchanged.
  • The report and CSV evidence retain all 216 paired performance samples. No loading-time improvement or causal memory benefit is established.

Validation:

  • CMake Release: 1,370 SV, 269 VHDL, 15 HDL helper, 11 mux utility, and 365 serialization tests passed; the determinism CTest contract passed.
  • The latest cross-process determinism script passed 47 tests against each uninstrumented Release archive, including snapshot round trips and cold reloads.
  • Synthetic coverage includes multiple widths/range directions, signed/unsigned values, both helper common-arm orientations, identical positions/multiple changed runs, partial/permuted rejection, reads/sharing, nested exits and fallback boundaries. Icarus passed 4,096 four-state data/binary-control combinations.
  • REUSE lint and diff whitespace checks passed.

Validation limits: source-based Bazel selected matching dependencies but executed zero tests, blocked by the local Xcode SDK absolute include check for SDKSettings.json. Four historical stress inputs were unavailable, limiting measurements to nine workloads; the regenerated Ibex file list has a different byte hash, while all 235 other available historical source/include hashes match. CMake/Bazel parity remains unverified.

Details: implementation, measurements and limits.

@codecov-commenter

codecov-commenter commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed

codspeed Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 14 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 111 untouched benchmarks


Comparing sv-case-packed (a66c949) with main (c9563f3)

Open in CodSpeed

@xtofalex
xtofalex merged commit f05f613 into main Nov 19, 2026
176 of 183 checks passed
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.

2 participants