Skip to content

Remove unused PtrHash remapping and vendored epserde - #175

Merged
haoweiyu-kumo merged 4 commits into
mainfrom
remove-ptrhash-remap
Nov 4, 2026
Merged

haoweiyu-kumo merged 4 commits into
mainfrom
remove-ptrhash-remap

Conversation

@haoweiyu-kumo

@haoweiyu-kumo haoweiyu-kumo commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

DiskGraph always uses index_no_remap(), but ingestion still builds and serializes an unused remapping table. Remove that parameter, table, scratch storage, packed-storage module, and dense index() API, eliminating cacheline-ef.

Replace the patched, vendored epserde 0.8 copy with upstream epserde 0.13.2. Remove the Cargo patch, copied source, standalone CI step, and vendor provenance. Preserve the other dependency security fixes from #172 and keep maligned absent. Regenerate notices for all four shipped artifact graphs.

Breaking change: epserde now writes format 2.0 with SHA-256 type/alignment hashes. Rebuild existing indexes from source data; do not resume ingestion from an old primary-key-map checkpoint. Frozen 0.8 fixtures remain as rejection tests.

Hash files now use epserde's exact-length, file-backed mmap() API in both query and ingestion loaders. The padded load_mmap() helper could accept truncated current-format files and silently change lookup slots. Regression tests reproduce that failure before the switch and verify rejection afterward; upstream epserde remains unmodified.

Change map

File-by-file rationale

Testing Done

Rust commands run from packages/diskgraph/ after rebasing on current main, including #172:

  • cargo check -q -p diskgraph-ingest -p diskgraph-index passed.
  • cargo test --locked -p diskgraph-ptrhash: 12 passed, 7 ignored.
  • cargo test --locked -p diskgraph-index --test epserde_compat: 8 passed; both hashers and all key shapes reject the frozen 0.8 files, round-trip current indexes, and reject truncation by 1 through 32 bytes. These eight cases all failed against the padded loader, accepting a missing final byte.
  • cargo test --locked -p diskgraph-index --lib: 27 passed, including a real shard-loader test for 10,000 correct row-ID lookups and rejection of truncated copies.
  • The shard-loader regression also passes with --features pkhash128.
  • cargo test --locked --offline -p diskgraph-ptrhash --no-default-features: 9 passed, 7 ignored.
  • Scoped rustfmt --check, artifact-manifest/notice checks, repository documentation validation, and git diff --check passed.
  • cargo tree --locked --offline --all-features and all four artifact graphs contain registry epserde 0.13.2, with neither cacheline-ef nor maligned.
  • python -m unittest test.scripts.test_gen_third_party: 10 passed.
  • Ruff and mypy passed for the changed artifact-manifest generator.

Checklist

  • Listed breaking changes and the required index rebuild.
  • Updated fork/fixture documentation and generated attribution.
  • Added serialization/mmap regression coverage and adapted the legacy fixtures.

@haoweiyu-kumo

haoweiyu-kumo commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator Author

Change map

Requested requirement: remove unused remapping and eliminate cacheline-ef/maligned. Previously ingestion constructed a table that production lookups bypassed, and main retained a patched epserde 0.8 copy. The sufficient change removes that path and upgrades the remaining serializer dependencies; it deliberately requires rebuilding existing indexes. No legacy reader or migration is included.

Verification: construction/lookup, serialized and mmap round trips, old-format rejection, both production crates compiling, dependency-tree inspection, and regenerated artifact checks. Stop when the unused path and advisory dependency are absent with these checks passing. After rebasing on main including #172, all 8 compatibility tests and 27 index unit tests pass. The compatibility cases reproduce truncation acceptance with the padded loader and now reject 1 through 32 missing bytes; the real shard-loader regression passes in both hash modes. Frozen 0.8 files are retained as rejection fixtures; current indexes round-trip through all three loaders.

