b37276fa4c9b65e60cf2b8e109e55450c8276ba3
624
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
b37276fa4c |
Note a heap texture's YCbCr filter where its handles and sampler can reach one that filters
What. A filtered `half` or `float` sample of a texture an argument buffer holds (a heap's) now
records `PrecisionNote::HalfSampleFilter` / `FloatSampleFilter` on a device that samples through
Metal's own sampler (MoltenVK), as a slot's sample does, under clauses the plan answers at each
draw or dispatch:
- `SpecKey::HeapYCbCrTextures(stage)`: a heap member of the command reaching the stage (a texture
it makes resident, or binds at a texture slot of the stage) is of a two-plane YCbCr class
(`TexelFormat::two_plane_ycbcr`);
- through an argument buffer's sampler, `SpecKey::FilteringArgumentSampler`: a listed argument
sampler (`BindShape::argument_samplers`, every live state) has a linear min, mag or mip filter,
anisotropy or a cubic filter; through a runtime slot, the bound word (`filtering_word`); a
constexpr sampler that reads one texel of one level records nothing.
Only a 2D, one-layer, color, single-sample heap sample can reach a two-plane texture, so 3D, array,
depth and multisample heap samples record nothing. The plan computes both keys in `record_noted`
(which now takes the heap's stage reach), so they are a function of the bind shape: the runtime's
bound-value memo, keyed by (variant, plan, specialization), stays valid. The runtime announces a
holding heap clause as `ycbcr-filter-not-exact` (`degrade_clauses`), naming the stage.
Why. A probe on the M3 Max (MoltenVK) showed a 4:4:4 two-plane texture (identity address-mode map:
`YCBCR8_444_2P`, `YCBCR10_444_2P`, their sRGB twins, the packed 10-bit one) held by an argument
buffer and sampled linearly through a constexpr, runtime-slot or argument-buffer sampler ran and
announced nothing, where Metal's own sampler filters the kept image's float texels, not Metal's
exact filter: an under-announcement. (4:2:0, 4:2:2 and the code-reading 4:4:4 textures reached
through handles are refused, `MappedTextureSampling { through: Handles }`; a slot texture sampled
through an argument buffer's sampler is refused at translation, `ArgumentBufferTextures`.) Which
sampler state an argument buffer holds is in its memory, which no plan reads (the binder's rule:
argument samplers come from object lifetimes), so the argument-sampler test is "a live state
filters": a program whose live states are all nearest announces nothing.
SEMANTICS_VERSION 1973 -> 1974 (precision notes change for heap samples on metal-sampler
profiles); ARTIFACT_FORMAT_VERSION 489 -> 490 (two `SpecKey` variants in the codec). The golden
table does not move (no SPIR-V changes). `api_signatures.tsv` gains the two variants.
heap_linear_samples_are_the_device_s now expects the specialized note on MoltenVK 2D samples.
Verified (potluck):
- M3 Max, MoltenVK, GPU (job m3-max-2786): 64/64 lane tests (ycbcr_textures, ycbcr_in_place,
degrade_notices, pixel_samplers, ycbcr_device_reads, argument_linear_samples), the new
a_ycbcr_texture_through_an_argument_buffer_announces_its_filter_only_where_it_can_filter
printing, for YCBCR8_444_2P and YCBCR10_444_2P_sRGB: constexpr linear 1, runtime nearest 0,
runtime linear 1, argument nearest 0, argument linear 1, argument nearest with a linear state
alive 1; RGBA16Float 0 in every case.
- lavapipe (msi, llvmpipe LLVM 23.1.1; job m3-max-2775): the same 64/64; announced only where
the device converted the 8-bit 4:4:4 texture itself.
- M3 unit tests (jobs m3-max-2767, m3-max-2774): the new
tests::engine_heap_binder::a_heap_texture_s_ycbcr_filter_note_holds_where_its_sampler_can_filter
and 134 more (engine_heap_binder, engine_ycbcr_in_place, engine_handles, golden_hashes, cache),
api_signatures/api_surface/refusal_surface 19/19, runtime tests::degradation 17/17; clippy
plain, --cfg m2v_gpu, --cfg m2v_cpu_icd and rustdoc -D warnings clean.
- Negative controls, both failing: no heap note (the unit test, and the lane's constexpr linear
case announcing nothing on the M3); a plan answering 1 for both keys (the unit test at
"YCBCR84442P beside none", the lane's argument nearest case announcing on the M3).
- Release CLI on moltenvk-m3, tip against 80d2dc465f, 3 runs: tail_argument_samplers
argument_sampler_sample 0.02 s / 25.1 MB both; handles argument_buffer_runtime_sampler 0.02 s /
25.6 MB both; grd_half_many_samples 0.05 s / 25.9 MB both.
(cherry picked from commit 8403d3746182d6c1acf7795666fc46fea811e660)
|
||
|
|
ffbfb8631d |
Bump SEMANTICS_VERSION to 1974 and regenerate the conformance coverage at stack 37's picks
Three picked branches each moved SEMANTICS_VERSION from 1972 to 1973 on their own: runtime sampler slots' filter notes now carry a test of the bound sampler word; an object function's barriers are predicated so a partial object threadgroup runs as Metal's; and extended-range partial masks and unwritten padded or bfloat attachments link. Together their outputs differ from any one branch's at 1973, so the version moves once more. docs/CONFORMANCE-COVERAGE.md is regenerated from the merged sources and recordings (the picks' conflicts kept the earlier text). Verified: conformance-coverage --check, signatures.py --check and refusal_surface.py --check pass on this tree; metal-coverage is current. |
||
|
|
c3cbf1e76b |
Conformance: the RTX 5080's XR rows at the multisampled shadow; lavapipe's BGR10_XR masks merge
The RTX 5080 (b5080 entry xr2-replay-xr, every xr-* case at b026d47db4) now matches the M3's
four-sample gamut counts (226/295 elements, one code; sRGB 547/548, up to four codes), where the
ledger had 542/543 and 610/622 from before the per-sample shadow: those ten rows take the M3's
counts and text. New rows for the 5080: the eight gradient cases (blended 134/142/109/145
elements, one code; unblended 39/44 and sRGB 56/86, the same counts as lavapipe's, the device's
float arithmetic of the gradient), the BGR10_XR masks (the M3's counts: 37, 41, 9, 14) and the
padded sRGB fill (92). The 5080's other unlisted xr-* divergences (blend, clears, clear-routes,
draw, planes, two-plane samples, two-planes) are in cases this branch does not touch; they are
left out here.
lavapipe at 36239bb3ab (msi's LLVM 23.1.1 and Ubuntu 26.04's Mesa with LLVM 21.1.8, the CI
image's): the four BGR10_XR partial-mask cases no longer refuse. Their texels match Metal's
(linear) or sit one code off (sRGB: 14 and 9 elements, the M3's counts), but the runtime announces
extended-range-blends-stored-codes at the merging draw: it reads the color over an input attachment,
where no half shadow is held, and the pipeline's state does not tell a read that only keeps codes
from the function's own fetch. The ledger records that as our gap (case/notices rows), and the
notice's documentation (degradation.rs, API.md) says it fires there. A base build (
|
||
|
|
c559ed6f84 |
Docs: the half shadow holds at more than one sample; REFUSALS for the merge's refusals
The extended-range-blends-stored-codes notice (its declaration and the docs/API.md catalogue entry) now says where it is not announced: a color whose half shadow the runtime holds, in a pass of one layer on a device that orders fetch through the pixel interlock alone, at one sample or more, from the pass's clear or (at one sample) its load; and where the codes stay: over lavapipe's input attachments, in a multisampled pass that loads the color, and after a draw the shadow cannot follow. docs/FAST-PATHS.md's word attachment row no longer says an extended-range color keeps its codes at more than one sample. docs/REFUSALS.md regenerated (scripts/refusal-surface/refusal_surface.py): link's second extended_write_mask site and fetch::unordered_extended_fetch. How verified: refusal_surface.py wrote the table with 0 variants without a reach mark or a basis; the catalogue test runs with the runtime suite next. (cherry picked from commit 70691da1d131573dac3a3c4ae4e6436ad48283f3) |
||
|
|
e10552b553 |
Re-record the mesh limits cases on the M3 Max, time every new case, regenerate the coverage document
What: the 17 mesh-limits cases' Metal answers and M3 cost bounds over the trimmed fixture, the timings of all 34 new and re-recorded cases (times --write, both legs; the host's load was above the gate's 26, so the verdict is to be re-read on a quieter host), docs/CONFORMANCE-COVERAGE.md (MTLMeshRenderPipelineDescriptor 27 of 27 items compared, the MTLRenderPipelineState getters 18 of 22), and the golden and inventory rows of the trimmed fixture. Why: the fixture's AIR changed; the suite's own tests ask each case for its cost and timing records. Verified: M3 jobs m3-max-2732 (bless, 155 touched translator tests pass) and m3-max-2737: replay on MoltenVK of the 34 cases, 29 exact, 4 announced (the partial-barrier draws' emulation notices), 1 refused as known-gaps.tsv expects (mesh-limits-amplification-2), exit 0; the conformance crate's 1023 tests pass. (cherry picked from commit d8031c15692c56abc40b3c6fc80579091bbfb680) |
||
|
|
7c6b61b76d |
Leave the mesh limits whose Metal answers follow compiler history out of the cases; ledger the amplification refusal
What: the mesh-limits family drops its 16 rows of a required threadgroup size or a function's own thread maximum, the fixture its two functions of one, and MeshLimitsSpec its required sizes. mesh_pipeline_limits.m and docs/API.md (accepted differences) record why: on the M3 Max each such answer changes with what the compiler compiled before (a first compile refuses a required size of 32 under a maximum of 64 in either stage and makes it after a compile under 64; a first compile of a function of max_total_threads_per_threadgroup(64) answered 32), so the recorded mesh-limits-required-mesh-32-max-64 made where the probe and a first compile refuse. known-gaps.tsv lists mesh-limits-amplification-2's refusal on every venue. Why: a recording of those rows holds the compiler's history, not an answer; the amplification refusal is an open gap. Verified: fresh-source creations on the M3 Max (jobs m3-max-2717 and m3-max-2725); the family re-records in the next job. (cherry picked from commit 187f1b12c0b8282a0dcf1e43ab530123ccf1d2fa) |
||
|
|
0f289cdac4 |
Commit the regenerated fixture companions, and record how Metal runs an amplified mesh draw
What: the .ll and .air.ll companions of mesh_partial_barrier, compute_thread_limit and mesh_pipeline_limits, and their TOOLCHAIN lines (regen-air-fixtures on the M3 Max, job m3-max-2677). probes/ mesh_amplification.m records its answers: under an amplification count of 2 the object function runs once (8 threads) and the mesh threadgroups it launches run once per amplification (16 threads, ids 0 and 1, a count of 2), each into its view mapping's slice. FAST-PATHS.md's known gap for a mesh pipeline's amplification says what an exact form must do and why neither built draw form is one. Why: the tests and cases read the fixtures; the gap stays open with the measured semantics written down. Verified: the probe ran on the M3 Max (job m3-max-2677). (cherry picked from commit bb5a45dd26d89d5af72e755ad4ac976975007d8b) |
||
|
|
b43ba48ee2 |
Regenerate the signature table and REFUSALS.md
What: api_signatures.tsv gains ComputePipelineProblem, its two variants and DescriptorError::ComputePipeline; REFUSALS.md's RequiredThreads row says only what creation refuses. Why: the new public refusal and the corrected problem doc. Verified: signatures.py --bless and refusal_surface.py on msi (job m3-max-2689). (cherry picked from commit 301047b4dc4f5f4f3a4d1725c9966e152f5b4fb0) |
||
|
|
9609083aa2 |
Walk object and mesh functions predicated at their barriers, and partial object threadgroups from their threads
What: the divergent-barrier pass (lower::simd::divergent::barriers) now covers object and mesh functions as it covers kernels: a workgroup barrier in a block Uniformity does not prove uniform makes the body walk predicated, so every invocation reaches it. Every object function now runs a drawMeshThreads partial object threadgroup (lower::mesh::plan_partial_groups no longer excludes a body with a barrier; RuntimeFact::PartialObjectThreadgroups). One whose body holds any workgroup barrier is walked predicated (Predication::partial_groups) from live = KernelDecl::live, the invocation being one of its threadgroup's threads (dispatch::emit_entry computes it in the entry block and hands it to the walk through CodeEmitter::entry_live/EmitCx::entry_live), so the invocations past a partial threadgroup's threads reach every barrier, and loop vote, as invocations that returned at entry, and run no other instruction of the body: no load, store or atomic of theirs is made. A body without a barrier keeps its early return. The vote word an object function's walk takes counts in its ObjectThreadgroupArena fact, which the binder checks with the encoder's lengths; where the word does not fit and the barriers are uniform, the function runs no partial threadgroup (the binder refuses such a draw as before). Why: an object function with a threadgroup barrier on a partial object threadgroup was refused (NotImplemented(MeshShading), a FAST-PATHS known gap), which kept the Metal3 mesh shading row false on every device; and an object or mesh function's barrier after a divergent early return or under a thread-dependent condition stood in non-uniform control flow, which Vulkan leaves undefined (an Intel GPU hangs on it). Docs: FAST-PATHS' known gap is gone; render/mesh.rs, bind/graphics.rs and the fact's docs say what runs. The Metal3 mesh feature rows (families/features.rs) lose their not_implemented(MeshShading), and the families test now expects the mesh shading row exact where the device runs the stages natively or as compute work. Tests: engine_mesh_barriers (new, over the owned fixture mesh_partial_barrier): every object function and the divergent mesh function predicated on every committed profile, their bodies' barriers all uniform by spirv::testing::barriers::workgroup_barriers_of (new: the check of a called body); partial draws instantiate; and the interpreter runs each emulated object function's partial and whole draws under BarrierRule::Vulkan giving the predicated reading. The old a_partial_object_threadgroup_of_a_body_with_a_barrier_is_not_implemented is replaced by a_partial_object_threadgroup_of_a_body_with_a_barrier_draws. SEMANTICS_VERSION 1973. Verification in the following commits' potluck runs. (cherry picked from commit 65660d13d001484e444c0f89b268f92b847976b1) |
||
|
|
8f2f973478 |
Announce a runtime sampler slot's YCbCr filter note only where the bound sampler filters
What: a filtered sample's note of a two-plane YCbCr format through Metal's own sampler (`PrecisionNote::HalfSampleFilter`, `FloatSampleFilter`, announced `ycbcr-filter-not-exact`) through a runtime sampler slot now holds only where the word of the sampler bound there filters. `lower::sampler::linear::filter_note` crosses the bound-format clauses with two tests of the bound word (`NoteOn::BoundSampler`, `SpecKey::BoundSamplerWord`, which the plan already records for noted keys): a linear min or mag filter, anisotropy or a cubic filter (any of those bits), or a linear mip filter, the constexpr rule `linear::unfiltered` read from the word. A constexpr sampler keeps its rule; an argument buffer's sampler, whose word no slot test reads, keeps the format-only clauses. Runtime: such a clause tests a bound value, so `Device::degrade_bound_values` reads it at each draw or dispatch. It now also answers `SpecKey::BoundTexelFormat` from the command's formats (the class `bound_texel_format` gives; a slot bound to nothing fails the clause, as `degrade_bound_formats` reads it; unknown formats hold), checks a filter note's kind as `ycbcr-filter-not-exact` (one atomic load once announced), and `degrade_clauses` announces a filter note's slot of unknown format (an execution of GPU-written commands) as that kind, naming "a format the GPU's commands bind", as `degrade_bound_formats` does. Which clauses hold stays a function of the plan (the shape it is planned for holds each bound format and sampler word), so render.rs's `QuietBoundValues` holds. Why: a runtime sampler slot announced the note whatever its sampler state, so a nearest runtime sampler on a texture that keeps its image (a 4:2:2 or 4:4:4 one on the M3) announced it though a nearest sample reads the one texel the view holds, Metal's read; the consumer runs notes fatal on Apple GPUs. Validation: `run_kinds` (degrade_notices) evaluates the bound formats through the same closure, and `bound_value_kinds` maps a filter note to `ycbcr-filter-not-exact`. Tests: `tests::engine_ycbcr_in_place::a_runtime_sampler_s_filter_note_holds_only_where_the_bound_word_filters` (clauses on moltenvk-m3 hold for linear min, mag, mip and anisotropic words over YCbCr formats, not for nearest words or other formats; lavapipe records none) and the lane test `runtime_lane::ycbcr_textures::a_runtime_sampler_announces_the_ycbcr_filter_only_where_it_filters`. Docs: the notes' rustdoc, `YCbCrFilterNotExact`, docs/API.md's two entries. SEMANTICS_VERSION 1973: the artifact's specialized notes change (no SPIR-V changes). Verified: cargo fmt; builds and runs follow. (cherry picked from commit d464b1d36f998cd8c69a9f2c9252288df64d13d9) |
||
|
|
efe9581bcf |
Map maxArgumentBufferSamplerCount in the porting guide
What: docs/RUNTIME-PORTING.md gets a table for the consumer's IdentityCaps (MTLDevice identity and size answers) with one row: sizes.max_argument_buffer_sampler_count, Metal's maxArgumentBufferSamplerCount, maps to DeviceProperties::max_argument_buffer_sampler_count. The row gives the derivation (one fewer than the smaller of a set-1 sampler array's elements, pipeline::heap_sampler_capacity, and maxSamplerAllocationCount) and marks it partial: 65535 on MoltenVK on an M3 Max, where Metal answers 500000. Why: the samplercount work added the property without a row here, so a port had no entry for the selector. The Item name is the consumer seam's field (reims-vgpu-core platform/caps.rs, IdentitySizes, on its current branches). Docs only. Checked against capabilities.rs (the field's rustdoc) and docs/API.md's accepted differences, which give the same derivation and values. (cherry picked from commit 866e5ab81bfee7ebcc521975a7c277d00ac20378) |
||
|
|
ee4a6c5b52 |
Bound texture ID placement by the handle table's reach
What: the runtime's set-1 image array capacity (resource_ids.rs `texture_arrays`, which texture placements and texture reservations are checked against) is now the least of the handle table's 65536 entries (bind::HANDLE_TABLE_CAPACITY, within which link sizes every heap array) and the update-after-bind image limits. Before, it was the limits alone. Each array carries what bounds it (`ArrayBound`): a device limit, named in the refusal as before, or the table. An ID past the table is refused Unsupported(ArgumentBufferTextures, NotImplemented), since no heap array on any device reaches it. `texture_arrays` and `check_capacity` are now free functions over the compile profile, so a test reaches them without a device. Why: this is the same gap `sampler_array` had before the samplercount work. MoltenVK reports 1,000,000 update-after-bind sampled and storage images, lavapipe 1,015,808, RADV 8388606, and ANV and NVIDIA more, so a texture reservation between 65536 and those limits was accepted. Yet no set-1 array holds such an ID: a texture placed there reads the neutral through its ID. Placements are unaffected in practice, since Metal's placement limit (16381) lies below the table's reach. Reservations of 65536 and more are now refused where they were taken. Tests: resource_ids::texture_arrays_reach_no_further_than_the_handle_table checks every committed profile: each array is at most the reach, the ID below its count is taken, and the ID at its count is refused naming its bound. It pins MoltenVK, lavapipe, RADV, ANV and NVIDIA to the table and the desktop baseline to its 128 sampled and 8 storage images a stage. Without the fix, the pins fail (moltenvk-m3: 1000000). A new device test, runtime_lane::resource_ids::a_texture_reservation_at_the_handle_table_s_reach_is_refused, reserves texture ID 65536 (refused, not implemented, where the device's limits reach past it) and 65535 (taken), printing a TEXTURE_RESERVATION line. REFUSALS.md is regenerated (check_capacity, 2 sites). Verification runs follow in the branch report. (cherry picked from commit 9629f473e25790aa573b03d6c4419d99127f33ce) |
||
|
|
570df3cc95 |
Answer maxArgumentBufferSamplerCount from the set-1 sampler array and the sampler limit
What: `DeviceProperties::max_argument_buffer_sampler_count`, Metal's `maxArgumentBufferSamplerCount`: one fewer than the smaller of a set-1 sampler array's elements and the device's maxSamplerAllocationCount (element 0 of the array, and one of the device's samplers, are the neutral sampler's; each state the array holds takes an element and a sampler of its own). The array's elements are a new public translator function, `pipeline::heap_sampler_capacity`: link's heap capacity for a heap of one sampler array with set 0 counting no sampler, the least of the handle table's 65536 entries (TABLE_CAPACITY) and the two update-after-bind sampler limits, 0 where a function cannot read a set-1 sampler array (the layout's features or the module's non-uniform sampled-image indexing). Link's heap_capacity now reads the same limit table (`heap_limits`) and arithmetic (`room`), and heap_set the same layout-feature check (`heap_layout_lacks`), so the sizing and the answer cannot drift. The runtime's `Device::sampler_array` (each state's creation-time check) now calls it too: it was the two update-after-bind limits without the handle table's reach, 500000 on MoltenVK where link makes 65536 elements, so a state past 65535 was not announced as it was made. The device's SamplerCount and the answer read one value, the identity's maxSamplerAllocationCount. Why: the consumer computed it as the least of the two update-after-bind sampler limits and maxSamplerAllocationCount; that misses the handle table's reach (500000 against our 65535 on the M3) and the neutral's element (32768 against 32767 on lavapipe, 4000 against 3999 on NVIDIA). Metal on the M3 Max (macOS 27.0.1) answers 500000 (a Swift query of MTLCreateSystemDefaultDevice, potluck job m3-max-2496), recorded in the field's docs and docs/API.md's accepted differences. Tests: engine_handles::an_argument_sampler_array_has_the_heap_sampler_capacity (link's array equals the function on every committed profile, follows lowered limits, 0 without the features); capabilities:: argument_buffer_samplers_are_one_fewer_than_the_array_and_the_sampler_limit (every committed profile, pinned venue values); the device test argument_sampler_count (the kernel's array, the device's count, the driver's limit and the answer agree; elements-1 states unannounced, the next announced). Verification follows in the branch's report. (cherry picked from commit 7a2b84f15a1dde81e35cbc0b9367962e54d8332f) |
||
|
|
296723b362 |
Test a filter notice's bound format against the format the slot's binding presents
The consumer's own-format view test died on the M3 Max (MoltenVK) in strict mode at a sample of an 8-bit 4:2:0 texture's 2D array view in its own format: `ycbcr-filter-not-exact`, "texture 0 bound as YCBCR84202P". That view is the luma view (`Texture::luma_view`): an `R8G8B8A8_UNORM` image of the codes, read as the code-reading format `RGB8_420_2P` through a swizzle, which Metal's own sampler filters as Metal filters that format (the lane already holds the view's linear sample to that format's, and Metal's view to it bit for bit). The binding plan reads the bound record's format (`ViewRecord::bound`, `RGB8_420_2P`), but the notice's bound-format test read `Texture::pixel_format`, the view's own (`YCBCR8_420_2P`), whose class carries the 1/2048 field `FloatSampleFilter`'s clause tests. So the note was wrong: no float texels are filtered there. The 10-bit views (`RGB10_420_2P` codes, `A2B10G10R10_UNORM_PACK32`) and the `_sRGB` twins' views announced it alike. `Tables::bound_format` now reads the format the texture's bindings present (`Texture::bound_pixel_format`, `ViewRecord::bound`), the one its slot's code was specialized for. That changes what the bound-format notices test and name for every texture that reads its image in another format: the luma views; views in other channels of their image's bits, whose class is their image's; and converted textures over a P3 surface, whose image is the code-reading format's codes. A P3 texture's linear sample is no longer announced: Metal's filter of it is not measured, now a FAST-PATHS known gap. Notices only: no pipeline, binding or answer changes. Docs: ycbcr.rs (views; linear filtering, with the in-place form's 4:2:0-only reach), the YCbCrFilterNotExact declaration and its API.md entry, and the FAST-PATHS known gap. Verified: cargo fmt. The lane check of the previous commit fails without this on the M3 Max; device runs follow. (cherry picked from commit 37a50861dd4e105619690a520a290c30bd3208d5) |
||
|
|
a2b99ee4f6 |
Report each write to a log of host pages in one batched call
The consumer measured DirtyCommit::report_host_writes at 77.7% of its present path on the RTX 5080: PagesLog::wrote_but called the source's hook once per run of the object's window in a guest RAM's log, about 9,000 calls a report for a 3840x2400 BGRA8 surface over scattered 4 KiB pages. PagesLog::wrote, wrote_as and a shadow's report did the same. DirtyPages gains wrote_runs(&[Range<u64>]) and wrote_runs_as(&[Range<u64>], writer), whose defaults call wrote or wrote_as once a run, in order, so existing sources keep working. Every write the runtime reports now comes to each log as one call carrying all its runs there: each range of a command buffer's writes in place (the bytes no shadow wrote, the gaps between the shadows' writes, in order), each shadow's write to the other logs, a copied host buffer's merge back (all its blocks, one call per log and copy, where it was one call per run of each block), a CPU write, and a shadow's copy back or merge (one run). For each source, the runs, their order and their writers are what the per-run calls carried. The runs gather in a thread-local buffer kept for the thread's next report, so a warm report allocates nothing (wrote_but also no longer builds a Vec per range to cut out the shadows' writes: one sorted list, swept). The internal DirtyHook calls the batched forms alone; its per-run methods went. The read side needs no batching: changed and changed_except already hand back every run of a query in one call. watch stays per run: a copied host buffer watches its runs once, at its making, not per report. Docs: the trait's contract for the runs (never empty, each non-empty, in the order of the object's bytes, apart in the object, not sorted by offset over scattered pages), its Batches paragraph, HostMemory::with_dirty_pages, the runtime README and HOWTO's guest RAM log; the api_signatures table blessed (two trait items). Tests: dirty_runs checks, over a memory log and a guest RAM log of 24 scattered pages, that a command buffer's report, a write with a shadow's merge inside it, a copy's merge back of three blocks and a CPU write each reach each log in one call per range carrying exactly the runs worked out from the window, and that a log keeping only wrote/wrote_as hears every run in the same order with the same writers. The bench gains a batched trivial log. (cherry picked from commit b69d6b70c49af0b0ab08db5fe2f8b78cd61ed2fe) |
||
|
|
b18b105cc0 |
Let a thread's own pass take the ready heads not behind, as the scheduler's does
A committing thread's pass (commit_and_submit) and a waiting thread's took only the line head committed first of all (Order::take_first, and claim_check's first_mut): any earlier commit held on any queue, its checks waiting for a signal to land or run by the scheduler's thread, sent every later commit to the scheduler's thread, a wake and a hop each, even a ready one on another queue. A consumer's video round (5080, 1 s windows) showed it: 879 commits, 741 passes at commit, 358 batches submitted there, the other ~521 batches the scheduler's (batches_held_past_a_look 522, heads held for checks 718, for check signals 129, for earlier commits 46; no event-value, host-step or binary-semaphore holds), scheduler_wakes_host 668. submit_plain_ready now takes its heads with Order::next and is_behind, the scheduler pass's own selection: the first ready head in commit order that waits behind no earlier commit keeping its place. claim_check takes the first head in commit order whose checks the thread may run and that is behind no earlier commit (no check before the batch it waits behind is submitted, as check_heads keeps). A held head so holds back only the later commits that wait behind it: its own queue's, and another queue's whose footprint runs in commit order with it. Order::take_first and first_mut, now unused, go with their two unit tests; the scheduler's next is tested by the rest of tests::scheduler. Test: commit_and_submit a_head_held_for_its_check_holds_back_only_the_commits_behind_it holds queue A's check on the scheduler's thread, then commits B (same buffer, behind A) and C (another buffer) with commit_and_submit: C is checked and submitted on the committing thread inside its call while A's check runs, B on the scheduler's thread after A; handlers in submission order C, A, B; one batch checked and submitted at commit. Before this change C's check ran on the scheduler's thread after A's (expected; the run's evidence goes with the landing report). (cherry picked from commit ff664020a1c7fe171ff15422e17b3c846624d94c) |
||
|
|
8a516f2255 |
Submit a queued commit_and_submit on the thread that runs its commit
Under RenderLoweringPolicy::Worker a commit whose last render encoder's end the lowering thread has not lowered returns at once and leaves its own work to the thread that lowers the end (render/queued_commits.rs). That run committed with Hand::Wake whatever the call was, so a commit_and_submit left so lost its inline pass: the scheduler's thread was woken for it and ran its checks and handlers. The queued commit now keeps the call's hand (State::queued_commit is Option<Hand>), and commit_queued makes commit_and_submit's pass on the thread that runs it (the lowering thread, or a program thread that settles it before a wait), with Hand::Wake on a thread command buffers' completion depends on, as commit_and_submit does there. The pass's submission checks and handlers then run on that thread. A render encoder opened there (by such a check or handler) lowers its calls at their calls: one that handed them to the lowering thread could wait for itself in reserve_end or wait_for_room. Test: deferred_calls a_commit_and_submit_after_an_end_in_flight_is_submitted_by_the_lowering_thread holds the slot so the end is in flight at the commit, then checks the check and handler ran on metal2vulkan-lowering, one pass at commit submitted and checked the batch, and an encoder the handler opened lowers at its calls. Without the hand kept the check runs on metal2vulkan-scheduler and scheduler_passes_at_commit stays 0; without the guard lowers_at_call is false. (cherry picked from commit bed9dc881cc1e6f18df708796da144a9072b9fb1) |
||
|
|
21a1cf7218 |
Give the commit hand-off's cost from idle too, and name commit_and_submit its inline form
docs/FAST-PATHS.md gave the scheduler thread's wake as 5 us on the RTX 5080 Laptop GPU, true for commits back to back, where the thread is awake. From idle it is far longer: with one fill committed every 2 ms (the completion latency lane), a commit's batch was watched 140 to 165 us after the call at the median on that GPU, against 5 us for vkQueueSubmit, and a parked thread's wake took 80 to 105 us at the median on that host. The row gives both, and names CommandBuffer::commit_and_submit as the inline form a program that needs the latency takes. (cherry picked from commit 880ffe3b551b585a7593784165a7b4ac11bc50ec) |
||
|
|
7d813def6f |
Regenerate the derived tables at stack 35's picks
The private-doc-link mend shortened the degradations! macro's note link and a refusal's doc link to in-scope paths, which moves the macro's template in api_signatures.tsv and one row of docs/REFUSALS.md; no item's signature changed for a consumer. The mesh change runs a partial object threadgroup, so the two mesh-object-draws-partial-threadgroup cases leave the conformance ledger (1378 rows to 1376) in docs/CONFORMANCE-COVERAGE.md, whose conflict the pick resolved to the earlier text. Verified: signatures.py --check, refusal_surface.py --check and conformance-coverage --check pass on this tree; metal-coverage is current. |
||
|
|
c305c66a7f |
Give mesh pipelines Metal's descriptor limits, state queries and refusals
The mesh descriptor gains Metal's fields, with Metal's defaults:
max_total_threads_per_{object,mesh}_threadgroup, max_total_threadgroups_per_mesh_grid,
the two threadgroup-size-is-multiple-of-width flags, payload_memory_length,
max_vertex_amplification_count (1) and required_threads_per_{object,mesh}_threadgroup. The
descriptor key reads every one.
A compiled mesh pipeline carries MeshPipelineMetalInfo (RenderPipeline::mesh_info), and the
runtime's RenderPipelineState answers Metal's five mesh queries from it, plus the two required
sizes. Each thread limit is the descriptor's maximum, else the function's
[[max_total_threads_per_threadgroup(n)]], else 1024, held to the device's own limit where that is
lower: the task and mesh stages' invocations with VK_EXT_mesh_shader, the compute stage's where
both stages run as compute work. The widths are 32. The grid limit is the descriptor's, else the
object function's [[max_total_threadgroups_per_mesh_grid(n)]], else 2^20, held to
maxMeshWorkGroupTotalCount where mesh functions run natively. Without an object function the
object stage answers 0 and 0, where the M3 Max answers 3 and 32 (an accepted difference).
DeviceProfile::emulates_mesh_shading says how a device runs the stages, so a consumer no longer
copies the compile layer's rule; with the getters, no separate per-stage query is needed.
What Metal refuses is refused as Metal's rule, DescriptorError::MeshPipeline with a
MeshPipelineProblem, measured on the M3 Max (mesh_pipeline_limits.m, plain and under
MTL_DEBUG_LAYER): a required size with an axis of 0, past 1024 threads or past its stage's
maximum, or for an object stage without an object function (process ends); a maximum past 1024,
a function maximum other than the descriptor's, a mesh stage's required size of other threads
than its maximum, and a payload past 16384 bytes (creation errors, codes 3 and 2). An
amplification count of 0 is VertexAmplificationCount, as a render pipeline's; one above 1, which
Metal makes, is NotImplemented(VertexAmplification), recorded in FAST-PATHS' known gaps.
payloadMemoryLength widens the object and mesh functions' payload arena past the declared type
(LoweringInputs::object_payload now reaches the object stage too); an object stage compiled on
its own without it is NeedsInput(ObjectPayload). SEMANTICS_VERSION 1971 and
ARTIFACT_FORMAT_VERSION 488 for that and the new artifact field; the runtime's warm record
format 4 for the descriptor's fields.
Docs: the new_mesh_render_pipeline_state doc now says how each device runs mesh stages, and
what it refuses; API.md's accepted differences gain the mesh pipeline rows. api_signatures
blessed (it also records RuntimeFact::PartialObjectThreadgroups from the partial-threadgroup
commit), api_surface lists MeshPipelineMetalInfo and MeshPipelineProblem, REFUSALS.md,
METAL-COVERAGE.md and CONFORMANCE-COVERAGE.md regenerated.
Tests: engine_mesh's a_mesh_pipeline_answers_metals_mesh_queries_within_the_device and
a_mesh_descriptor_metal_refuses_is_refused_as_its_rule over every committed mesh and
emulating profile; the validation lane's
a_mesh_state_answers_metals_queries_and_refuses_what_metal_refuses on a device. Not yet built:
the next steps are the M3, lavapipe and RTX 5080 runs.
(cherry picked from commit d6934967fad363ca2185c49935204141f253b416)
|
||
|
|
ead2c31249 |
Run a partial object threadgroup of drawMeshThreads as Metal does
What: a drawMeshThreads with an object function whose threads leave a partial object threadgroup now draws instead of failing with NotImplemented(MeshShading). The binder launches the object threadgroups the threads fill, rounded up, at their whole size, under MultiRegion 1, with Metal's threads in region[1].xyz and the new flag lower::dispatch::NONUNIFORM in region[1].w (a folded variant's record carries it in word 7). An object function whose body holds no workgroup barrier (lower::mesh::plan_partial_groups, RuntimeFact:: PartialObjectThreadgroups) reads the flag: its threadgroup answers min(L, threads - group * L) per axis as threads_per_threadgroup and in its simdgroup counts, its thread position is lin unflattened over that size, and its invocations past it return before the body. The emulated wrapper's payload copy strides by the dispatched threads so those invocations still copy. A body that holds a barrier keeps the uniform form and its partial draws stay NotImplemented(MeshShading), since the returned invocations would not reach the barrier (FAST-PATHS known gap). Why: Metal (M3 Max, macOS 27.0.1) draws these: 6 threads in object threadgroups of 4 run a threadgroup of 4 and one of 2 whose threads_per_threadgroup is 2, as dispatchThreads runs a kernel. Tests: lower::dispatch's partial_object_threadgroups_match_metal (each Metal thread live once with Metal's builtins, Spec and Flat forms); the binder's object_draws_specialize_each_stage_within_its_limits (the flagged region, MultiRegion 1, refused without the fact); engine_mesh's emulated and native partial draws and a_partial_object_threadgroup_of_a_body_with_a_barrier_is_not_implemented; the lane test object_draws_store_metals_words now requires Metal's words for both Threads rows; the conformance ledger's two partial rows are removed. SEMANTICS_VERSION 1970. Verification in the following commits' potluck runs. (cherry picked from commit 1707d3428bcd641faba462d4c35b13148df83a91) |
||
|
|
1f2b0f2d39 |
Run a command buffer's completion-seen handlers where seen even with completed handlers
A command buffer with completed handlers ran its whole transition to Completed on its queue's handler thread, its completion-seen handlers included, so they started a thread wake after the queue waiter's turn: the consumer's handler_cost bench (a completion-seen and a completed handler on each 4 KiB fill) put that wake into the completion-seen latency. On an idle M3 Max (MoltenVK 1.4.2) the turn-to-handler time was 22 us at the median with a completed handler against 1 us without. Now the waiter runs such a transition to its completion-seen handlers (To::Seen: its status final, those handlers run) where its queue's context is idle, and posts the rest (To::Rest: follow release, completed handlers, slot, releases, gate) to that context while it still runs it, so the queue's later items stay behind the rest. The rest holds its own Hold, so the gate, and wait_until_completed, open only after the completed handlers and once the context is done with the rest (the order a10704b730 set). A command buffer with a Follow (it signals at its end an event another queue's command buffer may wait for) keeps the whole transition on the handler thread, so the cross-queue order (follow.rs) is untouched. Where the waiter cannot run it here (the line busy, a deallocator held), the transition goes whole, as before (Item::whole). complete() is split into complete_seen() and complete_rest(), unchanged in order. Docs: add_completion_seen_handler, completion.rs, the runtime README and RUNTIME-PORTING. Not yet run on a device. (cherry picked from commit e1f36ec2f08735c92872a3d5eed8689b398373ce) |
||
|
|
5080707c8c |
Document the surface shapes and BC textures the runtime makes
linear_plan.rs gains **Block-compressed surfaces** and **Beyond the plane's rows** (the probe's measurements and what the runtime holds); new_texture_with_iosurface_plane names the new shapes and the SurfacePlaneShape refusal; TexelsPastBufferLength records where the M3 Max puts rows past a surface's end and that the x86 Macs' are unmeasured; FAST-PATHS.md's known gaps record the refused shapes and the taller-than-plane divergence on the x86 Macs, which IoSurfacePlane cannot hold as it carries no plane height. Regenerated docs/REFUSALS.md and api_signatures.tsv (RuntimeGap::SurfacePlaneShape). Verified: refusal_surface.py (0 variants without reach or basis); signatures.py --bless. Rustdoc runs in the next M3 job. (cherry picked from commit d3bb1dfa2aab94728518529a0b2020da4a3e76aa) |
||
|
|
a57e6c770a |
Copy a standing shadow in whole at its command buffer's first use
A pass that loads a shadow and draws under a scissor copied in only the scissor's texels, so the image held only those: a later command of the same command buffer reading every texel copied them all in again (beyond what it held), and the command buffer's end, holding less than every texel, left no standing. On the M3 the padded Private plane's Write frame (a scissored pass, then a pass sampling the surface whole) planned 9478144 texels in a frame and skipped only the scissor's 262144 (job m3-max-1937); WriteThenReadApart's writer never stood. At a command buffer's first use of a shadow that may stand across command buffers, the copy in takes every texel, as over logged host pages: it moves nothing where the image stands, and leaves the image holding every texel for the command buffer's later commands and its end. The device test adds a pass that draws inside four rows: its load takes the standing image, and the next command buffer's read stands and holds the pass's rows over the earlier texels. API.md's catalogue entry says the scissor cut does not apply to that first use. Verified: runs next on the M3 with the controls. (cherry picked from commit 258964cc06d8c4da64866b6991ec8b46906fa504) |
||
|
|
66ea975bdb |
Take a command buffer's tracked uses as its writes, whatever the logs collected
The standing let go of every shadow at each command buffer whose uses the device's logs of host pages did not collect (`unnoted`), taking that as a command buffer that may reach memory no use names. But `unnoted` only says no log or copied host buffer lived to collect them (`note_dirty`): the tracker's summary of every encoder holds its tracked uses either way. So on a device with no logs every command buffer let go of every standing, and none ever held (M3 job m3-max-1916: the second read of the Private plane skipped no copy in). Only `State::reaches_unnamed` (a root table, work resolved from records) lets go of all now. A shadow over a buffer whose own uses are untracked, whose writes no summary holds, never stands: the plane's texture takes its descriptor's tracking, not the buffer's. The module docs and the API.md catalogue entry say both. Verified: runs next on the M3, with the negative controls. (cherry picked from commit dcc32875db5aee8a8903ef9443235edce8de97cf) |
||
|
|
660f69188b |
Name the cross-command-buffer standing apart from a carry's, and say its cost
The standing commit's `shadow_standing::Standing` collided with shadow.rs's own `Standing` (a carry entry's Unread/Current/Lost), which failed the build (E0255). It is `StandingAcross` now. The ShadowedTexture notice's cost said every use copies in; over a tracked private buffer of the runtime's own a later command buffer now copies in only once another command buffer wrote it. The cost text and the API.md catalogue entry say so, and the entry names the conditions (the buffer's kind, no handed-out VkBuffer, a command buffer reaching unnamed memory letting go) and the counter. Verified: the M3 build that failed on E0255 (job m3-max-1857); this commit's build and the catalogue test run next. (cherry picked from commit 52986e4c999b6fbdb593c177265fd577cdcfe553) |
||
|
|
81d45b6d40 |
Conformance: ledger rows for the wide-gamut cases on the RTX 5080
The RTX 5080 Laptop replay of the 32 cases (NVIDIA, b5080 batch m3-max-1762, binary at aa91079622) made every pipeline and ran every case. The linear unwritten and masked cases match Metal code for code; the rest differ at their texels in the families the MoltenVK rows name, in the same shapes (the blend over the half shadow in the pixel interlock at one sample, the blends over stored codes and the runtime's resolve at four, the sRGB twin's encode through the device's Pow): a code from Metal's for the linear form, up to three for the sRGB twin at four samples. 26 rows, venue NVIDIA GeForce RTX 5080 Laptop GPU, in the MoltenVK rows' words. The run's other gap, dont-care-store announced by the depth-only unwritten pipeline, is the one 46ff85e725 already declares (that binary predates it). docs/CONFORMANCE-COVERAGE.md regenerated. (cherry picked from commit 0f5ffdf4b634171cfcbecc386a58942f9002dd34) |
||
|
|
38210e8938 |
Conformance: the wide-gamut cases on lavapipe, declarations and ledger rows
The lavapipe replay of the 32 cases (llvmpipe, LLVM 23.1.1, job m3-max-1679) made every pipeline, the four-sample ones included, and announced two notices the cases did not declare: extended-range-blends-stored-codes at one sample too (lavapipe blends over the input attachment, and the half shadow is built only for passes fetching in the pixel interlock), and dont-care-store for the depth-only unwritten pipeline (its pass stores depth DontCare). The blended draws and the blended masked write now declare the first, the depth-only unwritten cases the second; each loosens the notices site alone. 26 llvmpipe rows for the texel sites: the linear blends a code from Metal's, the sRGB twin up to three (four under the color mask), each saying which notes record it and what is open (the half shadow over an input attachment and at four samples; the stored-codes note's stated code does not cover an sRGB twin). The linear unwritten and masked cases match Metal on lavapipe. The translator test's note on lavapipe at four samples now says what it is: the committed profile states framebufferIntegerColorSampleCounts of one and no per-format count, so the profile refuses; the device itself renders them (this replay). docs/CONFORMANCE-COVERAGE.md regenerated. (cherry picked from commit 46ff85e7254d5626292ad8e906c484b7c94d4bcf) |
||
|
|
0f04983d25 |
Conformance: ledger rows for the wide-gamut cases' MoltenVK texel differences
26 rows, venue Apple M3 Max, one per texel site the MoltenVK replay of the new cases left unlisted (job m3-max-1657). Each says whose answer moves the codes: - linear BGRA10_XR at one sample: the shader's blend over the half shadow in the device's float arithmetic (extended-range-blend-source / -float-blend-source), one code; - linear at four samples: the same, plus the blends over stored codes and the runtime's resolve (extended-range-blends-stored-codes, extended-range-resolve, both announced), one code; open: the half shadow is single-sampled; - the sRGB twin: the same plus the encode through the device's Pow (device-pack-conversion), one code at one sample and up to three at four, which extended-range-resolve's measured bound covers; the unblended sRGB rows take the existing sRGB-twin family's words. The linear unwritten and masked cases need no row: they match Metal code for code. docs/CONFORMANCE-COVERAGE.md regenerated (`scripts/conformance-coverage/coverage.py`). (cherry picked from commit aa9107962298198722825148379784d1f5b546cc) |
||
|
|
d1b5ace93d |
Keep draws that read textures through the heap, at commit and at a host step
A draw that read the heap (set 1's heap set, the device's texture table or a sampler table) was never plain (render.rs draw_resident), so no execution of such draws kept a chunk: a host step of the replayed_textured page (5001 commands, each reading a texture of its own through an argument buffer) read and recorded all 5001 again at every step. Now a replayed draw that is plain but for its heap is kept where its set-1 binding is one a kept recording may bind again (heap_sets::bind's Bound::again): - the device has descriptorBindingUpdateUnusedWhilePending, so the heap set is the shared SetVersion that later writes update in place (heap_sets.rs); - the draw writes no set elements of its own (a function table's); - its set holds no shadowed texture, decoded twin or raw read (SetEntry::notes_nothing); - it reads no sampler table, and its tables bind no texture its heap part reads (HeapPart::binds_slot_textures). A kept chunk holds a Weak of each SetVersion its draws bound (KeptEffects::heaps). Running it again (KeptEffects::runs_again, heap_sets::bound_again) requires each to be its layout's current shared version with nothing noted, and pins it for the command buffer as a fresh bind does (HeapUse::bind_again). RenderKey gains the device's sampler_slots_changed count, so a sampler state made or released between steps records the kept chunks again. Draws that fall out are counted by why, new public WorkCounts fields: replayed_heap_draws_unshared, replayed_heap_draws_writing, replayed_heap_draws_noted, replayed_heap_draws_over_sampler_tables, replayed_heap_draws_table_textures. The replayed_frames lane prints them. Images in the heap set rest in GENERAL and its image infos name GENERAL; only an instance's own attachments move, as for a fresh recording. A kept chunk's run notes the uses its recording noted (EncoderCore::run_kept), so the tracker orders it after earlier writers as it orders a fresh recording. Verified on the M3 Max (MoltenVK 1.4.2), release, the replayed_textured page (5001 commands, 15018 resident buffers), 2 rounds of 3 frames, interleaved, b960f51b05 (this branch's base before commit 1; it carries the code of bfcfa638ee) against this commit: - frame 2 (the first step that runs kept chunks): host_step_ms 25.6/26.7 before, 7.4/7.3 now; encoding to completion 57.0/57.8 ms before, 38.8/38.3 now; host_step_chunks_kept 0 before, 20 now (every chunk); records_read 5001 before, 0 now. - frame 1 (the step that records the chunks apart to keep them): host_step_ms 27.4/28.7 before, 85.9/83.3 now; encoding to completion 60.1/60.3 ms before, 117.6/116.1 now. Each of the 20 chunks recorded apart gathers the page's 5002 resident uses (resident_uses_gathered 100044, against 5006 inline). It is paid once, at the step that first finds the records unchanged. - frame 0: 99.4/98.5 ms before, 102.9/101.5 now. - replayed_heap_draws_*: 0 in every frame. New tests: - runtime tests::kept_heap_uses (device test): the batches planned for a frame that runs both chunks kept hold the same tracked uses (resource, range, read and write stages and accesses) as those of the frame that recorded inline, the 512 textures among them (CommandBuffer::watch_planned, test-only). - lane kept_textured (two chunks, validation layer): a host step keeps the heap draws (frame 1 records apart, frame 2 runs kept, frame 0's pixels; the host then writes every texture's texels and frame 3, still kept, draws what a fresh page of those texels draws; where the device lacks the feature, every frame records inline and counts every replayed draw unshared); a kept draw reads what a blit in an earlier command buffer wrote, on the same queue and on another queue (a spinning kernel holds the blit back past the host step); a sampler state made between steps records the chunks again; a texture swapped at a token records them again; a texture made with a released texture's ID is read by the kept draws. - replayed_textured's commit-1 test now runs on a device made without descriptorBindingUpdateUnusedWhilePending (DeviceOptions::withheld_features), so each command buffer binds a heap set of its own and its draws stay not plain: it still covers commit 1's hand-back, and now also asserts that no chunk is kept. Negative controls, each fails its test on the M3: - plain_drawn set from the old plain rule (no heap draw kept): the keeping test fails; - run_kept noting none of the recording's uses: tests::kept_heap_uses fails (the kept frame's planned uses differ from the inline frame's); - RenderKey's samplers left out of its equality: the sampler test fails; - the resident key left out: the token-swap and gone-ID tests fail; - commit 1's hand-back dropped: the commit-1 test fails at frame 2 (674400 bytes copied). The pixel test a_kept_heap_draw_reads_what_an_earlier_command_buffer_wrote still passes on the M3 under the dropped-uses control: there the copies land before the kept draws read them anyway (expected cause: Metal under MoltenVK orders its tracked textures' writes itself; unaudited). The structural uses test is the check that fails. Checks run on the M3: clippy -D warnings with --cfg m2v_gpu over the runtime and validation crates (all targets, all features); the runtime suite (1659 passed; tests::kept_heap_uses passed on its own after its hook was keyed right); the residency, draw and notice lanes (248 passed); the kept, step and replayed lanes (62 passed; kept_textured and the commit-1 test run again after the last test edits, 6 passed); the frame-cost lanes in debug and release (3 passed); the API signature table (blessed for the five fields). (cherry picked from commit bc717ab533dbc4d36d47f355245857fd0d1fe773) |
||
|
|
f2fc42a95d |
Show a command buffer's kernel start only with its end, waiting or not
`kernelStartTime` answered the host time the scheduler began submitting the first batch as soon as it began, while `kernelEndTime` answered 0 until the last batch was submitted: a start without an end for as long as the submission took, and for as long as a command buffer that waits for an event after its first batch waited. Metal shows neither before both. A Swift probe on the M3 Max under macOS 27.0.1 (a potluck job, committed nowhere) read each command buffer's pair, start first, from its commit until it completed: 3,900 to 240,000 reads of each of six that waited for nothing, and 4.6 to 4.7 million over 200 ms of each of eighteen that waited for an `MTLSharedEvent` the host signalled or an `MTLEvent` another queue's command buffer signalled, after a blit encoder, before one, or alone. None answered a start and no end. The waiting ones answered both 0, `Committed`, until 50 to 160 us after the signal, then both; their start was 13 to 39 us after the commit, from before the wait. `kernel_start_time` now reads `KernelTimes::shown_start`: 0 until the end is stored, the start then (the end loaded first, acquire; the start is stored before the end on every path). The scheduler's own reads (whether to begin, a recovery's window, the GPU times' life check) keep the stored start, `KernelTimes::start`, so no scheduler file changes. Where the first command waits for the event, the runtime's start is that batch's submission after the signal, where Metal's is about the commit: recorded among docs/FAST-PATHS.md's known gaps. The users of the old order move to Metal's semantics: - rebind_reach's four held-buffer cases waited for `kernel_start_time() != 0` as the sign that the batch before the wait was submitted, which now never shows while it waits (they timed out at 60 s with 86701a2e00). They wait instead for the device's batches submitted to rise (`WorkCounts::batches_with_none_pending` and the three fields after it, which count a batch as it is submitted or held, at the place in `submit_batch` where the start was stored), through `property_reads::first_batch_submitted`; `walk`'s check that nothing was submitted before the event reads the same count. - property_reads_wait_for_no_submission_and_no_busy_work counted a read inside the submission as one that answered a start and no end. A read inside is now one begun after the kernel start and returned before the kernel end, on their clock (`host_time`), judged once the end shows from the most recent 2^16 reads each thread keeps; and the test asserts that no read of either thread answered a start and then no end. - New: property_reads' kernel_times_show_neither_while_their_command_buffer_waits_for_an_event, for both kinds of event: after the batch before the wait was submitted (the count), 50 ms of reads answer neither time and `Committed`; after the signal no read answers a start alone, and the start lies before the signal, the end after it. - New: tests::gpu_time::a_kernel_start_shows_with_its_end_alone. Tests: those above on MoltenVK (M3 Max, --cfg m2v_gpu) and lavapipe (--cfg m2v_cpu_icd); the negative control is `kernel_start_time` reading the stored start again, under which both property_reads tests and the unit test fail. (cherry picked from commit 2ce15a20927a8f7a44c1bc7ee70869977a88d702) |
||
|
|
e56b684d54 |
Record the packed word's blend refused on lavapipe among the known gaps
A blend or a partial write mask of a packed 16-bit attachment the device renders through its word view (`A1BGR5Unorm`, `ABGR4Unorm`) is built only where the device orders fragment fetch through the pixel interlock alone (`color_writes::stored_word`, `fetch::interlock_orders`). The known-gap line named the device without the interlock as where it is refused; lavapipe has the interlock but orders fetch through rasterization-order input attachments, and there the function neither blends the word nor merges its fields over the input attachment (`merges_over_input` leaves packed words out), so it is refused as the device lacking the format too. That is ours, not the device's: lavapipe orders the fetch an in-shader blend needs, as the extended-range blend over its input attachment uses. 98d65ecad3 made the multisampled word lane accept the refusal there; the ledger now says so. Docs only. Checked against the code paths named above and lavapipe's committed profiles (`profiles/lavapipe.json`, `gate-lavapipe-x86_64.json`: `fragmentShaderPixelInterlock` and `rasterizationOrderColorAttachmentAccess` both true). (cherry picked from commit 25b55132654d8b4c6554e9a0bc0a030820db22f9) |
||
|
|
39639ef473 |
Follow struct members in the narrow analysis: mixed-select merges and a read's noted bits
What. Two analyses in lower/arith/narrow.rs looked only at whole values, so a value carried
inside a composite slipped past both:
- `merges_mixed_selects` (now `narrow::merges`) decides whether a module merges a select of a
widened `half` against a value it does not hold widened with another widened value. Metal's
compiler answers 2045 of the 2046 `half` NaNs of that merge `0x7E00` (measured on the M3 Max,
2026-11-03), so a module that does it stays outside `DriverDeviation::MetalNanMoves`. It
checked only scalar selects at phis and stores, and missed the same merge when a struct (a
texel read's `{T, i8}`), an array or a vector carried the select and the other value. The new
module records how each value is made (construct, insert, extract, copy, select, phi) and asks
member by member, by a path of literal indices, whether a merged value holds a mixed select
where another merged value holds a widened one. Walks are bounded (256 steps per question, 256
members per type; past a bound the answer is the conservative one), and the records are charged
to the meter.
- `known_bits` reused a `half`'s read bits only when the stored value was the read itself. A
store of the read's value pulled back out of a struct (`{T, i8}` built from the read, then
`OpCompositeExtract`) encoded the `half` again, which is the device's narrowing and loses a NaN's
bits. The builder now records each struct construct, insert and extract it emits
(`ModuleBuilder::structs`, counted in its footprint), and `FunctionBuilder::member_source`
walks an extract back to the value that supplies the member wholly. A later insert into part
of the path, a struct the builder did not make, a load or a phi gives no source. `known_bits`
follows it before looking up noted bits.
Both decide from IR structure only (types, composite paths, operands), never from names.
Why. The coordinator's bug: `narrow::merges_mixed_selects` misses struct-wrapped merges, and a
store of a read's value does not see noted bits through the `{T, i8}` extract.
Docs: driver_facts.rs (the MetalNanMoves measurement) and docs/API.md's native-nan-encoding
entry now say the merge is followed member by member, and that a `half` moved unchanged from its
read keeps its bits through a struct's member too. The member-by-member reading is not measured
through a composite; the code and the docs say so.
SEMANTICS_VERSION 1968 -> 1969: translations change. The golden table moves 30 cells, all
`engine/rfs_imageblock_cover{.ll,.air.ll} | cover_two_word`, on every one of the 15 profiles.
That kernel's `as_type<half>` result is now stored from its noted bits through the struct
member instead of being encoded again. The table is re-blessed on development, not here.
Verified on the M3 Max (potluck, debug):
- New tests:
- `lower::arith::tests::narrow::narrow_members_move_as_bits_through_structs`: every
pattern of every narrow form, through a construct, inserts, a nested struct, and a
replaced member, compared exactly.
- `lower::arith::tests::narrow::a_merge_of_a_select_is_followed_through_struct_members`:
builder-made `OpPhi`s of a plain select and of structs carrying it by construct, insert
and extract are merges; a struct holding the select apart from the other value's member,
and a merge with a constant, are not.
- `tests::engine_arith::half_moves_are_metals_only_where_the_device_folds_them` gains
kernel `member_kept`: a `half` read, inserted into `{half, i8}` and extracted keeps its
bits (0xFE01) and widens nothing.
All three, plus engine_cross_class and engine_float_call_notes, pass: 15/15, job
m3-max-1192.
- Negative controls, with the translator sources of fd1029d6c9 under these tests (job
m3-max-1195): all three fail.
- The merge test fails at `Struct` (false, want true).
- The members test fails "Form { held: Float(Half), lanes: 1 } through a struct
(construct): 2045 of 65536 cases differ".
- `member_kept` widens on lavapipe (true, want false).
- Note sets: a census of every public fixture's entries (2914 rows per stem) on moltenvk-m3 and
lavapipe. It recorded each row's precision notes and whether it requires MetalNanMoves, before
(fd1029d6c9's sources) and after. The two files are byte-identical (job m3-max-1195), so no
fixture gains or loses a note on either device.
- Full metal2vulkan suite at an earlier stage of this change: 3335 passed. The 2 failures were a
since-corrected test expectation and the golden table above (job m3-max-1190).
(cherry picked from commit a4c235fb867a6a32098b77e39387c43a97a28862)
|
||
|
|
be34c40f1d |
Bound a packed blend by the code its sample was stored at
The multisampled word lane compares each blended sample of a format the
device renders itself with Metal's within one code. The blend reads the
sample the device's fill stored, which the lane already accepts a code from
Metal's (the device's conversion, `device-color-conversion`), and the device
blends over that code by its own arithmetic, so the two native differences add.
On lavapipe (Mesa 26.2.4, LLVM 23.1.1) `A1BGR5Unorm` at 4 samples, pixel 12:
the fill stored 0x9ea1 where Metal stored 0x9e61 (green 26 against 25), and
source-over at alpha 0.102 stored 0x9ea5 against Metal's 0x9e23 (green 26
against 24, blue 18 against 17); the exact blend over the device's own sample
is green 25.31, blue 17.44, so the device's blend is itself within a code.
The lane now allows a blended sample one code more for each code its stored
sample lies from Metal's (none on the word path, whose fill is exact).
`PrecisionNote::DeviceColorConversion`, `Degradation::DeviceColorConversion`
and docs/API.md's catalogue record the measured lavapipe bound: within 2
codes over a sample stored a code from Metal's.
Verified on msi-laptop, lavapipe (Mesa 26.2.4), `--cfg m2v_cpu_icd`: at
|
||
|
|
d261d6ed46 |
Announce device-subpixel-snap where the band draws on a driver not measured to snap a half step as Metal
line_widths' wide_lines_draw_metal_s_parallelograms (and its exact-answers
twin) failed on the RTX 5080 Laptop GPU (NVIDIA 615.71.09, b5080 entries
nvlane-lane2-a2f and nvlane-lane3-a2f at a2f4c50f94) and on lavapipe
(llvmpipe, LLVM 23.1.1, Mesa 26.2.4, nvlane-lvplines-a2f) at "rows
offset by (r - 32) / 512 width 0": both drew the map's rows 18 to 49
where Metal draws 17 to 48. Before a5e1d20bd9 the 5080 failed earlier in
that test, at "LANE strip 1", so this case had not run there.
The case draws lines at y = r + 0.5 + (r - 32) / 512, which the band
draws at width 1/16 (half width 16/512). band.rs leaves the corners'
snap to 1/256 pixel to the device's rasterizer, where Metal snaps the
endpoints first, a half step rounded up, and offsets them after; the two
agree on the grid, and for odd r the endpoint lies half a step off it.
Half steps rounded down give the device's map exactly: odd r covers its
row for r in 19..49 and even r for 18..48, against Metal's 17..48 (round
to even gives the same rows here). The band's arithmetic is exact at
these values (side 64, every conversion a power of two), so the rounding
is the rasterizer's, which Vulkan leaves to the implementation: the
device's own answer, so it is announced, not emulated.
- DriverFact::SubpixelSnapIsMetals (appended): the driver's rasterizer
snaps a vertex half a step off its 1/256-pixel grid as Metal snaps a
line's endpoint, up. Row: MoltenVK on the M3 Max (APPLE9), where this
lane's maps pass (a2f4c50f94, m3-max-994: 1847 of 1847). NVIDIA and
lavapipe drew otherwise, so neither takes it; every other driver is
unmeasured.
- Degradation::DeviceSubpixelSnap ("device-subpixel-snap", precision):
announced by line_route at each draw the band draws on a driver
without the fact. Its catalogue entry in docs/API.md, a FAST-PATHS
known gap, and the conformance suite's NATIVE_NOTES (the device's own
answer) take it. band.rs's and line_width.rs's docs say where the two
snaps differ.
- The lane announces it per draw; a band case with a vertex an odd
multiple of 1/512 pixel off (in framebuffer pixels) is left unchecked
where it is announced, and every other band case is still compared
with Metal's map. Held to the fact: never announced where the driver
has it, and some case unchecked where it does not and the device
tessellates. degrade_notices lists SUBPIXEL_SNAP as its site.
- driver_facts' profile test expects the fact on moltenvk-m3.
Note sets: MoltenVK on the M3 Max takes the fact, so it announces
nothing new. NVIDIA, lavapipe, RADV and ANV now announce
device-subpixel-snap at band draws. api_signatures.tsv gains the three
items (blessed); docs/REFUSALS.md regenerates unchanged. driver_facts.rs,
degradation.rs and line_width.rs are runtime pin inputs, so
RUNTIME_VERSION and the pin are the orchestrator's to move.
Verified: cargo fmt; scripts/api-signatures --check after --bless;
refusal_surface.py. Builds, clippy, the unit tests and the 5080, M3 and
lavapipe lane reruns are in the next jobs.
(cherry picked from commit 2574f4bb084656035feae4ef714bac96f720f497)
|
||
|
|
792822226e |
Take lavapipe out of LineTiesAreMetals: it leaves out the line lane's strip's first pixel
a5e1d20bd9 gave lavapipe the fact on the conformance case's evidence (llvmpipe draws primitive-type-restart-indices' line through (3.5, 1.0) as Metal does). The line lane on lavapipe says otherwise: at 3785e99d8e, under --cfg m2v_cpu_icd on msi-laptop's lavapipe (llvmpipe, LLVM 23.1.1, Mesa 26.2.4, m3-max-949), wide_lines_draw_metal_s_parallelograms and its exact-answers twin fail at "LANE strip 1": the strip starts at (3.5, 1.0), a vertex the diamonds of rows 0 and 1 share, and lavapipe leaves out row 0 column 3, which Metal covers; every other pixel of the map is Metal's. With the fact the lane held lavapipe to exactness there, and it failed. The fact's rows are now MoltenVK on the M3 Max alone, so lavapipe announces device-line-ties at its width-1 line draws as NVIDIA does: a notice lavapipe did not announce before, for a difference it drew silently before. driver_facts' profile test no longer expects the fact on the three lavapipe profiles; the fact's docs, the catalogue entry, FAST-PATHS' known gap and the lane's docs say what lavapipe draws. Verified: cargo fmt. The lavapipe rerun of the line lane is in the next msi job. (cherry picked from commit a13ef6b9c4aeb5bac7448bd1a16526352458169d) |
||
|
|
d9e3324d4e |
Announce device-line-ties where a driver breaks a width-1 line's diamond-vertex tie unmeasured
line_widths' wide_lines_draw_metal_s_parallelograms (and its exact-answers
twin) failed on the RTX 5080 Laptop GPU at "LANE strip 1": the
three-vertex strip at width 1, drawn in Bresenham's mode, put its
diagonal a row higher than Metal's (row 9 columns 3-4 where Metal draws
row 9 column 3 and row 10 columns 4-5, and so on, its last pixel at row
14 left out). The diagonal runs through vertices two pixels' diamonds
share; Metal covers the lower pixel, and Vulkan's diamond is open, so
the tie is the driver's with no Vulkan control over it. FAST-PATHS'
known gap "One line texel at a diamond vertex on the RTX 5080" already
said so for the conformance case primitive-type-restart-indices, but
the runtime announced nothing: a near-equivalent drawn silently.
- DriverFact::LineTiesAreMetals (appended): the driver's width-1 lines,
as the runtime draws them, cover Metal's pixel at such a tie. Rows:
MoltenVK on the M3 Max (APPLE9; its lines are Metal's own, the lane's
maps pass there) and lavapipe (the conformance case: no texel differs
on llvmpipe, LLVM 23.1.1, Mesa 26.2.4). Every other driver is
unmeasured, so NVIDIA, RADV and ANV announce.
- Degradation::DeviceLineTies ("device-line-ties", precision): announced
by line_route at each draw the device's lines draw at width 1 (a
plain-width draw of lines or edges, or the nearest width where that
is 1) on a driver without the fact. Its catalogue entry in docs/API.md,
FAST-PATHS' known gap (now "announced"), and the conformance suite's
NATIVE_NOTES (the device's own answer) take it.
- The lane announces it per draw, leaves such a case unchecked as it
does the other announced routes, and holds it to the fact: never
announced where the driver has it, announced in some case where it
does not. degrade_notices lists LINE_TIES as its site.
- driver_facts' profile test now expects the fact on the three lavapipe
profiles and moltenvk-m3.
Note sets: MoltenVK on the M3 Max and lavapipe take the fact, so neither
announces anything new. api_signatures.tsv gains the three items
(blessed); docs/REFUSALS.md regenerates unchanged. Not covered (left as
it was): a pipeline whose multisample state keeps Bresenham's mode off
(alpha to coverage, alpha to one, sample shading) draws the device's
default mode, which the fact does not measure. The runtime's notice and
line_width.rs are runtime pin inputs, so RUNTIME_VERSION and the pin are
the orchestrator's to move.
Verified: cargo fmt; scripts/api-signatures --check after --bless;
refusal_surface.py. Build, clippy, the unit tests and the 5080 and M3
lane runs are pending (the lane fixes batch).
(cherry picked from commit 75bb1413eacbf5ef3e1a3abed7ec97eff4b1c42d)
|
||
|
|
639e505b11 |
State NVIDIA's BC decode bound as the RTX 5080 measures it: 4/255 for BC1 to BC3, 7.4/255 for BC4 and BC5
compressed_decode's bc1_to_bc5_texels_read_the_device_s_decode failed on
the RTX 5080 Laptop GPU (identically at
|
||
|
|
751135f389 |
State a gathered 32-bit float denormal, flushed to a zero, in device-texel-conversion's bound
runtime_lane::half_read_nans::half_float_reads_hand_back_metals_nans on the RTX 5080 Laptop GPU (NVIDIA 615.71.09, at 961b1ff319): with the gathered NaNs taken (eb9a8db1ac), 24 lanes still differed, every one a gathered 32-bit float denormal (0x00000001, 0x80000001 in R32Float, RG32Float and RGBA32Float) handed back as a zero of its sign, where Metal hands back the texel's bits; the device's reads and samples of the same texels hand them back as stored. The gather is the device's texture unit's, which DeviceTexelConversion records off Apple GPUs; its bound named the gathered NaN, not the denormal. An under-stated bound. What: DeviceTexelConversion's bound (pipeline/artifact.rs) and docs/API.md's catalogue state a 32-bit float texel's denormal in a gather as flushed to a zero of its sign; the lane takes such a lane for Metal's where the device's texture unit is not Metal's. The note's condition is unchanged, so no translation, note set or classification moves. Verified: the 24 differing lanes of the 5080's run are each a flushed gathered denormal (the lane's HALF-READ-DIFFERS lines); the lane reruns in the next proof run. (cherry picked from commit ec73c51148a57302b1c6cc8f421c4b02692036e5) |
||
|
|
c6901502d2 |
Prove max_buffer_length's heap bound in the lane: a buffer one byte past it is nil, one of it is made
The lane's a_buffer_past_max_buffer_length_is_nil prints the device's max_buffer_length (MAX-BUFFER-LENGTH) and refuses a Shared and a Private buffer one byte longer as Nil(new_buffer, BufferLength), as plain Metal answers nil past maxBufferLength. The ignored a_buffer_of_max_buffer_length_is_made_where_the_heap_bounds_it makes a Private buffer of exactly max_buffer_length where the heap bound is below the compile layer's answer (the RTX 5080 Laptop GPU's) and refuses one byte more; it takes three quarters of the device's memory, so it runs only by name. docs/API.md's accepted differences name the proxy: the largest DEVICE_LOCAL heap stands for Metal's recommendedMaxWorkingSetSize, which Vulkan does not report. Verified: not yet built (potluck build queued). (cherry picked from commit 77fc830057352d11837826a8bb181ebb9a6bac5b) |
||
|
|
12497a0aad |
State a gathered 32-bit float NaN in device-texel-conversion's bound
half_read_nans failed on the RTX 5080 Laptop GPU (NVIDIA 615.71.09): a gather of R32Float, RG32Float and RGBA32Float hands back 0x7fffffff for every NaN texel (64 lanes each), where Metal hands back the stored words; the same texels read and sampled come back as stored. The gather records PrecisionNote::DeviceTexelConversion off Apple's GPUs, whose bound said every class but a half-float or small-float NaN is Metal's value. What: the bound (the note's rustdoc and API.md's catalogue) states a 32-bit float texel's NaN in a gather as the device's encoding, with the 5080's answer; half_read_nans takes a gathered 32-bit float NaN for Metal's where the device's texture unit is not Metal's, as it takes a half-float texel's NaN. No note is recorded differently, so no version moves. Verified: compile and the 5080 and M3 runs follow in the lane proof run. (cherry picked from commit 8e537ae9c2c3ad814c0973841b2454fa15d66120) |
||
|
|
fc79fdd4e9 |
Announce every NVIDIA RTX 5080 Laptop clear and plain fill off a whole code: its clears take either nearest code
runtime_lane::color_fills::plain_color_fills_are_the_device_s_clear (vkCmdClearColorImage of 762
colours into each of 70 formats) on the RTX 5080 Laptop GPU at
|
||
|
|
f1def3dffe |
Count a texel's half rounding as the measured conversion on MetalHalfConversion profiles
Re-applies 384734851d (reverted in the stack by
|
||
|
|
5dbf6f3be3 |
Revert counting a texel's half rounding as measured on MetalHalfConversion profiles
This reverts the stack's pick of 384734851d ("Count a texel's half rounding as the measured
conversion on MetalHalfConversion profiles"); SEMANTICS_VERSION goes to 1965, since the recorded
notes change back.
The stack 28 gate's M3 lane run failed
runtime_lane::cross_class_reads::argument_buffer_cross_class_reads_are_the_native_words: an
argument buffer's half read of an integer texture (R8Sint, RGBA8Sint, RG16Sint, RGBA16Sint,
RGBA32Sint, RGBA16Uint, RGBA32Uint; 66 of 2170 lanes) answers the device's quiet NaN 0x7e00 where
the slot's read of the same texel keeps its bits (0xfff5 and the like). The heap read rounds its
texel through float, and that rounding's narrowing no longer recorded NativeHalfConversion on
moltenvk-m3, so the stage carried no note that leaves a half NaN's bits to the device (the notes
were SetPastLayoutSupport, DeviceNanEncoding and HalfTexelConversion). The commit's measurement
covered the extended-range forms' codes, not an integer texel's bits read as half. Until a fix
keeps those bits or notes them, the note stays as it was before the change.
The doc conflict in driver_facts.rs (a later pick's measurement paragraph for the reverted rule)
takes the text from before the change.
Verified: not yet; the gate reruns the core suite and the M3 lanes on this tree.
|
||
|
|
4f32162f99 |
Regenerate the conformance coverage document for stack 28's cases and recordings
The coverage document is generated from the suite's sources and recordings; the stack's picks each regenerated it on their own base, so it is derived again here once over all of them. Verified: python3 -I scripts/conformance-coverage/coverage.py --check reports it as derived. |
||
|
|
95859dac16 |
Regenerate the conformance coverage document for the composited row
python3 scripts/conformance-coverage/coverage.py over the tree with pass-start-barrier-private-composited's recording: one more recording, case and Metal-run answer, and the Metal items the row reaches counted once more. (cherry picked from commit 0147b3a386081175dfaffa7c72513efac6def034) |
||
|
|
bc1d0ab837 |
Say in render-pass-split's trigger that a read of the clear alone takes a cleared copy instead
The declaration in degradation.rs and docs/API.md's catalogue entry both said a draw that reads a color attachment's texture after a memory barrier splits the pass. A read of the clear alone before any draw of the pass now reads its copy cleared to the clear in the pass's one instance where the copy can be (WorkCounts::attachment_read_clears), so both name that exception. Docs only; unverified beyond cargo fmt. (cherry picked from commit 1bcf89e89571bc7f65694c10ea34bdde6c3af6b0) |
||
|
|
de64560175 |
Name the pass-start read's cleared copy in the API guide's accepted difference
docs/API.md: a draw that reads the clear after a render-target barrier before any draw of its pass reads its copy cleared to the clear in the pass's first instance where the copy can be so (WorkCounts::attachment_read_clears), else an instance after one of the clear alone. Unverified: documentation of 4259b7f41c, whose runs are pending. (cherry picked from commit cc9312dcc9a97d5c663efbfea3f0f25374581249) |
||
|
|
d3f2bf185a |
HostRam: test a run-bound buffer against copies of its pages; copies' take wording
On gate/stack27b the HostRam copies (copy_from_host_ram, copy_to_host_ram) and the run imports compose: a copy reads and writes a chunk's pages through the chunk's import, and an object over a chunk not imported yet is bound in an import of its own run, two imports of the same pages ordered only by their host bytes (host_aliases.rs). New device test a_run_bound_buffer_and_a_copy_of_its_pages_order_by_their_host_bytes: four pages over a chunk not imported are bound in their run's import, and then, both ways: - a fill through the buffer before a gather of its second page; - a scatter into that page before a copy out of the buffer. Each way runs in one blit encoder (a barrier recorded between them), in two encoders of one command buffer, and across two queues in commit order (the writer behind 2 GiB of private fills). The six copies import nothing, and the run's import stays live. On a device with RuntimeDriverDefect::AliasedImportBlitsUnordered (MoltenVK) the test asserts the fallback: no run import, the buffer imports the chunk and lies in the copies' import. Docs: copy.rs's module docs and HOWTO said a copy takes a chunk "as an object does", importing it or waiting for its import; objects no longer wait, so both now say that a copy makes no run import of its own and waits. host_ram.rs and HOWTO add the copies to what a run-bound object's uses order against, and the test module's docs add the composition. Verification is pending in this commit: M3 and RTX 5080 device runs. (cherry picked from commit be6d43fbf2c0a5921a2468038740ef3604a2da9f) |
||
|
|
c074aa490e |
Document the HostRam window's direction, the runs' imports and their fallback
docs/HOWTO.md's "One run inside one chunk" bullet now says what the branch's runtime does: the window opens in the takes' direction, up or down the RAM; an object over a chunk not imported yet is bound in an import of its own run (run_bound_buffers_made, run_imports_live) and never waits for the chunk's fault-in; the price is up to one more allocation and pin per such object; and where the object falls back to the chunk's import (thread stopped, chunk failed or given back, allocations within the margin, a whole-chunk run, or RuntimeDriverDefect::AliasedImportBlitsUnordered on MoltenVK). It adds the measured result from tests/host_ram_window_bench.rs on the RTX 5080 laptop (NVIDIA 615.71.09), at 2b2419c67c: 256 2 MiB heaps upward, downward and scattered had no making of 5 ms or more (slowest 1.4, 1.5, 3.7 ms), against 2, 8 and 15 makings importing a chunk (slowest 8.2 to 8.7 ms) without the change; 128, about 76 and 20 heaps were bound in their own runs' imports. Docs only; verified by reading the text against host_ram.rs's for_object and after_take. (cherry picked from commit 25572e5af997da7009960fa31bf94c5d478e2370) |