6fa25ee1c8f81dc5ad5996255fc99bc2a0647fa8
913
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
8ed67dfa17 |
Regenerate REFUSALS.md and CONFORMANCE-COVERAGE.md for the padded fetch and its cases
python3 scripts/refusal-surface/refusal_surface.py (the padded fetch's FramebufferFetch site gone) and python3 -I scripts/conformance-coverage/coverage.py (the padded-fetch cases); METAL-COVERAGE.md is current (coverage.py --check). (cherry picked from commit 0c8ad6c47d76ff7436835fa5377ff17700151c21) (cherry picked from commit f448ad63ca5d317526e923c2363c3f05a44a0068) (cherry picked from commit 4037ac989aa2942bdde46538b8b9856a9bfd3d78) |
||
|
|
af1dd85b66 |
Blend-source notes state their bound and the device compiler's regrouping; padded rows on the 5080 and the Iris Xe
ExtendedRangeBlendSource and ExtendedRangeFloatBlendSource (their docs, the API catalogue entries and the FAST-PATHS device-gap row) now say what the suite measured: the device's compiler may contract and regroup the in-shader blend (MoltenVK on the M3 Max and NVIDIA's driver on the RTX 5080 compute S·F + D·(1 - F) as D + F·(S - D)); a stored channel lands within two codes of Metal's on a linear format and within six near zero on an sRGB twin; and where the compiler regroups a padded format's blend, an infinite second source stores an end code where Metal's sum is NaN, stored as 0. The FAST-PATHS row names the padded formats, which it lacked, and no longer says 'not measured'. known-gaps.tsv: the 168 extended-range rows (xr-blend, xr-gamut, xr-gradient, xr-masked) whose Open item was the blend notes' documentation are closed (Open: nothing, the recorded bound covering the difference); every one is within the bound (survey of the rows' largest differences). The padded-blend rows are regenerated for five venues: the M3 Max, RADV PHOENIX and llvmpipe as before, and the RTX 5080 (b5080 entry xrblend2-padded-replay-5080) and the Iris Xe (job m3-max-13386), 17 each. The 5080's second-source cases differ by the whole code range as the M3's do, and its counts are exactly a model of D + a·(S - D) over an unnarrowed float destination (971 on R10Unorm_X6, 1850 on RG10Unorm_X12); the Iris's are exactly the sum as written over the half destination (844, 1607), as RADV's; llvmpipe's the sum as written over a float destination (962, 1831). No venue's largest difference exceeds the M3's, the 780M's or llvmpipe's. engine_padded_blends: a fetch of a padded attachment makes the whole pipeline on every committed profile that orders fetch (storage form or input attachment) and names the device gap elsewhere; a bfloat fetch stays NotImplemented(Format), the negative control. Not yet run. (cherry picked from commit c923b6d49c36c8354f375f6dababfd5f81f1ffbc) (cherry picked from commit e3a2b226d7f5938811d1d251172088baf05c15cb) (cherry picked from commit 85a2473cc6ea6a2c9165e2614d1e87ca77c1627e) |
||
|
|
962aa365dd |
FAST-PATHS: the fill decision's evidence on um870 and gem10
The fill row gains the decision's measurements: the images arm of tests::reclaim_submit_bench, two runs each of the base (every block filled), the decision (cf5561bb5d) and the arm with no fill, interleaved, the TTM page pools emptied through the shrinker's debugfs before each arm and before its pressed phase. um870 (RADV, Mesa 26.2.6, Linux 7.3.1-1-cachyos), pressed, base / decision / no fill: turnarounds of 8 ms or more 19 and 4 / 5 and 11 / 11 and 17, of 17 ms or more 1 and 1 / 1 and 2 / 8 and 9; the ready thread's makings 419 and 461 / 379 and 343 / 494 and 292 ms, in compaction 269 and 299 / 215 and 203 / 374 and 179 ms; block-sized buffer objects 2.0 / 2.0 and 1.5 / 1.0 a making. Quiet: the decision filled every block (1 miss alone in 26) with no turnaround of 8 ms or more; no fill had 12 a run. gem10 (quiet in both phases): the decision made no block plain, no turnaround of 8 ms or more. Also: the misses' free times (17 of 18 quiet misses freed in 0.06 to 0.20 ms, the pages left to the kernel's deferred delete; 44 of 47 pressed ones in 2.7 ms or more), the fill's CPU shares (91 to 99% and 85 to 100%), the page-table buffer objects a fill's mapping adds, and the block_fills misses as now measured (0 or 1 of 5). (cherry picked from commit 58bff1328f25ca7f96f4c82bab23d46ff5a40b1b) |
||
|
|
15c596f09a |
Memory: a device stops its fills once 3 of its last 4 missed
On gem10's 780M, quiet (12 GiB of free memory left beside the bench), a tip of 2 of the last 4 stopped once: two fills in a row whose frees returned in 0.14 and 0.17 ms, the pages left to the kernel's deferred delete, each block then filling its own (8.0 and 10.9 ms); the 2 plain makings that followed held the submissions 10.0 ms. Of the misses the benches' quiet phases saw on um870 and gem10, 14 of 15 had such a fast free; of those under um870's pressed phase, 30 of 33 freed in 2.7 ms or more, in runs of up to 6. Replayed over the always-filling base's phases, stopping at 3 of the last 4 fills 6 to 8 of 12 under um870's pressure (2 of 4: 5 to 7) and none on a quiet host. Verified so far: the CPU test is rewritten for the threshold; its run and the device evidence follow. (cherry picked from commit cf5561bb5d95b659debfeeedc3454188cda701b3) |
||
|
|
09e4afdba6 |
Memory: a device stops its fills once 2 of its last 4 missed, not after a lone miss
On um870's 780M (pools emptied before each arm and again before its pressed phase), a quiet phase's fills missed alone: 1 of 13 and 1 of 5 in the always-filling base, each the fill's free returning in 0.06 to 0.15 ms where a free that hands its pages to the kernel's pool takes 2.7 to 3.5 ms, so that the block's allocation ran before the pages were back. Backing off after each such miss (837c461b2b) made the next 2 makings plain on the quiet host, each holding the submissions 9.0 to 9.6 ms: 3 turnarounds of 8 ms or more in a quiet phase where the base had none. Now a device keeps the outcomes of its last 4 fills (FILL_RECENT) and stops filling once 2 of them missed (FILL_STOP_MISSES); the backoff after that is as before (2, doubling with each missed probe up to 32), and a probe that saves clears the record. Misses under pressure come together (the same base, pressed: 8 of 12 and 3 of 12, runs of up to 5). Verified so far: the rule's CPU test is rewritten for it (tests::memory::fills_stop_once_two_of_the_last_four_miss_and_a_saved_probe_brings_them_back); its run and the device evidence follow. (cherry picked from commit bc3338dee50f9627b799cf68c747bef1b36a4672) |
||
|
|
261af18a27 |
Memory: after a fill misses, a device makes its next plain blocks plain, probing with backoff
The fill rule of 6da2c8c1dc kept a device filling while each fill spared its block's allocation half its time, so on a host short of free memory it kept making a second block-sized allocation for each block, the kernel compacting and reclaiming for both: the consumer's scroll on um870's 780M (pin 33) waited longer on host compaction than pin 30 did, with no fill. Now a fill that missed (its block's own allocation took 1 ms or more, FILL_SAVED_BELOW, as WorkCounts::plain_block_fills_missed counts) leaves the next 2 makings plain, then fills one, a probe; each further miss in a row doubles the plain makings between probes, up to 32; a probe that saves brings filling back for every making (Fills, FILL_BACKOFF_FIRST, FILL_BACKOFF_MOST). The module docs, the skipped count's docs and the ledger row say the rule. Verified so far: tests::memory::fills_back_off_after_a_miss_and_a_saved_probe_brings_them_back is the rule's CPU test (not yet run: the build is next). Device evidence follows in a later commit. (cherry picked from commit 837c461b2b1aa716622237afc48870307282dbf8) |
||
|
|
e5fffbf611 |
Known gaps: the padded-blend cases on lavapipe
Seventeen rows for the 256-bit llvmpipe venue, the counts its replay printed at 31d3ac25a2 (job m3-max-13288). lavapipe computes the second-source blend as written with a product fused into the sum (native-fma), so an infinite second source's NaN stores code 0 as Metal's does and no linear element is more than two codes from Metal's. CONFORMANCE-COVERAGE.md regenerated for the ledger's row count. (cherry picked from commit 37237c7c805a19a814c809d13a1b2c196fd148b2) |
||
|
|
54e0d91b2c |
Known gaps: the padded-blend cases on the M3 Max and RADV PHOENIX
Seventeen rows per venue, the counts the replays printed at 31d3ac25a2 (M3 under MoltenVK, job m3-max-13278; the 780M under RADV, job m3-max-13289). Each blend runs in the shader in the device's arithmetic, unclamped, and lands a code or two from Metal's on a linear format, up to six near zero on an sRGB twin. The second-source blends differ by venue: the M3's compiler computes S·a + D·(1 - a) as D + a·(S - D), so an infinite second source stores an end code where Metal's IEEE sum is NaN, stored as 0; RADV computes the sum as written and stores 0. A model of each form reproduces the replay's count exactly on R10Unorm_X6 and RG10Unorm_X12. CONFORMANCE-COVERAGE.md regenerated (the new case module, its recordings and rows). (cherry picked from commit e117b085632700b586e56d043b91b16b2365a524) |
||
|
|
880b03cb2b |
Blend into a padded attachment over unclamped operands; padded tiles announced
Measured on the M3 Max under macOS 27.0.1 (probes/padded_and_bfloat_blends.m, targets without Metal's optimized layout, whose blits moved every texel): - Metal clamps nothing before a blend into a padded attachment (R10Unorm_X6, RG10Unorm_X12, their sRGB twins, RGB10A2Unorm_sRGB): sources, second sources and blend colors past both ends of [0, 1], alpha among them, blend as they are. With the operands unclamped, the stored codes of 18 blend states under fast and safe math, half and float outputs, match the f32 model within one code for the linear forms (16-bit safe-math half outputs exactly in half arithmetic), apart from NaN and infinity results; clamped to [0, 1], up to 1023 codes off in 30-50% of channels. - A padded attachment's tile holds half through the pass: a premultiplied blend of (0, 0, 0, 0.5) over a clear of 0.33371 stored code 171 (the half's), not 170 (code 341's), and over an unblended draw of values in [-0.5, 1.5] it matched the unclamped half in every channel (65,536 texels of R10Unorm_X6, 131,072 channels of RG10Unorm_X12). So blend::extended_ranges is None for a padded form (native() clamps nothing), source_range drops its padded arm, and the model test clamps no padded lane: every_blend_is_the_devices_arithmetic's random sources past the range fail it with the clamp. The runtime's extended-range-blends-stored-codes now covers padded colors (render.rs extended_colors), and ExtendedRange::clear_read_back answers a padded form's clear by its codes' values (c / 1023, the sRGB twins' transfer, RG10Unorm_X12_sRGB linear), so a blend over a clear between two codes is announced as for the extended-range forms. Docs: the blend-source notes, the stored-codes kind and its catalogue entry, ExtendedRangeColor. (cherry picked from commit 5750641750642bdb7800da8e9618f98919d2cc9f) |
||
|
|
17cf2bf636 |
Bfloat blend refusal: tests, docs, refusal surface; SEMANTICS 2012
The translator test of bfloat targets expects Metal's pipeline error for a blended bfloat attachment, in the translation and at link with no fragment function, with the unblended unwritten pipeline as its negative control. A new engine test (engine_padded_blends) checks the same on every committed profile through compile_render_pipeline, under a full mask and a mask of no channel, and without a fragment function, with the unblended pipeline made as its control. Docs: stage_io::extended_color, input_blend, ExtendedRangeColor::blended (any blend now, not factors one and zero), DescriptorError::ColorAttachment (a blended bfloat attachment). docs/REFUSALS.md regenerated. SEMANTICS_VERSION 2012 (a refusal's class changed, padded blends translate). A clippy literal in extended_range's tests grouped. (cherry picked from commit 8ef001f0a0eeed4c1b51a31df2ae093285dfbe9c) |
||
|
|
848c072b8f |
CONFORMANCE-COVERAGE.md with read_through's ledger rows
Regenerated by scripts/conformance-coverage/coverage.py after the 96 llvmpipe rows and the three read_through gap rows: 3410 ledger rows. Verified: the conformance suite on msi (job m3-max-13292) failed only the_conformance_coverage_document_is_what_the_sources_derive before this. (cherry picked from commit 3514ac3e7a91a8245325939db06bbec5e950a63a) |
||
|
|
0fcb724d2c |
CONFORMANCE-COVERAGE.md with the read_through family
Regenerated by scripts/conformance-coverage/coverage.py: 13 more recordings, 162 case modules, three ledger rows, and read_through among the families that compare MTLSamplerState and the texture and buffer items it calls. Verified: coverage.py --check reported the doc stale before and is the generator's output now. (cherry picked from commit b2b166a2d4b03ed957824bc8290b214d4c78c66b) |
||
|
|
34310d93f7 |
Reads through a sampler: a texture buffer's border by its t axis, the ledger rows
The read_through conformance family's per-axis states, recorded on the M3 Max, show a texture buffer's index past its end addressed as the first texel of a row past its one row: the border texel where t's mode is a border mode, else texel 0, whatever s and r are; a runtime sampler whose s mode is clamp_to_edge clamps it first (s-border reads texel 0, st-border the border, tr-border clamps). The read took s's mode, which read the border for s-border, sr-border, s-zero and three mixed states. The border now follows t, and never applies where the sampler clamps. The retaken buffer recording; known-gaps rows for the argument-buffer texture's swizzled transparent border (divergent) and its opaque-border and runtime-sampler reads (refused), with the swizzle gap in FAST-PATHS.md's known gaps; the module docs say both. Verified: the replay on the M3 through MoltenVK (job m3-max-13263) named the six buffer divergences this fixes; the fix's replay is next. (cherry picked from commit 22c6817d4074c1b18bbc7c6d166370fe9990c1a5) |
||
|
|
5b24698068 |
SEMANTICS 2012, ARTIFACT_FORMAT 499, REFUSALS.md and the API signatures for reads through a sampler
What: SEMANTICS_VERSION 2011 -> 2012: reads through a sampler other than constexpr clamp_to_edge now translate (they were refused), a clamp-to-edge read past its level or layer reads zero in every lane, and a texture buffer's index outside a constexpr clamp_to_edge reads its first texel. ARTIFACT_FORMAT_VERSION 498 -> 499: SpecKey::BorderTexels and RuntimeFact::BorderTexels are encoded variants. docs/REFUSALS.md regenerated (refusal_surface.py): select_through's two sites. api_signatures.tsv blessed: SpecKey::BorderTexels, RuntimeFact::BorderTexels and SamplerWord::READ_STATE are added; nothing is removed or changed. Why: the translation's output changed under unchanged keys, and the encoding gained two variants. Verified: refusal_surface.py wrote the doc with 0 unmarked variants; signatures.py --bless reported only those three additions; METAL-COVERAGE.md --check is current. (cherry picked from commit 26c37d74d6d2a4bb395ff64a539eb7fc617619bd) |
||
|
|
ac0ffe1c25 |
Probe measurements and the API guide for reads dead after specialization
dead_ordered_and_unattached_reads.m records what it measured on the M3
Max under macOS 27.0.1 (potluck job m3-max-13241): dfr_color,
dfr_buffer and dfr_output are made and drawn, dead and live, every texel
the closed form's, with the debug layer silent; dfr_lacks has no state,
dead and live ('Shaders reads from a color attachment whose pixel format
is MTLPixelFormatInvalid'). Its header names the tests and the lane that
read it.
docs/API.md's color-group refusal list now names a raster order group on
a color output or on a parameter the function uses; one on a parameter
it never uses orders nothing and is not refused.
(cherry picked from commit 93aaa9c6685770db04032b710ec7b36950b56f89)
|
||
|
|
e51d85e18d |
API guide: a color input of another group is refused only where it is read
docs/API.md's color groups paragraph lists what each group's draw would read from another group as the pipeline's limit refusal; a [[color(n)]] input of another group is that only where the specialized function reads it, as pipeline::compile::color_group::entry now decides. (cherry picked from commit 1df7b9589dc6bda472d3faaa14bf432677647658) |
||
|
|
c42e63e64b |
Record DevicePackConversion where a heap read decodes a raw-held texture
A float or half read, sample or gather through an argument buffer that decodes a texture the heap holds by its raw texels alone (BGR10_XR, BGRA10_XR, R10Unorm_X6, RG10Unorm_X12 and the bfloat formats; the heap_raw routine) converts by the device's arithmetic, as a slot's decode of the same texel does, but recorded no PrecisionNote: a reader of the module alone saw no near-equivalent, against AGENTS.md's "allowed only when the artifact records it". The decode is planned in one place now, texture::heap_raw::plan, which both the read (select_read_as) and the emulated sample or gather (heap_raw_sample) call. It records DevicePackConversion as a specialized note with one clause on a new bound-value key, SpecKey::HeapRawTextures (stage): a texture the stage's handles can name is held raw. The binding plan gives the key from the command's heap members (resident or bound textures, as for HeapYCbCrTextures), so the note is in the module's notes, holds under precision_notes_bound exactly where the command can name such a texture, and the runtime announces it at that draw or dispatch (degrade_bound_values) and never at the pipeline's making. A stage that records the note outright for another conversion keeps it outright. Heap accesses that reach no such texture (queries, integer reads, storage reads, samples the function does not emulate) record nothing. NoteOn::HeapTextures is renamed HeapYCbCr beside the new HeapRaw. bind::heap::raw_held is pub(crate) for the plan. The heap set's own announcement naming the texture (heap_sets::RawRead) stays. SEMANTICS_VERSION 2008 (heap-reading modules gain the note); ARTIFACT_FORMAT_VERSION 498 (a SpecKey variant). api_signatures blessed; REFUSALS.md regenerated (unchanged). docs/API.md's catalogue and the runtime's Degradation docs say where the note is recorded and announced. Tests: heap_decodes_record_the_device_pack_conversion now also asserts the one HeapRawTextures clause; the new a_heap_decode_s_note_holds_where_its_command_can_name_a_raw_texture checks the plan's key and the bound note on every committed profile; the lane a_heap_decode_s_stage_note_is_announced_where_its_command_can_name_a_raw_texture checks the runtime's announcement under announce_each. (cherry picked from commit 1ab403b671f18773a10c8572ffbe0a73b56f5bbc) |
||
|
|
dbad32bb7b |
Docs: visibility venues, Metal's subnormal sample coordinates, a shared event's queue rule
Three corrections, each checked against the tree: - runtime/src/visibility.rs said Metal's visibility-result behaviour was measured on an M4, which is not one of our venues. The conformance suite's visibility cases record Metal's answers on an Apple M3 Max with macOS 27.0.1 (recordings/visibility-*.json); the doc now names that venue. The 5300M and UHD 630 answers it cites beside it are unchanged. - docs/FAST-PATHS.md's DeviceSampling row (and docs/API.md's device-sampling entry) said Metal reads any subnormal coordinate as the zero of its sign before addressing. That holds for a normalized coordinate (measured on the M3 Max on R32Float, PrecisionNote::DeviceSampling's documentation); a negative subnormal pixel coordinate addresses texel -1, as the M3 Max's recording of pixel-samplers-subnormal-border answers (the border at -2^-149, -2^-140 and -2^-127, known-gaps.tsv). Both now say so, and the 27 known-gaps.tsv rows that quoted the old reading quote the new one. - SharedEvent::reserve_vk_signal's Safety text lacked the same-VkQueue rule that Event::reserve_vk_signal states. A shared event's command-buffer waits are held on the host (event_timeline.rs: a settable timeline never hands a wait to Vulkan), but a command buffer that signals the event after the reservation waits on its VkQueue for the reserved index before its own signal (EventTimeline::signal's `after`, the order wait in command_buffer/submit.rs), so the caller's signalling submission must not go behind it on one VkQueue, and a texture copy on the first VkQueue behind it waits for the signal too. The rule is now stated, scoped to those signalling command buffers. Verified: rustdoc and the runtime's degradation_catalogue test over the edited text; no behaviour changes. (cherry picked from commit 12bac3fafd3d3e66dc0b88d01231dd30e2694ffb) |
||
|
|
ab10b3cbcf |
Runtime: say what a decoded twin's CPU decode makes replace_region wait for
The cpu-block-decode notice said the call waits for the decode where a command buffer that may read the texture is submitted and not yet complete, or the texture is untracked. The call has waited for no GPU work since the decode moved to the device's decode thread (texture/twin_decode.rs): it waits only for room, while 256 MiB of written blocks wait for the thread (a 4:2:2 carrier's partial-row write also reads its rows back first), and the scheduler holds the first command buffer that may read the texture, every command buffer where the texture is untracked. The declaration's rustdoc, its announced cost and docs/API.md's catalogue entry now say that. A test ties the stated bound to the queue's QUEUED_BYTES (made pub(crate) for it), so the text follows the constant. Verified: tests::degradation::the_cpu_block_decode_cost_states_the_calls_ only_wait and tests::degradation_catalogue (the catalogue states the cost). (cherry picked from commit f128722f1b2197f52833080eca738fd498cf6ce5) |
||
|
|
b1625c535c |
Translator: note a mesh function's point size only where it outputs points
A mesh function that writes a vertex's point size recorded
PrecisionNote::DevicePointSize whatever primitive its mesh outputs. The
rasterizer reads a vertex's size for points alone, so a line or triangle
mesh's size draws nothing on any device, and the runtime already announces
the note only at draws that rasterize points (
|
||
|
|
05a31354c1 |
Spares: hold at most 4,096 command buffers, the pools out of them counted
A command buffer keeps what its recording took of the driver's device-wide pools until it is begun again, reset or freed, and the spare command pools kept each pool's peak over its recent uses with no bound across pools. On ANV below Xe-HP each command buffer that records a binding table takes a 64 KiB block of the device's 1 GiB binding-table pool, so a device holds at most 16,384 of them, and the next recording fails with VK_ERROR_OUT_OF_DEVICE_MEMORY with no driver message. tests::linear_runs::checked_frames_merge_once failed so on ms01's Iris Xe (6 of 79 runs beside the runtime suite, job m3-max-13027): its frames of 707 and 1,413 render passes, each a command buffer whose pool kept its peak, left the spares holding 9,716 to 9,771 command buffers in every failed run (2,786 to 7,747 in sampled passing runs) before the frame that failed. A probe on the same Iris Xe (job m3-max-13053, twice): one command buffer of render passes, each a primary and a secondary beside a cleared depth target, failed at the end of its 8,087th pass with the spares holding 424, 2 x 8,086 + 212 = 16,384. A give-back now counts the spares, the pool given back, and what each pool out of the spares held as it went out (taken by a command buffer, out for frees, or beginning a primary ahead: CommandPools::out, kept under the spares' lock). Past HELD (4,096) the oldest spares that hold any shed all their command buffers on the free thread as an idle spare does and go back as the oldest; where that is not enough, the pool given back frees its last made past the bound, a secondary kept, never the primary begun ahead (past_held, CommandPool::past). On ANV the frees do not trim, as before, so kept barriers stay valid. HELD leaves three quarters of the binding- table pool to the command buffers committed and in recording. Tests: tests::spares::the_spares_and_a_pool_given_back_hold_at_most_held_command_buffers (the policy, no device) and tests::spares::device:: command_buffers_alive_at_once_leave_the_spares_holding_at_most_held (three command buffers of 2,112 blit encoders alive at once, each in a pool of its own). docs/FAST-PATHS.md records the remaining ceiling: one command buffer of about 8,000 such passes still fails on ANV below Xe-HP. Verification follows in the next commits' messages and the report: build and clippy, the spares tests on lavapipe, the M3 and the Iris Xe with a negative control, and a loaded Iris run. (cherry picked from commit 8ab6915d698cdaf29e2aa8bfd50c77cd8922d507) |
||
|
|
c120cdf105 |
Docs: the fill misses often, not mostly, in a process that submits nothing
tests::block_fills on the Radeon 780M (RADV PHOENIX, Mesa 26.2.6) missed 4 of its 5 fills in job 12841 and 2 of 5 in job 12891 (at the rebased tree of this branch); the fill row said "mostly" from the first run alone. Documentation only. (cherry picked from commit caa2b45263277b2696184602298e329291c8b5dd) |
||
|
|
ee0b8af622 |
Docs: the fill row's fragmented phases at 68 MiB blocks of images, 0 to 4 and 0 to 2
The row said a fragmented phase had 1 to 4 turnarounds of 8 ms or more and 1 or 2 missed fills; job 12852's second run of the bursts arm had neither (0 and 0), so the ranges are 0 to 4 and 0 to 2. Documentation only. (cherry picked from commit e20985fc7ff241c40edcd55b3c21506b715bb899) |
||
|
|
6f4f45f1a8 |
Docs: the fill with 68 MiB blocks of images, measured; its misses where nothing is submitted
The fill row's numbers were of 64 MiB blocks of images. With the 68 MiB ones made now, on the Radeon 780M (RADV PHOENIX, Mesa 26.2.6), the kernel's page pools drained before each run, the reclaim bench's arms (jobs 12852, two runs, and 12860, one run with the fill-window print): a quiet phase 0 or 1 turnarounds of 8 ms or more, no fill missed, the makings' vkAllocateMemory 1.2 to 2.0 ms in all; a fragmented phase 1 to 4 (the slowest 33.1 ms, behind a missed block whose allocation took 29.4 ms), 1 or 2 of its 12 or 13 fills missed. Of the 957 submissions begun while a fill ran (12860), 1 turned around in 8 ms or more (14.0 ms, fragmented); in 12852 a 24.0 ms one began within a 32 ms fill on the fragmented host. The row also says that in a process that submits nothing the fill mostly misses (tests::block_fills on the 780M, job 12841: of 5 fills, 1 saved and 4 missed), the cause not measured, and the fill's cost for a 68 MiB block (about 16 ms on the quiet host, at most 17.3 ms). (cherry picked from commit 30108c53759b9f76e25c0994e7db3cd4f7de7731) |
||
|
|
314263e447 |
Docs: the 2048x2048 packing measured, the slack's reason; the fill's other devices by the test
Verified at the tree of "Memory: pooled blocks stay 64 MiB, 68 MiB for images" (job 12840 on ms01, the Iris Xe; job 12841 on gem10, the 780M) and at that of "Memory: a block's making time is the tests' alone" (job 12851 on ms01, the Iris Xe and lavapipe): - tests::blocks_ahead::a_block_of_images_holds_four_textures_of_a_quarter_block_each passes on the Radeon 780M (RADV PHOENIX, Mesa 26.2.6; 12841), on the Iris Xe (ANV; 12840 and 12851) and on lavapipe (12851): eight RGBA8Unorm textures of 2048x2048 lie in 2 blocks of 68 MiB. Each took 16842752 bytes at an alignment of 65536 on the 780M and the Iris Xe, 16777216 at 64 on lavapipe. With the slack taken out (a negative control, image blocks of 64 MiB), the test fails on the 780M (12841) and the Iris Xe (12840): the eight lie in 3 blocks. So the sixteenth stays, for images. - tests::block_fills passes on all three: the 780M fills every block of images first (types 0x15864: of 3 blocks of images, 5 plain blocks filled first, 1 made under 1 ms and 4 not, in a process that submits nothing; 12841); the Iris Xe and lavapipe fill none (types 0x0, 0 fills; 12851). - The memory, blocks_ahead, zeroed_start, clip_bursts, exported and freed memory, device_recovery and host_copy tests pass on the 780M (51 of 51; 12841) and the Iris Xe (51 of 51; 12840); blocks_ahead and block_fills on the Iris Xe (8 of 8; 12851), and blocks_ahead, block_fills and memory on lavapipe under --cfg m2v_cpu_icd (27 of 27; 12851). - clippy with no cfg, with --cfg m2v_gpu and with --cfg m2v_cpu_icd, the runtime's Rustdoc, the API signatures and the driver-fact tests (9 of 9): clean (12851). The conformance crate's suite: 1029 of 1029 (12840). (cherry picked from commit 458aa4a23c3359cc6b44f01812d53a88260f29ba) |
||
|
|
930e3aa49e |
Memory: pooled blocks stay 64 MiB, 68 MiB for images; the making-rate rule goes
The rule that made a device's later pooled blocks of plain memory smaller once a making took longer than 8 ms (MAKING_BOUND, MIN_PLAIN_BLOCK_BYTES, Memory::plain_block_made) is removed, with what existed only for it: placements larger than a pool's small blocks taking blocks of their own power of two (pooled_block_bytes, Pool::large, took_large), the block's worth of small blocks kept ahead (ahead_sizes' count), the call's upper bound on the blocks it takes (ready::Need's most; a call now takes a block of its least bytes or more), and nearness by the largest block a pool holds (Pool::ahead_room). Every pool's blocks are one size: 64 MiB, or the device's largest allocation, and a pool of images' 68 MiB, a sixteenth besides (IMAGE_BLOCK_SLACK, formerly PLAIN_BLOCK_SLACK, now on images alone): a driver's image takes more than its texels, so that four images of a quarter of a block fit in one. The hold that rule shortened is taken away by the exportable fill of the commit before, where the driver holds submissions in plain makings, with the blocks kept at 64 MiB: the 17 MiB blocks made 45 to 55 makings a phase on the 780M against 13 to 15, holding 138 to 230 ms against 125 to 201 ms, and put every texture past 17 MiB in a block of its own (docs/FAST-PATHS.md). Tests: tests::plain_blocks goes; blocks_ahead's small-blocks tests go (the reserve of four small blocks, the large placements' block, the mixed-sizes run made smaller partway); its packing test now packs four RGBA8Unorm textures of 2048x2048 (a quarter of 64 MiB) to a block of images; the first-block test runs on 64 MiB blocks. A new device test, tests::block_fills, holds that a device with DriverFact::PlainAllocationsHoldSubmissions fills every block of images it makes exportable first, counted, and that a device without it fills none. The reclaim bench's small-blocks arms go. The conformance cost gate gates device_memory_allocated again (the BLOCK_SIZE reason goes): block sizes no longer follow how long earlier makings took. docs/FAST-PATHS.md: the RADV plain-blocks row is rewritten (blocks stay 64 MiB, the hold measured), a row for the fill is added (its kernel dependency, its counters, the 780M A/B and its cost), and the NVIDIA memory-block row says one block is kept ahead. Verified: not yet compiled; the clippy, Rustdoc and device runs follow. (cherry picked from commit 2cc9b21cb99b3fa7ac3b4199ae2aca88a99e014e) |
||
|
|
25401533b9 |
Docs: a fast-math NaN constant beside a run value stores the NaN; the fold's wording
API.md, section 10, Function constants: an fadd, fsub, fmul or fdiv under nnan whose operand is a function constant bound to a NaN is poison in the AIR. The translation answers the NaN operand unchanged, as it does without fast math, where that NaN is Metal's answer. On the M3 Max, Metal drops a kernel's store of it. Measured in job m3-max-12877 with case 2d9a7e3091e1f9d9..., which is the fixture sfold_fast_poison in a scratch corpus: - Metal on apple-m3-max-macos27.0.1 left every poison row's float and half store at the 0xCD fill, and wrote the run-value row. - MoltenVK with the folds wrote the NaN operand unchanged in every poison row (ffc12345, 7f800321, fd21). - MoltenVK with the base translator dropped the float rows, and wrote ff21 and 0 in the half rows. The case is not committed: the corpus compares exactly. ARCHITECTURE.md: the canon row now says a NaN operand is as it is beside a value the run computes, and quieted where every operand is a constant. (cherry picked from commit cddef968a3a8a971341fafcc5469e141fb97b434) |
||
|
|
f12af61da9 |
ARCHITECTURE: SCCP's float folds in the canonicalization summary
The canon row names what SCCP settles; it now names the float operations a constant operand decides (a NaN operand, the first in order, quieted; a product by a zero under nnan and nsz). (cherry picked from commit f6b2db494f2aabdb2a875c5a49651abc2e28803b) |
||
|
|
b83d35f35a |
Clear reach: a pass without a draw call clears before itself where its own clear would overreach
On MoltenVK, a pass's own Clear load in a pass without a draw call reaches the whole attachment. Where the reach is the render area itself (an uncompressed attachment whose render area ends on 32x32 tiles, now that only a compressed one is cleared whole), the pass's own clear was used and reached the whole 128x128 texture over a 64x64 area: lane fresh_clear_reach on the M3 Max (MoltenVK), 3 of 150 cases, BGRA8Unorm, RGBA16Float and RG16Float. ReachClears now clears such a stored attachment before the pass by a render pass of its own and the pass loads it (own_clear_overreaches: no draw call, an attachment larger than the render area), color and depth/stencil alike. The pass's render area stays Metal's, so a DontCare or Load attachment beside it keeps its texels. Docs: MacClass and docs/API.md cite arm64metal's tileclear2 jobs: the M3's answer (m3-max-12716, 12735) and the x86 Macs' disagreement (5300M whole, UHD 630 from the area to the whole texture: m3-max-12736, 12737), where the runtime keeps the whole level, the 5300M's answer. (cherry picked from commit ea34c273885ff00633c3afe983fdb3a7a398dd03) |
||
|
|
44e51b5081 |
Docs: how far a Clear reaches without a draw call, by the Mac class
MacClass and docs/API.md's accepted differences (the Mac a device presents) state the answer: on a device presenting an Apple silicon Mac, a Clear load in a pass of one layer without a draw call clears a compressed texture's whole level and slice and any other texture's render area rounded up to 32x32 tiles; on one presenting a Mac with an Intel or AMD GPU, the whole level and slice whatever the texture, unmeasured there and kept as it was. The lane's clear_reach docs name the compressed textures their whole-level cases use. Docs only; no behaviour change. (cherry picked from commit 5591cc4b71a9458fef7a3773ed99d1bf0eeb1dcd) |
||
|
|
f066aaf587 |
Blocks made ahead: a pool near its next block by three quarters of the largest block it holds
tests::blocks_ahead::mixed_sizes_find_their_blocks_made_ahead failed in two of five runs of the memory tests on the Radeon 780M (gem10, jobs 12627 and 12669): "creation calls waited for a block of images at textures [11]". In both, a slow making of the host's (the tests beside it) made the device's blocks of plain memory smaller early in the run, while its pool of images still filled its first block of 64 MiB, made before. A pool that has not grown keeps its next block made ahead once it is near it (Pool::near_next), which was measured by three quarters of its blocks' size now: 12.75 MiB of a 17 MiB block (12 MiB of 16 MiB before the blocks' sixteenth). The 64 MiB block had 12.4 MiB left, so the pool kept none ahead, and texture 11 (2560 x 1440, 15,790,080 bytes on RADV) found no room and waited for its block. Told of a slow making before its fourth texture (a scratch of the test, job 12687) the 780M waited at texture 11 in two runs of two; before its seventh or eleventh, by which the pool had grown or was near its next block, in none. A pool is now near its next block below three quarters of the largest of its blocks' size and the pooled blocks it holds (Pool::ahead_room), so a pool still filling a block made before its blocks were made smaller keeps its next block ahead as it did for that block; the sweep of blocks made ahead and unused reads the same measure. A pool whose blocks are all of one size is unchanged. New test: mixed_sizes_after_blocks_made_smaller_find_their_blocks_made_ ahead, the mixed run told of a slow making before its fourth texture. memory/ready.rs and docs/FAST-PATHS.md's blocks-made-ahead row say the measure. Verified on the 780M (job 12692): the new test without this change waited at texture 11 in three runs of three; with it, the memory tests (66) pass in three runs of three, the new test with no wait (7 blocks of images made ahead), and in one of them the existing mixed test's own blocks made smaller at texture 15 by a slow making of the host's, with no wait. The memory tests pass on the RX 550, lavapipe (job 12693) and the Iris Xe (job 12694); clippy plain and under m2v_gpu and m2v_cpu_icd, and the runtime's Rustdoc, clean. (cherry picked from commit c3fd622421584dfcc0b34ca133dbae22f53203e6) |
||
|
|
6346da2609 |
Small blocks: a sixteenth besides the power of two, so four quarter-block images fit
A pooled block of plain memory made smaller after a slow making (Memory::plain_block_made) was a power of two, 16 MiB at the least. A driver's image takes more than its texels: a Private RGBA8Unorm texture of 1024 x 1024, sampled and rendered to, is placed in 4,210,688 bytes on a Radeon 780M (RADV PHOENIX) and an Iris Xe (ANV, RPL-P) and 4,210,712 on an RX 550 (RADV POLARIS12), each at an alignment of 64 KiB, so the second starts at 4 MiB and 64 KiB and a 16 MiB block holds three, not four (lavapipe: 4,194,304 bytes at 64, four). The blocks are now made of that power of two and a sixteenth of it besides (PLAIN_BLOCK_SLACK): 17 MiB at the least, holding four images of a quarter of the power of two with up to 256 KiB of metadata and alignment each, two of a half with up to 512 KiB, one of the whole with up to 1 MiB. plain_block_made picks the largest power of two whose block with its sixteenth the slow making's rate makes within MAKING_BOUND, so the 8 ms bound holds for the block as made (64 MiB in 16 ms: 16 MiB, not 32, as 34 MiB would pass it). A placement larger than such a block takes the least power of two so made that holds it (a 20 MiB texture: 34 MiB). Blocks of plain memory not made smaller keep their 64 MiB, and the blocks of exportable buffers theirs. The reserve a pool keeps ahead is as many of its blocks as come to a 64 MiB block or more (four of 17 MiB, 68 MiB), at least what it kept before. Verified, tests::blocks_ahead::small_blocks_hold_four_textures_of_a_ quarter_block_each (16 such textures, one at a time, on a device told of a slow making): before, 6 pooled blocks of 16 MiB held them on the 780M and the RX 550 (failing, jobs 12602 and 12590); after, 4 blocks of 17 MiB hold them on the 780M, the RX 550, the Iris Xe and lavapipe (a fifth made ahead). The memory tests (blocks_ahead, plain_blocks, zeroed_start, memory, clip_bursts, host_copy) pass on the RX 550, lavapipe and the Iris Xe, and on the 780M but for mixed_sizes_find_their_blocks_made_ ahead in two runs of five: a wait older than the sixteenth, which the branch's last commit fixes. Clippy plain and under both cfgs, and the runtime's Rustdoc, clean. tests::reclaim_submit_bench on the 780M (gem10, Mesa 26.2.6), the small-blocks arms, pooled blocks made a phase before -> after (two runs each, release): - images, 1024 x 1024 one a frame: quiet 64 (1024 MiB) -> 48 (816 MiB), pressed 67 (1072 MiB) -> 51 (867 MiB); - images of mixed sizes: quiet 36 (576 MiB) -> 30 (510 MiB), pressed 39 (624 MiB) -> 33 (561 MiB); - images in bursts: quiet 64 (1024 MiB) -> 48 (816 MiB), pressed 64-67 (1024-1072 MiB) -> 51 (867 MiB); calls that waited for a block made ahead 23 -> 15 quiet, 20-23 -> 15 pressed. The three blocks made ahead and freed unused in each pressed phase stay (48 MiB -> 51 MiB). docs/FAST-PATHS.md's known gap (blocks made smaller, down to 17 MiB) and its blocks-made-ahead row change with it. (cherry picked from commit 532d06c2359fb2756f5514ba2821f959cf48293b) |
||
|
|
40831926fd |
Blocks made ahead: the reserve counted in bytes with the pool's room, made again at large placements
The trigger of a pool's blocks made ahead skipped the pool while it had room for a whole block (`ready_if_growing`'s `has_room(bytes)`). A call that takes a block from the reserve leaves the pool a whole block of room and none made ahead, so nothing was made again until a later creation call found the pool short of a whole block; by then the placements had taken the room, and the next call that needed a block waited for a making it started itself. On an RX 550 (64 MiB blocks, textures of 4, 14.1 and 31.6 MiB one at a time, every making ended between two) the call after each 31.6 MiB texture waited so, at textures 8, 16 and 24 of 32 (job 12539, `tests::blocks_ahead::mixed_sizes_find_their_blocks_made_ahead`, with made-ahead empty from texture 6 on). On a Radeon 780M the bench's mixed arm waited for 8 and 6 of its blocks with none hurried (job 12513). - The reserve counts its own blocks in bytes together with the pool's room (`Memory::lacking`, the longest free range, `Pool::room`): none lacks while those made ahead and the room come to their worth (a block's worth, as before), and once they come to less, as many as bring those made ahead back to it. The trigger no longer skips a pool with room for a whole block: a pool that grew or is near its next block keeps what it lacks. The large block's rule is unchanged. - A placement of a quarter of a block or more in a pool whose blocks are made ahead runs that trigger there and then (`ready_after_placing`, in `place`), not at the next creation call, which may need the block at once: a quarter of a block is the lead `ahead_room` gives the next block's making before the half block `keep_room` keeps, so such a placement can use it up in one step. (A threshold of half a block would miss the 31.6 MiB texture, just under half of 64 MiB, and pooled placements are at most half a block.) Room is cached (`Pool::room`), so the check derives it where the next creation call would have. - A call whose waited making ended without its block waits once more, on a making that counts it from its start (`take_ready`), before it makes the block itself. A thread ends so without a failure: a reserve making no call waited for as it began makes no block within the device's allocation margin (`Allocations::room_ahead`), and its ending drops the sizes queued behind it, the waiting call's among them. This is the hole the M3 cost records' selection-only image and buffer blocks made in place point to (not measured here). Measured on a Radeon 780M (RADV PHOENIX, gem10, exclusive; job 12560, two runs each, the reclaim bench's images arms; RT 1991 is development with the ready threads' rename): - Mixed sizes, 64 MiB blocks: blocks waited for, quiet and pressed, RT 1991 8 and 6 in both runs (none hurried), with this change 0 and 0 in both. Slowest creation call in the pressed phase 8.5 and 5.8 ms at RT 1991, 3.6 and 1.9 ms with it (RT 1987: 5.2 and 1.5 ms, with 8 and 6 blocks of images made in place, none since). Blocks made, 13 and 14 a phase, unchanged. - Bursts of 16 textures, 16 MiB blocks: waited for, quiet 24 and 25 at RT 1991, 20 and 21 with it; pressed 27 and 27, then 23 and 23; hurried 11 to 12 at both (RT 1987: 60 a phase). - Images one a frame and mixed sizes on 16 MiB blocks, and the 64 MiB images and bursts arms: no wait at either, none in place, the same blocks made. On an RX 550 the mixed-sizes test waited at textures 8, 16 and 24 without this change and at none with it (job 12556); lavapipe, whose slow makings made its blocks 16 MiB, waits only at texture 7, the first texture larger than its blocks. The mixed-sizes test allows the one wait it should: where a device's slow makings made its blocks of images smaller (lavapipe, 16 MiB), the first texture larger than them waits for a block of its own size, which nothing foretold. Work counts expected to move: blocks_ahead_waited_for down (the mixed and burst arms' waits on makings started late become blocks made ahead and found ready); image/buffer_blocks_made_ahead about the same in total, with makings started earlier; blocks_ahead_hurried down where those makings would have been cut short; image/buffer_blocks_made_in_place down to 0 in the M3 selection where the room_ahead ending was the cause (expected, unmeasured). The bytes kept ahead are bounded as before: a block's worth a pool, plus the large block. (cherry picked from commit 384c96121f7fa1ff8dec80ccfbf98f401ab77a74) |
||
|
|
f79bf9a144 |
Blocks made ahead: calls for a pool's own blocks leave its large block alone, and a taken block is waited for again
1. The large block kept ahead was not kept for the large placements. While a pool's placements past its 16 MiB blocks are recent, it keeps one 32 MiB block ahead ( |
||
|
|
074d8e762e |
Blocks made ahead: a block's worth of bytes per pool, a block for large placements, and calls wait instead of making
The problem, from reims's pin 31 scroll round on um870's 780M. After slow makings, its plain blocks were made at 16 MiB (RT 1984). Over two boots: - 250 and 264 pooled blocks were made; - 114 and 82 image blocks were made in place on the guest's threads; - 110 and 159 blocks made ahead were waited for (91 and 122 hurried); - direct compaction on guest threads took 833 and 306 ms. Two causes: - The ready thread kept one block ahead per pool. With 16 MiB blocks that is a quarter of the reserve that one 64 MiB block used to give. A call that found no block made and no making under way made its own. - A placement larger than a 16 MiB block takes a 32 MiB block of its own size (pooled_block_bytes). No block made ahead could hold it, so it was always made in place. What changed (memory/ready.rs, memory.rs): - A pool keeps a block's worth of bytes ahead: as many of its blocks as one 64 MiB block holds (4 of 16 MiB). - While the pool's placements larger than its blocks are recent (the last within KEPT_EMPTY_FOR), the reserve also holds one block of the largest such size. The pool's own blocks fill the rest of the 64 MiB (32 MiB + 2 x 16 MiB). - One thread per pool makes them one after another, one vkAllocateMemory each, after a single wait for a burst's end. A block a call or a top-up queues while the thread runs joins its queue; a waiting call's block goes first. - A call that finds no made block of the size it needs no longer makes one itself. It waits for the block being made or queued, or queues one first and waits. If the pool has no thread, it starts one. The waited block's pages are not read. - The host copies' pool is now waited for too, except while its thread reads a block's pages (whose first touch may wait behind the program's GPU work). The waiter counts itself before it checks a reading flag; the thread sets the flag before it checks for waiters. - A block is made in place only in these cases: a host-copies placement while that pool's thread reads pages; a making that failed or a thread that could not start; a placement before the device's first creation call. - A placement over half of BLOCK_BYTES stays dedicated, as before. - keep_room's per-pool step moves into keep_pool_room. Resting cost (bytes kept ahead per pool, counted against the kept-blocks budget): - Against pre-1984 (one 64 MiB block per growing or near-next pool): unchanged at 64 MiB. - Against RT 1984 and RT 1987 (one block of the pool's size): unchanged for 64 MiB pools. A pool of 16 MiB blocks keeps up to 48 MiB more while it grows or is near its next block. - At the device's first creation call, a pool of 16 MiB blocks also makes 3 blocks ahead after its first. If the pool never nears its next block they go after KEPT_EMPTY_FOR (blocks_ahead_unused). Pools of 64 MiB blocks, the default before any slow making, make none extra. Work counts expected to move, for the cost records: - buffer_blocks_made_in_place and image_blocks_made_in_place fall to 0, except in the cases above. That includes each kept pool's first block at a device's first creation call, which the call now waits for on the ready thread. - buffer_blocks_made_ahead and image_blocks_made_ahead rise by as many. So does blocks_ahead_waited_for, since a call waited for each of them. These are not hurried: the making started at once for the call. - host_copy_blocks_readied rises, and host_copy_blocks_made_in_place falls, where a host-copies placement found no making at all. - pooled_memory_blocks_made is unchanged with 64 MiB blocks. With 16 MiB blocks the extra reserve blocks count there when added. When swept unused they count as blocks_ahead_unused and pooled_memory_blocks_freed. - Kept-ahead bytes against the heap budget: a block's worth per pool, as above. Docs: memory/ready.rs, memory.rs, the WorkCounts fields, and FAST-PATHS' kept-blocks row, which now describes the 64 MiB reserve and the large block. Tests (tests::blocks_ahead), on lavapipe under --cfg m2v_cpu_icd: - a_pool_of_small_blocks_keeps_a_block_s_bytes_ahead_and_no_creation_call_makes_one: 16 MiB blocks, 4 MiB textures. 0 in place, 64 MiB kept ahead. The base fails it: 1 in place, 16 MiB ahead. - placements_past_a_pool_s_small_blocks_find_a_block_of_their_size_made_ahead: a 20 MiB texture every 4. 0 in place, four 32 MiB blocks, 0 waits after the first 20 MiB texture. The base fails it: 5 in place, four of them 32 MiB. - The memory, blocks_ahead, plain_blocks, zeroed_start, clip_bursts, exported/freed memory, device_recovery and host_copy tests passed, 78 of 78 (jobs 12486 and 12491). - The 780M bench before and after (images, mixed and burst arms, fragmented) is running on gem10 (job 12492). Its numbers go in the pin notes. (cherry picked from commit 096241d0964536db875ab2957c64b40922e7fa8e) |
||
|
|
05dcfce04e |
Memory: a pool near its next block gets it made ahead, its first growth among them
Blocks were made ahead (memory/ready.rs) only for a pool that grew lately: a second or later pooled block added within KEPT_EMPTY_FOR. So a pool's first growth, and its first after a pause, was always made in place by the creation call whose keep_room found no room for half a block: in a guest's scroll on a Radeon 780M, the buffers' pool's first growth block, made on the guest's thread. A pool made ahead for now also gets its next block made ahead, grown or not, once it is near it (Pool::near_next): it holds a pooled block and its longest free range is below three quarters of a block (ahead_room), a quarter of a block before the half block keep_room keeps. The pools of exportable buffers take the same rule (exported_growing lists those near their next block too). A block made ahead for a pool that stopped growing goes after KEPT_EMPTY_FOR only once the pool has room for three quarters of a block again, so a pool that rests near its next block keeps that block, one at most a pool, counted against the kept empty blocks' budget, and makes none over and over. That is the resting cost, written in docs/FAST-PATHS.md's row on kept blocks and in ready.rs. The other option, a block ready for every pool in use, holds one at rest for every pool, not only those near their next. Tests: blocks_ahead's growing-pool test now asserts its first growth is made ahead too (renamed). reclaim_submit_bench gains a scroll arm: Private buffers of 7471104 bytes (a scroll's, eight to a block) every 30 ms, 64 a phase. Verified on um790's Radeon 780M (RADV PHOENIX) and lavapipe (jobs 12337, 12354): - blocks_ahead, 780M: first growth 1 made ahead, 0 in place (lavapipe the same). Negative, development's memory.rs and ready.rs: 0 ahead, 1 in place, the test fails. - Runtime suite: 780M 2011/2011, lavapipe 2014/2014; clippy with m2v_gpu, m2v_cpu_icd and no cfg clean; rustdoc clean. - reclaim_submit_bench_scroll, release, three runs each, alternating: development made 7 blocks ahead and 1 in place in each phase, quiet and fragmented (compact_stall about 2500 in the pressed phase), every run; with this change 8 ahead and 0 in place in every phase. The slowest creation call: development 0.2 to 0.4 ms, this change 0.1 to 0.2 ms. The in-place makings were fast in this bench's fragmenting; the consumer's trace had the same making under the kernel's compaction. (cherry picked from commit 35c4231506652a454e43e703b162384a0a2f71cc) |
||
|
|
7a50011e74 |
Memory: the plain-block rule's ledger row; the cost gate reports device_memory_allocated
docs/FAST-PATHS.md gains the known-gaps row for the measured-rate size of plain blocks: what a making holds on RADV, the rule, the 780M's numbers against the base (turnarounds, creation calls, vkQueueSubmit per call, block counts), what a single slow making costs for the device's life, the drivers left unaudited, and the M3 Max's makings over the conformance cost measurement. The conformance cost gate reports device_memory_allocated (a new race-rule reason, BLOCK_SIZE) rather than gating it, because the bytes a case allocates now follow how long the device's earlier makings took. Measured on the M3 Max, `conformance cost --check` over eight runs of the whole set (1233 cases): at this tip rc 0, no 64 MiB making past 1.61 ms, the rule never fired; with the size held at its 16 MiB floor, rc 1 on one case's device_memory_allocated (201326592 in the record, 50331648 measured), with no gated bound or ceiling of pooled_memory_blocks_made moving and no case over a bound, so that count stays gated. The fold test that used device_memory_allocated as a count with no MONOTONE row now uses owned_kernel_spirv_bytes. (cherry picked from commit a4246707ec6da2b49342feca48bf9a931e152675) |
||
|
|
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
(
|
||
|
|
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) |
||
|
|
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) |
||
|
|
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) |
||
|
|
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) |
||
|
|
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) |
||
|
|
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) |
||
|
|
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 |
||
|
|
462934908e |
RUNTIME_VERSION 1974, the runtime-sources pin and the API table for recovery 1b
exitcrash 1571c220d7..4b9b7ed8b0 (11 commits): a device recovery carries the program's no-copy buffers (made again on the new VkDevice over the same pages, same contents pointer, Metal address and bytes: pointer imports, buffers in another's import, gate-refused copies, runs of guest RAM) and its uses of guest RAM (HostRamUse, carried before the buffers). The caller's deallocator still runs once, after every generation's import of the pages is freed; a detached no-copy buffer stays on the lost generation (MadeBeforeRecovery). Runtime behaviour changed: RUNTIME_VERSION 1973 -> 1974, pin recomputed, docs/REFUSALS.md regenerated (two refusal sites renamed: ram_use_on, buffer_over_host_parts). API table: HostRamUse is now a tuple struct over a private Arc<RamUseCell> and its own impl Drop is gone (the cell's use drops it). Nothing breaks for a consumer: dropping a HostRamUse still lets go of the RAM at once (the recovery's carry holds only a Weak, upgraded for the carry itself), and nothing could call the Drop impl directly. Verified by exitcrash: lavapipe 11782 at a5f0c3be37 runtime suite 1999/2000 (the one red a test bug, fixed), clippy plain/cpuicd/gpucfg, rustdoc, refusal check; lavapipe 11814 recovery/no-copy/event 30/30 with negative controls A (deallocator not handed on) and B (lost parts never let go) failing as designed; rebased tip 4b9b7ed8b0: Iris 11823 51/51 and 780M (RADV PHOENIX) 11824 51/51 over recovery, no-copy, host_ram_device, event_timeline, detach_lost, the new tests run on both. Not run at the tip: lavapipe whole suite, clippy, the 5080 (development's checks). |
||
|
|
15923d88c0 |
Docs: a recovery carries no-copy buffers and uses of guest RAM
The DeviceRecovered cost text (and docs/API.md's catalogue entry, which states it), the runtime README's recovery section, new_buffer_with_bytes_no_copy, and the contracts of the import gate, the run resolver and the dma-buf source now say the following. A recovery carries a device's uses of guest RAM and its no-copy buffers. Each buffer is made again over the same pages. The caller's callbacks are asked again on the thread that recovers, before the new device serves, so they must make no call on the device. The deallocator runs at the buffer's release once no VkDevice's import of its pages is left (the keep-alive's contract says the same). Detached no-copy buffers and a no-copy heap's buffers stay refused. HostRamUse's doc says the use goes on. (cherry picked from commit 58ba0931b857a9dcf9a6124138c81fc31a259552) |
||
|
|
742e320bee |
REFUSALS.md for what a recovery carries; the carry test's notification sends plainly
REFUSALS.md is regenerated by scripts/refusal-surface/refusal_surface.py in job m3-max-11457, and its --check passes. MadeBeforeRecovery's row now says what the recovery does not carry and lists the exportable-event carry site. The carry test's notification no longer drops a Copy Result, which the CPU-ICD clippy rejected. (cherry picked from commit ef076009e82d2bde7f29ff9a81608ec40e94cb6a) |
||
|
|
33675e87f1 |
Carry tests, and docs for what a recovery carries and leaves refused
New device tests (tests/device_recovery_carry.rs, under the CPU-ICD and GPU cfgs): - One recovery carries a Private buffer (same address, zero after) and a buffer in fresh pages. The fresh-page buffer keeps its contents pointer and bytes, and the host's writes through that pointer after the recovery reach the GPU's copy. It also carries a shared event: its value, its listener's notification and a GPU signal after the recovery. - A pooled Shared buffer stays refused, and the notice counts it. It keeps the lost VkDevice, which then holds no empty block and less memory than before the loss. Dropping it takes the line back to one live VkDevice. - Seven recoveries with a carried buffer and event in use between them end with one live VkDevice, and eight made. The device_recovery helpers are shared with the new file. Docs: RuntimeGap::MadeBeforeRecovery, the DeviceRecovered catalogue entry and its consequence (runtime and API.md), the runtime README's lost-device section, line.rs's module and recover_for_test docs, in_place.rs, the validation lane's docs and the refusal surface's reach mark now say what is carried and what stays refused. REFUSALS.md is regenerated in the next commit. Not yet built. (cherry picked from commit 68d68cdfbdbbac979e5097a8ad286416450790bf) |
||
|
|
2cbe8ce595 |
Volume resolves: NVIDIA's leaves plane 1 unwritten, so it resolves through the scratch copied into the planes too
On the RTX 5080 Laptop GPU (NVIDIA 615.71.09)
runtime_lane::view_attachments::a_resolve_writes_the_volume_plane_it_names failed at base and tip
alike, 3/3 each (t3d_resolve_plane1: byte 64 is 0x11, Metal's 0x33). Its VOLUME-RESOLVE lines and a
probe of resolve orders (scratch branch, never merged) show a 4x multisampled RGBA8Unorm attachment
resolved into the 2D view of a 4x4x4 or 4x4x8 volume that begins at depth plane 1 writes no plane:
the volume keeps every byte it had. Into the views at planes 0, 2 and 3 it writes that plane alone,
in every order tried (1023, 3210, 0123) and three times over into plane 1. A draw into plane 1
through the same kind of view writes it (a_volume_s_plane_is_an_attachment passes), and the
validation layer reports nothing, so the usage is the valid one RADV's defect row already cites.
Fix, the RADV fix's shape (
|