File Function / scope What changed Why
packages/diskgraph/Cargo.toml, packages/diskgraph/diskgraph-ptrhash/Cargo.toml Dependency declarations Upgrade epserde; remove cacheline-ef, direct mem_dbg, and redundant derive dependency. Replace the local epserde backport with upstream 0.13.2 and keep maligned absent.
packages/diskgraph/Cargo.lock Resolved dependencies Regenerate for the reduced dependency graph. Pin the upgraded serializer and omit removed crates.
packages/diskgraph/deny.toml Advisory policy Replace the obsolete backport explanation with upstream epserde 0.13. Keep the existing advisory-free policy accurate.
packages/diskgraph/diskgraph-ptrhash/src/lib.rs PtrHash, PtrHashParams, construction and lookup Remove remapping parameter, state, generic, construction pass, and dense index API; retain direct pilot access; mark phantom parameters and keep the bucket function fully copied for epserde 0.13. All production callers use non-remapped slots.
packages/diskgraph/diskgraph-ptrhash/src/build.rs, packages/diskgraph/diskgraph-ptrhash/src/sort_buckets.rs Construction impls Drop the removed storage generic. Match the reduced PtrHash type.
packages/diskgraph/diskgraph-ptrhash/src/scratch.rs PtrHashScratch Remove free_slots buffer. No remapping scratch is needed.
packages/diskgraph/diskgraph-ptrhash/src/pack.rs, packages/diskgraph/diskgraph-ptrhash/src/util.rs Packed storage and prefetch helper Delete unused storage module and its prefetch helper. Remove cacheline-ef integration and dead code.
packages/diskgraph/diskgraph-ptrhash/src/bucket_fn.rs, packages/diskgraph/diskgraph-ptrhash/src/reduce.rs, packages/diskgraph/diskgraph-ptrhash/src/hash.rs Supporting hash types Remove MemSize derives; update epserde attributes where needed. Remove unused memory-reporting dependency and compile with epserde 0.13.2.
packages/diskgraph/diskgraph-index/src/pkmap.rs, packages/diskgraph/diskgraph-ingest/src/mapping.rs Mapped hash loading, lookup, and truncation regression Use epserde 0.13 MemCase ownership and uncase; use exact-length file-backed mmap instead of padded load_mmap; test correct row IDs and truncation rejection in both hash modes. Preserve mapped lookups and reject truncated files before they can change row IDs; keep the routing-hasher import available in both tested modes.
packages/diskgraph/diskgraph-ingest/src/lib.rs write_pk_hash_and_data Adapt serialization to the unsafe API with its validity invariant. Write typed remap-free hashes with epserde 0.13.2.
packages/diskgraph/diskgraph-ptrhash/src/test.rs Construction and persistence regressions Use slot bounds; test serialized/mapped lookups for each key type and reject the previous file-format version. Verify collision-free lookup and deliberate format incompatibility.
packages/diskgraph/diskgraph-ptrhash/src/test_on_disk_hashes.rs Persistence golden values Pin full SHA-256 layout hashes and retain existing key-hash golden values. Record the intentional layout break while detecting accidental key-hash changes.
packages/diskgraph/diskgraph-ptrhash/README.md Fork behavior and saved-index compatibility Document remap removal, required rebuilds, and why hash files must use exact-length mmap rather than zero-padded helpers. Prevent reuse of old indexes or old PK-map checkpoints.
packages/diskgraph/third_party/artifact-manifest.json, 3rdparty/notices/inventory.json, THIRD-PARTY.txt Generated dependency attribution Regenerate shipped dependency records and notices. Attribute the actual upgraded graph and remove obsolete components.
.github/workflows/testing.yml Rust test job Remove the standalone test step for the deleted vendor crate. Workspace tests continue to cover the upgraded registry dependency.
packages/diskgraph/diskgraph-index/examples/write_legacy_index_fixture.rs Obsolete fixture writer Delete the old-format fixture producer. Avoid overwriting frozen 0.8 evidence with current-format data.
packages/diskgraph/diskgraph-index/tests/epserde_compat.rs Legacy rejection and current round trips Assert old-version rejection, verify new-index round trips, and reject each truncation from 1 through 32 bytes using the production mapping API for both hashers and all key types. Replace the old compatibility promise with verified rebuild behavior.
packages/diskgraph/diskgraph-index/tests/fixtures/epserde-0.8/README.md Frozen fixture documentation Document intentional rejection and the historical writer location. Preserve fixture provenance without claiming old-file compatibility.
packages/diskgraph/scripts/generate_artifact_manifest.py stable_source and artifact typing Remove epserde from the vendored-source classification and type the artifact tuple; modernize the Sequence import. Classify upstream epserde correctly and pass mypy/Ruff.
packages/diskgraph/third_party/source-provenance.json Vendored provenance Remove the deleted epserde source/license records. Only maintained vendored sources belong in the inventory.
packages/diskgraph/third_party/epserde/.cargo_vcs_info.json, packages/diskgraph/third_party/epserde/Cargo.toml, packages/diskgraph/third_party/epserde/LICENSE-Apache-2.0, packages/diskgraph/third_party/epserde/LICENSE-LGPL-2.1-or-later, packages/diskgraph/third_party/epserde/LOCAL-PATCH.md, packages/diskgraph/third_party/epserde/README.md, packages/diskgraph/third_party/epserde/build.rs, packages/diskgraph/third_party/epserde/src/deser/helpers.rs, packages/diskgraph/third_party/epserde/src/deser/mem_case.rs, packages/diskgraph/third_party/epserde/src/deser/mod.rs, packages/diskgraph/third_party/epserde/src/deser/read.rs, packages/diskgraph/third_party/epserde/src/deser/reader_with_pos.rs, packages/diskgraph/third_party/epserde/src/deser/slice_with_pos.rs, packages/diskgraph/third_party/epserde/src/impls/array.rs, packages/diskgraph/third_party/epserde/src/impls/boxed_slice.rs, packages/diskgraph/third_party/epserde/src/impls/iter.rs, packages/diskgraph/third_party/epserde/src/impls/mod.rs, packages/diskgraph/third_party/epserde/src/impls/prim.rs, packages/diskgraph/third_party/epserde/src/impls/slice.rs, packages/diskgraph/third_party/epserde/src/impls/stdlib.rs, packages/diskgraph/third_party/epserde/src/impls/string.rs, packages/diskgraph/third_party/epserde/src/impls/tuple.rs, packages/diskgraph/third_party/epserde/src/impls/vec.rs, packages/diskgraph/third_party/epserde/src/lib.rs, packages/diskgraph/third_party/epserde/src/ser/helpers.rs, packages/diskgraph/third_party/epserde/src/ser/mod.rs, packages/diskgraph/third_party/epserde/src/ser/write.rs, packages/diskgraph/third_party/epserde/src/ser/write_with_names.rs, packages/diskgraph/third_party/epserde/src/traits/copy_type.rs, packages/diskgraph/third_party/epserde/src/traits/mod.rs, packages/diskgraph/third_party/epserde/src/traits/type_info.rs, packages/diskgraph/third_party/epserde/src/utils/aligned_cursor.rs, packages/diskgraph/third_party/epserde/src/utils/alignment.rs, packages/diskgraph/third_party/epserde/src/utils/mod.rs, packages/diskgraph/third_party/epserde/tests/test_bad_deser.rs, packages/diskgraph/third_party/epserde/tests/test_bad_ser.rs, packages/diskgraph/third_party/epserde/tests/test_generics.rs, packages/diskgraph/third_party/epserde/tests/test_max_size_of.rs, packages/diskgraph/third_party/epserde/tests/test_memcase.rs, packages/diskgraph/third_party/epserde/tests/test_phantom.rs, packages/diskgraph/third_party/epserde/tests/test_prim.rs, packages/diskgraph/third_party/epserde/tests/test_review_regressions.rs, packages/diskgraph/third_party/epserde/tests/test_slice.rs, packages/diskgraph/third_party/epserde/tests/test_std.rs, packages/diskgraph/third_party/epserde/tests/test_stdlib.rs, packages/diskgraph/third_party/epserde/tests/test_tuples.rs, packages/diskgraph/third_party/epserde/tests/test_type_hash_val.rs, packages/diskgraph/third_party/epserde/tests/test_types.rs, packages/diskgraph/third_party/epserde/tests/test_zero.rs Vendored epserde source, licenses, documentation, and tests Delete the complete patched 0.8 crate. Upstream 0.13.2 replaces the local security backport.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Explain Change →

