DEV Community

COMMENTERTHE9
COMMENTERTHE9

Posted on • Originally published at cx-lang.com

Cx Dev Log — 2026-05-09

Nine PRs into submain and ten new feature branches created in a single day. The headline is CX-74: exit-code propagation through the backend trait. Six silent return; paths in main.rs where backend errors would exit 0 are now replaced with structured BackendError { message, exit_code } propagation. This directly fixes a problem where the differential harness misclassified failures as SKIPs because the CLI was swallowing error exits. The Backend trait now owns exit-code semantics: 127 means the JIT can't handle the program, 126 means runtime panic, anything else is the Cx program's own return value.

What Merged

CX-74 (PR #117): Exit-code propagation. This change brought clear improvements to how we handle errors. The Backend trait gained a BackendError return type, ensuring exit codes flow from JIT to CLI without needing string parsing. We introduced three new exit-code tests as this was pushed by CX-69's parity harness, where errors exiting with 0 caused false SKIPs.

CX-73 (PR #115): Assert/assert_eq lowering. Transitioning assert(cond) and assert_eq(a, b) into native Cranelift codegen represents a milestone. With assert(cond) lowering to a Branch + Trap on failure, and assert_eq(a, b) via Compare(Eq) + Branch + Trap, these built-ins no longer require runtime intrinsic dispatch. This change reflected across six files, reinforcing the IR printer, validator, and JIT.

CX-53 (PR #106): IrType::Void handling. By introducing IrType::Void and adapting function lowering to Cranelift's lack of void type, we refined how void-return functions operate. This manifested in six new tests, aligning semantic and IR void types.

CX-52 (PR #105): JIT float comparison. We added fcmp for float comparison along with ConstFloat for Cranelift's emit path, expanding our floating-point computation capabilities.

CX-54 (PR #104): Controlled IR dumping. Addressing IR println! clutter, IR dumps now require --debug-trace. This improves the cleanliness of dispatch paths.

CX-55 (PR #107): Determinism test improvements. A rebased 12 determinism tests now align with the current submain better, especially with tightened naming.

CX-67 (PR #109): CodeRabbit integration. With .coderabbit.yaml, we configured our repo for automated reviews, targeting submain and main, and emphasizing relevant file path filtering.

CX-70 (PR #112) and CX-71 (PR #113): CodeRabbit-driven fixes. Enhancements in assertions and CI-running processes denote our responsiveness to CodeRabbit feedback. The 30-second timeout particularly stands out for CI processes, transforming previously hanging tasks.

Ten Branches in Flight

The day's addition of ten new branches targets significant advancements:

  • CX-57: F64 remainder achieved through fmod in Cranelift.
  • CX-58: Logical operations AND/OR optimized to short-circuit IR branches.
  • CX-60: I128 constants incorporated into the JIT.
  • CX-63: Direct function call implementation with corresponding determinism tests.
  • CX-64 and CX-66: Pointer operations across structure fields and arrays.
  • CX-59, CX-61, CX-62: Enhanced test fixtures for control flow logic.

Once these routes are integrated, we can expect a substantial boost in JIT's IR instructions coverage.

Decisions and Direction

Exit-code semantics take shape. The introduction of the BackendError struct formalizes error handling across backends, establishing clear semantic guidelines—127 for unmanageable programs, 126 for runtime panic, and others reflective of the actual Cx return value.

Assert handling reaches codegen. By removing asserts from the built-in tier, we move closer to native code generation. This step simplifies runtime processes, while future endeavors await for I/O related built-ins.

CodeRabbit's role solidified. As we continue refining developer-tooling integration, CodeRabbit's automated insights streamline PR reviews, ensuring prompt and effective feedback deployment.

JIT harness compliance enforced. Implementing a JIT timeout has precautioned us against CI blocks. This small tweak averts latent deadlocks from becoming broader issues.

Where Things Stand

Submain sits 40 commits ahead of main, pushing the need for a merge soon to avoid escalated conflict resolution. Reviewing test successes shows promise—an unblemished submain JIT, and a mostly intact audit branch. However, noted CRLF issues in matrix status persist without regression.

The impending steps include merging the freshly formed branches into submain, surpassing 50 ahead of main. This precedes the pivotal submain-to-main merge. Outstanding facets in Phase 9 and deferred items in Phase 11 beckon our focus next.


Follow the Cx language project:

Originally published at https://cx-lang.com/blog/2026-05-09

Top comments (0)