D3D12.X: preserve native host vtable prefixes and tails #1894
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1904"
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 mikebuckets171 on 2026-11-24T22:55:12Z.
Part of #258. This upstreams Ahmet Dedeler's focused D3DMetal host-vtable fix from
ddf3be7, preserving its author and existing Claude Mythos 5.2 co-author trailer. D3DMetal is native code under Wine rather than a PE module: the existing extended vtable layout puts XCL metadata where D3DMetal expects its C++ ABI prefix and does not preserve enough host tail slots. The change mirrors the host prefix and tail only when the original methods are outside PE modules; PE-backed Windows host tables keep their existing layout.What is in it
crates/xcl/src/hle/d3d12x/real.rs: preserve the native host vtable prefix/tail and map extended tables back to their original table; add a focused regression test for native and PE-backed table layouts.Tested
cargo build --workspace --locked --release --target x86_64-pc-windows-gnullvm— passed on this head.cargo test -p xcl --lib --release --target x86_64-pc-windows-gnullvm hle::d3d12x::real::native_host_table_tests::a_native_hosts_table_keeps_its_prefix_and_other_tables_keep_theirs -- --exact --nocapture— 1 passed, 0 failed, 951 filtered out, under CrossOver.main689f2db477c3c062cf162649781640ef8a977c18:50768d87beca1773980745db1fbc68cf69446b92:main; this is a bounded no-regression check only, not evidence the title reaches the changed vtable path. Wine reports peak commit as 0 MB, so memory is unmeasured.Not tested
cargo test --workspace -- --test-threads=4and any Windows GPU run; no Windows GPU machine was available in this session. Per #258 guidance this is a Mac-host-only behavior change, so Windows remains untested pending a Windows tester.AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T02:15:55Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T21:00:31Z.
Review: COMMENTED
No confirmed source defect, but this D3DMetal ABI prerequisite is not merge-ready. Synthetic layout tests do not validate real native-host adoption/dynamic_cast or tail calls; the Mac smoke reaches zero frames and does not exercise rendering/adoption. Prefix/tail constants need target-path evidence, and IsBadReadPtr establishes mapped readability rather than actual vtable extent. Add a real D3DMetal host tail-call/adoption integration test, a non-zero-frame target run, and required Windows/current CI evidence.
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:40:08Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:04:41Z.
Triage (#1607) – head
50768d8No open or merged PR makes the same change. #3099 touches
class_foras part of a large amd-dev rebase, but it does not keep the native host's prefix or tail.One point in
real.rs:class_for: on a native hostscannedbecomestotal, and slots0..totalare read with*ot.add(i)without theIsBadReadPtrprobe that the prefix (table_header) and the tail get. That read can run past the host table's mapping. Main'slist_x.rstest (*(raw as *mut usize) = *ext.sub(1)) still reads the word before the table directly, but only in a test. The branch conflicts with main.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.