Walkthrough

The workspace upgrades Epserde from 0.8 to 0.13.2 and removes the local Epserde copy. PtrHash removes remapping and packed-storage support, returning raw slots bounded by max_index(). Index and ingest code use typed mmap loading and updated lookup calls. Tests cover current-format round trips, rejection of old-format indexes, and truncated files. Artifact inventories are refreshed for the updated dependencies.

Sequence Diagram(s)

sequenceDiagram
  participant IngestContext
  participant PtrHash
  participant HashFile
  participant PkHashShard
  IngestContext->>PtrHash: serialize constructed hash
  PtrHash->>HashFile: write serialized hash
  PkHashShard->>HashFile: mmap typed hash
  PkHashShard->>PtrHash: uncase and call index_no_remap
Loading
Pre-merge checks: Passed 1 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Change Map Design Review Warning The change map misses a proven safety regression in the remap-free lookup design. The PR changes index_no_remap from the base revision's bounds-checked pilot access to get_unchecked at `packages/d… Replace the unchecked pilot read with self.pilots.as_ref()[b], or make the lookup unsafe/private and enforce the pilot-length invariant before access. Add regression tests for DefaultPtrHash::default() and for a deserialized or mapped v…
Pr Size Warning The pull request changes 77 files. This exceeds the limit of 40 files. Split the pull request into smaller, reviewable units.
Passed Passed checks: 1 passed
Check name Status Explanation
Public Resource Access Passed PASS. The changed external references are public. The PR changes the epserde source from a local path to the crates.io registry and updates registry package records; anonymous requests returned 200 fo…
Full details: Public Resource Access

Explanation

PASS. The changed external references are public. The PR changes the epserde source from a local path to the crates.io registry and updates registry package records; anonymous requests returned 200 for the registry and all 10 new/changed crate records, including epserde 0.13.2. Updated repository origins for epserde, aliasable, allocator-api2, hashbrown, maybe-dangling, mem_dbg, and nix also returned 200. Added notice links were reachable or redirected successfully.

Full details: Change Map Design Review

Explanation

The change map misses a proven safety regression in the remap-free lookup design. The PR changes index_no_remap from the base revision's bounds-checked pilot access to get_unchecked at packages/diskgraph/diskgraph-ptrhash/src/lib.rs:485-490. The public Default implementation still creates zero reducers and an empty pilots vector at lines 216-240. FastReduce::reduce returns 0 for a zero divisor, so DefaultPtrHash::default().index_no_remap(key) reads pilot 0 out of bounds through safe API. The changed tests cover constructed valid hashes and valid serialization round trips, but not the default value or malformed short pilot storage. The proposed design therefore does not preserve safe behavior, and its safety comment only establishes an invariant for successful construction.

Resolution

Replace the unchecked pilot read with self.pilots.as_ref()[b], or make the lookup unsafe/private and enforce the pilot-length invariant before access. Add regression tests for DefaultPtrHash::default() and for a deserialized or mapped value with fewer pilots than buckets_total; verify that invalid values fail safely. Update the marked Change map to identify this safe-API invariant, the prior bounds-checked behavior, the smallest sufficient fix, and the focused verification.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Review coverage is incomplete: 2 files could not be fully reviewed. Findings from completed review steps are included; see review info for details.

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up Comments

Minor follow-up Use an isolated temporary directory for the mmap round-trip artifact.

333-337: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Use an isolated temporary directory for the mmap round-trip artifact.

The fixed filenames are shared by concurrent test processes. A concurrent write can make another invocation load incomplete or invalid serialized data and panic at load_mmap(...).unwrap(). The test also leaves the artifacts behind.

Suggested fix
diff --git a/packages/diskgraph/diskgraph-ptrhash/Cargo.toml b/packages/diskgraph/diskgraph-ptrhash/Cargo.toml
@@
 [features]
 epserde = ["dep:epserde"]
 test-utils = []
 default = ["epserde"]
