# K5 residual inspection and matched F1 images

2026-10-04. Owner: crossfit/k5_figures. No new fit was run.

**Headline / Conclusion:** F1 has a visible bright-source held-out training gap on identical native pixels. The individual residuals include dipole and more complex core structure, while the faint bins retain common residual structure even when the score ratio is close to one. The test supports a brightness-dependent generalization issue conditional on the current scene and evaluation amplitudes; it does not identify a unique cause or establish calibrated noise, temporal accuracy, or photometric improvement.

## Comparison contract

F1 is sector 24, camera 2, CCD 2, FFI `tess2020120182919-s0024-2-2`. Source scene: `/astro/armin/koji/syndiff/dev_runs/epsf_model_closure_20261004/models/inputs/full_generation/F1/scene_boot`. Five current-generation A3 models are `/astro/armin/koji/syndiff/dev_runs/epsf_model_closure_20261004/crossfit/F1_full_generation/fold{0..4}/A3/fit`. The immutable production pin is `3609d467a7f17c9ed56a434d71f131ca5cf15528`; the CCD colour adapter is installed before building each model. Each fit's recorded colour reference, XP coordinate and gauge are restored. Extra CCD coefficients are frozen zero in A3.

All 10,536 primary sources are retained with identical IDs and native core pixels across all five renders. Physical radius is at most 3 TESS pixels, each core lies wholly in held tiles, and at least 15 originally valid pixels are required. Each saved native re-render agrees with the corresponding stored c2 score at relative tolerance 0.00002. Full scene fluxes and the nuisance prior scale are recalibrated on the unmodified evaluation scene; this is a conditional evaluation.

$$c^2_{im}=\frac{1}{n_i}\sum_{p\in C_i}\left(\frac{D_{ip}-M_{imp}}{\sigma_{ip}}\right)^2,\qquad G_i=\frac{c^2_{i,h_i}}{\operatorname{median}_{m\ne h_i}c^2_{im}}.$$

Here $i$ is a source, $m$ a fold model, $p$ a native TESS pixel, $C_i$ the fixed valid physical core, $n_i$ its pixel count, $D_{ip}$ the measured image stamp in electrons per second, $M_{imp}$ the full scene prediction with evaluation amplitudes in the same units, and $\sigma_{ip}$ the scorer's fixed scene noise (including its numerical floor) in electrons per second. The recorded held fold is $h_i$. Both $c^2_{im}$ and the paired ratio $G_i$ are dimensionless. There is no nuisance or model degrees-of-freedom correction, and model/noise covariance is not propagated. The in-training comparator is the median score from the other four current-generation fold models.

$$I_{imp}=10^4\frac{D_{ip}-M_{imp}}{f_{i,h_i}}.$$

Here $I_{imp}$ is the displayed dimensionless flux fraction multiplied by $10^4$, and $f_{i,h_i}$ is the held-out model's fitted source flux in electrons per second, used as the same denominator for all five model images of source $i$. Stack panels are arithmetic means of $I_{imp}$ on the fixed native support, aligned by integer stamp centres without interpolation. Subpixel phase is therefore smeared in a stack. In-training columns use increasing withheld-fold order omitting the source's own fold; they do not sort models by score. The difference panel subtracts the mean of the four in-training images. It is an image diagnostic, not the median squared-score statistic.

## F1 results

| Catalogue T | Sources | Median paired held-out/in-training ratio |
|---|---:|---:|
| 8-9 | 196 | 6.006 |
| 9-10 | 427 | 2.309 |
| 10-11 | 930 | 1.392 |
| 11-12 | 2924 | 1.006 |
| 12-13 | 6059 | 1.004 |

![Same-star native residual stacks](F1_matched_stacks.png)

The bright held-out stack is more structured than each in-training stack; fainter stacks share a positive central and surrounding pattern. Positive and negative residuals cancel in signed stacks, so the individual examples are essential evidence alongside the squared scores.

![All-fold training-gap curves](F1_training_gap.png)

The bright-bin gap occurs in each fold. The fold spread is descriptive, not a confidence interval: training sets overlap and only one image per field is evaluated. A ratio near one is not evidence of an adequate residual/noise model.

![Matched individual-source examples](F1_matched_examples.png)

Two catalogue-T 8–9 sources per fold are selected by the median and 90th percentile of the paired gap, before looking at morphology. Their source rows are in `F1_matched_summary.json`. OOF images show stronger core dipole or multi-lobed structure than most/all in-training images of the same source. Each row uses one residual colour scale and one OOF-flux denominator. The data image has its own intensity scale. The full bright cohort of 196 sources is browsable on the HTML page; all 10,536 five-model native arrays are saved in `F1_fold*_matched_native.npz`.

## Standard grid inspection

All 60 PNGs were individually viewed: five fields × (five folds plus pooled OOF) × (absolute plus relative). Exact paths, SHA256 hashes, and field captions are in `inspected_grids.json`. These compatibility grids use Gaia BP−RP and **fitted-flux-derived** TESS magnitude, unlike the primary catalogue-T / fitted-XP-u metrics. The relative grids subtract each CCD cell's all-star stack. Their colour limits vary by image; compare the printed scales, not visual saturation. Counts are display-bin populations. Sparse/blank bins are not null detections. Morphological labels below are visual descriptions, without fitted mode amplitudes or significance claims.

