Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
d4aec47
list-journal and api-census (opt-in)
ShitizZip Nov 3, 2026
049f87f
madeira-duo: hitch recorder ([hitch], [hitch-ecl], [hitch-sum])
ShitizZip Nov 4, 2026
104c560
madeira-duo: pso-warm-compute-only (warm compute pipelines only)
ShitizZip Nov 4, 2026
3cf7034
madeira-duo: hitch recorder without CPU-time reads; shader cache hit …
ShitizZip Nov 4, 2026
af2edf6
gpu-mix: per-frame render/compute/blit pass counts and attachment loa…
ShitizZip Nov 4, 2026
63a44f9
gpu-work: per-window draws/vertices/dispatches/threadgroups and top r…
ShitizZip Nov 4, 2026
26275eb
pso-async-threads: configurable background pipeline builders (default 2)
ShitizZip Nov 4, 2026
eaa7d10
Name the pso-async, prebuild and submission worker threads (MADEIRA_T…
ShitizZip Nov 4, 2026
62fe919
xess-metalfx: MetalFX temporal upscaling behind a builtin libxess.dll
ShitizZip Nov 4, 2026
e4a493f
[gpu-work]: list up to 12 compute pipelines per window, so small pass…
ShitizZip Nov 5, 2026
3b9fea4
rcas-fill: give PoE2's FSR sharpening pass a strength when the game w…
ShitizZip Nov 5, 2026
a175b18
madeira-d3d12: the device build's uncommitted work (prof12-prof18)
ShitizZip Nov 7, 2026
ae49dd7
ntdll iOS: opt-in CPU-time-weighted sampling profiler ([prof], MADEIR…
ShitizZip Nov 7, 2026
2d587dd
ntdll iOS: opt-in trim of the JIT pool's image copies (MADEIRA_POOL_T…
ShitizZip Nov 7, 2026
5c1f01e
App: panel-hz pins the display link to a fixed rate
ShitizZip Nov 7, 2026
6dadb9f
build: list-journal x64 objects in build-pe.sh, and the journal tests
ShitizZip Nov 7, 2026
bddcb54
build: ARM64EC dxcompiler.dll (DXC 1.8.2407) for MADEIRA_DXC_NATIVE
ShitizZip Nov 7, 2026
6093f99
tools: prof-report.py for the [prof] sampler captures
ShitizZip Nov 7, 2026
b8340df
Pin wine, dxmt and FEX to their duo/integration branches
ShitizZip Nov 7, 2026
9318532
Config catalog regenerated for the Duo keys
ShitizZip Nov 7, 2026
cca7748
App: Blend display mode, halfway between Fill and Stretch
ShitizZip Nov 7, 2026
2269107
d3d12 tex-pfv-minimal: PixelFormatView usage only where a view can ne…
ShitizZip Nov 8, 2026
766bcb5
d3d12 fence-chain-frag: mode-3 render waits at the fragment stage (ml…
ShitizZip Nov 8, 2026
9d8c017
d3d12 root-cbv-fast: root descriptors inside the previous one's buffe…
ShitizZip Nov 8, 2026
b3419e8
d3d12 reset-wait-event: a list Reset waiting for the worker sleeps in…
ShitizZip Nov 8, 2026
7c23c09
d3d12 cs-create-build: compute pipelines built in the background at c…
ShitizZip Nov 8, 2026
c1d8946
d3d12 overlay-shader: shader misses and pso-async queue depth in the …
ShitizZip Nov 9, 2026
71354c2
Overlay: Shader misses field (MISS/s and PSO Q cells)
ShitizZip Nov 9, 2026
c7b19f4
d3d12 pso-origin: count the pipelines Metal compiles by origin (diagn…
ShitizZip Nov 9, 2026
7f67569
vk2: KosmicKrisp caches, archives and stats; Vulkan presents in the f…
ShitizZip Nov 9, 2026
f2412d3
vk2: native DXC with SPIR-V code generation (DXC_SPIRV_CODEGEN, defau…
ShitizZip Nov 9, 2026
bc02dcf
vk2: Fossilize record/replay for KosmicKrisp through the Khronos loader
ShitizZip Nov 9, 2026
5644113
vk2: build the iOS Vulkan loader with USE_GAS=OFF
ShitizZip Nov 9, 2026
e420d45
vk2: Fossilize patch 0002, no external replayer on iOS (sys/prctl.h)
ShitizZip Nov 9, 2026
8f299b2
KosmicKrisp: name unsupported features at vkCreateDevice; opt-in rela…
ShitizZip Nov 9, 2026
146e25d
KosmicKrisp: split large timestamp query pools across counter heaps (…
ShitizZip Nov 9, 2026
02784c8
KosmicKrisp: heapless timestamp pools when Metal refuses counter heap…
ShitizZip Nov 9, 2026
0edf16b
vk3: compile shaders before a game starts, with progress; cache sizes…
ShitizZip Nov 9, 2026
ca8d08e
vk3b: fix the empty replay thread count; Shaders gets its own page
ShitizZip Nov 9, 2026
a07d5b4
vk3c: KosmicKrisp compile-speed levers (patch 0014); replay progress …
ShitizZip Nov 9, 2026
d32dc66
vk3d: KosmicKrisp patch 0015 (giant MSL hashes and dumps; compile QoS…
ShitizZip Nov 10, 2026
ea1da57
vk4: overlay shader figures as session totals; DXMT with the D3D12 co…
ShitizZip Nov 11, 2026
ee134d7
d3d12 pso-create-block: drawn-before pipelines built inside the creat…
ShitizZip Nov 11, 2026
17e0231
d3d12 shader-cache-app-key: a pinned converter keeps the cache across…
ShitizZip Nov 11, 2026
4e23f55
ntdll/wineserver section-view-grow: reserve views past the end of a f…
ShitizZip Nov 11, 2026
5bc0c69
vk5: config catalog lists section-view-grow and shader-cache-app-key
ShitizZip Nov 11, 2026
4cf01a9
ntdll section-view-grow: cap the view at 16 GB (PoE2 asks LMDB for 10…
ShitizZip Nov 14, 2026
7bcd6c6
ntdll section-view-grow: grow only, never shrink the file
ShitizZip Nov 14, 2026
d198f80
build: DXC mem2reg live-in check without the block walk, [dxc-time] t…
ShitizZip Nov 14, 2026
b7a42ce
d3d12 pso-create-block = 2: block only on pipelines already in the ps…
ShitizZip Nov 14, 2026
f3557a7
vk7: dxmt 783f0d0c (archive-only pipeline lookup), config catalog for…
ShitizZip Nov 14, 2026
8265644
windows-runtime: dxcompiler.dll is a custom component, not a Wine module
ShitizZip Nov 14, 2026
76909d4
d3d12: compile time by class, probe hit/miss cost, [pso-rebuilt]
ShitizZip Nov 14, 2026
adb34d8
vk8: dxmt 8c4870a5 (pso-warm yields to the game's compiles, archive s…
ShitizZip Nov 14, 2026
902c2bf
d3d12 DXIL cache: no loose-entry scan when the shader pack is on
ShitizZip Nov 16, 2026
5e24ab0
tests: check-overlay-shader follows the vk4 overlay (session totals, …
ShitizZip Nov 16, 2026
b6e16e7
Pin wine, dxmt and FEX to the Duo PR branches
ShitizZip Nov 16, 2026
d23bb33
tests/host: seven checks follow the Duo changes
ShitizZip Nov 17, 2026
6c833a4
d3d12: cs-create-build 2 / 3, new compute pipelines built at creation
ShitizZip Nov 17, 2026
ee3fb0b
d3d12: sampler-max-aniso caps the anisotropy of the Metal samplers
ShitizZip Nov 17, 2026
6271b67
ntdll-unix: MADEIRA_PROF_THREADS limits the profiler to threads by name
ShitizZip Nov 17, 2026
0acdbc3
audio: MADEIRA_AUDIO_MIX_RATE sets the rate the mix format reports
ShitizZip Nov 17, 2026
c2fc578
app: the display link reads MADEIRA_PROMOTE_KICK once per arming
ShitizZip Nov 17, 2026
94075c5
vk9: dxmt b548b251 (pso-warm hit counting), config catalog for the ne…
ShitizZip Nov 17, 2026
b068b5f
d3d12: list-journal entries in the PE view (jr-pe-entries)
ShitizZip Nov 20, 2026
6ff4141
d3d12: frame timeline, slow-pipeline lines, fence poll runs
ShitizZip Nov 20, 2026
9fa25ba
xp sampler: [wake-census], [xp-thr] thread table, [xp-vm] paging split
ShitizZip Nov 20, 2026
267812c
d3d12: dependency trace (dep-trace)
ShitizZip Nov 21, 2026
7c56472
d3d12: dep-trace takes the frame's command buffers
ShitizZip Nov 21, 2026
121f9d5
d3d12: take tex-pfv-minimal back out
ShitizZip Nov 22, 2026
650cf3c
ntdll iOS: [xp] run= reads ri_runnable_time as nanoseconds
ShitizZip Nov 22, 2026
d9a4a8b
ntdll iOS: [xp-thr] fits the log line; no [wake-census] reader
ShitizZip Nov 22, 2026
8128b29
build: libxess.dll for xess-metalfx
ShitizZip Nov 22, 2026
449f01c
d3d12: frame timeline code after the encoder-batch block
ShitizZip Nov 22, 2026
a1a934e
tests/host: vis-trace and rusage-sdk follow dep-trace and the run= fix
ShitizZip Nov 22, 2026
79e9a18
Pin wine, dxmt and FEX to their PR branches; config catalog
ShitizZip Nov 22, 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
63 changes: 61 additions & 2 deletions app/Madeira/ConfigCatalog.generated.swift

Large diffs are not rendered by default.

24 changes: 21 additions & 3 deletions app/Madeira/FPSOverlay.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,13 @@ final class ProMotionIntent {
// `minimum` must not exceed the panel's own maximum or CoreAnimation
// clamps the whole range away (a 60Hz device asked for min 60 /
// max 120 gets nothing useful).
let lo = Float(min(60, maxHz))
let lo = ProMotionIntent.pinnedHz > 0 ? want : Float(min(60, maxHz)) // madeira-duo panel-hz: a fixed rate
l.preferredFrameRateRange = CAFrameRateRange(minimum: lo, maximum: want, preferred: want)
l.add(to: .main, forMode: .common)
link = l
activeMax = want
displaySyncApplied = false; armedAt = 0; tickStart = 0 // ml2021: per arming
kickWanted = false
fputs("[promote] display link armed preferred=\(Int(want))Hz panel_max=\(ProMotionIntent.panelMaxFPS)Hz\n", stderr)
// ml2020: stderr written before Wine starts is not in the exported log; say it there too
LogStore.shared.log("[promote] display link armed min=\(Int(lo))Hz preferred=\(Int(want))Hz panel_max=\(ProMotionIntent.panelMaxFPS)Hz")
Expand All @@ -96,8 +97,20 @@ final class ProMotionIntent {
}
}

/// madeira-duo (6 Nov 2026): `panel-hz = N` in madeira.cfg pins the panel to N Hz
/// (minimum = preferred = maximum = N) for every FPS limit, overriding the intents
/// below. iPhone ProMotion rates include 120, 80, 60, 48, 40, 30 and 24 (Apple,
/// "Optimizing iPhone and iPad apps to support ProMotion displays"); iOS may still pick
/// another. A 40 FPS limit on a 40 Hz panel wakes the main thread a third as often as
/// at 120 Hz, but a frame that misses 25 ms then waits until 50 ms. Unset or 0: off.
static var pinnedHz: Int {
guard let text = MadeiraConfig.get("panel-hz"), let hz = Int(text), hz > 0 else { return 0 }
return min(hz, panelMaxFPS)
}

/// The intent that belongs to a given pacing mode (0 = none). See the type comment.
static func maxHz(for mode: Int32) -> Int {
if pinnedHz > 0 { return pinnedHz }
let floor = panelFloor ? min(60, panelMaxFPS) : 0 // ml2020: see panelFloor
if mode == 3 { return holdMaximum ? min(60, panelMaxFPS) : floor } // 30 cap
if mode == 1 { return holdMaximum ? panelMaxFPS : floor } // 60 cap
Expand All @@ -107,7 +120,7 @@ final class ProMotionIntent {
/// Arms or releases the link for `mode` and publishes the rates to DXMT.
static func apply(mode: Int32) {
let hz = maxHz(for: mode)
LogStore.shared.log("[promote] pacing mode \(mode): display intent \(hz) Hz (panel max \(panelMaxFPS), hold-maximum \(holdMaximum), floor \(panelFloor))")
LogStore.shared.log("[promote] pacing mode \(mode): display intent \(hz) Hz (panel max \(panelMaxFPS), hold-maximum \(holdMaximum), floor \(panelFloor), panel-hz \(pinnedHz))")
shared.setActive(hz > 0, maxHz: hz)
madeira_set_display_max_fps(Int32(panelMaxFPS), Int32(hz))
}
Expand All @@ -127,6 +140,10 @@ final class ProMotionIntent {
/// drawable waits fall with this on, that is what the display link alone does not do.
private var kickLayer: CALayer?
private var kickOn = false
/// madeira-duo: `kickEnabled` as read once per arming (with display sync, a second after the link starts).
/// Reading it on every tick cost two stat() calls on madeira.cfg plus string building each time:
/// 160 stats a second on the main thread at panel-hz 80, 44% of that thread's samples in a profile.
private var kickWanted = false
static var kickEnabled: Bool { MadeiraConfig.flag("MADEIRA_PROMOTE_KICK", fallback: false) }

/// ml2021: env.MADEIRA_DISPLAY_SYNC applied to the game's layer once the session's
Expand All @@ -138,6 +155,7 @@ final class ProMotionIntent {
private func applyDisplaySync(now: CFTimeInterval) {
guard !displaySyncApplied, now - armedAt >= 1 else { return }
displaySyncApplied = true
kickWanted = ProMotionIntent.kickEnabled
let layer = MetalHostView.shared.metalLayer
let sel = NSSelectorFromString("setDisplaySyncEnabled:")
guard layer.responds(to: sel) else { return }
Expand All @@ -164,7 +182,7 @@ final class ProMotionIntent {
(sender.targetTimestamp - sender.timestamp) * 1000))
tickStart = now; tickCount = 1; tickMaxGap = 0
}
if ProMotionIntent.kickEnabled { kick() }
if kickWanted { kick() }
}

private func kick() {
Expand Down
19 changes: 16 additions & 3 deletions app/Madeira/GuestDisplay.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import UIKit

/// How the guest surface is mapped into the view's bounds.
enum DisplayMode: String, CaseIterable {
case fit, fill, stretch, aspect
case fit, fill, stretch, aspect, blend

/// Older settings stored "fitHeight" (Fill height); it behaved as Fit in
/// landscape and is gone from the picker, so it decodes to Fit.
Expand All @@ -27,6 +27,7 @@ enum DisplayMode: String, CaseIterable {
case "fill": self = .fill
case "stretch": self = .stretch
case "aspect": self = .aspect
case "blend": self = .blend
default: return nil
}
}
Expand All @@ -37,6 +38,7 @@ enum DisplayMode: String, CaseIterable {
case .fill: return "Fill"
case .stretch: return "Stretch"
case .aspect: return "Aspect"
case .blend: return "Blend"
}
}
var symbol: String {
Expand All @@ -45,6 +47,7 @@ enum DisplayMode: String, CaseIterable {
case .fill: return "arrow.up.left.and.arrow.down.right"
case .stretch: return "rectangle.expand.vertical"
case .aspect: return "rectangle.ratio.16.to.9"
case .blend: return "rectangle.compress.vertical"
}
}
}
Expand All @@ -65,14 +68,24 @@ enum GameSurfaceLayout {
/// game whose back buffer is 4:3 on a 16:9 monitor is stretched by the
/// layer in every other mode; here it is scaled uniformly. Falls back to
/// the guest shape until a drawable size is known (`aspect == .zero`).
/// - Blend: halfway between Fill and Stretch. The picture takes the
/// geometric mean of the guest's shape and `bounds`'s and covers
/// `bounds`, so half of the shape difference is cropped and half is
/// stretched (madeira-duo: PoE2 draws 16:10 at the narrowest, the
/// unfolded Duo is ~1.42:1; Stretch squashed it 11%, Fill cropped 5.5%
/// a side, Blend is ~5.5% squash and ~3% a side).
static func rect(guest: CGSize, aspect: CGSize = .zero, bounds: CGRect, mode: DisplayMode) -> CGRect {
guard guest.width > 0, guest.height > 0,
bounds.width > 0, bounds.height > 0 else { return bounds }
if mode == .stretch { return bounds }
let useDrawable = mode == .aspect && aspect.width > 0 && aspect.height > 0
let shape = useDrawable ? aspect : guest
var shape = useDrawable ? aspect : guest
if mode == .blend {
let guestAspect = guest.width / guest.height, boundsAspect = bounds.width / bounds.height
shape = CGSize(width: (guestAspect * boundsAspect).squareRoot(), height: 1)
}
let sx = bounds.width / shape.width, sy = bounds.height / shape.height
let scale = mode == .fill ? max(sx, sy) : min(sx, sy)
let scale = mode == .fill || mode == .blend ? max(sx, sy) : min(sx, sy)
let w = shape.width * scale, h = shape.height * scale
return CGRect(x: bounds.minX + (bounds.width - w) / 2,
y: bounds.minY + (bounds.height - h) / 2,
Expand Down
Loading