+
+[dev-dependencies]
+tempfile = "3"
diff --git a/packages/diskgraph/diskgraph-ptrhash/src/test.rs b/packages/diskgraph/diskgraph-ptrhash/src/test.rs
@@
-            let output_dir = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
-                .join("../target/test-artifacts/remap-free");
-            std::fs::create_dir_all(&output_dir).unwrap();
-            let path = output_dir.join(concat!($name, ".bin"));
+            let output_dir = tempfile::tempdir().unwrap();
+            let path = output_dir.path().join(concat!($name, ".bin"));
             std::fs::write(&path, buffer.as_bytes()).unwrap();
@@
                 assert!(!seen[slot], "slot collision after deserialization");
                 seen.set(slot, true);
             }
+            drop(mapped);

Open the source location

@haoweiyu-kumo
haoweiyu-kumo temporarily deployed to gha-kumo-workflow-tests November 3, 2026 22:35 — with GitHub Actions Inactive

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

Other comments: 1
packages/diskgraph/diskgraph-ptrhash/src/test.rs: 1

333-337: Minor · Stability & Availability · Quick win

Write test artifacts to a per-run temporary directory.

The test maps the file and then uses the mapped view. Two concurrent test processes can rewrite the same deterministic file because the path and file name are fixed. This can make the test fail while the mapping is in use. Add tempfile under [dev-dependencies], and keep the TempDir alive until mapped is dropped.

Suggested fix
-            let output_dir = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
-                .join("../target/test-artifacts/remap-free");
-            std::fs::create_dir_all(&output_dir).unwrap();
-            let path = output_dir.join(concat!($name, ".bin"));
+            let output_dir = tempfile::tempdir().unwrap();
+            let path = output_dir.path().join(concat!($name, ".bin"));
             std::fs::write(&path, buffer.as_bytes()).unwrap();
Review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 46dedd8 and aab8ef9.

Files ignored due to path filters: 1
  • packages/diskgraph/Cargo.lock is excluded by !**/*.lock, !**/*.lock
Files selected for processing: 21
  • 3rdparty/notices/inventory.json
  • THIRD-PARTY.txt
  • packages/diskgraph/Cargo.toml
  • packages/diskgraph/deny.toml
  • packages/diskgraph/diskgraph-index/src/pkmap.rs
  • packages/diskgraph/diskgraph-ingest/src/lib.rs
  • packages/diskgraph/diskgraph-ingest/src/mapping.rs
  • packages/diskgraph/diskgraph-ptrhash/Cargo.toml
  • packages/diskgraph/diskgraph-ptrhash/README.md
  • packages/diskgraph/diskgraph-ptrhash/src/bucket_fn.rs
  • packages/diskgraph/diskgraph-ptrhash/src/build.rs
  • packages/diskgraph/diskgraph-ptrhash/src/hash.rs
  • packages/diskgraph/diskgraph-ptrhash/src/lib.rs
  • packages/diskgraph/diskgraph-ptrhash/src/pack.rs
  • packages/diskgraph/diskgraph-ptrhash/src/reduce.rs
  • packages/diskgraph/diskgraph-ptrhash/src/scratch.rs
  • packages/diskgraph/diskgraph-ptrhash/src/sort_buckets.rs
  • packages/diskgraph/diskgraph-ptrhash/src/test.rs
  • packages/diskgraph/diskgraph-ptrhash/src/test_on_disk_hashes.rs
  • packages/diskgraph/diskgraph-ptrhash/src/util.rs
  • packages/diskgraph/third_party/artifact-manifest.json
Files with no reviewable changes: 3
  • packages/diskgraph/diskgraph-ptrhash/src/util.rs
  • packages/diskgraph/diskgraph-ptrhash/src/scratch.rs
  • packages/diskgraph/diskgraph-ptrhash/src/pack.rs
Files not fully reviewed because their changes were unavailable: 2
  • THIRD-PARTY.txt
  • 3rdparty/notices/inventory.json

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 9 remain after this review.

@haoweiyu-kumo
haoweiyu-kumo temporarily deployed to gha-kumo-workflow-tests November 4, 2026 00:48 — with GitHub Actions Inactive
@haoweiyu-kumo haoweiyu-kumo changed the title Remove unused PtrHash remapping and maligned dependency Remove unused PtrHash remapping and vendored epserde Nov 4, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

Other comments: 1
packages/diskgraph/diskgraph-index/tests/epserde_compat.rs: 1

45-48: Minor · Stability & Availability · Quick win

Use an isolated temporary directory for each compatibility test.

Two concurrent processes running the same generated test can write the same fixed file while another process is loading or using its load_mmap view. A completed load_mem view is independent after its read finishes, but it can still race while loading. Keep the temporary directory alive until all views are dropped.

Suggested fix
-            let output_dir = Path::new(env!("CARGO_MANIFEST_DIR"))
-                .join("../target/test-artifacts/epserde-compat");
-            std::fs::create_dir_all(&output_dir)?;
-            let output = output_dir.join(concat!(stringify!($name), ".bin"));
+            let temp_dir = tempfile::tempdir()?;
+            let output = temp_dir.path().join(concat!(stringify!($name), ".bin"));
Review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 502adef and 07d19e1.

Files ignored due to path filters: 1
  • packages/diskgraph/Cargo.lock is excluded by !**/*.lock, !**/*.lock
