Skip to content

Playability, shader coverage, D3D12 views/barriers, and multi-placeholder xmem - #3

Open
sahajiscoding wants to merge 7 commits into
mainfrom
arena/83a2874f-victory
Open

sahajiscoding wants to merge 7 commits into
mainfrom
arena/83a2874f-victory

Conversation

@sahajiscoding

@sahajiscoding sahajiscoding commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

User description

Summary

1. Adaptive PSO compilation & non-blocking pipeline cache (crates/victory-gpu/src/pipeline/{make.rs,library.rs})

  • Replaced fixed 50 ms frame stall with adaptive budget scheduling (200 ms startup, 40 ms busy, 12 ms steady-state, 4 ms frame-drop budget) and a priority work queue (VecDeque) promoting newly needed pipelines ahead of backlog.
  • Scaled background PSO worker pool to (n * 3 / 4).clamp(2, 12) with inline fallback if workers fail to spawn.
  • Moved pipeline cache serialization to a dedicated THREAD_PRIORITY_LOWEST saver thread (schedule_save) with burst deferral (20 s / 60 s under heavy queue depth), SAVE_LOCK serialization, raised EARLY_MAX to 16 384, and unique temp paths for atomic rename safety.

2. Read-only depth + SRV barrier preservation (crates/victory-gpu/src/draw.rs)

  • Tracked active DSV read-only flags (depth_flags), stencil presence (depth_has_stencil), and simultaneous depth sampling (depth_sampled) so read-only depth+SRV passes stay in DEPTH_READ | SHADER_RESOURCE (0xE0) instead of thrashing barriers.

3. Full sRGB/linear typeless view promotion & exact null RTV/DSV descriptors (crates/victory-gpu/src/{resource.rs,descriptor.rs,descriptor/host.rs,host.rs,capture.rs})

  • Expanded typeless dual-view promotion across all 7 sRGB/linear format pairs (R8G8B8A8, B8G8R8A8, B8G8R8X8, BC1, BC2, BC3, BC7), added explicit dimension/MSAA/array RTV and DSV descriptors, added Format == 0 -> view_format fallback across RTV/DSV/SRV/UAV, and enabled B8G8R8X8* present/swap and diagnostics capture.

4. Shader compiler coverage & safety (crates/victory-shader/src/emit/lower.rs)

  • Comparison gather4 & implicit-level gather4: Lowered image_gather4_c, image_gather4_c_o, image_gather4_c_lz, image_gather4_c_lz_o, image_gather4_c_l, image_gather4_c_l_o to DXIL dx.op.textureGatherCmp.f32 (opcode 74) with comparison sampler and programmable signed 6-bit offsets, and enabled image_gather4 / image_gather4_o via dx.op.textureGather.f32 (opcode 73), unlocking PCF shadow maps and SSAO/bilateral passes.
  • Cube & MSAA textures: Supported non-sample Cube operations (Texture2DArray (7, 3)), MSAA image_load / image_get_resinfo (Texture2DMS / Texture2DMSArray), Cube & MSAA T# descriptor size queries in descriptor_word, and explicit mip UAV writes (image_store_mip).
  • LDS safety: Clamped LDS dword indices against lds_dwords (pred::IULT) to prevent out-of-bounds group-shared memory GPU faults.

5. Multi-placeholder physical page mapping (crates/victory-hle/src/modules/xmem.rs)

  • Updated xmem::map() to coalesce split adjacent placeholders via MEM_COALESCE_PLACEHOLDERS and walk remaining placeholder boundaries via VirtualQueryEx chunking (with partial rollback on failure), enabling seamless remapping across fractured placeholder ranges.

Validation

  • Windows CI run 45456538760 passed cleanly:
    • Clippy (-D warnings)
    • Clippy, diagnostics build (-D warnings)
    • Tests (including real dxil.dll DXIL validation for gather4/gather4_c/MSAA/Cube/LDS/image_store_mip, D3D12 WARP tests, and real Windows multi-placeholder xmem tests)

CodeAnt-AI Description

Bring missing world effects back and expand console shader compatibility

What Changed

  • Adds shader support for ray-tracing queries, meshlet culling, shadow gathers, cube and multisample queries, and additional console instructions, restoring effects and rendering paths that previously failed.
  • Corrects texture sampling, interpolation, 16-bit math, shared-memory operations, and mesh output handling to preserve scene details.
  • Runs more 64-lane workloads on 32-lane GPUs and adjusts synchronization so split waves can share data safely.
  • Reduces frame pauses during pipeline compilation and supports additional title-memory and multi-placeholder access patterns.

Impact

✅ Fewer missing world, shadow, and meshlet effects
✅ Fewer frame stalls during pipeline compilation
✅ More 64-lane shaders run on 32-lane GPUs

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

…-only depth rendering

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
@codeant-ai

codeant-ai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt Review Status

✅  Review completed

Status Commit Started (UTC) Finished (UTC)
✅  #1f141 Incremental review completed 3c65009 Nov 25, 2026 · 09:17 09:31
✅  #5bbd9 Reviewed your PR 40431a6 Nov 24, 2026 · 17:57 18:10

@codeant-ai

codeant-ai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7fe965db-0c8a-47f2-9801-8246900ce6e6
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@codeant-ai codeant-ai Bot added the size:XL This PR changes 500-999 lines, ignoring generated files label Nov 24, 2026
sahajiscoding and others added 2 commits November 24, 2026 18:00
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…laceholder xmem mapping

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Comment thread crates/victory-gpu/src/draw.rs Resolved
Comment thread crates/victory-gpu/src/host.rs Resolved
Comment thread crates/victory-gpu/src/host.rs Outdated
Some(match format.0 {
27..=32 => DXGI_FORMAT_R8G8B8A8_UNORM,
87 | 90 | 91 => DXGI_FORMAT_B8G8R8A8_UNORM,
87 | 88 | 90..=93 => DXGI_FORMAT_B8G8R8A8_UNORM,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: For same-sized B8G8R8X8 planes, presentation skips the blitter and copies into a B8G8R8A8 swap buffer; these formats are incompatible for CopyResource.

Assessment: 🟠 Major · 🔁 Occurrence: Sometimes · 🏷️ Api mismatch

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** crates/victory-gpu/src/host.rs
**Line:** 2460:2460
**Comment:**
	*Api Mismatch: For same-sized B8G8R8X8 planes, presentation skips the blitter and copies into a B8G8R8A8 swap buffer; these formats are incompatible for `CopyResource`.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
@sahajiscoding sahajiscoding changed the title Playability & world rendering: adaptive PSO scheduling, LDS bounds safety, read-only depth SRV, dual sRGB views, cube/MSAA/mip shader ops Playability, shader coverage, D3D12 views/barriers, and multi-placeholder xmem Nov 24, 2026
sahajiscoding and others added 2 commits November 24, 2026 18:15
…litter RTV roundtrip

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…tiles/inplace coherency, and console instruction emulation

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
@codeant-ai codeant-ai Bot added size:XXL This PR changes 1000+ lines, ignoring generated files and removed size:XL This PR changes 500-999 lines, ignoring generated files labels Nov 25, 2026
…nd map_unwrap_or lints

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant