Skip to content

feat(lane D): held gate candidates' bench sweep starts with the settlement step, beside scoring - #1044

Merged
tensorlink-dev merged 1 commit into
mainfrom
laned-gate-prefetch
Dec 1, 2026
Merged

tensorlink-dev merged 1 commit into
mainfrom
laned-gate-prefetch

Conversation

@tensorlink-dev

Copy link
Copy Markdown
Contributor

Owner request 2026-12-01: lane D's public-bench gate for already-held candidates starts on the bench host when the settlement step starts, in parallel with scoring (eval-host pool/public forecasts, ~20-30 min). Before this, it waited for scoring to finish.

How it works

  • lane_d_wiring.LaneDStep._produce calls _start_gate_prefetch right after the block hash and sentinel are read, before _read_inputs. That call gets a plan from LaneDInputsSource.gate_prefetch(b), which only reads: held digests via the new pure lane_d.held_gate_digests, KING_D, the house, and their contexts from _needed, the same map set_contexts receives. It opens the boundary's bench session (same session id) and runs SweepSession.prefetch on a daemon thread. The suites are the gate's own gate_record draw plus the sentinel.
  • SweepSession.prefetch sets the rows aside. paired() adopts a prefetched digest only when the suites tuple matches exactly and host.context_of(dg) equals the prefetched context. Anything else is dropped, and the gate sweeps that digest as before. _run_gate is unchanged.
  • One sweep on the host at a time: a per-session lock means paired waits for a running prefetch. No prefetch starts while the king's full bench is running or while an earlier prefetch is still alive. The step waits for any prefetch to finish before using a fresh session and before scheduling the king bench. A retried tick for the same boundary reuses an unused prefetch session.
  • Fails closed: if the plan or prefetch raises, the reply is partial, a suite is extra or missing, or a context doesn't match, the gate falls back to the sequential sweep. There is no plan without a bench host or without a held candidate.
  • SSHBenchHost.__call__ takes an optional contexts= override. The rows are the same as from a normal call.

Byte-identity: the gate decides on the same per-digest host rows, so the report, gate record, bound bench records, receipt and state are identical. This relies on the bench host's per-digest results not depending on how digests are grouped into calls, which the session cache already assumes. External validators and satellites are unchanged: they have no bench host, so they never prefetch.

Tests

tests/accept/w8b/test_w8b_gate_prefetch.py is torch-free, and all 11 tests fail on base by assertion. They cover:

  • the prefetch starts while a blocking eval host is still scoring
  • byte-identical report, gate, receipt, state and bench rows with and without the prefetch (sentinel on and off), and adoption is shown to happen
  • raise / partial / context-mismatch cases fall back with identical output
  • no prefetch without a held candidate or without a bench host
  • new clears are still gated
  • held_gate_digests does not mutate state and matches _held_candidates
  • the gate waits for an in-flight prefetch

Regression: w8b, w3b2, w3b3, w3b4, w3b6a, w3b6b, w5e, w8c and w_offbox all green, plus test_incident_rules.py (89 passed). Ruff is clean.

Labels: laned:W8b (wiring + tests), laned:W3b2 (lane_d_bench.py), laned:W3b6a (bench host + inputs), laned:W5e (lane_d.py).

Not merged and not deployed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BMT4D7f8wd5dXsASyWUBwe

…ement step, beside scoring

Owner 2026-12-01. At step start, when the boundary has held gate candidates
and a bench host, their gate sweep (with KING_D and the house; same session
id, suite draw, sentinel and contexts as _run_gate) runs on a background
thread in the boundary's SweepSession while the eval host scores. The gate's
SweepSession.paired adopts a prefetched digest only when the suites match
exactly and the host's settlement context equals the prefetched one;
anything else (failure, partial reply, context mismatch) is swept in order
as before. paired waits for a running prefetch (one sweep on the bench host
at a time); no prefetch beside the king's full bench. _run_gate and the
signed report are unchanged: timing only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BMT4D7f8wd5dXsASyWUBwe
@vercel

vercel Bot commented Dec 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cascade Ignored Ignored Dec 1, 2026 4:59am UTC

Request Review

@tensorlink-dev
tensorlink-dev added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit 463d15d Dec 1, 2026
16 of 20 checks passed
tensorlink-dev added a commit that referenced this pull request Dec 1, 2026
Resolves docs/MINER_LANE_D.md (main's gate paragraph kept, the held-first
crown-order bullet after it). lane_d.py auto-merged: #1044's prefetch adopts
the held candidates' rows in SweepSession.paired, which held-first gating
calls first; new clears are still not benched when a held candidate crowns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BMT4D7f8wd5dXsASyWUBwe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

laned:W3b2 laned:W3b6a Lane D WP W3b6a laned:W5e laned:W8b Lane D plan WP W8b

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant