Repository navigation
Conversation
Plugin Test Summary 1 files 3 suites 1s ⏱️ Results for commit 39521ed. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Pull request overview
Adds opt-in normalized IR generation for language-agnostic SDK consumers.
Changes:
- Adds
--normalized-irCLI support. - Serializes analyzed programs and expanded Impact VM instructions as S-expressions.
- Integrates artifact generation into the compiler pipeline.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
compiler/compactc.ss |
Defines the flag and help text. |
compiler/config-params.ss |
Adds the configuration parameter. |
compiler/passes.ss |
Runs normalized IR generation when enabled. |
compiler/save-normalized-ir-passes.ss |
Defines the pass library. |
compiler/save-normalized-ir-passes/extract-normalized-ir.ss |
Converts analyzed IR into normalized S-expressions. |
compiler/save-normalized-ir-passes/save-normalized-ir.ss |
Writes the normalized artifact. |
Suppressed comments (2)
compiler/save-normalized-ir-passes/extract-normalized-ir.ss:50
- The operands of
VMnullandVMmax-sizeofare IR types (seert-null/rt-max-sizeofinvm.ss), but this routes them back throughvm-value->sexp, whose fallback treats them as expressions. Operations such asMap.insertDefaulttherefore fail while extracting their(null value_type)operand. Serialize these operands with theTypetransformer.
[(VMnull x) `(null ,(vm-value->sexp x))]
[(VMmax-sizeof x) `(max-sizeof ,(vm-value->sexp x))]
compiler/save-normalized-ir-passes/extract-normalized-ir.ss:250
- The serialized operation drops
op-class, so it cannot reproduceupdate-with-coin-checksemantics. TypeScript checks that class and its coin/recipient indices to callhasCoinCommitmentbeforequeryLedgerState(print-typescript.ss:464-501); that check is not part of the expanded VM instruction list. Preserve the operation class and indices (or emit equivalent explicit metadata), otherwisewriteCoin/insertCoinoperations execute differently from generated TypeScript.
,ledger-op
,(Type type)
(instructions ,@(expand-ops src path-elt* adt-formal* adt-arg* var-name* expr* vm-code))
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
Suppressed comments (2)
compiler/save-analyzed-ir-passes/extract-analyzed-ir.ss:29
- Identifier text is not stable here: formatting an
idinvokes the record writer, which lazily assignsid-uniq(langs.ss:493-501). With--trace-passes, earlier pass unparsing atpasses.ss:71-73assigns those numbers in a different traversal before this serializer runs, so the same source produces a differentanalyzed-ir.sexpmerely by enabling tracing. Please make artifact identifiers independent of prior printing (or assign compiler IDs deterministically before any optional unparsing).
(define (id->sym i) (string->symbol (format "~a" i)))
compiler/passes.ss:152
- The new flag and 329-line serializer have no compiler-suite coverage. The existing suite snapshots many
contract-info.jsonvariants, but nothing enableswrite-analyzed-iror checks this output. Add tests that assert the flag-off file is absent, snapshot representative ledger/emit/native output when enabled, and verify diagnostic flags such astrace-passesdo not alter the artifact.
(when (write-analyzed-ir)
(with-target-ports
'((analyzed-ir.sexp . "compiler/analyzed-ir.sexp"))
(run-passes save-analyzed-ir-passes analyzed-ir proof-circuit-name*)))
79e512b to
3933292
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
Suppressed comments (1)
compiler/passes.ss:152
- The new output branch and 338-line serializer are not exercised by tests; the man-page fixture only verifies help text. This leaves flag wiring, default absence, file creation, S-expression readability, and the required ledger/emit instruction and export/proof metadata unprotected. Please add an end-to-end flag test plus golden/pass-level coverage, following the existing
save-contract-infocoverage incompiler/test.ss:35597.
(when (write-analyzed-ir)
(with-target-ports
'((analyzed-ir.sexp . "compiler/analyzed-ir.sexp"))
(run-passes save-analyzed-ir-passes analyzed-ir proof-circuit-name*)))
f9a22f5 to
b5b0b5f
Compare
Signed-off-by: Rodrigo Quelhas <rodrigo_quelhas@outlook.pt>
Signed-off-by: Rodrigo Quelhas <rodrigo_quelhas@outlook.pt>
Signed-off-by: Rodrigo Quelhas <rodrigo_quelhas@outlook.pt>
Signed-off-by: Rodrigo Quelhas <rodrigo_quelhas@outlook.pt>
Signed-off-by: Rodrigo Quelhas <rodrigo_quelhas@outlook.pt>
7fdd22a to
39521ed
Compare
Adds
--analyzed-ir. The flag writes one more file into the target directory,compiler/analyzed-ir.sexp.The file holds the analyzed program in the compiler's own vocabulary. Each ledger operation and each
emitcarries its expanded Impact VM instructions. Circuits carry theirexported,pureandproofflags, and the program carries its export table.Part of CoIP: LFDT-Minokawa#700.