Vendored libraries — local patches
This file enumerates every local modification on top of the upstream
methods/_vendored/{tslib,moderntcn}/ source. Per plan §7b #6, additions
must be appended (not silently merged) so the diff against upstream is
auditable.
Source revisions:
tslib/— https://github.com/thuml/Time-Series-Library (main; MIT — seeLICENSE-tslib)moderntcn/— https://github.com/luodhhh/ModernTCN (main; MIT — seeLICENSE-moderntcn)
License note: Plan §7 lists ModernTCN as Apache 2.0; verification against the upstream
LICENSEfile (fetched 2026-05-04) confirms it is MIT. The MIT text is reproduced verbatim underLICENSE-moderntcn.
Patches in methods/_vendored/
TSLib (tslib/)
No source-level patches. The vendored snapshot is byte-identical to the
upstream models/{DLinear,iTransformer,PatchTST}.py and the supporting
layers/. The Method-contract glue — namespace-style configs, (B, L, F)
input shape, target-variate selection — lives in methods/sequence.py
inside the _TSLibWrapper class (a thin nn.Module adapter, not a
modification to the vendored source).
ModernTCN (moderntcn/)
No source-level patches. The vendored snapshot is byte-identical to the
upstream models/{ModernTCN,ModernTCN_Layer}.py and layers/RevIN.py.
The Method-contract glue lives in methods/sequence.py inside the
_ModernTCNWrapper class (same pattern as _TSLibWrapper; constructs
the four-stage dims/dw_dims lists ModernTCN expects even when only
one stage is in use).
Patches that live outside methods/_vendored/ (referenced for completeness)
These patches operate against installed Python packages — not vendored source — but are documented here because they are part of the same "local modifications to upstream behaviour" surface the auditor cares about.
Moirai2 — gluonts 0.16 forward-shape wrap
- Where:
methods/tsfm.py - What: Wraps
Moirai2Forecast.forwardso it returns((preds.transpose(1, 2),), None, None), the shapegluonts==0.16.QuantileForecastGeneratorexpects. - Why:
uni2tsships a forward signature aligned with gluonts < 0.16; the runtime crash this papers over is a pure interface mismatch, not a semantic change. - Idempotency: guarded by the
_macrolens_gluonts016_wrap_appliedsentinel attribute on theMoirai2Forecastclass so repeated method instantiations do not stack wrappers.
Sundial — not vendored, removed from the panel
transformers >= 4.45is incompatible with the upstream Sundial checkpoint's custom forward; rather than maintain a deeper patch we removed Sundial fromexperiments/panel.py(see comment there).- This entry is preserved as a trail for future re-evaluation against a newer upstream release.
Method-contract wrappers (not modifications, but worth documenting)
_TSLibWrapper—methods/sequence.py. Thinnn.Moduleadapter exposing the vendored TSLib models via the unifiedMethodcontract. Accepts(B, L, F)and emits the target variate at indexself.target_idx(closeprice column for T1; index 0 for T4)._ModernTCNWrapper—methods/sequence.py. Same pattern for the vendored ModernTCN model. Constructs the four-stagedimsanddw_dimslists ModernTCN expects even when only one stage is in active use.
Append-only log
Future patches MUST be appended below this header (with date and a one- line rationale). Silent merges into the sections above are prohibited by plan §7b #6.
2026-05-05 — ITFormer (itformer/) — adapter for authors' CLI
Added methods/_vendored/itformer/ with two files:
__init__.py— re-exportsITFormerEngine.engine.py— Pythonic wrapper that drives the authors'inference.pyCLI verbatim. Locates an existing clone atbaselines/_vendor/itformer/(preferred; legacy clone, 3.5 MB) ormethods/_vendored/itformer/upstream/(clones on demand). No source-level patches to the upstream tree — it is invoked as an opaque CLI per the authors'accelerate launch ... inference.py --config ... --model_checkpoint ...recipe.
Source revision:
- Upstream URL:
https://github.com/Pandalin98/ITFormer-ICML25(main, MIT — see upstreamLICENSE). Verified againsthttps://huggingface.co/Pandalin98/ITFormer-ICML25model card on 2026-05-05.
The Method-contract glue lives in methods/llm_ts_reason.py::ITFormer
(per-task _predict_* overrides that batch all prompts into one
HDF5+JSONL+YAML triple, subprocess-call inference.py once, and route
each generated prediction string through the same parsers the
chat-complete path uses). Documented protocol mismatch (zero-padded
time-series prefix for non-T1 tasks; all prompts tagged stage='1') is
disclosed in DRAFT.md Family 6 and in the ITFormer class docstring.