db-ivm structural-identity oracle model treats nested deep nodes as distinct
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 58/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- databases, testing-qa
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 3.9k
- Fork
- 272
- Merge trung bình
- 1 ngày 48 phút
- Pull request đã merge (30 ngày)
- 238
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TanStack/db
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Ordered, limited live query over a string key commits `loading` first (and `orderBy().findOne()` since 0.11.1)Có thể đã có người làm @KyleAMathews đã nhận 1 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 18/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 8/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
xdjs/MusicNerdWeb#1532 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
sebastian-software/ardo#352 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
@react95/core good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 3 ngày
-
@shikijs/stream: `ShikiStreamTokenizer.clone()` shares its `tokensStable` array with the originalCó thể đã có người làm @xyrolle đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 6 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày