Skip to content

3.13.3.3#207

Merged
PalNilsson merged 3 commits into
PanDAWMS:nextfrom
PalNilsson:next
Jun 4, 2026
Merged

3.13.3.3#207
PalNilsson merged 3 commits into
PanDAWMS:nextfrom
PalNilsson:next

Conversation

@PalNilsson
Copy link
Copy Markdown
Collaborator

@PalNilsson PalNilsson commented Jun 4, 2026

  • CPU architecture UNKNOWN

Claude was used to document and improve the pilot code in this version. Copilot was used for code review.

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.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses cases where CPU architecture detection reports UNKNOWN by introducing a Pilot-side fallback to the bundled pilot/scripts/cpu_arch.py, and bumps the Pilot version to 3.13.3.2.

Changes:

  • Enable internal CPU-architecture fallback when the experiment plugin returns an empty value (and make ATLAS convert UNKNOWN to empty to trigger fallback).
  • Refactor pilot/scripts/cpu_arch.py to support x86-64 tier detection and ARMv8 detection with clearer structure and CLI options.
  • Bump Pilot version constants/files and adjust pylint configuration.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
PILOTVERSION Updates the published Pilot version to 3.13.3.2.
pilot/util/constants.py Updates REVISION/BUILD to match the new Pilot version.
pilot/util/workernode.py Enables internal fallback when plugin CPU-arch detection returns empty; adjusts internal script invocation.
pilot/user/atlas/utilities.py Treats CVMFS cpu_arch.py returning UNKNOWN as “no result” to trigger Pilot fallback.
pilot/scripts/cpu_arch.py Major refactor of CPU arch detection logic and CLI, adding ARM handling and improving structure.
.pylintrc Comments out suggestion-mode setting.
Comments suppressed due to low confidence (1)

pilot/util/workernode.py:203

  • get_cpu_arch() now calls get_cpu_arch_internal() as a fallback, but get_cpu_arch_internal() can currently crash when PYTHONPATH is unset (os.environ['PYTHONPATH'] KeyError / None + ':' TypeError). Also, the successful stdout from cpu_arch.py likely includes a trailing newline; returning it unstripped can propagate newline characters into cpu_architecture_level.
    ec, stdout, stderr = execute(f'python3 {script_dir}/{script}')
    if ec or stderr:
        logger.debug(f'ec={ec}, stdout={stdout}, stderr={stderr}')
    else:
        cpu_arch = stdout

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pilot/scripts/cpu_arch.py
… 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.
@PalNilsson PalNilsson changed the title 3.13.3.2 3.13.3.3 Jun 4, 2026
@PalNilsson PalNilsson merged commit b0b6718 into PanDAWMS:next Jun 4, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants