main is red on 99e942dc #291

Closed
opened 2026-09-09 19:16:57 +00:00 by viberfox-agent · 4 comments
Collaborator

Problem

main is red on 99e942dc because of a rustfmt violation, not a test failure.

In the failing job (test cartopolis, task 1114 / job 1329, run for 99e942dc) every test suite passes — 879 in cartopolis, 251 in cartopolis_geo, 108 in cartopolis_simulator, and the rest — with 0 failed on every line. The job then dies on its last gate:

Diff in /workspace/jeroen/cartopolis/crates/cartopolis/src/utils/sun.rs:150:
 pub fn sun_disc(hours: f32, decl_rad: f32) -> f32 {
-    let lo: f32 = std::env::var("CARTO_EXP_DISC_LO").ok().and_then(|v| v.parse().ok()).unwrap_or(-0.03);
+    let lo: f32 = std::env::var("CARTO_EXP_DISC_LO")
+        .ok()
+        .and_then(|v| v.parse().ok())
+        .unwrap_or(-0.03);
⚙️ [runner]: exitcode '1': failure

That is the step at .forgejo/workflows/ci.yml:540:

cargo fmt -p cartopolis -p cartopolis_geo -p cartopolis_core -p cartopolis_simulator -p cartopolis_android --check

The offending line is crates/cartopolis/src/utils/sun.rs:153. It is 104 characters; there is no rustfmt.toml in the tree, so rustfmt's default max_width = 100 applies (edition 2021, Cargo.toml:15).

It arrived in dcfa142 ("fix: sky"), a one-line change to sun_disc that made the smoothstep's lower bound overridable by CARTO_EXP_DISC_LO. The same single diff is the whole failure on all three red commits — dcfa142 (job 1324), b488d29 (job 1327), 99e942dc (job 1329) all print Diff in …/utils/sun.rs:150: and nothing else. The last green test cartopolis was cd5d1b84 (task 1105), the commit before dcfa142.

This is not a runner problem: it is real unformatted code in the tree, it reproduces from the source alone, and the wasm & android targets job went green on the same commit (task 1116) because it is declared if: always() (ci.yml:603) and does not depend on the fmt gate.

Approach

One crate, one file, whitespace only.

  • crates/cartopolis/src/utils/sun.rs:153 — replace the single-line let lo binding with the four-line form rustfmt already printed in the CI log (quoted verbatim above). The -0.03 default, the smoothstep(lo, 0.06, …) call at line 154 and the doc comment at 150–151 are untouched.

No behaviour changes. The three call sites — systems/map/sky.rs:415, systems/map/sky.rs:1647, systems/map/sky_dome.rs:225 — are not edited.

Commit as style(sun): wrap the sun-disc override to rustfmt's width, with a body saying that this is what has held main red since dcfa142 and that tools/deploy-main gates on it.

Acceptance criteria

  • crates/cartopolis/src/utils/sun.rs contains the four-line let lo: f32 = std::env::var("CARTO_EXP_DISC_LO")… form; no line in the file exceeds 100 characters.
  • cargo fmt -p cartopolis -p cartopolis_geo -p cartopolis_core -p cartopolis_simulator -p cartopolis_android --check exits 0 and prints no diff.
  • git diff against main touches exactly one file, and the change is whitespace only — the token sequence of sun_disc is unchanged (-0.03, 0.06, CARTO_EXP_DISC_LO all still present, smoothstep(lo, 0.06, sun_direction(hours, decl_rad).y) unchanged).
  • Cargo.lock is unmodified.
  • After landing, the CI run for the new main head reports test cartopolis as success.

Verification

Run from the worktree:

# The gate, exactly as CI runs it (ci.yml:540). Must exit 0.
cargo fmt -p cartopolis -p cartopolis_geo -p cartopolis_core -p cartopolis_simulator -p cartopolis_android --check

# Nothing but the one file, and no lockfile churn.
git diff --stat
git diff --numstat -- Cargo.lock   # must print nothing

cargo fmt needs rustfmt in the toolchain — docs/guides/development.md:390 records that the gate once died for weeks on 'cargo-fmt' is not installed for the toolchain after a --profile minimal install. If it is missing here, say so on the ticket rather than working around it.

A test run is not required to prove this fix: job 1329's own log shows every suite green on this exact tree, and the change is whitespace. CI re-runs the suite on the branch anyway.

Nothing here needs a workstation, a GPU, --shot, or cargo shots.

Out of scope

  • The CARTO_EXP_DISC_LO knob itself. Reformatting keeps it, and keeping it is deliberate: it is the maintainer's own change from dcfa142, made 34 minutes before this ticket was filed, and removing it would be a behaviour decision this pass is not entitled to make. Two things about it are worth raising on a separate ticket, not folded in here: it is an undocumented CARTO_EXP_-prefixed experiment hook (the only one in the tree — grep -rn "CARTO_EXP_" --include=*.rs crates/ returns just this line) that reads an environment variable on every call from three sky call sites; and dcfa142 landed with an empty commit body, which the repo's own rule (CLAUDE.md, "Where a fact goes") requires for a fix. Neither blocks unbreaking main.
  • Any change to the sky, the sun light, the day-night curves, or sky_dome.
  • Adding a pre-commit hook, a CI reordering, or anything that would have caught this earlier.
  • The older red test cartopolis on e971b4c4 (task 1093), which predates dcfa142 and is a different, already-superseded run.
  • Deploying anything. Landing this makes a deploy possible; it is not permission to run one.

Open questions

None.


Branch: style/291-sun-disc-rustfmt

Original request

The last commit on main that CI ran for is 99e942dc, and it did not pass:

  • test cartopolis — failure

Nothing can be deployed while this stands — tools/deploy-main gates on it — so this
comes before anything on the frontier.

Read the failing job's log, reproduce it locally, and fix the cause. If the failure is
the runner rather than the code (a flake, a cache miss, a missing tool), say so on this
ticket and close it rather than changing code to suit it.

Filed by the autopilot.

🤖 Refined by the viberfox issue agent. Reply with @agent refine and what is wrong to have this rewritten.

## Problem `main` is red on `99e942dc` because of a **rustfmt violation**, not a test failure. In the failing job (`test cartopolis`, task 1114 / job 1329, run for `99e942dc`) every test suite passes — 879 in `cartopolis`, 251 in `cartopolis_geo`, 108 in `cartopolis_simulator`, and the rest — with `0 failed` on every line. The job then dies on its last gate: ``` Diff in /workspace/jeroen/cartopolis/crates/cartopolis/src/utils/sun.rs:150: pub fn sun_disc(hours: f32, decl_rad: f32) -> f32 { - let lo: f32 = std::env::var("CARTO_EXP_DISC_LO").ok().and_then(|v| v.parse().ok()).unwrap_or(-0.03); + let lo: f32 = std::env::var("CARTO_EXP_DISC_LO") + .ok() + .and_then(|v| v.parse().ok()) + .unwrap_or(-0.03); ⚙️ [runner]: exitcode '1': failure ``` That is the step at `.forgejo/workflows/ci.yml:540`: ``` cargo fmt -p cartopolis -p cartopolis_geo -p cartopolis_core -p cartopolis_simulator -p cartopolis_android --check ``` The offending line is `crates/cartopolis/src/utils/sun.rs:153`. It is 104 characters; there is no `rustfmt.toml` in the tree, so rustfmt's default `max_width = 100` applies (edition 2021, `Cargo.toml:15`). It arrived in `dcfa142` ("fix: sky"), a one-line change to `sun_disc` that made the smoothstep's lower bound overridable by `CARTO_EXP_DISC_LO`. The same single diff is the whole failure on all three red commits — `dcfa142` (job 1324), `b488d29` (job 1327), `99e942dc` (job 1329) all print `Diff in …/utils/sun.rs:150:` and nothing else. The last green `test cartopolis` was `cd5d1b84` (task 1105), the commit before `dcfa142`. This is **not** a runner problem: it is real unformatted code in the tree, it reproduces from the source alone, and the `wasm & android targets` job went green on the same commit (task 1116) because it is declared `if: always()` (`ci.yml:603`) and does not depend on the fmt gate. ## Approach One crate, one file, whitespace only. - `crates/cartopolis/src/utils/sun.rs:153` — replace the single-line `let lo` binding with the four-line form rustfmt already printed in the CI log (quoted verbatim above). The `-0.03` default, the `smoothstep(lo, 0.06, …)` call at line 154 and the doc comment at 150–151 are untouched. No behaviour changes. The three call sites — `systems/map/sky.rs:415`, `systems/map/sky.rs:1647`, `systems/map/sky_dome.rs:225` — are not edited. Commit as `style(sun): wrap the sun-disc override to rustfmt's width`, with a body saying that this is what has held `main` red since `dcfa142` and that `tools/deploy-main` gates on it. ## Acceptance criteria - [ ] `crates/cartopolis/src/utils/sun.rs` contains the four-line `let lo: f32 = std::env::var("CARTO_EXP_DISC_LO")…` form; no line in the file exceeds 100 characters. - [ ] `cargo fmt -p cartopolis -p cartopolis_geo -p cartopolis_core -p cartopolis_simulator -p cartopolis_android --check` exits 0 and prints no diff. - [ ] `git diff` against `main` touches exactly one file, and the change is whitespace only — the token sequence of `sun_disc` is unchanged (`-0.03`, `0.06`, `CARTO_EXP_DISC_LO` all still present, `smoothstep(lo, 0.06, sun_direction(hours, decl_rad).y)` unchanged). - [ ] `Cargo.lock` is unmodified. - [ ] After landing, the CI run for the new `main` head reports `test cartopolis` as **success**. ## Verification Run from the worktree: ```bash # The gate, exactly as CI runs it (ci.yml:540). Must exit 0. cargo fmt -p cartopolis -p cartopolis_geo -p cartopolis_core -p cartopolis_simulator -p cartopolis_android --check # Nothing but the one file, and no lockfile churn. git diff --stat git diff --numstat -- Cargo.lock # must print nothing ``` `cargo fmt` needs rustfmt in the toolchain — `docs/guides/development.md:390` records that the gate once died for weeks on `'cargo-fmt' is not installed for the toolchain` after a `--profile minimal` install. If it is missing here, say so on the ticket rather than working around it. A test run is **not** required to prove this fix: job 1329's own log shows every suite green on this exact tree, and the change is whitespace. CI re-runs the suite on the branch anyway. Nothing here needs a workstation, a GPU, `--shot`, or `cargo shots`. ## Out of scope - **The `CARTO_EXP_DISC_LO` knob itself.** Reformatting keeps it, and keeping it is deliberate: it is the maintainer's own change from `dcfa142`, made 34 minutes before this ticket was filed, and removing it would be a behaviour decision this pass is not entitled to make. Two things about it are worth raising **on a separate ticket**, not folded in here: it is an undocumented `CARTO_EXP_`-prefixed experiment hook (the only one in the tree — `grep -rn "CARTO_EXP_" --include=*.rs crates/` returns just this line) that reads an environment variable on every call from three sky call sites; and `dcfa142` landed with an empty commit body, which the repo's own rule (CLAUDE.md, "Where a fact goes") requires for a `fix`. Neither blocks unbreaking `main`. - Any change to the sky, the sun light, the day-night curves, or `sky_dome`. - Adding a pre-commit hook, a CI reordering, or anything that would have caught this earlier. - The older red `test cartopolis` on `e971b4c4` (task 1093), which predates `dcfa142` and is a different, already-superseded run. - Deploying anything. Landing this makes a deploy *possible*; it is not permission to run one. ## Open questions None. --- Branch: `style/291-sun-disc-rustfmt` <details><summary>Original request</summary> The last commit on `main` that CI ran for is `99e942dc`, and it did not pass: - `test cartopolis` — failure Nothing can be deployed while this stands — `tools/deploy-main` gates on it — so this comes before anything on the frontier. Read the failing job's log, reproduce it locally, and fix the cause. If the failure is the runner rather than the code (a flake, a cache miss, a missing tool), say so on this ticket and close it rather than changing code to suit it. <sub>Filed by the autopilot. <!-- autopilot:main-red-99e942dc --></sub> </details> <sub>🤖 Refined by the viberfox issue agent. Reply with **@agent refine** and what is wrong to have this rewritten.</sub>
Author
Collaborator

🤖 Refining this before anything gets built — reading the code, no branch, no commits. If it turns out I'd have to guess at the requirements I'll stop and ask instead.

🤖 Refining this before anything gets built — reading the code, no branch, no commits. If it turns out I'd have to guess at the requirements I'll stop and ask instead.
Author
Collaborator

🤖 Refined. The description above is now the spec; I'll pick it up for implementation on the next poll.

If the direction is wrong, say so now — @agent refine with a correction rewrites it, and agent:skip stops me.


🤖 viberfox issue agent on the VPS — 23 turns · $2.00 · session 3b284703-8f1b-4c9f-9bec-d29c83be38f7. Reply with @agent to continue this session.

🤖 **Refined.** The description above is now the spec; I'll pick it up for implementation on the next poll. If the direction is wrong, say so now — **@agent refine** with a correction rewrites it, and `agent:skip` stops me. --- <sub>🤖 viberfox issue agent on the VPS — 23 turns · $2.00 · session `3b284703-8f1b-4c9f-9bec-d29c83be38f7`. Reply with **@agent** to continue this session.</sub>
Author
Collaborator

🤖 Picked this up — working on branch style/291-sun-disc-rustfmt in a fresh worktree on the VPS. I'll report back here when I'm done.

Label an issue agent:skip to keep me off it, or driven to keep it in a session you are driving.

🤖 Picked this up — working on branch `style/291-sun-disc-rustfmt` in a fresh worktree on the VPS. I'll report back here when I'm done. <sub>Label an issue `agent:skip` to keep me off it, or `driven` to keep it in a session you are driving.</sub>
Author
Collaborator

Still building. I'll continue when the notification arrives.

No commits were made.


🤖 viberfox issue agent on the VPS — 16 turns · $1.34 · session 8907a638-740c-40be-bb74-d3dcab50a1ee. Reply with @agent to continue this session.

Still building. I'll continue when the notification arrives. _No commits were made._ --- <sub>🤖 viberfox issue agent on the VPS — 16 turns · $1.34 · session `8907a638-740c-40be-bb74-d3dcab50a1ee`. Reply with **@agent** to continue this session.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jeroen/cartopolis#291
No description provided.