Skip to content

runtime: 'Cannot mix BigInt and other types' thrown during pi bundle init where node runs clean — pi wall #4 #6649

Description

@proggeramlug

Wall #4 of the pi coding-agent bring-up (tracker #6564; prior walls: #6593, #6604, #6644 — all fixed). With all three fixes applied, pi-native --help now dies during bundle module init, before any output:

TypeError: Cannot mix BigInt and other types, use explicit conversions
    at <anonymous>            (no stack), rc=1

Node on the identical bundle prints pi's full usage, rc=0 — so under perry some init-path expression sees a BigInt operand where node sees none (or perry's mixed-operand gate fires where node's semantics allow the operation).

Throw site is the mixed-operand check in crates/perry-runtime/src/value/dynamic_arith.rs (or typedarray/bigint.rs). Already probed and node-identical (not the cause): BigInt("…") string parsing, bigint literals/equality, % with BigInt(0), relational bigint/number comparisons.

Candidate init-path sites in the bundle (pi-target/dist/pi-bundle.mjs):

  • zod v4 int64/uint64 checks tables — ~line 108135 and ~118573-76
  • json-bigint parser — ~70468
  • photon-wasm glue BigInt.asUintN(64, ret) — ~2683 (should be lazy, but verify)

Execution point is later than lru-cache init (~5520), where wall #3 threw.

Repro: HOME=$(mktemp -d) /Users/amlug/projects/perry/secret-tests/pi-target/dist/pi-native --help (binary includes the #6603+#6633+#6647 fixes; pi-native.pre6644 reproduces the previous wall for contrast). Suggested diagnosis: --debug-symbols build + lldb breakpoint on the dynamic_arith mixed-operand throw to capture the actual operands and JS provenance, as done for #6604.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed defect or regressionparityCompatibility gap with Node.js, ECMAScript, or the supported ecosystem

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions