#1 [high] PR #590 verified code facts (line numbers, main comparison)
PR #590 "helios,ignition: fix Engram reader bugs and add PLE lookahead publish", author lukealonso (the maintainer who blocked #519), head 4ea9ba0, +588/-112 over 4 files: helios/src/engram.rs (+187/-19), helios/src/engram/reader.rs (+265/-67), helios/src/runtime_core/engram.rs (+107/-26), ignition/components/ngram_delivery.py (+29/-0). Only PR comment is the automated case-file notice. Fixes #481.
VERIFIED at head:
- Requests::read engram.rs:299-320; WaitBackoff::step :369-376; constants :325-332 (SPIN_ROUNDS 1<<12, NAP_GROWTH 25us, NAP_MAX 250us); yield_core cfg(not(windows)) :340-347 and cfg(windows) :349-352 (bare spin_loop).
- next_reader_action engram.rs:388-415; Gather returned only when job.requests.is_ready(cancelled) (:401-406); is_ready :287-298 does same ready.load == sequence test.
- Reader loop: Gather arm :626-671,
let ids = job.requests.read(&stop)?:654; Warm arm :672-684 with warm_batch :674; WaitReady :685-687 wait.step(); BlockRecv :688-694. requests.read(occurs only engram.rs:654 (production) + tests :1100,:1135,:1167. => read's wait loop unreachable in serving.- At ref main engram.rs:308-314: same loop but
std::hint::spin_loop()and NO backoff => PR "Why" item 3 ("turned #519's spin-then-nap backoff in Requests::read into dead code") is false for main; #519 is still open, blocked by lukealonso on 2026-11-28. - #519 comment (lukealonso 2026-11-28) blocking reasons verbatim: (1) after #566 (7745deea) "a spin-then-nap inside Requests::read never runs in production", real wait site is ReaderAction::WaitReady; (2) no served-workload benefit + flare_replay_readiness_wait_nanoseconds_total unreported. Same maintainer comment: "NAP_GROWTH and NAP_MAX need #[cfg(not(windows))]"; SPIN_ROUNDS "enough to catch ids the graph published before the wait began" is wrong because pre-published ids are seen on first Acquire load; asks for Signed-off-by and ulimit -l 65536.
- New test wait_ready_backoff_naps_until_publication_or_cancellation_and_resets engram.rs:1142-1182 asserts only rounds.0 > SPIN_ROUNDS (:1177-1180); a spin-only step also exceeds 4096 rounds within AFTER_SPIN=5ms (:1092) => test cannot distinguish nap from spin.
- Unix fan-out reader.rs:787-796 lane_depth = DEPTH/lanes.len(); active_lanes = reads.len().div_ceil(lane_depth).min(lanes.len()); DEPTH=128 at reader.rs:30; workers restricted to 1|2|4|8 in DiskReader::from_files :687-698 (lane depth = DEPTH/workers).
- Windows twin UNCHANGED: reader/windows.rs:56
let depth = DEPTH / workers;, :91if self.lanes.len() == 1 || reads.len() <= DEPTH { return self.lanes[0].gather(...) }, :94let chunk = reads.len().div_ceil(self.lanes.len());=> Windows still collapses 17..=128 reads onto lane 0. No windows file in diff. - CachedReader::gather rejects ids.len() > max_rows (reader.rs:1001-1004); warm now chunks instead (reader.rs:1081-1140), prefetch_rows_loaded per chunk :1133-1136.
- warm reachable only via Reader::warm (reader.rs:1293-1304, return usize discarded at engram.rs:676-678) whose only caller engram.rs:677 passes pending_warm[warm_cursor..end] with warm_batch = WARM_BATCH_ROWS.min(max_tokenstable.heads).max(1) (:607-609) and reader max_rows = max_tokenstable.heads (engram.rs:539-541) => always one chunk. AdvisoryMailbox::snapshot clamps to max_rows (:264).
- ResidentMapping::new reader.rs:131-176:
Self::open_readonly_view(file).ok():138-143, map_fd fallback :144-149, EPERM message fork :151-159 ("kernels older than 6.7 require /proc/self/fd ..."); open_readonly_view :108-111 is plain File::open (no OpenOptions/custom_flags). #481 explicitly asked for a kernel-version hint on EPERM, so the hint has a request behind it; the defect is that the reopen error is discarded. - Transfers::new required blocks engram.rs:846-858 (request mailbox, max_tokenstable.heads+1) and :864-874 (prefetch, max_rows+2). runtime_core/engram.rs:302-322 already validates min_request_len = max_staged_rows+1 and max_prefetch_len = max_staged_rows+2 with max_staged_rows = tokenscore_heads (:242-244) and table_heads = core_heads (:241,:351). Shared::new gets the same tokens (runtime_core/model.rs:857-871). => arithmetic agrees; new check is redundant, cannot false-reject. Stream::host_address (cuda.rs:895-943) already rejects empty ranges so
address + nbytes - 8cannot underflow. - GraphKind filters now
GraphKind::try_from(g.kind.as_str()).is_ok_and(crate::engram::consumes)(runtime_core/engram.rs:224, :333), matching model.rs:480-481; consumes at engram.rs:1011-1021 includes ScoredPrefill. Genuine de-dup; ignition/preparation/contract.py:88-89 already attaches embedding_tables for scored_prefill, so exporter-side capacity is consistent. - PLE python: _requests ngram_delivery.py:59-75, publish_requests :36-44, publish_advisory_requests :47-56, NEW _advisory_requests :78-95 (identical to _requests except live_rows + HAS_LIMIT=True/HAS_COUNT=True), PreparedPLELookup.publish :148-155, NEW publish_lookahead :157-164 with docstring "Hash an upcoming prompt window during graph capture ...". functional() sets metadata/output/requests=None (:144) but NOT self.ids, so publish_lookahead works after functional(); it allocates a fresh
ids = torch.empty_like(self.ids)which is REQUIRED to avoid aliasing the prepared hash buffer self.ids used by publish/_lookup => the "steady-state GPU allocation" objection is wrong as a subtraction target;requestsalone could be reused. - publish_lookahead passes token_count=ids.shape[0] (= len(self.ids) = PLE token count), not the passed window length => tail of a longer lookahead window is not hashed (same convention as _requests). No in-repo caller (grep: definition only); consumer is local-inference-lab/hyperflare-recipes per merge-order note.
- PreparedEngram.publish_lookahead engram.py:280-283 calls _hash_window(...) with no args/dest => it also allocates per call, so the "unlike the Engram precedent" claim in the Conventions lens is factually wrong.
- New fan-out test reader.rs:2219-2292 duplicates parallel_unix_disk_workers_preserve_rows_and_propagate_truncation :1934-2021 (same fixture shape, workers loop, assert_eq rows); only new assertion is used_lanes :2276-2289.
- PR body claims: "reduced synchronous PLE gather time by 76.5% ... TTFT by 4.6%" as paired run at
--embedding-table-workers 1(=> single lane, guard at reader.rs:788 short-circuits, fan-out fix not exercised); "Fixes all four runtime defects" though Why lists 5 items; "Windows builds ... were not re-run". Rules cited: AGENTS.md:165-169 (need demonstrated defect), :176-186 (no steady-state GPU alloc, no silent path substitution), :188-193 (no fallback layers/churn), :194-199 (tests exercise behavior; one coherent outcome), :497-500 (check equivalent paths on every supported target); docs/design-review.md:16 ("Keep Helios as simple as possible"), :36-38 (Python prepares, Rust serves); charter "Bring real evidence" (#210) and "don't silently swallow/retry (#397)", windows.md is a supported target. Dropped as noise: flare-cli distribution::tests::source_waits_for_receiver_file_verification BrokenPipe and RLIMIT_MEMLOCK/engram::reader CUDA-registration failures (both pre-existing, unrelated to diff); clippy "0 warnings in modified lines" claims.
#2 [high] Brief outline + dedupe/drop decisions
FINAL BRIEF STRUCTURE (12 candidates) delivered to adjudicator:
BLOCKERS B1 WaitBackoff re-lands exactly the change blocked in open #519; no served measurement attributable to it (evidence in #590 body is credited to the PLE lookahead path, and the run used --embedding-table-workers 1). #519's own maintainer comment requires a maintainer ruling on idle-core occupancy + flare_replay_readiness_wait_nanoseconds_total. Approach PR as author decision: either drop/split the wait change, or record the ruling + metric. Quote engram.rs:325-332, :369-376, :685-687; contrast main engram.rs:309-314. B2 Windows backend keeps the pre-fix dispatch (windows.rs:56,:91,:94) while Unix got per-lane fan-out (reader.rs:787-796). AGENTS.md:497-500 equivalent-path rule; docs/windows.md is a supported target. Either fix both or declare Windows out of scope + track.
SHOULD FIX S1 Requests::read backoff half unreachable in serving (Gather only dispatched after is_ready true, engram.rs:401-406 vs the loop at :310-316); PR body says WaitBackoff is "used by both". Carried-over #519 blocking point 1. Also merges: new nap test (engram.rs:1142-1182, assert :1177-1180) cannot distinguish nap from spin because AFTER_SPIN=5ms already exceeds 4096 spin rounds. S2 chunked CachedReader::warm fixes a case the new warm_batch clamp makes impossible (engram.rs:607-609,674; reader max_rows = max_tokens*heads at :539-541) and now contradicts CachedReader::gather's rejection (reader.rs:1001-1004 vs :1085). Keep clamp, drop loop; keep gather's reject as the single policy. S3 publish_lookahead is inert in-repo (grep: definition only), unexercised, and hashes token_count=ids.shape[0] not the passed window => silently drops tails of a longer window. Land with the recipe, or state inertness; settle the length contract. S4 One prose/evidence item: combined-stack 76.5%/4.6% numbers attributed to five changes; "Why" item 3 claims #519's backoff exists on main; the named run (--embedding-table-workers 1) takes the lanes.len()==1 guard so the headline fan-out fix is untested by it; "Fixes all four runtime defects" vs 5 enumerated; "Windows builds were not re-run"; docstring "during graph capture"; "O_RDONLY|O_CLOEXEC" vs plain File::open; omitted .ok() fallback.
SUBTRACT/SIMPLIFY X1 Transfers::new duplicate capacity validation (engram.rs:846-858, :864-874) suited by runtime_core/engram.rs:302-322 (max_staged_rows = tokens*core_heads, table_heads = core_heads at :241,:351, same tokens from model.rs:857-871 => arithmetic agrees, cannot false-reject) and host_address (cuda.rs:903-905) already prevents empty ranges. Also covers the checked_add(1/2) impossible-overflow micro nit. X2 Merge new fan-out test (reader.rs:2219-2292) into parallel_unix_disk_workers_preserve_rows_and_propagate_truncation (:1934-2021); fold the used_lanes assertion into the existing workers loop. ~70 lines. X3 Fold _advisory_requests into _requests with optional live_rows (ngram_delivery.py:78-95 vs :59-75); reuse self.requests in publish_lookahead (ids must stay fresh: self.ids is the prepared hash buffer used by publish/_lookup). X4 EPERM path: .ok() fallback discards the reopen error (reader.rs:138-143) and map_fd/message fork (:113-129,:151-159) is removable; #481 did request a kernel hint, so keep a hint but only when mapping actually used the original fd.
NITS N1 Windows dead_code on NAP_GROWTH/NAP_MAX (explicitly requested by the maintainer in #519); stale SPIN_ROUNDS rationale ("enough to catch IDs the graph published before the wait began" — false, first Acquire load sees them); NAP_MAX's "under one decode step" unenforced. Quote engram.rs:325-332. N2 Third copy of the consumes filter closure (model.rs:480-481, runtime_core/engram.rs:224, :333) — one helper next to consumes.
DROPPED as noise: flare-cli BrokenPipe and RLIMIT_MEMLOCK CUDA-registration test failures (pre-existing, unrelated); clippy "0 warnings in modified lines"; "second unification lint-table 2x-8x" nothing; Conventions' claim that publish_lookahead is the only path that allocates (engram.py:280-283 also allocates via _hash_window with dest=None => false); "steady-state GPU allocation" violation for ids (aliasing hazard, allocation is required); Prose #5 docstring as separate item (folded into S4); Prose #6/#7 counts (folded into S4); Simplicity F6 redundant guard (equivalent, 1-line, folded into X-notes... actually I dropped F6 - low value: mention? Decided to drop; it's cosmetically valid but zero-risk and code-review noise).
#3 [high] Quoted code per candidate (final brief payload)
Exact quotations, verified at PR/590 head 4ea9ba0 unless labelled main.
=== B1 (blocker) WaitBackoff re-lands what open #519 is blocked on === helios/src/engram.rs:325-332
/// Rounds a waiting gather spins before it starts napping, enough to catch IDs
/// the graph published before the wait began.
const SPIN_ROUNDS: u32 = 1 << 12;
/// Nap growth per round after the spin; the tenth round reaches `NAP_MAX`.
const NAP_GROWTH: Duration = Duration::from_micros(25);
/// Longest nap between rounds, under one decode step so that a nap delays the
/// published IDs by no more than its own length.
const NAP_MAX: Duration = Duration::from_micros(250);
helios/src/engram.rs:685-687 (production wait site)
ReaderAction::WaitReady => {
wait.step();
}
helios/src/engram.rs:309-314 at ref main (no backoff exists to be "turned dead")
let ready = unsafe { &*(flag as *const AtomicU64) };
while ready.load(Ordering::Acquire) != sequence {
if cancelled.load(Ordering::Acquire) {
return Err("n-gram request cancelled".into());
}
std::hint::spin_loop();
#519 (open) maintainer comment 2026-11-28: "a spin-then-nap inside Requests::read never runs in production. The actual wait site is now ReaderAction::WaitReady" and "lowering idle reader CPU ... does not meet the merge bar (matching why #353 was closed on the same wait)", requiring "paired, warm-cache alternating runs ... with flare_replay_readiness_wait_nanoseconds_total reported". #590's own evidence paragraph attributes 76.5% gather / 4.6% TTFT to the companion Qwen3.8 recipe PR and used --embedding-table-workers 1.
=== B2 (blocker) Windows twin keeps the pre-fix dispatch === helios/src/engram/reader/windows.rs:91-94
if self.lanes.len() == 1 || reads.len() <= DEPTH {
return self.lanes[0].gather(reads, fragments, output, stats);
}
let chunk = reads.len().div_ceil(self.lanes.len());
(and windows.rs:56 let depth = DEPTH / workers;)
vs fixed Unix helios/src/engram/reader.rs:787-796
let lane_depth = DEPTH / self.lanes.len();
if self.lanes.len() == 1 || self.reads.len() <= lane_depth {
self.lanes[0].gather(&self.reads, &self.fragments, output, &self.stats)?;
} else {
let active_lanes = self
.reads
.len()
.div_ceil(lane_depth)
.min(self.lanes.len());
let chunk = self.reads.len().div_ceil(active_lanes);
DEPTH = 128 (reader.rs:30); per-lane ring depth is DEPTH/workers (reader.rs:687-698; windows.rs:56). No windows file in the diff (pr_files). Rule: AGENTS.md:497-500.
=== S1 (should fix, merged with test nit) read-side backoff unreachable; nap test cannot prove napping === helios/src/engram.rs:401-406
if held
.as_ref()
.is_some_and(|job| job.requests.is_ready(cancelled))
{
return ReaderAction::Gather;
helios/src/engram.rs:309-317 (only production read() caller is :654)
let ready = unsafe { &*(flag as *const AtomicU64) };
let mut wait = WaitBackoff::new();
while ready.load(Ordering::Acquire) != sequence {
if cancelled.load(Ordering::Acquire) {
return Err("n-gram request cancelled".into());
}
wait.step();
}
helios/src/engram.rs:1177-1180 with AFTER_SPIN at :1092
assert!(
rounds.0 > SPIN_ROUNDS,
"expected WaitReady to enter nap phase"
);
const AFTER_SPIN: Duration = Duration::from_millis(5);
A step() that only spins (spins += 1) exceeds 4096 rounds inside 5 ms, so the assertion passes without any sleep.
=== S2 (should fix) chunked warm unreachable after the clamp; contradicts gather === helios/src/engram.rs:607-609 and :674-678
let warm_batch = WARM_BATCH_ROWS
.min(max_tokens.saturating_mul(table.heads))
.max(1);
ReaderAction::Warm => {
wait.reset();
let end = (warm_cursor + warm_batch).min(pending_warm.len());
// Advisory warming is best-effort and never poisons a staging frame.
let _ = std::panic::catch_unwind(std::panic::AssertUnwindSafe(
|| reader.warm(&planes, &pending_warm[warm_cursor..end]),
reader max_rows is the same product: engram.rs:539-541 let rows = max_tokens.checked_mul(table.heads)... -> reveal::Reader::from_files(.., rows, ..).
helios/src/engram/reader.rs:1001-1004 (gather rejects) vs :1085-1086 (warm chunks)
fn gather(&mut self, planes: &[Plane; 2], ids: &[i64], output: &mut [u8]) -> Result<()> {
if ids.len() > self.max_rows {
return Err("embedding gather exceeds the row cache workspace capacity".into());
}
let mut total_loaded = 0usize;
for chunk in ids.chunks(self.max_rows) {
~20 added lines + 86-line test advisory_warm_chunks_ids_exceeding_workspace_max_rows (reader.rs:2174-2217). Subtract: keep the clamp, keep gather's reject, restore single-pass warm.
=== S3 (should fix) publish_lookahead inert + hashes the wrong row count === ignition/components/ngram_delivery.py:157-164
def publish_lookahead(self, token_ids, query_start, history, num_seqs, num_tokens, live_rows, mailbox):
"""Hash an upcoming prompt window during graph capture and publish to an advisory mailbox."""
g = self.geometry
ids = torch.empty_like(self.ids)
requests = torch.empty(self.ids.shape[0], dtype=torch.int32, device=self.ids.device)
_advisory_requests(token_ids, query_start, history, num_seqs, num_tokens,
g.multipliers, g.prime_sizes, g.table_offsets,
ids, requests, live_rows, mailbox, self.sequence, self.plan.handle)
ignition/components/ngram_delivery.py:84-89 (row count is the prepared PLE token count, not the window)
state = require_prepared(plan_from_handle(plan), "sequence.ple_embedding", ids.device)
state.hash_state.run_tensors(token_ids, query_start, history, num_seqs, num_tokens,
multipliers, primes, offsets, ids, requests, token_count=ids.shape[0])
n = ids.numel()
_copy_requests[(triton.cdiv(n, 256),)](ids, live_rows, mailbox, n, 256, True)
grep of whole repo: only hits are the definitions (ngram_delivery.py:78,:157); consumer is local-inference-lab/hyperflare-recipes. ids = torch.empty_like(self.ids) is required to avoid overwriting the prepared hash buffer self.ids that publish/_lookup read, so only requests is reusable.
=== S4 (should fix, ONE prose item) PR description/comment accuracy ===
Quotes from the PR body (read_item 590): "reduced synchronous PLE gather time by 76.5% (0.881 s -> 0.207 s ...) and cold 111,915-token TTFT by 4.6%" attributed to five changes; run config "--embedding-table-workers 1" (single lane => guard at reader.rs:788 short-circuits, so the 2x-8x fan-out fix is only covered by the new unit test); "Fixes all four runtime defects" while "Why" enumerates 5 items (two of which bundle pairs); "turn #519's spin-then-nap backoff in Requests::read into dead code" (no such backoff on main, and #519 is still open — relation to #519 unstated); "Windows builds ... were not re-run" though the diff adds a new #[cfg(windows)] path never compiled; "reopens /proc/self/fd/<fd> read-only (O_RDONLY | O_CLOEXEC)" while the code is plain File::open (reader.rs:108-111) and the .ok() fallback is omitted. Rules: AGENTS.md:74-112 (esp. "Never attribute a combined result to one PR"), :103-109, docs/design-review.md:147-162.
=== X1 (subtract) Transfers::new duplicates decode-side mailbox validation === helios/src/engram.rs:848-858
let required = binding
.shared
.max_tokens
.checked_mul(table.heads)
.and_then(|rows| rows.checked_add(1))
.and_then(|slots| slots.checked_mul(std::mem::size_of::<i64>()))
.ok_or("n-gram request mailbox exceeds host range")?;
if nbytes < required {
return Err("n-gram request mailbox is smaller than staged capacity".into());
}
Ok::<_, Error>((address, address + nbytes - 8))
already enforced at helios/src/runtime_core/engram.rs:302-312 plus :241/:351 (table_heads = core_heads) and :242-244 (max_staged_rows = tokens*core_heads), with the same tokens (runtime_core/model.rs:857-871); Stream::host_address rejects empty ranges first (helios/src/cuda.rs:903-905). Same story for the prefetch block engram.rs:866-874. Includes the impossible checked_add(1/2) overflow arms (runtime_core/engram.rs:303-305, :314-316).
=== X2 (subtract) new fan-out test duplicates the existing multi-worker test === helios/src/engram/reader.rs:2276-2289 is the only new assertion
if let Data::Disk(disk) = &reader.data {
let used_lanes = disk
.lanes
.iter()
.filter(|lane| lane.slot_read.iter().any(|&idx| idx > 0))
.count();
let lane_depth = DEPTH / workers;
let expected_lanes = 80usize.div_ceil(lane_depth).min(workers);
against the existing test at reader.rs:1984-2000 which already loops workers [1,2,4,8], asserts row equality and truncation recovery.
=== X3 (subtract) _advisory_requests duplicates _requests ===
ignition/components/ngram_delivery.py:78-89 vs :59-70 — identical hash-plan + fake + publish tail, differing only in live_rows and HAS_LIMIT/HAS_COUNT = True; _copy_requests/_publish already take the flag as tl.constexpr (:18-33). One op with live_rows: Optional[Tensor] covers both. Keep ids fresh (aliasing) but reuse self.requests like publish does (:148-155).
=== X4 (subtract) EPERM path: silent fallback + message fork === helios/src/engram/reader.rs:138-159
let readonly_view = if !writable {
Self::open_readonly_view(file).ok()
} else {
None
};
let map_fd = readonly_view
.as_ref()
.map_or(file.as_raw_fd(), |ro| ro.as_raw_fd());
...
let address = Self::map_fd(map_fd, nbytes, protection).map_err(|error| {
if !writable && error.raw_os_error() == Some(libc::EPERM) {
format!(
"map resident embedding table: {error} (kernels older than 6.7 require /proc/self/fd to map a write-sealed memfd read-only)"
)
#481 explicitly asked for a kernel-version hint on EPERM, so the hint has a request behind it; .ok() is the problem (drops the reopen error, silently reproduces #481 when procfs is missing), and map_fd (:113-129) exists only to be called once.
=== N1 (nit) Windows dead_code + stale SPIN_ROUNDS rationale === helios/src/engram.rs:325-327 and :349-352
/// Rounds a waiting gather spins before it starts napping, enough to catch IDs
/// the graph published before the wait began.
const SPIN_ROUNDS: u32 = 1 << 12;
#[cfg(windows)]
fn yield_core(_: u32) {
std::hint::spin_loop();
}
Pre-published IDs are observed by the Acquire load at :311 before any round, so the rationale is false; NAP_GROWTH/NAP_MAX are referenced only from the not(windows) body — the exact item the maintainer listed in #519.
=== N2 (nit) third copy of the consumes filter ===
helios/src/runtime_core/engram.rs:224 and :333 GraphKind::try_from(g.kind.as_str()).is_ok_and(crate::engram::consumes) now duplicates runtime_core/model.rs:480-481; consumes at engram.rs:1011-1021. A one-word helper next to consumes would keep all three from diverging again. (This de-dup is otherwise a genuine improvement: it removes two hardcoded five-kind lists that omitted ScoredPrefill.)
=== DROPPED (do not pass downstream) ===
- flare-cli
distribution::tests::source_waits_for_receiver_file_verificationBrokenPipe and the RLIMIT_MEMLOCK / CUDA-registrationengram::readerfailures: pre-existing, unrelated to the diff. - "clippy 0 warnings in modified lines" disputes; pytest counts.
- Conventions' claim that publish_lookahead is the only allocating preparation path (PreparedEngram.publish_lookahead at engram.py:280-283 calls _hash_window without dest, which allocates too) — factually wrong.
- "steady-state GPU allocation" objection to
ids/requests(allocating fresh ids is required; reusing self.ids would corrupt publish/_lookup). - Prose items 5/6/7 and nit 3 separately (folded into S4 / N1), Simplicity F6 redundant guard (behaviour-identical, 1 line), "unverified Windows clippy" notices.
#4 [high] docs/windows.md:144-148 supports Candidate Blocker B2
docs/windows.md:144-148 (read at PR head):
Disk embedding tables use Windows I/O rings with registered files and buffers.
All core shards share each worker's ring and staging allocation; file indices
keep equal offsets in separate shards distinct.
Each disk-reader worker refills completed slots during the gather; the default
four workers share 128 slots and 8 MiB of staging per table.
This makes B2 (Windows dispatch left behind) a supported-configuration defect, not a hypothetical: the documented Windows default is 4 workers / 128 slots, i.e. Ring depth per worker = 128/4 = 32 (windows.rs:56), while windows.rs:91 still routes every batch with reads.len() <= DEPTH (128) to lanes[0]. So on the documented Windows default, the 17..=128-read collapse this PR fixes on Unix is still present on Windows. Also docs/windows.md:183 documents a Linux-exported SM121 Engram fixture with mapped mailboxes being served on Windows, so the path is exercised.
Do NOT drop B2 as "Windows unverified noise": the two Rust sources are both in-tree and the divergence is provable without a Windows build (windows.rs was not in the diff at all).
Note for the adjudicator: this does not claim a regression — Windows behaves as on main. The question is in-scope-vs-declared-out-of-scope under AGENTS.md:497-500 / charter "check every supported ... hardware target named in the docs".
#5 [high] Research summary
Brief prepared for PR #590 (head 4ea9ba0, +588/−112, 4 files). I re-opened every cited site at the PR head and compared "before" claims against main; exact 5–15 line quotations for all 11 survivors are in scratchpad entry 3, with verification facts in entry 1 and the dedupe/drop rationale in entry 2.
Candidate Blockers (2)
- B1 —
WaitBackoffre-lands the change that open #519 is blocked on, with no served measurement attributable to it. The same maintainer authored both; his #519 comment requires a recorded ruling on idle-core occupancy plusflare_replay_readiness_wait_nanoseconds_total, and #590's 76.5 %/4.6 % numbers belong to the companion PLE recipe path on a single-worker run. Also fixes the "no such backoff on main" misstatement in the body (mainengram.rs:309-314 is a bare spin). - B2 — Windows backend keeps the exact dispatch this PR fixes on Unix.
windows.rs:91,94still routesreads.len() <= DEPTHto lane 0;docs/windows.md:144-148documents 4 workers sharing 128 slots as the Windows default, so the 17–128-read collapse persists there. Provable from two in-tree files, no Windows build needed; kept out of the "unverified infra" bucket deliberately.
Should Fix (3)
- S1 —
Requests::read's backoff half is unreachable (Gather is only dispatched afteris_ready, :401-406 vs :310-316) — #519's blocking point 1 carried over. Merged with the nap test that cannot distinguish napping from spinning (AFTER_SPIN = 5 msalready exceeds 4096 spin rounds, sorounds.0 > SPIN_ROUNDSpasses for a spin-only step). - S2 — chunked
CachedReader::warmfixes a case the PR's ownwarm_batchclamp makes impossible (clamp :607-609/:674 vsmax_rows = max_tokens*heads:539-541) and now tolerates whatgatherrejects (:1002-1004 vs :1085). - S3 —
publish_lookaheadis inert in-repo and hashestoken_count=ids.shape[0], not the passed window, so a longer lookahead window silently loses its tail. - S4 — one combined prose/evidence item (combined-stack attribution, the
--embedding-table-workers 1run that cannot exercise the fan-out fix, "four defects" vs five, "Windows not re-run", the "graph capture" docstring,O_RDONLY|O_CLOEXECvs plainFile::open, omitted.ok()fallback).
Subtract / Simplify (4): duplicate Transfers::new capacity checks (proved redundant and non-false-rejecting: table_heads = core_heads, same tokens); merge the new fan-out test into parallel_unix_disk_workers_* (~70 lines); fold _advisory_requests into _requests with optional live_rows; collapse the EPERM .ok() fallback + map_fd + message fork. Nits (2): Windows dead_code on NAP_GROWTH/NAP_MAX plus the false SPIN_ROUNDS rationale; third copy of the consumes filter closure.
Pre-filtered out: the flare-cli BrokenPipe and RLIMIT_MEMLOCK/CUDA-registration failures (pre-existing), clippy/test-count disputes, the Conventions lens's "publish_lookahead is the only path that allocates" (false — engram.py:280-283 allocates too), and the "steady-state GPU allocation" objection to ids (allocating fresh ids is required; reusing self.ids would corrupt publish/_lookup). Note for the adjudicator: the Conventions lens's publish_lookahead "buffer reuse" advice must be narrowed to requests only.
#6 [high] Adjudication questions + corrections for the report
Candidate count: 12 (B1, B2, S1, S2, S3, S4, X1, X2, X3, X4, N1, N2). Entry 3 already carries a quotation block for every one of the 12. Any draft that says "11 survivors" is wrong.
Hard judgment calls the adjudicator (not me) must settle — state them as open, do not pre-decide:
- B1: is landing #519's wait inside a bug-fix PR acceptable because the maintainer is the author (i.e. the ruling is implicit), or does AGENTS.md:165-169/:198-199 still require either splitting it out or recording the idle-core ruling +
flare_replay_readiness_wait_nanoseconds_total? Note the asymmetry: the maintainer's own #519 text demands the ruling, and #590 does not contain it. - B2: fix both backends, or declare Windows out of scope and track it (AGENTS.md:497-500 allows "distinguish confirmed findings from untested paths")? No regression is claimed — Windows is as on main.
- S1: is
read's loop worth deleting (test-only) or should it bedebug_assert!(is_ready)? Either way the PR body must stop saying "used by both". - S2: keep the clamp only (smallest) vs keep chunking as defence-in-depth for direct
Reader::warmcallers; if kept,gather's reject should match, so one policy exists. - S3: does the cross-repo consumer justify shipping an in-repo-inert capability (AGENTS.md:165-169 says hypothetical consumers do not establish need; but the recipe PR is stated as real and merge-ordered)? Plus the window-length contract question (
token_count=ids.shape[0]vs the passedtoken_ids/window). - X1: is defence-in-depth at the layer holding the address deliberate or drift? If deliberate, one clause in the description settles it.
Reporting notes / corrections to the lens input:
- Narrow the Conventions lens's finding 2: the only reusable allocation in
publish_lookaheadisrequests.ids = torch.empty_like(self.ids)must stay fresh becauseself.idsis the prepared hash buffer thatpublish(:148-155) and_lookup(:172-174) read; reusing it would corrupt both. The "steady-state GPU allocation" (AGENTS.md:176-179) objection toidsis therefore wrong; the shape/consistency point againstpublishstill stands forrequests. - Conventions' "only preparation-time hashing path that allocates" is factually false:
PreparedEngram.publish_lookahead(engram.py:280-283) calls_hash_windowwith noargs/dest, which allocates five tensors per call. Do not repeat that claim. - Prose lens's #519-relationship item, "four vs five defects", docstring "during graph capture", and "Windows not re-run" are all folded into S4 (one item), and the SPIN_ROUNDS rationale sits in N1 — do not list them as separate candidates.
- The
Try_fromhalf of the new filter cannot fail in practice (unknown kinds rejected at manifest decode), so X/N2 is only about the third textual copy of the closure — not a correctness issue. NAPS: the 25–225 µs rungs are under Linux timer slack, which is why the ramp buys nothing measurable (supports X1/B1's "one sleep" suggestion) — from #519's review round, not verifiable here.
#7 [high] Verified positives (do not flag)
Verified positives — the report should say these are clean so the adjudicator does not re-litigate them:
- Lane fan-out arithmetic (reader.rs:787-796) is panic-free:
lane_depth = DEPTH/lanes.len()is 128/64/32/16 and never zero becausefrom_filesrestricts workers to 1|2|4|8 (:687-698);active_lanesis >= 1 wheneverreads.len() > lane_depth, sosplit_first_mut()always yieldsSomeandchunk != 0. Correct fix for the 4x–8x queue-depth collapse. /proc/self/fdreopen (reader.rs:108-111, :138-147) is the right layer and the right root cause for #481 (issue reproduces exactly this:mmap MAP_SHARED|PROT_READon theO_RDWRsealed memfd returns EPERM; the O_RDONLY reopen succeeds). Seals are still enforced (RESIDENT_SEALS,F_GET_SEALSinfrom_shared), theMADV_POPULATE_READpreparation is preserved, and the new test assertsF_GETFL == O_RDONLYplusmprotect(PROT_WRITE)EACCES— the positive control is good. The hand-rolled reopen is NOT a duplicate ofeos/src/unix.rs:60-65 direct_reopen(that addsO_DIRECT, which cannot back an mmap) or ofmap_host.runtime_core/engram.rshardening is a genuine subtraction:checked_mulat :287 replaces an uncheckedshape[0] * 8,offset.checked_add(nbytes) <= a.nbytes(:289-296) is new real validation, and theGraphKind::try_from(...).is_ok_and(crate::engram::consumes)filters (:224, :333) delete two hardcoded five-kind lists that omittedscored_prefill— matching model.rs:480-481. Exporter-side capacity is consistent (ignition/preparation/contract.py:88-89 already attaches embedding_tables for scored_prefill), so no core is selectively stranded.- Backward compatibility (AGENTS.md:434-437): the new
Transfers::newrejects cannot fire on a validly exported core — the arithmetic matches decode (:241, :242-244, :302-322) andStream::host_address(cuda.rs:903-905) already rejects empty ranges, soaddress + nbytes - 8cannot underflow. Only reachable with a malformed mailbox, i.e. exactly the u64-wrap case the PR targets. - Python layering is correct: Ignition only prepares a publish op (docs/design-review.md:36-38); no native change was needed for the PLE table, which is the model-agnostic outcome the charter asks for. The mailbox layout matches
AdvisoryMailbox::snapshot(engram.rs:254-267: count at nbytes-16, flag at nbytes-8) and the shippedengram.py:280-283.publish_lookaheadcorrectly requires a non-functional()instance, same aspublish. prefetch_rows_loadedstill counts rows and still matches docs/cli-design.md:816 / helios/README.md:671; the double-count was removed by deleting the caller-side add at Reader::warm (reader.rs:1293-1304), whose return value was already discarded (engram.rs:676-678).- Test conventions: new tests reuse the file's temp-file + Plane + Stats + remove_file shape;
device_request(engram.rs:1080-1088) matches the one productionRequests::Deviceconstruction. - Global correctness verdict from the Correctness lens: no blocking or should-fix defect; I found nothing it missed. So the report should not carry a "correctness bug" framing — the disputes are scope/evidence/subtraction, not wrong behavior.