Skip to content

feat: allocate emissions by repository share#1233

Closed
CaptainTimon wants to merge 1 commit into
entrius:testfrom
CaptainTimon:feat/repo-emission-share-allocation
Closed

feat: allocate emissions by repository share#1233
CaptainTimon wants to merge 1 commit into
entrius:testfrom
CaptainTimon:feat/repo-emission-share-allocation

Conversation

@CaptainTimon
Copy link
Copy Markdown

Summary

Folded #1215 into one atomic PR, per maintainer feedback on the sliced PRs.

This converts repository allocation from an unbounded per-PR weight multiplier into bounded repo-level emission_share allocation:

  • Rename live repo config from weight to emission_share, with [0, 1] per-repo validation and sum(emission_share) <= 1.0 validation.
  • Add issue_discovery_share ([0, 1], default 0.5) and set entrius/oc-1 to 0.0 for issue discovery.
  • Collapse top-level emissions to OSS_EMISSION_SHARE = 0.90 and ISSUES_TREASURY_EMISSION_SHARE = 0.10; remove fixed issue-discovery/recycle emission constants.
  • Remove repository weighting from PR earned-score, open-PR collateral, mirror PR multiplier calculation, and issue-discovery earned-score calculation.
  • Preserve old storage/adapter fields as neutral compatibility fields instead of doing schema churn in this PR.
  • Add allocate_repo_scoring_pool: each repo receives at most emission_share * 90%; PR/issue sides split by issue_discovery_share, empty side spills only within the same repo, fully inactive repo slices and registry slack recycle to UID 0.
  • Persist scored issue-discovery Issue objects on MinerEvaluation.discovered_issues so aggregation uses real per-repo issue-discovery evidence, not global normalized arrays.
  • Wire validator forward pass and gitt miner score to allocate from raw per-repo score evidence.

Related Issues

Closes #1215.

Prior PR Analysis

Reviewed the existing single-PR attempts #1217, #1218, #1219, and #1223 plus the closed slice PRs #1220, #1222, #1224-#1232.

This PR keeps the integrated/atomic shape requested by the maintainer, but avoids two risks I saw in those attempts:

  • It does not remove persistence columns or adapter fields in the same monetary-policy change; old repo_weight_multiplier fields stay neutral for compatibility.
  • It explicitly stores issue-discovery scored issues on MinerEvaluation, so repo-level aggregation can see real issue-discovery scores from the active path instead of relying on a non-existent per-repo aggregate field or already-normalized arrays.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe below)

Emission policy / reward allocation change.

Testing

  • Tests added/updated
  • Manually tested

Commands run:

uv run pytest tests/validator/test_load_weights.py tests/validator/test_emission_share_allocation.py tests/validator/oss_contributions/mirror/test_scored_pr.py tests/validator/oss_contributions/mirror/test_scoring.py tests/validator/issue_discovery/test_scan.py tests/cli/test_miner_score.py -q
uv run ruff check gittensor/constants.py gittensor/validator/utils/load_weights.py gittensor/validator/emission_allocation.py gittensor/validator/forward.py gittensor/classes.py gittensor/validator/oss_contributions/mirror/scored_pr.py gittensor/validator/oss_contributions/mirror/scoring.py gittensor/validator/issue_discovery/scan.py gittensor/validator/oss_contributions/scoring.py gittensor/cli/miner_commands/score.py tests/validator/test_load_weights.py tests/validator/test_emission_share_allocation.py tests/validator/oss_contributions/mirror/test_scoring.py tests/validator/oss_contributions/mirror/test_scored_pr.py
uv run ruff format --check gittensor/constants.py gittensor/validator/utils/load_weights.py gittensor/validator/emission_allocation.py gittensor/validator/forward.py gittensor/classes.py gittensor/validator/oss_contributions/mirror/scored_pr.py gittensor/validator/oss_contributions/mirror/scoring.py gittensor/validator/issue_discovery/scan.py gittensor/validator/oss_contributions/scoring.py gittensor/cli/miner_commands/score.py tests/validator/test_load_weights.py tests/validator/test_emission_share_allocation.py tests/validator/oss_contributions/mirror/test_scoring.py tests/validator/oss_contributions/mirror/test_scored_pr.py
uv run pytest -q

Results:

  • Focused suite: 195 passed
  • Full suite: 729 passed

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Changes are documented (if applicable)

@xiao-xiao-mao xiao-xiao-mao Bot added the enhancement New feature or request label May 13, 2026
@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented May 13, 2026

Closing — contributor is not a registered subnet miner.

@anderdc anderdc closed this May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convert per-repo weight from unbounded multiplier to emission_share (bounded pool slice)

2 participants