### F1

Absolute grids retain positive central cores in many blue/mid-colour faint bins and asymmetric red-bin residuals, strongest toward the right and lower CCD cells. Relative grids remove much of the common blue/mid-colour structure but retain red-bin asymmetry. Fold panels repeat the populated-cell patterns with substantial sparse-bin sampling stripes.

![F1 pooled absolute grid](../F1_full_generation/k5_eval/resgrid_strict_K5_F1_OOF_20261004.png)

![F1 pooled relative grid](../F1_full_generation/k5_eval/resgrid_strict_K5_F1_OOF_20261004_rel.png)

### F2

The pooled grid shows spatially varying blue-bin dipoles, stronger red-bin core structure, and relatively quiet mid-colour bins after cell-mean subtraction. Red upper-left and lower-left cells retain strong opposing lobes. Individual folds contain many empty bright-colour cells and striped/checkerboard sampling; they are not featureless residuals.

![F2 pooled absolute grid](../F2_full_generation/k5_eval/resgrid_strict_K5_F2_OOF_20261004.png)

![F2 pooled relative grid](../F2_full_generation/k5_eval/resgrid_strict_K5_F2_OOF_20261004_rel.png)

### S22

The pooled grid has structured red-bin cores and a broad positive surrounding component in the middle-right CCD cell, alongside negative blue cores in some bright bins. The relative view removes part of the shared surrounding signal but preserves colour-dependent lobes. Folds show variable sampling stripes and blank bright bins; no unique single residual mode is established.

![S22 pooled absolute grid](../S22_full_generation/k5_eval/resgrid_strict_K5_S22_OOF_20261004.png)

![S22 pooled relative grid](../S22_full_generation/k5_eval/resgrid_strict_K5_S22_OOF_20261004_rel.png)

### C1

The pooled absolute grid has central positive faint blue/mid-colour residuals and red-bin asymmetric cores across the CCD; the lower-right red cell is especially structured. Relative subtraction suppresses much of the mid-colour common component. Single-fold red bins and bright cells are often sparsely sampled, with striped patterns or missing images.

![C1 pooled absolute grid](../C1_full_generation/k5_eval/resgrid_strict_K5_C1_OOF_20261004.png)

![C1 pooled relative grid](../C1_full_generation/k5_eval/resgrid_strict_K5_C1_OOF_20261004_rel.png)

### C4

Pooled bright blue residuals often have a negative core and positive surrounding region; red bins show a positive or asymmetric core with negative surrounding structure. The red/blue distinction persists after cell-mean subtraction. More populous faint bins are visually smoother than many single-fold bright bins. One negative-flux source remains in the primary score cohort but is excluded from these flux-normalized grids.

![C4 pooled absolute grid](../C4_full_generation/k5_eval/resgrid_strict_K5_C4_OOF_20261004.png)

![C4 pooled relative grid](../C4_full_generation/k5_eval/resgrid_strict_K5_C4_OOF_20261004_rel.png)

## C4 negative-flux exception

C4 fold 4 scene row 11902, Gaia 1436295372260016000, catalogue T=12.461, has fitted target flux −155.7 electrons per second. It remains in the primary fixed-cohort c2 statistics; only the positive-flux normalized display omits it. The native image below shows a crowded stamp with masked pixels and an opposing-sign core residual; it does not by itself diagnose the cause of the negative source amplitude.

![Retained C4 negative-flux native stamp](../C4_full_generation/k5_eval/fold4/negative_flux_native_stamp.png)

## Publication

All 30 inspected K5 tabs (60 images) were published to [the existing shared residual-grid page](http://localhost:18888/residual-grids/resgrid.html) after the coordinated manifest writer slot was released. Copied image hashes match, and all unrelated manifest entries are unchanged. The external Claude Artifact mirror and SendUserFile were unavailable; neither action is claimed. Publication details are in `publication.json`. Owned source is backed up on dev branch `codex/k5-residual-figures-20261004`; it has not been merged into main.

## Reproduction and scope

Run `bash /astro/armin/koji/syndiff/dev_runs/epsf_model_closure_20261004/crossfit/figures/run_render.sh`; then activate `syndiff` and run `plot_matched.py` and `build_report.py` in this directory. Local renders use CPU 24–31 with BLAS/MKL/OMP threads set to one; JAX is imported before pandas transitively. Native cache sidecar JSON files record each parameter hash and source path. Existing models, scenes, masks and primary cohorts are unchanged.

Training spatial coverage, fitted nuisance amplitudes, and field/model uncertainty differ between held-out and in-training cases. This is not a one-factor causal overfitting test. Independent-start and confirmation-image controls belong to the parent investigation. The next discriminating step is to combine those controls with fixed-support model comparisons; the present figures alone cannot separate interpolation error, model flexibility, catalogue/scene error, or optimization sensitivity.

**Conclusion:** The F1 bright training gap is present in matched underlying images and in each fold's score summary. Structured colour/spatial residuals remain across all five fields. Current K5 evidence does not support declaring the residual model closed or claiming improved photometry.
