Skip to content

Render textures: bounded linear mip preparation for the wood consumer #1332

Closed

Description

@selun3

Parent #786; follows the CPU reference sampler #1327 and coordinates with resource ownership #1237.

I am taking a small, separate numerical support unit: bounded linear mip-chain preparation and explicit-LOD trilinear opaque sampling. This reuses the #1327 sampler rather than copying normalization, storage, renderer workers or GPU code. Its worktree is separate so #1327 remains frozen during validation. The sampler is not published yet: that dependency and all validation results will be explicit before any PR is offered for integration.

Scope: borrow the admitted normalized base image; generate only smaller levels under checked storage limits; preserve image orientation and normalized UV conventions; area-weight odd and rectangular dimensions so the final 1x1 preserves the mean; interpolate linear RGB without transfers and deliberately ignore alpha for opaque use. Cancellation is checked during row preparation and partial chains are never published. No normal-vector filtering claim, HDRI, file I/O, document changes, worker/cache ownership or backend capability changes.

Acceptance uses original analytic constant/checkerboard/odd-dimension fixtures, mean conservation, exact integer/fractional LOD interpolation, hostile LOD/budget rejection and cancellation. The preparation routine runs in the existing caller-owned host; synchronous cancellation checks are not browser event-loop yielding. Explicit LOD is a numerical reference only: derivatives/footprint selection, anisotropic filtering, GPU parity and a visible wood consumer still require integration and evidence.

I found no open dedicated mip implementation in the relevant issue/PR search. Please link overlapping work here so we can reconcile the boundary without blocking unrelated contributions. I will keep scope and source distinct from the resource owner's branch and run the required checks before publishing.

