HowlFrame #90 Phase 3b: experimental while bytecode - #59
Merged
Merged
Conversation
-compile-hfir-bc now emits existing JUMP_IF_FALSE and JUMP for while. A while header's control edges are the condition, then the body. Production -compile-bc stays AST bytecode after the gate. #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 3b looks clean on the fence.
-compile-hfir-bc now runs a tiny while off ControlEdges (condition → body) with the existing JUMP_IF_FALSE / JUMP layout. Prod -compile-bc is still AST after the gate — locked by the sleep split. No new opcode, no new cap, no Wasm, no linker, no #88 reopen. write_file / mkdir stay deferred. #90 stays Partial.
Hard nos look clean. CI build is green on d466ff5e. Good to undraft + squash-merge when you’re ready — leave #90 Partial.
howlcipher
marked this pull request as ready for review
September 30, 2026 05:15
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
Experimental
-compile-hfir-bcnow compiles and runs a tinywhile.LowerASTrecords that loop header's control edges as the condition, then the body.LowerToBytecodefollows those edges and emits the existingJUMP_IF_FALSEandJUMPopcodes, with the same relative offsets as the AST bytecode compiler. Awhilewhose control edges are missing or swapped fails closed withHFIR_BYTECODE_UNSUPPORTEDand no bytecode program.Production
-compile-bcis stillrunHFIRGateand thenbytecode.CompileToBytecodeon the AST.sleepstill compiles on that flag and is still rejected by-compile-hfir-bc. This is not a CFG or SSA pass:if,for, and every other node still have empty control edges. No new opcode, no new capability, no Wasm, and no module linker. The model-adapter transport still rejectswhile, so #88 stays closed.write_fileandmkdirstay deferred. #90 stays Partial.Journal:
docs/journals/2026-09-30_lowered_hfir_abi_phase3b_while.md.How to test
The shared fixture is
tests/conformance/abi_v1/10_while.howl(while_controlintests/conformance/lowered_hfir_abi_v1.json). A false loop must not print. A counting loop prints1,2, and3on the experimental bytecode path, production bytecode, the interpreter, Go, and JavaScript:go test ./tools/difftest/ -run TestLoweredHFIRABIConformance -count=1go test ./internal/vm/ -run TestHFIRBytecode -count=1compares the experimental artifact with AST bytecode on a counting loop, a loop that does not enter, a nested loop, a loop insidedefun, and a non-bool condition (TYPE_ERROR, empty stdout).