Skip to content

Fix dynamic result bugs in GPU simulator - #3663

Merged
João Boechat (joao-boechat) merged 3 commits into
mainfrom
joaoboechat/fix-gpu-dynamic-result-bug
Aug 27, 2026
Merged

Fix dynamic result bugs in GPU simulator#3663
João Boechat (joao-boechat) merged 3 commits into
mainfrom
joaoboechat/fix-gpu-dynamic-result-bug

Conversation

@joao-boechat

@joao-boechat João Boechat (joao-boechat) commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

This change fixes several GPU adaptive bytecode instructions that did not handle dynamic values correctly. It also corrects how dynamic rotation angles are detected, as the previous check would always return true.

GPU Adaptive Runtime

  • Handle function returns and dynamic result IDs correctly.
  • Fix result reads, output recording, and loss reads.
  • Fix a flag check that treated every rotation angle as dynamic, including immediate values.

Tests

  • Add CPU and GPU tests that compute a result ID at runtime, then use it to read a measurement, record output, and detect qubit loss.
  • Dynamic rotation angles already have CPU and GPU coverage. No new angle test was added because immediate angles still produced correct results; they were only being recomputed unnecessarily at runtime.

@joao-boechat João Boechat (joao-boechat) changed the title Fix dynamic variable bugs in GPU simulator Fix dynamic result bugs in GPU simulator Aug 27, 2026
@joao-boechat
João Boechat (joao-boechat) added this pull request to the merge queue Aug 27, 2026
Merged via the queue into main with commit 1f672db Aug 27, 2026
14 checks passed
@joao-boechat
João Boechat (joao-boechat) deleted the joaoboechat/fix-gpu-dynamic-result-bug branch August 27, 2026 20:45
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.

2 participants