bb21c14865fd994b46bb26c74619cc5e01ac4bbc
14
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
adb6f3c93c |
devtools: the tool runner's test module on unix hosts only
Its one test runs /bin/sh; on Windows the module held only an unused import. Verified: Windows clippy (gnullvm and msvc, --all-targets) reported this as the only error at 438f0c42cb (job m3-max-31946). |
||
|
|
4c6a29c409 |
Windows: dma-buf items unix-only; dirty pages, residency and rotation on every host
The runtime's first Windows check stopped at its module tree: dma_buf.rs takes file descriptors (std::os::fd) unconditionally, while dirty_pages, host_residency and texture/rotation were unix-only modules that every host's code names. - dma_buf.rs: every item that holds or makes a file descriptor (the sources, requests and chunks, the imports of dma-bufs and their pages, images bound to them, exported pages) is cfg(unix). The DRM-modifier image items that hold none (ModifierMemory, the explicit-plane and natural-layout checks, the format queries) stay on every host: their extension decides at run time. - dirty_pages and texture/rotation hold no unix code: on every host. - host_residency: the descriptor limit (RLIMIT_NOFILE), the dma-buf form of an import made again and its descriptor counts are unix-only; the pointer form and the sweeps stay on every host. - devtools' scratch lock: the file identity on Windows is the volume serial number and file index (GetFileInformationByHandle) in place of dev/ino. Verified: a step of the Windows check iteration (gnullvm, msi job). |
||
|
|
39bff0de2a |
The carried test trees read the checkout where the test runner names it
Every env!("CARGO_MANIFEST_DIR") in validation's runtime_lane.rs and runtime_lane/ and in
metal2vulkan-runtime/src/tests (135 sites) named the directory the test binary was built in. A
nextest archive built on msi and run on another node with --workspace-remap read msi's path there:
teardown_threads panicked reading runtime_examples.ll, and public_cases read no case shard.
metal2vulkan-devtools gets one resolver, workspace_dir(): two levels above the manifest directory
the runner names as the test runs (cargo and nextest name the test's crate; a remapped archive
names it in the running machine's checkout), where that root holds the validation fixtures, else
above the dev-tools crate as built (the fallback fixtures_dir already had). validation_dir() and
fixtures_dir() sit on it; engine_dir() is unchanged. The sites move onto them:
- fixture reads (fixtures/public, engine/ and examples/) onto fixtures_dir() and engine_dir(),
with the two hand-rolled "runtime variable else built" copies (attachment_reads, encoder_holds);
- committed cases and observations (validation_dir()/corpus), and public_cases and
public_case_names now read the public source rows through source::public_sources_under on
fixtures_dir() instead of source::public_sources(), which bakes the path;
- the runtime tests' device profiles (validation_dir()/profiles) and degradation_sites' read of
the lane's sources;
- the conformance recordings, docs/API.md and the runtime's own src/ through workspace_dir().
The imports of std::path the moves left unused are removed.
Test-only. tests::the_carried_tests_read_the_checkout_where_the_runner_names_it (devtools, the
previous commit) fails before this commit and passes after. Verification: the msi job that builds
both commits, runs the remapped archive at each and lints the tip is reported with this sha.
With 4e06c87523 (the scan check), e9a0927685 (render_state.rs and line_width tests; the scan covers all of runtime/src),
74aa3e44cc and 086962f1fa (fixes; source.rs fixture reads through fixtures_dir). Test code only.
Compiled in m3-max-31605 (msi: clippy x3; scan passes; lavapipe suites 6235 passed, failures all pre-existing pin-97
items or the runtime-sources pin; remapped run with the build tree hidden 201/202, the last needing an all-targets
archive, 31641). Base 4e06c87523 (31508): scan lists 135 sites; remapped run fails 63/202.
|
||
|
|
ea5d2b5dbb |
The dev tools find the fixtures beside the crate the test runner names
devtools::fixtures_dir() returned the validation crate's fixtures/public beside the dev-tools crate as it was built (env! of CARGO_MANIFEST_DIR at compile time). A nextest archive built on one machine and run on another, as the GPU nodes now run every device leg (built on msi, carried to um790), therefore read the build machine's paths and found no fixtures. It now looks first beside the manifest directory the test runner names at run time (cargo test and cargo nextest set CARGO_MANIFEST_DIR for the test's crate; a run with --workspace-remap names it in that machine's checkout), and falls back to the build-time path where that directory has no fixtures. Test infrastructure only (metal2vulkan-devtools, unpublished); no product path reads it. Verified (devcopy, 5c30935a78): validation-lane archives built on msi ran their fixture tests on um790 (the XTX device_copy run 27511 and the 2080 run 27575 read their fixtures through it). |
||
|
|
02341f3157 |
End to end: the linked-signature fixtures compute Metal's words by position
The owned fixtures engine/linked_signature_caller and linked_signature_functions (regenerated by scripts/regen-air-fixtures on the M3, Metal 32023.922, SDK 27.2) are the MSL the probe linked_function_signatures.m compiles. metal2vulkan_devtools::linked_signatures holds their 28 cases and word 0 of each: Metal's where the M3 Max stored one (m3-max-3300, which also matched m3-max-3238 case for case), the translator's own where Metal's read is undefined, or a refusal for the shapes no adapter passes. tests::engine_linked_signatures runs every case on the CPU interpreter and compiles the linking ones on every committed profile through L3; runtime_lane::linked_signatures runs them through the runtime under the validation layer, linked in functions, and in privateFunctions for the stitched and the plain extra-argument cases Metal measured so. (cherry picked from commit 98d793e667d739cb96c005ec63a0f7680f5129fc) |
||
|
|
43ba8cf525 |
Test stitched functions linked into their caller
Metal's stitcher writes its library only at run time, so the tests get its structure from a writer of our own: metal2vulkan_devtools::stitched writes, as LLVM text, the module the probe stitched_function_linked.m read back from Metal for a graph of float stitchable functions (the stitched function with its nodes inlined, its air.visible entry and air.stitching_info naming internal helpers kept by llvm.compiler.used, and an !air.signature of kind air.stitching_modules_signature listing the graph in post-order and a digest per stitchable function), and the executable metallib holding one visible (TYPE 4) module per function. PROBE_GRAPHS are the probe's `fused` and `fused4`. No Apple-produced bytes are committed. The owned fixture engine/stitched_caller (regen-air-fixtures, macOS 27.0 target, as the probe compiled) holds the stitchable sum2 and product2 and the kernels stitch_caller and stitch_caller4 that call `fused` and `fused4`. tests::engine_stitched checks Metal's answers: through the public API the stitched library's functions are visible and each kernel's compute pipeline links its function in privateFunctions and in functions; on the SPIR-V interpreter the kernels store the probe's 20 and 25 (and the graph's value on two other input sets); and each link passes L3 on every committed profile. Verified: the three tests pass; with the previous commit's gate restored all three fail, the link refused with exactly the consumer's error (Linking, NotImplemented, stitch_caller block 0 instruction 5, symbol "fused"). regen-air-fixtures --check: up to date. (Carried to development from steelbrain/reims-graphics-kext 88a6b651a7.) |
||
|
|
bf3ce3813c |
Read Core Image kernel libraries and split whole aggregate accesses
A Core Image kernel library (metal -fcikernel, metallib -cikernel) is a
metallib of file type 1 whose kernels (!air.ci) are listed as function
TYPE 5 over one shared module. The container refused the file type
(Unsupported LibraryKind(1)), so newLibraryWithData: failed where Metal
succeeds; the consumer's graphics-kext lane hit it on Core Image's own
helper library in a macOS 26 guest, so every Core Image path stopped
there.
What Metal answers, measured with kernels written from scratch on an M3
Max under macOS 27.0.1 (probe programs over Metal's API and objc's message
log of a CIColorKernel render):
- newLibraryWithData: takes it as MTLLibraryTypeExecutable; functionNames
is empty; the private externFunctionNames lists the kernels in the
reverse of the table's order (libraries of two and four kernels);
- newFunctionWithName:, newFunctionWithDescriptor: and the private
newExternFunctionWithName: make each kernel with functionType 4 (no SDK
enumerator; its description prints "Unknown"); newExternFunctionWithName:
answers as newFunctionWithName: for any library, a kernel of an
executable one included, and nil for a missing name;
- a compute pipeline made from an extern function fails ("Function tint
was not found in the module");
- Core Image fetches each kernel and its own helpers with
newExternFunctionWithName: and links them on the CPU, in Metal.framework's
base device class, into an ordinary executable library holding one
kernel, ciKernelMain, of which it builds a plain compute pipeline.
So now:
- container: file type 1 is read (executable; its functions may share one
bitcode range, hashed once, as a dynamic library's); TYPE 5 is the new
FunctionStage::Extern, no stage: the ABI cross-check refuses it as a
mismatch, Library::Function compiles it as no entry (EntryNotFound,
available 0). Unobserved file types stay LibraryKind refusals.
- FunctionType gains the private enumerator Extern = 4
(regen-metal-enums PRIVATE); reflection maps Extern to it.
- runtime Library: function_names leaves extern functions out;
extern_function_names (reverse table order) and
new_extern_function_with_name are new.
ciKernelMain itself was refused next: Lowering(Arith) at its first
load, `load [4 x <4 x float>], ptr addrspace(2)`, a whole array loaded
from the constant buffer and passed by value to a helper. Lowering reads
and writes buffer and threadgroup memory a scalar or vector at a time.
The new canon pass `aggregates` (after SCCP, beside the other expansions)
replaces each non-volatile, non-atomic load or store of a pointer-free
array or struct in device, constant or threadgroup memory by its members'
accesses in layout order (a getelementptr i8 at the member's distance, the
access's alignment lowered to what the distance allows, joined by
insertvalue or split by extractvalue), at most 256 members, 8 deep.
Thread memory, pointer-holding aggregates (handles), volatile accesses
and larger types stay whole as before. The same-type pointer bitcast
beside the load was never the problem (verified alone).
Public surface: metal2vulkan-air FunctionStage::Extern; metal2vulkan
FunctionStage::Extern and FunctionType::Extern; runtime
Library::extern_function_names and new_extern_function_with_name
(api_signatures blessed: 5 added, none changed or removed). devtools
gains core_image_metallib. The metal-enum generation now records the
macOS 27.2 SDK (the host's Xcode); no SDK value changed, only Extern was
added. LibraryKind's doc and reach note name what it refuses now.
No cache version moves: file type 1 and aggregate accesses outside thread
memory were refused before, so no key reached them, and
golden_hashes_match_the_table passes unchanged (every public fixture
assembled: this Mac's Xcode 27.2 now has its Metal toolchain). The
runtime-sources pin moves (runtime library.rs): re-pinned here to
23766690fd75227c5333e976bfc1fdfafa6ff78f43e0c5ba8fa5183574cd9371.
Verified (M3 Max, macOS 27.0.1):
- Metal versus this tree's runtime on MoltenVK: Core Image's linked
ciKernelMain for a tint color kernel and for a sampler kernel (both
from-scratch CI kernels; the linked libraries captured from Metal in
scratch and deleted after), same constant buffer, source texture and
sampler, 4x4 RGBA32Float target: byte-identical texels, the early-out
column untouched on both. The parent tree answers FALLBACK (Lowering
Arith) for both. Release CLI: 0.01-0.03 s, 11 MiB each.
- Release CLI, parent vs this tree, largest public fixtures
(hfb_filter_bank render pair, tns_mm_flags), three runs each:
0.12-0.13 s vs 0.12-0.16 s and 0.05-0.06 s vs 0.04-0.05 s, 27 MiB both
(runs beside a test suite; the same within noise).
- New tests: canon aggregates (split loads, stores with nested arrays and
lowered alignments, threadgroup; volatile, pointer-holding and
300-element aggregates stay whole), an engine test running a
ciKernelMain-shaped kernel on the CPU interpreter on three profiles,
core_image_libraries (container types, stages, shared hash, functionType
4, EntryNotFound), and a runtime device test on MoltenVK (names, extern
names, both lookups, pipeline refusal, an executable library's kernel
through the extern lookup). Negative controls: the split and execution
tests fail with the pass disabled; the library tests fail with file
type 1 refused.
- cargo nextest -p metal2vulkan -p metal2vulkan-air -p metal2vulkan-runtime
-p metal2vulkan-devtools --all-features: 4927 passed (golden hashes and
the metal-as fixture parts included); -p metal2vulkan-validation
-p metal2vulkan-conformance: 2369, all passed after the re-pin; doctests
ok; clippy --workspace --all-targets --all-features -D warnings and the
runtime's under --cfg m2v_gpu: clean; rustdoc -D warnings and
scripts/api-docs: clean; REFUSALS, METAL-COVERAGE and
CONFORMANCE-COVERAGE re-derived (MTLFunctionTypeExtern is listed as not
yet compared by a conformance case). Not run: a corpus translation
census, and the device suites beyond the new runtime test.
|
||
|
|
ec6b322bb5 |
Read the AIR slice of Mach-O universal metallibs
The container took a universal metallib only in Metal's own form (magic
0xCBFEBABE, what MTLDynamicLibrary's serializeToURL: writes). The system's
universal metallibs are Mach-O universal files instead: FAT_MAGIC
(0xCAFEBABE) with fat_arch records (five big-endian u32s), or FAT_MAGIC_64
(0xCAFEBABF) with fat_arch_64 records, whose offset and size are u64s.
Metal loads them; the parser refused them as BadMagic ("input not read").
The consumer's reims-graphics lane hit it on every Core Animation library
WindowServer made (QuartzCore's default.metallib, 19 slices on a macOS
26.6.1 x86-64 guest).
container::parse now dispatches on all three headers (UniversalForm) and
reads the slice of CPU type 0x01000017, the library's AIR; the GPU slices
stay unread. Metal's own form without an AIR slice is still NoAirSlice. The
Mach-O magic is shared with files that are no metallib (a CPU-only binary,
a Java class), so a Mach-O file whose records do not fit, or that holds no
AIR slice, is BadMagic, as before. An AIR slice that is no MTLB is
BadMagic at the slice; error offsets inside the slice are the slice's own.
Truncation offsets saturate rather than overflow on a hostile 64-bit
record.
The library is its AIR slice. container::Metallib gains `bytes` (the
metallib's own bytes: the input, or the slice), and Library::parse keeps
and hashes only that slice: Library::bytes, content_hash and the runtime's
serializeToURL: are the AIR slice's for a universal input. That keeps a
universal file inside the 500 MiB ceiling: QuartzCore's file is 187 MB,
and the first cut, which kept the whole file and copied it, peaked at
587 MB of resident memory in the command line. The command line also no
longer copies a .metallib input before parsing it.
Public surface (metal2vulkan-air): FAT_MAGIC and FAT_MAGIC_64 are new
public constants beside UNIVERSAL_MAGIC; container::Metallib gains the
public field `bytes`. Metallib is not #[non_exhaustive], so a consumer
that builds one with a struct literal must add the field; consumers that
only read a parsed Metallib are unaffected. The devtools metallib module
gains UniversalHeader and universal(), the builder both suites share.
No cache version moves: a function's translation key covers its own
bitcode, which is the same in a thin and a universal file, and a refused
file never reached a key. The content hash of a library loaded from
Metal's own universal form changes (it covers the AIR slice, not the
whole file), so such a key misses once; it never hits stale.
Verified (M3 Max, macOS 27.0.1):
- QuartzCore's default.metallib starts CA FE BA BE with 21 fat_arch
records, its AIR slice at offset 432 of 2,776,572 bytes (the layout
<mach-o/fat.h> gives). The release command line built from this tree
translates its kernel dynamic_system_ootf_decimate (profile
amd-rdna3-radv; spirv-val vulkan1.2: PASS) in 0.03-0.04 s wall at
192.4 MiB max RSS (185.9 MiB peak footprint, the input file itself),
three runs; from the extracted AIR slice, 0.01 s at 16.2 MiB, with
byte-identical SPIR-V (sha256 2dda4fe6...). Built from the parent it
answers FALLBACK (input not read). Nothing of the file is in the tree;
the scratch copy was deleted.
- Tests: a_universal_metallib_is_read_through_its_air_slice (each header;
missing slice, non-MTLB slice, truncations, Java-class-shaped inputs),
a_wide_universal_record_reads_64_bit_offsets_and_sizes (high words of
offset and size), and a_universal_file_is_the_dynamic_library_it_holds
(Library level: bytes, content hash, type, install name and a computed
result through the interpreter, run with llvm-as present, no SKIPPED).
The container tests fail on the parent's parser and pass here.
- cargo nextest -p metal2vulkan-air -p metal2vulkan-devtools: green;
api_signatures (blessed: 3 signatures and 2 constant values added, none
changed or removed) and api_surface: green; clippy --workspace
--all-targets --all-features -D warnings: clean; cargo doc --workspace
--all-features --no-deps with -D warnings and scripts/api-docs: clean;
REFUSALS.md re-derived with no drift.
- The full metal2vulkan suite: 3258 run, 10 failed before the signature
bless: api_signatures (fixed by the bless), golden_hashes (stale
"unassembled" cells) and 8 tests that need `xcrun metal-as`, which this
Xcode 27.2 lacks (its Metal Toolchain is not installed). Those 9 are
environmental and independent of this change. The validation and
conformance suites and a corpus translation census were not run.
|
||
|
|
63859d8cc1 |
Sum emulated filters' taps in the device's arithmetic
Rule 1: where the device has a native form it is the only form. The emulated filters reproduced Metal's datapath bit for bit: a 2^-16 Catmull-Rom weight table, two-word integer sums truncated onto grids and rounded half up, exact quotients, ties-away half rounding, a 12-bit sRGB grid snap, 64ths of a level and 256ths of a blend, and the anisotropic filter's piecewise log2 and chord exp2. All of it is gone. Bicubic (lower/sampler/bicubic.rs, bicubic/routines.rs): - One routine, `Plane::sum`: Catmull-Rom weights computed in f32 from the fraction (vec4 Horner), the sixteen taps summed by the device's multiply and add, rows then columns; Metal's bilinear rule (32-bit float formats, a level under four texels) is the device's FMix of the four inner taps already fetched; UNORM/SNORM clamps. - 1D: `Line::sum`, the device's FMix of its two taps. - An 8-bit sRGB twin's taps are the device's transfer, not the 1/4095 grid. A half result is the device's narrowing (`narrow::round`), not ties-away. - Kept: Metal's footprint, addressing, mirror pin, filter selection, `Quad::exact` (in-place YCbCr's filter, owner form H, not touched). - Deleted: the weight table routine, the exact/half/accumulated plane and row routines, the block and float-quad routines, their words and specials; metal::bicubic's test-only table and its test. Extended range (lower/sampler/extended.rs): - Linear, 3D and the linear mip filter's level blend decode their taps through xrconv's functions as they are, then FMix in f32 at the f32 fractions; the level weight is the f32 fraction, not 64ths; a half result is the device's narrowing. Bicubic clamps into the format's decoded endpoints. The in-place decode keeps `Quad::exact`. - Deleted: the step tables' callers (steps_of, step, level_taps, half_of) and, in xrconv's extended_range.rs and texel_round.rs, the helpers only they used (STEPS_WORDS, has_steps, steps, step_grids, ratio_by_255_to_f32, normal_half_bits; minimal edits in another lane's files). Anisotropic (lower/sampler/anisotropic.rs): - The device's Log2 and Exp2 replace Metal's piecewise log2, chord exp2 and truncations; the level and spacing are not rounded to 256ths, 4096ths or a 6-bit mantissa. - Each tap is one explicit-level sample: under a linear mip filter the fractional level, which the device's own linear mip filter blends. The two-samples-a-tap form existed because an RTX 3090's blend of a fractional level is not Metal's (1.03 codes off without anisotropy); under rule 1 that blend is the device's. A nearest mip filter's level stays whole (the 3090's anisotropic sampler blends the next level at a fractional level whatever its mipmap mode). - Kept: Metal's length, tap count thresholds, floor(256/n) weights, kappa fit and direction. Notes: PrecisionNote::BicubicFilterArithmetic is reused, broadened to the extended-range linear, 3D and level blends (select.rs records it); AnisotropicFilter's doc names the device's logarithm and blend. No new variant, no ARTIFACT_FORMAT_VERSION bump. FAST-PATHS: the two "not built yet / none known" bicubic rows are now one device-gap row (the device's sum is the form); the known-gaps bullet loses the sRGB grid snap. API.md's catalogue entries rewritten. SEMANTICS_VERSION 1922 -> 1923. Tests: the plane routine's interpreter differential against an f32 Catmull-Rom reference in the routine's order (fails on the old table and integer sum), the line routine's FMix, the routines' word bounds; engine_bicubic against the polynomial within 2^-18 (+ half ulp); extended-range engine tests compare within the filter's bound (`filtered_close`); xr_bicubic's `near` adds Metal's table's deviation from the polynomial (WEIGHTS_BOUND 2.1e-3); anisotropic and bias-reach tests count one sample a tap and two Exp2 per emulation. Lanes and the conformance suite: - runtime_lane::extended_range_samples compares linear samples within `xr_bicubic::filtered_close` (moved to devtools from the engine test, which re-exports it); two_plane_samples holds the digest of nearest cases only (a linear one's values are compared by the conformance suite's xr-two-plane-samples cases). - runtime_lane::anisotropic_filter's bounds re-measured on the M3 Max with samplerAnisotropy withheld: linear 10.375 codes max (mean 0.21), nearest mean 0.82 and 6.7% of channels a code or more off, clamp to edge 6.531 max. Other devices not measured. - conformance: the XR two-plane-samples and extended-range/padded extended-swizzles cases declare bicubic-filter-arithmetic; 32 known-gaps rows (Apple M3 Max) for the linear sites the device's FMix moves. - runtime-sources.sha256 re-pinned: metal/bicubic.rs lost its test-only table and docs; no run's behaviour depends on it. Verified (this M3 Max, macOS 27.0.1): metal2vulkan + devtools suites, 3302/3303 passed (golden_hashes_match_the_table fails: 1001 cells moved, not blessed). Module words of a bicubic sample (ANV Iris Xe profile): xr_bicubic xrb_edge 12990 -> 2093, a2_bicubic_weights 15731 -> 3858, bcx_rules 30727 -> 11388; anisotropic emulation (vk12-floor) 2705 -> 1884. Also in this packet: the padded 10-bit formats' linear samples join the known gaps (d326b293c0), and the conformance coverage document is regenerated for the filter rows. Anisotropic emulation (devices without samplerAnisotropy only) now takes the device's Log2/Exp2 and level blend, and Metal's spacing roundings (r' to 256ths, g*S to 4096ths, S to a 6-bit mantissa) are gone with them: on the M3 with samplerAnisotropy withheld, linear reads up to 10.4 codes from Metal (mean <= 0.21), bounded in runtime_lane/anisotropic_filter.rs. One work packet, landed as 2 commits on archive/development-linear-2026-10-29: abc366a2fa, then 8f506cb2fd (the re-pin). |
||
|
|
20287666c0 |
Blend extended-range attachments in the device's arithmetic; drop the 32-bit float Metal blend
Rule 1 (owner, 10-29): where the device has a native form, it is the only form.
An extended-range attachment's raw codes are something no blend unit reads, so the
shader still blends it (capability), inside the pixel interlock or over lavapipe's
input attachment. Its arithmetic used to be Metal's compiler's: lerps, common
factors, fusing by factor rank, half rounding at every step, a separate float4
model and computed-output tables. Now it is a blend unit's arithmetic: S*Fs op D*Fd
in float, in the order of the blend equation, with the source, second source and
blend color clamped to the form's range first (`extended_range::blend::native`).
- computed.rs is deleted. blend_color.rs keeps only the two source ranges.
- input_blend.rs and fetch.rs call native().
- The blend color is pushed as raw f32 bits (HalfBlendColor), so
PushField::BlendColor is gone.
- Every blended extended-range output that stores a channel now records
ExtendedRangeBlendSource (half) or ExtendedRangeFloatBlendSource (float).
- The refusals ConstantColorDifference, SrgbForm and FloatOutput are gone, as is
the fast-math DualSource refusal for extended range. Every factor, operation
and mask is built; only outputs other than four half or float lanes are
still refused (Output).
The 32-bit float storage-form blend (`Blend::float32`, `fetch::float32_blended`)
computed Metal's fused forms in float. Every committed profile except
roadmap-2022 and vk12-floor sets COLOR_ATTACHMENT_BLEND on R32/RG32/RGBA32_SFLOAT,
so that form copied Metal's bits where the device blends natively. It is removed:
- a fetched 32-bit float attachment takes the generic float blend
(UnmeasuredFetchBlend);
- one that is not fetched gets the device's blend after the pass splits.
The float4-output paths of the half/unorm8 model (Atom::Sf, Arith::Kept,
round_inner, Blend::float/narrow/takes_float) were dead after this and are pruned.
Removed:
- the Metal blend-table validation lane (extended_range_blend_table.rs)
- devtools xr_blends
- the xr_blend_table*.txt fixtures
- lower/arith/tests/blend32.rs
- the extended_range tests that pinned Metal's forms
Added:
- every_blend_is_the_devices_arithmetic: every form, 19 factors, 5 operations,
rotating masks and adversarial sources, bit-exact against a float model of
S*Fs op D*Fd
- every_blend_is_built_but_a_placeholder
Docs:
- FAST-PATHS: the "Metal's rounding per shape" fast row is removed. The
extended-range blend is now a device-gaps row with the two notes. The
32-bit float row and the interlock section are fixed.
- artifact.rs note docs and the API.md catalogue are rewritten.
- REFUSALS is regenerated, reach.tsv updated and api_signatures blessed
(removed ExtendedRangeBlend::{ConstantColorDifference, FloatOutput, SrgbForm},
PushField::BlendColor).
- Conformance: the two notes join replay::NATIVE_NOTES, and 16 Apple M3 Max
known-gaps rows hold the xr-blend add/premul sites the device's arithmetic
moves: one code, two at the sRGB premultiplied sites.
- SEMANTICS_VERSION 1923, ARTIFACT_FORMAT_VERSION 479.
Size: a premultiplied half4 fill into RGB10A8_2P_XR10 on moltenvk-m3 goes from
3275 to 1937 SPIR-V words (the blend itself from 2133 to 795). The float4 fill
goes from 3435 to 1951 words, and BGRA10_XR_sRGB premultiplied from 7992 to 6654.
Verified:
- metal2vulkan lib, touched modules: 511/511.
- Sabotage: rounding the source to half in native() fails
every_blend_is_the_devices_arithmetic; restored, it passes.
- clippy, plain and with --cfg m2v_gpu; rustdoc -D warnings.
- M3 Max conformance replay of 25 cases: half-output-blends-*,
blend-interaction-format-float32 and xr-blend-*-one-zero are justified; the 16
xr-blend add/premul sites are held by the new rows.
The replay exits 0 with the ledger held exactly. The conformance crate
passes 1007/1007, CONFORMANCE-COVERAGE is regenerated, and runtime
degradation/catalogue and api_signatures/api_surface/refusal_surface pass.
- M3 device tests (memcap + maclock, --cfg m2v_gpu): 11/11 of
runtime_lane::extended_range_blends and framebuffer_fetch::generic_blend.
The renamed blends_of_half_outputs_into_extended_range_texels asserts
Metal's bytes for one-zero and prints the 16 add/premul outputs the device's
arithmetic moves.
One work packet, landed as 2 commits on archive/development-linear-2026-10-29: 808143ef80, then 18431ee908 (the re-pin).
|
||
|
|
8264a4c1f0 |
Remove each scratch temporary that outlived its tool, kill included
Content: the tree of `development` at 16257a79ad, unchanged. |
||
|
|
e320a1f475 |
Drop design-record, work-package and evidence codes from comments, and retire vk12-bare from the corpus
Comments, fixture notes and docs lose their design-record numbers, work-package codes and evidence codes; lines that earlier commits of this series added carry their cleaned text there, so this commit holds the cleanup of lines that predate the series, the retired vk12-bare profile's corpus rows (a rationale and two observation rows), and docs/FAST-PATHS.md's measurements stated as they stand. Thirteen hash-keyed files keep their citations, because their bytes are case or record identities: eight case-keyed .ll fixtures and five parity sources. Verified: the CPU suites (4997 of 4997 and 1328 of 1328), clippy, rustdoc and doctests. Folds in: - Drop evidence codes, design-record numbers and work-package codes from comments and fixture notes - Drop the retired vk12-bare profile from the corpus - Say the fast-path ledger's measurements as they stand, without commits, rounds or host incidents - Keep the case-keyed .ll fixtures byte for byte - Keep the parity lanes' fingerprinted sources byte for byte |
||
|
|
4b564766ec |
Sample extended-range textures through Metal's bicubic filter
A sample of a BGR10_XR, BGRA10_XR or RGB10A8_2P_XR10 texture (or an sRGB twin) through a constexpr bicubic sampler, or through a runtime sampler whose bound word states Cubic, was refused (NotImplemented(SamplerBicubicFilter) in the lowering, NotImplemented(Format) in the binder). It is now Metal's bicubic filter of the decoded texels, measured on an Apple M3 Max (macOS 26.7) through the owned fixture xr_bicubic: random codes of each of the six formats at 16x16, 7x5, 3x3, 2x6 and 1x1, 2,304 coordinates each (every texel's centre, then random ones up to 0.15 of the texture past its edges), through 12 kernels (a runtime Cubic sampler with float and half results; constexpr samplers under clamp to edge with float and half results, repeat, mirrored repeat, clamp to zero, the opaque-white and opaque-black borders, pixel coordinates, and an offset under clamp to edge and repeat): 3,317,760 lanes. What Metal does, and what the lowering now does: the footprint, weights, addressing, a mirrored axis and a level below four texels are the other formats' bicubic filter's, each tap the decoded texel or the border texel through the format's channels; a level below four texels sums as the extended-range linear filter (terms truncated); otherwise each tap's step is weighed by the product of Metal's weights and summed exactly (no term truncated, unlike the linear filter), the step rounded half up, clamped into the steps of the codes 0 and 1023 (a color lane's (0-384)/510 and (1023-384)/510, an sRGB twin's table steps, alpha [0, 1]), and divided by the grid exactly; a half result rounds as the linear filter's does. The clamp is applied to the rounded result, which equals clamping the step because each rounding is monotonic. Every lane but 4,050 matches that model; each of the 4,050 is one step from Metal's (1/8160 a color lane, 1/8192 an sRGB color lane, 1/4080 alpha), its exact sum within 0.014 of a step of a rounding tie that Metal rounds the other way. No model of Metal's datapath tried closes that residue, so the sample records PrecisionNote::BicubicFilterArithmetic, and docs/FAST-PATHS.md and docs/API.md say so. A bfloat or padded form's bicubic sample, a swizzled texture's and a gather through a bicubic sampler were not measured and are refused. How: select_extended takes the bicubic state of a constexpr sampler or of the slot's cubic-sampler variant (LoweringInputs::cubic_samplers) and plans Metal's bicubic filter; the extended sampler emits it through bicubic::filter with Texels::Extended, which fetches each tap's raw texel and decodes it, through the exact routines alone, then clamps. The binder takes a cubic word at an extended-range slot as the cubic-sampler variant's, and gives such a slot the neutral BicubicTexels value in the plan of the pipeline as compiled, which binds the neutral there (it refused the format before naming the variant: the device lane found that). SEMANTICS_VERSION 1693; RUNTIME_VERSION 1184, as a run of an existing artifact with a cubic sampler at an extended-range slot is no longer refused; the runtime-sources hash re-pinned. The table: xr_bicubic.tsv (2,067 samples of the probe's, per texture and kernel the middle texel's centre, four random coordinates, the first sample with a lane at a clamp bound and the first with a lane at a tie), shared through metal2vulkan_devtools::xr_bicubic with the probe's texture generator. Verified on homelab-gem10 (debug builds): - tests::engine_extended_range::bicubic, on the CPU interpreter on the lavapipe and MoltenVK-M3 profiles: every lane of the table through the same 12 kernels, compiled under the six forms' variants (the runtime ones under the cubic-sampler word the binder plans), is Metal's bits but the 136 lanes the table marks, each one step away; each compile validates and its estimate bounds it. A padded or bfloat form's bicubic sample, a swizzled texture's and a gather are refused as above (a two-plane gather as Format, under any sampler); on every committed profile the pipeline as compiled plans the variants with the XR texture and a Cubic sampler bound, and the variant's pipeline plans the same key. - runtime_lane::extended_range_bicubic (new): the 8,268 lanes on the Radeon 780M (RADV), the RTX 3090 and lavapipe, textures written as the probe wrote them: 0 differ from Metal (136 at a tie, one step away), and the state announces bicubic-filter-arithmetic. The extended_range_samples, two_plane_samples and two_plane_copies lanes, whose helpers this shares, pass on all three. - Release build, 12 kernels x 6 forms x 5 profiles (lavapipe, 780M, RTX 5080 Laptop, Arc ANV, MoltenVK-M3): 360 translations, mean 1.31 ms, slowest 1.97 ms (xrb_runtime, BGRA10_XR sRGB, 780M), budget ledger peak at most 935 KiB, process peak RSS 15.6 MB; the linear XR kernels take 0.81 ms on average. - clippy -D warnings (workspace, all features, all targets; validation also under m2v_gpu), rustdoc -D warnings and the doctests pass. Suites: metal2vulkan, -air, -runtime and -devtools 4,566 of 4,567, validation 1,293 of 1,293. The one failure is tests::golden_hashes, whose 380 stale cells are the two new fixtures' alone (smw_writers 7 and xr_bicubic 12 entries x 20 profiles), left to be blessed on development. |
||
|
|
13b279df1b |
Squash 11203 commits of translator, runtime, and validation work
Rolls up everything since
|