Skip to content

Run a primitive's input checks on the value its decoder produced - #462

Open
DZakh wants to merge 12 commits into
mainfrom
claude/schema-failing-cases-u2dnpj-to-refinement
Open

DZakh wants to merge 12 commits into
mainfrom
claude/schema-failing-cases-u2dnpj-to-refinement

Conversation

@DZakh

@DZakh DZakh commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Fixes the defect under known bug to-output-keeps-source-refinement: a coerced primitive's input check ran on the value before coercion.

const schema = S.string.with(S.minLength, 3).with(S.to, S.number);
S.encodeOrThrow(schema, 500); // before: throws "Expected string.length >= 3, received 500"
                              // after:  "500"

Cause

reverse turns a node's output refiner into its input refiner, and input checks read what the node's decoder was handed. For a container, that's its Input form. For a primitive it isn't always, because a primitive decoder coerces into its own type (S.string handed a number). So the length check ran on the number, before it became "500".

-i=>{try{i.length>2||e[0](i);return ""+i}catch(v0){e[1](v0)}}
+i=>{try{let v0=""+i;v0.length>2||e[0](v0);return v0}catch(v1){e[1](v1)}}

A custom coder didn't have the problem, because its conversion runs as a step of its own before the target decoder. The fuzzer's uuid case hid the defect: RegExp.test coerces 36 to "36", so the answer came out the same, and only the error message (received 36) showed which value had been checked.

Fix

  • A primitive's Input and Output are one value, so when its decoder produces a new value (a coercion), its input checks read that value (parse.ts). A decoder that only refines what it was handed is unaffected, so there's no extra work on that path.
  • The parse loop's primitive branch was also where the recursive ref applied its refiners, even though the loop's contract is that every other decoder marks its own output. recursiveDecoder now does that itself, reading input checks off the value it was handed exactly as before (codec-protobuf-recursive-refined-conversions is unchanged). The branch is now primitive-only.

What changes for you

A primitive's input check now reads the value its decoder produced, whether reverse put it there or you wrote it forward:

const schema = S.string.with(S.minLength, 3).with(S.to, S.number);
S.encodeOrThrow(500, schema); // main: throws "Expected string.length >= 3, received 500"
                              // now:  "500"

const not5 = S.number.with(S.to, S.fromJSONSchemaOrThrow({ type: "string", not: { const: "5" } }));
S.decodeOrThrow(5, not5);     // main: "5"
                              // now:  throws "Should NOT be valid against schema in the not property."

const uuidLength = S.uuid.with(S.to, S.number, { decode: (v) => v.length, encode: "auto" });
S.decodeOrThrow(36, S.reverse(uuidLength)); // main: "Expected uuid, received 36"
                                            // now:  "Expected uuid, received \"36\""

Impact

  • Bundle: total 73883 B on main, 73905 B here, +22 B gzip.
  • Behaviour: only answers that were wrong move. A coerced primitive's input check judges the coerced value, so a value that slipped through (not: { const: "5" } above) is rejected and one wrongly rejected (500 above) passes.

Decision

The known-bug entry stays. main's #490 reclassified to-output-keeps-source-refinement as a limitation and narrowed its matcher to the grammar's leaf string-to-length link. This PR fixes the check that ran on the wrong value, but the finding itself stands: decoding a uuid to its length gives 36, isOutput asks whether 36 encodes back, and "36" is no uuid. That is the codec not inverting itself, which is what main's entry says. So this merge keeps main's entry and drops this branch's earlier skip of decode conformance for lossy members, which excused the whole lossy family rather than one root cause. pnpm fuzz:schema still reaches the entry and reports no findings. The to-refined-source-output FIXME said is(36) should be true; false is right, since "36" isn't a uuid.

