XAsync: a result size of 0 when there is no result to take #2618
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2618
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2618"
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?
@F1reworks10 on GitHub · 2026-11-25 16:56 UTC · original
F1reworks10:xasync-result-size-without-result→main· +63 −5 · 1 files · 1 commits · openXAsyncGetResultSizeonly wrote the size when the call had succeeded:The public reference implementation (libHttpClient's
AsyncLib.cpp) writes the size whatever the status:So the reported size is 0 in three cases:
This matters in VIctory because all of its offline answers fail, such as
xnetworking's security information andxuser's token and signature. Failure is therefore the normal path for those size queries. A title that sizes its buffer from the reported size before checking the HRESULT reads an uninitialized stack value on main, where the console gives it 0.Change (
crates/victory-hle/src/modules/xasync.rs)XAsyncGetResultSizealways writes a size:The returned status is unchanged.
Test
result_size_is_zero_without_a_result_to_takechecks the pending, held, taken and failed cases. It fails on main, because a pending call leaves the caller's0xdeadbeefin place.cargo test -p victory-hlepasses. Clippy is clean with and without--all-features. This PR and #2616 change different parts ofxasync.rsand merge cleanly together.🤖 Generated with Claude Code
@kotekompotek on GitHub · 2026-11-25 17:43 UTC · original
Reviewed: semantics match the libHttpClient reference — size written unconditionally, 0 when the call is pending/failed/result already taken.
call(block).is_some()is the right predicate (the call is filed until its result is taken). Test covers pending/completed/taken states. CI green.@Marvisak on GitHub · 2026-11-25 22:18 UTC · original
Automated triage for the maintainers.
Recommended for a maintainer's look.
XAsyncGetResultSizeincrates/victory-hle/src/modules/xasync.rsnow always writes the size: the block's size word while the call is still filed inCALLS, 0 otherwise, matching the cited public libHttpClient reference. I checked against main that a call leavesCALLSviareleasewhen it fails or completes with size 0 (complete_call) and when its result is taken (XAsyncGetResult), so "filed" is the right test for "has a result to take"; the returned HRESULT is unchanged. Small, with a test covering pending/held/taken/failed. It also merges alongside #2616 by the author's account (#2616 currently needs a rebase). Merges cleanly, CIcheckpassing.Generated by Claude Code
@futurepro62 on GitHub · 2026-11-26 01:22 UTC · original
Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head
21d63c2(on its base13f91ca).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 774 passed, 0 failed, 9 ignored.result_size_is_zero_without_a_result_to_take.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
@Dukestar69 on GitHub · 2026-11-26 05:17 UTC · original · approved these changes
Tested locally merged onto
origin/main(63bcca4) on Windows 11 x64:XAsyncGetResultSizenow always writes*out(0when pending, failed, or after the result has already been taken viacall(block).is_some()check, and the recorded result size otherwise), matching libHttpClient'sAsyncLib.cppsemantics and preventing callers from reading stale output values.cargo test -p victory-hle xasync: 14 passed, 0 failed (includingresult_size_is_zero_without_a_result_to_take).cargo clippy -p victory-hle --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@fuzeofficlal on GitHub · 2026-11-26 13:55 UTC · original · approved these changes
This matches the public
XAsyncGetResultSizereference behavior: returningE_INVALIDARGon null inputs, writing0while pending (E_PENDING), after failure/cancellation, whenrequired_size == 0, or onceXAsyncGetResulthas consumed the call, and returning the held payload size for any non-negative completion status (includingS_FALSE).A small follow-up could also add direct assertions for a successful zero-payload completion, a failed completion given a non-zero
required_size, and the null-pointer checks.Local verification on commit
21d63c270f58and merged ontoorigin/main(e42183d9):cargo run --locked -p xtask -- policy(184 files ok),cargo clippy -p victory-hle --all-targets(defaultand--all-features),xasync::(13 passedon PR head,14 passedmerged), and the fullvictory-hlesuite (149 passedon PR head,155 passed, 0 failedmerged) all pass. Approving.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.