Skip to content

Fix two missing parents and check the DAG against feature sets - #162

Open
haampie wants to merge 3 commits into
archspec:masterfrom
haampie:fix/feature-dag-consistency
Open

Fix two missing parents and check the DAG against feature sets#162
haampie wants to merge 3 commits into
archspec:masterfrom
haampie:fix/feature-dag-consistency

Conversation

@haampie

@haampie haampie commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

This is Claude fixing two issues I've found. Let me know if you're interested in the test.


Each microarchitecture names a feature set, so feature inclusion defines a partial order of its own. Comparing it against the explicit from DAG (with feature_aliases applied) shows the two agree everywhere except for deliberate design choices — cross-vendor portability goes through the generic levels only — and two omissions:

  • ampere1a: has every feature of ampere1 plus sm3/sm4, but both chips listed the same parents (neoverse_n1, armv8.6a). So archspec concluded an ampere1 binary cannot run on an AmpereOneA machine. Now ampere1a descends from ampere1, like other same-vendor successors (zen2 from zen, m4 from m3).
  • cannonlake: its feature list fully covers x86_64_v4 (AVX-512 F/CD/VL/BW/DQ), but its only parent was skylake, so x86_64-v4 binaries were considered incompatible with Cannon Lake machines. Now it also descends from x86_64_v4, like skylake_avx512 does.

The last commit adds tests/check_dag_consistency.py to the validation workflow. It checks both directions: a descendant must have all features of its ancestors (up to feature_aliases), and within a family a strict feature superset must descend from the subset when the two share a vendor or the subset is a generic level. It would have caught both omissions above, and passes after them.

The full archspec test suite (638 tests) passes against the updated JSON.

Found while comparing the feature-derived partial order with the DAG for spack/spack#52856.

AmpereOneA has every feature of AmpereOne plus sm3/sm4, but both listed
the same parents (neoverse_n1, armv8.6a), so archspec concluded an
ampere1 binary cannot run on an ampere1a machine. List ampere1 as a
parent, like other same-vendor successors (zen2 from zen, m4 from m3).

Signed-off-by: Harmen Stoppels <harmenstoppels@gmail.com>
Cannon Lake supports AVX-512 F/CD/VL/BW/DQ, so its feature list already
covers all of x86_64_v4, but its only parent was skylake and archspec
concluded an x86_64_v4 binary cannot run on a cannonlake machine. List
x86_64_v4 as a parent, like skylake_avx512 does.

Signed-off-by: Harmen Stoppels <harmenstoppels@gmail.com>
Feature inclusion defines a partial order of its own, and the explicit
from DAG must agree with it: a descendant must have all features of its
ancestors, and within a family a strict feature superset must descend
from the subset when the two share a vendor or the subset is a generic
level. Cross-vendor lineage is intentionally not required, since
portability between vendors is expressed through the generic levels.

This check would have caught the ampere1a and cannonlake omissions
fixed in the previous commits.

Signed-off-by: Harmen Stoppels <harmenstoppels@gmail.com>
@alalazo
alalazo force-pushed the fix/feature-dag-consistency branch from 26f125d to 377bf74 Compare August 19, 2026 12:00

@alalazo alalazo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we split the new check from the fixes? I think the fixes are correct, modulo removing a now redundant edge.

The script probably needs some more discussion:

  • It "correctly" flagged neoverse_n2 -> neoverse_v3 (in the sense that code tuned for N2 can actually run on V3)
  • It didn't flag neoverse_n2 <-> neoverse_v2

Iirc we decided to leave the nx and the vx branches separate from each other on purpose. Modeling things correctly would remove acyclicity of the uarch graph, which I think deserves its own PR to discuss.

@@ -0,0 +1,96 @@
#!/usr/bin/env python3
# Copyright 2019-2020 Lawrence Livermore National Security, LLC and other

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

2019-2020 ?

"from": [
"neoverse_n1",
"ampere1",
"armv8.6a"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
"armv8.6a"

@alalazo alalazo self-assigned this Aug 19, 2026
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