Repository navigation
hle: bind queued async work to its original call - #80
Open
smecherucarbarou wants to merge 1 commit into
Open
smecherucarbarou wants to merge 1 commit into
smecherucarbarou wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Prerequisite for #42
Queued async work currently resolves its provider by block address when dispatched. After completion and address reuse, old work can invoke or cancel the newer call. A work callback that completes inline can also let its return value complete the replacement call.
Capture the original call through a weak reference in a task-owned context and complete that call directly. Completed or expired calls are skipped. Context ownership ends on dispatch, canceled delivery, rejected submission or queue disposal. Weak ownership avoids a Call/Queue/Task cycle when #42 introduces runtime-owned provider state.
Only
crates/xtp-hle/src/modules/xasync.rschanges: 342 changed lines (+331/-11), comprising 51 production (+40/-11) and 291 test (+291/-0). Provider admission/cleanup ordering and completion-queue ownership remain separate contributions. Existing #30/#44 waiting behavior is preserved.Fixes: none
Depends on: none
Area
xtp-hle: XAsyncSchedule work identity and queued context lifetime.Tests
cargo xtask pr-checkpasses on my machineNative Windows x64, pinned Rust 1.98.1; base
9b822f58870e351613666129ca5621c6a4955fb7.cargo xtask pr-check --title "hle: bind queued async work to its original call": 5/6 passed (fmt, clippy, clippy-diagnostics, policy, conventions). Workspace tests fail only in the two GPU tests below; the proposed title passes. No contribution commit exists yet, so the commit convention check covered zero commits.cargo test --workspace --locked --no-fail-fast: 1,668 passed, 2 failed, 69 ignored, including doctests. Onlyxtp-gpu --libfailed.host::twins::tests::a_24_bit_plane_copied_in_a_query_holds_what_the_pass_draws_for_floats(same 1,412 float differences) andhost::twins::tests::a_pass_leaves_no_scissor_where_the_title_set_none(intermittent; reproduced in the first repeat). Clean baseline GPU runs: 632 passed/1 failed/14 ignored, then 631 passed/2 failed/14 ignored. No GPU code or assertions were modified.Provenance
Original Rust implementation and synthetic fixtures for XTP. Adapted the applicable task-context ownership pattern and callback-reuse regression from the earlier local XTP contribution
0d455a115e9874585099557410aa0deb52fdb883; replaced its strong call capture with a weak reference. No external implementation code was copied or translated. Maintainer scope approval: #42 (comment).AI assistance: OpenAI Codex implemented the change and tests, reviewed ownership paths, ran validation, and prepared this description. The contributor remains responsible for every line.
Checklist
<area>: <summary>; one topic; under 400 changed lines, or the reason is aboveNo command, environment-variable or public API changes require additional documentation; the local ownership contract is documented beside the implementation. No commit has been created yet.