Files selected for processing: 76
  • .github/workflows/testing.yml
  • 3rdparty/notices/inventory.json
  • THIRD-PARTY.txt
  • packages/diskgraph/Cargo.toml
  • packages/diskgraph/deny.toml
  • packages/diskgraph/diskgraph-index/examples/write_legacy_index_fixture.rs
  • packages/diskgraph/diskgraph-index/src/pkmap.rs
  • packages/diskgraph/diskgraph-index/tests/epserde_compat.rs
  • packages/diskgraph/diskgraph-index/tests/fixtures/epserde-0.8/README.md
  • packages/diskgraph/diskgraph-ingest/src/lib.rs
  • packages/diskgraph/diskgraph-ingest/src/mapping.rs
  • packages/diskgraph/diskgraph-ptrhash/Cargo.toml
  • packages/diskgraph/diskgraph-ptrhash/README.md
  • packages/diskgraph/diskgraph-ptrhash/src/bucket_fn.rs
  • packages/diskgraph/diskgraph-ptrhash/src/build.rs
  • packages/diskgraph/diskgraph-ptrhash/src/hash.rs
  • packages/diskgraph/diskgraph-ptrhash/src/lib.rs
  • packages/diskgraph/diskgraph-ptrhash/src/pack.rs
  • packages/diskgraph/diskgraph-ptrhash/src/reduce.rs
  • packages/diskgraph/diskgraph-ptrhash/src/scratch.rs
  • packages/diskgraph/diskgraph-ptrhash/src/sort_buckets.rs
  • packages/diskgraph/diskgraph-ptrhash/src/test.rs
  • packages/diskgraph/diskgraph-ptrhash/src/test_on_disk_hashes.rs
  • packages/diskgraph/diskgraph-ptrhash/src/util.rs
  • packages/diskgraph/scripts/generate_artifact_manifest.py
  • packages/diskgraph/third_party/artifact-manifest.json
  • packages/diskgraph/third_party/epserde/.cargo_vcs_info.json
  • packages/diskgraph/third_party/epserde/Cargo.toml
  • packages/diskgraph/third_party/epserde/LICENSE-Apache-2.0
  • packages/diskgraph/third_party/epserde/LICENSE-LGPL-2.1-or-later
  • packages/diskgraph/third_party/epserde/LOCAL-PATCH.md
  • packages/diskgraph/third_party/epserde/README.md
  • packages/diskgraph/third_party/epserde/build.rs
  • packages/diskgraph/third_party/epserde/src/deser/helpers.rs
  • packages/diskgraph/third_party/epserde/src/deser/mem_case.rs
  • packages/diskgraph/third_party/epserde/src/deser/mod.rs
  • packages/diskgraph/third_party/epserde/src/deser/read.rs
  • packages/diskgraph/third_party/epserde/src/deser/reader_with_pos.rs
  • packages/diskgraph/third_party/epserde/src/deser/slice_with_pos.rs
  • packages/diskgraph/third_party/epserde/src/impls/array.rs
  • packages/diskgraph/third_party/epserde/src/impls/boxed_slice.rs
  • packages/diskgraph/third_party/epserde/src/impls/iter.rs
  • packages/diskgraph/third_party/epserde/src/impls/mod.rs
  • packages/diskgraph/third_party/epserde/src/impls/prim.rs
  • packages/diskgraph/third_party/epserde/src/impls/slice.rs
  • packages/diskgraph/third_party/epserde/src/impls/stdlib.rs
  • packages/diskgraph/third_party/epserde/src/impls/string.rs
  • packages/diskgraph/third_party/epserde/src/impls/tuple.rs
  • packages/diskgraph/third_party/epserde/src/impls/vec.rs
  • packages/diskgraph/third_party/epserde/src/lib.rs
  • packages/diskgraph/third_party/epserde/src/ser/helpers.rs
  • packages/diskgraph/third_party/epserde/src/ser/mod.rs
  • packages/diskgraph/third_party/epserde/src/ser/write.rs
  • packages/diskgraph/third_party/epserde/src/ser/write_with_names.rs
  • packages/diskgraph/third_party/epserde/src/traits/copy_type.rs
  • packages/diskgraph/third_party/epserde/src/traits/mod.rs
  • packages/diskgraph/third_party/epserde/src/traits/type_info.rs
  • packages/diskgraph/third_party/epserde/src/utils/aligned_cursor.rs
  • packages/diskgraph/third_party/epserde/src/utils/alignment.rs
  • packages/diskgraph/third_party/epserde/src/utils/mod.rs
  • packages/diskgraph/third_party/epserde/tests/test_bad_deser.rs
  • packages/diskgraph/third_party/epserde/tests/test_bad_ser.rs
  • packages/diskgraph/third_party/epserde/tests/test_generics.rs
  • packages/diskgraph/third_party/epserde/tests/test_max_size_of.rs
  • packages/diskgraph/third_party/epserde/tests/test_memcase.rs
  • packages/diskgraph/third_party/epserde/tests/test_phantom.rs
  • packages/diskgraph/third_party/epserde/tests/test_prim.rs
  • packages/diskgraph/third_party/epserde/tests/test_review_regressions.rs
  • packages/diskgraph/third_party/epserde/tests/test_slice.rs
  • packages/diskgraph/third_party/epserde/tests/test_std.rs
  • packages/diskgraph/third_party/epserde/tests/test_stdlib.rs
  • packages/diskgraph/third_party/epserde/tests/test_tuples.rs
  • packages/diskgraph/third_party/epserde/tests/test_type_hash_val.rs
  • packages/diskgraph/third_party/epserde/tests/test_types.rs
  • packages/diskgraph/third_party/epserde/tests/test_zero.rs
  • packages/diskgraph/third_party/source-provenance.json
