2daafe221e65e307fc93856595b5fa84d02b1fc3
3208
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
2daafe221e |
Memory: plain blocks made smaller where their making is slow
On RADV a block of plain memory (allocated with no export: the blocks of images, of heaps, of buffers that declare their padding unobserved) shares the reservation of the process's buffer objects, and its vkAllocateMemory holds every submission of the process while the kernel fills its pages. On a Radeon 780M with the kernel's page pools empty, a 64 MiB block took 8.9 to 9.6 ms at the median on a quiet host and up to 23.1 ms (slowest 30.4 ms) with its free memory in single pages, and a texture made every frame left 13 to 33 turnarounds of 8 ms or more a phase (the slowest 42.3 ms). Now a making of such a block that took longer than MAKING_BOUND (8 ms, half a frame at 60 Hz) makes the device's later pooled blocks of plain memory the largest power of two that making's rate makes within the bound, at least 16 MiB (Memory::plain_block_made); a placement larger than such a block takes a pooled block of the power of two that holds it (up to half of BLOCK_BYTES, past which it is dedicated as before). The size is never made larger again. Exportable blocks keep 64 MiB: each is a buffer object of its own reservation, whose making holds nothing. Each made Block records how long its making took (Block::took, zero for imports); add_block feeds the plain ones to plain_block_made. place, keep_room, ready_if_growing, ready_ahead and sweep_stale size a pool's blocks through pooled_bytes, and add_ready takes the size of the block it adds. tests::plain_blocks: the size rule and the pooled block sizes on the bookkeeping alone, and on a device told of a slow making, 1 MiB textures in 16 MiB blocks and 20 MiB ones in 32 MiB blocks. tests::reclaim_submit_bench: an images arm (a 1024x1024 texture a frame) and a mixed one (with 2560x1440 and 3840x2160 textures), the blocks of images made, pooled and dedicated, and the plain block size reached. (cherry picked from commit 0bec0583b042c1f2c05b98e97d080e6426d13619) |
||
|
|
c6243bbd5e |
blocks_ahead: the hurried-making test holds a use of the queues open
The test of a creation call that cuts a making's wait for quiet short kept the device's queues
in use with three threads that each committed a one-word fill and waited for it. A making's wait
reads the holds of the device's queue locks (device/queue_quiet.rs), not the GPU's work, so a
pause of 1 ms between two of those threads' submissions ends it; on a loaded host the threads
leave such pauses, each making's wait ended before a call needed its block, and the test gave
up after three makings it waited for with none hurried. Pin 30's 5080 runtime half 1 (run
beside half 2) failed so: 0 hurried, 3 made ahead, 28.35 ms at the longest.
Now the test holds one use open (QueueQuiet::began, ended as its guard drops) from before its
first creation, so nothing but the bound (QUIET_MOST) ends a making's wait, and settles the
device's submission checks first, as the first test does, so that no creation call in it makes
the first block of a pool of the runtime's own pages. It stops at the first making a call
hurried, or after three whose wait reached its bound, which only a host slower than 50 ms over
the few creation calls between a making's start and its block's need reaches; it prints those
and the makings waited for.
The exportable pools made ahead (
|
||
|
|
9b00cd81d6 |
RUNTIME_VERSION 1983 and the runtime-sources pin for listed plans that ask the driver first
77f336e98c changes the runtime's guest RAM: run-list imports consult the device's remembered dma-buf refusal (and remember the driver's own refusal of a list), and a use whose plan would be listed first asks the driver with one page of the RAM (Device::ram_takes_dma_bufs), listing only where the driver took it, so a taxed NVIDIA keeps 64 MiB chunks by pointer. The host_ram_dma_buf tests force the tax held and read the plan the device chose. Pin 30's 5080 red copies_over_a_listed_ram_make_no_untouched_page_of_it_resident was this. Verified by the branch: RTX 5080 (b5080 exitcrash-follow-112525) dma-buf module 10/10 twice, the driver refusing the use's question for real; the old tests with the tax forced held fail 3 of 4 there; gem10 lavapipe 12205 (suite 2007/2007, clippy x3, rustdoc), 12213 fast_paths/docs 27/27; 780M 12209 module 10/10 twice (listed, run lists used). Negative controls for each part fail. Here: signatures --check, REFUSALS and coverage docs regenerated, fmt. |
||
|
|
7d17fb1882 |
Guest RAM: a refused dma-buf keeps run lists and listed plans off the driver
Three follow-ups to remembering a driver's refusal of a guest RAM's dma-buf
(
|
||
|
|
0d45d4f9d5 |
RUNTIME_VERSION 1982 and the runtime-sources pin for a kernel end stamped at the submit call
58e674d802 changes the runtime's kernelEndTime: the host time read right before the last batch's
vkQueueSubmit is called, not after it returned. Pin 30's lavapipe replay (
|
||
|
|
4499666bd6 |
Kernel end: the host time the last batch's vkQueueSubmit was called, never after it returned
Pin 30's lavapipe replay (
|
||
|
|
c148f594ff |
RUNTIME_VERSION 1981 and the runtime-sources pin for guest RAM's remembered dma-buf refusals
a6ccb78810..abddf2d2f1 change the runtime: a guest RAM span's dma-buf that fails on a device that imports dma-bufs is counted (WorkCounts::host_ram_dma_buf_imports_failed); a driver's refusal of one is remembered for the device's life, so its later chunks take their pointer without asking the source (NVIDIA refuses every udmabuf import and lets go of one descriptor each time); and an import tax Holds short of TAX_MARGIN answers Fails for the device's life, unrecorded, as split tries short of it do since 4acfbee03b. Pin 29's 5080 runtime half failed the route test when that process measured the tax held (the driver refused, the pointer took it, nothing counted it). Verified by the branch: gem10 lavapipe 12177 (suite 2004/2004, the translator's surface and fast_paths tests, clippy x3, rustdoc; the new test fails with the remembering removed, the source asked twice); RTX 5080 release (b5080 exitcrash-taxroute2-104522): the route test with NVIDIA's refusal 15/15 (3 quiet, 12 loaded beside 35 host-RAM tests a loop), every loaded device measuring the tax not held; before the fix the forced route failed 2/2 (ERROR_OUT_OF_DEVICE_MEMORY). Here: signatures --check, REFUSALS and coverage docs regenerated, fmt. Open: run-list imports and a RAM's Plan::listed do not consult the remembered refusal; three other host_ram_dma_buf tests still expect dma-buf imports wherever the measured tax holds. |
||
|
|
3fe18c4efd |
Guest RAM: a driver's refusal of a span's dma-buf is remembered for the device's life
Counting the refusal left its cost: on a device whose import tax holds and whose driver refuses every udmabuf (NVIDIA 615.71.09, FAST-PATHS), every guest-RAM chunk asked the source for a dma-buf, failed vkAllocateMemory, let go of one descriptor (the driver closes the clone it was handed) and only then took its pointer. ram_span_as_dma_buf now tells the source's failures (an error, or an answer of other lengths: that span's alone, counted) from the driver's (anything once the source answered one dma-buf of the span: its memory types, the buffer, the import, the bind). A driver's refusal is counted once and remembered in the device's RamSource; every later span is refused at once, unasked and uncounted, and takes its pointer. The decision reads the device's own answer, never its identity. A transient failure of the driver's (memory that ran out) is remembered the same way, recorded in FAST-PATHS' NVIDIA row. Tests: a_driver_s_refused_dma_buf_sends_the_device_s_later_chunks_to_their_pointer forces the tax held and refuses every dma-buf import through a test stand-in for the driver (Memory::import_refusal, cfg(test), answered where the driver's import would run), on every device that imports dma-bufs: two chunks, the source asked once, the failed count 1, the second chunk by its pointer. The route test, where the driver itself refused (NVIDIA's), makes a buffer over the RAM's second chunk and asserts the same with the real driver. Without the remembering both ask the source a second time. (cherry picked from commit abddf2d2f1ed16a5ee6407cae04f7e10dfffb736) |
||
|
|
c6be8ef2d8 |
Submission checks' report: an import tax Holds short of its margin is named
The report showed only the Fails it answered, beside floors that may pass the bound; the flag says the margin's rule ran (the evidence for the change before this one's path). (cherry picked from commit deccce5b26744b591df0dc9988d4827adef30b16) |
||
|
|
a7dde1cba9 |
where_the_import_tax_holds_a_chunk_takes_its_dma_buf_first: the report read before the force
The report printed after the force named the forced Holds beside the measured floors (lavapipe 12153: "measured not held: ... import tax Holds (0.7 ... against 0.7 us)"). (cherry picked from commit 72e91bb5df25293f1a5257ebe29ea427d01bd35c) |
||
|
|
178ace2529 |
where_the_import_tax_holds_a_chunk_takes_its_dma_buf_first: print the checks' report beside the measured verdict
The verdict the device measured, with its floors, is the evidence of which route its process would have taken; the forced route no longer shows it. (cherry picked from commit a7afbb370f689fd3d75e664099083905a3a2fd6f) |
||
|
|
ee7a6e2e22 |
Import tax: a Holds short of its margin answers Fails for the device's life, unrecorded
A loaded process concluded a tax its quiet ones never see. On the RTX 5080 Laptop GPU (615.71.09), the route test run 3 times quiet and 5 times beside a loop of the host-RAM and host-residency device tests (b5080 t entry exitcrash-dmabuf-100324, probe 3f3ca70d32): every quiet device answered Fails, 2.1 to 2.2 us a submission with the 32 imports held and without alike; the first loaded one answered Holds from 3.4 against 1.9 us, both halves agreeing, past the 1 us bound but short of TAX_MARGIN (2 us), and so took the routes of a taxed device (its guest RAM dma-buf first) for its life. lavapipe's loaded Holds (1.4 against 0.2 us, in the module docs) was the same shape. The margin already kept such answers out of the records; now a Holds short of it answers Fails, as the taxsplit change made tries that all split short of it answer, and the next device measures again. A Holds past the margin stands, recorded only where its repeats pass it again, as before. The taxes the probe measured (RADV, ANV with 32 imports held) pass the bound six times over and more. The unit test an_import_tax_holds_short_of_its_margin_answers_fails_unrecorded takes the 5080's and lavapipe's loaded floors; without this change both answer Holds. The lavapipe case leaves an_import_tax_holds_is_recorded_only_past_its_margin_and_repeated, which asserted the old answer. Module docs, TAX_MARGIN's and tax_tried's docs updated; no record changes (CHECK_VERSION stays). (cherry picked from commit 4c2760204e17687d07fdf7a3cd40b5653f4565d2) |
||
|
|
98729ad0de |
Guest RAM: a chunk's dma-buf the driver refuses is counted; the route test forces the tax held
On the RTX 5080 (NVIDIA 615.71.09) pin 29's runtime half failed host_ram_dma_buf::a_ram_with_a_source_takes_the_route_its_device_s_checks_choose: that process's import tax answered Holds, the chunk went dma-buf first, the source was asked, and no dma-buf was imported. A probe printed the refusal: vkGetMemoryFdPropertiesKHR gives the udmabuf types 0x9, the buffer takes 0x1f, and vkAllocateMemory answers ERROR_OUT_OF_DEVICE_MEMORY (the refusal FAST-PATHS already records for NVIDIA). import_chunk dropped that error and took the pointer, as it should, but nothing counted it, and the test held every taxed device to a dma-buf import. - WorkCounts::host_ram_dma_buf_imports_failed counts a guest RAM span's dma-buf that failed on a device that imports dma-bufs (the source failed or answered other lengths, or the driver refused it); ram_span_as_dma_buf counts it past its device check. - The route test (now where_the_import_tax_holds_a_chunk_takes_its_dma_buf_first) forces the tax held, as the pointer-first test forces it not held, so the taxed route runs on every device in every run, not only in a process whose check measured a tax. It asserts the source asked once for the chunk, and the dma-buf imported or refused and counted, the pointer then taking it; it prints the verdict the device measured beside it. - HOWTO, FAST-PATHS' NVIDIA dma-buf row, host_ram's docs and the API signature table name the count. Verified: the probe at 3f3ca70d32 on the 5080 (b5080 t entry exitcrash-dmabuf-100324): with the tax forced held, 2 of 2 runs failed the old assertion with the refusal above; quiet runs measured the tax not held (3 of 3). This commit's own runs are in the next evidence. (cherry picked from commit a6ccb78810867a4d567892feee4b3b56ba1af834) |
||
|
|
8c36a3e1e5 |
Re-bless the authored compile census at 6efa9fe7b9
Its product fingerprint follows development's versions at
|
||
|
|
6efa9fe7b9 |
RUNTIME_VERSION 1980, the runtime-sources pin and the API table for recovery 1c
1c (eac07b1f9a..e64d7a7e7a, 14 commits) puts the program's host-visible buffers in blocks of the
runtime's own pages where the device's checks give them what plain blocks do (the import tax
answered Fails and the fresh pages' texture verdicts hold), and a recovery carries those blocks to
the new VkDevice, so pooled Shared and Managed buffers are no longer refused as MadeBeforeRecovery
there. While a verdict is pending, and under exact_answers' Shadow policy, plain blocks serve.
API table: two WorkCounts fields added, page_buffer_blocks_made and page_buffer_blocks_plain
(additions only; nothing a consumer used moved).
Verified by the branch at 951f9244cc (the same product code on
|
||
|
|
76d5571193 |
padding_unobserved: print where each undeclared buffer lies and the checks that decide it
On the M3 the test's undeclared Shared buffers lay in plain blocks at every pitch (m3-max-12032) while the recovery test's pooled buffer lay in a block of the runtime's own pages. The line each pitch prints now names the block the undeclared buffer lies in, and a line before them says whether the device's submission check found a held import costs nothing and whether it takes those blocks. Diagnostics only. (cherry picked from commit e64d7a7e7aa8189f3b878299afb2268d12f66920) |
||
|
|
6083ac1e4c |
texture_placement_device: no block of the runtime's own pages under the exact form's policy
Under HostPageTexturePolicy::Shadow (DevicePolicy::exact_answers) no in-place check runs, so its verdicts stay pending and in_place.rs's blocks_take never takes the blocks of the runtime's own pages: a Shared buffer lies in the device's own memory and its texture is the device's linear image, as before such blocks, whatever the submission checks found. The test now holds that on its exact-policy device: the buffer in no page block, the placement NotHostPages as made, and no page block made. Verification: lavapipe (which takes such blocks under the default policy) in the job that follows. (cherry picked from commit 73a667fc42878e629ac3c6641882738cb236a302) |
||
|
|
f168b9b645 |
RuntimeGap::MadeBeforeRecovery: what a recovery carries, as it carries it now
The variant's docs listed the events, the Private buffers and the buffers in fresh pages as all a recovery carries, and every no-copy buffer and pooled Shared or Managed buffer among what it does not. A recovery also carries the uses of guest RAM and the no-copy buffers (made again over the same pages; a detached one stays refused), and, where the device takes them, the pooled buffers in blocks of the runtime's own pages. The docs now say so, as the runtime README's recovery section does. docs/REFUSALS.md regenerated: its row reads the variant's first sentence, unchanged. (cherry picked from commit 5db8726121b2ff46f89b793adb3a5f354d505758) |
||
|
|
513d792675 |
REFUSALS: MadeBeforeRecovery's pooled buffers are those in memory the device allocated
A recovery now carries a pooled Shared or Managed buffer that lies in a block of the runtime's own pages, so the reach note names the pooled buffers left refused as those in memory the device allocated. docs/REFUSALS.md regenerated (scripts/refusal-surface/refusal_surface.py); no refusal changed. (cherry picked from commit b11909130479dbdb8c42c8d6c3950ffa1d9414ed) |
||
|
|
669e2247c7 |
padding_unobserved: an undeclared buffer's page block may refuse the image at the pitch
On the M3 (MoltenVK) the first pitch's undeclared Shared buffer lay in a plain block, made before the device's submission checks answered, and the next pitch's in a block of the runtime's own pages, whose texture's placement the test held to InPlace, Unchecked or CheckFailed. A texture over such pages takes the host route, where the making's own steps may refuse the image at the pitch (TextureShadowReason::Refused); over a plain block an undeclared buffer's texture is the BytesBetweenRows shadow, so a shadow either way. The test now settles the submission checks before it makes the buffers, so every pitch's undeclared buffer lies where the device's buffers lie once they answered, accepts the making's refusal there, and prints each pitch's undeclared answer, not a constant. Verification: the M3's runtime suite follows on this commit. (cherry picked from commit e1713ded5148bda7d727d37a8cbb08eb4b8d0bb8) |
||
|
|
2ea44c4884 |
keep_room: its comment on the page pools within the line width
The comment the rebase onto the in-place keep_room wrote ran a character past the 100 the tree wraps at. Comment only. (cherry picked from commit 1419bdca90bbc498737193596f5e509e4c4c3eca) |
||
|
|
96297c3588 |
Runtime README: the recovery's refused objects listed in one sentence again
The 1c change put the cases of pooled buffers in device memory between semicolons, which ran into the list of the other refused objects. The cases go in parentheses, the list reads as before, and the paragraph above is rewrapped. Docs only. (cherry picked from commit 05c67001faf3253b6b184dae243bd50d94ca9fad) |
||
|
|
a8515c0c9a |
device_recovery_carry: two pooled buffers of one block carried in one import of its pages
The carry of a pooled `Shared` buffer in a block of the runtime's own pages imports the block's pages again once and places each buffer of the block at its own offset there. The test carried one such buffer; it now carries two of one block and checks both keep their `contents` pointers and bytes, the host's writes after the recovery reach the GPU, both lie in one memory on the next generation, and both keep their offsets. Where the device takes no such blocks, both stay refused and the notice counts two. The module docs said every pooled `Shared` buffer stays refused; they now name the ones carried. Verification: lavapipe runtime suite and the GPU runs follow on the merged tip. (cherry picked from commit 47f69293ada8be3f314e1fd404fc28a29d9de47d) |
||
|
|
73545f6afc |
Page blocks only where the fresh pages' verdicts give textures what plain blocks do
A texture over a buffer in a block of the runtime's own pages takes the route over fresh pages: its image is made for host allocations and starts UNDEFINED, so it lies in place only where the in-place check's verdicts of fresh pages pass, where over a plain block's buffer the device's linear image starts PREINITIALIZED and needs none. So the program's buffers now lie in such blocks only where those verdicts give every access and row ends a texture over a plain block's buffer takes in place (by the pooled class's verdicts) the same, as the blocks allocated exportable already do: fd_blocks_take is now blocks_take of a pages class (FdBlocks or Fresh), its enum BlocksTake, and Device::page_blocks_taken asks it for Fresh, starting no check. Pending verdicts leave the buffers in plain blocks. The memory lock is no longer held while the verdicts are read as a buffer is made. Docs: memory.rs's module docs, device/carry.rs, the runtime README, docs/API.md and the recovery notice's cost name the condition. Verification: the suite follows. (cherry picked from commit 8c50d54d9871bce0e80865ac4916e7da0c192a8a) |
||
|
|
bda5799682 |
padding_unobserved: the undeclared buffer in a page block goes on to the declared one
The test's branch for an undeclared buffer in a block of the runtime's own pages ended its pitch's round, so no declared buffer took an aliasing image and the test failed at its last assertion (job 11947). It now asserts that branch and goes on, as the other does. Verification: the suite follows. (cherry picked from commit fcd5dc709d45961631cd0f7bdbfd09db14e46e62) |
||
|
|
4fdeddae01 |
Page blocks: the tests that meet them, the recovery notice's cost, the placement docs
On lavapipe the page blocks are taken (job 11936: seven tests failed, each on a premise they change): - blocks_ahead: the pools of page blocks join the kept pools once the submission check answers, their first block made in place then; the test settles that check before its first creation. - device_recovery: a Shared buffer a call made on the generation lost under it is carried by its maker where it lies in a page block; refused as before elsewhere. - device_recovery_carry: the pooled Shared buffer is carried (contents pointer and bytes kept, a host write after read by the GPU) where it lies in a page block; a texture, which no recovery carries, holds the lost VkDevice instead. The notice's counts follow. - exported_textures, padding_unobserved, texture_placement_device: a Shared buffer in a page block binds images for host allocations and takes the route over fresh pages (in place where the check passed, else a shadow it decided). - degradation_catalogue: DeviceRecovered's cost names the buffers in the runtime's own pages, as docs/API.md does. TexturePlacement's docs name the pages the runtime imports among host pages. Verification: the suite follows. (cherry picked from commit b7279d58a05a396815f3d34293ff1c6fc4b30253) |
||
|
|
4206b724d1 |
Page blocks: kept() asks the page buffers' address types before it borrows the families
The commit before this one says so, but its edit did not apply: kept() still asked address_types for Holds::PageBuffers while a Sharing borrowed the families, which the borrow checker refuses (job 11930). The query now runs before that borrow. Verification: the build follows. (cherry picked from commit 823871a55b52d3ed55101931220f129709178bff) |
||
|
|
3d0ece2f7a |
Page blocks: kept() asks the page buffers' address types before it borrows the families; docs
kept() asked address_types for Holds::PageBuffers while a Sharing borrowed the families, which the borrow checker refused (job 11930). The query now runs before that borrow. Docs: memory.rs's module docs get "Buffers in the runtime's own pages"; device/carry.rs, Buffer::carry, the runtime README and docs/API.md's recovery cost say a recovery carries the Shared and Managed (unified memory) buffers in blocks of the runtime's own pages, and leaves those in memory the device allocated. Verification: the build follows. (cherry picked from commit e5df53c305b27909f4cca460a4910c12861d20aa) |
||
|
|
72f37612a4 |
The program's host-visible buffers lie in blocks of the runtime's own pages, which a recovery carries
On a device whose submission check found that a held host-pointer import costs its submissions nothing, the Shared, write-combined and Managed (unified memory) buffers placed_new_buffer makes now lie in blocks of a new kind, Holds::PageBuffers: anonymous pages the runtime maps (OwnPages) and imports by their pointer, the block's host address theirs. Each such buffer is made for host allocations (VUID-vkBindBufferMemory-memory-02985), and so is a block's buffer of addresses. The memory types are those the driver imports such pages as (vkGetMemoryHostPointerPropertiesEXT, asked once as the device is made) that are host-visible; a class takes the blocks where its best type for such a buffer is among them. Where the system or the driver refuses the pages, the block is made as any block of buffers. Until the check answers, and where it found a tax, the buffers lie where they did. A recovery now carries such a buffer instead of leaving it on the lost generation (Left::Pooled): the pages of its block are imported again on the next generation, once for every buffer carried from that block, into a block that takes no other placement and goes once those buffers do; the buffer is bound at its offset there, its contents pointer and bytes as they were. A texture over such a buffer takes the route a texture over fresh pages takes (PagesClass::Fresh): its image is bound in imported memory, so it is made for host allocations and starts UNDEFINED (VUID-VkImageCreateInfo-pNext-01443). WorkCounts::page_buffer_blocks_made and page_buffer_blocks_plain count the blocks. Verification: none yet; build and tests follow. (cherry picked from commit eac07b1f9a7b405ce2d486e5d8c080e79bfe267b) |
||
|
|
7b5490de37 |
RUNTIME_VERSION 1979 and the runtime-sources pin for import-tax tries that all split
4acfbee03b changes the runtime's submission checks: where every import-tax try splits and the last try's floors fall short of the tax's bound TAX_MARGIN times over, the device answers Fails for its life (unrecorded) instead of Unchecked. On the M3 Max one device in six answered Unchecked under its neighbours' load (m3-max-12078) and so took no fresh pages or page blocks where the others did. Verified by the branch: tests::submit_check 9/9 with the new test; the new test fails (Unchecked) with the change taken out (um790, 12092 / 12104); clippy and rustdoc. Here: signatures --check, REFUSALS, coverage docs regenerated (no change), fmt. |
||
|
|
ca86565599 |
Import tax: tries that all split short of the margin answer Fails for the device's life
In three runs of the runtime's device tests on the M3 Max (m3-max-12078, MoltenVK 1.4.2), one of the six devices that printed their submission checks' verdicts had all three of its import tax tries split, under the load of the tests beside it, its last try's floors 2.5 against 1.2 us over all its phases; the other five answered Fails (1.1 to 2.6 against 1.2 to 3.0 us). That device answered Unchecked, so its long buffers took no fresh pages where the others' did: the same host and driver took one form or the other by the load around one process's check. Tries that all split now answer Fails for the device's life, unrecorded (the next device measures again), where the last try's floors over all its phases fall short of the import tax's bound TAX_MARGIN times over: the margin a Holds must pass to be recorded, and a cost no try told from the load beside it. Past the margin they stay Unchecked, unrecorded, as before; a merge's split tries are unchanged, and no record changes, so CHECK_VERSION stays. Verification: tests::submit_check, its new test of both sides of the margin and of the merge's tries, in the job that follows. (cherry picked from commit 4acfbee03bf4a01d902e1e362d60e6577174dcfb) |
||
|
|
6caad73bde |
RUNTIME_VERSION 1978 and the runtime-sources pin for exportable pools' blocks made ahead
5a862c6ab9 changes the runtime's memory: a pool of exportable buffers (Exports, DmaBufs) that grew gets its next block made ahead on the ready thread, and a creation call that places such a buffer takes it instead of making a 64 MiB block on the program's thread. A reported guest stall on a Radeon 780M with fragmented memory (inline makings 31-97 ms) was that path. Verified by the branch (RADV PHOENIX, gem10): release bench, slowest creation call 12.0-15.0 ms at the base vs 0.3 ms at most at the tip under fragmentation; blocks_ahead's new test 6 of 6 made ahead, 0 of 6 with development's memory.rs (780M 12111, lavapipe 12112); runtime lib under m2v_gpu 1997/1997 (12109). Here: signatures --check, REFUSALS, coverage docs regenerated (no change), fmt. |
||
|
|
9e663b770c |
Memory: the pools of exportable buffers get their growth blocks made ahead
A creation call that places an exportable buffer (new_exportable_buffer, an exportable buffer descriptor, the in-place check's buffers) in a pool with no room made the pool's 64 MiB block itself, on the program's thread. keep_room made blocks ahead (memory/ready.rs) only for the pools the runtime's encodings and commits place in and for the host copies' pool, so every growth block of Holds::Exports and Holds::DmaBufs was made in place. Now each pool of exportable buffers that grew within KEPT_EMPTY_FOR and lacks room for a whole block gets a block started ahead at each creation call's keep_room (Memory::exported_growing, ready_if_growing, the kept pools' tail of keep_room moved into it), made right after a burst of the device's submissions ended, as the kept pools' blocks are. makes_ahead covers those pools, so the placement that finds no room takes the block made ahead or waits for its making (place, take_ready) and counts a block it makes itself in buffer_blocks_made_in_place. keep_room makes no block for such a pool in place: its placements are the creation calls. The reclaim bench gains an arm of exportable buffers made by the runtime (24 of 32 MiB a phase, one every 400 ms) and prints blocks_ahead_waited_for. The citation of a consumer's wait is replaced by these measurements; FAST-PATHS's row on kept blocks says blocks are made ahead for pools that grew, the exportable ones among them. Verified, on a Radeon 780M (RADV PHOENIX, Mesa 26.2.6, gem10, MESA_VK_DEVICE_SELECT '1002:15bf!'): - reclaim_submit_bench_exportable in release under --cfg m2v_gpu, exclusive, two rounds each, the negative being memory.rs and memory/ready.rs as on development (job m3-max-12103): the creation calls that made blocks in place took 10.0 to 10.8 ms (quiet, round 1), 12.9 to 15.0 ms (fragmented: free memory in single pages, round 1) and 12.0 to 13.7 ms (fragmented, round 2; 0.3 ms at most in round 2's quiet phase). With the change no creation call took over 0.3 ms in any phase: 10 blocks made ahead and 2 in place (the pool's first two) in each quiet phase, 12 ahead and 0 in place in each fragmented one, 0 waited for. Turnarounds of 8 ms or more: 0 in every phase both ways (an exportable block holds no submission). - blocks_ahead's new test a_growing_pool_of_exportable_buffers_gets_its_new_blocks_made_ahead: 6 of the pool's last 6 blocks made ahead, 0 in place; with memory.rs as on development it fails, 0 of 6 made ahead (job m3-max-12111). - The whole runtime lib under --cfg m2v_gpu (debug): 1997 of 1997 passed (job m3-max-12109); clippy on the runtime crate, all targets and features, clean. And on lavapipe (llvmpipe, LLVM 23.1.4) under --cfg m2v_cpu_icd: blocks_ahead and clip_bursts pass (the later clips allocated nothing: [(0, 0), (0, 0)]; job m3-max-12110), clippy clean, and the new test fails, 0 of 6, with memory.rs as on development (job m3-max-12112). Not run: NVIDIA, MoltenVK. (cherry picked from commit 5a862c6ab9ebf0a6f2effeb8776aaac6de3bed16) |
||
|
|
5561cbf475 |
Creation check: the loader's warning that the host lists a layer twice
runtime_lane::creation_heard_checked demands that a device's making say only its own informational messages, after the loader's message about a layer it could not provide. A host that lists an instance layer twice (two manifests of one layer name) makes the Vulkan loader warn, at vkCreateInstance, "Removing layer <name> (<path>) because it is a duplicate of <name> (<path>)", with its id name "Loader Message"; the runtime forwards it (its creation messenger takes warnings and errors), and the check failed on it. The M3 lists the validation layer twice: Homebrew's manifest names its library by bare name, which dlopen does not find there, and a copy in ~/.local/share names it by absolute path. So a_creation_s_notices_and_messages_reach_the_sink_on_ the_asking_thread failed there on every run (20 of 20 alone at 47e072ccd3; the whole validation suite 3399 of 3400, this test the one failure). The lane's own sink fails on no warning of the general kind, so no other test saw it. The check now takes the loader's own messages at the head of creation's: its duplicate-layer warning (layer_claim's new loader_duplicate_layer_message: the loader's id name, the text starting "Removing layer " and holding " because it is a duplicate of "), and, where the device was made without a layer, its message about each, as before. The host's listing of its layers is not the device's, and nothing wider passes. Ran (gem10, lavapipe under --cfg m2v_cpu_icd, at the scratch twin of this commit): with a copy of the validation layer's manifest in a directory VK_ADD_LAYER_PATH names, so the loader lists it twice, the test failed at the base on the loader's warning (the M3's message, with lavapipe's name and the two paths) and passed with the change; with the host's own listing it passed both ways. The matcher's unit test passed; clippy on the validation crate, plain and under m2v_cpu_icd, clean. (cherry picked from commit 7b2005eb914a62421d2e2206837017acaa640367) |
||
|
|
13a5136520 |
Re-bless the cost records at bc7a657890
452 recordings moved, measured on the M3 Max (MoltenVK 1.4.2): cost --runs 8 --write over the whole set, then cost --runs 8 --alone --write over the changed cases (gate tree commit be02f2e6c2, jobs m3-max-12055). Why: pin 29's replay at |
||
|
|
7aec1f5047 |
Re-bless the authored compile census at 880a1f0c08
Its product fingerprint follows development's versions at
|
||
|
|
880a1f0c08 |
queue_quiet: the burst's end read before it ends, on the wait's own clock
a_wait_ends_once_a_burst_that_began_after_it_ended failed on lavapipe's suite under a loaded gem10 (m3-max-12030): the wait returned before the burst's end plus SETTLE, as the test reads it. The test read that end with Instant::now() after QueueQuiet::ended had stored it, so a pause of the burst's thread between the two of more than SETTLE (1 ms) put the end it read past the one the wait saw; and it compared Instant (CLOCK_MONOTONIC) against the wait's host clock (CLOCK_MONOTONIC_RAW on Linux, CLOCK_UPTIME_RAW on macOS). The thread now reads the host's clock (gpu_time::host_nanos, the clock ended() stores) before ended(), and the waiter reads it as the wait returns: the end the wait saw is at or after the one read, so the wait's return is at least SETTLE past it whatever the pauses. The wait itself is unchanged. Verification: the test with a 3 ms pause between ended() and the timestamp fails at the old form and passes at this one, in the job that follows. (cherry picked from commit 3c6c921005c470f727804c7b05ee8a1209832b26) |
||
|
|
e0a6edd099 |
SEMANTICS_VERSION 2006 for sample cells proven apart in a row
nvreds 2f61bceb95 (lockstep/facts.rs): the lockstep analysis could not prove
out[(y*w + x)*n + s] over s < n apart between threads of one row (a counter
needed a constant bound, the sample count had no range, the compiler's
select(y < h, n != 0, false) guard was not split, y*w was not known fixed in
a row), so it kept a barrier and Cluster32 with a multiple of 64, and a
32-thread dispatch on wave64 took the emulated variant and announced
EmulatedSimdgroups. Counters may test a bound computed before the loop,
NumSamples has 0..=64, edge facts split conjunctions, 'fixed' covers uniform
values, size queries and a row's y/z (6 deep). A one-row threadgroup now
records RowLockstep and runs the plain pipeline; multi-row groups keep the
barrier. Kernels with such cells or guards change: SEMANTICS 2005 -> 2006.
Verified by nvreds (msi, same tree over
|
||
|
|
50959b2a8e |
Prove a texel's sample cells apart in a row: a counter below a sample count that scales the row
What: the lockstep analysis took the store of out[(y * w + x) * n + s] over s < n
(wsm_samples's kernels, n = t.get_num_samples()) as a conflict between two threads of a
simdgroup, in the same iteration and across iterations, even where each simdgroup lies within one
row of its threadgroup. The barrier it kept put the kernel on a flattened tier, and on a wave64
device (Cluster32, a multiple of 64 threads) a 32-thread dispatch ran on the emulated-simdgroups
variant and announced EmulatedSimdgroups. The analysis now proves the address apart from the
IR's structure:
- a loop counter may test its next value against a bound computed before the loop (one value
while it runs), not only a constant; the bound's range stands for it in the counter's numeric
facts, and where the start is below the bound (by the ranges, or as a branch before the loop
tested it: `n != 0`, `k < n`, `start < n`) and the branch lets a next value through only below
it (or, stepping by one, unequal to it), every value of the counter is below it
(Counter::below);
- a multisampled texture's sample count is at most 64, Vulkan's largest sample count (range);
- the comparisons a branch dominating a block held include each part of a conjunction on the
edge taken (`select c, d, false` or `and` taken, `select c, true, d` or `or` not taken), as the
Metal compiler spells `y < h && n != 0` (edge_facts, which guards now reads too);
- a value is one value in every thread of a simdgroup (fixed) where it is uniform, a texture's
size query of such operands (it reads only the texture and the level), or, where each
simdgroup lies within one row, a y or z component of a position; integer operations and casts
of such values too, at most 6 operations deep. An addition with one such operand differs
between threads as the other does (it took only uniform operands before), so y * w + x
differs as x does in a row;
- a cell s + p * n, s a counter below n, n fixed and bounded by N, and p differing between
threads by 1 to S, differs between threads by 1 to S * N + N - 1 (by at least 1 wherever the
p's differ, at whatever iterations, since |s1 - s2| < n), or not at all where p may not
differ; across iterations it is settled where p * n is (core_home: the cell's home is p * n's).
In a multi-row threadgroup two threads of a simdgroup may share a pixel (a grid deeper than one),
so the barrier, the Cluster32 tier and the multiple of 64 stay; the kernel now records
RowLockstep, and a one-row threadgroup of any width runs on its one compiled pipeline.
Tests: engine_simd_emulated's
a_texel_s_samples_in_a_row_need_no_emulated_simdgroups_on_wave64, on the RDNA3 description
narrowed to wave64: wsm_samples's wsm_read_f and wsm_read_u, and the same IR with the guard as an
`and`, keep Cluster32 and LocalSizeConstraint { multiple: 64 }, record RowLockstep, and plan 1,
16, 32 and 48 threads on the plain variant (VariantKey::new()), two rows of 16 on the emulated
one. Negative controls, each one change from that IR and each a real collision, record no
RowLockstep and keep every partial threadgroup on the emulated variant: the row scaled by the
width rather than by n, the latch testing the counter rather than the next value (the body runs
at s == n, the next pixel's first cell), and the loop entered without the n != 0 test (at n == 0
every pixel writes cell 0).
Ran on msi-laptop (Linux, llvm-as 23.1.1) at this change over
|
||
|
|
47e072ccd3 |
RUNTIME_VERSION 1977 and the runtime-sources pin for texture makings that allocate no scratch lists
exitcrash c118e602a6 + 5cd3797b49: keep_room read the kept pools by splitting them into two Vecs on every creation call ( |
||
|
|
83691b5ce4 |
A tiled heap texture's making reads its copy units without collecting them
host_ab's percall gate on the M3 held heap_texture_256 to 17.25 allocations a call and measured 19.25 once keep_room's two were gone. A trace of the counted window on lavapipe (base |
||
|
|
e33fb4f5ab |
keep_room reads the kept pools in place: no allocation per creation call
|
||
|
|
451549179b |
RUNTIME_VERSION 1976 and the runtime-sources pin for MoltenVK's pass-start reads taking the cleared copy
nvreds 25063af705: since |
||
|
|
2ef8af3abe |
A pass-start read takes the copy cleared by MoltenVK's clear command, which is Metal's clear
What: on MoltenVK (DriverFact::ColorClearIsMetals) a draw that samples a colour its pass clears, after a memory barrier at the pass's start, split the pass again (attachment_read_splits, a second render pass instance, the render-pass-split notice) instead of reading a copy of the attachment cleared to the clear before the pass (attachment_read_clears). Texture::cleared_copy refused a clear whose device-color-conversion note the load operation withholds (ColorTarget::withheld_clear), because the copy is cleared by vkCmdClearColorImage and only the load operation was measured to store Metal's texel there. Since |
||
|
|
6d7f59365a |
RUNTIME_VERSION 1975 and the runtime-sources pin for a depth cleared ahead where RADV on the RX 550 clears at the standard positions
nvreds c7061858f8: on RADV POLARIS12 (Mesa 26.2.6) a pass at custom sample
positions whose load op clears its depth stores and tests every sample's
depth at the standard position of its index for every draw (16/16 samples,
Depth32Float, Depth16Unorm, Depth32Float_Stencil8), while a pass that loads
the depth takes the custom positions. New DriverFact
ClearedDepthAtStandardPositions (one row, RADV 0x1002:0x699f): ReachClears
clears that depth before the pass in its own render pass
(vkCmdClearAttachments) and the pass loads it; no notice, the answer is
Metal's. Runtime behaviour changed: RUNTIME_VERSION 1974 -> 1975, pin
recomputed. A DriverFact enters no translation fingerprint, so SEMANTICS
stays.
Verified by nvreds: runtime_lane::sample_positions RX 550 9/9 (validation
layer silent, 'cleared ahead true (1 attachment clears)'), 780M 9/9
('cleared ahead false'), base
|
||
|
|
3314bd71b9 |
Clear a depth at custom sample positions before its pass where RADV on the RX 550 clears it at the standard ones
What: DriverFact::ClearedDepthAtStandardPositions (appended), one row: RADV on the Radeon RX 550 (0x1002:0x699f). On a driver with it, a pass at custom sample positions whose depth Metal clears has that depth cleared before the pass by ReachClears (a render pass of the attachment alone, vkCmdClearAttachments), wherever the clear reaches, over the render area alone where the pass does not store it, a memoryless depth too, and the pass then loads it (load_in_pass). Nothing is announced: the answer is Metal's. clear_reach.rs and sample_positions.rs (runtime) document the route; driver_facts.rs documents the fact and its measurement. Why: runtime_lane::sample_positions failed on the RX 550 (RADV POLARIS12, Mesa 26.2.6) in four tests (depth_takes_the_custom_positions, custom_sample_depth_store_stores_as_store, later_passes_keep_the_stored_samples, a_callers_image_takes_the_positions_through_a_stand_in): plane X drawn at four custom positions stored each sample's depth at the standard position of its index (stored 0.421875, 0.484375, 0.390625, 0.453125 where Metal stores 0.390625, 0.4140625, 0.453125, 0.484375). Probes through the lane's harness on the RX 550: - Depth32Float, Depth16Unorm and Depth32Float_Stencil8 4x, cleared by the pass: 16 of 16 samples at the standard positions, 0 at Metal's; a second draw in the pass, and a DontCare load the runtime clears, the same. - the pass's own test under Less against a clear of 0.4375 drew samples 0 and 2 of each first-column pixel (the standard positions'), where Metal draws 0 and 1; - a pass at four other positions that loaded such a depth drew and stored at its own positions; - a depth cleared by a pass without a draw, then loaded and drawn at the custom positions: 16 of 16 at Metal's. Coverage was at the custom positions throughout (the lane's coverage and stencil tests passed). So the driver evaluates the depth at the standard positions in a pass whose load operation clears it, and at the pass's positions in one that loads it. The route reaches that by documented Vulkan alone (a clear in a pass of its own, then LOAD), selected by a measured fact like PositionedDepthReadAtStandardPositions's stand-in for NVIDIA. RADV on the Radeon 780M keeps the custom positions' depths and takes no row. Tests: driver_facts' a_radv_gpu_no_row_names_takes_radv_s_driver_wide_fact_alone gives the RX 550's identity the fact and RADV's driver-wide one alone; the lane's depth_takes_the_custom_positions holds the route to the fact: where the device has it, its custom-position pass records an attachment clear (WorkCounts::attachment_clears_recorded), and it prints whether it cleared ahead. api_signatures.tsv gains the two variant rows. Ran (um790, at a tree identical to this commit on |
||
|
|
be59d46240 |
word_samples_msaa: read the samples in a threadgroup of whole subgroups on every device
What: the sample reads (wsm_read_f, wsm_read_u) are dispatched in one threadgroup of 128
threads (GROUP), whole simdgroups and whole subgroups of every size a kernel's simdgroups run
on (32, or 64 or 128 for wider subgroups split into simdgroups), instead of the row rounded up
to thread_execution_width (32).
Why: on the RX 550 (RADV POLARIS12, 64-wide subgroups) the lane failed with "announced past
[...]: [EmulatedSimdgroups]": "a dispatch of kernel `wsm_read_u`: its threadgroups of [32, 1, 1]
threads are not whole subgroups of the size the kernel's simdgroups run on". The kernels have
no simdgroup operation or barrier in their source, but their translations carry one
OpControlBarrier and LocalSizeConstraint { multiple: 64 } there (printed by a probe): the
lockstep pass orders each thread's stores in its loop over the samples, whose index the
analysis does not prove apart between threads, so a 32-thread group is a partial subgroup and
runs on the emulated-simdgroups variant, announced. The lane's comment already meant to avoid
that route; whole simdgroups are not whole subgroups on a 64-wide device.
Ran on the RX 550 (um790, MESA_VK_DEVICE_SELECT=1002:699f!) at this change on
|
||
|
|
ce1fca855a |
uniform_varyings: a half denormal may read as the zero the device's noted rounding answers
What: the flat read's compared words must be Metal's, but now a `half` denormal (Metal's word is
the denormal itself) may read as a zero where a stage of the pipeline records the device's own
`half` rounding: of either sign under PrecisionNote::NativeHalfQuantize (the device's
OpQuantizeToF16, which the SPIR-V specification lets answer a zero below the smallest normal
`half`), of the denormal's sign under NativeHalfConversion. Those words are counted apart
(`device-rounded denormals` in FLT-LANE, "the device's" in FLT-LANE-WORD), not as differences.
Why: on the RX 550 (RADV POLARIS12, no shaderFloat16) the lane failed with 24 differing
constants: the three `half` denormal constants 2 (0x0001), 3 (0x83ff) and 21 (0x0200) read
0x0000 in hp and hn at every qualifier and sample count (3,672 words each at 1x), where Metal
keeps them. The flat read rounds each `half` lane after Metal's word for it by the device's
quantize and narrows it to its bits by PackHalf2x16 for the store, and both the quantize and
the conversion notes are recorded there; the device's answer is within the quantize note's
bound (rule 1: the device's native rounding, recorded). Every other word stayed Metal's.
Ran on the RX 550 (um790, MESA_VK_DEVICE_SELECT=1002:699f!) at this change on
|
||
|
|
3d5ed3b021 |
read_through_views: a view's mipmaps are the device's box filter of each level above, not one format's ties
mipmaps_through_a_view_are_the_formats held the levels generate_mipmaps writes through an A8Unorm view of an R8Unorm atlas equal to a plain A8Unorm texture's. On the RX 550 (RADV POLARIS12) the first level through the view read [9, 11, 13, ...] where the plain texture's read [8, 10, 12, ...] (potluck 11625 and 11635): each texel the average of four codes on a tie, which the device's blit (device-filtered-mipmaps) rounds up into R8_UNORM and down into A8_UNORM. Vulkan's conversion to a normalized code takes either of the two codes nearest the value. Both chains are now held, level by level, to the box filter of the level above as the device wrote it: the average where it is a code, else one of the two codes around it. The texels where the two chains differ are counted and printed. (cherry picked from commit 3dbee7cf7fe3128d8c436dc548a5d265f093d883) |
||
|
|
785edff162 |
alpha_in_red: an A8 edge texel's resolve may round its tie a code from R8Unorm's where the device rounds
a8_resolves_as_r8_unorm held A8Unorm's 4-sample resolve equal to R8Unorm's at every texel. On the RX 550 (RADV POLARIS12, its own A8_UNORM) every edge texel, whose samples average 114.5, resolved to 114 in A8Unorm and 115 in R8Unorm (potluck 11625 and 11635), every other texel the same. Where the device rounds the average (resolve_kind: device-rounded-resolve, whose bound is one code of Metal's for an 8-bit unorm channel), Vulkan leaves the tie to it, per format; an edge texel may then lie a code apart, counted and printed. Elsewhere, and where the device's average is measured to be Metal's, every texel must match as before. (cherry picked from commit f76c49e82499e02d85e68cdbce20ebdd6a9ffaf1) |