Skip to content

feat(makie): implement acf-pacf#8575

Merged
MarkusNeusinger merged 6 commits into
mainfrom
implementation/acf-pacf/makie
Jun 10, 2026
Merged

feat(makie): implement acf-pacf#8575
MarkusNeusinger merged 6 commits into
mainfrom
implementation/acf-pacf/makie

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Implementation: acf-pacf - julia/makie

Implements the julia/makie version of acf-pacf.

File: plots/acf-pacf/implementations/julia/makie.jl

Parent Issue: #4663


🤖 impl-generate workflow

@claude

claude Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

AI Review - Attempt 1/3

Image Description

Light render (plot-light.png): Two vertically-stacked subplots on a warm off-white #FAF8F1 background. The top panel (ACF) shows vertical lollipop stems in brand green #009E73 from lag 0 to lag 35, with the ACF value starting at 1.0 at lag 0 and decaying geometrically — all lags remaining above the upper confidence bound, characteristic of a near-unit-root AR process. The bottom panel (PACF) shows the same green stems from lag 1 to lag 35, with a large spike at lag 1 (~0.85) and values near or below the confidence bound from lag 3 onwards. Both panels show a solid zero baseline and dashed confidence bounds at approximately ±0.113 (1.96/√300). Title 'AR(2) Process · acf-pacf · julia · makie · anyplot.ai' is dark on light background, clearly readable. Y-labels 'ACF' / 'PACF' and x-label 'Lag' are readable. No grid visible. All text is readable against the light background. Legibility verdict: PASS.

Dark render (plot-dark.png): Identical layout on a warm near-black #1A1A17 background. Data colors are identical to the light render — brand green #009E73 stems and tips throughout both panels. Title and all axis labels render in light off-white, clearly readable against the dark background. Confidence bound dashed lines appear in a lighter shade appropriate for the dark surface. No dark-on-dark text failures detected. Both themes show the same data proportions and identical green data series. Legibility verdict: PASS.

Both paragraphs are required. A review that only describes one render is invalid.

Score: 86/100

Category Score Max
Visual Quality 28 30
Design Excellence 12 20
Spec Compliance 15 15
Data Quality 15 15
Code Quality 10 10
Library Mastery 6 10
Total 86 100

Visual Quality (28/30)

  • VQ-01: Text Legibility (6/8) — Title (20pt), axis labels (14pt) explicitly sized; xticklabelsize/yticklabelsize not explicitly set on either Axis (inherit from base fontsize=14). Visual result is readable, but 8/8 requires all font sizes explicitly set.
  • VQ-02: No Overlap (6/6) — No text or element collisions in either render
  • VQ-03: Element Visibility (6/6) — Stems (linewidth=2), tips (markersize=8), and confidence lines well-adapted to 36-lag density
  • VQ-04: Color Accessibility (2/2) — Brand green #009E73, dashed vs. solid lines provide redundant encoding beyond color
  • VQ-05: Layout & Canvas (4/4) — Canvas gate passed (3200×1800), balanced two-panel layout, proportions good
  • VQ-06: Axis Labels & Title (2/2) — 'ACF', 'PACF', 'Lag' are descriptive; no units needed for dimensionless correlation coefficients
  • VQ-07: Palette Compliance (2/2) — First and only series is #009E73; #FAF8F1 light / #1A1A17 dark backgrounds; full theme-adaptive chrome

