Skip to content

sync: merge main into cpp-migration - #3038

Closed
tedin7 wants to merge 39 commits into
R0Y00:cpp-migrationfrom
tedin7:sm2-sync-main-cpp
Closed

tedin7 wants to merge 39 commits into
R0Y00:cpp-migrationfrom
tedin7:sm2-sync-main-cpp

Conversation

@tedin7

@tedin7 tedin7 commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

Part of #1198

What this unblocks: cpp-migration catches up with main (37 commits), so PRs based on cpp-migration stop falling behind.

Merge commit of origin/main into cpp-migration (no rebase, no force). Four conflicts, resolved keeping both sides:

  • src/startup_stubs/d3d12_compute_dispatch.inl: the in-process translation (translate_compute_natively) stays next to the new root SRV resolver; the per-key retry gate uses main's manifest_retry.due() and still tries the native translation first.
  • tests/startup_stream_consumer.cpp: main's table-offset / root-changed / heap-changed modes plus cpp-migration's dispatch-records32.
  • tests/startup_run_ps1_check.py: the stub record carries both the native SDK field and main's title id and storage fields.
  • tools/startup/gfx2hlsl.py: main's vconst literal tracking now sits in set_v (git had paired it with the wrong function).

Verification:

  • git merge origin/main on a branch from origin/cpp-migration; python3 -m py_compile tools/startup/gfx2hlsl.py tests/startup_run_ps1_check.py: ok.
  • No conflict markers left; no Windows run (CI decides). Merge with a MERGE commit, not squash.

AI-assisted; commands listed were executed locally.

xiaoqi72665 and others added 30 commits November 27, 2026 10:58
Document the Windows 10 GPU Check results, including the Shader Model 6.5 capability skip.

Refs #1.
Submit an explicit render-target clear before the main sequence and the skipped-draw control. Preserve the pixel-history checks.

Refs R0Y00#1268.
Validate module names and row shape before publishing routing metadata. Exercise boundary and mutation controls.
Reject boolean and malformed inputs to the host commit budget check. Cover page bounds and mocked Windows API behavior.
…0Y00#2970)

Support a bounded uniform sampler diamond for explicit 2D LOD operations. Validate both sampler definitions and exercise both selectors, swapped bindings and supported limits with source-built fixtures.
Preserve modulo-32-bit subtraction in the non-returning, barrier-delimited LDS profile while avoiding the reported groupshared PSO creation failure. Pin both additions with a readback mutation.
Use the spatial coordinates for LOD on supported 2D-array resources and retain the derivative and static sampler checks. Verify two slices and two derivative scales against direct HLSL.
Compare canonical script paths while preserving command arguments and the original execution paths.
Use the existing bitwise binary32 scaling contract and pin the lowering with source-built decode and refusal controls.

Refs R0Y00#2618.
Validate a bounded calculated branch to a pure terminating continuation and verify byte-exact extraction with LLVM 15.
Bind eligible raw table SRVs directly to a placed buffer alias when enabled. Preserve combined index and shader read states and validate the full rounded range.

Fixes R0Y00#2976.
…Y00#2869)

Clear the three inherited dump switches before applying each explicit fixture case.
Select the high or low word with bit five and preserve lane-mask refusals. Verify both operations with source-built controls.
…2891)

Compare both scalar words and preserve the refusal of lane masks. Exercise equality, inequality and each independently differing half.
Track submitted diagnostic readback ownership until its matching fence completes. Retire timed-out work asynchronously and disable reuse on device removal or failed signals.
Invalidate the high VCC proof for a live unsigned VOP3B carry and rotate both runtime shader request keys.
)

Preserve untouched channels when disjoint pixel stores target the same texel. Keep full-mask array and compute behavior.
Select the original half encoding for each packed result, retaining signed zero and the one-NaN rules.

Refs R0Y00#2022.
…00#2903)

Permit dead opaque selects and refuse numerical, joined-descriptor and high-pair uses.

Refs R0Y00#2618.
Lower the per-byte average with the rounding bit and reject unsupported encoded modifiers.
Bind tracked, bounded root SRV ranges during translated compute Dispatch and keep the indirect route restricted to fixed-table raw buffers.
Outline a staged control-flow proof with source-built fixtures and negative controls.
Lay out separately testable translator, pipeline creation and mesh dispatch milestones.
Add a source-built CPU reference for node intersection and pointer decoding, with model-only witnesses.
Retry missing graphics and compute manifests with a bounded shared backoff. Reset the schedule once a manifest appears.
…00#2949)

Refuse stale command-list resubmissions before execution when a released upload chunk has been recycled. Keep the behavior behind X2W_D3D12_RING_RELEASE_AT_SUBMIT.

Fixes R0Y00#2948.
)

Lower full-channel compute stores to 1D and 3D texture UAVs and validate the selected mip and W range when binding. Cover both dimensions with source-built readbacks and refusal controls.

Refs R0Y00#2022 and R0Y00#2274.
…00#2892)

Use the runtime-dependent readback words to distinguish fused FMad from separate multiply and add. Preserve the compiler-folded first word in both probe models and include the first mismatches in diagnostics.

Fixes R0Y00#2883.
Lower 64-bit scalar bit clear and set with six-bit indexing. Preserve the index when it aliases the destination pair and verify both operations with source-built readbacks and rejection controls.
Keep in-flight present signature resources when the fence reports device removal. Re-observe the fence after the bounded teardown wait and publish a sample only after verified completion.
thepatrickworld and others added 9 commits November 27, 2026 15:40
…0Y00#2865)

Record the observed mip choices, error bounds, negative controls, adapter and pinned toolchain for the AMD Radeon RX 9070 XT report.
Use literal paths when checking and reading MicrosoftGame.config. Cover normal and bracketed paths and an absent manifest with a matching sibling.
…00#2874)

Verify the selected descriptor offset and same-heap rebind. Confirm the exact table refusal with untouched output when the root or view heap invalidates the binding.

Refs R0Y00#2470.
Validate dimensions, pitch, format names and padding before tiling or linearizing block surfaces. Add source-built round-trip, refusal and mutation coverage.
Use streaming-store intrinsics for supported non-temporal stores and preserve native SIMD alignment faults. Compare source-built native and lowered stores byte for byte with fault and mutation controls.
Lower the FP32 box32 intersection with constant descriptor and node inputs. Preserve original child order when sorting is disabled. Cover exact WARP and hardware readback and miss-fill controls.
Lower byte permutation, sign-byte selection and constant selectors through on-demand HLSL helpers. Cover exact selectors and modified instruction refusals with source-built controls.
Conflicts: d3d12_compute_dispatch.inl (native translation kept next to the
root SRV resolver; manifest retry gate kept with the native attempt),
startup_stream_consumer.cpp (table-offset/heap-change modes and records32),
startup_run_ps1_check.py (native SDK + title id + storage fields),
gfx2hlsl.py (vconst tracking moved into set_v).
…eader

main moved the runtime request keys to x2w-startup-shader-29 / 29cs; the C++
reader, its fixtures and the doc still hashed revision 28, so a native
translation refused every compute request with 'compute request key mismatch'.
@tedin7

tedin7 commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator Author

