Repository navigation
Bathyal next4: world-read race, BC5, memory copies, MWAITX on Intel - #7
Merged
Merged
Conversation
…s on the CPU A title streams its world through command list #60 with a source in its own memory (outside the windows) and a destination at a title GPU address: both sides went unresolved and the copy was dropped. Now either side outside the windows takes the CPU path: the copy is recorded on the list and done by the cpu_writes worker once the queue is past the submission's earlier work, reading the source at that moment (a source in a sparse window is read back from its video memory first). A destination in a sparse window is then sent to its video memory (sparse::flush_written) and the title queues wait for it before their next work, which is also what the write-watch would do at the next submit. A range in a sparse window with no video memory (unmapped tiles, hole pages) no longer takes the GPU copy either. Tests: a copy outside unified memory is recorded and done (list_x), copies land after the queue (cpu_writes), a copy the CPU cannot make changes nothing.
The BC5 stream is two symbols per lane per 16-byte block: lane 0 the distance in BC3's bit-interleaved form, lanes 2/3 the endpoint residues of the two channels, lanes 4-7 and 8-11 the 3-bit index pairs. Each channel becomes a plain BC4 block. The stream carries neither the 64-entry index-pair table nor the 255-slot endpoint history; the tables are the estimates of the clean-room decoder leonida-asset-pipeline (MIT), generated into bc5_tables.rs by scripts/gen_bcpack_bc5_tables.py. 214 slots are fitted; an unknown slot ends the stream with Error::History rather than a guess. BC7 stays refused: its block layout is documented, but the rebuild needs two 256-slot history tables and 10 of the 285 lane-15 signatures that only GPL-3.0 sources carry, which this GPL-2.0-only crate cannot take. Tests (synthetic data only): a hand-built block with an in-stream reference and a history slot, a round trip from blocks to symbols to the fragment encoder to decoded blocks, the bc5 fixture, the fitted tables, and a BC5 request through a DirectStorage queue.
The endpoint symbols of lane 2 and lane 3 are E at the even unit and O at the odd unit, so O is symbols[12 + lane], not the next lane's E. The round-trip test failed on this before the fix (endpoints off by one lane).
…aited for A retail title fills its streaming page tables from another thread right after Submit. XCL's worker runs the request first, reads page 0 and refused the request with E_ACCESS_VIOLATION (12288, 24576 bytes and more, one per world-database file per run). The entries that were 0 at enqueue are now read again at the request's turn, and a table still holding 0 is given a few milliseconds before the request fails.
… as an address A raw pointer is not Send; usize is.
…mulation A title's spin-waits run them in a loop; on a CPU without them each iteration was an exception. The faulting instruction becomes NOPs (MONITORX) or PAUSE and NOPs (MWAITX), as CLWB already is.
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.
Known-good build: ran 16+ minutes of loading on an RTX 4090 without a crash. 797 tests pass on galaxy.