Files with no reviewable changes: 55
  • packages/diskgraph/third_party/epserde/README.md
  • packages/diskgraph/third_party/epserde/LICENSE-Apache-2.0
  • packages/diskgraph/third_party/epserde/tests/test_slice.rs
  • packages/diskgraph/third_party/epserde/LICENSE-LGPL-2.1-or-later
  • .github/workflows/testing.yml
  • packages/diskgraph/third_party/epserde/tests/test_bad_ser.rs
  • packages/diskgraph/diskgraph-ptrhash/src/util.rs
  • packages/diskgraph/third_party/epserde/src/traits/mod.rs
  • packages/diskgraph/third_party/epserde/Cargo.toml
  • packages/diskgraph/third_party/epserde/.cargo_vcs_info.json
  • packages/diskgraph/third_party/epserde/src/utils/mod.rs
  • packages/diskgraph/third_party/epserde/src/impls/array.rs
  • packages/diskgraph/third_party/epserde/tests/test_phantom.rs
  • packages/diskgraph/third_party/epserde/tests/test_type_hash_val.rs
  • packages/diskgraph/third_party/epserde/src/utils/alignment.rs
  • packages/diskgraph/third_party/epserde/tests/test_std.rs
  • packages/diskgraph/diskgraph-index/examples/write_legacy_index_fixture.rs
  • packages/diskgraph/third_party/epserde/tests/test_tuples.rs
  • packages/diskgraph/third_party/epserde/tests/test_prim.rs
  • packages/diskgraph/third_party/epserde/tests/test_memcase.rs
  • packages/diskgraph/third_party/epserde/build.rs
  • packages/diskgraph/third_party/epserde/tests/test_bad_deser.rs
  • packages/diskgraph/third_party/epserde/tests/test_generics.rs
  • packages/diskgraph/third_party/epserde/src/impls/boxed_slice.rs
  • packages/diskgraph/third_party/epserde/tests/test_types.rs
  • packages/diskgraph/third_party/source-provenance.json
  • packages/diskgraph/third_party/epserde/LOCAL-PATCH.md
  • packages/diskgraph/third_party/epserde/src/traits/type_info.rs
  • packages/diskgraph/third_party/epserde/src/impls/vec.rs
  • packages/diskgraph/third_party/epserde/src/impls/iter.rs
  • packages/diskgraph/third_party/epserde/src/deser/read.rs
  • packages/diskgraph/third_party/epserde/src/impls/string.rs
  • packages/diskgraph/diskgraph-ptrhash/src/scratch.rs
  • packages/diskgraph/third_party/epserde/src/impls/slice.rs
  • packages/diskgraph/third_party/epserde/src/impls/stdlib.rs
  • packages/diskgraph/third_party/epserde/src/deser/mod.rs
  • packages/diskgraph/third_party/epserde/src/deser/slice_with_pos.rs
  • packages/diskgraph/third_party/epserde/src/deser/reader_with_pos.rs
  • packages/diskgraph/third_party/epserde/src/deser/mem_case.rs
  • packages/diskgraph/third_party/epserde/tests/test_review_regressions.rs
  • packages/diskgraph/third_party/epserde/src/ser/helpers.rs
  • packages/diskgraph/third_party/epserde/src/ser/write_with_names.rs
  • packages/diskgraph/third_party/epserde/tests/test_max_size_of.rs
  • packages/diskgraph/third_party/epserde/src/lib.rs
  • packages/diskgraph/third_party/epserde/src/ser/write.rs
  • packages/diskgraph/diskgraph-ptrhash/src/pack.rs
  • packages/diskgraph/third_party/epserde/src/impls/prim.rs
  • packages/diskgraph/third_party/epserde/tests/test_stdlib.rs
  • packages/diskgraph/third_party/epserde/tests/test_zero.rs
  • packages/diskgraph/third_party/epserde/src/utils/aligned_cursor.rs
  • packages/diskgraph/third_party/epserde/src/impls/mod.rs
  • packages/diskgraph/third_party/epserde/src/traits/copy_type.rs
  • packages/diskgraph/third_party/epserde/src/deser/helpers.rs
  • packages/diskgraph/third_party/epserde/src/impls/tuple.rs
  • packages/diskgraph/third_party/epserde/src/ser/mod.rs
Files not fully reviewed because their changes were unavailable: 2
  • THIRD-PARTY.txt
  • 3rdparty/notices/inventory.json

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

anle2024
anle2024 previously approved these changes Nov 4, 2026

@anle2024 anle2024 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed commit 07d19e1.

Focused ARM64 validation passed: ptrhash tests with and without default features; current-format serialization/mmap round trips; GxHash128 checks across four key shapes and rejection of a different hasher type; generated artifact manifests for all four shipped graphs; notice inventory and 18 focused notice/license tests. The intentional old-index format rejection is documented by this PR.

One P1 finding remains: a truncated current-format hash file can be accepted and produce incorrect lookups. The reproduction and affected loader are recorded inline. This approval leaves that finding outstanding.

The full Rust workspace, GPU tests, and native Windows builds were not run in this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

Other comments: 1
packages/diskgraph/diskgraph-index/src/pkmap.rs: 1

498-500: Minor · Stability & Availability · Quick win

Use a per-run temporary directory for the truncation test files.

The test writes fixed file names under packages/diskgraph/target/test-artifacts/pkmap-truncation. The path ignores CARGO_TARGET_DIR, and the files remain after the run. Two concurrent runs of this test in one checkout write the same files. std::fs::write truncates existing files, so one run can truncate a file that the other run has memory-mapped. Accessing pages past the new end of the file can fault and fail or crash the test.