Design Excellence (12/20)

  • DE-01: Aesthetic Sophistication (5/8) — Above defaults: descriptive 'AR(2) Process ·' title prefix, theme-adaptive chrome carefully threaded to all axis properties, statistically meaningful data. Falls short of strong design (6) — no typographic hierarchy variation, no subtle grid aid for value reading, visual presentation is clean but not distinctive.
  • DE-02: Visual Refinement (4/6) — Top/right spines removed, strokewidth=0 on scatter tips, no grid (appropriate for diagnostic stems). rowgap!(fig.layout, 1, 8) is very tight — the two panels sit close together with minimal breathing room. Refinement is above defaults but not fully polished.
  • DE-03: Data Storytelling (3/6) — AR(2) data choice creates a natural diagnostic story (geometric ACF decay vs. PACF cutoff). But no visual hierarchy differentiates the significant lags (1–2 in PACF) from noise: all stems use identical color and weight, making the viewer do all the interpretive work.

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — Stem/lollipop ACF and PACF correctly implemented as stacked subplots
  • SC-02: Required Features (4/4) — ACF top, PACF bottom; shared x-axis (linkxaxes!); vertical stems from zero; ±1.96/√N dashed confidence lines; lag 0 in ACF (=1.0); PACF from lag 1; 35 lags (within 30–40 spec range)
  • SC-03: Data Mapping (3/3) — Lags on x-axis, correlation values on y-axis, all data visible
  • SC-04: Title & Legend (3/3) — 'AR(2) Process · acf-pacf · julia · makie · anyplot.ai' matches {Descriptive} · {spec-id} · {lang} · {lib} · anyplot.ai format

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) — AR(2) with φ₁=0.7, φ₂=0.2 showcases all ACF/PACF diagnostic features: geometric ACF decay, PACF cutoff pattern, confidence bounds as significance markers
  • DQ-02: Realistic Context (5/5) — 'Monthly economic indicator' AR(2) process — realistic, neutral, plausible domain
  • DQ-03: Appropriate Scale (4/4) — n=300 observations (within spec 100–500), 35 lags, conf_bound ≈ 0.113 — all values match statistical convention

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) — Linear: imports → tokens → data → PACF computation → figure → save
  • CQ-02: Reproducibility (2/2) — Random.seed!(42)
  • CQ-03: Clean Imports (2/2) — CairoMakie, Colors, Random, Statistics all used
  • CQ-04: Code Elegance (2/2) — Levinson-Durbin PACF implemented in native Julia, no fake UI elements, appropriate complexity
  • CQ-05: Output & API (1/1) — Saves as plot-$(THEME).png, uses current Figure(size=...) API

Library Mastery (6/10)

  • LM-01: Idiomatic Usage (4/5) — Expert use of linesegments! for stem plots (no native stem! in CairoMakie), linkxaxes! for shared axes, rowgap! for layout, Figure grid indexing. Slightly below 5 as axis ranges could be set explicitly.
  • LM-02: Distinctive Features (2/5) — Uses Makie-specific linkxaxes!, rowgap!, and Figure layout grid. However, these are basic Makie layout primitives; no distinctive Makie features (Themes system, Axis recipes, Observable-based computation, or advanced styling attributes like custom spine rendering) are used.

Score Caps Applied

  • None — all cap-triggering criteria avoided (no zero scores in VQ-02, VQ-03, SC-01, DQ-02, DE-01=5>2, CQ-04=2)

Strengths

  • Perfect spec compliance: all required ACF/PACF features implemented correctly, including lag 0 in ACF, PACF from lag 1, shared x-axis, and correct ±1.96/√N confidence bounds
  • Statistically rigorous: Levinson-Durbin PACF recursion implemented in pure Julia — no external stats packages needed
  • Full theme-adaptive chrome: all Axis properties (titlecolor, xlabelcolor, ylabelcolor, xticklabelcolor, yticklabelcolor, spine colors) use correct INK / INK_SOFT tokens for both themes
  • Realistic AR(2) data with well-chosen parameters (φ₁=0.7, φ₂=0.2) that clearly demonstrate the diagnostic contrast between ACF and PACF patterns
  • Clean KISS structure with Random.seed!(42) reproducibility

Weaknesses

  • xticklabelsize and yticklabelsize not explicitly set on ax_acf or ax_pacf — add e.g. xticklabelsize=12, yticklabelsize=12 to both Axis constructors
  • rowgap!(fig.layout, 1, 8) is too tight — increase to 16–24 to give breathing room between the ACF and PACF panels
  • No visual hierarchy in the PACF panel: the first two significant lags (1–2) look identical to noise lags. Consider using a second color (e.g., IMPRINT_PALETTE[5] #AE3030) or a slightly larger markersize for lags beyond the confidence threshold to guide the reader's eye toward the diagnostic cutoff
  • Limited library mastery beyond basic Makie layout primitives — consider using Makie's theme system or a custom recipe to demonstrate library-distinctive capabilities

Issues Found

  1. VQ-01 LOW: xticklabelsize / yticklabelsize not explicitly set on either Axis
    • Fix: Add xticklabelsize=12, yticklabelsize=12 to both ax_acf and ax_pacf Axis constructors
  2. DE-02 LOW: rowgap between subplots too tight
    • Fix: Change rowgap!(fig.layout, 1, 8) to rowgap!(fig.layout, 1, 20)
  3. DE-03 LOW: No visual hierarchy differentiating significant PACF lags from noise
    • Fix: In the PACF subplot, consider using a different color or size for stems above the confidence bound — or add a y-axis only grid (ygridvisible=true, ygridcolor=RGBAf(..., 0.12)) to both panels to help readers read values against the zero line
  4. LM-02 LOW: Basic Makie layout primitives only — no distinctive Makie features
    • Fix: Consider using a Makie Theme block to set axis defaults, or add axis decorations (e.g., explicit xticks with custom values) that demonstrate Makie's layout system more distinctively

AI Feedback for Next Attempt

Set xticklabelsize=12, yticklabelsize=12 explicitly on both Axis constructors. Increase rowgap to 20 for better whitespace. Add ygridvisible=true with ygridcolor=RGBAf(INK.r,INK.g,INK.b,0.12) to both axes to provide value-reading guides. In the PACF panel, visually distinguish statistically significant stems: if abs(pacf_val) > conf_bound, render the stem and tip in IMPRINT_PALETTE[1] at full saturation; if within bounds, use a slightly muted variant (alpha≈0.55 via RGBAf) — this guides the reader directly to the AR(2) cutoff without annotations.

Verdict: REJECTED

@github-actions github-actions Bot added quality:86 Quality score 86/100 ai-rejected Quality not OK, triggers update labels Jun 10, 2026
@github-actions github-actions Bot added ai-attempt-1 First repair attempt and removed ai-rejected Quality not OK, triggers update labels Jun 10, 2026
Attempt 1/3 - fixes based on AI review
@github-actions

Copy link
Copy Markdown
Contributor Author

🔧 Repair Attempt 1/4

Applied fixes based on AI review feedback.

Status: Repair completed, re-triggering review...


🤖 impl-repair

@github-actions

Copy link
Copy Markdown
Contributor Author

🔧 AI Review Produced No Score — Auto-Retrying

The Claude Code Action ran but didn't write quality_score.txt. Auto-retrying review once...


🤖 impl-review

@claude

claude Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

AI Review - Attempt 2/3

Image Description

Light render (plot-light.png): Two vertically stacked panels on a warm off-white #FAF8F1 background. Top panel (ACF) shows all 36 lags (0–35) in Imprint brand green #009E73 with vertical stems from zero to the correlation value and circular dot tips; lag 0 is 1.0, then slow exponential decay across all lags — all remaining above the dashed 95% confidence bound at ~±0.113. Bottom panel (PACF) shows lags 1–35 with visual hierarchy: significant lags (1 and 2 have large spikes at ~0.87 and ~0.13) in full #009E73, non-significant lags in the same hue at alpha=0.38. Title "AR(2) Process · acf-pacf · julia · makie · anyplot.ai" in dark ink at top. Y-axes labeled "ACF" and "PACF", shared x-axis labeled "Lag" on bottom panel only. Top and right spines removed. Subtle y-axis grid. All text clearly readable against the light background.

Dark render (plot-dark.png): Identical layout on a warm near-black #1A1A17 background. Title, axis labels, and tick labels all rendered in light colors (primary text in #F0EFE8, secondary in #B8B7B0) — no dark-on-dark failures. Data stems and dots are the same #009E73 as the light render — color identity preserved across themes. Confidence bound dashes and zero baselines appear in theme-appropriate light tones. Grid remains faint but visible. All text is clearly readable against the dark surface.

Both paragraphs are required. A review that only describes one render is invalid.

Score: 86/100

Category Score Max
Visual Quality 28 30
Design Excellence 13 20
Spec Compliance 15 15
Data Quality 14 15
Code Quality 9 10
Library Mastery 7 10
Total 86 100

Visual Quality (28/30)

  • VQ-01: Text Legibility (7/8) — All font sizes explicitly set (titlesize=20, labels=14, ticks=12). Both renders fully readable. Near-perfect proportions.
  • VQ-02: No Overlap (6/6) — No overlapping elements across 36 lags in two panels
  • VQ-03: Element Visibility (5/6) — Stems and full-opacity tips are clear. Muted PACF dots (alpha=0.38, markersize=7) are visible but slightly small.
  • VQ-04: Color Accessibility (2/2) — Single hue with alpha differentiation; no red-green issue, strong contrast on both backgrounds
  • VQ-05: Layout & Canvas (4/4) — Two panels fill 3200×1800 canvas well, rowgap=20 provides breathing room, no content cut off
  • VQ-06: Axis Labels & Title (2/2) — "ACF", "PACF", "Lag" are clear standard abbreviations; descriptive title prefix "AR(2) Process"
  • VQ-07: Palette Compliance (2/2) — First series #009E73, backgrounds #FAF8F1/#1A1A17, full theme-adaptive chrome, data colors identical across themes

Design Excellence (13/20)

  • DE-01: Aesthetic Sophistication (5/8) — Above the "well-configured default" threshold: intentional significant/non-significant visual hierarchy in PACF, clean spine removal, professional Imprint palette application. Not yet FiveThirtyEight-level polish.
  • DE-02: Visual Refinement (4/6) — Top/right spines removed, subtle y-grid (alpha=0.12), dashed confidence lines add visual texture. Good but not maximal refinement.
  • DE-03: Data Storytelling (4/6) — AR(2) process choice is pedagogically intentional: slow ACF decay vs. sharp PACF cutoff at lag 2 tells a clear model-identification story. Visual emphasis on significant PACF lags creates a focal point.

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — Two-panel ACF/PACF stem plot, exactly the specified chart type
  • SC-02: Required Features (4/4) — Shared x-axis via linkxaxes!, 95% CI dashed lines at ±1.96/√N, lag 0 in ACF only, stems with dot tips, 35 lags within spec range
  • SC-03: Data Mapping (3/3) — X=Lag, Y=correlation values, all data visible
  • SC-04: Title & Legend (3/3) — "AR(2) Process · acf-pacf · julia · makie · anyplot.ai" — correct format with descriptive prefix; no legend needed for single-series

Data Quality (14/15)

  • DQ-01: Feature Coverage (6/6) — AR(2) process demonstrates all distinguishing ACF/PACF features: slow ACF decay and sharp PACF cutoff at the AR order
  • DQ-02: Realistic Context (4/5) — Monthly economic indicator with realistic AR(2) parameters (φ₁=0.7, φ₂=0.2); context is in code comments rather than axis labels
  • DQ-03: Appropriate Scale (4/4) — 300 observations (within spec's 100–500), correlation values in [-1,1], confidence bounds at correct 1.96/√300 ≈ ±0.113

Code Quality (9/10)

  • CQ-01: KISS Structure (2/3) — Defines make_segs() helper function at line 75; violates the no-functions/classes KISS rule. Small and practical, but still a function definition.
  • CQ-02: Reproducibility (2/2) — Random.seed!(42) at line 11
  • CQ-03: Clean Imports (2/2) — CairoMakie, Colors, Random, Statistics — all imported and used
  • CQ-04: Code Elegance (2/2) — Clean Levinson-Durbin recursion, logical significant/non-significant split, no fake interactivity
  • CQ-05: Output & API (1/1) — save("plot-$(THEME).png", fig; px_per_unit = 2) — correct format

Library Mastery (7/10)

  • LM-01: Idiomatic Usage (4/5) — linkxaxes!, linesegments!, scatter!, hlines!, rowgap!, RGBAf — very good idiomatic Makie patterns
  • LM-02: Distinctive Features (3/5) — linkxaxes! for linked axes, Makie layout system (fig[1,1]/fig[2,1]), rowgap! for gap control, RGBAf float-precision RGBA colors — Makie-specific patterns used well

Score Caps Applied

  • None

Strengths

  • Excellent spec compliance: all required features present including shared x-axis via linkxaxes!, vertical stems with dot tips, dashed 95% confidence bounds, lag 0 in ACF but not PACF
  • Strong data storytelling: AR(2) process choice beautifully illustrates the textbook ACF/PACF signatures — slow exponential ACF decay contrasted with sharp PACF cutoff at lag 2
  • Visual hierarchy for PACF: muted alpha (0.38) for non-significant lags vs. full #009E73 for significant lags — immediately guides the eye to the identifying spikes
  • Full theme-adaptive chrome: all six Makie color tokens correctly wired — both renders clean and readable without any dark-on-dark failures
  • Levinson-Durbin recursion implemented from scratch — no external statistics dependency needed

Weaknesses

  • Helper function make_segs() at line 75 violates the KISS no-functions/classes rule — inline the two-line segment construction directly at each call site
  • Design Excellence ceiling: plot reads as a well-configured professional chart but lacks the typographic weight variation and deliberate whitespace that would push it toward publication-ready

Issues Found

  1. CQ-01 MINOR: make_segs() function defined at line 75
    • Fix: Inline the segment construction directly at the two call sites

AI Feedback for Next Attempt

Plot is approved at 86/100 (Attempt 2 threshold ≥ 80). Minor improvement for future attempts: remove the make_segs helper function and inline the segment construction directly, and consider adding typographic weight variation (e.g., slightly larger title or explicit font weight) to push toward full publication-ready polish.

Verdict: APPROVED

@github-actions github-actions Bot added the ai-approved Quality OK, ready for merge label Jun 10, 2026
@MarkusNeusinger MarkusNeusinger merged commit 1e5d414 into main Jun 10, 2026
3 checks passed
@MarkusNeusinger MarkusNeusinger deleted the implementation/acf-pacf/makie branch June 10, 2026 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-approved Quality OK, ready for merge ai-attempt-1 First repair attempt quality:86 Quality score 86/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant