Skip to content

feat: Improve __archspec handling in pixi#6533

Open
hunger wants to merge 3 commits into
prefix-dev:mainfrom
hunger:push-nsztsmsztsmu
Open

feat: Improve __archspec handling in pixi#6533
hunger wants to merge 3 commits into
prefix-dev:mainfrom
hunger:push-nsztsmsztsmu

Conversation

@hunger

@hunger hunger commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Description

!!! This needs change in rattler before it can land!!! conda/rattler#2558

Improve how __archspec matches are handled in pixi. USe proper DAG based matching over just comparing the version (which is defined to have a hard-coded value!).

This change does not do anything about resolving packages.

How Has This Been Tested?

I played with a couple of user projects I had around. I did validate that the data looks sane in all places it can show up.

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: Claude

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes.
  • I have verified that changes that would impact the JSON schema have been made in schema/model.py.

Both host-compatibility comparators (possible_pixi_platforms and
unsatisfied_virtual_packages) ignored build strings, so a declared
build-string requirement constrained nothing. Unify them on one shared
predicate: a non-empty required build string must be provided exactly.
__archspec is exempt for now; its microarchitecture names need DAG
compatibility rather than string equality, which lands separately.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@hunger

hunger commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

CI is read as this needs conda/rattler#2558

@baszalmstra

Copy link
Copy Markdown
Contributor

No special handling is needed now that conda-forge/microarch-level-feedstock#26 is merged !

hunger commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

We might want to do more than comparing the __archspec version number, considering that the version is defined as to be a constant in CEP. For pixi all __Archspecs are identical that way.

@baszalmstra

Copy link
Copy Markdown
Contributor

With the PR merged in microarch-level feedstock, the lockfile is now valid for multiple archspecs "automatically". It uses a regex that matches on all compatible archspec names. This means that if you lock "haswell" the environment will also be satisfiable on skylake automatically.

Because of that, we don't need to treat the inheritance of microarchitectures in any special way. It's captured by the requirements/constraints of the microarch-level packages.

hunger commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

I am aware of that. I still need to handle virtual packages in a couple of places that are not resolution. That needs a bit of support code.

hunger and others added 2 commits July 9, 2026 13:17
When pixi checks whether the current host can run a declared platform, a
host satisfies an __archspec requirement if its detected microarchitecture
implements the required baseline (the same node or a descendant in the
archspec DAG); the meaningless version constant is ignored. This replaces
the build-string exemption in the shared predicate used for rich-platform
selection and the conda-meta marker, and the minimal-required computation
now keeps every distinct required microarchitecture instead of discarding
build strings.

Lock-file validation continues to skip __archspec: the solver already
matches it through the DAG, so re-checking it here against the single
detected microarchitecture would reject hosts the solver accepted (a
skylake host running x86_64_v3 packages).

Unknown archspec names are rejected at manifest parse time, in raw
__archspec entries, and in 'pixi workspace platform --archspec', with a
did-you-mean hint for dashed spellings. Docs and schema examples used
dashed names, which are invalid in conda build strings; they now use the
canonical underscore names, and the rich-platform docs describe DAG
matching and the list-most-specific-first pattern.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds a microarch-v3 package (requiring __archspec ==1 x86_64_v3, like
conda-forge's microarchitecture metapackages) to the virtual_packages
test channel, and integration tests covering variant selection,
baseline fallback, install refusal with the exact override hint,
run-time refusal on a machine weaker than the environment was
installed for, and CLI rejection of unknown names. Also pins the
conda-meta/pixi marker round-trip with multiple __archspec entries.

Fixes CONDA_OVERRIDE_ARCHSPEC being ignored by host-platform
detection: apply_environment_variable_overrides handled cuda, linux,
osx and glibc but never archspec, so platform selection kept using the
real CPU even when the override was set.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@hunger hunger force-pushed the push-nsztsmsztsmu branch from f0f26c4 to cf831a7 Compare July 9, 2026 13:23
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.

2 participants