Skip to content

fix(macros): write array elements through generated IO setters - #1613

Merged
mergify[bot] merged 1 commit into
masterfrom
stack/tignear/fix/macro-array-setters/write-array-elements-generated-io-setters--5b9d65b6
Oct 20, 2026
Merged

mergify[bot] merged 1 commit into
masterfrom
stack/tignear/fix/macro-array-setters/write-array-elements-generated-io-setters--5b9d65b6

Conversation

@tignear

@tignear tignear commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Generated array setters inside dut.modify(...) silently discarded writes.
Use a shared element update for batched and direct setters, reading the
current stored image so repeated writes in one callback compose correctly.
Truncate values to the element width, preserve neighboring payloads and X/Z
masks, and reject out-of-range indices before writing.

Repair interface-array accessor generation as well: resolve member types
from flattened variables, look up qualified signal names, scope generated
types by module, and retain the backing IO lifetime across member access.
Expose a stored four-state read on IOContext to support these updates
without evaluating combinational logic inside a modify callback.

Add API regressions covering repeated element updates, narrow and 129-bit
elements, neighboring X/Z masks, bounds checks, and interface arrays used
by multiple modules. Update the generated-code snapshot.

Validation:

  • Generated API integration tests: 8 passed, including a failed-before
    reproduction of the no-op setter.
  • Macro unit/snapshot tests: 2 passed.
  • Simulator API regressions: 58 passed.
  • Formatting, affected library and regression-target Clippy with warnings
    denied, and diff checks pass.

Generated array setters inside `dut.modify(...)` silently discarded writes.
Use a shared element update for batched and direct setters, reading the
current stored image so repeated writes in one callback compose correctly.
Truncate values to the element width, preserve neighboring payloads and X/Z
masks, and reject out-of-range indices before writing.

Repair interface-array accessor generation as well: resolve member types
from flattened variables, look up qualified signal names, scope generated
types by module, and retain the backing IO lifetime across member access.
Expose a stored four-state read on IOContext to support these updates
without evaluating combinational logic inside a modify callback.

Add API regressions covering repeated element updates, narrow and 129-bit
elements, neighboring X/Z masks, bounds checks, and interface arrays used
by multiple modules. Update the generated-code snapshot.

Validation:
- Generated API integration tests: 8 passed, including a failed-before
  reproduction of the no-op setter.
- Macro unit/snapshot tests: 2 passed.
- Simulator API regressions: 58 passed.
- Formatting, affected library and regression-target Clippy with warnings
  denied, and diff checks pass.

Change-Id: I5b9d65b61f0c762e3923e02537b2032164d07969
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

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 ✅ Completed 2026-10-20T11:47:53.059120Z 334bd4d 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.

@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 20, 2026
@mergify

mergify Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 1 hour 48 minutes 21 seconds in the queue, including 53 minutes 34 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 982dba7 into master Oct 20, 2026
29 checks passed
@mergify
mergify Bot deleted the stack/tignear/fix/macro-array-setters/write-array-elements-generated-io-setters--5b9d65b6 branch October 20, 2026 14:15
@mergify mergify Bot removed the queued Mergify queue entry label Oct 20, 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