stress-test add cartridge

This commit is contained in:
bQUARKz 2026-02-21 00:50:14 +00:00
parent ca40a7b939
commit 98b899c380
Signed by: bquarkz
SSH Key Fingerprint: SHA256:Z7dgqoglWwoK6j6u4QC87OveEq74WOhFN+gitsxtkf8
6 changed files with 18 additions and 15 deletions

View File

@ -8,6 +8,7 @@ pub struct TelemetryFrame {
pub cycles_budget: u64, pub cycles_budget: u64,
pub syscalls: u32, pub syscalls: u32,
pub host_cpu_time_us: u64, pub host_cpu_time_us: u64,
pub completed_logical_frames: u32,
pub violations: u32, pub violations: u32,
// GFX Banks // GFX Banks

View File

@ -321,6 +321,7 @@ impl VirtualMachineRuntime {
) as u32; ) as u32;
// Latch telemetry for the Host/Debugger to read. // Latch telemetry for the Host/Debugger to read.
self.telemetry_current.completed_logical_frames += 1;
self.telemetry_last = self.telemetry_current; self.telemetry_last = self.telemetry_current;
self.logical_frame_index += 1; self.logical_frame_index += 1;

View File

@ -214,8 +214,8 @@ impl ApplicationHandler for HostRunner {
fn resumed(&mut self, event_loop: &ActiveEventLoop) { fn resumed(&mut self, event_loop: &ActiveEventLoop) {
let attrs = WindowAttributes::default() let attrs = WindowAttributes::default()
.with_title(format!( .with_title(format!(
"PROMETEU | GFX: {:.1} KB | FPS: {:.1} | Load: {:.1}% (C) + {:.1}% (A) | Frame: tick {} logical {}", "PROMETEU | GFX: {:.1} KB | FPS: {:.1} | Load: {:.1}% (C) + {:.1}% (A) | Frame: tick {} logical {} done {}",
0.0, 0.0, 0.0, 0, 0, 0)) 0.0, 0.0, 0.0, 0, 0, 0, 0))
.with_inner_size(LogicalSize::new(960.0, 540.0)) .with_inner_size(LogicalSize::new(960.0, 540.0))
.with_min_inner_size(LogicalSize::new(320.0, 180.0)); .with_min_inner_size(LogicalSize::new(320.0, 180.0));

View File

@ -55,13 +55,14 @@ impl HostStats {
}; };
let title = format!( let title = format!(
"PROMETEU | GFX: {:.1} KB | FPS: {:.1} | Load: {:.1}% (C) + {:.1}% (A) | Frame: tick {} logical {}", "PROMETEU | GFX: {:.1} KB | FPS: {:.1} | Load: {:.1}% (C) + {:.1}% (A) | Frame: tick {} logical {} done {}",
0, 0,
self.current_fps, self.current_fps,
cpu_load_core, cpu_load_core,
cpu_load_audio, cpu_load_audio,
firmware.os.tick_index, firmware.os.tick_index,
firmware.os.logical_frame_index firmware.os.logical_frame_index,
firmware.os.telemetry_last.completed_logical_frames,
); );
window.set_title(&title); window.set_title(&title);
} }

View File

@ -10,7 +10,7 @@ pub fn generate() -> Result<()> {
let mut rom: Vec<u8> = Vec::new(); let mut rom: Vec<u8> = Vec::new();
heavy_load(&mut rom); heavy_load(&mut rom);
//light_load(&mut rom); // light_load(&mut rom);
let functions = vec![ let functions = vec![
FunctionMeta { FunctionMeta {
@ -88,7 +88,7 @@ fn heavy_load(mut rom: &mut Vec<u8>) {
// --- draw 500 discs --- // --- draw 500 discs ---
rom.extend(asm("PUSH_I32 0\nSET_LOCAL 1")); rom.extend(asm("PUSH_I32 0\nSET_LOCAL 1"));
let disc_loop_start = rom.len() as u32; let disc_loop_start = rom.len() as u32;
rom.extend(asm("GET_LOCAL 1\nPUSH_I32 500\nLT")); rom.extend(asm("GET_LOCAL 1\nPUSH_I32 500\nLT"));
let jif_disc_end_offset = rom.len() + 2; let jif_disc_end_offset = rom.len() + 2;
rom.extend(asm("JMP_IF_FALSE 0")); rom.extend(asm("JMP_IF_FALSE 0"));
@ -114,7 +114,7 @@ fn heavy_load(mut rom: &mut Vec<u8>) {
// --- draw 20 texts --- // --- draw 20 texts ---
rom.extend(asm("PUSH_I32 0\nSET_LOCAL 1")); rom.extend(asm("PUSH_I32 0\nSET_LOCAL 1"));
let text_loop_start = rom.len() as u32; let text_loop_start = rom.len() as u32;
rom.extend(asm("GET_LOCAL 1\nPUSH_I32 20\nLT")); rom.extend(asm("GET_LOCAL 1\nPUSH_I32 0\nLT"));
let jif_text_end_offset = rom.len() + 2; let jif_text_end_offset = rom.len() + 2;
rom.extend(asm("JMP_IF_FALSE 0")); rom.extend(asm("JMP_IF_FALSE 0"));
@ -170,11 +170,11 @@ fn heavy_load(mut rom: &mut Vec<u8>) {
patch(&mut rom, jif_log_offset, after_log); patch(&mut rom, jif_log_offset, after_log);
} }
// fn light_load(rom: &mut Vec<u8>) { fn light_load(rom: &mut Vec<u8>) {
// // Single function 0: main // Single function 0: main
// // Only paints Purple: 0x780F once. // Only paints Purple: 0x780F once.
// // The runtime handles calling this function repeatedly every tick. // The runtime handles calling this function repeatedly every tick.
//
// // --- clear screen (Purple 0x780F) --- // --- clear screen (Purple 0x780F) ---
// rom.extend(asm("PUSH_I32 30735\nSYSCALL 0x1010\nFRAME_SYNC\nRET")); // 30735 is 0x780F rom.extend(asm("PUSH_I32 30735\nSYSCALL 0x1010\nFRAME_SYNC\nRET")); // 30735 is 0x780F
// } }