From 6e32d2cc2746edb9f340f45b1337180cf090aa4e Mon Sep 17 00:00:00 2001 From: warriord Date: Sat, 28 Nov 2026 00:37:58 +0100 Subject: [PATCH] BUG-0020: the gate says when the diagonal system could not be evaluated; BUG-0001 closed by the C; BUG-0002 updated BUG-0020. With a univariate optimum whose own MA sits on the invertibility wall, the diagonal system can fail elf (ifault 3) 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, in the C's words for the fault, and names the own MA factors on the wall: the univariate model to reconsider. Only the message; the same in the C (atsw-gui engines/drvarma BUG-0009). Repro and test, with the C engine and with DRVARMA_NO_ENGINE=1. BUG-0001. The phase off-by-one was still live in the C of record (atsw-gui engines/drvarma); fixed there as its BUG-0008, the same rotation as the port's. Closed. BUG-0002. Updated, still open: the copies are two now (atsw-gui and the embedded csrc/); elfvarma.c is identical, the drift is the deprecated .inp path's (drvmlest.c, qnewtopt.c, nlatools.c). Resync or wait for 6.0: a decision pending. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LHFMF3teQWFeXfDJVGj2p5 --- CHANGELOG.md | 8 + ...n-phase-still-unpatched-in-the-c-engine.md | 22 +- ...ces-are-copies-and-have-already-drifted.md | 27 ++ ...0-la-puerta-falla-con-un-ma-en-la-pared.md | 31 ++- bugs/BUG-0020-repro/repro.py | 42 ++++ bugs/BUG-0020-repro/y1.inp | 238 ++++++++++++++++++ bugs/BUG-0020-repro/y2.inp | 238 ++++++++++++++++++ bugs/BUG-0020-repro/y3.inp | 236 +++++++++++++++++ bugs/README.md | 8 +- src/drvarma/ladder.py | 33 ++- tests/data/bug0020/y1.inp | 238 ++++++++++++++++++ tests/data/bug0020/y2.inp | 238 ++++++++++++++++++ tests/data/bug0020/y3.inp | 236 +++++++++++++++++ tests/test_bug_0020_puerta_ma_en_la_pared.py | 31 +++ 14 files changed, 1615 insertions(+), 11 deletions(-) create mode 100644 bugs/BUG-0020-repro/repro.py create mode 100644 bugs/BUG-0020-repro/y1.inp create mode 100644 bugs/BUG-0020-repro/y2.inp create mode 100644 bugs/BUG-0020-repro/y3.inp create mode 100644 tests/data/bug0020/y1.inp create mode 100644 tests/data/bug0020/y2.inp create mode 100644 tests/data/bug0020/y3.inp create mode 100644 tests/test_bug_0020_puerta_ma_en_la_pared.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bf06fe..fc1afeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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". diff --git a/bugs/BUG-0001-deseason-phase-still-unpatched-in-the-c-engine.md b/bugs/BUG-0001-deseason-phase-still-unpatched-in-the-c-engine.md index 7165c55..8fc7cd7 100644 --- a/bugs/BUG-0001-deseason-phase-still-unpatched-in-the-c-engine.md +++ b/bugs/BUG-0001-deseason-phase-still-unpatched-in-the-c-engine.md @@ -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: @@ -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. + diff --git a/bugs/BUG-0002-c-sources-are-copies-and-have-already-drifted.md b/bugs/BUG-0002-c-sources-are-copies-and-have-already-drifted.md index 406b56c..099d757 100644 --- a/bugs/BUG-0002-c-sources-are-copies-and-have-already-drifted.md +++ b/bugs/BUG-0002-c-sources-are-copies-and-have-already-drifted.md @@ -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. diff --git a/bugs/BUG-0020-la-puerta-falla-con-un-ma-en-la-pared.md b/bugs/BUG-0020-la-puerta-falla-con-un-ma-en-la-pared.md index 6d7e6cd..a030cc3 100644 --- a/bugs/BUG-0020-la-puerta-falla-con-un-ma-en-la-pared.md +++ b/bugs/BUG-0020-la-puerta-falla-con-un-ma-en-la-pared.md @@ -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 @@ -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. diff --git a/bugs/BUG-0020-repro/repro.py b/bugs/BUG-0020-repro/repro.py new file mode 100644 index 0000000..90dda4d --- /dev/null +++ b/bugs/BUG-0020-repro/repro.py @@ -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) diff --git a/bugs/BUG-0020-repro/y1.inp b/bugs/BUG-0020-repro/y1.inp new file mode 100644 index 0000000..4f8db67 --- /dev/null +++ b/bugs/BUG-0020-repro/y1.inp @@ -0,0 +1,238 @@ +************************************************ +* Input file for program FUE * +************************************************ +* Route V specification (drvarma BUG-0020: the echelon study's (2,2,1), rep 45) + +** Frequency of time series: either 1(A), 4(Q) or 12(M): + 1 +** Number of observations and starting date of time series: + 200 1 1 y1 +** Number of deterministic variables (including seasonal components): +0 +** Number and orders of regular AR operators: +1 2 +** +0.000000 1 +0.000000 1 +** Number and orders of annual AR operators: +0 +** Number and orders of regular MA operators: +1 2 +** +0.000000 1 +0.000000 1 +** Number and orders of anual MA operators: +0 +** Number and frequencies of regular AR(2) operators with fixed frequency: +0 +** Number and frequencies of regular MA(2) operators with fixed frequency: +0 +** Mean parameter (mu): +9.961451 1 +** Box-Cox lambda, regular differences and complete annual differences: + 1 0 0 +** Individual factors of the annual difference (starting at freq 0.0): + 0 +** ACF/PACF bands (0 Automatic) and reescaling factor: + 0 1 +** Time series (stochastic and non-standard deterministic variables): +9.06996474731577 +7.95184160477874 +7.96399894177633 +8.50244511887725 +9.69901085546404 +11.588655082543 +8.96028699686367 +8.49179172294378 +6.35827139474561 +7.77463897611694 +9.29442972881215 +9.8420658879027 +6.35034282717388 +10.8765672092971 +11.0250092564782 +8.64346642327471 +6.56823240535416 +10.8865083202116 +8.10189629257192 +9.52757773442323 +7.6539864196051 +12.8872463663156 +4.93934250957403 +8.32631780454742 +12.8342040794175 +5.00418554651598 +8.74981112278442 +11.5098338228065 +8.25797225740871 +9.7490868810673 +12.1244903313118 +7.10133676212733 +11.7465840310128 +9.46353025651178 +13.7609056853964 +7.87212161046984 +8.65689789860462 +12.2696924760417 +5.16255761795402 +10.7082938939938 +10.7602921191494 +10.8850708186432 +10.3756861774628 +8.83847013416639 +9.45808246516024 +11.5240163734399 +8.97543418304578 +12.1668748228465 +10.6913340551983 +11.0499913187575 +12.175805983211 +12.5315317001339 +9.28002883080372 +11.7646815049771 +7.36064516841932 +6.10156903102476 +8.14495409505972 +12.009324074588 +9.4139140924737 +7.25720465383465 +13.8057957492863 +9.90538263510384 +6.86495648869405 +9.71618445506552 +9.07333752132416 +9.05929267778123 +8.78047076367156 +8.65622960701792 +7.65991707127787 +10.3032878599049 +10.4953569355958 +9.56182949707338 +10.2271710905745 +11.9778230342019 +13.6505886366589 +12.5011944617502 +8.33862915055646 +11.6067080744298 +10.7481413419215 +9.39276156378414 +11.1443195497239 +10.3220536592356 +11.9384429751993 +11.3514089426834 +7.11541961442399 +10.5214860537658 +9.0722451415744 +8.85872015952433 +8.9767304754843 +7.57643414231709 +11.0171566287624 +6.47816071418712 +10.7718235734235 +12.3323363388423 +8.74045321308698 +7.08591985224233 +11.274060091612 +10.0151369867276 +8.26797595063481 +12.9227209891224 +12.0597456706994 +10.8693102602184 +8.2747152135436 +11.8953680618633 +9.70137182338664 +8.60598616030864 +12.6395942797795 +11.8636778054916 +6.22426280821616 +11.6443500790541 +6.77633953697015 +8.99457601034115 +9.93974952789896 +7.13738049098075 +11.0058079790894 +10.8619852159105 +9.57465131591182 +11.3431740654853 +9.43426877161755 +10.3265050687821 +9.14166150686048 +10.714949098135 +11.9830049015892 +10.5713653440607 +9.76092268136611 +10.4335170222954 +11.2754958649333 +9.7477573560343 +9.47965592022065 +7.84459369689827 +12.8905072185557 +9.44911399799116 +9.6859862652911 +14.0461369488758 +8.84838631114545 +5.99121007164766 +13.0470773114864 +9.77207299084983 +5.25860020465551 +13.6749099646736 +10.4698491168132 +10.0107755039958 +6.17851843103177 +11.7800384823726 +15.4369402839236 +10.906892073575 +9.54413850795107 +13.487917868476 +12.8520476369934 +10.1710315961017 +10.2219803866562 +14.1997808817442 +11.416971193689 +8.30952746628947 +7.87590889633557 +12.6865975094054 +9.90413240322241 +9.55372064813915 +8.46025589864412 +11.1332473228832 +7.4386761256714 +8.88771832648418 +10.3211320426202 +10.1833612794847 +10.202920088026 +9.83506133495961 +11.5751613507676 +8.58363064498272 +8.32383106557446 +14.9772101328657 +10.2020512367664 +7.90017136684204 +10.0601686153096 +9.28237434267665 +12.061508336972 +9.303609882134 +5.0794577191691 +13.2416171089129 +8.85204089274622 +12.9226519301135 +10.4053986748796 +10.8253077480266 +7.61111627212715 +13.3166160875177 +9.95570873440165 +9.35043287455681 +9.84905493110763 +15.8711446581724 +12.0086565139229 +11.8334283406569 +6.88749635286555 +12.0121072043702 +15.5981968484141 +8.62539314330304 +9.6729691877125 +11.6130061880937 +9.03743227023928 +8.93667231941544 +10.9554237749715 +6.17190604384312 diff --git a/bugs/BUG-0020-repro/y2.inp b/bugs/BUG-0020-repro/y2.inp new file mode 100644 index 0000000..4cc8f17 --- /dev/null +++ b/bugs/BUG-0020-repro/y2.inp @@ -0,0 +1,238 @@ +************************************************ +* Input file for program FUE * +************************************************ +* Route V specification (drvarma BUG-0020: the echelon study's (2,2,1), rep 45) + +** Frequency of time series: either 1(A), 4(Q) or 12(M): + 1 +** Number of observations and starting date of time series: + 200 1 1 y2 +** Number of deterministic variables (including seasonal components): +0 +** Number and orders of regular AR operators: +1 2 +** +0.000000 1 +0.000000 1 +** Number and orders of annual AR operators: +0 +** Number and orders of regular MA operators: +1 2 +** +0.000000 1 +0.000000 1 +** Number and orders of anual MA operators: +0 +** Number and frequencies of regular AR(2) operators with fixed frequency: +0 +** Number and frequencies of regular MA(2) operators with fixed frequency: +0 +** Mean parameter (mu): +10.031128 1 +** Box-Cox lambda, regular differences and complete annual differences: + 1 0 0 +** Individual factors of the annual difference (starting at freq 0.0): + 0 +** ACF/PACF bands (0 Automatic) and reescaling factor: + 0 1 +** Time series (stochastic and non-standard deterministic variables): +10.961561095428 +11.5501446920272 +11.0463056820124 +8.93409276685376 +8.81629236103666 +9.73245415974837 +10.7807943528177 +12.6241226434849 +10.4330482651906 +8.77585098507138 +7.601991780153 +11.6150863771414 +10.1372853596078 +8.14907684197468 +8.71788180589325 +11.6820519722109 +10.9289701554407 +9.13975107147125 +8.60133702841124 +13.0415700449124 +7.98473399077686 +12.3080177428287 +8.58444973465533 +9.58868442863639 +11.4340935349084 +11.1240003307687 +9.35660715097657 +10.2625649866286 +6.51500345498934 +11.680769513653 +12.8080924387946 +6.46847412215811 +12.0302248201088 +7.05486820606875 +12.2140693141206 +10.5183191586748 +8.64301948109695 +10.245502350093 +7.94131539170941 +14.030811249115 +5.89051346212758 +10.7474236811192 +10.6217384390626 +11.5118353952685 +9.13322147234434 +9.18786025454938 +7.0275670171545 +11.5073028878544 +11.4204312996498 +9.30718873063024 +8.30831914009698 +12.4006461706017 +8.98140113812302 +13.1175160494336 +11.2431584131638 +11.2994100217254 +8.15632059445064 +7.46676212430503 +11.3827607934545 +10.6527334948454 +9.03908861780811 +10.8524052217507 +12.6982768786057 +9.75151777863373 +8.38486991742382 +9.39905848486724 +10.6023408015473 +12.4866423248012 +10.8147481072219 +8.24297570344294 +8.66858308007148 +9.84629882470984 +9.06426175306069 +8.36195230116959 +8.18568873078684 +13.21167243613 +11.7670442193751 +11.482953952256 +9.59732690589911 +11.4430837508545 +9.5828047917177 +6.82277306675205 +10.4030198798133 +11.2967310021577 +11.7228270533121 +10.3472851091816 +8.64261781077574 +8.33186603677086 +11.4444634677917 +8.61512455505768 +11.8791299677275 +8.78688924751409 +10.265934774942 +9.65069684409137 +12.8761053023345 +9.95627625039769 +7.70510457500008 +9.72149933070521 +10.5562802475279 +7.86276536131566 +8.2679493696311 +14.3395277772152 +10.428337233387 +11.3907172895876 +10.4507251087528 +6.97296746230735 +8.80757929936679 +12.1187520231573 +8.51133930655315 +13.2456887789836 +8.69576149986261 +10.9040163307866 +10.8826847113689 +8.78684865049842 +10.4327597590778 +7.89696565339279 +8.82413586096757 +9.49202320678791 +7.38063808076261 +11.6665976923197 +9.22292810615618 +8.91510004211825 +10.2232572724469 +11.6384252462901 +11.0561409733274 +9.48120175866677 +9.51778079824345 +9.60649761742339 +9.96530402709526 +8.32082455955212 +12.2174689513143 +9.03295673809808 +8.28230685918997 +10.6422998597231 +12.4818263490718 +10.2607838334809 +10.1609603820346 +10.0256513044129 +10.0591392301105 +10.9844170389682 +7.55174374406691 +12.2858488620858 +9.90216299744858 +6.43129348815553 +7.97452510847643 +11.032568749894 +12.0053786230375 +7.49647421064538 +7.2814864198645 +14.4797862862518 +10.3639594392009 +8.28441250747553 +10.3772775273793 +13.3500823199687 +10.1188156696797 +10.3996672175928 +7.18604580641193 +11.0770731584978 +8.83334952701067 +10.7445357113039 +9.62810700502091 +11.0359866808818 +8.0931362157081 +9.20888146188703 +10.9323176653792 +9.97073036658236 +11.1368524768009 +11.4342430839743 +8.28901059952282 +8.72407668778648 +9.54109476595291 +11.698680886446 +12.0945939641445 +5.29563242754566 +12.5646008541175 +12.0562611223762 +7.44598155686374 +11.1518524534209 +6.61808996348776 +11.8224483067468 +9.92154848316195 +12.6441997636988 +8.08951897431347 +11.3521420865717 +6.46815568518881 +12.3348281551665 +8.81353934383707 +10.0730735301938 +9.30644493538766 +14.2207795022219 +8.36295175822993 +7.46877641195931 +10.1660443947522 +10.622755431197 +13.3969280019586 +10.4984029811636 +8.87595218364817 +11.7588206354072 +10.9404389623148 +9.60155574194038 diff --git a/bugs/BUG-0020-repro/y3.inp b/bugs/BUG-0020-repro/y3.inp new file mode 100644 index 0000000..ac52002 --- /dev/null +++ b/bugs/BUG-0020-repro/y3.inp @@ -0,0 +1,236 @@ +************************************************ +* Input file for program FUE * +************************************************ +* Route V specification (drvarma BUG-0020: the echelon study's (2,2,1), rep 45) + +** Frequency of time series: either 1(A), 4(Q) or 12(M): + 1 +** Number of observations and starting date of time series: + 200 1 1 y3 +** Number of deterministic variables (including seasonal components): +0 +** Number and orders of regular AR operators: +1 1 +** +0.000000 1 +** Number and orders of annual AR operators: +0 +** Number and orders of regular MA operators: +1 1 +** +0.000000 1 +** Number and orders of anual MA operators: +0 +** Number and frequencies of regular AR(2) operators with fixed frequency: +0 +** Number and frequencies of regular MA(2) operators with fixed frequency: +0 +** Mean parameter (mu): +10.097109 1 +** Box-Cox lambda, regular differences and complete annual differences: + 1 0 0 +** Individual factors of the annual difference (starting at freq 0.0): + 0 +** ACF/PACF bands (0 Automatic) and reescaling factor: + 0 1 +** Time series (stochastic and non-standard deterministic variables): +10.5446165980925 +12.1196910301995 +14.7572081313219 +15.7646907860011 +12.9861162574577 +10.883088647429 +10.8226124948273 +14.4993241168696 +18.823953308723 +17.8889229552915 +14.1231084689129 +13.2426538938714 +16.2615573539416 +15.0308850950125 +10.0514932665399 +10.2360227850602 +12.8423134733418 +12.6863801120541 +11.1955566654058 +10.5024406117606 +12.8493884302265 +12.9046094553387 +14.5508740474731 +12.0076128674671 +11.4544617440859 +13.4909585343958 +17.9005443934224 +12.3270655151437 +12.0571425623926 +10.4494069911752 +9.00474537304729 +14.0047601786205 +12.3874572501881 +9.49976775172156 +7.83153765952719 +12.5076278414541 +12.791658688785 +9.11915566464664 +11.1487063632545 +8.6997949046918 +11.1864424157386 +7.16690142691526 +8.6171182489306 +9.20964785379834 +11.800367271719 +9.99196797017942 +6.31302532155273 +4.86829288004803 +6.00156748044878 +6.13310175169246 +6.77638137829922 +4.88955111912481 +8.14327607578206 +7.85783871221041 +12.7478589210569 +17.6228822096305 +15.5820100596724 +10.4636968472575 +9.05670095441783 +9.14525116774233 +7.98882151654237 +8.16659479982696 +11.6108802681348 +16.0812793571653 +13.9929574158885 +9.80589224642811 +9.30344211641485 +12.0727971610228 +14.7232207968434 +14.7769588062735 +10.342895461613 +8.45932411731804 +9.12501254270955 +4.61932815593231 +-0.0740358156707277 +-0.238344993306733 +5.54513534760758 +7.50955516531138 +9.70355338950512 +10.9728303191515 +12.9971987438473 +12.0334171609227 +7.65526127294846 +9.36990680549093 +12.4218128527997 +15.4465351564256 +13.4565570383333 +13.2898897841576 +11.2576029119495 +11.1711424643246 +10.3756713535496 +12.8003864396796 +9.41343879356033 +8.89659154901049 +11.7800441334226 +14.8988455103457 +12.2429125135241 +9.31831354541141 +8.38613531498711 +7.2025097306513 +3.95440948402541 +1.96546008034191 +8.41486032025884 +12.9221398451103 +13.4891096119314 +12.0429741875181 +9.78248263779044 +7.43863365143764 +11.4130164546772 +11.7564652935636 +13.6561504998885 +12.7934392696186 +13.9457903598143 +16.0220696995151 +15.1867261502235 +15.4437372508957 +14.6346502289464 +12.5593042655859 +11.6584691935851 +8.94572646278683 +9.43235715988846 +6.4724058696955 +4.22703822449999 +6.12392600275122 +9.56172834372089 +10.5908726379311 +9.8789240572542 +10.4074065999069 +9.32120704469085 +7.9648380400059 +6.46866860720261 +9.14047774498159 +7.43410700895984 +4.80045177102325 +6.35853843286147 +11.2754742627935 +10.5196104127605 +9.67893045118831 +10.9002316450396 +11.6112081058667 +9.59631501225643 +10.816508895566 +14.12935597079 +11.4714053125237 +3.3081336270515 +4.31003862010399 +8.52853170170937 +6.72004347891028 +3.42536619724721 +2.48351705724201 +7.43118803935335 +6.92336122285821 +4.30164970762153 +7.60757322660759 +14.1631292910133 +12.9569352029368 +13.0959420844309 +12.2067490800692 +12.3319138895135 +10.3153645560071 +12.0539357370749 +13.2323625299587 +12.6779814761241 +9.77773616112019 +8.34620861007437 +8.19353605325446 +9.0719150370527 +11.4406202048257 +12.7072639528868 +8.8970810175718 +5.46928953266059 +9.93861315675869 +11.1063874263346 +10.3117472935522 +6.61916808623798 +10.9280612435766 +13.9771734614943 +9.67824301665726 +7.58505610883246 +6.0783393853102 +7.09565633055902 +8.30924954861368 +12.7784242893924 +8.25370595725368 +8.78680488568038 +5.59142166153442 +5.20208645359372 +3.38492303283125 +4.32879806307014 +6.28013996155138 +10.394244010185 +7.69253369775123 +2.75883778068252 +4.23578232355066 +6.66422450529218 +8.017183672282 +9.51613277289409 +8.16719406835756 +10.3090161512988 +12.5216559168989 diff --git a/bugs/README.md b/bugs/README.md index e2edd8f..eb16bd2 100644 --- a/bugs/README.md +++ b/bugs/README.md @@ -1,17 +1,16 @@ # Bug reports -In-repo bug tracker for **drvarma**. One Markdown file per bug (`BUG-NNNN-slug.md`); this index is generated by `art-bug index`. +In-repo bug tracker for **drvarma-bugs-viejos**. One Markdown file per bug (`BUG-NNNN-slug.md`); this index is generated by `art-bug index`. New report: `art-bug new` (or copy `TEMPLATE.md`). Validate: `art-bug check`. A fix commit references the id, e.g. `fix(pipeline): BUG-0001 …`. -**32 report(s), 4 open.** +**32 report(s), 2 open.** | id | status | sev | component | title | fixed in | |----|--------|-----|-----------|-------|----------| -| [BUG-0001](BUG-0001-deseason-phase-still-unpatched-in-the-c-engine.md) | open | high | deseason | 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 | — | | [BUG-0002](BUG-0002-c-sources-are-copies-and-have-already-drifted.md) | open | high | csrc | The C sources are three unsynchronised COPIES, and they have already drifted — the termcode fix lives in the embedded copy only | — | -| [BUG-0020](BUG-0020-la-puerta-falla-con-un-ma-en-la-pared.md) | open | low | ladder | 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 | — | | [BUG-0003](BUG-0003-seasonal-adjustment-applied-in-levels-before-box-cox.md) | in-progress | medium | deseason | The seasonal component is estimated and subtracted in LEVELS, before the Box-Cox log, so a multiplicative pattern on a trending index is adjusted at the wrong scale | 0.2.0 (Python; the C pending) | +| [BUG-0001](BUG-0001-deseason-phase-still-unpatched-in-the-c-engine.md) | fixed | high | deseason | 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 | the C, atsw-gui engines/drvarma BUG-0008 (2026-11-28); the port long before | | [BUG-0004](BUG-0004-el-docstring-dice-que-el-respaldo-en-python-solo-hace-q0.md) | fixed | low | engine | El docstring de `estimate_w` dice que el respaldo en Python sólo hace q=0, y hace VARMA completo desde junio | 0.2.0 | | [BUG-0005](BUG-0005-el-respaldo-en-python-puro-entra-sin-avisar.md) | fixed | medium | packaging | Donde no hay rueda binaria se instala la de Python puro y el motor C no se usa, sin ningún aviso | 0.2.0 | | [BUG-0006](BUG-0006-la-busqueda-lineal-no-vuelve-con-un-objetivo-no-finito.md) | fixed | high | optimizer | La búsqueda lineal no vuelve nunca si el objetivo es NaN o infinito — el optimizador (C y Python) se queda girando, sin error ni salida | 0.1.7 | @@ -24,6 +23,7 @@ New report: `art-bug new` (or copy `TEMPLATE.md`). Validate: `art-bug check`. | [BUG-0017](BUG-0017-el-lr-de-la-escalera-no-descuenta-los-ceros.md) | fixed | medium | ladder | Ladder.lr_test counts (p + q) cross coefficients per linked pair, whatever `zeros` fixed, so the LR's df is too large | 0.2.0 | | [BUG-0018](BUG-0018-overflow-de-logq-rompe-el-ajuste.md) | fixed | medium | ladder | A line-search step with log(Q_ii/Q_11) > 709 raises OverflowError out of Ladder.fit; the C rejects the point and goes on | 0.2.0 | | [BUG-0019](BUG-0019-hessiana-singular-rompe-el-ajuste.md) | fixed | medium | stderr | An exactly singular fdhess Hessian passes Cholesky and then raises LinAlgError out of Ladder.fit, instead of falling back to BFGS and saying so | 0.2.0 | +| [BUG-0020](BUG-0020-la-puerta-falla-con-un-ma-en-la-pared.md) | fixed | low | ladder | 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 | unreleased (after 0.3.4); the C, atsw-gui engines/drvarma BUG-0009 | | [BUG-0021](BUG-0021-una-instalacion-desde-git-no-lleva-el-registro.md) | fixed | low | packaging | An install from git carries no bug register; sima's engine-defects resource says it is missing | 0.2.0 | | [BUG-0022](BUG-0022-las-ruedas-de-windows-no-llevan-el-motor.md) | fixed | high | packaging | The Windows wheels carry no compiled engine — GSL is never installed for the Windows build, the optional extension fails in silence, and the smoke test skips | 0.2.0 | | [BUG-0023](BUG-0023-la-suite-entera-corre-sin-el-motor.md) | fixed | medium | tests | A full pytest run computes with the pure-Python port — collecting test_regression_bugs.py sets DRVARMA_NO_ENGINE for the whole session | 0.3.0 | diff --git a/src/drvarma/ladder.py b/src/drvarma/ladder.py index a3c76c1..6370409 100644 --- a/src/drvarma/ladder.py +++ b/src/drvarma/ladder.py @@ -97,6 +97,21 @@ def modulus(c): return out +# The C's fault_msg (escalera.c): the ifault of a ladder fit, in words. +_FAULT_MSG = {1: "Q matrix not positive definite", 2: "unit root in AR", + 3: "AR nonstationary", 4: "MA noninvertible", 5: "numerical problem", + 6: "inadmissible point (fixed-frequency factor or deterministic denominator)"} + + +def _fault_msg(ifault): + return _FAULT_MSG.get(int(ifault), "unknown") + + +def _own_ma_list(own): + """The C's list of own_ma_outside: "y2 (1.0000), ..." (BUG-0020).""" + return ", ".join(f"{name[:40]} ({md:.4f})" for name, _k, _q, _c, md in own) + + def _own_ma_text(own): """The C's block of the .out for own_ma_outside, line for line.""" if not own: @@ -1575,8 +1590,24 @@ def _gate_close(self, rows, m): total = float(sum(r["logL"] for r in rows)) diff = joint.logL - total passed = (joint.ifault == 0 and abs(diff) <= GATE_TOL * (1.0 + abs(total))) + # BUG-0020 (the C's BUG-0009): when the diagonal system cannot be + # evaluated, say so, and name an own MA factor of the univariate optima + # on the invertibility wall, the likely cause in sight. Only the report. + wall = _own_ma_outside(self.series) if joint.ifault else [] self.gate = {"rows": rows, "sum": total, "joint": joint.logL, - "difference": diff, "passed": bool(passed)} + "difference": diff, "passed": bool(passed), + "ifault": int(joint.ifault), "own_ma_wall": wall} + if not passed and wall: + raise GateError( + "the diagonal gate failed: the diagonal system could not be evaluated " + f"at the univariate optima ({_fault_msg(joint.ifault)}), and an own MA " + f"factor is on the invertibility wall: {_own_ma_list(wall)}. " + "Reconsider that univariate model.") + if not passed and joint.ifault: + raise GateError( + "the diagonal gate failed: the diagonal system could not be evaluated " + f"at the univariate optima ({_fault_msg(joint.ifault)}). Nothing on top " + "of it can be trusted.") if not passed: raise GateError(f"the diagonal gate failed (difference {diff:.3g}): the " f"joint cast does not reproduce the univariate models") diff --git a/tests/data/bug0020/y1.inp b/tests/data/bug0020/y1.inp new file mode 100644 index 0000000..4f8db67 --- /dev/null +++ b/tests/data/bug0020/y1.inp @@ -0,0 +1,238 @@ +************************************************ +* Input file for program FUE * +************************************************ +* Route V specification (drvarma BUG-0020: the echelon study's (2,2,1), rep 45) + +** Frequency of time series: either 1(A), 4(Q) or 12(M): + 1 +** Number of observations and starting date of time series: + 200 1 1 y1 +** Number of deterministic variables (including seasonal components): +0 +** Number and orders of regular AR operators: +1 2 +** +0.000000 1 +0.000000 1 +** Number and orders of annual AR operators: +0 +** Number and orders of regular MA operators: +1 2 +** +0.000000 1 +0.000000 1 +** Number and orders of anual MA operators: +0 +** Number and frequencies of regular AR(2) operators with fixed frequency: +0 +** Number and frequencies of regular MA(2) operators with fixed frequency: +0 +** Mean parameter (mu): +9.961451 1 +** Box-Cox lambda, regular differences and complete annual differences: + 1 0 0 +** Individual factors of the annual difference (starting at freq 0.0): + 0 +** ACF/PACF bands (0 Automatic) and reescaling factor: + 0 1 +** Time series (stochastic and non-standard deterministic variables): +9.06996474731577 +7.95184160477874 +7.96399894177633 +8.50244511887725 +9.69901085546404 +11.588655082543 +8.96028699686367 +8.49179172294378 +6.35827139474561 +7.77463897611694 +9.29442972881215 +9.8420658879027 +6.35034282717388 +10.8765672092971 +11.0250092564782 +8.64346642327471 +6.56823240535416 +10.8865083202116 +8.10189629257192 +9.52757773442323 +7.6539864196051 +12.8872463663156 +4.93934250957403 +8.32631780454742 +12.8342040794175 +5.00418554651598 +8.74981112278442 +11.5098338228065 +8.25797225740871 +9.7490868810673 +12.1244903313118 +7.10133676212733 +11.7465840310128 +9.46353025651178 +13.7609056853964 +7.87212161046984 +8.65689789860462 +12.2696924760417 +5.16255761795402 +10.7082938939938 +10.7602921191494 +10.8850708186432 +10.3756861774628 +8.83847013416639 +9.45808246516024 +11.5240163734399 +8.97543418304578 +12.1668748228465 +10.6913340551983 +11.0499913187575 +12.175805983211 +12.5315317001339 +9.28002883080372 +11.7646815049771 +7.36064516841932 +6.10156903102476 +8.14495409505972 +12.009324074588 +9.4139140924737 +7.25720465383465 +13.8057957492863 +9.90538263510384 +6.86495648869405 +9.71618445506552 +9.07333752132416 +9.05929267778123 +8.78047076367156 +8.65622960701792 +7.65991707127787 +10.3032878599049 +10.4953569355958 +9.56182949707338 +10.2271710905745 +11.9778230342019 +13.6505886366589 +12.5011944617502 +8.33862915055646 +11.6067080744298 +10.7481413419215 +9.39276156378414 +11.1443195497239 +10.3220536592356 +11.9384429751993 +11.3514089426834 +7.11541961442399 +10.5214860537658 +9.0722451415744 +8.85872015952433 +8.9767304754843 +7.57643414231709 +11.0171566287624 +6.47816071418712 +10.7718235734235 +12.3323363388423 +8.74045321308698 +7.08591985224233 +11.274060091612 +10.0151369867276 +8.26797595063481 +12.9227209891224 +12.0597456706994 +10.8693102602184 +8.2747152135436 +11.8953680618633 +9.70137182338664 +8.60598616030864 +12.6395942797795 +11.8636778054916 +6.22426280821616 +11.6443500790541 +6.77633953697015 +8.99457601034115 +9.93974952789896 +7.13738049098075 +11.0058079790894 +10.8619852159105 +9.57465131591182 +11.3431740654853 +9.43426877161755 +10.3265050687821 +9.14166150686048 +10.714949098135 +11.9830049015892 +10.5713653440607 +9.76092268136611 +10.4335170222954 +11.2754958649333 +9.7477573560343 +9.47965592022065 +7.84459369689827 +12.8905072185557 +9.44911399799116 +9.6859862652911 +14.0461369488758 +8.84838631114545 +5.99121007164766 +13.0470773114864 +9.77207299084983 +5.25860020465551 +13.6749099646736 +10.4698491168132 +10.0107755039958 +6.17851843103177 +11.7800384823726 +15.4369402839236 +10.906892073575 +9.54413850795107 +13.487917868476 +12.8520476369934 +10.1710315961017 +10.2219803866562 +14.1997808817442 +11.416971193689 +8.30952746628947 +7.87590889633557 +12.6865975094054 +9.90413240322241 +9.55372064813915 +8.46025589864412 +11.1332473228832 +7.4386761256714 +8.88771832648418 +10.3211320426202 +10.1833612794847 +10.202920088026 +9.83506133495961 +11.5751613507676 +8.58363064498272 +8.32383106557446 +14.9772101328657 +10.2020512367664 +7.90017136684204 +10.0601686153096 +9.28237434267665 +12.061508336972 +9.303609882134 +5.0794577191691 +13.2416171089129 +8.85204089274622 +12.9226519301135 +10.4053986748796 +10.8253077480266 +7.61111627212715 +13.3166160875177 +9.95570873440165 +9.35043287455681 +9.84905493110763 +15.8711446581724 +12.0086565139229 +11.8334283406569 +6.88749635286555 +12.0121072043702 +15.5981968484141 +8.62539314330304 +9.6729691877125 +11.6130061880937 +9.03743227023928 +8.93667231941544 +10.9554237749715 +6.17190604384312 diff --git a/tests/data/bug0020/y2.inp b/tests/data/bug0020/y2.inp new file mode 100644 index 0000000..4cc8f17 --- /dev/null +++ b/tests/data/bug0020/y2.inp @@ -0,0 +1,238 @@ +************************************************ +* Input file for program FUE * +************************************************ +* Route V specification (drvarma BUG-0020: the echelon study's (2,2,1), rep 45) + +** Frequency of time series: either 1(A), 4(Q) or 12(M): + 1 +** Number of observations and starting date of time series: + 200 1 1 y2 +** Number of deterministic variables (including seasonal components): +0 +** Number and orders of regular AR operators: +1 2 +** +0.000000 1 +0.000000 1 +** Number and orders of annual AR operators: +0 +** Number and orders of regular MA operators: +1 2 +** +0.000000 1 +0.000000 1 +** Number and orders of anual MA operators: +0 +** Number and frequencies of regular AR(2) operators with fixed frequency: +0 +** Number and frequencies of regular MA(2) operators with fixed frequency: +0 +** Mean parameter (mu): +10.031128 1 +** Box-Cox lambda, regular differences and complete annual differences: + 1 0 0 +** Individual factors of the annual difference (starting at freq 0.0): + 0 +** ACF/PACF bands (0 Automatic) and reescaling factor: + 0 1 +** Time series (stochastic and non-standard deterministic variables): +10.961561095428 +11.5501446920272 +11.0463056820124 +8.93409276685376 +8.81629236103666 +9.73245415974837 +10.7807943528177 +12.6241226434849 +10.4330482651906 +8.77585098507138 +7.601991780153 +11.6150863771414 +10.1372853596078 +8.14907684197468 +8.71788180589325 +11.6820519722109 +10.9289701554407 +9.13975107147125 +8.60133702841124 +13.0415700449124 +7.98473399077686 +12.3080177428287 +8.58444973465533 +9.58868442863639 +11.4340935349084 +11.1240003307687 +9.35660715097657 +10.2625649866286 +6.51500345498934 +11.680769513653 +12.8080924387946 +6.46847412215811 +12.0302248201088 +7.05486820606875 +12.2140693141206 +10.5183191586748 +8.64301948109695 +10.245502350093 +7.94131539170941 +14.030811249115 +5.89051346212758 +10.7474236811192 +10.6217384390626 +11.5118353952685 +9.13322147234434 +9.18786025454938 +7.0275670171545 +11.5073028878544 +11.4204312996498 +9.30718873063024 +8.30831914009698 +12.4006461706017 +8.98140113812302 +13.1175160494336 +11.2431584131638 +11.2994100217254 +8.15632059445064 +7.46676212430503 +11.3827607934545 +10.6527334948454 +9.03908861780811 +10.8524052217507 +12.6982768786057 +9.75151777863373 +8.38486991742382 +9.39905848486724 +10.6023408015473 +12.4866423248012 +10.8147481072219 +8.24297570344294 +8.66858308007148 +9.84629882470984 +9.06426175306069 +8.36195230116959 +8.18568873078684 +13.21167243613 +11.7670442193751 +11.482953952256 +9.59732690589911 +11.4430837508545 +9.5828047917177 +6.82277306675205 +10.4030198798133 +11.2967310021577 +11.7228270533121 +10.3472851091816 +8.64261781077574 +8.33186603677086 +11.4444634677917 +8.61512455505768 +11.8791299677275 +8.78688924751409 +10.265934774942 +9.65069684409137 +12.8761053023345 +9.95627625039769 +7.70510457500008 +9.72149933070521 +10.5562802475279 +7.86276536131566 +8.2679493696311 +14.3395277772152 +10.428337233387 +11.3907172895876 +10.4507251087528 +6.97296746230735 +8.80757929936679 +12.1187520231573 +8.51133930655315 +13.2456887789836 +8.69576149986261 +10.9040163307866 +10.8826847113689 +8.78684865049842 +10.4327597590778 +7.89696565339279 +8.82413586096757 +9.49202320678791 +7.38063808076261 +11.6665976923197 +9.22292810615618 +8.91510004211825 +10.2232572724469 +11.6384252462901 +11.0561409733274 +9.48120175866677 +9.51778079824345 +9.60649761742339 +9.96530402709526 +8.32082455955212 +12.2174689513143 +9.03295673809808 +8.28230685918997 +10.6422998597231 +12.4818263490718 +10.2607838334809 +10.1609603820346 +10.0256513044129 +10.0591392301105 +10.9844170389682 +7.55174374406691 +12.2858488620858 +9.90216299744858 +6.43129348815553 +7.97452510847643 +11.032568749894 +12.0053786230375 +7.49647421064538 +7.2814864198645 +14.4797862862518 +10.3639594392009 +8.28441250747553 +10.3772775273793 +13.3500823199687 +10.1188156696797 +10.3996672175928 +7.18604580641193 +11.0770731584978 +8.83334952701067 +10.7445357113039 +9.62810700502091 +11.0359866808818 +8.0931362157081 +9.20888146188703 +10.9323176653792 +9.97073036658236 +11.1368524768009 +11.4342430839743 +8.28901059952282 +8.72407668778648 +9.54109476595291 +11.698680886446 +12.0945939641445 +5.29563242754566 +12.5646008541175 +12.0562611223762 +7.44598155686374 +11.1518524534209 +6.61808996348776 +11.8224483067468 +9.92154848316195 +12.6441997636988 +8.08951897431347 +11.3521420865717 +6.46815568518881 +12.3348281551665 +8.81353934383707 +10.0730735301938 +9.30644493538766 +14.2207795022219 +8.36295175822993 +7.46877641195931 +10.1660443947522 +10.622755431197 +13.3969280019586 +10.4984029811636 +8.87595218364817 +11.7588206354072 +10.9404389623148 +9.60155574194038 diff --git a/tests/data/bug0020/y3.inp b/tests/data/bug0020/y3.inp new file mode 100644 index 0000000..ac52002 --- /dev/null +++ b/tests/data/bug0020/y3.inp @@ -0,0 +1,236 @@ +************************************************ +* Input file for program FUE * +************************************************ +* Route V specification (drvarma BUG-0020: the echelon study's (2,2,1), rep 45) + +** Frequency of time series: either 1(A), 4(Q) or 12(M): + 1 +** Number of observations and starting date of time series: + 200 1 1 y3 +** Number of deterministic variables (including seasonal components): +0 +** Number and orders of regular AR operators: +1 1 +** +0.000000 1 +** Number and orders of annual AR operators: +0 +** Number and orders of regular MA operators: +1 1 +** +0.000000 1 +** Number and orders of anual MA operators: +0 +** Number and frequencies of regular AR(2) operators with fixed frequency: +0 +** Number and frequencies of regular MA(2) operators with fixed frequency: +0 +** Mean parameter (mu): +10.097109 1 +** Box-Cox lambda, regular differences and complete annual differences: + 1 0 0 +** Individual factors of the annual difference (starting at freq 0.0): + 0 +** ACF/PACF bands (0 Automatic) and reescaling factor: + 0 1 +** Time series (stochastic and non-standard deterministic variables): +10.5446165980925 +12.1196910301995 +14.7572081313219 +15.7646907860011 +12.9861162574577 +10.883088647429 +10.8226124948273 +14.4993241168696 +18.823953308723 +17.8889229552915 +14.1231084689129 +13.2426538938714 +16.2615573539416 +15.0308850950125 +10.0514932665399 +10.2360227850602 +12.8423134733418 +12.6863801120541 +11.1955566654058 +10.5024406117606 +12.8493884302265 +12.9046094553387 +14.5508740474731 +12.0076128674671 +11.4544617440859 +13.4909585343958 +17.9005443934224 +12.3270655151437 +12.0571425623926 +10.4494069911752 +9.00474537304729 +14.0047601786205 +12.3874572501881 +9.49976775172156 +7.83153765952719 +12.5076278414541 +12.791658688785 +9.11915566464664 +11.1487063632545 +8.6997949046918 +11.1864424157386 +7.16690142691526 +8.6171182489306 +9.20964785379834 +11.800367271719 +9.99196797017942 +6.31302532155273 +4.86829288004803 +6.00156748044878 +6.13310175169246 +6.77638137829922 +4.88955111912481 +8.14327607578206 +7.85783871221041 +12.7478589210569 +17.6228822096305 +15.5820100596724 +10.4636968472575 +9.05670095441783 +9.14525116774233 +7.98882151654237 +8.16659479982696 +11.6108802681348 +16.0812793571653 +13.9929574158885 +9.80589224642811 +9.30344211641485 +12.0727971610228 +14.7232207968434 +14.7769588062735 +10.342895461613 +8.45932411731804 +9.12501254270955 +4.61932815593231 +-0.0740358156707277 +-0.238344993306733 +5.54513534760758 +7.50955516531138 +9.70355338950512 +10.9728303191515 +12.9971987438473 +12.0334171609227 +7.65526127294846 +9.36990680549093 +12.4218128527997 +15.4465351564256 +13.4565570383333 +13.2898897841576 +11.2576029119495 +11.1711424643246 +10.3756713535496 +12.8003864396796 +9.41343879356033 +8.89659154901049 +11.7800441334226 +14.8988455103457 +12.2429125135241 +9.31831354541141 +8.38613531498711 +7.2025097306513 +3.95440948402541 +1.96546008034191 +8.41486032025884 +12.9221398451103 +13.4891096119314 +12.0429741875181 +9.78248263779044 +7.43863365143764 +11.4130164546772 +11.7564652935636 +13.6561504998885 +12.7934392696186 +13.9457903598143 +16.0220696995151 +15.1867261502235 +15.4437372508957 +14.6346502289464 +12.5593042655859 +11.6584691935851 +8.94572646278683 +9.43235715988846 +6.4724058696955 +4.22703822449999 +6.12392600275122 +9.56172834372089 +10.5908726379311 +9.8789240572542 +10.4074065999069 +9.32120704469085 +7.9648380400059 +6.46866860720261 +9.14047774498159 +7.43410700895984 +4.80045177102325 +6.35853843286147 +11.2754742627935 +10.5196104127605 +9.67893045118831 +10.9002316450396 +11.6112081058667 +9.59631501225643 +10.816508895566 +14.12935597079 +11.4714053125237 +3.3081336270515 +4.31003862010399 +8.52853170170937 +6.72004347891028 +3.42536619724721 +2.48351705724201 +7.43118803935335 +6.92336122285821 +4.30164970762153 +7.60757322660759 +14.1631292910133 +12.9569352029368 +13.0959420844309 +12.2067490800692 +12.3319138895135 +10.3153645560071 +12.0539357370749 +13.2323625299587 +12.6779814761241 +9.77773616112019 +8.34620861007437 +8.19353605325446 +9.0719150370527 +11.4406202048257 +12.7072639528868 +8.8970810175718 +5.46928953266059 +9.93861315675869 +11.1063874263346 +10.3117472935522 +6.61916808623798 +10.9280612435766 +13.9771734614943 +9.67824301665726 +7.58505610883246 +6.0783393853102 +7.09565633055902 +8.30924954861368 +12.7784242893924 +8.25370595725368 +8.78680488568038 +5.59142166153442 +5.20208645359372 +3.38492303283125 +4.32879806307014 +6.28013996155138 +10.394244010185 +7.69253369775123 +2.75883778068252 +4.23578232355066 +6.66422450529218 +8.017183672282 +9.51613277289409 +8.16719406835756 +10.3090161512988 +12.5216559168989 diff --git a/tests/test_bug_0020_puerta_ma_en_la_pared.py b/tests/test_bug_0020_puerta_ma_en_la_pared.py new file mode 100644 index 0000000..24cc0ac --- /dev/null +++ b/tests/test_bug_0020_puerta_ma_en_la_pared.py @@ -0,0 +1,31 @@ +"""BUG-0020 (the C's BUG-0009): when the diagonal system cannot be evaluated +at the univariate optima, the gate says so and names an own MA factor on the +invertibility wall, instead of "difference nan" and blaming the cast.""" +import glob +import os + +import pytest + +from drvarma.ladder import GateError, Ladder, _fault_msg, _own_ma_list + +D = os.path.join(os.path.dirname(__file__), "data", "bug0020") + + +def test_la_puerta_nombra_el_ma_en_la_pared(): + L = Ladder(sorted(glob.glob(os.path.join(D, "y*.inp"))), 0, 0) + with pytest.raises(GateError) as e: + L.run_gate() + msg = str(e.value) + assert "could not be evaluated at the univariate optima (AR nonstationary)" in msg + assert "invertibility wall: y2 (1.0000)" in msg + assert "joint cast does not reproduce" not in msg + g = L.gate + assert g["ifault"] == 3 and not g["passed"] + assert [w[0] for w in g["own_ma_wall"]] == ["y2"] + + +def test_las_piezas_del_mensaje_son_las_del_c(): + assert _fault_msg(3) == "AR nonstationary" + assert _fault_msg(99) == "unknown" + assert _own_ma_list([("y2", "regular MA", 2, "", 0.99990), + ("y3", "regular MA", 1, "theta = 1.0", 1.0)]) == "y2 (0.9999), y3 (1.0000)"