Skip to content

feat(cybergym): v3 redirects the CyberGym lane to compute when idle (N=0) - #147

Open
ai-hpc wants to merge 3 commits into
mainfrom
ai-hpc/cybergym-v3-idle-redirect
Open

feat(cybergym): v3 redirects the CyberGym lane to compute when idle (N=0)#147
ai-hpc wants to merge 3 commits into
mainfrom
ai-hpc/cybergym-v3-idle-redirect

Conversation

@ai-hpc

@ai-hpc ai-hpc commented Aug 25, 2026

Copy link
Copy Markdown
Member

Implements the N=0 → compute redirect (STAGE B of the v3 CyberGym-lane redesign, Option A), removing the fail-closed HALT: a v3 tick with zero CyberGym winners no longer stops the whole subnet from paying.

What changed

When CyberGym has no winners this tick, v3 signs an honest 100% Intel TDX / 0% CyberGym split with an empty lane, instead of raising:

  • Publisher (weights.py): _compose_cybergym_lane_v3 emits an empty lane (fraction 0.0, same V3_CYBERGYM_LANE_FIELDS) on no_contribution; build_signed_vector then sets intel_tdx_allocation=1.0 / cybergym_allocation=0.0. Genuine failures (disabled / burn-destination-unresolved / recipient-identity-unresolved) still fail closed.
  • Validator (validator_thin.py): the allocation check accepts 0.70/0.30 (CyberGym active) or 1.0/0.0 (idle → redirected to compute).

Safety

The two shapes are mutually exclusive and self-consistent: the existing lane_mass == cybergym_allocation cross-check (validator_thin.py:3414) means 1.0/0.0 forces an empty lane and 0.70/0.30 forces a full one. A publisher cannot claim idle while paying CyberGym miners, nor vice versa. Two rejection tests cover this.

Tests

test_validated_supply_v334 passed (idle metadata accepted; idle maps to 100% compute; both safety rejections; publisher composes an empty lane on idle). The 45 chain-submission failures seen locally are pre-existing (bittensor absent in this env) and unrelated — they fail identically on origin/main.

Independent of the STAGE A curve PR (#146 / distill #161 — different files). Reward-path / v3 contract shape; not self-merged.

🤖 Generated with Claude Code

ai-hpc and others added 3 commits August 25, 2026 04:48
…idle (N=0)

A v3 tick with zero CyberGym winners previously RAISED in
_compose_cybergym_lane_v3, halting the whole signed vector -- so a quiet
CyberGym epoch stopped the compute lane paying too. This adds an honest
"CyberGym-idle" shape to the v3 contract:

- Publisher: on cybergym_allocation status "no_contribution" the composer now
  emits an EMPTY lane (fraction 0.0, same V3_CYBERGYM_LANE_FIELDS) instead of
  raising; build_signed_vector then signs the honest 100% Intel TDX / 0% CyberGym
  split. Genuine failures (disabled / burn-destination-unresolved / recipient-
  identity-unresolved) still fail closed.
- Validator: _validated_supply_v3_meta accepts 0.70/0.30 (CyberGym active) OR
  1.0/0.0 (idle -> redirected to compute). Safety is preserved by the existing
  cybergym_lane mass cross-check (lane_mass == cybergym_allocation): 1.0/0.0
  forces an empty lane and 0.70/0.30 forces a full one, so a publisher cannot
  claim idle while paying CyberGym miners, nor vice versa.

Tests: idle metadata accepted, idle maps to 100% compute, both safety
rejections, publisher composes an empty lane on idle -- test_validated_supply_v3
34 passed (45 chain-submission failures are pre-existing bittensor-absent-locally,
unrelated). Removes the fail-closed HALT flagged pre-launch.

Reward-path / v3 contract shape; for wallscaler review, not self-merged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…idator contract

Same-repo coherence guard (BOUNDARY.md fork hazard): if the publisher's
V3_TDX_ALLOCATION/V3_CYBERGYM_ALLOCATION and the validator's accepted split ever
diverge, this fails loudly instead of rejecting every signed vector in prod.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adversarial review of the v3 lane PRs (no exploitable or correctness defect
found) surfaced three latent items, fixed here:

- policy_hash was computed over the pre-redirect 0.70/0.30 supply_policy, so an
  idle vector's SIGNED hash committed to a split the signed values no longer
  carry (unconsumed today, but a latent trap). Recompute it after the idle
  mutation so the signed hash matches the signed values.
- The public reproducer _assert_current_dry_run_v3 hard-required 0.70/0.30 and
  would report an idle (1.0/0.0) tick as non-reproducible once wired to live
  events. Teach it the idle shape (mirrors the validator's own allocation gate).
- Add an end-to-end seam test: the empty lane the PUBLISHER actually composes on
  idle is fed straight into the validator and maps to 100% compute (closes the
  emitted-==-accepted coverage gap the review noted).

test_validated_supply_v3: 37 passed. Reward-path; for wallscaler review.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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