Repository navigation
Model L's own reconstruction on the D3D12 frame (runtime option l_post=own) - #162
Merged
Merged
Conversation
…t=own) Native D3D12, Model L: l_post=own runs l_post_recon_p12 (l_coef_pack12's images; l_coef + l_post_recon where the pack12 kernels do not fit), then the unbanded analytic filter w64/post_filter_c1_s4, in place of Model M's fused pack12 post. The default stays Model M's fused post (l_post=m); the kernels line names the route (l_post=l_post_recon / m_pack12). Direct-resource route (games): two D3D12-only kernels (dx12/kernels/l_post_direct.hlsl) stage the game's colour into color_net with the staged route's values (native_direct_normalized_color) and store the filter's FP32 output into the game's texture (native_direct_scale for pi, framebuffer_half bytes with output_rne16, alpha 1). The direct route then gives the staged route's bytes. Checks: CPU recorder (test_l_runtime_frame D3D12.test_own_post / test_own_post_refusals), and the GPU check clean/l/runner/l_d3d12_own_post_check.py against the HIP frame and the reference. Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com> # Conflicts: # clean/l/runtime/tests/test_l_runtime_frame.py # clean/runtime/runtime.cpp
phantoslayer21
marked this pull request as ready for review
November 14, 2026 10:40
phantoslayer21
added a commit
that referenced
this pull request
Nov 14, 2026
… trace per choice - run.py: runtime_options_extra in the config and --extra on prepare / use-m / use-l (e.g. l_post=own, then --extra '' for the default post in the same session); set_options replaces the items it added before (timing, launch trace, the previous extra) instead of appending them again. - run.py: each model choice writes its own launch-trace-<time>.txt; collect summarises every trace on its own. - offline_create.py: --extra adds runtime options to Model L's runs. Used for the Model L own-reconstruction game run (#162). Refs #89 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…copy store; kernel sets - clean/l/runner/l_d3d12_fallback_check.py: the fallback route (recon2_supported false: l_coef, l_post_recon, w64/post_filter_c1_s4), chained as the frame runs it, against HIP byte for byte, with edge tiles at sizes that are not tile multiples; sentinels, slack, negative control, Model M control. - clean/dx12/tests/post_tf_d3d12_check.py --store: HIP's output-copy rows (post_filter_c1_s4_o16 / post_filter_h) against w64/post_filter_c1_s4 then l_direct_store with output_rne16 = 1 into an RGBA16F texture, with FP16 subnormals, values past 65504, infinities, NaN and rounding ties. - kernel_replay: direct_params takes color_pi and output_rne16. - kernel_sets.json regenerated: l_direct_color and l_direct_store in Model L's set (Model M: 46). Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…nels, raw defined bytes, negative controls Each run fills its outputs with its own sentinel before every frame and records every output's raw defined bytes; both raw comparisons (against HIP, defaults against stages) fail on a missing output, another size or any differing byte, and carry l_frame_check's record-level negative controls. Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #89
Runs Model L's own reconstruction in the native D3D12 Model L frame, behind the runtime option
l_post=own. The pipeline isl_post_recon_p12(#141), then the analytic filterw64/post_filter_c1_s4(#147), in place of Model M's fused pack12 post. The default doesn't change: Model M's fused post (l_post=m) runs until the release lead's game screenshot comparison is done.What
clean/runtime/runtime.cppl_post=m|own.ownis a Model L option. On HIP it changes nothing, because Model L always runs its own post there.l_own_post_setup), the route becomes the unbanded pack12 route:l_post_recon_p12reads the pack12 images. They come from the decoder fold (Model L on D3D12: the decoder block with l_coef_pack12 as its epilogue #159, on by default) or froml_coef_pack12.l_coefandl_post_reconrun instead.w64/post_filter_c1_s4.ownrefuses:l_post_reconis HDR.l_post=l_post_recon, orl_post=m_pack12for the default D3D12 route.manifest_missing()is built on Model L on D3D12: the decoder block with l_coef_pack12 as its epilogue #159'smanifest_kernels().l_post_recon_p12reads colour from a buffer. Two D3D12-only kernels are added inclean/dx12/kernels/l_post_direct.hlsl(co=-,rs=direct):l_direct_colorstages the colour texture intocolor_net(16 bytes a pixel) usingnative_direct_normalized_color. These are the staged route's bytes: the Converter's dense RGBA with alpha +0, divided by pi ascolor_dividedoes when pi != 1.l_direct_storewrites the filter's FP32 output into the game's output texture:scale_rgb(native_direct_scale) when pi != 1;output_rne16(the RGBA16F output-copy rows),framebuffer_half's bytes (±65504 clamp, round to nearest even), aspost.hlsl's direct forms store them;color_netand the FP32 output buffer, andvalidate_native_direct_config/validate_native_direct_frameaccept the route.clean/l/runner/l_d3d12_own_post_check.py(new): the GPU check below, onl_frame_check.py's frames, models and build.l_frame_check.pyitself is unchanged.clean/l/runtime/tests/test_l_runtime_frame.py(CPU recorder):D3D12.test_own_postcovers sizes that change, a reset, and a frame of render size D (the non-pack12 fallback). It checks:l_post_recon_p12after the fold;D3D12.test_own_post_refusalscovers the refusals above, each missing port by name, the default stillm_pack12, and HIP unchanged.clean/tests/runtime_frame_trace.cppdecodesl_post_recon_p12andpost_filter_c1_s4.GPU record (merged tree 7e8778b, one GPU slot per run)
Frames:
l_frame_check's sequence.l_post=ownagainst the HIP Model L frame (l_post_recon+ the same filter), every output both write, byte for byteenc1.mergedl_post=own, fusions off, per stage against the CPU reference on its own inputsclean/l/reference/recon.py, Model L's post acceptancerecon.output_filterenc2.merged) is off on frame 1. Per stage it passes there. See the note below the table.native_direct_test, Model L,l_post=own, pi 1 / 1.375, exposure modes 0 / 1 / 2, resets)b5 on frame 1. The chained reference (b0 … b5 as one unit, started from
enc2.merged) parts from the runtime on frame 1. The two runs below show the runtime's b5 is right per stage:The script checks this explicitly and records the frame.
The launch trace of the direct-route format run shows the route:
l_post_recon_p12andw64/post_filter_c1_s4192 times each (96 direct + 96 staged frames);l_direct_colorandl_direct_store96 times each;color_divideandscale_rgb48 times each, on the staged frames with pi != 1;Controls (same build):
l_frame_check --compare-d3d12, the default route:native_direct_testwithout the option: 16 / 16, runningpost_tf4_dl_*as before.l_frame_check --compare: L and M pass, 11 / 11.Tested
clean/l/runtime/tests(33);clean.tests.test_runtime_frame_trace(7);Not tested
l_coef+l_post_recon) on the GPU in the frame. The recorder test covers its launches, and both ports are byte-exact on their own (Model L: D3D12 port of the reconstruction kernel l_post_recon, byte for byte against its HIP kernel #136 and thel_coefport). The check's frame sequence has no such size.output_rne16 = 1(the RGBA16F output-copy rows, the game executor's default route) on the GPU.native_direct_testbindsoutput_rne16 = 0. The store usesframebuffer_half's clamp andwg_f2h, aspost.hlsl's direct forms and the direct output table do.l_post=ownagainst the current post.Review fixes (REVIEW-162), merged tree f425e99 (main 9a42f4b)
Offline GPU comparisons against HIP, one GPU slot each.
l_d3d12_ops_check.py's raw-byte engine.1. Fallback route (
recon2_supportedfalse).clean/l/runner/l_d3d12_fallback_check.py --seeds 2. The chain is run as the frame runs it:l_coef;l_post_reconon HIP's A, B, C;w64/post_filter_c1_s4on HIP's display image.The 5 frames, D = (3 O + 1) / 2:
Every launch has edge tiles: D columns are not a multiple of 32, D row pairs not of 8, O columns not of 40, O row pairs not of 8, and R is not a multiple of 32.
l_coefl_post_reconw64/post_filter_c1_s4swin_block_c96_ncNegative control (
l_post_reconwith half its workgroups): caught, 146,011 differing bytes.2. The
output_rne16 = 1RGBA16F copy store.clean/dx12/tests/post_tf_d3d12_check.py --store --seeds 2.post_filter_c1_s4_o16(pi 1) orpost_filter_h(pi 1.25, 1.375, 30000; pitch 8 O).w64/post_filter_c1_s4, thenl_direct_storeinto an RGBA16F texture filled with 0x5A beforehand, withcolor_piandoutput_rne16 = 1.kernel_replay'sdirect_paramsnow takes both.--direct):orig_w64/post_tf_f32_p12_diet_vsit_direct8 / 8 identical. The analytic direct forms: 10 / 10 and 10 / 10. Negative control caught.3. kernel_sets.json (#154), regenerated:
l_direct_colorandl_direct_storeare now in Model L's set. Model M: 46 kernels; Model L: 18.Re-runs on the merged tree:
l_d3d12_own_post_check.py: against HIP 11 / 11 identical, negative control caught, per stage 11 / 11, defaults against stages 11 / 11.native_direct_testwithl_post=own, matrix: 96 / 96 frames, 24 formats, 0 debug-layer errors.native_direct_test, default route: 16 / 16.clean/l/runtime/tests(33),test_kernel_sets(3).Finding 1 (the frame check's byte-identity gaps) is fixed by param's #165. After #165 lands,
l_d3d12_own_post_check.pymoves to its raw API (fill_sentinels/raw_outputs/raw_compare/negative_controls). Param has already runl_post=ownwith the fixed checker: 11 / 11 raw-byte identical, all negative controls caught.Frame check on l_frame_check's raw-byte API (#165), head 0b89598 (main dc80ba5)
l_d3d12_own_post_check.pynow usesfill_sentinels,raw_outputs,raw_compareandnegative_controls.d3d12_own0x5A,d3d12_own_stages0x3C).l_post=ownagainst the HIP Model L frame (28 outputs: post history, reduced history, display image, output, state, every stage)The REVIEW-162 offline comparisons above still stand:
output_rne16 = 1RGBA16F copy store: 22 / 22.