1// What the shipped solvers must achieve, shared by both test suites
2// (test/solver-test.ts through numbl, test/matlab-test.ts in real
3// MATLAB). Keyed by the solver's source directory rather than its id, so
4// that manifest entries sharing one solver.m — mfs and mfs-mat, and
5// likewise nystrom-dlp — are held to the same expectation whichever
6// runtime executes them.
8/** Best relMax the solver must reach somewhere in its full sweep. */
9export const MUST_REACH: Record<string, Record<string, number>> = {
10 // On flower-15 the MFS charge curve, a fixed 0.3 outside a boundary
11 // whose curvature radius is 0.014, self-intersects and puts charges
12 // inside the domain; the floor is only a sanity check that the solver
13 // still returns something, and MUST_NOT_REACH below is the real test.
14 mfs: {
15 "disk-easy": 1e-12,
16 "star-medium": 1e-12,
17 "star-hard": 1e-4,
18 "flower-15": 1e-2,
19 // Convex geometry and charges far from every target: MFS is the best
20 // method on the corner instance, so this floor is a real requirement.
21 "square-corners": 1e-11,
22 // Charges 0.3 out and targets 0.005 in: the charge curve overshoots
23 // the sources, as on star-hard, and the near-boundary targets cost
24 // nothing extra because the representation is smooth up to it.
25 "star-nearfield": 1e-4,
26 },
27 "nystrom-dlp": {
28 "disk-easy": 1e-10,
29 "star-medium": 1e-10,
30 "star-hard": 1e-8,
31 "flower-15": 1e-6,
32 // Loose because the numbl sweep stops at 1536 nodes, where the target
33 // 0.005 inside a corner is still at 1e-3; the MATLAB twin, whose list
34 // runs to 4096, gets to 7e-9 and passes the same floor.
35 "square-corners": 1e-2,
36 // Looser still: uncorrected quadrature at a target 0.005 from a
37 // boundary resolved at h = 0.0059 (1536 nodes) is worth about 1e-2,
38 // and the MATLAB twin at 4096 only reaches 7e-6.
39 "star-nearfield": 5e-2,
40 },
41 // chunkie's default quadrature tolerances cap it near 1e-11, and its
42 // sweep is checked on the extreme instances only.
43 "chunkie-dlp": {
44 "disk-easy": 1e-10,
45 "star-hard": 1e-9,
46 "flower-15": 1e-9,
47 "square-corners": 1e-8,
48 // The instance chunkie exists to win: its corrected near-field
49 // quadrature has to hold the same accuracy at a target 0.005 from the
50 // boundary that it reaches in the bulk.
51 "star-nearfield": 1e-9,
52 },
53};
55/** Accuracy the solver must NOT reach. MFS is required to do badly on
56 * both hard instances, for the two different reasons they exist: on
57 * star-hard its charge curve lies beyond the data's singularities, and on
58 * flower-15 the fixed offset self-intersects and puts charges inside the
59 * domain. If either suddenly reached high accuracy, the instance would no
60 * longer be testing what the spec says it tests. */
61export const MUST_NOT_REACH: Record<string, Record<string, number>> = {
62 mfs: { "star-hard": 1e-8, "flower-15": 1e-8 },
63 // star-nearfield exists to measure near-field evaluation, and the plain
64 // trapezoid rule has none: if this solver ever reached high accuracy at
65 // a target 0.005 inside the boundary, either it acquired a near-field
66 // correction or the instance stopped placing its targets there.
67 "nystrom-dlp": { "star-nearfield": 1e-8 },
68};