Files
metal2vulkan/docs
Anees Iqbal d806c0a792 Write Boolean visibility results as the device's nonzero query result, without the resolve
Metal's Boolean visibility result is nonzero where any sample passed and 0 otherwise. The
Apple M3 Max writes 1; Metal on the AMD Radeon Pro 5300M and the Intel UHD Graphics 630
(macOS 26.7.1, the reims-vgpu team's probes) writes the samples that passed. The runtime
had a crate-owned dispatch (bind::visibility_resolve_module) after every pass with a
Boolean offset whose only job was to rewrite that word to exactly 1. Under AGENTS.md rule
1 the device's native answer is the only form: a Boolean result is now the imprecise
occlusion query's own result, which Vulkan states as "When any samples are passed,
boolean queries will return a non-zero result value, otherwise a result value of zero is
returned" (occlusionQueryPrecise). Across a split pass's render pass instances the
combine still ORs the continuations, so zero stays zero exactly where no instance passed
a sample. Counting queries stay precise.

- Runtime: the resolve's plan, uploads, sets and dispatch are gone from visibility.rs, and
  OwnedModule::VisibilityResolve from owned_kernel.rs. A pass with no continuation now
  records only vkCmdCopyQueryPoolResults. The combine's in-place words are declared as
  shader reads and writes for every combined offset (they were declared only for Boolean
  ones). A new precision degradation, DeviceBooleanVisibility
  (device-boolean-visibility), is announced where a pass's Boolean results record; its
  catalogue entry is in docs/API.md section 9 and a device-gaps row in docs/FAST-PATHS.md,
  as for the other native-answer kinds.
- Translator: bind/visibility_resolve.rs and its tests are deleted (VisibilityResolve,
  VisibilityResolveModule, visibility_resolve_module leave the public surface). Its
  shared helpers (windows, words_buffer, u32_value) move into visibility_combine.rs; the
  combine's plan tests take the two refusal cases only the resolve's tests held. No
  translation output changes.
- Conformance: a new Loosening::Nonzero, and an allowance may name one element of a byte
  region as <site>/<byte offset>. The visibility family loosens each Boolean result's word,
  and only that word, by Nonzero, justified by device-boolean-visibility, which its Boolean
  cases also declare at the notices site. Every other word still compares exactly. No
  recording changes. README and docs/CONFORMANCE-COVERAGE.md (regenerated) say so.
- Validation lane: every Boolean expectation reads the word by its contract
  (visibility::by_contract: nonzero and not the buffer's starting word reads as 1), in
  visibility, framebuffer_fetch, host_bytes, depth_never and amplified_draws; the notice
  is a new lane site (visibility::BOOLEANS) taken by
  boolean_results_announce_the_device_s_value and expected where other tests' notice sets
  are exact. boolean_results_are_copied_with_no_dispatch counts one query result copy and
  no vkCmdDispatch for a pass of two Boolean offsets.

Verified: cargo clippy --workspace --all-targets --all-features -D warnings with
--cfg m2v_gpu; the runtime's degradation catalogue and site tests, the translator's
combine, owned-division, resolve-helper users', api_surface and api_signatures tests;
the conformance suite's 1024 device-free tests. The device lane tests run on the M3 with
the next step.

(cherry picked from commit a4976cdc3734c21c1b9ed4cf603bbf6bab2523f0)
(cherry picked from commit 34e44e3a12a46e6ff4b651cc4689002690d680fc)
2026-11-03 11:08:01 -08:00
..