Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…py gap in two lines
…m sampling has no branch per pair
…air, its output unchanged to the bit
…its output unchanged to the bit
…rs, keeping the file under 600 lines
…not per pair, its output unchanged
…t, its output unchanged
…vel, its exponent carried past double precision
…cancels, as the Gaussian copula's does
…remainder is formed, so a tiny shape answers 0, not NaN
…l level too, from p·2^64
…mes less, y's rounding weighted by |ρ|, and never at ρ = 0
…ile_gap's doc names what it returns
…gits, and so do the closed-form and gamma quantiles in both tails
…s through a small-shape series
…branches, no ziggurat point mass at hz = MIN
…s or its terms underflow
…r, and the GED, gamma, Cauchy and Pareto quantiles keep their tails
…nd the copulas read them there
…ver, and the GEV moments stay finite past the Γ values' overflow
…al, and the rule test states what its pairs bracket
… takes the log path where the plain one cancels or underflows
…er law, as only a mass below 2⁵³·MIN_POSITIVE can produce one
…pecial.rs stays under 600 lines
…sit in as a constraint
…s room under 600 lines
…pula pins and truncated-normal row it moves are re-pinned
…ise band, 6e-12, as its bar
…l, its seventh declared mover
…ve terms above ½, and the GED, gamma and Cauchy quantiles keep their large-β, large-θ and tiny-γ cells
…es, and its concentrated-law test names cells off the point mass
…nential quantile stops at upper, and GED's closed form takes an accurate Γ(1 + 1/β)
…test doc states its constraint, and the Cauchy comment names the quotient's bound
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracking PR for the rc.5 stabilization round: release-pipeline and soundness blockers, the approved breaking API changes, and the stable-release policy, docs and CI. Merged only after the full battery passes on every wave.
Wave 1 benchmarks
Apple M4 Max, shared; rustc +1.99.0 (the
pre-wavepairs and Tasks 4–5 ran on +1.98.0, the default then); baselinespre-wave(Task 10) andpre-d18(= e7079b8); Δ = criterion median against the stored baseline, negative is faster; † = ABBA against a same-session build of the baseline (the reviewer's figure where one exists), used for every doubted row and where no stored pair exists.pre-wave→ Task 14 (rand 0.10 bump and seals; Task 14 = min of 7 runs of a bench binary byte-identical across the task, against the stored pre-wave median)Normal/simd/f32/N=32Normal/simd/f32/N=64Normal/simd/f64/N=32Normal/simd/f64/N=64LogNormal/simd/f32LogNormal/simd/f64Poisson/simdNormal/rand_distr/f32ThreadRngruns chacha20 instead of rand_chacha (Task 12)Normal/rand_distr/f64LogNormal/rand_distr/f32LogNormal/rand_distr/f64Poisson/rand_distrdist_multicoreNormal(ref) 2048², 1T / MTdist_multicoreExp(ref) 2048², 1T / MTdist_multicorePoisson(ref) 2048², 1T / MTdist_multicore18 othersample_matrixrows, 1Tdist_multicore18 othersample_matrixrows, MTdist_multicoreNormalfill_slicen = 4 … 65 536pre-d18→ Tasks 16–19 (D18 stateless distributions; large = 100 000 draws;scalar ÷ rand_distron the sameSimdRng, limit 1.3× for Normal and Exp and 1.5× for the rest;dist_multicore= ABBA minima from Task 17's final round (Tasks 16–17) and the reviewers' series (Tasks 18–19), MT swings 20–50 % so read it as ±15 %)tan(π(u−½))against rand_distr'stan(πu), libmtan7.45 vs 5.26 nsmemset_pattern16splats left in generic kernels go to Wave 3aMaybeUninitsink in Wave 3a (final-tree ABBA +4.8 %); seeded faster: compile-time lane constantsUnsafeCellstate gone (ABBA pop −2.3 %, fill −1.5 %); honest draw 45.7 → 31.5 ns once the CMS constants B and S are stored at constructionUnsafeCellsub-objects gone (ABBA pop −17.4 %, reviewer −9 … −18 %); ratio codegen-sensitive: LLVM if-converts rand_distr's inverse-Gaussian acceptance test or leaves a mispredicting branch (~10 ns)UnsafeCellsub-objects gone; no pre-d18 id (group added in Task 18), † = ABBA pop and fill; ratio codegen-sensitive as for NIGUnsafeCellsub-objects gone (ABBA pop −3.8 %, fill −8.0 %)fill_partsout of line took it from +4.7 % to +1.1 % against the pre-Task-19 build); MT: 0.13–0.21 ms job, min −26.2 % / median −3.6 %: noisepre-d18→ Task 20 (jump laws and the particle filter; jump rows = reviewer ABBA, median of 4 interleaved runs per variant)jump_processes/merton/256SimdNormalreplaces cdf-inversionScalarNormal(Task 20 alone −14.7 % against the pre-Task-20 build, the rest is Tasks 16–19)jump_processes/kou/256jump_processes/levy_diffusion/256jump_processes/merton/4096jump_processes/kou/4096jump_processes/levy_diffusion/4096gaussian_random_walk_transition, d = 1SimdNormalstream per component per step; implementer ABBA, 3 rounds, min of 11 rounds of 200 000 callsgaussian_random_walk_transition, d = 2gaussian_random_walk_transition, d = 8mledensity_eval/Ou/EulerTask 4 special functions and Task 5
ai_surrogate(before → after of the task; Task 4 before = 096541d, Task 5 before = candle 0.9.2)ProcessGeneration/process/Cts.samplespecial::gammais LanczosProcessGeneration/process/Cgmy.sampledensity_eval/Cir/Exactln_bessel_iewith the Hankel switch at max(50, ν²/2); the old 80-term series was wrong beyond z ≈ 100density_eval/Cir/transition_pdfdensity_eval/Cir/{Euler, Kessler, Ozaki, ShojiOzaki, Elerian}special/gammareflection, x < ½ (old(πx).sin()againstsinpi)CGMYFourier::price_callat y = 0.3 267.75 → 268.83 µs, +0.4 %special/bessel_ieseries / temme / hankel / cir_daily / uniform / reflection / ln_uniformcir_daily: 1.691 µs before the Hankel switch)bessel_ifamily, after onlyai_surrogate/train_epoch/rows_2048ai_surrogate/jacobianai_surrogate/predict_surfaces/rows_1024Wave 2 benchmarks
Apple M4 Max, shared; rustc +1.99.0; baselines
pre-w2-t3,pre-w2-t8,pre-w2-t10andpre-w2-t13, each saved before its task's change; Δ = criterion median against the stored baseline, negative is faster; a row outside ±3 % was re-measured ABBA (a1 old, b1 new, a2 old, b2 new build, interleaved; a regression only if both b runs exceed both a runs by more than 3 %) and its reason carries the four medians.pre-w2-t3→ Task 3 (RoughSimdfolded intoSimdFloatExt;rl_rough, 7 groups, 32/35 rows within ±3 %; shown: the 3 rows outside and, per group, the in-band row with the largest |Δ|)RL_BlackScholes/H=0.3RL_FOU/H=0.1RL_Heston/H=0.12/256RL_Heston_throughput/sample_par/16RL_Heston_throughput/sample_par/256RL_Heston_throughput/sample_par/1024RL_fBM_by_hurst/bilokon_wong/H=0.05RL_fBM_by_size/bilokon_wong/1024RL_fBM_throughput/sample_batch/64RL_fBM_throughput/sample_par/64pre-w2-t8→ Task 8 (DistributionExtreturnsOption,inv_cdfisquantile; 7/7 rows within ±3 %; each row is 4096 calls of the method)DistributionExt/pdf/normalDistributionExt/cdf/normalDistributionExt/quantile/normalDistributionExt/pdf/student_tDistributionExt/pdf/johnson_suDistributionExt/cdf/gammaDistributionExt/pdf/poissoncdf/gammawas re-measured at the wave head (4273e77), after Task 9 added two guards togamma_pon its path (x = ∞, NaN shape): 89.205 µs, +1.69 % againstpre-w2-t8, inside ±3 %.pre-w2-t10→ Task 10 (a finiteness assert on every float parameter of everySimd*::new;sample_ncpbelowdf = 1builds a Poisson and a Gamma law per draw, the per-draw construction path; 2/2 rows within ±3 %)NonCentralChiSquared/sample_ncp/df=0.5/small(1 000 draws)NonCentralChiSquared/sample_ncp/df=0.5/large(100 000 draws)Task 10's re-review also ran ABBA, base 6198ba6 against head d32ff86, on the
bessel_kegrid and the VG / GH / NIG / GIG negative log-likelihoods (the Bessel K path whose panics the task removed): every row within ±3 %, worst +0.76 % (no criterion files kept, so per-row medians are not listed).pre-w2-t13→ Task 13 (NaN propagates through the production max and min reductions; bench targetsfilteringandmle(evt_fit); 4/6 rows within ±3 %;gev_200_maximabuildsblock_maximaoutside the timed loop)particle_filter_n500_stepmax_or_nanmeasured +4.22 % (min b / max a of ABBA a1/b1/a2/b2 43.422 / 45.254 / 43.395 / 45.898 µs), so the fold keepsf64::maxplus a separate NaN flag; fresh ABBA 43.463 / 43.094 / 43.395 / 43.415 µs (−0.85 % / +0.05 %)metropolis_5k_after_burn1kukf_step_state2_obs1evt_fit/hill_20k_k500evt_fit/pot_20k_u3evt_fit/gev_200_maximaTask 13 also moved the Malliavin–Thalmaier payoff and localization folds to
max_or_nan/min_or_nan; no Thalmaier bench exists yet, so that path is unmeasured here — one is added when Wave 3e touches the engine.Wave 3c benchmarks
Fresh, same-session measurements of every row of
benches/copulas.rsat the tip against agit archiveof the wave basec2b6480f(its library, Task 1's bench file and base-API ports of the other rows), then the per-task tables from the task reports. Of the 33 rows, 25 have a base figure and 8 are new. Against the base, 18 rows are faster by more than 3 % (the closed-form and Brent inverses, the NAC density, the fits), 2 sit inside ±3 % (clayton_n10k+2.6 %,vine_fit_d4_n1k+0.1 %), and 5 are slower: four multivariate cdf rows by design (a 4000-draw Monte Carlo sample becomes 4096 Sobol points per query) andbivariate_cdf/gaussian_16qby 11 % (accepted: 0.17 µs per 16 queries, the price of the relative accuracy of Task 16f). The two Gaussian rows routed to Wave 3a and the two rows blamed on code placement (fgm_n10k,clayton_cvm_n300_r10) did not reproduce as regressions in this session; their numbers are under Known regressions.How the numbers were taken
git archiveofc2b6480fwith its own target directory. It predatesbenches/copulas.rs, so it carries Task 1's bench file (18007368) plus ports of the later rows to the base API. A row whose operation the base cannot run (NumericalorUnsupported) has no base figure and is marked new.a1 b1 a2 b2) of every row ran at load 9–12, because the machine did not quieten again within 12 minutes. The undecided rows were re-measured in three more alternations at load 3–6.bruns exceed botharuns by more than 3 %. The figures are criterion's median point estimates, taken as the median of the run medians.Wave level: every row of
benches/copulas.rs, HEAD against the wave basec2b6480fMedians in this session (criterion point estimates; the median of the run medians, 3 base runs against 3 or 4 HEAD runs (a fourth HEAD run on 15 rows, which changes no verdict), and 6 for the re-measured rows). "change" is HEAD over base. A row marked new has no base figure.
c2b6480feb8bc651and ±0.1 % againstba901c9a(Task 2b's own ABBA read +2.17 % for the row)ln h(Tasks 2b, 16c)ln hover the whole interval (Task 16c); the base's inverse was a bisectionNumericalfor most n (Task 2)partial_derivativeNumericalat θ = 3erfcregression here, see Known regressionsS/Cbookkeeping that buys it was accepted after B3's fix round 1 (+7 % over the absolute-accuracy form: 1.61 → 1.72 µs)h_inverseper integrand evaluation (Task 16); base: the Monte Carlo cdf2^dfinite differences of the cdf (Task 13b)fit(Task 7)578125b6measured the Spearman-proxy fit at 83 µs and the exact-τ fit at 1.43 ms, since cut to the series and closed forms of Task 16esample_with_seed(1000, Deterministic::new(1).next_seed()), Task 4's control); no changeerfcregression here, see Known regressionslocalminfor ν (Task 16b-i)fitwasUnsupported(Task 13)Base-only row from Task 1, measured in this session:
bivariate_sample/frank_brent_n2k(θ = 1, Brent) 6.36 ms (base1), 7.18 ms (a1), 7.00 ms (a2); HEAD's closed form at θ = 1 takes 14.2 µs (Task 2b), and at θ ≥ 2 the base failed.The per-row ABBA runs (a1 b1 a2 b2) behind every verdict above are kept with the wave's evidence.
Known regressions
multivariate_sample/gaussian_d5_n10kandfit/gaussian_fit_d4_n1k: routed to Wave 3a; not reproduced in this session. Block B3 measured +36–41 % and +11.7 % against its base9fa7020c(B2 had seen +10–12 % on the first row) and traced both to fat LTO no longer inlining libm'serfcinto the callers of distributions'norm_cdf(nm: the base keepslibm::erf::erfc2out of line and HEAD folds it intoerfc;/usr/bin/sample: the base inlineserfcinto the sampling and fit closures, HEAD calls it out of line, 2673 and 1610 samples; no source change on the path). Rebuilt here from agit archiveof9fa7020c, the two rows read −13.8 / −5.0 / −6.2 % and −2.4 / −0.4 / −2.6 % at the tip in three alternated pairs. Against the ruling's acceptance baselineeb8bc651they read −14.4 / −5.5 / +4.1 % (best of three −1.1 %) and −4.5 / −3.4 / −2.7 %; against the wave base −11.9 / −8.7 / −11.4 % and −9.7 / −9.5 / −10.1 % in the quiet pairs; againstba901c9a−6.8 / −7.8 / −1.9 % and +1.0 / 0.0 / +0.1 %.nmof the five bench binaries (wave base,eb8bc651,9fa7020c,ba901c9a, tip) listserfcanderfc2as separate out-of-line symbols in all five, andgaussian_d5_n10kvaries by up to 23 % between runs of one binary (the base alone ran 336–415 µs), so I cannot reproduce the code-generation difference B3 measured. B3's cause was not observed in this session, so Wave 3a re-measures both rows before it changes anything; this build already meets the acceptance (both rows within ±3 % ofeb8bc651by ABBA).fit/vine_fit_d4_n1k(+20.7 %) andbivariate_sample/plackett_n10k(+6 %), B3's two other regressions: fixed in its fix round 1. The BB1, BB7 and Student-t log-densities form their per-call logarithms once (f69cc09d) and the samplers invert their own uniforms through an unchecked inverse (856d8300). At the tip against9fa7020c: the vine fit +1.3 / +0.2 / +1.6 % (B3's fix round read +1.6 % the same way) and Plackett −1.5 / −3.3 / −3.1 %; against the wave base the vine fit is +0.1 % on the same input.gof/clayton_cvm_n300_r10: code placement, re-measured, not a regression now. Tasks 4 and 12 saw +5 … +7 % with the loop's source unchanged (note below). Here: −4.6 / −4.6 / −6.7 % against the base in the quiet pairs, −3.0 / −4.6 / −3.4 % againsteb8bc651, −0.2 / −3.7 / −0.1 % against9fa7020c, −3.2 / −2.8 / −1.7 % againstba901c9a; the one +7.2 % (b1againsta1) was taken at load 9–12.bivariate_sample/fgm_n10k: code placement, re-measured, not a regression now. B3's last report saw +7–9 % in ordinary builds againstba901c9a(22.9 against 24.6–25.3 µs; level in builds with every function aligned to 128 bytes and every loop to 64, the loop being the base's instruction for instruction). Here: −0.1 / +0.3 / +1.3 % againstba901c9a(best of three +0.7 %, 22.34 against 22.50 µs) and +7.2 / −6.6 / −7.6 % againsteb8bc651. The one row that reads over 2 % againstba901c9aismarshall_olkin_n10k(+4.1 / +2.1 / +4.0 %, with min b under max a, so inside the rule; −0.1 / −3.3 / −1.6 % againsteb8bc651).bivariate_cdf/gaussian_16q: +11 % against the base, accepted. 1.54 → 1.72 µs for 16 queries, every pair over 7 %; the cdf holds 1e-12 relative accuracy at every ρ and in both tails since Task 16f, and theS/Cbookkeeping that buys it was accepted after B3's fix round 1 (+7 % over the absolute-accuracy form: 1.61 → 1.72 µs against9fa7020c).multivariate_cdf/cvine_d4_16q: a further +10 % in cycles in the final fix, accepted. The BB1 pair'sh_inversenow runs the bivariate family'sln hquantile, one inverse per family (+23.4 % instructions, +10.1 % cycles againsta164020b).amh_n10k+8.6 %,fgm_n10k+14.1 %,plackett_n10k+8.7 % andfrank_n2k+3.8 % in cycles: the open-cube rule, accepted. The cost is one pass that moves an exact 0 or 1 one ulp inside, about 6 instructions a draw on these 38–44-instruction samplers. AMH and FGM stay over 200× faster than at the wave base.multivariate_cdf/gaussian_d3_16q+1846 %,t_d3_16q+1937 %,dvine_d3_16q+900 %,cvine_d4_16q+212 % (Tasks 15 and 16: Genz and Sobol QMC replace a 4000-draw Monte Carlo sample). Every other row outside ±3 % is faster.The
clayton_cvm_n300_r10placement noteThe row calls
gof_cramer_von_mises, whose bootstrap loop (rosenblatt,cramer_von_mises_independence,pseudo_observations,Clayton::fit) is the same functions at the base and at the tip apart from the seed argument (Task 4) and a different bootstrap draw (Task 5). Two earlier measurements found it 5 % slower with no source on the path to blame, and both traced it to where the linker put the code: Task 4's ABBA read +4.75 … +5.37 %, a hand-rolled copy of the old loop ran 5.1 % slower in the new binary and the newgofonly 1.6 % over base; Task 12 read +4.9 … +6.7 %, and an address-normalised disassembly diff showed the loop and 11 of its 12 callees identical,pseudo_observationscalling an out-of-linendarrayconstructor, three hot functions moved to a different 64-byte alignment, and a variant with all 12 callees identical to the base still +7 %. B3 saw +3.8 %. In this session the row is under the base in every quiet pair (1.06 ms against 1.11–1.14 ms), undereb8bc651(1.04–1.06 against 1.07–1.09) and underba901c9a(1.01–1.02 against 1.03–1.05), and the lone +7.2 % is a load-9–12 run: the placement moved with later commits and the row is inside ±3 % today. It would move again with any unrelated change; no bench row or test depends on it.Final fix rounds (
a164020b→8f2aba11)The final review's fixes, and the residual round its re-review asked for:
vto[1e-12, 1 − 1e-12].normal_quantile, with the point-mass law atv ∈ {0, 1}.x − ρyis formed directly where its rounding bound allows, and from the refined quantile gap past it.ln chold 1e-12 on both sides of the switch: relative for h and its inverse,1e-12·max(1, |ln c|)forln c.1 ± aas(1 − |θ|) + 2|θ| min(v, 1 − v), so it holds 1e-12 near θ = ±1.1e-12clamp is left in the elliptical transforms, the vine pairs or the samplers.d = 2, every multivariate density equals its bivariate family to 1e-12.DimensionMismatch(aValueErrorin Python);try_new;partial_derivativeis a required method;pickandsanswers NaN outside [0, 1];sin(πτ/2)uncapped;v.No stream pin moved.
How it was measured. The machine was loaded throughout (load 8–65) and never quietened. So the counts that load does not move decide: instructions retired and cycles per row, the minimum of three alternations.
Round 1 ran every row against a
git archiveofa164020b, also in ABBA. Two of its fixes first cost more:The round's three perf commits brought both back inside the band. These rows ended outside ±3 % in either count:
h_inverseruns the bivariate family'sln hquantile (one inverse per family)normal_quantile's subnormal testThe residual round, against
0f4bbd3b, ended with these rows outside ±3 % in cycles:Every other row is within ±3 % in cycles.
Per task: the medians each task recorded against its own baseline
Criterion medians as the task reports recorded them (µs unless marked). Every number below is transcribed from the task's own report; the raw criterion data of the earlier tasks was not kept. A row outside ±3 % carries its accepted reason; "ABBA" is the
a1 b1 a2 b2recipe against agit archiveexport with its own target dir.pre-w3c-base(Task 1, the 13 rows as found; the three fit rows re-saved at the 9 s window) and Task 2's new rowTask 2's three untouched rows read +0.85 % / +0.29 % / +1.39 % (clayton, frank, gaussian) against this baseline.
pre-w3c-t2b(Task 2b, closed-form conditional inverses; ABBA medians a1 b1 a2 b2)ln h)gofloop is unchanged)Frank at θ = 4 has no "before" (every seed failed at n = 2000); after: 18.0–18.3 µs. The old θ = 1 Brent row took 6533/6567 µs against 14.2 µs for the closed form (about 460×).
pre-w3c-t3(Task 3,ArrayViewinputs)pre-w3c-t4(Task 4, every draw takes&seed)pre-w3c-t5(Task 5, the goodness-of-fit test; tip of the fix round against the baseline)check_marginalcalls cost 3.99 µs per call)pre-w3c-t7(Task 7, τ helpers and fits that reject τ outside the family;copulas/fit)pre-w3c-t9(Task 9, constructors own the parameter invariants)The plain compare read every row +18 … +147 % at load 65–94 (another session ran
cargo testin the same checkout, a VM held 4–6 cores), so the table is the ABBA: "tight" is the best base median against the best task median over 5–15 alternated pairs (or the best of the two full-run pairs).The ABBA rule flags no row.
pre-w3c-t11(Task 11, τ-b and onepseudo_observations; final code, load 10–12, ABBA a3 b3 a4 b4)pre-w3c-t12(Task 12, vines carry their variable order andfitselects structure and families; ABBA)fit_vinenow tries every candidate family per edge (Student-t profile 13–17 ms, BB1 ≈ 10 ms, BB7 20–240 ms per edge at n = 1000)pre-w3c-t15(Task 15, deterministic Genz–Bretz cdfs and exact bivariate t cdf;copulas/multivariate_cdf)No bench row covers
TCopula::cdf; per evaluation on an export of the base: ν = 4 39.5 µs → 0.94 µs, ν = 4.5 40.3 → 5.5, ν = 31 44.1 → 1.09.pre-w3c-t16(Task 16, vine cdfs by Sobol-driven inverse Rosenblatt; ABBA)h_inverseper integrand evaluation