-
Notifications
You must be signed in to change notification settings - Fork 1
devcontainer: VS Code container with Rust stable+MSRV, Node 20, gh CLI #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
cbc0242
8832650
a086c56
c9ccd6e
025ede8
7f4188b
6938f00
9862678
7756121
80b7ede
9d1a355
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| { | ||
| "name": "echo-dev", | ||
| "image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04", | ||
| "features": { | ||
| "ghcr.io/devcontainers/features/common-utils:2": { | ||
| "username": "vscode", | ||
| "installZsh": false | ||
| }, | ||
| "ghcr.io/devcontainers/features/rust:1": { | ||
| "version": "1.90", | ||
| "profile": "minimal", | ||
| "components": ["rustfmt", "clippy"] | ||
| }, | ||
| "ghcr.io/devcontainers/features/node:1": { | ||
| "version": "20" | ||
| }, | ||
| "ghcr.io/devcontainers/features/github-cli:1": {} | ||
| }, | ||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "rust-lang.rust-analyzer", | ||
| "serayuzgur.crates", | ||
| "tamasfe.even-better-toml", | ||
| "vadimcn.vscode-lldb" | ||
| ] | ||
| } | ||
| }, | ||
| "mounts": [ | ||
| "source=devcontainer-cargo-cache,target=/usr/local/cargo,type=volume", | ||
| "source=devcontainer-rustup-cache,target=/usr/local/rustup,type=volume" | ||
| ], | ||
| "containerEnv": { | ||
| "CARGO_TERM_COLOR": "always" | ||
| }, | ||
| "overrideCommand": false, | ||
| "postCreateCommand": "/bin/bash .devcontainer/post-create.sh" | ||
| } | ||
|
|
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,19 @@ | ||||||||||
| #!/usr/bin/env bash | ||||||||||
| set -euo pipefail | ||||||||||
|
|
||||||||||
| echo "[devcontainer] Installing MSRV toolchain (1.68.0) and common targets..." | ||||||||||
| if ! command -v rustup >/dev/null 2>&1; then | ||||||||||
| curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail https://sh.rustup.rs | sh -s -- --default-toolchain none -y | ||||||||||
| export PATH="$HOME/.cargo/bin:$PATH" | ||||||||||
| fi | ||||||||||
|
|
||||||||||
| rustup toolchain install 1.68.0 --profile minimal | ||||||||||
| rustup default stable | ||||||||||
| rustup component add rustfmt clippy | ||||||||||
| rustup target add wasm32-unknown-unknown | ||||||||||
|
|
||||||||||
| echo "[devcontainer] Priming cargo registry cache (optional)..." | ||||||||||
| cargo fetch || true | ||||||||||
|
Comment on lines
+15
to
+16
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
You're swallowing ALL exit codes from Either remove the echo "[devcontainer] Priming cargo registry cache (optional)..."
-cargo fetch || true
+cargo fetch || echo "[devcontainer] WARNING: cargo fetch failed; dependencies may be fetched on first build" >&2📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
|
|
||||||||||
| echo "[devcontainer] Done. Run 'cargo test -p rmg-core' or 'make ci-local' to validate." | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainReferences potentially non-existent You're telling users to run Verify the target exists or update the message: 🏁 Script executed: #!/bin/bash
# Check if make ci-local target exists
if [ -f Makefile ]; then
grep -q "^ci-local:" Makefile && echo "Target exists" || echo "Target missing"
else
echo "No Makefile found"
fiLength of output: 14 Fix the broken Your devcontainer post-create message tells users to run a make target that doesn't exist. The target verification came back negative, confirming the reviewer's concern. Either remove the reference from the message or actually add the Update line 18 in BunBun 🤖 Prompt for AI Agents |
||||||||||
|
|
||||||||||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ | |
| /// - Zero (`TxId(0)`) is reserved as invalid. [`crate::Engine::begin`] never returns zero. | ||
| /// - External callers using [`TxId::from_raw`] must not construct `TxId(0)` unless | ||
| /// they have a valid reason (e.g., sentinel in FFI); using invalid ids with engine | ||
| /// operations returns [`EngineError::UnknownTx`]. | ||
| /// operations returns [`crate::engine_impl::EngineError::UnknownTx`]. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainVerify the module path for The rustdoc comment references 🏁 Script executed: #!/bin/bash
# Verify the EngineError type and UnknownTx variant exist in the engine_impl module
ast-grep --pattern 'enum EngineError { $$$ UnknownTx $$$ }'
rg -n 'mod engine_impl' crates/rmg-core/src/
rg -n 'pub.*EngineError' crates/rmg-core/src/Length of output: 429 I need to examine the full 🏁 Script executed: #!/bin/bash
# Extract the EngineError enum definition
sed -n '26,100p' crates/rmg-core/src/engine_impl.rsLength of output: 77 Length of output: 2269 🏁 Script executed: #!/bin/bash
# Also check the tx.rs file to see the exact comment
sed -n '10,20p' crates/rmg-core/src/tx.rsLength of output: 724 🏁 Script executed: #!/bin/bash
# Search for UnknownTx variant in the codebase
rg 'UnknownTx' crates/rmg-core/src/Length of output: 552 Use the public re-export path in rustdoc references. The Change line 15 in crates/rmg-core/src/tx.rs from: to: — From: Linus Torvalds torvalds@linux-foundation.org Look, the path technically resolves, but you're bypassing the entire reason we have public re-exports. This isn't even a style thing—it's about readers seeing the actual public API. Don't bury it under internal module names. Fix it. BunBun 🤖 Prompt for AI Agents |
||
| /// | ||
| /// The `#[repr(transparent)]` attribute ensures FFI ABI compatibility: `TxId` has | ||
| /// the same memory layout as `u64` across the FFI/Wasm boundary. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| [package] | ||
| name = "rmg-geom" | ||
| version = "0.1.0" | ||
| edition = "2021" | ||
| description = "Echo geometry primitives: AABB, transforms, temporal proxies, and broad-phase scaffolding" | ||
| license = "Apache-2.0" | ||
| repository = "https://example.invalid/echo" | ||
| readme = "../../README.md" | ||
| keywords = ["echo", "geometry", "aabb", "broad-phase"] | ||
| categories = ["game-engines", "data-structures"] | ||
|
|
||
| [dependencies] | ||
| rmg-core = { path = "../rmg-core" } | ||
|
|
||
| #[dev-dependencies] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| #![deny( | ||
| warnings, | ||
| clippy::all, | ||
| clippy::pedantic, | ||
| rust_2018_idioms, | ||
| missing_docs, | ||
| clippy::unwrap_used, | ||
| clippy::expect_used, | ||
| clippy::panic | ||
| )] | ||
| #![doc = r"Geometry primitives for Echo. | ||
|
|
||
| This crate provides: | ||
| - Axis-aligned bounding boxes (`Aabb`). | ||
| - Rigid transforms (`Transform`). | ||
| - Temporal utilities (`Tick`, `TemporalTransform`, `TemporalProxy`). | ||
| - A minimal broad-phase trait and an AABB-based pairing structure. | ||
|
|
||
| Design notes: | ||
| - Deterministic: no ambient RNG; ordering of pair outputs is canonical. | ||
| - Float32 throughout; operations favor clarity and reproducibility. | ||
| - Rustdoc is treated as part of the contract; public items are documented. | ||
| "] | ||
|
|
||
| /// Foundational geometric types. | ||
| pub mod types; | ||
| /// Time-aware utilities for broad-phase and motion. | ||
| pub mod temporal; | ||
| // Broad-phase will land in a follow-up PR. | ||
| // pub mod broad; | ||
|
|
||
| pub use types::aabb::Aabb; | ||
| pub use types::transform::Transform; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| //! Temporal types and helpers used for tick-based motion and broad-phase. | ||
|
|
||
| #[doc = "Discrete Chronos ticks (u64 newtype)."] | ||
| pub mod tick; | ||
| #[doc = "Start/end transforms over a tick and fat AABB computation."] | ||
| pub mod temporal_transform; | ||
| #[doc = "Broad-phase proxy carrying entity id, tick, and fat AABB."] | ||
| pub mod temporal_proxy; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| use crate::temporal::tick::Tick; | ||
| use crate::types::aabb::Aabb; | ||
|
|
||
| /// Broad-phase proxy summarizing an entity’s motion window for a tick. | ||
| /// | ||
| /// Stores a conservative fat AABB and the owning `entity` identifier (opaque | ||
| /// to the geometry layer). The proxy is suitable for insertion into a broad- | ||
| /// phase accelerator. | ||
| #[derive(Debug, Copy, Clone, PartialEq)] | ||
| pub struct TemporalProxy { | ||
| entity: u64, | ||
| tick: Tick, | ||
| fat: Aabb, | ||
| } | ||
|
|
||
| impl TemporalProxy { | ||
| /// Creates a new proxy for `entity` at `tick` with precomputed `fat` AABB. | ||
| #[must_use] | ||
| pub const fn new(entity: u64, tick: Tick, fat: Aabb) -> Self { Self { entity, tick, fat } } | ||
|
|
||
| /// Opaque entity identifier owning this proxy. | ||
| #[must_use] | ||
| pub const fn entity(&self) -> u64 { self.entity } | ||
|
|
||
| /// Tick associated with the motion window. | ||
| #[must_use] | ||
| pub const fn tick(&self) -> Tick { self.tick } | ||
|
|
||
| /// Conservative fat AABB for this proxy. | ||
| #[must_use] | ||
| pub const fn fat(&self) -> Aabb { self.fat } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| use crate::types::{aabb::Aabb, transform::Transform}; | ||
|
|
||
| /// Transform at two adjacent ticks used to bound motion in the broad-phase. | ||
| /// | ||
| /// - `start` corresponds to tick `n`. | ||
| /// - `end` corresponds to tick `n+1`. | ||
| /// | ||
| /// Determinism and plan: | ||
| /// - `fat_aabb` below currently uses a union of the start/end AABBs. This is | ||
| /// conservative for linear motion and sufficient for pairing/CCD triggers. | ||
| /// - Future: introduce a quantized margin policy (based on velocity, `dt`, and | ||
| /// shape scale) so that fat proxies are identical across peers/branches. The | ||
| /// policy and quantization will be recorded in the graph/spec. | ||
| #[derive(Debug, Copy, Clone, PartialEq)] | ||
| pub struct TemporalTransform { | ||
| start: Transform, | ||
| end: Transform, | ||
| } | ||
|
|
||
| impl TemporalTransform { | ||
| /// Creates a new `TemporalTransform` from start and end transforms. | ||
| #[must_use] | ||
| pub const fn new(start: Transform, end: Transform) -> Self { Self { start, end } } | ||
|
|
||
| /// Returns the start transform. | ||
| #[must_use] | ||
| pub const fn start(&self) -> Transform { self.start } | ||
|
|
||
| /// Returns the end transform. | ||
| #[must_use] | ||
| pub const fn end(&self) -> Transform { self.end } | ||
|
|
||
| /// Computes a conservative fat AABB for a collider with local-space `shape` AABB. | ||
| /// | ||
| /// The fat box is defined as the union of the shape’s AABBs at the start and | ||
| /// end transforms. This is conservative for linear motion and suffices for | ||
| /// broad-phase pairing and CCD triggering. | ||
| #[must_use] | ||
| pub fn fat_aabb(&self, shape: &Aabb) -> Aabb { | ||
| let a0 = shape.transformed(&self.start.to_mat4()); | ||
| let a1 = shape.transformed(&self.end.to_mat4()); | ||
| a0.union(&a1) | ||
|
Comment on lines
+33
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Useful? React with 👍 / 👎. |
||
| } | ||
| } | ||
|
Comment on lines
+1
to
+44
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CRITICAL: Still not running cargo fmt, I see. Three files in a row with formatting failures. Do you not have a pre-commit hook? Do you not run CI locally? This is basic hygiene and you're failing at it spectacularly. #!/bin/bash
cargo fmt -- crates/rmg-geom/src/temporal/temporal_transform.rsBunBun 🧰 Tools🪛 GitHub Actions: CI[error] 1-1: cargo fmt --check failed: rustfmt would reformatted code in temporal_transform.rs. Run 'cargo fmt' to fix formatting. 🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /// Discrete simulation tick in Chronos time. | ||
| /// | ||
| /// The engine advances in integer ticks with a fixed `dt` per branch. This | ||
| /// newtype ensures explicit tick passing across APIs. | ||
| #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] | ||
| pub struct Tick { | ||
| index: u64, | ||
| } | ||
|
|
||
| impl Tick { | ||
| /// Creates a new tick with the given index. | ||
| #[must_use] | ||
| pub const fn new(index: u64) -> Self { Self { index } } | ||
|
|
||
| /// Returns the tick index. | ||
| #[must_use] | ||
| pub const fn index(&self) -> u64 { self.index } | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fragile rustup installation flow.
If
rustupis not found, you install it but only export PATH in the current shell context. If the curl succeeds but the install script fails silently (wrong arch, permissions, whatever), subsequentrustupcommands will blow up with cryptic errors. Plus, you're not verifying the installation actually worked.Add explicit verification:
📝 Committable suggestion
🤖 Prompt for AI Agents