Conversation
c1e650a to
d0e0c1b
Compare
d0e0c1b to
4c8974f
Compare
4c8974f to
2760ee1
Compare
|
🤖😈 Adversarial review — #78 (design doc for M3) The rewrite reads well, and dropping the markers is the right call. §4.3's per-primitive table is much easier to trust than the five special-cased rules. Three places where the doc now says something the code doesn't back up:
Also missing from §4.6: the tape currently lives in the caller's catalog under global names, which makes concurrent use of one context unsafe (#79). Whatever the fix is, it deserves a decision-log entry beside S6/S7. |
2760ee1 to
1348bc5
Compare
|
All four recorded in 6b5d753, with decision-log entry S11.
|
1348bc5 to
570be55
Compare
|
Added
🤖 Generated with Claude Code |
570be55 to
16d5949
Compare
|
Added 🤖 Generated with Claude Code |
16d5949 to
e2a6dc3
Compare
|
Added a sentence to §4.4 stating which MAX/MIN arguments get the 8-ulp tie tolerance (only those read from an aggregate's output), and sharpened the S13 note to match. Follows #76's fix for #102. 🤖 Generated with Claude Code |
e2a6dc3 to
4ce19d1
Compare
85cd600 to
aa91fff
Compare
|
😈🧪 Adversarial tester: ✅ approved for correctness. Reviewed at |
9f1268f to
a2febb9
Compare
5ecbf7b to
a64ab63
Compare
a49b9a3 to
ae26d22
Compare
4014e37 to
50edebe
Compare
§2's principle 3 is restated: derive what the operators say, be told only what they cannot. §4.3 gives one transpose rule per relational primitive, with AVG, MAX and MIN reduce rules and both argmax idioms. §4.4 describes grad and vjp as built: dims and values, saved aggregates and recomputed regions, fan-in by UNION ALL, dense gradients shaped like their tables, late-bound reads. §4.5's example is nn.py's own loss query, unchanged. §4.6 and §8 record M3. Decision log S6-S10, S10 recording why the tagging markers were dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CvszJhH8pn8H9G69wEPMU2
§4.1's ReLU claim now holds and says how; §4.3's map row covers CASE, greatest and least. §4.4 states that recomputing a region assumes the engine returns the same rows, and that rankings must be total; that dims are checked at run time; the NULL and type conventions of a gradient; and per-program table names. §4.6 lists recomputation's remaining engine assumptions (volatile functions, repeatable scans). S8 notes the run-time check; S11 records why each program's tables live under their own prefix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CvszJhH8pn8H9G69wEPMU2
The MAX/MIN rule now finds its rows with windows over the recomputed rows; an aggregate's NULL-skipped rows get no gradient; the "same rows" checks cover a LIMIT, a semi-join's ranking, rankings in constant data and volatile functions, so volatile functions leave §4.6's open list, and near-tie jitter joins it. S12 records what the soak found and where each fix went. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CvszJhH8pn8H9G69wEPMU2
A forward-mode oracle found no calculus errors; what broke was the size of the plans DataFusion builds from ddx's (names by expression, nested folds, one projection per cotangent), plus grad-in-SQL comments, vjp cotangent keys and the tie tolerance. S13 records each and its fix, and the one limit left: a very deep chain is still large from Python. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CvszJhH8pn8H9G69wEPMU2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CvszJhH8pn8H9G69wEPMU2
alxmrs
left a comment
There was a problem hiding this comment.
TL;DR: Design update is fine; this is basically internal only.
Stacked on #77. Docs only; closes out M3.
The design's v2 sections were written before any of v2 existed, and several things changed on contact with real plans and with review. This brings the doc in line and records why:
grad/jvpin v1,ddx_stop_gradientin v2.SUM,AVG,MAX,MINandCOUNTunder reduce. A contraction is those rules composed. Both argmax idioms are covered:MAXshares ties likejax.grad, while a rank filter gives the tie to the row itsORDER BYkept. The DuckDB window round-trip bug and its workaround stay. Stop-gradient is the one thing a query tells ddx.grad/vjpas built: dims and values, saved aggregates and recomputed regions (the checkpointing choice), fan-in asUNION ALLplusSUM, gradients shaped like their tables, and late-bound reads.🤖 Generated with Claude Code
https://claude.ai/code/session_01CvszJhH8pn8H9G69wEPMU2