Skip to content

feat: supported openqasm support to the playground along with its ast, hir and rir#3289

Open
Gmin2 wants to merge 7 commits into
microsoft:mainfrom
Gmin2:openqasm-playground
Open

feat: supported openqasm support to the playground along with its ast, hir and rir#3289
Gmin2 wants to merge 7 commits into
microsoft:mainfrom
Gmin2:openqasm-playground

Conversation

@Gmin2

@Gmin2 Gmin2 commented Jun 3, 2026

Copy link
Copy Markdown

this adds openqasm support to the q# playground, which only handled q# before. the playground now registers a basic openqasm syntax highlighting grammar in monaco, shows the openqasm samples in their own "Samples (OpenQASM)" nav section, and passes the right languageId and projectType through to the existing language service and compiler. so openqasm programs get live diagnostics, can run for shots, and render their ast, hir, rir and qir just like q#. the ir views needed a small backend change: get_ast, get_hir and get_rir now branch on the project type, and a new Interpreter::get_rir produces rir for openqasm, whose entry point is a generated expression instead of a q# @EntryPoint. multi file openqasm projects and openqasm katas are out of scope.

Fixes #3233

Screen.Recording.2026-06-04.at.2.40.27.AM.mov

@Gmin2

Gmin2 commented Jun 3, 2026

Copy link
Copy Markdown
Author

cc @minestarks

@Gmin2

Gmin2 commented Jun 4, 2026

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@minestarks

Copy link
Copy Markdown
Member

@Gmin2 Thank you for your contribution! We'll take a look shortly. Per UnitaryHACK's AI Policy could you please disclose to what extent you used AI for this pull request?

@Gmin2

Gmin2 commented Jun 4, 2026

Copy link
Copy Markdown
Author

I was stuck on why the rir, hir and ast were not shown for openqasm AI help me with that and also at first understanding the flow and of code like how it is being rendered

@minestarks

Copy link
Copy Markdown
Member

@Gmin2 Your code isn't passing the CI checks. Please run ./build.py from your dev environment and ensure it runs cleanly.

@minestarks

Copy link
Copy Markdown
Member

@Gmin2 to be clear, it's just minor stuff like lints and formatting - the ./build.py errors should point you in the right direction.

Our workflow is here, and should hopefully match the errors you see locally! https://github.com/microsoft/qdk/actions/runs/26913329686/job/79600772588

@Gmin2

Gmin2 commented Jun 4, 2026

Copy link
Copy Markdown
Author

Hey @minestarks thw CI should be green now !

@joao-boechat

Copy link
Copy Markdown
Contributor

@Gmin2 , thanks for your contribution, we really appreciate it!

At a first glance the code looks good, but it would be really nice if we had more test coverage for the new methods you added. Nothing fancy, just replicating what we already have for the same features in Q#.

@Gmin2

Gmin2 commented Jun 5, 2026

Copy link
Copy Markdown
Author

thnx for the review, just pushed the test @joao-boechat

@minestarks minestarks left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking really good - another round of requests (hopefully last). Thank you!

Comment thread source/wasm/src/lib.rs Outdated
Comment thread source/wasm/src/lib.rs Outdated
Comment thread source/wasm/src/lib.rs Outdated
Comment thread source/compiler/qsc/src/codegen.rs Outdated
Comment thread source/playground/src/main.tsx
Comment thread source/wasm/src/lib.rs
@minestarks

Copy link
Copy Markdown
Member

Hey @Gmin2 , could you let us know if you're still planning to make changes, so we can make sure the PR isn't abandoned? Please let me know if you need clarification on any of the comments.

Thank you again for your contribution - it's almost there!

@Gmin2

Gmin2 commented Jun 9, 2026

Copy link
Copy Markdown
Author

Hey @minestarks addressed yur reviewed comments, take a look !

@minestarks

Copy link
Copy Markdown
Member

Looks good, thanks!

Looks like CI failed due to some formatting checks. Could you fix them? ./build.py should run clean.

@Gmin2

Gmin2 commented Jun 9, 2026

Copy link
Copy Markdown
Author

should be fixed now !

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.

Support OpenQASM in the Playground

3 participants