21a01acb3344dec9cbf39a1178b50f1d98ebd764
1509
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
21a01acb33 |
rt textures: device images at the consumer's index, their bytes in and out
Device::new_texture is newTextureWithDescriptor: at an index of a live grant: an optimal image in device-local memory of its own (the first memoryTypeBits type that is DEVICE_LOCAL), usage the descriptor's plus transfer source and destination, so any texture can be replaced, read back or blitted as in Metal. Its home layout is GENERAL where it has a storage element, SHADER_READ_ONLY_OPTIMAL for shader read alone, the attachment layout for render target alone, GENERAL otherwise; the first move from UNDEFINED goes through core's Work::upload, ahead of every command buffer committed after the call. The sampled view's components are Metal's swizzle composed over the format mapping; a depth or stencil format's view takes depth, else stencil. The storage element exists where the format's emulation is Direct and the device stores it through a storage image without a format. Size, layer and sample limits come from vkGetPhysicalDeviceImageFormatProperties2. Admitted emulations: Direct, SwizzledView, AlphaInRed, RotatedView, XChannel, DepthInCombined, StencilInCombined; any other format is Gap::TextureFormat. Texture::gpu_resource_id is the index and the translator's TextureWord, so the guest computes it. replace_region and get_bytes copy through a staging buffer per call (Shared memory type, counted in Metrics::bytes_copied); get_bytes submits at once (Work::flush, carried in the commit before this one and landing with it) and waits (Done::wait). get_bytes's read of the staging buffer is in readback.rs with its bound, under the readback rule test. An upload into a 32-bit float depth is Gap::FloatDepthUpload (the planner's ruling): Metal keeps any float there, Vulkan copies no depth outside [0, 1] without VK_EXT_depth_range_unrestricted, which the Intel captures lack so the floor cannot take it, and no recorded stream uploads one. get_bytes still reads such a texture. The index frees at the last Texture handle's drop (its elements written null, the index vacated), and grants now track occupancy: Refusal::IndexInUse and Refusal::IndicesInUse. The Vulkan objects are an Image the uploads hold, freed by the reaper (Free::Texture) once the last upload that moves or copies it retires. Gauges::textures and Gauges::descriptor_slots count them, back to zero at drop. Refusals carry Basis lines; docs/REFUSALS.md regenerated; api_signatures blessed. The README's "Textures" section and its known gaps say the contract. Verified: - m3-max-42550 (msi), this tree: clippy of metal2vulkan-rt plain, --cfg m2v_gpu and --cfg m2v_cpu_icd green; rustdoc -D warnings green; nextest 36 of 36; the device tests on lavapipe under the validation layer 76 of 76, 0 validation errors. - m3-max-42601 (780M, radv) and m3-max-42602 (3090), this tree's archive under the validation layer: 73 of 73 each (the three source-reading tests skipped off the building machine), 0 validation errors; every gauge zero at drop. - Not yet run on Intel: the UHD 630 (Windows) build, m3-max-42551, is running without the GPU lease; its run follows. - `python3 scripts/api-signatures/signatures.py --check` and `python3 scripts/refusal-surface/refusal_surface.py --check` clean. |
||
|
|
b78f8163f9 |
translator: a half fma is the device's 16-bit Fma on from_queries' profile under the 16-bit float controls
On every device the new runtime makes, Metal's fma on half was the device's float Fma on the operands held in float, rounded to half by the controlled conversion pair (two OpFConvert decorated NoContraction). On a chain of 1,024 dependent half4 fmas over 2^19 threads, the device's 16-bit Fma took 437.5 against 1,818-1,832 us on an RTX 3090, 284 against 377-389 us on an RX 7900 XTX, and 22.0 against 114.2 ms on a UHD 630 (probe jobs 42069, 42068, 42070). The translator: a new profile fact, HalfFma. Device::new keeps Measured, the routes it took (the measured 16-bit Fma on MoltenVK, OpFmaKHR on 16 bits under the controls where shaderFmaFloat16 is enabled, else the float Fma rounded), which ROWS renders as nothing, so every Device::new fingerprint and module is unchanged. Device::from_queries takes Native: a half fma is fma::Route::F16Native, the device's GLSL.std.450 Fma on 16-bit floats, wherever the profile computes half under the 16-bit float controls (shaderFloat16, with 16-bit RoundingModeRTE, DenormPreserve and SignedZeroInfNanPreserve); spirv::half_hold then removes its exact conversions, so the kernel carries no NoContraction pair for it. Elsewhere today's float Fma rounded to half stays: on the RX 550, without shaderFloat16, and on lavapipe, which does not preserve 16-bit denormals. OpFmaKHR is not taken on that profile: shaderFmaFloat16 is not one of the queries that may choose a second form, and the new runtime does not enable VK_KHR_shader_fma. The note is PrecisionNote::NativeFma, the float fma's. It is per operation, not per width: it already covers both formats with a bound for each, and Vulkan gives the 16-bit Fma the precision of the 32-bit one (a multiply and an add, each rounded), so its float bound holds in half. A half twin would add a Degradation kind to the frozen old runtime and a row to the conformance suite's native notes for the same statement. Every half fma on from_queries' profile records it, on either route, and none requires VkProperty::MetalHalfFma. RADV (Mesa 26.2.6, RX 7900 XTX) does not round the 16-bit Fma once: 1,622,016 lanes of that chain ended up to 9 half ulp from Metal's (42068). NVIDIA's driver on an RTX 3090 and Intel's Windows driver on a UHD 630 matched Metal in every lane (42069, 42070). The new runtime's README lists it among the known gaps of pipeline states. Tests: engine_arith's a_half_fused_multiply_add_is_the_devices_16_bit_fma_on_from_queries compiles a half fma through Device::from_queries on five captures: on RADV's, ANV's and NVIDIA's it is one 16-bit Fma with no NoContraction decoration, no MetalHalfFma requirement and NativeFma recorded, rounding once on the interpreter; on lavapipe's and vk12-floor's it is the float Fma rounded, NativeFma recorded, rounding twice. The profile facts test covers HalfFma and its fingerprint; the fused emit test takes the new route. docs/API.md's native-fma entry and PrecisionNote::NativeFma's doc state the 16-bit form and its bound. |
||
|
|
1b97a620c8 |
rt: set 1 and index grants
Every pipeline of the new runtime takes set 1, one descriptor set the device makes at creation: 65,536 sampled textures (binding 0), 4,096 storage-capable textures (binding 1) and 4,000 samplers of each use, plain, depth comparison and integer texture (bindings 2, 3 and 4), each partially bound, updated after bind and while unused elements are pending, seen by every stage. Set 0 is empty. The pipeline layout is made once from it, in Device::new, and every pipeline and dispatch uses that layout. Every element no object owns is defined: a texture element is a null descriptor (VK_EXT_robustness2 nullDescriptor, which joins the floor; the robust buffer and image access beside it stay off), and a sampler element is its array's default sampler, nearest and clamped to the edge, the comparison array's comparing with NEVER. The device writes every element at creation and holds the two default VkSamplers (Gauges::device_samplers). The translator is told of VK_EXT_robustness2, so its profile has nullDescriptor. Device::grant_indices(class, first, count) grants the consumer the range it names, so the IDs it picks reproduce in replay: storage-capable textures 1 to 4,095, other textures 4,096 to 65,535, samplers 1 to 3,999, 0 nil and never granted (IndexClass, IndexGrant). Limit::IndexRange, Refusal::IndicesGranted and Refusal::IndicesNotGranted, with Basis lines; docs/REFUSALS.md regenerated. The floor's sampler limits are now three arrays' (12,000 samplers per stage and set, 81,632 update-after-bind descriptors in all pools). README: "Set 1 and index grants", and the floor's extension, feature and limit rows. Device::new output is unchanged: no translator source changes. Verified: - m3-max-42273 (msi): clippy -p metal2vulkan-rt --all-targets --all-features, plain, --cfg m2v_gpu and --cfg m2v_cpu_icd, green; rustdoc -D warnings green; rt tests 33/33; every device test on lavapipe with the Khronos validation layer, 0 validation errors; making a second set 1 takes 106 ms there. refusal_surface.py --check clean. - m3-max-42305 (Radeon 780M, RADV, gem10) and m3-max-42306 (RTX 3090, um870), validation layer on: every device test passes with 0 validation errors, gauges zero at drop; a second set 1 takes 15.1 ms on the 780M and 4.6 ms on the 3090. The three tests that read the source tree fail on those nodes only because the carried archive names msi's paths; they pass on msi. |
||
|
|
100b92d608 |
identity: constexpr samplers by a pushed index into set 1's sampler arrays
Under the identity domains a texture slot sampled through a constexpr sampler takes the sampler
from the set-1 sampler array of its use (binding 2 plain, 3 compare, 4 integer texture) at an
index the consumer pushes: PushField::ConstexprSampler(CombinedSampler), one u32. The consumer
makes the device sampler that the new public CombinedSampler::constexpr_sampler(profile)
describes, places it at an index of that array, and pushes the index. The index is a push word,
not a specialization constant: an index allocated at run time would key the driver's and the
pipeline cache's entries. Link's immutable sampler for the default domains now goes through the
same method, with the same result.
Under the identity domains every device sampler is normalized: a constexpr pixel sampler's
coordinate is scaled in the shader, as a runtime sampler's is, never handed to the device's
unnormalized sampler. A linear sample or gather through it records
PrecisionNote::PixelSamplerScaling, which is static. No address-mode-map variant applies there
(no binder picks a variant), so the sampler keeps its own modes and the slot records no
ConstexprSampled fact.
Still refused as Unsupported{IdentityDomains}: an argument buffer's sampler, arrays of samplers,
bicubic and anisotropy emulation. The refusal test now uses engine/a2_bicubic_weights.
Translation output changes only under the identity domains (Device::from_queries). Device::new
output is unchanged: golden_hashes_match_the_table passes at this tip (job m3-max-42192), with no
"changed under an unchanged key" and no "profile changed:" line.
Public surface: PushField::ConstexprSampler and CombinedSampler::constexpr_sampler are added
(api_signatures blessed); nothing is removed or changed.
SEMANTICS_VERSION 2162: identity-domain modules of constexpr-sampling kernels change.
ARTIFACT_FORMAT_VERSION 531: PushField gains a variant.
Verified:
- m3-max-42097 (msi), this change on
|
||
|
|
445b720f78 |
identity: texture slots sampled through runtime sampler slots from set 1's sampler arrays
Under the identity domains a kernel samples a texture slot through a runtime sampler slot. The
texture is its class's set-1 element at the index of its pushed gpuResourceID, as a read's is.
The sampler is the element of a set-1 sampler array at the index of the sampler slot's pushed
gpuResourceID (SlotGuestBase of the sampler slot), joined to the texture by OpSampledImage. The
array is picked by the use: binding 2 for a plain sample, 3 for a depth comparison, 4 for a
texture of an integer format; 4,000 SAMPLER descriptors each, PARTIALLY_BOUND |
UPDATE_AFTER_BIND | UPDATE_UNUSED_WHILE_PENDING, every stage, the same set 1 for every pipeline.
The sampler's word (pixel coordinates, a nearest pixel sampler) is read from the ID's high word,
so no specialization constant and no SamplerReduction, SamplerCoordinates, CubicSampler or
ConstantLanes fact remains; every precision note is static. An integer write to a storage slot
without a format saturates to the channel widths the consumer pushes
(PushField::TextureIntegerChannels, a u32), with no fact.
Still refused as Unsupported{IdentityDomains}: constexpr samplers (next change: a pushed index),
an argument buffer's sampler, arrays of samplers, bicubic and anisotropy emulation, a slot's
minimum level.
Translation output changes only under the identity domains (Device::from_queries). Device::new
output is unchanged: golden_hashes_match_the_table passes at this tip (job m3-max-42189), with no
"changed under an unchanged key" and no "profile changed:" line.
For the runtime's side (the planner's three facts):
a. The runtime must dedupe device samplers by create info across the three arrays' uses.
Exhausting maxSamplerAllocationCount (4,000 on the 2080, 3090 and UHD 630; 32,768 on
lavapipe; 65,536 on the others) must be a typed refusal, with a fill-past-capacity test.
b. The update-after-bind limits for 65,536 sampled images, 4,096 storage images and 12,000
samplers hold on all nine profiles (the smallest is lavapipe's 1,015,808); the floor must
check them by query.
c. The count of cubic sampler descriptors is asked of the replay lane; if any exist it goes back
to the planner before step 5 closes.
SEMANTICS_VERSION 2161: identity-domain modules of sampling kernels and integer writes change.
Verified:
- m3-max-42094 (msi), this change on
|
||
|
|
cd5a76a757 | docs: conformance coverage with the vector word-phase cases | ||
|
|
da5fd7da0b |
push window: 256 bytes on from_queries' profile, the new runtime's floor
A kernel's push window held 128 bytes, what Vulkan guarantees: a dispatch region and 12 buffer
addresses. A kernel of more buffers put the rest in a parameter block that the new runtime writes
into its ring on every dispatch, and whose address the window holds.
The translator: a new profile fact, PushWindow. Device::new keeps Guaranteed (a 128-byte kernel
window, the value ROWS renders as nothing, so every Device::new fingerprint and module is
unchanged); Device::from_queries takes Floor, a 256-byte kernel window: a dispatch region and 28
buffer addresses. lower::push::{window, place, spills} take it; the render windows are the same on
both. The push range is still the function's own need, and a module whose block passes 128 bytes
requires maxPushConstantsSize to cover it, as before.
The new runtime: the floor requires maxPushConstantsSize >= 256 (every captured device reports
256), a typed refusal below it; its pipeline layout declares 256 bytes, and a dispatch pushes the
kernel's own bytes. A new metric, Metrics::ring_writes, counts each parameter block and each
set_bytes copy written into the ring. README: the floor's limit row and the parameters paragraph.
The harness gains wide_bindings: 256 small dispatches of a kernel that binds 24 buffers.
Tests: push.rs places a region and 28 addresses in the floor window and spills a 29th, with the
first 12 placed as the guaranteed window places them; engine_identity's many-buffer kernel on
from_queries pushes all 21 addresses with no block, and one of 33 slots spills 2, both answering
on the interpreter; the floor tests move to 256; the profile facts test covers the new fact; an rt
device test dispatches a 24-buffer kernel with no ring write and a 30-buffer one with one a
dispatch. The signatures table gains Metrics::ring_writes.
|
||
|
|
fdc3fd3907 |
rt: threadgroups of partial SIMD groups run the kernel's emulated module, lowered on the reaper
A kernel whose tier runs each SIMD group as one subgroup (a pinned subgroup of 32, the device's own 32, or half of a 64-lane subgroup) runs only threadgroups of whole groups of that width. Such a state now has its emulated-SIMD-group variant (LoweringInputs::emulated_simdgroups), which the reaper lowers once new_compute_pipeline_state has returned, through the cache directory like every lowering (a refusal is kept too). A dispatch whose threadgroup is not whole groups runs that module at its own size; one that comes before the reaper is done waits for the lowering, which the reaper takes next (Reaper::hurry), counted as a first-use wait. Nothing translates on an encoding thread. A state made after quiesce, or whose lowering the reaper's end leaves, is marked not lowered (Error::Quiesced at such a dispatch). The emulated module's threadgroup memory is its arena (metal2vulkan::pipeline::arena_bytes, now public) holding the lengths set, the scratch of each SIMD group, and a vote word: the dispatch's total is checked against maxComputeSharedMemorySize (Limit::ThreadgroupMemory). ComputePipelineState::precision_notes returns the emulated module's notes too once it is lowered. Gap::PartialSimdgroups stays for a state with no emulated module: a kernel the consumer compiled, or one whose emulated variant the translator refuses. A ragged dispatchThreads grid at such a size is Gap::PartialThreadgroups: the partial-threadgroups variant does not take the emulated tier. |
||
|
|
c1b123813f | docs: under the identity domains unwritten and constant arguments are read-only memory | ||
|
|
8ec8cbbc20 |
old-runtime regression fix: a half color output is 16-bit again under Device::new
|
||
|
|
b206c48b2a |
matrix: only a subject that opens with the phrase lets the old path move
a17eb26a6b's matrix run did not report OLD PATH MOVED although its golden test counted 7260 cells under a changed profile fingerprint (the stage-bound change): the check commit's own message quotes "old-runtime regression fix", and the rule looked for the phrase anywhere in a message since the last bless. It now takes only a subject that starts with it, as each fix's does. Tests: scripts/matrix/test_results.py, 17 pass; the old-path test now also feeds a message that quotes the phrase in its body and expects the problem to stand. |
||
|
|
aa8d6ac6f5 |
old-runtime regression fix: a stage's reconvergence note only on from_queries' profile; the old runtime's extra kind goes
|
||
|
|
e0f567a8bc |
old-runtime regression fix: the two half rows return to Device::new; from_queries' profile notes every controlled pair
|
||
|
|
d5a475f1a0 |
old-runtime regression fix: the stage bounds return to Device::new's ANV rows; the bound on every device is a fact of from_queries' profile
|
||
|
|
75b422338a |
identity: argument-buffer textures are the set-1 elements their resource IDs name
Under the identity domains an argument buffer's texture handle is the gpuResourceID its member
holds: the handle is the ID's index, the element of the class's set-1 array (0 is nil, the null
descriptor), with no handle table, no search and no descriptor. Where the shader checks a read
itself (no robustImageAccess2) the handle carries the word's missing-alpha bit (word bit 12) at
HANDLE_ALPHA_ONE, so the handle form is Lookup::Element or Lookup::Flagged{alpha} only.
The handle tables' variant forms are off under these domains (`texture::tabled`): reads of a
member of another numeric class, raw-texel decodes, storage conversions (red-blue, sRGB alias),
A8 alpha-in-red, unreadable-storage nulls, YCbCr write marks, and the HeapCrossClassNeutral,
HeapStorageReads and HeapResidency facts. A slot and a member of one class index one array, so
the class's volatility now merges the slots' uses with the groups'. The admission takes heap
groups whose declaration is their identity class with no plain, raw or cross classes; anything
else stays Unsupported{IdentityDomains}.
Translation output changes only under the identity domains: the default domains plan and emit
as before (no golden re-bless needed). SEMANTICS_VERSION 2153.
The test kernel `tex` gains an argument-buffer form (`texture_kernel(true)`), checked on
lavapipe, moltenvk-m3 and moltenvk-m3 without robustImageAccess2: same answers at the same
elements, set 0 empty, and the handle form Element or Flagged{alpha} as the profile checks reads.
Verified (this commit's tree, as 657e2245c2 on
|
||
|
|
4ac52bf082 |
rt: a kernel's threadgroup memory arguments come from its length constants
The device legs of the tile (m3-max-41638/41639/41640) refused every observing kernel with Gap::KernelInput: the runtime took a kernel's [[threadgroup(n)]] arguments from PipelineInterface::threadgroup, which the translator leaves empty, so a TgLength specialization found no argument. The arguments are now the TgLength constants the module specializes on, by their index. With threadgroup memory reaching a pipeline, a dispatch checks it: the kernel's static part (and a predicated walk's 4-byte vote word, RuntimeFact::PredicationVote, now accepted) plus each length set rounded up to 16 bytes must be within maxComputeSharedMemorySize, else the new Limit::ThreadgroupMemory, Metal's maxThreadgroupMemoryLength counterpart. The precise kernel's test found on the 780M and the XTX one word apart between a tile and the app's shape: a NaN/NaN division (0xffb86e83 / 0x7f9fc206) answers the first operand's payload in one pipeline and the second's in the other. The state carries NativeNanEncoding, so two NaNs are alike there; every other word must be equal. README: the threadgroup memory limit, and NVIDIA 615.71.09's sign-extended narrow clamped sum on GA10x (the planner's wording). REFUSALS.md and the API signatures regenerated. |
||
|
|
2930583b47 |
rt: the cache directory keeps lowered kernels and pipeline data
DeviceOptions::pipeline_cache_dir names a directory a device keeps two things in, for compute pipeline states. translations/ holds each lowering, named by its FunctionCompileKey (the kernel's AIR, entry, constants and linked functions, its lowering inputs, the profile fingerprint and the translator's semantics version), in the translator's self-checking encoding; a state reads a lowering there in place of lowering (Metrics::translations_loaded beside the new Metrics::translations), and a partial-threadgroups variant the translator refused is kept as a marker so it is not tried again. The files take at most 256 MiB, least recently used evicted first. pipelines-<uuid> holds the VkPipelineCache data, framed with a length and a checksum since the initial data must be exactly what vkGetPipelineCacheData returned; every VkPipeline is made through the device's cache, the reaper writes the data 10 seconds after a VkPipeline was made at most once per 10 seconds, and the device's end writes it a last time. Writes go through a temporary file renamed over the name; a file that does not check is a miss and nothing the cache does fails a call. The tile commit's README, refusal table and API signatures follow here: direct dispatches past maxComputeWorkGroupCount are split, and Gap::PartialThreadgroups names the variant refusals by the deciding queries. Tests: a store filled past its cap keeps the most recently used files within it, stores on one directory share files, and pipeline data cut short or flipped is a miss (host); a second device on the same directory lowers nothing at creation, reading all three lowerings, and the pipeline data file is there (device). Not yet compiled: the lint follows. |
||
|
|
37cc7ac829 |
matrix: harness counts compare under one harness; six old-runtime lavapipe flakes parked
The |
||
|
|
a17eb26a6b |
matrix: the old path moving fails a leg unless its fix says so
The old runtime is frozen until the cutover: the translator's output through Device::new must not move. Today it moved three times through the shared path (half outputs widened, the half pair workarounds dropped, the stage-size rows dropped) and nothing caught it, because the golden table's failure read as "needs a bless" whatever moved. The golden table compiles through Device::new. Its test's stale message now counts each kind (new, gone, under a changed fixture source, under a changed profile fingerprint), from one tested function. The matrix reads the counts: a cell changed under an unchanged key, or one under a changed profile fingerprint, fails the leg with OLD PATH MOVED, unless a commit since the table's last bless says "old-runtime regression fix" (the fix of such a move, or a fix the old-runtime lane lands). New, gone and re-keyed fixture rows still only need a bless. Tests: scripts/matrix/test_results.py (16 pass; the new one feeds both panics as nextest prints them, a new-rows-only failure and a passing run, with and without the phrase); golden_hashes::only_a_cell_changed_under_its_key_needs_a_bump checks the counts' text. |
||
|
|
576a7348bc |
translator: one stage bound on every device; the two stage-size workarounds go
A module whose entry weighs more than COMPILED_STAGE_WEIGHT (99,109, the heaviest stage measured to compile within host-sized memory, on ANV) is now handed to no driver, whatever its identity. A kernel that emulated its simdgroups only in place of the widest mode's pin (the subgroup size range decides it) is planned again keeping the pin, as before; every other module past the bound is refused with Feature::StageSize and a new Needs::StageBound, its symbol naming the weight and the bound. The refusal is permanent for the input on the device (its plan decides the weight), so it is not NotImplemented; validation reads it as the translator's own gap. DriverWorkaround::SerializedStageWrapsLargeModules and CompilerMemoryGrowsWithStageSize go, with ANV's identity entries for them and the serialized bound (786,432), which the single bound sits far below. Why: the workaround ladder takes one form for every device, the slowest compiler's; a device whose compiler would take a heavier stage is refused it, recorded in FAST-PATHS' known gaps. Measured before this change, with a scratch build that applied the bounds and the re-plan to every profile: the corpus on the Iris Xe's description without its identity refused nothing (largest planned module 91,399, job m3-max-41496), and RADV and NVIDIA nothing either; without maximal reconvergence 12 rows were refused, 6 distinct simdgroup-matrix modules of 198 to 285 products whose lockstep pairs force emulated simdgroups (jobs m3-max-41474, m3-max-41523). The owned fixture stage_bound/stage_bound_matrix (512 simdgroup matrix products beside a lockstep pair in divergent flow, our own MSL) has their structure: on the Iris Xe its emulated module weighs 123,307 and its pinned one 37,646; without maximal reconvergence it is refused at 123,308 (scratch weighing, job m3-max-41602). The new test the_stage_bound_fixture_keeps_the_pin_or_is_refused asserts both paths and that the re-planned kernel is under the bound. The old runtime's heap-trim test loses its long chain, now refused on every device; it asks for a trim where the making left more than the floor free (NVIDIA's compile never does under the bound, 189 MB at most measured). SEMANTICS_VERSION 2150; REFUSALS.md regenerated; the API table loses the two variants and gains Needs::StageBound. |
||
|
|
9cb90de8cc |
replay: a group that held a Private-range split reports its executed counts apart
Leaving out what the runtime counted while the player's own calls ran did not keep the split out of the executed counts: the old runtime records the barriers a split needs at the program's next command and at the commit. Device legs at 0b882f337c (jobs m3-max-41605, m3-max-41608) counted 8 barriers on the RX 7900 XTX, RX 550, 780M and lavapipe and 10 on the RTX 2080 for the test stream, against 5 for the same stream without the records. A background pipeline that landed inside an uncounted window also left pipelines_made out (RX 550, 780M, lavapipe). The runtime's work for a split cannot be told apart from the program's, so a group whose command buffers held a split now reports no executed counts. Those counts are added up apart, in Report::split_executed and on the `split N executed COUNTS` line, and the total leaves them out with the readbacks. The player's own calls around the dispatch are no longer measured on their own. |
||
|
|
4862a521e0 |
replay: the player's encoder splits are in no count; the report counts them
The encoders, blits, buffer and fence the player adds around a dispatch an m2v.privateBytes record names are its own work: what the runtime counts while those calls run is left out of the group and total executed counts, as its readbacks are, and the report counts the splits (split N). The comparison takes its completed snapshots from a queue. |
||
|
|
68789f62a5 |
replay: the player puts a Private range's bytes in before its dispatch and compares them after
The host records m2v.privateBytes for each dispatch of a pipeline with linked functions: each bound Private buffer range's bytes before and after the dispatch, which no CPU can read and no other record holds. The player played these records as nothing. It now reads the stream ahead once (a second reader of the same segments) and indexes the records by the dispatch each names, since they come after it, at the command buffer's completion. At that dispatch it puts each range's bytes before (relocated as a write's are) in a Shared buffer of its own, ends the guest's compute encoder, copies them into the ranges in a blit encoder, makes the compute encoder again by the call that made it with every set.../use... call the program made on it, dispatches, then ends it, copies the ranges out in a second blit encoder and makes it again. A fence of the player's own orders each piece after the one before, so untracked resources are ordered too. Once the command buffer completed it reads the bytes after back, counts the 4-byte words of each range that differ from the recording's, and reports a `private ID DISPATCH LOCATION+LENGTH match|differs N/WORDS` line; the play goes on. The readback helper check() and the comparison share now shifts the group baseline by the readback's own growth rather than setting it to the counters after it, so work recorded since the last group stays in the next group's executed counts. REPLAY-STREAM.md sections 8 and 10 state the read-ahead, the split, the report line and what the counts include. |
||
|
|
31c1161940 |
rt: SIMD groups at Metal's width, and robustImageAccess, at the floor
The floor requires Vulkan 1.3's subgroupSizeControl, computeFullSubgroups and robustImageAccess, enabled on every device; the translator's profile takes them through the enable set. Where a device lists compute in requiredSubgroupSizeStages with 32 between its sizes, the translator pins a kernel's SIMD groups to subgroups of 32 (the Direct tier); the compute pipeline state now takes such a kernel: each VkPipeline chains VkPipelineShaderStageRequiredSubgroupSizeCreateInfo where the tier pins a size (the translator pins only a stage the device lists, VUID-...-pNext-02755) and carries the stage's REQUIRE_FULL_SUBGROUPS. "A stage that pins a subgroup size" leaves Gap::KernelInput. A flattened tier's LocalSizeConstraint is supplied: a dispatch whose threadgroup is not whole SIMD groups is refused at the dispatch as the new Gap::PartialSimdgroups, since the emulated-SIMD-group variant is not built. With robustImageAccess on, the translator drops its image write and atomic guards on every device; robustImageAccess2, robustBufferAccess, robustBufferAccess2 and nullDescriptor stay off. Tests: the floor names each new missing feature; the translator's enable set holds robustImageAccess and none of a reported geometryShader, samplerMirrorClampToEdge or VK_EXT_robustness2 (host); every device's translator profile has robustImageAccess and none of robustImageAccess2, robustBufferAccess, robustBufferAccess2, nullDescriptor (device); and simd_float_products runs Direct, pinned at 32, wherever compute can pin 32, refusing a 16-thread threadgroup and answering Metal's products (device). REFUSALS.md and the API signatures regenerated. Verified: cargo fmt; the lint and the device legs follow. |
||
|
|
fa52012831 |
identity: texture slots are the set-1 elements their pushed resource IDs name
Under the identity domains a kernel's texture slots now lower. A slot's gpuResourceID is pushed as its PushField::SlotGuestBase (the index in the low word, the word in the high one). Its texture is the element at that index of one of set 1's two fixed arrays: binding 0, SAMPLED_IMAGE x 65,536, and binding 1, STORAGE_IMAGE x 4,096. Each is partially bound, updated after binding and while unused elements are pending, and seen by every stage, with the same layout for every pipeline (BindingSource::IdentityArray). Each image class the kernel declares (shape, numeric type and depth comparison, sampled, or storage without a format) is a variable of its descriptor type's binding. The slot binds no descriptor and declares no specialization constant: - is_null_texture answers whether the index is 0. Nil needs nothing else in the shader, since element 0 of each array is a null descriptor (the device test of |
||
|
|
1ceaea8eec |
replay: the player plays m2v.privateBytes records as nothing
The host now records m2v.privateBytes: a Private buffer range's bytes before and after one dispatch of a pipeline with linked functions, written at the command buffer's completion (so after the dispatch, possibly after the buffer's release), with blobs in the blob directory alone. The player sent the unknown selector to the backend, which refused it on a buffer receiver and stopped the play. It now joins the records the player plays none of; REPLAY-STREAM.md section 8 states the record's receiver, arguments and order. Verified: private_bytes_records_play_nothing, a synthetic stream with the record on a released buffer and absent blobs, plays to the end with no backend call for it. |
||
|
|
07e62aa306 |
translator: a controlled half pair is noted on every device; the two half workarounds go
What: a half rounded through the device's conversion and its widening under the 16-bit float controls (QuantizeForm::Controlled) now records PrecisionNote::NativeHalfConversion on every device, as a static note of the operation. Every profile with shaderFloat16 and those controls takes that form, NVIDIA's included. DriverWorkaround::HalfConversionPairFolded (NVIDIA, identity) and DriverWorkaround::HalfConversionFusedWithArithmetic (RADV, identity) are deleted, with narrow::rounds_arithmetic, which only the second read. Why: rule 2 of the owner's rules (one path for every device, no identity-keyed branch) and the planner's ruling on these two rows of the workaround ladder. The pair is Metal's half(float) by the Vulkan spec, but a driver's compiler may fold it (NVIDIA's) or fuse the float operation into the narrowing (RADV's). Recording the note statically on every device covers both drivers with no identity check, and it never refuses. NVIDIA's modules move from the Converted form to the Controlled one (NoContraction on the pair, the entry declaring the 16-bit modes), so its golden cells move. ANV's and RADV's modules gain only the note, which is not hashed. SEMANTICS_VERSION goes to 2149. Tests: engine_native_half, device::tests::profile (half_rounding_follows_the_queries_alone replaces the two identity tests), engine_float_call_notes, and the native_maths and half_conversions lanes, updated to expect the note on every controlled profile. Docs: API.md's NativeHalfConversion entry and HOWTO.md. api_signatures.tsv loses the two variants, and REFUSALS.md is regenerated unchanged. |
||
|
|
35fbfb4f2e |
matrix: the old runtime's time outliers are parked like its gauges
The UHD 630's harness-old/frame time swung to 1.58x its base at |
||
|
|
ac4b2370f5 |
rt: the consumer names the core Vulkan features its own work needs
DeviceOptions::features takes ConsumerFeature values (SamplerYcbcrConversion for now). Device::new enables each one the device reports, once, in the consumer's order, and Device::features lists those enabled, so the consumer can refuse its own path. The runtime's own work and the translator read only the floor's features. No Metal counterpart. The floor test's device creation chains the maximal-reconvergence and subgroup-uniform-control-flow structures where their extensions are listed, as Device::new does (the device cfgs failed to compile without the fields). The consumer-extensions device test also expects the optional extensions the device lists, and asks for the feature twice. REFUSALS.md takes the renamed site of VulkanVersion (derive.rs derived). API signatures blessed. Verified: cargo fmt. Lint and device legs follow. |
||
|
|
6e08f5aaef |
metal2vulkan: PrecisionNote::DeviceReconvergence, a stage's implementation-defined reconvergence as a static note
A stage whose reconvergence is ImplementationDefined (a tangled instruction in its entry on a device without maximal reconvergence) records PrecisionNote::DeviceReconvergence, static per stage and as coarse as the field. metal2vulkan-rt forwards it through ComputePipelineState::precision_notes and adds none of its own; metal2vulkan-runtime announces its note kind beside its existing ImplementationDefinedReconvergence kind. The note is in API.md's degrade-notice catalogue, the fast-paths ledger's Elsewhere class, the cache codec (ARTIFACT_FORMAT_VERSION 528) and validation's Unbounded allowance. SEMANTICS_VERSION 2149: a stage's notes change on devices without maximal reconvergence; the golden tables are re-blessed on development. Tests: engine_simd reconvergence_follows_the_profile and the uniform-control-flow case assert the note exactly where the field is ImplementationDefined. |
||
|
|
136fb66907 |
metal2vulkan-rt: map the identity ABI's parameter block and grid region; translated-kernel device test
Identity steps 2 and 3 are on development: ArgumentTableAddress is the ring block's address in the window, fields placed in the ArgumentTable go to the block, and every dispatch reads Metal's grid from its pushed region (a zero grid for an indirect dispatch), with no MultiRegion constant to specialize. The README gains the pipeline states' section and its known gaps; REFUSALS.md and the API signature table are regenerated. |
||
|
|
5617449350 |
metal2vulkan-rt: the encoder's refusals in REFUSALS.md and its API in the surface table
Generated by refusal_surface.py and signatures.py --bless. Verified: the generators ran clean (0 variants without a reach mark or a basis). |
||
|
|
001cc5ae8a |
matrix: a lint leg runs the gate's fmt check, clippy in three configurations and Rustdoc
The matrix ran the suites but none of the gate's lints, so a public doc linking private items
(
|
||
|
|
159154d5a9 |
PrecisionNote::CappedLodBias: a sampler state's capped or withheld lodBias carries a static note
Where the presented GPU adds a sampler descriptor's lodBias to every sample's level (SamplerUse::lod_bias), vk_sampler hands the device device_lod_bias's answer: past the device's maxSamplerLodBias it adds that limit, and a NaN, or any bias where a portability subset withholds samplerMipLodBias, adds none. Only the old runtime said so (Degradation::CappedLodBias, announced as it makes the state); the translator's vocabulary had no note for it, so a runtime built on the translator alone could not report it. The lab's own reports put the limit at 15 on the 2080 and both 3090s and 16 on the other target devices. The translator now states it as PrecisionNote::CappedLodBias, which DeviceLodBias::note gives for every variant but Exact. It is fixed by the state's bias and the device's limit; no pipeline stage records it, so translation output does not change (no SEMANTICS_VERSION bump). Classed where every note is: the artifact codec, tests::fast_paths (Elsewhere: docs/API.md section 9 states it), validation's comparison allowance (unbounded). The old runtime's degradations! macro maps the note to its existing runtime kind CappedLodBias with one hand-written from_precision_note arm. That change is mechanical, with no behaviour change: the kind keeps its code, category, cost and announcement site, and its precision_note() stays None, so the site tests' rule (a kind with a note is a stage's) still holds. docs/API.md: section 9's intro, the capped-lod-bias catalogue entry and the accepted difference name the note. api_signatures.tsv re-blessed; refusal_surface.py --check passes, REFUSALS unchanged. Test: metal::sampler::tests::the_device_lod_bias_carries_its_note_where_it_is_not_the_bias, over every committed device: no note for 0, -0 or a bias within the limit, the note past it, at the infinities and for a NaN, and for every nonzero bias where samplerMipLodBias is withheld. Verified: cargo fmt; signatures.py --bless; refusal_surface.py --check. Lints and tests follow as potluck jobs. |
||
|
|
eaac55bd36 |
replay: the recorder's commitPart cut, object 0, copied contents and gpuResourceID
The recorder now writes four things a player must read:
- m2v.commitPart answers `cut`: "Cut" where the host committed the command
buffer as a part, "Fails" or {Whole: reason} where it committed nothing. The
player commits only at "Cut", or where the answer is absent, as before.
- The pass descriptor's setters write object 0 for an object property set to
nil (visibilityResultBuffer, rasterizationRateMap, texture, resolveTexture);
nil still means left as it was. The old runtime's backend clears the
property at object 0.
- newBufferWithDescriptor: of a buffer copied from host memory carries its
starting bytes as the descriptor's `contents` (a blob or inline bytes). The
player makes the buffer with the contents nil, then puts the bytes at its
first byte as a write's: relocated where it answered a gpuAddress, counted
in written_bytes.
- `gpuResourceID` records carry the ID the program saw of a texture, sampler,
depth-stencil state, pipeline, ICB or function table. The player compares
each object's first answer with its runtime's ID (Backend::resource_id) and
reports each object where they differ as `id #OBJ RECORDED PLAYED`.
docs/REPLAY-STREAM.md carries the spellings. Each addition has a synthetic
stream test on the player's mock backend, and the old runtime's backend has
two device tests (an attachment set to nil left untouched by its pass; a
copied buffer reading back its contents, with a placed texture's ID matching
and an unplaced one's reported).
|
||
|
|
a68d520bee |
matrix: times compare under one harness; the old runtime's met failures are parked
At |
||
|
|
50c5bd0fe1 |
identity: every dispatch reads Metal's grid from its pushed region
Under the identity domains a kernel that reads a grid builtin no longer declares the MultiRegion
specialization constant. It tells a region from an indirect dispatch by the region's grid
(RegionSelect::Grid in lower::dispatch):
- Every dispatch the host knows (dispatchThreads, dispatchThreadgroups, and each piece of a split
of either) pushes DispatchRegion with Metal's threads_per_grid in region[1].xyz and its piece's
first threadgroup in region[0].xyz. So the pieces of a split read Metal's whole grid, and every
compute pipeline takes the base offset.
- An indirect dispatch pushes a zero grid. Its kernel then takes the single-region form, its grid
NumWorkgroups times L, which needs its workgroup size to be Metal's threadgroup size.
- One pipeline runs every dispatch of a threadgroup size, with no constant to specialize.
A flat variant (LoweringInputs::flat_grid), bound as any other kernel, reads its grid from the same
pushed field rather than from a record at ReplayRegionAddress (plan_replay, EmitCx::push_field).
The consumer runs non-observing kernels in a fixed shape with it, and invocations past the grid
return before the body. A replay or folded variant keeps its record and stays refused under the
identity domains.
The runtime lane takes this ABI as agreed: the zero grid marks an indirect dispatch, which runs
the per-size pipeline.
SEMANTICS_VERSION 2148: modules under the identity domains change.
Tests (src/tests/engine_identity.rs), on lavapipe and moltenvk-m3:
- every_dispatch_reads_metals_grid_from_its_pushed_region. A generated kernel reads
thread_position_in_grid, threads_per_grid and threadgroups_per_grid. It declares no MultiRegion
constant and passes L3. On the CPU interpreter, with L = (4, 2, 1) over an 8x6 grid, it stores
the same answer at every position in three forms: one whole dispatch, a split into two pieces at
region base (0, 1, 0), and an indirect dispatch with a zero grid.
- a_flat_variant_reads_its_grid_from_its_pushed_region. Its flat variant reads a 7x5 grid from
the pushed region in three workgroups of 16. The 13 invocations past the grid store nothing.
- The buffer-kernel test runs once, with its region pushed.
Verified:
- m3-max-41225 (msi, check commit 7fe9bc780c: this tree's metal2vulkan files, which equal those
here on
|
||
|
|
227b118bd9 |
identity: fields past the push window go to a parameter block at a pushed address
Under the identity domains the stage's ArgumentTable is not a uniform buffer. It is a parameter
block in memory that the consumer writes for the call, and its device address is the new push
field PushField::ArgumentTableAddress, a u64.
How it works:
- The placement is the one the translator already makes. Fields fill the 128-byte window in kind
order; the first that does not fit, and every field after it, go to the block at
PushLoc::ArgumentTable offsets, and argument_table_size is the block's size.
- ArgumentTableAddress sorts first among the kinds. A kernel whose fields spill inserts it, so the
window always holds it, at offset 0 under the identity domains, where RootTableAddress never
appears.
- The function reads each spilled field through the address (table::read_block): a
PhysicalStorageBuffer load at the field's offset, aligned to its shape.
- No descriptor is declared or counted, and maxUniformBufferRange does not bound the block.
- Selection now admits a kernel whose slot addresses or region spill, with the address in the
window.
The variant goes at the codec's end, since tags are by name. The api_signatures table gains it,
and the kind-order and status-address placement tests name it. SEMANTICS_VERSION 2147: a refusal
under the identity domains became a module.
The new test, slot_addresses_past_the_window_are_read_from_the_pushed_parameter_block, uses a
generated kernel with 20 read buffers and an output. On lavapipe and moltenvk-m3:
- ArgumentTableAddress is at Push{0}, 15 slot addresses fill the rest of the window, and 6 go to a
48-byte block;
- there is no descriptor;
- it passes L3;
- on the CPU interpreter, with the block and every buffer above 4 GiB, it stores the ordered fold
of the 20 words, which a swapped address would change.
Docs: docs/API.md's identity-domain bullet names the parameter block (added after the check
runs; no code differs from what they built).
Verified:
- m3-max-41196 (msi, check commit 9c6102b5ad on step 1's tree: this commit's metal2vulkan tree, with
the same translator files as here on
|
||
|
|
46e3215e55 |
identity: kernels over buffers lower under the identity domains
Under PointerDomain::Identity with HandleDomain::Identity every buffer slot of a kernel is its
device address used directly. Each slot is the Psb form, its address read from its own push
field, PushField::SlotGuestBase(slot): gpuAddress plus the bind offset, which under the identity
domains is the Vulkan device address. No root table is read, and no access is contained, as Metal
contains no device-address access (psb::prepare_at). Selection admits, under the identity domains,
only the plans lowered so far (select::identity_admits): a kernel whose push fields are its slot
addresses and its dispatch region, all in the push window, with no descriptor and every slot
addressed. Anything else is still Unsupported{IdentityDomains}, not implemented, now refused there
rather than for every function at analysis. SEMANTICS_VERSION 2146: a refusal under the identity
domains became a module.
The new tests (src/tests/engine_identity.rs):
- a1_bool_from_float under the identity domains on lavapipe and moltenvk-m3 has no descriptor,
no root table and three SlotGuestBase fields. It passes L3, and it computes the program's
answer on the CPU interpreter, with its buffers above 4 GiB at bind offsets 32, 16 and 4. It
writes nothing past its output, with its region pushed.
- a2_dynamic_texel_offset, which samples a texture, compiles under the default domains and is
refused under the identity ones.
Verified:
- m3-max-41149 (msi, check commit eeecc4492b, the same tree but for the test's region bytes):
clippy -p metal2vulkan --all-targets --all-features, rustdoc -D warnings, and nextest -p
metal2vulkan --all-features, 3664 of 3665. The one failure was this test, which met the kernel's
DispatchRegion field and did not fill it.
- m3-max-41195 (msi, a5dbfd408f, this tree): clippy and rustdoc; tests::engine_identity and the
domain pair test, 3 of 3.
- m3-max-41150 (msi, eeecc4492b): clippy under --cfg m2v_gpu and --cfg m2v_cpu_icd.
|
||
|
|
6769c2eaaf |
known-gaps: the RTX 3090's and the Iris Xe's half-output blend rows
The six half-output blend cases differ from Metal on the RTX 3090 (59 sites) and on the Iris Xe under ANV (62 sites). The ledger had no rows for either venue, so the conformance replay failed there. Every site is the device's own blend, which the native-arithmetic contract makes the answer, so each gets a row: 59 scoped `NVIDIA GeForce RTX 3090`, with answers equal to the RTX 5080 Laptop's rows (no venue pattern covers those two without the RTX 2080, which no run here measured), and 62 scoped `Iris(R) Xe`. docs/CONFORMANCE-COVERAGE.md is re-derived for them. How the sites were shown to be the device's blend, by a measurement build (not committed) that read every stored code back and set it beside plain float models of the blend: - The `one-zero`, `min` and `max` sites store the source or the destination through the attachment alone, and store Metal's codes on both devices, so both operands reach the blend exact. - RTX 3090 (NVIDIA 620.70.06): the exact blend rounded once to the attachment's precision gives 98.0% of the 16-bit words and 98.7% of the 32-bit ones. Into a 16-bit target the blend colour is truncated to `half`; the runtime hands vkCmdSetBlendConstants Metal's float colour unchanged, so the truncation is the device's. Every word that differs from Metal's is within 1.01 ulps of that model at the largest operand's magnitude. A -0 + +0 sum stores -0, which is the 32768 and 2147483648 of the zero-1msa and sas-1msa rows. - Iris Xe (Mesa 26.2.6): the float blend truncated toward zero into a 16-bit target gives 97.6% of those words. The exact blend rounded to nearest gives every 32-bit word. - On both devices every differing word is within two ulps of Metal's at the largest operand's magnitude. That is inside the bound of the `half-output-fast-math-blend` precision note (three half ulps, two float ulps). The note is announced on both devices: the cases' allowance for it fired on all six cases (3090: 12 of 12 allowances fired; Iris: 6 of 12, the six silent ones are shared-in-system-memory, which an integrated GPU does not announce). Verified: - conformance replay of the six cases exits 0, each run holding one GPU: ms01 RTX 3090 m3-max-41210, ms01 Iris Xe m3-max-41211, um870 RTX 3090 m3-max-41218. - cargo nextest run -p metal2vulkan-conformance --all-features: 1043 passed (m3-max-41208). The first run, before the document was re-derived, failed only the_conformance_coverage_document_is_what_the_sources_derive (m3-max-41199). - Measurements: m3-max-41151, 41171 and 41176 (um870 3090), 41174 (ms01 3090), 41175 (Iris). These ran at tree 9326ca7fd8, which this commit's tree equals. |
||
|
|
b415aae947 |
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. |
||
|
|
94071f82a2 |
device: the identity pointer and handle domains, taken as a pair
The new runtime's form: pointers are device addresses used directly and a texture's or sampler's
handle is its gpuResourceID (docs/RESOURCE-ID.md). The variants come beside the old domains,
which stay until the cutover; nothing lowers under them yet.
- PointerDomain::Identity and HandleDomain::Identity.
- Device::new refuses one identity domain without the other (InvalidDescriptor) and the identity
domains on a device without bufferDeviceAddress and shaderInt64 (Unsupported{IdentityDomains},
naming both features as one alternative).
- A compile under the identity domains is Unsupported{IdentityDomains}, not implemented, at the
start of analysis, so no old form is ever emitted under them. Later steps lift it as the
lowering lands.
- The profile fingerprint covers the domains (tested).
- docs/API.md's policy section names the domains; docs/REFUSALS.md and the reach table carry the
new refusal; api_signatures regenerated.
Verified (this commit's tree, rebased with the ledger commit before it onto
|
||
|
|
b6077a933a |
docs: REPLAY-STREAM.md says how much the old runtime's executed counts move
A play of one recorded stream on a 780M with an empty translation cache and an empty Mesa cache (m3-max-41100, at a8ad095897) recorded 2523 dispatches, 71967 draws, 28321 render passes and 8503 submissions; the two warm plays after it recorded 2079, 71742, 27871 and 7036. The stream's counts were equal in all three, every group and frame line (0 of 7932 differ); the executed counts differ in 285 lines cold against warm and in 11 between the two warm plays. So cold caches change the totals, not only where a few draws land, and the spec now says so. |
||
|
|
c97dbd66ea |
validation: the replay report keeps what the stream fixes apart from what the runtime executed
Each report line (completed group, frame, total) now holds two sets of counts. `stream`: the calls played, the command buffers committed, the encoders made, the draws and dispatches their calls issued, and the player's own relocated, misaligned and written counts, all fixed by the stream, so equal on every play on any runtime. `executed`: the runtime's counters (for the old runtime, the Vulkan commands it recorded and the pipelines it made). The separate `calls N` line goes: the total's stream calls are the calls played. Why: the old runtime's executed counts are not repeatable at one tip. Seven plays of one recorded stream on a 780M at one tip gave equal totals, but in some plays a few draws (with their barriers) moved from one group to a group 15 later, and once from one frame to the next. The moving groups are the ones that make a pipeline, and they differ in `draws_unkept_making` (2 against 1): draws recorded through a pipeline's general form while its own was still being made on the runtime's pool, which keep nothing to draw again (metal2vulkan-runtime's pipeline/render/residual.rs). Where a background making lands is timing. The commits, submissions per group and the player's waits did not differ. The matrix compares the stream's counts only. |
||
|
|
077c9722e3 |
metal2vulkan-rt: command queues, command buffers and events on the submit and completion threads
Step (c) of the new runtime's compute core.
What:
- CommandQueue (newCommandQueueWithMaxCommandBufferCount:, its bound on uncompleted command
buffers), CommandBuffer (enqueue, commit, handlers, waits, status, error), Event and
SharedEvent (signaled_value, set_signaled_value, wait_until_signaled_value,
notify_listener).
- A command buffer records at once into segments split at event waits and signals. The submit
thread holds a segment whose waits are not met, and its queue behind it, while the segments
before it run (reims F1). A wait the host's value meets submits no semaphore wait; a GPU
signal not above the highest value submitted or set is left out, so the semaphore only rises.
- The completion thread retires by a progress semaphore, follows submitted event signals (a
listener runs at a mid-buffer signal, reims F2), runs handlers with no lock held, and is
woken through a host-signalled timeline semaphore only when a wait needs it.
- A command buffer keeps each block it uses until it retires. A zeroed Private buffer's fill is
an upload submitted ahead of every later commit, whose segments start with a barrier; each
segment ends with a barrier to the host.
- Device::quiesce(timeout) (F9), with every wait bounded, no join of a thread still running, no
thread-local that exit() tears down, idempotent, freeing nothing; unmap runs on the caller for
every block handed out, once (a handed set replaces the per-idle flag).
- The last handle dropped in a handler: the completion thread finishes the teardown itself (F8).
- CommandQueue::abandon (F14); a loss ends held work, in-flight work once the device is idle,
host waits on pending signals, and later commits, with DeviceLost { in_flight } (F13).
- Refusals Committed, OtherDevice, NoCommandBuffers with their basis; Error::Quiesced;
docs/REFUSALS.md and the API signature table regenerated; the README's contract.
Verified: cargo fmt; refusal_surface --check. The compile and device jobs follow.
|
||
|
|
4e8784ad14 |
refusal surface: the new runtime's own refusal enums, one section each
What: refusal_surface.py reads the new runtime's Error and makes a section of docs/REFUSALS.md for each variant whose payload is one enum the runtime declares: today Refused(Refusal) and Limit(Limit), and any family added later (a Gap included) without a list of names to keep. Each of their variants declares its basis, as Problem's do, and --check fails on one that does not. The translator's Limit section no longer counts rt's Limit sites. A rustdoc link [text](path) in a summary reads as its text; three existing rows lose a link the file could not follow. Why: AGENTS.md wants every new refusal in REFUSALS.md, and the scan of rt read the floor's Missing only, so EmptyBuffer, BufferPastBlock, BlockLen and BlockIds were missing. Their basis lines cite the M3 Max measurements the old runtime records for the same answers (newBufferWithLength:0 and a placement past the heap's end answer nil), the device's limits, and our 32-bit numbers. How verified: the script regenerates, --check and --selftest pass locally; the refusal_surface test runs in the compile job. |
||
|
|
d3b0f2f580 |
validation: a played no-copy buffer drops the read-only option
A no-copy buffer plays as a buffer of its length (its host memory is not in the stream), and the runtime refuses option bit 24 on such a buffer, as Metal ends the process there; b2 stopped at its 354th call on one. The bit is dropped for a no-copy buffer alone, so the replay keeps the GPU writes Metal drops from that memory; the spec says so. A heap keeps the bit, which the runtime takes. Found by the b2 play on gem10's 780M (job m3-max-40908). |
||
|
|
2dda92f5e0 |
validation: a buffer in a block is the block's call, as the recorder writes it
The recorder renames a placement on a block (newBufferWithLength:options:offset:) and keeps its receiver, the block; the backend took it on the device, and b2 stopped at its 88th call. A no-copy buffer, [nil, length, options, nil], plays as a buffer of that length. Found by the b2 play on gem10's 780M (job m3-max-40905). |
||
|
|
a28aca8889 |
validation: the replay report counts the calls played, so a stop names its call
The stopping call is the one after the count: on a long stream the selector alone does not say where the play stopped. Verified by the unit test of a refused selector (the count stops before it). |
||
|
|
e99ec291b5 |
validation: the replay player plays the recorder's format, renders included
The spec and the player follow what the recorder writes (reims-vgpu bec103226; b2 was recorded at 50fc14009, the same format but for refused guest-RAM copies): structs and descriptors are maps keyed by the recorder's camelCase field names, nil for an unset optional field; f32 values are f64; descriptors Metal makes as objects (texture and render pass descriptors) are platform records changed by setter records; a drawable never seen made is a texture of its descriptor; the host's plumbing (padded, exportable and dma-buf buffers, an unshared queue) plays as the plain Metal call it stands for; the host's scheduling records play as nothing; no call answers a resource ID, and a descriptor's resource index places its object. The guest-RAM copies are [buffer, [[byte, data], ...]] in and [buffer, [[byte, [start, end]], ...]] out. m2v.copyBytes:toBuffer:offset: and m2v.copyToHost: are gone: the host has no such methods. The gpuResourceID answer check and PlayError::ResourceId are gone with the answers. The old runtime's backend becomes a module: argument and map readers (args), descriptors (texture, render pass setters, render and compute pipelines, depth-stencil, sampler, buffer and heap descriptors, function constants and descriptors, surface planes), and the command buffer, compute, blit and render encoders' calls. Each mapping follows how the host's platform applies the recorded value to the runtime. |