Repository navigation
feat(viz): geom_histogram + geom_freqpoly + geom_density layout rows at ggplot2 4.0.3 parity (PLOT-GG-001) - #7128
Conversation
…4.0.3 (PLOT-GG-001, #6962) layout() now resolves one ungrouped geom_histogram: stat_bin as ggplot2 4.0.3 computes it (bins, binwidth, boundary, center, closed = right, fuzzed edges, bin_breaks_bins' width quirk, zero-range 0.1 width), x scale trained on the bin edges, y on 0..max count. Grouped histograms, empty, non-finite or invalid args return typed errors; the other four distribution kinds still return NOT_BUILT; renderers still refuse. Measured: 8 R-generated cases (default, bins 10 and 1, binwidth 2, boundary, center, bins+boundary, constant) match count, x, xmin, xmax, density and both panel scales; aprender-viz --lib 842 passed. Refs #6962 #6909 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
stat_density ported from ggplot2 4.0.3 / R 4.6.2: bw.nrd0, linear binning onto a 2n grid, the exact circular convolution (equal to R FFT up to rounding), approx onto 512 points. layout() builds one ungrouped geom_density layer; grouped, constant, one-value input is a typed Err. Fixtures (4 cases) made by R 4.6.2 / ggplot2 4.0.3 on kfocus under C collation. Measured: 4 oracle cases, max abs error 2.7e-15 (tail FFT noise), max rel 1.3e-15 where density >1e-3; tolerance 1e-9 rel + 1e-12 abs. Mutations (0.9 factor, ext 4->3, sd-only bandwidth) turn the oracle red. geom_density is not a core ontology row, so the contract binds no entity. contracts.nt, the pv-sat witness and the README count (1728) regenerated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…m_histogram row contract Keeps stat_bin (histogram) and stat_density (density) side by side: BuiltLayer carries both `bins` and `density`; layout() dispatches Histogram and Density; dist_math.rs holds both kernels; both oracle modules are wired. Adds ggplot2-row16-histogram-v1 bound to core row geom_histogram, a histogram refusal test, explicit oracle test fns (the contract scanner cannot see macro-made ones), and regenerates contracts.nt, the pv-sat witness and the README count (1729). The ggplot2-row bound count in shapes_gate_ggplot2_tests.rs goes 7 -> 8. Refs #6962 #6964 #6909 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…+ position_stack (PLOT-GG-001, #6962) stat_bin cuts every group at the edges of all of x and keeps empty bins; the counts are stacked by the bar rows own position_stack. Three R-generated oracle cases (two groups, three groups with empty bins, default bins). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Generated files regenerated, not merged by hand: contracts.nt (pv extract), the pv-sat witness, and the README contract count (readme_sync.sh --write, 1730). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
stat_bin with pad = TRUE (one zero-count bin at each end, as wide as its neighbour) through GGPlot::layout(), ungrouped. New math stat_bin_padded in dist_math.rs, one dispatch arm and freqpoly() in dist.rs, oracle module ggplot2_dist_freqpoly_oracle.rs with 7 R-generated cases, and the ggplot2-geom-freqpoly-v1 contract (geom_freqpoly is not a core ontology row, so no entity binding). Regenerated contracts.nt, the pv-sat witness and the README contract count. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… stacking falsifiers Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Keeps histogram (stat_bin_groups), freqpoly (stat_bin_padded) and density. Witness is stale until regenerated by pv-sat in the next commit. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
§13.11 rung 1 — quorum shadow verdict Shadow mode: this records a verdict and merges nothing. A refusal |
…tness and README count - stat_bin_padded builds from bin_breaks/bins_from_counts (stat_bin is test-only after the histogram row); pad_bins fills ymin/ymax/group. - freqpoly oracle prints its max abs error per case. - freqpoly FALSIFY-GFP-002 named a bins1 fixture that does not exist; it now names bins10. - witness census id set and README contract count regenerated by pv-sat / readme_sync.sh. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
NON-AUTHOR REVIEW: FAIL @e79d243f4b9747443919d25e14d85e6f79d0f62d Lane: agy, model claude-opus-5-5-high (gemini-4-hydrogen-high returned 429 quota). Two calls (engine; tests/contracts/body). Both VERDICT: FAIL. Blockers:
Should-fix (summary): r_mod is not R's myfmod (boundary-rescale case untested); edges/density not total for huge or lost-precision widths (typed Err needed); O(G*N) groups and unbounded bins x groups allocation; +-Inf refused instead of dropped; all errors are Error::Rendering strings; GGH-007 stacking half not asserted; PR body "ont-delta: none" contradicts contracts.nt +31/-1 and bound count 7->8; contract text says "constant" but IQR=0 is also refused. Receipt: /mnt/nvme-raid0/cop-inbox/handoff/agy/review-aprender-7128-e79d243-agy.md |
…ds; sharper density falsifiers (PLOT-GG-001, Refs #6909) bw_nrd0 now takes min(sd, IQR/1.34) and, when that is 0, falls back to sd, then abs(x[1]), then 1, as stats::bw.nrd0 does. New R fixtures iqr0, constant, zero (ggplot2 4.0.3). FALSIFY-GGD-004/005 restated so a mutation turns them red; FALSIFY-GGD-007/008 added. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Fix round for the review of e79d243 (new head 4b483b7).
|
|
NON-AUTHOR REVIEW: FAIL @4b483b71162f53abc790f03b6c4ef1c86560444e Lane: agy, claude-opus-5-5-high (gemini-4-hydrogen-high returned 429 quota). Two calls: engine PASS, tests/contracts/body FAIL. Old blockers 1-3 are resolved (nrd0 chain matches R; Blockers (confirmed against diff:
Should-fix: GGD-008 names only Receipt: /mnt/nvme-raid0/cop-inbox/handoff/agy/review-aprender-7128-4b483b7-agy.md |
…ter fixtures that move the edges (PLOT-GG-001, Refs #6909) - FALSIFY-GGH-004/GFP-004: the binwidth path never reaches bins_params, so the mutation is now in breaks_width (ignoring the given boundary). - FALSIFY-GGH-005/GFP-005: binwidth5_center0 gives the same edges as the default (center 0 lands on width/2 mod width), so it could not see center. New R fixtures binwidth5_center1 (edges -1.5, 3.5, ... vs -2.5, 2.5) and bins10_center0 (bins path), oracle cases through the public layout() path; the center falsifier now names binwidth5_center1. - FALSIFY-GGH-003/GFP-003: the origin floor-to-ceil mutation survived binwidth2 (min x sits on a boundary); binwidth2 now backs "binwidth wins over bins", new -014 backs the origin with binwidth5_center1. New -012/-013 cover boundary and center on the bins path. - FALSIFY-GGH-007 names groups2 (stacking); FALSIFY-GGD-008 names constant and zero; GGD bandwidth_cases description narrowed to what its check covers. - contracts.nt: two new histogram fixture triples (pv extract). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Fix round for the second non-author FAIL (head 94a8151). Mutations were applied on framework16 one at a time, the named test run, then reverted.
CI: at e79d243 Verification (framework16): fmt rc 0; clippy rc 0; aprender-viz lib 888 passed; aprender-contracts lib 2403 passed rc 0; pv validate x3 rc 0; ont-consistency rc 0; readme_sync rc 0; contracts_gate.sh: the |
|
NON-AUTHOR REVIEW: PASS @94a8151b2ff7920ebdb44a266e904c098d6175f6 Lane: agy, fallback to claude-opus-5-5-high (gemini-4-hydrogen-high returned 429 quota; the Opus answer is complete). Head re-read before posting. Blockers: none. Both review-2 blockers are fixed. I traced every falsifier (GGH-001..014, GFP-001..008/012..014, GGD-001..008) from the named test through dispatch to the mutated function and checked by arithmetic that the case's output changes: GGH/GFP-004 (breaks_width boundary, binwidth1_boundary0: origin 1 vs 0.5), -005 and -014 (binwidth5_center1: first edge -1.5 vs -2.5 and 3.5), -012 (bins5_boundary2: -6.125 vs -3.0625), -013 (bins10_center0: -1.8056 vs -0.8056). All rows reach and change. Should-fix (not blocking):
CI at review time: no check red on this PR (3 pending, 8 skipping). Receipt: /mnt/nvme-raid0/cop-inbox/handoff/agy/review-aprender-7128-94a8151-agy.md |
…14 renumbered 009-011) (PLOT-GG-001, Refs #6909) pr-light fail_fast ids reported 2 new test ID gaps. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
pr-light failed on fail_fast ids: FALSIFY-GGD-006 sat after 008 in the density contract and FALSIFY-GFP jumped 008 to 012 in the freqpoly contract. Reordered/renumbered the ids only (no test or code change; fail_fast ids now 0 gaps, aprender-contracts --lib 2403 passed). Head moved, so a new non-author review is needed at the new head; auto-merge disabled. |
|
NON-AUTHOR REVIEW: PASS @7ce93f87bf92f08f937feb620ce6a5220ebffabe Delta 94a8151...7ce93f8 (1 commit) touches 2 files only:
Findings: none blocking. Info: the 94a8151 review table's GFP-012..014 rows are now GFP-009..011. |
Keeps main's geom_area/geom_ribbon/position_dodge rows (BuiltFilled) and the PR's dist rows (bins/density); BuiltLayer carries all three. contracts.nt and the witness regenerated with pv extract + pv-sat; ggplot2-row bound count is 11. Pmat-Ticket: PMAT-6962 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(readme): regenerate the contract count 1731 -> 1734 (main red since #7128) #7128 added three contracts without running readme_sync, so FALSIFY-README-002 and readme_sync fail on main. Forward fix: scripts/readme_sync.sh --write. Replaces revert #7161, which the ONT ratchet refuses (contracts_anchored 96 -> 95). Pmat-Ticket: PMAT-6962 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
What it adds
Three distribution rows of PLOT-GG-001 (ggplot2 4.0.3), folded into one branch:
stat_bin(pad = FALSE) layout, ungrouped and grouped (stacked: every group cut at the edges of all of x, empty bins kept, counts stacked byposition_stack()),BuiltLayer.binswithymin/ymax/group. Row contractcontracts/trueno-viz/ggplot2-row16-histogram-v1.yaml, bound to core rowgeom_histogram.stat_bin(pad = TRUE)as a path through the bin centres, ungrouped; scales retrained on the padded edges. Contractggplot2-geom-freqpoly-v1.yaml(binds no core row).stat_density(bw.nrd0, linear binning, circular convolution, 512 points), ungrouped layout. Contractggplot2-geom-density-v1.yaml(binds no core row).layout()dispatches Histogram, Freqpoly and Density; all three oracle modules are wired.stat_binneeded one semantic fix:stat_bin_paddedbuilds frombin_breaks/bins_from_countsandpad_binsfillsymin/ymax/group. Freqpoly falsifier FALSIFY-GFP-002 named abins1fixture that does not exist; it now namesbins10.contracts/contracts.nt(changed bypv extract, see ont-delta), README count (1731, thecontracts/census.jsonvalue, the same as on main at bb2ffa3; not re-derived at this head).Oracle cases and max abs error
freqpoly-oracle <case> max_abs_err=...).Verification (rc read directly, head 94a8151)
cargo fmt --all -- --checkrc 0cargo clippy -p aprender-viz --lib --tests -- -D warningsrc 0cargo test -p aprender-viz --librc 0 (888 passed)cargo test -p aprender-contracts --librc 0 (2403 passed, 5 ignored) on the working tree before the final commitpv validateon the three dist contracts rc 0;pv lint contracts --gate ont-consistencyrc 0scripts/readme_sync.sh --checkrc 0scripts/contracts_gate.sh: 7 of 8 steps pass (lint, consistency, census, regen, readme, provenance, diff); theshapesstep rc 1 on the build host with a shape (binary-apr-cli-apr-surface) this PR does not touch, and it fails the same way at 4b483b7 with a pv built from this treeont-delta: none (no ontology source edit); contracts/contracts.nt gains derived triples only: the three dist contracts' own triples,
plot/geom_histogramgains acontracttriple and 13fixturetriples (the histogram contract binds the existing core row), and itsnotProvenshrinks to surface and receiptRefs #6909
keep-open: #6909 is the group ticket; this PR completes its checklist lines for geom_histogram, geom_freqpoly, geom_density; other rows remain
Refs #6962
keep-open: formerly #6962 (folded into #6909); the work is the geom_histogram line of #6909
Refs #6963
keep-open: formerly #6963 (folded into #6909); the work is the geom_freqpoly line of #6909
Refs #6964
keep-open: formerly #6964 (folded into #6909); the work is the geom_density line of #6909
🤖 Generated with Claude Code