* wip(render): reconcile completed material and image pipeline source with 0.20 (#5493) Source-only integration reference for staged review, not a merge-ready aggregate. Donor: 0xlillith/solidcraft@aea20b0115. Upstream:858e5995d6. Retain original CPU/material contracts and explicit GPU donor provenance in docs/render-materials-lab.md (#2067, #2191, #2780, #3306). Preserve released format migrations and current navigation/startup/shell behavior. New saved records use pending descriptors. The physical-card descriptor follows the maintainer's material-engineering-cards naming request, with a legacy-lab format-29 regression. Replace raw new panel hosts with shared containers. Repository checks, complete workspace/all-target Clippy, and the independent physical/resource authoring checks pass for this source. The fresh full local CI invocation has reached test compilation and is not yet complete. Do not transfer donor native output or prior test totals to this integration. Generated review screenshots, video, package ZIP and machine logs remain at the immutable personal evidence pin. Uncommitted geometric displacement is backed up separately, not silently included. No kernel/vendor change, direct main write, release or independent contributor-branch rewrite. Co-authored-by: Christian Svensson <blue@cmd.nu> * test(cli): pin the Compact camera-sample admission diagnostic (#5493) The bounded request still refuses 1024x1024x64 samples before host initialization and writes no output. Update only the stale expected diagnostic to the existing Compact budget wording; production limits and code are unchanged. Exact-tree CLI regression suite: 14 passed, 0 failed. The full repository gate has been invoked separately and is not yet complete. * Normalize UI container violation paths across platforms Report repository-relative paths with forward slashes so diagnostics and the existing nested-package regression assertions agree on Windows and Unix. Keep the container detection rules unchanged. Validation: official ui-containers gate and all seven focused xtask tests passed; rustfmt and diff checks passed. Only xtask/dependencies were compiled; no application build or heavy tests. (cherry picked from commit44b58d8e10) * fix(render): preserve camera contracts and correct acceptance regressions (#5493) Preserve Design view.apply semantics with a separate strict Render camera command. Retain existing translations when English-only aliases collide; add material-axis entries and camera-specific pitch labels. Compare complete validated engineering cards and retain job handles before cancellation. Focused and native acceptance is pinned to treef8a423b21f. Full CI has been invoked separately and is not claimed green. Landing follows the render integration policy in #5493. * fix(render): resolve showcase licence and upstream resource hygiene (#5493) Record SychPL's explicit MIT OR Apache-2.0 grant, retaining source/model bytes and the Ubuntu lettering notice. Remove 80 absent attribution rows, personal fork records, dead delivery attributes and three fork/resource-only workflows. Existing xtask assets now performs bounded offline hash checks and rejects orphan render attribution; no parallel draft CI or package installation. Original authoring reproduction remains explicit. Scoped xtask tests, assets, Clippy, formatting and prepared SELENE validation pass; no application or renderer-wide result is inferred. * fix(render): align saved bounds and progressive sample resolution (#5493) Address review r4364211669/r4364211677/r4364211681/r4364211691/r4364211695. Persisted light/frame domains respect the existing 1e9 document bound; related LED/rectangle/direction cases use the same bound. Workstation primary resolve shares the 4096 admission cap and film counters use checked conversions. Exact candidate: 485 CPU render tests, 21 render document tests and strict scoped Clippy pass, including positive boundary round trips and 2048/4096 end-to-end checkpoints. No released format/migration edits, relaxed test limits or full-stack acceptance claim. * wip(render): isolate optional resources and harden sample handling (#5493) Review work in progress: opt-in encoded render library with reproducible runtime catalog exports; native-only robust dependency through the workspace; checked bloom slices; per-sample point-light diagnostics; independent area-light spatial/film keys. Resource-module binaries in both configurations, generation, Cargo production feature graphs and attribution checks pass. Full engine/render regression and combined acceptance are pending: do not merge this donor as a constituent or treat scoped resource proof as runtime acceptance. * fix(gpu): preserve donor allocations through the scope-safety repair (#5722) Port the native-validated #5723 scope-cleanup correction into the experimental donor, retaining its adaptive, volume, aging, photographic and bloom allocations. Same reverse-drain helper and regression cases; the donor combination still needs its own compile/test gate and is not covered retroactively by render-base results. * claim: #1369 * Reject unknown pending concepts after format folding (#1369) * test(render): close bounded sampling and bloom review regressions (#5493) Validate the optional-resource/lighting/dependency donor at its exact tree. Required Vulkan GPU 127/0/3; CPU renderer 487/0; engine Render 72/0; document render 21/0; lean library 7/0; strict scoped Clippy, assets/layers/lists/containers and lean-engine WASM pass. Preserve original failed controller/typing attempts. This is the draft donor/disposition source, not a replacement for constituent render PRs or final main acceptance. * wip(render): preserve stable aging target validation candidate Exact staged source from prior review work on donor3b892eab5e. This is a recovery/review checkpoint, NOT accepted delivery. An actual command-path regression currently fails because the selected executor refuses ordered surface aging. No assertion, capability or admission limit is weakened. Native/UI/full combination acceptance remains pending. Saved/runtime split adds one pending descriptor and retains original file scope; no main/render branch is changed. * test(render): preserve numeric setup intent at the admitted coordinate bound Follow up jyviko review on #5494 without weakening the corrected saved-coordinate contract. The positive clicked fixture uses 1e9 instead of inadmissible 2e9; explicit out-of-range cases still refuse, and the full saved setup round-trips through JSON and the native container. Exact-source Render workspace 95/0 and strict all-target UI Clippy pass. This does not incorporate the separately failing stable-aging candidate or claim full current-render acceptance. * test(render): use the real GPU executor for saved aging Move successful native cold-reopen Check/Start coverage from the CPU-backed protocol fixture into the production GPU executor tests. Verify capture-index changes preserve the stable target and that enabling aging changes both PNG and raw EXR output. Retain explicit, allocation-free refusal coverage for executors without aging support. Production capabilities and admission checks are unchanged. * fix(render): persist stable identities for targeted aging (#5493) Separate saved RenderBodyTarget identities from captured mesh ordinals. Reject legacy ambiguous targets, resolve Check/Start after visibility changes and preserve native reopening, copies and undo. Unsupported executors still refuse; real AMD Vulkan regression completes saved aging after reordered capture. Source tree6b84c8adpasses document 23, engine Render 75, GPU effects 5 and Render UI 95 with no failures; scoped strict Clippy, WASM and repository gates pass. Fresh CLI/native reopen and clean/aged GPU exports pass with identical physical totals and inspected actual images. Whole current-render integration is separate. * fix(render): reconcile combined CPU/GPU contracts on current upstream Unify captured resources/status and CPU-vs-GPU request schemas after the real two-parent integration; remove obsolete duplicate Vulkan selector and retain combined platform-filter regression. Deduplicate only identical or superseded test definitions, retaining the stronger card metadata and reserved-executor assertions. No assertions, admission limits or feature refusals are weakened. All targets of render dependencies, GPU, engine, UI, CLI and native app pass cargo check with raytrace-cpu and bundled-render-library at treec70d00d1. Native executable tests and full current-source acceptance remain pending. This is a private integration rehearsal for subsequent constituent PRs, not an aggregate official render/main merge. * test(render): retain one complete host lifetime regression set Deduplicate byte-identical DropProbe/task-lifetime tests and retain the adapted environment/texture ownership regressions with every assertion and complete memory estimate. Keep the registered-geometry admission regression once; only struct field order differed. Replace a one-element diagnostic loop with its equivalent block, preserving all wrap/width assertions. Test-only integration repair. Formatting and diff checks pass; refreshed executable validation is required. No production behavior, limits, assertions or ignores changed. * fix(doc): recognize the proven format-29 card descriptor alias Normalize only the historical format-29 physical-material-cards spelling, and only when material-engineering-cards is registered. Admission and migration de-duplication use the same identity. Unknown concepts, wrong versions and incapable readers still refuse before mutation. Six controlled-history Rust regressions and actual CLI migration/no-clobber acceptance pass. No version, released migration or CI changes. Refs #5793, #1369, #5493. * test(render): preserve grounding refusal before explicit instance moves Update the two Render binding fixtures for upstream first-occurrence grounding. Verify grounded movement refuses without changing document/history, then explicitly unground through the public command before the intended move. Retain every target, resource, copy and persistence assertion. Refs #5493. --------- Co-authored-by: Christian Svensson <blue@cmd.nu> Co-authored-by: Victor Santos Oliveira <56417388+Vittuu@users.noreply.github.com> Co-authored-by: cfaulkingham <colin.faulkingham@gmail.com>
13 KiB
CPU ray visibility and hard shadows (RT2)
Current combined integration boundary (2026-10-17)
The sections below describe the original RT2 direct-image stage. In the combined source, HDR/reflection integration adds selected ideal/rough-specular reflections and certified planar anisotropy. Environment sampling describes the earlier standalone direct estimator; the combined page specifies the connected reflection path and its disjoint HDR estimators. HDR input remains the bounded decoder route. Only explicit sRGB/D65 primaries are admitted for lighting. HDR plus rough reflections requires fully metallic selected bodies and all effective face responses. HDR plus anisotropy requires the supported rough reflection combination; direct anisotropic HDR and anisotropic delta mirrors refuse. Those additions do not imply MIS, GI or unrestricted material transport.
The opt-in solidcraft-engine/raytrace-cpu feature forwards the render feature.
The native host selects cpu-raytrace only for explicit
integrator: "raytrace"; raster remains the default, and cooperative/browser
hosts refuse ray tracing. Use the same preflight/start/status/cancel/export
commands and job identity described in product-image jobs.
Preflight does not reserve a queue slot or memory; start repeats admission.
The CLI render wrapper accepts settings, output and timeout options, but no
--integrator or --raytrace-options flags. It submits settings and transparency
through the default raster route, waits for the job and exports within that
process. Jobs do not survive the host process exiting. Ray tracing commands can
instead use a persistent native MCP session with the compiled feature and an
installed image host, or the optional desktop image controls described below.
Primary rays default to fixed pixel centres. Explicit primary_samples values
of 4 or 16 use bounded pixel-box quadrature in primary AA.
Reflection samples and viewport MSAA are separate controls. The retained raster
scratch estimate does not mean ray tracing performs raster supersampling.
The light union connects bounded rectangle and point/spot
sources to this same ImageTask; continuous LED strip recipes lower to a rectangle
before capture. These source integrations require their own revision-specific
qualification. Texture sampling and glass/refraction/transmission remain outside
this consumer. Output remains opaque Preview/Image/PNG, without EXR or GPU ray
tracing.
Existing shared-host limits remain: 262,144 triangles, 128 MiB retained source geometry, 384 MiB job admission and a 512 MiB shared pool. These are not total CAD-process RSS limits. HDR buffers, reflection selectors, light options and actual retained capacities join the same ownership/accounting; the common cumulative work cap remains 1,000,000,000.
Desktop CPU/AA controls
The optional desktop feature solidcraft/raytrace-cpu forwards the engine feature
and enables the Render image-method choice when the installed image host supports
ray tracing. Raster remains the default. CPU Edge samples offers exactly
1× (the original fixed centre), 4× or 16×. Preset lighting, cast shadows and
exposure are temporary per-document editor choices. More samples cost more work
and can exhaust the unchanged limits.
Check and Start use the same request builder, native image host and captured-job commands. CPU images require an opaque background. Missing, stopped, cooperative and compiled-out CPU hosts refuse before image scene capture; the selector does not install a fallback or another host. A stale model must be explicitly refreshed or its modelling gesture finished before Check or Start.
The current Check badge is advisory. It invalidates on document identity, revision, visibility, camera/options or host changes. Start rebuilds the current request and repeats admission. The global status message is not a current Check identity. Export uses the retained completed job selected when its file picker opens; changing options does not rerender that image. A failed or cancelled new job preserves the previous successful frame.
Runtime method, AA, preset, shadows and exposure are not persisted by Save Setup or added to document undo. Switching to Raster discards CPU options and resets the next CPU choice to 1×; a new or reopened document starts with Raster. Existing Record and navigation routes are unchanged. This panel does not expose HDR, reflection selection, explicit directional/area/punctual lights, LED recipes or anisotropy authoring. It rejects non-panel raytrace options instead of silently forwarding them. Engine/MCP lighting support is a separate interface.
Qualification and historical evidence
Qualification belongs to a specific source revision and build configuration. Report the exact source, feature-on/off checks, wasm and full CI results, native executable identity and visible evidence in the accompanying PR. Earlier scoped CPU/AA results belong to their recorded source snapshot; they do not certify a later merge with main or changes to lighting and host contracts.
For this UI consumer, evidence must exercise the actual method and AA controls, Check, a new Start/completion for both 4× and 16×, and native PNG export. Check that those requests reach the same host, the exported bytes belong to the selected completed frame, and repeated export does not rerender it. Preserve document geometry, physical properties and history during rendering; save and reopen the design to verify that the transient CPU/AA choices are absent. Include refusal, preflight invalidation and cancellation coverage, with the CPU feature both on and off. These are acceptance criteria, not a claim that this combined revision has passed them. Broader HDR/reflection/light changes require their own evidence.
The combined path includes the exact-coordinate-plane depth correction. On an earlier isolated source, the Rust witness failed before the correction and passed afterwards; that source passed 222 feature-on and 147 feature-off render tests plus scoped Clippy/wasm. Those historical results do not qualify later main integration, primary-shading reuse or reflection-sequence changes. General oblique and near-edge robustness remain outside the coordinate-plane correction's scope.
The original combined source's full CI ended incomplete at its fixed deadline. Known modelling golden failures remain recorded separately; do not attribute their cause to rendering or carry them over as a verdict on another revision without paired baseline evidence. An earlier optional 960x540 request exhausted the billion-unit cap without producing a PNG; smaller drafts do not qualify that request. No cap, assertion, tolerance, ignore or golden-baseline change is implied.
The stage-specific descriptions below record the original direct-image scope,
not a current pass/fail report. This opt-in slice of #1368 follows the phased
render design in #620 and connects SolidCraft's original RT1 triangle/BVH core
to immutable product captures and the existing image-job host. The
raytrace-cpu Cargo feature stays off by default.
Original RT2 runtime contract
render.preflight and render.start accept integrator: "raster" (the default) or
"raytrace". Optional raytrace settings contain lights, exposure_ev and
shadows, plus an optional preset (neutral, warm_cool, key_rim).
A preset and an explicit lights list are mutually exclusive, including an empty
list. Presets use original hard directional-light compositions, not calibrated
color-temperature claims. These values belong to the request, not the saved document or render
setup. A build without the feature refuses raytracing before geometry capture.
The initial image executor is native-only; no browser performance is claimed.
Each light has a world-space direction: [x,y,z] pointing towards the light,
linear-sRGB color: [r,g,b] and relative intensity. Directions are normalized;
all numbers must be finite. At most eight lights and eight retained slots are
accepted, colors are in [0,1], intensity in [0,64], exposure in [-16,16] EV.
Omitting lights uses the existing three-light studio. An empty list is darkness.
These are relative radiances, not measured lux or watts. Background color remains
independent of illumination and exposure.
The scene must be opaque, including face overrides; transparent backgrounds are refused. Captured world positions are used once, preserving occurrence placement. Scalar colors become linear-sRGB opaque dielectric surfaces (roughness 0.7, IOR 1.5); explicit opaque surfaces retain their metal fraction, roughness and IOR. This scalar fallback differs from the legacy raster shading and is not a measured material fit. Density and engineering properties do not change.
The camera uses the existing pixel rays and the same scene-radius near/far policy as product rasterization. Primary rays start on the near plane; shadow rays have independent finite intervals. There is one center sample per output pixel, so edge quality can differ from the supersampled raster image. Shading uses interpolated normals with a geometric-normal fallback and hemisphere checks.
Per-light BVH visibility supplies hard shadows to the existing opaque BRDF. Linear contributions are summed, exposure is applied once, then Reinhard and the piecewise sRGB transfer are applied once. Shadows can be disabled without changing the BRDF. No SSAO is multiplied into this output. No indirect lighting, soft shadows, reflection transport, texture sampling, HDRI lighting, refraction, absorption, emission transport or denoising is implemented here. IOR controls opaque Fresnel; it does not make glass. Unsupported requested capabilities must fail explicitly.
Work and memory
The same native queue, worker, cancellation token and 512 MiB host reservation are used. There is no additional worker pool. Admission retains the conservative raster geometry/pixel/codec estimate and adds BVH input/nodes/order/build stack, per-triangle surface/normals/vertices and 8 KiB for task/light/traversal state. Total admission must remain within 384 MiB including the checked sum of work and retained request allocations. Original directional-light capacities keep a separate lease from the same pool for the job-handle lifetime, even after PNG eviction. Actual buffer capacities may not exceed the planned capacities; the builder's actual reservation is checked before continuing.
One cumulative maximum of one billion work units covers preparation, BVH build, primary and all shadow traversal. Builder operations are debited into that same budget. Exhaustion and cancellation are typed failures, never truncated visibility or a partial successful image. Each traversal step visits at most one node or primitive; each preparation step examines at most one face override. A task call performs at most four such units, or four PNG rows. These are work bounds, not a hard real-time or operating-system memory guarantee.
Shadow origins are reconstructed from triangle barycentrics. Component-wise floating-point rounding bounds projected onto the geometric normal and one outward representable step replace a fixed world-space epsilon. Secondary intervals require a strictly positive representable distance to exclude signed zero after subnormal interpolation. This avoids displacing a Z-plane merely because X is large. Floating-point geometry still has finite resolution; thin blockers, self-intersection and translated scenes require tests.
PNG encoding reuses the bounded cancellable row encoder. Captured geometry, acceleration data, pixels and light buffers are released before successful output is returned; the host drops task state before shrinking to the retained PNG lease. Cancelled or failed jobs preserve the previous successful frame.
Provenance and acceptance
RT1 was copied, with its owner's authorization, from the existing isolated
rt1-raytrace-core contribution. Its original source remains untouched. The new
resumable cursor and image consumer are original Rust additions; the source receipt
records the exact adopted hashes. No external rendering engine, shader source,
commercial CAD asset or new dependency is introduced.
Regressions cover typed cumulative-work exhaustion, resumable traversal parity, near/far camera policy in both projections/up axes, translated thin occluders, self-shadow avoidance, runtime refusal and captured-resource release. Lighting tests use analytic Lambert values and independently masked colored lights. Actual test counts, compiler results and original-scene PNG review must be reported only after execution. Qualification of the integrated revision requires those gates and the PR evidence described above.
Beyond the original direct-image stage, HDR/reflection connections are described at the top of this page. Qualified texture resources, role-correct material maps, progressive transport and explicit glass/medium semantics remain separate work. Community feedback is welcome on bounded latency, normal handling, energy loss in the preview BRDF and reproducible acceptance scenes.