[mlir][x86] Fix AMX loop carried accumulation (#231170)
Fixes the AMX contraction lowering of reduction loops whose accumulators
are carried in by an enclosing loop.
The values accumulated by the enclosing loop were dropped and replaced
with the initial accumulator, which produced wrong results.
Assisted-by: Claude
[clang][Serialization] Make directory dependencies absolute when read (#231319)
Directory dependencies under a module's base directory are stored
relative to it, and the reader's base directory isn't always absolute:
with relocation checks enabled it is taken from where header search
found the module, which is relative through a relative search path, and
with -fmodule-file-home-is-cwd there is none. These directories were
then read back relative, so `directory-deps` reported them relative and
they never matched the absolute paths a build system reports as
invalidated.
Canonicalize them when reading the same way they are when recorded.
Assisted-by: Claude Code: opus-5.5
games/openbve: update OpenBVE port to version 1.14.1.2
Garbage-collect no longer useful .Net version patching
for compatibility with deprecated Mono 5.10. Upstream
solution was updated as a whole to require .Net 4.8 in
version 1.14.0.2 onwards, which works fine against our
default Mono 5.20.
Reported by: portscout
PR bin/60496 - fix printf(3) with non-single-byte decimal point & thousands sep
These fixes are relatively simple, and should be safe -- I have had them
in my source tree for ages now.
The fix for the decimal point case is taken more or less directly from
an old FreeBSD fix for the same issue.
The thousands separator case is different - our code and FreeBSD's have
diverged so much in this area that simply using their method would have
been more trouble than it was worth, so I reimplemented it differently
to better fit our code model.
There are ATF tests that go with this, which will be committed one day,
but have been waiting on strfmon(3) fixes, which are related. I decided
these code changes should wait no longer. The tests will come later.
XXX pullup -11 -10
[RISCV][GlobalISel] Mark manually selected FP comparisons as nofpexcept (#231360)
Like AArch64 (https://reviews.llvm.org/D115352), set `NoFPExcept` on the
FP compares built manually in `selectFPCompare`, matching what the
generated selector does for non-strict operations. This lets MachineCSE
combine identical compares.
This is safe because `selectFPCompare` only handles non-strict `G_FCMP`,
constrained comparison uses `G_STRICT_FCMP/G_STRICT_FCMPS`.
ufs: do not let a rolled back inode write end a data-only sync
With soft updates, ffs_syncvnode() writes the inode between its passes
while buffers are still dirty. That write can go out with new block
pointers rolled back, for instance a new indirect block whose contents
are only written in a later pass, yet ffs_update() clears IN_SIZEMOD
and IN_IBLKDATA because the write was synchronous. A data-only sync
then decides at the end that the inode need not be written, and
fdatasync(2) or an O_DSYNC write that allocated the first indirect
block returned with the on-disk inode not pointing to it.
Note on entry whether a data-only sync has to write the inode, and base
the final write, done once all dependencies are flushed, on that alone:
nothing else can set IN_SIZEMOD or IN_IBLKDATA meanwhile, as the vnode
is locked. A full sync always writes the inode last and was not
affected.
Sponsored by: Sippy Software, Inc.
Reviewed by: kib
[3 lines not shown]
tests: add UFS synchronous write durability tests
Check that once fsync(2), fdatasync(2), or a write(2) with O_SYNC or
O_DSYNC returns, the new data, the file size and every block pointer
leading to the data are on disk. The cases append a block, fill a hole,
append the first block that needs an indirect block and append below an
existing indirect block. Two more append after another write left a
new direct block unsynced, which with soft updates cuts the size and the
later pointers of an inode written meanwhile. With O_SYNC and O_DSYNC
on soft updates, those also check that the open already made the
unsynced block durable.
Each case runs on UFS without soft updates, with soft updates and with
SU+J.
The file systems live on md(4) and the checks read the inode, the
indirect block and the data block straight from the device with libufs
right after the synchronous call returns. There is no cache in front
of the disk device, so this shows what would survive a crash at that
moment without having to crash anything.
[6 lines not shown]
ufs: make fdatasync(2) and O_DSYNC writes update the inode
ffs_syncvnode() in the DATA_ONLY case and ffs_write() for IO_DATASYNC
decide whether the inode has to be written by testing IN_SIZEMOD and
IN_IBLKDATA against ip->i_flags, the chflags(2) word, instead of the
in-core state ip->i_flag. IN_SIZEMOD and IN_IBLKDATA alias UF_READONLY
and UF_ARCHIVE, so for ordinary files the test was always false: after
an fdatasync() or an O_DSYNC write that extended a file or filled a
hole, the data blocks were on disk but the inode size and block pointers
were not, and a crash before the syncer got to the inode lost the
"synced" data. Files with uarchive or urdonly set got a synchronous
inode write on every call instead.
journal_mount() has the same mixup and sets IN_MODIFIED in i_flags,
which leaves UF_OPAQUE set on the in-core .sujournal inode. The
synchronous ffs_update() that follows writes the inode regardless, so
only the stray flag is fixed here.
Fixes: 7428630b757 ("UFS: write inode block for fdatasync(2) if pointers in inode where allocated")
[9 lines not shown]
ufs: flush soft updates dependencies for O_SYNC and O_DSYNC writes
For a synchronous write, ffs_write() writes the data buffers with
bwrite() and then the inode with ffs_update(vp, 1). With soft updates,
a new block pointer can only reach the disk after the dependencies of
the block, such as the cylinder group map that allocates it, are
written. Until then initiate_write_inodeblock_ufs[12]() and
initiate_write_indirdep() roll the pointer, and for an extending write
the size, back in the buffer being written. Nothing in the write path
flushes those dependencies, so the inode went out with the old size and
pointers, ffs_update() cleared IN_SIZEMOD and IN_IBLKDATA, and a crash
before the syncer rewrote the inode lost data that O_SYNC or O_DSYNC
promised was on stable storage. The same held for a new block below an
indirect block, which ffs_balloc() writes synchronously but with the
pointer rolled back.
When soft updates are enabled and the write allocated blocks, finish it
with ffs_syncvnode(), as fsync(2) and fdatasync(2) do: it flushes the
dependencies, rewrites the rolled back indirect blocks and writes the
[30 lines not shown]
ufs: make fdatasync(2) write dirty indirect blocks
A data-only ffs_syncvnode() skips dirty indirect blocks on file systems
without soft updates, and with soft updates stops making passes once
only indirect blocks are left dirty. Indirect blocks only get dirty
when the block pointers in them change, and those pointers are what
makes a newly allocated block reachable. So when fdatasync() follows
a write that extended the file or filled a hole past the direct blocks,
the data and the inode size reached the disk but the pointer to the new
block did not, and a crash lost the "synced" data. With soft updates
the indirect block was usually written once, with the new pointer
rolled back, and never rewritten.
POSIX requires fdatasync() to write the metadata needed to retrieve the
data, which 52488b51489 already acknowledged for the inode, so treat
dirty indirect blocks the same way for a data-only sync as for a full
one. This restores the loop to what it was before 2f514f92cf0. Plain
overwrites, the case data-only sync is meant to speed up, do not dirty
indirect blocks and still write neither them nor the inode.
[8 lines not shown]
lang/babashka: Update to 1.13.226
Changes since 1.13.225:
1.13.226 (2026-10-11)
* Fix clojure.lang.RT/baseLoader and the context classloader
returning nil in nREPL sessions
* Bump jline to 4.4.7
* Support the [opts stream] arity of read+string
* Add the CIDER debugger to the nREPL server: #dbg, #break,
C-u C-M-x and the step commands
* Add CIDER's track-state to the nREPL server: font-lock of loaded
vars and the box around instrumented functions
* Fix the cider-nrepl version mismatch warning on cider-connect-clj
* Allow constructing ThreadDeath
* SCI: a macro var in call position expands, as in
(eval (list #'when true 1))
* SCI: fix stack overflow in clojure.walk/macroexpand-all on a reify
[16 lines not shown]
stress2: add a test for forced unmount racing mkdir at UFS_LINK_MAX
On a soft updates file system, keep a directory at UFS_LINK_MAX with
workers removing and recreating subdirectories in it, so that mkdir(2)
keeps going through ufs_sync_nlink(), and force-unmount, check and
remount the file system in a loop. The workers work relative to the
directory: a lookup through the mount point would wait for the unmount
on the covered vnode lock and never race with it. Before the fix, the
first forced unmount deadlocked with mkdir(2) sleeping in vfs_busy().
With dtrace=1, count the vfs_busy() calls made during an unmount by
caller, and the mkdir(2) calls that synced and restarted with ERELOOKUP
during an unmount, which shows that the race was hit.
Sponsored by: Sippy Software, Inc.
Reviewed by: pho
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D60204
MFC after: 1 month
ufs: do not busy or reference the mount in ufs_sync_nlink()
With soft updates, mkdir(2), link(2) and rename(2) into a directory
whose i_nlink is at UFS_LINK_MAX while i_effnlink is below it call
ufs_sync_nlink1() to sync the file system and restart. It busied the
mount with vfs_busy(mp, 0), which sleeps for as long as an unmount is in
progress. The caller is still between vn_start_write() and
vn_finished_write() there, and the unmount, once it has set
MNTK_UNMOUNT, goes on to suspend writes in VFS_UNMOUNT() and waits in
vfs_write_suspend() for that write to end. Neither could make progress,
and every later vfs_busy() of the mount, such as from getfsstat(2) or a
lookup crossing the mount point, hung behind them.
The window is wide: after setting MNTK_UNMOUNT, the unmount waits for
the busy references to drain, which includes another thread already
syncing in ufs_sync_nlink1(), and for vfs_periodic(). A forced unmount
of a file system with a directory at the link limit under mkdir/rmdir
load hits it within seconds.
[19 lines not shown]
set ifp->if_link_state to LINK_STATE_DOWN in attach.
aq doesn't complete packet transmission if the link is down, so
aq_start uses LINK_STATE_IS_UP(ifp->if_link_state) to decide if it
should drop the queued packets or actually put them on the ring.
however, LINK_STATE_IS_UP() returns true if the link state is
LINK_STATE_UNKNOWN, which is the default value for the link state
in struct ifnet (because it's 0). this means if aq(4) is booted
without being plugged into the network, the link state handler
doesnt run and change the state to UP or DOWN, which leaves it
UNKNOWN. that's enough to confuse aq_start though.
defaulting the state to down properly represents the state of the
link, which in turn makes aq_start do the right thing with the
packets. if the network is plugged in on boot, the phy layer notices
and moves it to UP as expected.
found by Paul de Weerd on bugs@
[2 lines not shown]
[KnownFPClass] Teach KnownFPClass that tanh(non-positive) = non-positive (#229752)
tanh is sign-preserving, so if the source is known to never be a
non-zero positive value (pinf, psub, pnorm), the result can never be a
positive subnormal or normal either. Zero is intentionally not ruled
out: tanh(+-0.0) = +-0.0, and a flushed subnormal may become +0.0 under
the positive-zero denormal modes.
Add Attributor tests for the new deduction, for the cases where it must
not fire (+inf, positive normal or positive subnormal still possible),
and for the dynamic and positive-zero denormal modes. Update the
existing tanh tests whose result is now stronger.
Fixes #229535
[llvm-objcopy] Stream ELF output to regular files
Write ELF output directly to seekable regular files instead of first allocating a buffer for the entire output. Keep buffered output for stdout and other non-seekable streams.
Use separate buffered and file-backed output implementations. Serialize regenerated metadata sequentially, seeking once per output range, and report sticky file errors after writing finishes. Truncate and extend seekable output up front so unwritten layout gaps read as zero without being materialized; explicitly overwrite only removed section contents within copied segments.
On a synthetic stamping-style ELF containing a 1 GiB payload, three warm-cache no-op copies had median peak RSS of 2,102,916 KiB before and 1,053,844 KiB after (49.9% lower). Median wall time improved from 1.06 s to 0.77 s, and the outputs were byte-identical.
Co-authored-by: Jeremy Braun <jtbraun at meta.com>
Co-authored-by: Fangrui Song <i at maskray.me>
Assisted-by: OpenAI Codex
[Support] Support seekable temporary output streams
Use raw_fd_stream for temporary outputs so callbacks can perform positioned writes and resize the destination. Add raw_fd_ostream::takeError and raw_fd_stream::resize, and return stream failures through Error while preserving an existing destination.
Co-authored-by: Jeremy Braun <jtbraun at meta.com>
Assisted-by: OpenAI Codex
[llvm-objcopy] Route section copies through writeSectionContents
Centralize section byte copies behind a virtual helper so ELF output can later target either a memory buffer or a seekable stream. Materialize SHT_SYMTAB_SHNDX entries using the target ELF word type to preserve output endianness.
Co-authored-by: Jeremy Braun <jtbraun at meta.com>
Assisted-by: OpenAI Codex