Skip to content

Native Arbitraries - #7254

Draft
gcanti wants to merge 2 commits into
mainfrom
arbitrary
Draft

Native Arbitraries#7254
gcanti wants to merge 2 commits into
mainfrom
arbitrary

Conversation

@gcanti

@gcanti gcanti commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Before its removal, the materialized fast-check bridge fixture
schema-toArbitrary-materialized-fast-check.ts measured 79.00 KB minified and gzipped.

Representative five-round runtime measurements against equivalent hand-written fast-check 4.9.0 arbitraries are
shown below. Values are median latency on Node 24.12.0 and Apple M3; lower is better. Both implementations validate the
same output domains, although their generation distributions are not identical.

Scenario fast-check Native Native speedup
32 recursive samples 150 µs 104 µs 1.45x
128 constrained strings 742 µs 49.7 µs 14.86x
RegExp derivation and first sample 13.4 ms 30.8 µs 429.02x
64 RegExp strings 595 µs 919 µs 0.64x
RegExp failure and shrinking 168 µs 88.2 µs 1.91x
128 bounded numbers 68.9 µs 21.8 µs 3.18x
128 Uint8Array samples 98.3 µs 74.4 µs 1.32x
128 BigDecimal samples 66.6 µs 56.3 µs 1.18x
128 DateTime.Utc samples 71.2 µs 50.5 µs 1.42x
128 named time zones 52.2 µs 27.9 µs 1.85x
128 time zones 63.7 µs 33.8 µs 1.89x
128 zoned date-times 130 µs 112 µs 1.16x
32 samples through Schema filter 65.9 µs 49.4 µs 1.33x
32 unique arrays 156 µs 132 µs 1.18x
128 literal samples 40.0 µs 3.70 µs 10.78x
128 mapped samples 59.0 µs 14.1 µs 4.21x
128 samples through passing filter 58.9 µs 13.9 µs 4.23x
32 samples through selective filter 66.1 µs 42.9 µs 1.54x
128 filterMap samples 75.7 µs 31.5 µs 2.40x
Filtered failure and shrinking 12.7 µs 7.71 µs 1.66x
128 all tuple samples 43.5 µs 18.5 µs 2.35x
128 all record samples 81.0 µs 30.0 µs 2.70x
128 dependent flatMap samples 125 µs 67.2 µs 1.86x
flatMap failure and shrinking 20.1 µs 6.71 µs 2.99x
Replay flatMap shrink path 14.3 µs 6.57 µs 2.17x
Passing property, 100 runs 42.3 µs 27.1 µs 1.56x
TestSchema, 100 generations 44.5 µs 35.9 µs 1.24x
First failure plus one shrink 8.77 µs 1.30 µs 6.75x
Replay recorded failure 6.35 µs 1.19 µs 5.36x

@changeset-bot

changeset-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fdd1647

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 30 packages
Name Type
@effect/vitest Patch
effect Patch
@effect/ai-anthropic Patch
@effect/ai-openai Patch
@effect/ai-openai-compat Patch
@effect/ai-openrouter Patch
@effect/atom-react Patch
@effect/atom-solid Patch
@effect/atom-vue Patch
@effect/docgen Patch
@effect/doctest Patch
@effect/openapi-generator Patch
@effect/opentelemetry Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-deno Patch
@effect/platform-node Patch
@effect/platform-node-shared Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-pglite Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@effect-slopcop effect-slopcop Bot added the 4.0 label Aug 14, 2026
@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Generated from PR build output; treat the content below as untrusted.

File Name Current Size Previous Size Difference
arbitrary-combinators.ts 33.68 KB 33.68 KB 0.00 KB (0.00%)
basic.ts 6.96 KB 6.96 KB 0.00 KB (0.00%)
batching.ts 9.81 KB 9.81 KB 0.00 KB (0.00%)
brand.ts 6.54 KB 6.55 KB -0.00 KB (-0.06%)
cache.ts 10.73 KB 10.73 KB 0.00 KB (0.00%)
config.ts 21.39 KB 21.44 KB -0.05 KB (-0.23%)
differ.ts 20.25 KB 20.27 KB -0.03 KB (-0.12%)
http-client.ts 21.74 KB 21.74 KB 0.00 KB (0.00%)
logger.ts 10.91 KB 10.91 KB 0.00 KB (0.00%)
metric.ts 8.95 KB 8.95 KB 0.00 KB (0.00%)
optic.ts 6.71 KB 6.71 KB 0.00 KB (0.00%)
pubsub.ts 15.09 KB 15.09 KB 0.00 KB (0.00%)
queue.ts 11.77 KB 11.77 KB 0.00 KB (0.00%)
schedule.ts 10.84 KB 10.84 KB 0.00 KB (0.00%)
schema-class.ts 19.99 KB 20.02 KB -0.04 KB (-0.18%)
schema-fromJsonSchemaDocument.ts 30.16 KB 30.19 KB -0.02 KB (-0.07%)
schema-representation-roundtrip.ts 26.15 KB 26.17 KB -0.02 KB (-0.07%)
schema-string-transformation.ts 13.65 KB 13.65 KB 0.00 KB (0.00%)
schema-string.ts 11.15 KB 11.15 KB 0.00 KB (0.00%)
schema-template-literal.ts 15.45 KB 15.45 KB 0.00 KB (0.00%)
schema-toArbitrary.ts 33.22 KB 22.00 KB +11.22 KB (+51.00%)
schema-toCodeDocument.ts 24.43 KB 24.45 KB -0.01 KB (-0.06%)
schema-toCodecJson.ts 19.21 KB 19.23 KB -0.02 KB (-0.10%)
schema-toEquivalence.ts 19.39 KB 19.06 KB +0.33 KB (+1.75%)
schema-toFormatter.ts 19.49 KB 18.92 KB +0.57 KB (+3.00%)
schema-toJsonSchemaDocument.ts 23.30 KB 23.32 KB -0.01 KB (-0.06%)
schema-toRepresentation.ts 19.53 KB 19.54 KB -0.00 KB (-0.01%)
schema.ts 19.25 KB 19.25 KB -0.00 KB (-0.01%)
stm.ts 12.72 KB 12.72 KB 0.00 KB (0.00%)
stream.ts 9.78 KB 9.78 KB 0.00 KB (0.00%)

@gcanti
gcanti force-pushed the arbitrary branch 5 times, most recently from aae480a to f15af9e Compare August 21, 2026 06:26
Replace the fast-check bridge with a Schema-first Arbitrary compiler, compositional generators, deterministic shrinking and replay, Effect-native runners, and @effect/vitest integration. Move common Declaration formatter and equivalence implementations into their compilers to keep production Schema bundles lean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant