diff --git a/README.md b/README.md index 676710f..045c30f 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,9 @@ Code that is in this repository: compatibility layer under everything else (loader, runtime services, Direct3D 12 back end, shader recompiler). - [fxceless/victory-fork](https://github.com/fxceless/victory-fork) (formerly - victory-gta6): the fork the 7900 XTX one grew from, and the Series S interface - plane (pull request 1189, Tissma95), which fixed the black menus. + victory-gta6): the fork the 7900 XTX one grew from, the Series S interface + plane (pull request 1189, Tissma95), which fixed the black menus, and the face + network fix (pull request 927, tippythetaidum), which made faces move. - victory-perf, carrying patches from [ZigZagBoi1/ScarlettPort](https://github.com/ZigZagBoi1/ScarlettPort): the title patches for render scale, the title's own upscaler and the watchdog. @@ -123,7 +124,60 @@ RTX 5070 12 GB with a Ryzen 7 9800X3D, in the prologue: `crates/victory-gpu/src/shader_cache.rs`): the `VICTORY_BVH_MISS` switch, made part of the shader cache key so translated shaders with and without it are kept apart. -12. **`scripts/play-nvidia.ps1`**: the launcher with all of the above. +12. **`scripts/play-nvidia.ps1`**: the launcher with all of this list. +13. **Faces move** (`crates/victory-shader/src/emit/halves.rs`, `lower.rs`, + `crates/victory-gpu/src/descriptor/host.rs`, `draw.rs`). Faces are driven by + a network of compute programs whose numbers travel as 16-bit values through + integer views; they were read as floats and came back as zeros on NVIDIA, so + no face moved. They now move as integers. Ported from fxceless/victory-fork + pull request 927 (tippythetaidum). + +14. **Ray tracing mostly off** (`scripts/rt_off_hashes.txt`, used by + `play-nvidia.ps1` through `VICTORY_SKIP_PIPELINES`; `-RayTracing` keeps the + passes). The title's ray-tracing structure builder cannot run on NVIDIA (its + 64-lane programs are refused; Marvisak/VIctory pull request 2311), so every + ray misses. The passes that turn those misses into light made rooms go white + and hazy depending on the view angle. The 1,000 `CS_RaytracingResolve` and + 34 traced-shadow shaders are skipped. The screen-probe and visibility traces + keep running: skipping them too (all 1,052 shaders of fxceless pull request + 465's rule) left their outputs as garbage, rainbow glitter everywhere. Needs + the `diag` build (the skip list is a diagnostics switch). +15. **The intro video no longer flickers** (`crates/victory-gpu/src/texture.rs`). + The movie's planes (linear, one-level R8 textures in a ring of three) were + written by the decoder through another view of the same memory, judged + clean when the frame was recorded, and copied a list late: frames from the + ring showed out of order. Video planes now always record their copy. + +### Settings + +The default set of `play-nvidia.ps1` is the speed set (about 18-22 fps on the +RTX 5070). `-Quality` trades about 7 fps for fewer of the first two faults +below. + +| Fault | Cause | Fix | +|---|---|---| +| Stretched bodies that jump | The relay's second stage and card steps hand skinned meshes back before they are done (avatarmanz issue 13; fxceless issue 89 on an RTX 5070) | `-Quality`: `VICTORY_RELAY=1`, `VICTORY_CARD_STEPS=0` | +| Rainbow, pixelated skin | A texture refresh that does not wait for the runtime's remapping fills its upload from pages not there yet | `-Quality`: `VICTORY_TEXTURE_NO_WAIT=0` | +| Some views far too bright | Without rays the light probes keep the sky's light indoors, and the fog takes it too | Always: `VICTORY_AMBIENT_AIR=1.5` (fog at most 1.5 times the light around), `VICTORY_AMBIENT_MOST=2` (new, `ambient.rs`; was a fixed 4) | +| The picture stops until you look away | A pipeline that takes longer than the wait was waited for again in every frame it was in view | Always: each pipeline is waited for once at most (`VICTORY_PIPELINE_WAIT_ONCE`, on; `pipeline/make.rs`; the problem of fxceless issue 1181) | +| Black blobs on faces and in the air | A NaN that a shader writes is spread by blur and the temporal upscaler | Always: `VICTORY_NAN_SCRUB=1` (new, `emit/lower.rs`): colours and image stores with NaN become 0; NaN in the fog volume is cleared too | + +Known faults left: the common room by its sunlit windows still goes beige and +hazy (sky light in the fog); smearing when the camera moves fast at half scale +(the title's own temporal upscaler); two orange glows on some corridor walls. +Render scale 1.0 on Series S has not been tested. + +Also in, off by default: + +- `VICTORY_CONSTANT_MARKS=1`, a port of fxceless pull request 1216 + (GamingRipperDoc): a slot picked from the heap is read as a constant buffer + only if it holds one (else a texture's descriptor was read as one, in the + meshlet culling passes). +- `VICTORY_TARGET_VARIANTS=1`, a port of fxceless a35c557393: a pipeline is made + again for the render target formats bound at the draw. +- F9 frame capture (`capture.rs`): with `VICTORY_CAPTURE=` and + `VICTORY_DUMP_TARGETS=1`, F9 saves the next frame's picture, its commands and + every 2D target. --- @@ -215,8 +269,10 @@ commits taken from elsewhere name the commit and its author. contributors: the loader, the runtime services, the Direct3D 12 back end and the shader recompiler. - **[fxceless/victory-fork](https://github.com/fxceless/victory-fork)**: the fork - the 7900 XTX one started from, the people whose pull requests it carries, and - pull request 1189 (Tissma95) for the Series S interface plane. + the 7900 XTX one started from, the people whose pull requests it carries, + pull request 1189 (Tissma95) for the Series S interface plane, 927 + (tippythetaidum) for the face network and 1216 (GamingRipperDoc) for the + marked constant buffer slots. - **[DexNom/VIctory](https://github.com/DexNom/VIctory)**: ray tracing fixes, cube gradients, sparse textures. - **[Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD)**: diff --git a/crates/victory-gpu/src/ambient.rs b/crates/victory-gpu/src/ambient.rs index 8a3d46e..326b6ef 100644 --- a/crates/victory-gpu/src/ambient.rs +++ b/crates/victory-gpu/src/ambient.rs @@ -112,6 +112,18 @@ fn air() -> f32 { }) } +/// LOCAL: how many times the estimate the title's own result may keep +/// (`VICTORY_AMBIENT_MOST=`, 4 when unset). Without rays the +/// probes hold the sky's light indoors too; at 4 times the estimate a room +/// looked towards a window or the sky goes very bright. +fn most() -> f32 { + static SET: OnceLock = OnceLock::new(); + *SET.get_or_init(|| { + let set = std::env::var("VICTORY_AMBIENT_MOST").unwrap_or_default(); + set.trim().parse().ok().filter(|v: &f32| v.is_finite() && *v > 0.0).unwrap_or(4.0) + }) +} + /// Strength and radius of the creases' shade. fn shade() -> [f32; 2] { static SET: OnceLock<[f32; 2]> = OnceLock::new(); @@ -243,6 +255,9 @@ void clear_air(uint3 at : SV_DispatchThreadID) { float far = float(at.z) / float(d); float cap = air * lerp(dot(cells[CELLS].rgb, LUMA), dot(seen_there, LUMA), far); float3 c = scattered[at]; + // LOCAL: a NaN or infinity in the air is summed along every view ray + // through it: black or white patches floating in the room. + if (any(isnan(c)) || any(isinf(c))) { scattered[at] = 0; return; } float has = dot(c, LUMA); if (has > cap) scattered[at] = c * (cap / has); } @@ -459,7 +474,7 @@ pub(crate) fn after(list: &HostList, role: Role, views: &Views) -> bool { words[6] = views.size[0]; words[7] = views.size[1]; words[8] = 0.04f32.to_bits(); - words[9] = 4.0f32.to_bits(); + words[9] = most().to_bits(); words[10] = air().to_bits(); let l = &list.list; // SAFETY: an open list with the heap of the views set; the title's diff --git a/crates/victory-gpu/src/capture.rs b/crates/victory-gpu/src/capture.rs index 937f560..9994c3f 100644 --- a/crates/victory-gpu/src/capture.rs +++ b/crates/victory-gpu/src/capture.rs @@ -27,7 +27,8 @@ pub(crate) fn listed(n: u64) -> bool { .filter_map(|f| f.trim().parse().ok()) .collect() }) - .contains(&n); + .contains(&n) + || n == KEY_FRAME.load(std::sync::atomic::Ordering::Relaxed); // `VICTORY_CAPTURE_WORLD`: also the 2nd and the 6th frame after the first // one that ran 500 draws or more (a title's first 3D frames: their // numbers depend on how long the menus were shown), and the 30th and @@ -120,12 +121,33 @@ fn world_on() -> bool { *ON.get_or_init(|| std::env::var_os("VICTORY_CAPTURE_WORLD").is_some()) } +/// LOCAL: the frame F9 asked for ([`frame_drew`]); `u64::MAX`: none. +static KEY_FRAME: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(u64::MAX); + /// The first frame that ran 500 draws or more (`VICTORY_CAPTURE_WORLD`). static WORLD: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(u64::MAX); /// At the present of `frame`: the draws run on the host so far. pub(crate) fn frame_drew(frame: u64, drawn: u64) { use std::sync::atomic::Ordering::Relaxed; + // LOCAL: with a capture folder, F9 captures the next frame as a listed + // one (its picture, its ops and, with VICTORY_DUMP_TARGETS=1, every + // target it drew): to catch a picture fault the moment it shows. + if folder().is_some() { + static WAS_DOWN: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false); + // SAFETY: a plain query of the keyboard's state. + let down = unsafe { + windows_sys::Win32::UI::Input::KeyboardAndMouse::GetAsyncKeyState(i32::from( + windows_sys::Win32::UI::Input::KeyboardAndMouse::VK_F9, + )) + } < 0; + if down && !WAS_DOWN.swap(true, Relaxed) { + KEY_FRAME.store(frame + 1, Relaxed); + tracing::info!(frame = frame + 1, "F9: this frame is captured"); + } else if !down { + WAS_DOWN.store(false, Relaxed); + } + } static LAST: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(0); let before = LAST.swap(drawn, Relaxed); if world_on() diff --git a/crates/victory-gpu/src/descriptor.rs b/crates/victory-gpu/src/descriptor.rs index 9c3cc2e..26d44d8 100644 --- a/crates/victory-gpu/src/descriptor.rs +++ b/crates/victory-gpu/src/descriptor.rs @@ -1588,6 +1588,74 @@ mod tests { ); } + /// A table made afresh for a draw holds the descriptors its shader + /// moves halves through (`HostShader::half_views`), also past the range + /// starts its used-resource entries give: with one entry for a range + /// from dword 0 and a 16-bit float buffer view at dword 8, the table + /// takes two dynamic slots, so the next allocation does not land on the + /// view's. (The case avt0m4t48 found in review on #927.) + #[cfg(windows)] + #[test] + fn a_fresh_table_holds_the_half_views_past_its_range_starts() { + use victory_shader::{ResourceType, RootType, UsedResource}; + let Some(device) = crate::host::host() else { + return; // no host GPU + }; + let list = device.new_list().expect("a host list"); + let desc = HeapDesc { + kind: VIEWS_KIND, + count: 2, + flags: SHADER_VISIBLE, + nodes: 1, + }; + let none = Placement { + address: 0, + size: 0, + }; + let mut h: This = std::ptr::null(); + assert_eq!(create(desc, none, &mut h), S_OK); + let title = heap(h); + let host_heap = title.host().expect("a host view heap"); + let (first, second) = (title.handle(0).unwrap(), title.handle(1).unwrap()); + // An R16G16B16A16_FLOAT buffer view of memory in the second slot. + let memory = [0u64; 64]; + let address = memory.as_ptr() as u64; + let resource = [1, 0, 0, 0, 512, 0, 1, 0x1_0001, 0, 1, 0, 1, 0, 0]; + let mut words = [0u32; 16]; + words[..10].copy_from_slice(&[10, 1, 5768, 0, 0, 0, 64, 0, 0, 0]); + words[10] = address as u32; + words[11] = (address >> 32) as u32; + create_placed_srv(std::ptr::null(), &resource, &words, second); + assert!(view(second).as_ref().and_then(host::half_view).is_some()); + let mut state = crate::draw::State::default(); + state.set_heaps(&[h]); + state.set_table(true, 1, first); + let range = UsedResource { + kind: ResourceType::Srv, + root: RootType::Table, + table_offset_dwords: 0, + lower_bound: 0, + stride: 8, + dwords: 4, + user_data: 4, + slot: 1, + }; + let made = state.tables(&list, &[range], &[], &[(1, 8)], true); + let [(1, offset)] = made[..] else { + panic!("one fresh table for root parameter 1, not {:?}", &made[..]); + }; + assert_ne!(offset, u32::MAX, "the table found no dynamic slots"); + let next = host_heap.dynamic(1).expect("a dynamic slot"); + host_heap.release(next, 1); + drop(state); + slot:: u32>(h, 0x10)(h); + assert_eq!( + next, + offset / 32 + 2, + "the next allocation took the table's second slot" + ); + } + #[test] fn heaps_hold_count_descriptors_from_their_start() { let null = std::ptr::null(); diff --git a/crates/victory-gpu/src/descriptor/host.rs b/crates/victory-gpu/src/descriptor/host.rs index 9fd871b..b6e8f9c 100644 --- a/crates/victory-gpu/src/descriptor/host.rs +++ b/crates/victory-gpu/src/descriptor/host.rs @@ -893,6 +893,14 @@ struct Waiting { checked: (u64, u64, u64, u8, u64), } +/// Whether due texture slots are served in turns, a slot looked at before +/// and one never looked at ([`TextureQueue::due`]; on unless +/// `VICTORY_FAIR_DUE=0`). +fn fair_due() -> bool { + static ON: std::sync::OnceLock = std::sync::OnceLock::new(); + *ON.get_or_init(|| std::env::var_os("VICTORY_FAIR_DUE").is_none_or(|v| v != "0")) +} + /// The queue of title slots whose texture view waits to be brought up to /// date for shaders that pick textures by index: which are due, and in /// which order (no host heap needed, so it is tested without one). @@ -926,14 +934,20 @@ impl TextureQueue { /// Up to `max` slots due at `frame`, each with its write number, in /// the order to serve them: - /// - first the ones looked at before (their memory was not mapped, or - /// only part of it): the look is a query, and memory that has - /// arrived since is what the title streamed in last; - /// - then the others, the newest write first and the oldest next, in - /// turns: slot order served the low slots of a backlog of - /// 25,000-40,000 while the textures of the shot on screen waited - /// (run 52: 98% of the drawn pixels had no colour texture in the - /// first 3D frames). + /// - the ones looked at before (their memory was not mapped, or only + /// part of it), newest write first: the look is a query, and memory + /// that has arrived since is what the title streamed in last; + /// - the others, the newest write first and the oldest next, in turns: + /// slot order served the low slots of a backlog of 25,000-40,000 + /// while the textures of the shot on screen waited (run 52: 98% of + /// the drawn pixels had no colour texture in the first 3D frames); + /// - the two kinds one after the other, a slot looked at before first + /// (`VICTORY_FAIR_DUE=0`: all those looked at before first, as + /// before). With them all first, a backlog of thousands of slots + /// streaming in a part at a time filled every pass in the opening + /// cutscene, which the pass's time then cut, and slots never looked + /// at waited 300 to 1,500 frames: faces whose textures are picked by + /// index read an empty slot (black) or an older view (red, noise). fn due(&self, frame: u64, max: usize) -> Vec<(u32, u64)> { let mut again: Vec<(u64, u32, u64)> = Vec::new(); let mut fresh: Vec<(u64, u32, u64)> = Vec::new(); @@ -945,16 +959,33 @@ impl TextureQueue { let newest_first = |a: &(u64, u32, u64), b: &(u64, u32, u64)| b.2.cmp(&a.2); again.sort_unstable_by(newest_first); fresh.sort_unstable_by(newest_first); - let mut order: Vec<(u32, u64)> = again.iter().map(|&(_, index, write)| (index, write)).collect(); + let mut fresh_order: Vec<(u32, u64)> = Vec::with_capacity(fresh.len().min(max)); let (mut new, mut old) = (0, fresh.len()); - while new < old && order.len() < max { - order.push((fresh[new].1, fresh[new].2)); + while new < old && fresh_order.len() < max { + fresh_order.push((fresh[new].1, fresh[new].2)); new += 1; - if new < old && order.len() < max { + if new < old && fresh_order.len() < max { old -= 1; - order.push((fresh[old].1, fresh[old].2)); + fresh_order.push((fresh[old].1, fresh[old].2)); } } + let mut again_order = again.iter().map(|&(_, index, write)| (index, write)); + if !fair_due() { + let mut order: Vec<(u32, u64)> = again_order.collect(); + order.extend(fresh_order); + order.truncate(max); + return order; + } + let mut fresh_order = fresh_order.into_iter(); + let mut order = Vec::with_capacity(max.min(fresh.len() + again.len())); + while order.len() < max { + let (a, b) = (again_order.next(), fresh_order.next()); + if a.is_none() && b.is_none() { + break; + } + order.extend(a); + order.extend(b); + } order.truncate(max); order } @@ -2520,9 +2551,18 @@ impl HostHeap { if let Some((_, _, data)) = &self.strides && index < victory_shader::emit::SLOT_STRIDES_COUNT { + // LOCAL (port of fxceless #1216): constant buffer views marked; + // programs read no other non-buffer slot as one. + let entry = match (stride, view) { + (Some(s), _) => s | kind, + (None, Some(View::Constant(..))) if victory_shader::emit::constant_marks() => { + victory_shader::emit::SLOT_STRIDE_CONSTANT + } + _ => kind, + }; // SAFETY: inside the mapping; shaders read it while we write (a // dword, either value is one the slot had). - unsafe { (*data as *mut u32).add(index as usize).write_volatile(stride.unwrap_or(0) | kind) }; + unsafe { (*data as *mut u32).add(index as usize).write_volatile(entry) }; } let was = if stride.is_some() { self.buffers.put(index); @@ -3259,6 +3299,76 @@ fn srv_desc(words: &[u32; 10]) -> D3D12_SHADER_RESOURCE_VIEW_DESC { } } +/// The unsigned integer format with the layout of a 16-bit float or +/// signed integer format (one, two or four channels), if `format` is one. +pub(crate) fn half_format(format: u32) -> Option { + match format { + // R16G16B16A16_FLOAT and _SINT: R16G16B16A16_UINT. + 10 | 14 => Some(12), + // R16G16_FLOAT and _SINT: R16G16_UINT. + 34 | 38 => Some(36), + // R16_FLOAT and _SINT: R16_UINT. + 54 | 59 => Some(57), + _ => None, + } +} + +/// `view` as a shader is shown it where it moves a buffer's 16-bit +/// channels as unsigned integers +/// (`victory_shader::emit::HostShader::half_views`): a buffer view in a +/// 16-bit float or signed format, in the unsigned format of the same +/// layout, through which every 16-bit pattern is read and stored as it +/// is. `None` for every other view: the title's own serves (an unsigned +/// one already carries the bits; a texture can only be viewed in the +/// formats it was made for). +pub(crate) fn half_view(view: &View) -> Option { + // Buffer views: dimension 1 in the title's description of either kind. + const BUFFER: u32 = 1; + match view { + View::Shader(resource, Some(desc)) if desc[1] == BUFFER => { + let mut desc = *desc; + desc[0] = half_format(desc[0])?; + Some(View::Shader(*resource, Some(desc))) + } + View::Unordered(resource, counter, Some(desc)) if desc[1] == BUFFER => { + let mut desc = *desc; + desc[0] = half_format(desc[0])?; + Some(View::Unordered(*resource, *counter, Some(desc))) + } + View::Placed(unordered, resource, desc) if resource[0] == BUFFER && desc[1] == BUFFER => { + let mut desc = *desc; + desc[0] = half_format(desc[0])?; + Some(View::Placed(*unordered, *resource, desc)) + } + _ => None, + } +} + +/// The format of `view`, a buffer view through which a shader moves +/// 16-bit channels as unsigned integers +/// (`victory_shader::emit::HostShader::half_views`), if those integers +/// are not what the console gives: a format of wider channels, a +/// normalised one or a signed 8-bit one, whose values the console converts +/// to and from halves. `None` for the formats the integers serve exactly +/// (16 bits a channel of any kind, through [`half_view`] where needed, and +/// unsigned channels of fewer bits; the title's are 16-bit unsigned) and +/// for any other view. +pub(crate) fn half_inexact(view: &View) -> Option { + // Buffer views: dimension 1 in the title's description of either kind. + const BUFFER: u32 = 1; + // R16G16B16A16, R16G16 and R16 (float, unsigned, signed), then + // R10G10B10A2, R8G8B8A8, R8G8 and R8 unsigned. + const EXACT: [u32; 13] = [10, 12, 14, 34, 36, 38, 54, 57, 59, 25, 30, 50, 62]; + let format = match view { + View::Shader(_, Some(desc)) | View::Unordered(_, _, Some(desc)) if desc[1] == BUFFER => { + desc[0] + } + View::Placed(_, resource, desc) if resource[0] == BUFFER && desc[1] == BUFFER => desc[0], + _ => return None, + }; + (!EXACT.contains(&format)).then_some(format) +} + fn uav_desc(words: &[u32; 10]) -> D3D12_UNORDERED_ACCESS_VIEW_DESC { let mut words = *words; words[0] = crate::resource::pc_format(words[0]); @@ -4688,6 +4798,243 @@ mod tests { super::read_all(start); } + /// The unsigned twin of a 16-bit float or signed format has its layout, + /// and only buffer views in such a format are shown as another view. + #[test] + fn only_16_bit_float_and_signed_buffer_views_get_an_unsigned_twin() { + for (format, unsigned) in [(10, 12), (14, 12), (34, 36), (38, 36), (54, 57), (59, 57)] { + assert_eq!(half_format(format), Some(unsigned)); + assert_eq!( + crate::resource::element(format), + crate::resource::element(unsigned), + "format {format}" + ); + } + // The unsigned formats themselves, normalised 16-bit formats, and + // wider and narrower ones. + for other in [0, 12, 36, 57, 11, 13, 35, 37, 56, 58, 42, 17, 30, 61] { + assert_eq!(half_format(other), None, "format {other}"); + } + const BUFFER: u32 = 1; + let words = |format: u32, dimension: u32| [format, dimension, 5768, 0, 0, 0, 64, 0, 0, 0]; + // R16G16B16A16_FLOAT: a buffer of halves a program moves as they are. + assert_eq!( + half_view(&View::Unordered(7, 0, Some(words(10, BUFFER)))), + Some(View::Unordered(7, 0, Some(words(12, BUFFER)))) + ); + assert_eq!( + half_view(&View::Shader(7, Some(words(54, BUFFER)))), + Some(View::Shader(7, Some(words(57, BUFFER)))) + ); + let mut placed = [0u32; 16]; + placed[..10].copy_from_slice(&words(38, BUFFER)); + placed[10] = 0x1234_0000; + let mut twin = placed; + twin[0] = 36; + let memory = [BUFFER, 0, 0, 0, 512, 0, 1, 0x1_0001, 0, 1, 0, 1, 0, 0]; + assert_eq!( + half_view(&View::Placed(true, memory, placed)), + Some(View::Placed(true, memory, twin)) + ); + // The title's kind (R16G16B16A16_UINT and R16_UINT buffers), a + // texture view (dimension 4: 2D), a view without a description, a + // constant buffer: the title's own. + assert_eq!( + half_view(&View::Unordered(7, 0, Some(words(12, BUFFER)))), + None + ); + assert_eq!(half_view(&View::Shader(7, Some(words(57, BUFFER)))), None); + assert_eq!(half_view(&View::Unordered(7, 0, Some(words(10, 4)))), None); + assert_eq!(half_view(&View::Shader(7, None)), None); + assert_eq!(half_view(&View::Constant(0x1000, 256)), None); + } + + /// The buffer views through which the integers a shader moves halves + /// as are not what the console gives are named; the title's are not. + #[test] + fn views_whose_values_the_console_would_convert_are_named() { + const BUFFER: u32 = 1; + let words = |format: u32, dimension: u32| [format, dimension, 5768, 0, 0, 0, 64, 0, 0, 0]; + for exact in [10, 12, 14, 34, 36, 38, 54, 57, 59, 25, 30, 50, 62] { + let view = View::Unordered(7, 0, Some(words(exact, BUFFER))); + assert_eq!(half_inexact(&view), None, "format {exact}"); + } + // R32_FLOAT, R32_UINT, R16G16B16A16_UNORM, R8G8B8A8_UNORM, R8_SINT, + // and a structured or raw view (no format). + for inexact in [41, 42, 11, 28, 64, 0] { + let view = View::Shader(7, Some(words(inexact, BUFFER))); + assert_eq!(half_inexact(&view), Some(inexact)); + } + let mut placed = [0u32; 16]; + placed[..10].copy_from_slice(&words(41, BUFFER)); + let memory = [BUFFER, 0, 0, 0, 512, 0, 1, 0x1_0001, 0, 1, 0, 1, 0, 0]; + assert_eq!(half_inexact(&View::Placed(true, memory, placed)), Some(41)); + // Not a buffer view. + assert_eq!(half_inexact(&View::Shader(7, Some(words(41, 4)))), None); + assert_eq!(half_inexact(&View::Constant(0x1000, 256)), None); + } + + /// The two ways a translated `buffer_load_format_d16_xyzw` and + /// `buffer_store_format_d16_xyzw` have moved a typed buffer's 16-bit + /// channels, on the host device, over a buffer that holds every 16-bit + /// pattern. As unsigned integers through an unsigned view (the title's + /// own R16G16B16A16_UINT, or the twin `half_view` gives a float one) + /// every pattern comes back as it was. By way of floats, as before + /// (load as floats, each to its half's bits; each half widened and + /// stored as a float): through the title's integer view that is + /// outside what D3D12 defines, and what the device gives is printed, + /// not checked (1 pattern of 65,536 on the cards tried: the network + /// that moves the title's faces computed zeros). + #[test] + fn halves_cross_an_unsigned_buffer_view_unchanged() { + const MOVES: &str = r#" +#define RS "DescriptorTable(UAV(u0, numDescriptors=2))" +#ifdef BY_FLOATS +RWBuffer from : register(u0); +RWBuffer to : register(u1); +#else +RWBuffer from : register(u0); +RWBuffer to : register(u1); +#endif +[RootSignature(RS)] +[numthreads(64, 1, 1)] +void BY_FLOATS_OR_NOT(uint3 id : SV_DispatchThreadID) { +#ifdef BY_FLOATS + uint4 h = f32tof16(from[id.x]); +#else + uint4 h = from[id.x] & 0xffff; +#endif + uint low = h.x | h.y << 16; + uint high = h.z | h.w << 16; +#ifdef BY_FLOATS + to[id.x] = float4(f16tof32(low), f16tof32(low >> 16), f16tof32(high), f16tof32(high >> 16)); +#else + to[id.x] = uint4(low & 0xffff, low >> 16, high & 0xffff, high >> 16); +#endif +} +"#; + const ELEMENTS: usize = 1 << 14; + const BYTES: u64 = ELEMENTS as u64 * 8; + const TITLES: u32 = 12; // R16G16B16A16_UINT + let Some(host) = host() else { + return; // no host GPU + }; + let heap: ID3D12DescriptorHeap = { + let desc = D3D12_DESCRIPTOR_HEAP_DESC { + Type: D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, + NumDescriptors: 2, + Flags: D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE, + NodeMask: 0, + }; + // SAFETY: plain heap creation. + unsafe { host.device.CreateDescriptorHeap(&desc) }.expect("a view heap") + }; + // How many of the 65,536 patterns come back as they were, moved by + // the program `by_floats` or not, through views in `format`. + let moved = |by_floats: bool, format: u32| -> usize { + let source = if by_floats { + MOVES + .replace("BY_FLOATS_OR_NOT", "main") + .replace("#ifdef BY_FLOATS", "#if 1") + } else { + MOVES + .replace("BY_FLOATS_OR_NOT", "main") + .replace("#ifdef BY_FLOATS", "#if 0") + }; + let code = crate::host::compile( + &source, + windows::core::s!("main"), + windows::core::s!("cs_5_1"), + ) + .expect("the test's shader"); + let (from, filled) = host.shared_buffer(BYTES).expect("a buffer"); + let (to, result) = host.shared_buffer(BYTES).expect("a buffer"); + // SAFETY: the shader's own root signature and plain creation + // calls; both mappings hold `BYTES` bytes; the views are of + // live buffers, in slots of the heap made above; an open list. + unsafe { + let root: ID3D12RootSignature = host + .device + .CreateRootSignature(0, &code) + .expect("a root signature"); + let pso: ID3D12PipelineState = host + .device + .CreateComputePipelineState(&D3D12_COMPUTE_PIPELINE_STATE_DESC { + pRootSignature: std::mem::transmute_copy(&root), + CS: D3D12_SHADER_BYTECODE { + pShaderBytecode: code.as_ptr().cast(), + BytecodeLength: code.len(), + }, + ..Default::default() + }) + .expect("a pipeline"); + let filled = std::slice::from_raw_parts_mut(filled.cast::(), ELEMENTS * 4); + for (pattern, half) in filled.iter_mut().enumerate() { + *half = pattern as u16; + } + std::ptr::write_bytes(result, 0xee, BYTES as usize); + let view = D3D12_UNORDERED_ACCESS_VIEW_DESC { + Format: DXGI_FORMAT(format as i32), + ViewDimension: D3D12_UAV_DIMENSION_BUFFER, + Anonymous: D3D12_UNORDERED_ACCESS_VIEW_DESC_0 { + Buffer: D3D12_BUFFER_UAV { + NumElements: ELEMENTS as u32, + ..Default::default() + }, + }, + }; + let start = heap.GetCPUDescriptorHandleForHeapStart(); + let step = host + .device + .GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV) + as usize; + host.device.CreateUnorderedAccessView( + &from, + None::<&ID3D12Resource>, + Some(&view), + start, + ); + let second = D3D12_CPU_DESCRIPTOR_HANDLE { + ptr: start.ptr + step, + }; + host.device.CreateUnorderedAccessView( + &to, + None::<&ID3D12Resource>, + Some(&view), + second, + ); + let list = host.new_list().expect("a host list"); + list.list.SetDescriptorHeaps(&[Some(heap.clone())]); + list.list.SetComputeRootSignature(&root); + list.list.SetPipelineState(&pso); + list.list + .SetComputeRootDescriptorTable(0, heap.GetGPUDescriptorHandleForHeapStart()); + list.list.Dispatch(ELEMENTS as u32 / 64, 1, 1); + list.close(); + host.execute(&[&list]); + assert!( + host.device.GetDeviceRemovedReason().is_ok(), + "the device, after views in format {format}" + ); + let result = std::slice::from_raw_parts(result.cast::(), ELEMENTS * 4); + (0..=u16::MAX) + .filter(|&p| result[usize::from(p)] == p) + .count() + } + }; + // A float view of halves is shown as the title's kind of view. + assert_eq!(half_format(10), Some(TITLES)); + let unsigned = moved(false, TITLES); + let by_floats = moved(true, TITLES); + eprintln!( + "halves through an R16G16B16A16_UINT buffer view: {unsigned} of 65536 patterns came back unchanged moved as unsigned integers, {by_floats} moved by way of floats" + ); + assert_eq!( + unsigned, 65_536, + "patterns unchanged, moved as unsigned integers" + ); + } + /// A null texture UAV keeps the title's dimension (3D for the world's /// wind field), and is 2D when the title names none. #[test] @@ -5101,6 +5448,31 @@ mod tests { assert!(q.due(16, 100).iter().any(|d| d.0 == 98)); } + /// Slots looked at before and slots never looked at are served in + /// turns, one looked at before first: a pass that can take only some + /// of a backlog of slots streaming in a part at a time still reaches + /// the slots never looked at. + #[test] + fn the_texture_queue_serves_looked_at_and_fresh_slots_in_turns() { + let mut q = TextureQueue::default(); + // Slots 100..110 looked at before (their memory not there yet). + for i in 0..10u32 { + q.written(100 + i, 1, 0, false); + } + for i in 0..10u32 { + let w = q.due(u64::MAX, 100).iter().find(|d| d.0 == 100 + i).unwrap().1; + q.later(100 + i, w, 1, 1); + } + // Slots 1..4 never looked at. + for i in 1..4u32 { + q.written(i, 2, 0, false); + } + let order: Vec = q.due(10, 6).into_iter().map(|d| d.0).collect(); + assert_eq!(order.len(), 6); + assert!(order[0] >= 100, "a slot looked at before comes first: {order:?}"); + assert_eq!(order.iter().filter(|&&i| i < 100).count(), 3, "every fresh slot is reached: {order:?}"); + } + /// Slots held back for lack of room on the card are not handed out /// until their frame, keep their place, are not counted as waiting /// for their memory, and all come back at once when the card has room; diff --git a/crates/victory-gpu/src/draw.rs b/crates/victory-gpu/src/draw.rs index f04fe53..19e3cc9 100644 --- a/crates/victory-gpu/src/draw.rs +++ b/crates/victory-gpu/src/draw.rs @@ -306,6 +306,10 @@ pub(crate) struct State { target_handles: Vec, depth_handle: u64, targets_set: bool, + /// LOCAL (fxceless a35c557393): the formats of the views + /// [`State::set_targets`] bound (eight targets, then depth), for the + /// draws' pipelines (`crate::pipeline::host_pipeline_for`). + target_formats: crate::pipeline::host::TargetFormats, /// The render target views and the depth view the host list has, once /// it has any ([`State::set_targets`]): per view the host texture (0: /// a null view) and what its descriptor says. @@ -1060,6 +1064,16 @@ impl State { crate::capture::note_target(record.resource); Some((texture, record)) }); + // The formats of the host views, for the draws' pipelines (before + // the bind cache below, which can return early). + let mut formats = [0u32; 9]; + for (i, (texture, desc)) in views.iter().take(8).enumerate() { + formats[i] = bound_format(*texture, desc.as_ref().map(|d| d.Format)); + } + if let Some((texture, record)) = dsv.as_ref() { + formats[8] = bound_format(Some(*texture), record.depth_desc().as_ref().map(|d| d.Format)); + } + self.target_formats = formats; let now = (keys, dsv.as_ref().map(|(texture, record)| (texture.as_raw() as usize, record.key()))); static CACHE: std::sync::OnceLock = std::sync::OnceLock::new(); if *CACHE.get_or_init(|| std::env::var("VICTORY_BIND_CACHE").map_or(true, |v| v != "0")) @@ -1336,7 +1350,7 @@ impl State { if crate::pipeline::is_skipped(self.pipeline as This) { return false; } - let Some(p) = crate::pipeline::host_pipeline(self.pipeline as This) else { + let Some(p) = crate::pipeline::host_pipeline_for(self.pipeline as This, &self.target_formats) else { return false; }; if p.compute || p.mesh != mesh { @@ -1493,7 +1507,13 @@ impl State { if t.stores && crate::picked::on() && crate::picked::picks(&stage.shader, &t.picks) { crate::picked::runs_in(list); } - let made = self.tables(list, &t.used, &t.host.root_indexed_views, compute); + let made = self.tables( + list, + &t.used, + &t.host.root_indexed_views, + &t.host.half_views, + compute, + ); STORES.set(true); if made.iter().any(|m| m.1 == u32::MAX) { once!("a draw whose descriptor table found no free slots is dropped"); @@ -2198,7 +2218,18 @@ impl State { static PASSED: AtomicU64 = AtomicU64::new(0); let now = crate::host::now_ms(); let took = now.saturating_sub(PASSED.swap(now, Ordering::Relaxed)).max(1); - let most = (4000 / took).clamp(16, 256); + // `VICTORY_RELOOK_MS` (20,000 unless said; 4,000 before): at 4,000 the + // opening cutscene's 4 frames a second looked at its ~20,000 slots + // waiting for their memory every 16 frames, thousands of queries + // a second and most of the pass's time, while slots never looked + // at waited. The runtime's mappings already make a slot due + // (`texture_slots_remapped`); these looks are only for what that + // does not tell. + static RELOOK_MS: std::sync::OnceLock = std::sync::OnceLock::new(); + let relook = *RELOOK_MS.get_or_init(|| { + std::env::var("VICTORY_RELOOK_MS").ok().and_then(|v| v.trim().parse().ok()).unwrap_or(20_000) + }); + let most = (relook / took).clamp(16, 1024); // What a table entry of a texture a shader samples says. let sampled = UsedResource { kind: ResourceType::Srv, @@ -3145,11 +3176,19 @@ impl State { /// once: its constant data is copied at submission either way, and the /// big tables the world binds would otherwise take hundreds of slots per /// draw, wrapping the dynamic slots onto lists not yet submitted. + /// + /// `half`: the table descriptors the shader moves sixteen bits a + /// channel as unsigned integers (`HostShader::half_views`). A table + /// with a 16-bit float or signed buffer view at one of them is made + /// afresh as well, with that view in the unsigned format of the same + /// layout (`descriptor::host::half_view`): the title's own slot keeps + /// the title's format for the shaders that read it as floats. pub(crate) fn tables( &mut self, list: &HostList, used: &[UsedResource], indexed: &[RootIndexedView], + half: &[(u8, u32)], compute: bool, ) -> Few<(u8, u32), 16> { let tables = |u: &&UsedResource| u.root == RootType::Table; @@ -3159,6 +3198,36 @@ impl State { fresh.push(u.slot); } } + // The view shown in place of the title's at dword `at` of the table + // in root parameter `slot`, if the shader moves halves there and + // the title's view is a 16-bit float or signed buffer view. + let halved = |state: &Self, slot: u8, at: u32| -> Option { + if !half.contains(&(slot, at)) { + return None; + } + let Some(&Root::Table(table)) = state.roots_ref(compute).get(usize::from(slot)) else { + return None; + }; + crate::descriptor::host::half_view(&crate::descriptor::view(table + u64::from(at) * 4)?) + }; + for &(slot, at) in half { + let Some(&Root::Table(table)) = self.roots_ref(compute).get(usize::from(slot)) else { + continue; + }; + let Some(view) = crate::descriptor::view(table + u64::from(at) * 4) else { + continue; + }; + if crate::descriptor::host::half_view(&view).is_some() { + if !fresh.contains(&slot) { + fresh.push(slot); + } + } else if let Some(format) = crate::descriptor::host::half_inexact(&view) { + once!( + format, + "a shader moves a buffer's 16-bit channels as integers through a view whose values the console converts: they are read and written unconverted" + ); + } + } // Tables reaching past a host heap smaller than the title's (the // host's limit, 1,000,000 views on NVIDIA) are made afresh too: the // title's slots there have no host slot of their own. @@ -3220,6 +3289,15 @@ impl State { index.byte_offset.wrapping_add(constant << index.shift) / 32 }) .collect(); + // The descriptors the shader moves halves through are made too, + // and the table reaches them: they may lie past the range starts + // the entries give (a range of several views names only its + // first; review on #927). + selected.extend( + half.iter() + .filter(|&&(s, _)| s == slot) + .map(|&(_, at)| at / 8), + ); selected.sort_unstable(); selected.dedup(); let n = entries() @@ -3242,6 +3320,11 @@ impl State { let at = table + u64::from(k) * 32; // SAFETY: a descriptor slot in title memory. h.add(unsafe { (at as *const [u32; 3]).read_unaligned() }); + // (Another table than the same slots made for a shader + // that reads them in the title's formats.) + if half.contains(&(slot, k * 8)) { + h.add([u32::MAX, slot.into(), k]); + } } (table, n, h.0) }; @@ -3382,7 +3465,10 @@ impl State { host.constant_at(index, &buffer, gpu, size); } Some(view) => { - host.make_at(index, &view); + match halved(self, slot, k * 8) { + Some(shown) => host.make_at(index, &shown), + None => host.make_at(index, &view), + } let kind = used.map(|u| u.kind).or_else(|| { selected.binary_search(&k).ok().and_then(|_| view_kind(&view)) }); @@ -4014,6 +4100,18 @@ pub(crate) fn view_kind(view: &View) -> Option { } } +/// LOCAL (fxceless a35c557393): the format of a host view of `texture` +/// whose description names `described`: that one, else the texture's own +/// (what the host gives a view without a format); 0 if neither is known. +fn bound_format(texture: Option<&ID3D12Resource>, described: Option) -> u32 { + match (described, texture) { + (Some(format), _) if format.0 != 0 => format.0 as u32, + // SAFETY: a live texture. + (_, Some(texture)) => unsafe { texture.GetDesc() }.Format.0 as u32, + _ => 0, + } +} + /// The host state a depth view needs of its texture: the read state if the /// view writes no plane the format has (the title's read-only flags), else /// the write state. @@ -4044,7 +4142,7 @@ fn depth_state(texture: &ID3D12Resource, desc: Option<&D3D12_DEPTH_STENCIL_VIEW_ /// A few things, up to `N` of them without memory of the heap: what a draw's /// tables are gone through with, some six lists a stage. -struct Few { +pub(crate) struct Few { few: [T; N], len: usize, /// All of them, if they are more. diff --git a/crates/victory-gpu/src/pipeline.rs b/crates/victory-gpu/src/pipeline.rs index e8a9f29..bd5c8bc 100644 --- a/crates/victory-gpu/src/pipeline.rs +++ b/crates/victory-gpu/src/pipeline.rs @@ -456,6 +456,21 @@ pub(crate) fn host_pipeline<'a>(this: This) -> Option<&'a host::HostPipeline> { make::ready(&pipeline(this).host) } +/// LOCAL (fxceless a35c557393): as [`host_pipeline`], for a draw into views +/// of the formats `bound`: if one has another format than the pipeline +/// declares for its slot, the host pipeline made for the bound formats. +#[cfg(windows)] +pub(crate) fn host_pipeline_for<'a>(this: This, bound: &host::TargetFormats) -> Option<&'a host::HostPipeline> { + if this.is_null() { + return None; + } + let p = &pipeline(this).host; + if p.formats != *bound && host::formats_differ(&p.formats, bound) { + return make::for_formats(p, bound); + } + make::ready(p) +} + /// Host pipelines queued and not made yet. #[cfg(windows)] pub(crate) fn making() -> u64 { diff --git a/crates/victory-gpu/src/pipeline/host.rs b/crates/victory-gpu/src/pipeline/host.rs index f1de86c..0c8c21c 100644 --- a/crates/victory-gpu/src/pipeline/host.rs +++ b/crates/victory-gpu/src/pipeline/host.rs @@ -150,6 +150,84 @@ fn host_blend(blend: &D3D12_BLEND_DESC, targets: &D3D12_RT_FORMAT_ARRAY) -> D3D1 host } +/// LOCAL (fxceless a35c557393, `VICTORY_TARGET_VARIANTS`): the formats of +/// what a draw draws into, as the host has them: the eight render targets +/// (0 where there is none), then depth (0 for none). +pub(crate) type TargetFormats = [u32; 9]; + +/// Whether a draw into views of the formats `bound` cannot go to the host +/// with a pipeline that declares `declared`: a render target slot for which +/// the pipeline declares a format has a view of another format bound. On +/// the console the view's format rules (fxceless run 289: a full-screen +/// zoom and blur declaring R10G10B10A2_UNORM drawn into R11G11B10_FLOAT); +/// on the host that draw is an invalid call, undefined without the debug +/// layer. Empty slots, views in undeclared slots and depth do not count. +pub(crate) fn formats_differ(declared: &TargetFormats, bound: &TargetFormats) -> bool { + declared[..8].iter().zip(&bound[..8]).any(|(&d, &b)| d != 0 && b != 0 && b != d) +} + +/// The formats a pipeline for a draw into `bound` declares: the title's, +/// but the declared render target slots with a view bound take its format. +pub(crate) fn formats_for(declared: &TargetFormats, bound: &TargetFormats) -> TargetFormats { + let mut formats = *declared; + for i in 0..8 { + if declared[i] != 0 && bound[i] != 0 { + formats[i] = bound[i]; + } + } + formats +} + +impl GraphicsState { + /// The formats the state declares ([`TargetFormats`]). + pub(crate) fn formats(&self) -> TargetFormats { + let mut formats = [0; 9]; + let n = (self.targets.NumRenderTargets as usize).min(8); + for (to, from) in formats.iter_mut().zip(&self.targets.RTFormats[..n]) { + *to = from.0 as u32; + } + formats[8] = self.depth_format.0 as u32; + formats + } + + /// The same state for a draw into views of the formats `bound` (from + /// [`formats_for`]): those render target formats, everything else the + /// title's (blending on integer targets goes off when the host pipeline + /// is made, [`host_blend`]). Its description differs, so it has a name + /// of its own in the library. + pub(crate) fn with_formats(&self, bound: &TargetFormats) -> GraphicsState { + let names = self.names.clone(); + let inputs: Vec = self + .inputs + .iter() + .zip(&names) + .map(|(e, name)| D3D12_INPUT_ELEMENT_DESC { + SemanticName: windows::core::PCSTR(name.as_ptr().cast()), + ..*e + }) + .collect(); + let mut targets = self.targets; + let n = (targets.NumRenderTargets as usize).min(8); + for (to, &from) in targets.RTFormats[..n].iter_mut().zip(bound) { + *to = DXGI_FORMAT(from as i32); + } + GraphicsState { + blend: self.blend, + sample_mask: self.sample_mask, + rasterizer: self.rasterizer, + depth: self.depth, + depth_bounds: self.depth_bounds, + inputs, + names, + strip_cut: self.strip_cut, + topology: self.topology, + targets, + depth_format: self.depth_format, + samples: self.samples, + } + } +} + impl GraphicsState { /// Whether the draws are a pass over the screen: no vertex input, no /// depth or stencil, a target. Such passes fill tables once; their shaders diff --git a/crates/victory-gpu/src/pipeline/make.rs b/crates/victory-gpu/src/pipeline/make.rs index 5ade89f..a22e80c 100644 --- a/crates/victory-gpu/src/pipeline/make.rs +++ b/crates/victory-gpu/src/pipeline/make.rs @@ -27,7 +27,7 @@ use std::sync::{Arc, Condvar, Mutex, OnceLock}; use std::time::{Duration, Instant}; use super::Shader; -use super::host::{GraphicsState, HostPipeline}; +use super::host::{GraphicsState, HostPipeline, TargetFormats}; /// What a host pipeline is made from, and the host pipeline once made. pub(crate) struct Pending { @@ -43,6 +43,14 @@ pub(crate) struct Pending { used: AtomicBool, /// A pass over the screen ([`GraphicsState::screen_pass`]). screen: bool, + /// LOCAL: how long draws have waited for it so far, in microseconds + /// ([`wait_once`]). + waited_us: AtomicU64, + /// LOCAL (fxceless a35c557393): the formats its state declares (zeros + /// without a graphics state), and the same shaders and state for other + /// formats bound at a draw ([`for_formats`]): a chain, one link per set. + pub(crate) formats: TargetFormats, + variant: OnceLock>, } // SAFETY: D3D12 objects are free-threaded; the graphics state (whose input @@ -60,6 +68,8 @@ impl Pending { } key.update(graphics.as_ref().map(|g| g.describe()).unwrap_or_default().as_bytes()); Pending { + formats: graphics.as_ref().map_or([0; 9], |g| g.formats()), + variant: OnceLock::new(), screen: graphics.as_ref().is_some_and(|g| g.screen_pass()), shaders, graphics, @@ -68,6 +78,7 @@ impl Pending { made: OnceLock::new(), key: key.finalize().to_hex()[..32].to_owned(), used: AtomicBool::new(false), + waited_us: AtomicU64::new(0), } } @@ -156,6 +167,52 @@ pub(crate) fn waiting() -> u64 { WAITING.load(Ordering::Relaxed) } +/// Pipelines made again for the formats bound at a draw, since the start. +static VARIANTS: AtomicU64 = AtomicU64::new(0); + +/// Whether a draw into views of other formats than its pipeline declares +/// gets a host pipeline for those formats ([`for_formats`]); on unless +/// `VICTORY_TARGET_VARIANTS=0`. +fn variants_on() -> bool { + static ON: OnceLock = OnceLock::new(); + *ON.get_or_init(|| std::env::var_os("VICTORY_TARGET_VARIANTS").is_none_or(|v| v != "0")) +} + +/// The host pipeline for a draw with `p` into views of the formats `bound` +/// that `p` does not declare: that of the same shaders and state for those +/// formats, queued and waited for like the title's own. +#[cold] +pub(crate) fn for_formats<'a>(p: &'a Arc, bound: &TargetFormats) -> Option<&'a HostPipeline> { + match p.graphics.as_deref() { + Some(g) if variants_on() => ready(variant(p, g, &super::host::formats_for(&p.formats, bound))), + _ => ready(p), + } +} + +/// The pipeline of `p`'s shaders and state `g` for the formats `bound`: +/// found in the chain from `p`, or added to it (logged once per set). +fn variant<'a>(p: &'a Arc, g: &GraphicsState, bound: &TargetFormats) -> &'a Arc { + let mut at = p; + for _ in 0..64 { + let next = at.variant.get_or_init(|| { + let so_far = VARIANTS.fetch_add(1, Ordering::Relaxed) + 1; + tracing::info!( + pipeline = %hashes(p), + declared = ?p.formats, + bound = ?bound, + so_far, + "a pipeline is made again for the render target formats bound at its draw (VICTORY_TARGET_VARIANTS=0: the draw goes out with the title's pipeline)" + ); + Arc::new(Pending::new(p.shaders.clone(), Some(Box::new(g.with_formats(bound))))) + }); + if next.formats == *bound { + return next; + } + at = next; + } + p +} + /// The host pipeline if it is made (or is made within the frame's budget); /// queues it on first use. pub(crate) fn ready(p: &Arc) -> Option<&HostPipeline> { @@ -200,6 +257,21 @@ fn shared_budget() -> bool { *ON.get_or_init(|| std::env::var_os("VICTORY_PIPELINE_WAIT_SHARED").is_none_or(|v| v != "0")) } +/// LOCAL (the problem of fxceless issue #1181): whether one pipeline is +/// waited for at most one budget over the whole run, not one budget every +/// frame. A pipeline whose make takes longer than the budget (a driver +/// compile of tens of seconds, or one that never ends) otherwise cost the +/// whole budget in every frame in which a draw asked for it: with +/// `VICTORY_PIPELINE_WAIT_MS=10000` the picture stood still while the thing +/// drawn with it was in view, and moved again when the camera turned away. +/// After its budget its draws are dropped until it is made, as with any +/// pipeline past the frame's budget. On by default; +/// `VICTORY_PIPELINE_WAIT_ONCE=0` waits as before. +fn wait_once() -> bool { + static ON: OnceLock = OnceLock::new(); + *ON.get_or_init(|| std::env::var_os("VICTORY_PIPELINE_WAIT_ONCE").is_none_or(|v| v != "0")) +} + /// Waits for `p` while frame `frame` has budget left. fn wait(p: &Pending, frame: u64) { let screen = p.screen && screens_first(); @@ -207,6 +279,16 @@ fn wait(p: &Pending, frame: u64) { if budget.is_zero() { return; } + // LOCAL: what is left of this pipeline's own budget ([`wait_once`]). + let own = if wait_once() { + let own = budget.saturating_sub(Duration::from_micros(p.waited_us.load(Ordering::Relaxed))); + if own.is_zero() { + return; + } + own + } else { + Duration::MAX + }; // The frame the budget belongs to, and what was waited of it (or is // taken by a thread waiting now); of the passes over the screen too. static SPENT: [Mutex<(u64, Duration)>; 2] = [const { Mutex::new((u64::MAX, Duration::ZERO)) }; 2]; @@ -217,7 +299,7 @@ fn wait(p: &Pending, frame: u64) { if spent.0 != frame { *spent = (frame, Duration::ZERO); } - let left = budget.saturating_sub(spent.1); + let left = budget.saturating_sub(spent.1).min(own); if shared { spent.1 += left; } @@ -238,6 +320,16 @@ fn wait(p: &Pending, frame: u64) { } drop(held); let waited = started.elapsed().min(left); + if wait_once() && p.made.get().is_none() { + let before = p.waited_us.fetch_add(waited.as_micros() as u64, Ordering::Relaxed); + if Duration::from_micros(before) + waited >= budget { + tracing::info!( + shaders = ?p.shaders, + ms = budget.as_millis() as u64, + "a pipeline not made within its wait: its draws are dropped until it is (VICTORY_PIPELINE_WAIT_ONCE=0: waited for every frame)" + ); + } + } if screen && waited > Duration::from_millis(500) { tracing::info!( ms = waited.as_millis() as u64, diff --git a/crates/victory-gpu/src/shader_cache.rs b/crates/victory-gpu/src/shader_cache.rs index f5e6482..c395e19 100644 --- a/crates/victory-gpu/src/shader_cache.rs +++ b/crates/victory-gpu/src/shader_cache.rs @@ -64,6 +64,10 @@ fn build() -> [u8; 32] { // executable had cached with the switch unset. for name in [ "VICTORY_BVH_MISS", + // LOCAL: colours and image stores with NaN made 0. + "VICTORY_NAN_SCRUB", + // LOCAL (fxceless #1216): constant buffer slots marked. + "VICTORY_CONSTANT_MARKS", "VICTORY_WAVE_WIDE", "VICTORY_WAVE_DEEP_SKIPS", "VICTORY_WAVE_OWN_BITS", @@ -268,6 +272,11 @@ fn encode(s: &HostShader) -> Vec { word(&mut out, value); } } + word(&mut out, s.half_views.len() as u32); + for &(slot, dword) in &s.half_views { + word(&mut out, u32::from(slot)); + word(&mut out, dword); + } out } @@ -336,6 +345,11 @@ fn decode(bytes: &[u8]) -> Option { shift: u8::try_from(r.word()?).ok().filter(|&s| s < 32)?, }); } + let n = r.word()? as usize; + let mut half_views = Vec::with_capacity(n.min(256)); + for _ in 0..n { + half_views.push((u8::try_from(r.word()?).ok()?, r.word()?)); + } r.0.is_empty().then_some(HostShader { stage, dxil, @@ -346,6 +360,7 @@ fn decode(bytes: &[u8]) -> Option { root_srvs, root_uavs, root_indexed_views, + half_views, }) } @@ -380,6 +395,7 @@ mod tests { byte_offset: 32, shift: 5, }], + half_views: vec![(0, 8), (4, 0)], } } diff --git a/crates/victory-gpu/src/texture.rs b/crates/victory-gpu/src/texture.rs index 1fbc585..337e7c3 100644 --- a/crates/victory-gpu/src/texture.rs +++ b/crates/victory-gpu/src/texture.rs @@ -65,6 +65,10 @@ pub(crate) struct Staging { /// The staging buffer's bytes (counted in `STAGED` while it lives). bytes: u64, memory: *const u8, + /// Whether the guard may stand for a hash of this texture (LOCAL, + /// fxceless #489): not for a video's picture planes, which the decoder + /// writes through another view of the same pages. + guard_view: bool, last: Mutex, /// Whether the staging buffer was detiled since a submitted list last /// uploaded it, and whether one has uploaded it at all: a list records @@ -111,6 +115,20 @@ struct Last { /// and after the hash found a change the guard did not see. const HOT_FRAMES: u64 = 64; +/// LOCAL (wt5 build38, bodnjenie14 12457b43 "Bink video flickering"): after +/// the hash finds a change the guard did not see, the texture stays hot this +/// many frames (`VICTORY_VIDEO_HOT_FRAMES`, 1,024 unless said; 64 before). +/// With 64 the intro video's ring slots went cold between their own changes +/// and showed frames from earlier again (wt5 r_fps2; the user confirmed +/// 1,024 fixed it). Only textures caught changing unseen get it, so the +/// world's static textures do not pay for it. +fn blind_hot_frames() -> u64 { + static N: std::sync::OnceLock = std::sync::OnceLock::new(); + *N.get_or_init(|| { + std::env::var("VICTORY_VIDEO_HOT_FRAMES").ok().and_then(|v| v.trim().parse().ok()).unwrap_or(1024) + }) +} + /// Whether a guarded texture whose memory the hash found changed although /// the guard saw no write is hashed at every check for a while /// ([`HOT_FRAMES`]), not every eighth frame. A title that writes such a @@ -788,7 +806,15 @@ pub(crate) fn upload_from(list: &HostList, resource: This, first: u32) { // at submission is left, and what it finds changed the next list that // samples the texture uploads (a frame late where every list of the // frame was recorded before that check). - if staging.uploaded.load(Relaxed) && !staging.dirty.load(Relaxed) { + // LOCAL: not for a video's picture planes (`guard_view` false). Their + // check at submission finds the frame the decoder wrote since, but the + // copy came only with the next list that samples the plane: three + // frames later in the video's ring of three, and the brightness and + // colour planes each on their own turn, so the intro showed colour + // ghosts and pictures from earlier (r_avm23, the user's recording). + // With the copy recorded here, it takes what that check puts in the + // staging buffer at this list's submission. + if staging.guard_view && staging.uploaded.load(Relaxed) && !staging.dirty.load(Relaxed) { #[cfg(feature = "diagnostics")] crate::copystat::add(crate::copystat::C::TexSkipped, 1); list.defer_texture(staging); @@ -1211,6 +1237,7 @@ impl Staging { // The guard saw no write: a change the hash finds came another way. let mut blind = false; if !alone + && self.guard_view && *GUARD.get_or_init(|| std::env::var_os("VICTORY_TEXTURE_GUARD").is_none_or(|v| v != "0")) && let Some((now, written)) = waited(1, || crate::watch::writes(start, start + size, true)) { @@ -1235,7 +1262,7 @@ impl Staging { // A change the guard did not see: hashed at every check for a while. let found_blind = |last: &mut Last| { if blind && hot_textures() { - last.hot_until = crate::frame::current() + HOT_FRAMES; + last.hot_until = crate::frame::current() + blind_hot_frames(); #[cfg(feature = "diagnostics")] crate::copystat::add(crate::copystat::C::TexHot, 1); } @@ -1774,6 +1801,34 @@ fn staging(resource: This, copy: &crate::resource::HostTexture, first: u32) -> O let host = host()?; // SAFETY: a live resource. let d = unsafe { texture.GetDesc() }; + // LOCAL (fxceless #489, "Fix stale frames in the opening video"): the + // software-decoded movie's planes are linear single-level R8 textures + // the decoder can write through another view of the same pages, which + // the guard on the sampled view does not see: with a hash every eighth + // frame the movie replayed its ring of three old frames (A, B, C, A, B, + // C). Those are hashed at every check. `VICTORY_VIDEO_PLANES=0`: as before. + static PLANES: std::sync::OnceLock = std::sync::OnceLock::new(); + let guard_view = !(*PLANES.get_or_init(|| std::env::var_os("VICTORY_VIDEO_PLANES").is_none_or(|v| v != "0")) + && d.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE2D + && d.Format == windows::Win32::Graphics::Dxgi::Common::DXGI_FORMAT_R8_UNORM + && d.MipLevels == 1 + && d.DepthOrArraySize == 1 + && layout.desc.swizzle == victory_formats::texture::Swizzle::LINEAR); + // Which one-level R8 textures count as video planes, to check the rule + // against the title's (the first few only). + if d.Format == windows::Win32::Graphics::Dxgi::Common::DXGI_FORMAT_R8_UNORM && d.MipLevels == 1 { + static SAID: std::sync::atomic::AtomicU32 = std::sync::atomic::AtomicU32::new(0); + if SAID.fetch_add(1, std::sync::atomic::Ordering::Relaxed) < 24 { + tracing::info!( + width = d.Width, + height = d.Height, + layers = d.DepthOrArraySize, + swizzle = ?layout.desc.swizzle, + video_plane = !guard_view, + "a one-level R8 texture staged" + ); + } + } let level0 = copy.base; let mips = level0 + u32::from(d.MipLevels); let first = crate::resource::read_from(&layout, first).max(level0).min(mips - 1); @@ -1834,6 +1889,7 @@ fn staging(resource: This, copy: &crate::resource::HostTexture, first: u32) -> O once: std::sync::atomic::AtomicBool::new(once() && !on_demand && PICKING.get().is_some()), bytes: total, memory, + guard_view, last: Mutex::default(), dirty: std::sync::atomic::AtomicBool::new(true), uploaded: std::sync::atomic::AtomicBool::new(false), diff --git a/crates/victory-shader/src/emit/diff_tests.rs b/crates/victory-shader/src/emit/diff_tests.rs index 21b4d03..8d09700 100644 --- a/crates/victory-shader/src/emit/diff_tests.rs +++ b/crates/victory-shader/src/emit/diff_tests.rs @@ -1237,7 +1237,24 @@ fn translated_compute_matches_pc() { }; roots.push((1 + n as u32, Root::View { srv, data })); } - let ours = host.dispatch(&root_t, &pso_t, &dispatch(roots)); + // A buffer of halves the translated program moves as unsigned + // integers is shown to it as its unsigned twin, as the host does + // (`HostShader::half_views`); the PC program keeps the float view. + let twins: Vec = views + .iter() + .map(|&v| match v { + View::HalfUav(n) if !cs_c.half_views.is_empty() => View::HalfUintUav(n), + v => v, + }) + .collect(); + let ours = host.dispatch( + &root_t, + &pso_t, + &Dispatch { + views: &twins, + ..dispatch(roots) + }, + ); if name.starts_with("terminates") { match ours { Ok(_) => eprintln!("{name}: finished"), diff --git a/crates/victory-shader/src/emit/halves.rs b/crates/victory-shader/src/emit/halves.rs new file mode 100644 index 0000000..adf2969 --- /dev/null +++ b/crates/victory-shader/src/emit/halves.rs @@ -0,0 +1,148 @@ +//! Typed buffer loads that move 16-bit halves without the d16 form: a +//! format load of whole dwords whose result the program reads only one +//! half of, as a half float, moves 16-bit integers, like a d16 access +//! ([`super::super::HostShader::half_views`]). + +use std::collections::HashSet; + +use super::{Fields, Inst, Lower, Operand, Reg, Role, RootType, Source, Value}; + +impl<'a> Lower<'a> { + /// Whether every use of `value`, a typed buffer load's result, reads + /// one 16-bit half of it as a half float: a `v_fma_mix*` source with + /// its `op_sel_hi` bit set, or `v_cvt_f32_f16`. A program that takes a + /// format load apart like that reads a 16-bit integer view on the + /// console (the load gives the zero-extended integer, whose bits are a + /// half; a float view's value it would not take apart). A use is a + /// read as an operand ([`crate::ir::operand_reads`]): a later write of + /// the register reads the value only to keep it in the lanes EXEC + /// leaves alone, and a phi carries it on, its own uses counting. False + /// without a use. + pub(super) fn read_only_as_halves(&self, value: Value) -> bool { + let p = self.x.p; + let mut used = false; + let mut seen = HashSet::from([value]); + let mut todo = vec![value]; + while let Some(value) = todo.pop() { + for b in &p.blocks { + for phi in b.phis.iter().filter(|phi| phi.args.contains(&value)) { + if seen.insert(phi.value) { + todo.push(phi.value); + } + } + for i in &b.insts { + if !i.reads.iter().any(|r| r.1 == value) { + continue; + } + let operands = crate::ir::operand_reads(p, i); + let regs: Vec = i + .reads + .iter() + .filter(|r| r.1 == value && operands.contains(&r.0)) + .map(|r| r.0) + .collect(); + if regs.is_empty() { + continue; + } + used = true; + let Fields::Valu(v) = &i.fields else { + return false; + }; + match i.name() { + "v_cvt_f32_f16" => {} + "v_fma_mix_f32" | "v_fma_mixlo_f16" | "v_fma_mixhi_f16" => { + let whole = v.src.iter().enumerate().any(|(k, op)| { + matches!(*op, Operand::Vector { reg, .. } if regs.contains(&Reg::V(reg))) + && v.opsel_hi >> k & 1 == 0 + }); + if whole { + return false; + } + } + _ => return false, + } + } + } + } + used + } + + /// Whether `inst` is a format load of whole dwords (not d16) whose + /// every channel is read only as halves ([`Self::read_only_as_halves`]). + pub(super) fn format_load_read_as_halves(&self, inst: &Inst) -> bool { + let Fields::Buffer { + data: Some(Operand::Vector { reg, .. }), + .. + } = inst.fields + else { + return false; + }; + let name = inst.name(); + let count = match name + .strip_prefix("buffer_load_format_") + .or(name.strip_prefix("tbuffer_load_format_")) + { + Some("x") => 1, + Some("xy") => 2, + Some("xyz") => 3, + Some("xyzw") => 4, + _ => return false, + }; + (0..count).all(|k| { + inst.write(Reg::V(reg + k)) + .is_some_and(|v| self.read_only_as_halves(v)) + }) + } + + /// The table places ([`Self::table_place`]) every access through which + /// moves halves: a d16 access, or a format load read only as halves + /// ([`Self::format_load_read_as_halves`]). A place the program reaches + /// otherwise too is left out (a format load of numbers beside one of + /// halves, a raw or scalar load, a descriptor chosen by control flow), + /// and so is every place of a table the program also picks from at run + /// time: what the program makes of such a view is not halves alone. + pub(super) fn places_read_as_halves(&self) -> std::collections::BTreeSet<(u8, u32)> { + let mut halves = std::collections::BTreeSet::new(); + let mut other = std::collections::BTreeSet::new(); + let mut picked = HashSet::new(); + for d in &self.x.res.descriptors { + if d.role == Role::Sampler { + continue; + } + let inst = self + .x + .p + .blocks + .get(d.site.0) + .and_then(|b| b.insts.get(d.site.1)); + let half = matches!(d.source, Source::Loaded { .. }) + && inst.is_some_and(|i| { + (i.name().starts_with("buffer_") && i.name().contains("_format_d16_")) + || self.format_load_read_as_halves(i) + }); + for leaf in d.source.leaves() { + let Source::Loaded { load, .. } = leaf else { + continue; + }; + let Some(a) = self.scalar.get(load) else { + continue; + }; + if a.dynamic.is_some() { + if let Some(rp) = self.x.native.layout.get(a.param) + && rp.root == RootType::Table + { + picked.insert(rp.slot); + } + } else if let Some(place) = self.table_place(leaf) { + if half { + halves.insert(place); + } else { + other.insert(place); + } + } + } + } + halves.retain(|p| !other.contains(p) && !picked.contains(&p.0)); + halves + } +} diff --git a/crates/victory-shader/src/emit/host.rs b/crates/victory-shader/src/emit/host.rs index 9196f51..3fbc2b9 100644 --- a/crates/victory-shader/src/emit/host.rs +++ b/crates/victory-shader/src/emit/host.rs @@ -612,6 +612,7 @@ fn stub(pixel: bool, outputs: Vec) -> HostShader { root_srvs: Vec::new(), root_uavs: Vec::new(), root_indexed_views: Vec::new(), + half_views: Vec::new(), } } @@ -991,6 +992,7 @@ fn transition( /// A view in the heap for [`Host::dispatch`]. #[cfg(test)] +#[derive(Clone, Copy)] pub enum View<'a> { /// An RGBA32F texture SRV (width, height, texels). Texture(u32, u32, &'a [[f32; 4]]), @@ -1004,6 +1006,9 @@ pub enum View<'a> { UintTextureUav(u32, u32), /// A typed RGBA16F buffer UAV of this many elements, zeroed. HalfUav(u32), + /// The same buffer viewed as R16G16B16A16_UINT: what a translated + /// program that moves halves is shown ([`super::HostShader::half_views`]). + HalfUintUav(u32), /// A constant buffer of these dwords. Cbv(&'a [u32]), /// A buffer SRV over these dwords. @@ -1240,7 +1245,7 @@ impl Host { ); keep.push(tex); } - View::RawUav(_) | View::HalfUav(_) => { + View::RawUav(_) | View::HalfUav(_) | View::HalfUintUav(_) => { // (dwords, format, elements, flags) let (n, format, elements, flags) = match *v { View::HalfUav(e) => ( @@ -1249,6 +1254,12 @@ impl Host { e, D3D12_BUFFER_UAV_FLAG_NONE, ), + View::HalfUintUav(e) => ( + 2 * e, + DXGI_FORMAT_R16G16B16A16_UINT, + e, + D3D12_BUFFER_UAV_FLAG_NONE, + ), View::RawUav(n) => { (n, DXGI_FORMAT_R32_TYPELESS, n, D3D12_BUFFER_UAV_FLAG_RAW) } diff --git a/crates/victory-shader/src/emit/intersect_tests.rs b/crates/victory-shader/src/emit/intersect_tests.rs index f2eddab..91143f6 100644 --- a/crates/victory-shader/src/emit/intersect_tests.rs +++ b/crates/victory-shader/src/emit/intersect_tests.rs @@ -194,6 +194,7 @@ pub(super) fn build_compute_shader( root_srvs: lowered.root_srvs, root_uavs: lowered.root_uavs, root_indexed_views: res.root_indexed_views.clone(), + half_views: lowered.half_views, }; if let Ok(mut v) = validator::Validator::load(validator::Validator::default_path().as_deref()) { let mut copy = shader.dxil.clone(); diff --git a/crates/victory-shader/src/emit/lower.rs b/crates/victory-shader/src/emit/lower.rs index 1dc305a..326f88f 100644 --- a/crates/victory-shader/src/emit/lower.rs +++ b/crates/victory-shader/src/emit/lower.rs @@ -25,6 +25,11 @@ use crate::structure::{Atom, Bool, LaneExit, Structured}; #[path = "intersect.rs"] pub(super) mod intersect; +/// Format loads that move 16-bit halves without the d16 form, a child +/// module so it shares the emitter's state. +#[path = "halves.rs"] +mod halves; + type Why = &'static str; /// How an interpolation evaluates an input channel. @@ -55,6 +60,8 @@ pub(crate) struct Lowered { pub root_cbvs: Vec, pub root_srvs: Vec, pub root_uavs: Vec, + /// See [`super::HostShader::half_views`]. + pub half_views: Vec<(u8, u32)>, pub user_data: Vec, pub samplers: Vec<[u32; 4]>, /// The wave size the shader requires of the host, if any. @@ -96,6 +103,12 @@ pub(crate) fn lower(parts: &Parts) -> Result { /// and store). Not where a group barrier would wait for lanes that left, nor /// where two host waves of 32 stand for a console wave (they exchange, which /// takes all lanes). +/// LOCAL: `VICTORY_NAN_SCRUB=1` (off by default): see `Lower::scrub_nan`. +pub(crate) fn nan_scrub() -> bool { + static ON: std::sync::OnceLock = std::sync::OnceLock::new(); + *ON.get_or_init(|| std::env::var_os("VICTORY_NAN_SCRUB").is_some_and(|v| v == "1")) +} + fn counted_in_threads(parts: &Parts) -> bool { let crate::native::StageIo::Cs(cs) = &parts.native.io else { return false; @@ -295,6 +308,11 @@ struct Lower<'a> { params: HashMap, user_data: Option, user_reads: BTreeMap, + /// Table descriptors read or written sixteen bits a channel + /// ([`super::HostShader::half_views`]): root parameter, dword offset. + half_views: std::collections::BTreeSet<(u8, u32)>, + /// [`Self::places_read_as_halves`], found before the code is lowered. + halves_only: std::collections::BTreeSet<(u8, u32)>, samplers: Vec<[u32; 4]>, descriptors: HashMap<(Site, bool), &'a Source>, scalar: HashMap, @@ -1635,6 +1653,8 @@ impl<'a> Lower<'a> { params: x.res.params.iter().map(|&(v, p, d)| (v, (p, d))).collect(), user_data: None, user_reads: BTreeMap::new(), + half_views: Default::default(), + halves_only: Default::default(), samplers: Vec::new(), descriptors: x .res @@ -2335,6 +2355,7 @@ impl<'a> Lower<'a> { self.s.entry = body; } self.find_coherent(); + self.halves_only = self.places_read_as_halves(); let order = crate::ir::reverse_postorder(&p.blocks); for (n, &b) in order.iter().enumerate() { self.rpo[b] = n; @@ -2420,6 +2441,7 @@ impl<'a> Lower<'a> { let root_cbvs = self.s.root_cbvs.iter().map(|r| r.0).collect(); let root_srvs = self.s.root_srvs.iter().map(|r| r.0).collect(); let root_uavs = self.s.root_uavs.iter().map(|r| r.0).collect(); + let half_views = std::mem::take(&mut self.half_views).into_iter().collect(); let cmp_samplers = self.s.cmp_samplers; let wave_size = self.s.wave_size; Ok(Lowered { @@ -2428,6 +2450,7 @@ impl<'a> Lower<'a> { root_cbvs, root_srvs, root_uavs, + half_views, #[cfg(test)] nonuniform_handles: self.s.nonuniform_handles, #[cfg(test)] @@ -6197,7 +6220,12 @@ impl<'a> Lower<'a> { raw.push((x, zero)); } let raw = self.end_guarded(at, &raw); - let other = self.s.m.cmp(self.cur, pred::EQ, stride, zero); + // LOCAL (fxceless #1216): only a slot marked as a constant + // buffer is read as one; any other non-buffer gives zeros. + let other = match self.slot_is_constant(src)? { + Some(is_constant) => is_constant, + None => self.s.m.cmp(self.cur, pred::EQ, stride, zero), + }; let at = self.begin_guarded(Some(other)); let h = self.handle(site, src, false, (13, 0x1_0000))?; let mut both = Vec::new(); @@ -6482,7 +6510,15 @@ impl<'a> Lower<'a> { let props = if un.starts_with("buffer_load_format") || un.starts_with("buffer_store_format") { - (10 | u, 0x409) + // (Unsigned integers where the access moves halves.) + let halves = self + .table_place(&Source::Loaded { load: site, first }) + .is_some_and(|p| { + self.halves_only.contains(&p) + && (un.contains("_format_d16_") + || self.format_load_read_as_halves(ui)) + }); + (10 | u, if halves { 0x405 } else { 0x409 }) } else if !counted && *idxen && format.is_none() @@ -7122,6 +7158,22 @@ impl<'a> Lower<'a> { (kind == Some(ResourceType::Uav)).then(|| self.host_word(RootType::Other(USER_VIEW_BIAS), rp.slot, 0)) } + /// The table descriptor `src` is, as (root parameter, dword in the + /// table), when the code loads it from a fixed place in a table: the + /// load's own place, not the start of the range its used-resource + /// entry describes (a range of several descriptors starts before most + /// of them). `None` for a descriptor picked at run time, built in the + /// code or chosen by control flow. + fn table_place(&self, src: &Source) -> Option<(u8, u32)> { + let Source::Loaded { load, first } = src else { + return None; + }; + let a = self.scalar.get(load)?; + let rp = self.x.native.layout.get(a.param)?; + (rp.root == RootType::Table && a.dynamic.is_none()) + .then(|| (rp.slot, a.offset / 4 + u32::from(*first))) + } + /// The used-resource entry a descriptor loaded from a table falls in. fn used_kind(&self, src: &Source) -> Option<&'a UsedResource> { if let Source::Phi { args, .. } | Source::Select { args, .. } | Source::Lanes { args, .. } = @@ -7477,10 +7529,33 @@ impl<'a> Lower<'a> { let word = self.slot_word(src)?; Ok(word.map(|word| { let bits = self.s.m.i32(super::shader::VIEW_STRIDE_BITS); - self.s.m.bin(self.cur, Bin::And, word, bits) + let stride = self.s.m.bin(self.cur, Bin::And, word, bits); + if super::shader::constant_marks() { + // LOCAL (fxceless #1216): the mark of a constant buffer + // slot is no stride. + let mark = self.s.m.i32(super::shader::SLOT_STRIDE_CONSTANT); + let is_constant = self.s.m.cmp(self.cur, pred::EQ, word, mark); + let zero = self.s.m.i32(0); + self.s.m.select(self.cur, is_constant, zero, stride) + } else { + stride + } })) } + /// LOCAL (fxceless #1216): with [`super::shader::constant_marks`], + /// whether the slot `src` names holds a constant buffer view. + fn slot_is_constant(&mut self, src: &Source) -> Result, Why> { + if !super::shader::constant_marks() { + return Ok(None); + } + let Some(word) = self.slot_word(src)? else { + return Ok(None); + }; + let mark = self.s.m.i32(super::shader::SLOT_STRIDE_CONSTANT); + Ok(Some(self.s.m.cmp(self.cur, pred::EQ, word, mark))) + } + /// Whether the typed buffer view `src` names is one of an integer format, /// and whether a signed one, as [`Self::slot_stride`] (`None`: a view the /// program does not pick from the heap). @@ -10932,6 +11007,10 @@ impl<'a> Lower<'a> { self.float_of(v)? }); } + // LOCAL: `VICTORY_NAN_SCRUB=1` (see `scrub_nan`). + for v in &mut vals { + *v = self.scrub_nan(*v); + } let h = self.handle(site, src, false, props)?; let at = self.begin_guarded(guard); let mut args = vec![h]; @@ -11630,6 +11709,23 @@ impl<'a> Lower<'a> { .copied() .ok_or("an untracked buffer")?; let used = self.used_kind(src); + // Sixteen bits a channel through a view of a table: the bits go as + // they are, as unsigned integers, and the host is told, which shows + // the shader a 16-bit float view there as its unsigned twin + // ([`super::HostShader::half_views`]). + // A format load of whole dwords whose every use reads one half of a + // result as a half float moves 16-bit integers too (the head + // program's reads of the face network's output), where every + // access through its view does ([`Self::places_read_as_halves`]). + // A d16 access too only where every access does: a whole float + // read through the same place would see the unsigned twin. + let place = typed.then(|| self.table_place(src)).flatten().filter(|p| { + self.halves_only.contains(p) && (d16 || self.format_load_read_as_halves(inst)) + }); + let halves = place.is_some(); + if let Some(place) = place { + self.half_views.insert(place); + } let (base, extra) = self.built_offset(src)?; if base != 0 { let b = self.s.m.i32(base); @@ -11861,14 +11957,16 @@ impl<'a> Lower<'a> { let mut vals = self.vgprs(inst, data.as_ref().ok_or("buffer store data")?, regs as u8)?; if d16 { - // d16 data is taken as f16, widened for the 32-bit float - // store; through a view of an integer format it is a 16-bit + // Through a view of a table each half is stored as it is + // (`halves`, fxceless #927). Reached another way, d16 data + // is taken as f16, widened for the 32-bit float store; + // through a view of an integer format it is a 16-bit // integer, zero- or sign-extended (VIctory 4243a96a: the face // network keeps its halves in UINT views; its output was // noise). shortcut: that is known of the views a program - // picks from the heap, not of those in its tables; and the - // handle stays a float one, whose bits the drivers pass. - let integer = if typed { self.integer_view(src)? } else { None }; + // picks from the heap; and the handle stays a float one, + // whose bits the drivers pass. + let integer = if typed && !halves { self.integer_view(src)? } else { None }; let mut wide = Vec::new(); for k in 0..count { let mut x = vals[(k / 2) as usize]; @@ -11876,6 +11974,11 @@ impl<'a> Lower<'a> { let k16 = self.s.m.i32(16); x = self.s.m.bin(c, Bin::LShr, x, k16); } + if halves { + let low = self.s.m.i32(0xffff); + wide.push(self.s.m.bin(c, Bin::And, x, low)); + continue; + } let f32t = self.s.t.f32; let f = self .s @@ -11900,12 +12003,21 @@ impl<'a> Lower<'a> { if count != 4 || *offen || *offset != 0 { return Err("a typed buffer store of some channels or at an offset"); } - args.push(self.handle(site, src, false, (10 | u, 0x409))?); + // Four unsigned integers for halves, four floats otherwise. + let component = if halves { 0x405 } else { 0x409 }; + args.push(self.handle(site, src, false, (10 | u, component))?); args.extend([index.unwrap_or(self.s.m.i32(0)), iu]); for x in vals { - args.push(self.as_float(x)); + args.push(if halves { x } else { self.as_float(x) }); } - (69, "bufferStore.f32") + ( + 69, + if halves { + "bufferStore.i32" + } else { + "bufferStore.f32" + }, + ) } else { match index { // A raw buffer (stride 1) written by index: the index is the byte. @@ -11965,16 +12077,30 @@ impl<'a> Lower<'a> { if uav { self.s.flags |= flags::TYPED_UAV_LOADS; } - let h = self.handle(site, src, false, (10 | u, 0x409))?; let index = index.unwrap_or(self.s.m.i32(0)); - self.s.op( - c, - "bufferLoad.f32", - Attr::ReadOnly, - self.s.t.res_ret, - 68, - &[h, index, iu], - ) + if halves { + let h = self.handle(site, src, false, (10 | u, 0x405))?; + let i32t = self.s.t.i32; + let ret = self.s.m.named_struct("dx.types.ResRet.i32", vec![i32t; 5]); + self.s.op( + c, + "bufferLoad.i32", + Attr::ReadOnly, + ret, + 68, + &[h, index, iu], + ) + } else { + let h = self.handle(site, src, false, (10 | u, 0x409))?; + self.s.op( + c, + "bufferLoad.f32", + Attr::ReadOnly, + self.s.t.res_ret, + 68, + &[h, index, iu], + ) + } } else { let mask = self.s.m.i8((1u8 << count) - 1); let align = self.s.m.i32(4); @@ -12024,24 +12150,32 @@ impl<'a> Lower<'a> { return Err("a buffer result"); }; if d16 { - // Two f16 channels per VGPR (an odd last high half 0); the low - // 16 bits of an integer view's (see the stores above). - let integer = if typed { self.integer_view(src)? } else { None }; + // Two f16 channels per VGPR (an odd last high half 0); through + // a view of a table, the 16 bits of each as they are (fxceless + // #927); the low 16 bits of an integer view's picked from the + // heap (see the stores above). + let integer = if typed && !halves { self.integer_view(src)? } else { None }; let k16 = self.s.m.i32(16); let i32t = self.s.t.i32; for k in 0..count.div_ceil(2) { let mut x = None; for ch in (2 * k..(2 * k + 2).min(count)).rev() { let f = self.s.m.extract(c, r, ch); - let mut h = self - .s - .op(c, "legacyF32ToF16", Attr::ReadNone, i32t, 130, &[f]); - if let Some((int, _)) = integer { - let bits = self.as_int(f); - let low = self.s.m.i32(0xFFFF); - let low = self.s.m.bin(c, Bin::And, bits, low); - h = self.s.m.select(c, int, low, h); - } + let h = if halves { + let low = self.s.m.i32(0xffff); + self.s.m.bin(c, Bin::And, f, low) + } else { + let mut h = self + .s + .op(c, "legacyF32ToF16", Attr::ReadNone, i32t, 130, &[f]); + if let Some((int, _)) = integer { + let bits = self.as_int(f); + let low = self.s.m.i32(0xFFFF); + let low = self.s.m.bin(c, Bin::And, bits, low); + h = self.s.m.select(c, int, low, h); + } + h + }; x = Some(match x { Some(hi) => { let hi = self.s.m.bin(c, Bin::Shl, hi, k16); @@ -12056,12 +12190,34 @@ impl<'a> Lower<'a> { } for k in 0..count { let x = self.s.m.extract(c, r, k); - let x = self.as_int(x); + // (Integers already where the load moved halves.) + let x = if halves { x } else { self.as_int(x) }; self.write(inst, Reg::V(reg + k as u8), x, guard); } Ok(()) } + /// LOCAL: with `VICTORY_NAN_SCRUB=1` (off by default), `f` or 0 where it + /// is NaN. Used on the colours pixel shaders write and on float image + /// stores: a NaN that reaches the title's bloom, blur or temporal + /// upscaler spreads into black patches that stay in its history (seen on + /// NVIDIA as black blobs on faces and in the air). Not what the console + /// does, so it is a switch; part of the shader cache key. + fn scrub_nan(&mut self, f: V) -> V { + if !nan_scrub() { + return f; + } + // NaN or an infinity (11/26: the whole picture went white at one + // angle with only NaN scrubbed: an infinity through bloom or the + // exposure does the same). |f| >= inf, unordered: true for NaN too. + let c = self.cur; + let a = self.unary(6, f); + let inf = self.s.m.f32(0x7f80_0000); + let bad = self.s.m.cmp(c, pred::UGE, a, inf); + let zero = self.s.m.f32(0); + self.s.m.select(c, bad, zero, f) + } + fn export(&mut self, b: usize, i: usize) -> Result<(), Why> { let e = *self .exports @@ -12247,6 +12403,8 @@ impl<'a> Lower<'a> { (true, false) => ("storeVertexOutput", 171), (true, true) => ("storePrimitiveOutput", 172), }; + // LOCAL: a colour a pixel shader writes (`VICTORY_NAN_SCRUB`). + let colour = self.s.pixel && matches!(e.target, Target::Color(_)); for (id, col, value, half) in stores { let mut x = self.i32_of(value)?; if let Some(high) = half { @@ -12265,12 +12423,19 @@ impl<'a> Lower<'a> { let el = &mut elements(self, primitive)[id]; el.usage |= 1 << col; let (suffix, x) = match el.comp { - 9 if half.is_some() => (".f32", self.as_float(x)), + 9 if half.is_some() => { + let f = self.as_float(x); + (".f32", if colour { self.scrub_nan(f) } else { f }) + } 9 => { let f = match self.floats.get(&value) { Some(&f) => f, None => self.as_float(x), }; + // LOCAL: `VICTORY_NAN_SCRUB=1`: a colour a pixel shader + // writes is 0 where it is NaN, so one bad value does not + // spread through the title's blur and temporal passes. + let f = if colour { self.scrub_nan(f) } else { f }; (".f32", f) } _ => (".i32", x), diff --git a/crates/victory-shader/src/emit/mod.rs b/crates/victory-shader/src/emit/mod.rs index baf9226..85a9e0f 100644 --- a/crates/victory-shader/src/emit/mod.rs +++ b/crates/victory-shader/src/emit/mod.rs @@ -122,8 +122,8 @@ pub use lower::{host_settings, set_host_max_wave, set_host_rdna}; pub use rect::rect_list_gs; pub use shader::{ MEMORY_FAULTS, MEMORY_PAGES, MEMORY_READ_ONLY, ROOT_CBV_SPACE, SAMPLER_SPACE, SLOT_FAULTS, SLOT_MEMORY, SLOT_STRIDES, - SLOT_STRIDES_COUNT, USER_DATA_SPACE, VIEW_INTEGER, VIEW_SIGNED, VIEW_STRIDE_BITS, USER_DISPATCH_THREADS_X, USER_MEMORY_BASE, USER_ROOT_ADDRESS, USER_VIEW_ADDRESS, USER_VIEW_BIAS, - raw_views, set_raw_views, set_view_heap_limit, view_heap_limit, + SLOT_STRIDE_CONSTANT, SLOT_STRIDES_COUNT, USER_DATA_SPACE, VIEW_INTEGER, VIEW_SIGNED, VIEW_STRIDE_BITS, USER_DISPATCH_THREADS_X, USER_MEMORY_BASE, USER_ROOT_ADDRESS, USER_VIEW_ADDRESS, USER_VIEW_BIAS, + constant_marks, raw_views, set_raw_views, set_view_heap_limit, view_heap_limit, }; /// The loop limit without an override: 2^20. @@ -354,6 +354,21 @@ pub struct HostShader { pub root_uavs: Vec, /// Heap descriptors that can be selected from root state at bind time. pub root_indexed_views: Vec, + /// Table descriptors (root parameter, dword offset in the table) whose + /// buffer the shader reads or writes sixteen bits a channel + /// (`buffer_load_format_d16_*`, `buffer_store_format_d16_*`), in + /// order. On the console each channel's 16 bits move as they are + /// through a 16-bit float view and through a 16-bit integer one alike + /// (the title keeps half floats, and indices beside them, in + /// `R16G16B16A16_UINT` and `R16_UINT` buffers). The DXIL moves them as + /// unsigned integers, which an unsigned 16-bit view carries unchanged; + /// the host shows the shader a 16-bit float or signed buffer view at + /// these places as the unsigned format of the same layout. + /// shortcut: a view in a normalised 16-bit format, whose values the + /// console would convert to halves, is read as its integers; a + /// descriptor picked at run time keeps the float path (its slot, and so + /// its format, is known only then). + pub half_views: Vec<(u8, u32)>, } impl HostShader { @@ -796,6 +811,7 @@ fn emit_program( root_srvs: l.root_srvs, root_uavs: l.root_uavs, root_indexed_views: res.root_indexed_views.clone(), + half_views: l.half_views, }; Ok((shader, wave_size)) } @@ -1578,6 +1594,7 @@ mod tests { root_srvs: Vec::new(), root_uavs: Vec::new(), root_indexed_views: Vec::new(), + half_views: Vec::new(), }; let file = |var: &str, stage| { std::env::var(var).ok().map(|p| super::HostShader { @@ -1590,6 +1607,7 @@ mod tests { root_srvs: Vec::new(), root_uavs: Vec::new(), root_indexed_views: Vec::new(), + half_views: Vec::new(), }) }; let ps = file("VICTORY_REF_PS", crate::HwStage::Ps).unwrap_or(ps); @@ -2199,6 +2217,7 @@ mod tests { root_srvs: l.root_srvs, root_uavs: l.root_uavs, root_indexed_views: Vec::new(), + half_views: Vec::new(), }; let (root, pso) = host.compute_pipeline(&cs).unwrap(); // Twelve dwords: the loads below run across the view's end. @@ -2352,6 +2371,7 @@ mod tests { root_srvs: l.root_srvs, root_uavs: l.root_uavs, root_indexed_views: Vec::new(), + half_views: l.half_views, }; let (root, pso) = host.compute_pipeline(&cs).unwrap(); let inputs: Vec = [ @@ -2768,6 +2788,7 @@ mod barycentric_tests { root_srvs: Vec::new(), root_uavs: Vec::new(), root_indexed_views: Vec::new(), + half_views: Vec::new(), }; validate(&vs); // One triangle covers an 8x8 target, with attribute values 2, 6, 10. diff --git a/crates/victory-shader/src/emit/permlane_tests.rs b/crates/victory-shader/src/emit/permlane_tests.rs index 3e6826c..a72b559 100644 --- a/crates/victory-shader/src/emit/permlane_tests.rs +++ b/crates/victory-shader/src/emit/permlane_tests.rs @@ -106,6 +106,7 @@ fn lowered(native: &NativeProgram, host_wave: u32) -> Result { diff --git a/crates/victory-shader/src/emit/probe_tests.rs b/crates/victory-shader/src/emit/probe_tests.rs index fd109ba..c12009d 100644 --- a/crates/victory-shader/src/emit/probe_tests.rs +++ b/crates/victory-shader/src/emit/probe_tests.rs @@ -34,6 +34,7 @@ fn probe() { root_srvs: Vec::new(), root_uavs: Vec::new(), root_indexed_views: Vec::new(), + half_views: Vec::new(), }; let (root, pso) = match host.compute_pipeline(&shader) { Ok(made) => made, diff --git a/crates/victory-shader/src/emit/rect.rs b/crates/victory-shader/src/emit/rect.rs index 9ec80fd..ba2f4b9 100644 --- a/crates/victory-shader/src/emit/rect.rs +++ b/crates/victory-shader/src/emit/rect.rs @@ -415,6 +415,7 @@ mod tests { root_srvs: Vec::new(), root_uavs: Vec::new(), root_indexed_views: Vec::new(), + half_views: Vec::new(), }; ( host(crate::native::HwStage::Vs, vs), diff --git a/crates/victory-shader/src/emit/shader.rs b/crates/victory-shader/src/emit/shader.rs index 1f6585f..4a44a92 100644 --- a/crates/victory-shader/src/emit/shader.rs +++ b/crates/victory-shader/src/emit/shader.rs @@ -34,6 +34,25 @@ pub const VIEW_INTEGER: u32 = 1 << 31; pub const VIEW_SIGNED: u32 = 1 << 30; /// Dwords of the [`SLOT_STRIDES`] buffer: heap indices are clamped to it. pub const SLOT_STRIDES_COUNT: u32 = 1 << 21; +/// LOCAL (port of fxceless/victory-fork PR #1216, GamingRipperDoc): the +/// [`SLOT_STRIDES`] dword of a slot that holds a constant buffer view (a +/// stride no buffer has, no kind bits). A program reads a slot it picks as a +/// constant buffer only where this mark is; a slot whose dword is 0 holds +/// neither a buffer nor a constant buffer, and the read gives zeros. Read as +/// a constant buffer, a texture's descriptor is taken as a buffer's: the +/// meshlet culling `_Prev` passes then read whatever lies at a made-up +/// address (a page fault on AMD). +/// `VICTORY_CONSTANT_MARKS=1` turns it on. Off by default here (on in the +/// PR): not yet run in the game on this tree, where a constant buffer slot +/// whose mark is not written yet would read zeros. +pub const SLOT_STRIDE_CONSTANT: u32 = VIEW_STRIDE_BITS; + +/// Whether [`SLOT_STRIDE_CONSTANT`] is in use: read once, by the host and +/// the translator alike. +pub fn constant_marks() -> bool { + static ON: std::sync::OnceLock = std::sync::OnceLock::new(); + *ON.get_or_init(|| std::env::var_os("VICTORY_CONSTANT_MARKS").is_some_and(|v| v == "1")) +} /// Title memory by address (`resource::MEMORY`): console code reads and /// writes through raw 40-bit addresses it takes from root constants, diff --git a/crates/victory-shader/src/emit/size_tests.rs b/crates/victory-shader/src/emit/size_tests.rs index 9c78bf4..391e48d 100644 --- a/crates/victory-shader/src/emit/size_tests.rs +++ b/crates/victory-shader/src/emit/size_tests.rs @@ -73,6 +73,7 @@ fn build(words: &[u32], srv: (u8, u32)) -> Result { root_srvs: lowered.root_srvs, root_uavs: lowered.root_uavs, root_indexed_views: Vec::new(), + half_views: Vec::new(), }; if let Ok(mut v) = validator::Validator::load(validator::Validator::default_path().as_deref()) { v.validate(&mut shader.dxil.clone()) diff --git a/crates/victory-shader/src/emit/valu_tests.rs b/crates/victory-shader/src/emit/valu_tests.rs index 4a2d829..f3067d2 100644 --- a/crates/victory-shader/src/emit/valu_tests.rs +++ b/crates/victory-shader/src/emit/valu_tests.rs @@ -181,6 +181,7 @@ fn build_cs(body: &[u32], threads: u32, lds_bytes: u32) -> HostShader { root_srvs: lowered.root_srvs, root_uavs: lowered.root_uavs, root_indexed_views: res.root_indexed_views, + half_views: lowered.half_views, }; if let Ok(mut v) = validator::Validator::load(validator::Validator::default_path().as_deref()) { @@ -1918,6 +1919,7 @@ fn whole_wave_f64_sum_and_cvt_f32_f64() { root_srvs: lowered.root_srvs, root_uavs: lowered.root_uavs, root_indexed_views: Vec::new(), + half_views: lowered.half_views, }; if let Ok(mut v) = validator::Validator::load(validator::Validator::default_path().as_deref()) { let mut copy = shader.dxil.clone(); @@ -2057,3 +2059,488 @@ fn rdna_forms_give_what_the_spelled_out_ones_give() { } } } + +/// A program that moves a typed buffer's 16-bit channels +/// (`buffer_load_format_d16_xyzw` from the table's first view, +/// `buffer_store_format_d16_xyzw` to its second) names both places for the +/// host (`HostShader::half_views`) and moves every pattern as it is through +/// unsigned views: half floats, the not-a-number ones among them, and +/// plain 16-bit integers (the title keeps both in such buffers; the +/// network that moves its faces reads indices this way). A program that +/// moves no halves names nothing. +#[test] +fn halves_go_through_a_table_as_they_are_and_name_their_views() { + use super::host::Stride; + use windows::Win32::Graphics::Dxgi::Common::DXGI_FORMAT_R16G16B16A16_UINT; + /// MUBUF `op vdata, vaddr, s[srsrc:srsrc+3], 0 idxen`. + const fn mubuf_idxen(op: u32, vdata: u8, vaddr: u8, srsrc: u8) -> [u32; 2] { + [ + 0x38 << 26 | op << 18 | 1 << 13, + 0x80 << 24 | ((srsrc as u32 >> 2) & 0x1F) << 16 | (vdata as u32) << 8 | vaddr as u32, + ] + } + const LOAD_D16_XYZW: u32 = 0x83; + const STORE_D16_XYZW: u32 = 0x87; + const THREADS: u32 = 32; + // The table's second descriptor, 0x20 bytes on. + let mut second = s_load_dwordx4(12, 4); + second[1] |= 0x20; + let mut words = vec![s_mov_b32(5, 0x80)]; + words.extend_from_slice(&s_load_dwordx4(8, 4)); + words.extend_from_slice(&second); + // v[1:2] = first[thread] (four halves), second[thread] = v[1:2]. + words.extend_from_slice(&mubuf_idxen(LOAD_D16_XYZW, 1, 0, 8)); + words.extend_from_slice(&mubuf_idxen(STORE_D16_XYZW, 1, 0, 12)); + words.push(S_ENDPGM); + let view = |kind: ResourceType, table_offset_dwords: u32| UsedResource { + kind, + root: RootType::Table, + table_offset_dwords, + lower_bound: table_offset_dwords / 8, + stride: 4, + dwords: 4, + user_data: 4, + slot: 1, + }; + let native = NativeProgram { + stage: HwStage::Cs, + wave64: false, + vgprs: 8, + layout: vec![ + RootParam { + root: RootType::Constants, + table_offset_dwords: 0, + sgprs: 4, + base_register: 0, + user_data: 0, + slot: 0, + }, + RootParam { + root: RootType::Table, + table_offset_dwords: 0, + sgprs: 1, + base_register: 0, + user_data: 4, + slot: 1, + }, + ], + used: vec![view(ResourceType::Srv, 0), view(ResourceType::Uav, 8)], + io: StageIo::Cs(ComputeIo { + rsrc2: 5 << 1, + threads: [THREADS, 1, 1], + }), + code: words.iter().flat_map(|w| w.to_le_bytes()).collect(), + }; + let p = ir::build(&native.code, native.wave64, native.vgprs).expect("ir::build"); + let st = structure::structure(&p).expect("structure"); + let res = + resource::track(&p, &native.layout, native.stage, Some(&st)).expect("resource::track"); + let io = io::raise(&p, &native).expect("io::raise"); + let lowered = lower::lower(&lower::Parts { + native: &native, + p: &p, + st: &st, + io: &io, + res: &res, + inputs: Vec::new(), + outputs: Vec::new(), + prims: Vec::new(), + mesh_stride: 0, + }) + .expect("lower"); + assert_eq!(lowered.half_views, [(1, 0), (1, 8)]); + let shader = HostShader { + stage: HwStage::Cs, + dxil: lowered.dxil, + user_data: lowered.user_data, + samplers: lowered.samplers, + static_samplers: Vec::new(), + root_cbvs: lowered.root_cbvs, + root_srvs: lowered.root_srvs, + root_uavs: lowered.root_uavs, + root_indexed_views: res.root_indexed_views, + half_views: lowered.half_views, + }; + if let Ok(mut v) = validator::Validator::load(validator::Validator::default_path().as_deref()) { + let mut dxil = shader.dxil.clone(); + v.validate(&mut dxil).expect("DXIL validation failed"); + } + // A raw store through the same table: no halves, nothing named. + assert!(build_valu_cs(&[]).half_views.is_empty()); + + // Four halves a thread: numbers, both zeros, subnormals, infinities, + // not-a-numbers of both signs, and integers past the largest number's + // pattern, as indices are. + const SPECIAL: [u16; 16] = [ + 0x0000, 0x0001, 0x03ff, 0x0400, 0x3c00, 0x7bff, 0x7c00, 0x7c01, 0x7e00, 0x7fff, 0x8000, + 0x8001, 0xbc00, 0xfc00, 0xfc01, 0xffff, + ]; + let halves: Vec = (0..4 * THREADS as usize) + .map(|i| match i { + 0..16 => SPECIAL[i], + _ => (i as u16).wrapping_mul(0x0203).wrapping_add(0x7b00), + }) + .collect(); + let data: Vec = halves + .chunks(2) + .map(|pair| u32::from(pair[0]) | u32::from(pair[1]) << 16) + .collect(); + let _one = ONE_AT_A_TIME.lock().unwrap_or_else(|e| e.into_inner()); + let mut ran = 0; + for (label, warp) in [("hardware", false), ("warp", true)] { + let Ok(host) = Host::new(warp) else { + eprintln!("no SM 6.6 {label} device; skipped"); + continue; + }; + let (root, pso) = host + .compute_pipeline(&shader) + .unwrap_or_else(|e| panic!("{label}: compute_pipeline failed: {e}")); + let mut ud = vec![0u32; shader.user_data_dwords().max(1) as usize]; + for u in &shader.user_data { + ud[u.index as usize] = match (u.root, u.slot) { + (RootType::Table, 1) => 0, + other => panic!("unexpected user data {other:?}"), + }; + } + let out = host + .dispatch( + &root, + &pso, + &Dispatch { + roots: vec![(0, Root::Constants(ud))], + views: &[ + View::Buffer { + data: &data, + stride: Stride::Format(DXGI_FORMAT_R16G16B16A16_UINT, 8), + }, + View::HalfUintUav(THREADS), + ], + samplers: &[], + groups: [1, 1, 1], + }, + ) + .unwrap_or_else(|e| panic!("{label}: dispatch failed: {e}")); + assert_eq!( + out[0], data, + "{label}: the halves stored are the halves loaded" + ); + ran += 1; + } + assert!(ran > 0, "no SM 6.6 device available"); +} + +/// The places a program that moves halves names are the descriptors it +/// loads, not the start of the range their used-resource entry describes: +/// with one entry for a range from dword 0, a load at byte 0x20 names +/// dword 8 (a host view there in a 16-bit float format is the one shown +/// as its unsigned twin). A descriptor picked at run time (the load's +/// offset in an SGPR) names nothing and keeps the float path: which slot +/// it reads, and in which format, is known only then. +#[test] +fn half_places_are_the_descriptors_the_program_loads() { + /// MUBUF `op vdata, vaddr, s[srsrc:srsrc+3], 0 idxen`. + const fn mubuf_idxen(op: u32, vdata: u8, vaddr: u8, srsrc: u8) -> [u32; 2] { + [ + 0x38 << 26 | op << 18 | 1 << 13, + 0x80 << 24 | ((srsrc as u32 >> 2) & 0x1F) << 16 | (vdata as u32) << 8 | vaddr as u32, + ] + } + const LOAD_D16_XYZW: u32 = 0x83; + const STORE_D16_XYZW: u32 = 0x87; + let lowered = |words: &[u32]| { + let range = |kind: ResourceType, table_offset_dwords: u32| UsedResource { + kind, + root: RootType::Table, + table_offset_dwords, + lower_bound: table_offset_dwords / 8, + stride: 4, + dwords: 4, + user_data: 4, + slot: 1, + }; + let native = NativeProgram { + stage: HwStage::Cs, + wave64: false, + vgprs: 8, + layout: vec![ + RootParam { + root: RootType::Constants, + table_offset_dwords: 0, + sgprs: 4, + base_register: 0, + user_data: 0, + slot: 0, + }, + RootParam { + root: RootType::Table, + table_offset_dwords: 0, + sgprs: 1, + base_register: 0, + user_data: 4, + slot: 1, + }, + ], + // One entry for a range of views from dword 0, one at 16. + used: vec![range(ResourceType::Srv, 0), range(ResourceType::Uav, 16)], + io: StageIo::Cs(ComputeIo { + rsrc2: 5 << 1, + threads: [32, 1, 1], + }), + code: words.iter().flat_map(|w| w.to_le_bytes()).collect(), + }; + let p = ir::build(&native.code, native.wave64, native.vgprs).expect("ir::build"); + let st = structure::structure(&p).expect("structure"); + let res = + resource::track(&p, &native.layout, native.stage, Some(&st)).expect("resource::track"); + let io = io::raise(&p, &native).expect("io::raise"); + lower::lower(&lower::Parts { + native: &native, + p: &p, + st: &st, + io: &io, + res: &res, + inputs: Vec::new(), + outputs: Vec::new(), + prims: Vec::new(), + mesh_stride: 0, + }) + .expect("lower") + }; + // `s_load_dwordx4 s[dst:dst+3], s[4:5], offset` (soffset null), or with + // the offset in `soffset` instead. + let at = |dst: u8, offset: u32| { + let mut w = s_load_dwordx4(dst, 4); + w[1] |= offset; + w + }; + let picked = |dst: u8, soffset: u8| { + let mut w = s_load_dwordx4(dst, 4); + w[1] = u32::from(soffset) << 25; + w + }; + let mut fixed = vec![s_mov_b32(5, 0x80)]; + fixed.extend_from_slice(&at(8, 0x20)); + fixed.extend_from_slice(&at(12, 0x40)); + fixed.extend_from_slice(&mubuf_idxen(LOAD_D16_XYZW, 1, 0, 8)); + fixed.extend_from_slice(&mubuf_idxen(STORE_D16_XYZW, 1, 0, 12)); + fixed.push(S_ENDPGM); + assert_eq!(lowered(&fixed).half_views, [(1, 8), (1, 16)]); + // The load's offset in s20, from the first lane's thread index + // (`v_readfirstlane_b32 s20, v0`): picked at run time. The pick may land + // on the store's place too, so no place of that table is named: the d16 + // accesses there take the float path, as before half views. + let mut runtime = vec![s_mov_b32(5, 0x80), vop1(0x02, 20, vgpr(0))]; + runtime.extend_from_slice(&picked(8, 20)); + runtime.extend_from_slice(&at(12, 0x40)); + runtime.extend_from_slice(&mubuf_idxen(LOAD_D16_XYZW, 1, 0, 8)); + runtime.extend_from_slice(&mubuf_idxen(STORE_D16_XYZW, 1, 0, 12)); + runtime.push(S_ENDPGM); + assert!(lowered(&runtime).half_views.is_empty()); +} + +/// A format load of whole dwords (`buffer_load_format_x`, not d16) whose +/// result the program only reads one half of as a half float +/// (`v_cvt_f32_f16`) is moving 16-bit integers: the head program reads the +/// face network's output so, from an `R16_UINT` view. It names its view for +/// the host and loads the integer: 0x3c00 comes through as 1.0. Used as a +/// whole float instead (`v_add_f32`), the load stays a float load and names +/// nothing; so does a load of halves beside a load of the same view read as +/// a whole float (a view of numbers the program also picks one half float +/// out of, as hundreds of the title's pixel programs do). +#[test] +fn a_format_load_read_as_halves_loads_the_integer() { + use super::host::Stride; + use windows::Win32::Graphics::Dxgi::Common::DXGI_FORMAT_R16_UINT; + /// MUBUF `op vdata, vaddr, s[srsrc:srsrc+3], 0 idxen`. + const fn mubuf_idxen(op: u32, vdata: u8, vaddr: u8, srsrc: u8) -> [u32; 2] { + [ + 0x38 << 26 | op << 18 | 1 << 13, + 0x80 << 24 | ((srsrc as u32 >> 2) & 0x1F) << 16 | (vdata as u32) << 8 | vaddr as u32, + ] + } + const LOAD_FORMAT_X: u32 = 0x00; + const V_CVT_F32_F16: u16 = 0x0B; + const V_ADD_F32: u8 = 0x03; + let lowered = |body: &[u32]| { + let view = |kind: ResourceType, table_offset_dwords: u32, stride: u32| UsedResource { + kind, + root: RootType::Table, + table_offset_dwords, + lower_bound: table_offset_dwords / 8, + stride, + dwords: 4, + user_data: 4, + slot: 1, + }; + let mut second = s_load_dwordx4(12, 4); + second[1] |= 0x20; + let mut words = vec![s_mov_b32(5, 0x80)]; + words.extend_from_slice(&s_load_dwordx4(8, 4)); + words.extend_from_slice(&second); + // `body` leaves v2, stored raw. + words.extend_from_slice(body); + words.extend_from_slice(&buffer_store_dword(2, 12, 0)); + words.push(S_ENDPGM); + let native = NativeProgram { + stage: HwStage::Cs, + wave64: false, + vgprs: 8, + layout: vec![ + RootParam { + root: RootType::Constants, + table_offset_dwords: 0, + sgprs: 4, + base_register: 0, + user_data: 0, + slot: 0, + }, + RootParam { + root: RootType::Table, + table_offset_dwords: 0, + sgprs: 1, + base_register: 0, + user_data: 4, + slot: 1, + }, + ], + used: vec![view(ResourceType::Srv, 0, 4), view(ResourceType::Uav, 8, 0)], + io: StageIo::Cs(ComputeIo { + rsrc2: 5 << 1, + threads: [1, 1, 1], + }), + code: words.iter().flat_map(|w| w.to_le_bytes()).collect(), + }; + let p = ir::build(&native.code, native.wave64, native.vgprs).expect("ir::build"); + let st = structure::structure(&p).expect("structure"); + let res = + resource::track(&p, &native.layout, native.stage, Some(&st)).expect("resource::track"); + let io = io::raise(&p, &native).expect("io::raise"); + let l = lower::lower(&lower::Parts { + native: &native, + p: &p, + st: &st, + io: &io, + res: &res, + inputs: Vec::new(), + outputs: Vec::new(), + prims: Vec::new(), + mesh_stride: 0, + }) + .expect("lower"); + HostShader { + stage: HwStage::Cs, + dxil: l.dxil, + user_data: l.user_data, + samplers: l.samplers, + static_samplers: Vec::new(), + root_cbvs: l.root_cbvs, + root_srvs: l.root_srvs, + root_uavs: l.root_uavs, + root_indexed_views: res.root_indexed_views, + half_views: l.half_views, + } + }; + // v1 = first[v0] (one channel). + let load = mubuf_idxen(LOAD_FORMAT_X, 1, 0, 8); + let half = vop1(V_CVT_F32_F16, 2, vgpr(1)); + let as_halves = lowered(&[&load[..], &[half]].concat()); + assert_eq!(as_halves.half_views, [(1, 0)]); + let as_float = lowered(&[&load[..], &[vop2(V_ADD_F32, 2, vgpr(1), 1)]].concat()); + assert!(as_float.half_views.is_empty()); + // v3 = first[v0] too, read as a whole float: v2 = half(v1) + v3. + let mut beside = load.to_vec(); + beside.extend_from_slice(&mubuf_idxen(LOAD_FORMAT_X, 3, 0, 8)); + beside.push(half); + beside.push(vop2(V_ADD_F32, 2, vgpr(3), 2)); + assert!(lowered(&beside).half_views.is_empty()); + // Behind a branch, as the head program has it: where the lanes meet + // again the loaded value goes on through a phi, and a later write of + // v1 under EXEC reads it only to keep it in the lanes it leaves alone. + const SAVE_EXEC: u32 = 0xBE90_037E; // s_mov_b32 s16, exec_lo + const ONLY_LANE_0: u32 = 0x7DA4_0080; // v_cmpx_eq_u32 exec_lo, 0, v0 + const SKIP_3: u32 = 0xBF88_0003; // s_cbranch_execz over the next 3 words + const RESTORE_EXEC: u32 = 0xBEFE_0310; // s_mov_b32 exec_lo, s16 + let zero = vop1(0x01, 2, 128); // v_mov_b32 v2, 0 + let rewrite = vop1(0x01, 1, 128); // v_mov_b32 v1, 0 + let branched = lowered( + &[ + &[zero, SAVE_EXEC, ONLY_LANE_0, SKIP_3][..], + &load, + &[ + half, + RESTORE_EXEC, + SAVE_EXEC, + ONLY_LANE_0, + rewrite, + RESTORE_EXEC, + ], + ] + .concat(), + ); + assert_eq!(branched.half_views, [(1, 0)]); + // A d16 load names its place where it is the only access there... + const LOAD_FORMAT_D16_X: u32 = 0x80; + let d16 = mubuf_idxen(LOAD_FORMAT_D16_X, 1, 0, 8); + let d16_alone = lowered(&[&d16[..], &[half]].concat()); + assert_eq!(d16_alone.half_views, [(1, 0)]); + // ...and not beside a whole float read through the same place, which + // would see the unsigned twin: v2 = half(d16 v1) + v3. + let mut d16_beside = d16.to_vec(); + d16_beside.extend_from_slice(&mubuf_idxen(LOAD_FORMAT_X, 3, 0, 8)); + d16_beside.push(half); + d16_beside.push(vop2(V_ADD_F32, 2, vgpr(3), 2)); + assert!(lowered(&d16_beside).half_views.is_empty()); + if let Ok(mut v) = validator::Validator::load(validator::Validator::default_path().as_deref()) { + for shader in [&as_halves, &branched, &d16_alone] { + let mut dxil = shader.dxil.clone(); + v.validate(&mut dxil).expect("DXIL validation failed"); + } + } + // Element 0 of an R16_UINT buffer holds the half 1.0 (0x3c00). + let data = [0x0000_3c00u32, 0]; + let _one = ONE_AT_A_TIME.lock().unwrap_or_else(|e| e.into_inner()); + let mut ran = 0; + for (label, warp) in [("hardware", false), ("warp", true)] { + let Ok(host) = Host::new(warp) else { + eprintln!("no SM 6.6 {label} device; skipped"); + continue; + }; + for (name, shader) in [("straight", &as_halves), ("branched", &branched)] { + let (root, pso) = host + .compute_pipeline(shader) + .unwrap_or_else(|e| panic!("{label}: compute_pipeline failed: {e}")); + let mut ud = vec![0u32; shader.user_data_dwords().max(1) as usize]; + for u in &shader.user_data { + ud[u.index as usize] = match (u.root, u.slot) { + (RootType::Table, 1) => 0, + other => panic!("unexpected user data {other:?}"), + }; + } + let out = host + .dispatch( + &root, + &pso, + &Dispatch { + roots: vec![(0, Root::Constants(ud))], + views: &[ + View::Buffer { + data: &data, + stride: Stride::Format(DXGI_FORMAT_R16_UINT, 2), + }, + View::RawUav(1), + ], + samplers: &[], + groups: [1, 1, 1], + }, + ) + .unwrap_or_else(|e| panic!("{label}: dispatch failed: {e}")); + assert_eq!( + out[0][0], + 1.0f32.to_bits(), + "{label}, {name}: the half read as an integer's bits" + ); + } + ran += 1; + } + assert!(ran > 0, "no SM 6.6 device available"); +} diff --git a/crates/victory-shader/src/emit/waterfall_tests.rs b/crates/victory-shader/src/emit/waterfall_tests.rs index 85e2b1a..b25f684 100644 --- a/crates/victory-shader/src/emit/waterfall_tests.rs +++ b/crates/victory-shader/src/emit/waterfall_tests.rs @@ -84,6 +84,7 @@ fn build(words: &[u32], buffers: bool) -> HostShader { root_srvs: lowered.root_srvs, root_uavs: lowered.root_uavs, root_indexed_views: Vec::new(), + half_views: lowered.half_views, }; if let Ok(mut v) = validator::Validator::load(validator::Validator::default_path().as_deref()) { v.validate(&mut shader.dxil.clone()) @@ -386,6 +387,7 @@ fn immediate_sampler_chosen_by_control_flow() { root_srvs: lowered.root_srvs, root_uavs: lowered.root_uavs, root_indexed_views: Vec::new(), + half_views: Vec::new(), }; if let Ok(mut v) = validator::Validator::load(validator::Validator::default_path().as_deref()) diff --git a/crates/victory-shader/src/emit/wave64_tests.rs b/crates/victory-shader/src/emit/wave64_tests.rs index 5d1557b..f3fe382 100644 --- a/crates/victory-shader/src/emit/wave64_tests.rs +++ b/crates/victory-shader/src/emit/wave64_tests.rs @@ -142,6 +142,7 @@ fn lowered_counted( root_srvs: lowered.root_srvs, root_uavs: lowered.root_uavs, root_indexed_views: res.root_indexed_views, + half_views: lowered.half_views, }) } @@ -281,6 +282,7 @@ fn on_64_lanes(native: &NativeProgram, p: &ir::Program) -> HostShader { root_srvs: lowered.root_srvs, root_uavs: lowered.root_uavs, root_indexed_views: res.root_indexed_views, + half_views: Vec::new(), }; if let Ok(mut v) = validator::Validator::load(validator::Validator::default_path().as_deref()) { let mut copy = shader.dxil.clone(); diff --git a/scripts/play-nvidia.ps1 b/scripts/play-nvidia.ps1 index 2759108..f0b559a 100644 --- a/scripts/play-nvidia.ps1 +++ b/scripts/play-nvidia.ps1 @@ -1,26 +1,40 @@ -# Starts the title on an NVIDIA card with the Series S settings measured on an RTX 5070 (about 20-22 fps, no device loss). +# Starts the title on an NVIDIA card with the Series S settings measured on an RTX 5070 (about 18-22 fps, no device loss). # scripts\play-nvidia.ps1 -Exe # -NoSmoothMotion run target\\victory.exe itself. By default a copy named victory_sm.exe is started instead, # so a Smooth Motion profile set for that exe in the NVIDIA App applies every time. # -SeriesX the Series X profile instead (slower: about 7 fps at half scale) +# -Quality fewer stretched/jumping bodies and less rainbow skin, at about 13 fps instead of about 20 +# -RayTracing keep the title's ray-tracing passes (off by default: see below) # -Build target\diag (the default, the build all measurements are of) or target\release +# (the release build ignores the ray-tracing skip list: VICTORY_SKIP_PIPELINES is a diagnostics switch) # -More other settings: -More @{VICTORY_PANEL='1'} # Run it from a normal window, not as administrator: the driver then keeps its shader cache elsewhere. param( [Parameter(Mandatory)][string]$Exe, [switch]$NoSmoothMotion, [switch]$SeriesX, + [switch]$Quality, + [switch]$RayTracing, [ValidateSet('diag', 'release')][string]$Build = 'diag', [hashtable]$More = @{} ) $settings = @{ - # This fork's play set (scripts\play.ps1, not -Safe). - VICTORY_TEXTURE_NO_WAIT = '1'; VICTORY_RELAY = '2'; VICTORY_WIDE_BACK = '1'; VICTORY_CARD_REHASH_RUNS = '1' - VICTORY_JOIN_COPIES = '1'; VICTORY_INDIRECT_WINDOW = '1'; VICTORY_RELAY_COPY = '1'; VICTORY_CARD_STEPS = '2' + # This fork's play set (scripts\play.ps1, not -Safe): the speed set. + VICTORY_TEXTURE_NO_WAIT = '1'; VICTORY_RELAY = '2'; VICTORY_CARD_STEPS = '2' + VICTORY_WIDE_BACK = '1'; VICTORY_CARD_REHASH_RUNS = '1' + VICTORY_JOIN_COPIES = '1'; VICTORY_INDIRECT_WINDOW = '1'; VICTORY_RELAY_COPY = '1' VICTORY_INDIRECT_BATCH = '2'; VICTORY_MAP_THREADS = '1'; VICTORY_TITLE_PRIORITIES = '0'; VICTORY_CARD_AWAKE = '1' VICTORY_SHOW_AFTER = '1'; VICTORY_AMBIENT = '0.8'; VICTORY_D3D12_DRED = 'light'; VICTORY_SKIP_PIPELINES = 'none' VICTORY_THIN = '1'; VICTORY_JOIN_PARTS = '8'; VICTORY_UPLOAD_AHEAD = '1' - # Wait for new shaders rather than skip their draws (a hitch the first time a place is seen). + # Cheap picture fixes, on in both sets: + # - Overbright views: without rays the light probes keep the sky's light indoors. The fog is bounded by 1.5 times + # the light around, and what the title left by 2 times the estimate (was 4; ambient.rs). + VICTORY_AMBIENT_AIR = '1.5'; VICTORY_AMBIENT_MOST = '2' + # - Black blobs: a NaN a shader writes is made 0 before blur and the temporal upscaler spread it (emit/lower.rs). + VICTORY_NAN_SCRUB = '1' + # Wait for new shaders rather than skip their draws (a hitch the first time a place is seen). Each pipeline is + # waited for at most once (VICTORY_PIPELINE_WAIT_ONCE, on by default): one that takes longer no longer stops the + # picture in every frame it is in view (pipeline/make.rs). VICTORY_PIPELINE_WAIT_MS = '10000' # NVIDIA caps the shader-visible view heap at 1,000,000: without more dynamic slots thousands of draws a frame # are dropped (descriptor/host.rs dynamic_slots). @@ -34,6 +48,21 @@ $settings = @{ # Series S presents the interface as a second plane: laid over the game (compose.rs), else black before gameplay. VICTORY_COMPOSE = '1' } +# Ray tracing mostly off. The structure builder cannot run on NVIDIA (its 64-lane programs are refused; upstream +# Marvisak/VIctory pull request 2311), so every ray misses, and the passes that turn misses into light made rooms go +# white depending on the view angle. rt_off_hashes.txt lists the 1,000 CS_RaytracingResolve and 34 traced-shadow +# shaders, which are skipped. The screen-probe and visibility traces keep running: skipping those too left their +# outputs as garbage (rainbow glitter everywhere). +$rtList = Join-Path $PSScriptRoot 'rt_off_hashes.txt' +if (-not $RayTracing -and (Test-Path $rtList)) { + $settings.VICTORY_SKIP_PIPELINES = (Get-Content $rtList -Raw).Trim() +} +if ($Quality) { + # Stretched/jumping bodies: relay stage 1 and no card steps (avatarmanz/VIctory-7900XTX issue 13, + # fxceless/victory-fork issue 89). Rainbow skin: texture refreshes wait for the runtime's remapping. + # Costs about 7 fps (the submitting thread waits about 30 ms a frame for the card). + $settings.VICTORY_RELAY = '1'; $settings.VICTORY_CARD_STEPS = '0'; $settings.VICTORY_TEXTURE_NO_WAIT = '0' +} foreach ($k in $More.Keys) { $settings[$k] = $More[$k] } $victory = Join-Path $PSScriptRoot "..\target\$Build\victory.exe" diff --git a/scripts/rt_off_hashes.txt b/scripts/rt_off_hashes.txt new file mode 100644 index 0000000..b02eb62 --- /dev/null +++ b/scripts/rt_off_hashes.txt @@ -0,0 +1 @@ +002f8eb4802deb36,008f3e09ac72b1e0,009411de14bdaf7c,015832d72477fb26,015ccbad26579e10,019bbbc14964fa81,01a0989ded2608aa,01cceb8d45b52bf8,024fc71d30ecf62b,029e551efc53f959,02a4ed10c682ac3a,02af016b81284952,02f7c70b1180ad08,031a0cdf7eea05e4,03c593f1296c249a,03eb4074242a6013,043df98be0270424,04d46e7934e1fe24,04f90cb19f940759,0512c381f84c2ae9,05b939a0705f27ed,05ba183058112919,05d0579c2cacd393,05ef21a2132db12d,06989306fb3b54c2,069933f119b8dc40,071749f385c35640,072f5fe96efd27e1,0753e7f1ebeb1681,075e4d20a54baa28,077869cd9b1456ee,07c6ecf2f7ff4e69,0801d2ce0fa5e5e0,08ef5b2aa4d1f252,08f914eec26d44e7,091c5b9715bf60ca,0926a680fc26dcba,09361790d2954b37,09a142d26deecbba,09b0be1e60364b47,0a12de46c4d5db08,0ab92d33b2800cac,0ac6717164281c2d,0ad5f672524dbdbc,0ae69044bfd15035,0aed4662a44cdf61,0b07d50b76014236,0b3d156291158496,0bb64e3e583c4899,0bcea570530f53d9,0c0120fcb5aac198,0c3f84cfd614b0df,0cdb904653133be0,0d0e7097e89fd890,0e82ddb656aab93d,0e8ba5f65adaded2,0ee452e79fc5b98c,0efa55e3d4952b26,0f0996fee0545c14,0f0defdf30b9ba7d,0f1395e5942ca3b2,0f1ea383d368b3c9,0f5d12d14d22e848,0f6878cf07be69b5,0fbd0340052ebeb6,0fe3c05d0fc8c074,110e0d0bac2f89a9,11bb63dffff08dcc,11d153b2f0b807ee,11f60daa85075500,12277d3fe5b09f57,1261271b20a35d1b,12e375a4a2ddb4eb,12efa84143ac3f9c,12fd000b7df7f35d,1351f0efaa452416,135237a5f20fc8c4,1378934c8174f649,137de2f8a7ef881c,138715fe4ad3f11a,1459863b79e1c6c1,146934cd6e55dac6,1472200ca409949b,149cb3508b989d0e,14d57d8f0cf5f2d8,1512b6b81c4072ed,154b14f2e16015a1,154cad3e8a014898,157d961dc763b8a4,15c8f09950ba2980,164e0145dabd887d,16622000e3a30bf0,168ac102b4088dc9,16e698c250d4e48e,173eb108a2e8ad07,17abf892ce45874a,17e32bc9dbc554e2,1807bb5832825166,18406421ee8b6e8f,185fca8fe0f3c45b,18acf73cb543f66c,19c48e8df2525284,19de2179f549fd39,1a1089a18f7ff5f8,1a72961fb4e91af0,1a83504bcee28c3b,1a919da0e04bb9cc,1b0893dbeea49285,1b20028fc5fae124,1b72691c45556780,1bbf44423a524038,1be5f31a9bf45d93,1bea280ac0b0105d,1c02f8131c508c75,1c13258774db7662,1c268875ec1ae9b3,1c2888d0f2ee3578,1c6050da9b536890,1c6ca57774390d61,1c7d12f61284dde9,1cc4a387e7ab270f,1d495a6ae4665a95,1d85ce5cf0645144,1e05feba773151c1,1e0af7527af3431b,1e1d0a4971e46f74,1e225eb5a582051a,1e4947eada3d9ee3,1f55c45de66dc2c4,1f7d589e25ac7ae7,1f8e2bb1d26f9a53,1ff05fa9d6793947,2006d876c438c7f2,2007e47e566d5ca3,20117840e7be70c8,203f78efece5bbdf,209db98c2610b1f2,20ed134dfe212910,210b038b2c2a6589,2133abe5e36f8449,214d84759c294d11,21925d87ec794b3c,21976b76134eb419,2208774ed8919ab6,223451eebd6061a8,228e926c4faac818,22e10ac0ddb8bb73,22f2cc5708df88be,230256e20bfd61ab,230a91c3826aaad8,230dfb08f981ce7b,231d2daa66789312,231f97ce8c51460e,2331e6a5c3f4dc73,245c03778498b495,249d03a504be80d3,254d39dc062ccbd2,2582aab1c7e668e5,25994ba679ebf4ee,25a77d8c961f70c3,25ec3eb56b6b4711,264c19e1f1c9ae60,26c37a5db50197e6,26d721e2d277c03b,26fbf87d883e1381,2706619ccc47630b,27a41d4c85829617,27ce027e7188bed3,27d1334b3958bd4c,27f379458a4387e7,28158d322104bce2,29093f0853881fc3,291be4e50b1272f1,293ad39389e70011,2964f72e06633f7c,29b2a8ec6424f269,29be03ccaa4e353a,29cc57bb8d704fdc,2a227f58578215a1,2a49e9ee73aac24d,2a4d50f2e99ccc76,2a5bd654ed830e72,2a5cb98cf0749a82,2a948292aaf20bee,2ab2457ed7617293,2b7f74908db2fd5e,2bb02bd91627418d,2bb23624d292d127,2bf91065944bcff4,2c2cefe06f048390,2c3c2602cf51d780,2c6eff2fd3d967c3,2c8ee60bfd04125f,2cc6decf9a73aedd,2d3c50b5aff0f7fb,2d6cbd167e79f48a,2d985a6fd3ae6e5d,2de05f43518e9170,2def80b5a6667abc,2e1c7a0a104906f7,2e28ea6fb9dad3c2,2e55d67003435c14,2ec1dd27e95fdd16,2ef28b3f055cf523,2ef7ed9bfc249bff,2f12d0f639fb7ed0,30727a8e4a68fc64,310a75ecf7e2c0e6,31bc42e2ea163a1a,326652d23fe73e99,32738648a576fea0,32b601132a13cff4,32eae53ef2498b71,32ff8b2fc21b2b61,334cf8d4ab5e2968,33e4acc94ea85bab,34121970d8a2e435,345cd62173c375c7,349493bfe6b68a87,34e028869986bcaf,35256c370615e650,353b2ff8b1040ce4,355f182eb23a2ccf,356b9eb924b82c31,365a74ae25a02341,368098738d8f1936,369e1cf9bc7dc155,36a631c57b93f93b,36bcbae3c6ee20b3,371f8ece65314945,371fc6b7dad5f271,37801617a570a3c1,37d324dbc6c86d16,37d9c18c015bc7f3,380028daa2706e89,38047b50e3443232,385afa7d556e39e8,38925291c659560f,389d2a50fc6e6018,38a52b258e5d26bb,38e48f628d308bce,38e7dedf37c90130,38f64f73d01d25cb,3934246fb674f317,39613a32023e4def,398d972280d662ef,3a22184f3b17f637,3a59b63b97ad1abd,3a6594961b9247e7,3ad0a1c1e5f591d2,3b168eb06ebd1f89,3b47ec04e064477f,3b741eb770b99f1f,3b7b226a0af45f46,3b9d6c2ddaae83d8,3bc3bfd1cec35a7f,3be66cd8abe8095d,3c5edc2725a39f30,3cf8a8fc81e6458d,3d03a8a88ad6670e,3d10c5ac254b9a3d,3d547602bdedb4eb,3d7af3f375b862bd,3db6a8cd5178b215,3e0536ff12f1a0fa,3e7e04c03727b40c,3ec37174114f18dc,3fa1fda35402c93f,40769e6c239f937d,40a32233402db4cb,40a8893aaeffa08b,40be578998668a29,4121071b5398393a,41217059b1eb768a,412868f442f3638e,415285668412204e,41819a1d0f885f45,422a5efe85d59e6a,422ae0b850e3624e,42aa89d313e7188c,4342a5c16979a53f,438b12b60f5db630,439716b7afba87b0,43a9fcb6c2636c61,43c72d85c4d86ffe,44a63aac0ea89a86,44ab1bd3cd6459a6,44dfb4c9f4f58355,45d25d3d28d7248a,464f5ba0daa4d1bb,46539424133f9b74,4697ffef97840f87,46a7f7fae3d2a65c,46c25132e6d22a04,46dc6c870454c7a6,470abab5c440c9c8,476446edcac7d521,479975ca9ff7e370,482d518532477e6f,4831be51e2ddbb5b,48654f1a6ce7f688,48ecc7b4d0968151,49935789e06a9b08,49c9aea86d416b02,49f2638c5dde0b23,4a51115a275d6335,4a55d212cc63c4ad,4a94c9adf5b2a83d,4adb3993b5a32e6d,4b4661fd9113cd4a,4b89a97ed9dfbe2d,4c573a76d2eeba04,4c780a471589d843,4c939cff28c2e1d6,4ca60aafca490f58,4da404cec3b5774d,4dfd5ed22314b4ba,4e0e2e2be4aec51c,4e69dc8770bf27fc,4e7ee9410ff16d57,4e86768ecb577cf9,4eaca33ef0b5c5ac,4f0d3d0c96a754f7,4f24ef2eee54fa06,4f895b74b86ac34f,4f93dfc3d999393f,4f9e4161d703f789,5002dc855d7c1bdd,501f0865fdf45dfd,503cf21ee3992b39,50477cd6f2bd62e8,5068b601735705a4,50949ebfee9eb51d,50fe6dbe276e004f,511b165e8c6f13f1,51340b4703f0e042,514b2105ad3d15de,51529682c38a2bc1,515371262d6da9f5,517535025e084ebd,51b4b1881981e654,52018f93785d6723,523dd9fe1a846c57,52ab310c43b9f99c,52b84c47ea411af2,533ff93b7c9adbf2,535f8a954d8ec638,537522c620805a34,53dbd04f3cafb88f,5439a8ec4be90032,54c8e6597f9cb705,54db209c0e1bb317,55153ab821a66fce,55858df1827ed9d0,55f2a4d171c8eeba,569d5818db7555f3,56e546e08e2e0bf5,571bf6d258f65ed0,5746e8eb5fc789a6,57a3fad03cac36af,57a89b3e2e61ac25,57a99301636eec5a,58a085bb8210cccc,5904bb0bd887a152,592680ab38031b20,595f2141e585c320,59792d2b282b4b29,598ea65d783fa12d,5a06550bbac79916,5b07cf102c5fb661,5b47ab4f89743d00,5b9f648fb54238f9,5bb4f587ecce90c4,5c10a56026ce13dd,5c7115296f0a8c41,5c82b79526ec2376,5c9d6316a51968c5,5d061e6aed59c57d,5d14dbfb09c8184f,5d4ad8bda6371f79,5da27dcac8ccd11c,5dc7c4abc75d1545,5ddd2ca380fd74d8,5e5b5c98afaa1753,5e92d32fd0c115f1,5e98acb32ee72e90,5eb1fc8c755bca61,5ececdeb8cd235c2,5f534ee8ed14f12f,5f8cf29b763648eb,5f970e9e47594541,5fdbc49b328e81d2,60009ff452b7bb54,6043a5c6d7e9545c,604a8deeada90f0c,615e4b316a3f8294,6180e67625d71b41,61d7c3333b73892d,62d2680b4de77b54,631d7f5bc2692fd2,63cb9879559651fa,63dcd49361dd8ec4,63f30685a64914f7,64291515aee9dee9,6441aa82da422799,649850fad69f9228,64ccfcf6dbda1152,64fd06f748cfa1e1,6507b6807f522057,65080b29d91a422f,65e3b4b0759b4d0a,65f802ba40eb4a87,66404798a567d7db,664a24a19f9df45a,6741171642c93081,67c3552004aca7aa,67fb9cddcf543d91,680b9fab03f54e4f,681f89eedac269a3,687a6c8dbd8d7389,690ea04f96a14884,695febfd5efced05,69d7fb6958502e4e,6a00947adb9651a9,6a19b6c520023886,6a20509b65f9a5f1,6a608f2053e604b5,6a7b41a73fab3f66,6a7fcb54bf246310,6b5f333e886b1030,6c86597c4a6c9c5a,6ce22dd14d876fc0,6d1f1af87409128d,6debf18bceee5f8d,6e23ac3f428905c3,6ea325014572ed8d,6ecb5deb3af40c9c,6f3efe76389642cc,6f859da7a88802de,6f8ba6961490ebb5,7007ec7e2ae00712,7019cc71ca384dc7,706c4f9cb0f4cbfd,70a3734bb266ce43,70b1e13de6df8585,70e78ff3961d953a,710a6eca5746445e,71961bdd346c45f8,719796c2b324593d,71ac5a0b99a51edd,71d5752d4d13974c,71ed96a64e932f76,721c6b98cc129aa5,72ee7db2a361ed65,72f84d6cdf836fe5,72ffc690df101ebb,7364921ed673344b,738c1f4089f14c47,73cabe666a66b4ed,741a9dbb11726187,7477b30d3a90be1a,747cbfa17dd7b24d,74930ddd74e36464,74cb99ceb454f355,74d0ebdf42728160,74f02289c9df5432,7514cdc54e3c9502,755edfc1003acdc6,75835efd55ca7167,758398ef7c32ee31,759aade8ac03d23d,75cbdae3b2da61bf,7658f1433b3ee4b8,76cfc8733e521f35,77102d53e4c12acd,7722237b2d9f9568,775864f2dfc88998,775d94fa817efe16,77615112be1fc7e3,77af7adee63083f5,77b7d7f05b292d27,781855483aad9a70,781e845d3e7ddced,7855309698000643,7871917ea1ba35d6,788d85601b22821f,78be9c2cfee2766d,79547b8d831bbcb0,797b90880091722f,79d3f9f9b164ec42,79e8f0811d07f017,7a0d42aefcee50a4,7b956e1f6d56609f,7bc5a66f3fe54503,7c7c52f59ed8d8d8,7c8010dfa98a4a9e,7cb338ecaeac0aa9,7ce830739b018ff3,7d30d09632fe7230,7d3d547e81d1d118,7dcd3a412a157e2c,7e23fb9a6be471fa,7e272e404d9a61d1,7e36d2a6d7c6a341,7e39630e36c59e15,7e666b54122429fb,7ea1d4d3aca20da4,7f05ddab771799a9,7f0b6f363e03b1fb,7f4ef84f10ee483b,7f67edba322d461f,7f6c3d8d319e6d29,7fb216a0c6dee3a9,8035d76170689f4b,810e4e3cf4237f07,811ec8279c97c1f6,81a798b379f98105,81b1a23c9de4ac3e,81c7c8d1bd09a944,82d469a7fec64cb4,83547e5a9e0581a7,8374e8bd3adaa914,842de0c32bc8dcc5,848707be5ef2843c,84a06428e6e455ab,84d6f253344db38e,85499d8904c05f47,858cb9984a20a09d,8592f1d4f8035dc0,85c42c66489010c0,85df3e0b2a2e72af,86380b036b00d3fc,869415c2d19e36f6,86ec5195c2fa82af,871583f211e7dae3,871f1215f671882c,87479c005e2b4043,8777116ab8279358,87e73d580fe6a492,88d648c905124388,88ef12094a20a42c,88f6e5d9344943be,891bd7a5134bf22d,896cd6b48e0b735e,89cc3adb9b3b587e,89d4abe49e730d80,8a068d3c7bcccc01,8a13d3da7f64b8d1,8aae6058589bedbc,8aeb634cd7c272d2,8b566eecfb71cacc,8b789540787ce9b8,8ba13a8355a53b91,8c9910d177e922b6,8cb9738c65481189,8cd8c8520c791196,8cf104b72e4a464b,8d5d3f97369050bd,8d6542a554c1147a,8d7bf99583310094,8da50e10dd1d5cdf,8dc919cddcf1ee78,8ddb224ef5dd08ab,8dfdf0d1c35ecea8,8e6fe95e600f3430,8e8696b916e3b141,8e91532497eb4ddc,8eca0d5db8dc7455,8f8dd4e691330c74,901ea5039cef0f12,909600eff697581d,90b02e69b90016a6,90d8df75aee69274,9118e859d349ab3f,9211a9c1bb57341b,92646708c3651a59,92bf545af3758416,92d4fbf3c4420b32,93c727ebeb0a414e,9422aad366692af1,9453e092e33f7f9c,945faaed7eda27dd,9494f1b99c92c281,94ba76b4f1e267dd,94ca5843379047d8,94f50b5020a69895,9506d52d41abfd92,9588ffb2478b45fc,95ad77412a88f3f5,9638c0c03cca4c6c,965b1fd9c61467ee,96744a8cd6c0588f,9693500202657a6b,96f043b62d77793b,96fad987a10d2178,9730c147304b8039,974a9d7e98c8472b,97c8165dc4f77bea,9837bec0c04f3746,9898a993d4896967,98b28a028bb1ab2a,9a13e9c13c57411f,9a6eb0b35e956927,9aa51ebb679b4e36,9aa61fc93f91d095,9b1235ce3bb3d161,9b18e7f333c1d4f9,9b484cbedc2d7cfc,9b5c4b6fc3e08c7a,9baa27bb65889d34,9c077417ffd3fa41,9cdbbfa2055ac39a,9cfd9c092e1d5a97,9d180fa0ccd52a27,9d4962b03185c07b,9dc1b86497754e73,9dd28e16445d6477,9e5deb7cc4c2e068,9e644939640669fc,9e88ce6227492d86,9e93ea4abd276eb3,9edf8a8267e77699,9eeba5c4a5cc1bff,9f1e01df5796c330,9fb1ebea2c1a32d4,9fd538515af9fc60,a06f4e4a750d260a,a0a074e2d868e618,a0ce4bef0ae97c3f,a0feba02e6cf0ebb,a1266cc7391ae0d6,a17ec51447e9b9f1,a1bbb095cb9ba1c2,a2352b9e2e9687eb,a2d880ad5dea1f45,a30ae8cc148ea059,a34d8ba7899e5277,a356d933075c6552,a374b2c962e658ae,a39ae7824fe671cc,a3c8adc23ab13eb3,a3f168d1790bbff9,a4169662a3549d17,a428c56efe5410fe,a438ee47aaa88b91,a47d0bb7c7e1e8ca,a4df980a1c65fdbe,a5399b214713f180,a57b5ad32276f8c0,a5ce23ef6a443dbd,a5dcdb5ab74beaeb,a5ed733fcbc9048d,a60f2ec7c2ff300b,a62731e90739f195,a65398c11dbc32ca,a664ce85c7ed8514,a7063551ab31b18b,a73284b60aa303ed,a7aef9e157ccc7fb,a7bbeaedc8e63360,a7d9b706b3465142,a7e6e0c9658aa904,a81de501c6f6ddcd,a87c63103cbe8249,a88748f4d223a920,a97b0de6386eca68,a98b2d2aa2acfffe,a9da8d8c21873245,aa107f09071811ca,aa221f469520e809,aac91f96d7555409,aae143ad4554b35b,ab19eae07e101c34,ab2765c008e8f04e,ab82aab9b599caac,ac8b0f8a8a9e0c79,ad17f5c4f7acac25,ad1cf51b8a6c7096,ad66a7c4bb2a77d9,ad8767d2da8435b8,ada19c97379f54bc,adc76ddaa3a13d20,add2d88b887885ee,aefb9a3ccd87421f,af3033548d076333,af4285d1da44a96e,afc5e62226ffbbc0,afca4e7816c70b95,afe3fb6e266aa5d1,b01e713adfd1b66a,b0226cc73c654742,b05d94d34dca4d2b,b084beb3ae6e27e3,b0b6a2622d6e72f0,b1b90a2b3a76dbaa,b2433b5b9845e711,b24ff5260e7c73cd,b2610b50166271d1,b2a79b56df1b85a1,b2ff2ef0d6c98dd7,b33899c67f22fa73,b3642a96ba443130,b3a428c1444c8e47,b3d19bbfbe971a8b,b40b3d8b444ada08,b42133da5f18f92a,b5075976aab8a28f,b51198aeaa434f1a,b55f324fb9f9fd51,b56cb5227f57e719,b671c90cad4a71ee,b69ef139ecd3b757,b6a28de7790e0a7e,b740639a48e688c6,b74ef432b1989b12,b7a7fb5ba5934a89,b7c35ddedb2c5cc3,b7fc9aa161dbdff0,b8042ca0af2f51c7,b829a51c2c2d4551,b83683e48abab9bd,b849f3f75c47a541,b967e77f0832eab9,ba0853e333e60933,ba1d9b18a9a571c1,ba6db671f79ae2d7,bb9c70158c1e22f8,bba66bbd55cbd9a0,bc3013e09410e5b1,bc7613a38819a1f2,bd232dec3bec4319,bd2f4c284a45b3bc,bd48d109e0b65217,bd673df5f240bee5,bddfcc3248f51318,be254519c3e15f64,be85f65a58656cec,be87288ad49b521b,be91ff7eef5b7852,becf87ccd8fdc1d7,bf1a5424e1b24d5b,bff3758517ad9142,c07b4d9d12a670b8,c0b9134fa622f802,c11581d638466192,c18e21e30faad154,c1b787327704c7f3,c1c7f6c2e8d5d2a5,c1d216bbc48bc9b4,c1e947806a47ee4b,c2f48c284c426430,c2fed64ee9b4bf23,c3117eb7dc3df471,c3864e62b7ffedb6,c3cb00c582d26394,c4023b5da8f2ce0d,c41429a8461b2032,c45fe32380ec2ef4,c47848abe71e05bb,c4a6e4fcf36a2033,c59bba942079b5d6,c5a3550ade4c767e,c5bf838f820fcc2e,c5eea4706e290002,c5fc2bc7f3d416f4,c60a8cc2683470c3,c60f282e136b76c7,c629ea495ad5be01,c69690deef0df358,c723729ad62ec697,c7b5d2d6e4e79e98,c8168a63471484b5,c896e7b54e00286a,c898bcae5656e417,c8a92fb86f31447f,c8d82097d68afeae,c9158941815aee62,c985aaf507dd3152,ca20fb3e42f84692,ca27a20b691326fa,ca3962cb8c674650,cb1006bb4ef510ad,cbf484655edb8a33,ccb2ef0f61223a15,ccc6eb3a3ef3e935,cdfefd6c8bb5dddd,ce0986e922fd40d1,ce4aa8c4600d85c5,ce4cf9d5b637a014,cea6cddd5326f6f0,cf0000f4537adc5e,cf4ce294accdd428,cf6868feac4b57ba,cf9bc2ab0b87e572,cfb21609d5f6a845,cfbf210830540a52,d0130073bb6f7a7d,d03d2f08eac22af2,d06b9d11b9265d12,d07589ad1eee4789,d0e8017ad28dfe19,d159096c20e5be8d,d21ae5d0eaaac74c,d282bd3d228df25d,d295a7bb8b39cd5d,d2b073bdd272bda7,d2c52fcd936985b4,d2eeffa9f876f56a,d2f6e544053acf55,d37ee2c1b91eb44a,d3917417a4e4f05d,d3a9cedce74d91ce,d3c2bcd69864ab66,d43289c11944a7a1,d4343b9a6e4f2717,d44e7912d7c1bab1,d46dfa0a902264ca,d46f9bb80b40a33f,d4f67ba4e4e695fa,d5131e7000dad14f,d5784d991f3164ab,d5b9c94a30d7cf28,d5c18b9fbcd08f36,d5ef4f2bb16d9fa3,d66a8e12bc1b27f9,d69f75770edf6e01,d6a371025bcf7e02,d6dba265fd10bc2b,d6e3a104264dd4c6,d7792cca59ed128f,d7ad7fcacbe52893,d7eff81efdc96061,d84645aebf8dca8f,d84c0ca92452e526,d8b41c72e52111ff,d8dde91b9e50a4cc,d9075dd50b1cca09,d91b2ffb8db48ce4,d96e054e72a72ab2,d9748ab66d9903f1,d9960eda3ab4c793,d9befe585a53610f,d9c73fe683ef7785,d9efdb70d39c1c86,da441db0e9fce769,dab8612ea72ac214,db0b0fd02ddc8a93,db40744873920422,dbba7e080e26ec20,dbdad6ff83aadb1c,dbdf9f9df42b2c69,dc65695e569ab466,dc6ef2687950428a,dc901b90d0633a00,dd002690745ec22d,dd17c8da5c1cc0d5,dd18ab2b9c21b361,dd66eddf464f4bb1,de314b30ec34ee35,de4e3af66d68d980,de63a341789daddc,df1c34cb6d9dbcfa,df28ea82c24dc056,df3c6b6f46100a6e,df68734027b2d0c3,dfa0cc44b45911d6,dfeef669b85178f5,dffafa6052629c85,e05a2c1364dd1988,e09b484b7400df95,e0ba27015903a5f3,e107201b7701a928,e148ad14c65c1dfd,e14ca2879156a091,e14ff49747e43acb,e1a6549a4718256b,e1b73b0e1f8d3c72,e211ec7b25919742,e2b858e568731a51,e2bbb611de6511d4,e2d427b0b6dff0d3,e30d21f0d7cc0880,e31587e8b64a7e25,e374fb548aae0ef8,e45baebc6a72e818,e4714debf856a402,e4804e5d87537072,e4b98007c374f061,e500d9c67eb7cec1,e50ee1165aac96b3,e5742545a3591526,e5929e833978d558,e596f88f20c3ec8f,e5b42ce7dd14cc41,e5c6b41bb2adb46c,e5d41b7e3006b249,e5fca2b95c853817,e62845424338161f,e685f0080b144a9c,e6cefb06155dac34,e74c876bd581859b,e758676dd153dff5,e79b0196ae5e27d5,e79dd4bd900b4200,e81277c8be37103b,e82463dae16a79ee,e90b8dcb8b4cfc6b,e920d92582cb15f1,e932a28baa58153e,e995747c51da17f0,ea2754446fe2e1d0,ea55f4b164fa2fb0,eaeb10a22b9d6d7d,eb0472e1f9299d59,eb47e845b2cb0eba,eb62e8e10b72f527,ebd66fe3453f755d,ec5bcfd7dd20c68d,ec8170ec97875620,ec8544c3b04dde27,ec992130e4f7387e,ecd67a438c64e75d,ecdc3a46f8db7a5d,ed9df95f1d43fd4f,edd6b83325de97ca,ee0f481da4520f33,ee4c89fea116872c,ee636271b480f425,eeb352e9ab670763,ef166f5e4a1e04cc,ef9f08487c8cc9c3,efc770e7f2c27b03,efdb8133aabc37fe,f0072e7d6d922b51,f018c205b5199d39,f0641885a8311319,f09b1760a72a26af,f0afa89ecfb6944e,f0d5c40a8c448a86,f0ded3c8f537287b,f0fad1ae48adb805,f140b29a240488c8,f1690b766e32ad76,f170f74128b85209,f1914c6c99d9577d,f1d566c1e044b018,f1e90a572946abda,f26cef5385572630,f2b05cae4e26c094,f32e9279590aa073,f33e805895d6dd30,f38d99b7a22477c9,f3c00fa863debb3b,f3c50f940f5b3106,f3c72658d0a642e1,f4215fc6f4a11aa9,f429d6151c64ce9e,f447e1cda168409b,f5f8da18803c22f3,f606667fe7c6b893,f60ea2c9d69cac35,f639f0fc07d7a39b,f63bfed4d7317be1,f655d7219b8023ec,f6a0d66f51a08d1f,f6da51317fcef92e,f73607ad12ab905d,f753717509f8ea20,f770aa1780a8878e,f7a5d494c618be5d,f7abaa39145df433,f7b588a6cdd60598,f8858586452e1ae7,f90f441cc9311f33,f91ef42e5b381cb9,f93a3a0da36147c7,f96d5cb8d72d9461,f9870b59c6d3c45b,fa056dc3e38cde75,faa6852385b8d530,fb666fb12f337286,fbdcc8e04b7f68d6,fc0cd9b89adde3ab,fc0dcb1f5312423f,fc311dcf2edb1fe9,fc40d61585d7a20a,fcd45c3d0020311b,fcdd5aab1f58e5ee,fce7d2cbef0f4a24,fcf879f8a407a4a9,fd9778f48ea9e227,fdfd1675ebbd57bc,fe0c502f0ee290a7,fea276ef543c780c,feb207119a4a496c,ff26243811447aed,ffa23aec3187f880,ffa98fdac87e91cb,ffb89aac3c3bd89c,ffeb489faf8be584,0275bde6a28e48ad,08ef61b38bdc988b,1250dc0656b3c091,17829ac71aab4e8d,221925bf9ed4e06e,22f3f0f74693bff9,43ce3255529b200a,534b3645dd344ab2,693d1d787d4a22eb,7ec122fc9eedf367,813783478ebb80e6,881646f629ed5b13,9701445db7a7e2f9,9ad3577822ed8af2,a0544eac81df1fc8,a1b20bc47e3c9597,a1e563ed5a217ebb,a41f0b553a07e79d,a96bb7e19625fc8d,afeea48bbb9913ad,b1e1f8b58b12a8bb,b53dd5baea7ac7da,ba263b6ab4b6d619,c2d3fdeffa839418,c331a83aa58c3d33,d2f4f8e0e2610d8c,d4c32d1ea3b676be,d50c03da6d935d87,e8c962358d862e3f,e9c39e7efe3c508d,f656e96a62bb116b,fb515ca95d694c18,ff6a098566877642,ffd9788ba9fec033