Skip to content

Test view colour packing, empty contours and CLI exits - #36

Merged
lispandfound merged 1 commit into
masterfrom
ai/tests
Oct 23, 2026
Merged

lispandfound merged 1 commit into
masterfrom
ai/tests

Conversation

@claude

@claude claude Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Tests-only: strengthens tests/test_view.py for rupture_generator/view.py.

What the new tests pin down

  • _packed puts channels into packed 0xRRGGBBAA uint32 values, rounds each channel and sets alpha to 0xFF. The test checks exact values, including fractional inputs that have to round.
  • VIRIDIS and HOT each have 256 shades, with exact endpoints (0x440154FF/0xFDE725FF and black/white). _colours clips values outside [low, high] to the ends of the map and puts a midpoint on shade 127.
  • _isochrones returns an empty (0, 2, 3) array when no edge crosses the level. _onset_contours returns empty lines and anchors and no labels for a rupture whose onset is the same everywhere.
  • _positive_seconds accepts a valid --step, and main records with a non-default step.
  • main exits with status 2 and prints a rupture-view: message for a missing file and for a file that isn't an SRF, and writes no recording in either case. When rerun-sdk can't be imported, it exits with status 2 and says to install rupture-generator[vis].

Coverage of view.py

  • Before: 96% (uncovered lines 281, 501, 535–545, 556)
  • After: 99% (only line 556 is left: the if __name__ == "__main__" guard)

Mutants

The new _packed exact-value test and the colour-map endpoint test kill all 13 surviving _packed mutants:

  • mutmut_1, mutmut_2 and mutmut_3 replace the conversion with None. Each one either raises or skips the uint32 cast.
  • mutmut_4, mutmut_5 and mutmut_6 turn a | into &, which drops channels or alpha.
  • mutmut_7, mutmut_9 and mutmut_11 flip << to >>, which drops a channel.
  • mutmut_8, mutmut_10 and mutmut_12 shift a channel by one bit too many.
  • mutmut_13 sets alpha to 256 instead of 0xFF.

I judged none of the survivors equivalent.

No issues filed: none of the tests showed the code doing something wrong.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@claude claude Bot added ai-generated Opened by the scheduled Claude jobs ai-tests AI-written tests that need review labels Oct 23, 2026
@claude
claude Bot requested a review from lispandfound October 23, 2026 14:12
@github-actions

Copy link
Copy Markdown
Contributor

Benchmarks

faa8d5e against base 26b166a, on AMD EPYC 9V45 96-Core Processor. Times are medians over the rounds. The median change is 1.4%; changes past 5% are in bold.

Kernels

kernel base head change head IQR rounds padded cells
embed[Mw6.5] 27.8 ms 27.4 ms -1.3% 324 µs 35 448,000 (+0.0%)
circulant_draw[Mw6.5] 2.58 ms 2.61 ms +1.4% 312 µs 258
embed[Mw7.5] 86.6 ms 87.6 ms +1.2% 10 ms 12 1,204,224 (+0.0%)
circulant_draw[Mw7.5] 6.02 ms 5.99 ms -0.5% 370 µs 124
eikonal_solve 945 ms 930 ms -1.6% 12.2 ms 5
synthesise_pulses[impulse] 381 µs 365 µs -4.3% 17.8 µs 1253
synthesise_pulses[liu] 331 ms 337 ms +1.9% 8.64 ms 5

End to end

Each round is the command line in a fresh interpreter, start-up included. Peak RSS is the largest the child process reached over the rounds.

example base time head time change base peak RSS head peak RSS change
alpine_hope 6.67 s 6.6 s -1.0% 294 MiB 295 MiB +0.3%
beavan 2.45 s 2.45 s -0.2% 232 MiB 232 MiB +0.0%
colombia 6.37 s 6.15 s -3.5% 3,171 MiB 3,172 MiB +0.0%
crustal 1.04 s 1.04 s -0.4% 246 MiB 246 MiB -0.1%
landers 2.03 s 1.99 s -1.9% 385 MiB 385 MiB -0.1%
northridge 1.03 s 1.02 s -0.3% 290 MiB 289 MiB -0.5%
two_faults 1.74 s 1.76 s +1.0% 354 MiB 354 MiB +0.2%
two_faults_segments 1.03 s 1.01 s -1.9% 192 MiB 191 MiB -0.2%
venezuela 12.5 s 12.2 s -2.1% 5,769 MiB 5,766 MiB -0.1%

@lispandfound
lispandfound merged commit 36a8c4a into master Oct 23, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Opened by the scheduled Claude jobs ai-tests AI-written tests that need review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant