Skip to content

cluster pull: a file that would stay held in part is refused, unless the caller allows unverified bytes - #3074

Merged
ashhart merged 2 commits into
mainfrom
security/cluster-pull-verified
Nov 13, 2026
Merged

ashhart merged 2 commits into
mainfrom
security/cluster-pull-verified

Conversation

@ashhart

@ashhart ashhart commented Nov 12, 2026

Copy link
Copy Markdown
Owner

What this changes

Before: the manifest's hash is of a whole file, so a copy held in part can never be checked against it. With #3043 such a copy was mapped and its bytes counted, but a later run that pulled nothing new mapped the same bytes and counted none. After: a load refuses, before it asks a peer for a byte, any file with a manifest hash that would not end up whole. A caller that wants a sparse copy sets unverified, and every byte mapped from such a copy is counted, whenever it was pulled.

Checks on this head

  • Head commit: 21c865344951c09b32d15813047bb62c9eb6968f
  • Lean checker, python3 tools/zig/lean_check.py, on the base and on this head: 345 on the base, 345 on this head, 0 new.
  • Tests run, with the command and pass, fail and skip counts:
    • zig fmt --check and git diff --check: pass
    • zig build test-cluster-loader-host test-pull-host: 9/9 steps succeeded; 52/54 tests passed (2 skipped)
    • zig build native: 66/66 steps succeeded
    • zig build test-golden test-server-security test-pull-security: 76/76 steps succeeded
  • New tests:
    • security: a file that would stay held in part is refused before a byte is pulled, unless that is allowed
  • CI: runs on this push.
  • Not run, and why: Not run between two real hosts. zig build test and every step that runs on a GPU were not run: this Mac's GPU was serving a model, and no CUDA, ROCm or Intel hardware was available.

Receipt

n/a. This change cannot reach inference: it is the cluster's weight pull, and no command passes a peer to the loader yet, so nothing that ships changes.

Checklist

  • The title and description match the head commit, including the receipt and the stack.
  • New tests fail before the change, pass after it, and skip cleanly without their dependency. On cluster pull: a file pulled whole is checked against the manifest's hash #3043's head, a probe that loads the same part twice maps 4,096 unchecked bytes on the second run and reports none (expected 4096, found 0).
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths in the diff or its commits. No AI attribution lines.

Notes for the reviewer

Suggested changelog line

Cluster: a pulled file that would stay held in part is refused unless unverified bytes are allowed by name, and such bytes are counted on every run.

@ashhart

ashhart commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Review: ready to land after #3043, which it's stacked on. A pull that would leave a file held only in part is refused unless the caller allows unverified bytes, and the default is off. A pull that will end up whole still resumes. No shipped code calls the cluster loader yet, so nothing changes for users today.

One thing for the next caller: needs() never asks for the safetensors header (checkpoint.zig:92). So no real plan's ranges make a file whole, and every first pull of a file whose manifest has a hash would be refused by default. That's fine with no caller. The first real caller must pull the header and the gaps, or pass unverified.

  • Synthena (Ash's Agent)

@ashhart
ashhart marked this pull request as ready for review November 12, 2026 23:26
@ashhart
ashhart force-pushed the security/cluster-pull-hash branch from a03f283 to a5e95b0 Compare November 13, 2026 00:03
Base automatically changed from security/cluster-pull-hash to main November 13, 2026 00:04
…the caller allows unverified bytes

The manifest's hash is of a whole file, so a copy held in part can never be checked against it. Such a
copy was mapped anyway and its bytes only counted, and a later run that pulled nothing new mapped the same
bytes and counted none. A load now refuses, before it asks a peer for a byte, any file with a manifest
hash that would not end up whole. A caller that wants a sparse copy sets `unverified`, and every byte
mapped from such a copy is counted, whenever it was pulled. No command passes a peer to the loader yet, so
nothing that ships changes.
@ashhart
ashhart force-pushed the security/cluster-pull-verified branch from 21c8653 to 8d66697 Compare November 13, 2026 02:04
@ashhart
ashhart merged commit 21eceb5 into main Nov 13, 2026
6 of 14 checks passed
@ashhart
ashhart deleted the security/cluster-pull-verified branch November 13, 2026 02:04
ashhart added a commit that referenced this pull request Nov 13, 2026
Figures and scope corrected to the PRs (#2948, #2863, #2934, #2933, #2921, #2906, #2878, #2892, #2851, #2728, #3072,
#2915, #2864, #2854 and others), promises of later work removed (#2903, #2875, #1630, #1720), #3074 and #3047/#3046
said as their PRs scope them, the duplicate #2861, #2585, #2321 and #2719 entries and two copies of released 1.2.5
lines removed, #1953's line named for its PR, and a line for #3255. Released sections unchanged.
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.

1 participant