Skip to content

Test config error messages and propagation checks - #38

Open
claude[bot] wants to merge 1 commit into
masterfrom
ai/tests
Open

claude[bot] wants to merge 1 commit into
masterfrom
ai/tests

Conversation

@claude

@claude claude Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Tests only: tests/test_config.py.

What the new tests check

  • Exact error text from load (_describe):
    • an unknown top-level key gives the file: has unknown keys ['bogus']. No table path exists, so the message names the file.
    • a value of the wrong kind gives source.magnitudes: 3 is not a dict, using the type's __name__ rather than its repr (dict[str, float]).
  • [pulse] sample interval: dt_s = 0.0 and dt_s = -1.0 are refused with pulse: a sample interval of … s is none. A tiny positive interval (1e-6) is accepted.
  • [segments] shape: segments = 3 gives segments: 3 is not a table, and segments = { next = 3 } gives segments.next: 3 is not a table.
  • Propagation at build time:
    • a two-segment config with no [propagation] table is refused.
    • a predetermined tree that names a segment that doesn't exist is refused (propagation.parents: ['nxt'] are not segments).
    • a valid predetermined tree produces exactly the given parents.

Coverage of rupture_generator/config.py

  • Before: 97% (missing lines 122, 422, 681, 700, 851, 860)
  • After: 99% (missing line 122)

Line 122 is the NotImplementedError in the private abstract _DepthProfile.field. Every concrete profile overrides it, so it was left uncovered.

Surviving mutants (all in _describe)

Killed by the exact-message tests:

  • mutmut_25: the InvalidFieldValue reason becomes None.
  • mutmut_26, mutmut_32, mutmut_33: the type is printed as dict[str, float] instead of dict.
  • mutmut_43, mutmut_44: the file becomes XXthe fileXX / THE FILE.

Judged equivalent:

  • mutmut_5, mutmut_6 (reason = str(error) → None / str(None)): the error passed in is always one of the types the match handles. load and _segments only catch InvalidFieldValue, MissingField, ExtraKeysError or RuptureGeneratorError, so the first loop iteration always overwrites the starting reason.
  • mutmut_28, mutmut_31 (getattr(t, '__name__', t) → getattr(t, '__name__', None) / getattr(t, '__name__')): these differ only for a field type with no __name__. On Python 3.14 every type mashumaro reports here has one, including generic aliases, unions and type aliases.

No issues filed.

🤖 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 24, 2026
@claude
claude Bot requested a review from lispandfound October 24, 2026 13:57
@github-actions

Copy link
Copy Markdown
Contributor

Benchmarks

739f908 against base 36a8c4a, on AMD EPYC 9V45 96-Core Processor. Times are medians over the rounds. The median change is 2.1%; changes past 5% are in bold.

Kernels

kernel base head change head IQR rounds padded cells
embed[Mw6.5] 29 ms 28.3 ms -2.5% 303 µs 34 448,000 (+0.0%)
circulant_draw[Mw6.5] 2.72 ms 2.59 ms -4.5% 153 µs 237
embed[Mw7.5] 90.9 ms 88.4 ms -2.8% 755 µs 11 1,204,224 (+0.0%)
circulant_draw[Mw7.5] 6.39 ms 6.15 ms -3.7% 340 µs 139
eikonal_solve 961 ms 1e+03 ms +4.1% 18 ms 5
synthesise_pulses[impulse] 391 µs 384 µs -1.8% 17.3 µs 948
synthesise_pulses[liu] 344 ms 347 ms +0.7% 4.78 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.93 s 6.86 s -1.0% 294 MiB 294 MiB -0.1%
beavan 2.46 s 2.51 s +2.1% 232 MiB 232 MiB +0.0%
colombia 6.28 s 6.39 s +1.8% 3,167 MiB 3,168 MiB +0.0%
crustal 1.05 s 1.06 s +1.7% 245 MiB 244 MiB -0.2%
landers 2.06 s 2.07 s +0.5% 385 MiB 385 MiB -0.1%
northridge 1.06 s 994 ms -6.5% 291 MiB 290 MiB -0.2%
two_faults 1.77 s 1.78 s +0.4% 354 MiB 354 MiB -0.2%
two_faults_segments 1.05 s 1.08 s +2.6% 193 MiB 193 MiB +0.2%
venezuela 12.6 s 12.4 s -2.1% 5,766 MiB 5,766 MiB +0.0%

This branch has not been deployed

No deployments
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.

0 participants