feat(render): preserve C16 fixture defaults and automatic Result preference with exact formatting bridge
This commit is contained in:
1 parent
415fb00232
commit
7ef3f51de4
9 files changed
+4268
No files matched your search
@@ -74,3 +74,8 @@ The original 516-case core result remains bound to its exact unchanged core sour
|
||||
## Exact19-path adopted Render composition
|
||||
|
||||
[Actual19 cumulative source](actual19-reviewed-source/README.md) preserves the independently source-reviewed V2 that ROOT adopted by exact RAW copy, with3571 members checked. It combines manual-final feedback, progressive certified optics and both W2 suffixes, CPU material routing/bridge/caption, UI252 with its explicit supported-feature/DTO-stage corrections, both Photographic fixes and Raster perspective/directional-core source. Reconstruct the exact previous C14 post-format base; this is an alternative to overlapping increments, never another layer on top of them. LF hunks and eight CRLF endpoints are explicitly bound. New66 declarations and planned242-case/49-marker selection are **unrun**; formatting/build/actual gates/native acceptance are still pending. Historical C14 remains36PASS/1FAIL/108unrun and no pass transfers.
|
||||
|
||||
<!-- c16-defaults-auto-result-source-20261030 -->
|
||||
## C16 source: fixture defaults and Result navigation
|
||||
|
||||
[C16 exact five-file source](c16-defaults-auto-result/README.md) is independently source-reviewed and adopted by RAW copy; the adjacent12-file C15 formatting bridge makes the Actual19→C15 post-format→C16 lineage explicit. It fixes the four invalid new-fixture calls and adds preference-compliant Result navigation after accepted GUI Start, retaining old behavior with `render_open_result_on_start=false`. Four new declarations remain unrun. C15 stays an actual four-E0599 build failure with0 test bodies/242 cases unrun; no build/test/native PASS transfers. Manifests record exact endpoint hashes/EOL and cumulative alternatives; no private execution files are published.
|
||||
@@ -0,0 +1,25 @@
|
||||
# C16 — fixture defaults and preference-compliant Result navigation
|
||||
|
||||
This exact five-file source successor has independent source review (`60695ce7`) and was adopted by verified RAW copy, with3572 source members checked and Git HEAD/index/unrelated WIP preserved. **No C16 runtime PASS is claimed.** At adoption the new source remained unformatted, uncompiled and unrun. Production draft #8938 is still not a ready implementation, installed fix or complete render parity.
|
||||
|
||||
## Reconstruct the exact base, then this cumulative change once
|
||||
|
||||
1. Reconstruct [Actual19](../actual19-reviewed-source/README.md) and its declared earlier protected27/C14 base.
|
||||
2. Concatenate the numbered `c15-postformat-delta-*.patch` parts in order, using `c15-postformat-manifest.json`, to reach the exact actual C15 post-format source `2fe4f37371e7376e02ae89a080e51fad82e6f6c564bfe8b8a8075c2951fe1f31`. The manifest gives each part's SHA and the whole concatenated patch SHA; file boundaries are preserved. That bridge describes the12 actual formatter-changed endpoints; before and after payloads were read and checked against the sealed source dictionaries, never inferred from hashes. It is source formatting evidence, not a successful build or tests.
|
||||
3. Apply `candidate.patch` once against that exact base. It is cumulative and is an **alternative** to separately applying the overlapping defaults252 and autoResultV2 patches. It is not a patch for production HEAD or arbitrary main.
|
||||
|
||||
Both patch files use LF-normalized textual hunks. The curated manifests and bindings preserve exact RAW before/candidate hashes, lengths, EOL counts and BOM status. Reconstruct only physical line endings explicitly and verify every final RAW SHA. In the C16 endpoints, `prefs.rs`, `prefs/graphics.rs` and `render_workspace_ribbon.rs` remain CRLF; UI tests and the new pending JSON remain LF. No universal literal RAW patch replay or fuzzy application is claimed. Actual adoption copied verified RAW candidates rather than applying normalized text to an unknown tree.
|
||||
|
||||
## Behavior and default change
|
||||
|
||||
**Changes a default: yes — successful GUI Start opens Result once; the earlier behavior is kept behind `render_open_result_on_start=false`.** The persisted preference has a Graphics checkbox/help/reset path. A successful GUI Start with accepted JobId registration invokes the existing Result-view command once. False preserves either current view; direct API Start, Check, errors, QueueFull and cache repaint do not acquire an automatic view change. A subsequent explicit Model selection remains respected. This does not replace Nateaux's panels/results implementation or alter final/provisional image/export authority.
|
||||
|
||||
The independent fixture correction replaces only four nonexistent `Stage`/`SurfaceBindings.clear` calls in two new tests with existing valid `Default` assignments and explicit empty-state preconditions. It does not change product contracts, original geometry, requests, branch assertions, tolerances or output oracles to fit the code. Corrected UI252 plus the unchanged original6879-byte AutoResult appendix yields UI255. Preferences116→117 and UI252→255 account for four new declarations; two new message IDs have all nine locale values.
|
||||
|
||||
## Failed evidence stays failed; source review is not execution
|
||||
|
||||
C15 completed formatting/check, then its own combined native-library test build failed with four `E0599` errors in those new fixture setups. **Zero tests and zero CPU markers executed; all242 selected cases remained unrun.** There was no complete qualified three-artifact set or real inventories. Independent terminal closure released the owned run; its raw failure is preserved. This successor does not relabel C15 as a pass, retry its unchanged source or inherit C14 test/build evidence.
|
||||
|
||||
The bounded source review found no actionable defect in this exact cumulative five-file packet. Actual formatting, fresh source binding, the sole cached serial builder's own artifacts/inventories/regressions and applicable strict/wasm/repository/full gates are still required before qualification. Native mouse/keyboard Result navigation, genuine manual-final accumulation, long-scene cadence/quality, cancellation and export remain acceptance work. The cooperative Raster navigation cases are not CPU/GPU image-quality proof. No physical GPU execution, additional strict TIR or real Raster directional consumer is enabled here.
|
||||
|
||||
Only source patches and curated relative-path bindings are in this folder. Private scripts, machine paths, admission/control/grant data, receipts and logs are excluded. Engineer owns canonical publication and later source-bound validation; this checkpoint grants no execution.
|
||||
@@ -0,0 +1,166 @@
|
||||
{
|
||||
"schema": 1,
|
||||
"status": "ACTUALLY_ADOPTED_SOURCE_ONLY_UNFORMATTED_UNCOMPILED_UNRUN_AT_ADOPTION",
|
||||
"base": {
|
||||
"description": "Exact actual C15 post-format source, after the adjacent formatter-only bridge",
|
||||
"manifest_sha256": "2fe4f37371e7376e02ae89a080e51fad82e6f6c564bfe8b8a8075c2951fe1f31",
|
||||
"formatter_bridge": "c15-postformat-manifest.json"
|
||||
},
|
||||
"files": [
|
||||
{
|
||||
"path": "crates/ui-egui/src/prefs.rs",
|
||||
"before_sha256": "c13838afa66969ab40de6825a252efd0436399a30d331f28724be4e1bfe11264",
|
||||
"candidate_sha256": "b90ea63d6238bf41cb467a41efcd2b3888196e3be60f2453c635078d0933c97d",
|
||||
"new_file": false,
|
||||
"delta_sha256": "552aa58c46f5c737e7dc216822d64a442ad3450e667050509a631dc1a8ea7da0"
|
||||
},
|
||||
{
|
||||
"path": "crates/ui-egui/src/prefs/graphics.rs",
|
||||
"before_sha256": "6168eff4e462477f57ab1ef496ff5917de0e21531f0acf9793c4798dcbcb9caf",
|
||||
"candidate_sha256": "e48ddcdf0fb9e203133d1d67c7cbba249ee0082b37d07585e9e54146324a2f64",
|
||||
"new_file": false,
|
||||
"delta_sha256": "e9732cb7ea2b1c1a684aadc14402be0bc4f14b87732cafb1063f231a0d938d20"
|
||||
},
|
||||
{
|
||||
"path": "crates/ui-egui/src/render_workspace_ribbon.rs",
|
||||
"before_sha256": "27fc255da6da75976edb4b37928b78ea034c6c579f258b3155f15d43e3237ffb",
|
||||
"candidate_sha256": "1f69c036f5b7327eb19b2495c7f3f3a30d2cb90a7f37f6b44980efbb37f06cf3",
|
||||
"new_file": false,
|
||||
"delta_sha256": "793d1970a5924e745448a280186d2fea265467a1cd4ac59e9f3014aa71aa5efb"
|
||||
},
|
||||
{
|
||||
"path": "crates/ui-egui/src/render_workspace_tests.rs",
|
||||
"before_sha256": "5eeb9bb333cad6936dae8bade8c3be0eece2cea7f52d274c6bd59b28c42625d9",
|
||||
"candidate_sha256": "2acd261a36f2baa0acedad44eed6cf67ad7d6ee895e2197539735a266c36ed3e",
|
||||
"new_file": false,
|
||||
"delta_sha256": "d06f36553129868fcca5fb00e40cf1e14035e31d0d43b99c78ceeadcd2229d6c"
|
||||
},
|
||||
{
|
||||
"path": "assets/locales/pending/render-result-on-start.json",
|
||||
"before_sha256": null,
|
||||
"candidate_sha256": "5ec777e3517710910dbdff067fcf55739961e2023290a2d673744a96505aa5e5",
|
||||
"new_file": true,
|
||||
"delta_sha256": "f69b7c1acebfdd623752a5dc01d7503b642eb6ea96d678d7815e120f0a73409c"
|
||||
}
|
||||
],
|
||||
"raw_endpoints": [
|
||||
{
|
||||
"path": "crates/ui-egui/src/prefs.rs",
|
||||
"before": {
|
||||
"sha256": "c13838afa66969ab40de6825a252efd0436399a30d331f28724be4e1bfe11264",
|
||||
"bytes": 377352,
|
||||
"eol": "CRLF",
|
||||
"crlf": 6770,
|
||||
"lf": 6770,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"candidate": {
|
||||
"sha256": "b90ea63d6238bf41cb467a41efcd2b3888196e3be60f2453c635078d0933c97d",
|
||||
"bytes": 378635,
|
||||
"eol": "CRLF",
|
||||
"crlf": 6790,
|
||||
"lf": 6790,
|
||||
"utf8_bom": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "crates/ui-egui/src/prefs/graphics.rs",
|
||||
"before": {
|
||||
"sha256": "6168eff4e462477f57ab1ef496ff5917de0e21531f0acf9793c4798dcbcb9caf",
|
||||
"bytes": 11761,
|
||||
"eol": "CRLF",
|
||||
"crlf": 204,
|
||||
"lf": 204,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"candidate": {
|
||||
"sha256": "e48ddcdf0fb9e203133d1d67c7cbba249ee0082b37d07585e9e54146324a2f64",
|
||||
"bytes": 11877,
|
||||
"eol": "CRLF",
|
||||
"crlf": 205,
|
||||
"lf": 205,
|
||||
"utf8_bom": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "crates/ui-egui/src/render_workspace_ribbon.rs",
|
||||
"before": {
|
||||
"sha256": "27fc255da6da75976edb4b37928b78ea034c6c579f258b3155f15d43e3237ffb",
|
||||
"bytes": 13010,
|
||||
"eol": "CRLF",
|
||||
"crlf": 285,
|
||||
"lf": 285,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"candidate": {
|
||||
"sha256": "1f69c036f5b7327eb19b2495c7f3f3a30d2cb90a7f37f6b44980efbb37f06cf3",
|
||||
"bytes": 13161,
|
||||
"eol": "CRLF",
|
||||
"crlf": 288,
|
||||
"lf": 288,
|
||||
"utf8_bom": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "crates/ui-egui/src/render_workspace_tests.rs",
|
||||
"before": {
|
||||
"sha256": "5eeb9bb333cad6936dae8bade8c3be0eece2cea7f52d274c6bd59b28c42625d9",
|
||||
"bytes": 545234,
|
||||
"eol": "LF",
|
||||
"crlf": 0,
|
||||
"lf": 10030,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"candidate": {
|
||||
"sha256": "2acd261a36f2baa0acedad44eed6cf67ad7d6ee895e2197539735a266c36ed3e",
|
||||
"bytes": 552355,
|
||||
"eol": "LF",
|
||||
"crlf": 0,
|
||||
"lf": 10169,
|
||||
"utf8_bom": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "assets/locales/pending/render-result-on-start.json",
|
||||
"before": null,
|
||||
"candidate": {
|
||||
"sha256": "5ec777e3517710910dbdff067fcf55739961e2023290a2d673744a96505aa5e5",
|
||||
"bytes": 2962,
|
||||
"eol": "LF",
|
||||
"crlf": 0,
|
||||
"lf": 38,
|
||||
"utf8_bom": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"ui_tests_before": 252,
|
||||
"ui_tests_candidate": 255,
|
||||
"prefs_tests_before": 116,
|
||||
"prefs_tests_candidate": 117,
|
||||
"added_test_declarations": 4,
|
||||
"change_default_line": "Changes a default: yes - successful GUI Start opens Result once, old behaviour kept behind preference render_open_result_on_start=false",
|
||||
"composition": {
|
||||
"original_autov2_ui_before_sha256": "5eeb9bb333cad6936dae8bade8c3be0eece2cea7f52d274c6bd59b28c42625d9",
|
||||
"original_autov2_ui_candidate_sha256": "d4338085adb86d040926d7df6e1b3b6188adffd22b0272a428732bc5a1320221",
|
||||
"corrected_ui252_sha256": "afb3daa7b2663d5b9372fdea7ff83ea0ceb5c35da43af10177a5ea6a0abeaaab",
|
||||
"auto_result_suffix_bytes": 6879,
|
||||
"expected_ui255_sha256": "2acd261a36f2baa0acedad44eed6cf67ad7d6ee895e2197539735a266c36ed3e",
|
||||
"other_candidates_identical": 4,
|
||||
"default_true_and_opt_off_unchanged": true
|
||||
},
|
||||
"predecessor_hashes": {
|
||||
"defaults252": {
|
||||
"manifest_sha256": "3c0d8e8d60276a054c48024badfa84ff78619f00ca70f0cb5753b97ff0d68d91",
|
||||
"proposal_sha256": "68b1fe88bebcb64c72dbe5f1b357de10784db2361fa2add2b0c2ea8a2b9fd642",
|
||||
"bindings_sha256": "0c8153845adb02dbf9f32d943631bc6e4efaee7960da95902c52d689ea515ad4"
|
||||
},
|
||||
"autoResultV2": {
|
||||
"manifest_sha256": "f993c9fb678565381838c96c54b1cf0a46989baebaaff32b36ddaced8867bb58",
|
||||
"proposal_sha256": "e71efa5b57deb5869b549b2c2eae69f0b50f79c88b52ba3b351115ef2d5eac3d",
|
||||
"bindings_sha256": "28bcd0455862a5eb321d1b713cd90fb6002cbe7b2ee2098a26908af5a2878615"
|
||||
}
|
||||
},
|
||||
"composition_policy": "Cumulative five-file successor after C15 formatting, not an additional application of the overlapping defaults252 or autoResultV2 patches. UI255 is corrected UI252 plus the same original6879-byte AutoResult appendix. Other four payloads are unchanged from their reviewed AutoResult predecessors.",
|
||||
"patch_EOLayout": "candidate.patch contains LF-normalized hunks. prefs.rs, prefs/graphics.rs and render_workspace_ribbon.rs must end in CRLF; UI tests and new pending JSON in LF. Raw hashes/sizes/EOL/BOM metadata are authoritative. No universal literal RAW diff replay claim.",
|
||||
"runtime_PASS_claimed": false
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,876 @@
|
||||
--- a/crates/ui-egui/src/render_workspace_tests.rs
|
||||
+++ b/crates/ui-egui/src/render_workspace_tests.rs
|
||||
@@ -8913,7 +8913,10 @@
|
||||
|
||||
#[test]
|
||||
fn explicit_cpu_recipe_builds_typed_optics_with_independent_linear_units_and_no_design_edit() {
|
||||
- use solidcraft_engine::render::{job::{DielectricBoundary, RaytraceOptions}, transmission::Transmission};
|
||||
+ use solidcraft_engine::render::{
|
||||
+ job::{DielectricBoundary, RaytraceOptions},
|
||||
+ transmission::Transmission,
|
||||
+ };
|
||||
let h = fixture();
|
||||
let document = h.app.session.doc.clone();
|
||||
let before = (h.app.session.revision, h.app.session.undo.len(), h.app.session.redo.len(), h.app.session.is_dirty());
|
||||
@@ -8985,10 +8988,19 @@
|
||||
let binding = &mut h.app.render_workspace.view.materials.bindings[0];
|
||||
match case {
|
||||
"coat" => binding.coat_enabled = true,
|
||||
- "maps" => { binding.maps_enabled = true; binding.maps.normal = "authored-normal.png".into(); }
|
||||
+ "maps" => {
|
||||
+ binding.maps_enabled = true;
|
||||
+ binding.maps.normal = "authored-normal.png".into();
|
||||
+ }
|
||||
"shadows" => binding.glass.shadows = true,
|
||||
- "subsurface" => binding.glass.subsurface = Some(solidcraft_engine::render::transmission::subsurface::Subsurface { scattering_per_mm: 0.1, anisotropy: 0.0 }),
|
||||
- _ => { binding.glass_enabled = false; binding.coat_enabled = true; }
|
||||
+ "subsurface" => {
|
||||
+ binding.glass.subsurface =
|
||||
+ Some(solidcraft_engine::render::transmission::subsurface::Subsurface { scattering_per_mm: 0.1, anisotropy: 0.0 })
|
||||
+ }
|
||||
+ _ => {
|
||||
+ binding.glass_enabled = false;
|
||||
+ binding.coat_enabled = true;
|
||||
+ }
|
||||
}
|
||||
let intent = format!("{:?}", h.app.render_workspace.view.materials);
|
||||
let mut request = json!({"settings":{"exposure_ev":0},"sentinel":"retain"});
|
||||
@@ -9094,96 +9106,110 @@
|
||||
fn progressive_optics_preserves_identity_and_saved_gpu_conflicts_without_mutation() {
|
||||
let mut h = fixture();
|
||||
let document = h.app.session.doc.clone();
|
||||
- let history = (h.app.session.revision,h.app.session.undo.len(),h.app.session.is_dirty());
|
||||
- let authored = format!("{:?}",h.app.render_workspace.view.materials.bindings[0]);
|
||||
+ let history = (h.app.session.revision, h.app.session.undo.len(), h.app.session.is_dirty());
|
||||
+ let authored = format!("{:?}", h.app.render_workspace.view.materials.bindings[0]);
|
||||
h.app.render_workspace.view.raytrace.progressive = Some(Default::default());
|
||||
- let progressive_final = runtime_image_request(&h.app,false).unwrap();
|
||||
+ let progressive_final = runtime_image_request(&h.app, false).unwrap();
|
||||
let final_options: RaytraceOptions = serde_json::from_value(progressive_final["raytrace"].clone()).unwrap();
|
||||
final_options.validate().unwrap();
|
||||
- assert_eq!(final_options.primary_samples,1);
|
||||
- assert_eq!(final_options.progressive.unwrap().samples_per_pixel,16);
|
||||
- assert_eq!(final_options.progressive.unwrap().seed,0);
|
||||
+ assert_eq!(final_options.primary_samples, 1);
|
||||
+ assert_eq!(final_options.progressive.unwrap().samples_per_pixel, 16);
|
||||
+ assert_eq!(final_options.progressive.unwrap().seed, 0);
|
||||
let optics = progressive_final["raytrace"]["dielectrics"].clone();
|
||||
- assert_eq!(optics.as_array().unwrap().len(),1);
|
||||
- assert_eq!(optics[0]["body_name"],"Optics");
|
||||
- assert_eq!(optics[0]["boundary"],"closed_box");
|
||||
- assert_eq!(optics[0]["ior"],1.5);
|
||||
+ assert_eq!(optics.as_array().unwrap().len(), 1);
|
||||
+ assert_eq!(optics[0]["body_name"], "Optics");
|
||||
+ assert_eq!(optics[0]["boundary"], "closed_box");
|
||||
+ assert_eq!(optics[0]["ior"], 1.5);
|
||||
assert!(h.app.render_workspace.view.materials.bindings[0].cpu_optics);
|
||||
let from_progressive = interactive_request(&h.app).unwrap();
|
||||
- assert_eq!(from_progressive["raytrace"]["dielectrics"],optics,"preview conversion cannot erase or replace the authored optical material");
|
||||
+ assert_eq!(from_progressive["raytrace"]["dielectrics"], optics, "preview conversion cannot erase or replace the authored optical material");
|
||||
assert!(h.app.render_workspace.view.materials.bindings[0].glass_enabled);
|
||||
h.app.render_workspace.view.raytrace.progressive = None;
|
||||
let from_fixed = interactive_request(&h.app).unwrap();
|
||||
- assert_eq!(from_fixed["raytrace"]["dielectrics"],optics,"Fixed editor preview still carries certified optics");
|
||||
+ assert_eq!(from_fixed["raytrace"]["dielectrics"], optics, "Fixed editor preview still carries certified optics");
|
||||
let progressive_input: RaytraceOptions = serde_json::from_value(from_progressive["raytrace"].clone()).unwrap();
|
||||
progressive_input.validate().unwrap();
|
||||
- assert_eq!(progressive_input.primary_samples,1);
|
||||
- assert_eq!(progressive_input.progressive.unwrap().samples_per_pixel,16);
|
||||
- assert_eq!(progressive_input.progressive.unwrap().seed,0);
|
||||
+ assert_eq!(progressive_input.primary_samples, 1);
|
||||
+ assert_eq!(progressive_input.progressive.unwrap().samples_per_pixel, 16);
|
||||
+ assert_eq!(progressive_input.progressive.unwrap().seed, 0);
|
||||
let fixed_input: RaytraceOptions = serde_json::from_value(from_fixed["raytrace"].clone()).unwrap();
|
||||
fixed_input.validate().unwrap();
|
||||
- assert_eq!(fixed_input.primary_samples,1);
|
||||
- assert!(fixed_input.progressive.is_none(),"the UI Fixed DTO stays Fixed until the engine preview conversion");
|
||||
- assert!(h.app.render_workspace.view.raytrace.progressive.is_none(),"constructing preview intent cannot change the manual-final editor");
|
||||
+ assert_eq!(fixed_input.primary_samples, 1);
|
||||
+ assert!(fixed_input.progressive.is_none(), "the UI Fixed DTO stays Fixed until the engine preview conversion");
|
||||
+ assert!(h.app.render_workspace.view.raytrace.progressive.is_none(), "constructing preview intent cannot change the manual-final editor");
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
- if native_host(&mut h,"progressive_bridge_obsolete_guard_adaptation") {
|
||||
- use solidcraft_engine::render::job::{JobId,Phase,interactive::VisualRevision};
|
||||
+ if native_host(&mut h, "progressive_bridge_obsolete_guard_adaptation") {
|
||||
+ use solidcraft_engine::render::job::{JobId, Phase, interactive::VisualRevision};
|
||||
use std::time::Duration;
|
||||
// Same original20x20/one-pixel/50-distance inputs: this is actual
|
||||
// capture/admission/completion, not a Beer pixel oracle (jitter may miss).
|
||||
let mut final_params = progressive_final.clone();
|
||||
final_params["progressive_feedback"] = json!(true);
|
||||
- let checked = h.app.run("render.preflight",final_params.clone()).unwrap();
|
||||
- let started = h.app.run("render.start",final_params).unwrap();
|
||||
+ let checked = h.app.run("render.preflight", final_params.clone()).unwrap();
|
||||
+ let started = h.app.run("render.start", final_params).unwrap();
|
||||
let final_id: JobId = serde_json::from_value(started["job"].clone()).unwrap();
|
||||
let final_job = h.app.session.render_job_handle(final_id).unwrap();
|
||||
let final_status = final_job.wait_timeout(Duration::from_secs(60)).unwrap();
|
||||
- assert_eq!(final_status.progress.phase,Phase::Completed,"{:?}",final_status.error);
|
||||
- assert_eq!(serde_json::to_value(&final_status.request).unwrap(),checked["request"]);
|
||||
- assert_eq!(json!(final_status.request.raytrace),progressive_final["raytrace"]);
|
||||
+ assert_eq!(final_status.progress.phase, Phase::Completed, "{:?}", final_status.error);
|
||||
+ assert_eq!(serde_json::to_value(&final_status.request).unwrap(), checked["request"]);
|
||||
+ assert_eq!(json!(final_status.request.raytrace), progressive_final["raytrace"]);
|
||||
assert!(!final_status.options.nested_media);
|
||||
assert!(final_job.protected_preview_report().unwrap().is_some());
|
||||
let final_bytes = final_job.frame().unwrap().unwrap().png().to_vec();
|
||||
- for (index,params) in [&from_progressive,&from_fixed].into_iter().enumerate() {
|
||||
+ for (index, params) in [&from_progressive, &from_fixed].into_iter().enumerate() {
|
||||
let context = h.app.session.interactive_render().unwrap();
|
||||
- context.enable(VisualRevision {
|
||||
- scene_generation:h.app.session.revision,visual_revision:index as u64+1,
|
||||
- },Duration::ZERO).unwrap();
|
||||
+ context
|
||||
+ .enable(VisualRevision { scene_generation: h.app.session.revision, visual_revision: index as u64 + 1 }, Duration::ZERO)
|
||||
+ .unwrap();
|
||||
let ticket = context.capture(Duration::from_millis(200)).unwrap().unwrap();
|
||||
- let snapshot = context.snapshot(&h.app.session,ticket,params).unwrap();
|
||||
- assert!(snapshot.run().unwrap(),"real optical snapshot must be admitted/adopted");
|
||||
+ let snapshot = context.snapshot(&h.app.session, ticket, params).unwrap();
|
||||
+ assert!(snapshot.run().unwrap(), "real optical snapshot must be admitted/adopted");
|
||||
let job = context.current().unwrap().unwrap();
|
||||
let status = job.wait_timeout(Duration::from_secs(60)).unwrap();
|
||||
- assert_eq!(status.progress.phase,Phase::Completed,"{:?}",status.error);
|
||||
- assert_eq!(status.resolved.executor.as_str(),"cpu-raytrace");
|
||||
+ assert_eq!(status.progress.phase, Phase::Completed, "{:?}", status.error);
|
||||
+ assert_eq!(status.resolved.executor.as_str(), "cpu-raytrace");
|
||||
let options = status.request.raytrace.as_ref().unwrap();
|
||||
- assert_eq!(serde_json::to_value(&options.dielectrics).unwrap(),optics);
|
||||
- assert_eq!(options.primary_samples,1);
|
||||
- assert_eq!(options.progressive.unwrap().samples_per_pixel,16);
|
||||
- assert_eq!(options.progressive.unwrap().seed,0);
|
||||
- assert_eq!((status.request.width,status.request.height),(1,1));
|
||||
+ assert_eq!(serde_json::to_value(&options.dielectrics).unwrap(), optics);
|
||||
+ assert_eq!(options.primary_samples, 1);
|
||||
+ assert_eq!(options.progressive.unwrap().samples_per_pixel, 16);
|
||||
+ assert_eq!(options.progressive.unwrap().seed, 0);
|
||||
+ assert_eq!((status.request.width, status.request.height), (1, 1));
|
||||
assert!(!status.options.nested_media);
|
||||
- assert_eq!(job.id(),ticket.job_id());
|
||||
+ assert_eq!(job.id(), ticket.job_id());
|
||||
assert!(job.frame().unwrap().is_some());
|
||||
- assert!(h.app.session.render_job_handle(job.id()).is_err(),"Interactive keeps a separate non-export owner");
|
||||
+ assert!(h.app.session.render_job_handle(job.id()).is_err(), "Interactive keeps a separate non-export owner");
|
||||
context.disable().unwrap();
|
||||
- assert_eq!(h.app.session.render_job_handle(final_id).unwrap().frame().unwrap().unwrap().png(),final_bytes.as_slice());
|
||||
+ assert_eq!(h.app.session.render_job_handle(final_id).unwrap().frame().unwrap().unwrap().png(), final_bytes.as_slice());
|
||||
}
|
||||
}
|
||||
- assert!(Arc::ptr_eq(&document,&h.app.session.doc));
|
||||
- assert_eq!(history,(h.app.session.revision,h.app.session.undo.len(),h.app.session.is_dirty()));
|
||||
- assert_eq!(format!("{:?}",h.app.render_workspace.view.materials.bindings[0]),authored);
|
||||
+ assert!(Arc::ptr_eq(&document, &h.app.session.doc));
|
||||
+ assert_eq!(history, (h.app.session.revision, h.app.session.undo.len(), h.app.session.is_dirty()));
|
||||
+ assert_eq!(format!("{:?}", h.app.render_workspace.view.materials.bindings[0]), authored);
|
||||
let mut request = wire(&h);
|
||||
let before = request.clone();
|
||||
assert!(materials::params(&h.app, &mut request).unwrap_err().contains(h.app.tr("render.cpu_optics_conflict")));
|
||||
assert_eq!(request, before);
|
||||
let target = h.app.render_workspace.view.materials.bindings[0].target.stable_target.clone().unwrap();
|
||||
- h.app.render_workspace.view.draft.optics.set(solidcraft_engine::doc::render_optics::SavedOptics {
|
||||
- target, optics: solidcraft_engine::doc::render_optics::OpticalMaterial {
|
||||
- ior: 1.5, absorption_per_mm: [0.0; 3], boundary: solidcraft_engine::doc::render_optics::OpticalBoundary::ClosedMesh,
|
||||
- thickness_mm: 0.0, shadow_transmission: false, subsurface: None,
|
||||
- },
|
||||
- }, false).unwrap();
|
||||
+ h.app
|
||||
+ .render_workspace
|
||||
+ .view
|
||||
+ .draft
|
||||
+ .optics
|
||||
+ .set(
|
||||
+ solidcraft_engine::doc::render_optics::SavedOptics {
|
||||
+ target,
|
||||
+ optics: solidcraft_engine::doc::render_optics::OpticalMaterial {
|
||||
+ ior: 1.5,
|
||||
+ absorption_per_mm: [0.0; 3],
|
||||
+ boundary: solidcraft_engine::doc::render_optics::OpticalBoundary::ClosedMesh,
|
||||
+ thickness_mm: 0.0,
|
||||
+ shadow_transmission: false,
|
||||
+ subsurface: None,
|
||||
+ },
|
||||
+ },
|
||||
+ false,
|
||||
+ )
|
||||
+ .unwrap();
|
||||
assert!(runtime_image_request(&h.app, false).is_err());
|
||||
assert_eq!(h.app.render_workspace.view.draft.optics.len(), 1);
|
||||
}
|
||||
@@ -9206,7 +9232,8 @@
|
||||
use solidcraft_engine::render::job::CpuHost;
|
||||
let host = CpuHost::for_platform().unwrap();
|
||||
let available = host.kind() == solidcraft_engine::render::job::HostKind::NativeWorker
|
||||
- && host.is_available() && host.validate_integrator(Integrator::Raytrace).is_ok();
|
||||
+ && host.is_available()
|
||||
+ && host.validate_integrator(Integrator::Raytrace).is_ok();
|
||||
h.app.session.set_render_job_host(Some(host.clone())).unwrap();
|
||||
h.app.render_workspace.image_host = Some(host);
|
||||
if !available {
|
||||
@@ -9250,7 +9277,9 @@
|
||||
#[test]
|
||||
fn native_library_box_reaches_same_cpu_check_start_and_real_beer_pixels() {
|
||||
let mut h = fixture();
|
||||
- if !native_host(&mut h, "library_box") { return; }
|
||||
+ if !native_host(&mut h, "library_box") {
|
||||
+ return;
|
||||
+ }
|
||||
// Explicit author edit isolates Beer: index-matched boundaries have zero
|
||||
// Fresnel reflection, 4 mm actual distance yields [.98,.99,1].
|
||||
let glass = &mut h.app.render_workspace.view.materials.bindings[0].glass;
|
||||
@@ -9263,7 +9292,9 @@
|
||||
#[test]
|
||||
fn native_cpu_optics_admission_preserves_opacity_and_refuses_false_thin_certificate() {
|
||||
let mut h = fixture();
|
||||
- if !native_host(&mut h, "opacity_and_certificate") { return; }
|
||||
+ if !native_host(&mut h, "opacity_and_certificate") {
|
||||
+ return;
|
||||
+ }
|
||||
h.app.render_workspace.view.materials.bindings[0].glass.boundary = materials::Boundary::Thin;
|
||||
let request = image_params(&h.app).unwrap();
|
||||
for command in ["render.preflight", "render.start"] {
|
||||
@@ -9288,7 +9319,9 @@
|
||||
#[test]
|
||||
fn native_thin_library_recipe_uses_actual_imported_planar_certificate_and_virtual_distance() {
|
||||
let mut h = fixture();
|
||||
- if !native_host(&mut h, "library_thin") { return; }
|
||||
+ if !native_host(&mut h, "library_thin") {
|
||||
+ return;
|
||||
+ }
|
||||
let path = h.dir.join("original-optical-sheet.stl");
|
||||
// Original one-triangle geometry, not a box proxy or commercial fixture.
|
||||
std::fs::write(&path, b"solid OriginalSheet\nfacet normal 0 0 1\nouter loop\nvertex -20 -20 2\nvertex 20 -20 2\nvertex 0 20 2\nendloop\nendfacet\nendsolid OriginalSheet\n").unwrap();
|
||||
@@ -9313,7 +9346,9 @@
|
||||
#[test]
|
||||
fn native_library_nested_opt_in_preserves_real_child_medium_and_default_refusal() {
|
||||
let mut h = fixture();
|
||||
- if !native_host(&mut h, "library_nested") { return; }
|
||||
+ if !native_host(&mut h, "library_nested") {
|
||||
+ return;
|
||||
+ }
|
||||
h.app.run("solid.box", json!({"length":10,"width":10,"height":2,"center":[0,0,2],"operation":"new","body_name":"Inner"})).unwrap();
|
||||
h.app.render_workspace.view.materials.bindings.clear();
|
||||
bind_recipe(&mut h, "Optics", "starter.glass.low-iron-clear", materials::Boundary::Box);
|
||||
@@ -9340,7 +9375,9 @@
|
||||
#[test]
|
||||
fn native_cpu_optics_refuses_face_alpha_and_general_closed_geometry_without_repairs() {
|
||||
let mut h = fixture();
|
||||
- if !native_host(&mut h, "face_alpha_and_sphere") { return; }
|
||||
+ if !native_host(&mut h, "face_alpha_and_sphere") {
|
||||
+ return;
|
||||
+ }
|
||||
h.app.run("appearance.assign", json!({"body":"Optics","faces":[[0,0,4]],"color":"#abcdef","opacity":0.5})).unwrap();
|
||||
let mut binding = h.app.render_workspace.view.materials.bindings[0].clone();
|
||||
materials::revalidate(&mut h.app, &mut binding).unwrap();
|
||||
@@ -9399,7 +9436,9 @@
|
||||
fn native_original_library_ior_and_hdr_survive_check_start_and_captured_file_change() {
|
||||
use solidcraft_engine::render::job::{JobId, Phase};
|
||||
let mut h = fixture();
|
||||
- if !native_host(&mut h, "library_ior_hdr") { return; }
|
||||
+ if !native_host(&mut h, "library_ior_hdr") {
|
||||
+ return;
|
||||
+ }
|
||||
let path = h.dir.join("original-optical-white.hdr");
|
||||
let bytes = original_hdr_bytes(128, true);
|
||||
std::fs::write(&path, &bytes).unwrap();
|
||||
@@ -9432,9 +9471,16 @@
|
||||
#[test]
|
||||
fn native_eight_optical_library_targets_admit_without_raising_the_ninth_target_limit() {
|
||||
let mut h = fixture();
|
||||
- if !native_host(&mut h, "eight_library_targets") { return; }
|
||||
+ if !native_host(&mut h, "eight_library_targets") {
|
||||
+ return;
|
||||
+ }
|
||||
for index in 1..=8 {
|
||||
- h.app.run("solid.box", json!({"length":2,"width":2,"height":2,"corner":[30*index,0,0],"body_name":format!("Optics{index}"),"operation":"new"})).unwrap();
|
||||
+ h.app
|
||||
+ .run(
|
||||
+ "solid.box",
|
||||
+ json!({"length":2,"width":2,"height":2,"corner":[30*index,0,0],"body_name":format!("Optics{index}"),"operation":"new"}),
|
||||
+ )
|
||||
+ .unwrap();
|
||||
}
|
||||
h.app.render_workspace.view.materials.bindings.clear();
|
||||
bind_recipe(&mut h, "Optics", "starter.glass.low-iron-clear", materials::Boundary::Box);
|
||||
@@ -9482,9 +9528,16 @@
|
||||
for language in ["en", "es", "de", "ko", "ar", "he", "ja", "vi", "zh"] {
|
||||
let locale = crate::i18n::Locale::for_language(language);
|
||||
for key in [
|
||||
- "render.cpu_optics_boundary", "render.cpu_optics_conflict", "render.cpu_optics_enable",
|
||||
- "render.cpu_optics_explicit", "render.cpu_optics_fixed", "render.cpu_optics_help",
|
||||
- "render.cpu_optics_limit", "render.cpu_optics_request", "render.cpu_optics_saved", "render.cpu_optics_unsupported",
|
||||
+ "render.cpu_optics_boundary",
|
||||
+ "render.cpu_optics_conflict",
|
||||
+ "render.cpu_optics_enable",
|
||||
+ "render.cpu_optics_explicit",
|
||||
+ "render.cpu_optics_fixed",
|
||||
+ "render.cpu_optics_help",
|
||||
+ "render.cpu_optics_limit",
|
||||
+ "render.cpu_optics_request",
|
||||
+ "render.cpu_optics_saved",
|
||||
+ "render.cpu_optics_unsupported",
|
||||
] {
|
||||
assert_ne!(locale.text(key), key, "{language}: {key}");
|
||||
assert!(!locale.text(key).is_empty(), "{language}: {key}");
|
||||
@@ -9494,7 +9547,11 @@
|
||||
|
||||
fn editor_frame(h: &mut Harness, events: Vec<egui::Event>) {
|
||||
let mut output = h.ctx.run_ui(
|
||||
- egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(480.0, 2400.0))), events, ..Default::default() },
|
||||
+ egui::RawInput {
|
||||
+ screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(480.0, 2400.0))),
|
||||
+ events,
|
||||
+ ..Default::default()
|
||||
+ },
|
||||
|ui| {
|
||||
ui.set_width(420.0);
|
||||
materials::selection_controls(&mut h.app, ui, Some("Optics"));
|
||||
@@ -9506,9 +9563,13 @@
|
||||
fn editor_click(h: &mut Harness, id: &str) {
|
||||
let at = crate::scenario::rect_of(id).unwrap().center();
|
||||
for pressed in [true, false] {
|
||||
- editor_frame(h, vec![egui::Event::PointerMoved(at), egui::Event::PointerButton {
|
||||
- pos: at, button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::NONE,
|
||||
- }]);
|
||||
+ editor_frame(
|
||||
+ h,
|
||||
+ vec![
|
||||
+ egui::Event::PointerMoved(at),
|
||||
+ egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::NONE },
|
||||
+ ],
|
||||
+ );
|
||||
}
|
||||
editor_frame(h, vec![]);
|
||||
}
|
||||
@@ -9568,16 +9629,12 @@
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
mod manual_final_cpu_feedback_tests {
|
||||
use super::*;
|
||||
- use solidcraft_engine::render::job::{
|
||||
- CpuHost, CpuProgressiveOptions, HostKind, JobHandle, PartialPreviewPlan,
|
||||
- PartialPreviewProjection, Phase,
|
||||
- };
|
||||
+ use solidcraft_engine::render::job::{CpuHost, CpuProgressiveOptions, HostKind, JobHandle, PartialPreviewPlan, PartialPreviewProjection, Phase};
|
||||
|
||||
fn fixture(width: u32, height: u32, samples: u32, background: [u8; 3], case: &str) -> Option<Harness> {
|
||||
let mut h = Harness::new();
|
||||
let host = CpuHost::for_platform().unwrap();
|
||||
- let available = host.kind() == HostKind::NativeWorker && host.is_available()
|
||||
- && host.validate_integrator(Integrator::Raytrace).is_ok();
|
||||
+ let available = host.kind() == HostKind::NativeWorker && host.is_available() && host.validate_integrator(Integrator::Raytrace).is_ok();
|
||||
h.app.session.set_render_job_host(Some(host.clone())).unwrap();
|
||||
h.app.render_workspace.image_host = Some(host);
|
||||
h.app.ui.tab = "RENDER".into();
|
||||
@@ -9591,7 +9648,9 @@
|
||||
view.draft.exposure_ev = 0.0;
|
||||
view.transparent = false;
|
||||
view.raytrace = RaytraceOptions {
|
||||
- primary_samples: 1, lights: Some(Vec::new()), shadows: false,
|
||||
+ primary_samples: 1,
|
||||
+ lights: Some(Vec::new()),
|
||||
+ shadows: false,
|
||||
progressive: Some(CpuProgressiveOptions { samples_per_pixel: samples, seed: 83 }),
|
||||
..Default::default()
|
||||
};
|
||||
@@ -9602,8 +9661,8 @@
|
||||
"raytrace":{"primary_samples":1,"lights":[],"shadows":false,
|
||||
"progressive":{"samples_per_pixel":samples,"seed":83}}});
|
||||
assert!(image_params(&h.app).is_err());
|
||||
- assert!(h.app.run("render.preflight",wire.clone()).is_err());
|
||||
- assert!(h.app.run("render.start",wire).is_err());
|
||||
+ assert!(h.app.run("render.preflight", wire.clone()).is_err());
|
||||
+ assert!(h.app.run("render.start", wire).is_err());
|
||||
assert!(h.app.render_workspace.view.job.is_none());
|
||||
assert!(h.app.render_workspace.final_partial.is_none());
|
||||
eprintln!("MANUAL_FINAL_CPU_BRANCH case={case} cpu_supported=false unsupported_refusal_asserted=true");
|
||||
@@ -9614,12 +9673,12 @@
|
||||
}
|
||||
|
||||
fn actual_final(h: &mut Harness) -> JobHandle {
|
||||
- ribbon::perform_job(&mut h.app,"render.start").unwrap();
|
||||
+ ribbon::perform_job(&mut h.app, "render.start").unwrap();
|
||||
let job = h.app.render_workspace.view.job.unwrap();
|
||||
let handle = h.app.session.render_job_handle(job).unwrap();
|
||||
let status = handle.wait_timeout(Duration::from_secs(60)).unwrap();
|
||||
- assert_eq!(status.progress.phase,Phase::Completed,"{:?}",status.error);
|
||||
- assert_eq!(status.resolved.executor.as_str(),"cpu-raytrace");
|
||||
+ assert_eq!(status.progress.phase, Phase::Completed, "{:?}", status.error);
|
||||
+ assert_eq!(status.resolved.executor.as_str(), "cpu-raytrace");
|
||||
assert!(handle.frame().unwrap().is_some());
|
||||
assert!(handle.protected_preview_report().unwrap().is_some());
|
||||
handle
|
||||
@@ -9629,170 +9688,173 @@
|
||||
// Derive bounded display pixels from an actual completed native final, then
|
||||
// author an explicit source-frontier descriptor to exercise the UI policy.
|
||||
// No JobHandle, host status, PreviewInfo or GPU executor is fabricated.
|
||||
- fn install_policy_partial(
|
||||
- h: &mut Harness, handle: &JobHandle, passes: u32, prefix: u64, sequence: u64,
|
||||
- ) -> interactive::PartialSampling {
|
||||
- use sha2::{Digest,Sha256};
|
||||
+ fn install_policy_partial(h: &mut Harness, handle: &JobHandle, passes: u32, prefix: u64, sequence: u64) -> interactive::PartialSampling {
|
||||
+ use sha2::{Digest, Sha256};
|
||||
let status = handle.status().unwrap();
|
||||
- assert_eq!(status.progress.phase,Phase::Completed);
|
||||
+ assert_eq!(status.progress.phase, Phase::Completed);
|
||||
let frame = handle.frame().unwrap().unwrap();
|
||||
let source = image::load_from_memory(frame.png()).unwrap().to_rgba8();
|
||||
- let plan = PartialPreviewPlan::new(status.request.width,status.request.height).unwrap();
|
||||
+ let plan = PartialPreviewPlan::new(status.request.width, status.request.height).unwrap();
|
||||
let mut pixels = Vec::new();
|
||||
for index in 0..usize::try_from(plan.pixels()).unwrap() {
|
||||
let source_index = plan.source_index(index).unwrap();
|
||||
let count = passes + u32::from((source_index as u64) < prefix);
|
||||
if count == 0 {
|
||||
- pixels.extend_from_slice(&[0,0,0,0]);
|
||||
+ pixels.extend_from_slice(&[0, 0, 0, 0]);
|
||||
} else {
|
||||
let x = source_index % status.request.width as usize;
|
||||
let y = source_index / status.request.width as usize;
|
||||
- pixels.extend_from_slice(&source.get_pixel(x as u32,y as u32).0);
|
||||
+ pixels.extend_from_slice(&source.get_pixel(x as u32, y as u32).0);
|
||||
}
|
||||
}
|
||||
- let png = super::partial_png_contract_encode(plan.width(),plan.height(),pixels);
|
||||
+ let png = super::partial_png_contract_encode(plan.width(), plan.height(), pixels);
|
||||
let mut frame_info = frame.info.clone();
|
||||
frame_info.width = plan.width();
|
||||
frame_info.height = plan.height();
|
||||
frame_info.png_bytes = png.len() as u64;
|
||||
- frame_info.png_sha256 = format!("{:x}",Sha256::digest(&png));
|
||||
+ frame_info.png_sha256 = format!("{:x}", Sha256::digest(&png));
|
||||
let info = PartialPreviewInfo {
|
||||
- frame:frame_info,sequence,source_width:status.request.width,source_height:status.request.height,
|
||||
- completed_passes:passes,updated_prefix:prefix,
|
||||
- projection:PartialPreviewProjection::TopLeftRepresentativeV1,
|
||||
+ frame: frame_info,
|
||||
+ sequence,
|
||||
+ source_width: status.request.width,
|
||||
+ source_height: status.request.height,
|
||||
+ completed_passes: passes,
|
||||
+ updated_prefix: prefix,
|
||||
+ projection: PartialPreviewProjection::TopLeftRepresentativeV1,
|
||||
};
|
||||
- let covered = vec![0;usize::try_from(plan.pixels()).unwrap()]; // committed misses have zero hit coverage
|
||||
+ let covered = vec![0; usize::try_from(plan.pixels()).unwrap()]; // committed misses have zero hit coverage
|
||||
let expected = interactive::PartialExpectation {
|
||||
- job:handle.id(),scene_generation:status.scene_generation,request:&status.request,
|
||||
- final_dimensions:[status.request.width,status.request.height],
|
||||
+ job: handle.id(),
|
||||
+ scene_generation: status.scene_generation,
|
||||
+ request: &status.request,
|
||||
+ final_dimensions: [status.request.width, status.request.height],
|
||||
};
|
||||
- let sampling = interactive::validate_partial_metadata(&expected,&info,png.len(),covered.len(),None).unwrap().unwrap();
|
||||
- let image = interactive::decode_partial_image(
|
||||
- &status.request,&info,&png,&covered,sampling,h.ctx.input(|input|input.max_texture_side),
|
||||
- ).unwrap();
|
||||
- let texture = h.ctx.load_texture("manual_final_policy_partial",image,egui::TextureOptions::NEAREST);
|
||||
- h.app.render_workspace.final_partial = Some(FinalPartialImage { info,sampling,image:Ok(texture) });
|
||||
+ let sampling = interactive::validate_partial_metadata(&expected, &info, png.len(), covered.len(), None).unwrap().unwrap();
|
||||
+ let image =
|
||||
+ interactive::decode_partial_image(&status.request, &info, &png, &covered, sampling, h.ctx.input(|input| input.max_texture_side)).unwrap();
|
||||
+ let texture = h.ctx.load_texture("manual_final_policy_partial", image, egui::TextureOptions::NEAREST);
|
||||
+ h.app.render_workspace.final_partial = Some(FinalPartialImage { info, sampling, image: Ok(texture) });
|
||||
sampling
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn native_manual_final_gui_opt_in_preserves_request_and_promotes_only_real_final() {
|
||||
- let Some(mut h) = fixture(13,7,9,[17,89,203],"gui_opt_in") else { return };
|
||||
+ let Some(mut h) = fixture(13, 7, 9, [17, 89, 203], "gui_opt_in") else { return };
|
||||
let document = h.app.session.doc.clone();
|
||||
- let before = (h.app.session.revision,h.app.session.undo.len(),h.app.session.is_dirty());
|
||||
+ let before = (h.app.session.revision, h.app.session.undo.len(), h.app.session.is_dirty());
|
||||
let stored = setups::snapshot(&h.app).unwrap();
|
||||
assert!(serde_json::to_value(&stored).unwrap().get("progressive_feedback").is_none());
|
||||
let offline = image_request(&h.app).unwrap();
|
||||
assert!(offline.get("progressive_feedback").is_none());
|
||||
let request = image_params(&h.app).unwrap();
|
||||
- assert_eq!(request["progressive_feedback"],true);
|
||||
+ assert_eq!(request["progressive_feedback"], true);
|
||||
h.app.render_workspace.view.raytrace.progressive = None;
|
||||
assert!(image_params(&h.app).unwrap().get("progressive_feedback").is_none());
|
||||
- h.app.render_workspace.view.raytrace.progressive = Some(CpuProgressiveOptions { samples_per_pixel:9,seed:83 });
|
||||
- let checked = h.app.session.execute("render.preflight",&request).unwrap();
|
||||
- ribbon::perform_job(&mut h.app,"render.preflight").unwrap();
|
||||
- assert_eq!(h.app.render_workspace.view.cpu.checked.as_ref().unwrap().request,request);
|
||||
+ h.app.render_workspace.view.raytrace.progressive = Some(CpuProgressiveOptions { samples_per_pixel: 9, seed: 83 });
|
||||
+ let checked = h.app.session.execute("render.preflight", &request).unwrap();
|
||||
+ ribbon::perform_job(&mut h.app, "render.preflight").unwrap();
|
||||
+ assert_eq!(h.app.render_workspace.view.cpu.checked.as_ref().unwrap().request, request);
|
||||
let handle = actual_final(&mut h);
|
||||
let status = handle.status().unwrap();
|
||||
- assert_eq!(serde_json::to_value(&status.request).unwrap(),checked["request"]);
|
||||
- assert_eq!((status.request.width,status.request.height),(13,7));
|
||||
+ assert_eq!(serde_json::to_value(&status.request).unwrap(), checked["request"]);
|
||||
+ assert_eq!((status.request.width, status.request.height), (13, 7));
|
||||
let progressive = status.request.raytrace.as_ref().unwrap().progressive.unwrap();
|
||||
- assert_eq!((progressive.samples_per_pixel,progressive.seed),(9,83));
|
||||
+ assert_eq!((progressive.samples_per_pixel, progressive.seed), (9, 83));
|
||||
let image = image::load_from_memory(handle.frame().unwrap().unwrap().png()).unwrap().to_rgba8();
|
||||
- assert!(image.pixels().all(|pixel|pixel.0 == [17,89,203,255]));
|
||||
+ assert!(image.pixels().all(|pixel| pixel.0 == [17, 89, 203, 255]));
|
||||
let ctx = h.ctx.clone();
|
||||
- cache_render_images(&mut h.app,&ctx);
|
||||
- assert_eq!(h.app.render_workspace.view.completed,Some(handle.id()));
|
||||
+ cache_render_images(&mut h.app, &ctx);
|
||||
+ assert_eq!(h.app.render_workspace.view.completed, Some(handle.id()));
|
||||
assert!(h.app.render_workspace.final_partial.is_none());
|
||||
let display = displayed_image(&h.app).unwrap();
|
||||
assert!(!display.provisional());
|
||||
assert!(display.preview.is_none() && display.partial.is_none());
|
||||
- assert_eq!(display.logical_size,[13,7]);
|
||||
- assert_eq!(display.info.job,handle.id());
|
||||
- assert_eq!(setups::snapshot(&h.app).unwrap(),stored);
|
||||
- assert!(Arc::ptr_eq(&document,&h.app.session.doc));
|
||||
- assert_eq!(before,(h.app.session.revision,h.app.session.undo.len(),h.app.session.is_dirty()));
|
||||
+ assert_eq!(display.logical_size, [13, 7]);
|
||||
+ assert_eq!(display.info.job, handle.id());
|
||||
+ assert_eq!(setups::snapshot(&h.app).unwrap(), stored);
|
||||
+ assert!(Arc::ptr_eq(&document, &h.app.session.doc));
|
||||
+ assert_eq!(before, (h.app.session.revision, h.app.session.undo.len(), h.app.session.is_dirty()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn native_final_partial_policy_keeps_global_unknown_full_framing_and_real_final_priority() {
|
||||
- let Some(mut h) = fixture(1025,1,3,[17,89,203],"partial_policy") else { return };
|
||||
+ let Some(mut h) = fixture(1025, 1, 3, [17, 89, 203], "partial_policy") else { return };
|
||||
let handle = actual_final(&mut h);
|
||||
assert!(h.app.render_workspace.view.completed.is_none());
|
||||
// The top-left 1024 representatives are known, but source pixel1024 is not.
|
||||
- let sampling = install_policy_partial(&mut h,&handle,0,1024,1);
|
||||
+ let sampling = install_policy_partial(&mut h, &handle, 0, 1024, 1);
|
||||
assert!(sampling.source_unknown());
|
||||
- assert_eq!(sampling.sample_range(),(0,1));
|
||||
- assert_eq!(sampling.sampled_source_pixels(),1024);
|
||||
+ assert_eq!(sampling.sample_range(), (0, 1));
|
||||
+ assert_eq!(sampling.sampled_source_pixels(), 1024);
|
||||
let display = displayed_image(&h.app).unwrap();
|
||||
assert!(display.provisional() && display.partial.is_some() && display.preview.is_none());
|
||||
- assert_eq!(display.logical_size,[1025,1]);
|
||||
- assert_eq!((display.info.width,display.info.height),(1024,1));
|
||||
- assert_eq!(display.image.as_ref().unwrap().size(),[1024,1]);
|
||||
+ assert_eq!(display.logical_size, [1025, 1]);
|
||||
+ assert_eq!((display.info.width, display.info.height), (1024, 1));
|
||||
+ assert_eq!(display.image.as_ref().unwrap().size(), [1024, 1]);
|
||||
assert!(reduced_display(&h.app));
|
||||
- let camera = Camera { distance:37.0,..Default::default() };
|
||||
+ let camera = Camera { distance: 37.0, ..Default::default() };
|
||||
h.app.render_workspace.view.result_camera = camera;
|
||||
h.app.render_workspace.view.result_scale = ResultScale::Free;
|
||||
h.app.render_workspace.view.result_job = Some(handle.id());
|
||||
let report = handle.protected_preview_report().unwrap();
|
||||
let ctx = h.ctx.clone();
|
||||
- cache_render_images(&mut h.app,&ctx);
|
||||
- assert_eq!(h.app.render_workspace.view.completed,Some(handle.id()));
|
||||
+ cache_render_images(&mut h.app, &ctx);
|
||||
+ assert_eq!(h.app.render_workspace.view.completed, Some(handle.id()));
|
||||
assert!(h.app.render_workspace.final_partial.is_none());
|
||||
let display = displayed_image(&h.app).unwrap();
|
||||
assert!(!display.provisional());
|
||||
- assert_eq!(display.logical_size,[1025,1]);
|
||||
+ assert_eq!(display.logical_size, [1025, 1]);
|
||||
assert!(!reduced_display(&h.app));
|
||||
- assert_eq!(h.app.render_workspace.view.result_camera,camera);
|
||||
- assert_eq!(h.app.render_workspace.view.result_scale,ResultScale::Free);
|
||||
+ assert_eq!(h.app.render_workspace.view.result_camera, camera);
|
||||
+ assert_eq!(h.app.render_workspace.view.result_scale, ResultScale::Free);
|
||||
invalidate_images(&mut h.app);
|
||||
assert!(h.app.render_workspace.final_partial.is_none());
|
||||
- assert_eq!(handle.protected_preview_report().unwrap(),report,"presentation invalidation cannot reset the actual ledger");
|
||||
+ assert_eq!(handle.protected_preview_report().unwrap(), report, "presentation invalidation cannot reset the actual ledger");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn native_late_complete_policy_preserves_retained_export_then_reconciles_actual_frame() {
|
||||
- let Some(mut h) = fixture(13,7,9,[17,89,203],"late_complete") else { return };
|
||||
+ let Some(mut h) = fixture(13, 7, 9, [17, 89, 203], "late_complete") else { return };
|
||||
let first = actual_final(&mut h);
|
||||
let ctx = h.ctx.clone();
|
||||
- cache_render_images(&mut h.app,&ctx);
|
||||
+ cache_render_images(&mut h.app, &ctx);
|
||||
let first_bytes = first.frame().unwrap().unwrap().png().to_vec();
|
||||
- h.app.render_workspace.view.draft.background = [91,33,187];
|
||||
+ h.app.render_workspace.view.draft.background = [91, 33, 187];
|
||||
let second = actual_final(&mut h);
|
||||
- assert_eq!(h.app.render_workspace.view.completed,Some(first.id()));
|
||||
- install_policy_partial(&mut h,&second,0,5,1);
|
||||
+ assert_eq!(h.app.render_workspace.view.completed, Some(first.id()));
|
||||
+ install_policy_partial(&mut h, &second, 0, 5, 1);
|
||||
assert!(displayed_image(&h.app).unwrap().provisional());
|
||||
let old_path = h.dir.join("manual-final-retained.png");
|
||||
let export_job = h.app.render_workspace.view.completed.unwrap();
|
||||
- h.app.run("render.export",json!({"job":export_job,"path":old_path})).unwrap();
|
||||
- assert_eq!(std::fs::read(&old_path).unwrap(),first_bytes);
|
||||
+ h.app.run("render.export", json!({"job":export_job,"path":old_path})).unwrap();
|
||||
+ assert_eq!(std::fs::read(&old_path).unwrap(), first_bytes);
|
||||
// Regression oracle for the observed event order:
|
||||
// frame read absent -> later real status Completed -> real frame promoted
|
||||
// BEFORE provisional clear/fallback. This calls the production policy on
|
||||
// an actual completed native handle; it does not fake the earlier read.
|
||||
- assert!(!final_job_still_running(&mut h.app,&second));
|
||||
- assert_eq!(h.app.render_workspace.view.completed,Some(second.id()));
|
||||
- cache_render_images(&mut h.app,&ctx);
|
||||
+ assert!(!final_job_still_running(&mut h.app, &second));
|
||||
+ assert_eq!(h.app.render_workspace.view.completed, Some(second.id()));
|
||||
+ cache_render_images(&mut h.app, &ctx);
|
||||
assert!(!displayed_image(&h.app).unwrap().provisional());
|
||||
assert!(h.app.render_workspace.final_partial.is_none());
|
||||
let new_path = h.dir.join("manual-final-current.png");
|
||||
let export_job = h.app.render_workspace.view.completed.unwrap();
|
||||
- h.app.run("render.export",json!({"job":export_job,"path":new_path})).unwrap();
|
||||
- assert_eq!(std::fs::read(&new_path).unwrap(),second.frame().unwrap().unwrap().png());
|
||||
+ h.app.run("render.export", json!({"job":export_job,"path":new_path})).unwrap();
|
||||
+ assert_eq!(std::fs::read(&new_path).unwrap(), second.frame().unwrap().unwrap().png());
|
||||
let final_pixels = image::load_from_memory(&std::fs::read(&new_path).unwrap()).unwrap().to_rgba8();
|
||||
- assert!(final_pixels.pixels().all(|pixel|pixel.0 == [91,33,187,255]));
|
||||
- assert!(!final_job_still_running(&mut h.app,&first),"a different selected final cannot be reconciled through an old handle");
|
||||
- assert_eq!(h.app.render_workspace.view.completed,Some(second.id()));
|
||||
+ assert!(final_pixels.pixels().all(|pixel| pixel.0 == [91, 33, 187, 255]));
|
||||
+ assert!(!final_job_still_running(&mut h.app, &first), "a different selected final cannot be reconciled through an old handle");
|
||||
+ assert_eq!(h.app.render_workspace.view.completed, Some(second.id()));
|
||||
}
|
||||
fn author_box_optics(h: &mut Harness) {
|
||||
- h.app.run("solid.box",json!({"length":200,"width":200,"height":4,"center":[0,0,2],"body_name":"ManualOptics"})).unwrap();
|
||||
- h.app.run("render.scene",json!({})).unwrap();
|
||||
+ h.app.run("solid.box", json!({"length":200,"width":200,"height":4,"center":[0,0,2],"body_name":"ManualOptics"})).unwrap();
|
||||
+ h.app.run("render.scene", json!({})).unwrap();
|
||||
h.app.ui.tab = "RENDER".into();
|
||||
let view = &mut h.app.render_workspace.view;
|
||||
view.method = ImageMethod::CpuRaytrace;
|
||||
view.draft.width = 1;
|
||||
view.draft.height = 1;
|
||||
- view.draft.background = [255;3];
|
||||
+ view.draft.background = [255; 3];
|
||||
view.draft.stage.clear();
|
||||
view.draft.surfaces.clear();
|
||||
view.transparent = false;
|
||||
@@ -9801,13 +9863,13 @@
|
||||
view.raytrace.lights = Some(Vec::new());
|
||||
view.raytrace.shadows = false;
|
||||
view.cpu.environment = cpu::Environment::Constant;
|
||||
- view.cpu.color = [1.0;3];
|
||||
+ view.cpu.color = [1.0; 3];
|
||||
view.cpu.intensity = 1.0;
|
||||
- h.app.cam = Camera { distance:10.0,fov:0.0,..Default::default() };
|
||||
+ h.app.cam = Camera { distance: 10.0, fov: 0.0, ..Default::default() };
|
||||
h.app.cam.set_view(StandardView::Top);
|
||||
- h.app.cam.target = solidcraft_engine::geom::Vec3::new(0.0,0.0,2.0);
|
||||
- let target = materials::read_targets(&mut h.app).unwrap().into_iter().find(|target|target.name == "ManualOptics").unwrap();
|
||||
- let mut binding = materials::Binding::new(target,&h.app);
|
||||
+ h.app.cam.target = solidcraft_engine::geom::Vec3::new(0.0, 0.0, 2.0);
|
||||
+ let target = materials::read_targets(&mut h.app).unwrap().into_iter().find(|target| target.name == "ManualOptics").unwrap();
|
||||
+ let mut binding = materials::Binding::new(target, &h.app);
|
||||
binding.glass_enabled = true;
|
||||
binding.cpu_optics = true;
|
||||
binding.glass = materials::Glass::recipe("starter.glass.low-iron-clear").unwrap();
|
||||
@@ -9820,32 +9882,45 @@
|
||||
fn editor_text(h: &mut Harness, events: Vec<egui::Event>) -> String {
|
||||
fn collect(shape: &egui::Shape, text: &mut String) {
|
||||
match shape {
|
||||
- egui::Shape::Text(shape) => { text.push_str(shape.galley.text()); text.push('\n'); }
|
||||
- egui::Shape::Vec(shapes) => for shape in shapes { collect(shape,text); },
|
||||
+ egui::Shape::Text(shape) => {
|
||||
+ text.push_str(shape.galley.text());
|
||||
+ text.push('\n');
|
||||
+ }
|
||||
+ egui::Shape::Vec(shapes) => {
|
||||
+ for shape in shapes {
|
||||
+ collect(shape, text);
|
||||
+ }
|
||||
+ }
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
let mut output = h.ctx.run_ui(
|
||||
- egui::RawInput { screen_rect:Some(egui::Rect::from_min_size(egui::Pos2::ZERO,egui::vec2(480.0,3200.0))),events,..Default::default() },
|
||||
+ egui::RawInput {
|
||||
+ screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(480.0, 3200.0))),
|
||||
+ events,
|
||||
+ ..Default::default()
|
||||
+ },
|
||||
|ui| {
|
||||
ui.set_width(420.0);
|
||||
- materials::selection_controls(&mut h.app,ui,Some("ManualOptics"));
|
||||
+ materials::selection_controls(&mut h.app, ui, Some("ManualOptics"));
|
||||
},
|
||||
);
|
||||
let mut text = String::new();
|
||||
- for clipped in &output.shapes { collect(&clipped.shape,&mut text); }
|
||||
+ for clipped in &output.shapes {
|
||||
+ collect(&clipped.shape, &mut text);
|
||||
+ }
|
||||
output.textures_delta.clear();
|
||||
text
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn certification_note_draws_cpu_check_guidance_in_both_sampling_modes_and_legacy_gpu_note() {
|
||||
- let pending: Value = serde_json::from_str(include_str!(concat!(
|
||||
- env!("CARGO_MANIFEST_DIR"),"/../../assets/locales/pending/cpu-optical-certification.json"
|
||||
- ))).unwrap();
|
||||
+ let pending: Value =
|
||||
+ serde_json::from_str(include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../../assets/locales/pending/cpu-optical-certification.json")))
|
||||
+ .unwrap();
|
||||
let key = "render.cpu_optics_certification";
|
||||
- for locale in ["ar","de","en","es","he","ja","ko","vi","zh"] {
|
||||
- assert_eq!(pending[locale].as_object().unwrap().len(),1);
|
||||
+ for locale in ["ar", "de", "en", "es", "he", "ja", "ko", "vi", "zh"] {
|
||||
+ assert_eq!(pending[locale].as_object().unwrap().len(), 1);
|
||||
assert!(!pending[locale][key].as_str().unwrap().trim().is_empty());
|
||||
}
|
||||
let mut h = Harness::new();
|
||||
@@ -9854,86 +9929,102 @@
|
||||
h.app.render_workspace.view.raytrace.progressive = None;
|
||||
let cpu_note = h.app.tr(key).to_string();
|
||||
let gpu_note = h.app.tr("render.material_certification").to_string();
|
||||
- assert_ne!(cpu_note,key,"a missing catalog fallback is not a translated note");
|
||||
- assert_ne!(gpu_note,"render.material_certification");
|
||||
+ assert_ne!(cpu_note, key, "a missing catalog fallback is not a translated note");
|
||||
+ assert_ne!(gpu_note, "render.material_certification");
|
||||
let document = h.app.session.doc.clone();
|
||||
- let before = (h.app.session.revision,h.app.session.undo.len(),h.app.session.is_dirty(),
|
||||
- h.app.render_workspace.view.job,h.app.render_workspace.view.completed);
|
||||
- let binding_before = format!("{:?}",h.app.render_workspace.view.materials.bindings[0]);
|
||||
- let initial = editor_text(&mut h,Vec::new());
|
||||
+ let before = (
|
||||
+ h.app.session.revision,
|
||||
+ h.app.session.undo.len(),
|
||||
+ h.app.session.is_dirty(),
|
||||
+ h.app.render_workspace.view.job,
|
||||
+ h.app.render_workspace.view.completed,
|
||||
+ );
|
||||
+ let binding_before = format!("{:?}", h.app.render_workspace.view.materials.bindings[0]);
|
||||
+ let initial = editor_text(&mut h, Vec::new());
|
||||
if !initial.contains(&cpu_note) {
|
||||
- let heading = format!("dialog:section:{}",h.app.tr("render.appearance_editor.glass"));
|
||||
+ let heading = format!("dialog:section:{}", h.app.tr("render.appearance_editor.glass"));
|
||||
let at = crate::scenario::rect_of(&heading).unwrap().center();
|
||||
- for pressed in [true,false] {
|
||||
- editor_text(&mut h,vec![egui::Event::PointerMoved(at),egui::Event::PointerButton {
|
||||
- pos:at,button:egui::PointerButton::Primary,pressed,modifiers:egui::Modifiers::NONE,
|
||||
- }]);
|
||||
+ for pressed in [true, false] {
|
||||
+ editor_text(
|
||||
+ &mut h,
|
||||
+ vec![
|
||||
+ egui::Event::PointerMoved(at),
|
||||
+ egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::NONE },
|
||||
+ ],
|
||||
+ );
|
||||
}
|
||||
}
|
||||
- for progressive in [None,Some(CpuProgressiveOptions { samples_per_pixel:5,seed:13 })] {
|
||||
+ for progressive in [None, Some(CpuProgressiveOptions { samples_per_pixel: 5, seed: 13 })] {
|
||||
h.app.render_workspace.view.method = ImageMethod::CpuRaytrace;
|
||||
h.app.render_workspace.view.raytrace.progressive = progressive;
|
||||
- let text = editor_text(&mut h,Vec::new());
|
||||
- assert!(text.contains(&cpu_note),"{text}");
|
||||
- assert!(!text.contains(&gpu_note),"{text}");
|
||||
+ let text = editor_text(&mut h, Vec::new());
|
||||
+ assert!(text.contains(&cpu_note), "{text}");
|
||||
+ assert!(!text.contains(&gpu_note), "{text}");
|
||||
}
|
||||
h.app.render_workspace.view.method = ImageMethod::GpuRaytrace;
|
||||
- let text = editor_text(&mut h,Vec::new());
|
||||
- assert!(text.contains(&gpu_note),"{text}");
|
||||
- assert!(!text.contains(&cpu_note),"{text}");
|
||||
- assert_eq!(format!("{:?}",h.app.render_workspace.view.materials.bindings[0]),binding_before);
|
||||
- assert!(Arc::ptr_eq(&document,&h.app.session.doc));
|
||||
- assert_eq!(before,(h.app.session.revision,h.app.session.undo.len(),h.app.session.is_dirty(),
|
||||
- h.app.render_workspace.view.job,h.app.render_workspace.view.completed));
|
||||
+ let text = editor_text(&mut h, Vec::new());
|
||||
+ assert!(text.contains(&gpu_note), "{text}");
|
||||
+ assert!(!text.contains(&cpu_note), "{text}");
|
||||
+ assert_eq!(format!("{:?}", h.app.render_workspace.view.materials.bindings[0]), binding_before);
|
||||
+ assert!(Arc::ptr_eq(&document, &h.app.session.doc));
|
||||
+ assert_eq!(
|
||||
+ before,
|
||||
+ (
|
||||
+ h.app.session.revision,
|
||||
+ h.app.session.undo.len(),
|
||||
+ h.app.session.is_dirty(),
|
||||
+ h.app.render_workspace.view.job,
|
||||
+ h.app.render_workspace.view.completed
|
||||
+ )
|
||||
+ );
|
||||
// Text/layout evidence only: selecting a note never certifies a CPU/GPU render.
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn native_progressive_optical_recipe_keeps_authored_ior_certificate_and_final_capture() {
|
||||
- let Some(mut h) = fixture(1,1,5,[255;3],"progressive_optics") else { return };
|
||||
+ let Some(mut h) = fixture(1, 1, 5, [255; 3], "progressive_optics") else { return };
|
||||
author_box_optics(&mut h);
|
||||
- h.app.render_workspace.view.raytrace.progressive = Some(CpuProgressiveOptions { samples_per_pixel:5,seed:13 });
|
||||
+ h.app.render_workspace.view.raytrace.progressive = Some(CpuProgressiveOptions { samples_per_pixel: 5, seed: 13 });
|
||||
// The orthographic pixel's entire jitter support lies in +/-4mm,
|
||||
// strictly inside the independently authored +/-100mm box footprint.
|
||||
- assert_eq!(h.app.cam.half_height(),4.0);
|
||||
- for (x,y) in [(0.0,0.0),(1.0,0.0),(0.0,1.0),(1.0,1.0)] {
|
||||
- let (origin,direction) = h.app.cam.ray(x,y,1.0,1.0);
|
||||
+ assert_eq!(h.app.cam.half_height(), 4.0);
|
||||
+ for (x, y) in [(0.0, 0.0), (1.0, 0.0), (0.0, 1.0), (1.0, 1.0)] {
|
||||
+ let (origin, direction) = h.app.cam.ray(x, y, 1.0, 1.0);
|
||||
assert!(direction.x.abs() < 1e-12 && direction.y.abs() < 1e-12);
|
||||
- assert!((direction.z.abs()-1.0).abs() < 1e-12);
|
||||
- let point = origin + direction * ((4.0-origin.z)/direction.z);
|
||||
- assert!(point.x.abs() <= 4.0+1e-9 && point.y.abs() <= 4.0+1e-9);
|
||||
+ assert!((direction.z.abs() - 1.0).abs() < 1e-12);
|
||||
+ let point = origin + direction * ((4.0 - origin.z) / direction.z);
|
||||
+ assert!(point.x.abs() <= 4.0 + 1e-9 && point.y.abs() <= 4.0 + 1e-9);
|
||||
assert!(point.x.abs() < 100.0 && point.y.abs() < 100.0);
|
||||
}
|
||||
let document = h.app.session.doc.clone();
|
||||
- let before = (h.app.session.revision,h.app.session.undo.len(),h.app.session.is_dirty());
|
||||
- let binding_before = format!("{:?}",h.app.render_workspace.view.materials.bindings[0]);
|
||||
+ let before = (h.app.session.revision, h.app.session.undo.len(), h.app.session.is_dirty());
|
||||
+ let binding_before = format!("{:?}", h.app.render_workspace.view.materials.bindings[0]);
|
||||
let request = image_params(&h.app).unwrap();
|
||||
- assert_eq!(request["progressive_feedback"],true);
|
||||
+ assert_eq!(request["progressive_feedback"], true);
|
||||
let optics = &request["raytrace"]["dielectrics"][0];
|
||||
- assert_eq!(optics["body_name"],"ManualOptics");
|
||||
- assert_eq!(optics["boundary"],"closed_box");
|
||||
- assert_eq!(optics["ior"],1.5,"the production recipe IOR is not reduced for this case");
|
||||
- for (index,transmission) in [0.98_f64,0.99,1.0].into_iter().enumerate() {
|
||||
- let expected = -transmission.ln()/4.0;
|
||||
- assert!((optics["absorption_per_mm"][index].as_f64().unwrap()-expected).abs() < 1e-15);
|
||||
- }
|
||||
- let checked = h.app.session.execute("render.preflight",&request).unwrap();
|
||||
+ assert_eq!(optics["body_name"], "ManualOptics");
|
||||
+ assert_eq!(optics["boundary"], "closed_box");
|
||||
+ assert_eq!(optics["ior"], 1.5, "the production recipe IOR is not reduced for this case");
|
||||
+ for (index, transmission) in [0.98_f64, 0.99, 1.0].into_iter().enumerate() {
|
||||
+ let expected = -transmission.ln() / 4.0;
|
||||
+ assert!((optics["absorption_per_mm"][index].as_f64().unwrap() - expected).abs() < 1e-15);
|
||||
+ }
|
||||
+ let checked = h.app.session.execute("render.preflight", &request).unwrap();
|
||||
let handle = actual_final(&mut h);
|
||||
let status = handle.status().unwrap();
|
||||
- assert_eq!(serde_json::to_value(&status.request).unwrap(),checked["request"]);
|
||||
- assert_eq!(json!(status.request.raytrace),request["raytrace"]);
|
||||
+ assert_eq!(serde_json::to_value(&status.request).unwrap(), checked["request"]);
|
||||
+ assert_eq!(json!(status.request.raytrace), request["raytrace"]);
|
||||
assert!(!status.options.nested_media);
|
||||
let frame = handle.frame().unwrap().unwrap();
|
||||
let pixels = image::load_from_memory(frame.png()).unwrap().to_rgba8();
|
||||
- assert_eq!(pixels.dimensions(),(1,1));
|
||||
- let pixel = pixels.get_pixel(0,0).0;
|
||||
- assert_eq!(pixel[3],255);
|
||||
- assert!(pixel[..3].iter().any(|value|*value > 0));
|
||||
- assert_eq!(format!("{:?}",h.app.render_workspace.view.materials.bindings[0]),binding_before);
|
||||
- assert!(Arc::ptr_eq(&document,&h.app.session.doc));
|
||||
- assert_eq!(before,(h.app.session.revision,h.app.session.undo.len(),h.app.session.is_dirty()));
|
||||
+ assert_eq!(pixels.dimensions(), (1, 1));
|
||||
+ let pixel = pixels.get_pixel(0, 0).0;
|
||||
+ assert_eq!(pixel[3], 255);
|
||||
+ assert!(pixel[..3].iter().any(|value| *value > 0));
|
||||
+ assert_eq!(format!("{:?}", h.app.render_workspace.view.materials.bindings[0]), binding_before);
|
||||
+ assert!(Arc::ptr_eq(&document, &h.app.session.doc));
|
||||
+ assert_eq!(before, (h.app.session.revision, h.app.session.undo.len(), h.app.session.is_dirty()));
|
||||
// Actual CPU capture/completion + nonblack optical smoke, not a full
|
||||
// Fresnel/TIR oracle or a partial-optical-tree while-running receipt.
|
||||
}
|
||||
-
|
||||
-}
|
||||
+}
|
||||
@@ -0,0 +1,289 @@
|
||||
{
|
||||
"schema": 1,
|
||||
"status": "EXACT_SOURCE_ONLY_FORMATTING_BRIDGE_NOT_A_TEST_PASS",
|
||||
"base": "../actual19-reviewed-source/README.md",
|
||||
"base_composition_sha256": "605292e1edb0ffaa2e1830cc3d277f006e6fc218f8ec6fe0dc2bc27b321ffe69",
|
||||
"base_adopted_source_manifest_sha256": "5ec1e34bfc91f4e0dc5970191bc34199ad856d2cd998a96f605e01662bf439f8",
|
||||
"C15_initial_source_manifest_sha256": "f9c2651977c95ee2120ae868c5ff4aeceeaae40e31f8a4cd3a6405d61299f57d",
|
||||
"C15_post_format_source_manifest_sha256": "2fe4f37371e7376e02ae89a080e51fad82e6f6c564bfe8b8a8075c2951fe1f31",
|
||||
"source_members": 3571,
|
||||
"files_changed": 12,
|
||||
"patch": {
|
||||
"parts": [
|
||||
{
|
||||
"path": "c15-postformat-delta-01.patch",
|
||||
"bytes": 64030,
|
||||
"sha256": "1fde9b825ed95b18929f3284c89140d6340026edd5314a797079a187571f19ab"
|
||||
},
|
||||
{
|
||||
"path": "c15-postformat-delta-02.patch",
|
||||
"bytes": 78431,
|
||||
"sha256": "d584c829f2325c9801433617366b8cc38dc4f681fecf2dd5fef2f5c105dd24ae"
|
||||
},
|
||||
{
|
||||
"path": "c15-postformat-delta-03.patch",
|
||||
"bytes": 54381,
|
||||
"sha256": "e1c151d97dce0ffdece14bbbf02ec551abc177145b739dce267d4bb0018ddf9a"
|
||||
}
|
||||
],
|
||||
"bytes": 196842,
|
||||
"sha256": "e545a3323c50e0e5f0e55ccbe0260b7fa2d45b3cb1999a78328c1e6fdac21508",
|
||||
"parts_preserve_source_file_boundaries": true
|
||||
},
|
||||
"files": [
|
||||
{
|
||||
"path": "crates/engine/src/cmd/render/jobs.rs",
|
||||
"before": {
|
||||
"sha256": "ff82cad9aae9f57c81c0da40bd4a7ebbfc390cbbc7fe70ef498eb21a5eb07eea",
|
||||
"bytes": 63778,
|
||||
"eol": "LF",
|
||||
"crlf": 0,
|
||||
"lf": 1229,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"candidate": {
|
||||
"sha256": "741caaaeb765853b6d89e0a69eaa8f425654689433a8eee48d3587d276144dd2",
|
||||
"bytes": 64072,
|
||||
"eol": "LF",
|
||||
"crlf": 0,
|
||||
"lf": 1255,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"normalized_diff_hunks": 11,
|
||||
"text_change": true
|
||||
},
|
||||
{
|
||||
"path": "crates/engine/src/render_jobs.rs",
|
||||
"before": {
|
||||
"sha256": "5655d5f5ae2c80560f9e067ca24424c0561cc5969260ff0343660e4d198909aa",
|
||||
"bytes": 42740,
|
||||
"eol": "CRLF",
|
||||
"crlf": 835,
|
||||
"lf": 835,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"candidate": {
|
||||
"sha256": "4a2d5c1886ca029d383874f9aece71b866390fad2b6651193e218b2c302c5f48",
|
||||
"bytes": 42310,
|
||||
"eol": "LF",
|
||||
"crlf": 0,
|
||||
"lf": 856,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"normalized_diff_hunks": 5,
|
||||
"text_change": true
|
||||
},
|
||||
{
|
||||
"path": "crates/render/src/job/host.rs",
|
||||
"before": {
|
||||
"sha256": "577295a655ab5a8f6204da2b9d2a6a18d3d2bfeb877993a0dfffdc58462a2551",
|
||||
"bytes": 115822,
|
||||
"eol": "CRLF",
|
||||
"crlf": 2406,
|
||||
"lf": 2406,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"candidate": {
|
||||
"sha256": "1884acfd018cb38683bd6ec92b171eff5a1b39eb5fd7e79bec0e31a3e76aa879",
|
||||
"bytes": 115999,
|
||||
"eol": "LF",
|
||||
"crlf": 0,
|
||||
"lf": 2587,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"normalized_diff_hunks": 31,
|
||||
"text_change": true
|
||||
},
|
||||
{
|
||||
"path": "crates/render/src/job/image_tests.rs",
|
||||
"before": {
|
||||
"sha256": "4878271823870137cddb4f7f96c61b7e7e17bbfe46488858fcaedd9448c505dd",
|
||||
"bytes": 19561,
|
||||
"eol": "CRLF",
|
||||
"crlf": 402,
|
||||
"lf": 402,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"candidate": {
|
||||
"sha256": "98dfbb281a16aea600a6cff86652b3c92e566eb1188c2942a873df5742183368",
|
||||
"bytes": 19074,
|
||||
"eol": "LF",
|
||||
"crlf": 0,
|
||||
"lf": 390,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"normalized_diff_hunks": 3,
|
||||
"text_change": true
|
||||
},
|
||||
{
|
||||
"path": "crates/render/src/job/mod.rs",
|
||||
"before": {
|
||||
"sha256": "601391ecc07447e6c65cb3b790c7fe83b839374fa600fc7f79a2668cdf7b3eb0",
|
||||
"bytes": 62159,
|
||||
"eol": "LF",
|
||||
"crlf": 0,
|
||||
"lf": 1477,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"candidate": {
|
||||
"sha256": "10b26a76921445cce0029a19e2c9e591663dc5b8876c055b2f07618a4ddeab74",
|
||||
"bytes": 62100,
|
||||
"eol": "LF",
|
||||
"crlf": 0,
|
||||
"lf": 1474,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"normalized_diff_hunks": 1,
|
||||
"text_change": true
|
||||
},
|
||||
{
|
||||
"path": "crates/render/src/job/photographic.rs",
|
||||
"before": {
|
||||
"sha256": "74756050d449a3333130e54d54b72aed9de2d54ca535d5b50803c30a9ec35c4b",
|
||||
"bytes": 28171,
|
||||
"eol": "LF",
|
||||
"crlf": 0,
|
||||
"lf": 596,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"candidate": {
|
||||
"sha256": "03973c7f40398fcd32e24df61678570f827da9e41944817f72dd21ae38e56243",
|
||||
"bytes": 28130,
|
||||
"eol": "LF",
|
||||
"crlf": 0,
|
||||
"lf": 593,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"normalized_diff_hunks": 3,
|
||||
"text_change": true
|
||||
},
|
||||
{
|
||||
"path": "crates/render/src/raytrace/image_tests.rs",
|
||||
"before": {
|
||||
"sha256": "08bbf206da1436f39c225a14529135b47f7381fc3c278ed2c1dd9564c5c5747c",
|
||||
"bytes": 114405,
|
||||
"eol": "LF",
|
||||
"crlf": 0,
|
||||
"lf": 2414,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"candidate": {
|
||||
"sha256": "4a4f46bc26e560fe4087a4fbf4439ea768d05fec2a414af7ad371f5a6897f62d",
|
||||
"bytes": 115864,
|
||||
"eol": "LF",
|
||||
"crlf": 0,
|
||||
"lf": 2455,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"normalized_diff_hunks": 10,
|
||||
"text_change": true
|
||||
},
|
||||
{
|
||||
"path": "crates/render/src/raytrace/primary_aa_tests.rs",
|
||||
"before": {
|
||||
"sha256": "37ac1993d703bb524d038ec061d621fe0facb44dbdd6d11861d830ae6123d916",
|
||||
"bytes": 89108,
|
||||
"eol": "LF",
|
||||
"crlf": 0,
|
||||
"lf": 1762,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"candidate": {
|
||||
"sha256": "66f4d53f8f544c8eeaad8ef7879b50163bcf64528d9aafd20f2c248b1e758e50",
|
||||
"bytes": 89705,
|
||||
"eol": "LF",
|
||||
"crlf": 0,
|
||||
"lf": 1810,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"normalized_diff_hunks": 5,
|
||||
"text_change": true
|
||||
},
|
||||
{
|
||||
"path": "crates/render/src/studio.rs",
|
||||
"before": {
|
||||
"sha256": "cf06738ea3c14638eb43ce5c05516a6a95d69ac1658464932bd13e54fb4fedf5",
|
||||
"bytes": 11331,
|
||||
"eol": "CRLF",
|
||||
"crlf": 218,
|
||||
"lf": 218,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"candidate": {
|
||||
"sha256": "39eec7cc41207f966994b980a2cec11661a89f7e7a019608616f584261764d26",
|
||||
"bytes": 11054,
|
||||
"eol": "LF",
|
||||
"crlf": 0,
|
||||
"lf": 213,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"normalized_diff_hunks": 4,
|
||||
"text_change": true
|
||||
},
|
||||
{
|
||||
"path": "crates/ui-egui/src/render_workspace.rs",
|
||||
"before": {
|
||||
"sha256": "dd3dc088fdc1080a493eb52f87978fbe8bd36abdfe844f7bbf47b56a986aa7ed",
|
||||
"bytes": 109538,
|
||||
"eol": "CRLF",
|
||||
"crlf": 2395,
|
||||
"lf": 2395,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"candidate": {
|
||||
"sha256": "e202f6006332d21942e6bd01a4889601c77f2f1ab84039c0bc5aea2fd0cc18f0",
|
||||
"bytes": 107739,
|
||||
"eol": "LF",
|
||||
"crlf": 0,
|
||||
"lf": 2444,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"normalized_diff_hunks": 10,
|
||||
"text_change": true
|
||||
},
|
||||
{
|
||||
"path": "crates/ui-egui/src/render_workspace_materials.rs",
|
||||
"before": {
|
||||
"sha256": "e290b9e2404d68524a6a6cb4355b3f11f8bb989e370c869b2a262b1faafa8519",
|
||||
"bytes": 49558,
|
||||
"eol": "CRLF",
|
||||
"crlf": 1045,
|
||||
"lf": 1045,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"candidate": {
|
||||
"sha256": "5f9efcda8d42627eea7b05a8ccea2006a265492325824885442c76b6ec07e85a",
|
||||
"bytes": 48776,
|
||||
"eol": "LF",
|
||||
"crlf": 0,
|
||||
"lf": 1062,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"normalized_diff_hunks": 4,
|
||||
"text_change": true
|
||||
},
|
||||
{
|
||||
"path": "crates/ui-egui/src/render_workspace_tests.rs",
|
||||
"before": {
|
||||
"sha256": "edc06b2999b190b85495db5496d68801f77f370a7c8e2763c25d7610841a085b",
|
||||
"bytes": 543384,
|
||||
"eol": "LF",
|
||||
"crlf": 0,
|
||||
"lf": 9939,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"candidate": {
|
||||
"sha256": "5eeb9bb333cad6936dae8bade8c3be0eece2cea7f52d274c6bd59b28c42625d9",
|
||||
"bytes": 545234,
|
||||
"eol": "LF",
|
||||
"crlf": 0,
|
||||
"lf": 10030,
|
||||
"utf8_bom": false
|
||||
},
|
||||
"normalized_diff_hunks": 22,
|
||||
"text_change": true
|
||||
}
|
||||
],
|
||||
"patch_policy": "LF-normalized text hunks; verify exact RAW before hashes, apply only textual/EOL reconstruction, restore declared endpoint EOL and verify exact RAW candidate SHA. No universal literal RAW replay claim. All endpoints were read from actual candidate/stage payloads, not reconstructed from hashes.",
|
||||
"C15_outcome": "Formatter/check completed; later combined test build failed with four E0599 in new UI fixture setup. Zero tests executed;242 selected cases unrun. This formatting bridge transfers no PASS to C16."
|
||||
}
|
||||
@@ -0,0 +1,273 @@
|
||||
diff --git a/crates/ui-egui/src/prefs.rs b/crates/ui-egui/src/prefs.rs
|
||||
--- a/crates/ui-egui/src/prefs.rs
|
||||
+++ b/crates/ui-egui/src/prefs.rs
|
||||
@@ -940,6 +940,8 @@
|
||||
vertex_markers: bool = false => check("Vertex markers", "Show a small dot at every vertex wherever edges are drawn");
|
||||
/// Restore the previous platform-specific fixed Render preview geometry budget.
|
||||
render_previous_geometry_budget: bool = false, PAGE_GRAPHICS => check_id("prefs.render_previous_geometry_budget");
|
||||
+ /// Open Result once after a successful GUI Start; false preserves the selected view.
|
||||
+ render_open_result_on_start: bool = true, PAGE_GRAPHICS => check_id("prefs.render_open_result_on_start");
|
||||
/// How finely the viewport tessellates curved faces and edges: `coarse`, `normal`, `fine` or
|
||||
/// `ultra` (#1287). Only the display plan the viewport draws; never the design or exports.
|
||||
display_quality: String = "normal".into(), PAGE_GRAPHICS;
|
||||
@@ -3331,6 +3333,24 @@
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
+ #[test]
|
||||
+ fn render_open_result_on_start_defaults_persists_validates_and_resets() {
|
||||
+ assert!(Prefs::default().render_open_result_on_start);
|
||||
+ assert!(serde_json::from_value::<Prefs>(json!({})).unwrap().render_open_result_on_start);
|
||||
+ let mut app = SolveApp::new(Default::default(), Default::default());
|
||||
+ let reply = super::set(&mut app, &json!({"render_open_result_on_start":false})).unwrap();
|
||||
+ assert_eq!(reply["render_open_result_on_start"], false);
|
||||
+ for invalid in [json!("false"), json!(0), json!(null)] {
|
||||
+ assert!(super::set(&mut app, &json!({"render_open_result_on_start":invalid})).is_err());
|
||||
+ assert!(!app.preferences.render_open_result_on_start);
|
||||
+ }
|
||||
+ let mut restored = SolveApp::new(Default::default(), Default::default());
|
||||
+ restored.load_prefs(&app.prefs());
|
||||
+ assert!(!restored.preferences.render_open_result_on_start);
|
||||
+ super::defaults(&mut restored, super::PAGE_GRAPHICS);
|
||||
+ assert!(restored.preferences.render_open_result_on_start);
|
||||
+ }
|
||||
+
|
||||
#[test]
|
||||
fn trackpad_zoom_modifier_roundtrips_and_validates_control_values() {
|
||||
assert_eq!(Prefs::default().trackpad_zoom_modifier, TrackpadZoomModifier::Off);
|
||||
diff --git a/crates/ui-egui/src/prefs/graphics.rs b/crates/ui-egui/src/prefs/graphics.rs
|
||||
--- a/crates/ui-egui/src/prefs/graphics.rs
|
||||
+++ b/crates/ui-egui/src/prefs/graphics.rs
|
||||
@@ -189,6 +189,7 @@
|
||||
#[cfg(target_os = "linux")]
|
||||
ui_kit::settings_section(ui, "window_system", app.tr("ui.window_system"), |ui| window_system_row(app, ui));
|
||||
setting::render_previous_geometry_budget(app, ui).on_hover_text(app.tr("prefs.render_previous_geometry_budget_help"));
|
||||
+ setting::render_open_result_on_start(app, ui).on_hover_text(app.tr("prefs.render_open_result_on_start_help"));
|
||||
ui.horizontal(|ui| {
|
||||
ui_kit::text(ui, app.tr_label("Renderer"), ui_kit::Text::Inline);
|
||||
let renderer = match (&app.viewport.gpu, &app.help.gpu) {
|
||||
diff --git a/crates/ui-egui/src/render_workspace_ribbon.rs b/crates/ui-egui/src/render_workspace_ribbon.rs
|
||||
--- a/crates/ui-egui/src/render_workspace_ribbon.rs
|
||||
+++ b/crates/ui-egui/src/render_workspace_ribbon.rs
|
||||
@@ -150,6 +150,9 @@
|
||||
.map_err(|e| crate::i18n::format("render.error_job_identity", &[("error", &e.to_string())]))?;
|
||||
app.render_workspace.view.job = Some(job);
|
||||
app.render_workspace.view.job_shot = Some(app.render_workspace.view.name.clone());
|
||||
+ if app.preferences.render_open_result_on_start {
|
||||
+ app.run("render.result.view", json!({"view":"image"}))?;
|
||||
+ }
|
||||
}
|
||||
"render.result.copy" => {
|
||||
let job = app.render_workspace.view.completed.ok_or_else(|| app.tr("render.ribbon_no_result").to_string())?;
|
||||
diff --git a/crates/ui-egui/src/render_workspace_tests.rs b/crates/ui-egui/src/render_workspace_tests.rs
|
||||
--- a/crates/ui-egui/src/render_workspace_tests.rs
|
||||
+++ b/crates/ui-egui/src/render_workspace_tests.rs
|
||||
@@ -9643,8 +9643,10 @@
|
||||
view.draft.width = width;
|
||||
view.draft.height = height;
|
||||
view.draft.background = background;
|
||||
- view.draft.stage.clear();
|
||||
- view.draft.surfaces.clear();
|
||||
+ view.draft.stage = Default::default();
|
||||
+ view.draft.surfaces = Default::default();
|
||||
+ assert!(view.draft.stage.is_empty());
|
||||
+ assert!(view.draft.surfaces.is_empty());
|
||||
view.draft.exposure_ev = 0.0;
|
||||
view.transparent = false;
|
||||
view.raytrace = RaytraceOptions {
|
||||
@@ -9855,8 +9857,10 @@
|
||||
view.draft.width = 1;
|
||||
view.draft.height = 1;
|
||||
view.draft.background = [255; 3];
|
||||
- view.draft.stage.clear();
|
||||
- view.draft.surfaces.clear();
|
||||
+ view.draft.stage = Default::default();
|
||||
+ view.draft.surfaces = Default::default();
|
||||
+ assert!(view.draft.stage.is_empty());
|
||||
+ assert!(view.draft.surfaces.is_empty());
|
||||
view.transparent = false;
|
||||
view.draft.exposure_ev = 0.0;
|
||||
view.raytrace.primary_samples = 1;
|
||||
@@ -10026,5 +10030,140 @@
|
||||
assert_eq!(before, (h.app.session.revision, h.app.session.undo.len(), h.app.session.is_dirty()));
|
||||
// Actual CPU capture/completion + nonblack optical smoke, not a full
|
||||
// Fresnel/TIR oracle or a partial-optical-tree while-running receipt.
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
+// These exercise GUI navigation against the real cooperative Raster host.
|
||||
+// They do not qualify CPU raytracing, progressive cadence or GPU rendering.
|
||||
+fn auto_result_raster_fixture() -> Harness {
|
||||
+ let mut h = Harness::new();
|
||||
+ h.app.run("solid.box", json!({"length":3,"width":4,"height":5})).unwrap();
|
||||
+ enter(&mut h.app, true).unwrap();
|
||||
+ let host = solidcraft_engine::render::job::CpuHost::cooperative();
|
||||
+ h.app.session.set_render_job_host(Some(host.clone())).unwrap();
|
||||
+ h.app.render_workspace.image_host = Some(host);
|
||||
+ h.app.render_workspace.view.method = ImageMethod::Raster;
|
||||
+ h.app.render_workspace.view.draft.width = 13;
|
||||
+ h.app.render_workspace.view.draft.height = 7;
|
||||
+ h.app.run("render.result.view", json!({"view":"model"})).unwrap();
|
||||
+ h
|
||||
+}
|
||||
+
|
||||
+#[test]
|
||||
+fn auto_result_success_opens_once_and_explicit_model_survives_real_completion() {
|
||||
+ use solidcraft_engine::render::job::Phase;
|
||||
+ let mut h = auto_result_raster_fixture();
|
||||
+ assert!(h.app.preferences.render_open_result_on_start);
|
||||
+ assert!(!h.app.render_workspace.view.result);
|
||||
+ let document = h.app.session.doc.clone();
|
||||
+ let undo = h.app.session.undo.len();
|
||||
+ let camera = h.app.cam;
|
||||
+ ribbon::perform_job(&mut h.app, "render.start").unwrap();
|
||||
+ let job = h.app.render_workspace.view.job.unwrap();
|
||||
+ let handle = h.app.session.render_job_handle(job).unwrap();
|
||||
+ assert!(h.app.render_workspace.view.result);
|
||||
+ assert_eq!(handle.status().unwrap().progress.phase, Phase::Queued);
|
||||
+ assert!(handle.frame().unwrap().is_none());
|
||||
+ assert!(h.app.render_workspace.view.completed.is_none());
|
||||
+ assert!(ribbon::action_ready(&h.app, "render.export").is_err());
|
||||
+ let request = handle.status().unwrap().request;
|
||||
+ assert_eq!((request.width, request.height, request.integrator), (13, 7, Integrator::Raster));
|
||||
+ cache_render_images(&mut h.app, &h.ctx);
|
||||
+ assert!(h.app.render_workspace.view.result);
|
||||
+ h.app.run("render.result.view", json!({"view":"model"})).unwrap();
|
||||
+ assert!(!h.app.render_workspace.view.result);
|
||||
+ let host = h.app.session.render_job_host().unwrap().clone();
|
||||
+ for _ in 0..128 {
|
||||
+ host.pump(16_384).unwrap();
|
||||
+ cache_render_images(&mut h.app, &h.ctx);
|
||||
+ assert!(!h.app.render_workspace.view.result, "publication/repaint must respect an explicit Model selection");
|
||||
+ if handle.frame().unwrap().is_some() {
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ let frame = handle.frame().unwrap().expect("bounded cooperative Raster work must complete");
|
||||
+ assert_eq!((frame.info.width, frame.info.height), (13, 7));
|
||||
+ assert_eq!(h.app.render_workspace.view.completed, Some(job));
|
||||
+ assert!(ribbon::action_ready(&h.app, "render.export").is_ok());
|
||||
+ for _ in 0..3 {
|
||||
+ cache_render_images(&mut h.app, &h.ctx);
|
||||
+ assert!(!h.app.render_workspace.view.result);
|
||||
+ }
|
||||
+ assert!(Arc::ptr_eq(&document, &h.app.session.doc));
|
||||
+ assert_eq!(h.app.session.undo.len(), undo);
|
||||
+ assert_eq!(h.app.cam, camera);
|
||||
+}
|
||||
+
|
||||
+#[test]
|
||||
+fn auto_result_disabled_keeps_both_selected_views_through_start_and_completion() {
|
||||
+ for selected in [false, true] {
|
||||
+ let mut h = auto_result_raster_fixture();
|
||||
+ crate::prefs::set(&mut h.app, &json!({"render_open_result_on_start":false})).unwrap();
|
||||
+ h.app.run("render.result.view", json!({"view":if selected {"image"} else {"model"}})).unwrap();
|
||||
+ ribbon::perform_job(&mut h.app, "render.start").unwrap();
|
||||
+ assert_eq!(h.app.render_workspace.view.result, selected);
|
||||
+ let job = h.app.render_workspace.view.job.unwrap();
|
||||
+ let handle = h.app.session.render_job_handle(job).unwrap();
|
||||
+ assert!(handle.frame().unwrap().is_none());
|
||||
+ let host = h.app.session.render_job_host().unwrap().clone();
|
||||
+ for _ in 0..128 {
|
||||
+ host.pump(16_384).unwrap();
|
||||
+ cache_render_images(&mut h.app, &h.ctx);
|
||||
+ assert_eq!(h.app.render_workspace.view.result, selected);
|
||||
+ if handle.frame().unwrap().is_some() {
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ assert!(handle.frame().unwrap().is_some(), "bounded cooperative Raster work must complete");
|
||||
+ assert_eq!(h.app.render_workspace.view.completed, Some(job));
|
||||
+ cache_render_images(&mut h.app, &h.ctx);
|
||||
+ assert_eq!(h.app.render_workspace.view.result, selected);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+#[test]
|
||||
+fn auto_result_check_invalid_start_and_real_queue_full_preserve_selected_view() {
|
||||
+ use solidcraft_engine::render::job::Phase;
|
||||
+ for selected in [false, true] {
|
||||
+ let mut h = auto_result_raster_fixture();
|
||||
+ assert!(h.app.preferences.render_open_result_on_start);
|
||||
+ h.app.run("render.result.view", json!({"view":if selected {"image"} else {"model"}})).unwrap();
|
||||
+ let document = h.app.session.doc.clone();
|
||||
+ let undo = h.app.session.undo.len();
|
||||
+ ribbon::perform_job(&mut h.app, "render.preflight").unwrap();
|
||||
+ assert_eq!(h.app.render_workspace.view.result, selected);
|
||||
+ assert!(h.app.render_workspace.view.job.is_none());
|
||||
+ h.app.render_workspace.view.draft.width = 0;
|
||||
+ assert!(ribbon::perform_job(&mut h.app, "render.preflight").is_err());
|
||||
+ assert_eq!(h.app.render_workspace.view.result, selected);
|
||||
+ assert!(ribbon::perform_job(&mut h.app, "render.start").is_err());
|
||||
+ assert_eq!(h.app.render_workspace.view.result, selected);
|
||||
+ h.app.render_workspace.view.draft.width = 13;
|
||||
+ let request = image_params(&h.app).unwrap();
|
||||
+ let mut jobs = Vec::new();
|
||||
+ // Queue two real jobs without registering a GUI job.
|
||||
+ // No pump or worker thread runs between admission and the third Start.
|
||||
+ for _ in 0..2 {
|
||||
+ let reply = h.app.session.execute("render.start", &request).unwrap();
|
||||
+ let job = serde_json::from_value(reply["job"].clone()).unwrap();
|
||||
+ let handle = h.app.session.render_job_handle(job).unwrap();
|
||||
+ assert_eq!(handle.status().unwrap().progress.phase, Phase::Queued);
|
||||
+ jobs.push(handle);
|
||||
+ }
|
||||
+ ribbon::action_ready(&h.app, "render.start").unwrap();
|
||||
+ let error = ribbon::perform_job(&mut h.app, "render.start").unwrap_err();
|
||||
+ assert!(error.contains("this document already has an active and pending render"), "expected real document QueueFull: {error}");
|
||||
+ assert_eq!(h.app.render_workspace.view.result, selected);
|
||||
+ assert!(h.app.render_workspace.view.job.is_none());
|
||||
+ assert!(h.app.render_workspace.view.completed.is_none());
|
||||
+ cache_render_images(&mut h.app, &h.ctx);
|
||||
+ assert_eq!(h.app.render_workspace.view.result, selected);
|
||||
+ for handle in jobs {
|
||||
+ assert_eq!(handle.status().unwrap().progress.phase, Phase::Queued);
|
||||
+ assert!(handle.frame().unwrap().is_none());
|
||||
+ }
|
||||
+ assert!(Arc::ptr_eq(&document, &h.app.session.doc));
|
||||
+ assert_eq!(h.app.session.undo.len(), undo);
|
||||
}
|
||||
}
|
||||
diff --git a/assets/locales/pending/render-result-on-start.json b/assets/locales/pending/render-result-on-start.json
|
||||
--- /dev/null
|
||||
+++ b/assets/locales/pending/render-result-on-start.json
|
||||
@@ -1,0 +1,38 @@
|
||||
+{
|
||||
+ "ar": {
|
||||
+ "prefs.render_open_result_on_start": "فتح النتيجة عند بدء التصيير",
|
||||
+ "prefs.render_open_result_on_start_help": "افتح النتيجة مرة واحدة بعد بدء التصيير بنجاح. عطّل هذا الخيار للاحتفاظ بالعرض المحدد. يمكنك العودة إلى النموذج أثناء التصيير."
|
||||
+ },
|
||||
+ "de": {
|
||||
+ "prefs.render_open_result_on_start": "Ergebnis beim Renderstart öffnen",
|
||||
+ "prefs.render_open_result_on_start_help": "Nach erfolgreichem Renderstart einmal das Ergebnis öffnen. Deaktivieren, um die gewählte Ansicht beizubehalten. Während des Renderns können Sie zum Modell zurückkehren."
|
||||
+ },
|
||||
+ "en": {
|
||||
+ "prefs.render_open_result_on_start": "Open Result when rendering starts",
|
||||
+ "prefs.render_open_result_on_start_help": "After starting a render successfully, open Result once. Turn off to keep your selected view. You can return to Model while rendering."
|
||||
+ },
|
||||
+ "es": {
|
||||
+ "prefs.render_open_result_on_start": "Abrir Resultado al iniciar el renderizado",
|
||||
+ "prefs.render_open_result_on_start_help": "Abre Resultado una vez tras iniciar correctamente el renderizado. Desactiva esta opción para conservar la vista seleccionada. Puedes volver a Modelo durante el renderizado."
|
||||
+ },
|
||||
+ "he": {
|
||||
+ "prefs.render_open_result_on_start": "פתיחת התוצאה עם תחילת הרינדור",
|
||||
+ "prefs.render_open_result_on_start_help": "פתיחת התוצאה פעם אחת לאחר התחלת רינדור בהצלחה. יש לבטל אפשרות זו כדי לשמור על התצוגה שנבחרה. אפשר לחזור למודל בזמן הרינדור."
|
||||
+ },
|
||||
+ "ja": {
|
||||
+ "prefs.render_open_result_on_start": "レンダリング開始時に結果を開く",
|
||||
+ "prefs.render_open_result_on_start_help": "レンダリングの開始に成功したら、結果を一度だけ開きます。無効にすると、選択中の表示を維持します。レンダリング中でもモデルに戻れます。"
|
||||
+ },
|
||||
+ "ko": {
|
||||
+ "prefs.render_open_result_on_start": "렌더링 시작 시 결과 열기",
|
||||
+ "prefs.render_open_result_on_start_help": "렌더링이 성공적으로 시작되면 결과를 한 번 엽니다. 끄면 선택한 보기가 유지됩니다. 렌더링 중에도 모델로 돌아갈 수 있습니다."
|
||||
+ },
|
||||
+ "vi": {
|
||||
+ "prefs.render_open_result_on_start": "Mở Kết quả khi bắt đầu kết xuất",
|
||||
+ "prefs.render_open_result_on_start_help": "Mở Kết quả một lần sau khi bắt đầu kết xuất thành công. Tắt để giữ chế độ xem đã chọn. Bạn có thể quay lại Mô hình trong khi kết xuất."
|
||||
+ },
|
||||
+ "zh": {
|
||||
+ "prefs.render_open_result_on_start": "开始渲染时打开结果",
|
||||
+ "prefs.render_open_result_on_start_help": "成功开始渲染后打开结果一次。关闭此选项可保留当前选中的视图。渲染期间也可以返回模型视图。"
|
||||
+ }
|
||||
+}
|
||||
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"schema": 1,
|
||||
"status": "SOURCE_CHECKPOINT_ADOPTED_REVIEWED_NOT_RUNTIME_QUALIFIED",
|
||||
"source_paths": 5,
|
||||
"production_draft": 8938,
|
||||
"production_head": "a077906234972dbbf11e80c54893f85ece97c8b7",
|
||||
"authorship": "Worker #1, SolidCraft Render team under0xlillith; independent Designer source review and Engineer exact-source adoption retained.",
|
||||
"original_source_manifest_sha256": "299b24a28d47411eb53ca322c5b1b01d74e0ac7ef690e9056927f06c12092727",
|
||||
"original_private_binding_sha256": "1cef2da8c20c602e9e91c9b79105376881916594aac99d6e31a24b2e58e051d1",
|
||||
"original_RAW_endpoint_manifest_sha256": "cfab0c69aef0731b1c4da4d39c5d967d7e8baea6a5f17052160baec5882d849c",
|
||||
"independent_source_review_sha256": "60695ce7719bd6c8d83d732fd934c2169caf994f46b3fca9de2a37ecf61b0d5e",
|
||||
"adopted_source_manifest_sha256": "7a30db715b0f342b37e4f5c53f7297cef1d56e22cf65a55278d6e14fd46cc852",
|
||||
"source_members_checked_at_adoption": 3572,
|
||||
"source_patch": {
|
||||
"path": "candidate.patch",
|
||||
"bytes": 15592,
|
||||
"sha256": "254b8e72b7b4ff1f12b866501e10fa37274c8614fbb49e38ecbec2172884b201"
|
||||
},
|
||||
"sanitized_bindings": {
|
||||
"path": "bindings.json",
|
||||
"sha256": "9f024a40545b2f0c7ff5cc002523ffa2386d1ca48d7cdd993c5b02c498304c67"
|
||||
},
|
||||
"C15_format_bridge_manifest": {
|
||||
"path": "c15-postformat-manifest.json",
|
||||
"sha256": "e0a5bc8634e9f3e42d7f911b8ce740a5e4251563ab1a3ad27e7ed0361667e68f"
|
||||
},
|
||||
"test_declarations": {
|
||||
"new": 4,
|
||||
"UI": 255,
|
||||
"preferences": 117
|
||||
},
|
||||
"Changes a default": "yes - successful GUI Start opens Result once, old behaviour kept behind preference render_open_result_on_start=false",
|
||||
"C15_historical": {
|
||||
"compiler_errors": "four E0599 in two new UI fixture setups",
|
||||
"test_bodies_executed": 0,
|
||||
"selected_cases_unrun": 242,
|
||||
"PASS_transferred_to_C16": false
|
||||
},
|
||||
"new_source_execution_qualification": false,
|
||||
"limits": [
|
||||
"Static/endpoint/source review is not Rust compilation, test execution, native layout/UX or image-quality acceptance.",
|
||||
"Cooperative Raster cases test GUI navigation policy; they do not qualify CPU final streaming or physical GPU rendering.",
|
||||
"Current protected feedback, glass/certified transport, finishing/export and cross-backend parity limitations remain.",
|
||||
"Additional strict TIR acceptance and the actual Raster directional consumer are not enabled by these five files."
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user