Repository navigation
fix(hall_of_rust): PowerPC arch bonus never applied (upper-case keys vs lower-cased arch) - #7956
Merged
Scottcjn merged 2 commits intoJul 13, 2026
Conversation
…vs lower-cased arch) calculate_rust_score() lower-cases device_arch before the substring match, but the PowerPC entries in arch_bonus used upper-case keys 'G3'/'G4'/'G5'. Since 'G4' in 'g4' is False, every PowerPC machine — the exact vintage hardware the Hall of Rust exists to celebrate — silently lost its architecture bonus, corrupting leaderboard ordering (ORDER BY rust_score DESC) and badge assignment. Lower-case the three PowerPC keys to match the already-lower-cased arch value. The sibling estimate_manufacture_year() already uses key.lower(), confirming lower-case is the intended convention. Adds node/test_hall_of_rust_arch_bonus_poc.py (fails on main for G3/G4/G5, passes with fix).
Contributor
|
Welcome to RustChain! Thanks for your first pull request. Before we review, please make sure:
Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150) A maintainer will review your PR soon. Thanks for contributing! |
Owner
|
Maintainer validation: all 19 focused multiplier and profile tests pass locally. Normalizing the profile keys to lowercase matches the already-lowercased architecture lookup and restores the intended G3/G4/G5 multipliers. The aggregate CI failure is the stale main-branch fetchall/checksum baseline repaired in #7957, not a regression in this PR. |
Contributor
RTC RewardThis merged PR earned 5 RTC — sent to |
This was referenced Jul 13, 2026
fix(hall_of_rust): explorer Rust Score drops PowerPC arch bonus (case-mismatch, twin of #7956)
#7960
Closed
Scottcjn
added a commit
that referenced
this pull request
Aug 10, 2026
…r) (#7969) calculate_rust_score() matches device_arch against arch_bonus with a substring test that stops at the first hit. 'pentium' is a substring of 'pentium4' and comes first in dict-iteration order, so a Pentium 4 machine matched 'pentium' and got 100 instead of its intended 50 -- the 'pentium4': 50 entry was unreachable dead code, and every Pentium 4 sat 50 points too high on the ORDER BY rust_score DESC leaderboard. Iterate arch_bonus longest-key-first so the most specific substring wins. This resolves the pentium/pentium4 overlap and is robust to future overlapping keys, without regressing the PowerPC fix (#7956). Adds node/test_hall_of_rust_pentium4_bonus.py (fails on main: pentium4 returns 100; passes with fix: 50), PowerPC/486/pentium cases kept green. Co-authored-by: AutoJanitor <crypteauxcajun@gmail.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.
Problem
calculate_rust_score()innode/hall_of_rust.pylower-cases the reported architecture:…but the PowerPC entries in
arch_bonusused upper-case keys'G3'/'G4'/'G5'. Because'G4' in 'g4'isFalse, a PowerPC machine — the exact vintage hardware the Hall of Rust exists to celebrate — never received its architecture bonus.Concrete failing inputs (pure function,
current_yearpassed explicitly, all other score terms 0):G4G3G5This silently under-scores PowerPC machines, corrupting leaderboard ordering (
ORDER BY rust_score DESC) and badge assignment.Fix
Lower-case the three PowerPC keys to match the already-lower-cased
archvalue:The sibling
estimate_manufacture_year()already useskey.lower() in arch.lower(), confirming lower-case is the intended convention.Test
Adds
node/test_hall_of_rust_arch_bonus_poc.py:G3/G4/G5return0.0.pytest ... -q→5 passed).test_hall_of_rust_limit_validation.py(6),test_hall_of_rust_error_responses.py(8),explorer/test_hall_of_rust_non_object.py(15) all pass.