Details

  • Merging main: conflicts in src/advanced/recursive.ts (main added an async-with-path early return; it now marks its own output like the final return, since the parse loop no longer does that for a recursive ref) and scripts/knownBugs.ts (main's side, see Decision). Generated goldens (bundleSize.yaml, packages/benchmarks/goldens/*) taken from main and regenerated.
  • Specs: codec-string-minLength-number (new: encode of 500 gives "500", of 5 fails with received "5"), codec-number-to-json-schema-not, to-refined-source-output (FIXME removed, errors read received "36") and the three codec-json-union-* specs give these answers on top of main. codec-json-union-nan-from-null's encode lost a let v0=NaN copy in its NaN arm (341 to 328 chars); its number arm still checks the coerced ""+i. No spec of main's moved.
  • Compile time: the link is limited to coercions; an earlier version linked every refined primitive and made 13 encodes 4 to 9% slower to create.
  • Gates: full pnpm verify passes, every step including ppx build and e2e.

🤖 Generated with Claude Code

https://claude.ai/code/session_01X9uDwr3yJ2L75BYdetqyE1

Summary by CodeRabbit

  • Bug Fixes

    • Parsing now consistently applies input checks to values produced by coercing and recursive decoders.
    • Refined JSON encoders validate converted values and report those values when validation fails.
  • Tests

    • Added coverage for minimum-length string-to-number conversion and number-to-JSON-Schema validation.
    • Updated benchmark size records; measured bundle sizes increased slightly.

`S.encodeOrThrow(S.string.with(S.minLength, 3).with(S.to, S.number), 500)`
threw "Expected string.length >= 3, received 500": the length was measured
on the number, before it became "500".

`reverse` turns a node's output refiner into its input refiner, and input
checks read what a decoder was handed. For a container that is its Input
form. For a primitive it is not always: a primitive decoder coerces into its
own type (`S.string` handed a number), so the value it was handed is the
other type. A primitive's Input and Output are one value, so both of its
refiners now read the decoder's result.

The parse loop's primitive branch was also where the recursive ref applied
its refiners, although the loop's contract is that every other decoder marks
its own output. `recursiveDecoder` now does, reading input checks off the
value it was handed as before, and the branch is primitive-only.

With the check on the right value, known bug
`to-output-keeps-source-refinement` turns out to be the fuzzer's own coder:
`isOutput` answers whether a value encodes, and `v => v.length` against the
auto encode turns 36 into "36", which no uuid ever was. The codec family
already skipped round-trip for that lossy coder; it now skips decode
conformance too, and the entry is deleted.

Specs: `codec-string-minLength-number` is new and holds the encode fix,
`to-refined-source-output` loses its FIXME and now reports `received "36"`.
Five specs only renumber embed slots. Bundle: +7 to +21 gzip bytes per
export, +7 total, for the extra link in the parse loop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XdDnkN38pECC46XqMZbwp8
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

Primitive parsing and recursive decoding now mark outputs through B_markOutput. Codec specifications change coercion and validation examples. Bundle-size specifications and benchmark goldens record updated byte counts.

Changes: Decoder Output and Conformance

Layer / File(s) Summary
Decoder output marking
packages/sury/src/parse.ts, packages/sury/src/advanced/recursive.ts, packages/sury/src/builder.ts
Primitive parsing applies an available input refiner when the decoded value differs from the original input, then marks the result as output. Recursive decoding also marks its output. A builder comment clarifies input handling for coercing primitive decoders.
Codec coercion and validation specifications
packages/sury/specs/codec-string-minLength-number.yaml, packages/sury/specs/codec-number-to-json-schema-not.yaml, packages/sury/specs/to-refined-source-output.yaml, packages/sury/specs/codec-json-union-literal-before-refined-union.yaml, packages/sury/specs/codec-json-union-nan-from-null.yaml, packages/sury/specs/codec-json-union-refined-then-date.yaml
The specifications add string-length and JSON Schema exclusion cases. They also update refined-value checks and number-encoding validation to use stringified values.
Bundle-size measurements
packages/sury/specs/bundleSize.yaml, packages/benchmarks/goldens/*
The bundle-size specification and benchmark goldens record increased byte counts.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: Minimal · up to bdc52

No concrete merge-blocking issue is established. The change is mergeable subject to normal build and test checks.

Architecture risk: Low · up to 84212

The change affects 2 systems.

Changed systems: packages/sury, packages/benchmarks

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — packages/sury (library) was modified; 12 changed files map to changed impact.
  • observed — packages/benchmarks (library) was modified; 4 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in packages/sury/specs/codec-string-minLength-number.yaml: Added a new codec-strings minLength spec with ts schema (S.string.with(S.minLength, 3).with(S.to, S.number)) and input/output types (string/number), JSON schema shapes ({ type: "string", minLength: 3 } and { type: "number" }), instantiation count 4953, strictEqual/strictCompare config, zod marked not-applicable, and parse/decode/encode expressions and examples that enforce string length > 2 and number conversion with matching error messages (Expected string.length >= 3...).
  • observed — Modified behavior in packages/sury/scripts/schemaFuzz/codec.ts: Comments now explain that decode conformance is skipped for lossy members because isOutput checks whether the decoded value encodes back, which may reject a lossy transform’s result.
  • observed — Modified behavior in packages/sury/scripts/schemaFuzz/codec.ts: Decode-output conformance is now checked only when the schema is not lossy; previously the check applied unconditionally.
  • observed — Modified behavior in packages/sury/specs/codec-number-to-json-schema-not.yaml: Adds a specification for number-to-string conversion with a JSON Schema not constraint excluding "5". The parse, decode, and encode examples record rejection of "5" and acceptance of "6", with operation expressions and expected outputs.
Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title "Run a primitive's input checks on the value its decoder produced" matches the main change in the changeset. The PR fixes a bug where input checks on a coerced primitive ran against the orig…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "Run a primitive's input checks on the value its decoder produced" matches the main change in the changeset. The PR fixes a bug where input checks on a coerced primitive ran against the original input instead of the coerced value. The summaries show parse.ts now applies B_refine to the decoded value, and the new codec specs cover coerced-value checks. The title is specific and does not use vague terms. The title does not mention the recursiveDecoder refactor, the bundle-size changes, or the to-refined-source-output fix, but the author does not need to cover every detail.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 3 files. (8 skipped: 8 unsupported.)

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 444f6a16-d299-4c77-9a98-057345aa3752
Commits

Reviewing files that changed from the base of the PR and between 84212bb and bdc521a.

Files selected for processing: 11
  • packages/benchmarks/goldens/jsonSchema.json
  • packages/benchmarks/goldens/jsonString.json
  • packages/benchmarks/goldens/protobuf.json
  • packages/benchmarks/goldens/schema.json
  • packages/sury/specs/bundleSize.yaml
  • packages/sury/specs/codec-json-union-nan-from-null.yaml
  • packages/sury/specs/codec-json-union-refined-then-date.yaml
  • packages/sury/specs/to-refined-source-output.yaml
  • packages/sury/src/advanced/recursive.ts
  • packages/sury/src/builder.ts
  • packages/sury/src/parse.ts
Files skipped from review as they are similar to previous changes: 2
  • packages/sury/specs/bundleSize.yaml
  • packages/sury/src/builder.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@github-actions

Copy link
Copy Markdown

Spec performance

14 slower of 3742 timed targets · 6b7d247 vs e84e97a (origin/main)

Not timed

  • behavior changed, not timed - codec-string-minLength-number · encode · accepts: long-enough: baseline rejected it, now accepted

Slower

target Δ vs baseline
to-refined-source-output · create+compile · parse +6.5% slower
string-minLength · create+compile · encode +5.4% slower
string-nonEmpty · create+compile · encode +5.2% slower
array-multipleOf · create+compile · encode +5.1% slower
string-refine-symbol-path · create+compile · encode +4.8% slower
string-maxLength · create+compile · encode +4.2% slower
string-refine · create+compile · encode +4.1% slower
bigint-lte · create+compile · encode +3.9% slower
bigint-gt · create+compile · encode +3.8% slower
string-refine-path · create+compile · encode +3.7% slower

…and 4 more.

Full report ↗

+% slower than baseline, -% faster · noise floor create 3.2% · create+compile 3.3% · run 3.0% · scenario 3.0%
3728 unchanged · 132 constant-schema targets skipped · 40 async examples skipped · advisory only
node 24.16.0 · linux x64 · 4 cores · 8×2 rounds · 2 screening jobs · confirmed by 2 fresh processes

…-cases-u2dnpj-to-refinement

# Conflicts:
#	packages/benchmarks/goldens/jsonSchema.json
#	packages/benchmarks/goldens/jsonString.json
#	packages/benchmarks/goldens/protobuf.json
#	packages/benchmarks/goldens/schema.json
#	packages/sury/scripts/knownBugs.ts
#	packages/sury/specs/bundleSize.yaml
@github-actions

Copy link
Copy Markdown

Spec performance

13 slower of 3857 timed targets · 0c6c3fd vs 4a723c8 (origin/main)

Not timed

  • behavior changed, not timed - codec-string-minLength-number · encode · accepts: long-enough: baseline rejected it, now accepted

Slower

target Δ vs baseline
string-length · create+compile · encode +8.9% slower
to-refined-source-output · create+compile · decode +8.9% slower
number-lte · create+compile · encode +7.1% slower
to-refined-source-output · create+compile · parse +7.1% slower
int32-gte · create+compile · encode +6.6% slower
codec-string-number-transform · create+compile · encode +5.4% slower
bigint-lt · create+compile · encode +5.1% slower
number-multipleOf · create+compile · encode +4.5% slower
set-size-supersedes-maxSize-message · create+compile · encode +4.5% slower
string-refine-symbol-path · create+compile · encode +4.0% slower

…and 3 more.

Full report ↗

+% slower than baseline, -% faster · noise floor create 6.9% · create+compile 3.0% · run 5.9% · scenario 3.0%
3844 unchanged · 132 constant-schema targets skipped · 40 async examples skipped · advisory only
node 24.16.0 · linux x64 · 4 cores · 8×2 rounds · 2 screening jobs · confirmed by 2 fresh processes

…alue

The CI perf report on the previous push had 13 refined encodes 4 to 9%
slower to create and compile: every primitive with an input refiner went
through an extra val. Only a decoder that coerces produces a value its input
checks would otherwise miss; one that refines what it was handed is already
read by them. The link now applies when the result is not the value the
decoder was handed, which also returns five specs to main's embed order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XdDnkN38pECC46XqMZbwp8
@github-actions

Copy link
Copy Markdown

Spec performance

1 slower of 3857 timed targets · d75033a vs 4a723c8 (origin/main)

Not timed

  • behavior changed, not timed - codec-string-minLength-number · encode · accepts: long-enough: baseline rejected it, now accepted

Slower

target Δ vs baseline
to-refined-source-output · create+compile · parse +6.1% slower

Full report ↗

+% slower than baseline, -% faster · noise floor create 4.4% · create+compile 3.0% · run 4.4% · scenario 6.1%
3856 unchanged · 132 constant-schema targets skipped · 40 async examples skipped · advisory only
node 24.16.0 · linux x64 · 4 cores · 8×2 rounds · 2 screening jobs · confirmed by 2 fresh processes

Kept this branch's examples in to-refined-source-output.yaml; its code
and every other generated file regenerated rather than hand-merged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XdDnkN38pECC46XqMZbwp8
The same fix covers an input refiner written forward, not only one
`reverse` produced: `S.number.with(S.to, S.fromJSONSchemaOrThrow({
type: "string", not: { const: "5" } }))` now judges "5", what the
decoder produced, and rejects 5 in both directions
(codec-number-to-json-schema-not).

B_markOutput's doc now says where a coercing primitive's input checks
read from, since the parse loop is the one caller that hands it the
result rather than what the decoder was handed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XdDnkN38pECC46XqMZbwp8
@github-actions

Copy link
Copy Markdown

Spec performance

2 slower, 1 faster of 3894 timed targets · 5ccdb8e vs b9bf517 (origin/main)

Not timed

  • behavior changed, not timed - codec-number-to-json-schema-not · parse · rejects: excluded: baseline accepted it, now rejected
  • behavior changed, not timed - codec-number-to-json-schema-not · decode · rejects: excluded: baseline accepted it, now rejected
  • behavior changed, not timed - codec-string-minLength-number · encode · accepts: long-enough: baseline rejected it, now accepted

Slower

target Δ vs baseline
codec-json-optional-custom-unknown · parse · accepts ×3 +7.7% slower
codec-string-minLength-number · create+compile · encode +3.9% slower

Faster

target Δ vs baseline
to-refined-source-output · is · accepts -18.9% faster

Full report ↗

+% slower than baseline, -% faster · noise floor create 3.8% · create+compile 3.8% · run 4.6% · scenario 3.0%
3891 unchanged · 132 constant-schema targets skipped · 45 async examples skipped · advisory only
node 24.16.0 · linux x64 · 4 cores · 8×2 rounds · 2 screening jobs · confirmed by 2 fresh processes

No conflicts; every golden regenerates unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XdDnkN38pECC46XqMZbwp8
Generated files (bundleSize.yaml, benchmark goldens) regenerated rather
than hand-merged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XdDnkN38pECC46XqMZbwp8
@github-actions

Copy link
Copy Markdown

Spec performance

1 faster of 3967 timed targets · 46adb2f vs 0491207 (origin/main)

Not timed

  • behavior changed, not timed - codec-number-to-json-schema-not · parse · rejects: excluded: baseline accepted it, now rejected
  • behavior changed, not timed - codec-number-to-json-schema-not · decode · rejects: excluded: baseline accepted it, now rejected
  • behavior changed, not timed - codec-string-minLength-number · encode · accepts: long-enough: baseline rejected it, now accepted

Faster

target Δ vs baseline
jsonstring-with-space · encode · accepts -3.5% faster

Full report ↗

+% slower than baseline, -% faster · noise floor create 3.0% · create+compile 3.1% · run 3.3% · async 5.8% · scenario 3.0%
3966 unchanged · 132 constant-schema targets skipped · advisory only
node 24.16.0 · linux x64 · 4 cores · 8×2 rounds · 2 screening jobs · confirmed by 2 fresh processes

claude added 2 commits October 1, 2026 10:00
Generated files (bundleSize.yaml, benchmark goldens) regenerated rather
than hand-merged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XdDnkN38pECC46XqMZbwp8
Generated files (bundleSize.yaml, benchmark goldens) regenerated rather
than hand-merged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XdDnkN38pECC46XqMZbwp8
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Spec performance

1 faster of 4246 timed targets · 84212bb vs 4b9e6fb (origin/main)

Not timed

  • behavior changed, not timed - codec-number-to-json-schema-not · parse · rejects: excluded: baseline accepted it, now rejected
  • behavior changed, not timed - codec-number-to-json-schema-not · decode · rejects: excluded: baseline accepted it, now rejected
  • behavior changed, not timed - codec-string-minLength-number · encode · accepts: long-enough: baseline rejected it, now accepted

Faster

target Δ vs baseline
to-refined-source-output · is · accepts -19.9% faster

Full report ↗

+% slower than baseline, -% faster · noise floor create 3.3% · create+compile 4.1% · run 9.7% · async 3.0% · scenario 17.4%
4245 unchanged · 132 constant-schema targets skipped · advisory only
node 24.16.0 · linux x64 · 4 cores · 8×2 rounds · 2 screening jobs · confirmed by 2 fresh processes

Generated files (bundleSize.yaml, benchmark goldens) regenerated rather
than hand-merged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XdDnkN38pECC46XqMZbwp8
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Spec performance

1 slower, 1 faster of 4268 timed targets · 56ab003 vs 5522d8f (origin/main)

Not timed

  • behavior changed, not timed - codec-number-to-json-schema-not · parse · rejects: excluded: baseline accepted it, now rejected
  • behavior changed, not timed - codec-number-to-json-schema-not · decode · rejects: excluded: baseline accepted it, now rejected
  • behavior changed, not timed - codec-string-minLength-number · encode · accepts: long-enough: baseline rejected it, now accepted

Slower

target Δ vs baseline
codec-json-union-recursive-union-member · parse · accepts ×3 +14.7% slower

Faster

target Δ vs baseline
to-refined-source-output · is · accepts -17.0% faster

Full report ↗

+% slower than baseline, -% faster · noise floor create 6.2% · create+compile 3.0% · run 9.7% · async 3.0% · scenario 14.6%
4266 unchanged · 132 constant-schema targets skipped · advisory only
node 24.16.0 · linux x64 · 4 cores · 8×2 rounds · 2 screening jobs · confirmed by 2 fresh processes

Version bump only; no conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XdDnkN38pECC46XqMZbwp8
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Spec performance

4 slower, 1 faster of 4268 timed targets · 4b280b4 vs 63b73cf (origin/main)

Not timed

  • behavior changed, not timed - codec-number-to-json-schema-not · parse · rejects: excluded: baseline accepted it, now rejected
  • behavior changed, not timed - codec-number-to-json-schema-not · decode · rejects: excluded: baseline accepted it, now rejected
  • behavior changed, not timed - codec-string-minLength-number · encode · accepts: long-enough: baseline rejected it, now accepted

Slower

target Δ vs baseline
to-refined-source-output · create+compile · decode +8.6% slower
codec-number-to-json-schema-not · create+compile · decode +4.5% slower
codec-number-to-json-schema-not · create+compile · parse +3.8% slower
to-refined-source-output · create+compile · parse +3.1% slower

Faster

target Δ vs baseline
to-refined-source-output · is · accepts -14.4% faster

Full report ↗

+% slower than baseline, -% faster · noise floor create 3.3% · create+compile 3.0% · run 3.0% · async 3.0% · scenario 3.0%
4263 unchanged · 132 constant-schema targets skipped · advisory only
node 24.16.0 · linux x64 · 4 cores · 8×2 rounds · 2 screening jobs · confirmed by 2 fresh processes

recursive.ts: main's async-with-path branch returns early through
B_asyncTry, so it marks its own output like the final return. The parse
loop no longer marks a recursive ref, which would otherwise link its input
checks to a fresh var.

knownBugs.ts and the codec fuzz: keep main's to-output-keeps-source-refinement
limitation and its narrowed matcher, and drop this branch's lossy skip of
decode conformance. The fix here leaves the finding standing (isOutput reads
"36" now, still no uuid), so the entry is still reached, and the skip would
also have hidden every other lossy member.

Goldens regenerated: bundle size, benchmarks, and the NaN arm of
codec-json-union-nan-from-null, which now checks i in place on top of main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X9uDwr3yJ2L75BYdetqyE1
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

Spec performance

6 slower, 1 faster of 6488 timed targets · bdc521a vs 2ebcac6 (origin/main)

Not timed

  • behavior changed, not timed - codec-number-to-json-schema-not · parse · rejects: excluded: baseline accepted it, now rejected
  • behavior changed, not timed - codec-number-to-json-schema-not · decode · rejects: excluded: baseline accepted it, now rejected
  • behavior changed, not timed - codec-string-minLength-number · encode · accepts: long-enough: baseline rejected it, now accepted

Slower

target Δ vs baseline
codec-json-union-recursive-union-member · parse · accepts ×3 +8.9% slower
recursive-same-name · encode · accepts +6.6% slower
recursive-same-name · decode · accepts +5.9% slower
to-refined-source-output · create+compile · decode +5.0% slower
codec-number-to-json-schema-not · parse · accepts +4.4% slower
to-refined-source-output · create+compile · parse +4.0% slower

Faster

target Δ vs baseline
to-refined-source-output · is · accepts -15.3% faster

Full report ↗

+% slower than baseline, -% faster · noise floor create 3.0% · create+compile 3.0% · run 3.0% · async 3.3% · scenario 3.0%
6481 unchanged · 134 constant-schema targets skipped · advisory only
node 24.16.0 · linux x64 · 4 cores · 8×2 rounds · 2 screening jobs · confirmed by 2 fresh processes

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