Skip to content

Upstream Contribution Candidates

OpenAI Codex edited this page Nov 1, 2026 · 5 revisions

Fork changes worth contributing upstream

31 candidate areas · 3 open-work entries · Evidence and caveats · Stable/main

Fix / benefit names the observed repair or measured benefit. Named-game fixes apply to the tested path; proposed fixes remain HOLD.

First batch: #2 + #201 + #121 + #138 + #305.

CPU, GPU and frame counters

Before→after. CPU: process usage, 100%=one core. GPU: whole-device usage. FPS: source-reported FPS; host presentation is not independently verified. Guest/s: guest event rate, not FPS. — = unreported, never zero.

Each row is a separate retained campaign. † historical/diagnostic; ‡ mixed or adverse; § different GPUs. Scope and regressions.

PR Fix / benefit Workload CPU core-% GPU device-% Reported FPS Guest/s p99 ms
#335 Optimization
• CPU usage reduction
• PGR2 — frame cadence increase
Deck / PGR2 380.947→
363.672
51.43→
57.67
— 7.388→
9.001
346.647→
221.125
#336 Optimization / risk
• CPU usage reduction
• PGR2 — frame cadence increase
• Seeded-history failure remains
Deck / PGR2 364.131→
276.695
58.34→
59.53
— 9.505→
14.974
199.448→
102.395
#296 Fix + optimization
• FPU state correctness
• FNSTSW work-time reduction
• PGR2 — cadence/tails worse
Deck / PGR2 251.5653→
251.4226
— — 18.1705→
18.0346
77.2801→
78.2095
#191 Small efficiency gain
• PGR2 — CPU usage reduction
Deck / PGR2 252.845→
250.937
— — 17.623→
17.739
79.532→
77.919
#283 Mixed results
• Morrowind — cadence increase
• Morrowind — worse p99
Deck / Morrowind † 222.318→
221.828
70.34→
75.76
— 12.765→
13.045
110.005→
114.591
#187 Mixed experiment
• No repeatable game gain
• PGR2 — worse p99/max
Deck / PGR2 ‡ 324.401→
322.967
— — 18.585→
18.62
—
#187 Mixed experiment
• No repeatable game gain
Windows / Conker ‡ 247.732→
247.661
— — 30→
30
—
#190 Historical efficiency
• Conker — CPU usage reduction
Windows / Conker † 250.915→
241.573
— — 30→
30
—
#190 Mixed results
• Morrowind — near-flat cadence
• Morrowind — worse tails
Deck / Morrowind † — — — 13.192→
13.207
—
#190 Mixed results
• Conker — lower CPU reported
• Conker — slightly lower cadence
Deck / Conker † — — — 8.348→
8.325
—
#275 Mixed results
• Voice processing — less work
• Morrowind — cadence/p99 regression
Deck / Morrowind ‡ 221.962→
219.785
— — 13.01→
12.676
100.145→
116.647
#158 Fix
• PGR2 — menu/atlas visual corruption
Windows / PGR2 † — — — 30.00017→
30.00059
34.28→
35.223
#158 Fix
• PGR2 — menu/atlas visual corruption
Windows / Morrowind † — — — 29.213→
29.135
50.01→
50.03
#76 Fix
• Dual GPU — black screen
Windows / PGR2 shared † — — 29.408→
29.536
— 43.144→
43.917
#76 Fix
• Dual GPU — black screen
Windows / PGR2 cross-GPU § — — 29.536→
25.39
— 43.917→
56.18
#104 Fix
• Vulkan — invalid depth/texture copies
• Device loss — unresolved
Windows / PGR2 † — — 29.412→
29.665
— 43.558→
42.184
#104 Fix
• Vulkan — invalid depth/texture copies
• Device loss — unresolved
Windows / Morrowind † — — 28.312→
28.963
— 50.046→
50.034