Focused Windows receipt for head e3397e416 (pull/3038/head, default pool, dev and release run in parallel, Windows 11 build 26100, WARP and the VM's hardware adapter).

x2w_pipe.py win2025 3038 --regex '^startup_(compute_dispatch|stream_consumer|stream_draw|run_ps1|gfx2hlsl|native_graphics|list_cost_bench|view_token)'   (on 75aa29d3)
x2w_pipe.py win2025 3038 --regex '^(startup_(compute_dispatch|stream_consumer|run_ps1)|native_(compute_clear|direct_container|startup_request_cache))'   (on e3397e41)
  • First run on the plain merge (75aa29d3): 370/372 passed on dev and on release. The two red tests, startup_compute_dispatch_native_{warp,hardware}, were a real conflict between the two sides: main moved the runtime request revision to x2w-startup-shader-29 / 29cs, while the C++ reader on cpp-migration, two fixtures and one doc still hashed revision 28 ("compute request key mismatch"). e3397e416 moves them to 29.
  • Second run (e3397e41): 23/24 passed on dev and on release. startup_compute_dispatch_native_warp skips (no 32-lane waves on WARP) and _hardware skips on the VM adapter; native_compute_clear, native_direct_container and native_startup_request_cache_warp pass.
  • One red remains: native_startup_request_cache_hardware, debug layer "Shader wants wave lane count of 32 but maximum wave lane count for device is 4". The VM adapter has 4-lane waves. It fails the same way on an unrelated cpp-migration PR head (shader: lower the non-packed 16-bit integer VOP3 ops in the direct C++ compute path #3018, fb760133), so it is not caused by this merge; the test needs a wave-size skip.

AI-assisted; commands listed were executed locally.

@tedin7
tedin7 marked this pull request as ready for review November 27, 2026 10:07
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-27T10:14:36.365005Z e3397e4 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

R0Y00 commented Nov 27, 2026

Copy link
Copy Markdown
Owner

Thanks for the independent Windows receipt and for isolating the four-lane adapter failure. The sync through main 8a901eb2 already landed on cpp-migration as b8f49259. It accepts current revision-29 and archived revision-28 cache requests. On the RTX 4060 Laptop, the cache hardware test passed in Debug and Release /O2; the two separate wave32 fixtures reported their WARP capability skips. Please close this overlapping draft. The four-lane skip in native_startup_request_cache_hardware can be handled as a separate focused change against the current branch.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e3397e4167

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/startup/gfx2hlsl.py
'lowered in this slice' % (name, tok))
raise Unsupported('%s descriptor %s is not four constant SGPRs' % (name, tok))
words = ['0x%08xu' % (value & 0xffffffff) for value in values]
base = ((values[1] & 0xff) << 32) | values[0]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Decode the BVH base field in 256-byte units

For a constant T# describing byte base 0x100000, the encoded base is 0x1000: both bvh_model.descriptor() and the native fixture's descriptor_for() store base >> 8. This code instead emits srv 0 bvh base 0x1000 ..., so the manifest names the wrong allocation. The later vals[0] & 0xff check also rejects valid 256-byte-aligned bases such as 0x123400. Reconstruct the byte address with the missing left shift and validate alignment on that address rather than on the encoded units.

Useful? React with 👍 / 👎.

Comment thread tools/startup/gfx2hlsl.py
Comment on lines +7885 to +7886
if node is None and node_reg and node_reg[0] == 'v' and not getattr(self, 'has_branches', True):
node = getattr(self, 'vconst', {}).get(node_reg[1])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Invalidate cached node literals on every VGPR write

In a straight-line compute shader, v_mov_b32 v16, 5, v_mov_b32 v28, 0x15, then v_swap_b32 v16, v28 leaves vconst[16] equal to 5 because op_v_swap_b32() emits register writes directly without calling set_v(). A subsequent image_bvh_intersect_ray therefore hardcodes node 0x05 even though the actual operand is 0x15, intersecting the node at offset 0 instead of offset 128. Update or invalidate the literal cache for all VGPR destination writes, including direct-emission helpers, before using it to fold the node operand.

Useful? React with 👍 / 👎.

@R0Y00

R0Y00 commented Nov 27, 2026

Copy link
Copy Markdown
Owner

Thanks for preparing the branch sync. We merged cpp-migration into main in #3039 (91cbedd), so I’m closing this sync PR.

One change is worth following up separately: e3397e4 updates the native startup request keys and fixtures to revision 29. On current main, tests/native_direct_container_check.py still constructs a revision-28 key. Please carry the revision alignment into a focused PR against main and verify that the runtime producer and offline compiler accept the same graphics and compute requests. The original commit remains linked here for reference.

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.