The title's bytes under flights' writes go up by whole words (VICTORY_UNDER_WORDS=0: by bytes)
Words are pairs of one dispatch and are not counted against the 4,096 copies a submission sends up, at which it stood until the flights had landed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
ef51870ee1
commit
74005234a2
3 files changed
+40
-3
No files matched your search
@@ -30,6 +30,36 @@ pub(super) fn own() -> bool {
|
||||
/// Runs up to this many bytes go as pairs.
|
||||
const SHORT: usize = 256;
|
||||
|
||||
/// Whether a run of `len` bytes at offset `at` of a copy goes as pairs.
|
||||
fn short(at: usize, len: usize) -> bool {
|
||||
len <= SHORT && at % 4 == 0 && len % 4 == 0
|
||||
}
|
||||
|
||||
/// Whether a run of `len` bytes at offset `at` of a copy in the card's memory
|
||||
/// is no copy command of its own, but pairs of one dispatch.
|
||||
pub(crate) fn goes_as_words(at: usize, len: usize) -> bool {
|
||||
own() && short(at, len)
|
||||
}
|
||||
|
||||
/// Whether the title's bytes that go in under flights' writes
|
||||
/// (`Shadow::merge_under_writes`) go in by whole words
|
||||
/// (`VICTORY_UNDER_WORDS=0`: by the bytes that changed, as before).
|
||||
///
|
||||
/// By bytes nearly every run (a float's three low bytes) was a copy command
|
||||
/// of its own, and a submission with more than 4,096 of them stood until the
|
||||
/// flights had landed: 4 to 14 ms of a steady frame (session play-1125-0203:
|
||||
/// "more changed runs than a submission sends up"), for some 20 KB. Whole
|
||||
/// words are pairs of one dispatch, and are not counted.
|
||||
///
|
||||
/// A word is taken to be the title's or the shaders', not shared: where the
|
||||
/// title changed a byte of a word of which a flight's shader writes another
|
||||
/// byte, that byte is as it was before the flight. The landing rests on the
|
||||
/// same ([`crate::shadow::exact_back`]).
|
||||
pub(crate) fn words_under() -> bool {
|
||||
static ON: OnceLock<bool> = OnceLock::new();
|
||||
*ON.get_or_init(|| own() && std::env::var_os("VICTORY_UNDER_WORDS").is_none_or(|v| v != "0"))
|
||||
}
|
||||
|
||||
const SCATTER: &str = r#"
|
||||
#define RS "RootConstants(num32BitConstants=2, b0), SRV(t0), UAV(u0)"
|
||||
cbuffer Part : register(b0) { uint at; uint count; };
|
||||
@@ -142,7 +172,7 @@ pub(super) fn take(host: &Host, dirty: &[(std::sync::Arc<Shadow>, Vec<(usize, us
|
||||
pass(host)?;
|
||||
// Runs of whole words of the copy: only those are pairs. (A byte beside
|
||||
// them in a word may be the card's.)
|
||||
let short = |&(a, b): &(usize, usize)| b - a <= SHORT && a % 4 == 0 && b % 4 == 0;
|
||||
let short = |&(a, b): &(usize, usize)| short(a, b - a);
|
||||
let mut at = 0u64;
|
||||
let mut copies = Vec::with_capacity(dirty.len());
|
||||
for (_, ranges) in dirty {
|
||||
|
||||
Reference in new issue
Block a user