Pipelines known to take long are made beside the others, by a quarter of the workers (VICTORY_PIPELINE_SLOW=0: in the order created)
Run shaders-1, the first with a changed translator (fresh shader and pipeline caches): 3,020 pipelines started at creation, all 16 workers in programs of seconds to tens of seconds each while the title loaded (97 made in 20 s), then the quick ones at 100-190 a second, too late: 0.5-1.6 s a frame and up to 2,900 draws a frame dropped from 60 to 150 s. A pipeline that took a second is now noted (slow-pipelines.txt; `victory warm` notes them too) and waits in a list of its own. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
b7ab9c49c0
commit
a30829c4d2
3 files changed
+147
-17
No files matched your search
@@ -14,10 +14,13 @@ use victory_hle::known_pipelines as known;
|
||||
|
||||
/// Pipelines a process makes before another takes its place: the compiler's
|
||||
/// and the translations' memory goes with it.
|
||||
const AT_ONCE: usize = 200;
|
||||
const AT_ONCE: usize = 40;
|
||||
/// A pipeline that takes longer is taken for one the compiler hangs on.
|
||||
const LONGEST: Duration = Duration::from_secs(180);
|
||||
|
||||
/// As the runs count one that takes long.
|
||||
const SLOW_MS: f64 = 1000.0;
|
||||
|
||||
fn folder() -> Result<PathBuf> {
|
||||
let cfg = victory_core::Config::load()?;
|
||||
Ok(cfg.cache_subdir("shaders")?.with_file_name("pipelines"))
|
||||
@@ -69,6 +72,8 @@ pub fn run(jobs: Option<usize>, limit: Option<usize>, again: bool, used: bool, t
|
||||
let next = AtomicUsize::new(0);
|
||||
let state = Mutex::new((Vec::<f64>::new(), 0usize, 0usize));
|
||||
let done_out = Mutex::new(std::fs::OpenOptions::new().create(true).append(true).open(&done_file)?);
|
||||
// (Read back by the runs: these are made beside the others, not before.)
|
||||
let slow_out = Mutex::new(std::fs::OpenOptions::new().create(true).append(true).open(dir.join("slow-pipelines.txt"))?);
|
||||
let bad_out = Mutex::new(std::fs::OpenOptions::new().create(true).append(true).open(&bad_file)?);
|
||||
std::thread::scope(|s| {
|
||||
for _ in 0..jobs.min(chunks.len()) {
|
||||
@@ -77,6 +82,9 @@ pub fn run(jobs: Option<usize>, limit: Option<usize>, again: bool, used: bool, t
|
||||
let mut rest = chunk;
|
||||
while !rest.is_empty() {
|
||||
let (made, ended) = child(rest, |n, ms, there| {
|
||||
if ms >= SLOW_MS {
|
||||
let _ = writeln!(lock(&slow_out), "\n{} {ms:.0}", keys[n]);
|
||||
}
|
||||
let mut state = lock(&state);
|
||||
state.0.push(ms);
|
||||
state.1 += usize::from(!there);
|
||||
@@ -187,11 +195,14 @@ fn make(dir: &Path, these: &str) -> Result<()> {
|
||||
victory_hle::known_pipelines::use_translations(cfg.cache_subdir("shaders")?);
|
||||
let mut out = std::io::stdout();
|
||||
known::make(dir, &these, |n, came| {
|
||||
let _ = match came {
|
||||
let told = match came {
|
||||
None => writeln!(out, "at {n}"),
|
||||
Some((ms, there)) => writeln!(out, "made {n} {ms:.2} {}", u8::from(there)),
|
||||
};
|
||||
let _ = out.flush();
|
||||
if told.and_then(|()| out.flush()).is_err() {
|
||||
// Whoever asked is gone.
|
||||
std::process::exit(1);
|
||||
}
|
||||
});
|
||||
// Without what a run's end does (nothing to save, the host's threads).
|
||||
let _ = out.flush();
|
||||
|
||||
Reference in new issue
Block a user