Repository navigation
Conversation
Ingest reads a node-table sort-key time or weight at the position of the relation's destination node, whatever table the spec names. A spec that names another table gives each edge the value of some other row, with no error, or fails late with "sort key offset out of range". Config validation now rejects a time or weight spec whose table is not the relation's destination table, or, for an edge table, the edge table itself. The compare is exact, as in the ingest code that reads the values. The reverse spec of a one-way fkey is not checked, because ingest does not build that relation. Four test fixtures named the fkey's own table in a forward spec. They now put the same spec in reverse, which reads the same column for the same rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Change mapObserved failure: a sort-key spec that names a table other than the one ingest reads gives each edge another row's value, with no error. Existing behavior: validation never reads the table of a time or weight spec. Smallest change: one check in each of the two validation loops. Focused check: validation tests for every allowed and refused case, and an ingest test that fails before any output. Stopping condition: every wrong spec fails at load, and every config in the repository still passes.
|
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueNote
|
Design discussion or issue: none. A read-only check of DiskGraph edge sort keys found this bug on 3 December 2026.
Summary
This PR makes config validation reject an edge sort-key time or weight spec that names a table that ingest does not read for that relation. The error names the fkey, the direction, the spec kind, the named table and the table to name instead.
Why
Ingest reads a node-table sort-key value at the position of the relation's destination node, whatever table the spec names. A spec that names another table therefore gives each edge the value of some other row, with no error. A check used 2,000 random orders with a forward spec that named the orders table. Every edge to a user got the time of the order whose key equals that user's key: 2,000 of 2,000. When the input was spread over 8 files, the edge times even changed between two ingests of the same data. Sometimes the read position does not exist in the named table. Ingest then fails late with "sort key offset out of range", which does not name the config.
Before and now
The name compare is exact and case-sensitive, as in the ingest code that reads the values. A reverse spec of a one-way fkey (
bidirectional: false) is not checked, because ingest does not build that relation.Why the new way is better
config_converter/convert.rs) names the destination table in forward specs and the fkey's own table in reverse specs. The experimental kumo-pytorch materialization does the same.Trade-off
ingest_timestamp_range.rsand one iningest_null_ts.rs. They now put the same spec in reverse, which reads the same column for the same rows. Their asserts and their printed drop and edge counts did not change.Change map
See the change-map comment on this PR.
Testing Done
validate_fkey_sort_key_tables,validate_edge_table_sort_key_tablesandvalidate_one_way_fkey_skips_reverse_sort_keyintests/graph_config.rs, andsort_key_on_owner_table_fails_before_outputiningest_sort_key_alignment.rs. All four fail on main and pass with the change. Each weakened version of the check fails at least one of them: a case-insensitive compare, swapped edge fkeys, no weight check, or a reverse check on a one-way fkey.cargo test --locked -p diskgraph-ingestafter the last change: 791 passed, 7 ignored and 1 failed. The full workspace run before the last error-text change: 2,206 passed, 18 ignored and 1 failed. The failure in both runs isdisk_manager::tests::test_eviction_under_real_disk_pressure, which measures free space on a shared disk and does not use the config code.cargo clippy --locked --workspace --all-targets --exclude diskgraph-ptrhash -- -D warnings: clean.diskgraph-ptrhashfails the same way on main on aarch64, in an unchanged test file.kumoapimodule, the same as on main.Hotfix Context
Not a hotfix.
Checklist
🤖 Generated with Claude Code