db-ivm structural-identity oracle model treats nested deep nodes as distinct
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 半天
- 新手友好度
- 58/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- databases, testing-qa
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- TypeScript
- 星标
- 3.9k
- 派生
- 272
- 平均合并
- 1 天 21 分钟
- 30 天内合并 PR
- 241
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TanStack/db 的其他 Issue
-
难度 5/5 一周以上 新手友好度 8/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 25/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 5/100
维护者通常 1 天内回复
-
query-db: a Query refetch that joins a loader's refetch acquisition does not report shifted pages未关闭
难度 5/5 一周以上 新手友好度 8/100
维护者通常 1 天内回复
-
A live query's preload on an on-demand collection waits for any persisting optimistic transaction未关闭
难度 5/5 一周以上 新手友好度 12/100
维护者通常 1 天内回复
相似的 Issue
-
streams:add
难度 2/5 1 小时以内 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
apache/rocketmq-dashboard#6872 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
interledger/publisher-tools#931 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
ARTPARK-SAHAI-ORG/calibrate-frontend#727 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
fab-geocommuns/RNB-site#539 ·
维护者通常 2 天内回复