Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions src/bin/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl Commands {
("benchmark".to_string(), None),
("mode".to_string(), Some("sprite".to_string())),
],
10000,
20000,
)),
Box::new(stress_tests::StressTest::on(
"bevymark".to_string(),
Expand All @@ -114,7 +114,7 @@ impl Commands {
("benchmark".to_string(), None),
("mode".to_string(), Some("mesh2d".to_string())),
],
5000,
10000,
)),
Box::new(stress_tests::StressTest::on(
"bevymark".to_string(),
Expand All @@ -125,7 +125,7 @@ impl Commands {
("mode".to_string(), Some("sprite_mesh".to_string())),
("alpha-mode".to_string(), Some("alpha_mask".to_string())),
],
5000,
10000,
)),
Box::new(stress_tests::StressTest::on(
"bevymark".to_string(),
Expand All @@ -136,67 +136,67 @@ impl Commands {
("mode".to_string(), Some("sprite_mesh".to_string())),
("alpha-mode".to_string(), Some("blend".to_string())),
],
5000,
10000,
)),
Box::new(stress_tests::StressTest::on(
"many_animated_sprites".to_string(),
vec![],
30000,
50000,
)),
Box::new(stress_tests::StressTest::on(
"many_buttons".to_string(),
vec![],
5000,
10000,
)),
Box::new(stress_tests::StressTest::on(
"many_cubes".to_string(),
vec![("benchmark".to_string(), None)],
15000,
20000,
)),
Box::new(stress_tests::StressTest::on(
"many_foxes".to_string(),
vec![],
15000,
30000,
)),
Box::new(stress_tests::StressTest::on(
"many_morph_targets".to_string(),
vec![],
15000,
30000,
)),
Box::new(stress_tests::StressTest::on(
"many_gizmos".to_string(),
vec![],
5000,
10000,
)),
Box::new(stress_tests::StressTest::on(
"many_glyphs".to_string(),
vec![],
10000,
15000,
)),
Box::new(stress_tests::StressTest::on(
"many_gradients".to_string(),
vec![],
20000,
40000,
)),
Box::new(stress_tests::StressTest::on(
"many_lights".to_string(),
vec![],
5000,
10000,
)),
Box::new(stress_tests::StressTest::on(
"many_materials".to_string(),
vec![],
20000,
40000,
)),
Box::new(stress_tests::StressTest::on(
"many_sprites".to_string(),
vec![],
30000,
60000,
)),
Box::new(stress_tests::StressTest::on(
"many_text2d".to_string(),
vec![],
20000,
30000,
)),
Box::new(stress_tests::StressTest::on(
"bevymark_3d".to_string(),
Expand All @@ -206,7 +206,7 @@ impl Commands {
("per-wave".to_string(), Some("200".to_string())),
("alpha-mode".to_string(), Some("blend".to_string())),
],
10000,
20000,
)),
Box::new(stress_tests::StressTest::on(
"bevymark_3d".to_string(),
Expand All @@ -216,7 +216,7 @@ impl Commands {
("per-wave".to_string(), Some("500".to_string())),
("alpha-mode".to_string(), Some("opaque".to_string())),
],
10000,
20000,
)),
Box::new(stress_tests::StressTest::on(
"bevymark_3d".to_string(),
Expand All @@ -226,7 +226,7 @@ impl Commands {
("per-wave".to_string(), Some("500".to_string())),
("alpha-mode".to_string(), Some("alpha_mask".to_string())),
],
10000,
20000,
)),
Box::new(
stress_tests::StressTest::on(
Expand Down Expand Up @@ -277,24 +277,24 @@ impl Commands {
large_scenes::LargeScene::on(
"bistro".to_string(),
vec![("compress".to_string(), None)],
25000,
30000,
)
.with_features(vec!["mipmap_generator/compress"]),
),
Box::new(large_scenes::LargeScene::on(
"bistro".to_string(),
vec![("no-mip-generation".to_string(), None)],
25000,
30000,
)),
Box::new(large_scenes::LargeScene::on(
"caldera_hotel".to_string(),
vec![],
25000,
30000,
)),
Box::new(large_scenes::LargeScene::on(
"bevy_city".to_string(),
vec![("no-cpu-culling".into(), None)],
25000,
30000,
)),
]
} else {
Expand Down
15 changes: 12 additions & 3 deletions src/metrics/large_scenes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,21 @@ impl Metrics for LargeScene {
.into_iter()
.flat_map(|f| ["--features".to_string(), f]);

let _guard = sh.push_env(
let _ = cmd!(sh, "sudo systemctl start lightdm").run();
thread::sleep(Duration::from_secs(10));

let _mangohud_guard = sh.push_env(
"MANGOHUD_CONFIG",
format!(
"output_folder={},autostart_log=10",
std::env::current_dir().unwrap().display()
),
);
let _display_guard = sh.push_env("DISPLAY", ":0");

let cmd = cmd!(
sh,
"xvfb-run mangohud cargo run --release {features...} --package {scene} -- {parameters...}"
"mangohud cargo run --release {features...} --package {scene} -- {parameters...}"
);
let mut results = HashMap::new();

Expand All @@ -158,7 +162,12 @@ impl Metrics for LargeScene {
while gpu.try_recv().is_ok() {}

let start = Instant::now();
if cmd.run().is_err() {
let cmd_result = cmd.run();

let _ = cmd!(sh, "sudo systemctl stop lightdm").run();
thread::sleep(Duration::from_secs(5));

if cmd_result.is_err() {
// ignore failure due to a missing scene
return results;
};
Expand Down
15 changes: 12 additions & 3 deletions src/metrics/stress_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,21 @@ impl Metrics for StressTest {
.into_iter()
.flat_map(|f| ["--features".to_string(), f]);

let _guard = sh.push_env(
let _ = cmd!(sh, "sudo systemctl start lightdm").run();
thread::sleep(Duration::from_secs(10));

let _mangohud_guard = sh.push_env(
"MANGOHUD_CONFIG",
format!(
"output_folder={},autostart_log=1",
std::env::current_dir().unwrap().display()
),
);
let _display_guard = sh.push_env("DISPLAY", ":0");

let cmd = cmd!(
sh,
"xvfb-run mangohud cargo run --release {features...} --example {stress_tests} -- {parameters...}"
"mangohud cargo run --release {features...} --example {stress_tests} -- {parameters...}"
);
let mut results = HashMap::new();

Expand All @@ -140,7 +144,12 @@ impl Metrics for StressTest {
while gpu.try_recv().is_ok() {}

let start = Instant::now();
let Ok(output) = cmd.output() else {
let cmd_output = cmd.output();

let _ = cmd!(sh, "sudo systemctl stop lightdm").run();
thread::sleep(Duration::from_secs(5));

let Ok(output) = cmd_output else {
// ignore failure due to a missing stress test
return results;
};
Expand Down
Loading