Repository navigation
Conversation
|
Duplicate of #315? |
KomanderDG88
pushed a commit
to KomanderDG88/VIniVIdiVIci
that referenced
this pull request
Nov 26, 2026
…ICTORY_MERGE_SUBMISSIONS, off by default) The thread that submits for the title pays fixed work per host submission (the placed-heap descriptor pass, the write-watch asking, the pass over copies in the card's memory, the refresh threads' joins, list close and reset, a send and a signal, a flight for the relay), about 59 times a frame. With VICTORY_MERGE_SUBMISSIONS=1 a title submission sent ahead (VICTORY_LATE_WAIT / VICTORY_RELAY) is held back and joins the next ones; they go to the card as one host submission, in the title's order, with a barrier (UAV and aliasing barriers on no resource) in front of each submission after the first. They are sent at: a fence signal on any queue, a wait for a memory value that a held submission may write (one met by a held bottom-of-pipe write lets the part behind it join), a present, a synchronous submission of ours, a settle, page mappings on a queue, a next submission that reads what held shaders or flights in the air write, copies over what a held one brings to the card, or runs code of ours on title memory, 256 lists or 32 submissions, and 500 us after the first was held (a thread of its own). Counters per frame on the frame line: title submissions, host submissions, sends by reason. Measured in AnyXboxX: preparation 48-52 ms a frame, 40-46 with =1. =2 (fence signals carried behind the held submissions, set when they have run) lost the device in AnyXboxX's runs: here it runs as =1, said in the log, unless VICTORY_MERGE_SUBMISSIONS_UNSAFE_CARRY=1 asks for it too. Off (the default) every path is as before. The decision logic is in merge.rs with unit tests; two WARP tests cover the step summary and the barrier prelude. Port: from LooperSalty/AnyXboxX PR fxceless#337 (in fxceless#358), commit f98cbc09f8e9c4016e4643df7b00ee0e814e4c18 with its docs follow-up 528b652e0f573f49e3196acb202e953f0bbfc020 folded in; applied by hand, as the trees differ (different layout and history). merge.rs is the original's but for the =2 gate and two field docs. The host side (Merging, touches_of, merge_send/signal/fence_asked/wait, the timer thread, join_barriers, Host::merge_offer/learn/send_held, the WARP tests) is in a new module host/merging.rs instead of host.rs, which is near the 512 KiB limit; host.rs keeps the hooks (execute_late split into send_late, submit/prelude take the joins, settle_now, execute, execute_own, present, the frame line). Adapted to this tree's steps: every fill counts as a read (blocked_by looks at constants too), a Step::Host's title range counts as a read, Step::Run(..) as code, and texture and buffer read-backs as what the shaders write; joins move past the heap worker's lists sent in front. Also hooked: the signals of joined parts (VICTORY_JOIN_PARTS) and Host::present (presents behind the line, VICTORY_ASYNC_PRESENT). The original's fix of its own merge (5ef1beca) is not needed here. Port: onto the stack where `impl HostList` lives in host/host_list.rs; HostList::prelude's hunks (the `join` argument, the prelude made when joining, the join barriers first) moved there, the rest of host.rs as in the original. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #245
Summary
Fixes two IEEE-754 FP16 conversion bugs in the GPU rectangle list CPU fallback (
f32_to_halfincrates/victory-gpu/src/primitive.rs):exp >= 31caughtraw_exp == 0xffinputs indiscriminately, turningNaNvalues into±inf(sign | 0x7c00).(man + 0x1000) >> 13, which always rounds exact halfway ties up instead of rounding ties to even (unlike the subnormal branch).raw_exp == 0xffbefore normal/overflow handling: whenman != 0, return a sign-preserving quietNaNwith a guaranteed nonzero mantissa (sign | 0x7e00 | ((man >> 13) & 0x03ff)); whenman == 0, returnsign | 0x7c00.((man >> 13) & 1)((man + 0x0fff + ((man >> 13) & 1)) >> 13), preserving carry-out into the exponent and overflow tosign | 0x7c00.R16_FLOATexpand_rectsregression tests for both#245cases (normal even tie1.0, 0.0, 2^-11 -> 0x3c00and quietNaN0x7e00/0xfe00preservation) and verified they failed before the fix and pass after.f32_to_halfedge-case tests covering odd tie rounding up (1.0 + 2^-10 + 2^-11 -> 0x3c02), non-ties,±0.0,±inf, finite overflow to±inf, quiet/low-payloadNaNs, and subnormal round-to-even ties.Verification
rustfmt --edition 2024 --check crates/victory-gpu/src/primitive.rs— passedcargo clippy --workspace --all-targets --locked -- -D warnings— passed (0 warnings)cargo clippy --workspace --all-targets --all-features --locked -- -D warnings— passed (0 warnings)cargo test --workspace --locked—499 passed; 0 failed; 7 ignoredacross the workspace (victory-gpu:113 passed; 0 failed; 1 ignored;xtaskincludingrepository_passes_policy:4 passed; 0 failed)Note: AI-assisted fix; contains no game files, keys, or assets.