From 96c450fb75645b854fa8999134ba18e27e0617bf Mon Sep 17 00:00:00 2001 From: shinyobjectz Date: Thu, 19 Nov 2026 11:12:29 -0800 Subject: [PATCH 1/4] export xml: a Windows path is a file URL an editor opens (#195) 0.1.8-rc8 percent-encoded a Windows path whole into : file://localhostD%3A%5CWork%5C... for D:\Work\..., which DaVinci Resolve refused. The same XML imported at once with file:///D:/Work/... (the reporter's test). A drive's path is now that, a share's file://nas/clips/..., separators as slashes and the \\?\ prefix off; a Mac's and Linux's are as before. cargo test -p raea-app-layers passes, with a test of each kind of path. --- apps/layers/src/tests.rs | 16 ++++++++++++++++ apps/layers/src/xml.rs | 32 +++++++++++++++++++++++++------- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/apps/layers/src/tests.rs b/apps/layers/src/tests.rs index 5c26a9826..4f3785f4e 100644 --- a/apps/layers/src/tests.rs +++ b/apps/layers/src/tests.rs @@ -402,3 +402,19 @@ fn a_pan_inside_its_box_is_keyed() { let dw = 3840.0 * 1920.0 / 2160.0; assert!(near(centre(&from), (dw / 2.0 - 540.0) / 1080.0) && near(centre(&to), -(dw / 2.0 - 540.0) / 1080.0)); } + +#[test] +fn a_windows_path_is_a_file_url_an_editor_opens() { + // #195: 0.1.8-rc8 wrote file://localhostD%3A%5CWork%5C... for D:\Work\...; Resolve imported the same XML at once with + // file:///D:/Work/... + use crate::xml::pathurl; + use std::path::Path; + assert_eq!(pathurl(Path::new(r"D:\Work\_research\raea\xmltest\public\clip.mp4")), "file:///D:/Work/_research/raea/xmltest/public/clip.mp4"); + assert_eq!(pathurl(Path::new(r"\\?\C:\Users\Jürgen\my clip.mp4")), "file:///C:/Users/J%C3%BCrgen/my%20clip.mp4"); + assert_eq!(pathurl(Path::new("C:/Users/me/out/xml/edit/graphics.rle.mov")), "file:///C:/Users/me/out/xml/edit/graphics.rle.mov"); + assert_eq!(pathurl(Path::new(r"\\nas\clips\a.mp4")), "file://nas/clips/a.mp4"); + assert_eq!(pathurl(Path::new(r"\\?\UNC\nas\clips\a.mp4")), "file://nas/clips/a.mp4"); + // a Mac's or Linux's as before, a backslash there being part of a name + assert_eq!(pathurl(Path::new("/Users/me/my clip.mp4")), "file://localhost/Users/me/my%20clip.mp4"); + assert_eq!(pathurl(Path::new(r"/tmp/a\b.mp4")), "file://localhost/tmp/a%5Cb.mp4"); +} diff --git a/apps/layers/src/xml.rs b/apps/layers/src/xml.rs index c90d1a994..bcdcbd8f1 100644 --- a/apps/layers/src/xml.rs +++ b/apps/layers/src/xml.rs @@ -57,14 +57,32 @@ fn esc(s: &str) -> String { } /// A file's path as xmeml's pathurl: file://localhost and the absolute path, each byte outside the unreserved set -/// percent-encoded. -fn pathurl(p: &Path) -> String { - let mut out = String::from("file://localhost"); - for b in p.to_string_lossy().bytes() { - if b.is_ascii_alphanumeric() || b"/-_.~".contains(&b) { - out.push(b as char); +/// percent-encoded. A Windows path is made a URL as a path, not as text (#195: 0.1.8-rc8 wrote +/// file://localhostD%3A%5CWork%5C..., which Resolve refused): a drive's is file:///D:/Work/clip.mp4, the form Resolve +/// opened, and a share's file://nas/clips/clip.mp4, each with its separators as slashes and Windows' \\?\ prefix off. +pub(crate) fn pathurl(p: &Path) -> String { + let s = p.to_string_lossy(); + let s = match (s.strip_prefix(r"\\?\UNC\"), s.strip_prefix(r"\\?\")) { + (Some(share), _) => format!(r"\\{share}"), + (None, Some(local)) => local.to_string(), + _ => s.into_owned(), + }; + let b = s.as_bytes(); + let drive = b.len() >= 3 && b[0].is_ascii_alphabetic() && b[1] == b':' && matches!(b[2], b'\\' | b'/'); + let (mut out, rest, windows) = if drive { + (format!("file:///{}:", b[0] as char), &b[2..], true) + } else if let Some(share) = s.strip_prefix(r"\\") { + (String::from("file://"), share.as_bytes(), true) + } else { + (String::from("file://localhost"), b, false) + }; + for &c in rest { + if windows && c == b'\\' { + out.push('/'); + } else if c.is_ascii_alphanumeric() || b"/-_.~".contains(&c) { + out.push(c as char); } else { - let _ = write!(out, "%{b:02X}"); + let _ = write!(out, "%{c:02X}"); } } out From c3e7206581d9bc921a3c9138970dc1babad51868 Mon Sep 17 00:00:00 2001 From: shinyobjectz Date: Thu, 19 Nov 2026 11:12:30 -0800 Subject: [PATCH 2/4] DX12 with DXC: hanabi's utils shader named so DXC can read it; an export refuses a codec before rendering (#196) wgpu hands DXC a shader module's label as its source's file name, and on Windows LLVM reads "hanabi:shader:utils" as a root and a file, so DXC said "error reading 'hanabi:shader:utils'" and every Bevy app failed: on a PC where dxcompiler.dll is on the PATH (wgpu loads it when it can, else FXC), rc8 rendered no 3D at all on DX12 (exit 101 on an RTX 4070 with WGPU_BACKEND=dx12 and DXC 1.9.2609; the same render passed with FXC). raea export xml's passes were where the reporter saw it, on a PC whose Intel iGPU puts raea on DX12. Bevy names its modules nothing; hanabi's utils module and its contract tests' were the only labels with a colon, now underscores. And an export refuses an alpha codec this machine can't write (ProRes or HEVC off a Mac) when it starts, not after the reference render: Codec::chosen, which layers, capcut and render_movie share. --- apps/capcut/src/lib.rs | 2 +- apps/layers/src/lib.rs | 2 +- io/alpha/src/lib.rs | 16 +++++++++++++--- io/alpha/src/movie.rs | 5 +---- vendor/bevy_hanabi/src/render/mod.rs | 4 +++- .../src/render/shader_contract_tests.rs | 8 ++++---- vendor/vendor.toml | 2 +- 7 files changed, 24 insertions(+), 15 deletions(-) diff --git a/apps/capcut/src/lib.rs b/apps/capcut/src/lib.rs index 70a621385..d6d0217f8 100644 --- a/apps/capcut/src/lib.rs +++ b/apps/capcut/src/lib.rs @@ -48,7 +48,7 @@ fn export(args: &[String]) -> R { let tsx = args.first().filter(|a| !a.starts_with('-')).ok_or(USAGE)?; let tsx = dunce::canonicalize(&PathBuf::from(tsx)).map_err(|e| format!("{tsx}: {e}"))?; let dir = tsx.parent().unwrap().to_path_buf(); - let codec = flag(args, "--alpha-codec").map_or(Ok(raea_io_alpha::Codec::default_here()), |c| raea_io_alpha::Codec::parse(&c))?; + let codec = raea_io_alpha::Codec::chosen(flag(args, "--alpha-codec").as_deref())?; let (root, in_store) = match flag(args, "-o") { Some(o) => (PathBuf::from(o), false), None => { diff --git a/apps/layers/src/lib.rs b/apps/layers/src/lib.rs index 312702ed8..17cf51092 100644 --- a/apps/layers/src/lib.rs +++ b/apps/layers/src/lib.rs @@ -145,7 +145,7 @@ pub fn export(args: &[String]) -> R<(Layers, String)> { let tsx = args.first().filter(|a| !a.starts_with('-')).ok_or(USAGE)?; let tsx = dunce::canonicalize(PathBuf::from(tsx)).map_err(|e| format!("{tsx}: {e}"))?; let edit_dir = tsx.parent().unwrap().to_path_buf(); - let codec = flag(args, "--alpha-codec").map_or(Ok(raea_io_alpha::Codec::default_here()), |c| raea_io_alpha::Codec::parse(&c))?; + let codec = raea_io_alpha::Codec::chosen(flag(args, "--alpha-codec").as_deref())?; let name = named(args, &tsx); let dir = flag(args, "-o").map_or_else(|| edit_dir.join("out/layers").join(&name), PathBuf::from); std::fs::create_dir_all(&dir).map_err(|e| format!("{}: {e}", dir.display()))?; diff --git a/io/alpha/src/lib.rs b/io/alpha/src/lib.rs index 2a16aee6e..5ce435486 100644 --- a/io/alpha/src/lib.rs +++ b/io/alpha/src/lib.rs @@ -59,6 +59,18 @@ impl Codec { pub fn here(self) -> bool { cfg!(target_vendor = "apple") || matches!(self, Codec::Rle | Codec::Png) } + + /// It, or what to use instead where this build can't write it. + pub fn usable(self) -> R { + if self.here() { Ok(self) } else { Err(format!("{} is written through VideoToolbox, on a Mac: --alpha-codec rle (QuickTime Animation) or png here", self.name())) } + } + + /// The codec `--alpha-codec` names (this machine's own when it names none), refused when it can't be written here: + /// what an export asks for before it renders anything, so a Windows PC told prores hears so before the reference + /// render, not after it (#196). + pub fn chosen(flag: Option<&str>) -> R { + flag.map_or(Ok(Codec::default_here()), Codec::parse)?.usable() + } } /// A transparent movie being written: frames in, `finish` makes the file. @@ -79,9 +91,7 @@ enum Inner { impl Writer { /// A movie of `codec` at `out`; `quality` (0..1) is HEVC's, which the others don't take. pub fn create(out: &Path, codec: Codec, width: u32, height: u32, fps: f64, quality: f32) -> R { - if !codec.here() { - return Err(format!("{} is written through VideoToolbox, on a Mac: use --alpha-codec rle or png here", codec.name())); - } + codec.usable()?; if width == 0 || height == 0 || width > 0xFFFF || height > 0xFFFF { return Err(format!("a {width}x{height} movie can't be written")); } diff --git a/io/alpha/src/movie.rs b/io/alpha/src/movie.rs index 3223caeba..e76cbfc07 100644 --- a/io/alpha/src/movie.rs +++ b/io/alpha/src/movie.rs @@ -11,10 +11,7 @@ use crate::{Codec, R, encode_dir}; /// --manifest, HEVC's quality 0..1), from the frames `render` writes when given the same arguments with -o FOLDER/ and /// --manifest in place of -o OUT.mov; what it said, APPLIED as the movie. pub fn render_movie(args: &[String], out: &Path, codec: Option<&str>, manifest: Option, quality: f32, render: impl Fn(&[String]) -> R) -> R { - let codec = codec.map_or(Ok(Codec::default_here()), Codec::parse)?; - if !codec.here() { - return Err(format!("{} is written through VideoToolbox, on a Mac: --alpha-codec rle (QuickTime Animation) or png here", codec.name())); - } + let codec = Codec::chosen(codec)?; if let Some(d) = out.parent().filter(|d| !d.as_os_str().is_empty()) { std::fs::create_dir_all(d).map_err(|e| format!("{}: {e}", d.display()))?; } diff --git a/vendor/bevy_hanabi/src/render/mod.rs b/vendor/bevy_hanabi/src/render/mod.rs index a465ff2ec..66dbf3540 100644 --- a/vendor/bevy_hanabi/src/render/mod.rs +++ b/vendor/bevy_hanabi/src/render/mod.rs @@ -1710,8 +1710,10 @@ impl FromWorld for UtilsPipeline { debug!("Create utils shader module:\n{}", shader_code); #[allow(unsafe_code)] let shader_module = unsafe { + // no colon in a shader module's label: DX12's DXC takes it as the source's file name, and on Windows + // "hanabi:shader:utils" names no file, so every Bevy app failed there wherever DXC loads (raea #196) render_device.create_shader_module(ShaderModuleDescriptor { - label: Some("hanabi:shader:utils"), + label: Some("hanabi_shader_utils"), source: shader_source, }) }; diff --git a/vendor/bevy_hanabi/src/render/shader_contract_tests.rs b/vendor/bevy_hanabi/src/render/shader_contract_tests.rs index 266015b38..1acfd76f4 100644 --- a/vendor/bevy_hanabi/src/render/shader_contract_tests.rs +++ b/vendor/bevy_hanabi/src/render/shader_contract_tests.rs @@ -191,7 +191,7 @@ fn create_sort_pipeline( crate::test_utils::compile_wesl(VFX_SORT_WESL.as_ref(), &["HAS_DUAL_KEY", "TEST"], &[]) .unwrap(); let shader = wgpu_device.create_shader_module(wgpu::ShaderModuleDescriptor { - label: Some("hanabi:test:vfx_sort"), + label: Some("hanabi_test_vfx_sort"), source: wgpu::ShaderSource::Wgsl(source.into()), }); let pipeline = wgpu_device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor { @@ -724,7 +724,7 @@ fn location_mapping_contracts() { let wgpu_device = device.wgpu_device(); let shader = wgpu_device.create_shader_module(wgpu::ShaderModuleDescriptor { - label: Some("hanabi:test:location:shader"), + label: Some("hanabi_test_location_shader"), source: wgpu::ShaderSource::Wgsl( r#" struct BatchInfo { @@ -926,7 +926,7 @@ fn indirect_plus_update_routing_contracts() { let wgpu_device = device.wgpu_device(); let indirect_shader = wgpu_device.create_shader_module(wgpu::ShaderModuleDescriptor { - label: Some("hanabi:test:indirect-lite"), + label: Some("hanabi_test_indirect-lite"), source: wgpu::ShaderSource::Wgsl( r#" struct Spawner { @@ -964,7 +964,7 @@ fn main(@builtin(global_invocation_id) gid: vec3) { ), }); let update_route_shader = wgpu_device.create_shader_module(wgpu::ShaderModuleDescriptor { - label: Some("hanabi:test:update-route"), + label: Some("hanabi_test_update-route"), source: wgpu::ShaderSource::Wgsl( r#" struct BatchInfo { diff --git a/vendor/vendor.toml b/vendor/vendor.toml index 125941ca3..7c6bdb679 100644 --- a/vendor/vendor.toml +++ b/vendor/vendor.toml @@ -169,7 +169,7 @@ exit = "a Rune release whose rune-taffy handles taffy's flexbox_balance" path = "vendor/bevy_hanabi" upstream = "git:github.com/djeedai/bevy_hanabi@77630ff1eed8b104f34e91d23e9440428dc5ab01:." kind = "patch" -reason = "frame-pure particles (raea #52): a new particle seeded by its spawn index, not the dead slot it recycles (vfx_init.wesl), and blended effects sorted by view depth from the main camera, far first as Bevy sorts its transparent phase, through the ribbons' sort pass (mod.rs, sort.rs, vfx_sort_fill.wesl); examples and GPU tests dropped" +reason = "frame-pure particles (raea #52): a new particle seeded by its spawn index, not the dead slot it recycles (vfx_init.wesl), and blended effects sorted by view depth from the main camera, far first as Bevy sorts its transparent phase, through the ribbons' sort pass (mod.rs, sort.rs, vfx_sort_fill.wesl); examples and GPU tests dropped; and no colon in a shader module's label (mod.rs's utils, the contract tests'), which DX12's DXC takes as a file name that names no file on Windows (raea #196)" exit = "a hanabi with a deterministic mode (both changes offered upstream); then back to the git dependency and drop the copy" [usvg] From f46529b46147bb64c31fe5427affb2e944369de2 Mon Sep 17 00:00:00 2001 From: shinyobjectz Date: Thu, 19 Nov 2026 11:37:55 -0800 Subject: [PATCH 3/4] Release: the Windows bundle's list read without its \r (rc9's Windows pack failed on it) GitHub's Windows runner checks text files out with CRLF, as the Models step already allows for (tr -d '\r' < models.tsv), so release.sh looked for "vcruntime140.dll\r" in target/dist, beside the vcruntime140.dll win-bundle.sh had just put there, and stopped. release.sh and release-check.sh, the list's two readers, now strip it. --- tools/release-check.sh | 2 +- tools/release.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/release-check.sh b/tools/release-check.sh index 410034070..307aa5d2b 100644 --- a/tools/release-check.sh +++ b/tools/release-check.sh @@ -153,7 +153,7 @@ keys=$(grep -rlE 'sk-or-v1-[0-9a-f]{20}|sk-ant-[A-Za-z0-9_-]{20}|(^|[^A-Za-z0-9+ # Windows: our binaries, and Microsoft's only where raea ships them on purpose, with their licences: ONNX Runtime's # onnxruntime.dll (MIT, #110) and the VC++ runtime's four DLLs (tools/release/win-bundle.sh). Any other DLL, or a file # named like the CRT, the SDK or DirectX's redistributables, isn't ours to ship. -bundle=$(cat "$(dirname "$0")/release/win-bundle.files") +bundle=$(tr -d '\r' < "$(dirname "$0")/release/win-bundle.files") allowed=$(printf './bin/%s\n' raea_bundle.dll onnxruntime.dll $bundle) ms=$(cd "$check/raea" && find . -type f \( -iname '*.dll' -o -iname 'vcruntime*' -o -iname 'msvcp*' -o -iname 'ucrtbase*' -o -iname 'api-ms-win*' -o -iname 'concrt*' -o -iname 'vccorlib*' -o -iname '*.lib' -o -iname '*.pdb' -o -iname 'd3dcompiler*' -o -iname 'dxcompiler*' -o -iname 'dxil*' \) | grep -ivxF "$allowed" | head -5 || true) [ -z "$ms" ] || fail "files that aren't ours: $ms" diff --git a/tools/release.sh b/tools/release.sh index df9fd5704..83bb11a85 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -138,8 +138,9 @@ loader (Debian and Ubuntu: apt install libxkbcommon-x11-0 libxcursor1 libxi6 lib cp "$bin/$f" "$stage/bin/" done # and what a PC with nothing installed and no downloads needs (tools/release/win-bundle.sh): the VC++ runtime - # raea.exe and onnxruntime.dll import, FFmpeg (raea's LGPL build) and uv, each with its licence - for f in $(cat "$root/tools/release/win-bundle.files"); do + # raea.exe and onnxruntime.dll import, FFmpeg (raea's LGPL build) and uv, each with its licence; the list read without + # its \r, as GitHub's Windows runner checks it out with CRLF (0.1.8-rc9 looked for "vcruntime140.dll\r") + for f in $(tr -d '\r' < "$root/tools/release/win-bundle.files"); do [ -f "$bin/$f" ] || { echo "release.sh: $bin has no $f (tools/release/win-bundle.sh $bin)" >&2; exit 1; } cp "$bin/$f" "$stage/bin/" done From b39dd4e7de6123406fcda401e3ce000f9df4a342 Mon Sep 17 00:00:00 2001 From: shinyobjectz Date: Thu, 19 Nov 2026 11:39:35 -0800 Subject: [PATCH 4/4] release.yml windows-verify: the bundle's list beside release-check.sh, where it reads it windows-verify checks the zip on a runner with only release-check.sh and lavapipe.sh checked out, and runs release-check.sh from RUNNER_TEMP; since the Windows bundle it reads release/win-bundle.files beside itself, which wasn't there, so the step would have stopped on it once rc9's pack step stopped failing. It's checked out and copied there now. --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f945edf9d..52412f1e1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -424,6 +424,7 @@ jobs: lfs: false sparse-checkout: | tools/release-check.sh + tools/release/win-bundle.files tools/release/lavapipe.sh sparse-checkout-cone-mode: false path: check @@ -437,7 +438,8 @@ jobs: run: | set -e v=${TAG#v} - cp check/tools/release-check.sh "$RUNNER_TEMP/" + # and the list of what bin\ must carry, where release-check.sh looks for it (release/ beside it) + cp check/tools/release-check.sh "$RUNNER_TEMP/" && mkdir -p "$RUNNER_TEMP/release" && cp check/tools/release/win-bundle.files "$RUNNER_TEMP/release/" rm -rf check cd "$RUNNER_TEMP/zip" sha256sum -c "raea-$v-windows-x86_64.zip.sha256"