tempfile is already declared for this crate. A per-run directory removes the shared paths and the leftover files. dir is declared before shard, so the shard is dropped before the directory is removed.

♻️ Proposed change
-        let output = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
-            .join("../target/test-artifacts/pkmap-truncation");
-        std::fs::create_dir_all(&output)?;
+        let dir = tempfile::tempdir()?;
+        let output = dir.path();
Review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 502adef and c322472.

Files ignored due to path filters: 1
  • packages/diskgraph/Cargo.lock is excluded by !**/*.lock, !**/*.lock
Files selected for processing: 76
  • .github/workflows/testing.yml
  • 3rdparty/notices/inventory.json
  • THIRD-PARTY.txt
  • packages/diskgraph/Cargo.toml
  • packages/diskgraph/deny.toml
  • packages/diskgraph/diskgraph-index/examples/write_legacy_index_fixture.rs
  • packages/diskgraph/diskgraph-index/src/pkmap.rs
  • packages/diskgraph/diskgraph-index/tests/epserde_compat.rs
  • packages/diskgraph/diskgraph-index/tests/fixtures/epserde-0.8/README.md
  • packages/diskgraph/diskgraph-ingest/src/lib.rs
  • packages/diskgraph/diskgraph-ingest/src/mapping.rs
  • packages/diskgraph/diskgraph-ptrhash/Cargo.toml
  • packages/diskgraph/diskgraph-ptrhash/README.md
  • packages/diskgraph/diskgraph-ptrhash/src/bucket_fn.rs
  • packages/diskgraph/diskgraph-ptrhash/src/build.rs
  • packages/diskgraph/diskgraph-ptrhash/src/hash.rs
  • packages/diskgraph/diskgraph-ptrhash/src/lib.rs
  • packages/diskgraph/diskgraph-ptrhash/src/pack.rs
  • packages/diskgraph/diskgraph-ptrhash/src/reduce.rs
  • packages/diskgraph/diskgraph-ptrhash/src/scratch.rs
  • packages/diskgraph/diskgraph-ptrhash/src/sort_buckets.rs
  • packages/diskgraph/diskgraph-ptrhash/src/test.rs
  • packages/diskgraph/diskgraph-ptrhash/src/test_on_disk_hashes.rs
  • packages/diskgraph/diskgraph-ptrhash/src/util.rs
  • packages/diskgraph/scripts/generate_artifact_manifest.py
  • packages/diskgraph/third_party/artifact-manifest.json
  • packages/diskgraph/third_party/epserde/.cargo_vcs_info.json
  • packages/diskgraph/third_party/epserde/Cargo.toml
  • packages/diskgraph/third_party/epserde/LICENSE-Apache-2.0
  • packages/diskgraph/third_party/epserde/LICENSE-LGPL-2.1-or-later
  • packages/diskgraph/third_party/epserde/LOCAL-PATCH.md
  • packages/diskgraph/third_party/epserde/README.md
  • packages/diskgraph/third_party/epserde/build.rs
  • packages/diskgraph/third_party/epserde/src/deser/helpers.rs
  • packages/diskgraph/third_party/epserde/src/deser/mem_case.rs
  • packages/diskgraph/third_party/epserde/src/deser/mod.rs
  • packages/diskgraph/third_party/epserde/src/deser/read.rs
  • packages/diskgraph/third_party/epserde/src/deser/reader_with_pos.rs
  • packages/diskgraph/third_party/epserde/src/deser/slice_with_pos.rs
  • packages/diskgraph/third_party/epserde/src/impls/array.rs
  • packages/diskgraph/third_party/epserde/src/impls/boxed_slice.rs
  • packages/diskgraph/third_party/epserde/src/impls/iter.rs
  • packages/diskgraph/third_party/epserde/src/impls/mod.rs
  • packages/diskgraph/third_party/epserde/src/impls/prim.rs
  • packages/diskgraph/third_party/epserde/src/impls/slice.rs
  • packages/diskgraph/third_party/epserde/src/impls/stdlib.rs
  • packages/diskgraph/third_party/epserde/src/impls/string.rs
  • packages/diskgraph/third_party/epserde/src/impls/tuple.rs
  • packages/diskgraph/third_party/epserde/src/impls/vec.rs
  • packages/diskgraph/third_party/epserde/src/lib.rs
  • packages/diskgraph/third_party/epserde/src/ser/helpers.rs
  • packages/diskgraph/third_party/epserde/src/ser/mod.rs
  • packages/diskgraph/third_party/epserde/src/ser/write.rs
  • packages/diskgraph/third_party/epserde/src/ser/write_with_names.rs
  • packages/diskgraph/third_party/epserde/src/traits/copy_type.rs
  • packages/diskgraph/third_party/epserde/src/traits/mod.rs
  • packages/diskgraph/third_party/epserde/src/traits/type_info.rs
  • packages/diskgraph/third_party/epserde/src/utils/aligned_cursor.rs
  • packages/diskgraph/third_party/epserde/src/utils/alignment.rs
  • packages/diskgraph/third_party/epserde/src/utils/mod.rs
  • packages/diskgraph/third_party/epserde/tests/test_bad_deser.rs
  • packages/diskgraph/third_party/epserde/tests/test_bad_ser.rs
  • packages/diskgraph/third_party/epserde/tests/test_generics.rs
  • packages/diskgraph/third_party/epserde/tests/test_max_size_of.rs
  • packages/diskgraph/third_party/epserde/tests/test_memcase.rs
  • packages/diskgraph/third_party/epserde/tests/test_phantom.rs
  • packages/diskgraph/third_party/epserde/tests/test_prim.rs
  • packages/diskgraph/third_party/epserde/tests/test_review_regressions.rs
  • packages/diskgraph/third_party/epserde/tests/test_slice.rs
  • packages/diskgraph/third_party/epserde/tests/test_std.rs
  • packages/diskgraph/third_party/epserde/tests/test_stdlib.rs
  • packages/diskgraph/third_party/epserde/tests/test_tuples.rs
  • packages/diskgraph/third_party/epserde/tests/test_type_hash_val.rs
  • packages/diskgraph/third_party/epserde/tests/test_types.rs
  • packages/diskgraph/third_party/epserde/tests/test_zero.rs
  • packages/diskgraph/third_party/source-provenance.json
