Skip to content

Add PsychoV24, Sobol path sampling, DLSS-RR guide corrections, SHaRC, and Ultra screenshots - #43

Open
PEQHUB wants to merge 6 commits into
ComfyFluffy:mainfrom
PEQHUB:codex/pr-final-20260810-04-capture
Open

Add PsychoV24, Sobol path sampling, DLSS-RR guide corrections, SHaRC, and Ultra screenshots#43
PEQHUB wants to merge 6 commits into
ComfyFluffy:mainfrom
PEQHUB:codex/pr-final-20260810-04-capture

Conversation

@PEQHUB

@PEQHUB PEQHUB commented Aug 10, 2026

Copy link
Copy Markdown

Summary

This PR adds four renderer changes: selectable PsychoV24 and analytical display transforms, a replacement path-sampling sequence, corrected DLSS Ray Reconstruction guide data with NVIDIA SHaRC indirect-light caching, and an immutable F4 screenshot mode.

The branch remains a clean five-commit stack:

  1. ee8b9f73 PsychoV24 and analytical tone mapping
  2. d13d8470 Sobol path sampling and RIS
  3. 7184ae66 DLSS-RR guide corrections and SHaRC
  4. e38fab3c F4 Ultra screenshots
  5. 985b0bc8 Validated SHaRC runtime defaults

PsychoV24 and analytical tone mapping

  • Adds the RenoDX PsychoV Test24 / PsychoV24 display operator pinned to fc85b7b15585050442ba35412597ecefc9e04cea.
  • Implements its weighted LMS and MacLeod-Boynton chromaticity processing, CIE 170-2 gamut boundary, Neutwo compression, and 23-point manual hue-direction table.
  • Uses fixed 0.18 adaptation and background anchors. SDR is peak-1 BT.709. HDR uses configured paper-white headroom, converts to BT.2020, scales to absolute nits, and encodes with SMPTE ST 2084 PQ.
  • Adds the AgX default contrast transform, Khronos PBR Neutral, extended Reinhard photographic operator, Krzysztof Narkowicz compact ACES fitted curve, Timothy Lottes parameterized filmic curve, John Hable Uncharted 2 filmic curve, and Hajime Uchimura GT tone-mapping curve.
  • Adds the ITU-R BT.2390 luma-Y' PQ EETF as an HDR option.
  • Keeps the existing ACES 2.0 LUT transforms unchanged. Exposure and bloom are shared, but only ACES 2.0 receives the existing look LMT. PsychoV24 and the analytical operators receive exposed ACEScg directly through their own display transforms.
  • Adds stable SDR/HDR mode IDs, parameter packing, config aliases, HDR paper-white/headroom controls, and effective peak selection. ACES selects the nearest packaged 500, 1000, 2000, or 4000-nit LUT. Analytical HDR operators use the exact configured peak.
  • Adds the Exposure & Tone Mapping settings screen with mode-specific controls and Ctrl+Shift reset.
  • Adds finite percentile validation, empty-histogram retention, invalid pre-exposure fallback, Auto-entry reset behavior, and histogram stride growth that keeps weighted counters inside uint32.
  • Preserves the established defaults: ACES 2.0 for SDR and HDR, exposure low percentile 0.50, and exposure high percentile 0.95. All new operators remain selectable.

Sobol path sampling and RIS

  • Replaces estimator PCG draws with a four-dimensional shuffled scrambled Sobol randomized quasi-Monte Carlo sampler using Joe-Kuo D(6) direction numbers, Burley-style hash-based Owen nested-uniform index and coordinate permutations, and independent per-coordinate digital XOR shifts.
  • Expands the first four dimensions from new-joe-kuo-6.21201. Dimension 0 is evaluated analytically from Gray code. Dimensions 1 through 3 use compact nibble-XOR lookup tables.
  • Stores immutable direction tables and SecureRandom roots in a GPU buffer-device-address table. Roots are randomized per renderer initialization and independent per continuation branch, bounce, semantic sample group, and coordinate; exact noise patterns are not replayable across restarts.
  • Adds stable sampler substreams for interface and lobe selection, Russian roulette, GGX visible-normal distribution function sampling, cosine-weighted diffuse hemisphere sampling, celestial jitter, and each RIS proposal and replacement decision.
  • Adds a global sample cursor and epoch. Changes to samples per pixel, maximum bounces, RIS candidates, or sampler layout reset temporal consumers before the new sequence is used.
  • Adds lights.ris-candidates with range 0 through 32. The renderer profile stays at eight candidates by default, and Off remains selectable. Changing it rebuilds terrain emitter records without resetting DLSS-RR history.
  • Keeps the renderer-profile maximum-bounces default at 4 while supporting the existing 2 through 8 range.
  • Changes the Ampere-sensitive RIS shader shape so local and global alias/BDA chains execute before selection. Packed 32-byte lights are read as two explicit float4 loads at byte offsets 0 and 16.
  • Adds valid local-alias and zero-span sentinel storage for discarded RIS chains, including sparse empty grid cells and nonempty hierarchies without a grid.

