Two big threads today: the ongoing push towards backend determinism in submain and a solid feature wrap-up that brings the while-in loop full source-to-IR lowering. That while-in loop is finally closing its parity gaps.
While-in Loop Source-to-IR Lowering
Particularly noteworthy is CX-233. It replaces the previous unsupported!("WhileIn") stub with a full-blown lower_while_in_single function. You're looking at roughly 210 lines of new IR lowering in src/ir/lower.rs. This implementation's core is a 5-block CFG: entry, header (where counter comparison kicks in), body (think array element loading via PtrOffset and stride multiplication, followed by storing to start_slot, then executing body statements), increment (adding to counter and looping back to header), and finally, exit.
Here’s what’s interesting technically:
Switching between CompareOp::Le and CompareOp::Lt in the header for inclusive vs exclusive range is what handles range checks. For iterators, the code navigates through then_chains, threading the active block through each lower_while_in_single call, which makes chained iteration click without special routing or exceptions.
On semantics, arr_binding (BindingId) and arr_ty (SemanticType) are passed through the WhileIn AST node and chained thens. Opting to address the array variable with lookup_var during semantic analysis rather than at IR time maintains consistency with other paths' approach to binding metadata.
The tests reflect improvement: WhileLoop parity climbed from 6 PASS / 2 SKIP to 8 PASS / 0 SKIP. t34 (while-in range-based) and t35 (while-in-then) tests are passing. Markedly, this is the introductory ranged iteration construct receiving full IR lowering. This branch with changes sits in origin/stokowski/CX-233, awaiting the green light from the PR review.
Backend Determinism Train Rolling Into Submain
Rolling over to PR #268, we’ve got the train/backend-determinism branch landing into submain. This involves a strategic approach—gather related determinism and parity efforts into a "train" of tickets (CX-223 through CX-230 in this case), then pushing them in with a single merge PR.
That merge is no slouch: affecting 28 files, with host_boundary.rs witnessing the most impact (+2494/-588 lines) due to determinism test suites lining up from multiple instruction categories spanning those tickets. ir/lower.rs gains (+144) while diff_harness.rs follows with (+116), alongside documentation tweaks to JIT's determinism and parity guides.
New Parity Fixtures: CX-228
Inside the train branch, CX-228 delivers a hefty 19 new .cx test fixtures to the verification matrix. Among them:
- Direct calls: covering implicit and explicit return, zero-arg runs, chains, forward declarations, and recursive forms.
- Unary operations like neg int and not bool.
- Various infinite loop models.
- Compound assignments within functions.
- Builtin assert/assert_eq.
- t128 arithmetic quirks.
- Constant declarations with block scope shadowing.
- Implementation details for basics, return scenarios, and multiple aliasing.
Bumping the fixture tally to t159 through t177 using current test numbering.
The Submain-Main Gap Isn't Shrinking
Submain stands 171 commits forward of main, creeping up from 164 just two days prior. This has hit the radar in each log since May 6, ballooning from 16 on May 7 to 171 at present. There’s no technical blockade for the merge. The matrix is solid at 117 PASS / 0 FAIL; it’s strictly merge lag, yet risk compounds with inaction.
What's in the Pipeline
First on deck is charting CX-233 into submain—a straight, single-commit enhancement clearing the final WhileLoop parity gap. Coming up next, target remaining parity objectives: the VariableDecl, DirectCall, InfiniteLoop, and BuiltinAssert segments still showing SKIPs.
The bridge from submain to main merge remains unresolved. At 171 commits, it’s never been wider for this project.
Follow the Cx language project:
- Website: cx-lang.com
- GitHub: github.com/COMMENTERTHE9/Cx_lang
- Dev.to: dev.to/commenterthe9
- Bluesky: thecomment.bsky.social
- Twitter/X: @commenterthe9
Originally published at https://cx-lang.com/blog/2026-05-18
Top comments (0)