observe: 288 partial draws a boot destroy texels, priced by the area they lost
Component: crates/reims-vgpu, runtime/draw/vulkan.rs.
Pathway: x86 macOS / Linux Vulkan. Rail: macos-15.
Observation only: no guest-visible behavior changes, so no conformance
battery applies.
What the prior commit's census read, on boot s3 (HEAD e273bd4f, tree clean,
rail macos-15, zero-input host capture WHITE, dock-sweep repair PAINTED):
draw_partial_preserving_from_target 14 882
draw_partial_preserving_seeded 78
draw_partial_preserving_unseeded 288
draw_partial_dontcare 288
Two readings. First, 288 partial draws a boot destroy texels that
MTLLoadActionDontCare promised to keep -- a population the ordinal census
reported as draw_partial_load_unseeded = 0 under the sentence "no partial
draw on this pathway destroys what it did not cover", which was true of one
ordinal and false of the contract term.
Second, and stronger: draw_partial_preserving_unseeded equals
draw_partial_dontcare exactly, in every sampling window. Not one DontCare
partial draw in the boot found its prior contents through any door, while
the LOAD population preserved 14 882 times. The two seed doors that were
widened to admit DontCare have never once answered for it.
The colour that lands. `target_clear` is initialised [0.0f64; 4] and is
assigned only in the LoadAction::Clear arm, so a preserving action with no
seed keys "no seed", caches.rs resolves that to vk::AttachmentLoadOp::CLEAR,
and the value cleared to is the untouched default: transparent black. The
texels outside the scissor do not become undefined -- they become (0,0,0,0),
a colour this device chose for an attachment whose clear colour the guest
never set, because the guest did not ask for a clear.
Behavior changed. None. The population is now priced in the only unit its
cost is proportional to: draw_partial_preserving_unseeded_lost_texels
accumulates the attachment area minus the rectangle the draw covered, for
the unseeded arm only. A record count cannot rank this -- a boot's small
scratch targets outnumber its full-screen compositor layers by orders of
magnitude -- and pricing the preserved arms would report the rail working as
if it were the loss, which is the mistake that once produced a 519 715-strong
"defect" out of the LOAD population.
Focused test. a_dontcare_partial_draw_is_priced_by_the_area_it_destroyed
asserts the loss of a 10x10 draw on a 100x100 DontCare target is 9 900, and
that the same draw prices nothing when its prior contents were on the
resident, when a seed resolved, and when the guest asked for a Clear. Delta
form, because the census map is process-global.
Verification run. cargo fmt --all and --check clean. All three clippy arms at
-D warnings, each invoked separately: aarch64-apple-darwin/backend-metal,
host backend-vulkan,host-window, and x86_64-unknown-linux-gnu
backend-vulkan,host-window. Serial suite 2390 passed, 0 failed.
Not verified. The lost-texel total has not itself been read on a boot; this
commit reports the record counts above, not an area. The link from this
population to the reported half-rendered-image and black-rectangle symptoms
remains a hypothesis: both witnesses failed on boot s3 for setup reasons --
menu-close-probe's dark= column used a non-existent magick fx operator and
its captures never changed across trials, and web-content-probe exited 2 on
its own "the page never declared a layout" gate. Neither result says
anything about the device. Symptom 1 is separately not explained by this:
the clear that lands is transparent black, the white field is uniform 0xff,
and the white passes declare MTLLoadActionLoad, whose seed is never lost.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
e273bd4fc0
commit
27a0dc1daa
1 file changed
+106
@@ -5770,6 +5770,30 @@ fn note_draw_coverage(
|
||||
// read together and neither replaces the other.
|
||||
if let Some(route) = preserving_partial_route(load_action, seeded, from_target) {
|
||||
crate::runtime::drain::note_store_route(route);
|
||||
// And what it costs, in the only unit the cost is proportional to.
|
||||
//
|
||||
// A record count cannot rank this population: a boot's small scratch
|
||||
// targets outnumber its full-screen compositor layers by orders of
|
||||
// magnitude, so a count is dominated by the passes whose answer does
|
||||
// not matter. The number that says whether a guest can see this is the
|
||||
// area the pass overwrote *without being asked to* — the attachment
|
||||
// minus the rectangle the draw actually covered — because that is
|
||||
// exactly the set of texels that held guest content before the pass and
|
||||
// hold `[0.0; 4]` after it.
|
||||
//
|
||||
// Only for the unseeded arm. The other two preserved their contents, so
|
||||
// their uncovered area is not destroyed and adding it here would price
|
||||
// the rail working as if it were the defect — the same mistake
|
||||
// `from_target` was added above to undo.
|
||||
if route == "draw_partial_preserving_unseeded" {
|
||||
let target = (target_w as u64).saturating_mul(target_h as u64);
|
||||
let covered = (scissor.width.min(target_w) as u64)
|
||||
.saturating_mul(scissor.height.min(target_h) as u64);
|
||||
crate::runtime::drain::note_store_route_n(
|
||||
"draw_partial_preserving_unseeded_lost_texels",
|
||||
target.saturating_sub(covered),
|
||||
);
|
||||
}
|
||||
}
|
||||
// How much of the surface this draw's scissor actually covers.
|
||||
//
|
||||
@@ -10693,6 +10717,88 @@ mod vulkan_split_tests {
|
||||
use crate::model::{DeviceId, PAGE_SHIFT_X86};
|
||||
use crate::runtime::host::FakeHost;
|
||||
|
||||
/// A DontCare partial draw prices its loss as the area it overwrote
|
||||
/// without being asked to, and a preserved one prices nothing.
|
||||
///
|
||||
/// The area is the reading, not the record count: a boot's small scratch
|
||||
/// targets outnumber its full-screen compositor layers by orders of
|
||||
/// magnitude, so a count is dominated by the passes whose answer does not
|
||||
/// matter. Asserted as a delta because the census map is process-global and
|
||||
/// the rest of the suite shares it.
|
||||
///
|
||||
/// The second half is the one that would have caught the original defect's
|
||||
/// mirror image. Pricing a draw whose prior contents *were* preserved would
|
||||
/// report the rail working as if it were the loss — which is exactly what
|
||||
/// scoring `target_rgba8.is_some()` alone did to the LOAD population, and
|
||||
/// it produced a 519 715-strong "defect" that was not one.
|
||||
#[test]
|
||||
fn a_dontcare_partial_draw_is_priced_by_the_area_it_destroyed() {
|
||||
use crate::runtime::drain::store_route_count;
|
||||
const LOST: &str = "draw_partial_preserving_unseeded_lost_texels";
|
||||
// A 100x100 target with a 10x10 draw in it: 10 000 - 100 = 9 900 texels
|
||||
// held guest content before the pass and hold `[0.0; 4]` after it.
|
||||
let scissor = ScissorRect {
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: 10,
|
||||
height: 10,
|
||||
};
|
||||
let before = store_route_count(LOST);
|
||||
note_draw_coverage(
|
||||
scissor,
|
||||
100,
|
||||
100,
|
||||
Some(super::MTL_LOAD_ACTION_DONT_CARE),
|
||||
false,
|
||||
false,
|
||||
);
|
||||
assert_eq!(
|
||||
store_route_count(LOST),
|
||||
before + 9_900,
|
||||
"the loss is the attachment minus the rectangle the draw covered"
|
||||
);
|
||||
|
||||
// The identical draw, with its prior contents on the engine resident.
|
||||
// Nothing was destroyed, so nothing is priced.
|
||||
let held = store_route_count(LOST);
|
||||
note_draw_coverage(
|
||||
scissor,
|
||||
100,
|
||||
100,
|
||||
Some(super::MTL_LOAD_ACTION_DONT_CARE),
|
||||
false,
|
||||
true,
|
||||
);
|
||||
note_draw_coverage(
|
||||
scissor,
|
||||
100,
|
||||
100,
|
||||
Some(super::MTL_LOAD_ACTION_LOAD),
|
||||
true,
|
||||
false,
|
||||
);
|
||||
assert_eq!(
|
||||
store_route_count(LOST),
|
||||
held,
|
||||
"a pass that kept its prior contents lost none of them"
|
||||
);
|
||||
|
||||
// And a Clear, which asked for those texels to be destroyed.
|
||||
note_draw_coverage(
|
||||
scissor,
|
||||
100,
|
||||
100,
|
||||
Some(super::MTL_LOAD_ACTION_CLEAR),
|
||||
false,
|
||||
false,
|
||||
);
|
||||
assert_eq!(
|
||||
store_route_count(LOST),
|
||||
held,
|
||||
"a Clear got the destruction it asked for and is not a loss"
|
||||
);
|
||||
}
|
||||
|
||||
/// A draw the engine made and a draw the engine refused do not report the
|
||||
/// same sentence, and neither reports "not attempted".
|
||||
///
|
||||
|
||||
Reference in new issue
Block a user