feat(cybergym): v3 redirects the CyberGym lane to compute when idle (N=0) - #147
Open
ai-hpc wants to merge 3 commits into
Open
feat(cybergym): v3 redirects the CyberGym lane to compute when idle (N=0)#147ai-hpc wants to merge 3 commits into
ai-hpc wants to merge 3 commits into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
weights.py):_compose_cybergym_lane_v3emits an empty lane (fraction 0.0, sameV3_CYBERGYM_LANE_FIELDS) onno_contribution;build_signed_vectorthen setsintel_tdx_allocation=1.0 / cybergym_allocation=0.0. Genuine failures (disabled / burn-destination-unresolved / recipient-identity-unresolved) still fail closed.validator_thin.py): the allocation check accepts0.70/0.30(CyberGym active) or1.0/0.0(idle → redirected to compute).Safety
The two shapes are mutually exclusive and self-consistent: the existing
lane_mass == cybergym_allocationcross-check (validator_thin.py:3414) means1.0/0.0forces an empty lane and0.70/0.30forces a full one. A publisher cannot claim idle while paying CyberGym miners, nor vice versa. Two rejection tests cover this.Tests
test_validated_supply_v3— 34 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 (bittensorabsent in this env) and unrelated — they fail identically onorigin/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