Repository navigation
fix: use population std for native Tinker advantages - #1115
Merged
Merged
Conversation
bradhilton
force-pushed
the
tarkin/tinker-native-population-std
branch
2 times, most recently
from
October 10, 2026 17:35
c6cda82 to
d379c4a
Compare
bradhilton
force-pushed
the
tarkin/tinker-native-population-std
branch
from
October 10, 2026 18:58
d379c4a to
edb3c9a
Compare
bradhilton
marked this pull request as ready for review
October 10, 2026 19:26
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.
Agent: Tarkin
Part of #1111 (item 10).
Problem:
tinker_nativenormalized advantages with the sample standard deviation (n−1), while ART's other backends use the population standard deviation (n). Its advantages were therefore smaller by √((n−1)/n), 0.87 at n = 4. Equal rewards also weren't caught: FP32 rounding left a mean residue that the std guard didn't treat as zero, so[0.3] * 8produced advantages of +0.94 with normalization on, and about 3e-8 with it off.Behavior after this change:
tinker_nativeruns will see advantages scaled up by √(n/(n−1)).Validation: New
tests/unit/test_tinker_native_advantages.pypins the population std convention, degenerate and equal-reward groups, the existing 1e-8 std guard, and the unnormalized path. 7 of its 12 cases fail on main. Thetinker_nativesuites pass.Limitations: The 1e-12 tolerance is inlined here. If #1118 merges first, this should switch to its shared
rewards_have_zero_variancehelper.