[libc] Implement getpriority, setpriority, their unit tests; add the accompanying macros and type headers. (#219573)
Testing these is a bit tricky, so:
- For `getpriority`, ensure the call succeeds and round-trip the highest nice
value on Linux (19).
- For `setpriority`, ensure the call succeeds when setting it to the current nice.
- For both, test two failure modes that are easy to stably induce.
[clang][docs] Fix Sphinx 8.2 and MyST build errors in Clang docs (#220108)
Commit 66617db9163d bumped Sphinx to 8.2, Docutils to 0.22, and
MyST-Parser to 4.0.1.
When building Clang documentation with `-W`, this surfaced two
breakages:
1. `ControlFlowIntegrityDesign.md`: Dangling `[^ivtbl]` footnote
references without a matching footnote definition, leading to a docutils
`ERROR: Too many autonumbered footnote references: only 0 corresponding
footnote available` / `ERROR: Unknown target name: "ivtbl"`.
2. `ScalableStaticAnalysis/developer-docs/index.md`: `:numbered: true`
caused a `ValueError: invalid literal for int() with base 10: 'true'` in
MyST because `:numbered:` takes an integer depth or no argument. Fix it
to `:numbered:`.
AI tool usage: An AI assistant was used to help research and draft the
documentation updates.
NAS-142020 / 27.0.0-BETA.1 / Bound failover.call_remote timeouts in the login and alert paths (by creatorcary) (#19572)
`auth.login_ex()` checks the peer controller's HA status before
authenticating on a BACKUP node, but passes only `connect_timeout` to
`failover.call_remote`. That option bounds the wait for the websocket to
exist, not the RPC itself, so the call timeout falls back to
`CALL_TIMEOUT`, which is 60 seconds.
The peer is normally rebooted during a failover, which leaves the
interconnect socket half-open: `RemoteClient.connected` is still set,
because `connect_and_wait()` only clears it once `c._closed` fires and
that waits on the TCP window to elapse. `connected.wait(2)` therefore
returns immediately and the RPC blocks for the full 60 seconds before
raising `ETIMEDOUT`. `login_ex()` already catches that and falls
through, so the login does succeed, just a minute late and after logging
an ERROR traceback.
Passing `timeout` bounds the RPC at 2 seconds, and `raise_connect_error:
False` makes `call_remote` return `None` for an expected network failure
[16 lines not shown]
[mlir] Migrate AMDGPU/ROCDL to targets, not chipset versions
**migration tl;dr:** `chipset=` becomes `triple=`, migrate off of
`amdgpu::Chipset` to `ROCDL::TargetInfo`, and eventually change
`gfxXYZ` to `amdgpuX.YZ-amd-amdhsa` in that `triple` argument.
`amdgpu::Chipset` was an awkward hack that was hard to keep up to date
with changes in the compiler/new architectures, and didn't properly
support generic targets (and has been strongly disfavored by the
compiler team).
This PR replaces `amdgpu::Chipset` with `ROCDL::TargetInfo`, a
structure that uses LLVM's TargetParser and the underlying LLVM
features tables to get the real nature of the target being compiled
for.
This also helps MLIR move to
new-style (`-mtriple=amdgpuX.YZ-amd-amdhsa`) over "old
style" (`-mtriple=amdgcn-amd-amdhsa -mcpu=gfxXYZ`) triples.
[40 lines not shown]
[mlir][AMDGPU][NFC] Pre-commit tests for incorrect version checks
There'll be a refactoring from `amdgpu::Chipset` to
`ROCDL::TargetInfo`, thus also moving from chip version checks to
features checks. This commit adds tests for incorrect lowerings that
were allowed by the current code.
- gfx90c is >= gfx90a but stil needs atomic emulation (it doesn't
have buffer fmax and so on).
- gfx90c is also >= gfx90a but has no barrier back-off, so it needs
the inline asm workaround around `s_barrier` that it isn't getting
- gfx908 doesn't have a packed fp16 atomic add but we thought it did
- gfx950 is mistakenly allowing xf32 MFMAs
- gfx1200 is allowing permlane_swap instructions that it doesn't have
- gfx11.7 should be allowing OCP FP8 conversions but isn't on the list
This also cleans up some redundant tests with a --check-prefixes
AI disclosure: Claude found these and wrote the tests.
[2 lines not shown]
x11/colormeter: Add new port
X11 pixel magnifier with live RGB readout from FrauBSD. Ctrl+L locks
the sample; Button1 drag moves the window. Installs colormeter(1).
Reviewed by: jrm
Differential Revision: https://reviews.freebsd.org/D58429
[AMDGPU] Expose buffer resource num_records width in TargetParser
This also fixes the conflict in gfx12.
Co-Authored-By: Claude Opus 5 (1M context) <noreply at anthropic.com>
[AMDGPU] Sort frontend-visible feature, add feature-name parsing
Emit `AMDGPUFrontendVisibleFeatures` sorted by name so it can be
binary-searched.
Also add an API for mapping feature name(s) to updates to a feature
bitmap, allowing frontends (MLIR in particular) to parse a
`-mattr`-like string.
AI disclosure; Claude wrote this code.
Co-Authored-By: Claude Opus 5 (1M context) <noreply at anthropic.com>
NAS-142020 / 26.0.0-RC.1 / Bound failover.call_remote timeouts in the login and alert paths (#19571)
`auth.login_ex()` checks the peer controller's HA status before
authenticating on a BACKUP node, but passes only `connect_timeout` to
`failover.call_remote`. That option bounds the wait for the websocket to
exist, not the RPC itself, so the call timeout falls back to
`CALL_TIMEOUT`, which is 60 seconds.
The peer is normally rebooted during a failover, which leaves the
interconnect socket half-open: `RemoteClient.connected` is still set,
because `connect_and_wait()` only clears it once `c._closed` fires and
that waits on the TCP window to elapse. `connected.wait(2)` therefore
returns immediately and the RPC blocks for the full 60 seconds before
raising `ETIMEDOUT`. `login_ex()` already catches that and falls
through, so the login does succeed, just a minute late and after logging
an ERROR traceback.
Passing `timeout` bounds the RPC at 2 seconds, and `raise_connect_error:
False` makes `call_remote` return `None` for an expected network failure
[9 lines not shown]
[Clang] Enable UBSan for AMDGPU device offload
Summary:
This enables the device UBSan runtime for AMDGPU decides. Primarily this
required modifications to the `addSanitizerRuntime` interface so we can
query the compilation's offload status. Also need to forward it through
the linker wrapper interface. Works on all AMDGPU offload, slight hacks
around the other targets as they do not advertise sanitizer
runtimes properly.
This is linked in via a new `-u __ubsan_device_initialize` hook to pull
in the side library. This is standard behavior and keeps the core logic
mostly unchanged and re-used.
[compiler-rt] Rename ubsan_device to ubsan_offload
The host interceptor and GPU handler library serve offload, not a
generic device sanitizer. Keep the Apple add_ubsan_device_testsuite name.
LinuxKPI: 802.11: implement cfg80211_calculate_bitrate()
lkpi_cfg80211_calculate_bitrate_vht() was constantly showing up
in my debug traces as a TODO with rtw89 so I went ahead and implemented
the HT and VHT versions. Realtek seems to limit amsdu sizes based
on the value and ask for it whether needed or not.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
[libc][Github] Switch to new runner set (#219754)
This moves some of the more expensive libc jobs over the new LLVM
premerge runner sets that allow dynamically setting the container. This
should make them significantly faster for cold builds (e.g., new PR
given cache sharing across PRs is not a thing).
There was an issue with this approach originally that meant jobs would
sometimes get spuriously killed but appear to succeed. That should be
mitigated with some ConfigMap updates that we deployed to the cluster,
but we should be on the lookout for any oddness happening with these
jobs.
This should also take some load off the free GitHub runners where
someone opening a bunch of libc PRs in the past has consumed all the
free GitHub resources leading to long delays for other jobs.
[mlir] introduce cf.assume
Introduce an "assumption" operation that optimizers can use to assume a boolean
value is true. This is complementary to `cf.assert` but does involve the
runtime abort.
Exercise this by lowering to the LLVM dialect counterpart.
[SLP]Vectorize unique scalars of splat gather nodes as separate subtrees
A splat gather (the same instruction in every lane) is emitted as an
expensive insertion sequence. When the unique scalars of several splat
gathers form a vectorizable bundle, build them as a separate subtree and
emit the splat gathers as broadcasts of the vectorized value.
Reviewers: bababuck, RKSimon
Pull Request: https://github.com/llvm/llvm-project/pull/218250
[mlir] Migrate AMDGPU/ROCDL to targets, not chipset versions
**migration tl;dr:** `chipset=` becomes `triple=`, migrate off of
`amdgpu::Chipset` to `ROCDL::TargetInfo`, and eventually change
`gfxXYZ` to `amdgpuX.YZ-amd-amdhsa` in that `triple` argument.
`amdgpu::Chipset` was an awkward hack that was hard to keep up to date
with changes in the compiler/new architectures, and didn't properly
support generic targets (and has been strongly disfavored by the
compiler team).
This PR replaces `amdgpu::Chipset` with `ROCDL::TargetInfo`, a
structure that uses LLVM's TargetParser and the underlying LLVM
features tables to get the real nature of the target being compiled
for.
This also helps MLIR move to
new-style (`-mtriple=amdgpuX.YZ-amd-amdhsa`) over "old
style" (`-mtriple=amdgcn-amd-amdhsa -mcpu=gfxXYZ`) triples.
[40 lines not shown]
[docs] Upgrade Sphinx and extension dependencies (#219299)
sphinx, furo, myst-parser, sphinx-automodapi, sphinxcontrib-applehelp,
sphinx-reredirects, and docutils were all pinned to 2023/2024-era
releases. Bump requirements.txt.in to current versions and regenerate
requirements.txt (pip-compile --generate-hashes --upgrade), which also
picks up newer transitive pins (certifi, requests, urllib3, jinja2,
etc).
Verified `sphinx-build -b html` completes with zero warnings across all
doc sources under the new versions.
Co-authored-by: Claude Sonnet 5 <noreply at anthropic.com>
[libc++] Enable _LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION for Bionic (#218055)
As mentioned in the comment, pthread_mutex_destory is a nop for regular
mutexes for Bionic, like glibc. We can enable
_LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION for Bionic causing std::mutex to
have trivial destructors. This change prevents compilers from
registering exit-time destructors for global/static mutexes exit-time
crashes and silencing warnings under -Wexit-time-destructors.
Fixes: https://github.com/android/ndk/issues/1261