Skip to content

borealis: specialize depth-only fragment tests for dynamic draws - #1314

Merged
DjDeveloperr merged 2 commits into
aurora-wipfrom
perf/borealis-dynamic-depth-only-tests
Nov 28, 2026
Merged

DjDeveloperr merged 2 commits into
aurora-wipfrom
perf/borealis-dynamic-depth-only-tests

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 28, 2026 •

Copy link
Copy Markdown

What: Compile one depth-only discard main with its depth/stencil test selector folded. Select it at draw time when single-sample depth state keeps testing in the main and alpha-to-coverage is disabled.
Tested: MacBook Neo J700 at 4adbc945f84d28743cae2f92d4b8948989d782fe, stock 7.3.0-41.fc44.aurora.aarch64. 336 exact CRCs, zero kernel GPU faults or AVCs, and 128 supported Vulkan CTS passes in each build profile. Fedora Mesa CI passed 224 tests per profile with zero failures, timeouts, or warnings in touched files.
Risk: Two-way door · native AGX3 fragment compilation and the shader-binary cache.
Not yet: Hardware rows on other affected GPU generations.

Shadow alpha test, depth 1 GPU µs, base → candidate GPU change Wall µs, base → candidate
Native Vulkan 1867.47 → 1872.00 +0.24% 2178.43 → 2200.00
DXVK 1996.73 → 1919.65 -3.86% 2244.90 → 2156.86
vkd3d-proton 1965.09 → 1874.28 -4.62% 2244.90 → 2156.86

The stock DXVK opaque control showed a 7.74% wall-time increase with matching GPU time. A same-boot, performance-core-pinned ABBA/BAAB repeat measured 235.13 → 234.49 µs at depth 1 and 106.45 → 106.48 µs at depth 4, with 104.04 µs GPU time throughout and 16 exact readbacks.

Details

The dynamic pipeline retains its general shader and one optional single-sample depth-only main. Both share the existing shader linker. Alpha-to-coverage, a different sample count, or a depth state that can use read-only early rejection selects the general shader. The optional fragment main is serialized with the shader binary and requires no main compilation at draw time.

Evidence
  • Base 714529071cb6f063315e85736255ae8469b24a8a, candidate 4adbc945f84d28743cae2f92d4b8948989d782fe. Stock kernel and Mesa system files matched before and after. The Apple memory controller reported four-plane SLC and device-tree status okay. Recorded GPU frequencies came from agx_stats.
  • GPUBench abad457, DXVK 1011dd9, vkd3d-proton 71cae09. The runner used --warmup-ms 140 --run-ms 110 --runs 3 --timed-runs 2 --timestamps on, with --verify on the DirectX executors. The comparison used ABBA/BAAB with four legs per arm.
  • The native direct-draw probe uses the benchmark's 2,048 indexed quads, push constants and shader-generated positions. The original Vulkan executor supplied shadow, deferred and postfx. Other controls used opaque 1080p, one light triangle, DRAM deferred 1080p at 1×, and 1440p postfx at 4×. Shadow used 2048² depth cascades and queue depths 1 and 2. Other controls used depths 1 and 4.
  • dEQP-VK ran identical targeted rasterization sample, alpha coverage, dynamic depth and discard lists in release and asserts-on builds. Each profile had 128 supported passes, 156 unsupported, zero fails and zero warnings.
  • Fedora Clang release and asserts-on profiles used -Dbuildtype=release and -Db_ndebug=if-release or -Db_ndebug=false. Meson ran the Asahi suite with --timeout-multiplier 4, including the fragment-main guard tests.
case depth crc baseline_wall candidate_wall wall_delta baseline_gpu candidate_gpu gpu_delta
d3d11-deferred 1 2cfe9a54 924.37 932.20 +0.85% 719.27 716.48 -0.39%
  [(1, '2cfe9a54', 940.1709, 719.75), (4, '2cfe9a54', 924.3697, 718), (6, '2cfe9a54', 916.6667, 750.792), (7, '2cfe9a54', 924.3697, 718.792)] [(2, '2cfe9a54', 932.2034, 715.458), (3, '2cfe9a54', 924.3697, 717.125), (5, '2cfe9a54', 932.2034, 715.833), (8, '2cfe9a54', 932.2034, 718.125)]
d3d11-deferred 4 2cfe9a54 753.42 753.42 +0.00% 755.69 755.02 -0.09%
  [(1, '2cfe9a54', 753.4247, 755.333), (4, '2cfe9a54', 753.4247, 754.708), (6, '2cfe9a54', 753.4247, 756.4585), (7, '2cfe9a54', 758.6207, 756.042)] [(2, '2cfe9a54', 753.4247, 754.5205), (3, '2cfe9a54', 753.4247, 755.5), (5, '2cfe9a54', 753.4247, 754.542), (8, '2cfe9a54', 753.4247, 755.5415)]
d3d11-draws 1 c5bb0241 2344.67 1848.87 -21.15% 165.41 166.41 +0.60%
  [(1, 'c5bb0241', 2444.4444, 165.604), (4, 'c5bb0241', 1466.6667, 164.834), (6, 'c5bb0241', 2244.898, 166.25), (7, 'c5bb0241', 3142.8571, 165.208)] [(2, 'c5bb0241', 1833.3333, 166.542), (3, 'c5bb0241', 2156.8627, 166.3125), (5, 'c5bb0241', 1864.4068, 166.209), (8, 'c5bb0241', 1718.75, 166.5)]
d3d11-draws 4 c5bb0241 1208.79 1061.51 -12.18% 166.32 166.31 -0.01%
  [(1, 'c5bb0241', 1145.8333, 166.209), (4, 'c5bb0241', 1208.7912, 166.2705), (6, 'c5bb0241', 1294.1176, 166.375), (7, 'c5bb0241', 1208.7912, 166.375)] [(2, 'c5bb0241', 873.0159, 166.333), (3, 'c5bb0241', 1392.4051, 166.291), (5, 'c5bb0241', 1250, 166.25), (8, 'c5bb0241', 873.0159, 166.75)]
d3d11-light 1 ac1eb1e5 157.82 157.26 -0.36% 9.62 9.62 +0.00%
  [(1, 'ac1eb1e5', 158.046, 9.625), (4, 'ac1eb1e5', 161.7647, 9.708), (6, 'ac1eb1e5', 157.5931, 9.625), (7, 'ac1eb1e5', 154.7117, 9.584)] [(2, 'ac1eb1e5', 160.3499, 9.625), (3, 'ac1eb1e5', 157.3677, 9.625), (5, 'ac1eb1e5', 156.9187, 9.625), (8, 'ac1eb1e5', 157.1429, 9.625)]
d3d11-light 4 ac1eb1e5 50.86 50.73 -0.25% 5.38 5.38 +0.00%
  [(1, 'ac1eb1e5', 50.7146, 5.375), (4, 'ac1eb1e5', 51.1152, 5.375), (6, 'ac1eb1e5', 50.8318, 5.375), (7, 'ac1eb1e5', 50.8788, 5.375)] [(2, 'ac1eb1e5', 50.5747, 5.375), (3, 'ac1eb1e5', 50.8318, 5.375), (5, 'ac1eb1e5', 50.6446, 5.333), (8, 'ac1eb1e5', 50.8083, 5.375)]
d3d11-opaque 1 3731911f 267.98 288.71 +7.74% 104.08 104.08 +0.00%
  [(1, '3731911f', 287.9581, 104.083), (4, '3731911f', 251.7162, 104.084), (6, '3731911f', 248.8688, 104.083), (7, '3731911f', 284.2377, 104.083)] [(2, '3731911f', 251.7162, 104.042), (3, '3731911f', 288.7139, 104.083), (5, '3731911f', 288.7139, 104.083), (8, '3731911f', 288.7139, 104.083)]
d3d11-opaque 4 3731911f 106.64 106.59 -0.05% 104.08 104.08 -0.00%
  [(1, '3731911f', 106.6925, 104.084), (4, '3731911f', 106.6925, 104.125), (6, '3731911f', 106.5891, 104.084), (7, '3731911f', 106.5891, 104.083)] [(2, '3731911f', 106.5891, 104.083), (3, '3731911f', 106.5891, 104.083), (5, '3731911f', 106.5891, 104.083), (8, '3731911f', 107.1081, 104.083)]
d3d11-postfx 1 32adc7e8 1760.11 1760.11 +0.00% 1367.06 1369.54 +0.18%
  [(1, '32adc7e8', 1803.2787, 1367.125), (4, '32adc7e8', 1774.1935, 1368.812), (6, '32adc7e8', 1718.75, 1366.25), (7, '32adc7e8', 1746.0317, 1367)] [(2, '32adc7e8', 1774.1935, 1368.5), (3, '32adc7e8', 1746.0317, 1370.667), (5, '32adc7e8', 1803.2787, 1368.416), (8, '32adc7e8', 1692.3077, 1370.583)]
d3d11-postfx 4 32adc7e8 1428.57 1428.57 +0.00% 1382.62 1383.33 +0.05%
  [(1, '32adc7e8', 1428.5714, 1382.5), (4, '32adc7e8', 1428.5714, 1384), (6, '32adc7e8', 1428.5714, 1382.75), (7, '32adc7e8', 1428.5714, 1382.375)] [(2, '32adc7e8', 1428.5714, 1380.083), (3, '32adc7e8', 1428.5714, 1383), (5, '32adc7e8', 1428.5714, 1383.667), (8, '32adc7e8', 1428.5714, 1384.708)]
