Merge fork main 8dd30ab: writes through one view of a page are seen at its other views

The fork's guard over every view of a physical page is kept on our own block
bits, known holes, kernel writes and changing blocks; what both had, ours.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
localandClaude Opus 5.5 committed 2026-11-25 00:38:57 -06:00
commit c45d109380
23 files changed
+4164 -221

No files matched your search

+24 -2
View File
@@ -682,7 +682,7 @@ fn create() -> windows::core::Result<Host> {
/// DXGI may return hardware for `EnumWarpAdapter` (notably under Proton).
/// Reject it before creating a device in diagnostics' software-only mode.
fn warp_adapter() -> windows::core::Result<IDXGIAdapter> {
pub(crate) fn warp_adapter() -> windows::core::Result<IDXGIAdapter> {
// SAFETY: plain DXGI adapter queries.
unsafe {
let factory: IDXGIFactory4 = CreateDXGIFactory2(DXGI_CREATE_FACTORY_FLAGS(0))?;
@@ -3127,7 +3127,8 @@ fn declared_writes(runs: &[&HostList]) -> Vec<Declared> {
/// ([`read_backs`]), the frame's main pass by scissor rectangle with its
/// culling dispatches (`draw.rs`, `walls_census`), the shader-written
/// buffers merged into title memory (`shadow.rs`, `walls_merged`), host
/// copies found stale after their refresh (`shadow.rs`), and, in the
/// copies found stale after their refresh (`shadow.rs`; only with
/// `VICTORY_REFRESH_CHECK=1` as well: it costs about 100 ms a frame), and, in the
/// runtime, the read requests that fail (with 2: every request).
pub(crate) fn walls_trace() -> bool {
static ON: OnceLock<bool> = OnceLock::new();
@@ -6829,6 +6830,13 @@ fn for_pieces(start: usize, len: usize, step: usize, mut f: impl FnMut(usize, us
}
impl Host {
/// The queue everything of ours runs on, for a call that must go to it
/// in order with the lists (`crate::tiles`: a texture's levels are
/// given memory ahead of the list that uploads them).
pub(crate) fn queue(&self) -> &ID3D12CommandQueue {
&self.queue
}
/// A buffer in the upload heap, mapped for writing.
/// A buffer of `size` bytes the card writes and we read (a read back),
/// in the state copies into it need.
@@ -7078,6 +7086,7 @@ impl Meter {
"placed texture views: {} writes of another view of the texture a slot showed (it kept the old view until the new was made)",
crate::descriptor::host::KEPT_VIEWS.load(Ordering::Relaxed)
);
crate::tiles::status();
{
let [queued, due, away, partly, oldest] =
[0, 1, 2, 3, 4].map(|i| crate::draw::HEAP_TEXTURES_QUEUE[i].load(Ordering::Relaxed));
@@ -7101,6 +7110,19 @@ impl Meter {
crate::descriptor::host::STALE[4].load(Ordering::Relaxed)
);
}
{
let mode = crate::watch::page_writes();
let [writes, bytes, guarded, plain] = [0, 1, 2, 3].map(|i| crate::watch::WRITTEN[i].load(Ordering::Relaxed));
let [kept, dropped, slots, uploaded] =
[0, 1, 2, 3].map(|i| crate::descriptor::host::PAGE_WRITES[i].load(Ordering::Relaxed));
tracing::info!(
"writes behind the guards, since the start: {writes} DirectStorage writes into physical pages at addresses the title had mapped ({} MB); {guarded} guarded 64 KiB blocks of host copies lay under them ({}); {plain} reads to plain addresses finished ({}); {kept} ranges under texture views kept for the texture pass ({dropped} dropped); {slots} slots of placed textures held their bytes, {uploaded} of them uploaded before the write ({}) (VICTORY_PAGE_WRITES: unset counts, 1 acts, guards, slots, all)",
bytes >> 20,
if mode & 1 != 0 { "opened, taken again" } else { "left as they were" },
if mode & 4 != 0 { "told as well" } else { "counted only" },
if mode & 2 != 0 { "made due again" } else { "left as they were" }
);
}
#[cfg(feature = "diagnostics")]
tracing::info!(
"write-watch askings of a millisecond or more: {:.1} a frame, {:.1} ms a frame; the longest asking {:.1} ms",