Skip to content

uucore: parse PMULL hardware capability correctly - #16435

Open
AFaria20s wants to merge 1 commit into
uutils:mainfrom
AFaria20s:uucore/fix-pmull-hwcap-parsing
Open

AFaria20s wants to merge 1 commit into
uutils:mainfrom
AFaria20s:uucore/fix-pmull-hwcap-parsing

Conversation

@AFaria20s

@AFaria20s AFaria20s commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Correct the hardware capability mapping for PMULL and accept the full PCLMULQDQ name.

Add a regression test for both capability names.

The aliasing of -PMULL onto Pclmulqdq is gone too. The AVX requirement in #16900 covers that assertion in tests/cksum/cksum.

Closes #16434

Copilot AI balanced review requested due to automatic review settings November 13, 2026 21:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/cksum/cksum. tests/cksum/cksum is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/env/env is no longer failing!

@codspeed

codspeed Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will degrade performance by 49.84%

1 warning, 1 note

⚠️ 121 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

ℹ️ 1 benchmark has no flamegraph

The flamegraph wasn't generated: most of the time was spent in runtime internals, which would leave nothing useful to analyze.

See affected benchmarks

❌ 1 regressed benchmark
✅ 414 untouched benchmarks
⏩ 70 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Memory timeout_enforced 88.8 KB 177 KB -49.84%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing AFaria20s:uucore/fix-pmull-hwcap-parsing (31d197c) with main (ab69b86)

Open in CodSpeed

Footnotes

  1. 70 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Comment thread src/uucore/src/lib/features/hardware.rs Resolved
@AFaria20s

Copy link
Copy Markdown
Contributor Author

/rerun

@AFaria20s
AFaria20s requested a review from xtqqczze November 19, 2026 15:41
Comment thread src/uu/cksum/src/cksum.rs Resolved
@sylvestre
sylvestre force-pushed the uucore/fix-pmull-hwcap-parsing branch 2 times, most recently from e28e9d1 to 6152c9e Compare November 21, 2026 17:27
@AFaria20s
AFaria20s force-pushed the uucore/fix-pmull-hwcap-parsing branch from 6152c9e to ebd181d Compare November 27, 2026 09:53
@AFaria20s

Copy link
Copy Markdown
Contributor Author

Split the AVX requirement out of this PR into a separate, independent change.

This PR now only contains the PMULL hardware capability parsing fix and its test; the AVX detection change lives in the follow-up PR.

@AFaria20s
AFaria20s force-pushed the uucore/fix-pmull-hwcap-parsing branch from ebd181d to 1f5e315 Compare November 27, 2026 11:15
Comment thread src/uucore/src/lib/features/hardware.rs Resolved
@sylvestre

Copy link
Copy Markdown
Contributor

thanks for looking into this!
The AVX/pclmul change in cksum --debug is a separate fix from the PMULL mapping, please move it to its own PR.

@AFaria20s
AFaria20s force-pushed the uucore/fix-pmull-hwcap-parsing branch from 1f5e315 to b441eaa Compare November 27, 2026 14:21
@AFaria20s

AFaria20s commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

@sylvestre The AVX part is already out, it's in #16900, and this PR now only touches the name table in hardware.rs.

The aliasing of -PMULL onto Pclmulqdq is gone too. It only worked as a stand-in for the AVX requirement, since -AVX doesn't stop the pclmul path until #16900 lands, and it diverged from GNU, which treats pmull and pclmul as separate hwcaps.

Confirmed locally: glibc.cpu.hwcaps=-AVX512F,-AVX2,-AVX,-PMULL still prints "using pclmul". #16900 doesn't depend on this PR, so it can land first and keep tests/cksum/cksum green throughout.

@xtqqczze

Copy link
Copy Markdown
Collaborator

We should be careful not to over-index on matching GNU debug output, debug output should reflect our actual implementation.

@sylvestre
sylvestre force-pushed the uucore/fix-pmull-hwcap-parsing branch from b441eaa to 31d197c Compare November 27, 2026 18:26
PMULL was mapped onto Pclmulqdq, so the aarch64-only name disabled the
x86 PCLMULQDQ feature, and PCLMULQDQ itself was not recognized at all.
Map PCLMUL/PCLMULQDQ to Pclmulqdq and PMULL/VMULL to Pmull to match
GNU, and drop the resolved TODO.

Add a regression test covering both capability names.
@sylvestre
sylvestre force-pushed the uucore/fix-pmull-hwcap-parsing branch from 31d197c to 8088ea1 Compare November 27, 2026 22:27

This branch has not been deployed

No deployments
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.

uucore: parse PMULL hardware capability correctly

4 participants