#182, earlier head / DSP JIT off: CPU reduction +3.530%; guest-cadence change +1.968%. Absolute counters unreported in the retained summary. Scope.

#200: Auto-four, all six cohorts

Separate 48-run clean-upstream study, Vulkan, ABBA/BAAB; medians of four per-run summaries per arm. Scene equality remains unresolved. Deck Conker p99 worsens 9.30%.

Fix / benefit Workload CPU core-% CPU improvement % GPU device-% Guest/s p99 ms
Efficiency
• CPU usage reduction
Deck / Morrowind 180.33→163.48 +9.35% 70.6→68.7 6.79→7.19 226.03→217
Efficiency / mixed
• CPU usage reduction
• Conker — worse p99
Deck / Conker 217.85→199.26 +8.53% 25.56→26.13 7.86→7.9 158.12→172.83
Efficiency
• CPU usage reduction
Deck / PGR2 293.12→268.97 +8.24% 38.17→34.26 8.32→8.39 210.24→208.08
Efficiency
• CPU usage reduction
Windows / Morrowind 250.49→244.66 +2.33% 38.45→38.84 24.98→25.62 50.41→50.23
Efficiency
• CPU usage reduction
Windows / Conker 254.38→247.21 +2.82% 53.09→53.74 29.17→29.56 50.09→50.04
Efficiency
• CPU usage reduction
Windows / PGR2 292.12→256.65 +12.14% 35.2→35.83 24.17→24.65 52.05→51.87

Correctness contributions

PR Summary Fix / benefit Result / counter Next
#2 Release owned SDL resources Fix
• SDL — leaked GL context/window
64/64 cycles; 0 added windows Port + lifecycle tests
#201 Unlock on worker exit Fix
• Shutdown — voice-worker deadlock
3/3 timeouts → 3/3 joins Production teardown tests
#121 Bound complete ZPASS reports Fix
• ZPASS reports — out-of-bounds writes
16/16 + 2/2; GL/VK PASS Check upstream writer
#132 Fix renderer-switch lock order Fix
• Renderer switching — deadlock
3/3 concurrency cases Lock/lifetime review
#124 + #298 Revalidate texture DMA sources Fix
• Texture DMA remap — stale colors
Stale red → correct green Separate GL/VK ports
#127 + #256 Fix cubemap stride and GL crop Fix
• Cubemaps — wrong face/mip pixels
• Converted mips — buffer overread
1/12 → 12/12; 96/96 repetitions Separate layout/crop patches
#76 Cross-GPU presentation fallback Fix
• Dual GPU — black screen
Black screen → visible output Interop + transfer cost
#10 + #123 Reject oversized packets atomically Fix
• Oversized packets — partial state writes
24 accepted + 12 oversized modes Coordinate upstream #2930
#138 Initialize bump uniforms Fix
• Shader uniforms — uninitialized values
7/7; deterministic bytes Small producer patch
#305 Recheck completion predicates Fix
• Voice workers — spurious-wake abort
Spurious-wake abort → PASS Port wake regressions
#279 Guard missing input provider Fix
• Input tab — controller disconnect crash
SIGSEGV → tab opens Check UI lifetime
#125 Read GPU surfaces before GL vertices Fix
• GL surface→vertex — stale attributes
5/5 + 4/4; guest PASS Coordinate upstream #2984
#119 + #158 Preserve newer guest writes Fix
• PGR2 — menu/atlas visual corruption
15/15; 6/6 short reloads Ownership review; p99 +2.75%
#50 Balance paused snapshot cleanup Fix
• Paused snapshots — ownership/cleanup
Ownership repaired; FPS — Save/failure regressions
#53 Quiesce APU before restore Fix
• Morrowind — snapshot-load DSP assertion
20 s GL/VK smoke PASS Lock/IRQ/lifecycle checks
#104 Fix Vulkan copy usage/alignment Fix
• Vulkan — invalid depth/texture copies
• Device loss — unresolved
4/4; copy VUIDs removed Device loss still unresolved
#264 Implement DOT_ZW depth Fix
• Ghoulies — depth/rendering corruption
17/17 GL + 7/7 VK Hardware/oracle coverage
#271 Decouple timer/control waits Fix
• Def Jam — freeze, tested path
2.406 ms lateness; 2.826 ms BQL wait GL/reset/save-load coverage

Performance contributions

PR Summary Fix / benefit Other counter / improvement Next
#101 Reuse completed host-copy upload Work reduction
• Host copy — duplicate uploads removed
2,991 skips; 45 uploads Requires host-copy path
#283 Direct Linux surface uploads Optimization / mixed
• Surface upload — lower 1x latency
• Morrowind — worse p99
1x: +9.13…14.92%; RGBA8 2x: −12.41% Retain historical p99 cost
#182 Resample mono once Optimization
• CPU usage reduction, earlier head
• PGR2 — frame cadence increase, earlier head
CPU +3.530%; cadence +1.968% Earlier head; lifecycle checks
#200 Auto workers = 4 Efficiency / mixed
• CPU usage reduction
• Deck Conker — worse p99
CPU +2.33…12.14% Resolve scene/tail attribution
#147 Persist driver pipeline cache Optimization
• Pipeline construction — lower time
44.941→4.740 ms; +89.5% One pair; coordinate #2993
#296 Generate FNSTSW AX Fix + optimization
• FPU — checkpoint/FIP correctness
• FNSTSW — lower work time
GL +77.837%; VK +79.144% Game cadence −0.748%; context gaps
#335 Wait for compiler completion Optimization
• CPU usage reduction
• PGR2 — frame cadence increase
Cadence +21.83%; CPU +4.53% Hybrid dependency; control tail +2.40%
#336 Defer optional live compilation Optimization / risk
• CPU usage reduction
• PGR2 — frame cadence increase
• Seeded history — black/stopped output
Cadence +57.53%; CPU +24.01% HOLD port: seeded-history failure

Percentages above use positive = improvement; component timings are not game FPS. GPU utilization has no preferred direction by itself.

Follow-ups

PR Summary Fix / benefit Result / counter Next
#47 Skip saturated LRU free scan Historical optimization
• LRU — wasted scan work removed
4,194,304→0 failed visits Historical; absent from current fork
#11 Preserve failed-prepare retry state Fix
• Vulkan — lost failure/retry state
17/17; isolated cost −0.392% Upstream ownership audit
#191 Read callback format once Small efficiency gain
• PGR2 — CPU usage reduction
9→1 reads; CPU +0.755% GL CPU control −2.475%
#187 Reuse decoded ADPCM blocks Mixed experiment
• No repeatable game gain
• PGR2 — worse p99/max
CPU +0.442% / +0.029% No stable gain; Deck p99/max worse
#190 + #275 Reuse live RAM mappings Efficiency / mixed
• Conker — historical CPU reduction
• Morrowind stack — cadence/tail regression
Deck cadence −2.57%; p99 cost +16.48% Resolve #310

Open work — HOLD

PR Summary Fix / benefit Result / counter Blocker
#362 + #363 Format guards + Vulkan mip crop Proposed fix — HOLD
• R6G5B5 — wrong colors
• Vulkan cubemaps — wrong border/mip pixels
11/11 + 19/19; 12 historical failures repaired Basic conversion already upstream; qualify missing delta
#377 Export JIT state without DMA reads Proposed fix — HOLD
• Pause/save — consumes DSP DMA polls
Regression PASS; 2 pause/resume cycles PCM/lifecycle/runtime qualification
#367 Finish GPU work before eviction retry Proposed fix — HOLD
• Texture-cache pressure — assertion/crash
3/3; historical 1,088-identity crash repaired Current-tree GPU/game qualification

Full review, dependencies, failed checks and contribution requirements. Upstream availability and fork merge status are separate; no row is an approved upstream port.

Clone this wiki locally