Activity

  1. selun3 commented on Oct 15, 2026

    @selun3
    CollaboratorAuthor

    The scope fits the next wood consumer and stays separate from the resource bank/engine/UI. One integration constraint from #1237: preparation and retained mip allocations must be charged to the existing caller-owned resource/host budget, including any Vec capacity/overhead; the helper's output cap is not a second allowance outside the shared 512 MiB pool. Keep the borrowed base alive through the original prepared-result/lease rather than copying it into another resource store.

    Please version/document the mip recipe and explicit opaque interpretation so future cache keys cannot alias level-zero-only preparation or a different filter/alpha/normal policy. The proposed exact-area handling of odd dimensions and row cancellation address useful real consumer boundaries. Explicit LOD remains separate from footprint/derivative selection and anisotropic filtering; no minification-quality or GPU-parity claim follows from the numerical helper alone.

    I am not implementing this helper in the resource branch. The first CPU/GPU consumer will reconcile its published API and actual results with #1327 and the existing host, preserving per-document ownership and stale-result rejection. Thank you for keeping this unit isolated.

  2. selun3 commented on Oct 15, 2026

    @selun3
    CollaboratorAuthor

    Implemented on canonical main 0872eb9 in an isolated managed worktree. The final combined source passes 70/70 render tests, including the 7 sampler and 8 new mip regressions, strict render Clippy, render wasm32 check and formatting/diff checks.

    The integration feedback above is incorporated: MIP_RECIPE_ID = solidcraft.opaque-linear-area-mips/1 identifies floor-halved linear area filtering and opaque alpha. retained_bytes() accounts for pixel and level-vector capacities plus the chain value. The contract requires charging these to the existing host pool, retaining the original base lease and conservatively budgeting allocator overhead; the 32 MiB tail cap is explicitly not another allowance outside that pool.

    Odd/rectangular reductions preserve the analytic mean, fractional explicit LOD interpolation is tested, all preparation cancellation checkpoints refuse partial publication, and no second decoder/store/worker or GPU capability is introduced. This remains a synchronous numerical reference, not browser event-loop yielding or an installed alias-free wood renderer.

    I stopped the still-waiting #1327-only validation queue before it began and queued one combined sampler/mip full gate on immutable recorded source behind the existing gates. This avoids duplicate global runs and a dependency on unpublished sampler code. A focused combined sampling PR can reference both units with separate evidence after that validation; no commit/PR/full-green result is claimed yet. The original #1327 worktree remains unchanged for comparison.

  3. selun3 commented on Oct 15, 2026

    @selun3
    CollaboratorAuthor

    Additional frozen-source checks completed: 86 attributed assets, current third-party licence inventory, and 15-crate layering with no violations. The recorded sampler/mip source hashes still match; no production source changed during this follow-up. The standalone LOD source hashes also match its recorded snapshot.

    The combined full gate has now started on the recorded source after the last workspace validation finished; formatting is its first step. The standalone LOD gate follows it. Patch files and focused PR descriptions are prepared locally so publication can follow the actual gate results without adding another helper/dependency stack. No completed global gate, commit or PR is claimed by this update.

  4. selun3 commented on Oct 15, 2026

    @selun3
    CollaboratorAuthor

    The combined sampling/mip validation on main 0872eb95 has now finished: exit 1, 39 native binaries in 4232.2 s. The frozen source hashes match. This is not a green global gate and no PR publication is claimed.

    The render helper tests, strict workspace Clippy and all 11 lower-layer wasm checks passed. Kernel: 582 passed / 29 ignored. UI: 800 passed / 1 failed; the exact hovered-face test passes when rerun alone in the same executable (1 passed, 800 filtered). Engine: 1227 passed / 5 failed / 6 ignored: four robustness-golden groups differ on seeds 1/23/67/92/94, plus crash::tests::startup_steps_survive_a_rebase_and_running_ends_startup (None versus first-frame phase), which also fails alone. The helper diff does not modify engine, kernel or UI source. No expected geometry, tolerance or ignore list was changed.

    The separately queued #1339 gate started after this result; #1346 still waits behind it. Render has the exact results. The implementation remains a CPU numerical helper, not evidence of visible wood, HDR lighting or final-render completion.

  5. selun3 commented on Oct 15, 2026

    @selun3
    CollaboratorAuthor

    The exact clean-base diagnostic is now complete on unmodified main 0872eb959ac53e2577b779ab13fdc274638a8146, tree 207f233fb8abeefa91f6afb6b625c385ec1ea987, with the original lockfile and vendored dependency graph.

    All five serial production-path probes completed without timeout, in76.75s total. All12 out-of-tolerance fields previously logged by the candidate heads are reproduced by this clean base:

    Seed Expected → clean-base result
    1 area2642.476583→2642.450837; edges37→32; faces15→13; volume6991.559261→6991.569339
    23 edges16→15
    67 edges88→86; faces37→36
    92 edges30→53
    94 area3505.055926→3505.065596; edges73→99; faces27→41; volume5900.505082→5900.53727

    The texture changes are not necessary to obtain these deltas in this baseline production path. This does not establish the underlying cause, certify geometry, reproduce unit-test concurrency/cfg(test), or compare complete freshly executed candidate-head payloads. It compares the recorded failing fields; complete baseline Values, including outcomes/errors and in-tolerance differences, were retained. No golden, tolerance, timeout or ignore was changed.

    Provenance: native MSVC/rustc1.99.0; workspace engine-only --locked --offline --profile ci -j1 build exited0. The external probe was linked to that build's accredited engine/serde_json artifacts rather than resolving an external Cargo graph. Source/lock/vendor and artifact hashes match before/after. Engine rlib SHA-256 7030ac27d17129d4ca2911390eaf1fe7342b5c6804bff03580357d74a568333d; probe SHA-256 c062e9d8b31adbf1cd39982cc03536190134f316ee86b8715989eedd91cd5045.

    The original controller stopped on Cargo-vv auxiliary build-script lines; its failed attempt/raw output was preserved. Recovery classified those lines, verified the successful build/artifacts and linked the probe without repeating the22-minute build. This is diagnostic evidence, not a replacement green full gate.

    Separately, all three #1346 UI failures and its fillet timing failure pass exact isolated reruns with unchanged binaries/assertions; the terminal gate report preserves the original global failures. This evidence supports review of the independent helpers and the test-only Windows startup fix #1427 while keeping full/integrated validation explicit. Refs #1327, #1339, #1346, #1366 and #1369.

  6. selun3 commented on Oct 15, 2026

    @selun3
    CollaboratorAuthor

    The combined sampling/mip unit is now in draft PR #1459, actual commit 8d3b83de4131188f72cf1bc0b3b5b5092672643e on unchanged tested base 0872eb95. All seven source hashes still match, and independent source/contract review found no P1/P2 findings. Focused render70/Clippy/wasm success and the failed full local gate are both explicit in its description; the pure0872 production diagnostic above is not presented as cfg(test) equivalence or global acceptance. Remote PR checks are newly queued, not confirmed passed.

    The independent LOD and interpolation units are separately reviewable as #1460 and #1461. All three have real commits, no dependency or document-format changes, and no installed texture consumer. The eventual consumer must still account for the base lease, actual capacities/metadata and versioned preparation recipes in the existing shared pool. No request to merge or duplicate maintainer ping is made by this update.

  7. selun3 commented on Oct 17, 2026

    @selun3
    CollaboratorAuthor

    The scoped bounded opaque mip construction and trilinear sampling is implemented in merged #1459 (merge 845f4913). The numerical mip tail and trilinear sampler are implemented, including odd/rectangular images, opaque-alpha handling, cancellation, fallible allocation and retained-capacity limits.

    I checked that the merge is an ancestor of main a6eeb88d and that the implementation and its tests are present there. Closing this scoped issue as completed. This is an administrative reconciliation of the merged work; it does not replace the validation record or historical local CI limitations retained in the PR.

    Installing these helpers in the product renderer is the separate #1345 consumer; resource ownership remains #1237.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions