ebfc68ebb795843032fbdc64406fbbffaeda20e7
1655
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
6605f18ddf |
harness, matrix: the frames' commit-to-complete row is gone after its one round
The planner's frame ruling showed the frames' old figure, their last command buffer's
commit-to-complete time (`<row>/commit_to_complete`), beside the new throughput row for one round,
unjudged, then deleted. The round at
|
||
|
|
ca92b2aa9e |
harness: a compute state row's first dispatches 64x1x1, the streams' commonest size; one thread beside it
The create_state row's first dispatched one thread (1x1x1), a size of few dispatches: 3.9% of the compute dispatches in the discrete replay recordings (from 3 to 5 kernels) and at most 0.5% in the unified ones, by identity's census of every stream's threadsPerThreadgroup. A runtime that compiles its pipeline for the dispatch's size (the old runtime) compiled the first at 1x1x1, where a program's first dispatch runs at its own size. The first now dispatches one threadgroup of FIRST_THREADGROUP, 64x1x1: the commonest size over the five streams of record, 24.1% of their compute dispatches (41.7% of the unified recordings', 7.1% of the discrete ones', where 128x1x1 leads with 39.3%; 128x1x1 is 23.3% overall). Each thread's 16 bytes are checked. Today's form stays beside it, shown and never judged: another content's first (the kernel with other constants) dispatched as one thread, create_state/first_one_thread (CreateReport::one_thread_first_us; results.SHOWN_FIRST). The name has no digits so the matrix's FIRST_KEEP keeps it from every creation process, which a results test holds. The warm-up stays at one thread. docs/VALIDATION.md and the crate doc say it; the authored device test asserts the compute row has the one-thread first. |
||
|
|
c1bd2d46d6 |
replay: a report of a stream recorded before the completion fix says so on its first line
The recorder's completion fix marks a stream with header flag bit 1, FLAG_COMPLETION_BYTES_RECORDED (value 2): at each command buffer's completion the stream holds every chunk the buffer's work could store to as the GPU left it, before any later CPU write, on all four late routes (signalled event, final status read, refused hook, released command buffer). Fixed streams read flags 3; every stream recorded so far reads 1. - The reader takes bit 1 (it refused any bit but 0 before), so a fixed stream plays. - command-replay play writes "recorded before the recorder's completion fix: the stream may differ from what the program did" by itself as the first line of report.txt for every stream without bit 1, so no table relayed from a report loses it. The stream is now read before the device type is parsed, so even a report that stops there carries it. - docs/REPLAY-STREAM.md: section 1 names the bit, section 6 replaces the rule that described a stream without completion writes as allowed with the completion invariant and what a stream without the bit may miss, and section 10 names the line and its place in report.txt. Tests: replay_completion_mark (integration) runs the player binary on a one-call stream with flags 1 (the report begins with the line) and flags 3 (it does not), with a device type no device has so no device opens; the header flags test now reads flags 3 and refuses bit 2. |
||
|
|
f1f846e636 |
rt docs: the consumer's own drivers in the guide, the validation ladder and the surface table
`Instance::with_drivers` and `Error::NoDirectDriverLoading` are public: the runtime's guide says what the call does, what it refuses and what it leaves to the consumer (loading the library and keeping it loaded); docs/VALIDATION.md says how a job runs the device tests through it (`M2V_DIRECT_DRIVER`) and what shows the path ran; the signature table takes the two records (scripts/api-signatures/signatures.py --bless). docs/REFUSALS.md regenerated unchanged: the variant refuses nothing Metal accepts, it says the host's loader lacks an extension. Verified: the generators' output; the build and the tests in the jobs named in the landing message. |
||
|
|
d3bfe3815d |
harness, matrix: a frame row is its throughput, and its latency from idle a row of its own
The planner's metric for the frame rows. A frame row's time was its runs' last command buffer's commit-to-complete time with two runs in flight, which mixes the time a frame adds with how long it waits behind the one before. Now `frame` and `frame_5cb` (Plan::frames) carry two figures, each the steady time (best window of ten) of the harness's own completed-handler times: - THROUGHPUT, the row of record (matrix_time): two runs in flight, from one run's last completed handler to the next's. The pairs around the waits that read the gauges after runs 100 and 200 (GAUGE_RUNS) are left out, as an untimed run sits between them. - LATENCY FROM IDLE, the row `<row>_from_idle` (FROM_IDLE): as many runs again after the timed ones, one in flight, each committed once the one before it completed, from just before its first commit to its last completed handler. The completed handlers now report the time of their commit and of their own run against one origin (Completions, Handled), so the commit-to-complete times, the throughput and the latency come from one record. The frames' commit-to-complete time is still printed, as `<row>/commit_to_complete`, which the matrix shows and does not judge (SHOWN_ROWS) for one round. Each latency row takes the ceiling and floor its workload's row has (listed_row), in the budget, the over table and the re-time selection, and is re-timed through its workload's runs. Other workloads are unchanged, long_4cb's commit-to-complete time included. The shape follows core's one-run-in-flight probe (3eaec97076), without its environment gate. Verified: test_results (a new test: a latency row past its workload's ceiling and the budget, the commit-to-complete row shown and never judged, the over table and the re-time selection choosing the latency rows); the harness's unit tests gain the throughput and latency arithmetic (the gauge pairs left out) and matrix_time's frames case; the harness gate job named in the landing message runs clippy, rustdoc, the unit tests and the authored workloads on lavapipe. |
||
|
|
6d4ca09039 |
translator: a render pipeline into a snorm attachment records SnormMinimumKept on Device::from_queries
metal2vulkan-rt's conformance side ran the six snorm-store cases on lavapipe (job 48051). Each diverged where Metal's tile store writes a loaded minimum code (-128, or -32768) back as the code above it, and the device's pass keeps the bytes. The old runtime announces that as `snorm-minimum-kept` at the draw, from its encoder (render/tile_store.rs). The new runtime has no such encoder step, and the translator recorded no note, so the answer went unannounced. A missing static note is a bug (rule 1: a static note fixed per operation). - `PrecisionNote::SnormMinimumKept` (appended): the note of a render pipeline that draws single-sampled into a color attachment of R8Snorm, RG8Snorm, RGBA8Snorm, R16Snorm, RG16Snorm or RGBA16Snorm. - `pipeline::private_state::note_snorm_minimum` records it on the fragment stage (the vertex stage where there is none), whatever the pass loads. That is static, so it may over-announce a cleared pass. - It is recorded only where the profile's new fact says `SnormMinimumNote::Noted`. That is `Device::from_queries` (ProfileFacts::EVERY); `Device::new` (ROWS) stays `Announced`. `Device::new`'s modules, keys and the old runtime's announcement are unchanged. - The old runtime maps the note to its existing `Degradation::SnormMinimumKept` (an explicit `from_precision_note` arm). Validation's comparison allowance is Unbounded, as for the other device-answer notes. The codec takes the variant, and ARTIFACT_FORMAT_VERSION goes from 536 to 537. fast_paths lists the note under Elsewhere. api_signatures gets the two variant rows and the macro row. docs/API.md's `snorm-minimum-kept` entry says where the static note is recorded. Test: engine_private_render_state's a_snorm_attachment_notes_the_minimum_code_metal_s_pass_rewrites. On lavapipe and moltenvk-m3, for each of the six formats, the note is on the fragment stage alone through Device::from_queries and on no stage through Device::new. No stage records it at four samples, or into RGBA8Unorm or RGBA16Float. The six conformance cases on the rt side are the end-to-end test (the check job's replay, named in the report). |
||
|
|
58229ccd71 |
replay: a copy back to the guest's RAM plays as buffer copies into a sink
The new runtime's backend skipped m2v.copyToGuestRam and counted it, so every play's verdict ended at the first one (u2 frame 97, u3 frame 99), though nothing in a play reads that RAM. The planner ruled it does not end the played range, and that work the recording host did live plays as the runtime's, cost included. It now plays as the old backend's does: each run copied by the blit encoder, in its order, into a Shared place of the play's own that nothing reads, each run widened to the whole words it touches within the buffer (a buffer copy takes whole 4-byte words). The place is given back at the command buffer's commit, as a copy from the guest's RAM gives back its staging. The report counts the bytes (copied_back_guest_ram_bytes); skipped_guest_ram_reads is gone. Verified: see the check job (a new rt_replay device test: nothing skipped, the widened bytes counted, the buffer's bytes kept). |
||
|
|
02eaf89136 |
matrix: the report ends with one table of every row over its limit, with its status
Two legs of eleven passed and every red was known, so the reds were no longer read. The report (`matrix run` and `matrix show`) now ends with one table: every harness row over its limit on every leg (results.over_rows, the rows harness_budget fails or names as its card's variance), with its kind (GPU time, host time, or count for the instructions gate), its ratio and limit, the frozen arm's verdict (VOID, stands, rebased, no base) and its status. The status comes from scripts/matrix/status.tsv, one typed entry per card and row (a `*` in the row matches any run): an open record with its owner and first round, whose age the table counts in rounds; a known gap with the place it was ruled; or a note alone. A row with neither reads NEW in the first round it is over (not over in its leg's base) and UNOWNED after; a CARD_VARIANCE row reads as its card's known gap. The table changes no verdict: the red rule waits for the planner's ruling. Seeded from the rulings so far: NVIDIA create_64MiB/first_take, a known gap (the 2080 and the 3090); create_64MiB on AMD, a note that it is no known gap and is unjudged until the first interleaved round; the Iris Xe's GPU-time rows, a note of one time-boxed investigation after that round; the Iris row_cells, identity's open record (first over at |
||
|
|
65aac391c2 |
matrix: the frozen arm compares only rounds of one harness, one old runtime and one shape
The noise meter read the old runtime's move between two rounds as noise even where the harness or the old runtime changed between them ( |
||
|
|
3027cf9b68 |
matrix: each creation process times both runtimes, the new runtime first
The creation rows ran in five processes per runtime, all of the old runtime's before the new runtime's, so a node or clock that moved between them moved one runtime's samples alone, an order effect. Each of the five processes now times both runtimes, `--runtime new,old --only 'create_*'`, on its own fresh driver cache and store: a creation's first sample on the new runtime is cold, and the old runtime's follows it on the same cache. FIRST_KEEP takes each sample's runtime from its line. The median of five per runtime and every row, ceiling and floor stay. Verified: test_matrix's harness-run test (five `new,old` creation processes, both runtimes' samples kept once each) and test_results' creation test (FIRST_KEEP keeps the old runtime's sample beside the new's and drops a GPU line); the Linux and Windows job scripts pass `bash -n`. |
||
|
|
abf3d4133d |
matrix: both runtimes' rows are timed in one process, their passes alternating
Two cards showed the noise the old runtime's frozen arm measures: the Iris Xe's frame moved 2.8x between rounds, the UHD 630's about 2x between passes of one process. The leg timed each runtime in a process of its own, one after the other, so a clock or a co-runner that moved between them moved one runtime's times and not the other's. Now one process times both, `harness --runtime new,old`: each workload runs on the new runtime, then on the old, so their passes alternate on the GPU and the node as they are at that moment. The new runtime runs first in each workload, so its first uses, the judged cold ones, compile before the old runtime's of the same workload, as cold as in a process of its own. The process is the leg's one suite, `harness`; a failure still names its runtime (`M2V-FAILED harness-<runtime>/<row>`). The creation rows keep their five fresh processes per runtime, now alternating old and new; rows over their limits are re-timed alone as before. No row, ceiling or floor changes, and the deterministic records are untouched. The frozen arm's column (FROZEN_DRIFT) stays the check on it. Verified: test_matrix's new test runs the leg's timing script against a stand-in harness: one `new,old` process, the new runtime's warm run, the creation processes alternating, one suite whose records hold both runtimes' rows once each. The Linux and Windows job scripts render and pass `bash -n`. |
||
|
|
06b940f810 |
matrix: the frozen arm is the noise meter: a row whose old time moved past 10% on the base is VOID
The old runtime takes regression fixes only, so its time of a harness row moves between rounds
with the node, the driver and the harness, not with the change under test. Each leg now compares,
per row, the old runtime's time the row is judged on (its GPU p50 where gpu_judged, the median of
the five processes for a creation row's first sample, else its time) with the same time in the
leg's base, the previous round. Past FROZEN_DRIFT (10%) either way, harness_budget names the row
VOID and judges nothing from it: its comparison comes from a re-time in one process with both
runtimes interleaved. The report (run and show) shows the move on every row the base has, and a
line per leg naming the void rows; show computes it from the notes, so a round already noted is
read with it.
Verified: test_results (47 tests, a new one for the void rule, the GPU and median-of-five forms,
no base, and the column). `matrix show 140714ceae` against its base
|
||
|
|
40e135c308 |
replay: the new runtime's backend rounds each buffer's place to its recorded granule
The backend packed buffers first fit at Metal's 256-byte alignment, so a program's write past a buffer's end landed in the next buffer. A recorded stream's program did that: an append list of 4000 records took about 870 more on one play, and the overrun went 17340 bytes into twelve 4-byte counters and the start of a 48000-byte buffer that the player had packed behind it. The recording had given each of those buffers its own 32 KiB-granular range, so the same overrun landed in the list's own slack there. The clobbered counters then feed the next rounds; a 780M page fault past a 64 MB buffer and a hang on a 3090 follow them (expected, the proof plays pending). Each buffer's place now spans its length rounded up to its recorded granule: the largest power of two that divides its recorded gpuAddress, from 256 bytes to 64 KiB, and 256 bytes where the stream records no address (the player's own staging included). Both copies of a two-copy Managed buffer take it. A buffer past the class's block length takes a block of its own of the rounded span. The backend's new "places by recorded granule" line counts the places by granule and gives the most bytes of slack held at once. Test: rt_replay's buffers_keep_the_slack_of_their_recorded_granule plays two 4-byte buffers recorded at addresses of 32 KiB and 64 KiB granules and reads back their relocated addresses from a third: they lie apart by at least the lower one's granule (256 bytes apart before). docs/REPLAY-STREAM.md says how the backend places buffers. |
||
|
|
795c834ded |
Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development` while this branch was in flight, so the copy committed here counted a smaller one. Verified: regenerating at this tip leaves no change beyond the `Generated at` stamp. |
||
|
|
d6a1a86d98 |
translator: the one-row variant leaves out the barriers of pairs apart in rows on every device; CompiledFunction says whether a kernel's lockstep barriers run in rows
LoweringInputs::one_row's lockstep order cleared the pairs that meet only where a SIMD group spans two rows only where Lockstep::rows held, which needs maximal reconvergence on 32-lane subgroups without the device's own lockstep: the old binder's condition for asking the variant. On a device without that tier (lavapipe's 8-lane subgroups, the UHD 630 without the extension, GCN's 64-lane waves) a one-row compile kept every barrier, though the clearing is exact there too: in a threadgroup whose SIMD groups each lie within one row, those pairs never meet, whatever runs the SIMD groups. The order now searches the pairs under the rows facts for every one-row compile and clears them wherever every pair left wants a threadgroup barrier at most. Lockstep::rows and RowLockstep keep their meaning, so Device::new's plans, and the old binder's one-row compiles, which it asks only where rows holds, are unchanged. CompiledFunction::runs_lockstep_barriers_in_rows (KernelFacts::lockstep_in_rows) says whether a kernel's lockstep order inserted a barrier that runs where each SIMD group lies within one row: any but the threadgroup barriers that order only pairs meeting across rows (Lockstep::across_rows), which the module runs only where its local size lets a SIMD group span two rows, a test the driver folds. Only where it holds can the one-row variant run fewer barriers than the kernel's own module at a one-row size, so a runtime asks the variant only there. It is decided from the plain compile's order and changes no module. docs/API.md states it; the api_signatures table gains its row. SEMANTICS_VERSION 2181 -> 2182: a one-row compile on a device without that tier changes. The old runtime's render descriptor key is re-pinned under it (b3d05d42). ARTIFACT_FORMAT_VERSION 536 -> 537: KernelFacts gains lockstep_in_rows. Test: a_one_row_variant_clears_the_pairs_apart_in_rows_without_a_32_lane_tier, on lavapipe's from_queries profile under the identity domains. Three kernels, each with its stores in its entry block and past a bounds test (six in all), keep lockstep barriers in their plain module and state no RowLockstep: - one storing the three words 3 cell + k of its cell y * stride + x in int arithmetic, as Apple compiles it (nsw on every step, the index sign-extended); - the same in uint arithmetic, whose steps carry no flags; - one whose threads store at x and x + 1. In the one-row variant the first has none. It states OneRow, takes no simd class, does not observe its partition with partial threadgroups (the variant without one_row does), and runs its grid in tiles. The other two keep their barriers: the wrapping index is not proved apart in rows, and the neighbours meet within one row. Every plain module runs its lockstep barriers in rows but the unguarded int cells kernel's, whose barriers all order pairs across rows. Verified: - Check 48214 (msi) at this series' tip on development |
||
|
|
051236c0c2 |
replay: a placement over an equal sampler state's index does not wait, and one a held commit owes stops the play
u3 stopped at player frame 259: the placement of a sampler state at index 16 waited for commit 1614 (#20713), which rt held at Committed because it waits for event #35 to reach 309, which only command buffer #20439 signals, encoded 20 records later. The program had released #10401 (index 16, bound directly by #20713) and made #20822 with the same descriptor the next call; Metal gave it ID 16 again. Nothing changed for the work in flight, and the original run did not wait (it could not: #20713's signal was not yet encoded). - A sampler state whose recorded descriptor is the one placed last at its index takes the index without waiting, counted on the indices line; the index stays owed for another sampler state. - The player tells the backend, at each look for command buffers to wait for, the committed ones no record played so far lets complete (Backend::held: their unmet event waits, or a held one ahead on their queue). A placement owing its index to one of those stops with PlayError::Held naming the chain, instead of waiting for ever. - docs/REPLAY-STREAM.md says what record order does not promise (a committed buffer may wait on a later record's signal) and what the indices line and the stop say. Tests: a unit test of the equal rule in Indices; rt_replay device tests of our own sequence: an equal sampler state at an index a held commit owes plays through without a wait; another descriptor there stops with Held naming #6 and its unmet wait. Check follows. |
||
|
|
4fbe03c3a0 |
rt: maxColorAttachments of 8 joins the floor, and the pass's colour-attachment limit goes
The floor now requires maxColorAttachments of at least 8, Metal's eight colour attachments
(MAX_COLOR_ATTACHMENTS, the render pass descriptor's slots). Vulkan 1.3 requires only 4: the
spec's Required Limits table (Table 76, vkspec 1.4.366) lists maxColorAttachments as "4 (Vulkan
Core) 7 (Vulkan Roadmap 2022) 8 (Vulkan Roadmap 2024, Vulkan 1.4)", min. A device below 8 is now
named below the floor at creation ("maxColorAttachments 7, below 8"), so a pass's colour
attachments, at most the descriptor's eight slots, never reach past the device's. The check in
pass.rs and its refusal, Limit::ColorAttachments, could no longer fire and are deleted.
Breaking, intended: the public variant metal2vulkan-rt::Limit::ColorAttachments { count, max } is
removed (api_signatures.tsv loses that one line, blessed). docs/REFUSALS.md is regenerated (the
new runtime's Limit goes from 10 to 9 variants). The README's limits table gains the row and the
Limits paragraph the spec's minimums; the render pass passage says a pass may use all eight.
The floor test's low-limit cases go from 16 to 17 with the maxColorAttachments case.
|
||
|
|
518800af99 |
rt: a wait in a handler or a listener for what its own thread does next is a typed refusal
The completion thread runs a device's completed handlers and listeners, and it is the thread that marks a command buffer completed, an event's GPU value observed, and a queue's place free. A wait there for any of those not yet done could only end by that thread's next step, so it hung by construction. Each is now Refusal::WaitOnOwnThread, and a wait already met answers at once: - wait_until_completed: Ok for a command buffer completed or ended, the handler's own among them, else the refusal; nothing is sent. - wait_until_scheduled: the refusal for one not yet scheduled. - SharedEvent::wait_until_signaled_value: Ok(true) for a value reached, else the refusal. - CommandQueue::command_buffer on a queue whose maximum count are made and not yet completed: the refusal on the completion thread and on the submit thread (a scheduled handler), whose next steps free the place. The condition is the program's own state (what it committed, what has completed), never a ring's fill. Outside a handler every wait answers as before. Test: every_device_refuses_in_a_handler_each_wait_its_own_thread_would_have_to_end checks 15 answers in a scheduled handler, a completed handler and a listener. REFUSALS.md regenerated and the signatures table blessed: Refusal gains WaitOnOwnThread (a new variant of a non-exhaustive enum; no consumer breaks). |
||
|
|
ea8e7843b7 |
rt: scheduled handlers run on the submit thread, before their submission, and wake no thread
The consumer adds a scheduled handler to every command buffer. The submit thread handed each command buffer's scheduled handlers to the completion thread (Done::scheduled), and where that thread waited on the GPU the hand-over was a host vkSignalSemaphore of its wake timeline, on every submission. On NVIDIA a host signal per submission measured 103-117 us of CPU a command buffer on an RTX 3090 (the waits probe's rt arm, job 47928), against 2.9-3.5 us for every single wait form, rt's own steady-state WAIT_ANY included. Now the submit thread, which already marks a command buffer scheduled as it joins a submission, runs its scheduled handlers itself once it has dropped its lock, in queue order, before that submission goes to the driver and before any of those command buffers is handed on as ended. So the status reads Scheduled and the kernel times are set in the handler, a command buffer that ends before it joins a submission runs none, as before, and the scheduled handlers run before the completed ones by construction. Done::scheduled, its list and the completion thread's branch for it are deleted. A handler on the submit thread may not call what waits for that thread to submit. The four internal sites that do (Work::room, Work::capture, Work::stage and the readback's flush and Done::wait) give the public entries that reach them; each is now Refusal::InScheduledHandler in a scheduled handler, on every device and whatever the runtime holds: commit; wait_until_scheduled, wait_until_completed and SharedEvent::wait_until_signaled_value; replace_region, upload_region, get_bytes and zero_block_range; new_managed_buffer, and new_buffer zeroing a buffer in a Private block. The one consumer's scheduled handler makes none of these calls, and a guest's addScheduledHandler block runs in the guest. Quiesce in a scheduled handler answers false at once (neither the submit thread nor the completion thread, which the submit thread stops as it ends, is waited for), and a device whose last handle drops there tears down on the reaper, as from a completed handler. For a consumer: CommandBuffer::wait_until_scheduled and wait_until_completed now return Result<(), Error>, and SharedEvent::wait_until_signaled_value returns Result<bool, Error> (api_signatures.tsv blessed); docs/REFUSALS.md regenerated; the README's contract says where each kind of handler runs, what a scheduled handler may do, and that it holds its queue's later submissions while it runs. Tests: every_device_tears_down_from_a_scheduled_handler, every_device_answers_false_to_a_quiesce_in_a_scheduled_handler, and every_device_refuses_each_call_that_waits_for_the_submit_thread_in_a_scheduled_handler (each refused entry by name, the allowed calls, the status and kernel times in the handler, and the same calls answering once it has returned). Verified by the next jobs. |
||
|
|
99ec109264 |
harness: each creation row's first is a fresh object's on a device that has made one of its kind
A creation row's first sample was the first of its kind in a fresh process, so it held the device's own first use (its first recorder, submission, upload, staging region, stamp pool) together with the object's. A guest keeps one device for the machine's life, so what a device pays once never reaches it. The planner ruled that every first row is judged on a new object's first use on a warm device. Each creation row now makes a warm-up of its kind first, made and used as the first is and kept until the first is done, then the timed first on a fresh object: - Shared and Private buffers: a buffer of the same length, kept, so the first takes memory the warm-up did not give back (a new 16 MiB Private block on rt's harness placement); the next take still follows the first's release. - compute states: a state of another authored kernel (lcg_step, bound as signed_zero_products is), created and dispatched once, its word checked; - render states: a state of another fragment function (sampled_fragment) with the row's vertex function and attachment. The warm-up's time is its own record, `<row>/device_first`. The matrix shows it with the ratio of its medians and never judges it (results.SHOWN_FIRST now names each shown sample with its reason). time_states takes the first as its caller timed it; its other form had no caller left. Tests: a host-buffer device shows the buffer row's order (the warm-up alone, the first and the next beside it, the timed ones alone); the matrix shows a warm-up and judges the first it comes before; the device test checks every row records its warm-up. |
||
|
|
4da77d8518 | FAST-PATHS: what an NVIDIA host whose type 0 reads right loses to the Shared dma-buf refusal | ||
|
|
1d5226bef7 |
runtime: a Shared dma-buf import takes host-coherent types only, and none where its first is not
The old runtime imported a Shared no-copy buffer's dma-buf on NVIDIA as type 0 (system memory,
no property flag): its udmabuf order (system-memory types the host maps last) puts type 0
before type 4. A type without HOST_COHERENT promises nothing of what the caller's own mapping
of the pages and the device see of each other's writes, and Shared memory's bytes are exactly
that; the consumer's probe showed wrong bytes there.
The form, decided by the memory types' flags alone (no fact row, device check or switch):
today's order is computed unchanged (memory::dma_buf_order, the former dma_buf_candidates);
for MemoryClass::Shared, dma_buf_candidates then keeps only its host-coherent types, in its
order, where its first type is host-coherent, and none where it is not. An empty order tries no
import and refuses as ImportFailure::NoMemoryType, which callers already map to not_importable()
("host memory this device cannot import exactly"), so what it would back takes the refused
dma-buf's path, a copy of its pages. Type 4 is never tried: a refused import there breaks every
later exportable device-local allocation for the device's life (tests::export_after_dma_buf).
Private and the other classes keep the order whole (type 0 on NVIDIA as before).
Tests:
- tests::memory::a_shared_dma_buf_import_takes_host_coherent_types_or_none: over NVIDIA's,
ANV's, RADV's (discrete) and lavapipe's types and udmabuf bits, the first type before and
after is the same but NVIDIA's (0 before, refused after, no attempt), and every other class's
order is unchanged. The order tests name dma_buf_order.
- tests::export_after_dma_buf::a_shared_dma_buf_import_is_host_coherent_or_refused_untried
(device test): where the order is empty the import is refused and exportable Private buffers
made after it still lie in device-local memory with no overflow; elsewhere it imports as a
host-coherent type and a Shared buffer over it shares bytes both ways (the GPU's fill read
through the caller's mapping; the CPU's writes there read by the GPU's copy).
docs/FAST-PATHS.md's known gap on NVIDIA's dma-buf imports says so. docs/REFUSALS.md
regenerates unchanged (the refusal is the existing one).
|
||
|
|
0228641d79 |
rt: the encoders and a segment's begin borrow the core; the lock budget's bound is 0.25, and a node naming the event must measure it
The planner's rulings on the lock budget and the alternations: - The bound is one value on every device, 0.25 locked instructions per added command, for draws, bound draws and dispatches: a site of rt's that runs per command adds 1 or more, and the drivers' own growth stays far below it (measured: Iris Xe 0.0195 / 0.1425 / 0.0285 at most, RX 7900 XTX 0.0000 / 0.0015 / 0.0050, RTX 2080 0.0005 / 0.0000 / 0.0175). - Each budget test prints its measurement as a matrix record, `locks lock_budget/<kind>`, per million added commands (none below 0), beside its LOCKS line. The matrix fails a GPU leg missing any of the three where the node's setup names M2V_LOCK_EVENT (results.LOCK_BUDGET, names_lock_event, lock_budget_missing; keyed on the setup, not on a card), for a commit that has the budget; elsewhere the budget prints LOCKS-UNMEASURED and passes. The note carries the three values per leg. docs/VALIDATION.md's records table has the kind. - Building::begin borrows the device's core where it took an Arc<Core> it dropped after the start timestamp; the compute and render encoders hold an uncounted borrow of the recording's core (kept::Uncounted, the kept handle's pattern for an Arc), valid while the encoder holds the recording, which it does until it ends. Two locked instructions fewer per encoder and one pair fewer per segment. Verified: scripts/matrix's unittest suite (47 tests, a new one for the event and the missing records). |
||
|
|
0afc54c573 |
rt tests: every instance runs under the validation layer, its log checked
Every instance rt's device tests open goes through one helper, crate::tests::validation. It enables VK_LAYER_KHRONOS_validation for its own test process through the loader's and the layer's own variables (VK_INSTANCE_LAYERS; report flags error,warn, debug action log, one log file per process). It checks that every device of the cfg's kind lists an active validation tool (vkGetPhysicalDeviceToolProperties), so a run whose loader found no layer fails. Once the instance is gone, it reads the log, prints each line with the test's name and fails on any message. The 41 sites that called Instance::new go through it; the exit-handler test reads its child's log, since the child's instance never drops. One test makes a deliberately invalid call (a buffer of size 0, refused by the layer) and checks that its log holds exactly VUID-VkBufferCreateInfo-size-00912. The product keeps no layer code and no variable read. Its one change is a visibility: Instance's shared state is pub(crate), so the helper waits, bounded, on a weak handle of it until the instance is gone, and only then reads the log. scripts/validation-layer makes the layer's directory, one version (1.4.363.0) on every leg, as a carry: Linux's copied from a node whose pacman package is that version and unaltered, Windows's from MSYS2's clang64 packages checked against the package database's SHA-256, and macOS's from a Homebrew install at that version. scripts/matrix carries it to every job that runs rt's device tests (GPU legs, lavapipe, the Windows host), points VK_LAYER_PATH at it, and puts the layer's version in the leg's note. A job without the layer says so and points the loader at none. The harness's timing jobs run without it. Verified: the matrix's unit tests (48, two new ones run the layer's shell for real) and the layer carry made. Builds and legs follow. |
||
|
|
4b781a949c |
translator: a grid tile tests its edge only inside a branch on its region's ragged flag
On Device::from_queries' profile a kernel that runs its grid in tiles compared every invocation's position with the grid's last thread before its body, on every dispatch. The test now sits inside one uniform branch on the region's NONUNIFORM flag, which rt (and the binder) already set for every region of a grid its workgroups do not divide: a ragged dispatch runs today's test, and every other dispatch (a grid the workgroups divide, an indirect dispatch) branches past it, its body deriving its position only where it reads it. One pipeline serves both, so there is no added compile or first-use wait. Device::new's profile has no grid tiles, so its modules are unchanged. The branch is also what keeps a driver's scheduler from spreading a kernel's pushed-word loads through its body: a form that dropped the branch lost 17-55% on a many-binding row on RADV and the UHD 630. SEMANTICS_VERSION 2180 -> 2181. The grid tile tests now run each grid flagged and unflagged: flagged, no invocation past the grid stores; unflagged, a ragged grid's do, so the flag alone guards the test. Verified at the same change on |
||
|
|
a914d524ea |
Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development` while this branch was in flight, so the copy committed here counted a smaller one. Verified: regenerating at this tip leaves no change beyond the `Generated at` stamp. |
||
|
|
1e8e5974fc |
REPLAY-STREAM: section 6 names the writes at a completion
The comparison point takes the GPU's bytes at a completion only for 4 KiB chunks wholly inside GPU-only ranges, and a recorder may record what a command buffer's GPU work stored in memory the CPU shares as writes after its commit: which chunks are compared, the Managed rule, why the player's waits make them change nothing, and the restore they let a stream carry. The planner's text, verbatim, for the recorder change that lands with it. Doc only; no test reads this section. |
||
|
|
990328afe1 |
translator: from_queries' profile contains no threadgroup access, and an arena of whole float words is a float array
What: a new profile fact, device::profile::ThreadgroupMemory, says whether an access of
threadgroup memory is contained. Device::new's profile keeps Contained, byte for byte: a load past
an arena reads zero, a store past it is dropped, and a typed threadgroup object's dynamic index is
clamped to its level. Device::from_queries' profile takes Native: no threadgroup access is
contained, and an access past a kernel's threadgroup memory is undefined, as in Metal. One
predicate, lower::access::local's contained(), decides it at the six sites that contained one:
an arena's loads and stores, its atomics, memory intrinsics, pointer cells and imageblock, and a
typed threadgroup object's index. Device memory's containment is unchanged.
On the Native profile, a kernel's arena whose every access is a whole, aligned float word (a float
or a vector of 2 to 4, at an offset its alignment makes a multiple of 4, with no atomic, no memory
intrinsic and no access of another type: memory::Leaf::float_words) is a float array of its own
whole words, at least four (memory::arena::FLOAT_LEAST). Each access is one typed load or store per
lane at its word index, with no bounds compare, no select and no bitcast. Every other arena stays
the u32 array of composed words, unchecked on this profile. The census names the float form's
accesses access.threadgroup.load.floats and access.threadgroup.store.floats.
SpecOp::ISub, which only the contained arena's bound used, is deleted.
docs/API.md's threadgroup memory bullet says so. The runtime README's contract states that an
access past threadgroup memory is undefined, as in Metal, and that the runtime does not confine
it. SEMANTICS_VERSION 2180; the old render key's pin moves with it.
Why: Metal leaves an access past threadgroup memory undefined, so containing it changes nothing a
correct program observes. Containment cost GPU time on every card measured: each access paid a
bounds compare and a select, and each composed word paid its bitcasts.
Verified (A = before this change, D = this change, both on from_queries):
- GPU p50 of the harness rows whose kernels use threadgroup memory or SIMD-group operations,
D over A, the median over 6 rounds of each. threadgroup_floats is a float scan that the probe
harness adds. No other row's kernel declares threadgroup memory (workloads.metal).
- UHD 630 (job 47289): threadgroup_scan 0.972, threadgroup_floats 0.892, simd_reduce 1.000,
vote_loop 1.000.
- Iris Xe (47290): threadgroup_scan 0.965, threadgroup_floats 0.919, simd_reduce 1.000,
vote_loop 1.000.
- Each arm's spread (its largest run over its smallest) is at most 1.013 on both cards.
- Driver compile per kernel on the UHD 630, the median of 5 cold processes per arm, each with a
fresh store and driver cache and the module bytes salted (47319). Every process exited 0. D over
A: the float scan 0.716, the typed scan 0.945, the SIMD reduce 0.951; the two kernels whose
modules are the same in both arms 0.998 and 1.062.
- The same on the Iris Xe (47349): the float scan 0.678. The typed scan (1.108) and the SIMD
reduce (1.19) are inside the run-to-run spread of 1.164 that a module equal in both arms shows.
- Cold plays of a replay stream up to frame 216, 4 per arm, with the arms alternated. Every
threadgroup kernel matched by function identity, 16 of 16 in each arm.
- RTX 2080 (47294): GPU 378.1 ms in A, 307.9 ms in D; driver 1154.8 ms against 1158.8 ms.
The 128-wide kernels: 0.634 (18 dispatches) and 0.793 (65). The 64-wide kernels: 0.808 to
0.959. The 1024-wide kernel: 0.933. The 395-dispatch kernel: p50 1.010, its total 0.996.
- Radeon 780M (47295): GPU 127.8 ms in A, 116.8 ms in D; driver 234.7 ms against 202.6 ms.
Every kernel's p50 is at or under A's: the 128-wide kernels 0.826 (18 dispatches), 0.799 (65)
and 0.966 (5); the 64-wide kernels 0.815 to 0.938; the 1024-wide kernels 0.981 and 0.978;
the 395-dispatch kernel p50 0.981, its total 1.006.
- Rebased on
|
||
|
|
f811e7cc2d |
replay: delete the unbound-buffer-read counter, whose reflection decoded each pipeline state's AIR again inside the play's pipeline time
The counter ( |
||
|
|
11dc2d46d5 |
translator: a removed argument's read takes zero and writes no status on from_queries' profile
What: a read of a texture, sampler or threadgroup memory argument the pipeline's function constants removed (the absent read, lower::access::absent, and texture::AbsentArgument) takes the same zero of its result's type as before: a read's zeros and a query's size of 0, which the nil texture, set 1's element 0, answers too, with a write of a removed texture dropped. A new profile fact says whether it also marks the command buffer's status (device::profile::AbsentReads): Device::new's profile keeps Marked (StatusBits::ABSENT_ARGUMENT_READ, the ExecutionStatus fact, its push field or binding), byte for byte; Device::from_queries' takes Nil, where the read marks nothing and the stage states no AbsentArgumentRead or ExecutionStatus fact, no ExecutionStatusAddress push field and no status binding. One form per profile, so it holds on every stage: a fragment function's read, which the replay recordings name, and a kernel's, whose pipeline the translator refused before on from_queries' profile (IdentityDomains: the status word's push field is outside what the identity domains admit), now run. The fact keys from_queries' fingerprint; Device::new's renders its fields alone, unchanged. docs/API.md's degrade entry and ExecutionStatus bullet say so. SEMANTICS_VERSION 2179. Why: Metal gives such a read no value, and its compiler drops or folds it; the new runtime writes no ExecutionStatus words, so the status a read marked was a refusal of the whole pipeline. Verified: - f0c676d4f7, this change before its rebase onto |
||
|
|
9be118cb5b |
rt: a take answers its zero mark, and the consumer asks for a Private range's zeros
The zero mark (BlockInfo::zeroed): how many of a block's first bytes the runtime itself zeroed and nothing held since, as the take found them. They read zero; bytes outside the mark are the consumer's to zero where Metal owes zeros. Nothing is inferred from the driver, the memory type or a fresh allocation: the runtime zeroes from the front only, on the block-maker thread. - Each Shared allocation made ahead of need is zeroed whole before it joins the pool (each device's first in its making), and its bytes are the allocation's clean ranges; a block carved there takes the clean run at its offset as its mark. - A Shared block given back is zeroed again from its first byte, in steps of 256 KiB, while it is kept; a take of it between two steps waits at most for the step that runs (the thread starts none while a take waits) and gets the mark as it stands. A kept block's zeroed bytes given back to its allocation stay clean. A block given back has mark 0 until then: the consumer may have written any byte. - Device::new_buffer zeroes only a Shared buffer's bytes past the block's mark, and every placement lowers the mark to its offset (new_managed_buffer's bytes too). - Private blocks carry no mark. Device::zero_block_range(block, offset, length) zeroes a range of one the consumer holds by a GPU fill on the upload path new_buffer's Private zeroing uses, ahead of every later commit; it never waits and is never done at a take. Refusal:: ZeroRangePastBlock and Refusal::ZeroRangeShared (REFUSALS.md regenerated). - Metrics: allocations_zeroed, allocation_zeroing_nanos, kept_bytes_zeroed, kept_zeroing_nanos, zeroed_bytes_taken, zeroed_bytes_freed (zeroed bytes an idle free gave back before any take), block_zero_fills, block_zero_fill_bytes; the replay player keys them; api_signatures blessed. - README: the consumer contract and the zeroing of kept blocks under the consumer's mappings. Tests: Ranges' run_at and cut; a Shared block of the made-ahead allocation is marked and reads zero whole; written, given back and kept, a take after three steps answers three steps' bytes, zero, the rest as written; a zeroed buffer then zeroes only past the mark and lowers it; given back again it is zeroed to its end. A Private block written by a kernel, kept and taken again, zero-filled over its first half, reads zero there to the next command buffer's kernel and the kernel's words past it; the refusals and NoSuchBlock. The three tests that check kept Shared bytes stay as written hold the zeroing. Verification: the check job and device legs run on this commit. |
||
|
|
a47fc3e69d |
translator: an argument buffer's texture index is masked to the set-1 image arrays
What: under the identity domains (Device::from_queries' profile alone; Device::new never takes them, so its modules are unchanged), the handle of a texture whose resource ID an argument buffer holds is the ID's low word masked to its low 16 bits (IDENTITY_TEXTURES - 1, the two image arrays' 65,536 elements, a power of two the compiler checks): one OpBitwiseAnd a handle. A bad ID reads the element at index & 0xFFFF, never one outside the arrays. Nothing else changes: a slot's index is the runtime's own push (SlotGuestBase), a constexpr sampler's too (ConstexprSampler), and an argument buffer's sampler is not lowered under these domains, so the sampler arrays stay at 4,000 with no mask. docs/API.md, where that sampler's refusal is listed, and RESOURCE-ID.md say the change that first lowers one masks its index the same way. The new runtime's README records, among the known gaps of memory blocks, that a shader uses a buffer's gpuAddress unchecked, so a stale one can still fault the device. SEMANTICS_VERSION 2178: from_queries' translations of such a texture change (2177 is the unlanded float-array branch's). The feedback elements (index + 65,536 in the sampled array, where the device reads attachments): only a draw's push of a texture slot's index reaches them. The render encoder builds no useResource: or useHeap:, so no draw makes an argument buffer's texture resident, and Metal reads an argument buffer's texture only once it is resident; the mask keeps every argument-buffer index below 65,536 besides. So an argument-buffer texture that is also the pass's attachment is never offset to its feedback element: the shader reads element index, as before, a read Metal leaves undefined while the texture is not made resident (only the compute encoder has use_resource and use_heap). Why: the ID is the program's word, and an index past the arrays fetches a descriptor outside them. Verified: - Check 46942 (msi) at this change on |
||
|
|
0463eb6d2d |
replay: a placement waits for the commits that named its index's holders, which count once retired
Under the owner rule the runtime gives a held index to the newer object, so a placement while an earlier holder's work runs takes the element from under that work, which Metal leaves the program never to do (docs/RESOURCE-ID.md); the program's own timing kept that duty, and the player, the runtime's consumer here, now keeps it. Each index is owed to the last commit that named an object holding it, live or released (a released one's uncommitted users owe it at their commit; a command buffer released uncommitted owes nothing), and a placement there, named, lowest or highest, first waits for that commit. The `indices named` line counts the waits and their time. A commit counts done once its completed handler has run: the runtime sets a command buffer's status before it drops what the command buffer held, and runs the handlers after, so the status alone could find the work done while the runtime still held the old holder. Verified: the ledger's unit test an_index_is_owed_to_the_commits_that_named_its_holders (to run in the lane's check). The device test that holds work in flight comes after the reruns. |
||
|
|
74fe5e67ca |
replay: count the draws and dispatches whose pipeline reads a buffer argument nothing is bound to
A read of an unbound buffer argument is undefined in Metal; under the new runtime a draw that makes one reads address 0 and loses the device. Whether release programs make such reads is a count the player can take: each pipeline state's used buffer arguments come from the translator's reflection of its descriptor (isUsed), and each encoder's bound indices from its setBuffer, setBuffers and setBytes calls per stage (a nil buffer unsets one) until endEncoding. The backend reports an `unbound buffer reads N: ...` line (the states, the unreflected ones, the first eight by position and frame) and `unbound_buffer_reads` per frame. Verified: the unit test a_draw_reading_a_buffer_argument_nothing_is_bound_to_is_counted (to run in the lane's check). |
||
|
|
71a22fc2be |
command-replay: a play that ends with differing IDs exits 3 with an ids line, apart from a stopped run
A run that played every frame but whose objects' gpuResourceID differ from the recording's exited 1 with an 'error ids' line, the status of a run that stopped: two clean plays read as crashes. It now ends 'ids: played to the end; ...' and exits 3; docs/REPLAY-STREAM.md says so. |
||
|
|
9f2ca244ff |
rt: attachment reads through a copy into a shadow, on a device without the feedback loop
A device whose descriptor limits hold set 1's second elements but that does not report attachmentFeedbackLoopLayout and attachmentFeedbackLoopDynamicState (the UHD 630 on Windows, driver 101.2145) refused every draw that reads an attachment of its own pass through a texture. It now reads through a copy: the one form left on that device, recorded as a known gap. The query: floor::Capabilities::attachment_reads is the descriptor room alone, and the new feedback_loop is the room plus both extensions and features; device creation enables the extensions, features and dynamic-state loader only where feedback_loop holds, so the extension device test's expected list (core().feedback) follows the query unchanged. The form (crate::shadow): an image a draw may read so gets one shadow, same format, extent, levels and layers, made at its first reading draw, homed by the next submission's upload, freed with the image (Free::Shadow) and counted in Gauges::shadows and shadow_bytes. A texture reaching the rendered level and layer reads its own view of the shadow at its second element (index + 65,536), written under the owner rule (Arrays::place_shadow); one reaching neither reads the image at home. The points are the feedback form's: the pass's first reading draw, and a reading draw after a memory barrier after draws (which leaves every shadow holding nothing). At any reading draw the planner copies what the shadow does not hold, as one area per read where what is new is one, with no look-ahead: an own-pixel slot reads the scissor a pixel wider each way, clamped; any other every level and layer its texture reaches. The copy ends the rendering, records one barrier (a global memory barrier, the image's copied ranges to transfer source from the attachment layout or home, the shadow's to transfer destination), the copies and one barrier back, and begins again. Each copy counts in Metrics::attachment_read_copies and attachment_read_copy_bytes, and in bytes_copied. Docs: the rt README (set 1's second elements, the render encoder's copy form, the floor's attachment reads and extension table, the chosen-by-a-query note, and the known gap with the UHD cost: 39.0 to 53.5 us a MiB plus 3 to 8 us a copy, about 12 to 16.5 ms a frame for r3 and 4 to 5.5 ms for b3, from the census's 298.0 and 93.4 MiB a frame), DrawKind::AttachmentRead, REFUSALS.md regenerated and the public signatures blessed. Tests: host unit tests of the planning (tests::shadow) and of the floor's two answers; the device test of attachment reads now runs the copy form where the device has it, asserting its barriers (7), copies (2) and bytes, the live shadow, and the texels, and printing the counters; the level test runs it too, one copy a level. Checks are run on the potluck legs after this commit. |
||
|
|
fe23decd1b |
rt: a constexpr sampler's index under the owner rule, and an object released with work pending
A constexpr sampler's numbering is a placement like any other. Where a sampler state took the index from it, a later pipeline state that numbers the constexpr sampler there took nothing back: it sampled through the program's sampler. Now it places the constexpr sampler there again with every element it holds (Arrays::hold_samplers: under the grants' lock, the owner's additions where it still owns the index, else a placement), and the constexpr sampler keeps its elements' samplers to write them. The consumer chooses constexpr indices and keeps them from the program's sampler states while a state numbering one lives; rt does not check it (rt README, compute pipeline docs). An object the program released while a command buffer that used it is pending is displaced like a live one: a placement at its index takes it at once, and its teardown once the command buffer retires touches nothing it no longer owns (one owner compare for both). Nothing empties an element at the program's release: a committed command buffer still reads the object through its index, which Metal allows. The owner's teardown nulls it. RESOURCE-ID.md states the duty (no work in flight reads a displaced or released object through its ID) and what an element no object owns holds: every element is written at device creation, a null descriptor (nullDescriptor, on the floor) or the array's default sampler, and written back to that when its owner goes. The replay player gave constexpr samplers the lowest free sampler index, the range the stream's named sampler IDs come from, so a program's sampler state could take a constexpr sampler's index. It now gives them the highest free one, outside that sequence (Indices::highest; REPLAY-STREAM.md). Tests: - sampling::every_device_gives_a_constexpr_sampler_s_index_to_the_object_placed_there_last: a nearest sampler state over sample_up's linear constexpr sampler reads nearest; a later state numbering it takes the index back (linear, for both states); the sampler state's going touches nothing; the slot gauge counts the index once. - sampling::every_device_gives_a_released_object_s_index_to_the_next_at_once: a command buffer samples A through SA, signals and waits on the host; A and SA are released and B and SB made at their indices while it is pending (asserted); another queue reads B through SB; after the first command buffer retires, and A and SA with it, the index still reads B through SB. The writes are valid under UPDATE_UNUSED_WHILE_PENDING with PARTIALLY_BOUND (vkspec: "as long as they are not dynamically used by any shader invocations"): A's dispatch completed before its signal. - replay a_constexpr_sampler_takes_no_index_of_the_sequence. |
||
|
|
fd916e7f99 |
rt: an index has one owner, the texture or sampler placed there last
The consumer's program places a texture at an index a live texture of its own still holds, and releases the older one later (179 placements in one recorded stream, 92 in another). Metal takes it: the later texture takes the ID. rt refused it (IndexInUse). Now Grants keeps one owner word per held index (a HashMap per class, the word given at placement and never again on the device; no list of holders, no refcount, no second bitset). A placement at a granted index always succeeds and makes the placed object the owner; a release vacates the index and empties its elements only where the releaser still owns it, so a displaced object's going touches nothing. Placement and element writes happen under the grants lock in one step (Arrays::place_texture, place_samplers, add_samplers, vacate_texture, vacate_samplers), so the elements always belong to the owner. Where a placement displaces another object, a texture with no storage view writes its storage element null and a sampler writes the arrays it does not use back to their defaults, so nothing stale answers. The descriptor-slot gauge counts held indices: a displacing placement adds none. The same occupancy serves textures, sampler states and constexpr samplers. Constexpr samplers are kept by (index, state words), each with its owner word; a later pipeline state of the same words adds its arrays where the constexpr sampler still owns the index. Refusal::IndexInUse is deleted: nothing Metal refuses remains. A texture now takes its index after its image and views are made, so an index not granted is refused after the image is made and freed at once. The duty: no work in flight reads a displaced object through its ID, as Metal's. rt does not check it. RESOURCE-ID.md and the rt README state the rule and the duty. The harness takes the next index round each class's range (its workloads make far fewer objects than a range holds). The replay player keeps the object placed last per index: a named index an object holds is taken, and the earlier object's release leaves it; with no index free for a constexpr sampler it answers IndicesNotGranted past the range. Tests: grants' an_index_has_one_owner_the_object_placed_there_last (both classes); sampling::every_device_gives_an_index_to_the_texture_placed_there_last (a storage-capable D at 3, a sampled-only A over it, whose placement empties D's storage element: a write through 3 is dropped and D keeps its texels; B storage-capable over A, A dropped; sampling through 3 reads B, writing through 3 writes B; B dropped, sampling through D's ID reads zero; the slot gauge counts 3 once); the sampler states' test places a state over a live one; replay's indices test. REFUSALS.md regenerated, api_signatures loses IndexInUse. |
||
|
|
cc9ab54b86 |
rt: one texture index class, 1 to 65,535, and a storage array as long as the sampled
The consumer hands each guest process texture IDs from one pool (1 to 16,320) and places every texture at its own ID whatever its usage. rt split textures into two index classes by usage (StorageTexture 1..4095 with shader-write usage, Texture 4096..65535 without), so every named sampled-only texture below 4,096 and every storage-capable one above it was refused (IndicesNotGranted), where Metal takes them: 4,818 makings in one recorded stream and 5,707 in another. Now there is one texture class, IndexClass::Texture, 1 to 65,535, with one grant bitset and one occupancy; IndexClass::StorageTexture is deleted. Set 1's storage-image array (binding 1) is as long as the sampled-image array, 65,536 (floor::TEXTURES replaces SAMPLED_IMAGES and STORAGE_IMAGES). A texture with a storage view writes both elements at its index; any other writes its sampled element alone and its storage element stays null; a texture that goes writes both null. Samplers keep their class. Why every floor device holds it: Vulkan's Required Limits (vkspec 56.1, Table 75 and Table 76) give maxPerStageDescriptorUpdateAfterBindStorageImages, maxDescriptorSetUpdateAfterBindStorageImages, the two SampledImages limits, maxPerStageUpdateAfterBindResources and maxUpdateAfterBindDescriptorsInAllPools a minimum of 500,000 on a device that supports descriptorIndexing. The floor's own sums become 2 * 65,536 + maxColorAttachments (131,080 at 8) and 2 * 65,536 + 3 * 4,000 = 143,072, both below 500,000. Every lab capture (2080, 3090, XTX, 780M x2, HawkPoint, RX 550, Iris Xe, UHD 630, lavapipe) reports descriptorIndexing and 1,015,808 or more for each of the six limits. The floor's limit check stays the one gate: no query-chosen size, no second form. Translator: link.rs's identity set 1 sizes binding 1 by IDENTITY_TEXTURES (65,536), the same constant as binding 0, so rt's of_the_device check still matches it. Nothing else in the pipeline interface, binding plan or resource-ID decode assumes a storage index below 4,096: the identity handle is the low word (masked only of bit 31 where the alpha flag rides it), indexing each array's runtime-array variable. The identity domains are reached only from Device::from_queries' profile (rt sets PointerDomain::Identity; the old runtime never does), so Device::new's modules, refusals and notes do not change. SEMANTICS_VERSION 2173: the identity set 1 layout is a binding-plan fact that changed under unchanged keys. Consumers in the tree: the harness and the replay player grant and place every texture in the one class; the player reserves a texture ID in it. Docs: RESOURCE-ID.md's class table (nil, texture, sampler), the rt README (set 1, grants, textures, the fault paragraph, the floor's limits table), IndicesNotGranted's doc (an object at an index not granted, as well as a release) and IndexRange's basis; REFUSALS.md regenerated; api_signatures loses the variant. Tests: sampling::every_device_makes_a_texture_of_any_usage_at_any_index grants the whole texture range, makes a shader-read texture at 2 and a shader-write one at 5,000, and checks one sample_down dispatch against the CPU mean. arrays' fill-past-capacity fills every texture index (a storage texture at 1, views of it at 2..65,535, 128 made again). |
||
|
|
da02260f2b |
Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development` while this branch was in flight, so the copy committed here counted a smaller one. Verified: regenerating at this tip leaves no change beyond the `Generated at` stamp. |
||
|
|
0c6d48aa7b |
replay: the player zeroes each block and heap of the stream once at its making
The live system zeroes a heap's memory once when it is made, so a buffer placed there reads zero where nothing wrote it. The runtime's take_block leaves a block's bytes undefined, and a block it takes again holds a released block's bytes: placed buffers read them where the program read zeros, a resource ID among them. zero_block zeroes [from, len) of a new block through buffers zeroed from their start; from is the extent the runtime zeroed itself, none yet. The device test writes a placed buffer, releases it and its block, and reads zeros from a buffer placed in a block of the same length; the bytes zeroed show both blocks went through it. |
||
|
|
b527ae9f68 |
rt, translator: a step above 1 on a device without supportsNonZeroFirstInstance runs from base instance 0
Vulkan's divisor needs firstInstance 0 where the device does not report supportsNonZeroFirstInstance
(VUID-vkCmdDraw-pNext-09461): lavapipe and the UHD 630 among the lab's devices. The translator
refused the step there under the identity domains, as a Metal draw may carry a base instance, so
those devices lost every draw through such a state, base instance 0 included. The WebGL divisor
stream draws 462 times through its two stepped states, every draw at base instance 0 (it calls no
baseInstance form and draws nothing indirectly).
Now, under the identity domains, fetch_as takes the divisor wherever the profile has
vertexAttributeInstanceRateDivisor and the rate is within maxVertexAttribDivisor; outside them the
step is pulled where the property is missing, as before, so the old runtime's path is unchanged.
divided() names the feature or the limit; its not-implemented arm had no caller left and is gone.
The new runtime marks such a state where the device lacks the property
(Draws::first_instance_zero) and refuses a draw through it at a base instance other than 0,
Gap::Draw { DividedBaseInstance }, before anything is recorded; a draw of no vertices or instances
still records nothing. Indirect draws are not built in the new runtime.
Tests: from_queries_divides_an_instance_step_where_the_divisor_feature_is_enabled (lavapipe and
moltenvk-m3 profiles, with and without the property: an instance-rate binding of divisor 2, both
modules L3-valid; rate 5 past a limit of 4 refused naming it). The device test
every_device_with_the_step_rates_fetches_per_instance_at_rate_2_from_the_base_instance draws from
base instance 0 on every device with the step rates (every texel the first mark) and from base
instance 1 where the property is reported (the second mark), expecting DividedBaseInstance where it
is not, and prints which path ran.
docs/REFUSALS.md regenerated (scripts/refusal-surface/refusal_surface.py): VertexStepRate has one
site. The rt README names the draw refusal on those devices; docs/API.md the identity-domain rule.
|
||
|
|
6f8d3ebc14 |
conformance: record and time vertex-step-rate-instances on the M3 Max
Record mode (job m3-max-46378 at 37f73671dd, an Apple M3 Max, macOS 27.0.1 26A434) took the case's Metal answer: plain Metal ran the pass with no error. Every instance fetched element base + (iid - base) / rate, its count starting at the draw's base instance: - rate 2 from base instance 0: elements 0, 0, 1, 1 (words 0x10, 0x10, 0x11, 0x11); - rate 2 from base instance 5: 5, 5, 6, 6 (a count from instance 0 would read 2, 3, 3, 4); - rate 3 from base instance 0: 0, 0, 0, 1; - rate 3 from base instance 5: 5, 5, 5, 6 (from instance 0: 1, 2, 2, 2). That is Vulkan's divisor, firstInstance + (instanceIndex - firstInstance) / divisor. conformance times --runs 8 --write (same job) wrote both legs' figures: within the 10x margin, the margin reported unjudged (the instrument's floor read 17.77 instrument costs on Metal's leg). The same job's replay on the M3 Max (the old runtime over MoltenVK) reads exact. docs/CONFORMANCE-COVERAGE.md regenerated (scripts/conformance-coverage/coverage.py). |
||
|
|
cecc252f26 |
rt: refuse indirect arguments and indices a placement puts off Vulkan's multiple
The consumer places buffers at any byte of a block, so a buffer's place in its block's VkBuffer
plus a Metal-valid offset can miss the multiple Vulkan reads at. Metal's own rules (an indirect
offset a multiple of 4, an index offset a multiple of the index size) assume a buffer that starts
at an aligned address, as every Metal buffer does; here the absolute offset is what Vulkan sees:
- VUID-vkCmdDispatchIndirect-offset-02710: the offset in the VkBuffer is a multiple of 4.
- VUID-vkCmdBindIndexBuffer-offset-08783: the offset plus the base of the memory range backing
the VkBuffer is a multiple of the index size. A block's VkBuffer is bound at a multiple of the
pool's granule (64 KiB) or at 0 of its own allocation, so the place in the VkBuffer decides it.
dispatch_threadgroups_with_indirect_buffer and draw_indexed_primitives now check the place in the
block (the device copy's, for a Managed buffer with one, which is what the GPU reads) after
Metal's own checks and refuse with the new Refusal::ArgumentPlace { place, alignment }, basis
ours. Nothing is copied to an aligned place: a copy is not a design answer here.
Tests (device cfg): every_device_reads_indirect_arguments_only_at_a_multiple_of_4_of_their_block
places a buffer 2 bytes into a Shared block and shows offsets 0 and 16 refused at places 2 and 18,
then dispatches from a buffer placed at byte 4100 and checks the result;
every_device_takes_indices_only_at_a_multiple_of_their_size_in_their_block places indices 2
bytes into a block and shows 32-bit indices at offset 0 refused (place 2, alignment 4) before
anything is recorded, then draws 16-bit indices from there and checks the texels and the pass's
counts. README's placement contract names the rule; docs/REFUSALS.md regenerated; the API table
gains the variant.
|
||
|
|
c459695b88 |
rt: the consumer places a Managed buffer's device copy, in a Private block it holds, at any byte offset
new_managed_buffer(bytes, copy, length, copied) takes both placements from the consumer: the bytes as (block, offset) in a block the host maps, and on a device that keeps a device copy (has_unified_memory false) the copy as (block, offset) in a Private block the consumer holds, at any byte offset; gpu_address is that block's address plus the offset. rt chooses no layout any more: its copy blocks, COPY_ALIGN, the first fit and the device's copies place list are deleted, and so is the Private block of the copy's own that the copy took where device-local memory had no room. Placement, and so the slack past a buffer's length, is the consumer's: rt writes the copy's length and no byte past it. New typed refusals: ManagedCopyMissing (no copy where the device keeps one), ManagedCopyOnUnified (a copy where it keeps none) and ManagedCopyNotPrivate (a copy in a block that is not Private); a copy range past its block is BufferPastBlock, as for any buffer. managed_spilled_bytes is now per buffer: a copy the consumer placed in a spilled Private block counts its length while the buffer lives. new_buffer shares the range check (placed). The harness places a Managed buffer's device copy as it places a Private buffer of its length and frees both with the buffer. The player places the GPU copy through its places at their current rule, as a Private buffer of the buffer's length: a buffer in a place of its own keeps the copy's place beside its own and gives both back with the same users; a buffer in a stream's block or heap holds the copy's place as its one place. REPLAY-STREAM.md says so. Tests: the two-copy rule places its device copy 4 KiB into a Private block the consumer takes and checks gpu_address there (and, under the spill test, in a consumer take that spills, counted in managed_spilled_bytes); a new device test places the copy at byte 4099 of a Private block filled with 0xA5 and checks the whole block after the copy's creation and after a copy-in of the whole buffer: the copy's bytes at 4099..5099 alone, the consumer's slack write at 5100..5200 and every other byte unchanged; and the four refusals. Every other Managed test places its copy at the start of a Private block of its own (tests::managed::on_device::new_managed). Regenerated docs/REFUSALS.md (scripts/refusal-surface); api_signatures.tsv by hand. |
||
|
|
55c88de862 |
replay: a stream whose header marks its announced bytes recorded keeps its read-backs out of the CPU copies
The recorder now keeps an announce invariant (its header flag bit 0, FLAG_ANNOUNCED_BYTES_RECORDED; the version stays 2): at each didModifyRange: of a Managed buffer, the last m2v.write before it that carries each 4 KiB chunk of the range holds the bytes the program's CPU copy held there, the GPU's that a synchronizeResource: read back included. A player that also plays the read-back into its CPU copy pushes the GPU's bytes where the program put its own back without the stream writing them again, which is how r3's appender lost its count reset at call 4319503 and overran its list. The reader takes the flags, refusing a segment with another bit or with flags unlike the first segment's, and the writer writes them (StreamWriter::with_flags). The player tells the backend before the first call (Backend::announced_bytes_recorded). On a marked stream a synchronizeResource: of a buffer played with two copies leaves the CPU's copy as the stream's writes made it: the new runtime's backend copies the GPU's copy into an aside buffer of its own (one per buffer, in a Shared place, given back at the buffer's release), which a check of the buffer reads from the read-back to its next didModifyRange:; the old runtime's backend moves nothing, and its checks read the GPU's copy as before. An unmarked stream plays as before. Each backend's report says which rule played on its "announced bytes" line, with the read-backs it kept out. docs/REPLAY-STREAM.md takes the flags (section 1), the invariant (section 6) and the player's rule (section 10). Tests: a unit test of the flags (read alike in every segment, refused otherwise); rt_replay device tests of one stream played marked and unmarked: a write of 5s announced, a fill of 9s read back (a check sees the 9s), an announcement with no write after it, then a copy of the buffer and checks: marked, the GPU's copy and the CPU's hold the stream's 5s; unmarked, the 9s read back (the marked test fails on a player that ignores the flag). Check follows. |
||
|
|
264c28feef | translator: a grid tile's edge test runs on every invocation, against the region's last thread, with no branch on the ragged flag | ||
|
|
12b113fa5a |
Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development` while this branch was in flight, so the copy committed here counted a smaller one. Verified: regenerating at this tip leaves no change beyond the `Generated at` stamp. |
||
|
|
428c680bdd |
translator: Device::kernel_observes_partition answers before any lowering
What: Device::kernel_observes_partition(kernel, inputs, budget, entries) answers what CompiledFunction::observes_threadgroup_partition answers for the compile under the same inputs, lowering nothing: from the specialized entry StageEntries holds (or one made there now), ordered for the device as the compile orders it (lockstep's inserted barriers observe the partition). Why: a runtime can then lower only the variant a creation needs: an observing kernel runs at its own size and needs no tiles, an oblivious one runs its grid in tiles. Split from the ragged branch, without its SpecKey::Ragged (ruled out). Tests: engine_identity's the_partition_query_answers_what_the_compile_does: the query equals the compile's answer for an oblivious and an observing kernel on both profiles. API table and API.md. |
||
|
|
370290b92d |
conformance: record and time vertex-constant-step-instances on the M3 Max
Record mode (job m3-max-45736 at f5172d90a3, an Apple M3 Max, macOS 27.0.1 26A434) took the case's two Metal facts: - Plain Metal ran the pass, Completed with no error, over 3 runs folded into one outcome. Every slot a draw's vertex and instance sums reach holds the attribute buffer's first word, 0x10, with its sum, and the one slot they do not reach stays 0xEE..: from vertex 0 slots 0-2 (0x10, 0..2); indices 1-2 at base instance 1 slots 2, 3, 0 (0x10, 2..4); vertex start 2^30 and base instance 2^30 slots 0-2 (0x10, 2^30..2^30+2). So Metal's constant step reads the first element whatever the vertex start, the instance and the base instance, past the buffer's end included. - Metal's API validation let the case run. conformance times --runs 8 --write (same job) wrote both legs' figures: within the 10x margin, the margin reported unjudged (the instrument's floor read 19.59 instrument costs on Metal's leg). The same job's replay on the M3 Max (the old runtime over MoltenVK) reads exact. docs/CONFORMANCE-COVERAGE.md regenerated (scripts/conformance-coverage/coverage.py; --check passes). |