From b4511d21ca0d9edeea09ed5efceda2323f2a85fb Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 18 Nov 2026 08:36:32 -0500 Subject: [PATCH] fix(web): restore bounded-memory wasm release profile Reapply aiongg commit 1848c17350db887be301df77c36e74b2d309fd80 (#15508), reverted by 435d6e5. Preserve newer test profiles, optimization levels and browser package size gate. Independently source-reviewed; locked offline metadata passed. Fresh hosted browser validation remains required. --- Cargo.toml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d4893f6317..3585e9cbf4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -243,16 +243,19 @@ codegen-units = 1 # The browser build (apps/photocraft-web, `data-cargo-profile` in its index.html). Hosts cap the # size of a single file (Cloudflare Pages/Workers: 25 MiB), and the wasm is downloaded on every -# visit, so this profile optimizes for size: fat LTO, opt-level "z" for PhotoCraft's own crates, +# visit, so this profile optimizes for size: opt-level "z" for PhotoCraft's own crates, # "s" for dependencies and for the crates that decode files, and 3 for pixel processing (filters # and compositing). Dependencies stay at "s": at "z" the whole wasm grows (by 0.4 MB, measured). # panic stays the target default (wasm32-unknown-unknown aborts; AGENTS.md's `panic = "unwind"` # is for the native app shell). packaging/web/package.sh fails the build above 24 MiB. +# Thin LTO over 16 codegen units keeps the link step near 8 GB, inside a 16 GB CI runner (one +# fat-LTO unit needs about 21 GB); after trunk's wasm-opt -Oz the wasm is within 3% of the +# fat-LTO size (71.6 MB against 69.7 MB, measured). [profile.wasm-release] inherits = "release" opt-level = "z" -lto = "fat" -codegen-units = 1 +lto = "thin" +codegen-units = 16 strip = "debuginfo" [profile.wasm-release.package."*"]