Files with no reviewable changes: 55
  • packages/diskgraph/third_party/epserde/LICENSE-LGPL-2.1-or-later
  • packages/diskgraph/third_party/epserde/LICENSE-Apache-2.0
  • packages/diskgraph/third_party/epserde/tests/test_bad_ser.rs
  • packages/diskgraph/third_party/epserde/src/impls/array.rs
  • packages/diskgraph/third_party/epserde/tests/test_std.rs
  • packages/diskgraph/third_party/epserde/.cargo_vcs_info.json
  • packages/diskgraph/third_party/epserde/tests/test_stdlib.rs
  • packages/diskgraph/third_party/epserde/build.rs
  • packages/diskgraph/third_party/epserde/tests/test_zero.rs
  • packages/diskgraph/third_party/epserde/tests/test_max_size_of.rs
  • packages/diskgraph/third_party/epserde/src/utils/mod.rs
  • packages/diskgraph/diskgraph-ptrhash/src/util.rs
  • packages/diskgraph/third_party/epserde/tests/test_generics.rs
  • packages/diskgraph/third_party/epserde/tests/test_phantom.rs
  • packages/diskgraph/third_party/epserde/tests/test_memcase.rs
  • packages/diskgraph/diskgraph-ptrhash/src/scratch.rs
  • packages/diskgraph/third_party/epserde/tests/test_types.rs
  • packages/diskgraph/third_party/epserde/tests/test_type_hash_val.rs
  • packages/diskgraph/third_party/epserde/tests/test_bad_deser.rs
  • packages/diskgraph/third_party/epserde/src/impls/prim.rs
  • packages/diskgraph/third_party/epserde/src/traits/mod.rs
  • packages/diskgraph/third_party/epserde/tests/test_prim.rs
  • packages/diskgraph/third_party/epserde/Cargo.toml
  • packages/diskgraph/third_party/epserde/src/deser/slice_with_pos.rs
  • packages/diskgraph/third_party/epserde/src/impls/tuple.rs
  • packages/diskgraph/third_party/epserde/src/lib.rs
  • packages/diskgraph/third_party/epserde/src/impls/stdlib.rs
  • packages/diskgraph/third_party/epserde/src/deser/mod.rs
  • packages/diskgraph/third_party/epserde/src/impls/iter.rs
  • packages/diskgraph/third_party/epserde/README.md
  • packages/diskgraph/third_party/epserde/tests/test_tuples.rs
  • .github/workflows/testing.yml
  • packages/diskgraph/third_party/source-provenance.json
  • packages/diskgraph/third_party/epserde/src/utils/aligned_cursor.rs
  • packages/diskgraph/third_party/epserde/src/traits/copy_type.rs
  • packages/diskgraph/third_party/epserde/src/impls/string.rs
  • packages/diskgraph/third_party/epserde/src/deser/reader_with_pos.rs
  • packages/diskgraph/third_party/epserde/src/deser/mem_case.rs
  • packages/diskgraph/third_party/epserde/src/ser/write_with_names.rs
  • packages/diskgraph/third_party/epserde/src/ser/helpers.rs
  • packages/diskgraph/third_party/epserde/src/impls/mod.rs
  • packages/diskgraph/diskgraph-ptrhash/src/pack.rs
  • packages/diskgraph/third_party/epserde/LOCAL-PATCH.md
  • packages/diskgraph/third_party/epserde/src/deser/read.rs
  • packages/diskgraph/third_party/epserde/src/impls/vec.rs
  • packages/diskgraph/third_party/epserde/tests/test_slice.rs
  • packages/diskgraph/third_party/epserde/src/impls/slice.rs
  • packages/diskgraph/third_party/epserde/tests/test_review_regressions.rs
  • packages/diskgraph/third_party/epserde/src/ser/write.rs
  • packages/diskgraph/third_party/epserde/src/traits/type_info.rs
  • packages/diskgraph/third_party/epserde/src/impls/boxed_slice.rs
  • packages/diskgraph/diskgraph-index/examples/write_legacy_index_fixture.rs
  • packages/diskgraph/third_party/epserde/src/utils/alignment.rs
  • packages/diskgraph/third_party/epserde/src/ser/mod.rs
  • packages/diskgraph/third_party/epserde/src/deser/helpers.rs
Files not fully reviewed because their changes were unavailable: 2
  • THIRD-PARTY.txt
  • 3rdparty/notices/inventory.json

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

This branch was previously deployed

1 inactive deployment
gha-kumo-workflow-tests — c3224729 Deployed Nov 4, 2026 by haoweiyu-kumo via import #1455
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