db-ivm structural-identity oracle model treats nested deep nodes as distinct
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- Ein halber Tag
- Anfängerfreundlichkeit
- 58/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript
- Bereich
- databases, testing-qa
Rechercherichtung
Start in packages/db-ivm/tests/structural-identity-oracle.property.test.ts, in the test "agrees with D2 value identity for independent values" and the model's normal(spec) function. Confirm the counterexample by running the test with the seed and path from the issue, then make the model agree with equalHashValues for nested deep nodes without changing equalHashValues or structuralIdentity. Done when the named replay passes, the property passes at 2000 runs, and the counterexample is kept as a fixed case.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
The db-ivm structural-identity oracle fails at random in CI. The failing assertion is the oracle's own sanity check, so the defect is most likely in the oracle's model, not in equalHashValues or structuralIdentity.
Failure
packages/db-ivm/tests/structural-identity-oracle.property.test.ts, test "agrees with D2 value identity for independent values":
Property failed after 1888 tests
{ seed: -956497647, path: "1887", endOnFailure: true }
Counterexample: [{"k":"deep","depth":6,"v":{"k":"leaf","i":3}},{"k":"deep","depth":3,"v":{"k":"deep","depth":3,"v":{"k":"leaf","i":3}}}]
AssertionError: model vs equalHashValues: expected true to be false
It failed CI on #2127, which does not change db-ivm.
Reproduce
The property calls fast-check directly, so the oracle replay environment variables do not reach it. Add the seed and path to the options, then run the test:
{ numRuns: 2000, seed: -956497647, path: `1887` }
On main (bbbf017ef) it fails at the first run with the same counterexample.
Analysis
Both specs build the same value: a leaf nested six levels deep. deep(6, leaf) and deep(3, deep(3, leaf)) produce equal structures, so equalHashValues returns true. The model's normal(spec) gives different strings for the two specs, so the model predicts false. The model normalizes the spec, not the built value, so it does not see that nested deep nodes compose.
Suggested fix
- Make
normalcollapse nesteddeepnodes (sum their depths) before it serializes, or compute the model from the built value's shape. - Add the counterexample as a named replay.
- Route this property through the shared oracle config, so that
TANSTACK_DB_ORACLE_SEEDandTANSTACK_DB_ORACLE_PATHcan replay it.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 3.9k
- Forks
- 272
- Ø Merge
- 1 T. 48 Min.
- Gemergte PRs (30 T.)
- 238
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TanStack/db
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 12/100
Maintainer antworten meist innerhalb von 1 Tag
-
Ordered, limited live query over a string key commits `loading` first (and `orderBy().findOne()` since 0.11.1)Evtl. vergeben @KyleAMathews hat das heute übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 18/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 18/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 18/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 8/100
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
dsh-market/dsh-market#877 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
stellar/stellar-dev-skill#151 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
area:arcade game ready-for-agent
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
fderuiter/deruiter.dev#2281 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
scope: data grid type: bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 2 Tagen