Repository navigation
feat(db): add bounded incoming-reference lookup to write transactions (#924) - #926
Merged
Merged
Conversation
…#924) WriteTransaction and OwnedWriteTransaction gain incoming_refs, which returns every live scalar reference to an entity, ignoring valid time, or an explicit exhausted outcome when a links or records budget is exceeded. Pending and staged facts keep target-keyed positions, and durable and large-transaction data are walked by VAET prefix, so the work depends only on the target's own history. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H2a7QmsdjnGhRdBSbw6GB7
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H2a7QmsdjnGhRdBSbw6GB7
…abase (#924) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H2a7QmsdjnGhRdBSbw6GB7
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…ked files portably (#924) Exercise the default CommittedReader method, which no test executed and which left src/storage/mod.rs below its coverage floor. Windows file locks are mandatory, so the incoming-reference tests compare the open database's length there and its exact bytes elsewhere. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H2a7QmsdjnGhRdBSbw6GB7
#924) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H2a7QmsdjnGhRdBSbw6GB7
This was referenced Nov 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
incoming_refs(target, limits)toWriteTransactionandOwnedWriteTransaction: a bounded lookup of the(source, attribute)pairs that currently hold a scalarValue::Refto an entity, as seen by the transaction (staged over pending over committed, or the working trees of a large transaction).max_linksandmax_recordsbudgets. The outcome isIncomingRefs::Complete { links, records_examined }orIncomingRefs::Exhausted { budget, records_examined }; an exhausted lookup returns no links. RequireCompletebefore cascading deletes.tx_count.BrowserDbAPI.Part of #924. The JVM binding and docs-site changes follow in their own repositories.
Type of change
Binary size
x86_64 Linux dist build, Rust 1.99.1: base
73388aec51,246,760 bytes, branch 1,250,568 bytes (+3,808); gate 1,280,000 bytes. CI (Rust 1.100.1): 1,225 KiB of 1,250 KiB.Write-path cost
Criterion medians, base against branch, two rounds with CPU/memory pinning swapped between them. No median regression above 5% on any of 65 workload IDs in either round. Largest increase: +4.01% (
insert/explicit_tx/10k, round 1); that control is +2.9% to +4.0% at 1k, 10k and 1m and +0.6% to +1.0% at 100k. Largest increase on a ref-writing workload: +2.36% (incoming_ref_writes/staged/1000). Method and reproduction:docs/testing/924-incoming-refs.md.Added pending-store memory per ref fact (10,000 ref facts): 13.13 B with one target, 13.24 B with 16 targets, 75.18 B with one target per ref.
All 65 workload IDs and scales (medians)
incoming_ref_writes/checkpoint/1000incoming_ref_writes/checkpoint/10000incoming_ref_writes/pending/1000incoming_ref_writes/pending/10000incoming_ref_writes/promotion/1000incoming_ref_writes/promotion/10000incoming_ref_writes/staged/1000incoming_ref_writes/staged/10000incoming_ref_writes/wal_recovery/1000incoming_ref_writes/wal_recovery/10000checkpoint/100kcheckpoint/10kcheckpoint/1kcheckpoint/1mcheckpoint/after_100k_facts/100kcheckpoint/after_100k_facts/10kcheckpoint/after_1_fact/100kcheckpoint/after_1_fact/10kcheckpoint/after_1_fact/1mcheckpoint/set_storage/inline_unique/10kcheckpoint/set_storage/long_repeated/10kcheckpoint/set_storage/long_unique/10kcheckpoint/storage_v3/multivalue_inline_unique/10kcheckpoint/storage_v3/multivalue_long_repeated/10kcheckpoint/storage_v3/multivalue_long_unique/10kcheckpoint/storage_v3/rebuild_damaged_avet/100k_historycheckpoint/storage_v3/verify/100k_historyinsert/batch_100/100kinsert/batch_100/10kinsert/batch_100/1kinsert/batch_100/1minsert/explicit_tx/100kinsert/explicit_tx/10kinsert/explicit_tx/1kinsert/explicit_tx/1minsert/single_fact/100kinsert/single_fact/10kinsert/single_fact/1kinsert/single_fact/1minsert_file/batch_100/100kinsert_file/batch_100/10kinsert_file/batch_100/1kinsert_file/batch_100/1minsert_file/chunked/execute/65535insert_file/chunked/execute/65537insert_file/chunked/retract/65535insert_file/chunked/retract/65537insert_file/chunked/statement_rollback/65537insert_file/chunked/write_tx/65535insert_file/chunked/write_tx/65537insert_file/explicit_tx/100kinsert_file/explicit_tx/10kinsert_file/explicit_tx/1kinsert_file/explicit_tx/1minsert_file/set_storage/inline_unique/10kinsert_file/set_storage/long_repeated/10kinsert_file/set_storage/long_unique/10kinsert_file/set_storage/scalar/10kinsert_file/single_fact/100kinsert_file/single_fact/10kinsert_file/single_fact/1kinsert_file/single_fact/1mopen/wal_replay/100kopen/wal_replay/10kopen/wal_replay/1kChecklist
cargo testpasses (2,190 passed, 0 failed, 23 ignored; withtest-hooks2,228 passed, 32 ignored)cargo clippy -- -D warningsis clean (native with and withouttest-hooks, browser wasm, wasip1)cargo fmt --checkpassesunwrap()/expect()in library code pathsCHANGELOG.mdupdated underUnreleasedNotes for reviewer
🤖 Generated with Claude Code
https://claude.ai/code/session_01H2a7QmsdjnGhRdBSbw6GB7