You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FAO delivery path is point/DataFrame-based — won't carry rusty_bucket's pooled draws #45
rusty_bucket (views-models#143) is the opposite by design: a PredictionFrameEnsembleManager + aggregation: concat ensemble that ships the full pooled posterior draws (~1024/cell, Track A y_pred.npy of shape (N, S)) uncollapsed, so the principled MAP/HDI collapse happens once downstream in views_frames_summarize.
So the current FAO delivery path would not carry rusty_bucket's draws — it expects a point DataFrame with _best/_prob columns, not (N, S) draw arrays. This is the downstream half of the views-models#143 contract: "the FAO delivery path must not collapse them."
Scope
Adapt the unfao delivery to read/carry the pooled draws (frames / (N, S) arrays + identifiers) for rusty_bucket, delivering them uncollapsed.
Keep the metadata enrichment (GaulLookupEnricher) and validation working on the frames/draws path.
Decide the delivery artifact to FAO (raw draws vs the views_frames_summarize collapse output).
Not blocking yet
rusty_bucket's constituent models are still being tuned (views-models#143), so this is track-and-scope. It must land before rusty_bucket goes live.
Refs
views-models#143 (rusty_bucket + the downstream draw-preservation contract)
Cross-repo note from the views-faoapi side — this issue is the keystone for faoapi going frame-native.
Confirmed end-to-end: unfao/managers/unfao.py_save → to_parquet() on the object-dtype DataFrame is exactly where the nested-array-sample parquet that faoapi consumes is born. Downstream, faoapi does the inverse dance — pd.read_parquet → _convert_to_arrays (decode each object-dtype cell back into an np.ndarray) → (N_time, N_entity, S) tensor (views-faoapi data/handlers.py ~234, ~467–516). So the object-dtype round-trip is pure overhead on both ends.
Suggested solution shape (so it unblocks the consumer cleanly):
Emit a native views-frames frame carrying the full (N, S) pooled draws uncollapsed (as you note for rusty_bucket), and let the principled MAP/HDI collapse happen once in faoapi via views_frames_summarize (tower_point/hdi_tower — see views-faoapi#89).
Use the arrow single-file form (views_frames.io.arrow), not the npz multi-file directory — Appwrite buckets are file-oriented (one blob per artifact).
Carry the 9 GAUL metadata columns in the frame header/sidecar, not as DataFrame cells.
This is the producer half of the wire-format change; the faoapi consumer half + the ADR-046 amendment are tracked in views-faoapi (new issue, linked). Resolving this is what actually lets faoapi retire its parquet decode.
Sharpened by the samples/uncertainty requirement (2026-06-27). The reason this issue matters is now concrete: the delivery is moving from point estimates to predictions-with-uncertainty (S samples/cell). The two representations diverge exactly here:
views-framesPredictionFrame = native contiguous (N, S) float32, sample axis always explicit (point is just S=1).
pandas PGMDataset = object-dtype list-in-cell (each of N cells holds a length-S numpy array; _convert_to_arrays in pipeline-core data/handlers.py).
The object-dtype cost scales ~linearly with S — memory blow-up (pipeline-core's own OOM #181/#189, ~18 GB), encode/decode tax at every parquet/API boundary (faoapi's inverse decode, already noted on this issue), and a silent np.resize pad on mismatched sample counts. At S=1 invisible; at S≈1000 it dominates.
So this issue is the producer half of carrying uncertainty: emit (N, S) draws uncollapsed as a native arrow frame rather than object-dtype parquet. Gated by C-40 (the inherited pandas container) + rusty_bucket (#143). Register C-40 updated with this priority + the concrete pipeline-core gate (#186/#207/#161/#159/#211).
Migration backlog created (2026-06-28): epic #85. The pandas→views-frames map for views-postprocessing is now sequenced as epic #85 ("Push pandas to the seams"), stories #86–#92, tracking #93.
This issue (#45) is the gate + consumer half for S6 (#91) — the forecast outbound to_parquet → views_frames.io.arrow sample-frame wire, the step that actually ships (N,S) to FAO. The unilateral arc S1–S3 (#86/#87/#88) makes vpp's interior carry the draws as a PredictionFrame first, so by the time the wire cutover lands the producer side is already built + parity-tested.
GAUL sidecar (§5): the 9 columns move to a gid-keyed sidecar (one per run) — faoapi already consumes them per-gid (verified); gid-set identity enforced by the existing coverage/identity invariants.
The S1 — Delete the retired delivery path; refuse an incomplete config #149 no-collapse boundary is named: vpp delivery/draws.py (§6) — 2-D, S==header, S≥S_min, global non-degeneracy (per-row zero variance explicitly legal). New invariant, sibling of coverage/identity/observed_range/provenance.
Historical artifact: unchanged (pandas parquet) in v1.
Status escalation (2026-07-05): this issue is now the confirmed blocker C of views-models#230 — the FAO walking skeleton (publish the baseline rusty_bucket forecast end-to-end to the live FAO API). The "not blocking yet" framing no longer holds: A (Appwrite collection ID) and B (run rusty_bucket) are ops steps, but with the current point-shaped _save (pred_*_best/_prob, unfao.py:298,309,316) a sample-less artifact would land in unfao_bucket, and views-faoapi's HDI/MAP forecast product cannot serve it.
Decision fork recorded on views-models#230: minimal (pass the (N,S) sample columns through in the existing nested-parquet encoding — unilateral here, unblocks the skeleton; encoding retired later by #91/S6) vs full (the #91 arrow wire cutover, gated on #88 + vpp#222; also closes views-faoapi#100).
Contract ADOPTED as ADR-013 (views-postprocessing/docs/ADRs/013_sampled_forecast_wire_contract.md); see the adoption comment on views-platform/views-models#149 (2026-07-15). This issue's requirement — carry rusty_bucket's pooled draws uncollapsed — is now contractually guaranteed end-to-end: Hop-A archives preserve (N,S) verbatim, the §6 no-collapse boundary (delivery/draws.py, this repo) fails loud before any FAO-facing upload, and faoapi ingests + asserts on the same header. vpp's build legs: draws.py (unblocked now), the source adapter (Track-A archive → PredictionFrame), the sink adapter (#91), the sidecar, and the legacy type-guard (§11.4 — before pipeline-core#269's first upload).
Delivery plan exists: epic #105 (ADR-013 Hop-B sink leg) carries this issue's scope — pooled (N,S) draws travel uncollapsed to unfao_bucket as per-month arrow shards + sidecar + run manifest, §6 no-collapse gate wired before upload, documents under the faoapi-visible name="un_fao" (fixing the invisibility this path always had). This issue's open decision (raw draws vs summarized) is answered by the adopted contract: raw draws on the wire; MAP/HDI computed at the faoapi edge, never stored. Stays open as the semantic parent; closes at #113 (S8) when the sink is fixture-proven.
Delivered by epic #105 (2026-07-20). The FAO delivery now carries pooled (N,S) draws uncollapsed end to end in fixture-proven code: verified Track-A inbound → §6 no-collapse gate → per-(target,month) arrow shards → GAUL sidecar (+gid parity) → run-manifest commit marker → all documents under the faoapi-visible name="un_fao" (the invisibility fix). This issue's open decision is answered by ADR-013: raw draws on the wire; MAP/HDI computed at the faoapi edge, never stored. Live enablement is interlocked (UPLOAD_ENABLED=False) pending faoapi C-161. Closing as delivered.
Activity
Polichinel commentedon Jun 24, 2026
Cross-repo note from the views-faoapi side — this issue is the keystone for faoapi going frame-native.
Confirmed end-to-end:
unfao/managers/unfao.py_save→to_parquet()on the object-dtype DataFrame is exactly where the nested-array-sample parquet that faoapi consumes is born. Downstream, faoapi does the inverse dance —pd.read_parquet→_convert_to_arrays(decode each object-dtype cell back into annp.ndarray) →(N_time, N_entity, S)tensor (views-faoapi data/handlers.py~234, ~467–516). So the object-dtype round-trip is pure overhead on both ends.Suggested solution shape (so it unblocks the consumer cleanly):
(N, S)pooled draws uncollapsed (as you note forrusty_bucket), and let the principled MAP/HDI collapse happen once in faoapi viaviews_frames_summarize(tower_point/hdi_tower— see views-faoapi#89).views_frames.io.arrow), not the npz multi-file directory — Appwrite buckets are file-oriented (one blob per artifact).This is the producer half of the wire-format change; the faoapi consumer half + the ADR-046 amendment are tracked in views-faoapi (new issue, linked). Resolving this is what actually lets faoapi retire its parquet decode.
Polichinel commentedon Jun 27, 2026
Sharpened by the samples/uncertainty requirement (2026-06-27). The reason this issue matters is now concrete: the delivery is moving from point estimates to predictions-with-uncertainty (S samples/cell). The two representations diverge exactly here:
PredictionFrame= native contiguous(N, S)float32, sample axis always explicit (point is just S=1).PGMDataset= object-dtype list-in-cell (each of N cells holds a length-S numpy array;_convert_to_arraysin pipeline-coredata/handlers.py).The object-dtype cost scales ~linearly with S — memory blow-up (pipeline-core's own OOM #181/#189, ~18 GB), encode/decode tax at every parquet/API boundary (faoapi's inverse decode, already noted on this issue), and a silent
np.resizepad on mismatched sample counts. At S=1 invisible; at S≈1000 it dominates.So this issue is the producer half of carrying uncertainty: emit
(N, S)draws uncollapsed as a native arrow frame rather than object-dtype parquet. Gated by C-40 (the inherited pandas container) + rusty_bucket (#143). Register C-40 updated with this priority + the concrete pipeline-core gate (#186/#207/#161/#159/#211).Polichinel commentedon Jun 28, 2026
Migration backlog created (2026-06-28): epic #85. The pandas→views-frames map for views-postprocessing is now sequenced as epic #85 ("Push pandas to the seams"), stories #86–#92, tracking #93.
This issue (#45) is the gate + consumer half for S6 (#91) — the forecast outbound
to_parquet→views_frames.io.arrowsample-frame wire, the step that actually ships(N,S)to FAO. The unilateral arc S1–S3 (#86/#87/#88) makes vpp's interior carry the draws as aPredictionFramefirst, so by the time the wire cutover lands the producer side is already built + parity-tested.docs(risk-register): cross-link C-40 to the pandas-migration epic (#85)
docs(risk-register): register D-11 — pandas→frames seam, concrete-sib…
Polichinel commentedon Jul 2, 2026
Wire contract posted — this issue's scope is now bounded. Contract of record: views-platform/views-models#149 (comment: Sampled-Forecast Wire Contract v1, 2026-07-03); producer leg: views-platform/views-pipeline-core#269.
vpp's obligations under the contract:
y_pred.npy (N,S)+identifiers.npz+metadata.json) per (target, month) shard, manifest-gated, → interior per-targetPredictionFrameviafrom_arrays. Validate payload-vs-header consistency at the door.views_frames.io.arrowfile per (target, month) tounfao_bucket, §2 header embedded.delivery/draws.py(§6) — 2-D, S==header, S≥S_min, global non-degeneracy (per-row zero variance explicitly legal). New invariant, sibling of coverage/identity/observed_range/provenance.Target vocabulary decided:
lr_ged_sb/ns/os(models#146).docs(risk-register): C-40 — wire contract v1 posted; S6/#45 circular …
Polichinel commentedon Jul 5, 2026
Status escalation (2026-07-05): this issue is now the confirmed blocker C of views-models#230 — the FAO walking skeleton (publish the baseline
rusty_bucketforecast end-to-end to the live FAO API). The "not blocking yet" framing no longer holds: A (Appwrite collection ID) and B (run rusty_bucket) are ops steps, but with the current point-shaped_save(pred_*_best/_prob,unfao.py:298,309,316) a sample-less artifact would land inunfao_bucket, and views-faoapi's HDI/MAP forecast product cannot serve it.Decision fork recorded on views-models#230: minimal (pass the
(N,S)sample columns through in the existing nested-parquet encoding — unilateral here, unblocks the skeleton; encoding retired later by #91/S6) vs full (the #91 arrow wire cutover, gated on #88 + vpp#222; also closes views-faoapi#100).docs(adr): ADOPT the Sampled-Forecast Wire Contract as ADR-013 (v1.5)
Polichinel commentedon Jul 15, 2026
Contract ADOPTED as ADR-013 (views-postprocessing/docs/ADRs/013_sampled_forecast_wire_contract.md); see the adoption comment on views-platform/views-models#149 (2026-07-15). This issue's requirement — carry rusty_bucket's pooled draws uncollapsed — is now contractually guaranteed end-to-end: Hop-A archives preserve
(N,S)verbatim, the §6 no-collapse boundary (delivery/draws.py, this repo) fails loud before any FAO-facing upload, and faoapi ingests + asserts on the same header. vpp's build legs:draws.py(unblocked now), the source adapter (Track-A archive →PredictionFrame), the sink adapter (#91), the sidecar, and the legacy type-guard (§11.4 — before pipeline-core#269's first upload).Polichinel commentedon Jul 19, 2026
Delivery plan exists: epic #105 (ADR-013 Hop-B sink leg) carries this issue's scope — pooled (N,S) draws travel uncollapsed to
unfao_bucketas per-month arrow shards + sidecar + run manifest, §6 no-collapse gate wired before upload, documents under the faoapi-visiblename="un_fao"(fixing the invisibility this path always had). This issue's open decision (raw draws vs summarized) is answered by the adopted contract: raw draws on the wire; MAP/HDI computed at the faoapi edge, never stored. Stays open as the semantic parent; closes at #113 (S8) when the sink is fixture-proven.🤖 Generated with Claude Code
Polichinel commentedon Jul 20, 2026
Delivered by epic #105 (2026-07-20). The FAO delivery now carries pooled (N,S) draws uncollapsed end to end in fixture-proven code: verified Track-A inbound → §6 no-collapse gate → per-(target,month) arrow shards → GAUL sidecar (+gid parity) → run-manifest commit marker → all documents under the faoapi-visible
name="un_fao"(the invisibility fix). This issue's open decision is answered by ADR-013: raw draws on the wire; MAP/HDI computed at the faoapi edge, never stored. Live enablement is interlocked (UPLOAD_ENABLED=False) pending faoapi C-161. Closing as delivered.🤖 Generated with Claude Code