Skip to content

test(analysis): regenerate the reference answers on Ubuntu 26.04 and pin it - #2062

Merged
giswqs merged 1 commit into
mainfrom
fix/reference-answers-ubuntu-26
Nov 14, 2026
Merged

giswqs merged 1 commit into
mainfrom
fix/reference-answers-ubuntu-26

Conversation

@giswqs

@giswqs giswqs commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Cause

The "Reference answers match generate.py" check fails on #2061 (run): cases.json and six buffer answers differ from what generate.py writes. It runs only when a pull request touches the reference corpus or reference.yml, so it hadn't run since it passed on Nov 7.

Between those runs ubuntu-latest moved from Ubuntu 24.04 (image 20261101.360) to 26.04 (20261111.82). The script's Python dependencies are pinned and resolve identically on Python 3.12, 3.13 and 3.14 (Shapely 2.1.2 with GEOS 3.13.1, pyproj 3.7.2 with PROJ 9.5.1, numpy 2.5.4), and its output is identical from run to run. What changed is the system's libm, which PROJ uses: 26.04's glibc rounds some results differently in the last digits, about 1e-13 relative (e.g. 14015.746772213406 → 14015.746772211674). The check compares bytes, so it fails.

Fix

  • The answers are regenerated with a matching glibc (2.44 here; the same seven files differ there as in CI).
  • The job runs on ubuntu-26.04 instead of ubuntu-latest, with a comment saying why, so a later image move can't break it unannounced: moving to a new image means regenerating on it.

Evidence

  • Locally, uv run generate.py --check failed on the same seven files as CI before regenerating, and passes after.
  • cargo test -p rustgis-analysis --test reference passes with the new answers.
  • 67 lines change, all in the last digits of floats.
  • This pull request touches the corpus, so the check runs here on 26.04.

Summary by CodeRabbit

  • Tests
    • Updated reference results for spatial distances, geometry measurements, and buffer shapes to reflect the calculations produced in the current test environment.
    • The reference checks now use a consistent operating system image, helping keep expected results stable across runs.

…pin it

ubuntu-latest moved from 24.04 to 26.04. pyproj's PROJ uses the
system's libm, and 26.04's glibc rounds some results differently in the
last digits, so generate.py --check found six buffer answers and
cases.json differing by about 1e-13 relative. The check compares bytes,
so it failed on any pull request touching the corpus.

The answers are regenerated with a matching glibc and the job is pinned
to ubuntu-26.04, so a later move of ubuntu-latest can't break it
unannounced.
@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The reference-answer workflow now uses a fixed Ubuntu runner. Expected spatial-join distances, geometry measurements, and buffer coordinates were updated. Test inputs and GeoJSON feature structures remain unchanged.

Changes: Reference test results

