Skip to content

feat(core): checked number conversion and numeric array conditional join - #41

Open
fffonion wants to merge 2 commits into
masterfrom
subagent/es51-core-checked-master169-256167f4
Open

fffonion wants to merge 2 commits into
masterfrom
subagent/es51-core-checked-master169-256167f4

Conversation

@fffonion

@fffonion fffonion commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add the internal __checked_int_from_number builtin at immutable call index 0xFF90, with matching std/no-std dispatch and generated ID mirror. Tagged integers are preserved; finite, integral, exactly representable floats in the signed 64-bit range convert; type, arity, and assertion failures retain their established error paths.
  • Join known numeric array and single-element array-tuple schemas in conditional expressions. This unblocks the shared JavaScript prelude's numeric-array conditional result without broadening Result or match joins.
  • Update wire, AOT/native, runtime, no-std, and typing tests and document the ID contract. VMBC remains v14, and the internal builtin remains inaccessible through guest name lookup.

These two Core capabilities are needed together before the ES5.1 frontends can replace their fixed Core dependency and exercise the prelude.

Verification

On base 2f433edab3f1907e8cb060e901357d7e2af016ce:

  • Focused test runs: 7 std conversion, 2 typing join, 4 AOT/native, 3 no-std, 4 wire, 7 runtime-only conversion, and 2 runtime-only join tests passed (29 executions; feature-mode duplicates counted separately).
  • cargo fmt -- --check, no-std and runtime-only cargo check, library Clippy with -D warnings, and git diff --check passed.
  • Independent code review found no publication blocker; exact-head PR CI passed for this update.

This PR is intentionally left open; no merge is requested.

Follow-up: reused-slot division hints

  • Align codegen Drop with typing so a recycled physical slot cannot retain a dead Float schema. Capture explicit declaration schemas before compaction in a compiler-private assignment sidecar; the public Stmt, FrontendIr, and VMBC shapes stay unchanged.
  • Regression evidence: the previous candidate mislabeled a post-reuse Int operand as Float/Float and hit TypeMismatch("float"); nested typed-number assignments in if/Result-match branches narrowed to Int/Float. The focused local checks on this commit passed: 9 runtime and 9 no-default-runtime tests, 1 closure-clone test, 7 type-inference tests, plus Clippy -D warnings, fmt, and diff checks. Independent scoped re-review found no blocker.
  • Exact-head PR CI passed in both Actions runs (Select CLI matrix, Rust lint and tests, VS Code extension, pd-vm CLI). Downstream ES5.1 frontend pin and end-to-end tests remain separate follow-up gates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant