Skip to content

[P2] ! changes meaning with the VM's numeric representation #14

Closed

Description

@ymote

Reproduced during the 2026-09-04 language review at a20753c6cff96ee86758744e227a04460234a832. Priority: P2.

[!1, !(1 + 0)]

Observed optimized result: [false, 1.8446744073709552e+19]. The second value is truthy; consequently if !1 1 else 0 returns 0, while if !(1 + 0) 1 else 0 returns 1.

handle_not bitwise-complements values represented as f64, but applies boolean conversion to other values. Arithmetic constructs f64 values while small integer literals can use another representation. An internal storage optimization has become observable language behavior.

Define ! as logical negation with a boolean result for every admitted operand, or reject non-boolean operands consistently. If bitwise operations are wanted, give them a separately specified integer operation. Add representation-invariance tests: a numeric literal, an arithmetic result with the same value, a variable, and a host-data value must not acquire unrelated meanings because of storage tags.

Acceptance: implement the described correction, publish the resulting language contract, and add focused regression coverage including applicable capability, streaming-parser, and resource-limit cases.

Fix and executable regressions: PR #19. Workspace tests, explicit vendor suites, formatting, strict Clippy, and the Linux ARM64/RISC-V and Windows GNU compile checks pass locally. All GitHub Actions checks pass on f1e775f, including Linux tests, fuzzing, AddressSanitizer, and Miri. This issue remains open until the fix is merged.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions