Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Nightly

# The nightly correctness run (SKILLS.md, "The nightly sweep and fuzz"): every arm of exp,
# expm1, log, log10, log1p, sinh, cosh, atan, asin, acos and atan2, unmasked and masked, compared
# with StrictMath by raw bits.
# expm1, log, log10, log1p, sinh, cosh, atan, asin, acos, atan2 and hypot, unmasked and masked,
# compared with StrictMath by raw bits (a lane of two NaNs of atan2 or hypot by PairBits).
#
# - sweep (x86): every one of the 2^32 high words with three low words each (Sweep.java) at
# every width the drawn runner has except 128 bits: 256 and max on every draw, 512 on an
Expand All @@ -27,7 +27,7 @@ name: Nightly
# Every mismatch file is uploaded as an artifact, its inputs one per line as
# hard-cases/<function>.txt takes them.
#
# A function of two arguments (`pairs` in the plan job; atan2 is the one ported) is swept one
# A function of two arguments (`pairs` in the plan job: atan2 and hypot) is swept one
# argument at a time (Sweep.java, `--argument`). The input `pair-passes` says which a night sweeps:
# `alternate` (the default) the first argument for a rotation of `nights` nights and the second for
# the next (turned over every `slice-nights` nights when a rotation is shorter, so that a slice of
Expand Down Expand Up @@ -139,11 +139,11 @@ jobs:
run: |
# Every function of the night: each matrix and each check below reads this list, so a
# new port is added here (and in `reach`, if it computes through another port).
all='exp expm1 log log10 log1p sinh cosh atan asin acos atan2'
# The functions of `all` that take two arguments: atan2. A port of another is added here
# as well as to `all`, and each sweep matrix then has an entry for each argument the
# night sweeps (PAIR_PASSES).
pairs='atan2'
all='exp expm1 log log10 log1p sinh cosh atan asin acos atan2 hypot'
# The functions of `all` that take two arguments: atan2 and hypot. A port of another is
# added here as well as to `all`, and each sweep matrix then has an entry for each
# argument the night sweeps (PAIR_PASSES).
pairs='atan2 hypot'
# A dispatch's text is echoed in errors below: a line break in it would let a line of
# the dispatcher's be read as a workflow command, so line breaks become spaces (which
# every check below then refuses).
Expand Down Expand Up @@ -230,13 +230,13 @@ jobs:
fault_args="-Dvfdlibm.fault=$FAULT"
fi
# A matrix holds at most 256 jobs, one per function and shard of the run: with all of
# today's 11 functions (ten of one argument and atan2, which a night sweeps one argument
# of, two with pair-passes both), 16 shards are 176 (192) and 32 shards are 352 (384),
# past the cap, so the 256-job check in the loop below refuses 32 shards of all eleven
# (eight functions fit at 32, nine do not). A function of two arguments is an entry for
# each argument a night sweeps (once or twice by PAIR_PASSES), so it counts for that many
# in the check. A stripe count (nights or slice-nights times shards) is at most Sweep's
# 4096 chunks.
# today's 12 functions (ten of one argument, and atan2 and hypot, of which a night sweeps
# one argument each, two with pair-passes both), 16 shards are 192 (224) and 32 shards
# are 384 (448), past the cap, so the 256-job check in the loop below refuses 32 shards
# of all twelve (eight functions fit at 32, nine do not). A function of two arguments is
# an entry for each argument a night sweeps (once or twice by PAIR_PASSES), so it counts
# for that many in the check. A stripe count (nights or slice-nights times shards) is at
# most Sweep's 4096 chunks.
case "$PAIR_PASSES" in
alternate | 1 | 2) pair_count=1 ;;
both) pair_count=2 ;;
Expand Down
16 changes: 7 additions & 9 deletions PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,13 @@ five are a later, optional set; the large-argument reduction of the trigonometri
-XX:MaxVectorSize=32`, 128 and 256 bits on every draw), on x86 with `-XX:MaxVectorSize=16`
(all of it at 128 bits) and on Arm (128 bits).
- **Nightly:** `.github/workflows/nightly.yml` sweeps every high word of exp, expm1, log, log10,
log1p, sinh, cosh, atan, asin, acos and atan2 (atan2, of two arguments, one argument at a time)
with three low words each (every branch fdlibm decides on the high word) at every width but 128
bits on x86, where a rotating 1/32 slice a night covers it in 32 nights, and at 128 bits on Arm
every night; it fuzzes from a fresh seed at every width, and runs every proof under both solvers;
a failure opens an issue labelled `nightly-failure` with the mismatching inputs, ready for a
`hard-cases` file (`SKILLS.md`), and a dispatch that plants a fault, to test that alert, opens one
labelled `nightly-fault-test`. `hypot` is registered with `Sweep` and `Fuzz`
(`Nightly.PairFunction.HYPOT`), so a slice runs by hand, but the night does not list it yet: a
later pull request adds it to `nightly.yml`, as #126 did for atan2 after its port.
log1p, sinh, cosh, atan, asin, acos, atan2 and hypot (atan2 and hypot, of two arguments, one
argument at a time) with three low words each (every branch fdlibm decides on the high word) at
every width but 128 bits on x86, where a rotating 1/32 slice a night covers it in 32 nights, and
at 128 bits on Arm every night; it fuzzes from a fresh seed at every width, and runs every proof
under both solvers; a failure opens an issue labelled `nightly-failure` with the mismatching
inputs, ready for a `hard-cases` file (`SKILLS.md`), and a dispatch that plants a fault, to test
that alert, opens one labelled `nightly-fault-test`.
- **Masked forms:** a masked form is checked under seeded random masks, all-true and all-false;
active lanes must equal `StrictMath` and inactive lanes must keep the input's raw bits (for a
two-argument function, the first argument's).
Expand Down
74 changes: 51 additions & 23 deletions SKILLS.md
Original file line number Diff line number Diff line change
Expand Up @@ -969,28 +969,54 @@ blend and 10 to 23 instructions. At 128 bits the bodies are 8 to 16 times longer
has not been rerun for eight, and atan's own cost is not measured, nor are sinh's and
cosh's: the first nights with them are, with `pool.py fetch` and `cost`, and this entry is
requoted from those.
- **Eleven functions: unmeasured.** asin, acos and atan2 join the night's list, so the scheduled
night runs eleven (atan2 sweeps one argument a night by `pair-passes=alternate`, so its jobs are
one function's worth at the defaults), and no night has run them. Everything here is an
extrapolation, not a reading. An estimate made for ten functions of one argument, not derived in
this document, was about 730 runner-minutes at the default 2 shards and 4 Arm shards (the 72
runner-minutes a function of the budget entry above would give 720); atan2 adds a function whose
cost is not estimated. The plan job at the defaults makes 22 sweep entries, 44 for Arm and 22
for the fuzz, against the 256 each may hold; a run of nine or more functions at 32 shards (288
for nine, more for eleven) exceeds that cap and the plan job refuses it, and eight fit. No span
is modelled here: the entry below computes its figures for eight functions (about 72 minutes);
scaling that by the count of functions gives about 90 for ten and 99 for eleven, the budget's 90
and over it, which is arithmetic on an extrapolation and no prediction. The first nights with
eleven are the measurement, read as above; the levers below are the answer if the median passes
90. **What `alternate` does about the slice:** the argument it picks is `days / nights % 2 + 1`
and the slice's night is `days % slice-nights`, and at the defaults (1 and 32) the parity of the
day is the parity of the slice's index, so a slice would keep one argument for good, half of
each argument's 128-bit slices never swept. The rotation therefore turns over once every
`slice-nights` nights when `nights` is below it (`(days / nights + days / slice-nights) % 2 +
1`), so a slice meets both arguments in two cycles of 32 nights, and the same argument is swept
on two nights running at each turn. Simulated over 20000 days for `nights` and `slice-nights` of
1 and 32, 2 and 32, 4 and 32, 32 and 32, 64 and 32, 1 and 1, and 2 and 1, every slice meets
both; the plan job was not run on a real night. `pair-passes=both` sweeps both every night.
- **Eleven functions: unmeasured when written (21 November 2026).** This entry was written before
a night ran them, and its extrapolations below, the 99 minutes for eleven among them, are of
that day: the first scheduled night of eleven took a span of 57.8 minutes and 720 runner-minutes
(the entry on twelve functions, below, with its file). asin, acos and atan2 join the night's
list, so the scheduled night runs eleven (atan2 sweeps one argument a night by
`pair-passes=alternate`, so its jobs are one function's worth at the defaults), and no night has
run them. Everything here is an extrapolation, not a reading. An estimate made for ten functions
of one argument, not derived in this document, was about 730 runner-minutes at the default 2
shards and 4 Arm shards (the 72 runner-minutes a function of the budget entry above would give
720); atan2 adds a function whose cost is not estimated. The plan job at the defaults makes 22
sweep entries, 44 for Arm and 22 for the fuzz, against the 256 each may hold; a run of nine or
more functions at 32 shards (288 for nine, more for eleven) exceeds that cap and the plan job
refuses it, and eight fit. No span is modelled here: the entry below computes its figures for
eight functions (about 72 minutes); scaling that by the count of functions gives about 90 for
ten and 99 for eleven, the budget's 90 and over it, which is arithmetic on an extrapolation and
no prediction. The first nights with eleven are the measurement, read as above; the levers below
are the answer if the median passes 90. **What `alternate` does about the slice:** the argument
it picks is `days / nights % 2 + 1` and the slice's night is `days % slice-nights`, and at the
defaults (1 and 32) the parity of the day is the parity of the slice's index, so a slice would
keep one argument for good, half of each argument's 128-bit slices never swept. The rotation
therefore turns over once every `slice-nights` nights when `nights` is below it (`(days / nights
+ days / slice-nights) % 2 + 1`), so a slice meets both arguments in two cycles of 32 nights,
and the same argument is swept on two nights running at each turn. Simulated over 20000 days for
`nights` and `slice-nights` of 1 and 32, 2 and 32, 4 and 32, 32 and 32, 64 and 32, 1 and 1, and
2 and 1, every slice meets both; the plan job was not run on a real night. `pair-passes=both`
sweeps both every night.
- **Twelve functions: an estimate from the eleven's night (23 November 2026).** hypot joins the
list as a second function of two arguments (`pairs`), swept one argument a night by `alternate`,
the same argument as atan2's every night (one rotation for both). The scheduled night of 22
November (run 44994568244, eleven functions, slots 6, 8 and 5) took 720 runner-minutes and a
span of 57.8 minutes, by `bench/pool/pool.py cost bench/pool/nightly-cost-2026-11-22.tsv` (its
row for that run; the file also holds the day's dispatch, run 44999281363, of six functions at 8
shards with both arguments of atan2, no night of the defaults): 210 in the sweep, 301 in the
fuzz and 209 on Arm, 65.4 a function by the mean, and atan2 the most, 87, summed from that run's
rows of atan2's jobs in the file (35.1 of sweep in 2 jobs, 29.2 of fuzz in 2, 22.7 on Arm in 4).
hypot adds 8 jobs (2 sweep, 2 fuzz, 4 Arm), and at atan2's cost about 87 runner-minutes, 807 a
night. For the span, replaying that night's jobs in the order they started on 6, 8 and 5 slots,
hypot's appended at the end, gives 46 to 47 minutes for each kind where the night took 49 (fuzz)
to 58 (Arm), since the gaps between one job and the next are not modelled; so the model's
increase is added to the measured 57.8, not its total: with hypot's jobs at atan2's durations
Arm, the kind that ended last, gains 4.4 minutes (the sweep 1.1, the fuzz 0.1), and with them at
each kind's longest job 8.4 (3.8 and 4.1), a span of about 62 to 66 minutes, under the budget's
90. It is an estimate on one night, with hypot's cost assumed to be atan2's, not a reading, and
high for the sweep, since atan2's sweep checks two arms and hypot's one (the fuzz runs a fixed
time whatever the arms, so its minutes are the same); the first nights with twelve are the
measurement, read as above. The plan job at the defaults makes 24 sweep entries, 48 for Arm and
24 for the fuzz; 16 shards make 192 sweep entries (224 with `both`), and 32 shards of all twelve
(384) are refused.
- **Slots 6, 8 and 5, and the 20 jobs (21 November 2026).** The matrices' `max-parallel` is 6
for the sweep, 8 for the fuzz and 5 for Arm: 19, and the proofs job makes 20, all of the free
plan's jobs while the matrices are full. The plan job runs before them and the fault-caught
Expand All @@ -1014,7 +1040,9 @@ blend and 10 to 23 instructions. At 128 bits the bodies are 8 to 16 times longer
and not the shards bound the span. Which of these to give up first is the owner's.
- **Not in it.** A cost of atan2's pair sweep: 13 times 72 assumes functions of one argument,
and atan2 joined with no night of its own run, so its place in the arithmetic is an
assumption (one function's worth at the defaults), not a reading.
assumption (one function's worth at the defaults), not a reading. One night has read it since
(87 runner-minutes, the entry on twelve functions), and the 13-function figures here are not
requoted from it.
- **When a night fails,** the `alert` job (the only one with `issues: write`) opens an issue
labelled `nightly-failure`, or comments on the open one, with the run's link, the seed, each
job's result, the dispatch inputs that replay the run (seed, `nights`, `shards`, `arm-shards`,
Expand Down
1 change: 1 addition & 0 deletions bench/pool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ when the logs are gone.
| `pool.py` | `fetch`, `table` and `cost` |
| `nightly-2026-11-03-to-2026-11-19.tsv` | the 664 recording jobs of the nightly's first 17 nights, runs 41612916834 to 44505887053: 332 x86 and 332 Arm, every one with a reading |
| `nightly-cost-2026-11-03-to-2026-11-19.tsv` | every job of those nights, its times and runs |
| `nightly-2026-11-22.tsv`, `nightly-cost-2026-11-22.tsv` | the same of 22 November: the scheduled night of eleven functions, run 44994568244 (`SKILLS.md`'s entry on twelve functions reads it), and a dispatch of six, run 44999281363; 184 recording jobs, every one with a reading |

The columns: `date`, `run`, `job` and `name` say which job; `cpu` is `/proc/cpuinfo`'s model
name (`-` on Arm, which has none); `cores`; `avx2`, `avx512f` and `avx512dq` are `yes` or `no`;
Expand Down
Loading