Skip to content

deepseek_v41 handoff: CUDA record codecs, FP4 packers and the part plan - #3563

Open
BlivionIaG wants to merge 48 commits into
ashhart:mainfrom
BlivionIaG:pr/dsv41-handoff-records
Open

BlivionIaG wants to merge 48 commits into
ashhart:mainfrom
BlivionIaG:pr/dsv41-handoff-records

Conversation

@BlivionIaG

@BlivionIaG BlivionIaG commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

Before, the tree has nothing that converts DeepSeek-V4.1's CUDA prompt state to the neutral hand-off records. After, a host-only library does: the release geometry, the codec between CUDA's fp8 cache records and the neutral bf16/f32 parts, the E2M1/E4M3 FP4 mirrors of the Metal packers, the part plan (what travels, cut into frames of at most 2 MiB) and the CUDA-side export of a snapshot's copies into those parts. Library and host tests only: no server, flag or transport calls it yet. This is slice 1 of the chain in #3553.

Checks on this head

  • Head commit: b0f145a464 (main cd55d61051 merged in at 4b746d93f4; the only conflict was CHANGELOG.md, both sides kept).
  • zig/src/native/cuda.zig reached 601 lines with the stamps and the producer wiring, so their two statements sit on one line, as that file's own long lines do: 599.
  • Lean checker, python3 tools/zig/lean_check.py, on the base and on this head: 165 problems on upstream/main 4c79cfe346, 165 on this head, 0 new (tools/zig/lean_new.py). tools/pr_check.py --base a3794242c4 --pr 3563: 0 errors, 1 advisory warning, inherited from Prefill on a GB10, decode on a Mac: long prompts for Qwen3.8-27B handed over ConnectX (#1594, step 2b)  #2648 (cli_remote.zig:40 names 192.0.2.20, a documentation address).
  • Two things the merge of main needed, both on this head:
    • Main took qwen27_slots.zig to 599 lines and the merge to 612, past the lean cap. 08a8930d2a moves slot 0's standing state (whether a stream resumes there, what it leaves, its rewind point, the remote resume point) into qwen27_standing.zig, 105 lines; qwen27_slots.zig is 516.
    • Main's submit now publishes the host's status after the lock. 49ddf74366 closes the host in the closed-host refusal test through halt (the production close) instead of full teardown, so the submit it refuses runs on live lists; f2e600d64d keeps the test file under 600 lines.
  • Tests run, with the command and pass, fail and skip counts (macOS arm64, Zig 0.17.0, -Dcpu=apple_m1 -j4):
    • zig build -Dcpu=apple_m1 -j4: exit 0.
    • zig build test-dsv41-handoff: 32 pass, 0 fail, 0 skip.
    • zig build test-lane-api-host: 812 pass, 0 fail, 0 skip (it runs lane_remote_test.zig, which the merge of main broke).
    • zig build test-qwen27-reply-cache-host: 10 pass, 0 fail, 0 skip (it runs qwen27_handoff_test.zig, which calls the moved helpers).
    • zig fmt --check build.zig zig and git diff --check: clean.
  • CI: all ten jobs passed and the two nightly jobs were skipped on the previous head 47c8f1100e (run 45126929052). The refreshed head reruns them.
  • Not run, and why: zig build test test-golden (full suite), dev-tools, any GPU or Metal device run. The failing-before check for the new tests was not done.

Receipt

n/a: a host-only library with no caller outside its tests; it cannot reach inference.

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.
  • 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.

Update after review

ThinkOffApp and others added 17 commits November 14, 2026 10:39
…, sent as KV handoff protocol 2

hybrid_state gives Qwen3.8-27B's recurrent and attention state one byte order, header and token sha256 that CUDA and Metal both read. Protocol 2 sends a recurrent layer's state part by part with a CRC-32 a frame (ARMv8 CRC instructions where present); protocol 1 readers refuse it. The producer table holds exports for a hand-off, refuses a reused id, expires them, and caps the bytes held (HeldExportsFull). fabric_handoff and tf-mcdma-pair tests cover the fake link and the frames. (ashhart#1594 step 2b)
…a kept state, and is kept as remote

The lane host fetches a remote prefix on its own thread after the cache's peek, leads the prefix wait for requests on the same prompt, and falls back to a full local prefill on a refusal. With TF_PREFILL_KEEP (default 1) the states a pulled prefix builds are kept in the prompt cache marked remote, never written to disk or learned from, so a chat's follow-ups resume on the Mac. Tests pin provenance (remote_prefix, pulled_prefix), the keep rules and slot 0's let-go. (ashhart#1594 step 2b)
…ls them over an MKVH link

cuda_produce reads a CUDA copy in place and serves hand-off exports as the link's service, at most TF_PRODUCE_HELD_GIB held (default 32). On the Mac, qwen27_remote pulls a prefix into a blank state, checks model, checkpoint, token sha, TP, geometry and protocol, and refuses a checkpoint whose state is not Qwen3.8-27B's (Qwen3.5-9B) at start. remote_trigger asks the GB10 over bounded HTTP, with TF_PREFILL_API_KEY_FILE's key as a Bearer token and a named 401. A detected mismatch turns remote prefill off; a refusal or timeout does not. The TF_PREFILL_* settings join the environment registry. (ashhart#1594 step 2b)
… a GB10, and the hand-off's API fields

A completion's kv_transfer_params.mcdma_handoff becomes its hand-off; a malformed one now returns 400 on every native server. Replies on a remote prefix report exact_mode "remote_prefix" with remote_prefix, pulled_prefix and kept_remote_cache_tokens. docs/api.md and docs/environment.md describe both. Off unless both machines are started with the new options. (ashhart#1594 step 2b)
…ecks on real weights

The GB10 exports a state (export, tail); the Mac restores it from a file or a live pull and checks it: teacher-forced KL and top-1 (close), the backends' own gap (floor), stage times (time, multi), and agree, which lists every position where the restored state's greedy token differs from the Mac alone with both top-1/top-2 margins, plus repeat restores' bytes and tokens. State files are read in 1 GiB pieces, as macOS refuses one read over 2 GiB. (ashhart#1594 step 2b)
…rrow and no promise

A repeat hand-off whose lookup finds a remote copy at the cut resumes below it on the engine's own state and keeps the cut as its own. When a queued chat protects the remote copy and the budget has no room beside it, the guard refuses that keep (CachePromised). The test shows the export and the reply still go on, the borrow from below() is let go, no job is left holding a promise, and the remote copy still serves the next chat.
…umes on the Mac

A stream on a pulled prefix was not plain(), so leave() dropped slot 0's record, rewindPoint returned 0 and every follow-up after a hand-off started at 0 and pulled its whole prompt from the GB10 again. Such a stream now counts as plain for slot 0: its pass makes a rewind point at the history end past the cut, and leave() keeps the record, marked remote (Standing.remote). A pass that resumes on that record, here or back at its point, takes its rows' origin (inherit: reuse.remote set, reuse.pulled cleared), so its reply reports the prefix as kept remote and its keeps are marked remote, never the Mac's own. A refused copy that ran here from 0 leaves an own record. With TF_PREFILL_KEEP=0 slot 0 keeps no record and no rewind point of a hand-off's rows, and Job.kept and Job.keep keep nothing on a remote prefix. The unplanned cache checkpoint still skips remote streams. The decisions move into qwen27_resume.zig (plain, leftRemote, inherit, rewindAt, Standing.left, Standing.point, Standing.keeps), where host tests pin the hand-off chain, a refused import, each case that keeps nothing (TF_PREFILL_KEEP=0, a cancelled or failed reply, images, prompt logprobs, untaught rows) and a pull that reaches the history end, which makes no rewind point. (ashhart#1594 step 2b)
New host tests (qwen27_handoff_test.zig, "qwen27 hand-off:", run by test-qwen27-reply-cache-host) drive the real lane host with a fake backend over a device-less Metal whose slot 0 choices are qwen27_slots' own: resumeAt as the lane host's resume_peek, opening where slot 0 resumes, rewindPoint and leave. A pulled turn leaves a remote record with its rewind point at the history end; its follow-up pulls nothing, resumes in place where the turn left slot 0 and reports the prefix as kept remote. With TF_PREFILL_KEEP=0 the follow-up pulls again. A pass on slot 0's remote rows makes no unplanned checkpoint, on its own rows it does, and either way it clears a pull it overtook. To reach these host-side, takeStanding inherits the origin once after its switch (here or back), attach's TF_PREFILL_KEEP goes through remote.keepRule (lane host and slot 0 alike), and leave and rewindPoint are pub.
The cache plans a fill's marks without slot 0's in-place resume, so a follow-up that resumes slot 0 (its own rows, or a hand-off's since the last commit) can carry marks below where its pass begins. It never stands at them, yet a request arriving during its pass waited for one until the pass ended, then computed the prefix itself. The prefix wait now skips a leader's marks at or below its stream's cached rows. A request picked in the same admission as the leader, before its first chunk, is not covered: the leader's start is not known yet. Host tests: a request arriving during a fill waits for its cut and resumes it; one arriving during a fill that resumed past the cut does not wait.
…DA export needs

compile-qwen35-rounds-host builds zig/tests/qwen35_cuda_main.zig as its own module, with cuda, qwen35, core and lanes only. Since the main imports qwen35_cuda_export.zig, which reads @import("hybrid_state"), that step stopped compiling. It now gets the same hybrid_state module zig/build/cuda.zig gives tf-qwen35-cuda, built for the census target. (ashhart#1594 step 2b)
inherit now takes the plan and leaves a stream's origin alone for .none, so the decision that a pass resumed here or back at the rewind point stands on the record's rows (remote or not) lives in qwen27_resume.zig, not in takeStanding's arms. The .back arm needs rewindSlot, a GPU blit, so no host test reaches it in qwen27_slots.zig; the rule it calls is pinned by the resume tests, whose helper now calls inherit as takeStanding does instead of deciding by itself. (ashhart#1594 step 2b)
…ixture

The hand-off fixture's pass now carries opening's rewind point as chunk's saveRewind would, so the follow-up's rewind_at is the code's (turn 1's point carried; a pass resumed in a reply sent back as generated makes none), and it keeps the s.cached opening set over the fake's own fill instead of setting it again from the resumed position, so qwen27_slots.opening's line is what the reported remote prefix reads. Slot 0's hand-off rules (qwen27_resume_remote_test.zig) also run in zig build test on every OS; the Metal fixture's tests stay in test-qwen27-reply-cache-host, macOS only. (ashhart#1594 step 2b)
Adds the host-only record library for the DeepSeek-V4.1 prefill hand-off: the release geometry,
the codec between CUDA's fp8 cache records and the neutral bf16/f32 parts, the E2M1/E4M3 FP4
mirrors of the Metal packers, the part plan (what travels, cut into frames of at most 2 MiB)
and the CUDA-side export of a snapshot's copies into those parts. Each piece is tested against
independent tables or f64 references; `test-dsv41-handoff` runs them on the host.

Not included: the Metal packers and importer, protocol 2 adapter, landing sink and stream
file, the CUDA export, and any transport.
# Conflicts:
#	zig/src/platform/environment_test.zig
# Conflicts:
#	zig/build/qwen27_host.zig
#	zig/src/core/lane_host.zig
#	zig/src/core/lane_stream.zig
#	zig/src/native/metal.zig
#	zig/src/native/qwen27_served.zig
#	zig/src/native/qwen27_slots.zig
#	zig/src/server/chat.zig
#	zig/src/server/chat_generation.zig
#	zig/tests/fixtures/gradient-serving.tsv
@ashhart

ashhart commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Thank you for the exact packer fix and the refreshed integration. All four packers now compare the restored BF16 bits with the input and refuse a changed row. The 6/1.25 refusal and the raw FP8 controls cover the earlier rounding bug. The isolated record and codec checks can proceed as exact synthetic comparisons.

One serving gate remains. The automatic checkpoint ID hashes the config and weight index, but not the tensor bytes. Two checkpoints with the same metadata and different weights can therefore receive the same ID. Please bind the ID to the bytes actually loaded, with a one-byte mismatch control and refusal on hashing or read failure. That change is still needed before the serving stack can land.

  • Synthena

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Merged upstream/main (head b739246b48). CI's lean step failed because environment_test.zig passed 600 lines; main has since moved the valid table into environment_valid_cases.zig, and this PR's rows now live there. Main's Folded Memory v3 landing overlapped the remote-prefill and hand-off paths. A request with a hand-off or a pending remote ticket now skips the memory composition, so exports and remote fills always see the unmodified prompt (max_new is capped at 1 for a hand-off and the chunks are the hand-off's cut, otherwise main's memory rule). Both Stats fields and both Host lifetimes are kept, and the qwen27_slots.zig pin is refreshed. The lane API, qwen27 reply-cache/hand-off, gradient-serving, environment, Metal open and server-security host steps pass.

@ashhart

ashhart commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Thank you, @BlivionIaG. The exact packer checks and refusal controls remain intact, and the refreshed memory and hand-off paths integrate cleanly with current main. The earlier codec finding stays closed; isolated exact record comparisons can proceed.

The inherited serving gate remains: the automatic checkpoint ID hashes config and index metadata, but omits loaded weight bytes. Identical metadata can therefore admit state from different weights. Please bind the identity to the content actually loaded, with a one-byte mismatch control and refusal when that binding cannot be read or verified. The whole serving stack still needs that correction before landing.

  • Synthena

…t it cannot read or check is refused

The name both ends of a hand-off compare hashed config.json and the weight index only, so checkpoints with equal metadata and different weights shared it. checkpoint_identity.handoffName now names the checkpoint by fullIdentity: the config, index, shard names, sizes and headers, and every shard byte, read once and then taken from the file-digest cache until a file changes; a Hugging Face shard is checked against its blob name. A missing shard, a broken header or bytes that do not match refuse the server's start. lane_remote.checkpointId goes; its callers (the Qwen3.8-27B producer and Mac consumer, the import tool) take handoffName.
@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Thank you, @ashhart. You asked for the checkpoint identity to bind the weight bytes actually loaded, with a one-byte
mismatch control and a refusal when the binding cannot be read or verified.

What changed (aa8711ef30): lane_remote.checkpointId, which hashed the config and the weight index only, is gone.
checkpoint_identity.handoffName names a checkpoint by main's fullIdentity: the config, the index, every shard
header and every shard byte. The bytes are read once and then served from the file-digest cache, keyed on the file's
device, inode, size and nanosecond mtime/ctime, so any change re-hashes. A file whose Hugging Face blob name is its
sha256 is checked against that name, and a file that changes while it is hashed is refused. Every hand-off caller uses
it: the DSv4.1 CUDA producer and its follower ranks, and the Qwen 27B CUDA producer and Metal decoder. A server started
for a hand-off (--mcdma-produce or --prefill-from) refuses to start when the name cannot be computed. Servers
started without a hand-off flag do not hash anything.

Evidence: new tests in checkpoint_handoff_test.zig. Flipping one byte of one shard changes the name, and a copy in
another folder keeps it. A missing index shard, a header that runs past its file, and a blob-name mismatch are each
refused. Red before, on the old id function: test-checkpoint-identity 36 pass, 4 fail (the four new tests). Green:
test-checkpoint-identity 40/40, test-lane-api-host 836, test-qwen27-reply-cache-host 12, test-dsv41-handoff,
test-metal-open-room-host, test-gradient-serving, test-environment-host 37, check-native-cuda-host.

One limit, stated plainly: the Metal decoder hashes the checkpoint before it loads it, and the CUDA producer hashes after
it loads. A file replaced between the hash and the load on the same machine is therefore not caught. A change before
the hash, including a one-byte edit, is caught. The CHANGELOG line is back under ## Unreleased.

  • New head: 7e9af38fed

@ashhart

ashhart commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Thank you, @BlivionIaG. The exact packer guards remain intact, and the new naming code closes the metadata-only omission by hashing shard contents and refusing unreadable or mismatched files.

The loaded-weight binding remains incomplete, as your note acknowledges. Naming reopens the folder separately from model loading; a replacement between those operations can give loaded tensors another checkpoint's name. Please carry the verified identity from the actual loader snapshot into the hand-off, or refuse when that binding cannot be established, with replacement controls at both serving boundaries. The whole serving stack still needs that correction; isolated exact codec comparisons remain useful.

  • Synthena

@ashhart

ashhart commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Thank you, @BlivionIaG.

CHANGES REQUESTED at 7e9af38fed40f18abbacdbc1cab4efb351af28d6.

The shard-content hash closes the metadata-only omission, and the four packers still compare restored BF16 bits before accepting a row. One serving defect remains.

checkpoint_identity.handoffName reopens and hashes the directory separately from loading (zig/src/core/checkpoint_identity.zig:358-378). CUDA loads the model at zig/src/native/cuda.zig:296 and computes that name at :424. Metal computes remote_id while constructing the arguments to qwen27.open at zig/src/native/metal.zig:357, before that function loads the model.

Replace one used shard after CUDA loads checkpoint A but before it hashes replacement B: the producer advertises B while exporting state computed with A. Replace A after Metal hashes it but before the load: the consumer loads B but still expects A. Matching manifest strings can therefore admit cross-checkpoint state instead of refusing it.

Please carry the verified identity of the tensors actually loaded into every producer and consumer hand-off, or refuse when that binding cannot be established. Add replacement controls for both orderings above, including no publication of a partial or mismatched destination. The current tests edit files before hashing; they do not cover either loader/hash interval.

This was a source-only review. I ran no builds, tests, or device checks.

# Conflicts:
#	CHANGELOG.md
#	zig/build/qwen27_host.zig
#	zig/src/native/qwen27_reply_cache_test.zig
#	zig/tests/fixtures/gradient-serving.tsv
@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Merged upstream/main (a3794242c4) to clear the conflicts. Code conflicts were in zig/build/qwen27_host.zig (kept both blocks), qwen27_reply_cache_test.zig (took main's logic, passing this PR's keep_remote argument) and the gradient-serving pins (took main's lines, repinned lane_host.zig and qwen27_served.zig). zig fmt --check clean, lean 123 vs 123 on the base, 0 new, pr_check 0 errors. New head 5df0217b8f.

Bound stamps config.json, the index and every shard (device, inode, size, mtime, ctime) before the load reads a byte; its name hashes after the load under those stamps (each shard's digest descriptor must equal its stamp) and checks every file before and after the hash. A file replaced or rewritten in between refuses the hand-off. The qwen27 CUDA producer stamps before F.open and names in cuda_produce.open; the Metal consumer stamps in qwen27_served.open before the load and names in remote.attach after it; the import tool stamps before host.open. handoffName, its alias and remote_id are gone.
@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Thank you. You asked that the hand-off name be bound to the tensors actually loaded, or refused, with replacement
controls for both orderings.

What changed (30146653b2):

  • checkpoint_identity.Bound replaces handoffName, the checkpointId alias and remote_id.
  • Before the load reads a byte, it records config.json, the index and every shard the index names: device, inode,
    size, mtime and ctime, from fstat.
  • After the load, name() hashes everything under those records. Each shard's digest must come from the recorded
    file, and every file is checked against its record before and after the hash.
  • Any difference is error.CheckpointChanged and refuses the start, so no name is advertised and nothing is published.

Where it is wired:

  • The qwen27 CUDA producer records before F.open and names in cuda_produce.open.
  • The Metal consumer records in qwen27_served.open before loadDeferredOpts, and names in remote.attach after the
    load and the share finish. metal.zig no longer names anything before the load.
  • The import tool records before host.open.

Controls, test-checkpoint-identity:

  • producer order: load A, rename B over a used shard, then name;
  • consumer order: record A, rename B, the load reads B;
  • an in-place rewrite of the same file.
    Red with the old naming behind the new calls: 41/44, three tests advertising B's name. Green: 44/44.
    The Metal remote.attach control (test-qwen27-reply-cache-host): red 13 pass and 1 crash (it named B and went on to
    start the link); green 14/14, with no link and no remote source attached. The CUDA producer's wiring is compile-checked
    only (check-native-cuda-host).

Residual risks:

  • a write that keeps a file's size and both of its times, possible only within one clock tick of that file's previous
    change, on a filesystem with a coarse clock;
  • writes after naming into files that are still mapped (the Metal engine maps its shards);
  • trust in the local digest cache.

Gates: test-checkpoint-identity, test-qwen27-reply-cache-host, check-native-cuda-host and tf-qwen27-import pass;
zig fmt is clean; pr_check gives 0 errors with 0 new lean. Head is now 30146653b2.

The Metal-layout finding on #3564 (real CUDA index keys are not on the Metal fp4 grid) is not a regression from this
stack's changes. It is a property of the two formats.

@ashhart

ashhart commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Thank you @BlivionIaG. The exact packer guards and the new producer/consumer replacement controls are useful, and naming now happens after the load at each inspected boundary.

Two identity cases remain. First, an unindexed checkpoint's identity includes only model.safetensors, while the loader consumes every model*.safetensors file. Different auxiliary tensors can therefore share a name without any race. Please use the loader's complete enumeration and add an unindexed multi-shard one-byte mismatch control.

Second, Bound compares device, inode, size, mtime and ctime, then hashes or reuses a digest under that key. Renaming A aside, loading B from its pathname, then restoring A before naming can restore the original key: B-loaded state is advertised as A. A coarse-timestamp in-place rewrite within one clock tick is another same-key route, and a cache hit can return stale content. Please bind the name to loader-owned descriptors or the actual byte stream, or refuse when that cannot be established. Add A→B→A controls in both orders and a production-cache-hit control.

The new zig/src/core/lane_remote_test.zig is also exactly 600 lines, and zig/src/native/flashnext_host.zig reaches 600. Please split enough test code to keep changed files below 600 lines. No further device run would close these source gaps.

  • Synthena

The name enumerated only model.safetensors when there was no index, while
the loader opens every model*.safetensors, so an auxiliary shard could differ
without changing the name. The names now come from the loader's own
enumeration (checkpoint.shardFiles), and a test writes two unindexed shards,
flips one payload byte in the auxiliary one, and checks the whole-file digest
moves while the header identity stays. Red on the old enumeration: 44/45,
1 fail; green: all pass.
@ashhart

ashhart commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Thank you, BlivionIaG. The unindexed-checkpoint fix now uses the loader's complete multi-shard enumeration, and the one-byte auxiliary-shard control covers that omission. The four FP4 packers also compare restored BF16 bits exactly and refuse values they cannot preserve.

Porting the Metal backend's own FP4 packers into exact scalar twins is the right shape for a bit-identical handoff, so there is no concern there.

Two source requests from the previous review remain open. The identity still stamps and rechecks pathname metadata rather than loader-owned descriptors or the bytes actually loaded. Renaming A aside, loading B from that pathname, then restoring A before naming can advertise B-loaded state as A. A coarse-timestamp rewrite within one clock tick is another same-key route, and a production cache hit can return the old digest. Please bind identity to the actual loader stream, or refuse when that is impossible, with A→B→A controls in both serving orders, a production-cache-hit control, and no publication of partial or mismatched state.

The two test files named in the previous review also remain exactly 600 lines. Please split enough test code to keep each changed file below the limit.

No device run is needed to establish these two source gaps.

  • Synthena

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Identity now reads the descriptors it opened, not the pathnames.

  • Bound.stamp opens config.json, the index and every shard once and keeps those handles. Bound.shard(i) hands the load the same descriptor, so the load and the name read one file object.
  • Bound.name reopens nothing by path: the metadata half (config, the index text, each shard's name, size and header) and every shard's full sha256 are read through the stamped handles. The value is unchanged — the untouched case now asserts it equals fullIdentity's name byte for byte.
  • No digest cache on this path: a hit keys on metadata, so it can only return a digest for bytes this load did not read. stampWithCache keeps its parameter and says it is unused here. A planted stale record for the very file — index.bin carrying a zero digest for that descriptor — leaves the name equal to the bytes' own.
  • Refusals: error.CheckpointChanged when a stamped name no longer resolves to the device, inode, size and change time opened under it, and when a name absent at stamping is present at naming (or the reverse).
  • Controls, temporary files, both serving orders: producer order (A loaded through the descriptor, B renamed over its path, then named) refuses; consumer order (A stamped, B renamed over the path, A's bytes loaded through the descriptor) refuses to name them, so a load that swapped the path cannot be published as A.
  • Residual, stated rather than hidden: the name is read after the load through the same descriptors, so an in-place rewrite between the load and the name is caught by the change time, but a rewrite that keeps the size and lands in the same file-system clock tick would not be. The airtight form is one pass that hashes exactly the bytes the load consumes; the loader can hand its reads to the hasher if you would rather have that than a refusal.

File limits: lane_remote_test.zig is 479 lines with the keep tests in lane_remote_keep_test.zig (131), and flashnext_host.zig is 539 lines with the status tests in flashnext_host_status_test.zig (66); both new files are registered beside their siblings.

Checks on af6ec539eb: tools/pr_check.py --base a3794242c4 --pr 3563 0 errors; lean 123 vs 123, 0 new; zig fmt --check build.zig zig clean; zig build test -Dcpu=apple_m1 -j4: 9581/9684 tests passed, 102 skipped, 1 failed. The failure is info.test.info prices a Qwen3.8-27B start from serve's charge… with four command buffer failed: fault lines — a Metal command-buffer fault in cli/info.zig, which this PR does not touch.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Merged upstream/main cd55d61051 into the branch at 4b746d93f4. The only conflict was CHANGELOG.md, where both sides' ## Unreleased lines are kept; this PR's own line now says what the name does after the descriptor change (hashed from the descriptors the load opened, no digest cache between them).

zig/src/native/cuda.zig went to 601 lines with the stamp and the producer wiring, so those two statements are joined on one line, as that file's own long lines already are; it is 599 now.

Checks on b0f145a464: tools/pr_check.py --base cd55d61051 --pr 3563 0 errors, 4 advisory warnings; lean 123 vs 123, 0 new; zig fmt --check build.zig zig clean; zig ast-check zig/src/native/cuda.zig clean.

The last full suite run (on af6ec539eb) gave 9581/9684 tests passed, 102 skipped, 1 failed: info.test.info prices a Qwen3.8-27B start from serve's charge… aborted with four command buffer failed: fault lines, a Metal command-buffer fault in cli/info.zig, which this PR does not touch.

This branch has not been deployed

No deployments
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.

4 participants