Skip to content

Feat/runner native decimal slice2#442

Merged
cukas merged 3 commits into
mainfrom
feat/runner-native-decimal-slice2
Jun 16, 2026
Merged

Feat/runner native decimal slice2#442
cukas merged 3 commits into
mainfrom
feat/runner-native-decimal-slice2

Conversation

@cukas

@cukas cukas commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

What

Why

How

Checklist

  • tsc -b passes
  • pnpm test passes
  • pnpm test:kern passes
  • pnpm lint passes
  • kern review packages/ --recursive checked

KERN-Agon and others added 3 commits June 16, 2026 13:12
…acle (RED-at-base spec)

The discriminating 3-leg oracle for runner-native Decimal Slice 2: the runner
(referenceRun) becomes the THIRD leg for the COMPARATORS (eq/ne/lt/lte/gt/gte →
bool, cmp → int -1|0|1) and VARIABLE Decimal operands, asserting
refOut === tsOut === pyOut byte-exact (operands stay within the Slice-1 producer
surface of/add/mul; the slice-3 test already proves ts===py for comparators).

RED-at-base for the right reason: 25 comparator/variable-operand cases fail
because the runner ABSTAINS today (Decimal.eq is an unknown member-call →
Preconditions failed); 5 abstain/defensive guard-rails already pass. The
composability cases (Decimal.cmp(...) + 1, Decimal.eq(...) ? "Y" : "N") prove the
comparator result is a genuine portable scalar the evaluator carries downstream.

This is the SPEC for the runner implementation (next commit). Emitters untouched.

⚔️ Forged by [Agon](https://github.com/KERNlang/agon)

Co-Authored-By: agon (KERN) <292465531+KERN-Agon@users.noreply.github.com>
…s, +round-trip/symmetry fixtures)

agon impl-review (full roster, kimi winner conf 0.86) found NO correctness blockers —
the three "blocking" items resolved to safe-or-coverage: #1 the comparator throw is
already caught by the expression-v1 precondition try/catch (green runtime_abstain
tests prove the clean abstain); #2 the variable round-trip is correct (-0 ≡ 0 in value
compare on all legs; precision-28 is lossless); #3 no current false-admit. Applied the
worthwhile hardening + coverage:

- portable-scalar: EMPTY_DECIMAL_ENV (a shared module-level mutable Map) → a
  freshDecimalEvalEnv() factory, so the default env can never leak across evaluations.
- docs: isCanonicalDecimalLiteralFailure rationale (the DECIMAL_SCALE_FAILCLOSE prefix
  is unique + slice-1's fail-close test guards a reword); isDecimalExpression invariant
  now states the variable-operand binding error the precondition routes to abstain
  (the ident over-accept is fail-SAFE, never a divergent value).
- oracle: +variable-bound computed signed-zero (eq+cmp == "0"/"true"),
  +variable-bound precision-28 round-trip (cmp == 0), +operand-order symmetry,
  +cmp-result-fed-as-a-Decimal-operand ABSTAINS.

Out of scope (noted): the shadow guard's flat env.bindings.has("Decimal") matches
slice-1's existing check (pre-existing, not new); div/mod/pow producer breadth is
runner-slice-3.

Gate: build + slice-2 (incl. new fixtures) + slice-1 + slice-3 + ir-semantics +
browser-spine pin (exactly 5 typescript importers) all GREEN. Emitters untouched.

⚔️ Forged by [Agon](https://github.com/KERNlang/agon)

Co-Authored-By: agon (KERN) <292465531+KERN-Agon@users.noreply.github.com>
@cukas cukas merged commit 129aff6 into main Jun 16, 2026
4 checks passed
@cukas cukas deleted the feat/runner-native-decimal-slice2 branch June 16, 2026 12:24
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.

2 participants