d3d11-shadow-alpha 1 7be9463a 2244.90 2156.86 -3.92% 1996.73 1919.65 -3.86%
  [(1, '7be9463a', 2244.898, 1999), (4, '7be9463a', 2244.898, 1995.5415), (6, '7be9463a', 2244.898, 1997.9165), (7, '7be9463a', 2244.898, 1986.1665)] [(2, '7be9463a', 2156.8627, 1922.7705), (3, '7be9463a', 2156.8627, 1915.2915), (5, '7be9463a', 2156.8627, 1919), (8, '7be9463a', 2156.8627, 1920.291)]
d3d11-shadow-alpha 2 7be9463a 2075.47 1964.29 -5.36% 2077.21 1960.41 -5.62%
  [(1, '7be9463a', 2075.4717, 2079.75), (4, '7be9463a', 2075.4717, 2078.041), (6, '7be9463a', 2075.4717, 2076.375), (7, '7be9463a', 2075.4717, 2068.167)] [(2, '7be9463a', 1964.2857, 1958.8955), (3, '7be9463a', 1929.8246, 1953.437), (5, '7be9463a', 1964.2857, 1961.917), (8, '7be9463a', 1964.2857, 1965.6875)]
d3d11-shadow-depth 1 c0fb9993 960.72 960.72 +0.00% 725.08 724.92 -0.02%
  [(1, 'c0fb9993', 948.2759, 724.959), (4, 'c0fb9993', 964.9123, 725.167), (6, 'c0fb9993', 956.5217, 725), (7, 'c0fb9993', 964.9123, 725.209)] [(2, 'c0fb9993', 956.5217, 724.875), (3, 'c0fb9993', 956.5217, 725.208), (5, 'c0fb9993', 964.9123, 724.875), (8, 'c0fb9993', 964.9123, 724.958)]
d3d11-shadow-depth 2 c0fb9993 728.48 728.48 +0.00% 724.94 724.94 +0.00%
  [(1, 'c0fb9993', 728.4768, 724.958), (4, 'c0fb9993', 728.4768, 725.333), (6, 'c0fb9993', 728.4768, 724.708), (7, 'c0fb9993', 728.4768, 724.917)] [(2, 'c0fb9993', 728.4768, 725.042), (3, 'c0fb9993', 728.4768, 755.625), (5, 'c0fb9993', 728.4768, 724.834), (8, 'c0fb9993', 728.4768, 724.792)]
d3d12-deferred 1 dd2b14d8 982.14 982.14 +0.00% 716.33 716.14 -0.03%
  [(1, 'dd2b14d8', 982.1429, 715.708), (4, 'dd2b14d8', 982.1429, 716), (6, 'dd2b14d8', 982.1429, 716.917), (7, 'dd2b14d8', 982.1429, 716.666)] [(2, 'dd2b14d8', 982.1429, 715.959), (3, 'dd2b14d8', 973.4513, 716.5), (5, 'dd2b14d8', 982.1429, 715.75), (8, 'dd2b14d8', 982.1429, 716.3125)]
d3d12-deferred 4 dd2b14d8 705.13 705.13 +0.00% 747.18 746.88 -0.04%
  [(1, 'dd2b14d8', 700.6369, 746.792), (4, 'dd2b14d8', 705.1282, 747.041), (6, 'dd2b14d8', 705.1282, 748.333), (7, 'dd2b14d8', 705.1282, 747.3125)] [(2, 'dd2b14d8', 705.1282, 747.5), (3, 'dd2b14d8', 705.1282, 746.521), (5, 'dd2b14d8', 705.1282, 746.708), (8, 'dd2b14d8', 705.1282, 747.042)]
d3d12-draws 1 c5bb0241 632.18 632.18 +0.00% 143.27 143.29 +0.01%
  [(1, 'c5bb0241', 632.1839, 143.584), (4, 'c5bb0241', 632.1839, 143.166), (6, 'c5bb0241', 632.1839, 143.209), (7, 'c5bb0241', 632.1839, 143.3335)] [(2, 'c5bb0241', 632.1839, 143.292), (3, 'c5bb0241', 632.1839, 143.292), (5, 'c5bb0241', 635.8382, 143.5205), (8, 'c5bb0241', 632.1839, 143.125)]
d3d12-draws 4 c5bb0241 278.49 279.22 +0.26% 141.48 141.63 +0.10%
  [(1, 'c5bb0241', 279.8982, 141.75), (4, 'c5bb0241', 283.5052, 141.375), (6, 'c5bb0241', 273.6318, 141.167), (7, 'c5bb0241', 277.0781, 141.583)] [(2, 'c5bb0241', 289.4737, 141.708), (3, 'c5bb0241', 282.0513, 141.584), (5, 'c5bb0241', 274.3142, 141.667), (8, 'c5bb0241', 276.3819, 141.291)]
d3d12-light 1 ac1eb1e5 231.58 231.09 -0.21% 5.06 5.08 +0.40%
  [(1, 'ac1eb1e5', 232.0675, 5.083), (4, 'ac1eb1e5', 230.608, 5.042), (6, 'ac1eb1e5', 231.0924, 5.042), (7, 'ac1eb1e5', 232.0675, 5.083)] [(2, 'ac1eb1e5', 231.0924, 5.083), (3, 'ac1eb1e5', 231.0924, 5.083), (5, 'ac1eb1e5', 231.5789, 5.083), (8, 'ac1eb1e5', 230.608, 5.083)]
d3d12-light 4 ac1eb1e5 54.43 54.58 +0.27% 5.08 5.08 -0.01%
  [(1, 'ac1eb1e5', 54.0806, 5.083), (4, 'ac1eb1e5', 54.3478, 5.084), (6, 'ac1eb1e5', 54.5094, 5.084), (7, 'ac1eb1e5', 55.1378, 5.083)] [(2, 'ac1eb1e5', 54.321, 5.083), (3, 'ac1eb1e5', 55.1932, 5.042), (5, 'ac1eb1e5', 54.3478, 5.083), (8, 'ac1eb1e5', 54.8082, 5.083)]
d3d12-opaque 1 3731911f 317.92 316.09 -0.57% 103.71 103.71 +0.00%
  [(1, '3731911f', 317.9191, 103.709), (4, '3731911f', 317.9191, 103.709), (6, '3731911f', 317.9191, 103.709), (7, '3731911f', 317.9191, 103.708)] [(2, '3731911f', 317.0029, 103.709), (3, '3731911f', 318.8406, 103.709), (5, '3731911f', 315.1862, 103.709), (8, '3731911f', 314.2857, 103.709)]
d3d12-opaque 4 3731911f 77.30 77.22 -0.11% 103.71 103.71 +0.00%
  [(1, '3731911f', 76.9769, 103.709), (4, '3731911f', 77.5194, 103.708), (6, '3731911f', 77.6288, 103.709), (7, '3731911f', 77.0848, 103.708)] [(2, '3731911f', 77.5194, 103.708), (3, '3731911f', 76.9231, 103.709), (5, '3731911f', 77.3015, 103.708), (8, '3731911f', 77.1388, 103.709)]
d3d12-postfx 1 4707efa8 1692.31 1692.31 +0.00% 1313.35 1313.07 -0.02%
  [(1, '4707efa8', 1692.3077, 1313.625), (4, '4707efa8', 1692.3077, 1313), (6, '4707efa8', 1692.3077, 1313.125), (7, '4707efa8', 1692.3077, 1313.583)] [(2, '4707efa8', 1692.3077, 1311.042), (3, '4707efa8', 1718.75, 1313.125), (5, '4707efa8', 1692.3077, 1313.0205), (8, '4707efa8', 1692.3077, 1314.125)]
d3d12-postfx 4 4707efa8 1358.02 1358.02 +0.00% 1334.56 1334.23 -0.02%
  [(1, '4707efa8', 1358.0247, 1334), (4, '4707efa8', 1358.0247, 1334.417), (6, '4707efa8', 1358.0247, 1334.7085), (7, '4707efa8', 1358.0247, 1335.75)] [(2, '4707efa8', 1358.0247, 1329.875), (3, '4707efa8', 1358.0247, 1334.167), (5, '4707efa8', 1358.0247, 1334.292), (8, '4707efa8', 1358.0247, 1336.5)]
d3d12-shadow-alpha 1 7be9463a 2244.90 2156.86 -3.92% 1965.09 1874.28 -4.62%
  [(1, '7be9463a', 2244.898, 1959.417), (4, '7be9463a', 2244.898, 1969.1875), (6, '7be9463a', 2244.898, 1975.5), (7, '7be9463a', 2244.898, 1961)] [(2, '7be9463a', 2156.8627, 1875.25), (3, '7be9463a', 2200, 1871), (5, '7be9463a', 2156.8627, 1890.4375), (8, '7be9463a', 2156.8627, 1873.3125)]
d3d12-shadow-alpha 2 7be9463a 2000.00 1896.55 -5.17% 2029.69 1910.25 -5.88%
  [(1, '7be9463a', 2000, 2025.9795), (4, '7be9463a', 2000, 2032.833), (6, '7be9463a', 2037.037, 2038.625), (7, '7be9463a', 2000, 2026.5415)] [(2, '7be9463a', 1896.5517, 1908.917), (3, '7be9463a', 1896.5517, 1906.334), (5, '7be9463a', 1929.8246, 1926.708), (8, '7be9463a', 1896.5517, 1911.584)]
d3d12-shadow-depth 1 c0fb9993 995.50 995.50 +0.00% 725.42 725.40 -0.00%
  [(1, 'c0fb9993', 990.991, 725.417), (4, 'c0fb9993', 1000, 725.416), (6, 'c0fb9993', 1000, 725.666), (7, 'c0fb9993', 990.991, 725.417)] [(2, 'c0fb9993', 990.991, 725.417), (3, 'c0fb9993', 1000, 725.417), (5, 'c0fb9993', 990.991, 725.375), (8, 'c0fb9993', 1000, 725.125)]
d3d12-shadow-depth 2 c0fb9993 696.20 696.20 +0.00% 725.52 725.54 +0.00%
  [(1, 'c0fb9993', 696.2025, 725.583), (4, 'c0fb9993', 696.2025, 725.459), (6, 'c0fb9993', 696.2025, 725.458), (7, 'c0fb9993', 696.2025, 725.625)] [(2, 'c0fb9993', 696.2025, 725.542), (3, 'c0fb9993', 696.2025, 725.5625), (5, 'c0fb9993', 696.2025, 725.5), (8, 'c0fb9993', 696.2025, 725.542)]
vk-deferred 1 2cfe9a54 814.81 814.81 +0.00% 656.58 656.65 +0.01%
  [(1, '2cfe9a54', 808.8235, 656.458), (4, '2cfe9a54', 814.8148, 656.625), (6, '2cfe9a54', 814.8148, 656.542), (7, '2cfe9a54', 814.8148, 656.75)] [(2, '2cfe9a54', 814.8148, 656.584), (3, '2cfe9a54', 814.8148, 656.583), (5, '2cfe9a54', 814.8148, 656.708), (8, '2cfe9a54', 814.8148, 656.875)]
vk-deferred 4 2cfe9a54 625.00 625.00 +0.00% 782.00 782.94 +0.12%
  [(1, '2cfe9a54', 621.4689, 780.542), (4, '2cfe9a54', 625, 781.583), (6, '2cfe9a54', 625, 782.4375), (7, '2cfe9a54', 625, 782.417)] [(2, '2cfe9a54', 625, 782.959), (3, '2cfe9a54', 625, 783.042), (5, '2cfe9a54', 625, 782.5625), (8, '2cfe9a54', 625, 782.917)]
vk-draws 1 c5bb0241 310.73 309.86 -0.28% 93.46 93.46 +0.00%
  [(1, 'c5bb0241', 310.7345, 93.417), (4, 'c5bb0241', 310.7345, 93.458), (6, 'c5bb0241', 312.5, 93.458), (7, 'c5bb0241', 306.4067, 93.458)] [(2, 'c5bb0241', 309.8592, 93.458), (3, 'c5bb0241', 309.8592, 93.458), (5, 'c5bb0241', 308.9888, 93.458), (8, 'c5bb0241', 309.8592, 93.458)]
vk-draws 4 c5bb0241 90.05 88.60 -1.61% 92.23 91.17 -1.15%
  [(1, 'c5bb0241', 90.312, 92), (4, 'c5bb0241', 89.7959, 92), (6, 'c5bb0241', 89.7227, 92.875), (7, 'c5bb0241', 91.5141, 92.458)] [(2, 'c5bb0241', 88.141, 91.083), (3, 'c5bb0241', 90.312, 91.875), (5, 'c5bb0241', 89.0688, 91.125), (8, 'c5bb0241', 87.4404, 91.209)]
vk-light 1 ac1eb1e5 128.13 127.17 -0.75% 9.02 9.00 -0.23%
  [(1, 'ac1eb1e5', 128.0559, 9.042), (4, 'ac1eb1e5', 128.2051, 9), (6, 'ac1eb1e5', 128.9566, 9.166), (7, 'ac1eb1e5', 127.7584, 9)] [(2, 'ac1eb1e5', 127.3148, 9.125), (3, 'ac1eb1e5', 126.7281, 9), (5, 'ac1eb1e5', 127.7584, 9), (8, 'ac1eb1e5', 127.0208, 9)]
vk-light 4 ac1eb1e5 33.97 33.74 -0.66% 7.17 7.23 +0.88%
  [(1, 'ac1eb1e5', 33.9716, 7.166), (4, 'ac1eb1e5', 33.9611, 7.166), (6, 'ac1eb1e5', 33.9821, 7.125), (7, 'ac1eb1e5', 33.7113, 7.167)] [(2, 'ac1eb1e5', 33.7423, 7.208), (3, 'ac1eb1e5', 33.7423, 7.25), (5, 'ac1eb1e5', 33.867, 7.166), (8, 'ac1eb1e5', 33.701, 7.25)]
vk-opaque 1 3731911f 229.41 229.89 +0.21% 103.33 103.33 +0.00%
  [(1, '3731911f', 229.1667, 103.333), (4, '3731911f', 228.2158, 103.333), (6, '3731911f', 229.6451, 103.333), (7, '3731911f', 231.0924, 103.333)] [(2, '3731911f', 230.1255, 103.333), (3, '3731911f', 229.6451, 103.333), (5, '3731911f', 231.5789, 103.333), (8, '3731911f', 229.6451, 103.333)]
vk-opaque 4 3731911f 74.00 73.92 -0.10% 73.25 73.25 +0.00%
  [(1, '3731911f', 73.776, 73.25), (4, '3731911f', 74.0242, 73.25), (6, '3731911f', 74.174, 73.25), (7, '3731911f', 73.9744, 73.25)] [(2, '3731911f', 73.7265, 73.25), (3, '3731911f', 73.9247, 73.25), (5, '3731911f', 73.9247, 73.25), (8, '3731911f', 73.9247, 73.25)]
vk-postfx 1 4707efa8 1047.62 1047.62 +0.00% 851.33 851.41 +0.01%
  [(1, '4707efa8', 1047.619, 851.625), (4, '4707efa8', 1057.6923, 853.25), (6, '4707efa8', 1047.619, 851.042), (7, '4707efa8', 1047.619, 849.916)] [(2, '4707efa8', 1047.619, 850.583), (3, '4707efa8', 1047.619, 850.917), (5, '4707efa8', 1047.619, 851.8955), (8, '4707efa8', 1047.619, 853.5)]
vk-postfx 4 4707efa8 862.76 869.58 +0.79% 1022.54 1021.96 -0.06%
  [(1, '4707efa8', 866.1417, 1019.208), (4, '4707efa8', 859.375, 1022.875), (6, '4707efa8', 873.0159, 1024.3125), (7, '4707efa8', 859.375, 1022.208)] [(2, '4707efa8', 880, 1020.667), (3, '4707efa8', 866.1417, 1021.958), (5, '4707efa8', 866.1417, 1021.958), (8, '4707efa8', 873.0159, 1023.875)]
vk-shadow-alpha 1 7be9463a 2178.43 2200.00 +0.99% 1867.47 1872.00 +0.24%
  [(1, '7be9463a', 2156.8627, 1816.729), (4, '7be9463a', 2156.8627, 1857.5625), (6, '7be9463a', 2200, 1877.375), (7, '7be9463a', 2200, 1879.291)] [(2, '7be9463a', 2156.8627, 1839.667), (3, '7be9463a', 2200, 1867.5415), (5, '7be9463a', 2200, 1876.458), (8, '7be9463a', 2200, 1878.417)]
vk-shadow-alpha 2 7be9463a 1880.48 1864.41 -0.85% 2032.71 2038.29 +0.27%
  [(1, '7be9463a', 1833.3333, 2004.792), (4, '7be9463a', 1864.4068, 2028.875), (6, '7be9463a', 1896.5517, 2036.542), (7, '7be9463a', 1896.5517, 2050.667)] [(2, '7be9463a', 1864.4068, 2029.208), (3, '7be9463a', 1896.5517, 2052.125), (5, '7be9463a', 1864.4068, 2040.167), (8, '7be9463a', 1864.4068, 2036.417)]
vk-shadow-depth 1 c0fb9993 916.67 916.67 +0.00% 757.78 757.76 -0.00%
  [(1, 'c0fb9993', 916.6667, 757.292), (4, 'c0fb9993', 916.6667, 757.792), (6, 'c0fb9993', 916.6667, 757.813), (7, 'c0fb9993', 916.6667, 757.7705)] [(2, 'c0fb9993', 916.6667, 757.875), (3, 'c0fb9993', 916.6667, 758.125), (5, 'c0fb9993', 916.6667, 757.646), (8, 'c0fb9993', 916.6667, 757.646)]
vk-shadow-depth 2 c0fb9993 728.48 728.48 +0.00% 881.94 881.38 -0.06%
  [(1, 'c0fb9993', 728.4768, 881.8755), (4, 'c0fb9993', 728.4768, 882.167), (6, 'c0fb9993', 728.4768, 881), (7, 'c0fb9993', 728.4768, 882)] [(2, 'c0fb9993', 728.4768, 879.9165), (3, 'c0fb9993', 728.4768, 881.584), (5, 'c0fb9993', 728.4768, 881.292), (8, 'c0fb9993', 728.4768, 881.458)]
clock d3d11-deferred candidate {1338000000: 56, 1470000000: 31}
clock d3d11-deferred overlay {1338000000: 54, 1470000000: 34}
clock d3d11-light candidate {1470000000: 62}
clock d3d11-light overlay {1470000000: 63}
clock d3d11-opaque candidate {1470000000: 83}
clock d3d11-opaque overlay {1470000000: 73}
clock d3d11-postfx candidate {1338000000: 100, 1470000000: 185}
clock d3d11-postfx overlay {1338000000: 98, 1470000000: 188}
clock d3d11-shadow-alpha candidate {1338000000: 15, 1470000000: 274}
clock d3d11-shadow-alpha overlay {1470000000: 289}
clock d3d11-shadow-depth candidate {1470000000: 91}
clock d3d11-shadow-depth overlay {1470000000: 88}
clock d3d12-deferred candidate {1338000000: 49, 1470000000: 39}
clock d3d12-deferred overlay {1338000000: 56, 1470000000: 30}
clock d3d12-draws candidate {1470000000: 2}
clock d3d12-light candidate {1470000000: 88}
clock d3d12-light overlay {1470000000: 82}
clock d3d12-opaque candidate {1470000000: 54}
clock d3d12-opaque overlay {1470000000: 40}
clock d3d12-postfx candidate {1338000000: 71, 1470000000: 214}
clock d3d12-postfx overlay {1338000000: 81, 1470000000: 205}
clock d3d12-shadow-alpha candidate {1338000000: 50, 1470000000: 239}
clock d3d12-shadow-alpha overlay {1470000000: 287}
clock d3d12-shadow-depth candidate {1470000000: 90}
clock d3d12-shadow-depth overlay {1470000000: 89}
clock vk-deferred candidate {1338000000: 82, 1470000000: 7}
clock vk-deferred overlay {1338000000: 77, 1470000000: 11}
clock vk-draws candidate {1470000000: 73}
clock vk-draws overlay {1470000000: 46}
clock vk-light candidate {1470000000: 46}
clock vk-light overlay {1470000000: 13}
clock vk-opaque candidate {1470000000: 108}
clock vk-opaque overlay {1470000000: 141}
clock vk-postfx candidate {1338000000: 9, 1470000000: 2}
clock vk-postfx overlay {1338000000: 3, 1470000000: 5}
clock vk-shadow-alpha candidate {1338000000: 8, 1470000000: 270}
clock vk-shadow-alpha overlay {1338000000: 7, 1470000000: 273}
clock vk-shadow-depth candidate {1470000000: 89}
clock vk-shadow-depth overlay {1470000000: 89}
336 exact readbacks across 42 row/depth pairs

Fixed-head validation

  • Tested: MacBook Neo J700 (G17P B1) at cc5feeae3176dfba537d7f205291bca6c76e4159 on 714529071cb6f063315e85736255ae8469b24a8a, stock Fedora kernel 7.3.0-41.fc44.aurora.aarch64. Release and assertions-enabled CTS passed 248 supported cases, with 132 unsupported and zero failures or warnings. Maintenance5 2× and 4× passed cold and after cache replay.
  • Native Vulkan, DXVK and vkd3d-proton at queue depths 1 and 2 matched all 24 readbacks. Alpha-test CRC was 7be9463a and depth-only CRC was c0fb9993. Eight isolated caches replayed in fresh processes with reported workload-level disk-cache hits. The scorer was corrected offline to recognize Mesa’s 64-hex cache identifiers.
  • All four SLC planes remained enabled. Stock boot and driver state matched before and after, with zero GPU faults and zero SELinux denials. Both hardware leases were released.
  • J516s second-generation confirmation passed targeted CTS, matched all eight shadow readbacks, and verified warmed-cache reuse.
  • Fedora Asahi passed 224/224 tests on the fixed-head merge result 466f64389304. The descriptor-size regression passed all seven cases.

Compile one single-sample depth-only discard variant with the test selector folded. Select it from the effective alpha-to-coverage and depth state when the main owns testing. Keep the general variant for draws that can run the read-only depth prolog or enable alpha-to-coverage.

Signed-off-by: DjDeveloperr <hey@djdev.me>
@DjDeveloperr
DjDeveloperr requested review from a team as code owners November 28, 2026 19:23

@aurora-silicon-review aurora-silicon-review 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.

Verdict: MERGE at 4adbc945

Blockers: None (wait for hosted CI checks once triggered; local Fedora Clang release and asserts-on builds passed 224/224 asahi tests per profile).

Checked:

  • Audited hk_fragment_main_tests_for_draw(), hk_populate_fs_key(), hk_compile_nir(), hk_static_tests_variant_matches(), hk_bound_fs(), hk_shader_destroy(), shader-binary serialization/deserialization, and hk_cmd_draw.c draw-time linking and dirty-state tracking.
  • Verified hk_fragment_main_tests_for_draw() is the exact complement of hk_g17p_read_only_early_reject_in()'s draw-time depth conditions (samples == 1 && !alpha_to_coverage && (!depth_test || depth_write || depth_compare_always || depth_bounds)), and hk_static_tests_variant_matches() rules out write_z, write_s, loc_written, and has_input_attachments, so both epilog_discards and read_only_early_reject are guaranteed false whenever static_tests_variant is selected (preserving the no_epilog_discard invariant in hk_cmd_draw.c).
  • Verified draw-time switching: all six inputs to hk_fragment_main_tests_for_draw() are in the fast_link_fs dirty guard in hk_cmd_draw.c, and hk_update_fast_linked() compares gfx->fast_link_fs.shader == shader, so toggling between fs and fs->static_tests_variant relinks and sets linked_fs_dirty / dirty.fragment_shader.
  • Verified shader-binary format and lifetime safety: HK_AGX3_SHADER_BINARY_VERSION (55 -> 56) and HK_CLASSIC_SHADER_BINARY_VERSION (42 -> 43) bumped cleanly (test-hk-execution-allowance.c updated, AGX2 untouched at 40), variants[0] is always eagerly compiled before serialization, serialize/deserialize ordering (variants -> static_tests_variant -> src -> mono) matches on both sides, cache_candidate returns VK_NOT_READY so hk_shader_binary_cache_clone() never aliases static_tests_variant, and hk_shader_destroy() frees it cleanly.
  • Verified exact-head J700 (4adbc945f84d28743cae2f92d4b8948989d782fe) results: DXVK -3.86% and vkd3d-proton -4.62% GPU on shadow alpha test, 336/336 exact CRCs across 42 row/depth pairs, 128/128 supported dEQP-VK CTS passes (release and -Db_ndebug=false), 224/224 asahi suite tests per profile including hk_fragment_main_tests, and P-core-pinned ABBA/BAAB confirming zero DXVK opaque regression.
