HowlFrame #90 Phase 3c: experimental if bytecode - #60
Merged
Merged
Conversation
Lower if through ControlEdges and the existing JUMP_IF_FALSE and JUMP opcodes on -compile-hfir-bc. Missing or swapped edges fail closed. Production -compile-bc stays the AST path, and #90 stays Partial. Co-authored-by: William Elias <wylelias.123@gmail.com>
howlcipher
commented
Sep 30, 2026
howlcipher
left a comment
Owner
Author
There was a problem hiding this comment.
Phase 3c looks clean on the fence.
Experimental -compile-hfir-bc gets if through ControlEdges (condition / then / optional else) on the existing JUMP_IF_FALSE / JUMP path. Production -compile-bc stays AST (runHFIRGate → CompileToBytecode); the sleep lock in TestCompileBcStaysASTWhileHfirBcRunsIf is the right guard. for stays empty. No new opcode, no new cap, no Wasm, no linker/module work. #88 stays closed (while/defun still off transport; no control_edges field). #90 stays Partial.
Hard nos clean. CI build green on d241e3f.
Okabe: undraft + squash-merge when ready. Don’t flip #90 to Done on merge.
howlcipher
marked this pull request as ready for review
September 30, 2026 05:34
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.
Summary
Phase 3c teaches experimental
-compile-hfir-bcto compile and run a smallifby fillingControlEdgesand emitting the existingJUMP_IF_FALSEandJUMPopcodes, the same pattern Phase 3b used forwhile.LowerASTstores anifas a condition, a then-branch, and an optional else, and writesControlEdgesin that order.LowerToBytecodefollows those successors. The relative jump offsets match the AST bytecode compiler. A then-onlyifemitsJUMP_IF_FALSEand noJUMP. Missing or swapped control edges fail closed with oneHFIR_BYTECODE_UNSUPPORTEDdiagnostic and noBCProgram.Production
-compile-bcis stillrunHFIRGateand thenbytecode.CompileToBytecodeon the AST.sleepstill compiles on that flag and is still rejected by-compile-hfir-bcwithout an artifact.fordoes not gain control edges and still usesFOR_INIT/FOR_NEXT.whileanddefunkeep the Phase 3a and Phase 3b behavior. There is no new opcode, capability, Wasm target, or module linker.The model-adapter transport still rejects
whileanddefun, so #88 stays closed.ifstays a Phase-1 transport kind. The schema still has no control-edge field; decoding anifderives the successors from the validated roles. A payload that namescontrol_edgesis rejected. Localization publishes anifrelation only when those successors match, and the published roles staythenandelse.tests/conformance/abi_v1/11_if.howlis the sharedif_controlcase.hfir_bytecode, production bytecode, the interpreter, Go, and JavaScript printelse,then,greater, andonly. The false branches do not print.#90 stays Partial. Journal:
docs/journals/2026-09-30_lowered_hfir_abi_phase3c_if.md.Test plan
gofmt -l .is cleango vet ./...go test ./...(includesinternal/hfir, the VM equivalence cases, the CLI lock that-compile-bcstays the AST, andtools/difftestif_control)