D3D12.X: keep the first indirect scaling pipeline per device #3317
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3317"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-29T07:55:26Z.
scale_indirect_pipelinebuilds, once per device, the root signature and compute pipeline that scale two-pass ExecuteIndirect arguments, and caches them. When two threads missed the cache at the same time, both built a pair, and the second insert replaced the first. The first pair's last references were then dropped while command lists recorded with it could still be pending or running: a pipeline released while in use.Now the first pair published wins. A late builder drops its own pair and returns the cached one, so every recording refers to the pair that stays alive.
claudetools-gh found the race and the first-wins fix (#2952 entry 6, https://github.com/xcl-dev/xcl/issues/2952#issuecomment-7214036990) and confirmed it is still in main (https://github.com/xcl-dev/xcl/issues/2952#issuecomment-7246668953).
Related: #2952 (entry 6). The argument-ordering buffer fix that was the second commit here is now its own PR: #3685.
What is in it (
hle/d3d12x/bind.rs)D3D12.X: keep the first indirect scaling pipeline per device(8afcf478, review fixes squashed in):build_scale_indirect_pipelinemakes a pair.cached_scale_indirect_pipelinereturns the cached pair, or builds one and inserts it under the lock withentry().or_insert(first wins).scale_indirect_pipelinegives its callers the same pair as before; it is no longerunsafe.gpu_scale_indirect_pipeline_keeps_first_pair(two callers that both missed, throughscale_indirect_pipeline_inon the real cache: the first to publish wins, and the entry keeps that pair and the caller's device; no thread scheduling involved) anda_failed_scale_indirect_build_takes_the_published_pair(no GPU).Tested
8afcf478, onmain1c8b5514(the PR split at Foniass's request; this commit is identical to before,git range-diff), NVIDIA GeForce RTX 3090 24 GB, driver 621.24, Intel i7-10700T, Windows 11 build 26300.9974, Rust 1.99.1, debug:cargo test --workspace --no-fail-fast -- --test-threads=4: 2903 passed, 5 failed, 51 ignored. The 5 fail onmain1c8b5514too (the 4title_texturestests and e2etest_title_runs_and_game_folder_is_untouched); SKIPPED: 28, as onmain.-- gpu_scale_indirect_pipeline_keeps_first_pair --nocapture --test-threads=1: 1 passed (the GPU test ran, no SKIPPED);-- a_failed_scale_indirect_build_takes_the_published_pair: 1 passed.730b5b9b(on7db2f391), NVIDIA GeForce RTX 3090 24 GB, driver 621.24, Intel i7-10700T, Windows 11 build 26300.9974, Rust 1.99.1, debug:cargo test -p xcl --lib -- scale_indirect --nocapture --test-threads=1: 2 passed, 0 failed;-- argument_order_buffers: 1 passed, 0 failed.cargo test --workspace --no-fail-fast -- --test-threads=4: 2589 passed, 5 failed, 49 ignored. The same 5 failures asmainon this machine (below); SKIPPED: 30, as below.cargo test -p xcl --lib -- scale_indirect --nocapture --test-threads=1atd848cc4c: 1 passed, 0 failed, 0 ignored, 2484 filtered out (gpu_scale_indirect_pipeline_keeps_first_pair; the GPU test ran, no SKIPPED: DXC dxcompiler 1.9.2602.17).cargo test -p xcl --lib --no-rundebug and release: both build.cargo test --workspace --no-fail-fast -- --test-threads=4at a83846da (the same change before its test got theno DXCskip; the runtime code is identical): 2587 passed, 5 failed, 49 ignored. Main7db2f391on the same machine: 2586 passed, the same 5 failed, 49 ignored. The 5 are main's own:title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels(a subtract overflow) and the 3stream_recheck_*tests it poisons, plus e2etest_title_runs_and_game_folder_is_untouched. SKIPPED: 30 lines, identical on both (21 no wave64, 3 refused f16/f32 per-lane forms, 2 no heap windows, 1 driver cache cannot be disabled, 3 no debug layer). The run leaves out the 3uma_drivercoherent-window remake tests that kill the lib binary on 621.x, on both.54225f58), RTX 5090 32 GB, 621.24, release:-- scale_indirect: 1 passed.Seen in the title (one occurrence, so read it as a likely reproduction, not proof): on an RTX 5090 (621.24), plain
main7db2f391crashed in the NVIDIA driver at the world entry (0xc0000005innvwgf2umx.dll, a read at0xe800,rax=0) at the same millisecond (121.430 s) as five title threads made the first two-passExecuteIndirect(DispatchMesh)calls of the run at once, i.e. the first uses of this per-device scaling pipeline; the crashing thread was one of them, between its argument scratch and its first call. This head, run the same way from the same cache, reached 2,252 frames over 200 s with no crash (an earlier pair with preparation off, separate from the Regression run below). Setup of both: 16 view windows, mixed UMA,XCL_PREPARE=0,XCL_HUGE_PSO_CONCURRENCY=3. Earlier, on annvidia-dev-based tree (d1be8103, same card), two runs crashed the same way in the NVIDIA user-mode driver during two-passExecuteIndirectat about 102 s, and the tree with this fix did not crash there (https://github.com/xcl-dev/xcl/issues/2952#issuecomment-7228069924; those fixed runs stalled later for another reason).Once more, independently (2026-12-02, RTX 5090, 621.24): a diagnostic tree of ours based on
main1c8b5514WITHOUT this change crashed the same way, 80 s in and before the world: five threads made the run's first two-passExecuteIndirect(DispatchMesh)calls within a millisecond while a sixth was building the scaling compute pipeline (a 4500-byte compute shader logged one millisecond earlier), and that thread faulted innvwgf2umx.dll+0x7c89af(a read at 0x4a8). The same tree had run clean before and after; it is one more occurrence, not a reproduction on demand.Regression run
RTX 5090 32 GB, driver 621.24, Ryzen 7 9800X3D, the retail title,
scripts/smoke.ps1, 600 s each, JIT (XCL_PREPARE=0), both from a copy of the same cache. This machine's usual settings (XCL_UMA_WINDOWS=16, mixed UMA,XCL_DIRECT_DXIL=1,XCL_HEAP_WINDOWS=1). The crash this PR fixes did not occur in this pair'smainrun; it is timing-dependent (see Seen in the title above).main
1c8b5514:this head
8afcf478:Not tested
mainmatches it (above, one occurrence); the test drives the interleaving directly.AI use
🤖 Generated with Claude Code
https://claude.ai/code/session_013oPUFCA9W9F8Qb5MPK33bR
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:48:54Z.
Triage (#1607) – head
d848cc4No open or merged PR fixes this race (#2952 entry 6); main's
scale_indirect_pipelinestill inserts last-wins.cached_scale_indirect_pipelinenow inserts withentry().or_insert, so a late builder returns the first pair and the pair recorded lists use is not released. The test builds the race without relying on thread scheduling. No problems found in the diff.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:51:32Z.
merge-check
base:
493dbd3dd0head:
d848cc4c66merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2901 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: read the whole diff (+62/-7). The bug is a use-after-free, not only a pipeline released while pending. On main, two threads that miss the cache both build a pair, and the second
insertreplaces the first (bind.rs~3176 on main). The first thread keeps only raw pointers (prepare_scaled_argstreats the pair as "the device's for good"), andmake_scaled_args_bufferthen runsSetPipelineStateon the freed object. That fits the reported crash innvwgf2umx.dll. The fix is right: the build runs outside the lock,entry().or_insert(pair)under it keeps the first pair stored, and the loser's pair never leaves the function. Findings (minor): (1) the test exercises the new helper, and would fail ifor_insertbecameinsert, but nothing checks thatscale_indirect_pipelinegoes through it; thelast_winsblock only checks a local map. (2) Two threads can still both compile once; that only costs time. Fine: the hit path costs the same as before, a miss adds one lock and one clone, and droppingunsafeis sound. The cache is still never evicted, as on main. Any ExecuteIndirect of a two-pass mesh pipeline reaches it. The title makes mesh pipelines in the run below, but the log doesn't show whether one goes through ExecuteIndirect in 60 s. #2092 touches the same function but doesn't fix this.performance: 60 s smoke of a retail title, main
493dbd3dvs this merge (beffe00f): 1670 -> 1673 frames shown (100 %; last presents per 2 s: 60 60 60), peak commit 17083 -> 18047 MB, 0 device removals, 0 crashes. Peak commit is 964 MB (5.6 %) above main in this one run; nothing in this diff allocates per draw, so that looks like run-to-run variation.verdict: safe to merge
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
AI-written and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-01T23:14:42Z.
Code review location:
crates/xcl/src/hle/d3d12x/bind.rs; line 3124If a late caller's own
build()fails, it returns Err even though another thread already published a working pair under the same key, because?returns before the second lock and re-check. Thread A inserts the pair. Thread B missed at the same time and its CreateComputePipelineState fails (e.g. a transient E_OUTOFMEMORY), soprepare_scaled_argsfails and that two-pass ExecuteIndirect is dropped or falls back, although a valid cached pair exists. Re-checking the map on the error path fixes it.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-01T23:14:42Z.
Code review location:
crates/xcl/src/hle/d3d12x/bind.rs; line 3114Not certain about this one (older issue that the PR keeps): the cache key is the raw
ID3D12Devicepointer. If a device is released and a new one is created at the same address,cached_scale_indirect_pipelinereturns the old device's root signature and PSO, andSetPipelineStatebinds a PSO from another device. If the cached children keep the old device alive instead, every device ever created leaks for the life of the process.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-01T23:14:42Z.
Review: COMMENTED
Review of
d848cc4c: 2 finding(s). 2 are inline.These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-01T23:22:06Z.
@bmjask Thanks, both fixed in
e54c6d1f(a commit of its own on top, to squash into the first before merge):cached_scale_indirect_pipelinenow re-checks the map when its own build fails: it returns the pair another caller published meanwhile, and the error only when there is none (a failure is not cached). Testa_failed_scale_indirect_build_takes_the_published_pair(no GPU): the other caller publishes while this one is still building, then this one fails and gets the published pair; alone, it gets its error, and a later build still fills the slot.real.rs, where the device is adopted), so the entry keeps nothing alive that was not kept already. Testgpu_scale_indirect_entry_holds_its_device(a device of its own, so other tests do not move its count): the entry holds the caller's device and adds a reference, and dropping the cache releases everything it took.Both new tests compile; their first run (the 3090 filter run) is queued, and its result goes into the description.
AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T23:27:49Z.
Follow-up review (head
e54c6d1f, sinced848cc4, diff read, not a merge-check; checks red):main): still holds; #3590 is theamd-devport.scale_indirect_pipelineuses the first-wins helper: partly fixed.gpu_scale_indirect_entry_holds_its_devicenow goes throughscale_indirect_pipeline_in, whichscale_indirect_pipelinewraps, but the first-wins test still callscached_scale_indirect_pipelinedirectly and thelast_winsblock (bind.rs~5486) still checks a localHashMap.New:
gpu_scale_indirect_entry_holds_its_devicecan fail under the parallel suite. D3D12 keeps one device per adapter in a process, soD3D12CreateDevice(None, ...)at ~5530 returns the same device the other tests create the same way (e.g.bind.rs~8725,console_heap.rs~1677), not "a device of its own" (~5522). Under--test-threads=4they add and drop references betweenbefore(~5541) and the exactassert_eq!(refs(&dev), before, ...)(~5551), and the test takes no lock.xcl-smokeblocks and Tested are ford848cc4c(the redPR descriptioncheck), the two new tests have no reported run, ande54c6d1fis a fixup to squash.Fine: a late caller whose own build fails now takes the published pair, and a failure is not cached; each entry holds a reference to its device, so its address key cannot be reused. Unlike #3590's test, the first-wins test does not depend on scheduling: the second caller publishes from inside the first caller's build callback, so both always miss the cache.
AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T23:32:46Z.
Follow-up review (head
9eceb137, sincee54c6d1f, diff read, not a merge-check; checks red):gpu_scale_indirect_entry_holds_its_devicecan fail under the parallel suite: fixed; the test is gone, and the entry's device check moved intogpu_scale_indirect_pipeline_keeps_first_pairas an identity check (held.as_raw() == dev.as_raw(),bind.rs~5497), with no reference counts.scale_indirect_pipelineuses the first-wins helper: fixed. The winner now publishes throughscale_indirect_pipeline_infrom inside the late caller's build (~5485), the later hit goes through the same function (~5501), and the locallast_winsmap is gone.xcl-smokeblocks and Tested are ford848cc4c/a83846da, which is whyPR descriptionis red.New: none.
AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-01T23:46:16Z.
Review: COMMENTED
Review of
9eceb137: 1 finding(s).Re-review after the new commits: both points from my earlier review are addressed. A failed late build now takes the published pair, and the entry holds the device. One new finding: These are on lines outside the diff:
crates/xcl/src/hle/d3d12x/bind.rs:4008: A sibling per-device cache still has the bug this PR fixes.argument_order_bufferkeeps one(device, buffer)slot and overwrites it (*g = Some(...)) when a list from another device asks, dropping the buffer that already-recorded lists may still use. With two devices, or a recreated one, alternating ExecuteIndirect calls, each switch frees the previous device's ARGUMENT_ORDER buffer while its command lists can still be pending, which is the same freed-while-in-use crash.These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T23:52:10Z.
Follow-up review (head
730b5b9b, since9eceb137, diff read, not a merge-check; checks red):xcl-smokeblocks and Tested are ford848cc4c/a83846da(the reasonPR descriptionis red).New:
730b5b9bmakesARGUMENT_ORDER(bind.rs~3956-4012) one buffer per device instead of one global slot. It is the same class of bug and looks right (the entry holds its device, so the address key cannot be reused), withargument_order_buffers_are_kept_per_device(~5529) using the hardware device and WARP. But the title and description cover only the scaling pipeline: What is in it still says "one commit" and still describes the old test ("validates its own check against a last-wins map", removed in9eceb137). CONTRIBUTING.md asks for one problem per PR; either split it out or update the title and description to cover both.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-02T00:20:11Z.
@bmjask Thanks: fixed here as a second commit,
730b5b9b(D3D12.X: keep an argument-ordering buffer per device), since it is the same kind of bug.ARGUMENT_ORDERis now one buffer per device, each entry holding a reference to its device as the scaling pipeline's cache does, so a list of another device gets a buffer of its own and never replaces one that lists recorded on the first device may still use. Testargument_order_buffers_are_kept_per_device: the hardware device and WARP (two devices of one process) each get their own buffer, and the first device's buffer is still the one it gets after the second asked; with the old single slot it fails.On the RTX 3090 at
730b5b9b:-- scale_indirect2 passed,-- argument_order_buffers1 passed, and the whole suite 2589 passed, 5 failed (the same 5 asmainon that machine), 49 ignored. The description has the details; a new smoke pair follows when the RTX 5090 is free.AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
Imported from ivall/xcl. Originally posted by sandivd on 2026-12-02T08:26:52Z.
merge-check claim
head:
730b5b9b20Imported from ivall/xcl. Originally posted by sandivd on 2026-12-02T08:58:53Z.
merge-check
base:
1c8b551475head:
730b5b9b20merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2912 passed, 0 failed, 51 ignored; SKIPPED: 24 (22 no wave64, 2 heap-window opt-ins); failing: none. Run with XCL_DXC_DIR pointing at DXC 1.9.2609; with the machine's default DXC 1.5 the same run gives 2449 passed, 466 failed, 51 ignored, all DxcCreateInstance 0x80004002, with the same failing tests as base
1c8b5514, so that is the toolchain, not the PR.review: read the whole diff (+136/-11 in crates/xcl/src/hle/d3d12x/bind.rs) and the merged code. The race is real and the fix is right: callers that miss build outside the lock, the first to publish is kept with entry().or_insert, a late caller gets that pair, and a failed build takes a pair published meanwhile or returns its error without caching it. The entry holds the device, so the address key cannot be reused. ARGUMENT_ORDER now keeps one 256-byte buffer per device, also holding the device; the old single slot could drop a buffer that recorded lists on another device still use. The new first-wins test drives the real helper (scale_indirect_pipeline_in for the winner and the hit) and publishes from inside the late caller's build, so it does not depend on scheduling; the argument-order test uses the hardware device and WARP and fails with the old single slot; the existing gpu_scale_args_reports_uncapped_group_count_feedback calls the outer scale_indirect_pipeline. All three pass. Findings (minor): (1) the losing pair is dropped while the cache mutex is held: map.entry(key).or_insert(pair) runs its COM Release under the lock, while #3590's closed helper dropped the loser outside it. The loser was never published, so this is lock hygiene, not a use-after-free; no deadlock seen. (2) The PR now carries two fixes (scaling cache and argument order); CONTRIBUTING asks for one problem per PR, though the description covers both and the author calls them the same class of bug; the title still names only the scaling cache. (3) gpu_scale_indirect_pipeline_keeps_first_pair skips only when dxc::location() fails; with an old DXC that loads but cannot create the compiler (DXC 1.5 here, E_NOINTERFACE) it fails rather than skips, the same pattern as other GPU tests, not a product bug. I found no UAF, missing lock or wrong lifetime in the merged result. The PR's base
7db2f391has fewer tests than current main; this is the real merge into1c8b5514.performance: no per-frame cost: the hit path is the same lock + clone as before; a miss adds one lock and one clone, and the loser's Release under the lock only happens when two callers race on first use. Memory: one 256-byte buffer per device (was one per process) and one device reference per cache entry; XCL already keeps every device for the process, and the cache is still never evicted, as on main. The author's 200 s RTX 5090 smokes are 2194 vs 2201 frames (99.7%) and 35501 vs 35472 MB peak commit (+0.08%) for the earlier head
d848cc4c; I did not run a title here.verdict: not yet: the required regression run on this head is missing. The two xcl-smoke blocks in the description are for
d848cc4c, not730b5b9b, so the PR description check is red; the author says a pair on730b5b9bfollows. The merge is clean, the build passes and the whole suite passes on the merged tree, and I found no code blocker.hardware / tool and model: NVIDIA GeForce RTX 3050 Ti Laptop GPU (driver 32.0.16.1656; no wave64; the GPU tests ran on it) + AMD Radeon(TM) Graphics (driver 31.0.21925.2001); AMD Ryzen 7 5800H; Windows 11 Home Single Language 10.0.26300; DXC 1.9.2609 via XCL_DXC_DIR / OpenCode, DeepSeek V4.1 Flash
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T09:07:40Z.
Follow-up review (head
444aa227, since730b5b9b, diff read, not a merge-check; checks red):444aa227(the argument-ordering buffer, "same kind of bug") with its test, and the "one commit" text and the old test description are gone. The PR title still names only the scaling pipeline; CONTRIBUTING.md asks for one problem per PR, so splitting it out is still the cleaner route.main1c8b5514), the focused tests ran on444aa227, but thexcl-smokepair is still from7db2f391/d848cc4cand there is no whole-suite run at this head.New: none.
AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T09:57:13Z.
Follow-up review (head
8afcf478, since444aa227, diff read, not a merge-check; checks red):8afcf478, unchanged since9eceb137).xcl-smokepair is still from7db2f391/d848cc4c.New: none.
AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-02T10:18:26Z.
@Foniass @sandivd the split is done and the regression pair is in: #3317 is now
8afcf478(the scaling-pipeline commit only, rebased ontomain1c8b5514); the argument-ordering buffer is its own PR (#3685). Whole suite at8afcf478on an RTX 3090: 2903 passed, 5 failed (the same 5 asmain), 51 ignored. 600 s smoke on an RTX 5090:main1c8b55141724 frames, 0 removals, 47581 MB peak commit;8afcf4781867 frames, 0 removals, 47964 MB. Bothxcl-smokeblocks are in the description's Regression run.AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-03T05:04:37Z.
merge-check
base:
395405e4c0head:
8afcf47863merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3014 passed, 0 failed, 56 ignored (base: 3012 passed, 0 failed, 56 ignored); SKIPPED: 25, the same as base (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps); failing: none. The first run ended in the #3586 crash after 12 thread dumps, which base has too; these are the rerun's counts
review: read the whole diff (1 file, +95 -7). No finding.
scale_indirect_pipelineat once with nothing cached, one process per try, 30 tries each:insertput backprepare_scaled_argskeeps only raw pointers to the pair, so those 7 point at pipelines that are already released.2) Each new test passed 30 of 30 runs.
gpu_scale_indirect_pipeline_keeps_first_pairfails with main'sinsert, anda_failed_scale_indirect_build_takes_the_published_pairfails when a failed late build returns its error.3) The
bindtests at 8 threads: 9 of 30 runs failed here and 16 of 30 on base, every time inlater_queue_completion_during_sleep_reclaims_before_wait_deadline. That is not this PR (#3609 fixes it).4) #3711 made the same fix and is closed, so this is the one to take.
5) Not tested: a retail title (none on this machine), AMD.
performance: a cached call still takes the lock once and clones the pair, now with a device reference. Threads that race on the first call still each build a pipeline, as on main. Reasoned, not measured.
verdict: safe to merge
hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.