⬆️ Build on nightly-2026-11-03 with the parallel front end

The owner asked for a nightly toolchain with rustc's parallel front end on.
rust-toolchain.toml pins nightly-2026-11-03 (rustc 1.101.0-nightly 1c3a65069),
the one metal2vulkan's builds moved to the same day, so the host runs one
rustc, clippy and rustfmt for both. .cargo/config.toml turns on Cargo's
profile rustflags and gives dev and release `-Zthreads=0`, one front-end
thread per core; test, debugging and checked inherit it, and it adds to
RUSTFLAGS rather than giving way to it (checked with `cargo rustc -v`).

What the nightly asks of the tree, no behaviour changed:
- rustfmt now formats inside the death tests' macro bodies;
- `fetch_update` is deprecated as `try_update`, the same call;
- clippy's redundant-closure, needless-range-loop and NonZero-divisor
  lints;
- the fuzz harness declares `write` with C's types, which the new lint on
  runtime symbols checks;
- the three Vulkan tests that unwrap a command buffer take the library's
  recursion limit of 256: rustc now warns, as a coming hard error, that the
  Send and Sync walk of their result overflows the default 128.
This commit is contained in:
Anees Iqbal committed 2026-11-03 23:44:11 -08:00
1 parent 0e88fde0d9
commit afde7318d8
17 files changed
+113 -49

No files matched your search

