Skip to content

feat: Stack Machine + compile only kernels + test framework#99

Merged
acl-cqc merged 156 commits intomainfrom
acl/stack_machine2
Apr 24, 2026
Merged

feat: Stack Machine + compile only kernels + test framework#99
acl-cqc merged 156 commits intomainfrom
acl/stack_machine2

Conversation

@acl-cqc
Copy link
Copy Markdown
Collaborator

@acl-cqc acl-cqc commented Jan 2, 2026

A few old commits moved out into #100.

  • Rework the Hugr compiler to compile only Kernel boxes; Compiler.hs (brat -c) calls this only for Kernel boxes that are inputs to the Id nodes of top-level decls. "compile" produces a Hugr + list of splices, where each splice is (the NodeId of a Hole op in the hugr, OutPort from BratGraph) - not using the "index" of the Hole op here.

  • Add Machine.hs with interpreter (commandline --run <func>). For Hugrs, this also evaluates the outports and performs the splices using routines from feat: add splice on HugrGraph ADT #98, and returns the final Hugr in JSON form.

  • Includes reworking test framework to specify which tests are xfailed for parsing/compilation, and allowing to specify expected outputs from the interpreter (or that the output should be hugr-validated) in the test file (examples/*.brat). We could do with a full audit of the testsuite after this but not done here.

  • Minor fixes: solveVal wiring, bad type in adder.brat

  • Also add CFull; Dummy graph node; hugrRotation, Hugr float extension, CR(x/y/z); HugrGraph root->getRoot+getNodes

Comment thread brat/examples/hea.brat

-- Reality:
-- - the parser is struggling with variables being plugged into the end of vectors
-- - kernel compilation doesn't find `numNodes` or `Operator`
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Should probably make an issue for this @croyzor ?

This also demonstrates how much better it would be if we could instead write xfail-checking on/after/before the line giving the error, with a "pattern" to check appears in the error message (the latter not really being supported by tasty expectedFail though)

@acl-cqc acl-cqc changed the title feat: Stack Machine (rebased, starting on kernel compilation) feat: Stack Machine + compile only kernels + test framework Apr 24, 2026
This was referenced Apr 24, 2026
@acl-cqc acl-cqc merged commit 8abf605 into main Apr 24, 2026
1 check passed
@acl-cqc acl-cqc deleted the acl/stack_machine2 branch April 24, 2026 13:46
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.

3 participants