fix(stim-parser)!: follow Stim's tag model#186
Open
rafaelha wants to merge 1 commit into
Open
Conversation
rafaelha
marked this pull request as draft
July 17, 2026 14:24
|
rafaelha
force-pushed
the
rafael/stim-raw-tag-atoms
branch
from
July 17, 2026 17:47
c17ada6 to
f83d8e0
Compare
rafaelha
marked this pull request as ready for review
July 17, 2026 17:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stim tags are a single opaque string, not a comma-separated list of structured values. This PR updates
stim-parserto follow that model and moves PPVM-specific modifier parsing into the extended lowering stage.[, and Unicode.\n,\r,\B, and\Cescapes; reject unknown escapes and raw line breaks.Tag/TagParamrepresentation in favor oftag: String(breaking Rust AST change).Simulation semantics
Tag interpretation is limited to PPVM's reserved carrier instructions:
S/S_DAGTpromotes to T / T-dagger; every other tag is ignored for simulation.IR_X,R_Y,R_Z, orU3modifier; malformed, unknown, or comment-like tags are errors.I_ERRORlossandcorrelated_losstags are accepted.T/T_DAGThis keeps ordinary Stim metadata readable and compatible while preventing misspelled PPVM modifiers on
IorI_ERRORfrom silently becoming comments.Testing
cargo test --workspace -qcargo clippy -p stim-parser -p ppvm-stim --all-targets -- -D warningsS[T], ignored metadata, strictImodifiers, strictI_ERRORmodifiers, and directT/T_DAGtags.