DLSS Ray Reconstruction and NVIDIA SHaRC

The existing renderer already supplied DLSS Ray Reconstruction with HDR color, hardware depth, motion, diffuse and specular albedo, normals and roughness, reflection motion, matrices, jitter, and reset state. This PR does not claim those as new.

  • Adds the two missing DLSSD guide inputs:

    • pInResponsivityMask, backed by an R16_SFLOAT image.
    • pInIsParticleMask, backed by an R8_UINT image.
  • Marks primary and transmitted sky pixels responsive so DLSSD does not reuse unstable sky history. Marks primary particle hits in the particle mask.

  • Adds a separate R16_SFLOAT primary-sky classification image for the display pass. This image is not passed to DLSSD.

  • Publishes exact reversed-Z far depth for primary sky and reprojects infinite sky directions with homogeneous w=0, removing camera translation from sky motion.

  • Publishes zero depth and motion for transmitted sky, which has no stable destination correspondence through the foreground interface.

  • Rejects nonfinite clip coordinates, depth, and motion before writing guide images.

  • Changes particle motion from one centroid displacement copied to every vertex to identity-keyed per-vertex current-minus-previous displacement.

  • Applies NVIDIA's RR texture LOD recommendation: log2(renderWidth / displayWidth) - 1.

  • Validates queried RR dimensions and aspect ratio, falls back to full-resolution RT if size negotiation fails, and clears the reset flag only after a successful DLSSD evaluation.

  • Adds explicit RR history-reset ownership and result-checked feature release. If NGX retains native device ownership during teardown, the renderer stops new RT work and requires a process restart instead of destroying the Vulkan device underneath NGX.

  • Integrates NVIDIA Spatial Hash Radiance Cache (SHaRC) SDK 1.8.0.0, pinned to e19ccacd511f42a3df6f850052d508c13c9e9737.

  • Enables directional spherical-harmonic radiance storage, 64-bit hash-grid atomics, material demodulation, separate emissive storage, cache resampling, propagation depth 4, and optional anti-firefly weighting.

  • Adds sparse SHaRC update ray generation, full-cache compute resolve, and full-resolution query variants for ordinary and Shader Execution Reordering pipelines.

  • Keeps direct lighting and the current path vertex live. Cold, invalid, dynamic, metallic, malformed, and near-delta queries continue through ordinary tracing.

  • Adds a six-slot timeline-protected cache frame ring, a 16-frame query warm-up, and explicit update-to-resolve-to-query synchronization.

  • Adds reset policy for camera cuts, terrain changes, settings changes, dimension sky changes, and End flash discontinuities.

  • Adds fail-closed checks for packaged SHaRC metadata, shader variants, license, shaderBufferInt64Atomics, shaderFloat16, and storageBuffer16BitAccess.

  • Adds SHaRC settings, cache memory reporting, clear-cache, and restore-default controls.

  • Uses the validated default profile: SHaRC on, 2^22 entries (about 256 MiB), anti-firefly on, primary debug off, 3x3 update tiles, 384 accumulation frames, 128 stale frames, scene scale 32, radiance scale 1000, grid base 3, grid bias 0, and roughness threshold 0. Existing saved configs remain respected.

  • Compared with the initial placeholder profile, the default cache is four times larger and 3x3 tiles emit about 7.1 times as many update rays as 8x8 at 3840x2130. This is a deliberate quality/stability profile; allocation failure remains fail-closed to ordinary tracing.

  • Adds native End skybox and End flash reconstruction. The display pass replaces only visible primary End sky; transmitted sky remains owned by the foreground glass or water surface.

  • Adds an explicit NGX shim ABI version and a new DLSSD evaluation ABI carrying the two new masks.

  • Queries NGX-required Vulkan instance and device extensions before object creation instead of relying on a manual extension list.

  • Fails DLSS features closed on ABI mismatch, missing required extensions, truncated extension queries, stale native extraction, or failed old-device shutdown.

  • Pins and validates the DLSS SDK checkout, required headers, static library, and runtime payloads before rebuilding and packaging ngxshim.

  • Makes an explicit -PacceptSharcLicense=false override an environment value of SHARC_LICENSE_ACCEPTED=true.

