feat: replace uniqueness multiplier with graduated pioneer reward mechanism#242
feat: replace uniqueness multiplier with graduated pioneer reward mechanism#242MkDev11 wants to merge 1 commit intoentrius:testfrom
Conversation
55c5689 to
5294a0e
Compare
|
@anderdc @LandynDev Please review the PR and let me know your feedback. |
4b4f56f to
d8be47a
Compare
a16e944 to
912e90a
Compare
|
Can you rebase this onto |
…trius#240) Replace the cross-miner repository uniqueness multiplier with a pioneer reward mechanism that makes untouched repos genuinely attractive while keeping follower scoring neutral. - Binary pioneer bonus: only earliest merged PR on each repo gets bonus - Quality gate: PRs below MIN_TOKEN_SCORE_FOR_BASE_SCORE are ineligible - Single-PR scoping: bonus only on pioneering PR, not follow-ups - Multi-repo damping: bonus decays as miner pioneers more repos - Pure scalar function: calculate_pioneer_reward_multiplier(int) with round(..., 2) consistent with all other multipliers - Pioneer multiplier: 2.20x (1 repo), 1.60x (4 repos), 1.40x (9 repos) - Comprehensive test suite: 33 tests across 8 test classes - DB schema: pioneer_multiplier + pioneer_rank replace repository_uniqueness_multiplier
912e90a to
c7e2a77
Compare
|
@LandynDev please review again. thanks |
Other notes:
Overall the PR was a bit complex and doesn't feel like an elegant solution that is easily maintainable and readable. The work feels like it lacked stepping back and giving a thorough review to ensure high quality. Lets spell out a quick example between what existed and your proposed solution: Say miner 1 had solo contributions to repos A,B,C. We already had a repository uniqueness multiplier in place that clearly wasn't working strong enough, hence issue #240. Sure we can raise the Key snippets from issue description:
|
Summary
Replace the repository uniqueness multiplier with a pioneer reward mechanism that gives the first miner to land a quality merged PR on an untouched repo a meaningful score bonus, while followers score normally at 1.0x.
Problem
Contribution activity clusters on a small number of popular repositories. The existing
repository_uniqueness_multipliergives a shared bonus that shrinks as more miners pile on, but it is too weak to change miner behavior — miners still cluster on repos once they become visibly profitable.Solution
A binary pioneer reward: exactly one winner per repo, decided by earliest eligible merge timestamp. The multiplier is a pure 4-line function with two constants:
How it works
token_score >= MIN_TOKEN_SCORE_FOR_BASE_SCORE, valid tier config, non-nullmerged_at).(merged_at, pr_number)— position 1 is the pioneer. The pioneer's specific PR gets the bonus multiplier; all other PRs (followers, later PRs from the same miner) get1.0x.Constants:
PIONEER_BASE_BONUS = 1.2,PIONEER_MULTI_REPO_DECAY_EXPONENT = 0.5Design decisions
MIN_TOKEN_SCORE_FOR_BASE_SCOREare excluded from pioneer ranking entirely. This prevents low-effort snipe merges from capturing pioneer status. If a low-quality PR merges first, the next quality contributor becomes the pioneer instead.pioneer=2.20(P)for pioneers andpioneer=1.00(F)for followers, making scoring transparent in validator output.Changes
gittensor/constants.pyPIONEER_BASE_BONUS = 1.2andPIONEER_MULTI_REPO_DECAY_EXPONENT = 0.5; removeUNIQUE_PR_BOOSTgittensor/classes.pyrepository_uniqueness_multiplierwithpioneer_multiplier: floatandpioneer_rank: int; updatecalculate_final_earned_scoreto use pioneer key with(P)/(F)taggittensor/validator/evaluation/scoring.pyis_pioneer_eligible,collect_repo_pioneer_candidates,build_repo_contributor_ordering,count_pioneered_repositories,calculate_pioneer_reward_multiplier; updatefinalize_miner_scoresto apply pioneer rewards; removecalculate_uniqueness_multipliergittensor/validator/storage/queries.pyrepository_uniqueness_multipliercolumn withpioneer_multiplierandpioneer_rankin INSERT/UPDATE queriesgittensor/validator/storage/repository.pypioneer_multiplierandpioneer_ranktests/validator/conftest.pyPRBuilder.create()to acceptmerged_at,uid, andtoken_scoreparameterstests/validator/test_pioneer_reward.pyDB migration
Related Issues
Closes #240
Type of Change
Testing
Test coverage (33 tests, 8 classes)
TestBuildRepoContributorOrderingTestPioneerEligibilitymerged_at+token_score >= MIN_TOKEN_SCORE_FOR_BASE_SCORETestCollectRepoPioneerCandidatesTestCalculatePioneerRewardMultiplierTestCountPioneeredRepositoriesTestFinalizationTestPioneerIncentiveEvidenceTestEdgeCasesScoring simulation evidence (from
TestPioneerIncentiveEvidence)Exploration yields 5x more network-wide pioneer bonus than pile-on. Distributed mining yields 10x more than concentrated.
Test results
Checklist