Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ The binary wheels were per minor version and stopped at cp314; on CPython
abi3audit). The pure `py3-none-any` wheel stays, for every platform without a
binary (free-threaded builds, 32-bit Windows, others).

**The gate says when the diagonal system could not be evaluated (BUG-0020).**
With a univariate optimum whose own MA sits on the invertibility wall, the
diagonal system can fail the likelihood where each series alone passes; the
gate said "difference nan: the joint cast does not reproduce the univariate
models". It now says the system could not be evaluated, with the reason, and
names the MA factor on the wall: the univariate model to reconsider. The C
does the same (atsw-gui `engines/drvarma` BUG-0009). Only the message changes.

**DRVARMA_NO_ENGINE reaches `elf_c` and `marma_c` (BUG-0032).** Only
`estimate_w` read it, so the ladder went on computing in C while
`engine_backend()` said "python".
Expand Down
22 changes: 20 additions & 2 deletions bugs/BUG-0001-deseason-phase-still-unpatched-in-the-c-engine.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
id: BUG-0001
title: The seasonal-adjustment phase off-by-one is fixed in the Python port but STILL LIVE in the C engine, which the standalone executable uses
status: open
status: fixed
severity: high
component: deseason
found_in: 0.1.3
fixed_in:
fixed_in: the C, atsw-gui engines/drvarma BUG-0008 (2026-11-28); the port long before
reported: 2026-07-28
reporter: David / ejercicio de pass-through del petróleo
tags:
Expand Down Expand Up @@ -95,3 +95,21 @@ El componente estacional se estima sobre la **diferencia simple de niveles** y s
resta en niveles, **antes** del logaritmo de Box-Cox en `transform`. Para un patrón
estacional multiplicativo sobre un índice con tendencia (el IPC de España va de 69 a
98) un ajuste aditivo en niveles es la escala equivocada. Ver BUG-0003.

## Resolution (2026-11-28)

The live C is atsw-gui's `engines/drvarma`; `drvarma_v.04.1` is gone. There
the defect was still in place on 2026-11-28 (`src/deseason.c`, under a
comment saying «NOT fixed here»), with `-deseason` live in the executable.
Fixed there as its BUG-0008 with the rotation above, the same as the port's,
so C and port subtract the same pattern again.

- Repro: atsw-gui `engines/drvarma/bugs/BUG-0008-repro/repro.py`. IPC_ES from
January and from February: the monthly rate of the re-seasonalized forecast
differed by 61 % of its range before, by 0.001 points after.
- The battery's `-deseason` cases start in January, where the rotation is the
identity: their references do not move.

BUG-0003 (estimated in levels before the Box-Cox) is separate and still
pending in the C.

27 changes: 27 additions & 0 deletions bugs/BUG-0002-c-sources-are-copies-and-have-already-drifted.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,30 @@ entra en el `diff` automático.
## Validation

El test de (2) pasa hoy solo después de aplicar (1). Es su propia comprobación.

## Update (2026-11-28): two copies now, and the drift is the `.inp` path's

`drvarma_v.04.1` is retired and drtran keeps its own engine: the copies are
two, atsw-gui's `engines/drvarma` (the C of record) and the embedded
`csrc/internal/` the wheel builds. The original symptom, an executable with
an inert convergence diagnosis, is solved in atsw-gui in its own way
(`opt_termcode`, `opt_iters`).

Measured against atsw-gui main today:

| file | lines different | what |
|---|---|---|
| `elfvarma.c` | 0 | the likelihood: the ladder's C (`elf_c`) is the C's |
| `drvmlest.c` | ~200 | the C's `.inp` path moved on: fdhess standard errors, the MA wall report, `objcfunc`'s boundary sentinel |
| `qnewtopt.c` | ~200 | the verdict recorded differently, the report deferred |
| `nlatools.c` | 34 | |

So the ladder (what sima uses) runs the C's likelihood, and its numbers are
homologated case by case (`tests/test_c_oracle.py`, `docs/HOMOLOGATION.md`).
What has drifted is `estimate_w`, the deprecated `.inp` path (`model.py`,
`forecast.py`), which the record pins by sha256 and declares pending; the
path goes in drvarma 6.0.

Two ways to close it: bring `drvmlest.c`/`qnewtopt.c`/`nlatools.c` to the
C's and regenerate the `.inp` path's references (its standard errors become
fdhess's), or leave it until 6.0 removes the path. A decision for David.
31 changes: 27 additions & 4 deletions bugs/BUG-0020-la-puerta-falla-con-un-ma-en-la-pared.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
id: BUG-0020
title: The diagonal gate fails with NaN when a univariate optimum sits on the MA wall; the same polynomial is admissible alone and ifault 3 in the joint elf
status: open
status: fixed
severity: low
component: ladder
found_in: 0.1.7
fixed_in:
fixed_in: unreleased (after 0.3.4); the C, atsw-gui engines/drvarma BUG-0009
reported: 2026-10-11
reporter: David / Claude — echelon stage 2's fits study
tags: [ladder, gate, elf, invertibility]
references:
- bugs/BUG-0020-repro/repro.py
- src/drvarma/ladder.py (Ladder._run_gate)
- src/drvarma/_as311.py (chekma, elf: ifault 3 at the Cholesky of mtmp0)
- research/echelon_seed/fits.py
Expand Down Expand Up @@ -49,8 +50,30 @@ wall"; (b) the univariate search keeps away from the wall.

## Fix

—
Fix (a), in both engines, only the report: when the diagonal system has an
ifault, the gate says it could not be evaluated, with the C's words for the
fault, and names every own MA factor of the univariate optima on the wall
(`_own_ma_outside`, the C's `own_ma_outside`):

```
the diagonal gate failed: the diagonal system could not be evaluated at the
univariate optima (AR nonstationary), and an own MA factor is on the
invertibility wall: y2 (1.0000). Reconsider that univariate model.
```

The numerical cause (why the joint Cholesky of mtmp0 fails at m = 3 where it
passes at m = 1) is in `elf`, the same in both engines: the C gives ifault 3
on the same files, and the port in C and in pure Python too. It is not
touched: a proven engine, and an MA on the wall is already a model to
reconsider. Fix (b), keeping the univariate search off the wall, would
change fue's optima and is not taken.

## Validation

—
- `bugs/BUG-0020-repro/repro.py` (y1.inp, y2.inp, y3.inp): exits 1 on the
code before (the "difference nan" message), 0 after.
- `tests/test_bug_0020_puerta_ma_en_la_pared.py`, with the C engine and with
`DRVARMA_NO_ENGINE=1`.
- The C: atsw-gui `engines/drvarma/bugs/BUG-0009-repro/repro.py`, the same
three files and the same message; before, "joint diagonal 0.000000" and a
difference of 1.26e+03.
42 changes: 42 additions & 0 deletions bugs/BUG-0020-repro/repro.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""BUG-0020: the diagonal gate fails with NaN when a univariate optimum sits
on the MA wall, and its message blames the cast.

The echelon study's system (2,2,1), rep 45, on route V's specifications
(y1.inp, y2.inp, y3.inp, written by research/echelon_seed/fits.py with a
fue header). y2's univariate MA(2) ends with an inverse root at modulus
~1.00005, inside chekma's tolerance: alone elf accepts it; the diagonal
system of three fails elf (ifault 3, the Cholesky of mtmp0). The gate said
"difference nan: the joint cast does not reproduce the univariate models".
The C said the same with a 0 for the joint logL (its BUG-0009).

Exits 1 while the GateError does not say that the diagonal system could not
be evaluated and name y2's MA on the wall, 0 when it does, 2 if the case
passes the gate (then there is nothing to say).

python3 bugs/BUG-0020-repro/repro.py # exits 1 while open
"""
import glob
import os
import sys
import warnings

warnings.simplefilter("ignore")
HERE = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.join(HERE, "..", "..", "src"))

from drvarma.ladder import GateError, Ladder # noqa: E402

L = Ladder(sorted(glob.glob(os.path.join(HERE, "y*.inp"))), 0, 0)
try:
L.run_gate()
except GateError as e:
msg = str(e)
else:
print("the case passes the gate: nothing to show")
sys.exit(2)
print(msg)
if "could not be evaluated" in msg and "invertibility wall: y2 (" in msg:
print("closed: the gate says the joint diagonal failed and names y2's MA")
sys.exit(0)
print("OPEN: the gate blames the cast and does not name the MA on the wall")
sys.exit(1)
Loading
Loading