Skip to content

typecheck: bare non-negative integer literals are context-polymorphic - #1924

Merged
gHashTag merged 1 commit into
masterfrom
fix/literal-inference
Aug 8, 2026
Merged

typecheck: bare non-negative integer literals are context-polymorphic#1924
gHashTag merged 1 commit into
masterfrom
fix/literal-inference

Conversation

@gHashTag

@gHashTag gHashTag commented Aug 8, 2026

Copy link
Copy Markdown
Owner

infer_expr pinned every integer literal to I32 -- in u32-dominant specs every let x = 0; x = u32_expr; raised a false 'cannot assign U32 to I32', and 27 of tri-net's specs fail typecheck TODAY on exactly this (invisible until #1922 made typecheck gate). Bare non-negative literals now infer Unknown (context-polymorphic); explicitly negative literals stay I32; promote_types resolves Unknown+Known to the KNOWN operand (100 - value with value: u32 is u32, improving coverage rather than losing it). tri-net sweep: 27 failing -> 2 (both 'assign to immutable array element' singletons, tracked with the C tail in #1919). Unit suite 1537/1537; FROZEN_HASH resealed; NOW files updated.

Closes #1923

🤖 Generated with Claude Code

infer_expr pinned every integer literal to I32, so in u32-dominant specs
every 'let x = 0; ... x = u32_expr;' and 'metric = 100 - value' raised a
false 'cannot assign U32 to I32' -- 27 of tri-net's specs failed typecheck
on exactly this, invisible until #1922 made typecheck gate (the hook only
checks staged files). A bare NON-NEGATIVE literal now infers Unknown
(context-polymorphic); only an explicitly negative literal commits to I32;
and promote_types resolves Unknown+Known to the KNOWN operand. tri-net
sweep: 27 failing -> 2 (both 'assign to immutable array element'
singletons, tracked with #1919). Unit suite 1537/1537; FROZEN_HASH
resealed.

Closes #1923

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gHashTag
gHashTag enabled auto-merge (squash) August 8, 2026 08:36
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-08 08:36:28 UTC

Summary

Status Count
Total Open PRs 14
PRs with Failing Checks 1
PRs with All Checks Green 13
READY 5
FAILING 1
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=37b349425f4d != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@gHashTag
gHashTag merged commit 024a61f into master Aug 8, 2026
22 checks passed
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.

typecheck: bare integer literals pin to I32 -- 27 tri-net specs false-fail on u32 assignments

1 participant