Skip to content

feat(testbench)!: support basic Veryl string values - #1371

Merged
mergify[bot] merged 5 commits into
masterfrom
feat/veryl-tb-strings
Oct 16, 2026
Merged

mergify[bot] merged 5 commits into
masterfrom
feat/veryl-tb-strings

Conversation

@tignear

@tignear tignear commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Stage 2 of 2; based on #1370. Merge the test PR first, then retarget this PR to master.

Veryl testbench string assignments currently truncate to the nominal one-bit width, so even assigning "short" and comparing it with the same literal fails. Store strings as dynamically sized byte values owned by each simulator, with dedicated bytecode loads/stores and lexicographic comparisons. Enable the Celox cases introduced by the prerequisite test PR #1370.

Support covers constant scalar string let initializers, changing lengths, empty strings, independent copies, conditional expressions, indexed string-array elements, function arguments/returns, assertion/display arguments, and component method arguments. Checkpoints capture and restore string values and account for their payload size. Layout-independent state files cannot encode this state yet and return an explicit error instead of silently dropping it.

The reproduction in veryl-lang/veryl#3555 now prints all five expected lines (let/var/const, %s, and direct display); regression assertions check the rendered bytes. This is a bounded Veryl testbench subset, not full SystemVerilog string support. String concatenation/replication, character indexing/slicing, unary or mixed numeric/string operations, and nonconstant/array string let initializers are rejected explicitly. Negative regressions also check that len() and substr() are rejected by the current frontend. SV string methods, conversions and NUL rules are not claimed as supported.

Add portable array/function cases, clock/message/checkpoint regressions, a dynamic component filename regression, and a NAPI test. The SV-frontend harness exclusion remains unchanged; Verilator and Icarus execute the shared Veryl cases through the native-testbench emitter.

Validation:

  • cargo test --locked -p celox --test testbench_string: 36 passed, including native, native parallel, Cranelift, Cranelift parallel, Wasm, interpreter, and clock/message/checkpoint regressions.
  • Follow-up for Veryl merge queue: checking #3525 on master (5db2026), stacked on #3531, #3523 and #3524 #3555 and unsupported operations: 36 string tests, 88 frontend unit tests, 152 native testbench/component tests (1 pre-existing ignored benchmark), affected-library clippy, rebuilt NAPI and all 10 native testbench JS tests passed.
  • Focused dynamic component filename regression: passed.
  • Existing native_testbench, component_method, checkpoint, concurrent_initial, and initial_readmem: 277 passed, 1 pre-existing ignored benchmark.
  • celox-testbench and celox-frontend-veryl unit tests: 100 passed.
  • Verilator and Icarus with --filter tb_string::: all 5 cases pass on each (2 fresh, 3 reused).
  • Rust formatting, affected-library clippy with -D warnings, TypeScript typecheck, Biome, workspace check, and pnpm run build:napi.
  • pnpm --filter @celox-sim/celox exec vitest run src/e2e.test.ts -t "E2E: native testbench": 10 passed; 98 unrelated tests filtered out.

Public API compatibility: TestbenchValue, ExprOpcode, and StateError gain variants. Downstream exhaustive matches need updating, so this PR uses a breaking-change title.

No retained verification baselines changed.

@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-16T19:30:11.096203Z 2541022 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 changed the title feat(testbench)!: support Veryl string variables feat(testbench)!: support basic Veryl string values Oct 16, 2026
Base automatically changed from test/veryl-tb-strings to master October 16, 2026 21:35
@mergify

mergify Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

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

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

mergify Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 52 minutes 5 seconds in the queue, including 36 minutes 37 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 b0237fa into master Oct 16, 2026
33 checks passed
@mergify
mergify Bot deleted the feat/veryl-tb-strings branch October 16, 2026 22:30
@mergify mergify Bot removed the queued Mergify queue entry label Oct 16, 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