From d8b0f9abbb393f115848f457343523effb3f9907 Mon Sep 17 00:00:00 2001 From: Rhys Lloyd Date: Fri, 27 Mar 2026 15:57:17 -0700 Subject: [PATCH] rename GraphicsState to InputGenerator --- src/inference.rs | 4 ++-- src/inputs.rs | 4 ++-- src/training.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/inference.rs b/src/inference.rs index 04f2185..ffd3e73 100644 --- a/src/inference.rs +++ b/src/inference.rs @@ -26,7 +26,7 @@ impl SimulateSubcommand { use burn::prelude::*; -use crate::inputs::GraphicsState; +use crate::inputs::InputGenerator; use crate::net::{INPUT, InferenceBackend, Net}; use strafesnet_common::instruction::TimedInstruction; @@ -113,7 +113,7 @@ fn inference(gpu_id: usize, model_path: std::path::PathBuf) { ); // setup graphics - let mut g = GraphicsState::new(&map); + let mut g = InputGenerator::new(&map); // setup simulation let mut session = Session { diff --git a/src/inputs.rs b/src/inputs.rs index d6974cc..be43c3d 100644 --- a/src/inputs.rs +++ b/src/inputs.rs @@ -7,7 +7,7 @@ use crate::net::{POSITION_HISTORY, SIZE}; // bytes_per_row needs to be a multiple of 256. const STRIDE_SIZE: u32 = (SIZE.x * size_of::() as u32).next_multiple_of(256); -pub struct GraphicsState { +pub struct InputGenerator { device: wgpu::Device, queue: wgpu::Queue, graphics: strafesnet_roblox_bot_player::graphics::Graphics, @@ -16,7 +16,7 @@ pub struct GraphicsState { texture_data: Vec, position_history: Vec, } -impl GraphicsState { +impl InputGenerator { pub fn new(map: &strafesnet_common::map::CompleteMap) -> Self { let desc = wgpu::InstanceDescriptor::new_without_display_handle_from_env(); let instance = wgpu::Instance::new(desc); diff --git a/src/training.rs b/src/training.rs index 9722f69..db2b012 100644 --- a/src/training.rs +++ b/src/training.rs @@ -33,7 +33,7 @@ use burn::nn::loss::{MseLoss, Reduction}; use burn::optim::{AdamConfig, GradientsParams, Optimizer}; use burn::prelude::*; -use crate::inputs::GraphicsState; +use crate::inputs::InputGenerator; use crate::net::{INPUT, Net, OUTPUT, TrainingBackend}; use strafesnet_roblox_bot_file::v0; @@ -61,7 +61,7 @@ fn training(gpu_id: usize, epochs: usize, learning_rate: f64) { // run progressively longer segments of the map, starting very close to the end of the run and working the starting time backwards until the ai can run the whole map // set up graphics - let mut g = GraphicsState::new(&map); + let mut g = InputGenerator::new(&map); // training data let training_samples = timelines.input_events.len() - 1;