+13
View File
@@ -8,3 +8,16 @@ xtask = "run --package xtask --"
# archive `cargo xtask dist` links whole (`ld -r -force_load`) registers jemalloc as the first
# malloc zone of every host that links it, ahead of the system's.
enable_zone_allocator = "no"
# rustc's parallel front end on every compile, with as many threads as the host has cores
# (`-Zthreads=0`), through Cargo's profile rustflags, which add to `RUSTFLAGS` rather than give way
# to it. `test`, `debugging` and `checked` inherit it from `dev` and `release`. The toolchain is
# nightly for this (rust-toolchain.toml).
[unstable]
profile-rustflags = true
[profile.dev]
rustflags = ["-Zthreads=0"]
[profile.release]
rustflags = ["-Zthreads=0"]
+2 -2
View File
@@ -247,8 +247,8 @@ the following.
- An Apple silicon Mac. Every Rust binary is arm64 (`aarch64-apple-darwin`): rustc's arm64e target
has no pointer authentication, and its binaries crash before `main` (`rust-toolchain.toml`).
- The toolchain `rust-toolchain.toml` pins: stable 1.98.1 with rustfmt and clippy. rustup installs
it on first use.
- The toolchain `rust-toolchain.toml` pins: nightly-2026-11-03 with rustfmt and clippy, for rustc's
parallel front end (`-Zthreads`, in `.cargo/config.toml`). rustup installs it on first use.
- `cargo-nextest`, which runs the tests in `cargo xtask check`
(`cargo install --locked cargo-nextest`).
- cbindgen 0.29.4, for `cargo xtask header` (`cargo install --locked cbindgen --version 0.29.4`).
+1 -1
View File
@@ -358,7 +358,7 @@ mod tests {
assert!(second_form_holds_every_id(0x4000));
assert!(!second_form_holds_every_id(0x1000));
assert_eq!(
(0x1000 / TABLE_ENTRY_SIZE) * (0x1000 / Form::First.size().get()),
(0x1000 / TABLE_ENTRY_SIZE) * (0x1000 / Form::First.size()),
MAPPING_ID_COUNT
);
}
+1 -2
View File
@@ -413,8 +413,7 @@ impl DirtyLog {
/// Ends one [`DirtyLog::close`].
pub fn reopen(&self) {
let _s = self.state.lock();
let _ =
(self.closed).fetch_update(Ordering::SeqCst, Ordering::SeqCst, |c| c.checked_sub(1));
let _ = (self.closed).try_update(Ordering::SeqCst, Ordering::SeqCst, |c| c.checked_sub(1));
}
/// Closes the log for good and drops the host's hook: once this returns, the hook is never
+44 -17
View File
@@ -1629,11 +1629,7 @@ mod tests {
|r| {
let h = r.assert_hung_at("sleeping an hour");
assert_eq!(h.thread.name(), Some("hang-body"));
assert!(
r.records()
.iter()
.any(|x| x.kind == RecordKind::Advanced)
);
assert!(r.records().iter().any(|x| x.kind == RecordKind::Advanced));
}
);
@@ -1844,7 +1840,10 @@ mod tests {
another_threads_op_after_the_death_is_not_the_deaths,
options = DYING_THREAD,
|t| {
let (go, done) = (Arc::new(AtomicBool::new(false)), Arc::new(AtomicBool::new(false)));
let (go, done) = (
Arc::new(AtomicBool::new(false)),
Arc::new(AtomicBool::new(false)),
);
let (go2, done2) = (go.clone(), done.clone());
named("other", move || {
while !go2.load(Ordering::Acquire) {
@@ -1924,7 +1923,10 @@ mod tests {
/// the op that preceded it, not at the worker's stale op
a_death_on_a_reused_worker_is_at_the_op_before_it,
|t| {
let q = crate::rt::queue::SerialQueue::new(&crate::testkit::threads::FakeThreads::default(), "A");
let q = crate::rt::queue::SerialQueue::new(
&crate::testkit::threads::FakeThreads::default(),
"A",
);
let done = Arc::new(AtomicBool::new(false));
let d2 = done.clone();
q.exec_async(move || {
@@ -1934,7 +1936,9 @@ mod tests {
// The worker ran the first block and waits for the next.
wait_until(|| done.load(Ordering::Acquire));
t.op("body: submit C");
q.exec_async(|| crate::testkit::capture::die(crate::raise::death::DeathKind::Abort, "site_t"));
q.exec_async(|| {
crate::testkit::capture::die(crate::raise::death::DeathKind::Abort, "site_t")
});
park_forever()
},
|r| {
@@ -1942,7 +1946,10 @@ mod tests {
assert!(!d.thread.body, "{d:?}");
// The reused worker's own last op is A's finished block.
let tid = d.thread.tid;
assert_eq!(r.last_op_before_end(|t| t.tid == tid), Some("A: block done"));
assert_eq!(
r.last_op_before_end(|t| t.tid == tid),
Some("A: block done")
);
assert_eq!(r.ops(), ["A: block done", "body: submit C"]);
}
);
@@ -1975,7 +1982,9 @@ mod tests {
go.store(true, Ordering::Release);
wait_until(|| finished.load(Ordering::Acquire) == 2);
t.op("body: submit C");
qa.exec_async(|| crate::testkit::capture::die(crate::raise::death::DeathKind::Abort, "site_t"));
qa.exec_async(|| {
crate::testkit::capture::die(crate::raise::death::DeathKind::Abort, "site_t")
});
park_forever()
},
|r| {
@@ -2081,7 +2090,11 @@ mod tests {
assert!(d.thread.body, "{d:?}");
assert_eq!(d.op.as_deref(), Some("recursing"));
assert_eq!(d.id, None);
assert!(r.stderr().contains("overflowed its stack"), "{}", r.stderr());
assert!(
r.stderr().contains("overflowed its stack"),
"{}",
r.stderr()
);
// std's line is one death's, and one death alone did not race.
assert!(!d.raced, "{d:?}");
assert_eq!(d.abort_lines.len(), 1, "{d:?}");
@@ -2151,7 +2164,10 @@ mod tests {
#[should_panic(expected = "expected a death")]
a_death_deferred_past_the_call_fails,
|t| {
let q = crate::rt::queue::SerialQueue::new(&crate::testkit::threads::FakeThreads::default(), "Q");
let q = crate::rt::queue::SerialQueue::new(
&crate::testkit::threads::FakeThreads::default(),
"Q",
);
t.op("body: calling");
trace("api: called");
q.exec_async(|| {
@@ -2260,7 +2276,9 @@ mod tests {
two_death_lines_are_not_paired,
|_| {
printed_not_marked("a", "site_a", 0);
named("b", || crate::testkit::capture::die(crate::raise::death::DeathKind::Abort, "site_b"));
named("b", || {
crate::testkit::capture::die(crate::raise::death::DeathKind::Abort, "site_b")
});
park_forever()
},
|r| {
@@ -2314,7 +2332,9 @@ mod tests {
park_forever()
});
wait_until(|| marked.load(Ordering::Acquire));
named("b", || crate::testkit::capture::die(crate::raise::death::DeathKind::Abort, "site_b"));
named("b", || {
crate::testkit::capture::die(crate::raise::death::DeathKind::Abort, "site_b")
});
park_forever()
},
|r| {
@@ -2421,7 +2441,11 @@ mod tests {
crate::testkit::capture::die(crate::raise::death::DeathKind::Abort, "site_t")
});
t.op("body: checking");
assert_eq!(std::hint::black_box(1 + 1), 3, "the body's own check failed");
assert_eq!(
std::hint::black_box(1 + 1),
3,
"the body's own check failed"
);
},
|r| {
let _ = r.assert_died_at(SITE, "body: checking");
@@ -2505,7 +2529,7 @@ mod tests {
a_death_line_beside_a_std_abort_is_not_paired,
|_| {
printed_not_marked("a", "site_a", 0);
named("b", || a_panic_in_a_trampoline());
named("b", a_panic_in_a_trampoline);
park_forever()
},
|r| check_a_beside_another_abort(r, "panic. aborting.")
@@ -2561,7 +2585,10 @@ mod tests {
assert!(!d.raced, "{d:?}");
assert_eq!((d.id.as_ref(), d.ids.len()), (None, 0), "{d:?}");
assert_eq!(d.abort_lines.len(), 1, "{d:?}");
assert!(d.abort_lines[0].contains("reims-vgpu: panicked at "), "{d:?}");
assert!(
d.abort_lines[0].contains("reims-vgpu: panicked at "),
"{d:?}"
);
assert_eq!(d.thread.name(), Some("b"));
assert_eq!(d.op.as_deref(), Some("body: calling"));
}
+11 -9
View File
@@ -949,7 +949,9 @@ macro_rules! apply_attachment {
apply_attachment!(
/// A colour attachment's set; its own: the clear colour.
apply_color_attachment(ColorAttachmentSet, MetalRenderPassColorAttachment) |set, o| {
apply_color_attachment(ColorAttachmentSet, MetalRenderPassColorAttachment)
| set,
o | {
if let Some(v) = set.clear_color {
let v = v.mtl();
msg::get("setClearColor:", || o.setClearColor(v));
@@ -959,30 +961,30 @@ apply_attachment!(
apply_attachment!(
/// The depth attachment's set; its own: the clear depth, then the resolve filter.
apply_depth_attachment(DepthAttachmentSet, MetalRenderPassDepthAttachment) |set, o| {
apply_depth_attachment(DepthAttachmentSet, MetalRenderPassDepthAttachment)
| set,
o | {
if let Some(v) = set.clear_depth {
msg::get("setClearDepth:", || o.setClearDepth(v));
}
if let Some(v) = set.depth_resolve_filter {
let v = MTLMultisampleDepthResolveFilter(v.to_usize());
msg::get("setDepthResolveFilter:", || {
o.setDepthResolveFilter(v)
});
msg::get("setDepthResolveFilter:", || o.setDepthResolveFilter(v));
}
}
);
apply_attachment!(
/// The stencil attachment's set; its own: the clear stencil, then the resolve filter.
apply_stencil_attachment(StencilAttachmentSet, MetalRenderPassStencilAttachment) |set, o| {
apply_stencil_attachment(StencilAttachmentSet, MetalRenderPassStencilAttachment)
| set,
o | {
if let Some(v) = set.clear_stencil {
msg::get("setClearStencil:", || o.setClearStencil(v));
}
if let Some(v) = set.stencil_resolve_filter {
let v = MTLMultisampleStencilResolveFilter(v.to_usize());
msg::get("setStencilResolveFilter:", || {
o.setStencilResolveFilter(v)
});
msg::get("setStencilResolveFilter:", || o.setStencilResolveFilter(v));
}
}
);
+1 -1
View File
@@ -361,7 +361,7 @@ impl Platform for MetalPlatform {
/// The device of `MTLCopyAllDevices()` whose `registryID` is `registry_id` (+1), or `None`.
/// In one process it is the instance the host's own device is.
fn open_device(&self, registry_id: u64) -> Option<MetalDevice> {
let all = msg::fatal_send("MTLCopyAllDevices()", || objc2_metal::MTLCopyAllDevices());
let all = msg::fatal_send("MTLCopyAllDevices()", objc2_metal::MTLCopyAllDevices);
let count = msg::value("count", || all.count());
(0..count)
.map(|i| msg::value("objectAtIndex:", || all.objectAtIndex(i)))
@@ -489,9 +489,9 @@ fn slice(sps: &SpsSpec, pps: &PpsSpec, spec: &SliceSpec) -> Vec<u8> {
.unwrap_or((pps.l0_default_minus1, pps.l1_default_minus1));
if pps.lists_modification && total_curr > 1 {
let bits = 32 - (total_curr - 1).leading_zeros();
for list in 0..if b { 2 } else { 1 } {
w.bit(spec.list_entries[list].is_some());
for &entry in spec.list_entries[list].iter().flatten() {
for entries in &spec.list_entries[..if b { 2 } else { 1 }] {
w.bit(entries.is_some());
for &entry in entries.iter().flatten() {
w.u(bits, entry);
}
}
@@ -646,7 +646,7 @@ impl Worker {
fn take_up_frame(&self) {
let _ = self
.frames_queued
.fetch_update(Ordering::AcqRel, Ordering::Acquire, |queued| {
.try_update(Ordering::AcqRel, Ordering::Acquire, |queued| {
queued.checked_sub(1)
});
}
@@ -104,7 +104,7 @@ impl HeldMessages {
fn take(&self, bytes: usize) -> bool {
let charge = |counter: &AtomicUsize, amount: usize, limit: usize| {
counter
.fetch_update(Ordering::AcqRel, Ordering::Acquire, |held| {
.try_update(Ordering::AcqRel, Ordering::Acquire, |held| {
held.checked_add(amount).filter(|&total| total <= limit)
})
.is_ok()
@@ -376,7 +376,7 @@ fn install_abort_report() {}
#[cfg(unix)]
extern "C" fn report_abort(_: i32) {
unsafe extern "C" {
fn write(fd: i32, bytes: *const u8, count: usize) -> isize;
fn write(fd: std::ffi::c_int, bytes: *const std::ffi::c_void, count: usize) -> isize;
}
let name = CASE_NAME.load(Ordering::SeqCst);
// SAFETY: null, or a name `run` leaked, which lives for ever.
@@ -395,7 +395,7 @@ extern "C" fn report_abort(_: i32) {
let end = usize::try_from(cursor.position()).unwrap_or(0);
// SAFETY: `end` bytes of `line` are initialised.
unsafe {
write(2, line.as_ptr(), end);
write(2, line.as_ptr().cast(), end);
}
}
@@ -475,7 +475,7 @@ fn placement_in(state: u8) -> Placement {
pub fn device_made(properties: &rt::DeviceProperties) {
super::census::on();
let class = class_of(properties.description.driver_id);
let _ = STATE.fetch_update(Ordering::AcqRel, Ordering::Acquire, |s| {
let _ = STATE.try_update(Ordering::AcqRel, Ordering::Acquire, |s| {
Some(after(s, class))
});
}
@@ -3306,7 +3306,15 @@ mod tests {
let c = shared(64);
let cb = command_buffer();
let e = compute(&cb);
encode_all(&e, [set(&inc), bind(&[Some(&c)], &[0]), start_while(&c, 0, 1, 1000), one()]);
encode_all(
&e,
[
set(&inc),
bind(&[Some(&c)], &[0]),
start_while(&c, 0, 1, 1000),
one(),
],
);
e.encode_end_while().unwrap();
e.encode(OnFault::Return, ComputeCmd::EndEncoding).unwrap();
cb.commit(OnFault::Return).unwrap();
@@ -20,7 +20,11 @@
//! surface's own, and Metal's write ends the process with a bus error, where this crate's platform
//! dies at the call.
#![cfg(target_os = "macos")] // Compares with Metal, which is macOS's.
#![cfg(target_os = "macos")]
// Compares with Metal, which is macOS's.
// The proof that a command buffer's result is well-formed walks the runtime's types for `Send` and
// `Sync`, deeper than rustc's default limit of 128, as in the library (`src/lib.rs`).
#![recursion_limit = "256"]
#![allow(
clippy::unwrap_used,
clippy::indexing_slicing,
@@ -14,7 +14,11 @@
//! too. A no-copy buffer's deallocator may call the platform's Mach VM, which tells the runtime,
//! whichever thread releases the buffer.
#![cfg(target_os = "macos")] // Compares with Metal, which is macOS's.
#![cfg(target_os = "macos")]
// Compares with Metal, which is macOS's.
// The proof that a command buffer's result is well-formed walks the runtime's types for `Send` and
// `Sync`, deeper than rustc's default limit of 128, as in the library (`src/lib.rs`).
#![recursion_limit = "256"]
#![allow(
clippy::unwrap_used,
clippy::indexing_slicing,
@@ -37,6 +37,9 @@
//! told of are made through the OS's VM alone (`os::OsVm`), which reports nothing.
#![cfg(target_os = "linux")]
// The proof that a command buffer's result is well-formed walks the runtime's types for `Send` and
// `Sync`, deeper than rustc's default limit of 128, as in the library (`src/lib.rs`).
#![recursion_limit = "256"]
#![allow(
clippy::unwrap_used,
clippy::indexing_slicing,
+10 -6
View File
@@ -1,13 +1,17 @@
# Pinned stable (architecture 2.1), measured with objc2 0.6.4. D32: the Metal platform is
# aarch64-apple-darwin alone; the Vulkan platform builds for aarch64 and x86-64, on macOS and
# Linux, and x86_64-unknown-linux-gnu is what ships on Linux (built there, type-checked from the
# Mac by `cargo xtask check`). x86_64-apple-darwin runs core's tests under Rosetta, with the x86-64
# guest's pages and instructions, on a Mac that has Rosetta (check skips them on one without).
# A dated nightly, for rustc's parallel front end (`-Zthreads`, set in `.cargo/config.toml` through
# Cargo's profile rustflags), the toolchain metal2vulkan's builds use too. The date is fixed so
# every host runs one rustc, clippy and rustfmt; moving it is a deliberate step, with a full check.
# The crates' `rust-version` (Cargo.toml) stays the stable floor clippy's `incompatible_msrv` checks
# the standard library's items against. D32: the Metal platform is aarch64-apple-darwin alone; the
# Vulkan platform builds for aarch64 and x86-64, on macOS and Linux, and x86_64-unknown-linux-gnu is
# what ships on Linux (built there, type-checked from the Mac by `cargo xtask check`).
# x86_64-apple-darwin runs core's tests under Rosetta, with the x86-64 guest's pages and
# instructions, on a Mac that has Rosetta (check skips them on one without).
# No Rust binary is arm64e: rustc's arm64e-apple-darwin target has no pointer authentication, and
# its binaries, a hello world among them, crash in dyld's `_tlv_get_addr` before `main` (measured
# 2026-09-25 with nightly-2026-09-24 on macOS 26.7). An arm64 binary still links and calls arm64e
# code, as it calls the system's frameworks, and arm64e code calls its callbacks.
[toolchain]
channel = "1.98.1"
channel = "nightly-2026-11-03"
components = ["rustfmt", "clippy"]
targets = ["aarch64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-apple-darwin"]