Skip to content

feat(coordinator): feed the CUDA miner from a quip-screen sidecar - #38

Open
rdyplayerB wants to merge 2 commits into
mainfrom
feat/probe-screen-feed
Open

rdyplayerB wants to merge 2 commits into
mainfrom
feat/probe-screen-feed

Conversation

@rdyplayerB

Copy link
Copy Markdown

What

With QUIP_SCREEN_BIN set, the feeder runs quip-screen serve (QuipNetwork/quip-miner-cuda#1) and gives cuda* miners the deepest screened salts instead of counter salts.

  • screen.rs: writes the snapshot topology to $TMPDIR/quip-screen-<hash>.json, starts the sidecar with --spec, sends R <generation> <prev hash> <identity> on each round change, and queues K <generation> <salt> <energy> lines, deepest first, per generation.
  • runtime.rs: when topping up a cuda* miner, pop the deepest queued salt of the current generation and derive the job with derive_pow_job. Validation, stash and submission are unchanged.
  • Empty queue: stage nothing for that miner, leaving the GPU to the screen. QUIP_SCREEN_FALLBACK=1 tops it up with counter salts instead.
  • The sidecar exits: counter salts from then on. A topology change restarts the sidecar with a new spec.
  • QUIP_SCREEN_ARGS passes probe settings (--reads-log2, --sweeps, serve --keep-per-s).
  • COORDINATOR.md: new "Probe screen (optional)" subsection under the feeder.
  • Unset QUIP_SCREEN_BIN: no change in behaviour.

Checks

  • cargo fmt --all --check, cargo clippy -p quip-coordinator --all-targets -- -D warnings.
  • cargo test -p quip-coordinator: all pass, including 4 new tests (queue order and generation filtering, reset, hex round trip, sidecar line parsing).

Related: #36 and #37, two drive problems found while measuring the screen.

With QUIP_SCREEN_BIN set, the feeder writes the snapshot topology to a
spec file, runs `quip-screen serve`, sends it each round's prev hash and
identity, and queues the salts it keeps, deepest first per generation.
cuda* miners are topped up from that queue; the job is still derived
with derive_pow_job, so validation, stash and submission are unchanged.
An empty queue stages nothing unless QUIP_SCREEN_FALLBACK=1; a dead
sidecar falls back to counter salts. Unset: no behaviour change.
@augmentcode

augmentcode Bot commented Sep 22, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Adds an optional quip-screen sidecar to pre-screen CUDA mining salts.

Changes:

  • Exports a new coordinator screen module and documents its environment variables.
  • Writes a snapshot-derived topology spec and launches the configured sidecar.
  • Announces each mining round to the sidecar using generation, previous-proof hash, and miner identity.
  • Collects generation-scoped screened salts in a bounded priority queue, deepest first.
  • Feeds queued salts to cuda* miners while retaining ordinary PoW job derivation and validation.
  • Leaves CUDA miners unstaged when the queue is empty, with an opt-in counter-salt fallback.
Technical notes: Sidecar exits fall back to counter salts; topology changes recreate the sidecar spec, and QUIP_SCREEN_ARGS is forwarded to the sidecar.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode 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.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

"nodes": snap.nodes,
"edges": snap.edges.iter().map(|&(u, v)| [u, v]).collect::<Vec<_>>(),
"allowed_h_milli": snap.allowed_h_milli,
"allowed_j_milli": snap.allowed_j_milli,

@augmentcode augmentcode Bot Sep 22, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

crates/quip-coordinator/src/screen.rs:164 omits allowed_spin_milli, even though it is part of the topology-spec schema and canonical topology hash. For a non-default spin set, quip-screen will default to ±1000 and screen a different solution domain than the coordinator's snapshot.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

"quip-screen-{}.json",
hex(snap.topology_hash.get(..8).unwrap_or(&snap.topology_hash))
));
if let Err(e) = std::fs::write(&spec, spec_json(snap)) {

@augmentcode augmentcode Bot Sep 22, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

crates/quip-coordinator/src/screen.rs:197 writes to a predictable, topology-derived filename in the shared temp directory with fs::write, which follows existing symlinks. A local user can pre-create that known path as a symlink and cause the coordinator service account to truncate and overwrite another file it can write.

Severity: high

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

In a long round the screened-salt queue reached its 20,000 cap and then
dropped every new salt, including ones deeper than those waiting. At the
cap it now keeps its deepest half and admits the new salt.
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