F4 Ultra screenshots

  • Adds F4 Ultra Screenshot without changing saved renderer settings.
  • Requires active RT, DLSS-RR, debug view Off, and a fresh ready frame.
  • Temporarily uses 8 samples per pixel and DLSS quality mode 5, DLAA, for the capture only.
  • Resets jitter, RR, path-sampling, SHaRC, and motion history while retaining the current valid exposure.
  • Accumulates one complete CausticaJitter.currentPhaseCount() period of fresh DLSS-RR frames. Skipped or stale frames do not advance capture progress.
  • Freezes camera, projection, fog, sky state, world flags, water parameters, breaking overlays, entities, geometry tables, TLAS, exposure, texture animation, input, and terrain streaming.
  • Suppresses keyboard presses and repeats plus mouse-wheel hotbar changes during accumulation. Key releases still clear held state, an initial unmodified F4 press remains the cancel action, capture cannot start over an interactive screen, and a screen opened programmatically invalidates capture before composition.
  • Reuses the first capture TLAS and entity snapshot while extending their graphics-timeline ownership on every submitted frame.
  • Writes zero displacement into retained entity, block-entity, and particle geometry entries so first-frame motion is not reapplied throughout accumulation.
  • Pauses only an unshared integrated server. LAN and remote worlds remain running and request a complete terrain residency rebuild when capture ends.
  • Captures the final composed main target at GameRenderer.render tail and hands it to the vanilla asynchronous PNG writer.
  • Adds a synchronized screenshot lease shared with F2. Pending F2 writes block F4, pending F4 writes block F2, and stale callbacks cannot release a newer lease.
  • Cancels on world, player, renderer settings, camera, window, resolution, phase-count, RR, reload, or renderer-lifetime changes, and restores capture-owned state on every exit path.
  • Ends capture ownership before retrying a capture-time RR failure, so the retry uses the configured normal RR quality. Unsafe native release remains fail-closed, and temporal state is reset on every exit path.
  • Preserves the existing F2 PNG and paired scene-linear EXR behavior.

Interface changes

  • New SDR/HDR tone-map mode and parameter fields in DisplayPush.
  • New BDA path-sampler address, cursor, epoch, and RIS fields in WorldPush.
  • New DLSSD native evaluation ABI with particle and responsivity guide resources.
  • New SHaRC generated push-constant and frame records.
  • New English-only video settings and F4 key binding.
  • No Frame Generation algorithm, settings, or RtDlssFg changes. Frame Generation continues to use the shared NGX shim/runtime updated by this stack.

Validation

  • Clean build passed with all 18 tasks executed.
  • 96 Java tests in 30 suites passed with no failures, errors, or skips.
  • All 32 ordinary, SER, SHaRC, and SHaRC+SER SPIR-V modules compiled and passed validation.
  • Shader-record and Java-binding generation passed.
  • A fresh Windows ngxshim.dll was built, packaged, and checked for ngxshim_abi_version, ngxshim_required_extensions, ngxshim_evaluate_dlssd_v2, and ngxshim_release.
  • The negative license-precedence check rejected -PacceptSharcLicense=false even when the environment contained SHARC_LICENSE_ACCEPTED=true.
  • Final JAR SHA-256: 3FAB4CE46EE252C72351A36943950346372608AC3EB15B57506FF4237AB083A0.

A short local Windows/RTX 5090 smoke on a77d772c initialized NGX, DLSS-RR, and SHaRC, loaded three worlds, showed no Vulkan timeout or device-loss signature, and shut down normally. Final head 985b0bc8 adds only the narrow F4 input guards and the validated SHaRC default profile above; it has clean build and static proof but has not been activated in Minecraft. Hosted GitHub Actions is awaiting maintainer approval for this fork workflow. This PR is ready for human code review, but it is not yet merge-ready or release-ready; RTX 3090 reproduction, Linux runtime, HDR/PsychoV24 visual acceptance, F4 completion, and a longer soak remain pending.

@PEQHUB
PEQHUB force-pushed the codex/pr-final-20260810-04-capture branch from 1c223d8 to a77d772 Compare August 10, 2026 19:27
@PEQHUB
PEQHUB force-pushed the codex/pr-final-20260810-04-capture branch from a77d772 to e38fab3 Compare August 10, 2026 19:48
@PEQHUB
PEQHUB marked this pull request as ready for review August 10, 2026 19:49
@ComfyFluffy

ComfyFluffy commented Aug 12, 2026

Copy link
Copy Markdown
Owner

I am doing a large refactor, basically a rewrite, so it may take a while before I can respond to the PR.

Verbatim copy of the RenoDX PsychoV Test30 shader, kept beside
psychov24.slang as the pinned reference for the Caustica Slang adaptation.
The file is inert to builds: only *.slang sources are compiled and packaged,
and its relative include resolves against the RenoDX tree. THIRD_PARTY_NOTICES
documents the MIT provenance (Carlos Lopez).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants