Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
9b4d74f
[Agc] Native stubs for sceAgcDcbDrawIndexIndirect and sceAgcDcbDrawIn…
xnetcat Nov 15, 2026
8840cfb
[Metal] Test owned pages a line at a time and read the completed seri…
xnetcat Nov 15, 2026
f9baab9
[Agc] Range stub takes a null source; native sceAgcGetDataPacketPaylo…
xnetcat Nov 15, 2026
6951471
[Agc] Batched sceAgcCreatePrimState and a trivial-leaf dispatch for it
xnetcat Nov 15, 2026
d7e5140
[Kernel] Native scePthreadGetthreadid answered from the fast-path block
xnetcat Nov 15, 2026
75ce584
[Metal] Answer a read-only guest-range binding from the binding befor…
xnetcat Nov 15, 2026
d2c7e4c
[Core] Decide the leaf path's per-call diagnostics once per session
xnetcat Nov 15, 2026
6f59784
[Metal] Test a range longer than a line as itself in an owned page
xnetcat Nov 15, 2026
b664dd3
[Core] Measure the import gateway crossing; PERF_HLE mutex and SetShR…
xnetcat Nov 15, 2026
6d0f470
Merge perf/ds-30fps-host: resolve ownership lines and read-binding memo
xnetcat Nov 15, 2026
557073a
[Metal] Answer a stage's texture memo entries and samplers from the l…
xnetcat Nov 15, 2026
90871ad
[Metal] Keep two read-only binding memo entries per set and count why…
xnetcat Nov 15, 2026
c3305bc
[Metal] Name an encoder's end cause from a table instead of two strin…
xnetcat Nov 15, 2026
cc680a1
[Metal] Count storage-image binds, compute encoders and the residents…
xnetcat Nov 15, 2026
656864d
[Tools] PerfAudit contend: managed guest-memory access cost from 1-12…
xnetcat Nov 15, 2026
f771279
[HLE] HostAccessStripes: in-flight counts on per-thread cache-line st…
xnetcat Nov 15, 2026
99478e0
[HLE] Count alias accesses on the backing's per-thread stripes
xnetcat Nov 15, 2026
91717bb
[HLE] SharedBackingViews: lock-free single-view accesses pin only the…
xnetcat Nov 15, 2026
5221bc4
[HLE] Keep the write-interval ledger dormant until its first observer
xnetcat Nov 15, 2026
2264599
[HLE] Pair write landed: announce lazily covered ranges as a single w…
xnetcat Nov 15, 2026
b6aff34
[Agc] CbSetShRegistersDirect: all runs in one reservation and one write
xnetcat Nov 15, 2026
8eafbcc
Merge perf/ds-30fps-host: stage binding plan, two-way read memo, coun…
xnetcat Nov 15, 2026
cbb304b
[Metal] Count why held label copies land and what barrier each landin…
xnetcat Nov 15, 2026
86235c6
[Tests] Benchmark the GPU cost of what a label landing puts between t…
xnetcat Nov 15, 2026
d8242a8
[Metal] Count meshlet rebuilds by reason, split build time, trace builds
xnetcat Nov 15, 2026
c2d5a2f
[Metal] Keep up to four meshlet versions per index range
xnetcat Nov 15, 2026
5378a1f
[Metal] Land device-ordered held label copies inside the open compute…
xnetcat Nov 15, 2026
a9c1793
[Metal] Pool meshlet buffers so rebuilds leave the resident list alone
xnetcat Nov 15, 2026
28ef607
[GPU] Keep only causal command-processor writes CPU-visible
xnetcat Nov 15, 2026
4ca89a0
[Metal] Record plain command-processor writes as a dispatch in the op…
xnetcat Nov 15, 2026
76d34bc
[Metal] Copy layer subsets of aliased arrays on the device; count ali…
xnetcat Nov 15, 2026
727d8cf
[Tests] Separator bench: an encoder split without the fence, tracked …
xnetcat Nov 15, 2026
a67ad64
Merge perf/ds-meshlet-cache: rebuild reasons, content versions, poole…
xnetcat Nov 15, 2026
12af424
[Metal] Defer array target uploads to their pass, drop the layers a p…
xnetcat Nov 15, 2026
706c65d
[Metal] Count CP write order suspects at the reads answered from unla…
xnetcat Nov 15, 2026
ab095ec
[Tests] Label fold refusals, fold at open, switches off, and causal r…
xnetcat Nov 15, 2026
af924ea
Merge perf/ds-30fps-host: label copies in the open compute encoder, c…
xnetcat Nov 15, 2026
51d72f6
[Metal] Name a new image stale over all of it, not over an empty inte…
xnetcat Nov 15, 2026
df5f4b2
[Metal] Check a subset copy's stale run reloads exactly; forget a pub…
xnetcat Nov 15, 2026
e77c48d
[Metal] Hold several stale and published runs per image; reload a run…
xnetcat Nov 15, 2026
e0387a8
[Metal] Count a stale-run reload widened over texture-only bytes; a d…
xnetcat Nov 15, 2026
f063ae6
Merge perf/ds-alias-churn: layer-subset copies, layered deferral, run…
xnetcat Nov 15, 2026
3feeb7b
[Metal] SHARPEMU_METAL_V2_UPLOAD_TRACE=1: name the images uploaded ag…
xnetcat Nov 15, 2026
899e737
Merge perf/ds-alias-churn: upload trace
xnetcat Nov 15, 2026
d0e3ebf
[Tests] Pin the image run sets: merges, cuts, full sets, writebacks, …
xnetcat Nov 15, 2026
c8f15de
[Tests] Pin the access stripes: double End, same-thread contract, bus…
xnetcat Nov 15, 2026
151638e
[Tests] Pin the meshlet cache at its budget: LRU eviction, pool overf…
xnetcat Nov 15, 2026
e65df31
Merge test/ds30-hardening: run-set, meshlet budget and access-stripe …
xnetcat Nov 15, 2026
d3b2d3f
[Metal] Count uploads that end an open render pass, by cause and by u…
xnetcat Nov 15, 2026
015b6bf
[Metal] Upload prelude: a CPU-caused upload in an open render pass ru…
xnetcat Nov 15, 2026
e4fa880
[Metal] Upload prelude: an upload that encoded nothing is not counted…
xnetcat Nov 15, 2026
f29442c
Merge perf/ds-alias-churn: upload prelude
xnetcat Nov 15, 2026
4ebaf44
[Metal] Read-binding memo: 16384x4 table with move-to-front, refusals…
xnetcat Nov 15, 2026
d481950
[Metal] Read-binding memo v2: entries keyed to their window object, v…
xnetcat Nov 15, 2026
4bb35ec
[Metal] Read-binding memo v2: pending fills, label copies and staged …
xnetcat Nov 15, 2026
f7ef33e
[Metal] Read-binding memo v2: image validity per range (no owner page…
xnetcat Nov 15, 2026
fc160c4
[Metal] Read-binding memo v2: single-copy trap moves re-checked per r…
xnetcat Nov 15, 2026
5abf5c1
[Tests] DS draw-cost bench: GameShaped variation for the read-binding…
xnetcat Nov 15, 2026
6dcd381
[Metal] Read-binding memo: make only the table in use (each is ~7 MiB…
xnetcat Nov 15, 2026
10edea5
[GPU] Resolve thread: a kept fast snapshot revalidates with its own d…
xnetcat Nov 15, 2026
01c8fdc
[GPU] Resolve thread counters: unresolved takes by cause, idle and ga…
xnetcat Nov 15, 2026
f6a7bb1
[GPU] Resolve memo, shadow: key every draw's resolution inputs and co…
xnetcat Nov 15, 2026
b3d768d
[Shader] ResourceMaterializer.Revalidate with explicit inputs; Revali…
xnetcat Nov 15, 2026
0ce695f
[GPU] Resolve memo on: keep many draws' graphics programs by content key
xnetcat Nov 15, 2026
4d6cef4
[GPU] Spin the idle program resolver briefly before it sleeps
xnetcat Nov 15, 2026
bbb6b32
[Metal] Read-binding memo v2: free an entry that can never answer again
xnetcat Nov 15, 2026
4ef42bc
[GPU] Resolve memo: a store whose key was refilled by a nested resolu…
xnetcat Nov 15, 2026
94c6612
Merge perf/ds-memo-v2: read-binding memo checked per range
xnetcat Nov 15, 2026
832befa
Merge perf/ds-resolve-memo: content-keyed graphics resolve memo
xnetcat Nov 15, 2026
5c9e38f
[Metal] Layered deferral: an array target whose stale layers are not …
xnetcat Nov 15, 2026
218f56a
[GPU] Graphics resolve counters (kept, resolved, resolve memo) on the…
xnetcat Nov 15, 2026
94977e2
[Tests] DS draw bench: GameWords variation with descriptor words and …
xnetcat Nov 15, 2026
c65b530
[GPU] Resolve memo: rebuild a words miss from its revalidation instea…
xnetcat Nov 15, 2026
548bb64
[GPU] Resolve memo: eight ways per set instead of two
xnetcat Nov 15, 2026
1a2ab1f
[Shader] Remember a level's read order per program, not per thread an…
xnetcat Nov 15, 2026
4e607f1
[Tests] Cached-draw allocation bound: the specialization a fast origi…
xnetcat Nov 15, 2026
0ba46f1
[Tests] DS draw bench: SHARPEMU_DS_DRAW_BENCH_COPIED_TABLES=1 puts th…
xnetcat Nov 15, 2026
00b07fe
[Metal] Answer the words of an owned line from its pending-write mask…
xnetcat Nov 15, 2026
644aaf0
Merge perf/ds-resolver-reuse: words-miss rebuild, 8-way resolve memo,…
xnetcat Nov 15, 2026
21efc7a
Merge perf/ds-resolver-owner: concurrent line masks and copy line
xnetcat Nov 15, 2026
bfe3bbc
[VideoOut] Overlay: restating an unchanged capture demand does not re…
xnetcat Nov 15, 2026
a6965c3
[Metal] Stamp an image's last use with the collection's clock, not a …
xnetcat Nov 15, 2026
30c717f
[GPU] Keep the targets' version when target registers are written aga…
xnetcat Nov 15, 2026
71f6713
[Tests] DS draw bench: SHARPEMU_DS_DRAW_BENCH_REBIND=n writes the tar…
xnetcat Nov 15, 2026
5c9dc73
[Metal] A read-only compute binding over held labels reads a staged v…
xnetcat Nov 15, 2026
91b6b36
[Tests] Staged label reads: no barrier, earlier stores, later labels,…
xnetcat Nov 15, 2026
7ad48fe
[Shader] Prove a fast snapshot current from its program's recorded reads
xnetcat Nov 15, 2026
c35bd47
[GPU] Compare a read proof's words through the Metal host's ownership…
xnetcat Nov 15, 2026
3254123
Merge perf/ds-label-staged-read: staged views for read-only compute b…
xnetcat Nov 15, 2026
f33438d
Merge perf/ds-resolver-hits: read proofs for cached draws
xnetcat Nov 15, 2026
b6cbf03
Merge perf/ds-worker-draw-cost: target value reuse, image last-use st…
xnetcat Nov 15, 2026
5f66c04
[Metal] Commit the open buffer when the GPU has run dry and it holds …
xnetcat Nov 15, 2026
09cd9c4
[Tests] Cover the commit-when-dry bars and a dry split that resumes t…
xnetcat Nov 15, 2026
7727e7c
[GPU] Count unresolved draw takes by the kind of item that gated thei…
xnetcat Nov 15, 2026
93c8f3f
[GPU] Let draw jobs resolve ahead of the dispatches just before them
xnetcat Nov 15, 2026
20b804a
[Shader] Back read proofs off for origins whose words change on every…
xnetcat Nov 15, 2026
b0be9fb
[Tests] Allow the read-proof back-off counters in a cached draw's all…
xnetcat Nov 15, 2026
cfa1907
Merge perf/ds-commit-when-gpu-idle: commit the open buffer when the G…
xnetcat Nov 15, 2026
e6679a1
Merge perf/ds-gate-lookahead: draws resolve ahead of dispatches, read…
xnetcat Nov 15, 2026
39ccccd
[Metal] Make the dry-GPU commit opt-in and give the overlay's phase c…
xnetcat Nov 15, 2026
425656f
[GPU] Let draw and dispatch jobs resolve ahead of the per-submission …
xnetcat Nov 15, 2026
538ca28
[Shader] Make the materializer's read proofs opt-in
xnetcat Nov 15, 2026
810fed3
[GPU] Name the programs, looked-over items and cache state in the loo…
xnetcat Nov 15, 2026
c900d49
[GPU] Tell a resolve-memo verify race from a mismatch and name the di…
xnetcat Nov 15, 2026
9ad62cc
[GPU] Refuse a prefetched draw resolution made before the program cac…
xnetcat Nov 15, 2026
6c363d0
[GPU] Add a look-ahead census mode that names the reads and owners wh…
xnetcat Nov 15, 2026
bd5c200
[GPU] Refuse a clean word read on the worker while a recorded GPU wri…
xnetcat Nov 15, 2026
fa3b6a0
[GPU] Re-test a resolution's owned answers at the take, since a compl…
xnetcat Nov 15, 2026
9cae280
[GPU] Name the differing word's address and each reader's answer in a…
xnetcat Nov 15, 2026
dc219d2
[GPU] Refuse every take whose reads a GPU write logged since the reso…
xnetcat Nov 15, 2026
3c3df55
[Shader] Turn the materializer's read proofs on by default (SHARPEMU_…
xnetcat Nov 15, 2026
a7418b5
[GPU] Answer a clean word read under a pending GPU write with the val…
xnetcat Nov 15, 2026
7defb18
[GPU] Refuse a dispatch job resolved under another program cache stam…
xnetcat Nov 15, 2026
b99217c
[GPU] Measure a dispatch job's effects from the start of its resoluti…
xnetcat Nov 15, 2026
aed59bb
[GPU] Predict no CPU kernel writes on a host that consumes none
xnetcat Nov 15, 2026
36aa407
[GPU] Put shader header registrations in the program cache stamp a pr…
xnetcat Nov 15, 2026
a7aefce
[Diag] SHARPEMU_GC_PAUSES=2: per-GC [GC-DETAIL] line with reason, sus…
xnetcat Nov 15, 2026
7f77899
[Agc] Make no submit-time copy of a command buffer for a host that re…
xnetcat Nov 15, 2026
1c0e4c9
[Metal] Consume a copy or fill kernel whose destination already holds…
xnetcat Nov 15, 2026
76b6b1a
[GPU] Hand out a memo rebuild without keeping it while the draw's wor…
xnetcat Nov 15, 2026
87c1b6e
[Shader] Let a rebuilt fast snapshot share the buffer words its prede…
xnetcat Nov 15, 2026
a4de7e6
[GPU] Keep a new key's resolution only on its second miss, and share …
xnetcat Nov 15, 2026
6b93870
[GPU] Hold a memo rebuild only when it follows another rebuild of the…
xnetcat Nov 15, 2026
a0846a4
[Agc] Take a copyless submit whose buffer only a read can answer for,…
xnetcat Nov 16, 2026
7afc253
[Diag] Early-label probe: publish chosen command-processor writes onc…
xnetcat Nov 16, 2026
9aad70d
[VideoOut] Flip ahead: publish a recorded flip once the flip before i…
xnetcat Nov 16, 2026
530a8d5
[Metal] Flip ahead: hand the presenter a stream-ordered copy of the f…
xnetcat Nov 16, 2026
fd1fd4a
Revert "[Metal] Flip ahead: hand the presenter a stream-ordered copy …
xnetcat Nov 16, 2026
79e60ed
Revert "[VideoOut] Flip ahead: publish a recorded flip once the flip …
xnetcat Nov 16, 2026
6f5eef6
[Diag] CP reuse history: submissions, slices and landings in one ring…
xnetcat Nov 16, 2026
815e980
[Diag] Follow a refused alias-run reload: refusal reason, reads of th…
xnetcat Nov 16, 2026
0ccb17f
[Diag] Refused alias-run reads: per layer, clean or after a write, by…
xnetcat Nov 16, 2026
ed653ff
[Metal] Reload a GPU-written image stale over all of its bytes, and w…
xnetcat Nov 16, 2026
4482f51
[Metal] Skip the covering-run loop for a whole-stale reload in the lo…
xnetcat Nov 16, 2026
5eb7f9b
[Shader] Opt-in fused legacy multiply-add for compute and non-depth p…
xnetcat Nov 16, 2026
175736e
[Diag] Frame-overlap stage 0: measure what overlapping the next frame…
xnetcat Nov 16, 2026
5cda54b
[Diag] Frame-overlap: retry a fault that raced the disarm, once per page
xnetcat Nov 16, 2026
c6346f2
[Diag] Frame-overlap: optional arming at commit (SHARPEMU_DIAG_FRAME_…
xnetcat Nov 16, 2026
fa336d2
[Diag] Frame-overlap: byte-level attribution of every counted fault
xnetcat Nov 16, 2026
d215a62
[Diag] Frame-overlap: retry every thread that faults on a page the di…
xnetcat Nov 16, 2026
8ba1998
[VideoOut] Flip ahead: publish a recorded flip once the flip before i…
xnetcat Nov 16, 2026
5bbbb7d
[Metal] Flip ahead: hand the presenter a stream-ordered copy of the f…
xnetcat Nov 16, 2026
7969522
[Probe] Unguarded frame-overlap probe: publish a frame's completions …
xnetcat Nov 16, 2026
2102860
[Probe] Frame-overlap probe: SHARPEMU_FRAME_OVERLAP_PROBE_WAITS=count…
xnetcat Nov 16, 2026
8e6a007
[Probe] Frame-overlap probe: no per-label commits, queued values answ…
xnetcat Nov 16, 2026
033de1f
[Probe] Frame-overlap probe: a queued copy copies raw guest memory on…
xnetcat Nov 16, 2026
440b957
[Probe] Frame-overlap probe: land publications per command buffer, bo…
xnetcat Nov 16, 2026
3d7eab1
[Diag] Frame-overlap: in-flight mode, what the guest touches while re…
xnetcat Nov 16, 2026
646c914
[Diag] Frame-overlap in-flight mode: arm at commit on a thread, never…
xnetcat Nov 16, 2026
7a9d09b
[Diag] Frame-overlap in-flight census: the writer op of an early-read…
xnetcat Nov 16, 2026
5fc0b1e
[Diag] Frame-overlap probe: arm on a run of draw-heavy frames (AFTER_…
xnetcat Nov 16, 2026
3fbcdbe
[Diag] Frame-overlap census: search the last writer over the recent s…
xnetcat Nov 16, 2026
d05a6fd
[Metal] Gate-hoist timing probe: buffers after a present on a second …
xnetcat Nov 16, 2026
80d99a4
[Shader] Fuse legacy multiply-add by default, SHARPEMU_MSL_FUSE_MAD=0…
xnetcat Nov 16, 2026
12f6aad
[Docs] Document SHARPEMU_TITLE_SCENE_RESOLUTION with measured frame t…
xnetcat Nov 16, 2026
24a9ef4
[Shader] Widen the half-local EXEC branch proof: exact operand widths…
xnetcat Nov 16, 2026
1d3bba6
[Shader] Half-local branch liveness: an updating scalar destination i…
xnetcat Nov 16, 2026
8fcc4b9
[GPU] Split the prefetch's unresolved draw takes by what bounded the …
xnetcat Nov 16, 2026
13132ba
[GPU] Fill the resolve memo key with the offset in a register
xnetcat Nov 16, 2026
121417d
[Shader] Merge a read proof's address-ordered runs instead of sorting…
xnetcat Nov 16, 2026
ef1ac3d
[GPU] Keep the resolver's per-job allocations and lookups off the hot…
xnetcat Nov 16, 2026
d73d6d5
[GPU] Read a draw's colour target export mapping without copying its …
xnetcat Nov 16, 2026
657c8b9
[GPU] Answer a draw's tessellation test and unwritten-target drop wit…
xnetcat Nov 16, 2026
e9538ad
[Metal] Write upload ranges once, answer a stage's step-report slot f…
xnetcat Nov 16, 2026
a7196c5
[GPU] Resolve a draw's targets in place and leave unwritten resolve/c…
xnetcat Nov 16, 2026
1405b1e
[GPU] Count a draw's export routing once for all its colour targets
xnetcat Nov 16, 2026
bfbaba3
[GPU] Record a queue's known colour targets only when its colour-targ…
xnetcat Nov 16, 2026
243726f
[Metal] Look up an encoder's named residents in a stamped open-addres…
xnetcat Nov 16, 2026
a419f9e
[GPU] Find once whether a program writes a storage image
xnetcat Nov 16, 2026
20a4e7a
[Shader] Read portable buffer words through optional function constants
xnetcat Nov 16, 2026
44b19c1
[Tests] Device tests and bench for buffer-word function constants
xnetcat Nov 16, 2026
7d3fcbd
[Metal] Draw through pipelines specialized for each draw's buffer words
xnetcat Nov 16, 2026
26a0346
[Metal] Keep a refused buffer-word variant from ending the process, a…
xnetcat Nov 16, 2026
49d1daa
[Metal] Dispatch through compute pipelines specialized for each dispa…
xnetcat Nov 16, 2026
dca16b2
[Tests] Compute buffer-word variants through the scene path, and what…
xnetcat Nov 16, 2026
7ade8ea
[Metal] Never write a buffer-word variant pipeline as a module's libr…
xnetcat Nov 16, 2026
72bcd6d
[Metal] Build buffer-word variants from their own archive files, in a…
xnetcat Nov 17, 2026
ac81c83
[Tests] Render buffer-word variants from their files across archive s…
xnetcat Nov 17, 2026
7d614ee
[Tests] Bench program resolution as N independent shards on N threads
xnetcat Nov 17, 2026
91366b9
[GPU] Resolve programs on N sharded resolver threads (SHARPEMU_RESOLV…
xnetcat Nov 17, 2026
86be8b8
[Tests] Bench the real resolver with N shards (SHARPEMU_DS_SHARD_BENC…
xnetcat Nov 17, 2026
42dada6
[GPU] Default to one resolver shard: two gave no frame-time gain in D…
xnetcat Nov 17, 2026
d0cfeb2
[Metal] Time blit, tiler and host compute encoders in the pass profile
xnetcat Nov 17, 2026
82d5e52
[GPU] Diagnostic: drop every draw after a set time to measure the fra…
xnetcat Nov 17, 2026
e18e31a
[GPU] Answer kept and rebound dispatches off the shared resolve lock …
xnetcat Nov 17, 2026
f202b2e
[Tests] Bench the shard resolver with the game's dispatch share and a…
xnetcat Nov 17, 2026
a2b6912
[GPU] Refuse a dispatch job across a logged kernel fill or copy only …
xnetcat Nov 17, 2026
a3f6c20
[GPU] Leave a draw resolved ahead of a logged kernel fill or copy to …
xnetcat Nov 17, 2026
37e588b
[Core] Dump guest memory named by register/deref expressions on a nat…
xnetcat Nov 17, 2026
ff37c7d
[Libc] Do not hand __cxa_guard_acquire's construction to a thread tha…
xnetcat Nov 17, 2026
7a09812
[GPU] Name the host or GPU write that covered a faulting guest range
xnetcat Nov 17, 2026
e047869
[Core] Fault forensics: HLE write ring, backing alias report and find…
xnetcat Nov 17, 2026
59c894d
[Core] Fault forensics: writes by backing, saved buffers, and samples…
xnetcat Nov 17, 2026
0854ca1
[Metal] A managed write waits for a writeback recorded while it reach…
xnetcat Nov 17, 2026
1114a71
[Tests] The busy-drainer test stops entering once it has seen the flag
xnetcat Nov 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion docs/macos/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ them for measurements or to isolate a problem.
| `SHARPEMU_GUEST_BACKING` | chunked | `shm` backs guest memory with one POSIX shared-memory object instead of 2 MiB purgeable memory objects. The default allows memory the guest frees to return to the OS. |
| `SHARPEMU_GUEST_BACKING_SHAREABLE` | unset | `1` makes the guest backing shareable with another process, and keeps a shared table and log of guest views. This is groundwork for the two-process split (`SHARPEMU_GPU_PROCESS=1` sets it too). See [Guest memory for the two-process split](split-shared-memory.md). |
| `SHARPEMU_HLE_FAST_PATH` | on | `0` disables the native stubs for `pthread_self` and `pthread_getspecific`. They are also off while import or pthread tracing is active. |
| `SHARPEMU_TITLE_SCENE_RESOLUTION` | unset | Demon's Souls only (known build). Caps the game's internal scene size below the display: `900p`, `720p`, `540p` (any `<height>p`, 16:9) or `WIDTHxHEIGHT`, at least 640x360. The game renders the scene at that size and upscales it itself; the output, display buffers and UI keep their sizes. Lowers image quality for frame time: on a base M4 at a 1080p display, about 78 ms per frame uncapped, 69 ms at `900p`, 63 ms at `720p`, 55 ms at `540p`. Below `540p` the picture breaks and nothing more is gained. |
| `SHARPEMU_STALL_WATCHDOG_SECONDS` | `20` | Seconds without import progress before the stall watchdog acts. `0` disables it. |
| `SHARPEMU_FLIP_AHEAD` | off | Experimental. `1` tells the game a GPU flip is done once the flip is recorded and the flip before it has really finished on the GPU, instead of when the frame is shown, so the game can build its next frame while the GPU draws this one (at most one flip ahead). Each such frame is copied in the GPU stream into a presenter-owned texture (up to 7 textures the size of the display buffer), so what is shown is unchanged; a flip whose frame cannot be copied keeps the usual timing, and the refusal is logged once. Pacing, interrupts and labels are unchanged. Counters: `[VIDEOOUT][FLIP-AHEAD]` and the `flip_copy*` fields of `[METAL-PRESENT]`. |

## Metal memory

Expand All @@ -50,6 +52,7 @@ them for measurements or to isolate a problem.
| `SHARPEMU_METAL_V2_WINDOW_MB` | `1024` | Largest a window grows to hold one binding. 512 to 4096. |
| `SHARPEMU_METAL_V2_IMAGE_BUDGET_MB` | computed | Fixed byte budget for the detiled image cache, at least 256. By default the budget follows the memory the host has free. |
| `SHARPEMU_METAL_V2_SINGLE_COPY` | on | `0` never releases guest memory that a clean texture's Metal copy duplicates. Requires the chunked guest backing. |
| `SHARPEMU_METAL_V2_WHOLE_STALE_RELOAD` | on | `0` restores the old refusal: a GPU-written image whose every byte an alias has since written keeps its older texels instead of reloading them, and writes them back over the alias's bytes. For A/B comparisons only. |
| `SHARPEMU_METAL_V2_STAGED_CACHE_MB` | `256` | Budget of the staged-range cache. |
| `SHARPEMU_METAL_V2_TRANSIENT_COMMIT_MB` | `256` | Transient staging a command buffer may hold before it is committed early. |
| `SHARPEMU_METAL_V2_RESIDENCY_SET` | off | `1` puts every guest window in an `MTLResidencySet`. |
Expand All @@ -66,6 +69,9 @@ them for measurements or to isolate a problem.
| `SHARPEMU_METAL_V2_BINARY_ARCHIVE_BUDGET_MB` | `8192` | Size bound of the archives on disk. |
| `SHARPEMU_METAL_V2_ASYNC_PIPELINES` | on | `0` builds pipeline states on the GPU worker thread. |
| `SHARPEMU_METAL_V2_ASYNC_LIBRARIES` | on | `0` compiles each shader library on the thread that needs it, not on the compile pool. |
| `SHARPEMU_RESOLVE_SHARDS` | `1` | Threads that resolve draw and dispatch programs ahead of the GPU worker, 1 to 8. With more than one, each has its own queue and its own part of the resolve memo, and a draw always goes to the same one. `1` is the single resolver; `2` measured no frame-time gain in Demon's Souls for more resolver CPU. Logged once at start; per-thread counts and the shared-lock wait are in the `shards=(...)` field of the `[METAL-V2][PERF]` prefetch counters. |
| `SHARPEMU_PREFETCH_EXACT_EFFECTS` | on | A dispatch or draw resolved ahead of a dispatch the host consumed as a kernel fill or copy is no longer refused for that alone: its take refuses it only when the fill's or copy's logged write covers what its resolution read (the same check as across any other dispatch). DCC and constant fills, image clears, metadata clears, image copies and CPU-predicted dispatches still refuse every dispatch and draw resolved ahead of them. The prefetch counters report `dispatch_effects=(...)` by kind and `exact_effects=(mode,refused,taken,draws,draw_refused,draw_taken)`, the jobs the old rule would have refused that the check refused or took. `dispatch` keeps the old rule for draws only; `0` refuses on every effect again. |
| `SHARPEMU_RESOLVE_UNSHARED_COMPUTE` | on | With more than one resolve shard, a dispatch whose kept program still holds, or whose kept program only needs new user data on a fast plan with a permutation already made, is answered on its own thread without the shared lock. `0` sends every dispatch through the shared lock. The `shards=(...)` counters split the shared-lock takes and wait by reason (`shared_by=`, `shared_wait_by=`) and count the dispatches answered without it (`unshared_compute=`) and why a rebinding still took it (`rebind_shared_by=`). |
| `SHARPEMU_METAL_V2_PIPELINE_LIMIT` | `8192` | Pipeline states kept before idle ones are released. `0` is unlimited. |
| `SHARPEMU_METAL_V2_MODULE_LIMIT` | `2048` | The same for shader modules. |
| `SHARPEMU_METAL_V2_SHADER_EVICTION` | on | `0` keeps every pipeline and module. |
Expand Down Expand Up @@ -97,10 +103,14 @@ undoes an optimization to isolate a miscompile:
| `SHARPEMU_MSL_CONSTANTTABLES` | on | Reads uniform tables through the device address space. |
| `SHARPEMU_MSL_LDSSIZE` | on | Declares all 32 KB of threadgroup memory. |
| `SHARPEMU_MSL_MASKBALLOT` | on | Materializes every wave ballot. |
| `SHARPEMU_MSL_HALF_BRANCHES` | on | Tests the whole wave64 (an exchange between its two simdgroups) at every forward `S_CBRANCH_EXECZ` of a one-wave compute group, instead of letting each half skip a body that only touches its own lanes. |
| `SHARPEMU_MSL_SPILLCOPY` | on | Reads spilled scalar registers through the lane exchange. |
| `SHARPEMU_MSL_PERSISTENT_FENCES` | on | Leaves `S_WAITCNT` a no-op in persistent-thread kernels. |
| `SHARPEMU_MSL_PERSISTENT_RECORDS` | on | Accesses multi-dword records of persistent-thread kernels dword by dword. |
| `SHARPEMU_MSL_BYTEBIAS` | off | `1` keeps the per-buffer byte bias. |
| `SHARPEMU_MSL_FUSE_MAD` | on | Emits the guest's legacy multiply-adds (`V_MAD_F32`, `V_MAC_F32`) as one fused operation in compute programs and pixel programs without depth export. Faster (about 5 ms of an 82 ms Demon's Souls frame) but not bit-exact for MAD/MAC: the guest rounds the product first. `0` restores the exact two-op form. |
| `SHARPEMU_METAL_V2_BUFFER_WORD_CONSTANTS` | on | With portable buffers (`SHARPEMU_METAL_V2_PORTABLE_BUFFERS`, on), each buffer stride and format word a program reads at run time is also a Metal function constant. A draw draws through its pipeline as before and, once a background compile has made it, through a variant whose functions have the draw's words folded in (same pixels, faster vertex stage). Up to 16 variants a pipeline; mesh, rectangle-list and tessellation pipelines stay generic. A variant built once is stored in the title's binary archive (each specialized stage's library file, the pipeline in its segment), so later starts load it instead of compiling. The periodic counter line reports `buffer_words=[...]`, with where built variants came from (`from_file`, `from_library`: this process's own library, `from_msl`: the module's MSL compiled again, `msl_compiles`), `pipelines_compiled`, `files_rejected`, `unresident` and the builders' `build_ms` / `wait_ms`. `0` restores the previous MSL exactly. |
| `SHARPEMU_METAL_V2_BUFFER_WORD_COMPUTE` | on | The same variants for compute pipelines: a dispatch runs the generic pipeline until a background compile has made the one with its words folded in (same results). Off whenever `SHARPEMU_METAL_V2_BUFFER_WORD_CONSTANTS=0`. `0` keeps every compute dispatch on its generic pipeline while draws keep their variants, so the two can be measured apart; it does not change the MSL. The periodic counter line reports `buffer_words_compute=[...]` (`generic_off` counts dispatches the switch kept generic). |
| `SHARPEMU_LOD_STATS` | guarded | `always` compiles the LOD statistics counters into every pixel pipeline. |

## Diagnostics
Expand All @@ -112,12 +122,14 @@ undoes an optimization to isolate a miscompile:
| `SHARPEMU_METAL_V2_WAIT_TRACE=1` (or `SHARPEMU_METAL_V2_EOP_TRACE=1`) | Names, on each `[METAL-V2][SLOW-WAIT]` line, the shader whose resources were being prepared. |
| `SHARPEMU_METAL_V2_PROFILE_SHADERS=1` | Gives every draw and dispatch its own command buffer and prints GPU time per shader hash (`[METAL-V2][SHADER-PROF]`). It serializes the GPU, so only ratios are meaningful. |
| `SHARPEMU_METAL_V2_PROFILE_TOP=<n>` | Entries per profile report. Default 8. |
| `SHARPEMU_METAL_V2_PROFILE_PASSES=1` | Per-encoder GPU time (`[METAL-V2][PASS-PROF]`). |
| `SHARPEMU_METAL_V2_PROFILE_PASSES=1` | Per-encoder GPU time (`[METAL-V2][PASS-PROF]`). Blit encoders (`k=blit`), the tiler's compute encoders (`k=tiler-compute`) and the host's other compute encoders (`k=host-compute`) are recorded too, named for the transfer that opened them, so `gap_us` is time no encoder ran; the `sub` line sums GPU time per kind (`kind_us=`). |
| `SHARPEMU_DIAG_SKIP_ALL_DRAWS_AFTER_S=<seconds>` | Diagnostic. From that many seconds after the GPU process translated its first draw, every draw is dropped before it is resolved or recorded; dispatches, labels and flips go on. Shows the frame time a draw path of no cost would leave. The picture is wrong by design; logged once when it starts. |
| `SHARPEMU_PROFILE_RENDER=1` | Per-phase timing of the draw translation path on the GPU worker, reported at each flip. |
| `SHARPEMU_METAL_V2_DUMP_TARGETS=<dir>` | Writes each render pass's color target and each presented frame as PNG. Waits for the GPU after each dump. `1` writes to `metal-targets` under the logs folder. |
| `SHARPEMU_METAL_V2_DUMP_MAX=<n>` | Maximum dumps. Default 240. |
| `SHARPEMU_METAL_V2_DUMP_EVERY=<n>` | Dump one frame's targets every `n` flips. |
| `SHARPEMU_METAL_V2_DUMP_AFTER_SECONDS=<n>`, `SHARPEMU_METAL_V2_DUMP_AFTER_FLIPS=<n>` | Hold dumps back until the game has run that long, or flipped that many times. |
| `SHARPEMU_MSL_HALF_BRANCH_REPORT=1` | Prints, for each forward `S_CBRANCH_EXECZ` of a wave64 compute program, whether each half may take it alone and the first reason it may not (`[MSL][HALF-BRANCH]`). Works with the shader corpus replay. |
| `SHARPEMU_SHADER_MSL_DUMP_DIR=<dir>` | Writes each translated program as `<stage>-<hash>.metal` with a `<stage>-<hash>.gen5` listing of the guest instructions. `1` writes to `msl-dumps` under the logs folder. |
| `SHARPEMU_SHADER_MSL_DUMP_HASH=<hashes>` | Restricts the dump to a comma-separated list of shader hashes. |
| `SHARPEMU_METAL_V2_IGNORE_TESTS=1` | Drops culling, depth and stencil tests from every draw, to tell an empty pass from a rejected one. |
Expand All @@ -127,6 +139,23 @@ undoes an optimization to isolate a miscompile:
| `SHARPEMU_FRAME_TIMES=<path>` | Writes one timestamp line per guest flip. `1` writes `frame-times-<timestamp>.txt` under the logs folder. |
| `SHARPEMU_INPUT_FILE=<path>` | Test automation: the file lists the keys held right now; it is polled every 30 ms and works without window focus. |

### Finding what overwrote guest memory

These cost nothing until the game faults. When it does, the crash report names
the writes that covered the bytes you asked about.

| Variable | Effect |
| --- | --- |
| `SHARPEMU_FAULT_DUMP=<label>=<expr>:<len>,...` | At a guest fault, dumps `len` bytes at each expression. An expression is a register or number with `+`/`-` offsets, and `[x]` reads the pointer at `x` (`e0=[[rbp]-0x360]:0x1000`). A label starting `find` also searches all mapped guest memory for those bytes; one starting `save` writes them (up to 64 MiB) to a file instead. |
| `SHARPEMU_FAULT_SAVE_DIR=<dir>` | Where `save` labels write `fault-<label>-<address>.bin`. |
| `SHARPEMU_FAULT_ALIASES=1` | For each dumped range, prints its backing offset and every other guest view of the same backing. |
| `SHARPEMU_FAULT_FIND_ALL=1` | `find` labels list every hit, not only the first few. |
| `SHARPEMU_FAULT_DUMP_REPEAT_MS=<ms>` | Repeats the dump after that long, to show bytes still changing. |
| `SHARPEMU_GPU_WRITE_RING=1` | The GPU process keeps a ring of its writes to guest memory (image write-backs, fills, copies, shader stores of 16 bytes or more) with time, submission and producer, and prints the ones over each dumped range, by address and by backing. `SHARPEMU_GPU_WRITE_RING_ENTRIES=<n>` sets its size. It also records what a managed write found and waited for (`gpu:store-enter`, `gpu:store-return`, `gpu:store-landed`, each with 16 bytes sampled at +0x20000 of the write). |
| `SHARPEMU_HLE_WRITE_RING=1` | The same ring in the game process for file reads and `memcpy` made by the emulator's libraries, with the file and offset or the copy's source; a copy into a dumped range adds its source to the search. AMPR reads also record the sampled bytes as the fill starts and ends (`hle:ampr-fill-start`, `hle:ampr-fill-end`). `SHARPEMU_HLE_WRITE_RING_MIN=<bytes>` drops smaller writes: recording every small copy changes thread timing enough to hide a race. |
| `SHARPEMU_FAULT_RING_PRODUCER=<text>` | Adds the ranges of recorded writes whose producer contains the text (a file name, for example) to the search. |
| `SHARPEMU_WRITE_RING_TAIL=<n>` | Also prints the last `n` records of each ring. |

The Metal source also reads many narrower switches that exist to bisect a
single optimization (for example `SHARPEMU_METAL_V2_FLUSH_COALESCE`,
`SHARPEMU_METAL_V2_FOLD_CLEARS` and `SHARPEMU_METAL_V2_KERNEL_FILLS`, all on by
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ private static void RecordPerfHleDispatchTime(HleDispatchTiming.Elapsed elapsed)
$"[PERF][HLE] fast_path: self_hits={fastPath.SelfHits} " +
$"getspecific_hits={fastPath.GetspecificHits} blocks={fastPath.Blocks}");
}

foreach (var line in SharpEmu.Libs.Diagnostics.HleCallShapeProfile.FormatLines())
{
System.Console.Error.WriteLine(line);
}
}
}

Expand Down
Loading
Loading