Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
70452ed
feat(aravath): stand and dig on one voxel island
cursoragent Oct 13, 2026
9d69211
feat(aravath): add the movement motor and the demo goals
cursoragent Oct 13, 2026
0d90ed4
feat(aravath): add a single locomotion graph
cursoragent Oct 13, 2026
fd80123
feat(aravath): add sword, shield, lock-on, and three enemies
cursoragent Oct 13, 2026
91a95f4
feat(aravath): place supported voxels and save the edit log
cursoragent Oct 13, 2026
f1f49b0
feat(aravath): stream a ring of mineable chunks around the player
cursoragent Oct 13, 2026
a7f2ead
feat(aravath): texture the ground with a CC0 Poly Haven albedo
cursoragent Oct 13, 2026
f546f58
docs(aravath): record the Windows target check
cursoragent Oct 13, 2026
6918eae
feat(aravath): replace box stand-ins with CC0 character, sword, shiel…
cursoragent Oct 13, 2026
dc1cd13
feat(aravath): drive character clips from movement and combat
cursoragent Oct 13, 2026
8750f09
feat(aravath): give the streamed world biomes, textures, and foliage
cursoragent Oct 13, 2026
2a22bdd
ci(aravath): build the greybox on windows-latest (#206)
lazyxeon Oct 13, 2026
c0be144
feat(aravath): add a combat HUD and save feedback
cursoragent Oct 13, 2026
af9787e
feat(aravath): tighten air control and give enemies a leash
cursoragent Oct 13, 2026
c053fb7
docs(aravath): note air control, mouse capture, and the enemy leash
cursoragent Oct 13, 2026
9b90269
feat(aravath): harden the sim and light it with the engine
cursoragent Oct 13, 2026
1f02064
fix(aravath): log startup failures and skip volumetrics on demand
cursoragent Oct 13, 2026
54c48d9
fix(aravath): import OsStrExt for the Windows loading paint
cursoragent Oct 13, 2026
cd03f06
fix(aravath): step the sim at a fixed 60 Hz
cursoragent Oct 14, 2026
30d45ed
fix(aravath): lock the replay hash across machines
cursoragent Oct 14, 2026
77c516a
fix(render): match WGSL uniform alignment for fog and the other share…
cursoragent Oct 14, 2026
bbef075
Add deterministic fate-scars and sample them in volumetric fog.
cursoragent Oct 14, 2026
f6dd90f
docs(aravath): point demo fiction at the Aravath lore bible
cursoragent Oct 14, 2026
3cb7494
feat(aravath): name the western hills from the internal lore brief
cursoragent Oct 14, 2026
70d92ca
fix(aravath): bound untrusted saves and drop the greybox network stack
cursoragent Oct 14, 2026
116f9e5
build(aravath): publish checksums, an SBOM, and optional Authenticode
cursoragent Oct 14, 2026
d6174bc
fix(aravath): let the Windows workflow start and leave signing unwired
cursoragent Oct 14, 2026
c8f6d48
fix(ci): retry advisory fetches and compile the Windows SDK harness
cursoragent Oct 14, 2026
e4db903
fix(ci): give cargo audit a fresh advisory database
cursoragent Oct 14, 2026
2e5d6e3
fix(ci): check out the repo before publishing the Aravath release
cursoragent Oct 14, 2026
4bfd08e
test(aw-save): lock the postcard and lz4 save bytes
cursoragent Oct 14, 2026
5347f02
fix(deps): bump rustls 0.23 to 0.23.46 and record the 0.22 residuals
cursoragent Oct 14, 2026
30cb7d4
fix(aravath): stop the black frame and the stuck mouse
cursoragent Oct 14, 2026
ca71f94
fix(ci): install libudev before the lavapipe volumetrics test
cursoragent Oct 14, 2026
bca0b3f
fix(render): drop expect from the atmosphere composite
cursoragent Oct 14, 2026
cbb8299
feat(aravath): scatter KayKit forest props on the western hills
cursoragent Oct 15, 2026
f700b60
feat(aravath): dress the greybox in the KayKit CC0 subset
cursoragent Oct 15, 2026
a87a2d3
feat(aravath): report frame time against the 11 ms budget
cursoragent Oct 15, 2026
b0de384
fix(veil): reject scar cell lists above 4096 before insert
cursoragent Oct 15, 2026
c21ce83
fix(ci): stop the greybox gate, hash, and trace-sync failures
cursoragent Oct 15, 2026
7ee34e9
fix(ci): pin Aravath actions and declare read-only workflow tokens
cursoragent Oct 15, 2026
5d63aa0
fix(ci): rustfmt the greybox Windows resource embed
cursoragent Oct 15, 2026
f692385
fix(ci): fetch Git LFS in test jobs and keep joint-matrix capacity exact
cursoragent Oct 15, 2026
2d5fab4
fix(test): generate beep wavs privately and probe depth textureLoad
cursoragent Oct 15, 2026
4794ee1
fix(lock): record aw_asset_cli's tokio dependency
cursoragent Oct 16, 2026
21db926
fix(docs): restore veil runtime edges after the weaving rebase
cursoragent Oct 16, 2026
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
Prev Previous commit
Next Next commit
feat(aravath): report frame time against the 11 ms budget
Settled streaming, seepage uploads, and repeat skinning reuse their
buffers. --frame-times prints CPU sim-and-skin percentiles against
the GTX 1660 Ti-class 11 ms budget. The play-input path is unchanged.

Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
  • Loading branch information
cursoragent and lazyxeon committed Oct 16, 2026
commit a87a2d346ba87b68744b59607011a4e604840c7b
1 change: 1 addition & 0 deletions aravath_runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ raw-window-handle = "0.6"
log = "0.4"

[dev-dependencies]
astraweave-ecs = { path = "../astraweave-ecs", features = ["alloc-counter"] }
sha2 = { workspace = true }
tempfile = "3"

Expand Down
23 changes: 17 additions & 6 deletions aravath_runtime/src/combat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,23 @@ impl Combat {
let blocking = self.blocking;
let player_body = player.body;
let hp_before = self.player_hp;
let spots: Vec<(u64, Vec3)> = self
.enemies
.iter()
.filter(|enemy| enemy.alive())
.filter_map(|enemy| body_pos(physics, enemy.body).map(|pos| (enemy.body, pos)))
.collect();
// Stack list so a settled tick does not allocate. The greybox keeps
// three foes; sixteen covers a small fight without a heap buffer.
let mut spots = [(0_u64, Vec3::ZERO); 16];
let mut spot_count = 0;
for enemy in &self.enemies {
if spot_count == spots.len() {
break;
}
if !enemy.alive() {
continue;
}
if let Some(pos) = body_pos(physics, enemy.body) {
spots[spot_count] = (enemy.body, pos);
spot_count += 1;
}
}
let spots = &spots[..spot_count];
if let Some(field) = scars.as_deref_mut() {
for enemy in &mut self.enemies {
if enemy.alive() || enemy.scarred {
Expand Down
141 changes: 113 additions & 28 deletions aravath_runtime/src/figure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
//! This module reports the hand frames they attach to. Clip maps are
//! `BTreeMap`s, and clip files are merged in sorted path order.

use std::collections::{BTreeMap, HashMap};
use std::collections::{BTreeMap, HashMap, HashSet};
use std::path::Path;

use anyhow::{Context, Result};
use astraweave_render::animation::{
compute_joint_matrices, skin_vertex_cpu, AnimationChannel, AnimationClip, ChannelData,
Interpolation, Joint, Skeleton, Transform,
compute_joint_matrices, compute_joint_matrices_into, skin_vertex_cpu, AnimationChannel,
AnimationClip, ChannelData, Interpolation, Joint, Skeleton, Transform,
};
use astraweave_render::mesh::{CpuMesh, MeshVertex};
use glam::{Mat4, Quat, Vec2, Vec3, Vec4};
Expand Down Expand Up @@ -38,6 +38,11 @@ pub struct Figure {
pub albedo: Option<crate::props::Rgba>,
pub hand_l: usize,
pub hand_r: usize,
locals: Vec<Transform>,
world: Vec<Mat4>,
skin_matrices: Vec<Mat4>,
visited: HashSet<usize>,
posed: Vec<PosedPrimitive>,
}

impl Figure {
Expand Down Expand Up @@ -190,6 +195,11 @@ impl Figure {
albedo: crate::props::rgba_from_images(&images),
hand_l,
hand_r,
locals: Vec::new(),
world: Vec::new(),
skin_matrices: Vec::new(),
visited: HashSet::new(),
posed: Vec::new(),
})
}

Expand Down Expand Up @@ -273,38 +283,88 @@ impl Figure {
self.clips.get(name)
}

pub fn skin(&self, clip_name: &str, time: f32) -> Result<Vec<PosedPrimitive>> {
pub fn skin(&mut self, clip_name: &str, time: f32) -> Result<Vec<PosedPrimitive>> {
self.skin_at(clip_name, time, true)
}

pub fn skin_at(
&self,
&mut self,
clip_name: &str,
time: f32,
looping: bool,
) -> Result<Vec<PosedPrimitive>> {
let locals = self.locals_at(clip_name, time, looping)?;
let joints = compute_joint_matrices(&self.skeleton, &locals)?;
let mut posed = Vec::new();
self.skin_into(clip_name, time, looping)?;
Ok(self.posed.clone())
}

/// Pose into this figure's buffers. The first call sizes them. Later calls
/// with the same mesh do not allocate.
pub fn skin_into(&mut self, clip_name: &str, time: f32, looping: bool) -> Result<()> {
let duration = self
.clips
.get(clip_name)
.with_context(|| format!("missing clip {clip_name}"))?
.duration
.max(0.001);
let sample_time = if looping {
time.rem_euclid(duration)
} else {
time.clamp(0.0, duration - 0.001)
};
self.ensure_posed();
{
let Figure {
clips,
skeleton,
locals,
..
} = &mut *self;
let clip = clips
.get(clip_name)
.with_context(|| format!("missing clip {clip_name}"))?;
clip.sample_into(sample_time, skeleton, locals);
}
compute_joint_matrices_into(
&self.skeleton,
&self.locals,
&mut self.world,
&mut self.skin_matrices,
&mut self.visited,
)?;
write_skinned(&self.primitives, &mut self.posed, &self.skin_matrices);
Ok(())
}

pub fn posed(&self) -> &[PosedPrimitive] {
&self.posed
}

/// Hand joints from the last [`Self::skin_into`] call.
pub fn hand_frames_posed(&self) -> (Mat4, Mat4) {
(
joint_world(&self.skeleton, &self.skin_matrices, self.hand_l),
joint_world(&self.skeleton, &self.skin_matrices, self.hand_r),
)
}

fn ensure_posed(&mut self) {
if self.posed.len() == self.primitives.len()
&& self
.posed
.iter()
.zip(self.primitives.iter())
.all(|(posed, primitive)| posed.mesh.vertices.len() == primitive.vertices.len())
{
return;
}
self.posed.clear();
for primitive in &self.primitives {
let mut vertices = Vec::with_capacity(primitive.vertices.len());
for vertex in &primitive.vertices {
let (position, normal) = skin_vertex_cpu(
vertex.position,
vertex.normal,
vertex.joints,
vertex.weights,
&joints,
);
let tangent = normal.cross(Vec3::Y).normalize_or_zero();
vertices.push(MeshVertex::new(
position,
normal,
Vec4::new(tangent.x, tangent.y, tangent.z, 1.0),
vertex.uv,
));
}
posed.push(PosedPrimitive {
let vertices = primitive
.vertices
.iter()
.map(|vertex| MeshVertex::new(vertex.position, vertex.normal, Vec4::X, vertex.uv))
.collect();
self.posed.push(PosedPrimitive {
mesh: CpuMesh {
vertices,
indices: primitive.indices.clone(),
Expand All @@ -314,7 +374,6 @@ impl Figure {
color: primitive.color,
});
}
Ok(posed)
}

pub fn hand_positions(&self, clip_name: &str, time: f32) -> Result<(Vec3, Vec3)> {
Expand Down Expand Up @@ -365,6 +424,7 @@ impl Figure {
}
}

#[derive(Clone)]
pub struct PosedPrimitive {
pub mesh: CpuMesh,
pub color: [f32; 4],
Expand Down Expand Up @@ -392,6 +452,31 @@ fn joint_named(skeleton: &Skeleton, name: &str) -> Option<usize> {
skeleton.joints.iter().position(|joint| joint.name == name)
}

fn write_skinned(primitives: &[Primitive], posed: &mut [PosedPrimitive], joints: &[Mat4]) {
for (primitive, posed) in primitives.iter().zip(posed.iter_mut()) {
for (vertex, out) in primitive
.vertices
.iter()
.zip(posed.mesh.vertices.iter_mut())
{
let (position, normal) = skin_vertex_cpu(
vertex.position,
vertex.normal,
vertex.joints,
vertex.weights,
joints,
);
let tangent = normal.cross(Vec3::Y).normalize_or_zero();
*out = MeshVertex::new(
position,
normal,
Vec4::new(tangent.x, tangent.y, tangent.z, 1.0),
vertex.uv,
);
}
}
}

fn joint_world(skeleton: &Skeleton, skin: &[Mat4], index: usize) -> Mat4 {
skin[index] * skeleton.joints[index].inverse_bind_matrix.inverse()
}
Expand Down Expand Up @@ -453,7 +538,7 @@ mod tests {

#[test]
fn library_has_locomotion_and_combat_clips() {
let figure = Figure::load_knight().unwrap();
let mut figure = Figure::load_knight().unwrap();
for name in [
"Idle_A",
"Walking_A",
Expand Down
88 changes: 88 additions & 0 deletions aravath_runtime/src/frame_budget.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
//! CPU frame times against the GTX 1660 Ti-class budget.
//!
//! The number is the whole frame the demo is allowed on that class of GPU.
//! `--frame-times` measures the runtime's own sim-and-skin work and prints
//! this budget beside it. A software adapter is not that GPU.

/// Whole-frame budget for a GTX 1660 Ti-class baseline.
pub const FRAME_BUDGET_MS: f64 = 11.0;

pub const BASELINE: &str = "GTX 1660 Ti-class";

#[derive(Clone, Debug, PartialEq)]
pub struct FrameReport {
pub count: usize,
pub min_ms: f64,
pub p50_ms: f64,
pub p95_ms: f64,
pub max_ms: f64,
}

impl FrameReport {
pub fn from_nanos(samples: &[u128]) -> Self {
if samples.is_empty() {
return Self {
count: 0,
min_ms: 0.0,
p50_ms: 0.0,
p95_ms: 0.0,
max_ms: 0.0,
};
}
let mut ordered: Vec<u128> = samples.to_vec();
ordered.sort_unstable();
let at = |fraction: f64| {
let index = ((ordered.len() - 1) as f64 * fraction).round() as usize;
nanos_to_ms(ordered[index])
};
Self {
count: ordered.len(),
min_ms: nanos_to_ms(ordered[0]),
p50_ms: at(0.50),
p95_ms: at(0.95),
max_ms: nanos_to_ms(*ordered.last().unwrap_or(&0)),
}
}

pub fn inside_budget(&self) -> bool {
self.count > 0 && self.p95_ms < FRAME_BUDGET_MS
}
}

pub fn nanos_to_ms(nanos: u128) -> f64 {
nanos as f64 / 1_000_000.0
}

pub fn budget_line(report: &FrameReport) -> String {
let word = if report.inside_budget() {
"inside budget"
} else {
"over budget"
};
format!(
"cpu frame n={} min {:.3} ms p50 {:.3} ms p95 {:.3} ms max {:.3} ms against {:.3} ms {BASELINE}: {word}",
report.count, report.min_ms, report.p50_ms, report.p95_ms, report.max_ms, FRAME_BUDGET_MS
)
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn ten_milliseconds_is_inside_the_1660_ti_budget() {
let samples = vec![10_000_000_u128; 20];
let report = FrameReport::from_nanos(&samples);
assert!(report.inside_budget());
assert!((report.p95_ms - 10.0).abs() < 1e-6);
assert!(budget_line(&report).contains("inside budget"));
assert!(budget_line(&report).contains("11.000"));
}

#[test]
fn twelve_milliseconds_misses_the_budget() {
let report = FrameReport::from_nanos(&[12_000_000]);
assert!(!report.inside_budget());
assert!(budget_line(&report).contains("over budget"));
}
}
9 changes: 9 additions & 0 deletions aravath_runtime/src/ground.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ pub struct Ground {
bodies: HashMap<ChunkCoord, u64>,
generated: HashSet<ChunkCoord>,
scatter: HashMap<ChunkCoord, Vec<PropSpot>>,
/// Chunk the ring was built around, plus the radius. A settled player
/// whose grid is clean skips the set rebuild.
stream_key: Option<(i32, i32, i32, i32)>,
}

#[derive(Clone, Debug)]
Expand All @@ -83,6 +86,7 @@ impl Ground {
bodies: HashMap::new(),
generated: HashSet::new(),
scatter: HashMap::new(),
stream_key: None,
}
}

Expand All @@ -99,6 +103,10 @@ impl Ground {
radius: i32,
) -> Vec<ChunkUpload> {
let center = ChunkCoord::from_world_pos(Vec3::new(focus.x, 0.0, focus.z));
let key = (center.x, center.y, center.z, radius);
if self.stream_key == Some(key) && self.grid.dirty_chunks().is_empty() {
return Vec::new();
}
let mut keep = HashSet::new();
for dz in -radius..=radius {
for dx in -radius..=radius {
Expand Down Expand Up @@ -140,6 +148,7 @@ impl Ground {
}
let mut uploads = self.sync_dirty(physics);
uploads.extend(removed);
self.stream_key = Some(key);
uploads
}

Expand Down
1 change: 1 addition & 0 deletions aravath_runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub mod bridge_agent;
pub mod combat;
pub mod detmath;
pub mod figure;
pub mod frame_budget;
pub mod ground;
pub mod hud;
pub mod island;
Expand Down
Loading