Evidence
  • src/asahi/vulkan/hk_shader.c: hk_compile_nir() clones NIR before main compilation only for single-sample depth-only discarding fragment shaders with key->fs.dynamic_tests, !force_sample_shading, !zs_self_dep, !early_fragment_tests, !uses_sample_shading, !writes_memory, !outputs_written; compiles the alternate with static_key.fs.static_tests = true and keep_mono = false, and calls hk_shader_destroy(dev, variant, true); free(variant); on compile failure or hk_static_tests_variant_matches() mismatch.
  • src/asahi/vulkan/hk_cmd_buffer.h: hk_bound_fs() checks fs && fs->static_tests_variant && !fs->info.fs.has_input_attachments && hk_fragment_main_tests_for_draw(...); UNUSED on present in hk_pipeline_stat_addr() clears release -Wunused-variable.
  • src/asahi/vulkan/tests/test-hk-fragment-main-tests.c + src/asahi/vulkan/meson.build: covers all eight draw-state combinations of hk_fragment_main_tests_for_draw().

@DjDeveloperr

Copy link
Copy Markdown
Author

Verdict — FINISH, then merge at 4adbc945f84d28743cae2f92d4b8948989d782fe.

Blockers

  1. hk_shader.c:7297 compares encoded descriptor-root sizes. On binary load, zero means the full table, so a full-table alternate passes alongside a trimmed main. The graphics uploader sizes the allocation from the main. Compare hk_shader_root_size() for both shaders and cover zero on either side.
  2. The G15S hardware result is pending.

Checked — Depth/stencil and alpha-to-coverage selection, relinking on state changes, variant ownership and cleanup, and DCO.

Evidence

Fedora passed 224/224 in each profile. J700 matched all 336 readbacks across 42 workload/depth pairs and passed 128 supported CTS cases per profile. The draw guard passed 160 selector combinations.

One missed optimization on M5: fixed 1× pipelines store the count in m5_position_samples. The compile guard at hk_shader.c:7314 reads g17p_samples. Using hk_native_fs_samples() there would include them.

A zero root size in a shader binary requests the full table. Compare effective sizes so an alternate cannot read beyond the prefix allocated for its main, and allow a trimmed alternate when the main gets the full table.

Signed-off-by: DjDeveloperr <hey@djdev.me>
@DjDeveloperr

Copy link
Copy Markdown
Author

J516s MacBook Pro (18 GB, G15S B1) — exact-head hardware confirmation for cc5feeae3176dfba537d7f205291bca6c76e4159 against 714529071cb6f063315e85736255ae8469b24a8a. Both private ICDs used assertions-enabled builds on stock Linux 7.3.0.

  • Targeted CTS passed 111 supported cases with zero failures or warnings. Alpha-to-coverage passed 16, dynamic depth 32, dynamic stencil 3, and discard 60. The exact Maintenance5 2× alpha-to-coverage case passed. The remaining 62 cases were unsupported.
  • All eight native alpha-shadow readbacks matched 7be9463a across the base and candidate at queue depths 1 and 2.
  • The single-sample fixture with dynamic depth-write enable passed both queue depths with a fresh Mesa disk cache and again in a separate process using the warmed cache. The fresh run reported 0 hits and 17 misses. The warmed run reported 13 hits and 4 misses. All four readbacks matched 7be9463a.
  • The warmed fixture returned the general fragment shader at all 48 sampled hk_bound_fs returns. The alternate pointer was absent. The cache load and output checks passed, and the optimized path remains unverified on J516s for this fixture.
  • Stock boot and Mesa files matched before and after. All six SLC planes read 0x2100. Zero GPU faults, recoveries, hangs, quarantines, new kernel errors or failed units.

The earlier 4adbc945f84d28743cae2f92d4b8948989d782fe row is tied to that head with the same base. It independently passed the same 111 supported CTS cases and all eight matched alpha-shadow readbacks. Its separate dynamic-depth probe also matched the CRC and showed no alternate pointer at 48 sampled fragment selections. Stock verified after that row as well.

@aurora-silicon-review aurora-silicon-review 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.

Verdict: MERGE at cc5feea after integration validation.

Checked: the predicate now compares the same effective root sizes used for allocation. An encoded zero becomes the full table on either side. A full alternate cannot fit a trimmed main, and a trimmed alternate can fit a full main. The delta is limited to that predicate. Keep the binary-size regression coverage, hosted checks and G15S hardware result outstanding.

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.

1 participant