Skip to content

[Explicit State Access] Support multiple StateRead nodes in proc_state_legalization_pass.cc. - #4816

Draft
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_967571718
Draft

[Explicit State Access] Support multiple StateRead nodes in proc_state_legalization_pass.cc. #4816
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_967571718

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Aug 20, 2026

Copy link
Copy Markdown

[Explicit State Access] Support multiple StateRead nodes in proc_state_legalization_pass.cc.

To support multiple state reads:

  • Generate a mutex assertion for StateRead nodes to verify at most one StateRead is active for a state element
  • Generate write-without-read assertions that a Next node can only fire when the corresponding StateRead is active
  • If there are no explicit next nodes for a StateRead, generate a default Next node
  • If there are explicit next nodes, generate a default next value node for each StateRead when there are no explicit Next nodes active and the corresponding read's predicate is active. This helps preserve state when no explicit next fires.
  • Loop through all StateRead nodes in order to ensure the pass is idempotent by not creating default Next nodes when they exist.

…ate_legalization_pass.cc.

To support multiple state reads:
* Generate a mutex assertion for `StateRead` nodes to verify at most one `StateRead` is active for a state element
* Generate write-without-read assertions that a `Next` node can only fire when the corresponding `StateRead` is active
* If there are no explicit next nodes for a `StateRead`, generate a default `Next` node
* If there are explicit next nodes, generate a default next value node for each `StateRead` when there are no explicit `Next` nodes active and the corresponding read's predicate is active. This helps preserve state when no explicit next fires.
* Loop through all `StateRead` nodes in order to ensure the pass is idempotent by not creating default `Next` nodes when they exist.

PiperOrigin-RevId: 967571718
@copybara-service copybara-service Bot changed the title [Explicit State Access] Support multiple state_reads in proc_state_legalization_pass.cc. [Explicit State Access] Support multiple StateRead nodes in proc_state_legalization_pass.cc. Aug 20, 2026
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.

1 participant