3.13.3.3#208
Merged
Merged
Conversation
ARM nodes that do not expose sub-revision-specific flags (e.g. SSBS,
EVTSTRM, LRCPC, DCPOP, ASIMDDP) were incorrectly reported as UNKNOWN
instead of ARMv8. The must_arm_v8 list was over-specified: it required
flags that are optional or were introduced in ARMv8.2–8.5 sub-revisions
and may be absent on fully conforming ARMv8-A hardware.
The ARMv8 check is now restricted to the two mandatory ARMv8-A baseline
flags: FP and ASIMD. All other feature flags are optional extensions and
are not required for classification.
The script has also been refactored to meet project coding standards:
- Global mutable flag lists replaced with FlagSpec / X86FlagSpecs
dataclasses returned by factory functions (build_x86_specs,
build_x86naive_specs, build_arm_spec), eliminating all global
statements
- Full type hints and Google-style docstrings on all functions
- Passes flake8, pylint (10/10), pyright, and pydocstyle --convention=google
- open() calls use encoding="utf-8"; subprocess.run uses check=False
explicitly; logging uses %s formatting throughout
- Entry point wrapped in main()
The CLI interface is unchanged except that --alg choices are renamed
from {naive,gcc} to {x86naive,x86} to better reflect their meaning.
The default algorithm (x86, formerly naive... wait, formerly gcc in the
internal call) is preserved.
Fixes ARM jobs reported as UNKNOWN in cpu_architecture_level field.
See: https://its.cern.ch/jira/browse/ATLINFR-4844
Activate internal cpu_arch.py fallback in get_cpu_arch()
The fallback call to get_cpu_arch_internal() was present but commented
out. It is now active: if the experiment plugin returns an empty string
(e.g. because the CVMFS call failed), the pilot will invoke the bundled
pilot/scripts/cpu_arch.py directly rather than silently returning no
architecture.
Also removes --alg gcc from the get_cpu_arch_internal() invocation; the
renamed flag (now --alg x86) is the default and need not be passed
explicitly.
Treat UNKNOWN return from CVMFS cpu_arch.py as a fallback trigger
If the CVMFS script runs successfully but returns "UNKNOWN", the result
is now reset to an empty string so that the fallback chain in
workernode.get_cpu_arch() proceeds to get_cpu_arch_internal(). Previously
UNKNOWN was returned as-is, bypassing the internal fallback entirely.
… in get_cpu_arch_internal()
Three bugs in get_cpu_arch_internal(): os.environ['PYTHONPATH'] raises KeyError on any site where PYTHONPATH is not set; os.environ.get('PYTHONPATH') + ':' + script_dir raises TypeError when the same variable is unset (returns None); stdout assigned unstripped, propagating a trailing newline into cpu_architecture_level. Fix by reading PYTHONPATH once with a default of '', and calling .strip() on stdout.
test_cpu_arch.py: add unit tests for cpu_arch.py classification logic
26 tests across four classes covering check_flags(), x86_checks() with both the GCC and naive specs across all four tiers using representative real-world flag strings (Skylake-X, Haswell, Sandy Bridge), arm_checks() for ARMv8 pass and all failure modes, and spec builder smoke tests including the structural invariant that v2 ⊆ v3 ⊆ v4 in the GCC spec. No /proc/cpuinfo or uname dependency.
There was a problem hiding this comment.
Pull request overview
Updates Pilot 3’s CPU architecture reporting to handle cases where the experiment plugin (e.g., CVMFS cpu_arch.py) returns UNKNOWN, by allowing an internal fallback to the bundled pilot/scripts/cpu_arch.py. This also modernizes/refactors the internal cpu_arch.py implementation and adds unit tests to validate the classification logic.
Changes:
- Add internal fallback execution path when the user plugin reports no CPU architecture (including mapping
UNKNOWN→ empty string in the ATLAS plugin). - Refactor
pilot/scripts/cpu_arch.pyinto a more structured, testable implementation (x86-64 tiers + ARMv8 detection). - Add a dedicated unit test module for the CPU architecture classifier and bump version metadata.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
PILOTVERSION |
Bumps the pilot version to 3.13.3.3. |
pilot/util/workernode.py |
Adds internal fallback invocation when plugin returns empty; improves PYTHONPATH handling and output trimming. |
pilot/util/constants.py |
Updates REVISION to align with the new release version. |
pilot/user/atlas/utilities.py |
Treats CVMFS-reported UNKNOWN as empty to trigger internal fallback at the pilot level. |
pilot/test/test_cpu_arch.py |
Adds unit tests for x86/ARM flag classification and spec builders. |
pilot/scripts/cpu_arch.py |
Major refactor: dataclasses/specs, x86/ARM classification, argument parsing, and improved error handling. |
.pylintrc |
Comments out suggestion-mode setting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Claude was used to document and improve the pilot code in this version. Copilot was used for code review.