team-ljyzipelo

공개

Merge pull request #80 from Team-LJY/fix/windows-renderer-fallback

Windows OpenGL 미지원 환경의 화면 시작 실패 수정
작성자
LeeJunyoung
작성 시각
커밋
8bfa25456b936346b4f1808233afb4551e769718
이 시점의 파일 보기

변경된 파일 10개

+523-85
수정experiments/rust-ui-memory-app/Cargo.lock+71-0
@@ -141,6 +141,12 @@ dependencies = [
141141 "zerocopy",
142142]
143143
144추가: [[package]]
145추가: name = "allocator-api2"
146추가: version = "0.2.21"
147추가: source = "registry+https://github.com/rust-lang/crates.io-index"
148추가: checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
149추가:
144150[[package]]
145151name = "android-activity"
146152version = "0.6.1"
@@ -810,6 +816,7 @@ dependencies = [
810816 "objc2-foundation 0.3.2",
811817 "parking_lot",
812818 "percent-encoding",
819추가: "pollster",
813820 "profiling",
814821 "raw-window-handle",
815822 "send_wrapper",
@@ -817,6 +824,7 @@ dependencies = [
817824 "wasm-bindgen",
818825 "web-sys",
819826 "web-time",
827추가: "wgpu",
820828 "windows-sys 0.61.2",
821829 "winit",
822830]
@@ -1358,6 +1366,19 @@ dependencies = [
13581366 "gl_generator",
13591367]
13601368
1369추가: [[package]]
1370추가: name = "gpu-allocator"
1371추가: version = "0.28.0"
1372추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1373추가: checksum = "51255ea7cfaadb6c5f1528d43e92a82acb2b96c43365989a28b2d44ee38f8795"
1374추가: dependencies = [
1375추가: "hashbrown 0.16.1",
1376추가: "log",
1377추가: "presser",
1378추가: "thiserror 2.0.21",
1379추가: "windows",
1380추가: ]
1381추가:
13611382[[package]]
13621383name = "guillotiere"
13631384version = "0.7.0"
@@ -1400,6 +1421,17 @@ dependencies = [
14001421 "foldhash 0.1.5",
14011422]
14021423
1424추가: [[package]]
1425추가: name = "hashbrown"
1426추가: version = "0.16.1"
1427추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1428추가: checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
1429추가: dependencies = [
1430추가: "allocator-api2",
1431추가: "equivalent",
1432추가: "foldhash 0.2.0",
1433추가: ]
1434추가:
14031435[[package]]
14041436name = "hashbrown"
14051437version = "0.17.1"
@@ -2133,6 +2165,15 @@ dependencies = [
21332165 "libredox",
21342166]
21352167
2168추가: [[package]]
2169추가: name = "ordered-float"
2170추가: version = "5.5.0"
2171추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2172추가: checksum = "8c7c9e0d9b23589f26070720bac724174bfec1083e82f7854cdd0267518343c0"
2173추가: dependencies = [
2174추가: "num-traits",
2175추가: ]
2176추가:
21362177[[package]]
21372178name = "ordered-stream"
21382179version = "0.2.0"
@@ -2357,6 +2398,12 @@ dependencies = [
23572398 "windows-sys 0.61.2",
23582399]
23592400
2401추가: [[package]]
2402추가: name = "pollster"
2403추가: version = "1.0.1"
2404추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2405추가: checksum = "bc6355899e1c9462875b6757c79f3caa011a1fdae12bbb1a2e72dd1f234f8336"
2406추가:
23602407[[package]]
23612408name = "polycool"
23622409version = "0.4.0"
@@ -2381,6 +2428,12 @@ dependencies = [
23812428 "portable-atomic",
23822429]
23832430
2431추가: [[package]]
2432추가: name = "presser"
2433추가: version = "0.3.1"
2434추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2435추가: checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa"
2436추가:
23842437[[package]]
23852438name = "proc-macro-crate"
23862439version = "3.5.0"
@@ -2447,6 +2500,12 @@ version = "6.0.0"
24472500source = "registry+https://github.com/rust-lang/crates.io-index"
24482501checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
24492502
2503추가: [[package]]
2504추가: name = "range-alloc"
2505추가: version = "0.1.5"
2506추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2507추가: checksum = "ca45419789ae5a7899559e9512e58ca889e41f04f1f2445e9f4b290ceccd1d08"
2508추가:
24502509[[package]]
24512510name = "raw-window-handle"
24522511version = "0.6.2"
@@ -3424,22 +3483,33 @@ version = "30.0.1"
34243483source = "registry+https://github.com/rust-lang/crates.io-index"
34253484checksum = "b6b7fb58561a792bc237628ba0792e332de418fefe145f13b5ed8201e6d52f58"
34263485dependencies = [
3486추가: "arrayvec",
3487추가: "bit-set",
34273488 "bitflags 2.13.2",
3489추가: "bytemuck",
34283490 "cfg-if",
34293491 "cfg_aliases",
3492추가: "gpu-allocator",
34303493 "hashbrown 0.17.1",
34313494 "libloading",
34323495 "log",
34333496 "naga",
34343497 "naga-types",
3498추가: "once_cell",
3499추가: "ordered-float",
3500추가: "parking_lot",
34353501 "portable-atomic",
34363502 "portable-atomic-util",
3503추가: "profiling",
3504추가: "range-alloc",
34373505 "raw-window-handle",
34383506 "renderdoc-sys",
34393507 "static_assertions",
34403508 "thiserror 2.0.21",
34413509 "wgpu-naga-bridge",
34423510 "wgpu-types",
3511추가: "windows",
3512추가: "windows-core",
34433513]
34443514
34453515[[package]]
@@ -4051,6 +4121,7 @@ name = "zipelo-ui-memory-app"
40514121version = "0.1.0"
40524122dependencies = [
40534123 "eframe",
4124추가: "wgpu",
40544125 "zipelo-app-core-memory",
40554126 "zipelo-archive-worker",
40564127]
수정experiments/rust-ui-memory-app/Cargo.toml+10-1
@@ -14,7 +14,7 @@ doctest = false
1414
1515[features]
1616default = []
17삭제: ui = ["dep:eframe"]
17추가: ui = ["dep:eframe", "dep:wgpu"]
1818ui-fixture = ["ui"]
1919
2020[dependencies]
@@ -42,3 +42,12 @@ path = "../../tests/rust-app-real-worker/flows.rs"
4242[[test]]
4343name = "format_contract"
4444path = "../../tests/rust-app-real-worker/formats.rs"
45추가:
46추가: [target.'cfg(target_os = "windows")'.dependencies]
47추가: wgpu = { version = "=30.0.1", optional = true, default-features = false, features = ["std", "dx12"] }
48추가: eframe = { version = "=0.37.0", optional = true, default-features = false, features = ["wgpu_no_default_features"] }
49추가:
50추가: [[test]]
51추가: name = "renderer_fallback"
52추가: path = "../../tests/rust-app-ui/renderer_fallback.rs"
53추가: required-features = ["ui"]
수정experiments/rust-ui-memory-app/src/app.rs+35-30
@@ -1,3 +1,5 @@
1추가: #[path = "renderer.rs"]
2추가: mod renderer;
13#[path = "system_font.rs"]
24mod system_font;
35
@@ -159,42 +161,45 @@ impl eframe::App for App {
159161
160162fn main() -> eframe::Result {
161163 let font = system_font::load().map_err(|e| eframe::Error::AppCreation(Box::new(e)))?;
162삭제: eframe::run_native(
164추가: renderer::run_native(
163165 "Zipelo 합성 메모리 작업",
164166 eframe::NativeOptions {
165삭제: renderer: eframe::Renderer::Glow,
166167 viewport: egui::ViewportBuilder::default()
167168 .with_inner_size([1060.0, 720.0])
168169 .with_min_inner_size([760.0, 540.0]),
169170 ..Default::default()
170171 },
171삭제: Box::new(move |cc| {
172삭제: let mut fonts = FontDefinitions::empty();
173삭제: let mut data = FontData::from_owned(font.bytes);
174삭제: data.index = font.face_index;
175삭제: fonts.font_data.insert("noto-kr".into(), data.into());
176삭제: fonts
177삭제: .families
178삭제: .insert(FontFamily::Proportional, vec!["noto-kr".into()]);
179삭제: cc.egui_ctx.set_fonts(fonts);
180삭제: cc.egui_ctx.set_visuals(egui::Visuals::light());
181삭제: cc.egui_ctx.style_mut_of(egui::Theme::Light, |style| {
182삭제: style
183삭제: .text_styles
184삭제: .insert(TextStyle::Body, FontId::proportional(18.0));
185삭제: style
186삭제: .text_styles
187삭제: .insert(TextStyle::Button, FontId::proportional(18.0));
188삭제: style
189삭제: .text_styles
190삭제: .insert(TextStyle::Heading, FontId::proportional(26.0));
191삭제: style.visuals.panel_fill = Color32::WHITE;
192삭제: style.visuals.override_text_color = Some(Color32::from_rgb(24, 39, 57));
193삭제: style.visuals.selection.bg_fill = Color32::from_rgb(211, 230, 246);
194삭제: style.spacing.item_spacing = egui::vec2(12.0, 10.0);
195삭제: style.spacing.button_padding = egui::vec2(14.0, 10.0);
196삭제: });
197삭제: Ok(Box::<App>::default())
198삭제: }),
172추가: || {
173추가: let bytes = font.bytes.clone();
174추가: let face_index = font.face_index;
175추가: Box::new(move |cc| {
176추가: let mut fonts = FontDefinitions::empty();
177추가: let mut data = FontData::from_owned(bytes);
178추가: data.index = face_index;
179추가: fonts.font_data.insert("noto-kr".into(), data.into());
180추가: fonts
181추가: .families
182추가: .insert(FontFamily::Proportional, vec!["noto-kr".into()]);
183추가: cc.egui_ctx.set_fonts(fonts);
184추가: cc.egui_ctx.set_visuals(egui::Visuals::light());
185추가: cc.egui_ctx.style_mut_of(egui::Theme::Light, |style| {
186추가: style
187추가: .text_styles
188추가: .insert(TextStyle::Body, FontId::proportional(18.0));
189추가: style
190추가: .text_styles
191추가: .insert(TextStyle::Button, FontId::proportional(18.0));
192추가: style
193추가: .text_styles
194추가: .insert(TextStyle::Heading, FontId::proportional(26.0));
195추가: style.visuals.panel_fill = Color32::WHITE;
196추가: style.visuals.override_text_color = Some(Color32::from_rgb(24, 39, 57));
197추가: style.visuals.selection.bg_fill = Color32::from_rgb(211, 230, 246);
198추가: style.spacing.item_spacing = egui::vec2(12.0, 10.0);
199추가: style.spacing.button_padding = egui::vec2(14.0, 10.0);
200추가: });
201추가: Ok(Box::<App>::default())
202추가: })
203추가: },
199204 )
200205}
수정experiments/rust-ui-memory-app/src/desktop.rs+95-53
@@ -1,71 +1,113 @@
1추가: #![cfg_attr(target_os = "windows", windows_subsystem = "windows")]
2추가:
13#[cfg(feature = "ui-fixture")]
24#[path = "../../../tests/rust-app-ui/fake.rs"]
35mod fake;
6추가: #[path = "renderer.rs"]
7추가: mod renderer;
48#[path = "system_font.rs"]
59mod system_font;
610use eframe::egui::{self, Color32, FontData, FontDefinitions, FontFamily, FontId, TextStyle};
711fn main() -> eframe::Result {
12추가: let result = run();
13추가: #[cfg(target_os = "windows")]
14추가: if let Err(error) = &result {
15추가: let message = if matches!(error, eframe::Error::AppCreation(_)) {
16추가: "앱을 시작하지 못했습니다. 설치 파일을 다시 설치한 뒤 시도해 주세요."
17추가: } else {
18추가: "이 PC에서 화면을 표시할 수 없습니다. 그래픽 드라이버를 업데이트해 주세요."
19추가: };
20추가: show_startup_error(message);
21추가: }
22추가: result
23추가: }
24추가:
25추가: #[cfg(target_os = "windows")]
26추가: fn show_startup_error(message: &str) {
27추가: #[link(name = "user32")]
28추가: unsafe extern "system" {
29추가: fn MessageBoxW(
30추가: window: *mut std::ffi::c_void,
31추가: text: *const u16,
32추가: caption: *const u16,
33추가: kind: u32,
34추가: ) -> i32;
35추가: }
36추가: let text: Vec<u16> = message.encode_utf16().chain(Some(0)).collect();
37추가: let caption: Vec<u16> = "Zipelo".encode_utf16().chain(Some(0)).collect();
38추가: // 종료까지 유효한 NUL 종료 문자열로 기본 오류 창을 표시함.
39추가: unsafe {
40추가: MessageBoxW(std::ptr::null_mut(), text.as_ptr(), caption.as_ptr(), 0x10);
41추가: }
42추가: }
43추가:
44추가: fn run() -> eframe::Result {
845 let font = system_font::load().map_err(|e| eframe::Error::AppCreation(Box::new(e)))?;
9삭제: eframe::run_native(
46추가: renderer::run_native(
1047 "Zipelo",
1148 eframe::NativeOptions {
12삭제: renderer: eframe::Renderer::Glow,
1349 viewport: egui::ViewportBuilder::default()
1450 .with_inner_size([1060.0, 720.0])
1551 .with_min_inner_size([760.0, 540.0]),
1652 ..Default::default()
1753 },
18삭제: Box::new(move |cc| {
19삭제: let mut fonts = FontDefinitions::empty();
20삭제: let mut data = FontData::from_owned(font.bytes);
21삭제: data.index = font.face_index;
22삭제: fonts.font_data.insert("noto-kr".into(), data.into());
23삭제: fonts
24삭제: .families
25삭제: .insert(FontFamily::Proportional, vec!["noto-kr".into()]);
26삭제: cc.egui_ctx.set_fonts(fonts);
27삭제: cc.egui_ctx.set_visuals(egui::Visuals::light());
28삭제: cc.egui_ctx.style_mut_of(egui::Theme::Light, |style| {
29삭제: style
30삭제: .text_styles
31삭제: .insert(TextStyle::Body, FontId::proportional(18.0));
32삭제: style
33삭제: .text_styles
34삭제: .insert(TextStyle::Button, FontId::proportional(18.0));
35삭제: style
36삭제: .text_styles
37삭제: .insert(TextStyle::Heading, FontId::proportional(26.0));
38삭제: style.visuals.panel_fill = Color32::WHITE;
39삭제: style.visuals.override_text_color = Some(Color32::from_rgb(24, 39, 57));
40삭제: style.visuals.selection.bg_fill = Color32::from_rgb(211, 230, 246);
41삭제: style.spacing.item_spacing = egui::vec2(12.0, 10.0);
42삭제: style.spacing.button_padding = egui::vec2(14.0, 10.0);
43삭제: });
44삭제: let (fixture, startup) = zipelo_ui_memory_app::archive_ui::launch_args(
45삭제: std::env::args_os().skip(1).collect(),
46삭제: std::env::current_dir()?,
47삭제: )
48삭제: .map_err(std::io::Error::other)?;
49삭제: let factory: Box<dyn zipelo_ui_memory_app::archive_ui::Factory> = if fixture {
50삭제: #[cfg(feature = "ui-fixture")]
51삭제: {
52삭제: Box::new(fake::FakeFactory::default())
53삭제: }
54삭제: #[cfg(not(feature = "ui-fixture"))]
55삭제: {
56삭제: return Err(Box::new(std::io::Error::other(
57삭제: "ui-fixture feature가 필요합니다",
58삭제: )));
59삭제: }
60삭제: } else {
61삭제: Box::new(
62삭제: zipelo_ui_memory_app::archive_process::ProcessFactory::sibling()
63삭제: .map_err(std::io::Error::other)?,
54추가: || {
55추가: let bytes = font.bytes.clone();
56추가: let face_index = font.face_index;
57추가: Box::new(move |cc| {
58추가: let mut fonts = FontDefinitions::empty();
59추가: let mut data = FontData::from_owned(bytes);
60추가: data.index = face_index;
61추가: fonts.font_data.insert("noto-kr".into(), data.into());
62추가: fonts
63추가: .families
64추가: .insert(FontFamily::Proportional, vec!["noto-kr".into()]);
65추가: cc.egui_ctx.set_fonts(fonts);
66추가: cc.egui_ctx.set_visuals(egui::Visuals::light());
67추가: cc.egui_ctx.style_mut_of(egui::Theme::Light, |style| {
68추가: style
69추가: .text_styles
70추가: .insert(TextStyle::Body, FontId::proportional(18.0));
71추가: style
72추가: .text_styles
73추가: .insert(TextStyle::Button, FontId::proportional(18.0));
74추가: style
75추가: .text_styles
76추가: .insert(TextStyle::Heading, FontId::proportional(26.0));
77추가: style.visuals.panel_fill = Color32::WHITE;
78추가: style.visuals.override_text_color = Some(Color32::from_rgb(24, 39, 57));
79추가: style.visuals.selection.bg_fill = Color32::from_rgb(211, 230, 246);
80추가: style.spacing.item_spacing = egui::vec2(12.0, 10.0);
81추가: style.spacing.button_padding = egui::vec2(14.0, 10.0);
82추가: });
83추가: let (fixture, startup) = zipelo_ui_memory_app::archive_ui::launch_args(
84추가: std::env::args_os().skip(1).collect(),
85추가: std::env::current_dir()?,
6486 )
65삭제: };
66삭제: Ok(Box::new(
67삭제: zipelo_ui_memory_app::archive_screen::ArchiveApp::new(factory, startup, fixture),
68삭제: ))
69삭제: }),
87추가: .map_err(std::io::Error::other)?;
88추가: let factory: Box<dyn zipelo_ui_memory_app::archive_ui::Factory> = if fixture {
89추가: #[cfg(feature = "ui-fixture")]
90추가: {
91추가: Box::new(fake::FakeFactory::default())
92추가: }
93추가: #[cfg(not(feature = "ui-fixture"))]
94추가: {
95추가: return Err(Box::new(std::io::Error::other(
96추가: "ui-fixture feature가 필요합니다",
97추가: )));
98추가: }
99추가: } else {
100추가: Box::new(
101추가: zipelo_ui_memory_app::archive_process::ProcessFactory::sibling()
102추가: .map_err(std::io::Error::other)?,
103추가: )
104추가: };
105추가: Ok(Box::new(
106추가: zipelo_ui_memory_app::archive_screen::ArchiveApp::new(
107추가: factory, startup, fixture,
108추가: ),
109추가: ))
110추가: })
111추가: },
70112 )
71113}
추가experiments/rust-ui-memory-app/src/renderer.rs+88-0
@@ -0,0 +1,88 @@
1추가: #[derive(Clone, Copy, Debug, PartialEq, Eq)]
2추가: pub enum Backend {
3추가: Dx12Hardware,
4추가: Dx12Software,
5추가: Glow,
6추가: }
7추가:
8추가: pub fn try_backends<E>(
9추가: windows: bool,
10추가: mut attempt: impl FnMut(Backend) -> Result<(), (E, bool)>,
11추가: ) -> Result<(), E> {
12추가: let order: &[Backend] = if windows {
13추가: &[Backend::Dx12Hardware, Backend::Dx12Software, Backend::Glow]
14추가: } else {
15추가: &[Backend::Glow]
16추가: };
17추가: let mut failure = None;
18추가: for &backend in order {
19추가: match attempt(backend) {
20추가: Ok(()) => return Ok(()),
21추가: Err((error, retry)) => {
22추가: if !retry {
23추가: return Err(error);
24추가: }
25추가: failure = Some(error);
26추가: }
27추가: }
28추가: }
29추가: Err(failure.expect("렌더러 시도 목록은 비어 있지 않음"))
30추가: }
31추가:
32추가: pub fn options(backend: Backend, mut options: eframe::NativeOptions) -> eframe::NativeOptions {
33추가: options.renderer = eframe::Renderer::Glow;
34추가: options.run_and_return = true;
35추가: #[cfg(target_os = "windows")]
36추가: if backend != Backend::Glow {
37추가: use eframe::{egui_wgpu, wgpu};
38추가: use std::sync::Arc;
39추가: let mut setup = egui_wgpu::WgpuSetupCreateNew::without_display_handle();
40추가: setup.instance_descriptor.backends = wgpu::Backends::DX12;
41추가: setup
42추가: .instance_descriptor
43추가: .backend_options
44추가: .dx12
45추가: .shader_compiler = wgpu::Dx12Compiler::Fxc;
46추가: setup.native_adapter_selector = Some(Arc::new(move |adapters, surface| {
47추가: adapters
48추가: .iter()
49추가: .find(|adapter| {
50추가: let software = adapter.get_info().device_type == wgpu::DeviceType::Cpu;
51추가: software == (backend == Backend::Dx12Software)
52추가: && surface.is_none_or(|surface| {
53추가: !surface.get_capabilities(adapter).formats.is_empty()
54추가: })
55추가: })
56추가: .cloned()
57추가: .ok_or_else(|| "사용 가능한 DirectX 화면 장치가 없음".into())
58추가: }));
59추가: options.renderer = eframe::Renderer::Wgpu;
60추가: options.wgpu_options.wgpu_setup = egui_wgpu::WgpuSetup::CreateNew(setup);
61추가: }
62추가: #[cfg(not(target_os = "windows"))]
63추가: let _ = backend;
64추가: options
65추가: }
66추가:
67추가: pub fn run_native(
68추가: title: &str,
69추가: native_options: eframe::NativeOptions,
70추가: mut create: impl FnMut() -> eframe::AppCreator<'static>,
71추가: ) -> eframe::Result {
72추가: use std::{cell::Cell, rc::Rc};
73추가: try_backends(cfg!(target_os = "windows"), |backend| {
74추가: let started = Rc::new(Cell::new(false));
75추가: let entered = started.clone();
76추가: let creator = create();
77추가: let result = eframe::run_native(
78추가: title,
79추가: options(backend, native_options.clone()),
80추가: Box::new(move |context| {
81추가: entered.set(true);
82추가: creator(context)
83추가: }),
84추가: );
85추가: // 앱 생성 뒤에는 작업이나 창을 중복 실행하지 않음.
86추가: result.map_err(|error| (error, !started.get()))
87추가: })
88추가: }
수정tests/rust-app-ui/README.md+11-0
@@ -17,3 +17,14 @@ cargo +1.99.1 run --locked --manifest-path experiments/rust-ui-memory-app/Cargo.
1717디자인은 흰 바탕 #FFFFFF, 글자 #182739, 선택 #D3E6F6, 강조 #174C7C를 사용함. 기존 한글 시스템 폰트와 본문/버튼 18px, 제목 26px를 유지함. 상단 작업 버튼, 가운데 파일 목록, 하단 진행/결과의 왼쪽 정렬 구조이며 작은 부가 설명, 장식 카드와 새 아이콘을 추가하지 않음.
1818
1919풀기 버튼은 raw GZ에만 출력명을 보내며 ZIP/TAR/TAR.GZ에는 None을 보냄. 모델과 가짜 작업자도 이 계약을 검증함. Start 전송 실패 시에는 연결을 보존하고 추가 요청을 막으며, 양쪽 EOF와 child wait가 모두 올 때까지 교체와 닫기를 허용하지 않음. 이때 Terminal이 없어도 종료 후 오류 확인 화면으로 이동하며 성공으로 표시하지 않음.
20추가:
21추가:
22추가: ## Windows 렌더러 시작 검증
23추가:
24추가: Windows는 DirectX 12 하드웨어 장치, 소프트웨어 장치(WARP), Glow 순서로 초기화를 시도합니다. 앱 생성 전에만 다음 렌더러를 시도하며 앱 생성 뒤 오류에는 작업을 중복 실행하지 않습니다. 모두 실패하면 한국어 안내 창을 표시합니다. Linux는 기존 Glow 경로를 유지합니다.
25추가:
26추가: ```sh
27추가: cargo +1.99.1 test --locked --manifest-path experiments/rust-ui-memory-app/Cargo.toml --features ui --test renderer_fallback
28추가: ```
29추가:
30추가: 이 시험은 선택 순서와 재시도 중단 조건을 검증합니다. Windows WARP와 안내 창의 실제 실행은 Windows 실기로 별도 확인해야 합니다. 파일 크기와 전체 로컬 검증 결과는 validation.json의 renderer_fallback에 기록합니다.
추가tests/rust-app-ui/renderer_fallback.rs+81-0
@@ -0,0 +1,81 @@
1추가: #[path = "../../experiments/rust-ui-memory-app/src/renderer.rs"]
2추가: #[allow(dead_code)]
3추가: mod renderer;
4추가: use renderer::{Backend, try_backends};
5추가:
6추가: #[test]
7추가: fn windows_tries_hardware_then_software_then_glow() {
8추가: let mut seen = Vec::new();
9추가: let result = try_backends(true, |backend| {
10추가: seen.push(backend);
11추가: Err((backend, true))
12추가: });
13추가: assert_eq!(
14추가: seen,
15추가: [Backend::Dx12Hardware, Backend::Dx12Software, Backend::Glow]
16추가: );
17추가: assert_eq!(result, Err(Backend::Glow));
18추가: }
19추가:
20추가: #[test]
21추가: fn successful_software_does_not_try_glow() {
22추가: let mut seen = Vec::new();
23추가: assert_eq!(
24추가: try_backends(true, |backend| {
25추가: seen.push(backend);
26추가: if backend == Backend::Dx12Hardware {
27추가: Err(((), true))
28추가: } else {
29추가: Ok(())
30추가: }
31추가: }),
32추가: Ok(())
33추가: );
34추가: assert_eq!(seen, [Backend::Dx12Hardware, Backend::Dx12Software]);
35추가: }
36추가:
37추가: #[test]
38추가: fn successful_hardware_stops_retries() {
39추가: let mut seen = Vec::new();
40추가: assert_eq!(
41추가: try_backends(true, |backend| {
42추가: seen.push(backend);
43추가: Ok::<_, ((), bool)>(())
44추가: }),
45추가: Ok(())
46추가: );
47추가: assert_eq!(seen, [Backend::Dx12Hardware]);
48추가: }
49추가:
50추가: #[test]
51추가: fn running_app_failure_is_not_restarted() {
52추가: let mut seen = Vec::new();
53추가: assert_eq!(
54추가: try_backends(true, |backend| {
55추가: seen.push(backend);
56추가: Err(("앱 생성 후", false))
57추가: }),
58추가: Err("앱 생성 후")
59추가: );
60추가: assert_eq!(seen, [Backend::Dx12Hardware]);
61추가: }
62추가:
63추가: #[test]
64추가: fn linux_only_tries_glow() {
65추가: let mut seen = Vec::new();
66추가: assert_eq!(
67추가: try_backends(false, |backend| {
68추가: seen.push(backend);
69추가: Err(((), true))
70추가: }),
71추가: Err(())
72추가: );
73추가: assert_eq!(seen, [Backend::Glow]);
74추가: }
75추가:
76추가: #[test]
77추가: fn options_keep_event_loop_available_for_retry() {
78추가: let options = renderer::options(Backend::Glow, eframe::NativeOptions::default());
79추가: assert!(options.run_and_return);
80추가: assert!(matches!(options.renderer, eframe::Renderer::Glow));
81추가: }
수정tests/rust-app-ui/validation.json+56-0
@@ -133,5 +133,61 @@
133133 "merge_heads": {
134134 "password_pr72": "ff86e6ddb7100781c4d3dc0dd388d10e86d2025c",
135135 "main": "e497fac4309018a2824b2f296a366a648f4429bf"
136추가: },
137추가: "renderer_fallback": {
138추가: "base_remote_main": "26bb9574dfab498b33825b1157678b146822055b",
139추가: "tested_source_local_commit": "84ca4cc3b0fa457e45c101a4ba5b3720fb80cdd0",
140추가: "tested_code_tree": "fec757180d04d57808fa424c7014a76816b8af86",
141추가: "command": "python3 tests/ci/run_rust.py local",
142추가: "exit_code": 0,
143추가: "rust_tests_passed": 953,
144추가: "runner_checks_passed": 34,
145추가: "linux_build_targets_passed": 21,
146추가: "linux_test_targets_passed": 21,
147추가: "windows_cross_targets_passed": 21,
148추가: "renderer_order_tests_passed": 6,
149추가: "windows_order": [
150추가: "DX12 hardware",
151추가: "DX12 software/WARP",
152추가: "Glow"
153추가: ],
154추가: "linux_order": [
155추가: "Glow"
156추가: ],
157추가: "retry_boundary": "앱 생성 전에만 재시도하며 앱 생성 뒤 오류나 정상 종료에는 다시 시작하지 않음",
158추가: "startup_failure_ui": "Windows MessageBoxW 한국어 안내와 GUI subsystem",
159추가: "baseline_package_commit": "9159859b761135a6957a3c527b4aa31cae1802b3",
160추가: "baseline_note": "9159859와 기준 main 사이 experiments/ 및 packaging/ 변경 없음. 사용자가 시험한 설치 파일과 앱 해시 일치.",
161추가: "artifacts": {
162추가: "app": {
163추가: "before_bytes": 20856408,
164추가: "before_sha256": "64486c3bbf3edde5041957755a21c738baddf3c5a920aaa1f09b143e9f2a05df",
165추가: "after_bytes": 29586667,
166추가: "after_sha256": "a6aabbc0d0411b34fe381e4b73fa737be5b163f6ffdcd562b571ffd5e9d99271",
167추가: "increase_bytes": 8730259,
168추가: "local_path": "tests/release-packages/runs/windows-renderer-final/payload/Zipelo.exe"
169추가: },
170추가: "installer": {
171추가: "before_bytes": 5609149,
172추가: "before_sha256": "fa9ba9f33897bf4794ff02a2e6151e22bce01b48a8a31eaeb8a0dfb370000ae4",
173추가: "after_bytes": 7473098,
174추가: "after_sha256": "e0023e413f09294bf9b123805a5f1f3feabf150f0c25d79952e3cb58a62b6a3f",
175추가: "increase_bytes": 1863949,
176추가: "local_path": "tests/release-packages/runs/windows-renderer-final/Zipelo-0.1.0-dev-windows-x64-setup.exe"
177추가: }
178추가: },
179추가: "windows_runtime_tested": false,
180추가: "warp_and_message_box_runtime_tested": false,
181추가: "native_linux_window_rerun": false,
182추가: "local_logs": [
183추가: "tests/renderer-local.log",
184추가: "tests/renderer-windows.log",
185추가: "tests/renderer-release.log"
186추가: ],
187추가: "initial_build_failures": [
188추가: "수동 교차 빌드에서 MinGW 기본 이름을 찾지 못해 기존 gcc-posix 경로를 지정함",
189추가: "설치 빌드의 생성 캐시가 Git 변경으로 잡혀 개인 저장소 제외 목록에 캐시 경로를 추가하고 같은 소스로 재실행함"
190추가: ],
191추가: "evidence_note": "검증과 패키지 생성 후 README와 이 검증 JSON만 갱신함"
136192 }
137193}
수정tests/rust-ui-memory-gui-races/Cargo.lock+71-0
@@ -129,6 +129,12 @@ dependencies = [
129129 "zerocopy",
130130]
131131
132추가: [[package]]
133추가: name = "allocator-api2"
134추가: version = "0.2.21"
135추가: source = "registry+https://github.com/rust-lang/crates.io-index"
136추가: checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
137추가:
132138[[package]]
133139name = "android-activity"
134140version = "0.6.1"
@@ -787,6 +793,7 @@ dependencies = [
787793 "objc2-foundation 0.3.2",
788794 "parking_lot",
789795 "percent-encoding",
796추가: "pollster",
790797 "profiling",
791798 "raw-window-handle",
792799 "send_wrapper",
@@ -794,6 +801,7 @@ dependencies = [
794801 "wasm-bindgen",
795802 "web-sys",
796803 "web-time",
804추가: "wgpu",
797805 "windows-sys 0.61.2",
798806 "winit",
799807]
@@ -1335,6 +1343,19 @@ dependencies = [
13351343 "gl_generator",
13361344]
13371345
1346추가: [[package]]
1347추가: name = "gpu-allocator"
1348추가: version = "0.28.0"
1349추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1350추가: checksum = "51255ea7cfaadb6c5f1528d43e92a82acb2b96c43365989a28b2d44ee38f8795"
1351추가: dependencies = [
1352추가: "hashbrown 0.16.1",
1353추가: "log",
1354추가: "presser",
1355추가: "thiserror 2.0.21",
1356추가: "windows",
1357추가: ]
1358추가:
13381359[[package]]
13391360name = "guillotiere"
13401361version = "0.7.0"
@@ -1377,6 +1398,17 @@ dependencies = [
13771398 "foldhash 0.1.5",
13781399]
13791400
1401추가: [[package]]
1402추가: name = "hashbrown"
1403추가: version = "0.16.1"
1404추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1405추가: checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
1406추가: dependencies = [
1407추가: "allocator-api2",
1408추가: "equivalent",
1409추가: "foldhash 0.2.0",
1410추가: ]
1411추가:
13801412[[package]]
13811413name = "hashbrown"
13821414version = "0.17.1"
@@ -2092,6 +2124,15 @@ dependencies = [
20922124 "libredox",
20932125]
20942126
2127추가: [[package]]
2128추가: name = "ordered-float"
2129추가: version = "5.5.0"
2130추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2131추가: checksum = "8c7c9e0d9b23589f26070720bac724174bfec1083e82f7854cdd0267518343c0"
2132추가: dependencies = [
2133추가: "num-traits",
2134추가: ]
2135추가:
20952136[[package]]
20962137name = "ordered-stream"
20972138version = "0.2.0"
@@ -2306,6 +2347,12 @@ dependencies = [
23062347 "windows-sys 0.61.2",
23072348]
23082349
2350추가: [[package]]
2351추가: name = "pollster"
2352추가: version = "1.0.1"
2353추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2354추가: checksum = "bc6355899e1c9462875b6757c79f3caa011a1fdae12bbb1a2e72dd1f234f8336"
2355추가:
23092356[[package]]
23102357name = "polycool"
23112358version = "0.4.0"
@@ -2330,6 +2377,12 @@ dependencies = [
23302377 "portable-atomic",
23312378]
23322379
2380추가: [[package]]
2381추가: name = "presser"
2382추가: version = "0.3.1"
2383추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2384추가: checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa"
2385추가:
23332386[[package]]
23342387name = "proc-macro-crate"
23352388version = "3.5.0"
@@ -2396,6 +2449,12 @@ version = "6.0.0"
23962449source = "registry+https://github.com/rust-lang/crates.io-index"
23972450checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
23982451
2452추가: [[package]]
2453추가: name = "range-alloc"
2454추가: version = "0.1.5"
2455추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2456추가: checksum = "ca45419789ae5a7899559e9512e58ca889e41f04f1f2445e9f4b290ceccd1d08"
2457추가:
23992458[[package]]
24002459name = "raw-window-handle"
24012460version = "0.6.2"
@@ -3362,22 +3421,33 @@ version = "30.0.1"
33623421source = "registry+https://github.com/rust-lang/crates.io-index"
33633422checksum = "b6b7fb58561a792bc237628ba0792e332de418fefe145f13b5ed8201e6d52f58"
33643423dependencies = [
3424추가: "arrayvec",
3425추가: "bit-set",
33653426 "bitflags 2.13.2",
3427추가: "bytemuck",
33663428 "cfg-if",
33673429 "cfg_aliases",
3430추가: "gpu-allocator",
33683431 "hashbrown 0.17.1",
33693432 "libloading",
33703433 "log",
33713434 "naga",
33723435 "naga-types",
3436추가: "once_cell",
3437추가: "ordered-float",
3438추가: "parking_lot",
33733439 "portable-atomic",
33743440 "portable-atomic-util",
3441추가: "profiling",
3442추가: "range-alloc",
33753443 "raw-window-handle",
33763444 "renderdoc-sys",
33773445 "static_assertions",
33783446 "thiserror 2.0.21",
33793447 "wgpu-naga-bridge",
33803448 "wgpu-types",
3449추가: "windows",
3450추가: "windows-core",
33813451]
33823452
33833453[[package]]
@@ -3975,6 +4045,7 @@ name = "zipelo-ui-memory-gui-races"
39754045version = "0.1.0"
39764046dependencies = [
39774047 "eframe",
4048추가: "wgpu",
39784049 "zipelo-app-core-memory",
39794050]
39804051
수정tests/rust-ui-memory-gui-races/Cargo.toml+5-1
@@ -11,7 +11,7 @@ autotests = false
1111
1212[features]
1313default = []
14삭제: gui-race-harness = ["dep:eframe"]
14추가: gui-race-harness = ["dep:eframe", "dep:wgpu"]
1515
1616[dependencies]
1717core_memory = { package = "zipelo-app-core-memory", path = "../../experiments/rust-app-core-memory" }
@@ -21,3 +21,7 @@ eframe = { version = "=0.37.0", optional = true, default-features = false, featu
2121name = "zipelo-ui-memory-gui-races"
2222path = "main.rs"
2323required-features = ["gui-race-harness"]
24추가:
25추가: [target.'cfg(target_os = "windows")'.dependencies]
26추가: wgpu = { version = "=30.0.1", optional = true, default-features = false, features = ["std", "dx12"] }
27추가: eframe = { version = "=0.37.0", optional = true, default-features = false, features = ["wgpu_no_default_features"] }