From 6c3a48fb52a02f33ff2823b69357d2d5f44efe94 Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Tue, 11 Nov 2025 00:47:40 +0000 Subject: [PATCH 1/2] chore: Remove trailing whitespace (#129) Switch to the convention of using no trailing whitespace, even on blank lines. Also remove some unintended trailing whitespace on non-blank lines and fix a few typos. Co-authored-by: Aaron Fenyes Reviewed-on: https://code.studioinfinity.org/StudioInfinity/dyna3/pulls/129 Reviewed-by: Vectornaut Co-authored-by: Glen Whitney Co-committed-by: Glen Whitney --- .forgejo/setup-trunk/action.yaml | 2 +- .../workflows/continuous-integration.yaml | 4 +- README.md | 6 +- app-proto/examples/irisawa-hexlet.rs | 4 +- app-proto/examples/kaleidocycle.rs | 4 +- app-proto/index.html | 2 +- app-proto/src/assembly.rs | 163 +++++++++--------- app-proto/src/components/diagnostics.rs | 30 ++-- app-proto/src/components/display.rs | 160 ++++++++--------- app-proto/src/components/outline.rs | 16 +- app-proto/src/components/point.frag | 4 +- app-proto/src/components/point.vert | 6 +- app-proto/src/components/spheres.frag | 24 +-- .../src/components/test_assembly_chooser.rs | 88 +++++----- app-proto/src/engine.rs | 136 +++++++-------- app-proto/src/main.rs | 8 +- app-proto/src/specified.rs | 6 +- notes/inversive.md | 4 +- notes/theory.md | 6 +- src/index.html | 2 - 20 files changed, 335 insertions(+), 340 deletions(-) diff --git a/.forgejo/setup-trunk/action.yaml b/.forgejo/setup-trunk/action.yaml index 6007527..85e8a31 100644 --- a/.forgejo/setup-trunk/action.yaml +++ b/.forgejo/setup-trunk/action.yaml @@ -10,7 +10,7 @@ runs: using: "composite" steps: - run: rustup target add wasm32-unknown-unknown - + # install the Trunk binary to `ci-bin` within the workspace directory, which # is determined by the `github.workspace` label and reflected in the # `GITHUB_WORKSPACE` environment variable. then, make the `trunk` command diff --git a/.forgejo/workflows/continuous-integration.yaml b/.forgejo/workflows/continuous-integration.yaml index f3b0130..6b53b3a 100644 --- a/.forgejo/workflows/continuous-integration.yaml +++ b/.forgejo/workflows/continuous-integration.yaml @@ -24,6 +24,6 @@ jobs: # workspace directory (action variable `github.workspace`, environment # variable `$GITHUB_WORKSPACE`): - uses: https://code.forgejo.org/actions/checkout@v4 - + - uses: ./.forgejo/setup-trunk - - run: RUSTFLAGS='-D warnings' cargo test \ No newline at end of file + - run: RUSTFLAGS='-D warnings' cargo test diff --git a/README.md b/README.md index ac2771b..16b0d35 100644 --- a/README.md +++ b/README.md @@ -52,20 +52,20 @@ The latest prototype is in the folder `app-proto`. It includes both a user inter 1. Use `sh` to run the script `tools/run-examples.sh`. - The script is location-independent, so you can do this from anywhere in the dyna3 repository. - The call from the top level of the repository is: - + ```bash sh tools/run-examples.sh ``` - For each example problem, the engine will print the value of the loss function at each optimization step. - The first example that prints is the same as the Irisawa hexlet example from the Julia version of the engine prototype. If you go into `engine-proto/gram-test`, launch Julia, and then execute - + ```julia include("irisawa-hexlet.jl") for (step, scaled_loss) in enumerate(history_alt.scaled_loss) println(rpad(step-1, 4), " | ", scaled_loss) end ``` - + you should see that it prints basically the same loss history until the last few steps, when the lower default precision of the Rust engine really starts to show. ### Run the automated tests diff --git a/app-proto/examples/irisawa-hexlet.rs b/app-proto/examples/irisawa-hexlet.rs index 0d710ff..d7dd5fc 100644 --- a/app-proto/examples/irisawa-hexlet.rs +++ b/app-proto/examples/irisawa-hexlet.rs @@ -15,9 +15,9 @@ fn main() { for k in 4..9 { println!(" {} sun", 1.0 / config[(3, k)]); } - + // print the completed Gram matrix print::gram_matrix(&config); } print::loss_history(&realization.history); -} \ No newline at end of file +} diff --git a/app-proto/examples/kaleidocycle.rs b/app-proto/examples/kaleidocycle.rs index ae4eb07..4a9ad7e 100644 --- a/app-proto/examples/kaleidocycle.rs +++ b/app-proto/examples/kaleidocycle.rs @@ -14,7 +14,7 @@ fn main() { // print the completed Gram matrix and the realized configuration print::gram_matrix(&config); print::config(&config); - + // find the kaleidocycle's twist motion by projecting onto the tangent // space const N_POINTS: usize = 12; @@ -29,4 +29,4 @@ fn main() { let normalization = 5.0 / twist_motion[(2, 0)]; println!("\nTwist motion:{}", (normalization * twist_motion).to_string().trim_end()); } -} \ No newline at end of file +} diff --git a/app-proto/index.html b/app-proto/index.html index 4fbe52f..c312b51 100644 --- a/app-proto/index.html +++ b/app-proto/index.html @@ -6,7 +6,7 @@ - +