Repository navigation
test: repair structural identity oracle normal form - #2153
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
Size Change: 0 B Total Size: 217 kB ℹ️ View Unchanged
|
More templates
@tanstack/angular-db
@tanstack/browser-db-sqlite-persistence
@tanstack/capacitor-db-sqlite-persistence
@tanstack/cloudflare-durable-objects-db-sqlite-persistence
@tanstack/db
@tanstack/db-ivm
@tanstack/db-sqlite-persistence-core
@tanstack/electric-db-collection
@tanstack/electron-db-sqlite-persistence
@tanstack/expo-db-sqlite-persistence
@tanstack/node-db-sqlite-persistence
@tanstack/offline-transactions
@tanstack/powersync-db-collection
@tanstack/query-db-collection
@tanstack/react-db
@tanstack/react-native-db-sqlite-persistence
@tanstack/react-router-with-db
@tanstack/rxdb-db-collection
@tanstack/solid-db
@tanstack/svelte-db
@tanstack/tauri-db-sqlite-persistence
@tanstack/trailbase-db-collection
@tanstack/vue-db
commit: |
Incremental update benchmarkComparing Overall median write time vs base: 1.00× · cold hydrate time: 0.99× (geometric mean of per-case ratios; lower is faster). Writes: 4 regression(s), 2 improvement(s) (threshold: ±20% and >0.05ms). Cold hydrate: 1 regression(s), 1 improvement(s) (threshold: ±50% and >5ms). Per-case flags are noisy on shared runners. Read the geometric means first. Writes
Cold hydrate
Each row aggregates the 14.4 scale/index/write-mode configurations of that query; per-configuration tables below. 100 rows/collection | source indexes: none | synced writes — geomean 0.95×, cold 1.00×, 2 change(s)
100 rows/collection | source indexes: none | optimistic writes — geomean 0.95×, cold 0.91×
100 rows/collection | source indexes: manual | synced writes — geomean 0.99×, cold 0.90×, 1 change(s)
100 rows/collection | source indexes: manual | optimistic writes — geomean 1.00×, cold 1.07×
1,000 rows/collection | source indexes: none | synced writes — geomean 1.26×, cold 1.05×, 2 change(s)
1,000 rows/collection | source indexes: none | optimistic writes — geomean 0.99×, cold 0.94×
1,000 rows/collection | source indexes: manual | synced writes — geomean 0.95×, cold 0.89×
1,000 rows/collection | source indexes: manual | optimistic writes — geomean 0.96×, cold 1.02×
10,000 rows/collection | source indexes: none | synced writes — geomean 1.06×, cold 1.09×, 1 change(s)
10,000 rows/collection | source indexes: none | optimistic writes — geomean 0.96×, cold 0.98×
10,000 rows/collection | source indexes: manual | synced writes — geomean 0.96×, cold 1.01×
10,000 rows/collection | source indexes: manual | optimistic writes — geomean 0.99×, cold 1.00×, 2 change(s)
Runner: node v24.8.0, linux 6.17.0-1022-azure, AMD EPYC 7763 64-Core Processor. Timings on shared CI runners are noisy; treat small deltas as indicative only. |
…form # Conflicts: # docs/contributing/oracle-coverage.md
Why this change
The structural identity oracle rejected two specs that build the same nested array. An explicit array around
deep(5, value)equalsdeep(6, value)after construction. The old model kept thedeeptag in its normal form. It therefore disagreed with D2 equality and produced a false failure.This PR expands
deepinto repeated array normal forms. It changes the oracle, its replay registration, and its coverage record. It does not change production code.What the oracle checks
The equal-pair generator uses both spellings of the same array. An adjacent-depth case checks that one missing array level remains unequal.
Collision cases compare symbols with the same description and Map, Set, and object values with similar contents. New cases vary later Map and Set entries and an enumerable array field. The tests check both
equalHashValuesandstructuralIdentitywhen each call returns.Fixed cases also vary array subclasses, object prototypes, key order, and hidden symbols.
Both generated properties run fixed and seedless campaigns of 2,000 cases. The replay manifest accepts a seed and shrink path for either property.
Scope
The Set generator wraps its second member so JavaScript keeps both entries. It does not test native Set deduplication.
The RegExp generator uses numeric
lastIndexvalues. Issue #2192 tracks a pre-existing collision for reference-valuedlastIndexand itsgroupByeffect. That defect remains open. The incrementalization oracle owns the separategroupBypath.Verification
mainfailed at seed1158727847, path255.deepmodel fails after three fixed-seed cases. Removing the equivalent-spelling pair lets that wrong model pass both campaigns.@tanstack/db-ivmtypecheck, ESLint, Prettier, andgit diff --checkpass.Summary by CodeRabbit
deeprepresentations, enumerable array fields, symbols, and Maps, Sets, and objects.lastIndex.