Skip to content

feat(testbench)!: keep strings in a heap referenced from state memory - #1679

Merged
mergify[bot] merged 1 commit into
masterfrom
stack/tignear/feat/string-class-heap/keep-strings-heap-referenced-state-memory--dff2d83d
Oct 22, 2026
Merged

mergify[bot] merged 1 commit into
masterfrom
stack/tignear/feat/string-class-heap/keep-strings-heap-referenced-state-memory--dff2d83d

Conversation

@tignear

@tignear tignear commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Testbench string variables now hold 32-bit handles into a per-simulator
heap instead of keys into a side table. This is the first step of the
shared string/class runtime design (#1400): one heap, handles that stay
position independent, and a collector whose roots are the typed handle
slots of state memory.

  • Add celox-heap: interned, immutable strings, so equal contents have
    equal handles and stores, commits, change detection and == stay
    integer operations. Handle 0 is "", the value of zero-initialized
    memory. A mark-sweep collection frees strings no root refers to.
  • Record each state object's value kind in VariableMetadata. Veryl
    string elements become 32-bit two-state handle slots.
  • The testbench VM loads and stores handles in those slots. Collections
    run between sequential statements and between concurrent process polls,
    with the saved temporaries of suspended processes as extra roots. This
    also gives each process its own string temporaries, which the old
    side table shared.
  • Checkpoints keep the heap. State files record referenced strings by
    contents in a new strings section and re-intern them on load, so they
    no longer reject testbench strings and stay portable between builds.
  • VCD output leaves handle slots out until strings have a waveform
    representation.

BREAKING CHANGE: celox_testbench::TestbenchStrings and
CompiledExpr::eval_with_strings are removed; evaluate with
CompiledExpr::eval_with_heap and a celox_heap::Heap. State files that
contain strings set a new flag and are not readable by older builds.

Refs #1400

@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-21T03:28:42.477185Z
We couldn’t complete this review. Comment @codex review to try again.
42f160c 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.

@mergify

mergify Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

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

@tignear
tignear force-pushed the stack/tignear/feat/string-class-heap/keep-strings-heap-referenced-state-memory--dff2d83d branch from 42f160c to ed3261e Compare October 21, 2026 05:44
@tignear

tignear commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Revision history

# Type Changes Reason Date
1 initial 42f160c 2026-10-21 05:43 UTC
2 content 42f160c → ed3261e 2026-10-21 05:43 UTC
3 content ed3261e → 4289f08 Rebased onto master; add value_kind to the VariableMetadata initializers that #1627 introduced (merge-queue build failure). 2026-10-22 01:03 UTC

@tignear

tignear commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 feat(testbench)!: keep strings in a heap referenced from state memory #1679 👈
2 feat(sv)!: support string variables and their operations #1688
3 feat(sv)!: support classes with properties, methods and constructors #1689
4 feat(sv): support static class members, super and base constructors #1696

@tignear tignear added the merge-ready Request merging through Mergify after required checks label Oct 21, 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 19 minutes 18 seconds in the queue, including 14 minutes 22 seconds running CI.

Reason

The merge conditions cannot be satisfied due to failing checks

  • Lint & Format

Failing checks:

Hint

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Waiting for
  • check-success = Queue validation
  • any of: [🛡 GitHub repository ruleset rule master]
    • check-neutral = @github-actions/Lint & Format
    • check-skipped = @github-actions/Lint & Format
    • check-success = @github-actions/Lint & Format
  • any of: [🛡 GitHub repository ruleset rule master]
    • check-neutral = @github-actions/NAPI Build (Linux ARM64 GNU)
    • check-skipped = @github-actions/NAPI Build (Linux ARM64 GNU)
    • check-success = @github-actions/NAPI Build (Linux ARM64 GNU)
  • any of: [🛡 GitHub repository ruleset rule master]
    • check-neutral = @github-actions/NAPI Build (Windows)
    • check-skipped = @github-actions/NAPI Build (Windows)
    • check-success = @github-actions/NAPI Build (Windows)
  • 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
  • any of: [🛡 GitHub repository ruleset rule master]
    • check-neutral = @github-actions/JS Test (Ubuntu)
    • check-skipped = @github-actions/JS Test (Ubuntu)
    • check-success = @github-actions/JS Test (Ubuntu)
  • any of: [🛡 GitHub repository ruleset rule master]
    • check-neutral = @github-actions/JS Test (Windows)
    • check-skipped = @github-actions/JS Test (Windows)
    • check-success = @github-actions/JS Test (Windows)
All conditions
  • check-success = Queue validation
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-neutral = @github-actions/Lint & Format
    • check-skipped = @github-actions/Lint & Format
    • check-success = @github-actions/Lint & Format
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-neutral = @github-actions/NAPI Build (Linux ARM64 GNU)
    • check-skipped = @github-actions/NAPI Build (Linux ARM64 GNU)
    • check-success = @github-actions/NAPI Build (Linux ARM64 GNU)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-neutral = @github-actions/NAPI Build (Windows)
    • check-skipped = @github-actions/NAPI Build (Windows)
    • check-success = @github-actions/NAPI Build (Windows)
  • 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
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-neutral = @github-actions/JS Test (Ubuntu)
    • check-skipped = @github-actions/JS Test (Ubuntu)
    • check-success = @github-actions/JS Test (Ubuntu)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-neutral = @github-actions/JS Test (Windows)
    • check-skipped = @github-actions/JS Test (Windows)
    • check-success = @github-actions/JS Test (Windows)
  • check-success = Conventional Commit title
  • 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

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

Testbench string variables now hold 32-bit handles into a per-simulator
heap instead of keys into a side table. This is the first step of the
shared string/class runtime design (#1400): one heap, handles that stay
position independent, and a collector whose roots are the typed handle
slots of state memory.

- Add `celox-heap`: interned, immutable strings, so equal contents have
  equal handles and stores, commits, change detection and `==` stay
  integer operations. Handle 0 is `""`, the value of zero-initialized
  memory. A mark-sweep collection frees strings no root refers to.
- Record each state object's value kind in `VariableMetadata`. Veryl
  `string` elements become 32-bit two-state handle slots.
- The testbench VM loads and stores handles in those slots. Collections
  run between sequential statements and between concurrent process polls,
  with the saved temporaries of suspended processes as extra roots. This
  also gives each process its own string temporaries, which the old
  side table shared.
- Checkpoints keep the heap. State files record referenced strings by
  contents in a new strings section and re-intern them on load, so they
  no longer reject testbench strings and stay portable between builds.
- VCD output leaves handle slots out until strings have a waveform
  representation.

BREAKING CHANGE: `celox_testbench::TestbenchStrings` and
`CompiledExpr::eval_with_strings` are removed; evaluate with
`CompiledExpr::eval_with_heap` and a `celox_heap::Heap`. State files that
contain strings set a new flag and are not readable by older builds.

Refs #1400

Change-Id: Idff2d83dfd8e9a4e706f73087b77d6292a1b990a
@tignear
tignear force-pushed the stack/tignear/feat/string-class-heap/keep-strings-heap-referenced-state-memory--dff2d83d branch from ed3261e to 4289f08 Compare October 22, 2026 01:04
@mergify mergify Bot added queued Mergify queue entry and removed dequeued Mergify stopped this queue entry; investigate before retrying labels Oct 22, 2026
@mergify

mergify Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 1 hour 28 minutes 14 seconds in the queue, including 1 hour 27 minutes 32 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 3430315 into master Oct 22, 2026
30 of 33 checks passed
@mergify
mergify Bot deleted the stack/tignear/feat/string-class-heap/keep-strings-heap-referenced-state-memory--dff2d83d branch October 22, 2026 03:54
@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