Repository navigation
Tests compile numba kernels for a generic CPU - #137
Merged
Merged
Conversation
…sim games Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SACGSprm9GiBueqKdxsy2j
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The environment is configured early enough for test collection and is scoped to pytest execution.
Review effort: Balanced
Findings: None
What changed in this PR
Configures test-time Numba kernels to target a generic CPU, reducing machine-dependent rsim test drift.
Changes:
- Sets
NUMBA_CPU_NAME=genericbefore Numba imports. - Preserves explicit environment overrides and propagates the setting to workers.
| File | Description |
|---|---|
conftest.py |
Establishes the generic Numba CPU target for tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
The planner's numba kernels are compiled with fastmath for the host CPU, so an rsim game played on CI's CPU drifts from the same game played locally, and a test asserting how a game unfolds can pass locally and fail on CI (as
test_restart_fuzzer's rsim test did). The rootconftest.pynow setsNUMBA_CPU_NAME=generic(if unset) before numba is imported, so tests on every x86 machine run the same kernel code; rsim worker processes inherit it. Tests only: tournaments and the bench still compile for the host.Cost: none measurable. Full suite locally 101 s (was ~97 s); on CI 110 s (recent runs 114-115 s). It removes the main CPU difference, not all of them (numpy and libm also pick CPU-specific code paths), so whether CI-only rsim failures stop shows over the coming weeks, not in one run.
🤖 Generated with Claude Code
https://claude.ai/code/session_01SACGSprm9GiBueqKdxsy2j