Files
ziran/tests/numeric_conformance.json
T
waozi 16b60d090f Free host-returned storage, speed up the engine, finish the Wasm tier
Engine (cmd/compiler_exec.zi, compiler_opt.zi, compiler_lowered_verify.zi):
- Storage that host calls return is given back once nothing the program
  can reach names it; 100,100 calls returning 64-byte strings peak at
  65,752 live bytes instead of growing by 6.4 MB.
- An address only loaded from or stored to later in its own block takes a
  scratch table entry instead of a permanent one, so programs that read
  millions of bytes of a global or of host text no longer hit the address
  limit. The optimizer drops block parameters every edge passes one value
  (float-text: 32,168 -> 1,031), and frame and plan records are read in
  place. float-text runs 63.9 -> 45.0 s locally.

Host interface and embedding:
- Types that hold themselves through a slice and procedure values are
  written in the interface section; when it cannot be written the build
  fails with a diagnostic naming the type instead of writing a bundle
  without it. Every entry-module global is lowered and named, so state
  export includes globals the entry never reads.

Wasm tier (cmd/zir-wasm/zx_wasm_lower.c, zir_zx_wasm_web.c):
- Recursive host types work; the tier stays out of Emscripten runtimes
  built with Asyncify or JSPI, where hosts suspend (Kryon's image and
  storage hosts trapped with "unreachable"), and the engine runs those.
  Kernels use real loops without dispatch tables. Benchmarks on Alpha in
  bench/wasm_tier.*, raw samples under bench/results/.

Also: generated C indexes []*T slices with pointer elements; the site
target matrix is regenerated for desktop and web (mobile waits for the
phone's USB authorization); ASSEMBLY docs describe one ZX format; the
package artifact test restores CC instead of unsetting it, since the
artifact key names the compiler.
2026-11-14 15:51:28 -03:00

142 lines
4.1 KiB
JSON

{
"schema_version": 1,
"stability": "stable-id",
"targets": [
"c",
"go",
"zx"
],
"evidence": "tests/numeric_semantics.sh",
"additional_evidence": ["tests/numeric_width_matrix.sh"],
"cases": [
{
"id": "numeric.compile.div_min.s32",
"summary": "Compile-time s32 minimum divided by -1 wraps to the minimum."
},
{
"id": "numeric.compile.div_min.s64",
"summary": "Compile-time s64 minimum divided by -1 wraps to the minimum."
},
{
"id": "numeric.compile.cast_wrap.u8",
"summary": "Compile-time signed narrowing uses u8 bit width."
},
{
"id": "numeric.compile.wrap_add.u8",
"summary": "Compile-time u8 addition wraps modulo 256."
},
{
"id": "numeric.compile.wrap_add.s8",
"summary": "Compile-time s8 addition wraps to signed minimum."
},
{
"id": "numeric.shift.left.u8",
"summary": "Runtime u8 left shift uses u8 width."
},
{
"id": "numeric.shift.left.u16",
"summary": "Runtime u16 left shift uses u16 width."
},
{
"id": "numeric.shift.right.arithmetic.s8",
"summary": "Runtime s8 right shift is arithmetic."
},
{
"id": "numeric.shift.right.arithmetic.s16",
"summary": "Runtime s16 right shift is arithmetic."
},
{
"id": "numeric.float.cast.u16",
"summary": "Float-to-u16 conversion truncates within range."
},
{
"id": "numeric.float.cast.s8",
"summary": "Float-to-s8 conversion preserves a negative in-range value."
},
{
"id": "numeric.float.divide.zero.f64",
"summary": "Runtime float64 division by zero produces infinity."
},
{
"id": "numeric.float.compare.nan",
"summary": "NaN remains unequal to itself."
},
{
"id": "numeric.float.divide.zero.f32",
"summary": "Runtime float32 division by zero produces infinity."
},
{
"id": "numeric.wrap.add.u8",
"summary": "Runtime u8 addition wraps modulo 256."
},
{
"id": "numeric.wrap.add.s8",
"summary": "Runtime s8 signed overflow wraps."
},
{
"id": "numeric.wrap.sub.u8",
"summary": "Runtime u8 subtraction wraps below zero."
},
{
"id": "numeric.wrap.mul.s8",
"summary": "Runtime s8 multiplication wraps."
},
{
"id": "numeric.wrap.add.s32",
"summary": "Runtime s32 signed overflow wraps to the minimum."
},
{
"id": "numeric.div_min.s32",
"summary": "Runtime s32 minimum divided by -1 wraps to the minimum."
},
{
"id": "numeric.rem_min.s32",
"summary": "Runtime s32 minimum remainder with -1 is zero."
},
{
"id": "numeric.div_min.s64",
"summary": "Runtime s64 minimum divided by -1 wraps to the minimum."
},
{
"id": "numeric.rem_min.s64",
"summary": "Runtime s64 minimum remainder with -1 is zero."
},
{
"id": "numeric.cast.width_pairs.all",
"summary": "All 64 conversions among the eight signed/unsigned integer types preserve their declared widths, including sign and truncation boundaries."
},
{
"id": "numeric.mixed.add.u16_to_u8",
"summary": "A u16 result narrows modulo u8 after u16-width addition."
},
{
"id": "numeric.mixed.add.u8_to_u16",
"summary": "A u8 result widens after u8-width wrapping addition."
},
{
"id": "numeric.bitwise.and.u8",
"summary": "u8 bitwise AND is unsigned and width-preserving."
},
{
"id": "numeric.bitwise.or.u8",
"summary": "u8 bitwise OR is unsigned and width-preserving."
},
{
"id": "numeric.bitwise.xor.u8",
"summary": "u8 bitwise XOR is unsigned and width-preserving."
},
{
"id": "numeric.float.literal.f32",
"summary": "A float literal in float32 arithmetic is a float32 constant, so each operation rounds once to float32."
},
{
"id": "numeric.shift.reject.width",
"summary": "A shift count at the operand bit width fails on every target."
},
{
"id": "numeric.shift.reject.negative",
"summary": "A negative shift count fails on every target."
}
]
}