1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: decimal-precision
# Publicly proves gMath's decimal-domain correctness on every push/PR. Two jobs:
#
# 1. lib-tests - the decimal_fixed module tests (incl. the d256 divmod
# root-cause regression, banker's rounding, and DecimalFixed mul/div) across
# the embedded/balanced/scientific profiles. DecimalFixed is i128-backed on
# every profile, so the arithmetic fixes are profile-agnostic; this confirms
# they hold across the cfg-gated profile code.
#
# 2. contract-harness - the full contract sweep against mootable/decimal-scaled's
# independent, adversarial mpmath corpus (pinned). Grades BOTH user-reachable
# decimal paths (imperative DecimalFixed + canonical gmath()/FASC) for all 15
# transcendentals, plus atan2 and add/sub/mul/div, at 0 LSB.
#
# Uses NO third-party or GitHub-authored actions - checkout is a plain `git fetch`
# (gMath is a public repo) and the ubuntu runner already ships stable Rust. This
# keeps the repo runnable under the most restrictive "Allow <owner> actions"
# policy (and trivially satisfies "require actions pinned to a full SHA", since no
# actions are used). Free on this public repo.
on:
push:
pull_request:
jobs:
lib-tests:
strategy:
fail-fast: false
matrix:
profile:
runs-on: ubuntu-latest
steps:
- name: Checkout (plain git - no external actions)
run: |
git init -q
git remote add origin "https://github.com/${{ github.repository }}.git"
git fetch -q --depth 1 origin "${{ github.sha }}"
git checkout -q FETCH_HEAD
- name: cargo test --lib decimal_fixed (${{ matrix.profile }})
env:
GMATH_PROFILE: ${{ matrix.profile }}
run: cargo test --lib decimal_fixed
contract-harness:
runs-on: ubuntu-latest
steps:
- name: Checkout (plain git - no external actions)
run: |
git init -q
git remote add origin "https://github.com/${{ github.repository }}.git"
git fetch -q --depth 1 origin "${{ github.sha }}"
git checkout -q FETCH_HEAD
# Oracle #2: decimal-scaled's adversarial golden corpus, pinned to the
# exact commit gMath was validated against. Not vendored into this repo.
- name: Fetch decimal-scaled golden corpus (pinned)
run: |
git clone https://github.com/mootable/decimal-scaled.git "${{ runner.temp }}/decimal-scaled"
git -C "${{ runner.temp }}/decimal-scaled" checkout e6c7497832be437cf464d07b841609a0b92aac87
# Balanced profile: the harness is cfg-gated to q128_128 (DecimalFixed<28>
# needs compute dp 77 for guard digits). Single-threaded: the sweep swaps
# the panic hook around catch_unwind. Prebuilt tables -> build is seconds.
- name: Decimal contract validation (balanced, oracle #1 + oracle #2)
env:
GMATH_PROFILE: balanced
GMATH_DECIMAL_SCALED_GOLDEN: ${{ runner.temp }}/decimal-scaled
run: cargo test --test decimal_contract_validation -- --test-threads=1 --nocapture