From 62dfb5cec35cd084256335e17689bf692d6b123e Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Thu, 12 Nov 2026 23:14:53 -0800 Subject: [PATCH] String literals whose line continuations were lost join their lines again A run of spaces inside a string literal, where a line once ended in `\`, printed the next line's indentation into the text. Swept every .rs file's string literals (non-raw) once for a run of four or more spaces between two non-space characters, and for literals whose line ends without a continuation; the latter were all intended multi-line text (LLVM IR, SQL, data tables, usage). Restored (each run became ` \` and the next line's indentation, 28 runs): - product messages: render_state.rs (SampleDepthClamp's text), degradation.rs (YCbCrFilterNotExact's text), two_planes.rs (a blit's why-not), device/create.rs (the dropped instance layers' line); - tests and suites: render_sibling_work.rs, shadow_standing_device.rs, image_standing.rs (2), conformance texture_views.rs (2) and rate_map_sweeps.rs (3), validation plan_resources.rs and parallel_encodes.rs (2); - conformance times.rs: a wrapped line after an explicit `\n`, its two-space indent kept; - engine_refused_families.rs: one space in an LLVM IR line's `ptr addrspace(1)`. The degradation texts change in whitespace alone; docs/API.md's catalogue names the kinds, not these texts, and still matches. Left as written: aligned columns and indentation after `\n` (kernel_textures.rs, renders.rs, argument_buffers.rs, degradation_catalogue.rs, the conformance stability, verdict and cost reports, the tab table of dma_buf_leak_probe.rs, usage texts). cargo fmt. --- .../src/cases/rate_map_sweeps.rs | 9 ++++++--- .../src/cases/texture_views.rs | 6 ++++-- crates/metal2vulkan-conformance/src/times.rs | 3 ++- crates/metal2vulkan-runtime/src/degradation.rs | 5 ++++- crates/metal2vulkan-runtime/src/device/create.rs | 10 ++++++++-- crates/metal2vulkan-runtime/src/render_state.rs | 4 +++- .../metal2vulkan-runtime/src/tests/image_standing.rs | 8 ++++++-- .../src/tests/render_sibling_work.rs | 4 +++- .../src/tests/shadow_standing_device.rs | 3 ++- crates/metal2vulkan-runtime/src/two_planes.rs | 4 +++- .../src/candidate/platform/plan_resources.rs | 3 ++- .../src/runtime_lane/parallel_encodes.rs | 7 +++++-- .../metal2vulkan/src/tests/engine_refused_families.rs | 2 +- 13 files changed, 49 insertions(+), 19 deletions(-) diff --git a/crates/metal2vulkan-conformance/src/cases/rate_map_sweeps.rs b/crates/metal2vulkan-conformance/src/cases/rate_map_sweeps.rs index 4b895a69d..f1e15bddc 100644 --- a/crates/metal2vulkan-conformance/src/cases/rate_map_sweeps.rs +++ b/crates/metal2vulkan-conformance/src/cases/rate_map_sweeps.rs @@ -950,14 +950,16 @@ mod tests { } assert!( unexplained.is_empty(), - "these points of the quality sweep derive one answer and no prediction of `rate_map_space` says why, so each is a site that compares nothing new: {}", + "these points of the quality sweep derive one answer and no prediction of \ + `rate_map_space` says why, so each is a site that compares nothing new: {}", unexplained.join("; ") ); // And the sweep is not mostly collapse: most of its points read a bucket of their own. let distinct = by_answer.len(); assert!( distinct * 2 > answers.len(), - "the quality sweep derives {distinct} distinct answers over {} points, so over half of it is a second reading of a bucket already read", + "the quality sweep derives {distinct} distinct answers over {} points, so over half \ + of it is a second reading of a bucket already read", answers.len() ); } @@ -993,7 +995,8 @@ mod tests { assert_eq!( answers.len(), 1, - "the forms over {count} layer(s) compile {} different maps, so the walk is comparing shapes rather than construction paths", + "the forms over {count} layer(s) compile {} different maps, so the walk is \ + comparing shapes rather than construction paths", answers.len() ); } diff --git a/crates/metal2vulkan-conformance/src/cases/texture_views.rs b/crates/metal2vulkan-conformance/src/cases/texture_views.rs index 5784effe3..960991ae0 100644 --- a/crates/metal2vulkan-conformance/src/cases/texture_views.rs +++ b/crates/metal2vulkan-conformance/src/cases/texture_views.rs @@ -772,11 +772,13 @@ mod tests { } assert!( missing.is_empty(), - "these `MTLTextureSwizzle` values are compared against Metal nowhere in the suite: {missing:?}" + "these `MTLTextureSwizzle` values are compared against Metal nowhere in the suite: \ + {missing:?}" ); assert!( not_alone.is_empty(), - "these values appear only with all four channels the same, so a side that broadcast one channel over the other three would pass every row: {not_alone:?}" + "these values appear only with all four channels the same, so a side that broadcast \ + one channel over the other three would pass every row: {not_alone:?}" ); assert!( parents().asks_inherited_swizzles, diff --git a/crates/metal2vulkan-conformance/src/times.rs b/crates/metal2vulkan-conformance/src/times.rs index ff50424e7..38dfcafd6 100644 --- a/crates/metal2vulkan-conformance/src/times.rs +++ b/crates/metal2vulkan-conformance/src/times.rs @@ -1165,7 +1165,8 @@ pub fn render(metal: Option<&Measurement>, ours: &Measurement, show: bool) -> St " A RATIO FAR IN OUR FAVOUR IS A SETUP DIFFERENCE UNTIL SOMEBODY SHOWS OTHERWISE. The \ suite's recordings make 733\n shader references over 152 distinct (shader, entry) \ pairs, so 90% are to a shader another case already used,\n and our leg has a shader \ - cache while Metal's newLibraryWithData recompiles every call. Our counters sum to 518\n shader modules and 1,040 pipelines for 122 ms of measured compile -- about 78 us each, \ + cache while Metal's newLibraryWithData recompiles every call. Our counters sum to 518\n \ + shader modules and 1,040 pipelines for 122 ms of measured compile -- about 78 us each, \ which is not a price at\n which any compile to machine code happens, so something below \ us is handing back work already done. Use\n --cold-shaders for the only setting under \ which the compile rows compare like with like.\n", diff --git a/crates/metal2vulkan-runtime/src/degradation.rs b/crates/metal2vulkan-runtime/src/degradation.rs index 55e91e85c..67b91404b 100644 --- a/crates/metal2vulkan-runtime/src/degradation.rs +++ b/crates/metal2vulkan-runtime/src/degradation.rs @@ -4430,7 +4430,10 @@ impl Device { ( stage_object(stage.stage).to_owned(), format!( - "a filtered sample of a texture its argument buffers name takes the device's filter, not Metal's exact filter of the format, and a texture the command makes resident or binds that they can name is two-plane YCbCr: {}", + "a filtered sample of a texture its argument buffers name takes the \ + device's filter, not Metal's exact filter of the format, and a texture \ + the command makes resident or binds that they can name is two-plane \ + YCbCr: {}", self.note_reason(note) ), ) diff --git a/crates/metal2vulkan-runtime/src/device/create.rs b/crates/metal2vulkan-runtime/src/device/create.rs index 6a48fef49..ef40b26c6 100644 --- a/crates/metal2vulkan-runtime/src/device/create.rs +++ b/crates/metal2vulkan-runtime/src/device/create.rs @@ -1047,8 +1047,14 @@ pub(crate) fn layers_dropped(dropped: &[CString], device: &str) -> Option 0, - "the first creation must specialize its stages into the device's entries at all, not {} times: a creation that specializes nothing there, because it keeps entries of its own, makes the run's zero a vacuous zero", + "the first creation must specialize its stages into the device's entries at all, not {} \ + times: a creation that specializes nothing there, because it keeps entries of its own, \ + makes the run's zero a vacuous zero", before.stage_entries_specialized ); let mut kept = Vec::with_capacity(RUN as usize); diff --git a/crates/metal2vulkan-runtime/src/tests/shadow_standing_device.rs b/crates/metal2vulkan-runtime/src/tests/shadow_standing_device.rs index a5f1e7bb6..e06d0488e 100644 --- a/crates/metal2vulkan-runtime/src/tests/shadow_standing_device.rs +++ b/crates/metal2vulkan-runtime/src/tests/shadow_standing_device.rs @@ -474,7 +474,8 @@ fn a_private_plane_copies_in_after_its_own_command_buffer_s_write_and_once_hande assert_eq!( (counts.at[COMMAND_BUFFER], written, counts.against), (texels, texels, 0), - "decided by its own command buffer's write, as the reading encoder recorded it: no copy left to the submission" + "decided by its own command buffer's write, as the reading encoder recorded it: no copy \ + left to the submission" ); // SAFETY: the handle is only read; no work of the caller's uses it. let _ = unsafe { plane.buffer.vk_buffer() }; diff --git a/crates/metal2vulkan-runtime/src/two_planes.rs b/crates/metal2vulkan-runtime/src/two_planes.rs index 21e969172..27eccc989 100644 --- a/crates/metal2vulkan-runtime/src/two_planes.rs +++ b/crates/metal2vulkan-runtime/src/two_planes.rs @@ -613,7 +613,9 @@ impl BlitCommandEncoder { Some("a copy within one texture") } else if volume { Some( - "a 3D texture, out of which Metal's blit reads the first texel at every texel and into which it wrote nothing at some widths, not modelled: the texels copy at the first depth slice", + "a 3D texture, out of which Metal's blit reads the first texel at every texel and \ + into which it wrote nothing at some widths, not modelled: the texels copy at the \ + first depth slice", ) } else { match (level(source)?, level(destination)?) { diff --git a/crates/metal2vulkan-validation/src/candidate/platform/plan_resources.rs b/crates/metal2vulkan-validation/src/candidate/platform/plan_resources.rs index f14abab65..5c7c1d830 100644 --- a/crates/metal2vulkan-validation/src/candidate/platform/plan_resources.rs +++ b/crates/metal2vulkan-validation/src/candidate/platform/plan_resources.rs @@ -388,7 +388,8 @@ impl<'a> PlanResources<'a> { ), WriteSource::TileAttachment { color_index, .. } => { return Err(format!( - "color attachment {color_index}'s sample planes, which the draw does not keep" + "color attachment {color_index}'s sample planes, which the draw does not \ + keep" ) .into()) } diff --git a/crates/metal2vulkan-validation/src/runtime_lane/parallel_encodes.rs b/crates/metal2vulkan-validation/src/runtime_lane/parallel_encodes.rs index aad73028c..b9270fe2f 100644 --- a/crates/metal2vulkan-validation/src/runtime_lane/parallel_encodes.rs +++ b/crates/metal2vulkan-validation/src/runtime_lane/parallel_encodes.rs @@ -185,7 +185,8 @@ fn a_fresh_texture_s_pattern_notice_follows_the_commit_order() { *count = fresh_notices(&messages); } println!( - "PARALLEL-FRESH on {name}: {samples}x, {first:?} then {second:?}: {} notice(s) serially, {} with the later encoded first; Metal reads the pattern {metal:?} time(s)", + "PARALLEL-FRESH on {name}: {samples}x, {first:?} then {second:?}: {} notice(s) \ + serially, {} with the later encoded first; Metal reads the pattern {metal:?} time(s)", announced[0], announced[1] ); // No pattern, so nothing to announce, on a device without Metal's compression. @@ -199,7 +200,9 @@ fn a_fresh_texture_s_pattern_notice_follows_the_commit_order() { } assert!( wrong.is_empty(), - "on {name}, notices of a new texture's pattern read that differ from the reads in commit order ((samples, loads, notices serially and with the later encoded first, the answer)): {wrong:?}" + "on {name}, notices of a new texture's pattern read that differ from the reads in commit \ + order ((samples, loads, notices serially and with the later encoded first, the \ + answer)): {wrong:?}" ); drop(queue); drop(device); diff --git a/crates/metal2vulkan/src/tests/engine_refused_families.rs b/crates/metal2vulkan/src/tests/engine_refused_families.rs index ab5593da2..2fb4129de 100644 --- a/crates/metal2vulkan/src/tests/engine_refused_families.rs +++ b/crates/metal2vulkan/src/tests/engine_refused_families.rs @@ -222,7 +222,7 @@ fn a_mistyped_call_to_a_defined_function_is_invalid_input() { ret void ", "define internal void @h(ptr addrspace(1) %p, i32 %v) { - store i32 %v, ptr addrspace(1) %p, align 4 + store i32 %v, ptr addrspace(1) %p, align 4 ret void } ",