feat: Stack Machine + compile only kernels + test framework#99
Merged
feat: Stack Machine + compile only kernels + test framework#99
Conversation
This reverts commit 99a7416.
acl-cqc
commented
Apr 24, 2026
|
|
||
| -- Reality: | ||
| -- - the parser is struggling with variables being plugged into the end of vectors | ||
| -- - kernel compilation doesn't find `numNodes` or `Operator` |
Collaborator
Author
There was a problem hiding this comment.
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)
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.
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.hswith 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:
solveValwiring, bad type inadder.bratAlso add
CFull;Dummygraph node;hugrRotation, Hugr float extension, CR(x/y/z); HugrGraph root->getRoot+getNodes