Skip to content

feat(rewards): allocate emissions by repo share#1217

Closed
aliworksx08 wants to merge 2 commits into
entrius:testfrom
aliworksx08:fix/repo-emission-share
Closed

feat(rewards): allocate emissions by repo share#1217
aliworksx08 wants to merge 2 commits into
entrius:testfrom
aliworksx08:fix/repo-emission-share

Conversation

@aliworksx08
Copy link
Copy Markdown

@aliworksx08 aliworksx08 commented May 12, 2026

Summary

Closes #1215.

Converts repository allocation from an unbounded per-PR weight multiplier to a bounded per-repository emission_share applied at round aggregation. PR and issue-discovery scores now determine proportional distribution only inside each repository's configured slice.

Changes

  • Rename repository allocation config to emission_share while keeping a compatibility alias for existing constructor callers.
  • Add issue_discovery_share with default 0.5, plus finite-float and [0, 1] validation.
  • Reject registry sums greater than 1.0; registry slack is recycled instead of redistributed.
  • Remove repo weighting from PR earned-score, open-PR collateral, and issue-discovery score products.
  • Allocate the unified OSS_EMISSION_SHARE = 0.90 scoring pool by repository slice, then split/spill within each repository between PR and issue-discovery sides.
  • Route inactive repository slices and registry slack to RECYCLE_UID; keep treasury as flat ISSUES_TREASURY_EMISSION_SHARE = 0.10.
  • Migrate master_repositories.json from weight to emission_share.
  • Add regression coverage for config invariants, non-finite and boolean share rejection, fixed repo slices across PR counts, PR/issue spill, inactivity recycling, and registry slack.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other: emission policy change

Testing

  • Tests added/updated
  • Manually tested

Validation:

uv run pytest tests/validator/test_load_weights.py tests/validator/test_emission_allocation.py tests/validator/oss_contributions/mirror/test_scored_pr.py tests/validator/oss_contributions/mirror/test_scoring.py tests/cli/test_miner_score.py -q
# 158 passed

uv run pytest -q
# 739 passed

uv run ruff check gittensor tests/validator/test_load_weights.py tests/validator/test_emission_allocation.py tests/cli/test_miner_score.py
# All checks passed

uv run ruff format --check gittensor/validator/utils/load_weights.py tests/validator/test_load_weights.py gittensor/validator/forward.py tests/validator/test_emission_allocation.py
# 4 files already formatted

uv run pyright gittensor
# 0 errors, 0 warnings, 0 informations

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 12, 2026
@aliworksx08 aliworksx08 changed the title fix(rewards): allocate emissions by repo share feat(rewards): allocate OSS emissions by repository emission share May 13, 2026
@aliworksx08 aliworksx08 changed the title feat(rewards): allocate OSS emissions by repository emission share feat(rewards): allocate emissions by repo share May 13, 2026
@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented May 13, 2026

Not advancing for #1215 review. Closing.

@anderdc anderdc closed this May 13, 2026
@aliworksx08
Copy link
Copy Markdown
Author

@anderdc, excuse me, may I reopen my PR? I don't know why my PR closed.

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