Skip to content

Fix review blockers: cache key, bulk card-one, Int AVET bounds - #12

Closed
tiensonqin wants to merge 1 commit into
logseq/shared-api-parity-fe5dfrom
logseq/review-fixes-fe5d
Closed

Fix review blockers: cache key, bulk card-one, Int AVET bounds#12
tiensonqin wants to merge 1 commit into
logseq/shared-api-parity-fe5dfrom
logseq/review-fixes-fe5d

Conversation

@tiensonqin

Copy link
Copy Markdown
Contributor

Summary

Addresses PR #5 review blockers:

  1. Query result cache key — include db_uid, as_of_tx, since_tx, history, and physical filter_pred so shared query ASTs cannot return wrong rows across DBs or temporal/filter views.
  2. Bulk card-one tx_data — restore live-fact semantics in the O(n) by_ea path (from_db excludes in-tx retracts; from_acc is live added facts only) so same-tx 20→30→20 keeps the final assert.
  3. Int AVET bounds — avoid n±1 overflow at max_int/min_int and post-filter when bounds cannot be tightened.
  4. Teststest_query_result_cache (cross-DB, as_of, since, history, filter, toggle) and test_bulk_card_one (re-assert regression); Int range edge cases.

Also notes in the TAVE design doc which parts are shipped vs design-only.

Test plan

  • dune build test/test_query_result_cache.exe test/test_bulk_card_one.exe
  • dune exec -- test/test_query_result_cache.exe
  • dune exec -- test/test_bulk_card_one.exe
  • Related query/transact suites (test_query_exec_parity, test_shared_queries, test_tx_history)
Open in Web Open in Cursor 

Result cache now keys on db_uid plus as_of/since/history/filter_pred so
shared query ASTs cannot cross-hit across DBs or temporal/filter views.
Restore live-fact semantics in the O(n) bulk tx_data path for same-tx
card-one re-asserts, guard Int n±1 AVET bounds at min/max_int, and add
regression tests covering cache isolation, bulk updates, and range edges.

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
@tiensonqin tiensonqin closed this Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants