Skip to content

macOS: harden shader lowering, resource synchronization, and runtime setup - #671

Closed
0b101010-lab wants to merge 1 commit into
pragyaangaur:mainfrom
0b101010-lab:pr/0b101010-macos-runtime-prerequisites
Closed

0b101010-lab wants to merge 1 commit into
pragyaangaur:mainfrom
0b101010-lab:pr/0b101010-macos-runtime-prerequisites

Conversation

@0b101010-lab

@0b101010-lab 0b101010-lab commented Nov 28, 2026 •

Copy link
Copy Markdown

This change improves shader translation, resource synchronization and toolkit setup on the existing macOS D3D12/D3DMetal path. It preserves current main's mesh layout planner, SCC proof, descriptor batching and CrossOver release handling.

We were able to reach the game and control the character in local testing. That earlier run used VICTORY_FAULT_TRACKING=1 and D3DMetal 4.0 beta 1, lasted 13 minutes 50 seconds, and ended when we closed the window, with no newly appended crash-log bytes. Fault tracking remains opt-in under Wine/macOS.

On this integrated build with D3DMetal 4.0 beta 3, we observed substantially better rendering. The indoor scene and character are visible, but rectangular artifacts and blur remain, at about 2 FPS. Logs show 56 rejected compute shaders and hundreds of skipped operations per frame. Rendering correctness, acceptable performance and long-term stability remain unfinished; the combined source integration and runtime upgrade do not isolate which change produced the improvement.

Screenshot

D3DMetal 4.0 beta 3, 28 November 2026: 2 FPS, with visible rectangular artifacts and blur.

VIctory running an indoor scene on D3DMetal 4.0 beta 3 at 2 FPS, with rectangular rendering artifacts

Changes

  • Extend guarded wave64 lowering on 32-lane hosts: scalar publication, immutable tables, bounded register indexing, saved EXEC, first-lane ownership and paired LDS ordering. Add synthetic value and rejection regressions, including multiple relative reads and recomputation of publication facts after loop rewrites.
  • Keep upstream's measured mesh layout planner and generalized SCC proof; retain value/clipping regressions and guard oversized negative Wine cases before pipeline creation.
  • Synchronize placed descriptor heaps with missing or partial write tracking, bound scans to host capacity and protect rereads of placement memory. Preserve upstream batching, foreign-slot policy and bindless invalidation.
  • Correct partial block-compressed texture uploads, use host row bytes in upload markers and avoid merging refresh ranges across already-current untracked bytes.
  • Share runtime shader options with offline diagnostics, preserve filtering/prewarm behavior and apply the repository output policy to failure dumps. Add bounded, opt-in pool/residency diagnostics.
  • Validate and stage D3DMetal upgrades with rollback, requiring 4.0 beta 3 or newer. Preserve the installed runtime on preflight failure, caller-relative image paths, release-aware Wine stamps and relink diagnostics.
  • Make BVH-builder dispatch opt-in with VICTORY_BVH_BUILDER=1; otherwise default to estimated ambient light and skip resolve passes. Explicit lighting overrides remain available. This default behavior change warrants maintainer review.

This does not implement a native Metal backend. Game files, generated title shaders, captures and Apple redistributables are excluded from the repository.

Validation

  • Native workspace suite: 956 passed, 0 failed, 23 ignored.
  • Windows-target workspace Clippy with -D warnings, default and all features: passed.
  • Asset policy: 356 files OK.
  • Synthetic toolkit version, installation/rollback, caller-relative path and CrossOver stamp tests: passed.
  • Full serial Wine workspace suite, all features, on D3DMetal 4.0 beta 1: 1,818 passed, 4 failed, 54 ignored. All four failures stop at the enhanced-barriers support prerequisite in unchanged upstream tests: enhanced_barriers_supported_and_command_list7_available and the three narrow_clamp_sync_* tests.
  • After upgrading to 4.0 beta 3, all four previously failing tests passed individually. The full suite has not been rerun on beta 3.
  • Three additional descriptor regressions explicitly run under Wine: passed, covering untracked heaps, partial tracking and decommitted placement.
  • Whitespace check: passed. WARP and optional DXIL validation are not claimed.

Preserve upstream mesh layout, SCC analysis, descriptor batching and
CrossOver release handling while integrating the guarded shader,
resource synchronization, diagnostics and toolkit recovery changes.

Cover multiple bounded relative moves, recomputed publication facts,
caller-relative toolkit paths and diagnostic output destinations.
@0b101010-lab
0b101010-lab marked this pull request as ready for review November 28, 2026 07:04
@pragyaangaur

Copy link
Copy Markdown
Owner

Thank you for the work and for the honest account of where it stands. I am closing this one because it is a single change of 14,000 lines in 69 files (mesh layout, SCC proofs, descriptor batching, ambient light, README, toolkit setup and more), and I cannot review, test or revert any one part of it on its own. Several parts also overlap PRs that merged today (#593, #605, #591, #589, #667), so a rebase would need real decisions. Please send it as separate small pull requests, one change each, with what it fixes, a test, and an opt-in switch where it changes behaviour. Start with the part you think matters most for the 2 FPS picture. The README screenshot cannot be committed either: the asset policy keeps pictures out of the tree (they go in a comment on #50).

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