Layer / File(s) Summary
Pin runner and update reference expectations
.github/workflows/reference.yml, crates/analysis/tests/reference/cases.json, crates/analysis/tests/reference/expected/*
The reference-answer job now uses ubuntu-26.04. Expected spatial-join distances and geometry measurements changed in cases.json. Expected buffer polygon coordinates changed in the GeoJSON fixtures.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: mavrick-f

Merge Risk: Minimal · up to cedd3

This change pins the reference-answer CI job to a fixed Ubuntu image and refreshes the expected numeric results to match it. It affects only test fixtures and CI, with no production impact. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the reference answers are regenerated on Ubuntu 26.04 and the job is pinned to that image. The title follows the repository's test(scope) convention and is specific. I…
Description check Passed The description follows the template's main structure. It has a Summary-like Cause and Fix section, a Testing section with local commands and results, and a related context of PR #2061. It does not in…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the reference answers are regenerated on Ubuntu 26.04 and the job is pinned to that image. The title follows the repository's test(scope) convention and is specific. It matches the raw summary, which shows the reference.yml job moved to ubuntu-26.04 and the expected fixtures updated with new floating-point values.

Full details: Description check

Explanation

The description follows the template's main structure. It has a Summary-like Cause and Fix section, a Testing section with local commands and results, and a related context of PR #2061. It does not include the required UI evidence section. The template marks that section as required, but the author's line states no visible UI change, which the template allows. The Related issue section is missing an explicit link, though the Cause section references #2061 and the failing run. The description is mostly complete and clearly explains the change, so it passes.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks each changed coordinate,
Then bounds through numbers, calm and bright.
The runner holds its ground in place,
New reference answers find their line,
And carrots wait beyond the test.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 5afa0d84-fb3b-4656-96a2-12fcc2e3e1cb
Commits

Reviewing files that changed from the base of the PR and between a13d490 and cedd371.

Files selected for processing: 8

  • .github/workflows/reference.yml
  • crates/analysis/tests/reference/cases.json
  • crates/analysis/tests/reference/expected/buffer_long_5km.geojson
  • crates/analysis/tests/reference/expected/buffer_parcels_-2km.geojson
  • crates/analysis/tests/reference/expected/buffer_parcels_1km.geojson
  • crates/analysis/tests/reference/expected/buffer_points_1km.geojson
  • crates/analysis/tests/reference/expected/buffer_roads_2km.geojson
  • crates/analysis/tests/reference/expected/buffer_stations_120km.geojson

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Scope: the CI runner change in .github/workflows/reference.yml and regenerated reference answers in crates/analysis/tests/reference/ (cases.json and six buffer GeoJSON files). The answers move by about 1e-13 relative, in the last digits of floats. No code, dependency or asset changes.

Bugs

  • None found. The Rust test crates/analysis/tests/reference.rs compares with tolerances (area 1e-7 relative, lines 1e-3 m, numbers 1e-9 relative, distances 1e-4), so this drift cannot break cargo test --workspace on any runner in test-rust.yml. The byte-exact check runs only in generate.py --check. Confidence: high.
  • The line counts match the PR body: 67 lines changed in the data files, and 71/68 in total with the workflow.

Security

  • None. The workflow keeps permissions: contents: read, the pinned action SHAs are unchanged, and no secrets are involved.

Performance

  • None.

Quality

  • Regeneration instructions don't say the answers are host-specific. crates/analysis/tests/reference/generate.py (docstring lines 9–12, and the failure message at line 555) tells contributors to run uv run generate.py and commit the result. The committed bytes now depend on the host's libm. Run on macOS, Windows or Ubuntu 24.04, it writes different last digits, so the next person to follow the message will commit answers that fail on the 26.04 runner. This file is not in the diff, so I have not posted an inline comment. Suggested docstring addition:

    The committed answers come from ubuntu-26.04 (see .github/workflows/reference.yml): PROJ's last
    digits depend on the system's libm, so regenerate them there, not on another machine.

    Confidence: high that the gap exists; medium on impact, since it only bites on the next regeneration. AGENTS.md treats wording as a release-quality-pass item, but this steers the next regeneration, so I would fix it here.

AGENTS.md

  • No violations found. The PR touches no code, so the never-crash, never-silent and background-work rules don't apply. I could not run cargo xtask ci (no shell), so the quality gates are unverified.

Needs confirmation before merge

  • The ubuntu-26.04 label and the claim that the byte-exact check passes on it cannot be checked offline. The PR touches the corpus, so the workflow runs on this PR; that green run is the real evidence.

Prior review threads: none on this PR, so no earlier concerns were left alone.

Change size

Compared: the whole PR against main (merge base a13d490 to PR head cedd371).

Measure Value
Files changed 8 (0 added, 8 modified, 0 removed, 0 renamed)
Size before 625.27 KB (640,272 B)
Size after 625.57 KB (640,581 B)
Total size change +309 B
File Before After Change
.github/workflows/reference.yml 1.10 KB (1,124 B) 1.35 KB (1,387 B) +263 B
expected/buffer_long_5km.geojson 102.13 KB (104,581 B) 102.18 KB (104,633 B) +52 B
expected/buffer_parcels_-2km.geojson 51.35 KB (52,583 B) 51.32 KB (52,553 B) -30 B
expected/buffer_parcels_1km.geojson 162.99 KB (166,903 B) 163.01 KB (166,918 B) +15 B
expected/buffer_roads_2km.geojson 127.88 KB (130,945 B) 127.88 KB (130,954 B) +9 B
expected/buffer_points_1km.geojson 138.24 KB (141,556 B) 138.24 KB (141,560 B) +4 B
cases.json 14.02 KB (14,360 B) 14.02 KB (14,357 B) -3 B
expected/buffer_stations_120km.geojson 27.56 KB (28,220 B) 27.56 KB (28,219 B) -1 B

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-2062/
Web app https://preview.rustgis.app/pr-2062/app/
Commit cedd371

GitHub Pages takes a minute or two to publish a new commit.

@giswqs
giswqs merged commit fb65132 into main Nov 14, 2026
19 checks passed
@giswqs
giswqs deleted the fix/reference-answers-ubuntu-26 branch November 14, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant