diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index f6ce9717c4..d8243aeb3f 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -11,7 +11,8 @@ # data: passes when all of the above pass (the name the pull requests show). # browser: a Chromium smoke test of the gallery, the viewer (60 sequences: every point drawn at # its term, the viewer's own fingerprint check, the OEIS link), a sequence page and its -# CSV, and the "How it works" page (tests/smoke.mjs). +# CSV, and the "How it works" page (tests/smoke.mjs); the Lab: its kernel against the +# published rows, every control record against its rules, the filters (tests/lab.mjs). name: checks on: @@ -88,7 +89,8 @@ jobs: [ "$ROWS" = success ] && [ "$SITE" = success ] browser: - runs-on: ubuntu-latest + # pinned: Playwright 1.56.1 has no Chromium build for ubuntu-latest's 26.04 image + runs-on: ubuntu-24.04 timeout-minutes: 20 steps: - uses: actions/checkout@v4 @@ -104,3 +106,4 @@ jobs: python3 -m http.server 8765 > /dev/null 2>&1 & sleep 2 node tests/smoke.mjs + node tests/lab.mjs diff --git a/README.md b/README.md index 9a44f8378c..7d09927568 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,8 @@ live example. Background: [decompwlj.com](https://decompwlj.com) and Changing view is one smooth camera flight (the perspective flattens into the 2-D views and back, a "dolly zoom"), and a new sequence fades in. The views fit the free space of any screen, from a phone (portrait or sideways) to QHD and UHD, with points and labels scaled to the canvas. +- πŸ”¬ **Lab** ([`/lab/`](https://decompwlj.net/lab/)): a second mode, separate from the viewer, that sets each + sequence against randomised **controls** in seven linked panels. See [The Lab](#the-lab) below. - 🧭 **Similar sequences**: the eight nearest in the catalogue's decomposition figures (level, tie, L = 1, forced and decomposable shares; ranges of a, k, L and d), each one click from the viewer or from a comparison. @@ -68,6 +70,41 @@ live example. Background: [decompwlj.com](https://decompwlj.com) and - πŸ“¦ Plain static files: no server code, no database, no build step. - πŸ”’ Privacy-friendly visit counts ([GoatCounter](https://www.goatcounter.com)): no cookies, no personal data. +## The Lab + +![The Lab: the primes against their residue controls](docs/img/lab.webp) + +The Lab asks one question of each sequence: how much of what the decomposition shows comes from the +sequence itself, and how much would any sequence with the same jumps and the same congruences show? +Each record keeps its jump d and the residue of β„“ = a βˆ’ d modulo M. β„“ is then redrawn at random +within Β±25 % and decomposed again with the same kernel. M runs through 1, 2, 6, 30, 210, 2310 and +30030, so the control learns the sequence's congruences one prime at a time. + +- **Plates.** The sequence and its control, on the same records, as square weight–level plates (log k + against log L, equal scales: the diagonal k = L is the class boundary). +- **The residue ladder.** The level share and the L = 1 share, sequence minus control, at each M, + with Β±2Οƒ. A step where the gap closes names a modulus that carries the structure. Click a step to use + that control in every chart. +- **Level share along n.** The sequence against the control band, by window. Drag to keep a range of n. +- **Jumps.** The commonest jumps. Click one to keep only that jump. +- **The congruence lock.** r Β· Pr[r | β„“] for the primes r ≀ 113, against chance (1) and the + Hardy–Littlewood value r/(r βˆ’ 2) of consecutive primes. +- **Columns and lines.** How often each small weight k and level L occurs, sequence against control. +- **Your sequence.** Paste a list or an OEIS b-file. It is decomposed in the browser and set against + the same controls. Nothing is uploaded. + +The filters (a range of n, one jump, the modulus M) apply to every chart and are kept in the link: +`/lab/#primes.M210.g6.n1000-50000`. The controls run in worker threads on a seeded random subsample +of 10,000 or 25,000 records, or on all of them, so every figure is reproducible. The kernel +(`lab/kernel.js`) is exact below 2⁡³. It uses trial division, a deterministic Miller–Rabin test and +Pollard–Brent rho, all in doubles with exact products. It was checked against PARI/GP 2.15.4 on 55,003 +cases, adversarial ones included, and against 180,000 published rows of 60 sequences up to 9Β·10¹⁡. + +The Lab shows where a sequence departs from its controls. It does not explain why. When β„“ is small next +to M, the control can barely move it: the ladder's *frozen* column gives the share of such records, +and where it is large the gap at that M is understated. For the primes, what remains after M = 30030 +is the Hardy–Littlewood local factor of every larger prime, which no finite M keeps. + ## Run it locally ```sh @@ -185,6 +222,7 @@ a hard reload (Ctrl+F5, Cmd+Shift+R) clears the cached `index.html` and `data/ca | `/#primes.kLd.iso.solid.vs-A001359` | a comparison (add `.split` for side by side) | | `/seq/A000040/` (or `/A000040`) | the sequence's static page, with **Download CSV** | | `/seq/`, `/family/primes/`, `/learn/` | all sequences, one family, how it works | +| `/lab/#primes` (or `/lab/#A000040`) | the Lab, on a sequence; add `.M30`, `.g6`, `.n1000-50000` for a modulus, a jump, a range of n | **Keys** β€” gallery: `/` search, `R` random, `T` theme, `Home` top. Viewer: `G`/`Esc` gallery, `↑`/`↓` neighbouring sequence, `R` random, `1`–`5` views, `V` overlay/side by side, `C`/`P` side @@ -209,9 +247,10 @@ Sequence panel) leads back to the sequence's page; browsers that support it cros | `share/.jpg` | Link previews of the sequence pages (600 Γ— 315) | | `seq/`, `family/`, `learn/`, `404.html`, `sitemap.xml`, `robots.txt`, `og.png` | Static pages, written by `tools/seo.py` | | `css/pages.css` | Stylesheet of the static pages | +| `lab/` | The Lab: `index.html`, `lab.js` (charts, filters), `worker.js` (controls), `kernel.js` (the exact kernel) | | `vendor/` | three.js r169 and OrbitControls, unmodified; mp4-muxer 5.2.2, minified (MIT) | | `tools/` | Generator, OEIS metadata, encoders, audit and page builders (not needed at runtime) | -| `tests/smoke.mjs`, `.github/workflows/checks.yml` | Automatic checks | +| `tests/smoke.mjs`, `tests/lab.mjs`, `.github/workflows/checks.yml` | Automatic checks | | `deploy/` | Apache and nginx examples | | `docs/SEQUENCES.md` | Every sequence by family, and how the data was verified | | `docs/img/` | The screenshots of this README | @@ -316,7 +355,10 @@ parallel jobs so that checking everything takes no longer than sampling did: sequence in 25 from the site's own chunks; `seo.py` must rewrite the same HTML; - **data**: passes when the rows and the site pass; - **browser**: `tests/smoke.mjs` drives Chromium through the gallery, the viewer, sixty sequences - (every point drawn checked against its term), a CSV download and the How it works page. + (every point drawn checked against its term), a CSV download and the How it works page; + `tests/lab.mjs` runs the Lab on the primes and on the sequence with the largest terms. It checks the + kernel against the published rows, every control record against its rules (by brute force where + β„“β€² < 10⁷), the seeded ladder after a reload, the filters and the link, a pasted sequence, and a phone width. Locally: @@ -324,6 +366,7 @@ Locally: python3 tools/check_site.py && python3 tools/audit.py data --every 25 python3 tools/check_derived.py # every fingerprint and plate (about 7 min on 4 cores) python3 -m http.server 8765 & node tests/smoke.mjs # needs: npm install playwright +node tests/lab.mjs # the Lab ``` ## Troubleshooting diff --git a/docs/img/lab.webp b/docs/img/lab.webp new file mode 100644 index 0000000000..6ec18a2008 Binary files /dev/null and b/docs/img/lab.webp differ diff --git a/index.html b/index.html index b484a20c52..8de589e163 100644 --- a/index.html +++ b/index.html @@ -724,6 +724,7 @@

Decomposition into weight Γ— level + jump, 5000