diff --git a/shared/package-files/06/06003cce6773f4dc3e5dbbb8fb0dd4001796ca9a8bbe6cbd5732fbe3812662d1/test_rewrite.py b/shared/package-files/06/06003cce6773f4dc3e5dbbb8fb0dd4001796ca9a8bbe6cbd5732fbe3812662d1/test_rewrite.py new file mode 100644 index 0000000000000000000000000000000000000000..7b73e2856d5f6380c576220fa2780324df98091a --- /dev/null +++ b/shared/package-files/06/06003cce6773f4dc3e5dbbb8fb0dd4001796ca9a8bbe6cbd5732fbe3812662d1/test_rewrite.py @@ -0,0 +1,74 @@ +from sympy.unify.rewrite import rewriterule +from sympy.core.basic import Basic +from sympy.core.singleton import S +from sympy.core.symbol import Symbol +from sympy.functions.elementary.trigonometric import sin +from sympy.abc import x, y +from sympy.strategies.rl import rebuild +from sympy.assumptions import Q + +p, q = Symbol('p'), Symbol('q') + +def test_simple(): + rl = rewriterule(Basic(p, S(1)), Basic(p, S(2)), variables=(p,)) + assert list(rl(Basic(S(3), S(1)))) == [Basic(S(3), S(2))] + + p1 = p**2 + p2 = p**3 + rl = rewriterule(p1, p2, variables=(p,)) + + expr = x**2 + assert list(rl(expr)) == [x**3] + +def test_simple_variables(): + rl = rewriterule(Basic(x, S(1)), Basic(x, S(2)), variables=(x,)) + assert list(rl(Basic(S(3), S(1)))) == [Basic(S(3), S(2))] + + rl = rewriterule(x**2, x**3, variables=(x,)) + assert list(rl(y**2)) == [y**3] + +def test_moderate(): + p1 = p**2 + q**3 + p2 = (p*q)**4 + rl = rewriterule(p1, p2, (p, q)) + + expr = x**2 + y**3 + assert list(rl(expr)) == [(x*y)**4] + +def test_sincos(): + p1 = sin(p)**2 + sin(p)**2 + p2 = 1 + rl = rewriterule(p1, p2, (p, q)) + + assert list(rl(sin(x)**2 + sin(x)**2)) == [1] + assert list(rl(sin(y)**2 + sin(y)**2)) == [1] + +def test_Exprs_ok(): + rl = rewriterule(p+q, q+p, (p, q)) + next(rl(x+y)).is_commutative + str(next(rl(x+y))) + +def test_condition_simple(): + rl = rewriterule(x, x+1, [x], lambda x: x < 10) + assert not list(rl(S(15))) + assert rebuild(next(rl(S(5)))) == 6 + + +def test_condition_multiple(): + rl = rewriterule(x + y, x**y, [x,y], lambda x, y: x.is_integer) + + a = Symbol('a') + b = Symbol('b', integer=True) + expr = a + b + assert list(rl(expr)) == [b**a] + + c = Symbol('c', integer=True) + d = Symbol('d', integer=True) + assert set(rl(c + d)) == {c**d, d**c} + +def test_assumptions(): + rl = rewriterule(x + y, x**y, [x, y], assume=Q.integer(x)) + + a, b = map(Symbol, 'ab') + expr = a + b + assert list(rl(expr, Q.integer(b))) == [b**a] diff --git a/shared/package-files/06/060f52bfcb8d3df3376c3b56ac879a8675da71dc864a396221e70fc870aa9937/test_pprint.py b/shared/package-files/06/060f52bfcb8d3df3376c3b56ac879a8675da71dc864a396221e70fc870aa9937/test_pprint.py new file mode 100644 index 0000000000000000000000000000000000000000..ee3e267dd5cbe317d93f52d3a1db350465050996 --- /dev/null +++ b/shared/package-files/06/060f52bfcb8d3df3376c3b56ac879a8675da71dc864a396221e70fc870aa9937/test_pprint.py @@ -0,0 +1,695 @@ +import re +from pprint import PrettyPrinter + +import numpy as np +import pytest + +from sklearn import config_context +from sklearn.base import BaseEstimator, TransformerMixin +from sklearn.feature_selection import SelectKBest, chi2 +from sklearn.linear_model import LogisticRegressionCV +from sklearn.pipeline import make_pipeline +from sklearn.utils._pprint import _EstimatorPrettyPrinter + + +# Constructors excerpted to test pprinting +class LogisticRegression(BaseEstimator): + def __init__( + self, + penalty="l2", + dual=False, + tol=1e-4, + C=1.0, + fit_intercept=True, + intercept_scaling=1, + class_weight=None, + random_state=None, + solver="warn", + max_iter=100, + multi_class="warn", + verbose=0, + warm_start=False, + n_jobs=None, + l1_ratio=None, + ): + self.penalty = penalty + self.dual = dual + self.tol = tol + self.C = C + self.fit_intercept = fit_intercept + self.intercept_scaling = intercept_scaling + self.class_weight = class_weight + self.random_state = random_state + self.solver = solver + self.max_iter = max_iter + self.multi_class = multi_class + self.verbose = verbose + self.warm_start = warm_start + self.n_jobs = n_jobs + self.l1_ratio = l1_ratio + + def fit(self, X, y): + return self + + +class StandardScaler(TransformerMixin, BaseEstimator): + def __init__(self, copy=True, with_mean=True, with_std=True): + self.with_mean = with_mean + self.with_std = with_std + self.copy = copy + + def transform(self, X, copy=None): + return self + + +class RFE(BaseEstimator): + def __init__(self, estimator, n_features_to_select=None, step=1, verbose=0): + self.estimator = estimator + self.n_features_to_select = n_features_to_select + self.step = step + self.verbose = verbose + + +class GridSearchCV(BaseEstimator): + def __init__( + self, + estimator, + param_grid, + scoring=None, + n_jobs=None, + iid="warn", + refit=True, + cv="warn", + verbose=0, + pre_dispatch="2*n_jobs", + error_score="raise-deprecating", + return_train_score=False, + ): + self.estimator = estimator + self.param_grid = param_grid + self.scoring = scoring + self.n_jobs = n_jobs + self.iid = iid + self.refit = refit + self.cv = cv + self.verbose = verbose + self.pre_dispatch = pre_dispatch + self.error_score = error_score + self.return_train_score = return_train_score + + +class CountVectorizer(BaseEstimator): + def __init__( + self, + input="content", + encoding="utf-8", + decode_error="strict", + strip_accents=None, + lowercase=True, + preprocessor=None, + tokenizer=None, + stop_words=None, + token_pattern=r"(?u)\b\w\w+\b", + ngram_range=(1, 1), + analyzer="word", + max_df=1.0, + min_df=1, + max_features=None, + vocabulary=None, + binary=False, + dtype=np.int64, + ): + self.input = input + self.encoding = encoding + self.decode_error = decode_error + self.strip_accents = strip_accents + self.preprocessor = preprocessor + self.tokenizer = tokenizer + self.analyzer = analyzer + self.lowercase = lowercase + self.token_pattern = token_pattern + self.stop_words = stop_words + self.max_df = max_df + self.min_df = min_df + self.max_features = max_features + self.ngram_range = ngram_range + self.vocabulary = vocabulary + self.binary = binary + self.dtype = dtype + + +class Pipeline(BaseEstimator): + def __init__(self, steps, memory=None): + self.steps = steps + self.memory = memory + + +class SVC(BaseEstimator): + def __init__( + self, + C=1.0, + kernel="rbf", + degree=3, + gamma="auto_deprecated", + coef0=0.0, + shrinking=True, + probability=False, + tol=1e-3, + cache_size=200, + class_weight=None, + verbose=False, + max_iter=-1, + decision_function_shape="ovr", + random_state=None, + ): + self.kernel = kernel + self.degree = degree + self.gamma = gamma + self.coef0 = coef0 + self.tol = tol + self.C = C + self.shrinking = shrinking + self.probability = probability + self.cache_size = cache_size + self.class_weight = class_weight + self.verbose = verbose + self.max_iter = max_iter + self.decision_function_shape = decision_function_shape + self.random_state = random_state + + +class PCA(BaseEstimator): + def __init__( + self, + n_components=None, + copy=True, + whiten=False, + svd_solver="auto", + tol=0.0, + iterated_power="auto", + random_state=None, + ): + self.n_components = n_components + self.copy = copy + self.whiten = whiten + self.svd_solver = svd_solver + self.tol = tol + self.iterated_power = iterated_power + self.random_state = random_state + + +class NMF(BaseEstimator): + def __init__( + self, + n_components=None, + init=None, + solver="cd", + beta_loss="frobenius", + tol=1e-4, + max_iter=200, + random_state=None, + alpha=0.0, + l1_ratio=0.0, + verbose=0, + shuffle=False, + ): + self.n_components = n_components + self.init = init + self.solver = solver + self.beta_loss = beta_loss + self.tol = tol + self.max_iter = max_iter + self.random_state = random_state + self.alpha = alpha + self.l1_ratio = l1_ratio + self.verbose = verbose + self.shuffle = shuffle + + +class SimpleImputer(BaseEstimator): + def __init__( + self, + missing_values=np.nan, + strategy="mean", + fill_value=None, + verbose=0, + copy=True, + ): + self.missing_values = missing_values + self.strategy = strategy + self.fill_value = fill_value + self.verbose = verbose + self.copy = copy + + +def test_basic(print_changed_only_false): + # Basic pprint test + lr = LogisticRegression() + expected = """ +LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True, + intercept_scaling=1, l1_ratio=None, max_iter=100, + multi_class='warn', n_jobs=None, penalty='l2', + random_state=None, solver='warn', tol=0.0001, verbose=0, + warm_start=False)""" + + expected = expected[1:] # remove first \n + assert lr.__repr__() == expected + + +def test_changed_only(): + # Make sure the changed_only param is correctly used when True (default) + lr = LogisticRegression(C=99) + expected = """LogisticRegression(C=99)""" + assert lr.__repr__() == expected + + # Check with a repr that doesn't fit on a single line + lr = LogisticRegression( + C=99, class_weight=0.4, fit_intercept=False, tol=1234, verbose=True + ) + expected = """ +LogisticRegression(C=99, class_weight=0.4, fit_intercept=False, tol=1234, + verbose=True)""" + expected = expected[1:] # remove first \n + assert lr.__repr__() == expected + + imputer = SimpleImputer(missing_values=0) + expected = """SimpleImputer(missing_values=0)""" + assert imputer.__repr__() == expected + + # Defaults to np.nan, trying with float('NaN') + imputer = SimpleImputer(missing_values=float("NaN")) + expected = """SimpleImputer()""" + assert imputer.__repr__() == expected + + # make sure array parameters don't throw error (see #13583) + repr(LogisticRegressionCV(Cs=np.array([0.1, 1]))) + + +def test_pipeline(print_changed_only_false): + # Render a pipeline object + pipeline = make_pipeline(StandardScaler(), LogisticRegression(C=999)) + expected = """ +Pipeline(memory=None, + steps=[('standardscaler', + StandardScaler(copy=True, with_mean=True, with_std=True)), + ('logisticregression', + LogisticRegression(C=999, class_weight=None, dual=False, + fit_intercept=True, intercept_scaling=1, + l1_ratio=None, max_iter=100, + multi_class='warn', n_jobs=None, + penalty='l2', random_state=None, + solver='warn', tol=0.0001, verbose=0, + warm_start=False))], + transform_input=None, verbose=False)""" + + expected = expected[1:] # remove first \n + assert pipeline.__repr__() == expected + + +def test_deeply_nested(print_changed_only_false): + # Render a deeply nested estimator + rfe = RFE(RFE(RFE(RFE(RFE(RFE(RFE(LogisticRegression()))))))) + expected = """ +RFE(estimator=RFE(estimator=RFE(estimator=RFE(estimator=RFE(estimator=RFE(estimator=RFE(estimator=LogisticRegression(C=1.0, + class_weight=None, + dual=False, + fit_intercept=True, + intercept_scaling=1, + l1_ratio=None, + max_iter=100, + multi_class='warn', + n_jobs=None, + penalty='l2', + random_state=None, + solver='warn', + tol=0.0001, + verbose=0, + warm_start=False), + n_features_to_select=None, + step=1, + verbose=0), + n_features_to_select=None, + step=1, + verbose=0), + n_features_to_select=None, + step=1, verbose=0), + n_features_to_select=None, step=1, + verbose=0), + n_features_to_select=None, step=1, verbose=0), + n_features_to_select=None, step=1, verbose=0), + n_features_to_select=None, step=1, verbose=0)""" + + expected = expected[1:] # remove first \n + assert rfe.__repr__() == expected + + +@pytest.mark.parametrize( + ("print_changed_only", "expected"), + [ + (True, "RFE(estimator=RFE(...))"), + ( + False, + "RFE(estimator=RFE(...), n_features_to_select=None, step=1, verbose=0)", + ), + ], +) +def test_print_estimator_max_depth(print_changed_only, expected): + with config_context(print_changed_only=print_changed_only): + pp = _EstimatorPrettyPrinter(depth=1) + + rfe = RFE(RFE(RFE(RFE(RFE(LogisticRegression()))))) + assert pp.pformat(rfe) == expected + + +def test_gridsearch(print_changed_only_false): + # render a gridsearch + param_grid = [ + {"kernel": ["rbf"], "gamma": [1e-3, 1e-4], "C": [1, 10, 100, 1000]}, + {"kernel": ["linear"], "C": [1, 10, 100, 1000]}, + ] + gs = GridSearchCV(SVC(), param_grid, cv=5) + + expected = """ +GridSearchCV(cv=5, error_score='raise-deprecating', + estimator=SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0, + decision_function_shape='ovr', degree=3, + gamma='auto_deprecated', kernel='rbf', max_iter=-1, + probability=False, random_state=None, shrinking=True, + tol=0.001, verbose=False), + iid='warn', n_jobs=None, + param_grid=[{'C': [1, 10, 100, 1000], 'gamma': [0.001, 0.0001], + 'kernel': ['rbf']}, + {'C': [1, 10, 100, 1000], 'kernel': ['linear']}], + pre_dispatch='2*n_jobs', refit=True, return_train_score=False, + scoring=None, verbose=0)""" + + expected = expected[1:] # remove first \n + assert gs.__repr__() == expected + + +def test_gridsearch_pipeline(print_changed_only_false): + # render a pipeline inside a gridsearch + pp = _EstimatorPrettyPrinter(compact=True, indent=1, indent_at_name=True) + + pipeline = Pipeline([("reduce_dim", PCA()), ("classify", SVC())]) + N_FEATURES_OPTIONS = [2, 4, 8] + C_OPTIONS = [1, 10, 100, 1000] + param_grid = [ + { + "reduce_dim": [PCA(iterated_power=7), NMF()], + "reduce_dim__n_components": N_FEATURES_OPTIONS, + "classify__C": C_OPTIONS, + }, + { + "reduce_dim": [SelectKBest(chi2)], + "reduce_dim__k": N_FEATURES_OPTIONS, + "classify__C": C_OPTIONS, + }, + ] + gspipline = GridSearchCV(pipeline, cv=3, n_jobs=1, param_grid=param_grid) + expected = """ +GridSearchCV(cv=3, error_score='raise-deprecating', + estimator=Pipeline(memory=None, + steps=[('reduce_dim', + PCA(copy=True, iterated_power='auto', + n_components=None, + random_state=None, + svd_solver='auto', tol=0.0, + whiten=False)), + ('classify', + SVC(C=1.0, cache_size=200, + class_weight=None, coef0=0.0, + decision_function_shape='ovr', + degree=3, gamma='auto_deprecated', + kernel='rbf', max_iter=-1, + probability=False, + random_state=None, shrinking=True, + tol=0.001, verbose=False))]), + iid='warn', n_jobs=1, + param_grid=[{'classify__C': [1, 10, 100, 1000], + 'reduce_dim': [PCA(copy=True, iterated_power=7, + n_components=None, + random_state=None, + svd_solver='auto', tol=0.0, + whiten=False), + NMF(alpha=0.0, beta_loss='frobenius', + init=None, l1_ratio=0.0, + max_iter=200, n_components=None, + random_state=None, shuffle=False, + solver='cd', tol=0.0001, + verbose=0)], + 'reduce_dim__n_components': [2, 4, 8]}, + {'classify__C': [1, 10, 100, 1000], + 'reduce_dim': [SelectKBest(k=10, + score_func=)], + 'reduce_dim__k': [2, 4, 8]}], + pre_dispatch='2*n_jobs', refit=True, return_train_score=False, + scoring=None, verbose=0)""" # noqa: E501 + + expected = expected[1:] # remove first \n + repr_ = pp.pformat(gspipline) + # Remove address of '' for reproducibility + repr_ = re.sub("function chi2 at 0x.*>", "function chi2 at some_address>", repr_) + assert repr_ == expected + + +def test_n_max_elements_to_show(print_changed_only_false): + n_max_elements_to_show = 30 + pp = _EstimatorPrettyPrinter( + compact=True, + indent=1, + indent_at_name=True, + n_max_elements_to_show=n_max_elements_to_show, + ) + + # No ellipsis + vocabulary = {i: i for i in range(n_max_elements_to_show)} + vectorizer = CountVectorizer(vocabulary=vocabulary) + + expected = r""" +CountVectorizer(analyzer='word', binary=False, decode_error='strict', + dtype=, encoding='utf-8', input='content', + lowercase=True, max_df=1.0, max_features=None, min_df=1, + ngram_range=(1, 1), preprocessor=None, stop_words=None, + strip_accents=None, token_pattern='(?u)\\b\\w\\w+\\b', + tokenizer=None, + vocabulary={0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, + 8: 8, 9: 9, 10: 10, 11: 11, 12: 12, 13: 13, 14: 14, + 15: 15, 16: 16, 17: 17, 18: 18, 19: 19, 20: 20, + 21: 21, 22: 22, 23: 23, 24: 24, 25: 25, 26: 26, + 27: 27, 28: 28, 29: 29})""" + + expected = expected[1:] # remove first \n + assert pp.pformat(vectorizer) == expected + + # Now with ellipsis + vocabulary = {i: i for i in range(n_max_elements_to_show + 1)} + vectorizer = CountVectorizer(vocabulary=vocabulary) + + expected = r""" +CountVectorizer(analyzer='word', binary=False, decode_error='strict', + dtype=, encoding='utf-8', input='content', + lowercase=True, max_df=1.0, max_features=None, min_df=1, + ngram_range=(1, 1), preprocessor=None, stop_words=None, + strip_accents=None, token_pattern='(?u)\\b\\w\\w+\\b', + tokenizer=None, + vocabulary={0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, + 8: 8, 9: 9, 10: 10, 11: 11, 12: 12, 13: 13, 14: 14, + 15: 15, 16: 16, 17: 17, 18: 18, 19: 19, 20: 20, + 21: 21, 22: 22, 23: 23, 24: 24, 25: 25, 26: 26, + 27: 27, 28: 28, 29: 29, ...})""" + + expected = expected[1:] # remove first \n + assert pp.pformat(vectorizer) == expected + + # Also test with lists + param_grid = {"C": list(range(n_max_elements_to_show))} + gs = GridSearchCV(SVC(), param_grid) + expected = """ +GridSearchCV(cv='warn', error_score='raise-deprecating', + estimator=SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0, + decision_function_shape='ovr', degree=3, + gamma='auto_deprecated', kernel='rbf', max_iter=-1, + probability=False, random_state=None, shrinking=True, + tol=0.001, verbose=False), + iid='warn', n_jobs=None, + param_grid={'C': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29]}, + pre_dispatch='2*n_jobs', refit=True, return_train_score=False, + scoring=None, verbose=0)""" + + expected = expected[1:] # remove first \n + assert pp.pformat(gs) == expected + + # Now with ellipsis + param_grid = {"C": list(range(n_max_elements_to_show + 1))} + gs = GridSearchCV(SVC(), param_grid) + expected = """ +GridSearchCV(cv='warn', error_score='raise-deprecating', + estimator=SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0, + decision_function_shape='ovr', degree=3, + gamma='auto_deprecated', kernel='rbf', max_iter=-1, + probability=False, random_state=None, shrinking=True, + tol=0.001, verbose=False), + iid='warn', n_jobs=None, + param_grid={'C': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, ...]}, + pre_dispatch='2*n_jobs', refit=True, return_train_score=False, + scoring=None, verbose=0)""" + + expected = expected[1:] # remove first \n + assert pp.pformat(gs) == expected + + +def test_bruteforce_ellipsis(print_changed_only_false): + # Check that the bruteforce ellipsis (used when the number of non-blank + # characters exceeds N_CHAR_MAX) renders correctly. + + lr = LogisticRegression() + + # test when the left and right side of the ellipsis aren't on the same + # line. + expected = """ +LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True, + in... + multi_class='warn', n_jobs=None, penalty='l2', + random_state=None, solver='warn', tol=0.0001, verbose=0, + warm_start=False)""" + + expected = expected[1:] # remove first \n + assert expected == lr.__repr__(N_CHAR_MAX=150) + + # test with very small N_CHAR_MAX + # Note that N_CHAR_MAX is not strictly enforced, but it's normal: to avoid + # weird reprs we still keep the whole line of the right part (after the + # ellipsis). + expected = """ +Lo... + warm_start=False)""" + + expected = expected[1:] # remove first \n + assert expected == lr.__repr__(N_CHAR_MAX=4) + + # test with N_CHAR_MAX == number of non-blank characters: In this case we + # don't want ellipsis + full_repr = lr.__repr__(N_CHAR_MAX=float("inf")) + n_nonblank = len("".join(full_repr.split())) + assert lr.__repr__(N_CHAR_MAX=n_nonblank) == full_repr + assert "..." not in full_repr + + # test with N_CHAR_MAX == number of non-blank characters - 10: the left and + # right side of the ellispsis are on different lines. In this case we + # want to expend the whole line of the right side + expected = """ +LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True, + intercept_scaling=1, l1_ratio=None, max_i... + multi_class='warn', n_jobs=None, penalty='l2', + random_state=None, solver='warn', tol=0.0001, verbose=0, + warm_start=False)""" + expected = expected[1:] # remove first \n + assert expected == lr.__repr__(N_CHAR_MAX=n_nonblank - 10) + + # test with N_CHAR_MAX == number of non-blank characters - 10: the left and + # right side of the ellispsis are on the same line. In this case we don't + # want to expend the whole line of the right side, just add the ellispsis + # between the 2 sides. + expected = """ +LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True, + intercept_scaling=1, l1_ratio=None, max_iter..., + multi_class='warn', n_jobs=None, penalty='l2', + random_state=None, solver='warn', tol=0.0001, verbose=0, + warm_start=False)""" + expected = expected[1:] # remove first \n + assert expected == lr.__repr__(N_CHAR_MAX=n_nonblank - 4) + + # test with N_CHAR_MAX == number of non-blank characters - 2: the left and + # right side of the ellispsis are on the same line, but adding the ellipsis + # would actually make the repr longer. So we don't add the ellipsis. + expected = """ +LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True, + intercept_scaling=1, l1_ratio=None, max_iter=100, + multi_class='warn', n_jobs=None, penalty='l2', + random_state=None, solver='warn', tol=0.0001, verbose=0, + warm_start=False)""" + expected = expected[1:] # remove first \n + assert expected == lr.__repr__(N_CHAR_MAX=n_nonblank - 2) + + +def test_builtin_prettyprinter(): + # non regression test than ensures we can still use the builtin + # PrettyPrinter class for estimators (as done e.g. by joblib). + # Used to be a bug + + PrettyPrinter().pprint(LogisticRegression()) + + +def test_kwargs_in_init(): + # Make sure the changed_only=True mode is OK when an argument is passed as + # kwargs. + # Non-regression test for + # https://github.com/scikit-learn/scikit-learn/issues/17206 + + class WithKWargs(BaseEstimator): + # Estimator with a kwargs argument. These need to hack around + # set_params and get_params. Here we mimic what LightGBM does. + def __init__(self, a="willchange", b="unchanged", **kwargs): + self.a = a + self.b = b + self._other_params = {} + self.set_params(**kwargs) + + def get_params(self, deep=True): + params = super().get_params(deep=deep) + params.update(self._other_params) + return params + + def set_params(self, **params): + for key, value in params.items(): + setattr(self, key, value) + self._other_params[key] = value + return self + + est = WithKWargs(a="something", c="abcd", d=None) + + expected = "WithKWargs(a='something', c='abcd', d=None)" + assert expected == est.__repr__() + + with config_context(print_changed_only=False): + expected = "WithKWargs(a='something', b='unchanged', c='abcd', d=None)" + assert expected == est.__repr__() + + +def test_complexity_print_changed_only(): + # Make sure `__repr__` is called the same amount of times + # whether `print_changed_only` is True or False + # Non-regression test for + # https://github.com/scikit-learn/scikit-learn/issues/18490 + + class DummyEstimator(TransformerMixin, BaseEstimator): + nb_times_repr_called = 0 + + def __init__(self, estimator=None): + self.estimator = estimator + + def __repr__(self): + DummyEstimator.nb_times_repr_called += 1 + return super().__repr__() + + def transform(self, X, copy=None): # pragma: no cover + return X + + estimator = DummyEstimator( + make_pipeline(DummyEstimator(DummyEstimator()), DummyEstimator(), "passthrough") + ) + with config_context(print_changed_only=False): + repr(estimator) + nb_repr_print_changed_only_false = DummyEstimator.nb_times_repr_called + + DummyEstimator.nb_times_repr_called = 0 + with config_context(print_changed_only=True): + repr(estimator) + nb_repr_print_changed_only_true = DummyEstimator.nb_times_repr_called + + assert nb_repr_print_changed_only_false == nb_repr_print_changed_only_true diff --git a/shared/package-files/06/061232ee06f86f807af33de374eda5936133334c56c62c9a55ef1210e45700e1/margins.py b/shared/package-files/06/061232ee06f86f807af33de374eda5936133334c56c62c9a55ef1210e45700e1/margins.py new file mode 100644 index 0000000000000000000000000000000000000000..cc9dd964b4eecefd4febac3413c26ee05ce44b1f --- /dev/null +++ b/shared/package-files/06/061232ee06f86f807af33de374eda5936133334c56c62c9a55ef1210e45700e1/margins.py @@ -0,0 +1,303 @@ +""" +Margin implementations for a :class:`~prompt_toolkit.layout.containers.Window`. +""" +from __future__ import annotations + +from abc import ABCMeta, abstractmethod +from typing import TYPE_CHECKING, Callable + +from prompt_toolkit.filters import FilterOrBool, to_filter +from prompt_toolkit.formatted_text import ( + StyleAndTextTuples, + fragment_list_to_text, + to_formatted_text, +) +from prompt_toolkit.utils import get_cwidth + +from .controls import UIContent + +if TYPE_CHECKING: + from .containers import WindowRenderInfo + +__all__ = [ + "Margin", + "NumberedMargin", + "ScrollbarMargin", + "ConditionalMargin", + "PromptMargin", +] + + +class Margin(metaclass=ABCMeta): + """ + Base interface for a margin. + """ + + @abstractmethod + def get_width(self, get_ui_content: Callable[[], UIContent]) -> int: + """ + Return the width that this margin is going to consume. + + :param get_ui_content: Callable that asks the user control to create + a :class:`.UIContent` instance. This can be used for instance to + obtain the number of lines. + """ + return 0 + + @abstractmethod + def create_margin( + self, window_render_info: WindowRenderInfo, width: int, height: int + ) -> StyleAndTextTuples: + """ + Creates a margin. + This should return a list of (style_str, text) tuples. + + :param window_render_info: + :class:`~prompt_toolkit.layout.containers.WindowRenderInfo` + instance, generated after rendering and copying the visible part of + the :class:`~prompt_toolkit.layout.controls.UIControl` into the + :class:`~prompt_toolkit.layout.containers.Window`. + :param width: The width that's available for this margin. (As reported + by :meth:`.get_width`.) + :param height: The height that's available for this margin. (The height + of the :class:`~prompt_toolkit.layout.containers.Window`.) + """ + return [] + + +class NumberedMargin(Margin): + """ + Margin that displays the line numbers. + + :param relative: Number relative to the cursor position. Similar to the Vi + 'relativenumber' option. + :param display_tildes: Display tildes after the end of the document, just + like Vi does. + """ + + def __init__( + self, relative: FilterOrBool = False, display_tildes: FilterOrBool = False + ) -> None: + self.relative = to_filter(relative) + self.display_tildes = to_filter(display_tildes) + + def get_width(self, get_ui_content: Callable[[], UIContent]) -> int: + line_count = get_ui_content().line_count + return max(3, len("%s" % line_count) + 1) + + def create_margin( + self, window_render_info: WindowRenderInfo, width: int, height: int + ) -> StyleAndTextTuples: + relative = self.relative() + + style = "class:line-number" + style_current = "class:line-number.current" + + # Get current line number. + current_lineno = window_render_info.ui_content.cursor_position.y + + # Construct margin. + result: StyleAndTextTuples = [] + last_lineno = None + + for y, lineno in enumerate(window_render_info.displayed_lines): + # Only display line number if this line is not a continuation of the previous line. + if lineno != last_lineno: + if lineno is None: + pass + elif lineno == current_lineno: + # Current line. + if relative: + # Left align current number in relative mode. + result.append((style_current, "%i" % (lineno + 1))) + else: + result.append( + (style_current, ("%i " % (lineno + 1)).rjust(width)) + ) + else: + # Other lines. + if relative: + lineno = abs(lineno - current_lineno) - 1 + + result.append((style, ("%i " % (lineno + 1)).rjust(width))) + + last_lineno = lineno + result.append(("", "\n")) + + # Fill with tildes. + if self.display_tildes(): + while y < window_render_info.window_height: + result.append(("class:tilde", "~\n")) + y += 1 + + return result + + +class ConditionalMargin(Margin): + """ + Wrapper around other :class:`.Margin` classes to show/hide them. + """ + + def __init__(self, margin: Margin, filter: FilterOrBool) -> None: + self.margin = margin + self.filter = to_filter(filter) + + def get_width(self, get_ui_content: Callable[[], UIContent]) -> int: + if self.filter(): + return self.margin.get_width(get_ui_content) + else: + return 0 + + def create_margin( + self, window_render_info: WindowRenderInfo, width: int, height: int + ) -> StyleAndTextTuples: + if width and self.filter(): + return self.margin.create_margin(window_render_info, width, height) + else: + return [] + + +class ScrollbarMargin(Margin): + """ + Margin displaying a scrollbar. + + :param display_arrows: Display scroll up/down arrows. + """ + + def __init__( + self, + display_arrows: FilterOrBool = False, + up_arrow_symbol: str = "^", + down_arrow_symbol: str = "v", + ) -> None: + self.display_arrows = to_filter(display_arrows) + self.up_arrow_symbol = up_arrow_symbol + self.down_arrow_symbol = down_arrow_symbol + + def get_width(self, get_ui_content: Callable[[], UIContent]) -> int: + return 1 + + def create_margin( + self, window_render_info: WindowRenderInfo, width: int, height: int + ) -> StyleAndTextTuples: + content_height = window_render_info.content_height + window_height = window_render_info.window_height + display_arrows = self.display_arrows() + + if display_arrows: + window_height -= 2 + + try: + fraction_visible = len(window_render_info.displayed_lines) / float( + content_height + ) + fraction_above = window_render_info.vertical_scroll / float(content_height) + + scrollbar_height = int( + min(window_height, max(1, window_height * fraction_visible)) + ) + scrollbar_top = int(window_height * fraction_above) + except ZeroDivisionError: + return [] + else: + + def is_scroll_button(row: int) -> bool: + "True if we should display a button on this row." + return scrollbar_top <= row <= scrollbar_top + scrollbar_height + + # Up arrow. + result: StyleAndTextTuples = [] + if display_arrows: + result.extend( + [ + ("class:scrollbar.arrow", self.up_arrow_symbol), + ("class:scrollbar", "\n"), + ] + ) + + # Scrollbar body. + scrollbar_background = "class:scrollbar.background" + scrollbar_background_start = "class:scrollbar.background,scrollbar.start" + scrollbar_button = "class:scrollbar.button" + scrollbar_button_end = "class:scrollbar.button,scrollbar.end" + + for i in range(window_height): + if is_scroll_button(i): + if not is_scroll_button(i + 1): + # Give the last cell a different style, because we + # want to underline this. + result.append((scrollbar_button_end, " ")) + else: + result.append((scrollbar_button, " ")) + else: + if is_scroll_button(i + 1): + result.append((scrollbar_background_start, " ")) + else: + result.append((scrollbar_background, " ")) + result.append(("", "\n")) + + # Down arrow + if display_arrows: + result.append(("class:scrollbar.arrow", self.down_arrow_symbol)) + + return result + + +class PromptMargin(Margin): + """ + [Deprecated] + + Create margin that displays a prompt. + This can display one prompt at the first line, and a continuation prompt + (e.g, just dots) on all the following lines. + + This `PromptMargin` implementation has been largely superseded in favor of + the `get_line_prefix` attribute of `Window`. The reason is that a margin is + always a fixed width, while `get_line_prefix` can return a variable width + prefix in front of every line, making it more powerful, especially for line + continuations. + + :param get_prompt: Callable returns formatted text or a list of + `(style_str, type)` tuples to be shown as the prompt at the first line. + :param get_continuation: Callable that takes three inputs. The width (int), + line_number (int), and is_soft_wrap (bool). It should return formatted + text or a list of `(style_str, type)` tuples for the next lines of the + input. + """ + + def __init__( + self, + get_prompt: Callable[[], StyleAndTextTuples], + get_continuation: None + | (Callable[[int, int, bool], StyleAndTextTuples]) = None, + ) -> None: + self.get_prompt = get_prompt + self.get_continuation = get_continuation + + def get_width(self, get_ui_content: Callable[[], UIContent]) -> int: + "Width to report to the `Window`." + # Take the width from the first line. + text = fragment_list_to_text(self.get_prompt()) + return get_cwidth(text) + + def create_margin( + self, window_render_info: WindowRenderInfo, width: int, height: int + ) -> StyleAndTextTuples: + get_continuation = self.get_continuation + result: StyleAndTextTuples = [] + + # First line. + result.extend(to_formatted_text(self.get_prompt())) + + # Next lines. + if get_continuation: + last_y = None + + for y in window_render_info.displayed_lines[1:]: + result.append(("", "\n")) + result.extend( + to_formatted_text(get_continuation(width, y, y == last_y)) + ) + last_y = y + + return result diff --git a/shared/package-files/06/062d1e165712e78effcbd8e10b8a59ae62e450a7c87083589230eaeef659dab4/qnxw b/shared/package-files/06/062d1e165712e78effcbd8e10b8a59ae62e450a7c87083589230eaeef659dab4/qnxw new file mode 100644 index 0000000000000000000000000000000000000000..8c9498a7972f516e0e2f13c80697ba4d161ff547 Binary files /dev/null and b/shared/package-files/06/062d1e165712e78effcbd8e10b8a59ae62e450a7c87083589230eaeef659dab4/qnxw differ diff --git a/shared/package-files/06/069ed4c1f7c830eee873c527155d75c9819c5d48d26b4361b2e3a041a35132df/test_rv.py b/shared/package-files/06/069ed4c1f7c830eee873c527155d75c9819c5d48d26b4361b2e3a041a35132df/test_rv.py new file mode 100644 index 0000000000000000000000000000000000000000..185756300556f2fe70b76c402113ec2bb2501ef4 --- /dev/null +++ b/shared/package-files/06/069ed4c1f7c830eee873c527155d75c9819c5d48d26b4361b2e3a041a35132df/test_rv.py @@ -0,0 +1,441 @@ +from sympy.concrete.summations import Sum +from sympy.core.basic import Basic +from sympy.core.containers import Tuple +from sympy.core.function import Lambda +from sympy.core.numbers import (Rational, nan, oo, pi) +from sympy.core.relational import Eq +from sympy.core.singleton import S +from sympy.core.symbol import (Symbol, symbols) +from sympy.functions.combinatorial.factorials import (FallingFactorial, binomial) +from sympy.functions.elementary.exponential import (exp, log) +from sympy.functions.elementary.trigonometric import (cos, sin) +from sympy.functions.special.delta_functions import DiracDelta +from sympy.integrals.integrals import integrate +from sympy.logic.boolalg import (And, Or) +from sympy.matrices.dense import Matrix +from sympy.sets.sets import Interval +from sympy.tensor.indexed import Indexed +from sympy.stats import (Die, Normal, Exponential, FiniteRV, P, E, H, variance, + density, given, independent, dependent, where, pspace, GaussianUnitaryEnsemble, + random_symbols, sample, Geometric, factorial_moment, Binomial, Hypergeometric, + DiscreteUniform, Poisson, characteristic_function, moment_generating_function, + BernoulliProcess, Variance, Expectation, Probability, Covariance, covariance, cmoment, + moment, median) +from sympy.stats.rv import (IndependentProductPSpace, rs_swap, Density, NamedArgsMixin, + RandomSymbol, sample_iter, PSpace, is_random, RandomIndexedSymbol, RandomMatrixSymbol) +from sympy.testing.pytest import raises, skip, XFAIL, warns_deprecated_sympy +from sympy.external import import_module +from sympy.core.numbers import comp +from sympy.stats.frv_types import BernoulliDistribution +from sympy.core.symbol import Dummy +from sympy.functions.elementary.piecewise import Piecewise + +def test_where(): + X, Y = Die('X'), Die('Y') + Z = Normal('Z', 0, 1) + + assert where(Z**2 <= 1).set == Interval(-1, 1) + assert where(Z**2 <= 1).as_boolean() == Interval(-1, 1).as_relational(Z.symbol) + assert where(And(X > Y, Y > 4)).as_boolean() == And( + Eq(X.symbol, 6), Eq(Y.symbol, 5)) + + assert len(where(X < 3).set) == 2 + assert 1 in where(X < 3).set + + X, Y = Normal('X', 0, 1), Normal('Y', 0, 1) + assert where(And(X**2 <= 1, X >= 0)).set == Interval(0, 1) + XX = given(X, And(X**2 <= 1, X >= 0)) + assert XX.pspace.domain.set == Interval(0, 1) + assert XX.pspace.domain.as_boolean() == \ + And(0 <= X.symbol, X.symbol**2 <= 1, -oo < X.symbol, X.symbol < oo) + + with raises(TypeError): + XX = given(X, X + 3) + + +def test_random_symbols(): + X, Y = Normal('X', 0, 1), Normal('Y', 0, 1) + + assert set(random_symbols(2*X + 1)) == {X} + assert set(random_symbols(2*X + Y)) == {X, Y} + assert set(random_symbols(2*X + Y.symbol)) == {X} + assert set(random_symbols(2)) == set() + + +def test_characteristic_function(): + # Imports I from sympy + from sympy.core.numbers import I + X = Normal('X',0,1) + Y = DiscreteUniform('Y', [1,2,7]) + Z = Poisson('Z', 2) + t = symbols('_t') + P = Lambda(t, exp(-t**2/2)) + Q = Lambda(t, exp(7*t*I)/3 + exp(2*t*I)/3 + exp(t*I)/3) + R = Lambda(t, exp(2 * exp(t*I) - 2)) + + + assert characteristic_function(X).dummy_eq(P) + assert characteristic_function(Y).dummy_eq(Q) + assert characteristic_function(Z).dummy_eq(R) + + +def test_moment_generating_function(): + + X = Normal('X',0,1) + Y = DiscreteUniform('Y', [1,2,7]) + Z = Poisson('Z', 2) + t = symbols('_t') + P = Lambda(t, exp(t**2/2)) + Q = Lambda(t, (exp(7*t)/3 + exp(2*t)/3 + exp(t)/3)) + R = Lambda(t, exp(2 * exp(t) - 2)) + + + assert moment_generating_function(X).dummy_eq(P) + assert moment_generating_function(Y).dummy_eq(Q) + assert moment_generating_function(Z).dummy_eq(R) + +def test_sample_iter(): + + X = Normal('X',0,1) + Y = DiscreteUniform('Y', [1, 2, 7]) + Z = Poisson('Z', 2) + + scipy = import_module('scipy') + if not scipy: + skip('Scipy is not installed. Abort tests') + expr = X**2 + 3 + iterator = sample_iter(expr) + + expr2 = Y**2 + 5*Y + 4 + iterator2 = sample_iter(expr2) + + expr3 = Z**3 + 4 + iterator3 = sample_iter(expr3) + + def is_iterator(obj): + if ( + hasattr(obj, '__iter__') and + (hasattr(obj, 'next') or + hasattr(obj, '__next__')) and + callable(obj.__iter__) and + obj.__iter__() is obj + ): + return True + else: + return False + assert is_iterator(iterator) + assert is_iterator(iterator2) + assert is_iterator(iterator3) + +def test_pspace(): + X, Y = Normal('X', 0, 1), Normal('Y', 0, 1) + x = Symbol('x') + + raises(ValueError, lambda: pspace(5 + 3)) + raises(ValueError, lambda: pspace(x < 1)) + assert pspace(X) == X.pspace + assert pspace(2*X + 1) == X.pspace + assert pspace(2*X + Y) == IndependentProductPSpace(Y.pspace, X.pspace) + +def test_rs_swap(): + X = Normal('x', 0, 1) + Y = Exponential('y', 1) + + XX = Normal('x', 0, 2) + YY = Normal('y', 0, 3) + + expr = 2*X + Y + assert expr.subs(rs_swap((X, Y), (YY, XX))) == 2*XX + YY + + +def test_RandomSymbol(): + + X = Normal('x', 0, 1) + Y = Normal('x', 0, 2) + assert X.symbol == Y.symbol + assert X != Y + + assert X.name == X.symbol.name + + X = Normal('lambda', 0, 1) # make sure we can use protected terms + X = Normal('Lambda', 0, 1) # make sure we can use SymPy terms + + +def test_RandomSymbol_diff(): + X = Normal('x', 0, 1) + assert (2*X).diff(X) + + +def test_random_symbol_no_pspace(): + x = RandomSymbol(Symbol('x')) + assert x.pspace == PSpace() + +def test_overlap(): + X = Normal('x', 0, 1) + Y = Normal('x', 0, 2) + + raises(ValueError, lambda: P(X > Y)) + + +def test_IndependentProductPSpace(): + X = Normal('X', 0, 1) + Y = Normal('Y', 0, 1) + px = X.pspace + py = Y.pspace + assert pspace(X + Y) == IndependentProductPSpace(px, py) + assert pspace(X + Y) == IndependentProductPSpace(py, px) + + +def test_E(): + assert E(5) == 5 + + +def test_H(): + X = Normal('X', 0, 1) + D = Die('D', sides = 4) + G = Geometric('G', 0.5) + assert H(X, X > 0) == -log(2)/2 + S.Half + log(pi)/2 + assert H(D, D > 2) == log(2) + assert comp(H(G).evalf().round(2), 1.39) + + +def test_Sample(): + X = Die('X', 6) + Y = Normal('Y', 0, 1) + z = Symbol('z', integer=True) + + scipy = import_module('scipy') + if not scipy: + skip('Scipy is not installed. Abort tests') + assert sample(X) in [1, 2, 3, 4, 5, 6] + assert isinstance(sample(X + Y), float) + + assert P(X + Y > 0, Y < 0, numsamples=10).is_number + assert E(X + Y, numsamples=10).is_number + assert E(X**2 + Y, numsamples=10).is_number + assert E((X + Y)**2, numsamples=10).is_number + assert variance(X + Y, numsamples=10).is_number + + raises(TypeError, lambda: P(Y > z, numsamples=5)) + + assert P(sin(Y) <= 1, numsamples=10) == 1.0 + assert P(sin(Y) <= 1, cos(Y) < 1, numsamples=10) == 1.0 + + assert all(i in range(1, 7) for i in density(X, numsamples=10)) + assert all(i in range(4, 7) for i in density(X, X>3, numsamples=10)) + + numpy = import_module('numpy') + if not numpy: + skip('Numpy is not installed. Abort tests') + #Test Issue #21563: Output of sample must be a float or array + assert isinstance(sample(X), (numpy.int32, numpy.int64)) + assert isinstance(sample(Y), numpy.float64) + assert isinstance(sample(X, size=2), numpy.ndarray) + + with warns_deprecated_sympy(): + sample(X, numsamples=2) + +@XFAIL +def test_samplingE(): + scipy = import_module('scipy') + if not scipy: + skip('Scipy is not installed. Abort tests') + Y = Normal('Y', 0, 1) + z = Symbol('z', integer=True) + assert E(Sum(1/z**Y, (z, 1, oo)), Y > 2, numsamples=3).is_number + + +def test_given(): + X = Normal('X', 0, 1) + Y = Normal('Y', 0, 1) + A = given(X, True) + B = given(X, Y > 2) + + assert X == A == B + + +def test_factorial_moment(): + X = Poisson('X', 2) + Y = Binomial('Y', 2, S.Half) + Z = Hypergeometric('Z', 4, 2, 2) + assert factorial_moment(X, 2) == 4 + assert factorial_moment(Y, 2) == S.Half + assert factorial_moment(Z, 2) == Rational(1, 3) + + x, y, z, l = symbols('x y z l') + Y = Binomial('Y', 2, y) + Z = Hypergeometric('Z', 10, 2, 3) + assert factorial_moment(Y, l) == y**2*FallingFactorial( + 2, l) + 2*y*(1 - y)*FallingFactorial(1, l) + (1 - y)**2*\ + FallingFactorial(0, l) + assert factorial_moment(Z, l) == 7*FallingFactorial(0, l)/\ + 15 + 7*FallingFactorial(1, l)/15 + FallingFactorial(2, l)/15 + + +def test_dependence(): + X, Y = Die('X'), Die('Y') + assert independent(X, 2*Y) + assert not dependent(X, 2*Y) + + X, Y = Normal('X', 0, 1), Normal('Y', 0, 1) + assert independent(X, Y) + assert dependent(X, 2*X) + + # Create a dependency + XX, YY = given(Tuple(X, Y), Eq(X + Y, 3)) + assert dependent(XX, YY) + +def test_dependent_finite(): + X, Y = Die('X'), Die('Y') + # Dependence testing requires symbolic conditions which currently break + # finite random variables + assert dependent(X, Y + X) + + XX, YY = given(Tuple(X, Y), X + Y > 5) # Create a dependency + assert dependent(XX, YY) + + +def test_normality(): + X, Y = Normal('X', 0, 1), Normal('Y', 0, 1) + x = Symbol('x', real=True) + z = Symbol('z', real=True) + dens = density(X - Y, Eq(X + Y, z)) + + assert integrate(dens(x), (x, -oo, oo)) == 1 + + +def test_Density(): + X = Die('X', 6) + d = Density(X) + assert d.doit() == density(X) + +def test_NamedArgsMixin(): + class Foo(Basic, NamedArgsMixin): + _argnames = 'foo', 'bar' + + a = Foo(S(1), S(2)) + + assert a.foo == 1 + assert a.bar == 2 + + raises(AttributeError, lambda: a.baz) + + class Bar(Basic, NamedArgsMixin): + pass + + raises(AttributeError, lambda: Bar(S(1), S(2)).foo) + +def test_density_constant(): + assert density(3)(2) == 0 + assert density(3)(3) == DiracDelta(0) + +def test_cmoment_constant(): + assert variance(3) == 0 + assert cmoment(3, 3) == 0 + assert cmoment(3, 4) == 0 + x = Symbol('x') + assert variance(x) == 0 + assert cmoment(x, 15) == 0 + assert cmoment(x, 0) == 1 + +def test_moment_constant(): + assert moment(3, 0) == 1 + assert moment(3, 1) == 3 + assert moment(3, 2) == 9 + x = Symbol('x') + assert moment(x, 2) == x**2 + +def test_median_constant(): + assert median(3) == 3 + x = Symbol('x') + assert median(x) == x + +def test_real(): + x = Normal('x', 0, 1) + assert x.is_real + + +def test_issue_10052(): + X = Exponential('X', 3) + assert P(X < oo) == 1 + assert P(X > oo) == 0 + assert P(X < 2, X > oo) == 0 + assert P(X < oo, X > oo) == 0 + assert P(X < oo, X > 2) == 1 + assert P(X < 3, X == 2) == 0 + raises(ValueError, lambda: P(1)) + raises(ValueError, lambda: P(X < 1, 2)) + +def test_issue_11934(): + density = {0: .5, 1: .5} + X = FiniteRV('X', density) + assert E(X) == 0.5 + assert P( X>= 2) == 0 + +def test_issue_8129(): + X = Exponential('X', 4) + assert P(X >= X) == 1 + assert P(X > X) == 0 + assert P(X > X+1) == 0 + +def test_issue_12237(): + X = Normal('X', 0, 1) + Y = Normal('Y', 0, 1) + U = P(X > 0, X) + V = P(Y < 0, X) + W = P(X + Y > 0, X) + assert W == P(X + Y > 0, X) + assert U == BernoulliDistribution(S.Half, S.Zero, S.One) + assert V == S.Half + +def test_is_random(): + X = Normal('X', 0, 1) + Y = Normal('Y', 0, 1) + a, b = symbols('a, b') + G = GaussianUnitaryEnsemble('U', 2) + B = BernoulliProcess('B', 0.9) + assert not is_random(a) + assert not is_random(a + b) + assert not is_random(a * b) + assert not is_random(Matrix([a**2, b**2])) + assert is_random(X) + assert is_random(X**2 + Y) + assert is_random(Y + b**2) + assert is_random(Y > 5) + assert is_random(B[3] < 1) + assert is_random(G) + assert is_random(X * Y * B[1]) + assert is_random(Matrix([[X, B[2]], [G, Y]])) + assert is_random(Eq(X, 4)) + +def test_issue_12283(): + x = symbols('x') + X = RandomSymbol(x) + Y = RandomSymbol('Y') + Z = RandomMatrixSymbol('Z', 2, 1) + W = RandomMatrixSymbol('W', 2, 1) + RI = RandomIndexedSymbol(Indexed('RI', 3)) + assert pspace(Z) == PSpace() + assert pspace(RI) == PSpace() + assert pspace(X) == PSpace() + assert E(X) == Expectation(X) + assert P(Y > 3) == Probability(Y > 3) + assert variance(X) == Variance(X) + assert variance(RI) == Variance(RI) + assert covariance(X, Y) == Covariance(X, Y) + assert covariance(W, Z) == Covariance(W, Z) + +def test_issue_6810(): + X = Die('X', 6) + Y = Normal('Y', 0, 1) + assert P(Eq(X, 2)) == S(1)/6 + assert P(Eq(Y, 0)) == 0 + assert P(Or(X > 2, X < 3)) == 1 + assert P(And(X > 3, X > 2)) == S(1)/2 + +def test_issue_20286(): + n, p = symbols('n p') + B = Binomial('B', n, p) + k = Dummy('k', integer = True) + eq = Sum(Piecewise((-p**k*(1 - p)**(-k + n)*log(p**k*(1 - p)**(-k + n)*binomial(n, k))*binomial(n, k), (k >= 0) & (k <= n)), (nan, True)), (k, 0, n)) + assert eq.dummy_eq(H(B)) diff --git a/shared/package-files/06/069f0d6d4cdf0f03e40bf33b01cac2fc3413cce89a528caef3f9c75f4a22ea76/python_ivalue.h b/shared/package-files/06/069f0d6d4cdf0f03e40bf33b01cac2fc3413cce89a528caef3f9c75f4a22ea76/python_ivalue.h new file mode 100644 index 0000000000000000000000000000000000000000..f33ceca30f2d00a32c290eb03727502bfb4b77dd --- /dev/null +++ b/shared/package-files/06/069f0d6d4cdf0f03e40bf33b01cac2fc3413cce89a528caef3f9c75f4a22ea76/python_ivalue.h @@ -0,0 +1,97 @@ +#pragma once +#include +#include +#include +#include +#include + +namespace py = pybind11; + +namespace c10::ivalue { + +// concrete ivalue Holder that hold a py::object +struct C10_EXPORT ConcretePyObjectHolder final : PyObjectHolder { + public: + static c10::intrusive_ptr create(py::object py_obj) { + return c10::make_intrusive(std::move(py_obj)); + } + + static c10::intrusive_ptr create(const py::handle& handle) { + py::gil_scoped_acquire ag; + return c10::make_intrusive( + handle.cast()); + } + + PyObject* getPyObject() override { + return py_obj_.ptr(); + } + + InferredType tryToInferType() override { + pybind11::gil_scoped_acquire ag; + return torch::jit::tryToInferType(py_obj_); + } + + IValue toIValue(const TypePtr& type, c10::optional N = c10::nullopt) + override { + pybind11::gil_scoped_acquire ag; + return torch::jit::toIValue(py_obj_, type, N); + } + + std::string toStr() override { + pybind11::gil_scoped_acquire ag; + return py::str(py_obj_); + } + + std::vector extractTensors() override { + // We could implement this entirely in C++ via pybind11 but it turns out to + // be substantially slower. Namely, the total time taken by markCompleted on + // a CUDAFuture is 21.5us with this implementation, but goes up to 58.7us + // when using C++. The reason is unclear. + try { + pybind11::gil_scoped_acquire ag; + static py::object& extractorFn = *new py::object( + py::module::import("torch._jit_internal").attr("_extract_tensors")); + return extractorFn(py_obj_).cast>(); + } catch (py::error_already_set& e) { + auto err = std::runtime_error( + c10::str("Cannot extract tensors from value: ", e.what())); + { + pybind11::gil_scoped_acquire ag; + e.restore(); + PyErr_Clear(); + } + throw err; + } + } + + // Note [Destructing py::object] + // ~~~~~~~~~~~~~~~~~~~~~~~~~~ + // + // (1) Why py_obj_ = py::none(); does not work. Because we also need to + // acquire GIL when destructing py::object of None that de-references None. + // https://docs.python.org/3/c-api/none.html#c.Py_RETURN_NONE + // + // https://stackoverflow.com/questions/15287590/why-should-py-increfpy-none-be-required-before-returning-py-none-in-c + // + // (2) Why we need to call dec_ref() explicitly. Because py::object of + // nullptr, on destruction, effectively does nothing because of it calls + // Py_XDECREF(NULL) underlying. + // https://docs.python.org/3/c-api/refcounting.html#c.Py_XDECREF + ~ConcretePyObjectHolder() override { + pybind11::gil_scoped_acquire ag; + py_obj_.dec_ref(); + // explicitly setting PyObject* to nullptr to prevent py::object's dtor to + // decref on the PyObject again. + py_obj_.ptr() = nullptr; + } + + // explicit construction to avoid errornous implicit conversion and + // copy-initialization + explicit ConcretePyObjectHolder(py::object py_obj) + : py_obj_(std::move(py_obj)) {} + + private: + py::object py_obj_; +}; + +} // namespace c10::ivalue diff --git a/shared/package-files/06/06a0d61aa47624e544ab2f31ae6c858f4ef591cf8fba38a5695276edb13d3ecb/data_missing.dta b/shared/package-files/06/06a0d61aa47624e544ab2f31ae6c858f4ef591cf8fba38a5695276edb13d3ecb/data_missing.dta new file mode 100644 index 0000000000000000000000000000000000000000..7df75d0d0cdede36e72cdb3145fa7e9322b5cc27 Binary files /dev/null and b/shared/package-files/06/06a0d61aa47624e544ab2f31ae6c858f4ef591cf8fba38a5695276edb13d3ecb/data_missing.dta differ diff --git a/shared/package-files/06/06bd03cb0ab219a5701da59b81b21664b9d0610ed2a5ad38678794f13ac7cfef/__init__.pyi b/shared/package-files/06/06bd03cb0ab219a5701da59b81b21664b9d0610ed2a5ad38678794f13ac7cfef/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..f06fa7396edfdc3f08801d7ba63264ca0286c3fb --- /dev/null +++ b/shared/package-files/06/06bd03cb0ab219a5701da59b81b21664b9d0610ed2a5ad38678794f13ac7cfef/__init__.pyi @@ -0,0 +1,309 @@ +import sys +from array import array +from typing import ( + Any, + Callable, + ClassVar, + Generic, + Iterable, + Iterator, + List, + Mapping, + Optional, + Sequence, + Text, + Tuple, + Type, + TypeVar, + Union as _UnionT, + overload, +) + +if sys.version_info >= (3, 9): + from types import GenericAlias + +_T = TypeVar("_T") +_DLLT = TypeVar("_DLLT", bound=CDLL) +_CT = TypeVar("_CT", bound=_CData) + +RTLD_GLOBAL: int = ... +RTLD_LOCAL: int = ... +DEFAULT_MODE: int = ... + +class CDLL(object): + _func_flags_: ClassVar[int] = ... + _func_restype_: ClassVar[_CData] = ... + _name: str = ... + _handle: int = ... + _FuncPtr: Type[_FuncPointer] = ... + def __init__( + self, + name: Optional[str], + mode: int = ..., + handle: Optional[int] = ..., + use_errno: bool = ..., + use_last_error: bool = ..., + winmode: Optional[int] = ..., + ) -> None: ... + def __getattr__(self, name: str) -> _NamedFuncPointer: ... + def __getitem__(self, name: str) -> _NamedFuncPointer: ... + +if sys.platform == "win32": + class OleDLL(CDLL): ... + class WinDLL(CDLL): ... + +class PyDLL(CDLL): ... + +class LibraryLoader(Generic[_DLLT]): + def __init__(self, dlltype: Type[_DLLT]) -> None: ... + def __getattr__(self, name: str) -> _DLLT: ... + def __getitem__(self, name: str) -> _DLLT: ... + def LoadLibrary(self, name: str) -> _DLLT: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... + +cdll: LibraryLoader[CDLL] = ... +if sys.platform == "win32": + windll: LibraryLoader[WinDLL] = ... + oledll: LibraryLoader[OleDLL] = ... +pydll: LibraryLoader[PyDLL] = ... +pythonapi: PyDLL = ... + +# Anything that implements the read-write buffer interface. +# The buffer interface is defined purely on the C level, so we cannot define a normal Protocol +# for it. Instead we have to list the most common stdlib buffer classes in a Union. +_WritableBuffer = _UnionT[bytearray, memoryview, array, _CData] +# Same as _WritableBuffer, but also includes read-only buffer types (like bytes). +_ReadOnlyBuffer = _UnionT[_WritableBuffer, bytes] + +class _CDataMeta(type): + # By default mypy complains about the following two methods, because strictly speaking cls + # might not be a Type[_CT]. However this can never actually happen, because the only class that + # uses _CDataMeta as its metaclass is _CData. So it's safe to ignore the errors here. + def __mul__(cls: Type[_CT], other: int) -> Type[Array[_CT]]: ... # type: ignore + def __rmul__(cls: Type[_CT], other: int) -> Type[Array[_CT]]: ... # type: ignore + +class _CData(metaclass=_CDataMeta): + _b_base: int = ... + _b_needsfree_: bool = ... + _objects: Optional[Mapping[Any, int]] = ... + @classmethod + def from_buffer(cls: Type[_CT], source: _WritableBuffer, offset: int = ...) -> _CT: ... + @classmethod + def from_buffer_copy(cls: Type[_CT], source: _ReadOnlyBuffer, offset: int = ...) -> _CT: ... + @classmethod + def from_address(cls: Type[_CT], address: int) -> _CT: ... + @classmethod + def from_param(cls: Type[_CT], obj: Any) -> _UnionT[_CT, _CArgObject]: ... + @classmethod + def in_dll(cls: Type[_CT], library: CDLL, name: str) -> _CT: ... + +class _CanCastTo(_CData): ... +class _PointerLike(_CanCastTo): ... + +_ECT = Callable[[Optional[Type[_CData]], _FuncPointer, Tuple[_CData, ...]], _CData] +_PF = _UnionT[Tuple[int], Tuple[int, str], Tuple[int, str, Any]] + +class _FuncPointer(_PointerLike, _CData): + restype: _UnionT[Type[_CData], Callable[[int], None], None] = ... + argtypes: Sequence[Type[_CData]] = ... + errcheck: _ECT = ... + @overload + def __init__(self, address: int) -> None: ... + @overload + def __init__(self, callable: Callable[..., Any]) -> None: ... + @overload + def __init__(self, func_spec: Tuple[_UnionT[str, int], CDLL], paramflags: Tuple[_PF, ...] = ...) -> None: ... + @overload + def __init__(self, vtlb_index: int, name: str, paramflags: Tuple[_PF, ...] = ..., iid: pointer[c_int] = ...) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + +class _NamedFuncPointer(_FuncPointer): + __name__: str + +class ArgumentError(Exception): ... + +def CFUNCTYPE( + restype: Optional[Type[_CData]], *argtypes: Type[_CData], use_errno: bool = ..., use_last_error: bool = ... +) -> Type[_FuncPointer]: ... + +if sys.platform == "win32": + def WINFUNCTYPE( + restype: Optional[Type[_CData]], *argtypes: Type[_CData], use_errno: bool = ..., use_last_error: bool = ... + ) -> Type[_FuncPointer]: ... + +def PYFUNCTYPE(restype: Optional[Type[_CData]], *argtypes: Type[_CData]) -> Type[_FuncPointer]: ... + +class _CArgObject: ... + +# Any type that can be implicitly converted to c_void_p when passed as a C function argument. +# (bytes is not included here, see below.) +_CVoidPLike = _UnionT[_PointerLike, Array[Any], _CArgObject, int] +# Same as above, but including types known to be read-only (i. e. bytes). +# This distinction is not strictly necessary (ctypes doesn't differentiate between const +# and non-const pointers), but it catches errors like memmove(b'foo', buf, 4) +# when memmove(buf, b'foo', 4) was intended. +_CVoidConstPLike = _UnionT[_CVoidPLike, bytes] + +def addressof(obj: _CData) -> int: ... +def alignment(obj_or_type: _UnionT[_CData, Type[_CData]]) -> int: ... +def byref(obj: _CData, offset: int = ...) -> _CArgObject: ... + +_CastT = TypeVar("_CastT", bound=_CanCastTo) + +def cast(obj: _UnionT[_CData, _CArgObject, int], type: Type[_CastT]) -> _CastT: ... +def create_string_buffer(init: _UnionT[int, bytes], size: Optional[int] = ...) -> Array[c_char]: ... + +c_buffer = create_string_buffer + +def create_unicode_buffer(init: _UnionT[int, Text], size: Optional[int] = ...) -> Array[c_wchar]: ... + +if sys.platform == "win32": + def DllCanUnloadNow() -> int: ... + def DllGetClassObject(rclsid: Any, riid: Any, ppv: Any) -> int: ... # TODO not documented + def FormatError(code: int) -> str: ... + def GetLastError() -> int: ... + +def get_errno() -> int: ... + +if sys.platform == "win32": + def get_last_error() -> int: ... + +def memmove(dst: _CVoidPLike, src: _CVoidConstPLike, count: int) -> None: ... +def memset(dst: _CVoidPLike, c: int, count: int) -> None: ... +def POINTER(type: Type[_CT]) -> Type[pointer[_CT]]: ... + +# The real ctypes.pointer is a function, not a class. The stub version of pointer behaves like +# ctypes._Pointer in that it is the base class for all pointer types. Unlike the real _Pointer, +# it can be instantiated directly (to mimic the behavior of the real pointer function). +class pointer(Generic[_CT], _PointerLike, _CData): + _type_: ClassVar[Type[_CT]] = ... + contents: _CT = ... + def __init__(self, arg: _CT = ...) -> None: ... + @overload + def __getitem__(self, i: int) -> _CT: ... + @overload + def __getitem__(self, s: slice) -> List[_CT]: ... + @overload + def __setitem__(self, i: int, o: _CT) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[_CT]) -> None: ... + +def resize(obj: _CData, size: int) -> None: ... + +if sys.version_info < (3,): + def set_conversion_mode(encoding: str, errors: str) -> Tuple[str, str]: ... + +def set_errno(value: int) -> int: ... + +if sys.platform == "win32": + def set_last_error(value: int) -> int: ... + +def sizeof(obj_or_type: _UnionT[_CData, Type[_CData]]) -> int: ... +def string_at(address: _CVoidConstPLike, size: int = ...) -> bytes: ... + +if sys.platform == "win32": + def WinError(code: Optional[int] = ..., descr: Optional[str] = ...) -> OSError: ... + +def wstring_at(address: _CVoidConstPLike, size: int = ...) -> str: ... + +class _SimpleCData(Generic[_T], _CData): + value: _T = ... + def __init__(self, value: _T = ...) -> None: ... + +class c_byte(_SimpleCData[int]): ... + +class c_char(_SimpleCData[bytes]): + def __init__(self, value: _UnionT[int, bytes] = ...) -> None: ... + +class c_char_p(_PointerLike, _SimpleCData[Optional[bytes]]): + def __init__(self, value: Optional[_UnionT[int, bytes]] = ...) -> None: ... + +class c_double(_SimpleCData[float]): ... +class c_longdouble(_SimpleCData[float]): ... +class c_float(_SimpleCData[float]): ... +class c_int(_SimpleCData[int]): ... +class c_int8(_SimpleCData[int]): ... +class c_int16(_SimpleCData[int]): ... +class c_int32(_SimpleCData[int]): ... +class c_int64(_SimpleCData[int]): ... +class c_long(_SimpleCData[int]): ... +class c_longlong(_SimpleCData[int]): ... +class c_short(_SimpleCData[int]): ... +class c_size_t(_SimpleCData[int]): ... +class c_ssize_t(_SimpleCData[int]): ... +class c_ubyte(_SimpleCData[int]): ... +class c_uint(_SimpleCData[int]): ... +class c_uint8(_SimpleCData[int]): ... +class c_uint16(_SimpleCData[int]): ... +class c_uint32(_SimpleCData[int]): ... +class c_uint64(_SimpleCData[int]): ... +class c_ulong(_SimpleCData[int]): ... +class c_ulonglong(_SimpleCData[int]): ... +class c_ushort(_SimpleCData[int]): ... +class c_void_p(_PointerLike, _SimpleCData[Optional[int]]): ... +class c_wchar(_SimpleCData[Text]): ... + +class c_wchar_p(_PointerLike, _SimpleCData[Optional[Text]]): + def __init__(self, value: Optional[_UnionT[int, Text]] = ...) -> None: ... + +class c_bool(_SimpleCData[bool]): + def __init__(self, value: bool = ...) -> None: ... + +if sys.platform == "win32": + class HRESULT(_SimpleCData[int]): ... # TODO undocumented + +class py_object(_CanCastTo, _SimpleCData[_T]): ... + +class _CField: + offset: int = ... + size: int = ... + +class _StructUnionMeta(_CDataMeta): + _fields_: Sequence[_UnionT[Tuple[str, Type[_CData]], Tuple[str, Type[_CData], int]]] = ... + _pack_: int = ... + _anonymous_: Sequence[str] = ... + def __getattr__(self, name: str) -> _CField: ... + +class _StructUnionBase(_CData, metaclass=_StructUnionMeta): + def __init__(self, *args: Any, **kw: Any) -> None: ... + def __getattr__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + +class Union(_StructUnionBase): ... +class Structure(_StructUnionBase): ... +class BigEndianStructure(Structure): ... +class LittleEndianStructure(Structure): ... + +class Array(Generic[_CT], _CData): + _length_: ClassVar[int] = ... + _type_: ClassVar[Type[_CT]] = ... + raw: bytes = ... # Note: only available if _CT == c_char + value: Any = ... # Note: bytes if _CT == c_char, Text if _CT == c_wchar, unavailable otherwise + # TODO These methods cannot be annotated correctly at the moment. + # All of these "Any"s stand for the array's element type, but it's not possible to use _CT + # here, because of a special feature of ctypes. + # By default, when accessing an element of an Array[_CT], the returned object has type _CT. + # However, when _CT is a "simple type" like c_int, ctypes automatically "unboxes" the object + # and converts it to the corresponding Python primitive. For example, when accessing an element + # of an Array[c_int], a Python int object is returned, not a c_int. + # This behavior does *not* apply to subclasses of "simple types". + # If MyInt is a subclass of c_int, then accessing an element of an Array[MyInt] returns + # a MyInt, not an int. + # This special behavior is not easy to model in a stub, so for now all places where + # the array element type would belong are annotated with Any instead. + def __init__(self, *args: Any) -> None: ... + @overload + def __getitem__(self, i: int) -> Any: ... + @overload + def __getitem__(self, s: slice) -> List[Any]: ... + @overload + def __setitem__(self, i: int, o: Any) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[Any]) -> None: ... + def __iter__(self) -> Iterator[Any]: ... + # Can't inherit from Sized because the metaclass conflict between + # Sized and _CData prevents using _CDataMeta. + def __len__(self) -> int: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... diff --git a/shared/package-files/06/06d090ae1a5cf3f42e004c937acfa25d9bcd1830a4e0c7218eaf4e0ee7a40025/sparse_csc_tensor_ops.h b/shared/package-files/06/06d090ae1a5cf3f42e004c937acfa25d9bcd1830a4e0c7218eaf4e0ee7a40025/sparse_csc_tensor_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..5857a620b802fee09cf49216dfa7afd1a9c70d09 --- /dev/null +++ b/shared/package-files/06/06d090ae1a5cf3f42e004c937acfa25d9bcd1830a4e0c7218eaf4e0ee7a40025/sparse_csc_tensor_ops.h @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API sparse_csc_tensor_ccol_row_value_size { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &, const at::Tensor &, at::IntArrayRef, c10::optional, c10::optional, c10::optional, c10::optional); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::sparse_csc_tensor") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "ccol_row_value_size") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "sparse_csc_tensor.ccol_row_value_size(Tensor ccol_indices, Tensor row_indices, Tensor values, int[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False) -> Tensor") + static at::Tensor call(const at::Tensor & ccol_indices, const at::Tensor & row_indices, const at::Tensor & values, at::IntArrayRef size, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & ccol_indices, const at::Tensor & row_indices, const at::Tensor & values, at::IntArrayRef size, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); +}; + +struct TORCH_API sparse_csc_tensor_ccol_row_value { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &, const at::Tensor &, c10::optional, c10::optional, c10::optional, c10::optional); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::sparse_csc_tensor") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "ccol_row_value") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "sparse_csc_tensor.ccol_row_value(Tensor ccol_indices, Tensor row_indices, Tensor values, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False) -> Tensor") + static at::Tensor call(const at::Tensor & ccol_indices, const at::Tensor & row_indices, const at::Tensor & values, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & ccol_indices, const at::Tensor & row_indices, const at::Tensor & values, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/06/06e5eecfab0237d4daed4956441ce3c7876d0e96dd748de38cabbcc4ea430f04/kl_div.h b/shared/package-files/06/06e5eecfab0237d4daed4956441ce3c7876d0e96dd748de38cabbcc4ea430f04/kl_div.h new file mode 100644 index 0000000000000000000000000000000000000000..efd25925a9f305bfc576612dba15054329c7f856 --- /dev/null +++ b/shared/package-files/06/06e5eecfab0237d4daed4956441ce3c7876d0e96dd748de38cabbcc4ea430f04/kl_div.h @@ -0,0 +1,30 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::kl_div(Tensor self, Tensor target, int reduction=Mean, *, bool log_target=False) -> Tensor +inline at::Tensor kl_div(const at::Tensor & self, const at::Tensor & target, int64_t reduction=at::Reduction::Mean, bool log_target=false) { + return at::_ops::kl_div::call(self, target, reduction, log_target); +} + +} diff --git a/shared/package-files/1f/1f012661d626769e2bec85a7a56ac4d20d19d7f1ccdd3ace9a1aebcfb1ad25e0/ansi.sys-old b/shared/package-files/1f/1f012661d626769e2bec85a7a56ac4d20d19d7f1ccdd3ace9a1aebcfb1ad25e0/ansi.sys-old new file mode 100644 index 0000000000000000000000000000000000000000..3d0297122a97589c66601950207ece9d0c09bad8 Binary files /dev/null and b/shared/package-files/1f/1f012661d626769e2bec85a7a56ac4d20d19d7f1ccdd3ace9a1aebcfb1ad25e0/ansi.sys-old differ diff --git a/shared/package-files/1f/1f0c7a1de6f606f4d33037d660bdf24685eca8c77dc5dbb5fcb457cf69cccf0b/win32-headers.h b/shared/package-files/1f/1f0c7a1de6f606f4d33037d660bdf24685eca8c77dc5dbb5fcb457cf69cccf0b/win32-headers.h new file mode 100644 index 0000000000000000000000000000000000000000..6a3e8bc2caf42f02fba1925970dd33770a40abfa --- /dev/null +++ b/shared/package-files/1f/1f0c7a1de6f606f4d33037d660bdf24685eca8c77dc5dbb5fcb457cf69cccf0b/win32-headers.h @@ -0,0 +1,60 @@ +#pragma once + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#ifndef NOMINMAX +#define NOMINMAX +#endif +#ifndef NOKERNEL +#define NOKERNEL +#endif +#ifndef NOUSER +#define NOUSER +#endif +#ifndef NOSERVICE +#define NOSERVICE +#endif +#ifndef NOSOUND +#define NOSOUND +#endif +#ifndef NOMCX +#define NOMCX +#endif +#ifndef NOGDI +#define NOGDI +#endif +#ifndef NOMSG +#define NOMSG +#endif +#ifndef NOMB +#define NOMB +#endif +#ifndef NOCLIPBOARD +#define NOCLIPBOARD +#endif + +// dbghelp seems to require windows.h. +// clang-format off +#include +#include +// clang-format on + +#undef VOID +#undef DELETE +#undef IN +#undef THIS +#undef CONST +#undef NAN +#undef UNKNOWN +#undef NONE +#undef ANY +#undef IGNORE +#undef STRICT +#undef GetObject +#undef CreateSemaphore +#undef Yield +#undef RotateRight32 +#undef RotateLeft32 +#undef RotateRight64 +#undef RotateLeft64 diff --git a/shared/package-files/1f/1f0c9cca56cf020455cf89d9be3bf0a8dde642725ba8a03e35131a02f20ff821/_utility_functions.py b/shared/package-files/1f/1f0c9cca56cf020455cf89d9be3bf0a8dde642725ba8a03e35131a02f20ff821/_utility_functions.py new file mode 100644 index 0000000000000000000000000000000000000000..5ecb4bd9fef732bf5ca6aeec38ce2e7557ed19c2 --- /dev/null +++ b/shared/package-files/1f/1f0c9cca56cf020455cf89d9be3bf0a8dde642725ba8a03e35131a02f20ff821/_utility_functions.py @@ -0,0 +1,37 @@ +from __future__ import annotations + +from ._array_object import Array + +from typing import Optional, Tuple, Union + +import numpy as np + + +def all( + x: Array, + /, + *, + axis: Optional[Union[int, Tuple[int, ...]]] = None, + keepdims: bool = False, +) -> Array: + """ + Array API compatible wrapper for :py:func:`np.all `. + + See its docstring for more information. + """ + return Array._new(np.asarray(np.all(x._array, axis=axis, keepdims=keepdims))) + + +def any( + x: Array, + /, + *, + axis: Optional[Union[int, Tuple[int, ...]]] = None, + keepdims: bool = False, +) -> Array: + """ + Array API compatible wrapper for :py:func:`np.any `. + + See its docstring for more information. + """ + return Array._new(np.asarray(np.any(x._array, axis=axis, keepdims=keepdims))) diff --git a/shared/package-files/1f/1f0ca74ed835cfb97b142562b47e00d3b505f1bff14b8b3b8682aabfe43aac1b/ansi.sys b/shared/package-files/1f/1f0ca74ed835cfb97b142562b47e00d3b505f1bff14b8b3b8682aabfe43aac1b/ansi.sys new file mode 100644 index 0000000000000000000000000000000000000000..3a2e620d3a6361ae7e26e92479a9daf73918d0a7 Binary files /dev/null and b/shared/package-files/1f/1f0ca74ed835cfb97b142562b47e00d3b505f1bff14b8b3b8682aabfe43aac1b/ansi.sys differ diff --git a/shared/package-files/1f/1f1b0f5dede0263bd81773a78e98af551f36361accb315b618c8ae70a5fe781e/id.msg b/shared/package-files/1f/1f1b0f5dede0263bd81773a78e98af551f36361accb315b618c8ae70a5fe781e/id.msg new file mode 100644 index 0000000000000000000000000000000000000000..17c6bb59d47c7e4b2bcf123ce653c54eb558c6a3 --- /dev/null +++ b/shared/package-files/1f/1f1b0f5dede0263bd81773a78e98af551f36361accb315b618c8ae70a5fe781e/id.msg @@ -0,0 +1,47 @@ +# created by tools/loadICU.tcl -- do not edit +namespace eval ::tcl::clock { + ::msgcat::mcset id DAYS_OF_WEEK_ABBREV [list \ + "Min"\ + "Sen"\ + "Sel"\ + "Rab"\ + "Kam"\ + "Jum"\ + "Sab"] + ::msgcat::mcset id DAYS_OF_WEEK_FULL [list \ + "Minggu"\ + "Senin"\ + "Selasa"\ + "Rabu"\ + "Kamis"\ + "Jumat"\ + "Sabtu"] + ::msgcat::mcset id MONTHS_ABBREV [list \ + "Jan"\ + "Peb"\ + "Mar"\ + "Apr"\ + "Mei"\ + "Jun"\ + "Jul"\ + "Agu"\ + "Sep"\ + "Okt"\ + "Nov"\ + "Des"\ + ""] + ::msgcat::mcset id MONTHS_FULL [list \ + "Januari"\ + "Pebruari"\ + "Maret"\ + "April"\ + "Mei"\ + "Juni"\ + "Juli"\ + "Agustus"\ + "September"\ + "Oktober"\ + "November"\ + "Desember"\ + ""] +} diff --git a/shared/package-files/1f/1f25c8588b495c12951d4cd67103e2d4c99de992e6664f90851528f4abf65ce2/Omsk b/shared/package-files/1f/1f25c8588b495c12951d4cd67103e2d4c99de992e6664f90851528f4abf65ce2/Omsk new file mode 100644 index 0000000000000000000000000000000000000000..16c5f3cfed75151d50ffc2dc483ac6279816a01f Binary files /dev/null and b/shared/package-files/1f/1f25c8588b495c12951d4cd67103e2d4c99de992e6664f90851528f4abf65ce2/Omsk differ diff --git a/shared/package-files/1f/1f3a5a429231389a9f86b10784ac845d11b0cdcfeeefd22eab2fcabaded1562d/six.h b/shared/package-files/1f/1f3a5a429231389a9f86b10784ac845d11b0cdcfeeefd22eab2fcabaded1562d/six.h new file mode 100644 index 0000000000000000000000000000000000000000..cfca55bb86ec7158e7d3de90dbaae0b0e6cde4b2 --- /dev/null +++ b/shared/package-files/1f/1f3a5a429231389a9f86b10784ac845d11b0cdcfeeefd22eab2fcabaded1562d/six.h @@ -0,0 +1,52 @@ +#pragma once + +#include +#include +#include +#include + +namespace six { + +// Usually instances of PyStructSequence is also an instance of tuple +// but in some py2 environment it is not, so we have to manually check +// the name of the type to determine if it is a namedtupled returned +// by a pytorch operator. + +inline bool isStructSeq(pybind11::handle input) { + return pybind11::cast(input.get_type().attr("__module__")) == + "torch.return_types"; +} + +inline bool isStructSeq(PyObject* obj) { + return isStructSeq(pybind11::handle(obj)); +} + +inline bool isTuple(pybind11::handle input) { + if (PyTuple_Check(input.ptr())) { + return true; + } + return false; +} + +inline bool isTuple(PyObject* obj) { + return isTuple(pybind11::handle(obj)); +} + +// maybeAsTuple: if the input is a structseq, then convert it to a tuple +// +// On Python 3, structseq is a subtype of tuple, so these APIs could be used +// directly. But on Python 2, structseq is not a subtype of tuple, so we need to +// manually create a new tuple object from structseq. +inline THPObjectPtr maybeAsTuple(PyStructSequence* obj) { + Py_INCREF(obj); + return THPObjectPtr((PyObject*)obj); +} + +inline THPObjectPtr maybeAsTuple(PyObject* obj) { + if (isStructSeq(obj)) + return maybeAsTuple((PyStructSequence*)obj); + Py_INCREF(obj); + return THPObjectPtr(obj); +} + +} // namespace six diff --git a/shared/package-files/1f/1f3b4f48d844fbb98ef3162a664f704c9437659bb4e9b80a8ddb8f6fc373ca9c/bernoulli_cuda_dispatch.h b/shared/package-files/1f/1f3b4f48d844fbb98ef3162a664f704c9437659bb4e9b80a8ddb8f6fc373ca9c/bernoulli_cuda_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..77e65c41af42fdc29f0d36bb5561faf29142eca3 --- /dev/null +++ b/shared/package-files/1f/1f3b4f48d844fbb98ef3162a664f704c9437659bb4e9b80a8ddb8f6fc373ca9c/bernoulli_cuda_dispatch.h @@ -0,0 +1,26 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API at::Tensor & bernoulli_out(at::Tensor & out, const at::Tensor & self, c10::optional generator=c10::nullopt); +TORCH_API at::Tensor & bernoulli_outf(const at::Tensor & self, c10::optional generator, at::Tensor & out); +TORCH_API at::Tensor & bernoulli_(at::Tensor & self, const at::Tensor & p, c10::optional generator=c10::nullopt); +TORCH_API at::Tensor & bernoulli_(at::Tensor & self, double p=0.5, c10::optional generator=c10::nullopt); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/1f/1f42bd13d30048a580a164a3b7aa8e67279ef71e4bb7368abc848422c8654da6/norm_except_dim.h b/shared/package-files/1f/1f42bd13d30048a580a164a3b7aa8e67279ef71e4bb7368abc848422c8654da6/norm_except_dim.h new file mode 100644 index 0000000000000000000000000000000000000000..b577796739b183ed46d08ca2c9a2dc12e219fd36 --- /dev/null +++ b/shared/package-files/1f/1f42bd13d30048a580a164a3b7aa8e67279ef71e4bb7368abc848422c8654da6/norm_except_dim.h @@ -0,0 +1,30 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::norm_except_dim(Tensor v, int pow=2, int dim=0) -> Tensor +inline at::Tensor norm_except_dim(const at::Tensor & v, int64_t pow=2, int64_t dim=0) { + return at::_ops::norm_except_dim::call(v, pow, dim); +} + +} diff --git a/shared/package-files/1f/1f4a0d664366c293fc8ba529cac9e40fbc9abded04dd853767c74a1a86d26ce0/test_sdm.py b/shared/package-files/1f/1f4a0d664366c293fc8ba529cac9e40fbc9abded04dd853767c74a1a86d26ce0/test_sdm.py new file mode 100644 index 0000000000000000000000000000000000000000..21d0b0ce92e1447806b23b163fccebfe980287ce --- /dev/null +++ b/shared/package-files/1f/1f4a0d664366c293fc8ba529cac9e40fbc9abded04dd853767c74a1a86d26ce0/test_sdm.py @@ -0,0 +1,444 @@ +""" +Tests for the basic functionality of the SDM class. +""" + +from itertools import product + +from sympy.core.singleton import S +from sympy.external.gmpy import HAS_GMPY +from sympy.testing.pytest import raises + +from sympy.polys.domains import QQ, ZZ, EXRAW +from sympy.polys.matrices.sdm import SDM +from sympy.polys.matrices.ddm import DDM +from sympy.polys.matrices.exceptions import (DMBadInputError, DMDomainError, + DMShapeError) + + +def test_SDM(): + A = SDM({0:{0:ZZ(1)}}, (2, 2), ZZ) + assert A.domain == ZZ + assert A.shape == (2, 2) + assert dict(A) == {0:{0:ZZ(1)}} + + raises(DMBadInputError, lambda: SDM({5:{1:ZZ(0)}}, (2, 2), ZZ)) + raises(DMBadInputError, lambda: SDM({0:{5:ZZ(0)}}, (2, 2), ZZ)) + + +def test_DDM_str(): + sdm = SDM({0:{0:ZZ(1)}, 1:{1:ZZ(1)}}, (2, 2), ZZ) + assert str(sdm) == '{0: {0: 1}, 1: {1: 1}}' + if HAS_GMPY: # pragma: no cover + assert repr(sdm) == 'SDM({0: {0: mpz(1)}, 1: {1: mpz(1)}}, (2, 2), ZZ)' + else: # pragma: no cover + assert repr(sdm) == 'SDM({0: {0: 1}, 1: {1: 1}}, (2, 2), ZZ)' + + +def test_SDM_new(): + A = SDM({0:{0:ZZ(1)}}, (2, 2), ZZ) + B = A.new({}, (2, 2), ZZ) + assert B == SDM({}, (2, 2), ZZ) + + +def test_SDM_copy(): + A = SDM({0:{0:ZZ(1)}}, (2, 2), ZZ) + B = A.copy() + assert A == B + A[0][0] = ZZ(2) + assert A != B + + +def test_SDM_from_list(): + A = SDM.from_list([[ZZ(0), ZZ(1)], [ZZ(1), ZZ(0)]], (2, 2), ZZ) + assert A == SDM({0:{1:ZZ(1)}, 1:{0:ZZ(1)}}, (2, 2), ZZ) + + raises(DMBadInputError, lambda: SDM.from_list([[ZZ(0)], [ZZ(0), ZZ(1)]], (2, 2), ZZ)) + raises(DMBadInputError, lambda: SDM.from_list([[ZZ(0), ZZ(1)]], (2, 2), ZZ)) + + +def test_SDM_to_list(): + A = SDM({0:{1: ZZ(1)}}, (2, 2), ZZ) + assert A.to_list() == [[ZZ(0), ZZ(1)], [ZZ(0), ZZ(0)]] + + A = SDM({}, (0, 2), ZZ) + assert A.to_list() == [] + + A = SDM({}, (2, 0), ZZ) + assert A.to_list() == [[], []] + + +def test_SDM_to_list_flat(): + A = SDM({0:{1: ZZ(1)}}, (2, 2), ZZ) + assert A.to_list_flat() == [ZZ(0), ZZ(1), ZZ(0), ZZ(0)] + + +def test_SDM_to_dok(): + A = SDM({0:{1: ZZ(1)}}, (2, 2), ZZ) + assert A.to_dok() == {(0, 1): ZZ(1)} + + +def test_SDM_from_ddm(): + A = DDM([[ZZ(1), ZZ(0)], [ZZ(1), ZZ(0)]], (2, 2), ZZ) + B = SDM.from_ddm(A) + assert B.domain == ZZ + assert B.shape == (2, 2) + assert dict(B) == {0:{0:ZZ(1)}, 1:{0:ZZ(1)}} + + +def test_SDM_to_ddm(): + A = SDM({0:{1: ZZ(1)}}, (2, 2), ZZ) + B = DDM([[ZZ(0), ZZ(1)], [ZZ(0), ZZ(0)]], (2, 2), ZZ) + assert A.to_ddm() == B + + +def test_SDM_to_sdm(): + A = SDM({0:{1: ZZ(1)}}, (2, 2), ZZ) + assert A.to_sdm() == A + + +def test_SDM_getitem(): + A = SDM({0:{1:ZZ(1)}}, (2, 2), ZZ) + assert A.getitem(0, 0) == ZZ.zero + assert A.getitem(0, 1) == ZZ.one + assert A.getitem(1, 0) == ZZ.zero + assert A.getitem(-2, -2) == ZZ.zero + assert A.getitem(-2, -1) == ZZ.one + assert A.getitem(-1, -2) == ZZ.zero + raises(IndexError, lambda: A.getitem(2, 0)) + raises(IndexError, lambda: A.getitem(0, 2)) + + +def test_SDM_setitem(): + A = SDM({0:{1:ZZ(1)}}, (2, 2), ZZ) + A.setitem(0, 0, ZZ(1)) + assert A == SDM({0:{0:ZZ(1), 1:ZZ(1)}}, (2, 2), ZZ) + A.setitem(1, 0, ZZ(1)) + assert A == SDM({0:{0:ZZ(1), 1:ZZ(1)}, 1:{0:ZZ(1)}}, (2, 2), ZZ) + A.setitem(1, 0, ZZ(0)) + assert A == SDM({0:{0:ZZ(1), 1:ZZ(1)}}, (2, 2), ZZ) + # Repeat the above test so that this time the row is empty + A.setitem(1, 0, ZZ(0)) + assert A == SDM({0:{0:ZZ(1), 1:ZZ(1)}}, (2, 2), ZZ) + A.setitem(0, 0, ZZ(0)) + assert A == SDM({0:{1:ZZ(1)}}, (2, 2), ZZ) + # This time the row is there but column is empty + A.setitem(0, 0, ZZ(0)) + assert A == SDM({0:{1:ZZ(1)}}, (2, 2), ZZ) + raises(IndexError, lambda: A.setitem(2, 0, ZZ(1))) + raises(IndexError, lambda: A.setitem(0, 2, ZZ(1))) + + +def test_SDM_extract_slice(): + A = SDM({0:{0:ZZ(1), 1:ZZ(2)}, 1:{0:ZZ(3), 1:ZZ(4)}}, (2, 2), ZZ) + B = A.extract_slice(slice(1, 2), slice(1, 2)) + assert B == SDM({0:{0:ZZ(4)}}, (1, 1), ZZ) + + +def test_SDM_extract(): + A = SDM({0:{0:ZZ(1), 1:ZZ(2)}, 1:{0:ZZ(3), 1:ZZ(4)}}, (2, 2), ZZ) + B = A.extract([1], [1]) + assert B == SDM({0:{0:ZZ(4)}}, (1, 1), ZZ) + B = A.extract([1, 0], [1, 0]) + assert B == SDM({0:{0:ZZ(4), 1:ZZ(3)}, 1:{0:ZZ(2), 1:ZZ(1)}}, (2, 2), ZZ) + B = A.extract([1, 1], [1, 1]) + assert B == SDM({0:{0:ZZ(4), 1:ZZ(4)}, 1:{0:ZZ(4), 1:ZZ(4)}}, (2, 2), ZZ) + B = A.extract([-1], [-1]) + assert B == SDM({0:{0:ZZ(4)}}, (1, 1), ZZ) + + A = SDM({}, (2, 2), ZZ) + B = A.extract([0, 1, 0], [0, 0]) + assert B == SDM({}, (3, 2), ZZ) + + A = SDM({0:{0:ZZ(1), 1:ZZ(2)}, 1:{0:ZZ(3), 1:ZZ(4)}}, (2, 2), ZZ) + assert A.extract([], []) == SDM.zeros((0, 0), ZZ) + assert A.extract([1], []) == SDM.zeros((1, 0), ZZ) + assert A.extract([], [1]) == SDM.zeros((0, 1), ZZ) + + raises(IndexError, lambda: A.extract([2], [0])) + raises(IndexError, lambda: A.extract([0], [2])) + raises(IndexError, lambda: A.extract([-3], [0])) + raises(IndexError, lambda: A.extract([0], [-3])) + + +def test_SDM_zeros(): + A = SDM.zeros((2, 2), ZZ) + assert A.domain == ZZ + assert A.shape == (2, 2) + assert dict(A) == {} + +def test_SDM_ones(): + A = SDM.ones((1, 2), QQ) + assert A.domain == QQ + assert A.shape == (1, 2) + assert dict(A) == {0:{0:QQ(1), 1:QQ(1)}} + +def test_SDM_eye(): + A = SDM.eye((2, 2), ZZ) + assert A.domain == ZZ + assert A.shape == (2, 2) + assert dict(A) == {0:{0:ZZ(1)}, 1:{1:ZZ(1)}} + + +def test_SDM_diag(): + A = SDM.diag([ZZ(1), ZZ(2)], ZZ, (2, 3)) + assert A == SDM({0:{0:ZZ(1)}, 1:{1:ZZ(2)}}, (2, 3), ZZ) + + +def test_SDM_transpose(): + A = SDM({0:{0:ZZ(1), 1:ZZ(2)}, 1:{0:ZZ(3), 1:ZZ(4)}}, (2, 2), ZZ) + B = SDM({0:{0:ZZ(1), 1:ZZ(3)}, 1:{0:ZZ(2), 1:ZZ(4)}}, (2, 2), ZZ) + assert A.transpose() == B + + A = SDM({0:{1:ZZ(2)}}, (2, 2), ZZ) + B = SDM({1:{0:ZZ(2)}}, (2, 2), ZZ) + assert A.transpose() == B + + A = SDM({0:{1:ZZ(2)}}, (1, 2), ZZ) + B = SDM({1:{0:ZZ(2)}}, (2, 1), ZZ) + assert A.transpose() == B + + +def test_SDM_mul(): + A = SDM({0:{0:ZZ(2)}}, (2, 2), ZZ) + B = SDM({0:{0:ZZ(4)}}, (2, 2), ZZ) + assert A*ZZ(2) == B + assert ZZ(2)*A == B + + raises(TypeError, lambda: A*QQ(1, 2)) + raises(TypeError, lambda: QQ(1, 2)*A) + + +def test_SDM_mul_elementwise(): + A = SDM({0:{0:ZZ(2), 1:ZZ(2)}}, (2, 2), ZZ) + B = SDM({0:{0:ZZ(4)}, 1:{0:ZZ(3)}}, (2, 2), ZZ) + C = SDM({0:{0:ZZ(8)}}, (2, 2), ZZ) + assert A.mul_elementwise(B) == C + assert B.mul_elementwise(A) == C + + Aq = A.convert_to(QQ) + A1 = SDM({0:{0:ZZ(1)}}, (1, 1), ZZ) + + raises(DMDomainError, lambda: Aq.mul_elementwise(B)) + raises(DMShapeError, lambda: A1.mul_elementwise(B)) + + +def test_SDM_matmul(): + A = SDM({0:{0:ZZ(2)}}, (2, 2), ZZ) + B = SDM({0:{0:ZZ(4)}}, (2, 2), ZZ) + assert A.matmul(A) == A*A == B + + C = SDM({0:{0:ZZ(2)}}, (2, 2), QQ) + raises(DMDomainError, lambda: A.matmul(C)) + + A = SDM({0:{0:ZZ(1), 1:ZZ(2)}, 1:{0:ZZ(3), 1:ZZ(4)}}, (2, 2), ZZ) + B = SDM({0:{0:ZZ(7), 1:ZZ(10)}, 1:{0:ZZ(15), 1:ZZ(22)}}, (2, 2), ZZ) + assert A.matmul(A) == A*A == B + + A22 = SDM({0:{0:ZZ(4)}}, (2, 2), ZZ) + A32 = SDM({0:{0:ZZ(2)}}, (3, 2), ZZ) + A23 = SDM({0:{0:ZZ(4)}}, (2, 3), ZZ) + A33 = SDM({0:{0:ZZ(8)}}, (3, 3), ZZ) + A22 = SDM({0:{0:ZZ(8)}}, (2, 2), ZZ) + assert A32.matmul(A23) == A33 + assert A23.matmul(A32) == A22 + # XXX: @ not supported by SDM... + #assert A32.matmul(A23) == A32 @ A23 == A33 + #assert A23.matmul(A32) == A23 @ A32 == A22 + #raises(DMShapeError, lambda: A23 @ A22) + raises(DMShapeError, lambda: A23.matmul(A22)) + + A = SDM({0: {0: ZZ(-1), 1: ZZ(1)}}, (1, 2), ZZ) + B = SDM({0: {0: ZZ(-1)}, 1: {0: ZZ(-1)}}, (2, 1), ZZ) + assert A.matmul(B) == A*B == SDM({}, (1, 1), ZZ) + + +def test_matmul_exraw(): + + def dm(d): + result = {} + for i, row in d.items(): + row = {j:val for j, val in row.items() if val} + if row: + result[i] = row + return SDM(result, (2, 2), EXRAW) + + values = [S.NegativeInfinity, S.NegativeOne, S.Zero, S.One, S.Infinity] + for a, b, c, d in product(*[values]*4): + Ad = dm({0: {0:a, 1:b}, 1: {0:c, 1:d}}) + Ad2 = dm({0: {0:a*a + b*c, 1:a*b + b*d}, 1:{0:c*a + d*c, 1: c*b + d*d}}) + assert Ad * Ad == Ad2 + + +def test_SDM_add(): + A = SDM({0:{1:ZZ(1)}, 1:{0:ZZ(2), 1:ZZ(3)}}, (2, 2), ZZ) + B = SDM({0:{0:ZZ(1)}, 1:{0:ZZ(-2), 1:ZZ(3)}}, (2, 2), ZZ) + C = SDM({0:{0:ZZ(1), 1:ZZ(1)}, 1:{1:ZZ(6)}}, (2, 2), ZZ) + assert A.add(B) == B.add(A) == A + B == B + A == C + + A = SDM({0:{1:ZZ(1)}}, (2, 2), ZZ) + B = SDM({0:{0:ZZ(1)}, 1:{0:ZZ(-2), 1:ZZ(3)}}, (2, 2), ZZ) + C = SDM({0:{0:ZZ(1), 1:ZZ(1)}, 1:{0:ZZ(-2), 1:ZZ(3)}}, (2, 2), ZZ) + assert A.add(B) == B.add(A) == A + B == B + A == C + + raises(TypeError, lambda: A + []) + + +def test_SDM_sub(): + A = SDM({0:{1:ZZ(1)}, 1:{0:ZZ(2), 1:ZZ(3)}}, (2, 2), ZZ) + B = SDM({0:{0:ZZ(1)}, 1:{0:ZZ(-2), 1:ZZ(3)}}, (2, 2), ZZ) + C = SDM({0:{0:ZZ(-1), 1:ZZ(1)}, 1:{0:ZZ(4)}}, (2, 2), ZZ) + assert A.sub(B) == A - B == C + + raises(TypeError, lambda: A - []) + + +def test_SDM_neg(): + A = SDM({0:{1:ZZ(1)}, 1:{0:ZZ(2), 1:ZZ(3)}}, (2, 2), ZZ) + B = SDM({0:{1:ZZ(-1)}, 1:{0:ZZ(-2), 1:ZZ(-3)}}, (2, 2), ZZ) + assert A.neg() == -A == B + + +def test_SDM_convert_to(): + A = SDM({0:{1:ZZ(1)}, 1:{0:ZZ(2), 1:ZZ(3)}}, (2, 2), ZZ) + B = SDM({0:{1:QQ(1)}, 1:{0:QQ(2), 1:QQ(3)}}, (2, 2), QQ) + C = A.convert_to(QQ) + assert C == B + assert C.domain == QQ + + D = A.convert_to(ZZ) + assert D == A + assert D.domain == ZZ + + +def test_SDM_hstack(): + A = SDM({0:{1:ZZ(1)}}, (2, 2), ZZ) + B = SDM({1:{1:ZZ(1)}}, (2, 2), ZZ) + AA = SDM({0:{1:ZZ(1), 3:ZZ(1)}}, (2, 4), ZZ) + AB = SDM({0:{1:ZZ(1)}, 1:{3:ZZ(1)}}, (2, 4), ZZ) + assert SDM.hstack(A) == A + assert SDM.hstack(A, A) == AA + assert SDM.hstack(A, B) == AB + + +def test_SDM_vstack(): + A = SDM({0:{1:ZZ(1)}}, (2, 2), ZZ) + B = SDM({1:{1:ZZ(1)}}, (2, 2), ZZ) + AA = SDM({0:{1:ZZ(1)}, 2:{1:ZZ(1)}}, (4, 2), ZZ) + AB = SDM({0:{1:ZZ(1)}, 3:{1:ZZ(1)}}, (4, 2), ZZ) + assert SDM.vstack(A) == A + assert SDM.vstack(A, A) == AA + assert SDM.vstack(A, B) == AB + + +def test_SDM_applyfunc(): + A = SDM({0:{1:ZZ(1)}}, (2, 2), ZZ) + B = SDM({0:{1:ZZ(2)}}, (2, 2), ZZ) + assert A.applyfunc(lambda x: 2*x, ZZ) == B + + +def test_SDM_inv(): + A = SDM({0:{0:QQ(1), 1:QQ(2)}, 1:{0:QQ(3), 1:QQ(4)}}, (2, 2), QQ) + B = SDM({0:{0:QQ(-2), 1:QQ(1)}, 1:{0:QQ(3, 2), 1:QQ(-1, 2)}}, (2, 2), QQ) + assert A.inv() == B + + +def test_SDM_det(): + A = SDM({0:{0:QQ(1), 1:QQ(2)}, 1:{0:QQ(3), 1:QQ(4)}}, (2, 2), QQ) + assert A.det() == QQ(-2) + + +def test_SDM_lu(): + A = SDM({0:{0:QQ(1), 1:QQ(2)}, 1:{0:QQ(3), 1:QQ(4)}}, (2, 2), QQ) + L = SDM({0:{0:QQ(1)}, 1:{0:QQ(3), 1:QQ(1)}}, (2, 2), QQ) + #U = SDM({0:{0:QQ(1), 1:QQ(2)}, 1:{0:QQ(3), 1:QQ(-2)}}, (2, 2), QQ) + #swaps = [] + # This doesn't quite work. U has some nonzero elements in the lower part. + #assert A.lu() == (L, U, swaps) + assert A.lu()[0] == L + + +def test_SDM_lu_solve(): + A = SDM({0:{0:QQ(1), 1:QQ(2)}, 1:{0:QQ(3), 1:QQ(4)}}, (2, 2), QQ) + b = SDM({0:{0:QQ(1)}, 1:{0:QQ(2)}}, (2, 1), QQ) + x = SDM({1:{0:QQ(1, 2)}}, (2, 1), QQ) + assert A.matmul(x) == b + assert A.lu_solve(b) == x + + +def test_SDM_charpoly(): + A = SDM({0:{0:ZZ(1), 1:ZZ(2)}, 1:{0:ZZ(3), 1:ZZ(4)}}, (2, 2), ZZ) + assert A.charpoly() == [ZZ(1), ZZ(-5), ZZ(-2)] + + +def test_SDM_nullspace(): + A = SDM({0:{0:QQ(1), 1:QQ(1)}}, (2, 2), QQ) + assert A.nullspace()[0] == SDM({0:{0:QQ(-1), 1:QQ(1)}}, (1, 2), QQ) + + +def test_SDM_rref(): + eye2 = SDM({0:{0:QQ(1)}, 1:{1:QQ(1)}}, (2, 2), QQ) + + A = SDM({0:{0:QQ(1), 1:QQ(2)}, 1:{0:QQ(3), 1:QQ(4)}}, (2, 2), QQ) + assert A.rref() == (eye2, [0, 1]) + + A = SDM({0:{0:QQ(1)}, 1:{0:QQ(3), 1:QQ(4)}}, (2, 2), QQ) + assert A.rref() == (eye2, [0, 1]) + + A = SDM({0:{1:QQ(2)}, 1:{0:QQ(3), 1:QQ(4)}}, (2, 2), QQ) + assert A.rref() == (eye2, [0, 1]) + + A = SDM({0:{0:QQ(1), 1:QQ(2), 2:QQ(3)}, + 1:{0:QQ(4), 1:QQ(5), 2:QQ(6)}, + 2:{0:QQ(7), 1:QQ(8), 2:QQ(9)} }, (3, 3), QQ) + Arref = SDM({0:{0:QQ(1), 2:QQ(-1)}, 1:{1:QQ(1), 2:QQ(2)}}, (3, 3), QQ) + assert A.rref() == (Arref, [0, 1]) + + A = SDM({0:{0:QQ(1), 1:QQ(2), 3:QQ(1)}, + 1:{0:QQ(1), 1:QQ(1), 2:QQ(9)}}, (2, 4), QQ) + Arref = SDM({0:{0:QQ(1), 2:QQ(18), 3:QQ(-1)}, + 1:{1:QQ(1), 2:QQ(-9), 3:QQ(1)}}, (2, 4), QQ) + assert A.rref() == (Arref, [0, 1]) + + A = SDM({0:{0:QQ(1), 1:QQ(1), 2:QQ(1)}, + 1:{0:QQ(1), 1:QQ(2), 2:QQ(2)}}, (2, 3), QQ) + Arref = SDM( + {0: {0: QQ(1,1)}, 1: {1: QQ(1,1), 2: QQ(1,1)}}, + (2, 3), QQ) + assert A.rref() == (Arref, [0, 1]) + + +def test_SDM_particular(): + A = SDM({0:{0:QQ(1)}}, (2, 2), QQ) + Apart = SDM.zeros((1, 2), QQ) + assert A.particular() == Apart + + +def test_SDM_is_zero_matrix(): + A = SDM({0: {0: QQ(1)}}, (2, 2), QQ) + Azero = SDM.zeros((1, 2), QQ) + assert A.is_zero_matrix() is False + assert Azero.is_zero_matrix() is True + + +def test_SDM_is_upper(): + A = SDM({0: {0: QQ(1), 1: QQ(2), 2: QQ(3), 3: QQ(4)}, + 1: {1: QQ(5), 2: QQ(6), 3: QQ(7)}, + 2: {2: QQ(8), 3: QQ(9)}}, (3, 4), QQ) + B = SDM({0: {0: QQ(1), 1: QQ(2), 2: QQ(3), 3: QQ(4)}, + 1: {1: QQ(5), 2: QQ(6), 3: QQ(7)}, + 2: {1: QQ(7), 2: QQ(8), 3: QQ(9)}}, (3, 4), QQ) + assert A.is_upper() is True + assert B.is_upper() is False + + +def test_SDM_is_lower(): + A = SDM({0: {0: QQ(1), 1: QQ(2), 2: QQ(3), 3: QQ(4)}, + 1: {1: QQ(5), 2: QQ(6), 3: QQ(7)}, + 2: {2: QQ(8), 3: QQ(9)}}, (3, 4), QQ + ).transpose() + B = SDM({0: {0: QQ(1), 1: QQ(2), 2: QQ(3), 3: QQ(4)}, + 1: {1: QQ(5), 2: QQ(6), 3: QQ(7)}, + 2: {1: QQ(7), 2: QQ(8), 3: QQ(9)}}, (3, 4), QQ + ).transpose() + assert A.is_lower() is True + assert B.is_lower() is False diff --git a/shared/package-files/1f/1f4e17b848b9d5800cfe065a7cf1e576cdfc9cf2c9fd527134095169d52612a6/_nested_get_lengths_ops.h b/shared/package-files/1f/1f4e17b848b9d5800cfe065a7cf1e576cdfc9cf2c9fd527134095169d52612a6/_nested_get_lengths_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..56b181a7fd571aad982b60106edf48a5d8c54af4 --- /dev/null +++ b/shared/package-files/1f/1f4e17b848b9d5800cfe065a7cf1e576cdfc9cf2c9fd527134095169d52612a6/_nested_get_lengths_ops.h @@ -0,0 +1,28 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API _nested_get_lengths { + using schema = at::Tensor (const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_nested_get_lengths") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_nested_get_lengths(Tensor self) -> Tensor") + static at::Tensor call(const at::Tensor & self); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/1f/1f519e110eea3924b0828e79b0d51a896cd56f5bdb02a3abd378677d1f81fa8f/_vector_sentinel.pyx b/shared/package-files/1f/1f519e110eea3924b0828e79b0d51a896cd56f5bdb02a3abd378677d1f81fa8f/_vector_sentinel.pyx new file mode 100644 index 0000000000000000000000000000000000000000..146234568963f387d9108b2851c2d521f1b8e6ba --- /dev/null +++ b/shared/package-files/1f/1f519e110eea3924b0828e79b0d51a896cd56f5bdb02a3abd378677d1f81fa8f/_vector_sentinel.pyx @@ -0,0 +1,118 @@ +from cython.operator cimport dereference as deref +from cpython.ref cimport Py_INCREF +cimport numpy as cnp + +cnp.import_array() + + +cdef StdVectorSentinel _create_sentinel(vector_typed * vect_ptr): + if vector_typed is vector[float64_t]: + return StdVectorSentinelFloat64.create_for(vect_ptr) + elif vector_typed is vector[int32_t]: + return StdVectorSentinelInt32.create_for(vect_ptr) + elif vector_typed is vector[int64_t]: + return StdVectorSentinelInt64.create_for(vect_ptr) + else: # intp_t + return StdVectorSentinelIntP.create_for(vect_ptr) + + +cdef class StdVectorSentinel: + """Wraps a reference to a vector which will be deallocated with this object. + + When created, the StdVectorSentinel swaps the reference of its internal + vectors with the provided one (vect_ptr), thus making the StdVectorSentinel + manage the provided one's lifetime. + """ + cdef void* get_data(self): + """Return pointer to data.""" + + cdef int get_typenum(self): + """Get typenum for PyArray_SimpleNewFromData.""" + + +cdef class StdVectorSentinelFloat64(StdVectorSentinel): + cdef vector[float64_t] vec + + @staticmethod + cdef StdVectorSentinel create_for(vector[float64_t] * vect_ptr): + # This initializes the object directly without calling __init__ + # See: https://cython.readthedocs.io/en/latest/src/userguide/extension_types.html#instantiation-from-existing-c-c-pointers # noqa + cdef StdVectorSentinelFloat64 sentinel = StdVectorSentinelFloat64.__new__(StdVectorSentinelFloat64) + sentinel.vec.swap(deref(vect_ptr)) + return sentinel + + cdef void* get_data(self): + return self.vec.data() + + cdef int get_typenum(self): + return cnp.NPY_FLOAT64 + + +cdef class StdVectorSentinelIntP(StdVectorSentinel): + cdef vector[intp_t] vec + + @staticmethod + cdef StdVectorSentinel create_for(vector[intp_t] * vect_ptr): + # This initializes the object directly without calling __init__ + # See: https://cython.readthedocs.io/en/latest/src/userguide/extension_types.html#instantiation-from-existing-c-c-pointers # noqa + cdef StdVectorSentinelIntP sentinel = StdVectorSentinelIntP.__new__(StdVectorSentinelIntP) + sentinel.vec.swap(deref(vect_ptr)) + return sentinel + + cdef void* get_data(self): + return self.vec.data() + + cdef int get_typenum(self): + return cnp.NPY_INTP + + +cdef class StdVectorSentinelInt32(StdVectorSentinel): + cdef vector[int32_t] vec + + @staticmethod + cdef StdVectorSentinel create_for(vector[int32_t] * vect_ptr): + # This initializes the object directly without calling __init__ + # See: https://cython.readthedocs.io/en/latest/src/userguide/extension_types.html#instantiation-from-existing-c-c-pointers # noqa + cdef StdVectorSentinelInt32 sentinel = StdVectorSentinelInt32.__new__(StdVectorSentinelInt32) + sentinel.vec.swap(deref(vect_ptr)) + return sentinel + + cdef void* get_data(self): + return self.vec.data() + + cdef int get_typenum(self): + return cnp.NPY_INT32 + + +cdef class StdVectorSentinelInt64(StdVectorSentinel): + cdef vector[int64_t] vec + + @staticmethod + cdef StdVectorSentinel create_for(vector[int64_t] * vect_ptr): + # This initializes the object directly without calling __init__ + # See: https://cython.readthedocs.io/en/latest/src/userguide/extension_types.html#instantiation-from-existing-c-c-pointers # noqa + cdef StdVectorSentinelInt64 sentinel = StdVectorSentinelInt64.__new__(StdVectorSentinelInt64) + sentinel.vec.swap(deref(vect_ptr)) + return sentinel + + cdef void* get_data(self): + return self.vec.data() + + cdef int get_typenum(self): + return cnp.NPY_INT64 + + +cdef cnp.ndarray vector_to_nd_array(vector_typed * vect_ptr): + cdef: + cnp.npy_intp size = deref(vect_ptr).size() + StdVectorSentinel sentinel = _create_sentinel(vect_ptr) + cnp.ndarray arr = cnp.PyArray_SimpleNewFromData( + 1, &size, sentinel.get_typenum(), sentinel.get_data()) + + # Makes the numpy array responsible of the life-cycle of its buffer. + # A reference to the StdVectorSentinel will be stolen by the call to + # `PyArray_SetBaseObject` below, so we increase its reference counter. + # See: https://docs.python.org/3/c-api/intro.html#reference-count-details + Py_INCREF(sentinel) + cnp.PyArray_SetBaseObject(arr, sentinel) + return arr diff --git a/shared/package-files/1f/1f55bdde7a0e8213fab2d4962730fac65163b7476179f1f5b926595c4fcc4d53/rshift_ops.h b/shared/package-files/1f/1f55bdde7a0e8213fab2d4962730fac65163b7476179f1f5b926595c4fcc4d53/rshift_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..8c86b0fb012f89ab90fc0f28952705ec38065bef --- /dev/null +++ b/shared/package-files/1f/1f55bdde7a0e8213fab2d4962730fac65163b7476179f1f5b926595c4fcc4d53/rshift_ops.h @@ -0,0 +1,83 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API __rshift___Scalar { + using schema = at::Tensor (const at::Tensor &, const at::Scalar &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::__rshift__") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Scalar") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "__rshift__.Scalar(Tensor self, Scalar other) -> Tensor") + static at::Tensor call(const at::Tensor & self, const at::Scalar & other); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Scalar & other); +}; + +struct TORCH_API __rshift___Tensor { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::__rshift__") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Tensor") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "__rshift__.Tensor(Tensor self, Tensor other) -> Tensor") + static at::Tensor call(const at::Tensor & self, const at::Tensor & other); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & other); +}; + +struct TORCH_API __irshift___Scalar { + using schema = at::Tensor & (at::Tensor &, const at::Scalar &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::__irshift__") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Scalar") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "__irshift__.Scalar(Tensor(a!) self, Scalar other) -> Tensor(a!)") + static at::Tensor & call(at::Tensor & self, const at::Scalar & other); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, at::Tensor & self, const at::Scalar & other); +}; + +struct TORCH_API __irshift___Tensor { + using schema = at::Tensor & (at::Tensor &, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::__irshift__") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Tensor") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "__irshift__.Tensor(Tensor(a!) self, Tensor other) -> Tensor(a!)") + static at::Tensor & call(at::Tensor & self, const at::Tensor & other); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, at::Tensor & self, const at::Tensor & other); +}; + +struct TORCH_API __rshift___Scalar_out { + using schema = at::Tensor & (const at::Tensor &, const at::Scalar &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::__rshift__") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Scalar_out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "__rshift__.Scalar_out(Tensor self, Scalar other, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, const at::Scalar & other, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Scalar & other, at::Tensor & out); +}; + +struct TORCH_API __rshift___Tensor_out { + using schema = at::Tensor & (const at::Tensor &, const at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::__rshift__") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Tensor_out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "__rshift__.Tensor_out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, const at::Tensor & other, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & other, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/1f/1f569ce27cb3145b482bc8bf51cef0b8e9fd1ae8f1e2e7a128061b1ddf93bb0e/scotland_births.html b/shared/package-files/1f/1f569ce27cb3145b482bc8bf51cef0b8e9fd1ae8f1e2e7a128061b1ddf93bb0e/scotland_births.html new file mode 100644 index 0000000000000000000000000000000000000000..242d4b14932e159a73508624534a9fb8597bdcdb --- /dev/null +++ b/shared/package-files/1f/1f569ce27cb3145b482bc8bf51cef0b8e9fd1ae8f1e2e7a128061b1ddf93bb0e/scotland_births.html @@ -0,0 +1,312 @@ + + + + + +Cross-sectional dataset viewer v1.1 + + + + + + + + + + + + + +
+ Home + + StatSearch + + Text Search + + StatStore + + FAQ + +   +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Dataset Display - Cross-Sectional

Dataset Name: + RT331602 +
Title: + + Vital and social statistics: Scotland +
Description:Vital and social statistics: Scotland

This dataset has been compiled from data published in Regional Trends 33, 1998 edition published on 25 June 1998.

Source: + Office for National Statistics; General Register Office for Scotland +
Time Frame: + 1996 +
Geographic Coverage: + United Kingdom + +
Universe: + UK live births +
Measure: + various +
Units: + See table +
Scalar: + various +
Formula: + none +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table Dimensions
Please select at least one item from each list and "Display Selection" or choose "Display All"
To select list items either hold down 'Ctrl' key and click each item required, or click the first item and hold down the mouse button whilst scrolling down the list.
+ Region + + 4 + + Measure + + +
+ + + +
 
To change your selection, click in the appropriate box
+ + + +
+ + + + + + + + + + +
+ + + Table + + + + +
Live births per 1,000 population 19961Deaths per 1,000 population 19961Perinatal mortality rate, 3 year average, 1994-19962Infant mortality rate, 3 year average, 1994-19963Percentage of live births outside marriage 1996
United Kingdom12.510.98.86.136.0
Scotland11.611.89.36.236.0
Aberdeen City11.010.47.75.735.0
Aberdeenshire11.39.09.03.824.0
Angus311.013.25.63.233.0
Argyll and Bute10.513.88.67.033.0
Clackmannanshire12.311.310.46.340.0
Dumfries and Galloway10.912.88.87.834.0
Dundee City11.513.18.66.851.0
East Ayrshire311.411.612.36.540.0
East Dunbartonshire10.59.28.17.219.0
East Lothian12.312.67.65.229.0
East Renfrewshire11.59.57.46.219.0
Edinburgh, City of11.411.78.16.433.0
Eilean Siar (Western Isles)239.714.911.25.719.0
Falkirk11.711.77.94.834.0
Fife11.011.48.77.137.0
Glasgow City12.514.011.16.949.0
Highland11.411.48.36.534.0
Inverclyde11.714.511.58.045.0
Midlothian11.210.710.86.035.0
Moray12.411.09.87.426.0
North Ayrshire2311.311.811.66.942.0
North Lanarkshire12.511.111.68.538.0
Orkney Islands10.911.67.51.430.0
Perth and Kinross310.512.69.85.929.0
Renfrewshire311.911.68.04.539.0
Scottish Borders, The310.712.88.04.928.0
Shetland Islands2311.710.99.96.528.0
South Ayrshire10.112.76.24.333.0
South Lanarkshire11.511.39.25.133.0
Stirling11.111.87.74.933.0
West Dunbartonshire12.512.711.78.742.0
West Lothian13.19.58.74.633.0
+
+ + + + +
Footnotes
1 -Births are on the basis of year of occurrence in England and Wales and year of registration in Scotland and Northern Ireland. Deaths relate to year of registration.
2 -Still births and deaths of infants under 1 week of age per 1,000 live and still births. Figures for some Council areas should be treated with caution as the perinatal mortality rate was based on fewer than 20 deaths.
3 -Deaths of infants under 1 year of age per 1,000 live births. Figures for some Council areas should be treated with caution as the infant mortality rate was based on fewer than 20 deaths.
4 -New Councils for Scotland
+
+ \ No newline at end of file diff --git a/shared/package-files/1f/1f59a95f609804c5eab38ac88282aaed1af4aa19acf7d2c3368da9c5d44e3447/bincount_compositeexplicitautograd_dispatch.h b/shared/package-files/1f/1f59a95f609804c5eab38ac88282aaed1af4aa19acf7d2c3368da9c5d44e3447/bincount_compositeexplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..dc846df532aa72be19847983739af117f43b06b3 --- /dev/null +++ b/shared/package-files/1f/1f59a95f609804c5eab38ac88282aaed1af4aa19acf7d2c3368da9c5d44e3447/bincount_compositeexplicitautograd_dispatch.h @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API at::Tensor & bincount_out(at::Tensor & out, const at::Tensor & self, const c10::optional & weights={}, int64_t minlength=0); +TORCH_API at::Tensor & bincount_outf(const at::Tensor & self, const c10::optional & weights, int64_t minlength, at::Tensor & out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/1f/1f5a6512789fd760f107664a07c1ff9a40b95b15eb3c7a5e1516d32d2c594142/_random.pyx b/shared/package-files/1f/1f5a6512789fd760f107664a07c1ff9a40b95b15eb3c7a5e1516d32d2c594142/_random.pyx new file mode 100644 index 0000000000000000000000000000000000000000..f0e649e60fe7c83bff5b5c6d1419bc142feaed1c --- /dev/null +++ b/shared/package-files/1f/1f5a6512789fd760f107664a07c1ff9a40b95b15eb3c7a5e1516d32d2c594142/_random.pyx @@ -0,0 +1,355 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + +""" +Random utility function +======================= +This module complements missing features of ``numpy.random``. + +The module contains: + * Several algorithms to sample integers without replacement. + * Fast rand_r alternative based on xor shifts +""" +import numpy as np +from . import check_random_state + +from ._typedefs cimport intp_t + + +cdef uint32_t DEFAULT_SEED = 1 + + +# Compatibility type to always accept the default int type used by NumPy, both +# before and after NumPy 2. On Windows, `long` does not always match `inp_t`. +# See the comments in the `sample_without_replacement` Python function for more +# details. +ctypedef fused default_int: + intp_t + long + + +cpdef _sample_without_replacement_check_input(default_int n_population, + default_int n_samples): + """ Check that input are consistent for sample_without_replacement""" + if n_population < 0: + raise ValueError('n_population should be greater than 0, got %s.' + % n_population) + + if n_samples > n_population: + raise ValueError('n_population should be greater or equal than ' + 'n_samples, got n_samples > n_population (%s > %s)' + % (n_samples, n_population)) + + +cpdef _sample_without_replacement_with_tracking_selection( + default_int n_population, + default_int n_samples, + random_state=None): + r"""Sample integers without replacement. + + Select n_samples integers from the set [0, n_population) without + replacement. + + Time complexity: + - Worst-case: unbounded + - Average-case: + O(O(np.random.randint) * \sum_{i=1}^n_samples 1 / + (1 - i / n_population))) + <= O(O(np.random.randint) * + n_population * ln((n_population - 2) + /(n_population - 1 - n_samples))) + <= O(O(np.random.randint) * + n_population * 1 / (1 - n_samples / n_population)) + + Space complexity of O(n_samples) in a python set. + + + Parameters + ---------- + n_population : int + The size of the set to sample from. + + n_samples : int + The number of integer to sample. + + random_state : int, RandomState instance or None, default=None + If int, random_state is the seed used by the random number generator; + If RandomState instance, random_state is the random number generator; + If None, the random number generator is the RandomState instance used + by `np.random`. + + Returns + ------- + out : ndarray of shape (n_samples,) + The sampled subsets of integer. + """ + _sample_without_replacement_check_input(n_population, n_samples) + + cdef default_int i + cdef default_int j + cdef default_int[::1] out = np.empty((n_samples, ), dtype=int) + + rng = check_random_state(random_state) + rng_randint = rng.randint + + # The following line of code are heavily inspired from python core, + # more precisely of random.sample. + cdef set selected = set() + + for i in range(n_samples): + j = rng_randint(n_population) + while j in selected: + j = rng_randint(n_population) + selected.add(j) + out[i] = j + + return np.asarray(out) + + +cpdef _sample_without_replacement_with_pool(default_int n_population, + default_int n_samples, + random_state=None): + """Sample integers without replacement. + + Select n_samples integers from the set [0, n_population) without + replacement. + + Time complexity: O(n_population + O(np.random.randint) * n_samples) + + Space complexity of O(n_population + n_samples). + + + Parameters + ---------- + n_population : int + The size of the set to sample from. + + n_samples : int + The number of integer to sample. + + random_state : int, RandomState instance or None, default=None + If int, random_state is the seed used by the random number generator; + If RandomState instance, random_state is the random number generator; + If None, the random number generator is the RandomState instance used + by `np.random`. + + Returns + ------- + out : ndarray of shape (n_samples,) + The sampled subsets of integer. + """ + _sample_without_replacement_check_input(n_population, n_samples) + + cdef default_int i + cdef default_int j + cdef default_int[::1] out = np.empty((n_samples,), dtype=int) + cdef default_int[::1] pool = np.empty((n_population,), dtype=int) + + rng = check_random_state(random_state) + rng_randint = rng.randint + + # Initialize the pool + for i in range(n_population): + pool[i] = i + + # The following line of code are heavily inspired from python core, + # more precisely of random.sample. + for i in range(n_samples): + j = rng_randint(n_population - i) # invariant: non-selected at [0,n-i) + out[i] = pool[j] + pool[j] = pool[n_population - i - 1] # move non-selected item into vacancy + + return np.asarray(out) + + +cpdef _sample_without_replacement_with_reservoir_sampling( + default_int n_population, + default_int n_samples, + random_state=None +): + """Sample integers without replacement. + + Select n_samples integers from the set [0, n_population) without + replacement. + + Time complexity of + O((n_population - n_samples) * O(np.random.randint) + n_samples) + Space complexity of O(n_samples) + + + Parameters + ---------- + n_population : int + The size of the set to sample from. + + n_samples : int + The number of integer to sample. + + random_state : int, RandomState instance or None, default=None + If int, random_state is the seed used by the random number generator; + If RandomState instance, random_state is the random number generator; + If None, the random number generator is the RandomState instance used + by `np.random`. + + Returns + ------- + out : ndarray of shape (n_samples,) + The sampled subsets of integer. The order of the items is not + necessarily random. Use a random permutation of the array if the order + of the items has to be randomized. + """ + _sample_without_replacement_check_input(n_population, n_samples) + + cdef default_int i + cdef default_int j + cdef default_int[::1] out = np.empty((n_samples, ), dtype=int) + + rng = check_random_state(random_state) + rng_randint = rng.randint + + # This cython implementation is based on the one of Robert Kern: + # http://mail.scipy.org/pipermail/numpy-discussion/2010-December/ + # 054289.html + # + for i in range(n_samples): + out[i] = i + + for i from n_samples <= i < n_population: + j = rng_randint(0, i + 1) + if j < n_samples: + out[j] = i + + return np.asarray(out) + + +cdef _sample_without_replacement(default_int n_population, + default_int n_samples, + method="auto", + random_state=None): + """Sample integers without replacement. + + Private function for the implementation, see sample_without_replacement + documentation for more details. + """ + _sample_without_replacement_check_input(n_population, n_samples) + + all_methods = ("auto", "tracking_selection", "reservoir_sampling", "pool") + + ratio = n_samples / n_population if n_population != 0.0 else 1.0 + + # Check ratio and use permutation unless ratio < 0.01 or ratio > 0.99 + if method == "auto" and ratio > 0.01 and ratio < 0.99: + rng = check_random_state(random_state) + return rng.permutation(n_population)[:n_samples] + + if method == "auto" or method == "tracking_selection": + # TODO the pool based method can also be used. + # however, it requires special benchmark to take into account + # the memory requirement of the array vs the set. + + # The value 0.2 has been determined through benchmarking. + if ratio < 0.2: + return _sample_without_replacement_with_tracking_selection( + n_population, n_samples, random_state) + else: + return _sample_without_replacement_with_reservoir_sampling( + n_population, n_samples, random_state) + + elif method == "reservoir_sampling": + return _sample_without_replacement_with_reservoir_sampling( + n_population, n_samples, random_state) + + elif method == "pool": + return _sample_without_replacement_with_pool(n_population, n_samples, + random_state) + else: + raise ValueError('Expected a method name in %s, got %s. ' + % (all_methods, method)) + + +def sample_without_replacement( + object n_population, object n_samples, method="auto", random_state=None): + """Sample integers without replacement. + + Select n_samples integers from the set [0, n_population) without + replacement. + + + Parameters + ---------- + n_population : int + The size of the set to sample from. + + n_samples : int + The number of integer to sample. + + random_state : int, RandomState instance or None, default=None + If int, random_state is the seed used by the random number generator; + If RandomState instance, random_state is the random number generator; + If None, the random number generator is the RandomState instance used + by `np.random`. + + method : {"auto", "tracking_selection", "reservoir_sampling", "pool"}, \ + default='auto' + If method == "auto", the ratio of n_samples / n_population is used + to determine which algorithm to use: + If ratio is between 0 and 0.01, tracking selection is used. + If ratio is between 0.01 and 0.99, numpy.random.permutation is used. + If ratio is greater than 0.99, reservoir sampling is used. + The order of the selected integers is undefined. If a random order is + desired, the selected subset should be shuffled. + + If method =="tracking_selection", a set based implementation is used + which is suitable for `n_samples` <<< `n_population`. + + If method == "reservoir_sampling", a reservoir sampling algorithm is + used which is suitable for high memory constraint or when + O(`n_samples`) ~ O(`n_population`). + The order of the selected integers is undefined. If a random order is + desired, the selected subset should be shuffled. + + If method == "pool", a pool based algorithm is particularly fast, even + faster than the tracking selection method. However, a vector containing + the entire population has to be initialized. + If n_samples ~ n_population, the reservoir sampling method is faster. + + Returns + ------- + out : ndarray of shape (n_samples,) + The sampled subsets of integer. The subset of selected integer might + not be randomized, see the method argument. + + Examples + -------- + >>> from sklearn.utils.random import sample_without_replacement + >>> sample_without_replacement(10, 5, random_state=42) + array([8, 1, 5, 0, 7]) + """ + cdef: + intp_t n_pop_intp, n_samples_intp + long n_pop_long, n_samples_long + + # On most platforms `np.int_ is np.intp`. However, before NumPy 2 the + # default integer `np.int_` was a long which is 32bit on 64bit windows + # while `intp` is 64bit on 64bit platforms and 32bit on 32bit ones. + if np.int_ is np.intp: + # Branch always taken on NumPy >=2 (or when not on 64bit windows). + # Cython has different rules for conversion of values to integers. + # For NumPy <1.26.2 AND Cython 3, this first branch requires `int()` + # called explicitly to allow e.g. floats. + n_pop_intp = int(n_population) + n_samples_intp = int(n_samples) + return _sample_without_replacement( + n_pop_intp, n_samples_intp, method, random_state) + else: + # Branch taken on 64bit windows with Numpy<2.0 where `long` is 32bit + n_pop_long = n_population + n_samples_long = n_samples + return _sample_without_replacement( + n_pop_long, n_samples_long, method, random_state) + + +def _our_rand_r_py(seed): + """Python utils to test the our_rand_r function""" + cdef uint32_t my_seed = seed + return our_rand_r(&my_seed) diff --git a/shared/package-files/1f/1f5b81f8d9bec88c2ba738c6a08bba4abc6dc4c6fbb70c3c7c303080eb214cc1/_convert_indices_from_coo_to_csr_native.h b/shared/package-files/1f/1f5b81f8d9bec88c2ba738c6a08bba4abc6dc4c6fbb70c3c7c303080eb214cc1/_convert_indices_from_coo_to_csr_native.h new file mode 100644 index 0000000000000000000000000000000000000000..ecae3648903a770a6ee26d60dd0d46cbf9ff8291 --- /dev/null +++ b/shared/package-files/1f/1f5b81f8d9bec88c2ba738c6a08bba4abc6dc4c6fbb70c3c7c303080eb214cc1/_convert_indices_from_coo_to_csr_native.h @@ -0,0 +1,26 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace native { +struct TORCH_API structured__convert_indices_from_coo_to_csr_structured_cpu : public at::meta::structured__convert_indices_from_coo_to_csr { +void impl(const at::Tensor & self, int64_t size, bool out_int32, const at::Tensor & out); +}; +struct TORCH_API structured__convert_indices_from_coo_to_csr_structured_cuda : public at::meta::structured__convert_indices_from_coo_to_csr { +void impl(const at::Tensor & self, int64_t size, bool out_int32, const at::Tensor & out); +}; +} // namespace native +} // namespace at diff --git a/shared/package-files/1f/1f666c36d96b5c0a28a42b6200b4cce5a74bde72a327d547e367b2daae2a6abc/nbinom_resids.csv b/shared/package-files/1f/1f666c36d96b5c0a28a42b6200b4cce5a74bde72a327d547e367b2daae2a6abc/nbinom_resids.csv new file mode 100644 index 0000000000000000000000000000000000000000..0c7c54a73429d1aff3a47e310be1a7609b3980fb --- /dev/null +++ b/shared/package-files/1f/1f666c36d96b5c0a28a42b6200b4cce5a74bde72a327d547e367b2daae2a6abc/nbinom_resids.csv @@ -0,0 +1,20 @@ +-.5049508,-.6297218,-83.54991,-1.306285,-6.620286 +-.2341522,-.2554235,-216.8307,-.758866,-7.183702 +1.024237,.7987758,483.7363,2.503515,22.51353 +-.2850617,-.3177966,-70411.51,-2.379918,-141.7456 +.2099025,.1967877,2247.514,.9519455,21.77242 +-.4034835,-.4757415,-19563.36,-2.635026,-88.94614 +-.1644134,-.1744011,-17331.03,-1.162355,-53.42135 +-.4296077,-.5134667,-5300.37,-2.244962,-47.82603 +.323713,.2941846,4110.794,1.486844,36.55984 +.1503672,.1434294,7285.321,.8855429,33.1355 +.4212886,.373428,1373.157,1.521332,24.15702 +.4506587,.3965867,1701.469,1.661779,27.80326 +.2435375,.226174,3184.023,1.136562,27.90734 +1.051829,.8162054,6001.352,3.890797,79.71313 +-.5544503,-.712749,-2094.852,-2.454965,-34.21899 +-.6057506,-.8064111,-274.7382,-1.907744,-13.05105 +-.3412157,-.3902446,-631.138,-1.270229,-14.76001 +.2218985,.2073287,691.1358,.8168764,12.43929 +.2455925,.2266392,.1992506,.2579483,.2747237 +-.7589526,-1.153008,-256.739,-2.407166,-14.14742 diff --git a/shared/package-files/1f/1f6a89978659a99e1b23e13d3426eed6815fb68d04745c424ca4ee80c3c74478/matfuncs.py b/shared/package-files/1f/1f6a89978659a99e1b23e13d3426eed6815fb68d04745c424ca4ee80c3c74478/matfuncs.py new file mode 100644 index 0000000000000000000000000000000000000000..8ed877ff1aa6f5a5466ce94729b9225dcce37b36 --- /dev/null +++ b/shared/package-files/1f/1f6a89978659a99e1b23e13d3426eed6815fb68d04745c424ca4ee80c3c74478/matfuncs.py @@ -0,0 +1,18 @@ +# This file is not meant for public use and will be removed in SciPy v2.0.0. +# Use the `scipy.sparse.linalg` namespace for importing the functions +# included below. + +from scipy._lib.deprecation import _sub_module_deprecation + + +__all__ = ["expm", "inv", "spsolve", "LinearOperator"] # noqa: F822 + + +def __dir__(): + return __all__ + + +def __getattr__(name): + return _sub_module_deprecation(sub_package="sparse.linalg", module="matfuncs", + private_modules=["_matfuncs"], all=__all__, + attribute=name) diff --git a/shared/package-files/1f/1f6b93fa6477edbf10cfa2880c369f2c16fd53712fcd5de308ecbca5f4237663/dense.py b/shared/package-files/1f/1f6b93fa6477edbf10cfa2880c369f2c16fd53712fcd5de308ecbca5f4237663/dense.py new file mode 100644 index 0000000000000000000000000000000000000000..f57879698eef8a8aa4452465949293c58f1bae18 --- /dev/null +++ b/shared/package-files/1f/1f6b93fa6477edbf10cfa2880c369f2c16fd53712fcd5de308ecbca5f4237663/dense.py @@ -0,0 +1,236 @@ +"""Floyd-Warshall algorithm for shortest paths. +""" +import networkx as nx + +__all__ = [ + "floyd_warshall", + "floyd_warshall_predecessor_and_distance", + "reconstruct_path", + "floyd_warshall_numpy", +] + + +@nx._dispatch +def floyd_warshall_numpy(G, nodelist=None, weight="weight"): + """Find all-pairs shortest path lengths using Floyd's algorithm. + + This algorithm for finding shortest paths takes advantage of + matrix representations of a graph and works well for dense + graphs where all-pairs shortest path lengths are desired. + The results are returned as a NumPy array, distance[i, j], + where i and j are the indexes of two nodes in nodelist. + The entry distance[i, j] is the distance along a shortest + path from i to j. If no path exists the distance is Inf. + + Parameters + ---------- + G : NetworkX graph + + nodelist : list, optional (default=G.nodes) + The rows and columns are ordered by the nodes in nodelist. + If nodelist is None then the ordering is produced by G.nodes. + Nodelist should include all nodes in G. + + weight: string, optional (default='weight') + Edge data key corresponding to the edge weight. + + Returns + ------- + distance : 2D numpy.ndarray + A numpy array of shortest path distances between nodes. + If there is no path between two nodes the value is Inf. + + Notes + ----- + Floyd's algorithm is appropriate for finding shortest paths in + dense graphs or graphs with negative weights when Dijkstra's + algorithm fails. This algorithm can still fail if there are negative + cycles. It has running time $O(n^3)$ with running space of $O(n^2)$. + + Raises + ------ + NetworkXError + If nodelist is not a list of the nodes in G. + """ + import numpy as np + + if nodelist is not None: + if not (len(nodelist) == len(G) == len(set(nodelist))): + raise nx.NetworkXError( + "nodelist must contain every node in G with no repeats." + "If you wanted a subgraph of G use G.subgraph(nodelist)" + ) + + # To handle cases when an edge has weight=0, we must make sure that + # nonedges are not given the value 0 as well. + A = nx.to_numpy_array( + G, nodelist, multigraph_weight=min, weight=weight, nonedge=np.inf + ) + n, m = A.shape + np.fill_diagonal(A, 0) # diagonal elements should be zero + for i in range(n): + # The second term has the same shape as A due to broadcasting + A = np.minimum(A, A[i, :][np.newaxis, :] + A[:, i][:, np.newaxis]) + return A + + +@nx._dispatch +def floyd_warshall_predecessor_and_distance(G, weight="weight"): + """Find all-pairs shortest path lengths using Floyd's algorithm. + + Parameters + ---------- + G : NetworkX graph + + weight: string, optional (default= 'weight') + Edge data key corresponding to the edge weight. + + Returns + ------- + predecessor,distance : dictionaries + Dictionaries, keyed by source and target, of predecessors and distances + in the shortest path. + + Examples + -------- + >>> G = nx.DiGraph() + >>> G.add_weighted_edges_from( + ... [ + ... ("s", "u", 10), + ... ("s", "x", 5), + ... ("u", "v", 1), + ... ("u", "x", 2), + ... ("v", "y", 1), + ... ("x", "u", 3), + ... ("x", "v", 5), + ... ("x", "y", 2), + ... ("y", "s", 7), + ... ("y", "v", 6), + ... ] + ... ) + >>> predecessors, _ = nx.floyd_warshall_predecessor_and_distance(G) + >>> print(nx.reconstruct_path("s", "v", predecessors)) + ['s', 'x', 'u', 'v'] + + Notes + ----- + Floyd's algorithm is appropriate for finding shortest paths + in dense graphs or graphs with negative weights when Dijkstra's algorithm + fails. This algorithm can still fail if there are negative cycles. + It has running time $O(n^3)$ with running space of $O(n^2)$. + + See Also + -------- + floyd_warshall + floyd_warshall_numpy + all_pairs_shortest_path + all_pairs_shortest_path_length + """ + from collections import defaultdict + + # dictionary-of-dictionaries representation for dist and pred + # use some defaultdict magick here + # for dist the default is the floating point inf value + dist = defaultdict(lambda: defaultdict(lambda: float("inf"))) + for u in G: + dist[u][u] = 0 + pred = defaultdict(dict) + # initialize path distance dictionary to be the adjacency matrix + # also set the distance to self to 0 (zero diagonal) + undirected = not G.is_directed() + for u, v, d in G.edges(data=True): + e_weight = d.get(weight, 1.0) + dist[u][v] = min(e_weight, dist[u][v]) + pred[u][v] = u + if undirected: + dist[v][u] = min(e_weight, dist[v][u]) + pred[v][u] = v + for w in G: + dist_w = dist[w] # save recomputation + for u in G: + dist_u = dist[u] # save recomputation + for v in G: + d = dist_u[w] + dist_w[v] + if dist_u[v] > d: + dist_u[v] = d + pred[u][v] = pred[w][v] + return dict(pred), dict(dist) + + +def reconstruct_path(source, target, predecessors): + """Reconstruct a path from source to target using the predecessors + dict as returned by floyd_warshall_predecessor_and_distance + + Parameters + ---------- + source : node + Starting node for path + + target : node + Ending node for path + + predecessors: dictionary + Dictionary, keyed by source and target, of predecessors in the + shortest path, as returned by floyd_warshall_predecessor_and_distance + + Returns + ------- + path : list + A list of nodes containing the shortest path from source to target + + If source and target are the same, an empty list is returned + + Notes + ----- + This function is meant to give more applicability to the + floyd_warshall_predecessor_and_distance function + + See Also + -------- + floyd_warshall_predecessor_and_distance + """ + if source == target: + return [] + prev = predecessors[source] + curr = prev[target] + path = [target, curr] + while curr != source: + curr = prev[curr] + path.append(curr) + return list(reversed(path)) + + +@nx._dispatch +def floyd_warshall(G, weight="weight"): + """Find all-pairs shortest path lengths using Floyd's algorithm. + + Parameters + ---------- + G : NetworkX graph + + weight: string, optional (default= 'weight') + Edge data key corresponding to the edge weight. + + + Returns + ------- + distance : dict + A dictionary, keyed by source and target, of shortest paths distances + between nodes. + + Notes + ----- + Floyd's algorithm is appropriate for finding shortest paths + in dense graphs or graphs with negative weights when Dijkstra's algorithm + fails. This algorithm can still fail if there are negative cycles. + It has running time $O(n^3)$ with running space of $O(n^2)$. + + See Also + -------- + floyd_warshall_predecessor_and_distance + floyd_warshall_numpy + all_pairs_shortest_path + all_pairs_shortest_path_length + """ + # could make this its own function to reduce memory costs + return floyd_warshall_predecessor_and_distance(G, weight=weight)[1] diff --git a/shared/package-files/1f/1f6dfbca13ca6ec97e0a2bf847a12dfcb5f9b815012eb0ea4c3bc14f524c79fe/middleware.pyi b/shared/package-files/1f/1f6dfbca13ca6ec97e0a2bf847a12dfcb5f9b815012eb0ea4c3bc14f524c79fe/middleware.pyi new file mode 100644 index 0000000000000000000000000000000000000000..427f8d0a7ca9bf205bf4ea0f97b6a389f69ace3c --- /dev/null +++ b/shared/package-files/1f/1f6dfbca13ca6ec97e0a2bf847a12dfcb5f9b815012eb0ea4c3bc14f524c79fe/middleware.pyi @@ -0,0 +1,7 @@ +from django.http.request import HttpRequest +from django.http.response import HttpResponse +from django.utils.deprecation import MiddlewareMixin + +class MessageMiddleware(MiddlewareMixin): + def process_request(self, request: HttpRequest) -> None: ... + def process_response(self, request: HttpRequest, response: HttpResponse) -> HttpResponse: ... diff --git a/shared/package-files/1f/1f6e42785e06337150ab407abb7710a7515918088695b38e86016a9f84480059/_svm_cython_blas_helpers.h b/shared/package-files/1f/1f6e42785e06337150ab407abb7710a7515918088695b38e86016a9f84480059/_svm_cython_blas_helpers.h new file mode 100644 index 0000000000000000000000000000000000000000..2548c7844d267ec631102ae1f44e48cab2b0a729 --- /dev/null +++ b/shared/package-files/1f/1f6e42785e06337150ab407abb7710a7515918088695b38e86016a9f84480059/_svm_cython_blas_helpers.h @@ -0,0 +1,9 @@ +#ifndef _SVM_CYTHON_BLAS_HELPERS_H +#define _SVM_CYTHON_BLAS_HELPERS_H + +typedef double (*dot_func)(int, const double*, int, const double*, int); +typedef struct BlasFunctions{ + dot_func dot; +} BlasFunctions; + +#endif diff --git a/shared/package-files/1f/1f726d57e3b9fd25ed45809804e4a07ada87bb4ed41141d1674567b77dc78e43/hp2 b/shared/package-files/1f/1f726d57e3b9fd25ed45809804e4a07ada87bb4ed41141d1674567b77dc78e43/hp2 new file mode 100644 index 0000000000000000000000000000000000000000..6f8c911b04a3bf74a875b63e073d9f6887543ed0 Binary files /dev/null and b/shared/package-files/1f/1f726d57e3b9fd25ed45809804e4a07ada87bb4ed41141d1674567b77dc78e43/hp2 differ diff --git a/shared/package-files/1f/1f726d57e3b9fd25ed45809804e4a07ada87bb4ed41141d1674567b77dc78e43/hpex2 b/shared/package-files/1f/1f726d57e3b9fd25ed45809804e4a07ada87bb4ed41141d1674567b77dc78e43/hpex2 new file mode 100644 index 0000000000000000000000000000000000000000..6f8c911b04a3bf74a875b63e073d9f6887543ed0 Binary files /dev/null and b/shared/package-files/1f/1f726d57e3b9fd25ed45809804e4a07ada87bb4ed41141d1674567b77dc78e43/hpex2 differ diff --git a/shared/package-files/1f/1f771e18fa4065f1f6fa66eefae63b300ea3b1e93e1c45182c1bd878b4ce3c40/environment.yml b/shared/package-files/1f/1f771e18fa4065f1f6fa66eefae63b300ea3b1e93e1c45182c1bd878b4ce3c40/environment.yml new file mode 100644 index 0000000000000000000000000000000000000000..43c481a91515a8a7024c80dc208a17be6ede16d3 --- /dev/null +++ b/shared/package-files/1f/1f771e18fa4065f1f6fa66eefae63b300ea3b1e93e1c45182c1bd878b4ce3c40/environment.yml @@ -0,0 +1,3 @@ +name: to-save +dependencies: + - python diff --git a/shared/package-files/1f/1f795d89c23fae196fd2bdd5169556b542fa5f7d16cb9f7abfbfd81f3dac11d8/langturkishmodel.py b/shared/package-files/1f/1f795d89c23fae196fd2bdd5169556b542fa5f7d16cb9f7abfbfd81f3dac11d8/langturkishmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..8ba93224de37cd47149c80fb7a41eab3d06c7a21 --- /dev/null +++ b/shared/package-files/1f/1f795d89c23fae196fd2bdd5169556b542fa5f7d16cb9f7abfbfd81f3dac11d8/langturkishmodel.py @@ -0,0 +1,4383 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from chardet.sbcharsetprober import SingleByteCharSetModel + + +# 3: Positive +# 2: Likely +# 1: Unlikely +# 0: Negative + +TURKISH_LANG_MODEL = { + 23: { # 'A' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 0, # 'K' + 49: 0, # 'L' + 20: 0, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 0, # 'b' + 28: 0, # 'c' + 12: 2, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 1, # 'g' + 25: 1, # 'h' + 3: 1, # 'i' + 24: 0, # 'j' + 10: 2, # 'k' + 5: 1, # 'l' + 13: 1, # 'm' + 4: 1, # 'n' + 15: 0, # 'o' + 26: 0, # 'p' + 7: 1, # 'r' + 8: 1, # 's' + 9: 1, # 't' + 14: 1, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 3, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 1, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 0, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 0, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 37: { # 'B' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 2, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 2, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 1, # 'K' + 49: 0, # 'L' + 20: 0, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 1, # 'P' + 44: 0, # 'R' + 35: 1, # 'S' + 31: 0, # 'T' + 51: 0, # 'U' + 38: 1, # 'V' + 62: 0, # 'W' + 43: 1, # 'Y' + 56: 0, # 'Z' + 1: 2, # 'a' + 21: 0, # 'b' + 28: 2, # 'c' + 12: 0, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 0, # 'i' + 24: 0, # 'j' + 10: 0, # 'k' + 5: 0, # 'l' + 13: 1, # 'm' + 4: 1, # 'n' + 15: 0, # 'o' + 26: 0, # 'p' + 7: 0, # 'r' + 8: 0, # 's' + 9: 0, # 't' + 14: 2, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 0, # 'y' + 22: 1, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 1, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 1, # 'ö' + 17: 0, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 0, # 'ı' + 40: 1, # 'Ş' + 19: 1, # 'ş' + }, + 47: { # 'C' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 1, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 0, # 'K' + 49: 1, # 'L' + 20: 0, # 'M' + 46: 1, # 'N' + 42: 0, # 'O' + 48: 1, # 'P' + 44: 1, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 0, # 'U' + 38: 1, # 'V' + 62: 0, # 'W' + 43: 1, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 0, # 'b' + 28: 2, # 'c' + 12: 0, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 0, # 'i' + 24: 2, # 'j' + 10: 1, # 'k' + 5: 2, # 'l' + 13: 2, # 'm' + 4: 2, # 'n' + 15: 1, # 'o' + 26: 0, # 'p' + 7: 2, # 'r' + 8: 0, # 's' + 9: 0, # 't' + 14: 3, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 0, # 'y' + 22: 2, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 1, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 1, # 'ç' + 61: 0, # 'î' + 34: 1, # 'ö' + 17: 0, # 'ü' + 30: 0, # 'ğ' + 41: 1, # 'İ' + 6: 3, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 39: { # 'D' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 1, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 1, # 'K' + 49: 0, # 'L' + 20: 0, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 1, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 2, # 'a' + 21: 0, # 'b' + 28: 2, # 'c' + 12: 0, # 'd' + 2: 2, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 0, # 'i' + 24: 0, # 'j' + 10: 0, # 'k' + 5: 1, # 'l' + 13: 3, # 'm' + 4: 0, # 'n' + 15: 1, # 'o' + 26: 0, # 'p' + 7: 0, # 'r' + 8: 0, # 's' + 9: 0, # 't' + 14: 1, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 0, # 'y' + 22: 1, # 'z' + 63: 0, # '·' + 54: 1, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 1, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 0, # 'ü' + 30: 1, # 'ğ' + 41: 0, # 'İ' + 6: 1, # 'ı' + 40: 1, # 'Ş' + 19: 0, # 'ş' + }, + 29: { # 'E' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 1, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 3, # 'K' + 49: 0, # 'L' + 20: 1, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 0, # 'b' + 28: 0, # 'c' + 12: 2, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 1, # 'g' + 25: 0, # 'h' + 3: 1, # 'i' + 24: 1, # 'j' + 10: 0, # 'k' + 5: 3, # 'l' + 13: 3, # 'm' + 4: 3, # 'n' + 15: 0, # 'o' + 26: 0, # 'p' + 7: 0, # 'r' + 8: 1, # 's' + 9: 1, # 't' + 14: 1, # 'u' + 32: 1, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 2, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 0, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 3, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 52: { # 'F' + 23: 0, # 'A' + 37: 1, # 'B' + 47: 1, # 'C' + 39: 1, # 'D' + 29: 1, # 'E' + 52: 2, # 'F' + 36: 0, # 'G' + 45: 2, # 'H' + 53: 1, # 'I' + 60: 0, # 'J' + 16: 0, # 'K' + 49: 0, # 'L' + 20: 1, # 'M' + 46: 1, # 'N' + 42: 1, # 'O' + 48: 2, # 'P' + 44: 1, # 'R' + 35: 1, # 'S' + 31: 1, # 'T' + 51: 1, # 'U' + 38: 1, # 'V' + 62: 0, # 'W' + 43: 2, # 'Y' + 56: 0, # 'Z' + 1: 0, # 'a' + 21: 1, # 'b' + 28: 1, # 'c' + 12: 1, # 'd' + 2: 0, # 'e' + 18: 1, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 2, # 'i' + 24: 1, # 'j' + 10: 0, # 'k' + 5: 0, # 'l' + 13: 1, # 'm' + 4: 2, # 'n' + 15: 1, # 'o' + 26: 0, # 'p' + 7: 2, # 'r' + 8: 1, # 's' + 9: 1, # 't' + 14: 1, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 1, # 'y' + 22: 1, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 1, # 'Ö' + 55: 2, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 2, # 'ö' + 17: 0, # 'ü' + 30: 1, # 'ğ' + 41: 1, # 'İ' + 6: 2, # 'ı' + 40: 0, # 'Ş' + 19: 2, # 'ş' + }, + 36: { # 'G' + 23: 1, # 'A' + 37: 0, # 'B' + 47: 1, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 1, # 'F' + 36: 2, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 2, # 'K' + 49: 0, # 'L' + 20: 0, # 'M' + 46: 2, # 'N' + 42: 1, # 'O' + 48: 1, # 'P' + 44: 1, # 'R' + 35: 1, # 'S' + 31: 0, # 'T' + 51: 1, # 'U' + 38: 2, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 0, # 'b' + 28: 1, # 'c' + 12: 0, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 0, # 'i' + 24: 1, # 'j' + 10: 1, # 'k' + 5: 0, # 'l' + 13: 3, # 'm' + 4: 2, # 'n' + 15: 0, # 'o' + 26: 1, # 'p' + 7: 0, # 'r' + 8: 1, # 's' + 9: 1, # 't' + 14: 3, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 1, # 'x' + 11: 0, # 'y' + 22: 2, # 'z' + 63: 0, # '·' + 54: 1, # 'Ç' + 50: 2, # 'Ö' + 55: 0, # 'Ü' + 59: 1, # 'â' + 33: 2, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 0, # 'ü' + 30: 1, # 'ğ' + 41: 1, # 'İ' + 6: 2, # 'ı' + 40: 2, # 'Ş' + 19: 1, # 'ş' + }, + 45: { # 'H' + 23: 0, # 'A' + 37: 1, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 2, # 'F' + 36: 2, # 'G' + 45: 1, # 'H' + 53: 1, # 'I' + 60: 0, # 'J' + 16: 2, # 'K' + 49: 1, # 'L' + 20: 0, # 'M' + 46: 1, # 'N' + 42: 1, # 'O' + 48: 1, # 'P' + 44: 0, # 'R' + 35: 2, # 'S' + 31: 0, # 'T' + 51: 1, # 'U' + 38: 2, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 0, # 'b' + 28: 2, # 'c' + 12: 0, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 2, # 'i' + 24: 0, # 'j' + 10: 1, # 'k' + 5: 0, # 'l' + 13: 2, # 'm' + 4: 0, # 'n' + 15: 1, # 'o' + 26: 1, # 'p' + 7: 1, # 'r' + 8: 0, # 's' + 9: 0, # 't' + 14: 3, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 0, # 'y' + 22: 2, # 'z' + 63: 0, # '·' + 54: 1, # 'Ç' + 50: 1, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 1, # 'ç' + 61: 0, # 'î' + 34: 1, # 'ö' + 17: 0, # 'ü' + 30: 2, # 'ğ' + 41: 1, # 'İ' + 6: 0, # 'ı' + 40: 2, # 'Ş' + 19: 1, # 'ş' + }, + 53: { # 'I' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 1, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 2, # 'K' + 49: 0, # 'L' + 20: 0, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 1, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 2, # 'a' + 21: 0, # 'b' + 28: 2, # 'c' + 12: 0, # 'd' + 2: 2, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 0, # 'i' + 24: 0, # 'j' + 10: 0, # 'k' + 5: 2, # 'l' + 13: 2, # 'm' + 4: 0, # 'n' + 15: 0, # 'o' + 26: 0, # 'p' + 7: 0, # 'r' + 8: 0, # 's' + 9: 0, # 't' + 14: 2, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 0, # 'y' + 22: 2, # 'z' + 63: 0, # '·' + 54: 1, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 2, # 'ç' + 61: 0, # 'î' + 34: 1, # 'ö' + 17: 0, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 0, # 'ı' + 40: 1, # 'Ş' + 19: 1, # 'ş' + }, + 60: { # 'J' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 0, # 'K' + 49: 0, # 'L' + 20: 1, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 0, # 'a' + 21: 1, # 'b' + 28: 0, # 'c' + 12: 1, # 'd' + 2: 0, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 1, # 'i' + 24: 0, # 'j' + 10: 0, # 'k' + 5: 0, # 'l' + 13: 0, # 'm' + 4: 1, # 'n' + 15: 0, # 'o' + 26: 0, # 'p' + 7: 0, # 'r' + 8: 1, # 's' + 9: 0, # 't' + 14: 0, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 0, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 0, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 0, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 16: { # 'K' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 3, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 0, # 'K' + 49: 0, # 'L' + 20: 2, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 2, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 2, # 'a' + 21: 3, # 'b' + 28: 0, # 'c' + 12: 3, # 'd' + 2: 1, # 'e' + 18: 3, # 'f' + 27: 3, # 'g' + 25: 3, # 'h' + 3: 3, # 'i' + 24: 2, # 'j' + 10: 3, # 'k' + 5: 0, # 'l' + 13: 0, # 'm' + 4: 3, # 'n' + 15: 0, # 'o' + 26: 1, # 'p' + 7: 3, # 'r' + 8: 3, # 's' + 9: 3, # 't' + 14: 0, # 'u' + 32: 3, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 2, # 'y' + 22: 1, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 2, # 'ü' + 30: 0, # 'ğ' + 41: 1, # 'İ' + 6: 3, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 49: { # 'L' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 2, # 'E' + 52: 0, # 'F' + 36: 1, # 'G' + 45: 1, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 0, # 'K' + 49: 0, # 'L' + 20: 1, # 'M' + 46: 0, # 'N' + 42: 2, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 1, # 'Y' + 56: 0, # 'Z' + 1: 0, # 'a' + 21: 3, # 'b' + 28: 0, # 'c' + 12: 2, # 'd' + 2: 0, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 2, # 'i' + 24: 0, # 'j' + 10: 1, # 'k' + 5: 0, # 'l' + 13: 0, # 'm' + 4: 2, # 'n' + 15: 1, # 'o' + 26: 1, # 'p' + 7: 1, # 'r' + 8: 1, # 's' + 9: 1, # 't' + 14: 0, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 2, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 2, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 1, # 'ö' + 17: 1, # 'ü' + 30: 1, # 'ğ' + 41: 0, # 'İ' + 6: 2, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 20: { # 'M' + 23: 1, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 1, # 'J' + 16: 3, # 'K' + 49: 0, # 'L' + 20: 2, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 1, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 2, # 'b' + 28: 0, # 'c' + 12: 3, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 1, # 'g' + 25: 1, # 'h' + 3: 2, # 'i' + 24: 2, # 'j' + 10: 2, # 'k' + 5: 2, # 'l' + 13: 3, # 'm' + 4: 3, # 'n' + 15: 0, # 'o' + 26: 1, # 'p' + 7: 3, # 'r' + 8: 0, # 's' + 9: 2, # 't' + 14: 3, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 2, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 3, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 0, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 3, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 46: { # 'N' + 23: 0, # 'A' + 37: 1, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 1, # 'F' + 36: 1, # 'G' + 45: 1, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 2, # 'K' + 49: 0, # 'L' + 20: 0, # 'M' + 46: 1, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 1, # 'R' + 35: 1, # 'S' + 31: 0, # 'T' + 51: 1, # 'U' + 38: 2, # 'V' + 62: 0, # 'W' + 43: 1, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 0, # 'b' + 28: 2, # 'c' + 12: 0, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 1, # 'g' + 25: 0, # 'h' + 3: 0, # 'i' + 24: 2, # 'j' + 10: 1, # 'k' + 5: 1, # 'l' + 13: 3, # 'm' + 4: 2, # 'n' + 15: 1, # 'o' + 26: 1, # 'p' + 7: 1, # 'r' + 8: 0, # 's' + 9: 0, # 't' + 14: 3, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 1, # 'x' + 11: 1, # 'y' + 22: 2, # 'z' + 63: 0, # '·' + 54: 1, # 'Ç' + 50: 1, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 1, # 'ö' + 17: 0, # 'ü' + 30: 0, # 'ğ' + 41: 1, # 'İ' + 6: 2, # 'ı' + 40: 1, # 'Ş' + 19: 1, # 'ş' + }, + 42: { # 'O' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 1, # 'F' + 36: 0, # 'G' + 45: 1, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 2, # 'K' + 49: 1, # 'L' + 20: 0, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 2, # 'P' + 44: 1, # 'R' + 35: 1, # 'S' + 31: 0, # 'T' + 51: 1, # 'U' + 38: 1, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 0, # 'b' + 28: 2, # 'c' + 12: 0, # 'd' + 2: 2, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 0, # 'i' + 24: 0, # 'j' + 10: 0, # 'k' + 5: 3, # 'l' + 13: 3, # 'm' + 4: 0, # 'n' + 15: 1, # 'o' + 26: 0, # 'p' + 7: 0, # 'r' + 8: 0, # 's' + 9: 0, # 't' + 14: 2, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 0, # 'y' + 22: 2, # 'z' + 63: 0, # '·' + 54: 2, # 'Ç' + 50: 1, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 2, # 'ç' + 61: 0, # 'î' + 34: 1, # 'ö' + 17: 0, # 'ü' + 30: 1, # 'ğ' + 41: 2, # 'İ' + 6: 1, # 'ı' + 40: 1, # 'Ş' + 19: 1, # 'ş' + }, + 48: { # 'P' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 2, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 2, # 'F' + 36: 1, # 'G' + 45: 1, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 2, # 'K' + 49: 0, # 'L' + 20: 0, # 'M' + 46: 1, # 'N' + 42: 1, # 'O' + 48: 1, # 'P' + 44: 0, # 'R' + 35: 1, # 'S' + 31: 0, # 'T' + 51: 0, # 'U' + 38: 1, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 2, # 'a' + 21: 0, # 'b' + 28: 2, # 'c' + 12: 0, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 0, # 'i' + 24: 0, # 'j' + 10: 1, # 'k' + 5: 0, # 'l' + 13: 2, # 'm' + 4: 0, # 'n' + 15: 2, # 'o' + 26: 0, # 'p' + 7: 0, # 'r' + 8: 0, # 's' + 9: 0, # 't' + 14: 2, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 2, # 'x' + 11: 0, # 'y' + 22: 2, # 'z' + 63: 0, # '·' + 54: 1, # 'Ç' + 50: 2, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 2, # 'ö' + 17: 0, # 'ü' + 30: 1, # 'ğ' + 41: 1, # 'İ' + 6: 0, # 'ı' + 40: 2, # 'Ş' + 19: 1, # 'ş' + }, + 44: { # 'R' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 1, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 1, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 3, # 'K' + 49: 0, # 'L' + 20: 0, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 1, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 1, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 1, # 'b' + 28: 1, # 'c' + 12: 0, # 'd' + 2: 2, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 0, # 'i' + 24: 0, # 'j' + 10: 1, # 'k' + 5: 2, # 'l' + 13: 2, # 'm' + 4: 0, # 'n' + 15: 1, # 'o' + 26: 0, # 'p' + 7: 0, # 'r' + 8: 0, # 's' + 9: 0, # 't' + 14: 2, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 1, # 'y' + 22: 2, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 1, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 1, # 'ç' + 61: 0, # 'î' + 34: 1, # 'ö' + 17: 1, # 'ü' + 30: 1, # 'ğ' + 41: 0, # 'İ' + 6: 2, # 'ı' + 40: 1, # 'Ş' + 19: 1, # 'ş' + }, + 35: { # 'S' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 1, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 1, # 'F' + 36: 1, # 'G' + 45: 1, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 3, # 'K' + 49: 1, # 'L' + 20: 1, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 1, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 1, # 'U' + 38: 1, # 'V' + 62: 0, # 'W' + 43: 1, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 0, # 'b' + 28: 2, # 'c' + 12: 0, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 0, # 'i' + 24: 0, # 'j' + 10: 1, # 'k' + 5: 1, # 'l' + 13: 2, # 'm' + 4: 1, # 'n' + 15: 0, # 'o' + 26: 0, # 'p' + 7: 0, # 'r' + 8: 0, # 's' + 9: 1, # 't' + 14: 2, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 0, # 'y' + 22: 1, # 'z' + 63: 0, # '·' + 54: 2, # 'Ç' + 50: 2, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 3, # 'ç' + 61: 0, # 'î' + 34: 1, # 'ö' + 17: 0, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 3, # 'ı' + 40: 2, # 'Ş' + 19: 1, # 'ş' + }, + 31: { # 'T' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 1, # 'J' + 16: 2, # 'K' + 49: 0, # 'L' + 20: 1, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 2, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 2, # 'b' + 28: 0, # 'c' + 12: 1, # 'd' + 2: 3, # 'e' + 18: 2, # 'f' + 27: 2, # 'g' + 25: 0, # 'h' + 3: 1, # 'i' + 24: 1, # 'j' + 10: 2, # 'k' + 5: 2, # 'l' + 13: 3, # 'm' + 4: 3, # 'n' + 15: 0, # 'o' + 26: 2, # 'p' + 7: 2, # 'r' + 8: 0, # 's' + 9: 2, # 't' + 14: 2, # 'u' + 32: 1, # 'v' + 57: 1, # 'w' + 58: 1, # 'x' + 11: 2, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 1, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 3, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 51: { # 'U' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 1, # 'F' + 36: 1, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 1, # 'K' + 49: 0, # 'L' + 20: 0, # 'M' + 46: 1, # 'N' + 42: 0, # 'O' + 48: 1, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 1, # 'U' + 38: 1, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 0, # 'b' + 28: 1, # 'c' + 12: 0, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 2, # 'g' + 25: 0, # 'h' + 3: 0, # 'i' + 24: 0, # 'j' + 10: 1, # 'k' + 5: 1, # 'l' + 13: 3, # 'm' + 4: 2, # 'n' + 15: 0, # 'o' + 26: 1, # 'p' + 7: 0, # 'r' + 8: 0, # 's' + 9: 0, # 't' + 14: 2, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 0, # 'y' + 22: 2, # 'z' + 63: 0, # '·' + 54: 1, # 'Ç' + 50: 1, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 0, # 'ü' + 30: 1, # 'ğ' + 41: 1, # 'İ' + 6: 2, # 'ı' + 40: 0, # 'Ş' + 19: 1, # 'ş' + }, + 38: { # 'V' + 23: 1, # 'A' + 37: 1, # 'B' + 47: 1, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 2, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 3, # 'K' + 49: 0, # 'L' + 20: 3, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 1, # 'P' + 44: 1, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 1, # 'U' + 38: 1, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 0, # 'b' + 28: 2, # 'c' + 12: 0, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 0, # 'i' + 24: 0, # 'j' + 10: 0, # 'k' + 5: 2, # 'l' + 13: 2, # 'm' + 4: 0, # 'n' + 15: 2, # 'o' + 26: 0, # 'p' + 7: 0, # 'r' + 8: 0, # 's' + 9: 1, # 't' + 14: 3, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 1, # 'y' + 22: 2, # 'z' + 63: 0, # '·' + 54: 1, # 'Ç' + 50: 1, # 'Ö' + 55: 0, # 'Ü' + 59: 1, # 'â' + 33: 2, # 'ç' + 61: 0, # 'î' + 34: 1, # 'ö' + 17: 0, # 'ü' + 30: 1, # 'ğ' + 41: 1, # 'İ' + 6: 3, # 'ı' + 40: 2, # 'Ş' + 19: 1, # 'ş' + }, + 62: { # 'W' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 0, # 'K' + 49: 0, # 'L' + 20: 0, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 0, # 'a' + 21: 0, # 'b' + 28: 0, # 'c' + 12: 0, # 'd' + 2: 0, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 0, # 'i' + 24: 0, # 'j' + 10: 0, # 'k' + 5: 0, # 'l' + 13: 0, # 'm' + 4: 0, # 'n' + 15: 0, # 'o' + 26: 0, # 'p' + 7: 0, # 'r' + 8: 0, # 's' + 9: 0, # 't' + 14: 0, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 0, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 0, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 0, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 43: { # 'Y' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 1, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 2, # 'F' + 36: 0, # 'G' + 45: 1, # 'H' + 53: 1, # 'I' + 60: 0, # 'J' + 16: 2, # 'K' + 49: 0, # 'L' + 20: 0, # 'M' + 46: 2, # 'N' + 42: 0, # 'O' + 48: 2, # 'P' + 44: 1, # 'R' + 35: 1, # 'S' + 31: 0, # 'T' + 51: 1, # 'U' + 38: 2, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 0, # 'b' + 28: 2, # 'c' + 12: 0, # 'd' + 2: 2, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 0, # 'i' + 24: 1, # 'j' + 10: 1, # 'k' + 5: 1, # 'l' + 13: 3, # 'm' + 4: 0, # 'n' + 15: 2, # 'o' + 26: 0, # 'p' + 7: 0, # 'r' + 8: 0, # 's' + 9: 0, # 't' + 14: 3, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 1, # 'x' + 11: 0, # 'y' + 22: 2, # 'z' + 63: 0, # '·' + 54: 1, # 'Ç' + 50: 2, # 'Ö' + 55: 1, # 'Ü' + 59: 1, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 1, # 'ö' + 17: 0, # 'ü' + 30: 1, # 'ğ' + 41: 1, # 'İ' + 6: 0, # 'ı' + 40: 2, # 'Ş' + 19: 1, # 'ş' + }, + 56: { # 'Z' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 0, # 'K' + 49: 0, # 'L' + 20: 0, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 2, # 'Z' + 1: 2, # 'a' + 21: 1, # 'b' + 28: 0, # 'c' + 12: 0, # 'd' + 2: 2, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 2, # 'i' + 24: 1, # 'j' + 10: 0, # 'k' + 5: 0, # 'l' + 13: 1, # 'm' + 4: 1, # 'n' + 15: 0, # 'o' + 26: 0, # 'p' + 7: 1, # 'r' + 8: 1, # 's' + 9: 0, # 't' + 14: 2, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 0, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 1, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 1, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 1: { # 'a' + 23: 3, # 'A' + 37: 0, # 'B' + 47: 1, # 'C' + 39: 0, # 'D' + 29: 3, # 'E' + 52: 0, # 'F' + 36: 1, # 'G' + 45: 1, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 0, # 'K' + 49: 0, # 'L' + 20: 3, # 'M' + 46: 1, # 'N' + 42: 0, # 'O' + 48: 1, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 3, # 'T' + 51: 0, # 'U' + 38: 1, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 2, # 'Z' + 1: 2, # 'a' + 21: 3, # 'b' + 28: 0, # 'c' + 12: 3, # 'd' + 2: 2, # 'e' + 18: 3, # 'f' + 27: 3, # 'g' + 25: 3, # 'h' + 3: 3, # 'i' + 24: 3, # 'j' + 10: 3, # 'k' + 5: 0, # 'l' + 13: 2, # 'm' + 4: 3, # 'n' + 15: 1, # 'o' + 26: 3, # 'p' + 7: 3, # 'r' + 8: 3, # 's' + 9: 3, # 't' + 14: 3, # 'u' + 32: 3, # 'v' + 57: 2, # 'w' + 58: 0, # 'x' + 11: 3, # 'y' + 22: 0, # 'z' + 63: 1, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 1, # 'ç' + 61: 1, # 'î' + 34: 1, # 'ö' + 17: 3, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 3, # 'ı' + 40: 0, # 'Ş' + 19: 1, # 'ş' + }, + 21: { # 'b' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 1, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 1, # 'J' + 16: 2, # 'K' + 49: 0, # 'L' + 20: 2, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 1, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 1, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 2, # 'b' + 28: 0, # 'c' + 12: 3, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 3, # 'g' + 25: 1, # 'h' + 3: 3, # 'i' + 24: 2, # 'j' + 10: 3, # 'k' + 5: 3, # 'l' + 13: 3, # 'm' + 4: 3, # 'n' + 15: 0, # 'o' + 26: 3, # 'p' + 7: 1, # 'r' + 8: 2, # 's' + 9: 2, # 't' + 14: 2, # 'u' + 32: 1, # 'v' + 57: 0, # 'w' + 58: 1, # 'x' + 11: 3, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 1, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 0, # 'ü' + 30: 1, # 'ğ' + 41: 0, # 'İ' + 6: 2, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 28: { # 'c' + 23: 0, # 'A' + 37: 1, # 'B' + 47: 1, # 'C' + 39: 1, # 'D' + 29: 2, # 'E' + 52: 0, # 'F' + 36: 2, # 'G' + 45: 2, # 'H' + 53: 1, # 'I' + 60: 0, # 'J' + 16: 0, # 'K' + 49: 0, # 'L' + 20: 2, # 'M' + 46: 1, # 'N' + 42: 1, # 'O' + 48: 2, # 'P' + 44: 1, # 'R' + 35: 1, # 'S' + 31: 2, # 'T' + 51: 2, # 'U' + 38: 2, # 'V' + 62: 0, # 'W' + 43: 3, # 'Y' + 56: 0, # 'Z' + 1: 1, # 'a' + 21: 1, # 'b' + 28: 2, # 'c' + 12: 2, # 'd' + 2: 1, # 'e' + 18: 1, # 'f' + 27: 2, # 'g' + 25: 2, # 'h' + 3: 3, # 'i' + 24: 1, # 'j' + 10: 3, # 'k' + 5: 0, # 'l' + 13: 2, # 'm' + 4: 3, # 'n' + 15: 2, # 'o' + 26: 2, # 'p' + 7: 3, # 'r' + 8: 3, # 's' + 9: 3, # 't' + 14: 1, # 'u' + 32: 0, # 'v' + 57: 1, # 'w' + 58: 0, # 'x' + 11: 2, # 'y' + 22: 1, # 'z' + 63: 1, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 1, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 1, # 'î' + 34: 2, # 'ö' + 17: 2, # 'ü' + 30: 2, # 'ğ' + 41: 1, # 'İ' + 6: 3, # 'ı' + 40: 0, # 'Ş' + 19: 2, # 'ş' + }, + 12: { # 'd' + 23: 1, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 2, # 'J' + 16: 3, # 'K' + 49: 0, # 'L' + 20: 3, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 1, # 'S' + 31: 1, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 2, # 'b' + 28: 1, # 'c' + 12: 3, # 'd' + 2: 3, # 'e' + 18: 1, # 'f' + 27: 3, # 'g' + 25: 3, # 'h' + 3: 2, # 'i' + 24: 3, # 'j' + 10: 2, # 'k' + 5: 3, # 'l' + 13: 3, # 'm' + 4: 3, # 'n' + 15: 1, # 'o' + 26: 2, # 'p' + 7: 3, # 'r' + 8: 2, # 's' + 9: 2, # 't' + 14: 3, # 'u' + 32: 1, # 'v' + 57: 0, # 'w' + 58: 1, # 'x' + 11: 3, # 'y' + 22: 1, # 'z' + 63: 1, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 1, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 2, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 2: { # 'e' + 23: 2, # 'A' + 37: 0, # 'B' + 47: 2, # 'C' + 39: 0, # 'D' + 29: 3, # 'E' + 52: 1, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 1, # 'K' + 49: 0, # 'L' + 20: 3, # 'M' + 46: 1, # 'N' + 42: 0, # 'O' + 48: 1, # 'P' + 44: 1, # 'R' + 35: 0, # 'S' + 31: 3, # 'T' + 51: 0, # 'U' + 38: 1, # 'V' + 62: 0, # 'W' + 43: 1, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 3, # 'b' + 28: 0, # 'c' + 12: 3, # 'd' + 2: 2, # 'e' + 18: 3, # 'f' + 27: 3, # 'g' + 25: 3, # 'h' + 3: 3, # 'i' + 24: 3, # 'j' + 10: 3, # 'k' + 5: 0, # 'l' + 13: 2, # 'm' + 4: 3, # 'n' + 15: 1, # 'o' + 26: 3, # 'p' + 7: 3, # 'r' + 8: 3, # 's' + 9: 3, # 't' + 14: 3, # 'u' + 32: 3, # 'v' + 57: 2, # 'w' + 58: 0, # 'x' + 11: 3, # 'y' + 22: 1, # 'z' + 63: 1, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 1, # 'ç' + 61: 0, # 'î' + 34: 1, # 'ö' + 17: 3, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 3, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 18: { # 'f' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 2, # 'K' + 49: 0, # 'L' + 20: 2, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 2, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 1, # 'b' + 28: 0, # 'c' + 12: 3, # 'd' + 2: 3, # 'e' + 18: 2, # 'f' + 27: 1, # 'g' + 25: 1, # 'h' + 3: 1, # 'i' + 24: 1, # 'j' + 10: 1, # 'k' + 5: 3, # 'l' + 13: 3, # 'm' + 4: 3, # 'n' + 15: 0, # 'o' + 26: 2, # 'p' + 7: 1, # 'r' + 8: 3, # 's' + 9: 3, # 't' + 14: 1, # 'u' + 32: 2, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 1, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 1, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 1, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 1, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 27: { # 'g' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 3, # 'K' + 49: 0, # 'L' + 20: 0, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 1, # 'S' + 31: 1, # 'T' + 51: 0, # 'U' + 38: 2, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 1, # 'b' + 28: 0, # 'c' + 12: 1, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 2, # 'g' + 25: 1, # 'h' + 3: 2, # 'i' + 24: 3, # 'j' + 10: 2, # 'k' + 5: 3, # 'l' + 13: 3, # 'm' + 4: 2, # 'n' + 15: 0, # 'o' + 26: 1, # 'p' + 7: 2, # 'r' + 8: 2, # 's' + 9: 3, # 't' + 14: 3, # 'u' + 32: 1, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 1, # 'y' + 22: 0, # 'z' + 63: 1, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 0, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 2, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 25: { # 'h' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 2, # 'K' + 49: 0, # 'L' + 20: 0, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 0, # 'b' + 28: 0, # 'c' + 12: 2, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 1, # 'g' + 25: 2, # 'h' + 3: 2, # 'i' + 24: 3, # 'j' + 10: 3, # 'k' + 5: 3, # 'l' + 13: 3, # 'm' + 4: 3, # 'n' + 15: 1, # 'o' + 26: 1, # 'p' + 7: 3, # 'r' + 8: 3, # 's' + 9: 2, # 't' + 14: 3, # 'u' + 32: 2, # 'v' + 57: 1, # 'w' + 58: 0, # 'x' + 11: 1, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 0, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 3, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 3: { # 'i' + 23: 2, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 1, # 'J' + 16: 3, # 'K' + 49: 0, # 'L' + 20: 3, # 'M' + 46: 0, # 'N' + 42: 1, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 1, # 'S' + 31: 2, # 'T' + 51: 0, # 'U' + 38: 1, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 2, # 'b' + 28: 0, # 'c' + 12: 3, # 'd' + 2: 3, # 'e' + 18: 2, # 'f' + 27: 3, # 'g' + 25: 1, # 'h' + 3: 3, # 'i' + 24: 2, # 'j' + 10: 3, # 'k' + 5: 3, # 'l' + 13: 3, # 'm' + 4: 3, # 'n' + 15: 1, # 'o' + 26: 3, # 'p' + 7: 3, # 'r' + 8: 3, # 's' + 9: 3, # 't' + 14: 3, # 'u' + 32: 2, # 'v' + 57: 1, # 'w' + 58: 1, # 'x' + 11: 3, # 'y' + 22: 1, # 'z' + 63: 1, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 1, # 'Ü' + 59: 0, # 'â' + 33: 2, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 3, # 'ü' + 30: 0, # 'ğ' + 41: 1, # 'İ' + 6: 2, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 24: { # 'j' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 1, # 'J' + 16: 2, # 'K' + 49: 0, # 'L' + 20: 2, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 1, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 1, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 1, # 'Z' + 1: 3, # 'a' + 21: 1, # 'b' + 28: 1, # 'c' + 12: 3, # 'd' + 2: 3, # 'e' + 18: 2, # 'f' + 27: 1, # 'g' + 25: 1, # 'h' + 3: 2, # 'i' + 24: 1, # 'j' + 10: 2, # 'k' + 5: 2, # 'l' + 13: 3, # 'm' + 4: 2, # 'n' + 15: 0, # 'o' + 26: 1, # 'p' + 7: 2, # 'r' + 8: 3, # 's' + 9: 2, # 't' + 14: 3, # 'u' + 32: 2, # 'v' + 57: 0, # 'w' + 58: 2, # 'x' + 11: 1, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 1, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 1, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 3, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 10: { # 'k' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 3, # 'K' + 49: 0, # 'L' + 20: 2, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 3, # 'T' + 51: 0, # 'U' + 38: 1, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 1, # 'Z' + 1: 3, # 'a' + 21: 2, # 'b' + 28: 0, # 'c' + 12: 2, # 'd' + 2: 3, # 'e' + 18: 1, # 'f' + 27: 2, # 'g' + 25: 2, # 'h' + 3: 3, # 'i' + 24: 2, # 'j' + 10: 2, # 'k' + 5: 3, # 'l' + 13: 3, # 'm' + 4: 3, # 'n' + 15: 0, # 'o' + 26: 3, # 'p' + 7: 2, # 'r' + 8: 2, # 's' + 9: 2, # 't' + 14: 3, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 1, # 'x' + 11: 3, # 'y' + 22: 0, # 'z' + 63: 1, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 3, # 'ç' + 61: 0, # 'î' + 34: 1, # 'ö' + 17: 3, # 'ü' + 30: 1, # 'ğ' + 41: 0, # 'İ' + 6: 3, # 'ı' + 40: 0, # 'Ş' + 19: 1, # 'ş' + }, + 5: { # 'l' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 3, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 0, # 'K' + 49: 0, # 'L' + 20: 2, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 1, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 0, # 'a' + 21: 3, # 'b' + 28: 0, # 'c' + 12: 3, # 'd' + 2: 1, # 'e' + 18: 3, # 'f' + 27: 3, # 'g' + 25: 2, # 'h' + 3: 3, # 'i' + 24: 2, # 'j' + 10: 3, # 'k' + 5: 1, # 'l' + 13: 1, # 'm' + 4: 3, # 'n' + 15: 0, # 'o' + 26: 2, # 'p' + 7: 3, # 'r' + 8: 3, # 's' + 9: 3, # 't' + 14: 2, # 'u' + 32: 2, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 3, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 1, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 2, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 3, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 13: { # 'm' + 23: 1, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 3, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 0, # 'K' + 49: 0, # 'L' + 20: 3, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 3, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 1, # 'Y' + 56: 0, # 'Z' + 1: 2, # 'a' + 21: 3, # 'b' + 28: 0, # 'c' + 12: 3, # 'd' + 2: 2, # 'e' + 18: 3, # 'f' + 27: 3, # 'g' + 25: 3, # 'h' + 3: 3, # 'i' + 24: 3, # 'j' + 10: 3, # 'k' + 5: 0, # 'l' + 13: 2, # 'm' + 4: 3, # 'n' + 15: 1, # 'o' + 26: 2, # 'p' + 7: 3, # 'r' + 8: 3, # 's' + 9: 3, # 't' + 14: 2, # 'u' + 32: 2, # 'v' + 57: 1, # 'w' + 58: 0, # 'x' + 11: 3, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 3, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 3, # 'ı' + 40: 0, # 'Ş' + 19: 1, # 'ş' + }, + 4: { # 'n' + 23: 1, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 1, # 'H' + 53: 0, # 'I' + 60: 2, # 'J' + 16: 3, # 'K' + 49: 0, # 'L' + 20: 3, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 2, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 2, # 'b' + 28: 1, # 'c' + 12: 3, # 'd' + 2: 3, # 'e' + 18: 1, # 'f' + 27: 2, # 'g' + 25: 3, # 'h' + 3: 2, # 'i' + 24: 2, # 'j' + 10: 3, # 'k' + 5: 3, # 'l' + 13: 3, # 'm' + 4: 3, # 'n' + 15: 1, # 'o' + 26: 3, # 'p' + 7: 2, # 'r' + 8: 3, # 's' + 9: 3, # 't' + 14: 3, # 'u' + 32: 2, # 'v' + 57: 0, # 'w' + 58: 2, # 'x' + 11: 3, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 1, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 2, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 1, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 15: { # 'o' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 1, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 2, # 'F' + 36: 1, # 'G' + 45: 1, # 'H' + 53: 1, # 'I' + 60: 0, # 'J' + 16: 3, # 'K' + 49: 2, # 'L' + 20: 0, # 'M' + 46: 2, # 'N' + 42: 1, # 'O' + 48: 2, # 'P' + 44: 1, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 0, # 'b' + 28: 2, # 'c' + 12: 0, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 1, # 'i' + 24: 2, # 'j' + 10: 1, # 'k' + 5: 3, # 'l' + 13: 3, # 'm' + 4: 2, # 'n' + 15: 2, # 'o' + 26: 0, # 'p' + 7: 1, # 'r' + 8: 0, # 's' + 9: 0, # 't' + 14: 3, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 2, # 'x' + 11: 0, # 'y' + 22: 2, # 'z' + 63: 0, # '·' + 54: 1, # 'Ç' + 50: 2, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 3, # 'ç' + 61: 0, # 'î' + 34: 1, # 'ö' + 17: 0, # 'ü' + 30: 2, # 'ğ' + 41: 2, # 'İ' + 6: 3, # 'ı' + 40: 2, # 'Ş' + 19: 2, # 'ş' + }, + 26: { # 'p' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 3, # 'K' + 49: 0, # 'L' + 20: 1, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 1, # 'b' + 28: 0, # 'c' + 12: 1, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 1, # 'g' + 25: 1, # 'h' + 3: 2, # 'i' + 24: 3, # 'j' + 10: 1, # 'k' + 5: 3, # 'l' + 13: 3, # 'm' + 4: 2, # 'n' + 15: 0, # 'o' + 26: 2, # 'p' + 7: 2, # 'r' + 8: 1, # 's' + 9: 1, # 't' + 14: 3, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 1, # 'x' + 11: 1, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 3, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 1, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 3, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 7: { # 'r' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 1, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 2, # 'J' + 16: 3, # 'K' + 49: 0, # 'L' + 20: 2, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 2, # 'T' + 51: 1, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 1, # 'Z' + 1: 3, # 'a' + 21: 1, # 'b' + 28: 0, # 'c' + 12: 3, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 2, # 'g' + 25: 3, # 'h' + 3: 2, # 'i' + 24: 2, # 'j' + 10: 3, # 'k' + 5: 3, # 'l' + 13: 3, # 'm' + 4: 3, # 'n' + 15: 0, # 'o' + 26: 2, # 'p' + 7: 3, # 'r' + 8: 3, # 's' + 9: 3, # 't' + 14: 3, # 'u' + 32: 2, # 'v' + 57: 0, # 'w' + 58: 1, # 'x' + 11: 2, # 'y' + 22: 0, # 'z' + 63: 1, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 2, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 3, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 2, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 8: { # 's' + 23: 1, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 1, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 3, # 'K' + 49: 0, # 'L' + 20: 3, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 2, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 1, # 'Z' + 1: 3, # 'a' + 21: 2, # 'b' + 28: 1, # 'c' + 12: 3, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 2, # 'g' + 25: 2, # 'h' + 3: 2, # 'i' + 24: 3, # 'j' + 10: 3, # 'k' + 5: 3, # 'l' + 13: 3, # 'm' + 4: 3, # 'n' + 15: 0, # 'o' + 26: 3, # 'p' + 7: 3, # 'r' + 8: 3, # 's' + 9: 3, # 't' + 14: 3, # 'u' + 32: 2, # 'v' + 57: 0, # 'w' + 58: 1, # 'x' + 11: 2, # 'y' + 22: 1, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 2, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 2, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 3, # 'ı' + 40: 0, # 'Ş' + 19: 1, # 'ş' + }, + 9: { # 't' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 1, # 'J' + 16: 3, # 'K' + 49: 0, # 'L' + 20: 2, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 2, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 1, # 'Z' + 1: 3, # 'a' + 21: 3, # 'b' + 28: 0, # 'c' + 12: 3, # 'd' + 2: 3, # 'e' + 18: 2, # 'f' + 27: 2, # 'g' + 25: 2, # 'h' + 3: 2, # 'i' + 24: 2, # 'j' + 10: 3, # 'k' + 5: 3, # 'l' + 13: 3, # 'm' + 4: 3, # 'n' + 15: 0, # 'o' + 26: 2, # 'p' + 7: 3, # 'r' + 8: 3, # 's' + 9: 3, # 't' + 14: 3, # 'u' + 32: 3, # 'v' + 57: 0, # 'w' + 58: 2, # 'x' + 11: 2, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 3, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 2, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 3, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 14: { # 'u' + 23: 3, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 3, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 1, # 'H' + 53: 0, # 'I' + 60: 1, # 'J' + 16: 0, # 'K' + 49: 0, # 'L' + 20: 3, # 'M' + 46: 2, # 'N' + 42: 0, # 'O' + 48: 1, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 3, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 1, # 'Y' + 56: 2, # 'Z' + 1: 2, # 'a' + 21: 3, # 'b' + 28: 0, # 'c' + 12: 3, # 'd' + 2: 2, # 'e' + 18: 2, # 'f' + 27: 3, # 'g' + 25: 3, # 'h' + 3: 3, # 'i' + 24: 2, # 'j' + 10: 3, # 'k' + 5: 0, # 'l' + 13: 3, # 'm' + 4: 3, # 'n' + 15: 0, # 'o' + 26: 3, # 'p' + 7: 3, # 'r' + 8: 3, # 's' + 9: 3, # 't' + 14: 3, # 'u' + 32: 2, # 'v' + 57: 2, # 'w' + 58: 0, # 'x' + 11: 3, # 'y' + 22: 0, # 'z' + 63: 1, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 3, # 'ü' + 30: 1, # 'ğ' + 41: 0, # 'İ' + 6: 3, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 32: { # 'v' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 3, # 'K' + 49: 0, # 'L' + 20: 1, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 0, # 'b' + 28: 0, # 'c' + 12: 3, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 0, # 'i' + 24: 1, # 'j' + 10: 1, # 'k' + 5: 3, # 'l' + 13: 2, # 'm' + 4: 3, # 'n' + 15: 0, # 'o' + 26: 1, # 'p' + 7: 1, # 'r' + 8: 2, # 's' + 9: 3, # 't' + 14: 3, # 'u' + 32: 1, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 0, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 2, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 0, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 1, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 57: { # 'w' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 0, # 'K' + 49: 0, # 'L' + 20: 0, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 1, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 1, # 'a' + 21: 0, # 'b' + 28: 0, # 'c' + 12: 0, # 'd' + 2: 2, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 1, # 'h' + 3: 0, # 'i' + 24: 0, # 'j' + 10: 1, # 'k' + 5: 0, # 'l' + 13: 0, # 'm' + 4: 1, # 'n' + 15: 0, # 'o' + 26: 0, # 'p' + 7: 0, # 'r' + 8: 1, # 's' + 9: 0, # 't' + 14: 1, # 'u' + 32: 0, # 'v' + 57: 2, # 'w' + 58: 0, # 'x' + 11: 0, # 'y' + 22: 0, # 'z' + 63: 1, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 1, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 0, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 58: { # 'x' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 1, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 1, # 'J' + 16: 0, # 'K' + 49: 0, # 'L' + 20: 1, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 0, # 'a' + 21: 1, # 'b' + 28: 0, # 'c' + 12: 2, # 'd' + 2: 1, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 2, # 'i' + 24: 2, # 'j' + 10: 1, # 'k' + 5: 0, # 'l' + 13: 0, # 'm' + 4: 2, # 'n' + 15: 0, # 'o' + 26: 0, # 'p' + 7: 1, # 'r' + 8: 2, # 's' + 9: 1, # 't' + 14: 0, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 2, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 1, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 2, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 11: { # 'y' + 23: 1, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 1, # 'J' + 16: 3, # 'K' + 49: 0, # 'L' + 20: 1, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 1, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 1, # 'Y' + 56: 1, # 'Z' + 1: 3, # 'a' + 21: 1, # 'b' + 28: 0, # 'c' + 12: 2, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 2, # 'g' + 25: 2, # 'h' + 3: 2, # 'i' + 24: 1, # 'j' + 10: 2, # 'k' + 5: 3, # 'l' + 13: 3, # 'm' + 4: 3, # 'n' + 15: 0, # 'o' + 26: 1, # 'p' + 7: 2, # 'r' + 8: 1, # 's' + 9: 2, # 't' + 14: 3, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 1, # 'x' + 11: 3, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 3, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 2, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 3, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 22: { # 'z' + 23: 2, # 'A' + 37: 2, # 'B' + 47: 1, # 'C' + 39: 2, # 'D' + 29: 3, # 'E' + 52: 1, # 'F' + 36: 2, # 'G' + 45: 2, # 'H' + 53: 1, # 'I' + 60: 0, # 'J' + 16: 0, # 'K' + 49: 0, # 'L' + 20: 3, # 'M' + 46: 2, # 'N' + 42: 2, # 'O' + 48: 2, # 'P' + 44: 1, # 'R' + 35: 1, # 'S' + 31: 3, # 'T' + 51: 2, # 'U' + 38: 2, # 'V' + 62: 0, # 'W' + 43: 2, # 'Y' + 56: 1, # 'Z' + 1: 1, # 'a' + 21: 2, # 'b' + 28: 1, # 'c' + 12: 2, # 'd' + 2: 2, # 'e' + 18: 3, # 'f' + 27: 2, # 'g' + 25: 2, # 'h' + 3: 3, # 'i' + 24: 2, # 'j' + 10: 3, # 'k' + 5: 0, # 'l' + 13: 2, # 'm' + 4: 3, # 'n' + 15: 2, # 'o' + 26: 2, # 'p' + 7: 3, # 'r' + 8: 3, # 's' + 9: 3, # 't' + 14: 0, # 'u' + 32: 2, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 3, # 'y' + 22: 2, # 'z' + 63: 1, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 2, # 'Ü' + 59: 1, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 2, # 'ö' + 17: 2, # 'ü' + 30: 2, # 'ğ' + 41: 1, # 'İ' + 6: 3, # 'ı' + 40: 1, # 'Ş' + 19: 2, # 'ş' + }, + 63: { # '·' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 0, # 'K' + 49: 0, # 'L' + 20: 0, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 0, # 'a' + 21: 0, # 'b' + 28: 0, # 'c' + 12: 0, # 'd' + 2: 1, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 0, # 'i' + 24: 0, # 'j' + 10: 0, # 'k' + 5: 0, # 'l' + 13: 2, # 'm' + 4: 0, # 'n' + 15: 0, # 'o' + 26: 0, # 'p' + 7: 0, # 'r' + 8: 0, # 's' + 9: 0, # 't' + 14: 2, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 0, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 0, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 0, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 54: { # 'Ç' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 1, # 'C' + 39: 1, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 1, # 'G' + 45: 1, # 'H' + 53: 1, # 'I' + 60: 0, # 'J' + 16: 0, # 'K' + 49: 0, # 'L' + 20: 0, # 'M' + 46: 0, # 'N' + 42: 1, # 'O' + 48: 1, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 1, # 'U' + 38: 1, # 'V' + 62: 0, # 'W' + 43: 2, # 'Y' + 56: 0, # 'Z' + 1: 0, # 'a' + 21: 1, # 'b' + 28: 0, # 'c' + 12: 1, # 'd' + 2: 0, # 'e' + 18: 0, # 'f' + 27: 1, # 'g' + 25: 0, # 'h' + 3: 3, # 'i' + 24: 0, # 'j' + 10: 1, # 'k' + 5: 0, # 'l' + 13: 0, # 'm' + 4: 2, # 'n' + 15: 1, # 'o' + 26: 0, # 'p' + 7: 2, # 'r' + 8: 0, # 's' + 9: 1, # 't' + 14: 0, # 'u' + 32: 2, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 0, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 2, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 1, # 'ö' + 17: 0, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 2, # 'ı' + 40: 0, # 'Ş' + 19: 1, # 'ş' + }, + 50: { # 'Ö' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 1, # 'C' + 39: 1, # 'D' + 29: 2, # 'E' + 52: 0, # 'F' + 36: 1, # 'G' + 45: 2, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 0, # 'K' + 49: 0, # 'L' + 20: 1, # 'M' + 46: 1, # 'N' + 42: 2, # 'O' + 48: 2, # 'P' + 44: 1, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 1, # 'U' + 38: 1, # 'V' + 62: 0, # 'W' + 43: 2, # 'Y' + 56: 0, # 'Z' + 1: 0, # 'a' + 21: 2, # 'b' + 28: 1, # 'c' + 12: 2, # 'd' + 2: 0, # 'e' + 18: 1, # 'f' + 27: 1, # 'g' + 25: 1, # 'h' + 3: 2, # 'i' + 24: 0, # 'j' + 10: 2, # 'k' + 5: 0, # 'l' + 13: 0, # 'm' + 4: 3, # 'n' + 15: 2, # 'o' + 26: 2, # 'p' + 7: 3, # 'r' + 8: 1, # 's' + 9: 2, # 't' + 14: 0, # 'u' + 32: 1, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 0, # 'y' + 22: 1, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 2, # 'ö' + 17: 2, # 'ü' + 30: 1, # 'ğ' + 41: 0, # 'İ' + 6: 2, # 'ı' + 40: 0, # 'Ş' + 19: 1, # 'ş' + }, + 55: { # 'Ü' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 2, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 1, # 'K' + 49: 0, # 'L' + 20: 0, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 1, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 0, # 'U' + 38: 1, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 2, # 'a' + 21: 0, # 'b' + 28: 2, # 'c' + 12: 0, # 'd' + 2: 2, # 'e' + 18: 0, # 'f' + 27: 1, # 'g' + 25: 0, # 'h' + 3: 0, # 'i' + 24: 0, # 'j' + 10: 0, # 'k' + 5: 1, # 'l' + 13: 1, # 'm' + 4: 1, # 'n' + 15: 0, # 'o' + 26: 0, # 'p' + 7: 0, # 'r' + 8: 0, # 's' + 9: 1, # 't' + 14: 2, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 0, # 'y' + 22: 1, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 1, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 1, # 'ö' + 17: 0, # 'ü' + 30: 1, # 'ğ' + 41: 1, # 'İ' + 6: 0, # 'ı' + 40: 0, # 'Ş' + 19: 1, # 'ş' + }, + 59: { # 'â' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 1, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 1, # 'K' + 49: 0, # 'L' + 20: 0, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 2, # 'a' + 21: 0, # 'b' + 28: 0, # 'c' + 12: 0, # 'd' + 2: 2, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 0, # 'i' + 24: 0, # 'j' + 10: 0, # 'k' + 5: 0, # 'l' + 13: 2, # 'm' + 4: 0, # 'n' + 15: 1, # 'o' + 26: 0, # 'p' + 7: 0, # 'r' + 8: 0, # 's' + 9: 0, # 't' + 14: 2, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 0, # 'y' + 22: 1, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 0, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 1, # 'ı' + 40: 1, # 'Ş' + 19: 0, # 'ş' + }, + 33: { # 'ç' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 3, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 0, # 'K' + 49: 0, # 'L' + 20: 1, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 2, # 'T' + 51: 0, # 'U' + 38: 1, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 0, # 'Z' + 1: 0, # 'a' + 21: 3, # 'b' + 28: 0, # 'c' + 12: 2, # 'd' + 2: 0, # 'e' + 18: 2, # 'f' + 27: 1, # 'g' + 25: 3, # 'h' + 3: 3, # 'i' + 24: 0, # 'j' + 10: 3, # 'k' + 5: 0, # 'l' + 13: 0, # 'm' + 4: 3, # 'n' + 15: 0, # 'o' + 26: 1, # 'p' + 7: 3, # 'r' + 8: 2, # 's' + 9: 3, # 't' + 14: 0, # 'u' + 32: 2, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 2, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 1, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 3, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 61: { # 'î' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 0, # 'K' + 49: 0, # 'L' + 20: 0, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 0, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 1, # 'Z' + 1: 2, # 'a' + 21: 0, # 'b' + 28: 0, # 'c' + 12: 0, # 'd' + 2: 2, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 0, # 'i' + 24: 1, # 'j' + 10: 0, # 'k' + 5: 0, # 'l' + 13: 1, # 'm' + 4: 1, # 'n' + 15: 0, # 'o' + 26: 0, # 'p' + 7: 0, # 'r' + 8: 0, # 's' + 9: 0, # 't' + 14: 1, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 0, # 'y' + 22: 1, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 1, # 'î' + 34: 0, # 'ö' + 17: 0, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 1, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 34: { # 'ö' + 23: 0, # 'A' + 37: 1, # 'B' + 47: 1, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 2, # 'F' + 36: 1, # 'G' + 45: 1, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 3, # 'K' + 49: 1, # 'L' + 20: 0, # 'M' + 46: 1, # 'N' + 42: 1, # 'O' + 48: 2, # 'P' + 44: 1, # 'R' + 35: 1, # 'S' + 31: 1, # 'T' + 51: 1, # 'U' + 38: 1, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 1, # 'Z' + 1: 3, # 'a' + 21: 1, # 'b' + 28: 2, # 'c' + 12: 1, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 2, # 'g' + 25: 2, # 'h' + 3: 1, # 'i' + 24: 2, # 'j' + 10: 1, # 'k' + 5: 2, # 'l' + 13: 3, # 'm' + 4: 2, # 'n' + 15: 2, # 'o' + 26: 0, # 'p' + 7: 0, # 'r' + 8: 3, # 's' + 9: 1, # 't' + 14: 3, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 1, # 'y' + 22: 2, # 'z' + 63: 0, # '·' + 54: 1, # 'Ç' + 50: 2, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 2, # 'ç' + 61: 0, # 'î' + 34: 2, # 'ö' + 17: 0, # 'ü' + 30: 2, # 'ğ' + 41: 1, # 'İ' + 6: 1, # 'ı' + 40: 2, # 'Ş' + 19: 1, # 'ş' + }, + 17: { # 'ü' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 1, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 0, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 1, # 'J' + 16: 1, # 'K' + 49: 0, # 'L' + 20: 1, # 'M' + 46: 0, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 1, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 0, # 'Y' + 56: 1, # 'Z' + 1: 3, # 'a' + 21: 0, # 'b' + 28: 0, # 'c' + 12: 1, # 'd' + 2: 3, # 'e' + 18: 1, # 'f' + 27: 2, # 'g' + 25: 0, # 'h' + 3: 1, # 'i' + 24: 1, # 'j' + 10: 2, # 'k' + 5: 3, # 'l' + 13: 2, # 'm' + 4: 3, # 'n' + 15: 0, # 'o' + 26: 2, # 'p' + 7: 2, # 'r' + 8: 3, # 's' + 9: 2, # 't' + 14: 3, # 'u' + 32: 1, # 'v' + 57: 1, # 'w' + 58: 0, # 'x' + 11: 0, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 1, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 2, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 2, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 30: { # 'ğ' + 23: 0, # 'A' + 37: 2, # 'B' + 47: 1, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 2, # 'F' + 36: 1, # 'G' + 45: 0, # 'H' + 53: 1, # 'I' + 60: 0, # 'J' + 16: 3, # 'K' + 49: 0, # 'L' + 20: 1, # 'M' + 46: 2, # 'N' + 42: 2, # 'O' + 48: 1, # 'P' + 44: 1, # 'R' + 35: 0, # 'S' + 31: 1, # 'T' + 51: 0, # 'U' + 38: 2, # 'V' + 62: 0, # 'W' + 43: 2, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 0, # 'b' + 28: 2, # 'c' + 12: 0, # 'd' + 2: 2, # 'e' + 18: 0, # 'f' + 27: 0, # 'g' + 25: 0, # 'h' + 3: 0, # 'i' + 24: 3, # 'j' + 10: 1, # 'k' + 5: 2, # 'l' + 13: 3, # 'm' + 4: 0, # 'n' + 15: 1, # 'o' + 26: 0, # 'p' + 7: 1, # 'r' + 8: 0, # 's' + 9: 0, # 't' + 14: 3, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 0, # 'y' + 22: 2, # 'z' + 63: 0, # '·' + 54: 2, # 'Ç' + 50: 2, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 1, # 'ç' + 61: 0, # 'î' + 34: 2, # 'ö' + 17: 0, # 'ü' + 30: 1, # 'ğ' + 41: 2, # 'İ' + 6: 2, # 'ı' + 40: 2, # 'Ş' + 19: 1, # 'ş' + }, + 41: { # 'İ' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 1, # 'C' + 39: 1, # 'D' + 29: 1, # 'E' + 52: 0, # 'F' + 36: 2, # 'G' + 45: 2, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 0, # 'K' + 49: 0, # 'L' + 20: 2, # 'M' + 46: 1, # 'N' + 42: 1, # 'O' + 48: 2, # 'P' + 44: 0, # 'R' + 35: 1, # 'S' + 31: 1, # 'T' + 51: 1, # 'U' + 38: 1, # 'V' + 62: 0, # 'W' + 43: 2, # 'Y' + 56: 0, # 'Z' + 1: 1, # 'a' + 21: 2, # 'b' + 28: 1, # 'c' + 12: 2, # 'd' + 2: 1, # 'e' + 18: 0, # 'f' + 27: 3, # 'g' + 25: 2, # 'h' + 3: 2, # 'i' + 24: 2, # 'j' + 10: 2, # 'k' + 5: 0, # 'l' + 13: 1, # 'm' + 4: 3, # 'n' + 15: 1, # 'o' + 26: 1, # 'p' + 7: 3, # 'r' + 8: 3, # 's' + 9: 2, # 't' + 14: 0, # 'u' + 32: 0, # 'v' + 57: 1, # 'w' + 58: 0, # 'x' + 11: 2, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 1, # 'Ü' + 59: 1, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 1, # 'ö' + 17: 1, # 'ü' + 30: 2, # 'ğ' + 41: 0, # 'İ' + 6: 3, # 'ı' + 40: 0, # 'Ş' + 19: 1, # 'ş' + }, + 6: { # 'ı' + 23: 2, # 'A' + 37: 0, # 'B' + 47: 0, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 0, # 'F' + 36: 1, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 2, # 'J' + 16: 3, # 'K' + 49: 0, # 'L' + 20: 3, # 'M' + 46: 1, # 'N' + 42: 0, # 'O' + 48: 0, # 'P' + 44: 0, # 'R' + 35: 0, # 'S' + 31: 2, # 'T' + 51: 0, # 'U' + 38: 0, # 'V' + 62: 0, # 'W' + 43: 2, # 'Y' + 56: 1, # 'Z' + 1: 3, # 'a' + 21: 2, # 'b' + 28: 1, # 'c' + 12: 3, # 'd' + 2: 3, # 'e' + 18: 3, # 'f' + 27: 3, # 'g' + 25: 2, # 'h' + 3: 3, # 'i' + 24: 3, # 'j' + 10: 3, # 'k' + 5: 3, # 'l' + 13: 3, # 'm' + 4: 3, # 'n' + 15: 0, # 'o' + 26: 3, # 'p' + 7: 3, # 'r' + 8: 3, # 's' + 9: 3, # 't' + 14: 3, # 'u' + 32: 3, # 'v' + 57: 1, # 'w' + 58: 1, # 'x' + 11: 3, # 'y' + 22: 0, # 'z' + 63: 1, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 2, # 'ç' + 61: 0, # 'î' + 34: 0, # 'ö' + 17: 3, # 'ü' + 30: 0, # 'ğ' + 41: 0, # 'İ' + 6: 3, # 'ı' + 40: 0, # 'Ş' + 19: 0, # 'ş' + }, + 40: { # 'Ş' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 1, # 'C' + 39: 1, # 'D' + 29: 1, # 'E' + 52: 0, # 'F' + 36: 1, # 'G' + 45: 2, # 'H' + 53: 1, # 'I' + 60: 0, # 'J' + 16: 0, # 'K' + 49: 0, # 'L' + 20: 2, # 'M' + 46: 1, # 'N' + 42: 1, # 'O' + 48: 2, # 'P' + 44: 2, # 'R' + 35: 1, # 'S' + 31: 1, # 'T' + 51: 0, # 'U' + 38: 1, # 'V' + 62: 0, # 'W' + 43: 2, # 'Y' + 56: 1, # 'Z' + 1: 0, # 'a' + 21: 2, # 'b' + 28: 0, # 'c' + 12: 2, # 'd' + 2: 0, # 'e' + 18: 3, # 'f' + 27: 0, # 'g' + 25: 2, # 'h' + 3: 3, # 'i' + 24: 2, # 'j' + 10: 1, # 'k' + 5: 0, # 'l' + 13: 1, # 'm' + 4: 3, # 'n' + 15: 2, # 'o' + 26: 0, # 'p' + 7: 3, # 'r' + 8: 2, # 's' + 9: 2, # 't' + 14: 1, # 'u' + 32: 3, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 2, # 'y' + 22: 0, # 'z' + 63: 0, # '·' + 54: 0, # 'Ç' + 50: 0, # 'Ö' + 55: 1, # 'Ü' + 59: 0, # 'â' + 33: 0, # 'ç' + 61: 0, # 'î' + 34: 2, # 'ö' + 17: 1, # 'ü' + 30: 2, # 'ğ' + 41: 0, # 'İ' + 6: 2, # 'ı' + 40: 1, # 'Ş' + 19: 2, # 'ş' + }, + 19: { # 'ş' + 23: 0, # 'A' + 37: 0, # 'B' + 47: 1, # 'C' + 39: 0, # 'D' + 29: 0, # 'E' + 52: 2, # 'F' + 36: 1, # 'G' + 45: 0, # 'H' + 53: 0, # 'I' + 60: 0, # 'J' + 16: 3, # 'K' + 49: 2, # 'L' + 20: 0, # 'M' + 46: 1, # 'N' + 42: 1, # 'O' + 48: 1, # 'P' + 44: 1, # 'R' + 35: 1, # 'S' + 31: 0, # 'T' + 51: 1, # 'U' + 38: 1, # 'V' + 62: 0, # 'W' + 43: 1, # 'Y' + 56: 0, # 'Z' + 1: 3, # 'a' + 21: 1, # 'b' + 28: 2, # 'c' + 12: 0, # 'd' + 2: 3, # 'e' + 18: 0, # 'f' + 27: 2, # 'g' + 25: 1, # 'h' + 3: 1, # 'i' + 24: 0, # 'j' + 10: 2, # 'k' + 5: 2, # 'l' + 13: 3, # 'm' + 4: 0, # 'n' + 15: 0, # 'o' + 26: 1, # 'p' + 7: 3, # 'r' + 8: 0, # 's' + 9: 0, # 't' + 14: 3, # 'u' + 32: 0, # 'v' + 57: 0, # 'w' + 58: 0, # 'x' + 11: 0, # 'y' + 22: 2, # 'z' + 63: 0, # '·' + 54: 1, # 'Ç' + 50: 2, # 'Ö' + 55: 0, # 'Ü' + 59: 0, # 'â' + 33: 1, # 'ç' + 61: 1, # 'î' + 34: 2, # 'ö' + 17: 0, # 'ü' + 30: 1, # 'ğ' + 41: 1, # 'İ' + 6: 1, # 'ı' + 40: 1, # 'Ş' + 19: 1, # 'ş' + }, +} + +# 255: Undefined characters that did not exist in training text +# 254: Carriage/Return +# 253: symbol (punctuation) that does not belong to word +# 252: 0 - 9 +# 251: Control characters + +# Character Mapping Table(s): +ISO_8859_9_TURKISH_CHAR_TO_ORDER = { + 0: 255, # '\x00' + 1: 255, # '\x01' + 2: 255, # '\x02' + 3: 255, # '\x03' + 4: 255, # '\x04' + 5: 255, # '\x05' + 6: 255, # '\x06' + 7: 255, # '\x07' + 8: 255, # '\x08' + 9: 255, # '\t' + 10: 255, # '\n' + 11: 255, # '\x0b' + 12: 255, # '\x0c' + 13: 255, # '\r' + 14: 255, # '\x0e' + 15: 255, # '\x0f' + 16: 255, # '\x10' + 17: 255, # '\x11' + 18: 255, # '\x12' + 19: 255, # '\x13' + 20: 255, # '\x14' + 21: 255, # '\x15' + 22: 255, # '\x16' + 23: 255, # '\x17' + 24: 255, # '\x18' + 25: 255, # '\x19' + 26: 255, # '\x1a' + 27: 255, # '\x1b' + 28: 255, # '\x1c' + 29: 255, # '\x1d' + 30: 255, # '\x1e' + 31: 255, # '\x1f' + 32: 255, # ' ' + 33: 255, # '!' + 34: 255, # '"' + 35: 255, # '#' + 36: 255, # '$' + 37: 255, # '%' + 38: 255, # '&' + 39: 255, # "'" + 40: 255, # '(' + 41: 255, # ')' + 42: 255, # '*' + 43: 255, # '+' + 44: 255, # ',' + 45: 255, # '-' + 46: 255, # '.' + 47: 255, # '/' + 48: 255, # '0' + 49: 255, # '1' + 50: 255, # '2' + 51: 255, # '3' + 52: 255, # '4' + 53: 255, # '5' + 54: 255, # '6' + 55: 255, # '7' + 56: 255, # '8' + 57: 255, # '9' + 58: 255, # ':' + 59: 255, # ';' + 60: 255, # '<' + 61: 255, # '=' + 62: 255, # '>' + 63: 255, # '?' + 64: 255, # '@' + 65: 23, # 'A' + 66: 37, # 'B' + 67: 47, # 'C' + 68: 39, # 'D' + 69: 29, # 'E' + 70: 52, # 'F' + 71: 36, # 'G' + 72: 45, # 'H' + 73: 53, # 'I' + 74: 60, # 'J' + 75: 16, # 'K' + 76: 49, # 'L' + 77: 20, # 'M' + 78: 46, # 'N' + 79: 42, # 'O' + 80: 48, # 'P' + 81: 69, # 'Q' + 82: 44, # 'R' + 83: 35, # 'S' + 84: 31, # 'T' + 85: 51, # 'U' + 86: 38, # 'V' + 87: 62, # 'W' + 88: 65, # 'X' + 89: 43, # 'Y' + 90: 56, # 'Z' + 91: 255, # '[' + 92: 255, # '\\' + 93: 255, # ']' + 94: 255, # '^' + 95: 255, # '_' + 96: 255, # '`' + 97: 1, # 'a' + 98: 21, # 'b' + 99: 28, # 'c' + 100: 12, # 'd' + 101: 2, # 'e' + 102: 18, # 'f' + 103: 27, # 'g' + 104: 25, # 'h' + 105: 3, # 'i' + 106: 24, # 'j' + 107: 10, # 'k' + 108: 5, # 'l' + 109: 13, # 'm' + 110: 4, # 'n' + 111: 15, # 'o' + 112: 26, # 'p' + 113: 64, # 'q' + 114: 7, # 'r' + 115: 8, # 's' + 116: 9, # 't' + 117: 14, # 'u' + 118: 32, # 'v' + 119: 57, # 'w' + 120: 58, # 'x' + 121: 11, # 'y' + 122: 22, # 'z' + 123: 255, # '{' + 124: 255, # '|' + 125: 255, # '}' + 126: 255, # '~' + 127: 255, # '\x7f' + 128: 180, # '\x80' + 129: 179, # '\x81' + 130: 178, # '\x82' + 131: 177, # '\x83' + 132: 176, # '\x84' + 133: 175, # '\x85' + 134: 174, # '\x86' + 135: 173, # '\x87' + 136: 172, # '\x88' + 137: 171, # '\x89' + 138: 170, # '\x8a' + 139: 169, # '\x8b' + 140: 168, # '\x8c' + 141: 167, # '\x8d' + 142: 166, # '\x8e' + 143: 165, # '\x8f' + 144: 164, # '\x90' + 145: 163, # '\x91' + 146: 162, # '\x92' + 147: 161, # '\x93' + 148: 160, # '\x94' + 149: 159, # '\x95' + 150: 101, # '\x96' + 151: 158, # '\x97' + 152: 157, # '\x98' + 153: 156, # '\x99' + 154: 155, # '\x9a' + 155: 154, # '\x9b' + 156: 153, # '\x9c' + 157: 152, # '\x9d' + 158: 151, # '\x9e' + 159: 106, # '\x9f' + 160: 150, # '\xa0' + 161: 149, # '¡' + 162: 148, # '¢' + 163: 147, # '£' + 164: 146, # '¤' + 165: 145, # '¥' + 166: 144, # '¦' + 167: 100, # '§' + 168: 143, # '¨' + 169: 142, # '©' + 170: 141, # 'ª' + 171: 140, # '«' + 172: 139, # '¬' + 173: 138, # '\xad' + 174: 137, # '®' + 175: 136, # '¯' + 176: 94, # '°' + 177: 80, # '±' + 178: 93, # '²' + 179: 135, # '³' + 180: 105, # '´' + 181: 134, # 'µ' + 182: 133, # '¶' + 183: 63, # '·' + 184: 132, # '¸' + 185: 131, # '¹' + 186: 130, # 'º' + 187: 129, # '»' + 188: 128, # '¼' + 189: 127, # '½' + 190: 126, # '¾' + 191: 125, # '¿' + 192: 124, # 'À' + 193: 104, # 'Á' + 194: 73, # 'Â' + 195: 99, # 'Ã' + 196: 79, # 'Ä' + 197: 85, # 'Å' + 198: 123, # 'Æ' + 199: 54, # 'Ç' + 200: 122, # 'È' + 201: 98, # 'É' + 202: 92, # 'Ê' + 203: 121, # 'Ë' + 204: 120, # 'Ì' + 205: 91, # 'Í' + 206: 103, # 'Î' + 207: 119, # 'Ï' + 208: 68, # 'Ğ' + 209: 118, # 'Ñ' + 210: 117, # 'Ò' + 211: 97, # 'Ó' + 212: 116, # 'Ô' + 213: 115, # 'Õ' + 214: 50, # 'Ö' + 215: 90, # '×' + 216: 114, # 'Ø' + 217: 113, # 'Ù' + 218: 112, # 'Ú' + 219: 111, # 'Û' + 220: 55, # 'Ü' + 221: 41, # 'İ' + 222: 40, # 'Ş' + 223: 86, # 'ß' + 224: 89, # 'à' + 225: 70, # 'á' + 226: 59, # 'â' + 227: 78, # 'ã' + 228: 71, # 'ä' + 229: 82, # 'å' + 230: 88, # 'æ' + 231: 33, # 'ç' + 232: 77, # 'è' + 233: 66, # 'é' + 234: 84, # 'ê' + 235: 83, # 'ë' + 236: 110, # 'ì' + 237: 75, # 'í' + 238: 61, # 'î' + 239: 96, # 'ï' + 240: 30, # 'ğ' + 241: 67, # 'ñ' + 242: 109, # 'ò' + 243: 74, # 'ó' + 244: 87, # 'ô' + 245: 102, # 'õ' + 246: 34, # 'ö' + 247: 95, # '÷' + 248: 81, # 'ø' + 249: 108, # 'ù' + 250: 76, # 'ú' + 251: 72, # 'û' + 252: 17, # 'ü' + 253: 6, # 'ı' + 254: 19, # 'ş' + 255: 107, # 'ÿ' +} + +ISO_8859_9_TURKISH_MODEL = SingleByteCharSetModel(charset_name='ISO-8859-9', + language='Turkish', + char_to_order_map=ISO_8859_9_TURKISH_CHAR_TO_ORDER, + language_model=TURKISH_LANG_MODEL, + typical_positive_ratio=0.97029, + keep_ascii_letters=True, + alphabet='ABCDEFGHIJKLMNOPRSTUVYZabcdefghijklmnoprstuvyzÂÇÎÖÛÜâçîöûüĞğİıŞş') + diff --git a/shared/package-files/1f/1f7be1029f426e7fbb26e4c6a334be3301a83a511c7757c72a63f4a2ad19d946/_param_validation.py b/shared/package-files/1f/1f7be1029f426e7fbb26e4c6a334be3301a83a511c7757c72a63f4a2ad19d946/_param_validation.py new file mode 100644 index 0000000000000000000000000000000000000000..27df9f4526d5c441457923a5119786e67905a8bb --- /dev/null +++ b/shared/package-files/1f/1f7be1029f426e7fbb26e4c6a334be3301a83a511c7757c72a63f4a2ad19d946/_param_validation.py @@ -0,0 +1,910 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + +import functools +import math +import operator +import re +from abc import ABC, abstractmethod +from collections.abc import Iterable +from inspect import signature +from numbers import Integral, Real + +import numpy as np +from scipy.sparse import csr_matrix, issparse + +from .._config import config_context, get_config +from .validation import _is_arraylike_not_scalar + + +class InvalidParameterError(ValueError, TypeError): + """Custom exception to be raised when the parameter of a class/method/function + does not have a valid type or value. + """ + + # Inherits from ValueError and TypeError to keep backward compatibility. + + +def validate_parameter_constraints(parameter_constraints, params, caller_name): + """Validate types and values of given parameters. + + Parameters + ---------- + parameter_constraints : dict or {"no_validation"} + If "no_validation", validation is skipped for this parameter. + + If a dict, it must be a dictionary `param_name: list of constraints`. + A parameter is valid if it satisfies one of the constraints from the list. + Constraints can be: + - an Interval object, representing a continuous or discrete range of numbers + - the string "array-like" + - the string "sparse matrix" + - the string "random_state" + - callable + - None, meaning that None is a valid value for the parameter + - any type, meaning that any instance of this type is valid + - an Options object, representing a set of elements of a given type + - a StrOptions object, representing a set of strings + - the string "boolean" + - the string "verbose" + - the string "cv_object" + - the string "nan" + - a MissingValues object representing markers for missing values + - a HasMethods object, representing method(s) an object must have + - a Hidden object, representing a constraint not meant to be exposed to the user + + params : dict + A dictionary `param_name: param_value`. The parameters to validate against the + constraints. + + caller_name : str + The name of the estimator or function or method that called this function. + """ + for param_name, param_val in params.items(): + # We allow parameters to not have a constraint so that third party estimators + # can inherit from sklearn estimators without having to necessarily use the + # validation tools. + if param_name not in parameter_constraints: + continue + + constraints = parameter_constraints[param_name] + + if constraints == "no_validation": + continue + + constraints = [make_constraint(constraint) for constraint in constraints] + + for constraint in constraints: + if constraint.is_satisfied_by(param_val): + # this constraint is satisfied, no need to check further. + break + else: + # No constraint is satisfied, raise with an informative message. + + # Ignore constraints that we don't want to expose in the error message, + # i.e. options that are for internal purpose or not officially supported. + constraints = [ + constraint for constraint in constraints if not constraint.hidden + ] + + if len(constraints) == 1: + constraints_str = f"{constraints[0]}" + else: + constraints_str = ( + f"{', '.join([str(c) for c in constraints[:-1]])} or" + f" {constraints[-1]}" + ) + + raise InvalidParameterError( + f"The {param_name!r} parameter of {caller_name} must be" + f" {constraints_str}. Got {param_val!r} instead." + ) + + +def make_constraint(constraint): + """Convert the constraint into the appropriate Constraint object. + + Parameters + ---------- + constraint : object + The constraint to convert. + + Returns + ------- + constraint : instance of _Constraint + The converted constraint. + """ + if isinstance(constraint, str) and constraint == "array-like": + return _ArrayLikes() + if isinstance(constraint, str) and constraint == "sparse matrix": + return _SparseMatrices() + if isinstance(constraint, str) and constraint == "random_state": + return _RandomStates() + if constraint is callable: + return _Callables() + if constraint is None: + return _NoneConstraint() + if isinstance(constraint, type): + return _InstancesOf(constraint) + if isinstance( + constraint, (Interval, StrOptions, Options, HasMethods, MissingValues) + ): + return constraint + if isinstance(constraint, str) and constraint == "boolean": + return _Booleans() + if isinstance(constraint, str) and constraint == "verbose": + return _VerboseHelper() + if isinstance(constraint, str) and constraint == "cv_object": + return _CVObjects() + if isinstance(constraint, Hidden): + constraint = make_constraint(constraint.constraint) + constraint.hidden = True + return constraint + if (isinstance(constraint, str) and constraint == "nan") or ( + isinstance(constraint, float) and np.isnan(constraint) + ): + return _NanConstraint() + raise ValueError(f"Unknown constraint type: {constraint}") + + +def validate_params(parameter_constraints, *, prefer_skip_nested_validation): + """Decorator to validate types and values of functions and methods. + + Parameters + ---------- + parameter_constraints : dict + A dictionary `param_name: list of constraints`. See the docstring of + `validate_parameter_constraints` for a description of the accepted constraints. + + Note that the *args and **kwargs parameters are not validated and must not be + present in the parameter_constraints dictionary. + + prefer_skip_nested_validation : bool + If True, the validation of parameters of inner estimators or functions + called by the decorated function will be skipped. + + This is useful to avoid validating many times the parameters passed by the + user from the public facing API. It's also useful to avoid validating + parameters that we pass internally to inner functions that are guaranteed to + be valid by the test suite. + + It should be set to True for most functions, except for those that receive + non-validated objects as parameters or that are just wrappers around classes + because they only perform a partial validation. + + Returns + ------- + decorated_function : function or method + The decorated function. + """ + + def decorator(func): + # The dict of parameter constraints is set as an attribute of the function + # to make it possible to dynamically introspect the constraints for + # automatic testing. + setattr(func, "_skl_parameter_constraints", parameter_constraints) + + @functools.wraps(func) + def wrapper(*args, **kwargs): + global_skip_validation = get_config()["skip_parameter_validation"] + if global_skip_validation: + return func(*args, **kwargs) + + func_sig = signature(func) + + # Map *args/**kwargs to the function signature + params = func_sig.bind(*args, **kwargs) + params.apply_defaults() + + # ignore self/cls and positional/keyword markers + to_ignore = [ + p.name + for p in func_sig.parameters.values() + if p.kind in (p.VAR_POSITIONAL, p.VAR_KEYWORD) + ] + to_ignore += ["self", "cls"] + params = {k: v for k, v in params.arguments.items() if k not in to_ignore} + + validate_parameter_constraints( + parameter_constraints, params, caller_name=func.__qualname__ + ) + + try: + with config_context( + skip_parameter_validation=( + prefer_skip_nested_validation or global_skip_validation + ) + ): + return func(*args, **kwargs) + except InvalidParameterError as e: + # When the function is just a wrapper around an estimator, we allow + # the function to delegate validation to the estimator, but we replace + # the name of the estimator by the name of the function in the error + # message to avoid confusion. + msg = re.sub( + r"parameter of \w+ must be", + f"parameter of {func.__qualname__} must be", + str(e), + ) + raise InvalidParameterError(msg) from e + + return wrapper + + return decorator + + +class RealNotInt(Real): + """A type that represents reals that are not instances of int. + + Behaves like float, but also works with values extracted from numpy arrays. + isintance(1, RealNotInt) -> False + isinstance(1.0, RealNotInt) -> True + """ + + +RealNotInt.register(float) + + +def _type_name(t): + """Convert type into human readable string.""" + module = t.__module__ + qualname = t.__qualname__ + if module == "builtins": + return qualname + elif t == Real: + return "float" + elif t == Integral: + return "int" + return f"{module}.{qualname}" + + +class _Constraint(ABC): + """Base class for the constraint objects.""" + + def __init__(self): + self.hidden = False + + @abstractmethod + def is_satisfied_by(self, val): + """Whether or not a value satisfies the constraint. + + Parameters + ---------- + val : object + The value to check. + + Returns + ------- + is_satisfied : bool + Whether or not the constraint is satisfied by this value. + """ + + @abstractmethod + def __str__(self): + """A human readable representational string of the constraint.""" + + +class _InstancesOf(_Constraint): + """Constraint representing instances of a given type. + + Parameters + ---------- + type : type + The valid type. + """ + + def __init__(self, type): + super().__init__() + self.type = type + + def is_satisfied_by(self, val): + return isinstance(val, self.type) + + def __str__(self): + return f"an instance of {_type_name(self.type)!r}" + + +class _NoneConstraint(_Constraint): + """Constraint representing the None singleton.""" + + def is_satisfied_by(self, val): + return val is None + + def __str__(self): + return "None" + + +class _NanConstraint(_Constraint): + """Constraint representing the indicator `np.nan`.""" + + def is_satisfied_by(self, val): + return ( + not isinstance(val, Integral) and isinstance(val, Real) and math.isnan(val) + ) + + def __str__(self): + return "numpy.nan" + + +class _PandasNAConstraint(_Constraint): + """Constraint representing the indicator `pd.NA`.""" + + def is_satisfied_by(self, val): + try: + import pandas as pd + + return isinstance(val, type(pd.NA)) and pd.isna(val) + except ImportError: + return False + + def __str__(self): + return "pandas.NA" + + +class Options(_Constraint): + """Constraint representing a finite set of instances of a given type. + + Parameters + ---------- + type : type + + options : set + The set of valid scalars. + + deprecated : set or None, default=None + A subset of the `options` to mark as deprecated in the string + representation of the constraint. + """ + + def __init__(self, type, options, *, deprecated=None): + super().__init__() + self.type = type + self.options = options + self.deprecated = deprecated or set() + + if self.deprecated - self.options: + raise ValueError("The deprecated options must be a subset of the options.") + + def is_satisfied_by(self, val): + return isinstance(val, self.type) and val in self.options + + def _mark_if_deprecated(self, option): + """Add a deprecated mark to an option if needed.""" + option_str = f"{option!r}" + if option in self.deprecated: + option_str = f"{option_str} (deprecated)" + return option_str + + def __str__(self): + options_str = ( + f"{', '.join([self._mark_if_deprecated(o) for o in self.options])}" + ) + return f"a {_type_name(self.type)} among {{{options_str}}}" + + +class StrOptions(Options): + """Constraint representing a finite set of strings. + + Parameters + ---------- + options : set of str + The set of valid strings. + + deprecated : set of str or None, default=None + A subset of the `options` to mark as deprecated in the string + representation of the constraint. + """ + + def __init__(self, options, *, deprecated=None): + super().__init__(type=str, options=options, deprecated=deprecated) + + +class Interval(_Constraint): + """Constraint representing a typed interval. + + Parameters + ---------- + type : {numbers.Integral, numbers.Real, RealNotInt} + The set of numbers in which to set the interval. + + If RealNotInt, only reals that don't have the integer type + are allowed. For example 1.0 is allowed but 1 is not. + + left : float or int or None + The left bound of the interval. None means left bound is -∞. + + right : float, int or None + The right bound of the interval. None means right bound is +∞. + + closed : {"left", "right", "both", "neither"} + Whether the interval is open or closed. Possible choices are: + + - `"left"`: the interval is closed on the left and open on the right. + It is equivalent to the interval `[ left, right )`. + - `"right"`: the interval is closed on the right and open on the left. + It is equivalent to the interval `( left, right ]`. + - `"both"`: the interval is closed. + It is equivalent to the interval `[ left, right ]`. + - `"neither"`: the interval is open. + It is equivalent to the interval `( left, right )`. + + Notes + ----- + Setting a bound to `None` and setting the interval closed is valid. For instance, + strictly speaking, `Interval(Real, 0, None, closed="both")` corresponds to + `[0, +∞) U {+∞}`. + """ + + def __init__(self, type, left, right, *, closed): + super().__init__() + self.type = type + self.left = left + self.right = right + self.closed = closed + + self._check_params() + + def _check_params(self): + if self.type not in (Integral, Real, RealNotInt): + raise ValueError( + "type must be either numbers.Integral, numbers.Real or RealNotInt." + f" Got {self.type} instead." + ) + + if self.closed not in ("left", "right", "both", "neither"): + raise ValueError( + "closed must be either 'left', 'right', 'both' or 'neither'. " + f"Got {self.closed} instead." + ) + + if self.type is Integral: + suffix = "for an interval over the integers." + if self.left is not None and not isinstance(self.left, Integral): + raise TypeError(f"Expecting left to be an int {suffix}") + if self.right is not None and not isinstance(self.right, Integral): + raise TypeError(f"Expecting right to be an int {suffix}") + if self.left is None and self.closed in ("left", "both"): + raise ValueError( + f"left can't be None when closed == {self.closed} {suffix}" + ) + if self.right is None and self.closed in ("right", "both"): + raise ValueError( + f"right can't be None when closed == {self.closed} {suffix}" + ) + else: + if self.left is not None and not isinstance(self.left, Real): + raise TypeError("Expecting left to be a real number.") + if self.right is not None and not isinstance(self.right, Real): + raise TypeError("Expecting right to be a real number.") + + if self.right is not None and self.left is not None and self.right <= self.left: + raise ValueError( + f"right can't be less than left. Got left={self.left} and " + f"right={self.right}" + ) + + def __contains__(self, val): + if not isinstance(val, Integral) and np.isnan(val): + return False + + left_cmp = operator.lt if self.closed in ("left", "both") else operator.le + right_cmp = operator.gt if self.closed in ("right", "both") else operator.ge + + left = -np.inf if self.left is None else self.left + right = np.inf if self.right is None else self.right + + if left_cmp(val, left): + return False + if right_cmp(val, right): + return False + return True + + def is_satisfied_by(self, val): + if not isinstance(val, self.type): + return False + + return val in self + + def __str__(self): + type_str = "an int" if self.type is Integral else "a float" + left_bracket = "[" if self.closed in ("left", "both") else "(" + left_bound = "-inf" if self.left is None else self.left + right_bound = "inf" if self.right is None else self.right + right_bracket = "]" if self.closed in ("right", "both") else ")" + + # better repr if the bounds were given as integers + if not self.type == Integral and isinstance(self.left, Real): + left_bound = float(left_bound) + if not self.type == Integral and isinstance(self.right, Real): + right_bound = float(right_bound) + + return ( + f"{type_str} in the range " + f"{left_bracket}{left_bound}, {right_bound}{right_bracket}" + ) + + +class _ArrayLikes(_Constraint): + """Constraint representing array-likes""" + + def is_satisfied_by(self, val): + return _is_arraylike_not_scalar(val) + + def __str__(self): + return "an array-like" + + +class _SparseMatrices(_Constraint): + """Constraint representing sparse matrices.""" + + def is_satisfied_by(self, val): + return issparse(val) + + def __str__(self): + return "a sparse matrix" + + +class _Callables(_Constraint): + """Constraint representing callables.""" + + def is_satisfied_by(self, val): + return callable(val) + + def __str__(self): + return "a callable" + + +class _RandomStates(_Constraint): + """Constraint representing random states. + + Convenience class for + [Interval(Integral, 0, 2**32 - 1, closed="both"), np.random.RandomState, None] + """ + + def __init__(self): + super().__init__() + self._constraints = [ + Interval(Integral, 0, 2**32 - 1, closed="both"), + _InstancesOf(np.random.RandomState), + _NoneConstraint(), + ] + + def is_satisfied_by(self, val): + return any(c.is_satisfied_by(val) for c in self._constraints) + + def __str__(self): + return ( + f"{', '.join([str(c) for c in self._constraints[:-1]])} or" + f" {self._constraints[-1]}" + ) + + +class _Booleans(_Constraint): + """Constraint representing boolean likes. + + Convenience class for + [bool, np.bool_] + """ + + def __init__(self): + super().__init__() + self._constraints = [ + _InstancesOf(bool), + _InstancesOf(np.bool_), + ] + + def is_satisfied_by(self, val): + return any(c.is_satisfied_by(val) for c in self._constraints) + + def __str__(self): + return ( + f"{', '.join([str(c) for c in self._constraints[:-1]])} or" + f" {self._constraints[-1]}" + ) + + +class _VerboseHelper(_Constraint): + """Helper constraint for the verbose parameter. + + Convenience class for + [Interval(Integral, 0, None, closed="left"), bool, numpy.bool_] + """ + + def __init__(self): + super().__init__() + self._constraints = [ + Interval(Integral, 0, None, closed="left"), + _InstancesOf(bool), + _InstancesOf(np.bool_), + ] + + def is_satisfied_by(self, val): + return any(c.is_satisfied_by(val) for c in self._constraints) + + def __str__(self): + return ( + f"{', '.join([str(c) for c in self._constraints[:-1]])} or" + f" {self._constraints[-1]}" + ) + + +class MissingValues(_Constraint): + """Helper constraint for the `missing_values` parameters. + + Convenience for + [ + Integral, + Interval(Real, None, None, closed="both"), + str, # when numeric_only is False + None, # when numeric_only is False + _NanConstraint(), + _PandasNAConstraint(), + ] + + Parameters + ---------- + numeric_only : bool, default=False + Whether to consider only numeric missing value markers. + + """ + + def __init__(self, numeric_only=False): + super().__init__() + + self.numeric_only = numeric_only + + self._constraints = [ + _InstancesOf(Integral), + # we use an interval of Real to ignore np.nan that has its own constraint + Interval(Real, None, None, closed="both"), + _NanConstraint(), + _PandasNAConstraint(), + ] + if not self.numeric_only: + self._constraints.extend([_InstancesOf(str), _NoneConstraint()]) + + def is_satisfied_by(self, val): + return any(c.is_satisfied_by(val) for c in self._constraints) + + def __str__(self): + return ( + f"{', '.join([str(c) for c in self._constraints[:-1]])} or" + f" {self._constraints[-1]}" + ) + + +class HasMethods(_Constraint): + """Constraint representing objects that expose specific methods. + + It is useful for parameters following a protocol and where we don't want to impose + an affiliation to a specific module or class. + + Parameters + ---------- + methods : str or list of str + The method(s) that the object is expected to expose. + """ + + @validate_params( + {"methods": [str, list]}, + prefer_skip_nested_validation=True, + ) + def __init__(self, methods): + super().__init__() + if isinstance(methods, str): + methods = [methods] + self.methods = methods + + def is_satisfied_by(self, val): + return all(callable(getattr(val, method, None)) for method in self.methods) + + def __str__(self): + if len(self.methods) == 1: + methods = f"{self.methods[0]!r}" + else: + methods = ( + f"{', '.join([repr(m) for m in self.methods[:-1]])} and" + f" {self.methods[-1]!r}" + ) + return f"an object implementing {methods}" + + +class _IterablesNotString(_Constraint): + """Constraint representing iterables that are not strings.""" + + def is_satisfied_by(self, val): + return isinstance(val, Iterable) and not isinstance(val, str) + + def __str__(self): + return "an iterable" + + +class _CVObjects(_Constraint): + """Constraint representing cv objects. + + Convenient class for + [ + Interval(Integral, 2, None, closed="left"), + HasMethods(["split", "get_n_splits"]), + _IterablesNotString(), + None, + ] + """ + + def __init__(self): + super().__init__() + self._constraints = [ + Interval(Integral, 2, None, closed="left"), + HasMethods(["split", "get_n_splits"]), + _IterablesNotString(), + _NoneConstraint(), + ] + + def is_satisfied_by(self, val): + return any(c.is_satisfied_by(val) for c in self._constraints) + + def __str__(self): + return ( + f"{', '.join([str(c) for c in self._constraints[:-1]])} or" + f" {self._constraints[-1]}" + ) + + +class Hidden: + """Class encapsulating a constraint not meant to be exposed to the user. + + Parameters + ---------- + constraint : str or _Constraint instance + The constraint to be used internally. + """ + + def __init__(self, constraint): + self.constraint = constraint + + +def generate_invalid_param_val(constraint): + """Return a value that does not satisfy the constraint. + + Raises a NotImplementedError if there exists no invalid value for this constraint. + + This is only useful for testing purpose. + + Parameters + ---------- + constraint : _Constraint instance + The constraint to generate a value for. + + Returns + ------- + val : object + A value that does not satisfy the constraint. + """ + if isinstance(constraint, StrOptions): + return f"not {' or '.join(constraint.options)}" + + if isinstance(constraint, MissingValues): + return np.array([1, 2, 3]) + + if isinstance(constraint, _VerboseHelper): + return -1 + + if isinstance(constraint, HasMethods): + return type("HasNotMethods", (), {})() + + if isinstance(constraint, _IterablesNotString): + return "a string" + + if isinstance(constraint, _CVObjects): + return "not a cv object" + + if isinstance(constraint, Interval) and constraint.type is Integral: + if constraint.left is not None: + return constraint.left - 1 + if constraint.right is not None: + return constraint.right + 1 + + # There's no integer outside (-inf, +inf) + raise NotImplementedError + + if isinstance(constraint, Interval) and constraint.type in (Real, RealNotInt): + if constraint.left is not None: + return constraint.left - 1e-6 + if constraint.right is not None: + return constraint.right + 1e-6 + + # bounds are -inf, +inf + if constraint.closed in ("right", "neither"): + return -np.inf + if constraint.closed in ("left", "neither"): + return np.inf + + # interval is [-inf, +inf] + return np.nan + + raise NotImplementedError + + +def generate_valid_param(constraint): + """Return a value that does satisfy a constraint. + + This is only useful for testing purpose. + + Parameters + ---------- + constraint : Constraint instance + The constraint to generate a value for. + + Returns + ------- + val : object + A value that does satisfy the constraint. + """ + if isinstance(constraint, _ArrayLikes): + return np.array([1, 2, 3]) + + if isinstance(constraint, _SparseMatrices): + return csr_matrix([[0, 1], [1, 0]]) + + if isinstance(constraint, _RandomStates): + return np.random.RandomState(42) + + if isinstance(constraint, _Callables): + return lambda x: x + + if isinstance(constraint, _NoneConstraint): + return None + + if isinstance(constraint, _InstancesOf): + if constraint.type is np.ndarray: + # special case for ndarray since it can't be instantiated without arguments + return np.array([1, 2, 3]) + + if constraint.type in (Integral, Real): + # special case for Integral and Real since they are abstract classes + return 1 + + return constraint.type() + + if isinstance(constraint, _Booleans): + return True + + if isinstance(constraint, _VerboseHelper): + return 1 + + if isinstance(constraint, MissingValues) and constraint.numeric_only: + return np.nan + + if isinstance(constraint, MissingValues) and not constraint.numeric_only: + return "missing" + + if isinstance(constraint, HasMethods): + return type( + "ValidHasMethods", (), {m: lambda self: None for m in constraint.methods} + )() + + if isinstance(constraint, _IterablesNotString): + return [1, 2, 3] + + if isinstance(constraint, _CVObjects): + return 5 + + if isinstance(constraint, Options): # includes StrOptions + for option in constraint.options: + return option + + if isinstance(constraint, Interval): + interval = constraint + if interval.left is None and interval.right is None: + return 0 + elif interval.left is None: + return interval.right - 1 + elif interval.right is None: + return interval.left + 1 + else: + if interval.type is Real: + return (interval.left + interval.right) / 2 + else: + return interval.left + 1 + + raise ValueError(f"Unknown constraint type: {constraint}") diff --git a/shared/package-files/1f/1f7c72d37dca932cd875eb3c732d17c01de6273fd30f8b38f85e236ed94cd2e3/pprint.py b/shared/package-files/1f/1f7c72d37dca932cd875eb3c732d17c01de6273fd30f8b38f85e236ed94cd2e3/pprint.py new file mode 100644 index 0000000000000000000000000000000000000000..d91421f0a6bf60a5a79b0c46050941d58637f180 --- /dev/null +++ b/shared/package-files/1f/1f7c72d37dca932cd875eb3c732d17c01de6273fd30f8b38f85e236ed94cd2e3/pprint.py @@ -0,0 +1,670 @@ +# Author: Fred L. Drake, Jr. +# fdrake@acm.org +# +# This is a simple little module I wrote to make life easier. I didn't +# see anything quite like it in the library, though I may have overlooked +# something. I wrote this when I was trying to read some heavily nested +# tuples with fairly non-descriptive content. This is modeled very much +# after Lisp/Scheme - style pretty-printing of lists. If you find it +# useful, thank small children who sleep at night. + +"""Support to pretty-print lists, tuples, & dictionaries recursively. + +Very simple, but useful, especially in debugging data structures. + +Classes +------- + +PrettyPrinter() + Handle pretty-printing operations onto a stream using a configured + set of formatting parameters. + +Functions +--------- + +pformat() + Format a Python object into a pretty-printed representation. + +pprint() + Pretty-print a Python object to a stream [default is sys.stdout]. + +saferepr() + Generate a 'standard' repr()-like value, but protect against recursive + data structures. + +""" + +import collections as _collections +import dataclasses as _dataclasses +import re +import sys as _sys +import types as _types +from io import StringIO as _StringIO + +__all__ = ["pprint","pformat","isreadable","isrecursive","saferepr", + "PrettyPrinter", "pp"] + + +def pprint(object, stream=None, indent=1, width=80, depth=None, *, + compact=False, sort_dicts=True, underscore_numbers=False): + """Pretty-print a Python object to a stream [default is sys.stdout].""" + printer = PrettyPrinter( + stream=stream, indent=indent, width=width, depth=depth, + compact=compact, sort_dicts=sort_dicts, + underscore_numbers=underscore_numbers) + printer.pprint(object) + +def pformat(object, indent=1, width=80, depth=None, *, + compact=False, sort_dicts=True, underscore_numbers=False): + """Format a Python object into a pretty-printed representation.""" + return PrettyPrinter(indent=indent, width=width, depth=depth, + compact=compact, sort_dicts=sort_dicts, + underscore_numbers=underscore_numbers).pformat(object) + +def pp(object, *args, sort_dicts=False, **kwargs): + """Pretty-print a Python object""" + pprint(object, *args, sort_dicts=sort_dicts, **kwargs) + +def saferepr(object): + """Version of repr() which can handle recursive data structures.""" + return PrettyPrinter()._safe_repr(object, {}, None, 0)[0] + +def isreadable(object): + """Determine if saferepr(object) is readable by eval().""" + return PrettyPrinter()._safe_repr(object, {}, None, 0)[1] + +def isrecursive(object): + """Determine if object requires a recursive representation.""" + return PrettyPrinter()._safe_repr(object, {}, None, 0)[2] + +class _safe_key: + """Helper function for key functions when sorting unorderable objects. + + The wrapped-object will fallback to a Py2.x style comparison for + unorderable types (sorting first comparing the type name and then by + the obj ids). Does not work recursively, so dict.items() must have + _safe_key applied to both the key and the value. + + """ + + __slots__ = ['obj'] + + def __init__(self, obj): + self.obj = obj + + def __lt__(self, other): + try: + return self.obj < other.obj + except TypeError: + return ((str(type(self.obj)), id(self.obj)) < \ + (str(type(other.obj)), id(other.obj))) + +def _safe_tuple(t): + "Helper function for comparing 2-tuples" + return _safe_key(t[0]), _safe_key(t[1]) + +class PrettyPrinter: + def __init__(self, indent=1, width=80, depth=None, stream=None, *, + compact=False, sort_dicts=True, underscore_numbers=False): + """Handle pretty printing operations onto a stream using a set of + configured parameters. + + indent + Number of spaces to indent for each level of nesting. + + width + Attempted maximum number of columns in the output. + + depth + The maximum depth to print out nested structures. + + stream + The desired output stream. If omitted (or false), the standard + output stream available at construction will be used. + + compact + If true, several items will be combined in one line. + + sort_dicts + If true, dict keys are sorted. + + """ + indent = int(indent) + width = int(width) + if indent < 0: + raise ValueError('indent must be >= 0') + if depth is not None and depth <= 0: + raise ValueError('depth must be > 0') + if not width: + raise ValueError('width must be != 0') + self._depth = depth + self._indent_per_level = indent + self._width = width + if stream is not None: + self._stream = stream + else: + self._stream = _sys.stdout + self._compact = bool(compact) + self._sort_dicts = sort_dicts + self._underscore_numbers = underscore_numbers + + def pprint(self, object): + self._format(object, self._stream, 0, 0, {}, 0) + self._stream.write("\n") + + def pformat(self, object): + sio = _StringIO() + self._format(object, sio, 0, 0, {}, 0) + return sio.getvalue() + + def isrecursive(self, object): + return self.format(object, {}, 0, 0)[2] + + def isreadable(self, object): + s, readable, recursive = self.format(object, {}, 0, 0) + return readable and not recursive + + def _format(self, object, stream, indent, allowance, context, level): + objid = id(object) + if objid in context: + stream.write(_recursion(object)) + self._recursive = True + self._readable = False + return + rep = self._repr(object, context, level) + max_width = self._width - indent - allowance + if len(rep) > max_width: + p = self._dispatch.get(type(object).__repr__, None) + if p is not None: + context[objid] = 1 + p(self, object, stream, indent, allowance, context, level + 1) + del context[objid] + return + elif (_dataclasses.is_dataclass(object) and + not isinstance(object, type) and + object.__dataclass_params__.repr and + # Check dataclass has generated repr method. + hasattr(object.__repr__, "__wrapped__") and + "__create_fn__" in object.__repr__.__wrapped__.__qualname__): + context[objid] = 1 + self._pprint_dataclass(object, stream, indent, allowance, context, level + 1) + del context[objid] + return + stream.write(rep) + + def _pprint_dataclass(self, object, stream, indent, allowance, context, level): + cls_name = object.__class__.__name__ + indent += len(cls_name) + 1 + items = [(f.name, getattr(object, f.name)) for f in _dataclasses.fields(object) if f.repr] + stream.write(cls_name + '(') + self._format_namespace_items(items, stream, indent, allowance, context, level) + stream.write(')') + + _dispatch = {} + + def _pprint_dict(self, object, stream, indent, allowance, context, level): + write = stream.write + write('{') + if self._indent_per_level > 1: + write((self._indent_per_level - 1) * ' ') + length = len(object) + if length: + if self._sort_dicts: + items = sorted(object.items(), key=_safe_tuple) + else: + items = object.items() + self._format_dict_items(items, stream, indent, allowance + 1, + context, level) + write('}') + + _dispatch[dict.__repr__] = _pprint_dict + + def _pprint_ordered_dict(self, object, stream, indent, allowance, context, level): + if not len(object): + stream.write(repr(object)) + return + cls = object.__class__ + stream.write(cls.__name__ + '(') + self._format(list(object.items()), stream, + indent + len(cls.__name__) + 1, allowance + 1, + context, level) + stream.write(')') + + _dispatch[_collections.OrderedDict.__repr__] = _pprint_ordered_dict + + def _pprint_list(self, object, stream, indent, allowance, context, level): + stream.write('[') + self._format_items(object, stream, indent, allowance + 1, + context, level) + stream.write(']') + + _dispatch[list.__repr__] = _pprint_list + + def _pprint_tuple(self, object, stream, indent, allowance, context, level): + stream.write('(') + endchar = ',)' if len(object) == 1 else ')' + self._format_items(object, stream, indent, allowance + len(endchar), + context, level) + stream.write(endchar) + + _dispatch[tuple.__repr__] = _pprint_tuple + + def _pprint_set(self, object, stream, indent, allowance, context, level): + if not len(object): + stream.write(repr(object)) + return + typ = object.__class__ + if typ is set: + stream.write('{') + endchar = '}' + else: + stream.write(typ.__name__ + '({') + endchar = '})' + indent += len(typ.__name__) + 1 + object = sorted(object, key=_safe_key) + self._format_items(object, stream, indent, allowance + len(endchar), + context, level) + stream.write(endchar) + + _dispatch[set.__repr__] = _pprint_set + _dispatch[frozenset.__repr__] = _pprint_set + + def _pprint_str(self, object, stream, indent, allowance, context, level): + write = stream.write + if not len(object): + write(repr(object)) + return + chunks = [] + lines = object.splitlines(True) + if level == 1: + indent += 1 + allowance += 1 + max_width1 = max_width = self._width - indent + for i, line in enumerate(lines): + rep = repr(line) + if i == len(lines) - 1: + max_width1 -= allowance + if len(rep) <= max_width1: + chunks.append(rep) + else: + # A list of alternating (non-space, space) strings + parts = re.findall(r'\S*\s*', line) + assert parts + assert not parts[-1] + parts.pop() # drop empty last part + max_width2 = max_width + current = '' + for j, part in enumerate(parts): + candidate = current + part + if j == len(parts) - 1 and i == len(lines) - 1: + max_width2 -= allowance + if len(repr(candidate)) > max_width2: + if current: + chunks.append(repr(current)) + current = part + else: + current = candidate + if current: + chunks.append(repr(current)) + if len(chunks) == 1: + write(rep) + return + if level == 1: + write('(') + for i, rep in enumerate(chunks): + if i > 0: + write('\n' + ' '*indent) + write(rep) + if level == 1: + write(')') + + _dispatch[str.__repr__] = _pprint_str + + def _pprint_bytes(self, object, stream, indent, allowance, context, level): + write = stream.write + if len(object) <= 4: + write(repr(object)) + return + parens = level == 1 + if parens: + indent += 1 + allowance += 1 + write('(') + delim = '' + for rep in _wrap_bytes_repr(object, self._width - indent, allowance): + write(delim) + write(rep) + if not delim: + delim = '\n' + ' '*indent + if parens: + write(')') + + _dispatch[bytes.__repr__] = _pprint_bytes + + def _pprint_bytearray(self, object, stream, indent, allowance, context, level): + write = stream.write + write('bytearray(') + self._pprint_bytes(bytes(object), stream, indent + 10, + allowance + 1, context, level + 1) + write(')') + + _dispatch[bytearray.__repr__] = _pprint_bytearray + + def _pprint_mappingproxy(self, object, stream, indent, allowance, context, level): + stream.write('mappingproxy(') + self._format(object.copy(), stream, indent + 13, allowance + 1, + context, level) + stream.write(')') + + _dispatch[_types.MappingProxyType.__repr__] = _pprint_mappingproxy + + def _pprint_simplenamespace(self, object, stream, indent, allowance, context, level): + if type(object) is _types.SimpleNamespace: + # The SimpleNamespace repr is "namespace" instead of the class + # name, so we do the same here. For subclasses; use the class name. + cls_name = 'namespace' + else: + cls_name = object.__class__.__name__ + indent += len(cls_name) + 1 + items = object.__dict__.items() + stream.write(cls_name + '(') + self._format_namespace_items(items, stream, indent, allowance, context, level) + stream.write(')') + + _dispatch[_types.SimpleNamespace.__repr__] = _pprint_simplenamespace + + def _format_dict_items(self, items, stream, indent, allowance, context, + level): + write = stream.write + indent += self._indent_per_level + delimnl = ',\n' + ' ' * indent + last_index = len(items) - 1 + for i, (key, ent) in enumerate(items): + last = i == last_index + rep = self._repr(key, context, level) + write(rep) + write(': ') + self._format(ent, stream, indent + len(rep) + 2, + allowance if last else 1, + context, level) + if not last: + write(delimnl) + + def _format_namespace_items(self, items, stream, indent, allowance, context, level): + write = stream.write + delimnl = ',\n' + ' ' * indent + last_index = len(items) - 1 + for i, (key, ent) in enumerate(items): + last = i == last_index + write(key) + write('=') + if id(ent) in context: + # Special-case representation of recursion to match standard + # recursive dataclass repr. + write("...") + else: + self._format(ent, stream, indent + len(key) + 1, + allowance if last else 1, + context, level) + if not last: + write(delimnl) + + def _format_items(self, items, stream, indent, allowance, context, level): + write = stream.write + indent += self._indent_per_level + if self._indent_per_level > 1: + write((self._indent_per_level - 1) * ' ') + delimnl = ',\n' + ' ' * indent + delim = '' + width = max_width = self._width - indent + 1 + it = iter(items) + try: + next_ent = next(it) + except StopIteration: + return + last = False + while not last: + ent = next_ent + try: + next_ent = next(it) + except StopIteration: + last = True + max_width -= allowance + width -= allowance + if self._compact: + rep = self._repr(ent, context, level) + w = len(rep) + 2 + if width < w: + width = max_width + if delim: + delim = delimnl + if width >= w: + width -= w + write(delim) + delim = ', ' + write(rep) + continue + write(delim) + delim = delimnl + self._format(ent, stream, indent, + allowance if last else 1, + context, level) + + def _repr(self, object, context, level): + repr, readable, recursive = self.format(object, context.copy(), + self._depth, level) + if not readable: + self._readable = False + if recursive: + self._recursive = True + return repr + + def format(self, object, context, maxlevels, level): + """Format object for a specific context, returning a string + and flags indicating whether the representation is 'readable' + and whether the object represents a recursive construct. + """ + return self._safe_repr(object, context, maxlevels, level) + + def _pprint_default_dict(self, object, stream, indent, allowance, context, level): + if not len(object): + stream.write(repr(object)) + return + rdf = self._repr(object.default_factory, context, level) + cls = object.__class__ + indent += len(cls.__name__) + 1 + stream.write('%s(%s,\n%s' % (cls.__name__, rdf, ' ' * indent)) + self._pprint_dict(object, stream, indent, allowance + 1, context, level) + stream.write(')') + + _dispatch[_collections.defaultdict.__repr__] = _pprint_default_dict + + def _pprint_counter(self, object, stream, indent, allowance, context, level): + if not len(object): + stream.write(repr(object)) + return + cls = object.__class__ + stream.write(cls.__name__ + '({') + if self._indent_per_level > 1: + stream.write((self._indent_per_level - 1) * ' ') + items = object.most_common() + self._format_dict_items(items, stream, + indent + len(cls.__name__) + 1, allowance + 2, + context, level) + stream.write('})') + + _dispatch[_collections.Counter.__repr__] = _pprint_counter + + def _pprint_chain_map(self, object, stream, indent, allowance, context, level): + if not len(object.maps): + stream.write(repr(object)) + return + cls = object.__class__ + stream.write(cls.__name__ + '(') + indent += len(cls.__name__) + 1 + for i, m in enumerate(object.maps): + if i == len(object.maps) - 1: + self._format(m, stream, indent, allowance + 1, context, level) + stream.write(')') + else: + self._format(m, stream, indent, 1, context, level) + stream.write(',\n' + ' ' * indent) + + _dispatch[_collections.ChainMap.__repr__] = _pprint_chain_map + + def _pprint_deque(self, object, stream, indent, allowance, context, level): + if not len(object): + stream.write(repr(object)) + return + cls = object.__class__ + stream.write(cls.__name__ + '(') + indent += len(cls.__name__) + 1 + stream.write('[') + if object.maxlen is None: + self._format_items(object, stream, indent, allowance + 2, + context, level) + stream.write('])') + else: + self._format_items(object, stream, indent, 2, + context, level) + rml = self._repr(object.maxlen, context, level) + stream.write('],\n%smaxlen=%s)' % (' ' * indent, rml)) + + _dispatch[_collections.deque.__repr__] = _pprint_deque + + def _pprint_user_dict(self, object, stream, indent, allowance, context, level): + self._format(object.data, stream, indent, allowance, context, level - 1) + + _dispatch[_collections.UserDict.__repr__] = _pprint_user_dict + + def _pprint_user_list(self, object, stream, indent, allowance, context, level): + self._format(object.data, stream, indent, allowance, context, level - 1) + + _dispatch[_collections.UserList.__repr__] = _pprint_user_list + + def _pprint_user_string(self, object, stream, indent, allowance, context, level): + self._format(object.data, stream, indent, allowance, context, level - 1) + + _dispatch[_collections.UserString.__repr__] = _pprint_user_string + + def _safe_repr(self, object, context, maxlevels, level): + # Return triple (repr_string, isreadable, isrecursive). + typ = type(object) + if typ in _builtin_scalars: + return repr(object), True, False + + r = getattr(typ, "__repr__", None) + + if issubclass(typ, int) and r is int.__repr__: + if self._underscore_numbers: + return f"{object:_d}", True, False + else: + return repr(object), True, False + + if issubclass(typ, dict) and r is dict.__repr__: + if not object: + return "{}", True, False + objid = id(object) + if maxlevels and level >= maxlevels: + return "{...}", False, objid in context + if objid in context: + return _recursion(object), False, True + context[objid] = 1 + readable = True + recursive = False + components = [] + append = components.append + level += 1 + if self._sort_dicts: + items = sorted(object.items(), key=_safe_tuple) + else: + items = object.items() + for k, v in items: + krepr, kreadable, krecur = self.format( + k, context, maxlevels, level) + vrepr, vreadable, vrecur = self.format( + v, context, maxlevels, level) + append("%s: %s" % (krepr, vrepr)) + readable = readable and kreadable and vreadable + if krecur or vrecur: + recursive = True + del context[objid] + return "{%s}" % ", ".join(components), readable, recursive + + if (issubclass(typ, list) and r is list.__repr__) or \ + (issubclass(typ, tuple) and r is tuple.__repr__): + if issubclass(typ, list): + if not object: + return "[]", True, False + format = "[%s]" + elif len(object) == 1: + format = "(%s,)" + else: + if not object: + return "()", True, False + format = "(%s)" + objid = id(object) + if maxlevels and level >= maxlevels: + return format % "...", False, objid in context + if objid in context: + return _recursion(object), False, True + context[objid] = 1 + readable = True + recursive = False + components = [] + append = components.append + level += 1 + for o in object: + orepr, oreadable, orecur = self.format( + o, context, maxlevels, level) + append(orepr) + if not oreadable: + readable = False + if orecur: + recursive = True + del context[objid] + return format % ", ".join(components), readable, recursive + + rep = repr(object) + return rep, (rep and not rep.startswith('<')), False + +_builtin_scalars = frozenset({str, bytes, bytearray, float, complex, + bool, type(None)}) + +def _recursion(object): + return ("" + % (type(object).__name__, id(object))) + + +def _perfcheck(object=None): + import time + if object is None: + object = [("string", (1, 2), [3, 4], {5: 6, 7: 8})] * 100000 + p = PrettyPrinter() + t1 = time.perf_counter() + p._safe_repr(object, {}, None, 0, True) + t2 = time.perf_counter() + p.pformat(object) + t3 = time.perf_counter() + print("_safe_repr:", t2 - t1) + print("pformat:", t3 - t2) + +def _wrap_bytes_repr(object, width, allowance): + current = b'' + last = len(object) // 4 * 4 + for i in range(0, len(object), 4): + part = object[i: i+4] + candidate = current + part + if i == last: + width -= allowance + if len(repr(candidate)) > width: + if current: + yield repr(current) + current = part + else: + current = candidate + if current: + yield repr(current) + +if __name__ == "__main__": + _perfcheck() diff --git a/shared/package-files/1f/1f81141da40215c6463fb7f03ac38bd2f5cfd7dfb760881371a194e32c08c489/mps_convolution_backward_ops.h b/shared/package-files/1f/1f81141da40215c6463fb7f03ac38bd2f5cfd7dfb760881371a194e32c08c489/mps_convolution_backward_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..fc26dff1430016f9ebc126e5dcc225a8ef1778ef --- /dev/null +++ b/shared/package-files/1f/1f81141da40215c6463fb7f03ac38bd2f5cfd7dfb760881371a194e32c08c489/mps_convolution_backward_ops.h @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API mps_convolution_backward { + using schema = ::std::tuple (const at::Tensor &, const at::Tensor &, const at::Tensor &, c10::SymIntArrayRef, c10::SymIntArrayRef, c10::SymIntArrayRef, c10::SymInt, ::std::array); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::mps_convolution_backward") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "mps_convolution_backward(Tensor self, Tensor grad_output, Tensor weight, SymInt[] padding, SymInt[] stride, SymInt[] dilation, SymInt groups, bool[3] output_mask) -> (Tensor, Tensor, Tensor)") + static ::std::tuple call(const at::Tensor & self, const at::Tensor & grad_output, const at::Tensor & weight, c10::SymIntArrayRef padding, c10::SymIntArrayRef stride, c10::SymIntArrayRef dilation, c10::SymInt groups, ::std::array output_mask); + static ::std::tuple redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & grad_output, const at::Tensor & weight, c10::SymIntArrayRef padding, c10::SymIntArrayRef stride, c10::SymIntArrayRef dilation, c10::SymInt groups, ::std::array output_mask); +}; + +struct TORCH_API mps_convolution_backward_out { + using schema = ::std::tuple (const at::Tensor &, const at::Tensor &, const at::Tensor &, c10::SymIntArrayRef, c10::SymIntArrayRef, c10::SymIntArrayRef, c10::SymInt, ::std::array, at::Tensor &, at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::mps_convolution_backward") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "mps_convolution_backward.out(Tensor self, Tensor grad_output, Tensor weight, SymInt[] padding, SymInt[] stride, SymInt[] dilation, SymInt groups, bool[3] output_mask, *, Tensor(a!) out0, Tensor(b!) out1, Tensor(c!) out2) -> (Tensor(a!), Tensor(b!), Tensor(c!))") + static ::std::tuple call(const at::Tensor & self, const at::Tensor & grad_output, const at::Tensor & weight, c10::SymIntArrayRef padding, c10::SymIntArrayRef stride, c10::SymIntArrayRef dilation, c10::SymInt groups, ::std::array output_mask, at::Tensor & out0, at::Tensor & out1, at::Tensor & out2); + static ::std::tuple redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & grad_output, const at::Tensor & weight, c10::SymIntArrayRef padding, c10::SymIntArrayRef stride, c10::SymIntArrayRef dilation, c10::SymInt groups, ::std::array output_mask, at::Tensor & out0, at::Tensor & out1, at::Tensor & out2); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/1f/1f8219810623ae657a2136fb89ec77178ab0052143c8f6ddadbd1ee195db90c6/_dsp.py b/shared/package-files/1f/1f8219810623ae657a2136fb89ec77178ab0052143c8f6ddadbd1ee195db90c6/_dsp.py new file mode 100644 index 0000000000000000000000000000000000000000..72b1a153f57eaec1b464ad42199cf6f6e331ae26 --- /dev/null +++ b/shared/package-files/1f/1f8219810623ae657a2136fb89ec77178ab0052143c8f6ddadbd1ee195db90c6/_dsp.py @@ -0,0 +1,433 @@ +import warnings +from typing import List, Optional, Union + +import torch + +from torchaudio.functional import fftconvolve + + +def oscillator_bank( + frequencies: torch.Tensor, + amplitudes: torch.Tensor, + sample_rate: float, + reduction: str = "sum", + dtype: Optional[torch.dtype] = torch.float64, +) -> torch.Tensor: + """Synthesize waveform from the given instantaneous frequencies and amplitudes. + + .. devices:: CPU CUDA + + .. properties:: Autograd TorchScript + + Note: + The phase information of the output waveform is found by taking the cumulative sum + of the given instantaneous frequencies (``frequencies``). + This incurs roundoff error when the data type does not have enough precision. + Using ``torch.float64`` can work around this. + + The following figure shows the difference between ``torch.float32`` and + ``torch.float64`` when generating a sin wave of constant frequency and amplitude + with sample rate 8000 [Hz]. + Notice that ``torch.float32`` version shows artifacts that are not seen in + ``torch.float64`` version. + + .. image:: https://download.pytorch.org/torchaudio/doc-assets/oscillator_precision.png + + Args: + frequencies (Tensor): Sample-wise oscillator frequencies (Hz). Shape `(..., time, N)`. + amplitudes (Tensor): Sample-wise oscillator amplitude. Shape: `(..., time, N)`. + sample_rate (float): Sample rate + reduction (str): Reduction to perform. + Valid values are ``"sum"``, ``"mean"`` or ``"none"``. Default: ``"sum"`` + dtype (torch.dtype or None, optional): The data type on which cumulative sum operation is performed. + Default: ``torch.float64``. Pass ``None`` to disable the casting. + + Returns: + Tensor: + The resulting waveform. + + If ``reduction`` is ``"none"``, then the shape is + `(..., time, N)`, otherwise the shape is `(..., time)`. + """ + if frequencies.shape != amplitudes.shape: + raise ValueError( + "The shapes of `frequencies` and `amplitudes` must match. " + f"Found: {frequencies.shape} and {amplitudes.shape} respectively." + ) + reductions = ["sum", "mean", "none"] + if reduction not in reductions: + raise ValueError(f"The value of reduction must be either {reductions}. Found: {reduction}") + + invalid = torch.abs(frequencies) >= sample_rate / 2 + if torch.any(invalid): + warnings.warn( + "Some frequencies are above nyquist frequency. " + "Setting the corresponding amplitude to zero. " + "This might cause numerically unstable gradient." + ) + amplitudes = torch.where(invalid, 0.0, amplitudes) + + pi2 = 2.0 * torch.pi + freqs = frequencies * pi2 / sample_rate % pi2 + phases = torch.cumsum(freqs, dim=-2, dtype=dtype) + if dtype is not None and freqs.dtype != dtype: + phases = phases.to(freqs.dtype) + + waveform = amplitudes * torch.sin(phases) + if reduction == "sum": + return waveform.sum(-1) + if reduction == "mean": + return waveform.mean(-1) + return waveform + + +def adsr_envelope( + num_frames: int, + *, + attack: float = 0.0, + hold: float = 0.0, + decay: float = 0.0, + sustain: float = 1.0, + release: float = 0.0, + n_decay: int = 2, + dtype: Optional[torch.dtype] = None, + device: Optional[torch.device] = None, +): + """Generate ADSR Envelope + + .. devices:: CPU CUDA + + Args: + num_frames (int): The number of output frames. + attack (float, optional): + The relative *time* it takes to reach the maximum level from + the start. (Default: ``0.0``) + hold (float, optional): + The relative *time* the maximum level is held before + it starts to decay. (Default: ``0.0``) + decay (float, optional): + The relative *time* it takes to sustain from + the maximum level. (Default: ``0.0``) + sustain (float, optional): The relative *level* at which + the sound should sustain. (Default: ``1.0``) + + .. Note:: + The duration of sustain is derived as `1.0 - (The sum of attack, hold, decay and release)`. + + release (float, optional): The relative *time* it takes for the sound level to + reach zero after the sustain. (Default: ``0.0``) + n_decay (int, optional): The degree of polynomial decay. Default: ``2``. + dtype (torch.dtype, optional): the desired data type of returned tensor. + Default: if ``None``, uses a global default + (see :py:func:`torch.set_default_tensor_type`). + device (torch.device, optional): the desired device of returned tensor. + Default: if ``None``, uses the current device for the default tensor type + (see :py:func:`torch.set_default_tensor_type`). + device will be the CPU for CPU tensor types and the current CUDA + device for CUDA tensor types. + + Returns: + Tensor: ADSR Envelope. Shape: `(num_frames, )` + + Example + .. image:: https://download.pytorch.org/torchaudio/doc-assets/adsr_examples.png + + """ + if not 0 <= attack <= 1: + raise ValueError(f"The value of `attack` must be within [0, 1]. Found: {attack}") + if not 0 <= decay <= 1: + raise ValueError(f"The value of `decay` must be within [0, 1]. Found: {decay}") + if not 0 <= sustain <= 1: + raise ValueError(f"The value of `sustain` must be within [0, 1]. Found: {sustain}") + if not 0 <= hold <= 1: + raise ValueError(f"The value of `hold` must be within [0, 1]. Found: {hold}") + if not 0 <= release <= 1: + raise ValueError(f"The value of `release` must be within [0, 1]. Found: {release}") + if attack + decay + release + hold > 1: + raise ValueError("The sum of `attack`, `hold`, `decay` and `release` must not exceed 1.") + + nframes = num_frames - 1 + num_a = int(nframes * attack) + num_h = int(nframes * hold) + num_d = int(nframes * decay) + num_r = int(nframes * release) + + # Initialize with sustain + out = torch.full((num_frames,), float(sustain), device=device, dtype=dtype) + + # attack + if num_a > 0: + torch.linspace(0.0, 1.0, num_a + 1, out=out[: num_a + 1]) + + # hold + if num_h > 0: + out[num_a : num_a + num_h + 1] = 1.0 + + # decay + if num_d > 0: + # Compute: sustain + (1.0 - sustain) * (linspace[1, 0] ** n_decay) + i = num_a + num_h + decay = out[i : i + num_d + 1] + torch.linspace(1.0, 0.0, num_d + 1, out=decay) + decay **= n_decay + decay *= 1.0 - sustain + decay += sustain + + # sustain is handled by initialization + + # release + if num_r > 0: + torch.linspace(sustain, 0, num_r + 1, out=out[-num_r - 1 :]) + + return out + + +def extend_pitch( + base: torch.Tensor, + pattern: Union[int, List[float], torch.Tensor], +): + """Extend the given time series values with multipliers of them. + + .. devices:: CPU CUDA + + .. properties:: Autograd TorchScript + + Given a series of fundamental frequencies (pitch), this function appends + its harmonic overtones or inharmonic partials. + + Args: + base (torch.Tensor): + Base time series, like fundamental frequencies (Hz). Shape: `(..., time, 1)`. + pattern (int, list of floats or torch.Tensor): + If ``int``, the number of pitch series after the operation. + `pattern - 1` tones are added, so that the resulting Tensor contains + up to `pattern`-th overtones of the given series. + + If list of float or ``torch.Tensor``, it must be one dimensional, + representing the custom multiplier of the fundamental frequency. + + Returns: + Tensor: Oscillator frequencies (Hz). Shape: `(..., time, num_tones)`. + + Example + >>> # fundamental frequency + >>> f0 = torch.linspace(1, 5, 5).unsqueeze(-1) + >>> f0 + tensor([[1.], + [2.], + [3.], + [4.], + [5.]]) + >>> # Add harmonic overtones, up to 3rd. + >>> f = extend_pitch(f0, 3) + >>> f.shape + torch.Size([5, 3]) + >>> f + tensor([[ 1., 2., 3.], + [ 2., 4., 6.], + [ 3., 6., 9.], + [ 4., 8., 12.], + [ 5., 10., 15.]]) + >>> # Add custom (inharmonic) partials. + >>> f = extend_pitch(f0, torch.tensor([1, 2.1, 3.3, 4.5])) + >>> f.shape + torch.Size([5, 4]) + >>> f + tensor([[ 1.0000, 2.1000, 3.3000, 4.5000], + [ 2.0000, 4.2000, 6.6000, 9.0000], + [ 3.0000, 6.3000, 9.9000, 13.5000], + [ 4.0000, 8.4000, 13.2000, 18.0000], + [ 5.0000, 10.5000, 16.5000, 22.5000]]) + """ + if isinstance(pattern, torch.Tensor): + mult = pattern + elif isinstance(pattern, int): + mult = torch.linspace(1.0, float(pattern), pattern, device=base.device, dtype=base.dtype) + else: + mult = torch.tensor(pattern, dtype=base.dtype, device=base.device) + h_freq = base @ mult.unsqueeze(0) + return h_freq + + +def sinc_impulse_response(cutoff: torch.Tensor, window_size: int = 513, high_pass: bool = False): + """Create windowed-sinc impulse response for given cutoff frequencies. + + .. devices:: CPU CUDA + + .. properties:: Autograd TorchScript + + Args: + cutoff (Tensor): Cutoff frequencies for low-pass sinc filter. + + window_size (int, optional): Size of the Hamming window to apply. Must be odd. + (Default: 513) + + high_pass (bool, optional): + If ``True``, convert the resulting filter to high-pass. + Otherwise low-pass filter is returned. Default: ``False``. + + Returns: + Tensor: A series of impulse responses. Shape: `(..., window_size)`. + """ + if window_size % 2 == 0: + raise ValueError(f"`window_size` must be odd. Given: {window_size}") + + half = window_size // 2 + device, dtype = cutoff.device, cutoff.dtype + idx = torch.linspace(-half, half, window_size, device=device, dtype=dtype) + + filt = torch.special.sinc(cutoff.unsqueeze(-1) * idx.unsqueeze(0)) + filt = filt * torch.hamming_window(window_size, device=device, dtype=dtype, periodic=False).unsqueeze(0) + filt = filt / filt.sum(dim=-1, keepdim=True).abs() + + # High pass IR is obtained by subtracting low_pass IR from delta function. + # https://courses.engr.illinois.edu/ece401/fa2020/slides/lec10.pdf + if high_pass: + filt = -filt + filt[..., half] = 1.0 + filt[..., half] + return filt + + +def frequency_impulse_response(magnitudes): + """Create filter from desired frequency response + + Args: + magnitudes: The desired frequency responses. Shape: `(..., num_fft_bins)` + + Returns: + Tensor: Impulse response. Shape `(..., 2 * (num_fft_bins - 1))` + """ + if magnitudes.min() < 0.0: + # Negative magnitude does not make sense but allowing so that autograd works + # around 0. + # Should we raise error? + warnings.warn("The input frequency response should not contain negative values.") + ir = torch.fft.fftshift(torch.fft.irfft(magnitudes), dim=-1) + device, dtype = magnitudes.device, magnitudes.dtype + window = torch.hann_window(ir.size(-1), periodic=False, device=device, dtype=dtype).expand_as(ir) + return ir * window + + +def _overlap_and_add(waveform, stride): + num_frames, frame_size = waveform.shape[-2:] + numel = (num_frames - 1) * stride + frame_size + buffer = torch.zeros(waveform.shape[:-2] + (numel,), device=waveform.device, dtype=waveform.dtype) + for i in range(num_frames): + start = i * stride + end = start + frame_size + buffer[..., start:end] += waveform[..., i, :] + return buffer + + +def filter_waveform(waveform: torch.Tensor, kernels: torch.Tensor, delay_compensation: int = -1): + """Applies filters along time axis of the given waveform. + + This function applies the given filters along time axis in the following manner: + + 1. Split the given waveform into chunks. The number of chunks is equal to the number of given filters. + 2. Filter each chunk with corresponding filter. + 3. Place the filtered chunks at the original indices while adding up the overlapping parts. + 4. Crop the resulting waveform so that delay introduced by the filter is removed and its length + matches that of the input waveform. + + The following figure illustrates this. + + .. image:: https://download.pytorch.org/torchaudio/doc-assets/filter_waveform.png + + .. note:: + + If the number of filters is one, then the operation becomes stationary. + i.e. the same filtering is applied across the time axis. + + Args: + waveform (Tensor): Shape `(..., time)`. + kernels (Tensor): Impulse responses. + Valid inputs are 2D tensor with shape `(num_filters, filter_length)` or + `(N+1)`-D tensor with shape `(..., num_filters, filter_length)`, where `N` is + the dimension of waveform. + + In case of 2D input, the same set of filters is used across channels and batches. + Otherwise, different sets of filters are applied. In this case, the shape of + the first `N-1` dimensions of filters must match (or be broadcastable to) that of waveform. + + delay_compensation (int): Control how the waveform is cropped after full convolution. + If the value is zero or positive, it is interpreted as the length of crop at the + beginning of the waveform. The value cannot be larger than the size of filter kernel. + Otherwise the initial crop is ``filter_size // 2``. + When cropping happens, the waveform is also cropped from the end so that the + length of the resulting waveform matches the input waveform. + + Returns: + Tensor: `(..., time)`. + """ + if kernels.ndim not in [2, waveform.ndim + 1]: + raise ValueError( + "`kernels` must be 2 or N+1 dimension where " + f"N is the dimension of waveform. Found: {kernels.ndim} (N={waveform.ndim})" + ) + + num_filters, filter_size = kernels.shape[-2:] + num_frames = waveform.size(-1) + + if delay_compensation > filter_size: + raise ValueError( + "When `delay_compenstation` is provided, it cannot be larger than the size of filters." + f"Found: delay_compensation={delay_compensation}, filter_size={filter_size}" + ) + + # Transform waveform's time axis into (num_filters x chunk_length) with optional padding + chunk_length = num_frames // num_filters + if num_frames % num_filters > 0: + chunk_length += 1 + num_pad = chunk_length * num_filters - num_frames + waveform = torch.nn.functional.pad(waveform, [0, num_pad], "constant", 0) + chunked = waveform.unfold(-1, chunk_length, chunk_length) + assert chunked.numel() >= waveform.numel() + + # Broadcast kernels + if waveform.ndim + 1 > kernels.ndim: + expand_shape = waveform.shape[:-1] + kernels.shape + kernels = kernels.expand(expand_shape) + + convolved = fftconvolve(chunked, kernels) + restored = _overlap_and_add(convolved, chunk_length) + + # Trim in a way that the number of samples are same as input, + # and the filter delay is compensated + if delay_compensation >= 0: + start = delay_compensation + else: + start = filter_size // 2 + num_crops = restored.size(-1) - num_frames + end = num_crops - start + result = restored[..., start:-end] + return result + + +def exp_sigmoid( + input: torch.Tensor, exponent: float = 10.0, max_value: float = 2.0, threshold: float = 1e-7 +) -> torch.Tensor: + """Exponential Sigmoid pointwise nonlinearity. + Implements the equation: + ``max_value`` * sigmoid(``input``) ** (log(``exponent``)) + ``threshold`` + + The output has a range of [``threshold``, ``max_value``]. + ``exponent`` controls the slope of the output. + + .. devices:: CPU CUDA + + Args: + input (Tensor): Input Tensor + exponent (float, optional): Exponent. Controls the slope of the output + max_value (float, optional): Maximum value of the output + threshold (float, optional): Minimum value of the output + + Returns: + Tensor: Exponential Sigmoid output. Shape: same as input + + """ + + return max_value * torch.pow( + torch.nn.functional.sigmoid(input), + torch.log(torch.tensor(exponent, device=input.device, dtype=input.dtype)), + ) + torch.tensor(threshold, device=input.device, dtype=input.dtype) diff --git a/shared/package-files/1f/1f85cb7a189c3d9da1ec16f7d043911dcb9d728b030fdffbdf045c63251e6a75/news28-a b/shared/package-files/1f/1f85cb7a189c3d9da1ec16f7d043911dcb9d728b030fdffbdf045c63251e6a75/news28-a new file mode 100644 index 0000000000000000000000000000000000000000..cde606664fd84b50b37d16a4570ba137a992b25d Binary files /dev/null and b/shared/package-files/1f/1f85cb7a189c3d9da1ec16f7d043911dcb9d728b030fdffbdf045c63251e6a75/news28-a differ diff --git a/shared/package-files/1f/1f85cb7a189c3d9da1ec16f7d043911dcb9d728b030fdffbdf045c63251e6a75/news29 b/shared/package-files/1f/1f85cb7a189c3d9da1ec16f7d043911dcb9d728b030fdffbdf045c63251e6a75/news29 new file mode 100644 index 0000000000000000000000000000000000000000..cde606664fd84b50b37d16a4570ba137a992b25d Binary files /dev/null and b/shared/package-files/1f/1f85cb7a189c3d9da1ec16f7d043911dcb9d728b030fdffbdf045c63251e6a75/news29 differ diff --git a/shared/package-files/1f/1f85f237c2e6c383416779bf50496d1caed3e590037377dba24d8ac0e2804e6f/mergesort.py b/shared/package-files/1f/1f85f237c2e6c383416779bf50496d1caed3e590037377dba24d8ac0e2804e6f/mergesort.py new file mode 100644 index 0000000000000000000000000000000000000000..cba5f3318b7ef55398df4f5e921e1f2c7a68aed3 --- /dev/null +++ b/shared/package-files/1f/1f85f237c2e6c383416779bf50496d1caed3e590037377dba24d8ac0e2804e6f/mergesort.py @@ -0,0 +1,126 @@ +""" +The same algorithm as translated from numpy. +See numpy/core/src/npysort/mergesort.c.src. +The high-level numba code is adding a little overhead comparing to +the pure-C implementation in numpy. +""" +import numpy as np +from collections import namedtuple + +# Array size smaller than this will be sorted by insertion sort +SMALL_MERGESORT = 20 + + +MergesortImplementation = namedtuple('MergesortImplementation', [ + 'run_mergesort', +]) + + +def make_mergesort_impl(wrap, lt=None, is_argsort=False): + kwargs_lite = dict(no_cpython_wrapper=True, _nrt=False) + + # The less than + if lt is None: + @wrap(**kwargs_lite) + def lt(a, b): + return a < b + else: + lt = wrap(**kwargs_lite)(lt) + + if is_argsort: + @wrap(**kwargs_lite) + def lessthan(a, b, vals): + return lt(vals[a], vals[b]) + else: + @wrap(**kwargs_lite) + def lessthan(a, b, vals): + return lt(a, b) + + @wrap(**kwargs_lite) + def argmergesort_inner(arr, vals, ws): + """The actual mergesort function + + Parameters + ---------- + arr : array [read+write] + The values being sorted inplace. For argsort, this is the + indices. + vals : array [readonly] + ``None`` for normal sort. In argsort, this is the actual array values. + ws : array [write] + The workspace. Must be of size ``arr.size // 2`` + """ + if arr.size > SMALL_MERGESORT: + # Merge sort + mid = arr.size // 2 + + argmergesort_inner(arr[:mid], vals, ws) + argmergesort_inner(arr[mid:], vals, ws) + + # Copy left half into workspace so we don't overwrite it + for i in range(mid): + ws[i] = arr[i] + + # Merge + left = ws[:mid] + right = arr[mid:] + out = arr + + i = j = k = 0 + while i < left.size and j < right.size: + if not lessthan(right[j], left[i], vals): + out[k] = left[i] + i += 1 + else: + out[k] = right[j] + j += 1 + k += 1 + + # Leftovers + while i < left.size: + out[k] = left[i] + i += 1 + k += 1 + + while j < right.size: + out[k] = right[j] + j += 1 + k += 1 + else: + # Insertion sort + i = 1 + while i < arr.size: + j = i + while j > 0 and lessthan(arr[j], arr[j - 1], vals): + arr[j - 1], arr[j] = arr[j], arr[j - 1] + j -= 1 + i += 1 + + # The top-level entry points + + @wrap(no_cpython_wrapper=True) + def mergesort(arr): + "Inplace" + ws = np.empty(arr.size // 2, dtype=arr.dtype) + argmergesort_inner(arr, None, ws) + return arr + + + @wrap(no_cpython_wrapper=True) + def argmergesort(arr): + "Out-of-place" + idxs = np.arange(arr.size) + ws = np.empty(arr.size // 2, dtype=idxs.dtype) + argmergesort_inner(idxs, arr, ws) + return idxs + + return MergesortImplementation( + run_mergesort=(argmergesort if is_argsort else mergesort) + ) + + +def make_jit_mergesort(*args, **kwargs): + from numba import njit + # NOTE: wrap with njit to allow recursion + # because @register_jitable => @overload doesn't support recursion + return make_mergesort_impl(njit, *args, **kwargs) diff --git a/shared/package-files/1f/1f8619123a353e3e1824e9a27597baaf3b37bf872dd0b130c2d9cb8b1d060858/select_copy_compositeexplicitautogradnonfunctional_dispatch.h b/shared/package-files/1f/1f8619123a353e3e1824e9a27597baaf3b37bf872dd0b130c2d9cb8b1d060858/select_copy_compositeexplicitautogradnonfunctional_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..e30135d61eb1aa859570a8dd9a6af2d3ba0a79f2 --- /dev/null +++ b/shared/package-files/1f/1f8619123a353e3e1824e9a27597baaf3b37bf872dd0b130c2d9cb8b1d060858/select_copy_compositeexplicitautogradnonfunctional_dispatch.h @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautogradnonfunctional { + +TORCH_API at::Tensor select_copy(const at::Tensor & self, int64_t dim, int64_t index); +TORCH_API at::Tensor select_copy_symint(const at::Tensor & self, int64_t dim, c10::SymInt index); + +} // namespace compositeexplicitautogradnonfunctional +} // namespace at diff --git a/shared/package-files/1f/1f8ae7ffab8be339418828bb6a492cec0af74998929c06e12ced655f51383398/special_erfinv_native.h b/shared/package-files/1f/1f8ae7ffab8be339418828bb6a492cec0af74998929c06e12ced655f51383398/special_erfinv_native.h new file mode 100644 index 0000000000000000000000000000000000000000..ef0b62252192b07ca392d2bad99c59f33067420f --- /dev/null +++ b/shared/package-files/1f/1f8ae7ffab8be339418828bb6a492cec0af74998929c06e12ced655f51383398/special_erfinv_native.h @@ -0,0 +1,22 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor special_erfinv(const at::Tensor & self); +TORCH_API at::Tensor & special_erfinv_out(const at::Tensor & self, at::Tensor & out); +} // namespace native +} // namespace at diff --git a/shared/package-files/1f/1f8b43919df95d275faeaa7c1b3ac15f8397e6f8ee8c6e8b3ff5bd031760e4ed/xnuppc+c b/shared/package-files/1f/1f8b43919df95d275faeaa7c1b3ac15f8397e6f8ee8c6e8b3ff5bd031760e4ed/xnuppc+c new file mode 100644 index 0000000000000000000000000000000000000000..bba151abd7a9e0cd5f14d93fef3f1e50b06f6217 Binary files /dev/null and b/shared/package-files/1f/1f8b43919df95d275faeaa7c1b3ac15f8397e6f8ee8c6e8b3ff5bd031760e4ed/xnuppc+c differ diff --git a/shared/package-files/1f/1f8c830a711f10c154138388320d452589fd72f8f909b411bf5cdea244dee906/template.pyi b/shared/package-files/1f/1f8c830a711f10c154138388320d452589fd72f8f909b411bf5cdea244dee906/template.pyi new file mode 100644 index 0000000000000000000000000000000000000000..90588a420f5a58a30a5ada4be11f3badf16114a2 --- /dev/null +++ b/shared/package-files/1f/1f8c830a711f10c154138388320d452589fd72f8f909b411bf5cdea244dee906/template.pyi @@ -0,0 +1,14 @@ +from typing import Any + +dot_re: Any + +def blankout(src: str, char: str) -> str: ... + +context_re: Any +inline_re: Any +block_re: Any +endblock_re: Any +plural_re: Any +constant_re: Any + +def templatize(src: str, origin: str = ...) -> str: ... diff --git a/shared/package-files/1f/1f924aedebc4c68ebe2b52c946ca31e1f5940451e0f18fee2077c47b4f645a66/tensor_split_compositeimplicitautograd_dispatch.h b/shared/package-files/1f/1f924aedebc4c68ebe2b52c946ca31e1f5940451e0f18fee2077c47b4f645a66/tensor_split_compositeimplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..53b572dd4dcdd6d9b1c584c250c3ea2b989fb7e2 --- /dev/null +++ b/shared/package-files/1f/1f924aedebc4c68ebe2b52c946ca31e1f5940451e0f18fee2077c47b4f645a66/tensor_split_compositeimplicitautograd_dispatch.h @@ -0,0 +1,27 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeimplicitautograd { + +TORCH_API ::std::vector tensor_split(const at::Tensor & self, int64_t sections, int64_t dim=0); +TORCH_API ::std::vector tensor_split_symint(const at::Tensor & self, c10::SymInt sections, int64_t dim=0); +TORCH_API ::std::vector tensor_split(const at::Tensor & self, at::IntArrayRef indices, int64_t dim=0); +TORCH_API ::std::vector tensor_split_symint(const at::Tensor & self, c10::SymIntArrayRef indices, int64_t dim=0); +TORCH_API ::std::vector tensor_split(const at::Tensor & self, const at::Tensor & tensor_indices_or_sections, int64_t dim=0); + +} // namespace compositeimplicitautograd +} // namespace at diff --git a/shared/package-files/1f/1f9398544b699e11b1ead37a04f2481b645857f1d901659a0c17580e3598fa91/DeviceArray.h b/shared/package-files/1f/1f9398544b699e11b1ead37a04f2481b645857f1d901659a0c17580e3598fa91/DeviceArray.h new file mode 100644 index 0000000000000000000000000000000000000000..e187f5a669db5fdd75074c6045dcc6506fc304bd --- /dev/null +++ b/shared/package-files/1f/1f9398544b699e11b1ead37a04f2481b645857f1d901659a0c17580e3598fa91/DeviceArray.h @@ -0,0 +1,28 @@ +#include +#include +#include +#include +#include + +namespace c10 { + +template +class DeviceArray { + public: + DeviceArray(c10::Allocator& allocator, size_t size) + : data_ptr_(allocator.allocate(size * sizeof(T))) { + static_assert(std::is_trivial::value, "T must be a trivial type"); + TORCH_INTERNAL_ASSERT( + 0 == (reinterpret_cast(data_ptr_.get()) % alignof(T)), + "c10::DeviceArray: Allocated memory is not aligned for this data type"); + } + + T* get() { + return static_cast(data_ptr_.get()); + } + + private: + c10::DataPtr data_ptr_; +}; + +} // namespace c10 diff --git a/shared/package-files/1f/1f9aec5b2fb484ec217fb62d337825bba40eae08e6c85fbaaeebdb53e9b58859/replication_pad2d_native.h b/shared/package-files/1f/1f9aec5b2fb484ec217fb62d337825bba40eae08e6c85fbaaeebdb53e9b58859/replication_pad2d_native.h new file mode 100644 index 0000000000000000000000000000000000000000..b835ffabf6b50062b766847ec3363cb6b834063b --- /dev/null +++ b/shared/package-files/1f/1f9aec5b2fb484ec217fb62d337825bba40eae08e6c85fbaaeebdb53e9b58859/replication_pad2d_native.h @@ -0,0 +1,26 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace native { +struct TORCH_API structured_replication_pad2d_out_cpu : public at::meta::structured_replication_pad2d { +void impl(const at::Tensor & self, at::ArrayRef padding, const at::Tensor & out); +}; +struct TORCH_API structured_replication_pad2d_out_cuda : public at::meta::structured_replication_pad2d { +void impl(const at::Tensor & self, at::ArrayRef padding, const at::Tensor & out); +}; +} // namespace native +} // namespace at diff --git a/shared/package-files/1f/1f9beaedfab9542f6cfabd5f2fcdbc688806c26e8fcee44fecdc856f751f93cf/ravel.h b/shared/package-files/1f/1f9beaedfab9542f6cfabd5f2fcdbc688806c26e8fcee44fecdc856f751f93cf/ravel.h new file mode 100644 index 0000000000000000000000000000000000000000..364f3fcf425a04bffa01c2a90f37ffdf7909d0b7 --- /dev/null +++ b/shared/package-files/1f/1f9beaedfab9542f6cfabd5f2fcdbc688806c26e8fcee44fecdc856f751f93cf/ravel.h @@ -0,0 +1,30 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::ravel(Tensor(a) self) -> Tensor(a) +inline at::Tensor ravel(const at::Tensor & self) { + return at::_ops::ravel::call(self); +} + +} diff --git a/shared/package-files/1f/1f9c33420f26bdd99785ba6c3c0585a4ccf07e04619bf14d55a2ad97bd8ad18d/direct_url.json b/shared/package-files/1f/1f9c33420f26bdd99785ba6c3c0585a4ccf07e04619bf14d55a2ad97bd8ad18d/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..d7744805219e2e005c05394fa582286abb22ce46 --- /dev/null +++ b/shared/package-files/1f/1f9c33420f26bdd99785ba6c3c0585a4ccf07e04619bf14d55a2ad97bd8ad18d/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///croot/markupsafe_1704205993651/work"} \ No newline at end of file diff --git a/shared/package-files/1f/1f9de39784dba6bdcc66fbcfc3723f12b6901fa6b5eca53364ed332e90c5d040/common_distributed.py b/shared/package-files/1f/1f9de39784dba6bdcc66fbcfc3723f12b6901fa6b5eca53364ed332e90c5d040/common_distributed.py new file mode 100644 index 0000000000000000000000000000000000000000..48c8e4dabbbe8159b183e557ec4b09d29c93eaa3 --- /dev/null +++ b/shared/package-files/1f/1f9de39784dba6bdcc66fbcfc3723f12b6901fa6b5eca53364ed332e90c5d040/common_distributed.py @@ -0,0 +1,1322 @@ +# mypy: ignore-errors + +import faulthandler +import logging +import multiprocessing +import os +import queue +import subprocess +import sys +import tempfile +import threading +import time +import traceback +import types +import unittest +from contextlib import contextmanager +from dataclasses import dataclass +from datetime import timedelta +from enum import Enum +from functools import partial, reduce, wraps +from io import StringIO +from typing import Dict, NamedTuple, Optional, Union +from unittest.mock import patch + +import torch +import torch._dynamo.test_case +import torch.cuda.nccl +import torch.distributed as c10d +import torch.nn as nn +from torch.testing._internal.common_utils import ( + FILE_SCHEMA, + find_free_port, + IS_SANDCASTLE, + retry_on_connect_failures, + skip_but_pass_in_sandcastle, + skip_but_pass_in_sandcastle_if, + TEST_WITH_ROCM, + TEST_WITH_TSAN, + TestCase, +) +from torch.testing._internal.common_utils import ( + parametrize, + subtest, +) +from torch.testing._internal.distributed.multi_threaded_pg import ( + _install_threaded_pg, + _uninstall_threaded_pg, + ProcessLocalGroup, +) +import operator + +logging.basicConfig(level=logging.INFO) +logger = logging.getLogger(__name__) + + +class TestSkip(NamedTuple): + exit_code: int + message: str + + +TEST_SKIPS = { + "backend_unavailable": TestSkip( + 72, "Skipped because distributed backend is not available." + ), + "small_worldsize": TestSkip(73, "Skipped due to small world size."), + "odd_worldsize": TestSkip(87, "Skipped due to odd world size."), + "no_cuda": TestSkip(74, "CUDA is not available."), + "multi-gpu-1": TestSkip(75, "Need at least 1 CUDA device"), + "multi-gpu-2": TestSkip(77, "Need at least 2 CUDA devices"), + "multi-gpu-3": TestSkip(80, "Need at least 3 CUDA devices"), + "multi-gpu-4": TestSkip(81, "Need at least 4 CUDA devices"), + "multi-gpu-5": TestSkip(82, "Need at least 5 CUDA devices"), + "multi-gpu-6": TestSkip(83, "Need at least 6 CUDA devices"), + "multi-gpu-7": TestSkip(84, "Need at least 7 CUDA devices"), + "multi-gpu-8": TestSkip(85, "Need at least 8 CUDA devices"), + "nccl": TestSkip(76, "c10d not compiled with NCCL support"), + "skipIfRocm": TestSkip(78, "Test skipped for ROCm"), + "no_peer_access": TestSkip(79, "Test skipped because no GPU peer access"), + "generic": TestSkip( + 86, "Test skipped at subprocess level, look at subprocess log for skip reason" + ), + "importerror": TestSkip(88, "Test skipped due to missing import"), +} + + +@dataclass +class DistTestCases: + # Backends that do not support a specific collective + skip_collective = {} + skip_collective["allgather_coalesced"] = {"nccl", "mpi", "ucc"} + skip_collective["reduce"] = set() + skip_collective["sendrecv anysource"] = {"nccl", "ucc"} + skip_collective["cpu barrier"] = {"nccl", "ucc"} + + # Sets showing that something is implemented + backend_feature = {} + backend_feature["gpu"] = {"nccl", "gloo", "ucc"} + backend_feature["cuda"] = {"nccl", "gloo", "ucc"} + backend_feature["ddp"] = {"nccl", "gloo", "ucc"} + backend_feature["subgroup"] = {"nccl", "gloo", "ucc"} + backend_feature["plugin"] = set() + + +def skip_if_no_gpu(func): + """Skips if the world size exceeds the number of GPUs, ensuring that if the + test is run, each rank has its own GPU via ``torch.cuda.device(rank)``.""" + + @wraps(func) + def wrapper(*args, **kwargs): + if not torch.cuda.is_available(): + sys.exit(TEST_SKIPS["no_cuda"].exit_code) + world_size = int(os.environ["WORLD_SIZE"]) + if torch.cuda.device_count() < world_size: + sys.exit(TEST_SKIPS[f"multi-gpu-{world_size}"].exit_code) + + return func(*args, **kwargs) + + return wrapper + + +def skip_if_small_worldsize(func): + @wraps(func) + def wrapper(*args, **kwargs): + if (os.environ["BACKEND"] != "mpi") and int(os.environ["WORLD_SIZE"]) <= 2: + sys.exit(TEST_SKIPS["small_worldsize"].exit_code) + + return func(*args, **kwargs) + + return wrapper + + +def skip_if_odd_worldsize(func): + @wraps(func) + def wrapper(*args, **kwargs): + if (os.environ["BACKEND"] != "mpi") and int(os.environ["WORLD_SIZE"]) % 2 == 1: + sys.exit(TEST_SKIPS["odd_worldsize"].exit_code) + + return func(*args, **kwargs) + + return wrapper + + +def require_n_gpus_for_nccl_backend(n, backend): + def decorator(func): + @wraps(func) + def wrapper(*args, **kwargs): + if backend == "nccl" and torch.cuda.device_count() < n: + sys.exit(TEST_SKIPS[f"multi-gpu-{n}"].exit_code) + else: + return func(*args, **kwargs) + + return wrapper + + return decorator + + +def import_transformers_or_skip(): + def decorator(func): + @wraps(func) + def wrapper(*args, **kwargs): + try: + from transformers import ( # noqa: F401 + AutoModelForMaskedLM, + BertConfig, + ) + + return func(*args, **kwargs) + except ImportError: + sys.exit(TEST_SKIPS["importerror"].exit_code) + + return wrapper + + return decorator + + +def skip_if_lt_x_gpu(x): + def decorator(func): + @wraps(func) + def wrapper(*args, **kwargs): + if torch.cuda.is_available() and torch.cuda.device_count() >= x: + return func(*args, **kwargs) + sys.exit(TEST_SKIPS[f"multi-gpu-{x}"].exit_code) + + return wrapper + + return decorator + + +# This decorator helps avoiding initializing cuda while testing other backends +def nccl_skip_if_lt_x_gpu(backend, x): + def decorator(func): + @wraps(func) + def wrapper(*args, **kwargs): + if backend != "nccl": + return func(*args, **kwargs) + if torch.cuda.is_available() and torch.cuda.device_count() >= x: + return func(*args, **kwargs) + sys.exit(TEST_SKIPS[f"multi-gpu-{x}"].exit_code) + + return wrapper + + return decorator + + +def verify_ddp_error_logged(model_DDP, err_substr): + # Verify error was logged in ddp_logging_data. + ddp_logging_data = model_DDP._get_ddp_logging_data() + assert "iteration" in ddp_logging_data + assert "has_error" in ddp_logging_data + assert "error" in ddp_logging_data + logging_err = ddp_logging_data["error"] + # Remove C++ stacktrace if needed. + actual = ( + err_substr + if err_substr.find("\nException raised from ") == -1 + else err_substr.split("\nException raised from ")[0] + ) + assert ( + actual in logging_err + ), f"Did not find expected {actual} in ddp logging data error: {logging_err}" + + +def with_nccl_blocking_wait(func): + """ + Convenience decorator to set/unset TORCH_NCCL_BLOCKING_WAIT flag. Note that use of + this decorator will override the setting of TORCH_NCCL_ASYNC_ERROR_HANDLING for + the particular test. After the test, both TORCH_NCCL_BLOCKING_WAIT and + TORCH_NCCL_ASYNC_ERROR_HANDLING will be restored to their original values. + """ + + @wraps(func) + def wrapper(*args, **kwargs): + # Save and unset TORCH_NCCL_ASYNC_ERROR_HANDLING + try: + cached_nccl_async_error_handling: Union[str, None] = os.environ[ + "TORCH_NCCL_ASYNC_ERROR_HANDLING" + ] + del os.environ["TORCH_NCCL_ASYNC_ERROR_HANDLING"] + except KeyError: + # TORCH_NCCL_ASYNC_ERROR_HANDLING was unset + cached_nccl_async_error_handling = None + + # Save val of TORCH_NCCL_BLOCKING_WAIT and set it. + try: + cached_nccl_blocking_wait: Union[str, None] = os.environ[ + "TORCH_NCCL_BLOCKING_WAIT" + ] + except KeyError: + cached_nccl_blocking_wait = None + finally: + os.environ["TORCH_NCCL_BLOCKING_WAIT"] = "1" + + try: + ret = func(*args, **kwargs) + return ret + finally: + # restore old values. + if cached_nccl_async_error_handling is not None: + os.environ[ + "TORCH_NCCL_ASYNC_ERROR_HANDLING" + ] = cached_nccl_async_error_handling + + if cached_nccl_blocking_wait is not None: + os.environ["TORCH_NCCL_BLOCKING_WAIT"] = cached_nccl_blocking_wait + + return wrapper + + +def with_dist_debug_levels(levels): + """ + Runs a test for each distributed debug level specified in levels. + """ + + def decorator(func): + @wraps(func) + def wrapper(*args, **kwargs): + old_level = os.environ.get("TORCH_DISTRIBUTED_DEBUG", None) + for level in levels: + os.environ["TORCH_DISTRIBUTED_DEBUG"] = level + c10d.set_debug_level_from_env() + ret = func(*args, **kwargs) + c10d.barrier() + if old_level is not None: + os.environ["TORCH_DISTRIBUTED_DEBUG"] = old_level + # Only returns test return for last test, but since these are + # unittests the return value is not really used and earlier tests + # would've raised had they failed. + return ret + + return wrapper + + return decorator + + +def requires_gloo(): + return skip_but_pass_in_sandcastle_if( + not c10d.is_gloo_available(), + "c10d was not compiled with the Gloo backend", + ) + + +def requires_nccl_version(version, msg): + if not c10d.is_nccl_available(): + return skip_but_pass_in_sandcastle( + "c10d was not compiled with the NCCL backend", + ) + else: + return skip_but_pass_in_sandcastle_if( + torch.cuda.nccl.version() < version, + "Requires NCCL version greater than or equal to: {}, found: {}, reason: {}".format( + version, torch.cuda.nccl.version(), msg + ), + ) + + +def requires_nccl(): + return skip_but_pass_in_sandcastle_if( + not c10d.is_nccl_available(), + "c10d was not compiled with the NCCL backend", + ) + +def requires_ucc(): + return skip_but_pass_in_sandcastle_if( + not c10d.is_ucc_available(), + "c10d was not compiled with the UCC backend", + ) + +def requires_mpi(): + return skip_but_pass_in_sandcastle_if( + not c10d.is_mpi_available(), + "c10d was not compiled with the MPI backend", + ) + + +def skip_if_rocm(func): + """Skips a test for ROCm""" + func.skip_if_rocm = True + + @wraps(func) + def wrapper(*args, **kwargs): + if not TEST_WITH_ROCM: + return func(*args, **kwargs) + sys.exit(TEST_SKIPS["skipIfRocm"].exit_code) + + return wrapper + + +def skip_if_win32(): + return skip_but_pass_in_sandcastle_if( + sys.platform == "win32", + "This unit test case is not supported on Windows platform", + ) + + +@retry_on_connect_failures +def create_tcp_store( + addr="localhost", + world_size=1, + is_master=True, + timeout=timedelta(minutes=5), + wait_for_workers=True, + jit_class=False, + use_libuv=False +): + """ + Creates a TCP store. Retries if the chosen port is already in use. + """ + port = find_free_port() + if jit_class: + timeout_millisecond = int(timeout / timedelta(milliseconds=1)) + return torch.classes.dist_c10d.TCPStore( + addr, port, world_size, is_master, timeout_millisecond + ) + else: + return c10d.TCPStore( + addr, port, world_size, is_master, wait_for_workers=wait_for_workers, use_libuv=use_libuv + ) + + +if TEST_WITH_TSAN: + # TSAN runs much slower. + TIMEOUT_DEFAULT = 500 +else: + TIMEOUT_DEFAULT = int(os.getenv('DISTRIBUTED_TESTS_DEFAULT_TIMEOUT', '300')) +TIMEOUT_OVERRIDE = {"test_ddp_uneven_inputs": 400} + + +# https://github.com/pytorch/pytorch/issues/75665 +if TEST_WITH_ROCM: + TIMEOUT_OVERRIDE["test_join_kwargs"] = 200 + + +def create_device(interface=None): + if sys.platform == "win32" or interface is None: + return c10d.ProcessGroupGloo.create_device(hostname="127.0.0.1") + else: + return c10d.ProcessGroupGloo.create_device(interface=interface) + + +def get_timeout(test_id) -> int: + return TIMEOUT_OVERRIDE.get(test_id.split(".")[-1], TIMEOUT_DEFAULT) + + +@contextmanager +def captured_output(): + new_out, new_err = StringIO(), StringIO() + old_out, old_err = sys.stdout, sys.stderr + try: + sys.stdout, sys.stderr = new_out, new_err + yield sys.stdout, sys.stderr + finally: + sys.stdout, sys.stderr = old_out, old_err + + +def simple_sparse_reduce_tests(rank: int, world_size: int, num_inputs: int = 1): + """ + Generate a number of basic test cases for sparse reduction. + These cover tensors with a varying number of sparse dimensions and a varying + number of dense dimensions. The only reduction operation we support is sum. + """ + + def generate(rank: int, world_size: int, sparse_dims: int = 1, dense_dims: int = 0): + # First sparse dimension is [0..rank]. + # Subsequent dimensions are always 0, so we know there is + # a non-empty intersection between any two sparse tensors. + indices = torch.reshape(torch.arange(rank + 1), (1, rank + 1)) + shape = [world_size] + [2 for _ in range(dense_dims)] + for _ in range(sparse_dims - 1): + indices = torch.cat((indices, torch.zeros(1, rank + 1))) + shape.append(world_size) + values = torch.ones([rank + 1] + [2 for _ in range(dense_dims)]) + return torch.sparse_coo_tensor(indices, values, shape) + + def compute_sum(fn, world_size: int): + return reduce( + operator.add, [fn(rank, world_size) for rank in range(world_size)] + ) + + return [ + ( + [ + fn(num_inputs * rank + i, num_inputs * world_size) + for i in range(num_inputs) + ], + [compute_sum(fn, num_inputs * world_size) for i in range(num_inputs)], + ) + for fn in [ + partial(generate, sparse_dims=1), + partial(generate, sparse_dims=2), + partial(generate, sparse_dims=3), + partial(generate, dense_dims=1), + partial(generate, dense_dims=2), + partial(generate, dense_dims=3), + ] + ] + + +# HELPER FOR MULTIGPU TESTS +def init_multigpu_helper(world_size: int, backend: str): + """Multigpu tests are designed to simulate the multi nodes with multi + GPUs on each node. Nccl backend requires equal #GPUs in each process. + On a single node, all visible GPUs are evenly + divided to subsets, each process only uses a subset. + """ + nGPUs = torch.cuda.device_count() + visible_devices = range(nGPUs) + + # If rank is less than or equal to number of available GPU's + # then each rank can be mapped to corresponding GPU. + nGPUs_per_process = 1 + if world_size > nGPUs: + nGPUs_per_process = nGPUs // world_size + rank_to_GPU = { + i: list(visible_devices[i * nGPUs_per_process : (i + 1) * nGPUs_per_process]) + for i in range(world_size) + } + return rank_to_GPU + + +tmp_dir: Optional[tempfile.TemporaryDirectory] = None + + +def initialize_temp_directories(init_method: Optional[str] = None) -> None: + global tmp_dir + tmp_dir = tempfile.TemporaryDirectory() + os.environ["TEMP_DIR"] = tmp_dir.name + os.mkdir(os.path.join(tmp_dir.name, "barrier")) + os.mkdir(os.path.join(tmp_dir.name, "test_dir")) + init_dir_path = os.path.join(tmp_dir.name, "init_dir") + os.mkdir(init_dir_path) + # Set init method if specified. + if init_method is not None: + os.environ["INIT_METHOD"] = init_method + else: + os.environ["INIT_METHOD"] = FILE_SCHEMA + os.path.join( + init_dir_path, "shared_init_file" + ) + + +def cleanup_temp_dir() -> None: + if tmp_dir is not None: + tmp_dir.cleanup() + + +# Most tests operate with this worldsize +DEFAULT_WORLD_SIZE = 4 + +# [How does MultiProcessTestCase work?] +# Each MultiProcessTestCase instance uses 1 + `world_size()` processes, by +# default `world_size()` returns 4. Let's take `test_rpc_spawn.py` as an +# example which inherits from this class. Its `Setup()` methods calls into +# `MultiProcessTestCase._spawn_processes()` which spawns `world_size()` +# subprocesses. During the spawn, the main process passes the test name to +# subprocesses, and the name is acquired from self.id(). The subprocesses +# then use the provided test function name to retrieve the function attribute +# from the test instance and run it. The main process simply waits for all +# subprocesses to join. + + +class MultiProcessTestCase(TestCase): + MAIN_PROCESS_RANK = -1 + # This exit code is used to indicate that the test code had an error and + # exited abnormally. There are certain tests that might use sys.exit() to + # simulate failures and in those cases, we can't have an exit code of 0, + # but we still want to ensure we didn't run into any other errors. + TEST_ERROR_EXIT_CODE = 10 + + # do not early terminate for distributed tests. + def _should_stop_test_suite(self) -> bool: + return False + + @property + def world_size(self) -> int: + return DEFAULT_WORLD_SIZE + + def join_or_run(self, fn): + @wraps(fn) + def wrapper(self): + if self.rank == self.MAIN_PROCESS_RANK: + self._join_processes(fn) + else: + fn() + + return types.MethodType(wrapper, self) + + # The main process spawns N subprocesses that run the test. + # Constructor patches current instance test method to + # assume the role of the main process and join its subprocesses, + # or run the underlying test function. + def __init__(self, method_name: str = "runTest") -> None: + super().__init__(method_name) + fn = getattr(self, method_name) + setattr(self, method_name, self.join_or_run(fn)) + + def setUp(self) -> None: + super().setUp() + self.skip_return_code_checks = [] # type: ignore[var-annotated] + self.processes = [] # type: ignore[var-annotated] + self.rank = self.MAIN_PROCESS_RANK + self.file_name = tempfile.NamedTemporaryFile(delete=False).name + # pid to pipe consisting of error message from process. + self.pid_to_pipe = {} # type: ignore[var-annotated] + + def tearDown(self) -> None: + super().tearDown() + for p in self.processes: + p.terminate() + # Each Process instance holds a few open file descriptors. The unittest + # runner creates a new TestCase instance for each test method and keeps + # it alive until the end of the entire suite. We must thus reset the + # processes to prevent an effective file descriptor leak. + self.processes = [] + + def _current_test_name(self) -> str: + # self.id() == e.g. '__main__.TestDistributed.TestAdditive.test_get_rank' + return self.id().split(".")[-1] + + def _start_processes(self, proc) -> None: + self.processes = [] + for rank in range(int(self.world_size)): + parent_conn, child_conn = torch.multiprocessing.Pipe() + process = proc( + target=self.__class__._run, + name="process " + str(rank), + args=(rank, self._current_test_name(), self.file_name, child_conn), + ) + process.start() + logger.info("Started process %s with pid %s", rank, process.pid) + self.pid_to_pipe[process.pid] = parent_conn + self.processes.append(process) + + def _spawn_processes(self) -> None: + proc = torch.multiprocessing.get_context("spawn").Process + self._start_processes(proc) + + class Event(Enum): + GET_TRACEBACK = 1 + + @staticmethod + def _event_listener(parent_pipe, signal_pipe, rank: int): + logger.info("Starting event listener thread for rank %s", rank) + while True: + ready_pipes = multiprocessing.connection.wait([parent_pipe, signal_pipe]) + + if parent_pipe in ready_pipes: + + if parent_pipe.closed: + logger.info( + "Pipe closed for process %s, stopping event listener thread", rank + ) + return + + event = parent_pipe.recv() + logger.info("Received event %s on process %s", event, rank) + + if event == MultiProcessTestCase.Event.GET_TRACEBACK: + # Return traceback to the parent process. + with tempfile.NamedTemporaryFile(mode="r+") as tmp_file: + faulthandler.dump_traceback(tmp_file) + # Flush buffers and seek to read from the beginning + tmp_file.flush() + tmp_file.seek(0) + parent_pipe.send(tmp_file.read()) + + logger.info("Process %s sent traceback", rank) + + if signal_pipe in ready_pipes: + return + + @classmethod + def _run(cls, rank: int, test_name: str, file_name: str, parent_pipe) -> None: + self = cls(test_name) + self.rank = rank + self.file_name = file_name + self.run_test(test_name, parent_pipe) + + def run_test(self, test_name: str, parent_pipe) -> None: + # Start event listener thread. + signal_recv_pipe, signal_send_pipe = torch.multiprocessing.Pipe(duplex=False) + event_listener_thread = threading.Thread( + target=MultiProcessTestCase._event_listener, + args=(parent_pipe, signal_recv_pipe, self.rank), + daemon=True, + ) + event_listener_thread.start() + if sys.platform != "win32" and sys.platform != "darwin": + # Register signal handler to dump stack traces on FATALs. + # Windows and MacOS do not support the signal handlers. + torch._C._set_print_stack_traces_on_fatal_signal(True) + # Show full C++ stacktraces when a Python error originating from C++ is raised. + os.environ["TORCH_SHOW_CPP_STACKTRACES"] = "1" + + # self.id() == e.g. '__main__.TestDistributed.test_get_rank' + # We're retrieving a corresponding test and executing it. + try: + getattr(self, test_name)() + except unittest.SkipTest as se: + logger.info( + "Process %s skipping test %s for following reason: %s", self.rank, test_name, str(se) + ) + sys.exit(TEST_SKIPS["generic"].exit_code) + except Exception as e: + logger.error( + "Caught exception: \n%s exiting " + "process %s with exit code: %s", + traceback.format_exc(), self.rank, MultiProcessTestCase.TEST_ERROR_EXIT_CODE + ) + # Send error to parent process. + parent_pipe.send(traceback.format_exc()) + sys.exit(MultiProcessTestCase.TEST_ERROR_EXIT_CODE) + finally: + if signal_send_pipe is not None: + signal_send_pipe.send(None) + + assert event_listener_thread is not None + event_listener_thread.join() + # Close pipe after done with test. + parent_pipe.close() + + def _get_timedout_process_traceback(self) -> None: + pipes = [] + for i, process in enumerate(self.processes): + if process.exitcode is None: + pipe = self.pid_to_pipe[process.pid] + try: + pipe.send(MultiProcessTestCase.Event.GET_TRACEBACK) + pipes.append((i, pipe)) + except ConnectionError as e: + logger.error( + "Encountered error while trying to get traceback for process %s: %s", i, e + ) + + # Wait for results. + for rank, pipe in pipes: + try: + # Wait for traceback + if pipe.poll(5): + if pipe.closed: + logger.info( + "Pipe closed for process %s, cannot retrieve traceback", rank + ) + continue + + traceback = pipe.recv() + logger.error( + "Process %s timed out with traceback: \n\n%s", rank, traceback + ) + else: + logger.error( + "Could not retrieve traceback for timed out process: %s", rank + ) + except ConnectionError as e: + logger.error( + "Encountered error while trying to get traceback for process %s: %s", rank, e + ) + + def _join_processes(self, fn) -> None: + timeout = get_timeout(self.id()) + start_time = time.time() + subprocess_error = False + try: + while True: + # check to see if any subprocess exited with an error early. + for (i, p) in enumerate(self.processes): + # This is the exit code processes exit with if they + # encountered an exception. + if p.exitcode == MultiProcessTestCase.TEST_ERROR_EXIT_CODE: + print( + f"Process {i} terminated with exit code {p.exitcode}, terminating remaining processes." + ) + active_children = torch.multiprocessing.active_children() + for ac in active_children: + ac.terminate() + subprocess_error = True + break + if subprocess_error: + break + # All processes have joined cleanly if they all a valid exitcode + if all(p.exitcode is not None for p in self.processes): + break + # Check if we should time out the test. If so, we terminate each process. + elapsed = time.time() - start_time + if elapsed > timeout: + self._get_timedout_process_traceback() + print( + f"Timing out after {timeout} seconds and killing subprocesses." + ) + for p in self.processes: + p.terminate() + break + # Sleep to avoid excessive busy polling. + time.sleep(0.1) + + elapsed_time = time.time() - start_time + + if fn in self.skip_return_code_checks: + self._check_no_test_errors(elapsed_time) + else: + self._check_return_codes(elapsed_time) + finally: + # Close all pipes + for pipe in self.pid_to_pipe.values(): + pipe.close() + + def _check_no_test_errors(self, elapsed_time) -> None: + """ + Checks that we didn't have any errors thrown in the child processes. + """ + for i, p in enumerate(self.processes): + if p.exitcode is None: + raise RuntimeError( + f"Process {i} timed out after {elapsed_time} seconds" + ) + self.assertNotEqual(self.TEST_ERROR_EXIT_CODE, p.exitcode) + + def _check_return_codes(self, elapsed_time) -> None: + """ + Checks that the return codes of all spawned processes match, and skips + tests if they returned a return code indicating a skipping condition. + """ + # If no processes are spawned, there is nothing to check. + if not self.processes: + logger.warning("Note: no subprocesses were spawned, test was likely skipped.") + return + + first_process = self.processes[0] + # first, we check if there are errors in actual processes + # (via TEST_ERROR_EXIT CODE), and raise an exception for those. + # the reason we do this is to attempt to raise a more helpful error + # message than "Process x terminated/timed out" + # TODO: we should pipe the exception of the failed subprocess here. + # Currently, the actual exception is displayed as a logging output. + errored_processes = [ + (i, p) + for i, p in enumerate(self.processes) + if p.exitcode == MultiProcessTestCase.TEST_ERROR_EXIT_CODE + ] + if errored_processes: + error = "" + for i, process in errored_processes: + # Get error from pipe. + error_message = self.pid_to_pipe[process.pid].recv() + error += ( + "Process {} exited with error code {} and exception:\n{}\n".format( + i, MultiProcessTestCase.TEST_ERROR_EXIT_CODE, error_message + ) + ) + + raise RuntimeError(error) + # If no process exited uncleanly, we check for timeouts, and then ensure + # each process exited cleanly. + for i, p in enumerate(self.processes): + if p.exitcode is None: + raise RuntimeError( + f"Process {i} terminated or timed out after {elapsed_time} seconds" + ) + self.assertEqual( + p.exitcode, + first_process.exitcode, + msg="Expect process {} exit code to match Process 0 exit code of {}, but got {}".format( + i, first_process.exitcode, p.exitcode + ), + ) + for skip in TEST_SKIPS.values(): + if first_process.exitcode == skip.exit_code: + if IS_SANDCASTLE: + # Don't use unittest.skip to skip the test on sandcastle + # since it creates tasks for skipped tests assuming there + # is some follow-up needed. Instead just "pass" the test + # with an appropriate message. + logger.info( + "Skipping %s on sandcastle for the following reason: %s", self.id(), skip.message + ) + return + else: + raise unittest.SkipTest(skip.message) + self.assertEqual( + first_process.exitcode, + 0, + msg=f"Expected zero exit code but got {first_process.exitcode} for pid: {first_process.pid}", + ) + + @property + def is_master(self) -> bool: + return self.rank == 0 + + +# Cannot use functools.cache as it requires python 3.9 +EFA_PROBE_RESULT = None + + +def has_efa() -> bool: + """ + If shell command `fi_info -p efa -t FI_EP_RDM` returns exit code 0 then we assume that the machine has + Libfabric EFA interfaces and EFA software components installed, + see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/efa-start.html. + """ + global EFA_PROBE_RESULT + if EFA_PROBE_RESULT is not None: + return EFA_PROBE_RESULT + + try: + EFA_PROBE_RESULT = ( + subprocess.run(["fi_info", "-p", "efa", "-t", "FI_EP_RDM"], check=False).returncode == 0 + ) + except FileNotFoundError: + EFA_PROBE_RESULT = False + return EFA_PROBE_RESULT + + +def tp_transports(): + """ + If the machine has Libfabric EFA interfaces and EFA software components installed it may cause + 'RuntimeError: In operator() at tensorpipe/common/ibv.h:172 "": Operation not supported' if tensorpipe + uses InfiniBand transport, so we exclude it from tensorpipe transports, + see https://github.com/pytorch/pytorch/issues/73885 and https://github.com/pytorch/pytorch/issues/65022 + """ + return ["shm", "uv"] if has_efa() else None + + +def spawn_threads_and_init_comms( + func=None, timeout=TIMEOUT_DEFAULT, world_size=DEFAULT_WORLD_SIZE +): + """ + Wrapper to use with a test method + """ + if func is None: + return partial( + spawn_threads_and_init_comms, timeout=timeout, world_size=world_size + ) + + + def _run_test_method_with_multi_threads(world_size, callback): + world = _install_threaded_pg() + global_store = c10d.HashStore() + + def world_is_valid(): + return world == c10d.distributed_c10d._world + + def worker(rank, world_pg, store): + c10d.init_process_group( + backend="threaded", rank=rank, world_size=world_size, store=store + ) + try: + callback() + except BaseException as ex: + # Exceptions are handled in MultiThreadedTestCase + MultiThreadedTestCase.exception_queue.put((rank, sys.exc_info())) + ProcessLocalGroup.exception_handle(ex) # trigger _terminate event and awaken worker threads + finally: + if world_is_valid(): + c10d.destroy_process_group() + + threads = [] + for rank in range(world_size): + t = threading.Thread(target=worker, args=(rank, world, global_store)) + t.start() + threads.append(t) + + return threads + + + @wraps(func) + def wrapper(self, *args, **kwargs): + # TODO: get test name from kwargs + torch._C._distributed_c10d._set_thread_isolation_mode(True) + try: + threads = _run_test_method_with_multi_threads(world_size, lambda: func(self, *args, **kwargs)) + # join and error handling + MultiThreadedTestCase._join_threads(threads, func) + finally: + torch._C._distributed_c10d._set_thread_isolation_mode(False) + + return wrapper + + +class MultiThreadedTestCase(TestCase): + """ + Test runner that runs all tests with the in-proc process group using + multiple threads with the threaded process group. + + Each test spawns world_size threads and run the test method in each thread. + + Difference from regular MultiProcess test runner: + Must explicitly defines SetUp and call self._spawn_threads() to run the tests. + Cannot use setUp / tearDown (must use perThreadSetup / perThreadShutdown) + to set up / tear down each thread when running each test. + No global state possible + How bad of a limitation is this? + """ + exception_queue = queue.Queue() + + MAIN_THREAD_RANK = -1 + + def join_or_run(self, fn): + @wraps(fn) + def wrapper(self): + if self.rank == self.MAIN_THREAD_RANK: + self._join_threads(self.threads, fn) + else: + fn() + + return types.MethodType(wrapper, self) + + def __init__(self, method_name: str = "runTest") -> None: + super().__init__(method_name) + test_fn = getattr(self, method_name, None) + setattr(self, method_name, self.join_or_run(test_fn)) + + def perThreadSetUp(self): + # super().setUp() # TestCase.setUp() calls torch.manual_seed() + pass + + def perThreadTearDown(self): + pass + + def setUp(self) -> None: + """ + setUp only set up things in the main thread, if you want to configure things + in the spawned threads, use perThreadSetUp + """ + super().setUp() + self.rank = self.MAIN_THREAD_RANK + self.threads = [] + # Show full C++ stacktraces when a Python error originating from C++ is raised. + os.environ["TORCH_SHOW_CPP_STACKTRACES"] = "1" + + def tearDown(self): + """ + tearDown only set up things in the main thread, if you want to configure things + in the spawned threads, use perThreadTearDown + """ + super().tearDown() + self.threads = [] + + def _spawn_threads(self): + """ + class method to spawn threads and run test, use this method in the SetUp of your TestCase + """ + torch._C._distributed_c10d._set_thread_isolation_mode(True) + test_name = self._current_test_name + # for each test case, we need to create thread local world, and a global store + world = _install_threaded_pg() + self.__class__.global_store = c10d.HashStore() + + def world_is_valid(): + return world == c10d.distributed_c10d._world + + if not world_is_valid(): + raise RuntimeError("Invalid world") + + for rank in range(self.world_size): + t = threading.Thread(target=self.__class__._run, args=(test_name, rank, self.world_size)) + t.start() + self.threads.append(t) + + @classmethod + def _run(cls, test_name, rank, world_size): + self = cls(test_name) + self.rank = rank + + # precision/rel_tol is a thread-local setting since it may be overridden per test, need to make + # every thread have the same value. This would be relevant when we use op db tests, where it + # needs those states to be set i.e. using instantiate_device_type_tests() + # TODO: figure out a better way to do this + if hasattr(self, "_tls"): + self._tls = threading.local() + self._tls.precision = TestCase._precision + self._tls.rel_tol = TestCase._rel_tol + + self.run_test_with_threaded_pg(test_name, rank, world_size) + + def run_test_with_threaded_pg(self, test_name, rank, world_size): + """ + Run the current test associated with `test_name` using the threaded process group. + """ + c10d.init_process_group( + backend="threaded", rank=rank, world_size=world_size, store=self.__class__.global_store + ) + self.perThreadSetUp() + + try: + getattr(self, test_name)() + except BaseException as ex: + self.exception_queue.put((rank, sys.exc_info())) + ProcessLocalGroup.exception_handle(ex) # trigger _terminate event and awaken worker threads + finally: + c10d.destroy_process_group() + self.perThreadTearDown() + + + @classmethod + def _join_threads(cls, threads, fn): + timeout = TIMEOUT_DEFAULT + try: + for idx, thread in enumerate(threads): + thread.join(max(0, timeout)) + if thread.is_alive(): + MultiThreadedTestCase.exception_queue.put( + ( + idx, + ( + TimeoutError, + TimeoutError( + f"Rank failed to join in under {timeout} seconds" + ), + None, + ), + ) + ) + ProcessLocalGroup.reset() + failed_ranks = [] + while not cls.exception_queue.empty(): + failure = cls.exception_queue.get() + failed_ranks.append(failure) + finally: + _uninstall_threaded_pg() + torch._C._distributed_c10d._set_thread_isolation_mode(False) + + cls._check_return_codes(failed_ranks, timeout, fn) + + @classmethod + def _check_return_codes(cls, failed_ranks, timeout, fn): + # Print based on exceptions raised from threads + # SkipTest: print info for each thread + # TimeoutError: raise RuntimeError for any timed out thread + # Normal Exception: print error for each thread that raises exception + # and raise a RuntimeError + error_msg = "" + skip_code = -1 + for rank, exc_info in failed_ranks: + exc = exc_info[1] + if isinstance(exc, unittest.SkipTest): + logger.info( + "Thread %s skipping test %s for following reason: %s", rank, fn, str(exc) + ) + if skip_code < 0: + skip_code = TEST_SKIPS["generic"].exit_code + elif isinstance(exc, TimeoutError): + msg = f"Thread {rank} terminated or timed out after {timeout} seconds\n" + logger.error(msg) + raise RuntimeError(msg) + elif isinstance(exc, Exception): + msg = "".join(traceback.format_exception(*exc_info)) + logger.error( + "Caught exception: \n%s exiting thread %s", msg, rank + ) + error_msg += ( + f"Thread {rank} exited with exception:\n{msg}\n" + ) + elif isinstance(exc, SystemExit): + if type(exc.code) == int and skip_code < 0: + skip_code = exc.code + + # check exceptions + if len(error_msg) > 0: + raise RuntimeError(error_msg) + # check skip + if skip_code > 0: + for skip in TEST_SKIPS.values(): + if skip_code == skip.exit_code: + if IS_SANDCASTLE: + # "pass" the test with an appropriate message. + logger.info( + "Skipping %s on sandcastle for the following reason: %s", fn, skip.message + ) + return + else: + raise unittest.SkipTest(skip.message) + + @property + def world_size(self) -> int: + return DEFAULT_WORLD_SIZE + + @property + def _current_test_name(self) -> str: + # self.id() == e.g. '__main__.TestDistributed.TestAdditive.test_get_rank' + return self.id().split(".")[-1] + + def assertEqualOnRank(self, x, y, msg=None, *, rank=0): + """ + The reason why we have this util function instead of + self.assertEqual is all threads are sharing one CPU RNG + so the assertion result is only reliable on rank 0 + """ + if self.rank == rank: + self.assertEqual(x, y, msg) + + def assertNotEqualOnRank(self, x, y, msg=None, *, rank=0): + if self.rank == rank: + self.assertNotEqual(x, y) + + +class SaveForwardInputsModule(nn.Module): + def __init__( + self, + forward_inputs: Dict[nn.Module, torch.Tensor], + cast_forward_inputs: bool, + ) -> None: + super().__init__() + self.l = nn.Linear(100, 100) + self.forward_inputs = forward_inputs + self.cast_forward_inputs = cast_forward_inputs + + def forward(self, x: torch.Tensor) -> torch.Tensor: + self.forward_inputs[self] = x + return self.l(x.to(self.l.weight.dtype) if self.cast_forward_inputs else x) + + +class SaveForwardInputsModel(nn.Module): + def __init__( + self, + forward_inputs: Dict[nn.Module, torch.Tensor], + cast_forward_inputs: bool, + ) -> None: + super().__init__() + self.c1 = SaveForwardInputsModule(forward_inputs, cast_forward_inputs) + self.c2 = SaveForwardInputsModule(forward_inputs, cast_forward_inputs) + self.forward_inputs = forward_inputs + + def forward(self, x: torch.Tensor) -> torch.Tensor: + self.forward_inputs[self] = x + return self.c2(self.c1(x)) + +@contextmanager +def _dynamo_dist_per_rank_init(rank, world_size, init_pg=True): + # To avoid multiple inheritance from _dynamo.test_case.TestCase and MultiProcessTestCase, + # Just manually implement the most important part of the dynamo behavior to reset/clear. + torch.cuda.set_device(rank) + os.environ['MASTER_ADDR'] = 'localhost' + os.environ['MASTER_PORT'] = '6789' + if init_pg: + c10d.init_process_group("nccl", rank=rank, world_size=world_size) + torch._dynamo.reset() + torch._dynamo.utils.counters.clear() + try: + yield + finally: + torch._dynamo.reset() + torch._dynamo.utils.counters.clear() + if init_pg: + c10d.destroy_process_group() + + +class DynamoDistributedSingleProcTestCase(torch._dynamo.test_case.TestCase): + """ + Test harness for single-process dynamo distributed tests, + initializes dist process group. + + Prefer this for simple tests, as it's easier to debug. + """ + + @classmethod + def setUpClass(cls): + super().setUpClass() + # _exit_stack is set up in TestCase + cls._exit_stack.enter_context( + patch.dict( + os.environ, + { + "MASTER_ADDR": "localhost", + "MASTER_PORT": "12355", + }, + ) + ) + cls.rank = 0 + cls.device = f"cuda:{cls.rank}" + cls.device_ids = None if "cuda" in cls.device else [cls.rank] + c10d.init_process_group("nccl", rank=cls.rank, world_size=1) + + @classmethod + def tearDownClass(cls): + c10d.destroy_process_group() + super().tearDownClass() + + +class DynamoDistributedMultiProcTestCase(MultiProcessTestCase): + """ + Use this for tests that actually run on multiple GPUs. + + Decorate tests with @skip_if_lt_x_gpu(ngpu) + + Note: MultiProcTestCase spawns processes per test and is slow. + Prefer MultiThreadedTestCase for most tests. Perhaps use this one + sparingly for integration tests. + """ + def setUp(self): + super().setUp() + self._spawn_processes() + + def tearDown(self): + super().tearDown() + try: + os.remove(self.file_name) + except OSError: + pass + + @property + def world_size(self) -> int: + return torch.cuda.device_count() + + @classmethod + def _run(cls, rank: int, test_name: str, file_name: str, parent_pipe) -> None: + # The rest is copypasta from MultiProcessTestCase._run + self = cls(test_name) + self.rank = rank + self.file_name = file_name + self.run_test(test_name, parent_pipe) + + +# NOTE [test parametrization utils for native funcol migration] +# +# Between the time we switch to the native funcol by default and the time when +# we are confident that we can remove the legacy implementation, we want to +# ensure that the legacy funcol remains covered by unit tests. This is to +# prepare for any potential (but unlikely) reverts. The following utilities +# help achieve this goal. +# +# run_with_{native,legacy}_funcol - mark a test to run with only +# {native,legacy} funcol. These decorators are for impl specific tests (e.g. +# verifying generated code with FileCheck). +# +# run_with_both_funcol_impls - parametrize a test to run with both legacy and +# native funcol. +# +# run_with_both_funcol_impls_with_arg - same as run_with_both_funcol_impls, but +# passes `enable_native_funcol` to the test so impl specific checks can be +# carried out. +def with_native_funcol(use_native_funcol: bool, remove_arg: bool): + import torch.distributed._functional_collectives_impl as funcol_impl + + def decorator(fn): + def inner(*args, **kwargs): + if remove_arg: + del kwargs["use_native_funcol"] + with patch.object(funcol_impl, '_use_native_funcol', new=use_native_funcol): + return fn(*args, **kwargs) + + return inner + + return decorator + + +run_with_native_funcol = with_native_funcol(True, remove_arg=False) +run_with_legacy_funcol = with_native_funcol(False, remove_arg=False) + + +run_with_both_funcol_impls = parametrize( + "use_native_funcol", + [ + subtest(True, decorators=[with_native_funcol(True, remove_arg=True)]), + subtest(False, decorators=[with_native_funcol(False, remove_arg=True)]), + ] +) + +run_with_both_funcol_impls_with_arg = parametrize( + "use_native_funcol", + [ + subtest(True, decorators=[with_native_funcol(True, remove_arg=False)]), + subtest(False, decorators=[with_native_funcol(False, remove_arg=False)]), + ] +) diff --git a/shared/package-files/1f/1f9f0d7c7e4161e437448b1c6c372de926641d055126389c855512b92ae1bc05/test_random.py b/shared/package-files/1f/1f9f0d7c7e4161e437448b1c6c372de926641d055126389c855512b92ae1bc05/test_random.py new file mode 100644 index 0000000000000000000000000000000000000000..01c677126285eb66349253368b94b3270fb97793 --- /dev/null +++ b/shared/package-files/1f/1f9f0d7c7e4161e437448b1c6c372de926641d055126389c855512b92ae1bc05/test_random.py @@ -0,0 +1,61 @@ +import random +from sympy.core.random import random as rand, seed, shuffle, _assumptions_shuffle +from sympy.core.symbol import Symbol, symbols +from sympy.functions.elementary.trigonometric import sin, acos +from sympy.abc import x + + +def test_random(): + random.seed(42) + a = random.random() + random.seed(42) + Symbol('z').is_finite + b = random.random() + assert a == b + + got = set() + for i in range(2): + random.seed(28) + m0, m1 = symbols('m_0 m_1', real=True) + _ = acos(-m0/m1) + got.add(random.uniform(0,1)) + assert len(got) == 1 + + random.seed(10) + y = 0 + for i in range(4): + y += sin(random.uniform(-10,10) * x) + random.seed(10) + z = 0 + for i in range(4): + z += sin(random.uniform(-10,10) * x) + assert y == z + + +def test_seed(): + assert rand() < 1 + seed(1) + a = rand() + b = rand() + seed(1) + c = rand() + d = rand() + assert a == c + if not c == d: + assert a != b + else: + assert a == b + + abc = 'abc' + first = list(abc) + second = list(abc) + third = list(abc) + + seed(123) + shuffle(first) + + seed(123) + shuffle(second) + _assumptions_shuffle(third) + + assert first == second == third diff --git a/shared/package-files/1f/1f9fd9bac54397849a969e742670d1dd62f3ee909f91b41d8158bc603391e8e4/functions.py b/shared/package-files/1f/1f9fd9bac54397849a969e742670d1dd62f3ee909f91b41d8158bc603391e8e4/functions.py new file mode 100644 index 0000000000000000000000000000000000000000..49c475a41b7831347f81a15a74e3235c6da02a56 --- /dev/null +++ b/shared/package-files/1f/1f9fd9bac54397849a969e742670d1dd62f3ee909f91b41d8158bc603391e8e4/functions.py @@ -0,0 +1,6216 @@ +import warnings # noqa: D100 +from typing import TYPE_CHECKING, Any, Callable, Optional, Union, overload + +from duckdb import ( + CaseExpression, + CoalesceOperator, + ColumnExpression, + ConstantExpression, + Expression, + FunctionExpression, + LambdaExpression, + SQLExpression, +) + +if TYPE_CHECKING: + from .dataframe import DataFrame + +from ..errors import PySparkTypeError +from ..exception import ContributionsAcceptedError +from . import types as _types +from ._typing import ColumnOrName +from .column import Column, _get_expr + + +def _invoke_function_over_columns(name: str, *cols: "ColumnOrName") -> Column: + """Invokes n-ary JVM function identified by name + and wraps the result with :class:`~pyspark.sql.Column`. + """ # noqa: D205 + cols = [_to_column_expr(expr) for expr in cols] + return _invoke_function(name, *cols) + + +def _nan_constant() -> Expression: + """Create a NaN constant expression. + + Note: ConstantExpression(float("nan")) returns NULL instead of NaN because + TransformPythonValue() in the C++ layer has nan_as_null=true by default. + This is intentional for data import scenarios (CSV, Pandas, etc.) where NaN + represents missing data. + + For mathematical functions that need to return NaN (not NULL) for out-of-range + inputs per PySpark/IEEE 754 semantics, we use SQLExpression as a workaround. + + Returns: + ------- + Expression + An expression that evaluates to NaN (not NULL) + """ + return SQLExpression("'NaN'::DOUBLE") + + +def col(column: str) -> Column: # noqa: D103 + return Column(ColumnExpression(column)) + + +def upper(col: "ColumnOrName") -> Column: + """Converts a string expression to upper case. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + upper case values. + + Examples: + -------- + >>> df = spark.createDataFrame(["Spark", "PySpark", "Pandas API"], "STRING") + >>> df.select(upper("value")).show() + +------------+ + |upper(value)| + +------------+ + | SPARK| + | PYSPARK| + | PANDAS API| + +------------+ + """ + return _invoke_function_over_columns("upper", col) + + +def ucase(str: "ColumnOrName") -> Column: + """Returns `str` with all characters changed to uppercase. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + str : :class:`~pyspark.sql.Column` or str + Input column or strings. + + Examples: + -------- + >>> import pyspark.sql.functions as sf + >>> spark.range(1).select(sf.ucase(sf.lit("Spark"))).show() + +------------+ + |ucase(Spark)| + +------------+ + | SPARK| + +------------+ + """ + return upper(str) + + +def when(condition: "Column", value: Union[Column, str]) -> Column: # noqa: D103 + if not isinstance(condition, Column): + msg = "condition should be a Column" + raise TypeError(msg) + v = _get_expr(value) + expr = CaseExpression(condition.expr, v) + return Column(expr) + + +def _inner_expr_or_val(val: Union[Column, str]) -> Union[Column, str]: + return val.expr if isinstance(val, Column) else val + + +def struct(*cols: Column) -> Column: # noqa: D103 + return Column(FunctionExpression("struct_pack", *[_inner_expr_or_val(x) for x in cols])) + + +def array(*cols: Union["ColumnOrName", Union[list["ColumnOrName"], tuple["ColumnOrName", ...]]]) -> Column: + r"""Creates a new array column. + + .. versionadded:: 1.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + cols : :class:`~pyspark.sql.Column` or str + column names or :class:`~pyspark.sql.Column`\\s that have + the same data type. + + Returns: + ------- + :class:`~pyspark.sql.Column` + a column of array type. + + Examples: + -------- + >>> df = spark.createDataFrame([("Alice", 2), ("Bob", 5)], ("name", "age")) + >>> df.select(array("age", "age").alias("arr")).collect() + [Row(arr=[2, 2]), Row(arr=[5, 5])] + >>> df.select(array([df.age, df.age]).alias("arr")).collect() + [Row(arr=[2, 2]), Row(arr=[5, 5])] + >>> df.select(array("age", "age").alias("col")).printSchema() + root + |-- col: array (nullable = false) + | |-- element: long (containsNull = true) + """ + if len(cols) == 1 and isinstance(cols[0], (list, set)): + cols = cols[0] + return _invoke_function_over_columns("list_value", *cols) + + +def lit(col: Any) -> Column: # noqa: D103, ANN401 + return col if isinstance(col, Column) else Column(ConstantExpression(col)) + + +def _invoke_function(function: str, *arguments) -> Column: + return Column(FunctionExpression(function, *arguments)) + + +def _to_column_expr(col: ColumnOrName) -> Expression: + if isinstance(col, Column): + return col.expr + elif isinstance(col, str): + return ColumnExpression(col) + else: + raise PySparkTypeError( + error_class="NOT_COLUMN_OR_STR", + message_parameters={"arg_name": "col", "arg_type": type(col).__name__}, + ) + + +def regexp_replace(str: "ColumnOrName", pattern: str, replacement: str) -> Column: + r"""Replace all substrings of the specified string value that match regexp with rep. + + .. versionadded:: 1.5.0 + + Examples: + -------- + >>> df = spark.createDataFrame([("100-200",)], ["str"]) + >>> df.select(regexp_replace("str", r"(\d+)", "--").alias("d")).collect() + [Row(d='-----')] + """ + return _invoke_function( + "regexp_replace", + _to_column_expr(str), + ConstantExpression(pattern), + ConstantExpression(replacement), + ConstantExpression("g"), + ) + + +def slice(x: "ColumnOrName", start: Union["ColumnOrName", int], length: Union["ColumnOrName", int]) -> Column: + """Collection function: returns an array containing all the elements in `x` from index `start` + (array indices start at 1, or from the end if `start` is negative) with the specified `length`. + + .. versionadded:: 2.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + x : :class:`~pyspark.sql.Column` or str + column name or column containing the array to be sliced + start : :class:`~pyspark.sql.Column` or str or int + column name, column, or int containing the starting index + length : :class:`~pyspark.sql.Column` or str or int + column name, column, or int containing the length of the slice + + Returns: + ------- + :class:`~pyspark.sql.Column` + a column of array type. Subset of array. + + Examples: + -------- + >>> df = spark.createDataFrame([([1, 2, 3],), ([4, 5],)], ["x"]) + >>> df.select(slice(df.x, 2, 2).alias("sliced")).collect() + [Row(sliced=[2, 3]), Row(sliced=[5])] + """ # noqa: D205 + start = ConstantExpression(start) if isinstance(start, int) else _to_column_expr(start) + length = ConstantExpression(length) if isinstance(length, int) else _to_column_expr(length) + + end = start + length + + return _invoke_function("list_slice", _to_column_expr(x), start, end) + + +def asc_nulls_first(col: "ColumnOrName") -> Column: + """Returns a sort expression based on the ascending order of the given + column name, and null values return before non-null values. + + .. versionadded:: 2.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to sort by in the ascending order. + + Returns: + ------- + :class:`~pyspark.sql.Column` + the column specifying the order. + + Examples: + -------- + >>> df1 = spark.createDataFrame([(1, "Bob"), (0, None), (2, "Alice")], ["age", "name"]) + >>> df1.sort(asc_nulls_first(df1.name)).show() + +---+-----+ + |age| name| + +---+-----+ + | 0| NULL| + | 2|Alice| + | 1| Bob| + +---+-----+ + + """ # noqa: D205 + return asc(col).nulls_first() + + +def asc_nulls_last(col: "ColumnOrName") -> Column: + """Returns a sort expression based on the ascending order of the given + column name, and null values appear after non-null values. + + .. versionadded:: 2.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to sort by in the ascending order. + + Returns: + ------- + :class:`~pyspark.sql.Column` + the column specifying the order. + + Examples: + -------- + >>> df1 = spark.createDataFrame([(0, None), (1, "Bob"), (2, "Alice")], ["age", "name"]) + >>> df1.sort(asc_nulls_last(df1.name)).show() + +---+-----+ + |age| name| + +---+-----+ + | 2|Alice| + | 1| Bob| + | 0| NULL| + +---+-----+ + + """ # noqa: D205 + return asc(col).nulls_last() + + +def desc_nulls_first(col: "ColumnOrName") -> Column: + """Returns a sort expression based on the descending order of the given + column name, and null values appear before non-null values. + + .. versionadded:: 2.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to sort by in the descending order. + + Returns: + ------- + :class:`~pyspark.sql.Column` + the column specifying the order. + + Examples: + -------- + >>> df1 = spark.createDataFrame([(0, None), (1, "Bob"), (2, "Alice")], ["age", "name"]) + >>> df1.sort(desc_nulls_first(df1.name)).show() + +---+-----+ + |age| name| + +---+-----+ + | 0| NULL| + | 1| Bob| + | 2|Alice| + +---+-----+ + + """ # noqa: D205 + return desc(col).nulls_first() + + +def desc_nulls_last(col: "ColumnOrName") -> Column: + """Returns a sort expression based on the descending order of the given + column name, and null values appear after non-null values. + + .. versionadded:: 2.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to sort by in the descending order. + + Returns: + ------- + :class:`~pyspark.sql.Column` + the column specifying the order. + + Examples: + -------- + >>> df1 = spark.createDataFrame([(0, None), (1, "Bob"), (2, "Alice")], ["age", "name"]) + >>> df1.sort(desc_nulls_last(df1.name)).show() + +---+-----+ + |age| name| + +---+-----+ + | 1| Bob| + | 2|Alice| + | 0| NULL| + +---+-----+ + + """ # noqa: D205 + return desc(col).nulls_last() + + +def left(str: "ColumnOrName", len: "ColumnOrName") -> Column: + """Returns the leftmost `len`(`len` can be string type) characters from the string `str`, + if `len` is less or equal than 0 the result is an empty string. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + str : :class:`~pyspark.sql.Column` or str + Input column or strings. + len : :class:`~pyspark.sql.Column` or str + Input column or strings, the leftmost `len`. + + Examples: + -------- + >>> df = spark.createDataFrame( + ... [ + ... ( + ... "Spark SQL", + ... 3, + ... ) + ... ], + ... ["a", "b"], + ... ) + >>> df.select(left(df.a, df.b).alias("r")).collect() + [Row(r='Spa')] + """ # noqa: D205 + len = _to_column_expr(len) + return Column( + CaseExpression(len <= ConstantExpression(0), ConstantExpression("")).otherwise( + FunctionExpression("array_slice", _to_column_expr(str), ConstantExpression(0), len) + ) + ) + + +def right(str: "ColumnOrName", len: "ColumnOrName") -> Column: + """Returns the rightmost `len`(`len` can be string type) characters from the string `str`, + if `len` is less or equal than 0 the result is an empty string. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + str : :class:`~pyspark.sql.Column` or str + Input column or strings. + len : :class:`~pyspark.sql.Column` or str + Input column or strings, the rightmost `len`. + + Examples: + -------- + >>> df = spark.createDataFrame( + ... [ + ... ( + ... "Spark SQL", + ... 3, + ... ) + ... ], + ... ["a", "b"], + ... ) + >>> df.select(right(df.a, df.b).alias("r")).collect() + [Row(r='SQL')] + """ # noqa: D205 + len = _to_column_expr(len) + return Column( + CaseExpression(len <= ConstantExpression(0), ConstantExpression("")).otherwise( + FunctionExpression("array_slice", _to_column_expr(str), -len, ConstantExpression(-1)) + ) + ) + + +def levenshtein(left: "ColumnOrName", right: "ColumnOrName", threshold: Optional[int] = None) -> Column: + """Computes the Levenshtein distance of the two given strings. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + left : :class:`~pyspark.sql.Column` or str + first column value. + right : :class:`~pyspark.sql.Column` or str + second column value. + threshold : int, optional + if set when the levenshtein distance of the two given strings + less than or equal to a given threshold then return result distance, or -1 + + .. versionchanged: 3.5.0 + Added ``threshold`` argument. + + Returns: + ------- + :class:`~pyspark.sql.Column` + Levenshtein distance as integer value. + + Examples: + -------- + >>> df0 = spark.createDataFrame( + ... [ + ... ( + ... "kitten", + ... "sitting", + ... ) + ... ], + ... ["l", "r"], + ... ) + >>> df0.select(levenshtein("l", "r").alias("d")).collect() + [Row(d=3)] + >>> df0.select(levenshtein("l", "r", 2).alias("d")).collect() + [Row(d=-1)] + """ + distance = _invoke_function_over_columns("levenshtein", left, right) + if threshold is None: + return distance + else: + distance = _to_column_expr(distance) + return Column( + CaseExpression(distance <= ConstantExpression(threshold), distance).otherwise(ConstantExpression(-1)) + ) + + +def lpad(col: "ColumnOrName", len: int, pad: str) -> Column: + """Left-pad the string column to width `len` with `pad`. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to work on. + len : int + length of the final string. + pad : str + chars to prepend. + + Returns: + ------- + :class:`~pyspark.sql.Column` + left padded result. + + Examples: + -------- + >>> df = spark.createDataFrame( + ... [("abcd",)], + ... [ + ... "s", + ... ], + ... ) + >>> df.select(lpad(df.s, 6, "#").alias("s")).collect() + [Row(s='##abcd')] + """ + return _invoke_function("lpad", _to_column_expr(col), ConstantExpression(len), ConstantExpression(pad)) + + +def rpad(col: "ColumnOrName", len: int, pad: str) -> Column: + """Right-pad the string column to width `len` with `pad`. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to work on. + len : int + length of the final string. + pad : str + chars to append. + + Returns: + ------- + :class:`~pyspark.sql.Column` + right padded result. + + Examples: + -------- + >>> df = spark.createDataFrame( + ... [("abcd",)], + ... [ + ... "s", + ... ], + ... ) + >>> df.select(rpad(df.s, 6, "#").alias("s")).collect() + [Row(s='abcd##')] + """ + return _invoke_function("rpad", _to_column_expr(col), ConstantExpression(len), ConstantExpression(pad)) + + +def ascii(col: "ColumnOrName") -> Column: + """Computes the numeric value of the first character of the string column. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + numeric value. + + Examples: + -------- + >>> df = spark.createDataFrame(["Spark", "PySpark", "Pandas API"], "STRING") + >>> df.select(ascii("value")).show() + +------------+ + |ascii(value)| + +------------+ + | 83| + | 80| + | 80| + +------------+ + """ + return _invoke_function_over_columns("ascii", col) + + +def asin(col: "ColumnOrName") -> Column: + """Computes inverse sine of the input column. + + .. versionadded:: 1.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + inverse sine of `col`, as if computed by `java.lang.Math.asin()` + + Examples: + -------- + >>> df = spark.createDataFrame([(0,), (2,)]) + >>> df.select(asin(df.schema.fieldNames()[0])).show() + +--------+ + |ASIN(_1)| + +--------+ + | 0.0| + | NaN| + +--------+ + """ + col = _to_column_expr(col) + # asin domain is [-1, 1]; return NaN for out-of-range values per PySpark semantics + return Column( + CaseExpression((col < -1.0) | (col > 1.0), _nan_constant()).otherwise(FunctionExpression("asin", col)) + ) + + +def like(str: "ColumnOrName", pattern: "ColumnOrName", escapeChar: Optional["Column"] = None) -> Column: + r"""Returns true if str matches `pattern` with `escape`, + null if any arguments are null, false otherwise. + The default escape character is the '\'. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + str : :class:`~pyspark.sql.Column` or str + A string. + pattern : :class:`~pyspark.sql.Column` or str + A string. See the DuckDB documentation on like_escape for more information. + escape : :class:`~pyspark.sql.Column` + An character added since Spark 3.0. The default escape character is the '\'. + If an escape character precedes a special symbol or another escape character, the + following character is matched literally. It is invalid to escape any other character. + + Examples: + -------- + >>> df = spark.createDataFrame([("Spark", "_park")], ["a", "b"]) + >>> df.select(like(df.a, df.b).alias("r")).collect() + [Row(r=True)] + + >>> df = spark.createDataFrame( + ... [("%SystemDrive%/Users/John", "/%SystemDrive/%//Users%")], ["a", "b"] + ... ) + >>> df.select(like(df.a, df.b, lit("/")).alias("r")).collect() + [Row(r=True)] + """ # noqa: D205 + escapeChar = ConstantExpression("\\") if escapeChar is None else _to_column_expr(escapeChar) + return _invoke_function("like_escape", _to_column_expr(str), _to_column_expr(pattern), escapeChar) + + +def ilike(str: "ColumnOrName", pattern: "ColumnOrName", escapeChar: Optional["Column"] = None) -> Column: + r"""Returns true if str matches `pattern` with `escape` case-insensitively, + null if any arguments are null, false otherwise. + The default escape character is the '\'. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + str : :class:`~pyspark.sql.Column` or str + A string. + pattern : :class:`~pyspark.sql.Column` or str + A string. See the DuckDB documentation on ilike_escape for more information. + escape : :class:`~pyspark.sql.Column` + An character added since Spark 3.0. The default escape character is the '\'. + If an escape character precedes a special symbol or another escape character, the + following character is matched literally. It is invalid to escape any other character. + + Examples: + -------- + >>> df = spark.createDataFrame([("Spark", "_park")], ["a", "b"]) + >>> df.select(ilike(df.a, df.b).alias("r")).collect() + [Row(r=True)] + + >>> df = spark.createDataFrame( + ... [("%SystemDrive%/Users/John", "/%SystemDrive/%//Users%")], ["a", "b"] + ... ) + >>> df.select(ilike(df.a, df.b, lit("/")).alias("r")).collect() + [Row(r=True)] + """ # noqa: D205 + escapeChar = ConstantExpression("\\") if escapeChar is None else _to_column_expr(escapeChar) + return _invoke_function("ilike_escape", _to_column_expr(str), _to_column_expr(pattern), escapeChar) + + +def array_agg(col: "ColumnOrName") -> Column: + """Aggregate function: returns a list of objects with duplicates. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + list of objects with duplicates. + + Examples: + -------- + >>> df = spark.createDataFrame([[1], [1], [2]], ["c"]) + >>> df.agg(array_agg("c").alias("r")).collect() + [Row(r=[1, 1, 2])] + """ + return _invoke_function_over_columns("list", col) + + +def collect_list(col: "ColumnOrName") -> Column: + """Aggregate function: returns a list of objects with duplicates. + + .. versionadded:: 1.6.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Notes: + ----- + The function is non-deterministic because the order of collected results depends + on the order of the rows which may be non-deterministic after a shuffle. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + list of objects with duplicates. + + Examples: + -------- + >>> df2 = spark.createDataFrame([(2,), (5,), (5,)], ("age",)) + >>> df2.agg(collect_list("age")).collect() + [Row(collect_list(age)=[2, 5, 5])] + """ + return array_agg(col) + + +def array_append(col: "ColumnOrName", value: Union[Column, str]) -> Column: + """Collection function: returns an array of the elements in col1 along + with the added element in col2 at the last of the array. + + .. versionadded:: 3.4.0 + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + name of column containing array + value : + a literal value, or a :class:`~pyspark.sql.Column` expression. + + Returns: + ------- + :class:`~pyspark.sql.Column` + an array of values from first array along with the element. + + Notes: + ----- + Supports Spark Connect. + + Examples: + -------- + >>> from pyspark.sql import Row + >>> df = spark.createDataFrame([Row(c1=["b", "a", "c"], c2="c")]) + >>> df.select(array_append(df.c1, df.c2)).collect() + [Row(array_append(c1, c2)=['b', 'a', 'c', 'c'])] + >>> df.select(array_append(df.c1, "x")).collect() + [Row(array_append(c1, x)=['b', 'a', 'c', 'x'])] + """ # noqa: D205 + return _invoke_function("list_append", _to_column_expr(col), _get_expr(value)) + + +def array_insert(arr: "ColumnOrName", pos: Union["ColumnOrName", int], value: Union[Column, str]) -> Column: + """Collection function: adds an item into a given array at a specified array index. + Array indices start at 1, or start from the end if index is negative. + Index above array size appends the array, or prepends the array if index is negative, + with 'null' elements. + + .. versionadded:: 3.4.0 + + Parameters + ---------- + arr : :class:`~pyspark.sql.Column` or str + name of column containing an array + pos : :class:`~pyspark.sql.Column` or str or int + name of Numeric type column indicating position of insertion + (starting at index 1, negative position is a start from the back of the array) + value : + a literal value, or a :class:`~pyspark.sql.Column` expression. + + Returns: + ------- + :class:`~pyspark.sql.Column` + an array of values, including the new specified value + + Notes: + ----- + Supports Spark Connect. + + Examples: + -------- + >>> df = spark.createDataFrame( + ... [(["a", "b", "c"], 2, "d"), (["c", "b", "a"], -2, "d")], ["data", "pos", "val"] + ... ) + >>> df.select(array_insert(df.data, df.pos.cast("integer"), df.val).alias("data")).collect() + [Row(data=['a', 'd', 'b', 'c']), Row(data=['c', 'b', 'd', 'a'])] + >>> df.select(array_insert(df.data, 5, "hello").alias("data")).collect() + [Row(data=['a', 'b', 'c', None, 'hello']), Row(data=['c', 'b', 'a', None, 'hello'])] + """ # noqa: D205 + pos = _get_expr(pos) + arr = _to_column_expr(arr) + # Depending on if the position is positive or not, we need to interpret it differently. + # This is because negative numbers are relative to the end of the NEW list. + # For example, if it's -2, it's expected that the inserted value is at the second position + # in the NEW list. + pos_is_positive = pos > 0 + + list_length_plus_1 = FunctionExpression("add", FunctionExpression("len", arr), 1) + + # If the position is above the list size plus 1, first extend the list with the + # relevant number of nulls to get the list to the size of (pos - 1). + list_ = CaseExpression( + pos > list_length_plus_1, + FunctionExpression("list_resize", arr, FunctionExpression("subtract", pos, 1)), + ).otherwise( + CaseExpression( + (pos < 0) & (FunctionExpression("abs", pos) > list_length_plus_1), + FunctionExpression( + "list_concat", + FunctionExpression( + "list_resize", + FunctionExpression("list_value", None), + FunctionExpression("subtract", FunctionExpression("abs", pos), list_length_plus_1), + ), + arr, + ), + ).otherwise(arr) + ) + + # We slice the array into two parts, insert the value in between and concatenate the two parts + # together again. + return _invoke_function( + "list_concat", + FunctionExpression( + "list_concat", + # First part of the list + FunctionExpression( + "list_slice", + list_, + 1, + CaseExpression(pos_is_positive, FunctionExpression("subtract", pos, 1)).otherwise(pos), + ), + # Here we insert the value at the specified position + FunctionExpression("list_value", _get_expr(value)), + ), + # The remainder of the list + FunctionExpression( + "list_slice", + list_, + CaseExpression(pos_is_positive, pos).otherwise(FunctionExpression("add", pos, 1)), + -1, + ), + ) + + +def array_contains(col: "ColumnOrName", value: Union[Column, str]) -> Column: + """Collection function: returns null if the array is null, true if the array contains the + given value, and false otherwise. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + name of column containing array + value : + value or column to check for in array + + Returns: + ------- + :class:`~pyspark.sql.Column` + a column of Boolean type. + + Examples: + -------- + >>> df = spark.createDataFrame([(["a", "b", "c"],), ([],)], ["data"]) + >>> df.select(array_contains(df.data, "a")).collect() + [Row(array_contains(data, a)=True), Row(array_contains(data, a)=False)] + >>> df.select(array_contains(df.data, lit("a"))).collect() + [Row(array_contains(data, a)=True), Row(array_contains(data, a)=False)] + """ # noqa: D205 + value = _get_expr(value) + return _invoke_function("array_contains", _to_column_expr(col), value) + + +def array_distinct(col: "ColumnOrName") -> Column: + """Collection function: removes duplicate values from the array. + + .. versionadded:: 2.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + name of column or expression + + Returns: + ------- + :class:`~pyspark.sql.Column` + an array of unique values. + + Examples: + -------- + >>> df = spark.createDataFrame([([1, 2, 3, 2],), ([4, 5, 5, 4],)], ["data"]) + >>> df.select(array_distinct(df.data)).collect() + [Row(array_distinct(data)=[1, 2, 3]), Row(array_distinct(data)=[4, 5])] + """ + return _invoke_function_over_columns("array_distinct", col) + + +def array_intersect(col1: "ColumnOrName", col2: "ColumnOrName") -> Column: + """Collection function: returns an array of the elements in the intersection of col1 and col2, + without duplicates. + + .. versionadded:: 2.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col1 : :class:`~pyspark.sql.Column` or str + name of column containing array + col2 : :class:`~pyspark.sql.Column` or str + name of column containing array + + Returns: + ------- + :class:`~pyspark.sql.Column` + an array of values in the intersection of two arrays. + + Examples: + -------- + >>> from pyspark.sql import Row + >>> df = spark.createDataFrame([Row(c1=["b", "a", "c"], c2=["c", "d", "a", "f"])]) + >>> df.select(array_intersect(df.c1, df.c2)).collect() + [Row(array_intersect(c1, c2)=['a', 'c'])] + """ # noqa: D205 + return _invoke_function_over_columns("array_intersect", col1, col2) + + +def array_union(col1: "ColumnOrName", col2: "ColumnOrName") -> Column: + """Collection function: returns an array of the elements in the union of col1 and col2, + without duplicates. + + .. versionadded:: 2.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col1 : :class:`~pyspark.sql.Column` or str + name of column containing array + col2 : :class:`~pyspark.sql.Column` or str + name of column containing array + + Returns: + ------- + :class:`~pyspark.sql.Column` + an array of values in union of two arrays. + + Examples: + -------- + >>> from pyspark.sql import Row + >>> df = spark.createDataFrame([Row(c1=["b", "a", "c"], c2=["c", "d", "a", "f"])]) + >>> df.select(array_union(df.c1, df.c2)).collect() + [Row(array_union(c1, c2)=['b', 'a', 'c', 'd', 'f'])] + """ # noqa: D205 + return _invoke_function_over_columns("array_distinct", _invoke_function_over_columns("array_concat", col1, col2)) + + +def array_max(col: "ColumnOrName") -> Column: + """Collection function: returns the maximum value of the array. + + .. versionadded:: 2.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + name of column or expression + + Returns: + ------- + :class:`~pyspark.sql.Column` + maximum value of an array. + + Examples: + -------- + >>> df = spark.createDataFrame([([2, 1, 3],), ([None, 10, -1],)], ["data"]) + >>> df.select(array_max(df.data).alias("max")).collect() + [Row(max=3), Row(max=10)] + """ + return _invoke_function( + "array_extract", _to_column_expr(_invoke_function_over_columns("array_sort", col)), _get_expr(-1) + ) + + +def array_min(col: "ColumnOrName") -> Column: + """Collection function: returns the minimum value of the array. + + .. versionadded:: 2.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + name of column or expression + + Returns: + ------- + :class:`~pyspark.sql.Column` + minimum value of array. + + Examples: + -------- + >>> df = spark.createDataFrame([([2, 1, 3],), ([None, 10, -1],)], ["data"]) + >>> df.select(array_min(df.data).alias("min")).collect() + [Row(min=1), Row(min=-1)] + """ + return _invoke_function( + "array_extract", _to_column_expr(_invoke_function_over_columns("array_sort", col)), _get_expr(1) + ) + + +def avg(col: "ColumnOrName") -> Column: + """Aggregate function: returns the average of the values in a group. + + .. versionadded:: 1.3.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + the column for computed results. + + Examples: + -------- + >>> df = spark.range(10) + >>> df.select(avg(col("id"))).show() + +-------+ + |avg(id)| + +-------+ + | 4.5| + +-------+ + """ + return _invoke_function_over_columns("avg", col) + + +def sum(col: "ColumnOrName") -> Column: + """Aggregate function: returns the sum of all values in the expression. + + .. versionadded:: 1.3.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + the column for computed results. + + Examples: + -------- + >>> df = spark.range(10) + >>> df.select(sum(df["id"])).show() + +-------+ + |sum(id)| + +-------+ + | 45| + +-------+ + """ + return _invoke_function_over_columns("sum", col) + + +def max(col: "ColumnOrName") -> Column: + """Aggregate function: returns the maximum value of the expression in a group. + + .. versionadded:: 1.3.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + column for computed results. + + Examples: + -------- + >>> df = spark.range(10) + >>> df.select(max(col("id"))).show() + +-------+ + |max(id)| + +-------+ + | 9| + +-------+ + """ + return _invoke_function_over_columns("max", col) + + +def mean(col: "ColumnOrName") -> Column: + """Aggregate function: returns the average of the values in a group. + An alias of :func:`avg`. + + .. versionadded:: 1.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + the column for computed results. + + Examples: + -------- + >>> df = spark.range(10) + >>> df.select(mean(df.id)).show() + +-------+ + |avg(id)| + +-------+ + | 4.5| + +-------+ + """ # noqa: D205 + return _invoke_function_over_columns("mean", col) + + +def median(col: "ColumnOrName") -> Column: + """Returns the median of the values in a group. + + .. versionadded:: 3.4.0 + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + the median of the values in a group. + + Notes: + ----- + Supports Spark Connect. + + Examples: + -------- + >>> df = spark.createDataFrame( + ... [ + ... ("Java", 2012, 20000), + ... ("dotNET", 2012, 5000), + ... ("Java", 2012, 22000), + ... ("dotNET", 2012, 10000), + ... ("dotNET", 2013, 48000), + ... ("Java", 2013, 30000), + ... ], + ... schema=("course", "year", "earnings"), + ... ) + >>> df.groupby("course").agg(median("earnings")).show() + +------+----------------+ + |course|median(earnings)| + +------+----------------+ + | Java| 22000.0| + |dotNET| 10000.0| + +------+----------------+ + """ + return _invoke_function_over_columns("median", col) + + +def mode(col: "ColumnOrName") -> Column: + """Returns the most frequent value in a group. + + .. versionadded:: 3.4.0 + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + the most frequent value in a group. + + Notes: + ----- + Supports Spark Connect. + + Examples: + -------- + >>> df = spark.createDataFrame( + ... [ + ... ("Java", 2012, 20000), + ... ("dotNET", 2012, 5000), + ... ("Java", 2012, 20000), + ... ("dotNET", 2012, 5000), + ... ("dotNET", 2013, 48000), + ... ("Java", 2013, 30000), + ... ], + ... schema=("course", "year", "earnings"), + ... ) + >>> df.groupby("course").agg(mode("year")).show() + +------+----------+ + |course|mode(year)| + +------+----------+ + | Java| 2012| + |dotNET| 2012| + +------+----------+ + """ + return _invoke_function_over_columns("mode", col) + + +def min(col: "ColumnOrName") -> Column: + """Aggregate function: returns the minimum value of the expression in a group. + + .. versionadded:: 1.3.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + column for computed results. + + Examples: + -------- + >>> df = spark.range(10) + >>> df.select(min(df.id)).show() + +-------+ + |min(id)| + +-------+ + | 0| + +-------+ + """ + return _invoke_function_over_columns("min", col) + + +def any_value(col: "ColumnOrName") -> Column: + """Returns some value of `col` for a group of rows. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to work on. + ignorenulls : :class:`~pyspark.sql.Column` or bool + if first value is null then look for first non-null value. + + Returns: + ------- + :class:`~pyspark.sql.Column` + some value of `col` for a group of rows. + + Examples: + -------- + >>> df = spark.createDataFrame( + ... [(None, 1), ("a", 2), ("a", 3), ("b", 8), ("b", 2)], ["c1", "c2"] + ... ) + >>> df.select(any_value("c1"), any_value("c2")).collect() + [Row(any_value(c1)=None, any_value(c2)=1)] + >>> df.select(any_value("c1", True), any_value("c2", True)).collect() + [Row(any_value(c1)='a', any_value(c2)=1)] + """ + return _invoke_function_over_columns("any_value", col) + + +def count(col: "ColumnOrName") -> Column: + """Aggregate function: returns the number of items in a group. + + .. versionadded:: 1.3.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + column for computed results. + + Examples: + -------- + Count by all columns (start), and by a column that does not count ``None``. + + >>> df = spark.createDataFrame([(None,), ("a",), ("b",), ("c",)], schema=["alphabets"]) + >>> df.select(count(expr("*")), count(df.alphabets)).show() + +--------+----------------+ + |count(1)|count(alphabets)| + +--------+----------------+ + | 4| 3| + +--------+----------------+ + """ + return _invoke_function_over_columns("count", col) + + +def approx_count_distinct(col: "ColumnOrName", rsd: Optional[float] = None) -> Column: + """Aggregate function: returns a new :class:`~pyspark.sql.Column` for approximate distinct count + of column `col`. + + .. versionadded:: 2.1.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + rsd : float, optional + maximum relative standard deviation allowed (default = 0.05). + For rsd < 0.01, it is more efficient to use :func:`count_distinct` + + Returns: + ------- + :class:`~pyspark.sql.Column` + the column of computed results. + + Examples: + -------- + >>> df = spark.createDataFrame([1, 2, 2, 3], "INT") + >>> df.agg(approx_count_distinct("value").alias("distinct_values")).show() + +---------------+ + |distinct_values| + +---------------+ + | 3| + +---------------+ + """ # noqa: D205 + if rsd is not None: + msg = "rsd is not supported by DuckDB" + raise ValueError(msg) + return _invoke_function_over_columns("approx_count_distinct", col) + + +def approxCountDistinct(col: "ColumnOrName", rsd: Optional[float] = None) -> Column: + """.. versionadded:: 1.3.0. + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + .. deprecated:: 2.1.0 + Use :func:`approx_count_distinct` instead. + """ + warnings.warn("Deprecated in 2.1, use approx_count_distinct instead.", FutureWarning, stacklevel=3) + return approx_count_distinct(col, rsd) + + +@overload +def transform(col: "ColumnOrName", f: Callable[[Column], Column]) -> Column: ... + + +@overload +def transform(col: "ColumnOrName", f: Callable[[Column, Column], Column]) -> Column: ... + + +def transform( + col: "ColumnOrName", + f: Union[Callable[[Column], Column], Callable[[Column, Column], Column]], +) -> Column: + """Returns an array of elements after applying a transformation to each element in the input array. + + .. versionadded:: 3.1.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + name of column or expression + f : function + a function that is applied to each element of the input array. + Can take one of the following forms: + + - Unary ``(x: Column) -> Column: ...`` + - Binary ``(x: Column, i: Column) -> Column...``, where the second argument is + a 0-based index of the element. + + and can use methods of :class:`~pyspark.sql.Column`, functions defined in + :py:mod:`pyspark.sql.functions` and Scala ``UserDefinedFunctions``. + Python ``UserDefinedFunctions`` are not supported + (`SPARK-27052 `__). + + Returns: + ------- + :class:`~pyspark.sql.Column` + a new array of transformed elements. + + Examples: + -------- + >>> df = spark.createDataFrame([(1, [1, 2, 3, 4])], ("key", "values")) + >>> df.select(transform("values", lambda x: x * 2).alias("doubled")).show() + +------------+ + | doubled| + +------------+ + |[2, 4, 6, 8]| + +------------+ + + >>> def alternate(x, i): + ... return when(i % 2 == 0, x).otherwise(-x) + >>> df.select(transform("values", alternate).alias("alternated")).show() + +--------------+ + | alternated| + +--------------+ + |[1, -2, 3, -4]| + +--------------+ + """ + raise NotImplementedError + + +def concat_ws(sep: str, *cols: "ColumnOrName") -> "Column": + """Concatenates multiple input string columns together into a single string column, + using the given separator. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + sep : str + words separator. + cols : :class:`~pyspark.sql.Column` or str + list of columns to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + string of concatenated words. + + Examples: + -------- + >>> df = spark.createDataFrame([("abcd", "123")], ["s", "d"]) + >>> df.select(concat_ws("-", df.s, df.d).alias("s")).collect() + [Row(s='abcd-123')] + """ # noqa: D205 + cols = [_to_column_expr(expr) for expr in cols] + return _invoke_function("concat_ws", ConstantExpression(sep), *cols) + + +def lower(col: "ColumnOrName") -> Column: + """Converts a string expression to lower case. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + lower case values. + + Examples: + -------- + >>> df = spark.createDataFrame(["Spark", "PySpark", "Pandas API"], "STRING") + >>> df.select(lower("value")).show() + +------------+ + |lower(value)| + +------------+ + | spark| + | pyspark| + | pandas api| + +------------+ + """ + return _invoke_function_over_columns("lower", col) + + +def lcase(str: "ColumnOrName") -> Column: + """Returns `str` with all characters changed to lowercase. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + str : :class:`~pyspark.sql.Column` or str + Input column or strings. + + Examples: + -------- + >>> import pyspark.sql.functions as sf + >>> spark.range(1).select(sf.lcase(sf.lit("Spark"))).show() + +------------+ + |lcase(Spark)| + +------------+ + | spark| + +------------+ + """ + return lower(str) + + +def ceil(col: "ColumnOrName") -> Column: + """Computes the ceiling of the given value. + + .. versionadded:: 1.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + the column for computed results. + + Examples: + -------- + >>> df = spark.range(1) + >>> df.select(ceil(lit(-0.1))).show() + +----------+ + |CEIL(-0.1)| + +----------+ + | 0| + +----------+ + """ + return _invoke_function_over_columns("ceil", col) + + +def ceiling(col: "ColumnOrName") -> Column: # noqa: D103 + return ceil(col) + + +def floor(col: "ColumnOrName") -> Column: + """Computes the floor of the given value. + + .. versionadded:: 1.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + column to find floor for. + + Returns: + ------- + :class:`~pyspark.sql.Column` + nearest integer that is less than or equal to given value. + + Examples: + -------- + >>> df = spark.range(1) + >>> df.select(floor(lit(2.5))).show() + +----------+ + |FLOOR(2.5)| + +----------+ + | 2| + +----------+ + """ + return _invoke_function_over_columns("floor", col) + + +def abs(col: "ColumnOrName") -> Column: + """Computes the absolute value. + + .. versionadded:: 1.3.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + column for computed results. + + Examples: + -------- + >>> df = spark.range(1) + >>> df.select(abs(lit(-1))).show() + +-------+ + |abs(-1)| + +-------+ + | 1| + +-------+ + """ + return _invoke_function_over_columns("abs", col) + + +def isnan(col: "ColumnOrName") -> Column: + """An expression that returns true if the column is NaN. + + .. versionadded:: 1.6.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + True if value is NaN and False otherwise. + + Examples: + -------- + >>> df = spark.createDataFrame([(1.0, float("nan")), (float("nan"), 2.0)], ("a", "b")) + >>> df.select("a", "b", isnan("a").alias("r1"), isnan(df.b).alias("r2")).show() + +---+---+-----+-----+ + | a| b| r1| r2| + +---+---+-----+-----+ + |1.0|NaN|false| true| + |NaN|2.0| true|false| + +---+---+-----+-----+ + """ + return _invoke_function_over_columns("isnan", col) + + +def isnull(col: "ColumnOrName") -> Column: + """An expression that returns true if the column is null. + + .. versionadded:: 1.6.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + True if value is null and False otherwise. + + Examples: + -------- + >>> df = spark.createDataFrame([(1, None), (None, 2)], ("a", "b")) + >>> df.select("a", "b", isnull("a").alias("r1"), isnull(df.b).alias("r2")).show() + +----+----+-----+-----+ + | a| b| r1| r2| + +----+----+-----+-----+ + | 1|NULL|false| true| + |NULL| 2| true|false| + +----+----+-----+-----+ + """ + return Column(_to_column_expr(col).isnull()) + + +def isnotnull(col: "ColumnOrName") -> Column: + """Returns true if `col` is not null, or false otherwise. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + + Examples: + -------- + >>> df = spark.createDataFrame([(None,), (1,)], ["e"]) + >>> df.select(isnotnull(df.e).alias("r")).collect() + [Row(r=False), Row(r=True)] + """ + return Column(_to_column_expr(col).isnotnull()) + + +def equal_null(col1: "ColumnOrName", col2: "ColumnOrName") -> Column: + """Returns same result as the EQUAL(=) operator for non-null operands, + but returns true if both are null, false if one of the them is null. + .. versionadded:: 3.5.0 + Parameters + ---------- + col1 : :class:`~pyspark.sql.Column` or str + col2 : :class:`~pyspark.sql.Column` or str + + Examples: + -------- + >>> df = spark.createDataFrame( + ... [ + ... ( + ... None, + ... None, + ... ), + ... ( + ... 1, + ... 9, + ... ), + ... ], + ... ["a", "b"], + ... ) + >>> df.select(equal_null(df.a, df.b).alias("r")).collect() + [Row(r=True), Row(r=False)] + """ # noqa: D205, D415 + if isinstance(col1, str): + col1 = col(col1) + + if isinstance(col2, str): + col2 = col(col2) + + return nvl((col1 == col2) | (col1.isNull() & col2.isNull()), lit(False)) + + +def flatten(col: "ColumnOrName") -> Column: + """Collection function: creates a single array from an array of arrays. + If a structure of nested arrays is deeper than two levels, + only one level of nesting is removed. + + .. versionadded:: 2.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + name of column or expression + + Returns: + ------- + :class:`~pyspark.sql.Column` + flattened array. + + Examples: + -------- + >>> df = spark.createDataFrame([([[1, 2, 3], [4, 5], [6]],), ([None, [4, 5]],)], ["data"]) + >>> df.show(truncate=False) + +------------------------+ + |data | + +------------------------+ + |[[1, 2, 3], [4, 5], [6]]| + |[NULL, [4, 5]] | + +------------------------+ + >>> df.select(flatten(df.data).alias("r")).show() + +------------------+ + | r| + +------------------+ + |[1, 2, 3, 4, 5, 6]| + | NULL| + +------------------+ + """ # noqa: D205 + col = _to_column_expr(col) + contains_null = _list_contains_null(col) + return Column(CaseExpression(contains_null, None).otherwise(FunctionExpression("flatten", col))) + + +def array_compact(col: "ColumnOrName") -> Column: + """Collection function: removes null values from the array. + + .. versionadded:: 3.4.0 + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + name of column or expression + + Returns: + ------- + :class:`~pyspark.sql.Column` + an array by excluding the null values. + + Notes: + ----- + Supports Spark Connect. + + Examples: + -------- + >>> df = spark.createDataFrame([([1, None, 2, 3],), ([4, 5, None, 4],)], ["data"]) + >>> df.select(array_compact(df.data)).collect() + [Row(array_compact(data)=[1, 2, 3]), Row(array_compact(data)=[4, 5, 4])] + """ + return _invoke_function( + "list_filter", _to_column_expr(col), LambdaExpression("x", ColumnExpression("x").isnotnull()) + ) + + +def array_remove(col: "ColumnOrName", element: Any) -> Column: # noqa: ANN401 + """Collection function: Remove all elements that equal to element from the given array. + + .. versionadded:: 2.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + name of column containing array + element : + element to be removed from the array + + Returns: + ------- + :class:`~pyspark.sql.Column` + an array excluding given value. + + Examples: + -------- + >>> df = spark.createDataFrame([([1, 2, 3, 1, 1],), ([],)], ["data"]) + >>> df.select(array_remove(df.data, 1)).collect() + [Row(array_remove(data, 1)=[2, 3]), Row(array_remove(data, 1)=[])] + """ + return _invoke_function( + "list_filter", _to_column_expr(col), LambdaExpression("x", ColumnExpression("x") != ConstantExpression(element)) + ) + + +def last_day(date: "ColumnOrName") -> Column: + """Returns the last day of the month which the given date belongs to. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + date : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + last day of the month. + + Examples: + -------- + >>> df = spark.createDataFrame([("1997-02-10",)], ["d"]) + >>> df.select(last_day(df.d).alias("date")).collect() + [Row(date=datetime.date(1997, 2, 28))] + """ + return _invoke_function("last_day", _to_column_expr(date)) + + +def sqrt(col: "ColumnOrName") -> Column: + """Computes the square root of the specified float value. + + .. versionadded:: 1.3.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + column for computed results. + + Examples: + -------- + >>> df = spark.range(1) + >>> df.select(sqrt(lit(4))).show() + +-------+ + |SQRT(4)| + +-------+ + | 2.0| + +-------+ + """ + return _invoke_function_over_columns("sqrt", col) + + +def cbrt(col: "ColumnOrName") -> Column: + """Computes the cube-root of the given value. + + .. versionadded:: 1.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + the column for computed results. + + Examples: + -------- + >>> df = spark.range(1) + >>> df.select(cbrt(lit(27))).show() + +--------+ + |CBRT(27)| + +--------+ + | 3.0| + +--------+ + """ + return _invoke_function_over_columns("cbrt", col) + + +def char(col: "ColumnOrName") -> Column: + """Returns the ASCII character having the binary equivalent to `col`. If col is larger than 256 the + result is equivalent to char(col % 256). + + .. versionadded:: 3.5.0 + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + Input column or strings. + + Examples: + -------- + >>> import pyspark.sql.functions as sf + >>> spark.range(1).select(sf.char(sf.lit(65))).show() + +--------+ + |char(65)| + +--------+ + | A| + +--------+ + """ # noqa: D205 + col = _to_column_expr(col) + return Column(FunctionExpression("chr", CaseExpression(col > 256, col % 256).otherwise(col))) + + +def corr(col1: "ColumnOrName", col2: "ColumnOrName") -> Column: + """Returns a new :class:`~pyspark.sql.Column` for the Pearson Correlation Coefficient for + ``col1`` and ``col2``. + + .. versionadded:: 1.6.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col1 : :class:`~pyspark.sql.Column` or str + first column to calculate correlation. + col1 : :class:`~pyspark.sql.Column` or str + second column to calculate correlation. + + Returns: + ------- + :class:`~pyspark.sql.Column` + Pearson Correlation Coefficient of these two column values. + + Examples: + -------- + >>> a = range(20) + >>> b = [2 * x for x in range(20)] + >>> df = spark.createDataFrame(zip(a, b), ["a", "b"]) + >>> df.agg(corr("a", "b").alias("c")).collect() + [Row(c=1.0)] + """ # noqa: D205 + return _invoke_function_over_columns("corr", col1, col2) + + +def cot(col: "ColumnOrName") -> Column: + """Computes cotangent of the input column. + + .. versionadded:: 3.3.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + angle in radians. + + Returns: + ------- + :class:`~pyspark.sql.Column` + cotangent of the angle. + + Examples: + -------- + >>> import math + >>> df = spark.range(1) + >>> df.select(cot(lit(math.radians(45)))).first() + Row(COT(0.78539...)=1.00000...) + """ + return _invoke_function_over_columns("cot", col) + + +def e() -> Column: + """Returns Euler's number. + + .. versionadded:: 3.5.0 + + Examples: + -------- + >>> spark.range(1).select(e()).show() + +-----------------+ + | E()| + +-----------------+ + |2.718281828459045| + +-----------------+ + """ + return lit(2.718281828459045) + + +def negative(col: "ColumnOrName") -> Column: + """Returns the negative value. + .. versionadded:: 3.5.0 + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + column to calculate negative value for. + + Returns: + ------- + :class:`~pyspark.sql.Column` + negative value. + + Examples: + -------- + >>> import pyspark.sql.functions as sf + >>> spark.range(3).select(sf.negative("id")).show() + +------------+ + |negative(id)| + +------------+ + | 0| + | -1| + | -2| + +------------+ + """ # noqa: D205, D415 + return abs(col) * -1 + + +def pi() -> Column: + """Returns Pi. + + .. versionadded:: 3.5.0 + + Examples: + -------- + >>> spark.range(1).select(pi()).show() + +-----------------+ + | PI()| + +-----------------+ + |3.141592653589793| + +-----------------+ + """ + return _invoke_function("pi") + + +def positive(col: "ColumnOrName") -> Column: + """Returns the value. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + input value column. + + Returns: + ------- + :class:`~pyspark.sql.Column` + value. + + Examples: + -------- + >>> df = spark.createDataFrame([(-1,), (0,), (1,)], ["v"]) + >>> df.select(positive("v").alias("p")).show() + +---+ + | p| + +---+ + | -1| + | 0| + | 1| + +---+ + """ + return Column(_to_column_expr(col)) + + +def pow(col1: Union["ColumnOrName", float], col2: Union["ColumnOrName", float]) -> Column: + """Returns the value of the first argument raised to the power of the second argument. + + .. versionadded:: 1.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col1 : str, :class:`~pyspark.sql.Column` or float + the base number. + col2 : str, :class:`~pyspark.sql.Column` or float + the exponent number. + + Returns: + ------- + :class:`~pyspark.sql.Column` + the base rased to the power the argument. + + Examples: + -------- + >>> df = spark.range(1) + >>> df.select(pow(lit(3), lit(2))).first() + Row(POWER(3, 2)=9.0) + """ + return _invoke_function_over_columns("pow", col1, col2) + + +def printf(format: "ColumnOrName", *cols: "ColumnOrName") -> Column: + r"""Formats the arguments in printf-style and returns the result as a string column. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + format : :class:`~pyspark.sql.Column` or str + string that can contain embedded format tags and used as result column's value + cols : :class:`~pyspark.sql.Column` or str + column names or :class:`~pyspark.sql.Column`\\s to be used in formatting + + Examples: + -------- + >>> import pyspark.sql.functions as sf + >>> spark.createDataFrame( + ... [ + ... ( + ... "aa%d%s", + ... 123, + ... "cc", + ... ) + ... ], + ... ["a", "b", "c"], + ... ).select(sf.printf("a", "b", "c")).show() + +---------------+ + |printf(a, b, c)| + +---------------+ + | aa123cc| + +---------------+ + """ + return _invoke_function_over_columns("printf", format, *cols) + + +def product(col: "ColumnOrName") -> Column: + """Aggregate function: returns the product of the values in a group. + + .. versionadded:: 3.2.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : str, :class:`Column` + column containing values to be multiplied together + + Returns: + ------- + :class:`~pyspark.sql.Column` + the column for computed results. + + Examples: + -------- + >>> df = spark.range(1, 10).toDF("x").withColumn("mod3", col("x") % 3) + >>> prods = df.groupBy("mod3").agg(product("x").alias("product")) + >>> prods.orderBy("mod3").show() + +----+-------+ + |mod3|product| + +----+-------+ + | 0| 162.0| + | 1| 28.0| + | 2| 80.0| + +----+-------+ + """ + return _invoke_function_over_columns("product", col) + + +def rand(seed: Optional[int] = None) -> Column: + """Generates a random column with independent and identically distributed (i.i.d.) samples + uniformly distributed in [0.0, 1.0). + + .. versionadded:: 1.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Notes: + ----- + The function is non-deterministic in general case. + + Parameters + ---------- + seed : int (default: None) + seed value for random generator. + + Returns: + ------- + :class:`~pyspark.sql.Column` + random values. + + Examples: + -------- + >>> from pyspark.sql import functions as sf + >>> spark.range(0, 2, 1, 1).withColumn("rand", sf.rand(seed=42) * 3).show() + +---+------------------+ + | id| rand| + +---+------------------+ + | 0|1.8575681106759028| + | 1|1.5288056527339444| + +---+------------------+ + """ # noqa: D205 + if seed is not None: + # Maybe call setseed just before but how do we know when it is executed? + msg = "Seed is not yet implemented" + raise ContributionsAcceptedError(msg) + return _invoke_function("random") + + +def regexp(str: "ColumnOrName", regexp: "ColumnOrName") -> Column: + r"""Returns true if `str` matches the Java regex `regexp`, or false otherwise. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + str : :class:`~pyspark.sql.Column` or str + target column to work on. + regexp : :class:`~pyspark.sql.Column` or str + regex pattern to apply. + + Returns: + ------- + :class:`~pyspark.sql.Column` + true if `str` matches a Java regex, or false otherwise. + + Examples: + -------- + >>> import pyspark.sql.functions as sf + >>> spark.createDataFrame([("1a 2b 14m", r"(\d+)")], ["str", "regexp"]).select( + ... sf.regexp("str", sf.lit(r"(\d+)")) + ... ).show() + +------------------+ + |REGEXP(str, (\d+))| + +------------------+ + | true| + +------------------+ + + >>> import pyspark.sql.functions as sf + >>> spark.createDataFrame([("1a 2b 14m", r"(\d+)")], ["str", "regexp"]).select( + ... sf.regexp("str", sf.lit(r"\d{2}b")) + ... ).show() + +-------------------+ + |REGEXP(str, \d{2}b)| + +-------------------+ + | false| + +-------------------+ + + >>> import pyspark.sql.functions as sf + >>> spark.createDataFrame([("1a 2b 14m", r"(\d+)")], ["str", "regexp"]).select( + ... sf.regexp("str", sf.col("regexp")) + ... ).show() + +-------------------+ + |REGEXP(str, regexp)| + +-------------------+ + | true| + +-------------------+ + """ + return _invoke_function_over_columns("regexp_matches", str, regexp) + + +def regexp_count(str: "ColumnOrName", regexp: "ColumnOrName") -> Column: + r"""Returns a count of the number of times that the Java regex pattern `regexp` is matched + in the string `str`. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + str : :class:`~pyspark.sql.Column` or str + target column to work on. + regexp : :class:`~pyspark.sql.Column` or str + regex pattern to apply. + + Returns: + ------- + :class:`~pyspark.sql.Column` + the number of times that a Java regex pattern is matched in the string. + + Examples: + -------- + >>> df = spark.createDataFrame([("1a 2b 14m", r"\d+")], ["str", "regexp"]) + >>> df.select(regexp_count("str", lit(r"\d+")).alias("d")).collect() + [Row(d=3)] + >>> df.select(regexp_count("str", lit(r"mmm")).alias("d")).collect() + [Row(d=0)] + >>> df.select(regexp_count("str", col("regexp")).alias("d")).collect() + [Row(d=3)] + """ # noqa: D205 + return _invoke_function_over_columns("len", _invoke_function_over_columns("regexp_extract_all", str, regexp)) + + +def regexp_extract(str: "ColumnOrName", pattern: str, idx: int) -> Column: + r"""Extract a specific group matched by the Java regex `regexp`, from the specified string column. + If the regex did not match, or the specified group did not match, an empty string is returned. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + str : :class:`~pyspark.sql.Column` or str + target column to work on. + pattern : str + regex pattern to apply. + idx : int + matched group id. + + Returns: + ------- + :class:`~pyspark.sql.Column` + matched value specified by `idx` group id. + + Examples: + -------- + >>> df = spark.createDataFrame([("100-200",)], ["str"]) + >>> df.select(regexp_extract("str", r"(\d+)-(\d+)", 1).alias("d")).collect() + [Row(d='100')] + >>> df = spark.createDataFrame([("foo",)], ["str"]) + >>> df.select(regexp_extract("str", r"(\d+)", 1).alias("d")).collect() + [Row(d='')] + >>> df = spark.createDataFrame([("aaaac",)], ["str"]) + >>> df.select(regexp_extract("str", "(a+)(b)?(c)", 2).alias("d")).collect() + [Row(d='')] + """ # noqa: D205 + return _invoke_function( + "regexp_extract", _to_column_expr(str), ConstantExpression(pattern), ConstantExpression(idx) + ) + + +def regexp_extract_all(str: "ColumnOrName", regexp: "ColumnOrName", idx: Optional[Union[int, Column]] = None) -> Column: + r"""Extract all strings in the `str` that match the Java regex `regexp` + and corresponding to the regex group index. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + str : :class:`~pyspark.sql.Column` or str + target column to work on. + regexp : :class:`~pyspark.sql.Column` or str + regex pattern to apply. + idx : int + matched group id. + + Returns: + ------- + :class:`~pyspark.sql.Column` + all strings in the `str` that match a Java regex and corresponding to the regex group index. + + Examples: + -------- + >>> df = spark.createDataFrame([("100-200, 300-400", r"(\d+)-(\d+)")], ["str", "regexp"]) + >>> df.select(regexp_extract_all("str", lit(r"(\d+)-(\d+)")).alias("d")).collect() + [Row(d=['100', '300'])] + >>> df.select(regexp_extract_all("str", lit(r"(\d+)-(\d+)"), 1).alias("d")).collect() + [Row(d=['100', '300'])] + >>> df.select(regexp_extract_all("str", lit(r"(\d+)-(\d+)"), 2).alias("d")).collect() + [Row(d=['200', '400'])] + >>> df.select(regexp_extract_all("str", col("regexp")).alias("d")).collect() + [Row(d=['100', '300'])] + """ # noqa: D205 + if idx is None: + idx = 1 + return _invoke_function( + "regexp_extract_all", _to_column_expr(str), _to_column_expr(regexp), ConstantExpression(idx) + ) + + +def regexp_like(str: "ColumnOrName", regexp: "ColumnOrName") -> Column: + r"""Returns true if `str` matches the Java regex `regexp`, or false otherwise. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + str : :class:`~pyspark.sql.Column` or str + target column to work on. + regexp : :class:`~pyspark.sql.Column` or str + regex pattern to apply. + + Returns: + ------- + :class:`~pyspark.sql.Column` + true if `str` matches a Java regex, or false otherwise. + + Examples: + -------- + >>> import pyspark.sql.functions as sf + >>> spark.createDataFrame([("1a 2b 14m", r"(\d+)")], ["str", "regexp"]).select( + ... sf.regexp_like("str", sf.lit(r"(\d+)")) + ... ).show() + +-----------------------+ + |REGEXP_LIKE(str, (\d+))| + +-----------------------+ + | true| + +-----------------------+ + + >>> import pyspark.sql.functions as sf + >>> spark.createDataFrame([("1a 2b 14m", r"(\d+)")], ["str", "regexp"]).select( + ... sf.regexp_like("str", sf.lit(r"\d{2}b")) + ... ).show() + +------------------------+ + |REGEXP_LIKE(str, \d{2}b)| + +------------------------+ + | false| + +------------------------+ + + >>> import pyspark.sql.functions as sf + >>> spark.createDataFrame([("1a 2b 14m", r"(\d+)")], ["str", "regexp"]).select( + ... sf.regexp_like("str", sf.col("regexp")) + ... ).show() + +------------------------+ + |REGEXP_LIKE(str, regexp)| + +------------------------+ + | true| + +------------------------+ + """ + return _invoke_function_over_columns("regexp_matches", str, regexp) + + +def regexp_substr(str: "ColumnOrName", regexp: "ColumnOrName") -> Column: + r"""Returns the substring that matches the Java regex `regexp` within the string `str`. + If the regular expression is not found, the result is null. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + str : :class:`~pyspark.sql.Column` or str + target column to work on. + regexp : :class:`~pyspark.sql.Column` or str + regex pattern to apply. + + Returns: + ------- + :class:`~pyspark.sql.Column` + the substring that matches a Java regex within the string `str`. + + Examples: + -------- + >>> df = spark.createDataFrame([("1a 2b 14m", r"\d+")], ["str", "regexp"]) + >>> df.select(regexp_substr("str", lit(r"\d+")).alias("d")).collect() + [Row(d='1')] + >>> df.select(regexp_substr("str", lit(r"mmm")).alias("d")).collect() + [Row(d=None)] + >>> df.select(regexp_substr("str", col("regexp")).alias("d")).collect() + [Row(d='1')] + """ # noqa: D205 + return Column( + FunctionExpression( + "nullif", + FunctionExpression("regexp_extract", _to_column_expr(str), _to_column_expr(regexp)), + ConstantExpression(""), + ) + ) + + +def repeat(col: "ColumnOrName", n: int) -> Column: + """Repeats a string column n times, and returns it as a new string column. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to work on. + n : int + number of times to repeat value. + + Returns: + ------- + :class:`~pyspark.sql.Column` + string with repeated values. + + Examples: + -------- + >>> df = spark.createDataFrame( + ... [("ab",)], + ... [ + ... "s", + ... ], + ... ) + >>> df.select(repeat(df.s, 3).alias("s")).collect() + [Row(s='ababab')] + """ + return _invoke_function("repeat", _to_column_expr(col), ConstantExpression(n)) + + +def sequence(start: "ColumnOrName", stop: "ColumnOrName", step: Optional["ColumnOrName"] = None) -> Column: + """Generate a sequence of integers from `start` to `stop`, incrementing by `step`. + If `step` is not set, incrementing by 1 if `start` is less than or equal to `stop`, + otherwise -1. + + .. versionadded:: 2.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + start : :class:`~pyspark.sql.Column` or str + starting value (inclusive) + stop : :class:`~pyspark.sql.Column` or str + last values (inclusive) + step : :class:`~pyspark.sql.Column` or str, optional + value to add to current to get next element (default is 1) + + Returns: + ------- + :class:`~pyspark.sql.Column` + an array of sequence values + + Examples: + -------- + >>> df1 = spark.createDataFrame([(-2, 2)], ("C1", "C2")) + >>> df1.select(sequence("C1", "C2").alias("r")).collect() + [Row(r=[-2, -1, 0, 1, 2])] + >>> df2 = spark.createDataFrame([(4, -4, -2)], ("C1", "C2", "C3")) + >>> df2.select(sequence("C1", "C2", "C3").alias("r")).collect() + [Row(r=[4, 2, 0, -2, -4])] + """ # noqa: D205 + if step is None: + return _invoke_function_over_columns("generate_series", start, stop) + else: + return _invoke_function_over_columns("generate_series", start, stop, step) + + +def sign(col: "ColumnOrName") -> Column: + """Computes the signum of the given value. + + .. versionadded:: 1.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + the column for computed results. + + Examples: + -------- + >>> import pyspark.sql.functions as sf + >>> spark.range(1).select(sf.sign(sf.lit(-5)), sf.sign(sf.lit(6))).show() + +--------+-------+ + |sign(-5)|sign(6)| + +--------+-------+ + | -1.0| 1.0| + +--------+-------+ + """ + return _invoke_function_over_columns("sign", col) + + +def signum(col: "ColumnOrName") -> Column: + """Computes the signum of the given value. + + .. versionadded:: 1.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + the column for computed results. + + Examples: + -------- + >>> import pyspark.sql.functions as sf + >>> spark.range(1).select(sf.signum(sf.lit(-5)), sf.signum(sf.lit(6))).show() + +----------+---------+ + |SIGNUM(-5)|SIGNUM(6)| + +----------+---------+ + | -1.0| 1.0| + +----------+---------+ + """ + return sign(col) + + +def sin(col: "ColumnOrName") -> Column: + """Computes sine of the input column. + + .. versionadded:: 1.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + sine of the angle, as if computed by `java.lang.Math.sin()` + + Examples: + -------- + >>> import math + >>> df = spark.range(1) + >>> df.select(sin(lit(math.radians(90)))).first() + Row(SIN(1.57079...)=1.0) + """ + return _invoke_function_over_columns("sin", col) + + +def skewness(col: "ColumnOrName") -> Column: + """Aggregate function: returns the skewness of the values in a group. + + .. versionadded:: 1.6.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + skewness of given column. + + Examples: + -------- + >>> df = spark.createDataFrame([[1], [1], [2]], ["c"]) + >>> df.select(skewness(df.c)).first() + Row(skewness(c)=0.70710...) + """ + return _invoke_function_over_columns("skewness", col) + + +def encode(col: "ColumnOrName", charset: str) -> Column: + """Computes the first argument into a binary from a string using the provided character set + (one of 'US-ASCII', 'ISO-8859-1', 'UTF-8', 'UTF-16BE', 'UTF-16LE', 'UTF-16'). + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to work on. + charset : str + charset to use to encode. + + Returns: + ------- + :class:`~pyspark.sql.Column` + the column for computed results. + + Examples: + -------- + >>> df = spark.createDataFrame([("abcd",)], ["c"]) + >>> df.select(encode("c", "UTF-8")).show() + +----------------+ + |encode(c, UTF-8)| + +----------------+ + | [61 62 63 64]| + +----------------+ + """ # noqa: D205 + if charset != "UTF-8": + msg = "Only UTF-8 charset is supported right now" + raise ContributionsAcceptedError(msg) + return _invoke_function("encode", _to_column_expr(col)) + + +def find_in_set(str: "ColumnOrName", str_array: "ColumnOrName") -> Column: + """Returns the index (1-based) of the given string (`str`) in the comma-delimited + list (`strArray`). Returns 0, if the string was not found or if the given string (`str`) + contains a comma. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + str : :class:`~pyspark.sql.Column` or str + The given string to be found. + str_array : :class:`~pyspark.sql.Column` or str + The comma-delimited list. + + Examples: + -------- + >>> df = spark.createDataFrame([("ab", "abc,b,ab,c,def")], ["a", "b"]) + >>> df.select(find_in_set(df.a, df.b).alias("r")).collect() + [Row(r=3)] + """ # noqa: D205 + str_array = _to_column_expr(str_array) + str = _to_column_expr(str) + return Column( + CaseExpression(FunctionExpression("contains", str, ConstantExpression(",")), 0).otherwise( + CoalesceOperator( + FunctionExpression( + "list_position", FunctionExpression("string_split", str_array, ConstantExpression(",")), str + ), + # If the element cannot be found, list_position returns null but we want to return 0 + ConstantExpression(0), + ) + ) + ) + + +def first(col: "ColumnOrName", ignorenulls: bool = False) -> Column: + """Aggregate function: returns the first value in a group. + + The function by default returns the first values it sees. It will return the first non-null + value it sees when ignoreNulls is set to true. If all values are null, then null is returned. + + .. versionadded:: 1.3.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Notes: + ----- + The function is non-deterministic because its results depends on the order of the + rows which may be non-deterministic after a shuffle. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + column to fetch first value for. + ignorenulls : :class:`~pyspark.sql.Column` or str + if first value is null then look for first non-null value. + + Returns: + ------- + :class:`~pyspark.sql.Column` + first value of the group. + + Examples: + -------- + >>> df = spark.createDataFrame([("Alice", 2), ("Bob", 5), ("Alice", None)], ("name", "age")) + >>> df = df.orderBy(df.age) + >>> df.groupby("name").agg(first("age")).orderBy("name").show() + +-----+----------+ + | name|first(age)| + +-----+----------+ + |Alice| NULL| + | Bob| 5| + +-----+----------+ + + Now, to ignore any nulls we needs to set ``ignorenulls`` to `True` + + >>> df.groupby("name").agg(first("age", ignorenulls=True)).orderBy("name").show() + +-----+----------+ + | name|first(age)| + +-----+----------+ + |Alice| 2| + | Bob| 5| + +-----+----------+ + """ + if ignorenulls: + raise ContributionsAcceptedError() + return _invoke_function_over_columns("first", col) + + +def last(col: "ColumnOrName", ignorenulls: bool = False) -> Column: + """Aggregate function: returns the last value in a group. + + The function by default returns the last values it sees. It will return the last non-null + value it sees when ignoreNulls is set to true. If all values are null, then null is returned. + + .. versionadded:: 1.3.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Notes: + ----- + The function is non-deterministic because its results depends on the order of the + rows which may be non-deterministic after a shuffle. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + column to fetch last value for. + ignorenulls : :class:`~pyspark.sql.Column` or str + if last value is null then look for non-null value. + + Returns: + ------- + :class:`~pyspark.sql.Column` + last value of the group. + + Examples: + -------- + >>> df = spark.createDataFrame([("Alice", 2), ("Bob", 5), ("Alice", None)], ("name", "age")) + >>> df = df.orderBy(df.age.desc()) + >>> df.groupby("name").agg(last("age")).orderBy("name").show() + +-----+---------+ + | name|last(age)| + +-----+---------+ + |Alice| NULL| + | Bob| 5| + +-----+---------+ + + Now, to ignore any nulls we needs to set ``ignorenulls`` to `True` + + >>> df.groupby("name").agg(last("age", ignorenulls=True)).orderBy("name").show() + +-----+---------+ + | name|last(age)| + +-----+---------+ + |Alice| 2| + | Bob| 5| + +-----+---------+ + """ + if ignorenulls: + raise ContributionsAcceptedError() + return _invoke_function_over_columns("last", col) + + +def greatest(*cols: "ColumnOrName") -> Column: + """Returns the greatest value of the list of column names, skipping null values. + This function takes at least 2 parameters. It will return null if all parameters are null. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + columns to check for gratest value. + + Returns: + ------- + :class:`~pyspark.sql.Column` + gratest value. + + Examples: + -------- + >>> df = spark.createDataFrame([(1, 4, 3)], ["a", "b", "c"]) + >>> df.select(greatest(df.a, df.b, df.c).alias("greatest")).collect() + [Row(greatest=4)] + """ # noqa: D205 + if len(cols) < 2: + msg = "greatest should take at least 2 columns" + raise ValueError(msg) + + cols = [_to_column_expr(expr) for expr in cols] + return _invoke_function("greatest", *cols) + + +def least(*cols: "ColumnOrName") -> Column: + """Returns the least value of the list of column names, skipping null values. + This function takes at least 2 parameters. It will return null if all parameters are null. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + cols : :class:`~pyspark.sql.Column` or str + column names or columns to be compared + + Returns: + ------- + :class:`~pyspark.sql.Column` + least value. + + Examples: + -------- + >>> df = spark.createDataFrame([(1, 4, 3)], ["a", "b", "c"]) + >>> df.select(least(df.a, df.b, df.c).alias("least")).collect() + [Row(least=1)] + """ # noqa: D205 + if len(cols) < 2: + msg = "least should take at least 2 columns" + raise ValueError(msg) + + cols = [_to_column_expr(expr) for expr in cols] + return _invoke_function("least", *cols) + + +def trim(col: "ColumnOrName") -> Column: + """Trim the spaces from left end for the specified string value. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + left trimmed values. + + Examples: + -------- + >>> df = spark.createDataFrame([" Spark", "Spark ", " Spark"], "STRING") + >>> df.select(ltrim("value").alias("r")).withColumn("length", length("r")).show() + +-------+------+ + | r|length| + +-------+------+ + | Spark| 5| + |Spark | 7| + | Spark| 5| + +-------+------+ + """ + return _invoke_function_over_columns("trim", col) + + +def rtrim(col: "ColumnOrName") -> Column: + """Trim the spaces from right end for the specified string value. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + right trimmed values. + + Examples: + -------- + >>> df = spark.createDataFrame([" Spark", "Spark ", " Spark"], "STRING") + >>> df.select(rtrim("value").alias("r")).withColumn("length", length("r")).show() + +--------+------+ + | r|length| + +--------+------+ + | Spark| 8| + | Spark| 5| + | Spark| 6| + +--------+------+ + """ + return _invoke_function_over_columns("rtrim", col) + + +def ltrim(col: "ColumnOrName") -> Column: + """Trim the spaces from left end for the specified string value. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + left trimmed values. + + Examples: + -------- + >>> df = spark.createDataFrame([" Spark", "Spark ", " Spark"], "STRING") + >>> df.select(ltrim("value").alias("r")).withColumn("length", length("r")).show() + +-------+------+ + | r|length| + +-------+------+ + | Spark| 5| + |Spark | 7| + | Spark| 5| + +-------+------+ + """ + return _invoke_function_over_columns("ltrim", col) + + +def btrim(str: "ColumnOrName", trim: Optional["ColumnOrName"] = None) -> Column: + """Remove the leading and trailing `trim` characters from `str`. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + str : :class:`~pyspark.sql.Column` or str + Input column or strings. + trim : :class:`~pyspark.sql.Column` or str + The trim string characters to trim, the default value is a single space + + Examples: + -------- + >>> df = spark.createDataFrame( + ... [ + ... ( + ... "SSparkSQLS", + ... "SL", + ... ) + ... ], + ... ["a", "b"], + ... ) + >>> df.select(btrim(df.a, df.b).alias("r")).collect() + [Row(r='parkSQ')] + + >>> df = spark.createDataFrame([(" SparkSQL ",)], ["a"]) + >>> df.select(btrim(df.a).alias("r")).collect() + [Row(r='SparkSQL')] + """ + if trim is not None: + return _invoke_function_over_columns("trim", str, trim) + else: + return _invoke_function_over_columns("trim", str) + + +def endswith(str: "ColumnOrName", suffix: "ColumnOrName") -> Column: + """Returns a boolean. The value is True if str ends with suffix. + Returns NULL if either input expression is NULL. Otherwise, returns False. + Both str or suffix must be of STRING or BINARY type. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + str : :class:`~pyspark.sql.Column` or str + A column of string. + suffix : :class:`~pyspark.sql.Column` or str + A column of string, the suffix. + + Examples: + -------- + >>> df = spark.createDataFrame( + ... [ + ... ( + ... "Spark SQL", + ... "Spark", + ... ) + ... ], + ... ["a", "b"], + ... ) + >>> df.select(endswith(df.a, df.b).alias("r")).collect() + [Row(r=False)] + + >>> df = spark.createDataFrame( + ... [ + ... ( + ... "414243", + ... "4243", + ... ) + ... ], + ... ["e", "f"], + ... ) + >>> df = df.select(to_binary("e").alias("e"), to_binary("f").alias("f")) + >>> df.printSchema() + root + |-- e: binary (nullable = true) + |-- f: binary (nullable = true) + >>> df.select(endswith("e", "f"), endswith("f", "e")).show() + +--------------+--------------+ + |endswith(e, f)|endswith(f, e)| + +--------------+--------------+ + | true| false| + +--------------+--------------+ + """ # noqa: D205 + return _invoke_function_over_columns("suffix", str, suffix) + + +def startswith(str: "ColumnOrName", prefix: "ColumnOrName") -> Column: + """Returns a boolean. The value is True if str starts with prefix. + Returns NULL if either input expression is NULL. Otherwise, returns False. + Both str or prefix must be of STRING or BINARY type. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + str : :class:`~pyspark.sql.Column` or str + A column of string. + prefix : :class:`~pyspark.sql.Column` or str + A column of string, the prefix. + + Examples: + -------- + >>> df = spark.createDataFrame( + ... [ + ... ( + ... "Spark SQL", + ... "Spark", + ... ) + ... ], + ... ["a", "b"], + ... ) + >>> df.select(startswith(df.a, df.b).alias("r")).collect() + [Row(r=True)] + + >>> df = spark.createDataFrame( + ... [ + ... ( + ... "414243", + ... "4142", + ... ) + ... ], + ... ["e", "f"], + ... ) + >>> df = df.select(to_binary("e").alias("e"), to_binary("f").alias("f")) + >>> df.printSchema() + root + |-- e: binary (nullable = true) + |-- f: binary (nullable = true) + >>> df.select(startswith("e", "f"), startswith("f", "e")).show() + +----------------+----------------+ + |startswith(e, f)|startswith(f, e)| + +----------------+----------------+ + | true| false| + +----------------+----------------+ + """ # noqa: D205 + return _invoke_function_over_columns("starts_with", str, prefix) + + +def length(col: "ColumnOrName") -> Column: + """Computes the character length of string data or number of bytes of binary data. + The length of character data includes the trailing spaces. The length of binary data + includes binary zeros. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + length of the value. + + Examples: + -------- + >>> spark.createDataFrame([("ABC ",)], ["a"]).select(length("a").alias("length")).collect() + [Row(length=4)] + """ # noqa: D205 + return _invoke_function_over_columns("length", col) + + +def coalesce(*cols: "ColumnOrName") -> Column: + """Returns the first column that is not null. + .. versionadded:: 1.4.0 + .. versionchanged:: 3.4.0 + Supports Spark Connect. + Parameters + ---------- + cols : :class:`~pyspark.sql.Column` or str + list of columns to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + value of the first column that is not null. + + Examples: + -------- + >>> cDf = spark.createDataFrame([(None, None), (1, None), (None, 2)], ("a", "b")) + >>> cDf.show() + +----+----+ + | a| b| + +----+----+ + |NULL|NULL| + | 1|NULL| + |NULL| 2| + +----+----+ + >>> cDf.select(coalesce(cDf["a"], cDf["b"])).show() + +--------------+ + |coalesce(a, b)| + +--------------+ + | NULL| + | 1| + | 2| + +--------------+ + >>> cDf.select("*", coalesce(cDf["a"], lit(0.0))).show() + +----+----+----------------+ + | a| b|coalesce(a, 0.0)| + +----+----+----------------+ + |NULL|NULL| 0.0| + | 1|NULL| 1.0| + |NULL| 2| 0.0| + +----+----+----------------+ + """ # noqa: D205, D415 + cols = [_to_column_expr(expr) for expr in cols] + return Column(CoalesceOperator(*cols)) + + +def nvl(col1: "ColumnOrName", col2: "ColumnOrName") -> Column: + """Returns `col2` if `col1` is null, or `col1` otherwise. + .. versionadded:: 3.5.0 + Parameters + ---------- + col1 : :class:`~pyspark.sql.Column` or str + col2 : :class:`~pyspark.sql.Column` or str + + Examples: + -------- + >>> df = spark.createDataFrame( + ... [ + ... ( + ... None, + ... 8, + ... ), + ... ( + ... 1, + ... 9, + ... ), + ... ], + ... ["a", "b"], + ... ) + >>> df.select(nvl(df.a, df.b).alias("r")).collect() + [Row(r=8), Row(r=1)] + """ # noqa: D205, D415 + return coalesce(col1, col2) + + +def nvl2(col1: "ColumnOrName", col2: "ColumnOrName", col3: "ColumnOrName") -> Column: + """Returns `col2` if `col1` is not null, or `col3` otherwise. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + col1 : :class:`~pyspark.sql.Column` or str + col2 : :class:`~pyspark.sql.Column` or str + col3 : :class:`~pyspark.sql.Column` or str + + Examples: + -------- + >>> df = spark.createDataFrame( + ... [ + ... ( + ... None, + ... 8, + ... 6, + ... ), + ... ( + ... 1, + ... 9, + ... 9, + ... ), + ... ], + ... ["a", "b", "c"], + ... ) + >>> df.select(nvl2(df.a, df.b, df.c).alias("r")).collect() + [Row(r=6), Row(r=9)] + """ + col1 = _to_column_expr(col1) + col2 = _to_column_expr(col2) + col3 = _to_column_expr(col3) + return Column(CaseExpression(col1.isnull(), col3).otherwise(col2)) + + +def ifnull(col1: "ColumnOrName", col2: "ColumnOrName") -> Column: + """Returns `col2` if `col1` is null, or `col1` otherwise. + .. versionadded:: 3.5.0 + Parameters + ---------- + col1 : :class:`~pyspark.sql.Column` or str + col2 : :class:`~pyspark.sql.Column` or str + + Examples: + -------- + >>> import pyspark.sql.functions as sf + >>> df = spark.createDataFrame([(None,), (1,)], ["e"]) + >>> df.select(sf.ifnull(df.e, sf.lit(8))).show() + +------------+ + |ifnull(e, 8)| + +------------+ + | 8| + | 1| + +------------+ + """ # noqa: D205, D415 + return coalesce(col1, col2) + + +def nullif(col1: "ColumnOrName", col2: "ColumnOrName") -> Column: + """Returns null if `col1` equals to `col2`, or `col1` otherwise. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + col1 : :class:`~pyspark.sql.Column` or str + col2 : :class:`~pyspark.sql.Column` or str + + Examples: + -------- + >>> df = spark.createDataFrame( + ... [ + ... ( + ... None, + ... None, + ... ), + ... ( + ... 1, + ... 9, + ... ), + ... ], + ... ["a", "b"], + ... ) + >>> df.select(nullif(df.a, df.b).alias("r")).collect() + [Row(r=None), Row(r=1)] + """ + return _invoke_function_over_columns("nullif", col1, col2) + + +def md5(col: "ColumnOrName") -> Column: + """Calculates the MD5 digest and returns the value as a 32 character hex string. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + the column for computed results. + + Examples: + -------- + >>> spark.createDataFrame([("ABC",)], ["a"]).select(md5("a").alias("hash")).collect() + [Row(hash='902fbdd2b1df0c4f70b4a5d23525e932')] + """ + return _invoke_function_over_columns("md5", col) + + +def sha2(col: "ColumnOrName", numBits: int) -> Column: + """Returns the hex string result of SHA-2 family of hash functions (SHA-224, SHA-256, SHA-384, + and SHA-512). The numBits indicates the desired bit length of the result, which must have a + value of 224, 256, 384, 512, or 0 (which is equivalent to 256). + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + numBits : int + the desired bit length of the result, which must have a + value of 224, 256, 384, 512, or 0 (which is equivalent to 256). + + Returns: + ------- + :class:`~pyspark.sql.Column` + the column for computed results. + + Examples: + -------- + >>> df = spark.createDataFrame([["Alice"], ["Bob"]], ["name"]) + >>> df.withColumn("sha2", sha2(df.name, 256)).show(truncate=False) + +-----+----------------------------------------------------------------+ + |name |sha2 | + +-----+----------------------------------------------------------------+ + |Alice|3bc51062973c458d5a6f2d8d64a023246354ad7e064b1e4e009ec8a0699a3043| + |Bob |cd9fb1e148ccd8442e5aa74904cc73bf6fb54d1d54d333bd596aa9bb4bb4e961| + +-----+----------------------------------------------------------------+ + """ # noqa: D205 + if numBits not in {224, 256, 384, 512, 0}: + msg = "numBits should be one of {224, 256, 384, 512, 0}" + raise ValueError(msg) + + if numBits == 256: + return _invoke_function_over_columns("sha256", col) + + msg = "SHA-224, SHA-384, and SHA-512 are not supported yet." + raise ContributionsAcceptedError(msg) + + +def curdate() -> Column: + """Returns the current date at the start of query evaluation as a :class:`DateType` column. + All calls of current_date within the same query return the same value. + + .. versionadded:: 3.5.0 + + Returns: + ------- + :class:`~pyspark.sql.Column` + current date. + + Examples: + -------- + >>> import pyspark.sql.functions as sf + >>> spark.range(1).select(sf.curdate()).show() # doctest: +SKIP + +--------------+ + |current_date()| + +--------------+ + | 2022-08-26| + +--------------+ + """ # noqa: D205 + return _invoke_function("today") + + +def current_date() -> Column: + """Returns the current date at the start of query evaluation as a :class:`DateType` column. + All calls of current_date within the same query return the same value. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Returns: + ------- + :class:`~pyspark.sql.Column` + current date. + + Examples: + -------- + >>> df = spark.range(1) + >>> df.select(current_date()).show() # doctest: +SKIP + +--------------+ + |current_date()| + +--------------+ + | 2022-08-26| + +--------------+ + """ # noqa: D205 + return curdate() + + +def now() -> Column: + """Returns the current timestamp at the start of query evaluation. + + .. versionadded:: 3.5.0 + + Returns: + ------- + :class:`~pyspark.sql.Column` + current timestamp at the start of query evaluation. + + Examples: + -------- + >>> df = spark.range(1) + >>> df.select(now()).show(truncate=False) # doctest: +SKIP + +-----------------------+ + |now() | + +-----------------------+ + |2022-08-26 21:23:22.716| + +-----------------------+ + """ + return _invoke_function("now") + + +def desc(col: "ColumnOrName") -> Column: + """Returns a sort expression based on the descending order of the given column name. + + .. versionadded:: 1.3.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to sort by in the descending order. + + Returns: + ------- + :class:`~pyspark.sql.Column` + the column specifying the order. + + Examples: + -------- + Sort by the column 'id' in the descending order. + + >>> spark.range(5).orderBy(desc("id")).show() + +---+ + | id| + +---+ + | 4| + | 3| + | 2| + | 1| + | 0| + +---+ + """ + return Column(_to_column_expr(col).desc()) + + +def asc(col: "ColumnOrName") -> Column: + """Returns a sort expression based on the ascending order of the given column name. + + .. versionadded:: 1.3.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to sort by in the ascending order. + + Returns: + ------- + :class:`~pyspark.sql.Column` + the column specifying the order. + + Examples: + -------- + Sort by the column 'id' in the descending order. + + >>> df = spark.range(5) + >>> df = df.sort(desc("id")) + >>> df.show() + +---+ + | id| + +---+ + | 4| + | 3| + | 2| + | 1| + | 0| + +---+ + + Sort by the column 'id' in the ascending order. + + >>> df.orderBy(asc("id")).show() + +---+ + | id| + +---+ + | 0| + | 1| + | 2| + | 3| + | 4| + +---+ + """ + return Column(_to_column_expr(col).asc()) + + +def date_trunc(format: str, timestamp: "ColumnOrName") -> Column: + """Returns timestamp truncated to the unit specified by the format. + + .. versionadded:: 2.3.0 + + Parameters + ---------- + format : str + 'year', 'yyyy', 'yy', 'month', 'mon', 'mm', + 'day', 'dd', 'hour', 'minute', 'second', 'week', 'quarter' + timestamp : :class:`~pyspark.sql.Column` or str + + Examples: + -------- + >>> df = spark.createDataFrame([("1997-02-28 05:02:11",)], ["t"]) + >>> df.select(date_trunc("year", df.t).alias("year")).collect() + [Row(year=datetime.datetime(1997, 1, 1, 0, 0))] + >>> df.select(date_trunc("mon", df.t).alias("month")).collect() + [Row(month=datetime.datetime(1997, 2, 1, 0, 0))] + """ + format = format.lower() + if format in ["yyyy", "yy"]: + format = "year" + elif format in ["mon", "mm"]: + format = "month" + elif format == "dd": + format = "day" + elif format == "hh": + format = "hour" + return _invoke_function_over_columns("date_trunc", lit(format), timestamp) + + +def date_part(field: "ColumnOrName", source: "ColumnOrName") -> Column: + """Extracts a part of the date/timestamp or interval source. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + field : :class:`~pyspark.sql.Column` or str + selects which part of the source should be extracted, and supported string values + are as same as the fields of the equivalent function `extract`. + source : :class:`~pyspark.sql.Column` or str + a date/timestamp or interval column from where `field` should be extracted. + + Returns: + ------- + :class:`~pyspark.sql.Column` + a part of the date/timestamp or interval source. + + Examples: + -------- + >>> import datetime + >>> df = spark.createDataFrame([(datetime.datetime(2015, 4, 8, 13, 8, 15),)], ["ts"]) + >>> df.select( + ... date_part(lit("YEAR"), "ts").alias("year"), + ... date_part(lit("month"), "ts").alias("month"), + ... date_part(lit("WEEK"), "ts").alias("week"), + ... date_part(lit("D"), "ts").alias("day"), + ... date_part(lit("M"), "ts").alias("minute"), + ... date_part(lit("S"), "ts").alias("second"), + ... ).collect() + [Row(year=2015, month=4, week=15, day=8, minute=8, second=Decimal('15.000000'))] + """ + return _invoke_function_over_columns("date_part", field, source) + + +def extract(field: "ColumnOrName", source: "ColumnOrName") -> Column: + """Extracts a part of the date/timestamp or interval source. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + field : :class:`~pyspark.sql.Column` or str + selects which part of the source should be extracted. + source : :class:`~pyspark.sql.Column` or str + a date/timestamp or interval column from where `field` should be extracted. + + Returns: + ------- + :class:`~pyspark.sql.Column` + a part of the date/timestamp or interval source. + + Examples: + -------- + >>> import datetime + >>> df = spark.createDataFrame([(datetime.datetime(2015, 4, 8, 13, 8, 15),)], ["ts"]) + >>> df.select( + ... extract(lit("YEAR"), "ts").alias("year"), + ... extract(lit("month"), "ts").alias("month"), + ... extract(lit("WEEK"), "ts").alias("week"), + ... extract(lit("D"), "ts").alias("day"), + ... extract(lit("M"), "ts").alias("minute"), + ... extract(lit("S"), "ts").alias("second"), + ... ).collect() + [Row(year=2015, month=4, week=15, day=8, minute=8, second=Decimal('15.000000'))] + """ + return date_part(field, source) + + +def datepart(field: "ColumnOrName", source: "ColumnOrName") -> Column: + """Extracts a part of the date/timestamp or interval source. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + field : :class:`~pyspark.sql.Column` or str + selects which part of the source should be extracted, and supported string values + are as same as the fields of the equivalent function `extract`. + source : :class:`~pyspark.sql.Column` or str + a date/timestamp or interval column from where `field` should be extracted. + + Returns: + ------- + :class:`~pyspark.sql.Column` + a part of the date/timestamp or interval source. + + Examples: + -------- + >>> import datetime + >>> df = spark.createDataFrame([(datetime.datetime(2015, 4, 8, 13, 8, 15),)], ["ts"]) + >>> df.select( + ... datepart(lit("YEAR"), "ts").alias("year"), + ... datepart(lit("month"), "ts").alias("month"), + ... datepart(lit("WEEK"), "ts").alias("week"), + ... datepart(lit("D"), "ts").alias("day"), + ... datepart(lit("M"), "ts").alias("minute"), + ... datepart(lit("S"), "ts").alias("second"), + ... ).collect() + [Row(year=2015, month=4, week=15, day=8, minute=8, second=Decimal('15.000000'))] + """ + return date_part(field, source) + + +def date_diff(end: "ColumnOrName", start: "ColumnOrName") -> Column: + """Returns the number of days from `start` to `end`. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + end : :class:`~pyspark.sql.Column` or column name + to date column to work on. + start : :class:`~pyspark.sql.Column` or column name + from date column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + difference in days between two dates. + + See Also: + -------- + :meth:`pyspark.sql.functions.dateadd` + :meth:`pyspark.sql.functions.date_add` + :meth:`pyspark.sql.functions.date_sub` + :meth:`pyspark.sql.functions.datediff` + :meth:`pyspark.sql.functions.timestamp_diff` + + Examples: + -------- + >>> import pyspark.sql.functions as sf + >>> df = spark.createDataFrame([("2015-04-08", "2015-05-10")], ["d1", "d2"]) + >>> df.select( + ... "*", sf.date_diff(sf.col("d1").cast("DATE"), sf.col("d2").cast("DATE")) + ... ).show() + +----------+----------+-----------------+ + | d1| d2|date_diff(d1, d2)| + +----------+----------+-----------------+ + |2015-04-08|2015-05-10| -32| + +----------+----------+-----------------+ + + >>> df.select( + ... "*", sf.date_diff(sf.col("d1").cast("DATE"), sf.col("d2").cast("DATE")) + ... ).show() + +----------+----------+-----------------+ + | d1| d2|date_diff(d2, d1)| + +----------+----------+-----------------+ + |2015-04-08|2015-05-10| 32| + +----------+----------+-----------------+ + """ + return _invoke_function_over_columns("date_diff", lit("day"), end, start) + + +def year(col: "ColumnOrName") -> Column: + """Extract the year of a given date/timestamp as integer. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target date/timestamp column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + year part of the date/timestamp as integer. + + Examples: + -------- + >>> df = spark.createDataFrame([("2015-04-08",)], ["dt"]) + >>> df.select(year("dt").alias("year")).collect() + [Row(year=2015)] + """ + return _invoke_function_over_columns("year", col) + + +def quarter(col: "ColumnOrName") -> Column: + """Extract the quarter of a given date/timestamp as integer. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target date/timestamp column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + quarter of the date/timestamp as integer. + + Examples: + -------- + >>> df = spark.createDataFrame([("2015-04-08",)], ["dt"]) + >>> df.select(quarter("dt").alias("quarter")).collect() + [Row(quarter=2)] + """ + return _invoke_function_over_columns("quarter", col) + + +def month(col: "ColumnOrName") -> Column: + """Extract the month of a given date/timestamp as integer. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target date/timestamp column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + month part of the date/timestamp as integer. + + Examples: + -------- + >>> df = spark.createDataFrame([("2015-04-08",)], ["dt"]) + >>> df.select(month("dt").alias("month")).collect() + [Row(month=4)] + """ + return _invoke_function_over_columns("month", col) + + +def dayofweek(col: "ColumnOrName") -> Column: + """Extract the day of the week of a given date/timestamp as integer. + Ranges from 1 for a Sunday through to 7 for a Saturday. + + .. versionadded:: 2.3.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target date/timestamp column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + day of the week for given date/timestamp as integer. + + Examples: + -------- + >>> df = spark.createDataFrame([("2015-04-08",)], ["dt"]) + >>> df.select(dayofweek("dt").alias("day")).collect() + [Row(day=4)] + """ # noqa: D205 + return _invoke_function_over_columns("dayofweek", col) + lit(1) + + +def day(col: "ColumnOrName") -> Column: + """Extract the day of the month of a given date/timestamp as integer. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target date/timestamp column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + day of the month for given date/timestamp as integer. + + Examples: + -------- + >>> df = spark.createDataFrame([("2015-04-08",)], ["dt"]) + >>> df.select(day("dt").alias("day")).collect() + [Row(day=8)] + """ + return _invoke_function_over_columns("day", col) + + +def dayofmonth(col: "ColumnOrName") -> Column: + """Extract the day of the month of a given date/timestamp as integer. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target date/timestamp column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + day of the month for given date/timestamp as integer. + + Examples: + -------- + >>> df = spark.createDataFrame([("2015-04-08",)], ["dt"]) + >>> df.select(dayofmonth("dt").alias("day")).collect() + [Row(day=8)] + """ + return day(col) + + +def dayofyear(col: "ColumnOrName") -> Column: + """Extract the day of the year of a given date/timestamp as integer. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target date/timestamp column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + day of the year for given date/timestamp as integer. + + Examples: + -------- + >>> df = spark.createDataFrame([("2015-04-08",)], ["dt"]) + >>> df.select(dayofyear("dt").alias("day")).collect() + [Row(day=98)] + """ + return _invoke_function_over_columns("dayofyear", col) + + +def hour(col: "ColumnOrName") -> Column: + """Extract the hours of a given timestamp as integer. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target date/timestamp column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + hour part of the timestamp as integer. + + Examples: + -------- + >>> import datetime + >>> df = spark.createDataFrame([(datetime.datetime(2015, 4, 8, 13, 8, 15),)], ["ts"]) + >>> df.select(hour("ts").alias("hour")).collect() + [Row(hour=13)] + """ + return _invoke_function_over_columns("hour", col) + + +def minute(col: "ColumnOrName") -> Column: + """Extract the minutes of a given timestamp as integer. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target date/timestamp column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + minutes part of the timestamp as integer. + + Examples: + -------- + >>> import datetime + >>> df = spark.createDataFrame([(datetime.datetime(2015, 4, 8, 13, 8, 15),)], ["ts"]) + >>> df.select(minute("ts").alias("minute")).collect() + [Row(minute=8)] + """ + return _invoke_function_over_columns("minute", col) + + +def second(col: "ColumnOrName") -> Column: + """Extract the seconds of a given date as integer. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target date/timestamp column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + `seconds` part of the timestamp as integer. + + Examples: + -------- + >>> import datetime + >>> df = spark.createDataFrame([(datetime.datetime(2015, 4, 8, 13, 8, 15),)], ["ts"]) + >>> df.select(second("ts").alias("second")).collect() + [Row(second=15)] + """ + return _invoke_function_over_columns("second", col) + + +def weekofyear(col: "ColumnOrName") -> Column: + """Extract the week number of a given date as integer. + A week is considered to start on a Monday and week 1 is the first week with more than 3 days, + as defined by ISO 8601. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target timestamp column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + `week` of the year for given date as integer. + + Examples: + -------- + >>> df = spark.createDataFrame([("2015-04-08",)], ["dt"]) + >>> df.select(weekofyear(df.dt).alias("week")).collect() + [Row(week=15)] + """ # noqa: D205 + return _invoke_function_over_columns("weekofyear", col) + + +def cos(col: "ColumnOrName") -> Column: + """Computes cosine of the input column. + + .. versionadded:: 1.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + angle in radians + + Returns: + ------- + :class:`~pyspark.sql.Column` + cosine of the angle, as if computed by `java.lang.Math.cos()`. + + Examples: + -------- + >>> import math + >>> df = spark.range(1) + >>> df.select(cos(lit(math.pi))).first() + Row(COS(3.14159...)=-1.0) + """ + return _invoke_function_over_columns("cos", col) + + +def acos(col: "ColumnOrName") -> Column: + """Computes inverse cosine of the input column. + + .. versionadded:: 1.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + inverse cosine of `col`, as if computed by `java.lang.Math.acos()` + + Examples: + -------- + >>> df = spark.range(1, 3) + >>> df.select(acos(df.id)).show() + +--------+ + |ACOS(id)| + +--------+ + | 0.0| + | NaN| + +--------+ + """ + col = _to_column_expr(col) + # acos domain is [-1, 1]; return NaN for out-of-range values per PySpark semantics + return Column( + CaseExpression((col < -1.0) | (col > 1.0), _nan_constant()).otherwise(FunctionExpression("acos", col)) + ) + + +def call_function(funcName: str, *cols: "ColumnOrName") -> Column: + r"""Call a SQL function. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + funcName : str + function name that follows the SQL identifier syntax (can be quoted, can be qualified) + cols : :class:`~pyspark.sql.Column` or str + column names or :class:`~pyspark.sql.Column`\\s to be used in the function + + Returns: + ------- + :class:`~pyspark.sql.Column` + result of executed function. + + Examples: + -------- + >>> from pyspark.sql.functions import call_udf, col + >>> from pyspark.sql.types import IntegerType, StringType + >>> df = spark.createDataFrame([(1, "a"), (2, "b"), (3, "c")], ["id", "name"]) + >>> _ = spark.udf.register("intX2", lambda i: i * 2, IntegerType()) + >>> df.select(call_function("intX2", "id")).show() + +---------+ + |intX2(id)| + +---------+ + | 2| + | 4| + | 6| + +---------+ + >>> _ = spark.udf.register("strX2", lambda s: s * 2, StringType()) + >>> df.select(call_function("strX2", col("name"))).show() + +-----------+ + |strX2(name)| + +-----------+ + | aa| + | bb| + | cc| + +-----------+ + >>> df.select(call_function("avg", col("id"))).show() + +-------+ + |avg(id)| + +-------+ + | 2.0| + +-------+ + >>> _ = spark.sql("CREATE FUNCTION custom_avg AS 'test.org.apache.spark.sql.MyDoubleAvg'") + ... # doctest: +SKIP + >>> df.select(call_function("custom_avg", col("id"))).show() + ... # doctest: +SKIP + +------------------------------------+ + |spark_catalog.default.custom_avg(id)| + +------------------------------------+ + | 102.0| + +------------------------------------+ + >>> df.select(call_function("spark_catalog.default.custom_avg", col("id"))).show() + ... # doctest: +SKIP + +------------------------------------+ + |spark_catalog.default.custom_avg(id)| + +------------------------------------+ + | 102.0| + +------------------------------------+ + """ + return _invoke_function_over_columns(funcName, *cols) + + +def covar_pop(col1: "ColumnOrName", col2: "ColumnOrName") -> Column: + """Returns a new :class:`~pyspark.sql.Column` for the population covariance of ``col1`` and + ``col2``. + + .. versionadded:: 2.0.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col1 : :class:`~pyspark.sql.Column` or str + first column to calculate covariance. + col1 : :class:`~pyspark.sql.Column` or str + second column to calculate covariance. + + Returns: + ------- + :class:`~pyspark.sql.Column` + covariance of these two column values. + + Examples: + -------- + >>> a = [1] * 10 + >>> b = [1] * 10 + >>> df = spark.createDataFrame(zip(a, b), ["a", "b"]) + >>> df.agg(covar_pop("a", "b").alias("c")).collect() + [Row(c=0.0)] + """ # noqa: D205 + return _invoke_function_over_columns("covar_pop", col1, col2) + + +def covar_samp(col1: "ColumnOrName", col2: "ColumnOrName") -> Column: + """Returns a new :class:`~pyspark.sql.Column` for the sample covariance of ``col1`` and + ``col2``. + + .. versionadded:: 2.0.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col1 : :class:`~pyspark.sql.Column` or str + first column to calculate covariance. + col1 : :class:`~pyspark.sql.Column` or str + second column to calculate covariance. + + Returns: + ------- + :class:`~pyspark.sql.Column` + sample covariance of these two column values. + + Examples: + -------- + >>> a = [1] * 10 + >>> b = [1] * 10 + >>> df = spark.createDataFrame(zip(a, b), ["a", "b"]) + >>> df.agg(covar_samp("a", "b").alias("c")).collect() + [Row(c=0.0)] + """ # noqa: D205 + return _invoke_function_over_columns("covar_samp", col1, col2) + + +def exp(col: "ColumnOrName") -> Column: + """Computes the exponential of the given value. + + .. versionadded:: 1.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + column to calculate exponential for. + + Returns: + ------- + :class:`~pyspark.sql.Column` + exponential of the given value. + + Examples: + -------- + >>> df = spark.range(1) + >>> df.select(exp(lit(0))).show() + +------+ + |EXP(0)| + +------+ + | 1.0| + +------+ + """ + return _invoke_function_over_columns("exp", col) + + +def factorial(col: "ColumnOrName") -> Column: + """Computes the factorial of the given value. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + a column to calculate factorial for. + + Returns: + ------- + :class:`~pyspark.sql.Column` + factorial of given value. + + Examples: + -------- + >>> df = spark.createDataFrame([(5,)], ["n"]) + >>> df.select(factorial(df.n).alias("f")).collect() + [Row(f=120)] + """ + return _invoke_function_over_columns("factorial", col) + + +def log2(col: "ColumnOrName") -> Column: + """Returns the base-2 logarithm of the argument. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + a column to calculate logariphm for. + + Returns: + ------- + :class:`~pyspark.sql.Column` + logariphm of given value. + + Examples: + -------- + >>> df = spark.createDataFrame([(4,)], ["a"]) + >>> df.select(log2("a").alias("log2")).show() + +----+ + |log2| + +----+ + | 2.0| + +----+ + """ + return _invoke_function_over_columns("log2", col) + + +def ln(col: "ColumnOrName") -> Column: + """Returns the natural logarithm of the argument. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + a column to calculate logariphm for. + + Returns: + ------- + :class:`~pyspark.sql.Column` + natural logarithm of given value. + + Examples: + -------- + >>> df = spark.createDataFrame([(4,)], ["a"]) + >>> df.select(ln("a")).show() + +------------------+ + | ln(a)| + +------------------+ + |1.3862943611198906| + +------------------+ + """ + return _invoke_function_over_columns("ln", col) + + +def degrees(col: "ColumnOrName") -> Column: + """Converts an angle measured in radians to an approximately equivalent angle + measured in degrees. + + .. versionadded:: 2.1.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + angle in radians + + Returns: + ------- + :class:`~pyspark.sql.Column` + angle in degrees, as if computed by `java.lang.Math.toDegrees()` + + Examples: + -------- + >>> import math + >>> df = spark.range(1) + >>> df.select(degrees(lit(math.pi))).first() + Row(DEGREES(3.14159...)=180.0) + """ # noqa: D205 + return _invoke_function_over_columns("degrees", col) + + +def radians(col: "ColumnOrName") -> Column: + """Converts an angle measured in degrees to an approximately equivalent angle + measured in radians. + + .. versionadded:: 2.1.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + angle in degrees + + Returns: + ------- + :class:`~pyspark.sql.Column` + angle in radians, as if computed by `java.lang.Math.toRadians()` + + Examples: + -------- + >>> df = spark.range(1) + >>> df.select(radians(lit(180))).first() + Row(RADIANS(180)=3.14159...) + """ # noqa: D205 + return _invoke_function_over_columns("radians", col) + + +def atan(col: "ColumnOrName") -> Column: + """Compute inverse tangent of the input column. + + .. versionadded:: 1.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + inverse tangent of `col`, as if computed by `java.lang.Math.atan()` + + Examples: + -------- + >>> df = spark.range(1) + >>> df.select(atan(df.id)).show() + +--------+ + |ATAN(id)| + +--------+ + | 0.0| + +--------+ + """ + return _invoke_function_over_columns("atan", col) + + +def atan2(col1: Union["ColumnOrName", float], col2: Union["ColumnOrName", float]) -> Column: + """.. versionadded:: 1.4.0. + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col1 : str, :class:`~pyspark.sql.Column` or float + coordinate on y-axis + col2 : str, :class:`~pyspark.sql.Column` or float + coordinate on x-axis + + Returns: + ------- + :class:`~pyspark.sql.Column` + the `theta` component of the point + (`r`, `theta`) + in polar coordinates that corresponds to the point + (`x`, `y`) in Cartesian coordinates, + as if computed by `java.lang.Math.atan2()` + + Examples: + -------- + >>> df = spark.range(1) + >>> df.select(atan2(lit(1), lit(2))).first() + Row(ATAN2(1, 2)=0.46364...) + """ + + def lit_or_column(x: Union["ColumnOrName", float]) -> Column: + if isinstance(x, (int, float)): + return lit(x) + return x + + return _invoke_function_over_columns("atan2", lit_or_column(col1), lit_or_column(col2)) + + +def tan(col: "ColumnOrName") -> Column: + """Computes tangent of the input column. + + .. versionadded:: 1.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + angle in radians + + Returns: + ------- + :class:`~pyspark.sql.Column` + tangent of the given value, as if computed by `java.lang.Math.tan()` + + Examples: + -------- + >>> import math + >>> df = spark.range(1) + >>> df.select(tan(lit(math.radians(45)))).first() + Row(TAN(0.78539...)=0.99999...) + """ + return _invoke_function_over_columns("tan", col) + + +def round(col: "ColumnOrName", scale: int = 0) -> Column: + """Round the given value to `scale` decimal places using HALF_UP rounding mode if `scale` >= 0 + or at integral part when `scale` < 0. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + input column to round. + scale : int optional default 0 + scale value. + + Returns: + ------- + :class:`~pyspark.sql.Column` + rounded values. + + Examples: + -------- + >>> spark.createDataFrame([(2.5,)], ["a"]).select(round("a", 0).alias("r")).collect() + [Row(r=3.0)] + """ # noqa: D205 + return _invoke_function_over_columns("round", col, lit(scale)) + + +def bround(col: "ColumnOrName", scale: int = 0) -> Column: + """Round the given value to `scale` decimal places using HALF_EVEN rounding mode if `scale` >= 0 + or at integral part when `scale` < 0. + + .. versionadded:: 2.0.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + input column to round. + scale : int optional default 0 + scale value. + + Returns: + ------- + :class:`~pyspark.sql.Column` + rounded values. + + Examples: + -------- + >>> spark.createDataFrame([(2.5,)], ["a"]).select(bround("a", 0).alias("r")).collect() + [Row(r=2.0)] + """ # noqa: D205 + return _invoke_function_over_columns("round_even", col, lit(scale)) + + +def get(col: "ColumnOrName", index: Union["ColumnOrName", int]) -> Column: + """Collection function: Returns element of array at given (0-based) index. + If the index points outside of the array boundaries, then this function + returns NULL. + + .. versionadded:: 3.4.0 + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + name of column containing array + index : :class:`~pyspark.sql.Column` or str or int + index to check for in array + + Returns: + ------- + :class:`~pyspark.sql.Column` + value at given position. + + Notes: + ----- + The position is not 1 based, but 0 based index. + Supports Spark Connect. + + See Also: + -------- + :meth:`element_at` + + Examples: + -------- + >>> df = spark.createDataFrame([(["a", "b", "c"], 1)], ["data", "index"]) + >>> df.select(get(df.data, 1)).show() + +------------+ + |get(data, 1)| + +------------+ + | b| + +------------+ + + >>> df.select(get(df.data, -1)).show() + +-------------+ + |get(data, -1)| + +-------------+ + | NULL| + +-------------+ + + >>> df.select(get(df.data, 3)).show() + +------------+ + |get(data, 3)| + +------------+ + | NULL| + +------------+ + + >>> df.select(get(df.data, "index")).show() + +----------------+ + |get(data, index)| + +----------------+ + | b| + +----------------+ + + >>> df.select(get(df.data, col("index") - 1)).show() + +----------------------+ + |get(data, (index - 1))| + +----------------------+ + | a| + +----------------------+ + """ # noqa: D205 + index = ConstantExpression(index) if isinstance(index, int) else _to_column_expr(index) + # Spark uses 0-indexing, DuckDB 1-indexing + index = index + 1 + + return _invoke_function("list_extract", _to_column_expr(col), index) + + +def initcap(col: "ColumnOrName") -> Column: + """Translate the first letter of each word to upper case in the sentence. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + string with all first letters are uppercase in each word. + + Examples: + -------- + >>> spark.createDataFrame([("ab cd",)], ["a"]).select(initcap("a").alias("v")).collect() + [Row(v='Ab Cd')] + """ + return Column( + FunctionExpression( + "array_to_string", + FunctionExpression( + "list_transform", + FunctionExpression("string_split", _to_column_expr(col), ConstantExpression(" ")), + LambdaExpression( + "x", + FunctionExpression( + "concat", + FunctionExpression( + "upper", + FunctionExpression("array_extract", ColumnExpression("x"), 1), + ), + FunctionExpression("array_slice", ColumnExpression("x"), 2, -1), + ), + ), + ), + ConstantExpression(" "), + ) + ) + + +def octet_length(col: "ColumnOrName") -> Column: + r"""Calculates the byte length for the specified string column. + + .. versionadded:: 3.3.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + Source column or strings + + Returns: + ------- + :class:`~pyspark.sql.Column` + Byte length of the col + + Examples: + -------- + >>> from pyspark.sql.functions import octet_length + >>> spark.createDataFrame([('cat',), ( '\U0001f408',)], ['cat']) \\ + ... .select(octet_length('cat')).collect() + [Row(octet_length(cat)=3), Row(octet_length(cat)=4)] + """ + return _invoke_function("octet_length", _to_column_expr(col).cast("blob")) + + +def hex(col: "ColumnOrName") -> Column: + """Computes hex value of the given column. + + The column can be :class:`~pyspark.sql.types.StringType`, :class:`~pyspark.sql.types.BinaryType`, + :class:`~pyspark.sql.types.IntegerType` or :class:`~pyspark.sql.types.LongType`. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + hexadecimal representation of given value as string. + + Examples: + -------- + >>> spark.createDataFrame([("ABC", 3)], ["a", "b"]).select(hex("a"), hex("b")).collect() + [Row(hex(a)='414243', hex(b)='3')] + """ + return _invoke_function_over_columns("hex", col) + + +def unhex(col: "ColumnOrName") -> Column: + """Inverse of hex. + + Interprets each pair of characters as a hexadecimal number and converts to the byte representation of number column + and returns it as a binary column. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + string representation of given hexadecimal value. + + Examples: + -------- + >>> spark.createDataFrame([("414243",)], ["a"]).select(unhex("a")).collect() + [Row(unhex(a)=bytearray(b'ABC'))] + """ + return _invoke_function_over_columns("unhex", col) + + +def base64(col: "ColumnOrName") -> Column: + """Computes the BASE64 encoding of a binary column and returns it as a string column. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + BASE64 encoding of string value. + + Examples: + -------- + >>> df = spark.createDataFrame(["Spark", "PySpark", "Pandas API"], "STRING") + >>> df.select(base64("value")).show() + +----------------+ + | base64(value)| + +----------------+ + | U3Bhcms=| + | UHlTcGFyaw==| + |UGFuZGFzIEFQSQ==| + +----------------+ + """ + if isinstance(col, str): + col = Column(ColumnExpression(col)) + return _invoke_function_over_columns("base64", col.cast("BLOB")) + + +def unbase64(col: "ColumnOrName") -> Column: + """Decodes a BASE64 encoded string column and returns it as a binary column. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + encoded string value. + + Examples: + -------- + >>> df = spark.createDataFrame(["U3Bhcms=", "UHlTcGFyaw==", "UGFuZGFzIEFQSQ=="], "STRING") + >>> df.select(unbase64("value")).show() + +--------------------+ + | unbase64(value)| + +--------------------+ + | [53 70 61 72 6B]| + |[50 79 53 70 61 7...| + |[50 61 6E 64 61 7...| + +--------------------+ + """ + return _invoke_function_over_columns("from_base64", col) + + +def add_months(start: "ColumnOrName", months: Union["ColumnOrName", int]) -> Column: + """Returns the date that is `months` months after `start`. If `months` is a negative value + then these amount of months will be deducted from the `start`. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + start : :class:`~pyspark.sql.Column` or str + date column to work on. + months : :class:`~pyspark.sql.Column` or str or int + how many months after the given date to calculate. + Accepts negative value as well to calculate backwards. + + Returns: + ------- + :class:`~pyspark.sql.Column` + a date after/before given number of months. + + Examples: + -------- + >>> df = spark.createDataFrame([("2015-04-08", 2)], ["dt", "add"]) + >>> df.select(add_months(df.dt, 1).alias("next_month")).collect() + [Row(next_month=datetime.date(2015, 5, 8))] + >>> df.select(add_months(df.dt, df.add.cast("integer")).alias("next_month")).collect() + [Row(next_month=datetime.date(2015, 6, 8))] + >>> df.select(add_months("dt", -2).alias("prev_month")).collect() + [Row(prev_month=datetime.date(2015, 2, 8))] + """ # noqa: D205 + months = ConstantExpression(months) if isinstance(months, int) else _to_column_expr(months) + return _invoke_function("date_add", _to_column_expr(start), FunctionExpression("to_months", months)).cast("date") + + +def array_join(col: "ColumnOrName", delimiter: str, null_replacement: Optional[str] = None) -> Column: + """Concatenates the elements of `column` using the `delimiter`. Null values are replaced with + `null_replacement` if set, otherwise they are ignored. + + .. versionadded:: 2.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to work on. + delimiter : str + delimiter used to concatenate elements + null_replacement : str, optional + if set then null values will be replaced by this value + + Returns: + ------- + :class:`~pyspark.sql.Column` + a column of string type. Concatenated values. + + Examples: + -------- + >>> df = spark.createDataFrame([(["a", "b", "c"],), (["a", None],)], ["data"]) + >>> df.select(array_join(df.data, ",").alias("joined")).collect() + [Row(joined='a,b,c'), Row(joined='a')] + >>> df.select(array_join(df.data, ",", "NULL").alias("joined")).collect() + [Row(joined='a,b,c'), Row(joined='a,NULL')] + """ # noqa: D205 + col = _to_column_expr(col) + if null_replacement is not None: + col = FunctionExpression( + "list_transform", + col, + LambdaExpression( + "x", + CaseExpression(ColumnExpression("x").isnull(), ConstantExpression(null_replacement)).otherwise( + ColumnExpression("x") + ), + ), + ) + return _invoke_function("array_to_string", col, ConstantExpression(delimiter)) + + +def array_position(col: "ColumnOrName", value: Any) -> Column: # noqa: ANN401 + """Collection function: Locates the position of the first occurrence of the given value + in the given array. Returns null if either of the arguments are null. + + .. versionadded:: 2.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Notes: + ----- + The position is not zero based, but 1 based index. Returns 0 if the given + value could not be found in the array. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to work on. + value : Any + value to look for. + + Returns: + ------- + :class:`~pyspark.sql.Column` + position of the value in the given array if found and 0 otherwise. + + Examples: + -------- + >>> df = spark.createDataFrame([(["c", "b", "a"],), ([],)], ["data"]) + >>> df.select(array_position(df.data, "a")).collect() + [Row(array_position(data, a)=3), Row(array_position(data, a)=0)] + """ # noqa: D205 + return Column( + CoalesceOperator( + _to_column_expr(_invoke_function_over_columns("list_position", col, lit(value))), ConstantExpression(0) + ) + ) + + +def array_prepend(col: "ColumnOrName", value: Any) -> Column: # noqa: ANN401 + """Collection function: Returns an array containing element as + well as all elements from array. The new element is positioned + at the beginning of the array. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + name of column containing array + value : + a literal value, or a :class:`~pyspark.sql.Column` expression. + + Returns: + ------- + :class:`~pyspark.sql.Column` + an array excluding given value. + + Examples: + -------- + >>> df = spark.createDataFrame([([2, 3, 4],), ([],)], ["data"]) + >>> df.select(array_prepend(df.data, 1)).collect() + [Row(array_prepend(data, 1)=[1, 2, 3, 4]), Row(array_prepend(data, 1)=[1])] + """ # noqa: D205 + return _invoke_function_over_columns("list_prepend", lit(value), col) + + +def array_repeat(col: "ColumnOrName", count: Union["ColumnOrName", int]) -> Column: + """Collection function: creates an array containing a column repeated count times. + + .. versionadded:: 2.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + column name or column that contains the element to be repeated + count : :class:`~pyspark.sql.Column` or str or int + column name, column, or int containing the number of times to repeat the first argument + + Returns: + ------- + :class:`~pyspark.sql.Column` + an array of repeated elements. + + Examples: + -------- + >>> df = spark.createDataFrame([("ab",)], ["data"]) + >>> df.select(array_repeat(df.data, 3).alias("r")).collect() + [Row(r=['ab', 'ab', 'ab'])] + """ + count = lit(count) if isinstance(count, int) else count + + return _invoke_function_over_columns("list_resize", _invoke_function_over_columns("list_value", col), count, col) + + +def array_size(col: "ColumnOrName") -> Column: + """Returns the total number of elements in the array. The function returns null for null input. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + total number of elements in the array. + + Examples: + -------- + >>> df = spark.createDataFrame([([2, 1, 3],), (None,)], ["data"]) + >>> df.select(array_size(df.data).alias("r")).collect() + [Row(r=3), Row(r=None)] + """ + return _invoke_function_over_columns("len", col) + + +def array_sort(col: "ColumnOrName", comparator: Optional[Callable[[Column, Column], Column]] = None) -> Column: + """Collection function: sorts the input array in ascending order. The elements of the input array + must be orderable. Null elements will be placed at the end of the returned array. + + .. versionadded:: 2.4.0 + + .. versionchanged:: 3.4.0 + Can take a `comparator` function. + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + name of column or expression + comparator : callable, optional + A binary ``(Column, Column) -> Column: ...``. + The comparator will take two + arguments representing two elements of the array. It returns a negative integer, 0, or a + positive integer as the first element is less than, equal to, or greater than the second + element. If the comparator function returns null, the function will fail and raise an error. + + Returns: + ------- + :class:`~pyspark.sql.Column` + sorted array. + + Examples: + -------- + >>> df = spark.createDataFrame([([2, 1, None, 3],), ([1],), ([],)], ["data"]) + >>> df.select(array_sort(df.data).alias("r")).collect() + [Row(r=[1, 2, 3, None]), Row(r=[1]), Row(r=[])] + >>> df = spark.createDataFrame( + ... [(["foo", "foobar", None, "bar"],), (["foo"],), ([],)], ["data"] + ... ) + >>> df.select( + ... array_sort( + ... "data", + ... lambda x, y: when(x.isNull() | y.isNull(), lit(0)).otherwise( + ... length(y) - length(x) + ... ), + ... ).alias("r") + ... ).collect() + [Row(r=['foobar', 'foo', None, 'bar']), Row(r=['foo']), Row(r=[])] + """ # noqa: D205 + if comparator is not None: + msg = "comparator is not yet supported" + raise ContributionsAcceptedError(msg) + else: + return _invoke_function_over_columns("list_sort", col, lit("ASC"), lit("NULLS LAST")) + + +def sort_array(col: "ColumnOrName", asc: bool = True) -> Column: + """Collection function: sorts the input array in ascending or descending order according + to the natural ordering of the array elements. Null elements will be placed at the beginning + of the returned array in ascending order or at the end of the returned array in descending + order. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + name of column or expression + asc : bool, optional + whether to sort in ascending or descending order. If `asc` is True (default) + then ascending and if False then descending. + + Returns: + ------- + :class:`~pyspark.sql.Column` + sorted array. + + Examples: + -------- + >>> df = spark.createDataFrame([([2, 1, None, 3],), ([1],), ([],)], ["data"]) + >>> df.select(sort_array(df.data).alias("r")).collect() + [Row(r=[None, 1, 2, 3]), Row(r=[1]), Row(r=[])] + >>> df.select(sort_array(df.data, asc=False).alias("r")).collect() + [Row(r=[3, 2, 1, None]), Row(r=[1]), Row(r=[])] + """ # noqa: D205 + if asc: + order = "ASC" + null_order = "NULLS FIRST" + else: + order = "DESC" + null_order = "NULLS LAST" + return _invoke_function_over_columns("list_sort", col, lit(order), lit(null_order)) + + +def split(str: "ColumnOrName", pattern: str, limit: int = -1) -> Column: + """Splits str around matches of the given pattern. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + str : :class:`~pyspark.sql.Column` or str + a string expression to split + pattern : str + a string representing a regular expression. The regex string should be + a Java regular expression. + limit : int, optional + an integer which controls the number of times `pattern` is applied. + + * ``limit > 0``: The resulting array's length will not be more than `limit`, and the + resulting array's last entry will contain all input beyond the last + matched pattern. + * ``limit <= 0``: `pattern` will be applied as many times as possible, and the resulting + array can be of any size. + + .. versionchanged:: 3.0 + `split` now takes an optional `limit` field. If not provided, default limit value is -1. + + Returns: + ------- + :class:`~pyspark.sql.Column` + array of separated strings. + + Examples: + -------- + >>> df = spark.createDataFrame( + ... [("oneAtwoBthreeC",)], + ... [ + ... "s", + ... ], + ... ) + >>> df.select(split(df.s, "[ABC]", 2).alias("s")).collect() + [Row(s=['one', 'twoBthreeC'])] + >>> df.select(split(df.s, "[ABC]", -1).alias("s")).collect() + [Row(s=['one', 'two', 'three', ''])] + """ + if limit > 0: + # Unclear how to implement this in DuckDB as we'd need to map back from the split array + # to the original array which is tricky with regular expressions. + msg = "limit is not yet supported" + raise ContributionsAcceptedError(msg) + return _invoke_function_over_columns("regexp_split_to_array", str, lit(pattern)) + + +def split_part(src: "ColumnOrName", delimiter: "ColumnOrName", partNum: "ColumnOrName") -> Column: + """Splits `str` by delimiter and return requested part of the split (1-based). + If any input is null, returns null. if `partNum` is out of range of split parts, + returns empty string. If `partNum` is 0, throws an error. If `partNum` is negative, + the parts are counted backward from the end of the string. + If the `delimiter` is an empty string, the `str` is not split. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + src : :class:`~pyspark.sql.Column` or str + A column of string to be splited. + delimiter : :class:`~pyspark.sql.Column` or str + A column of string, the delimiter used for split. + partNum : :class:`~pyspark.sql.Column` or str + A column of string, requested part of the split (1-based). + + Examples: + -------- + >>> df = spark.createDataFrame( + ... [ + ... ( + ... "11.12.13", + ... ".", + ... 3, + ... ) + ... ], + ... ["a", "b", "c"], + ... ) + >>> df.select(split_part(df.a, df.b, df.c).alias("r")).collect() + [Row(r='13')] + """ # noqa: D205 + src = _to_column_expr(src) + delimiter = _to_column_expr(delimiter) + partNum = _to_column_expr(partNum) + part = FunctionExpression("split_part", src, delimiter, partNum) + + return Column( + CaseExpression(src.isnull() | delimiter.isnull() | partNum.isnull(), ConstantExpression(None)).otherwise( + CaseExpression(delimiter == ConstantExpression(""), ConstantExpression("")).otherwise(part) + ) + ) + + +def stddev_samp(col: "ColumnOrName") -> Column: + """Aggregate function: returns the unbiased sample standard deviation of + the expression in a group. + + .. versionadded:: 1.6.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + standard deviation of given column. + + Examples: + -------- + >>> import pyspark.sql.functions as sf + >>> spark.range(6).select(sf.stddev_samp("id")).show() + +------------------+ + | stddev_samp(id)| + +------------------+ + |1.8708286933869...| + +------------------+ + """ # noqa: D205 + return _invoke_function_over_columns("stddev_samp", col) + + +def stddev(col: "ColumnOrName") -> Column: + """Aggregate function: alias for stddev_samp. + + .. versionadded:: 1.6.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + standard deviation of given column. + + Examples: + -------- + >>> import pyspark.sql.functions as sf + >>> spark.range(6).select(sf.stddev("id")).show() + +------------------+ + | stddev(id)| + +------------------+ + |1.8708286933869...| + +------------------+ + """ + return stddev_samp(col) + + +def std(col: "ColumnOrName") -> Column: + """Aggregate function: alias for stddev_samp. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + standard deviation of given column. + + Examples: + -------- + >>> import pyspark.sql.functions as sf + >>> spark.range(6).select(sf.std("id")).show() + +------------------+ + | std(id)| + +------------------+ + |1.8708286933869...| + +------------------+ + """ + return stddev_samp(col) + + +def stddev_pop(col: "ColumnOrName") -> Column: + """Aggregate function: returns population standard deviation of + the expression in a group. + + .. versionadded:: 1.6.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + standard deviation of given column. + + Examples: + -------- + >>> import pyspark.sql.functions as sf + >>> spark.range(6).select(sf.stddev_pop("id")).show() + +-----------------+ + | stddev_pop(id)| + +-----------------+ + |1.707825127659...| + +-----------------+ + """ # noqa: D205 + return _invoke_function_over_columns("stddev_pop", col) + + +def var_pop(col: "ColumnOrName") -> Column: + """Aggregate function: returns the population variance of the values in a group. + + .. versionadded:: 1.6.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + variance of given column. + + Examples: + -------- + >>> df = spark.range(6) + >>> df.select(var_pop(df.id)).first() + Row(var_pop(id)=2.91666...) + """ + return _invoke_function_over_columns("var_pop", col) + + +def var_samp(col: "ColumnOrName") -> Column: + """Aggregate function: returns the unbiased sample variance of + the values in a group. + + .. versionadded:: 1.6.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + variance of given column. + + Examples: + -------- + >>> df = spark.range(6) + >>> df.select(var_samp(df.id)).show() + +------------+ + |var_samp(id)| + +------------+ + | 3.5| + +------------+ + """ # noqa: D205 + return _invoke_function_over_columns("var_samp", col) + + +def variance(col: "ColumnOrName") -> Column: + """Aggregate function: alias for var_samp. + + .. versionadded:: 1.6.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target column to compute on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + variance of given column. + + Examples: + -------- + >>> df = spark.range(6) + >>> df.select(variance(df.id)).show() + +------------+ + |var_samp(id)| + +------------+ + | 3.5| + +------------+ + """ + return var_samp(col) + + +def weekday(col: "ColumnOrName") -> Column: + """Returns the day of the week for date/timestamp (0 = Monday, 1 = Tuesday, ..., 6 = Sunday). + + .. versionadded:: 3.5.0 + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + target date/timestamp column to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + the day of the week for date/timestamp (0 = Monday, 1 = Tuesday, ..., 6 = Sunday). + + Examples: + -------- + >>> df = spark.createDataFrame([("2015-04-08",)], ["dt"]) + >>> df.select(weekday("dt").alias("day")).show() + +---+ + |day| + +---+ + | 2| + +---+ + """ + return _invoke_function_over_columns("isodow", col) - 1 + + +def zeroifnull(col: "ColumnOrName") -> Column: + """Returns zero if `col` is null, or `col` otherwise. + + .. versionadded:: 4.0.0 + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + + Examples: + -------- + >>> df = spark.createDataFrame([(None,), (1,)], ["a"]) + >>> df.select(zeroifnull(df.a).alias("result")).show() + +------+ + |result| + +------+ + | 0| + | 1| + +------+ + """ + return coalesce(col, lit(0)) + + +def _to_date_or_timestamp(col: "ColumnOrName", spark_datatype: _types.DataType, format: Optional[str] = None) -> Column: + if format is not None: + raise ContributionsAcceptedError( + "format is not yet supported as DuckDB and PySpark use a different way of specifying them." + + " As a workaround, you can use F.call_function('strptime', col, format)" + ) + return Column(_to_column_expr(col)).cast(spark_datatype) + + +def to_date(col: "ColumnOrName", format: Optional[str] = None) -> Column: + """Converts a :class:`~pyspark.sql.Column` into :class:`pyspark.sql.types.DateType` + using the optionally specified format. Specify formats according to `datetime pattern`_. + By default, it follows casting rules to :class:`pyspark.sql.types.DateType` if the format + is omitted. Equivalent to ``col.cast("date")``. + + .. _datetime pattern: https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + .. versionadded:: 2.2.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + input column of values to convert. + format: str, optional + format to use to convert date values. + + Returns: + ------- + :class:`~pyspark.sql.Column` + date value as :class:`pyspark.sql.types.DateType` type. + + Examples: + -------- + >>> df = spark.createDataFrame([("1997-02-28 10:30:00",)], ["t"]) + >>> df.select(to_date(df.t).alias("date")).collect() + [Row(date=datetime.date(1997, 2, 28))] + + >>> df = spark.createDataFrame([("1997-02-28 10:30:00",)], ["t"]) + >>> df.select(to_date(df.t, "yyyy-MM-dd HH:mm:ss").alias("date")).collect() + [Row(date=datetime.date(1997, 2, 28))] + """ # noqa: D205 + return _to_date_or_timestamp(col, _types.DateType(), format) + + +def to_timestamp(col: "ColumnOrName", format: Optional[str] = None) -> Column: + """Converts a :class:`~pyspark.sql.Column` into :class:`pyspark.sql.types.TimestampType` + using the optionally specified format. Specify formats according to `datetime pattern`_. + By default, it follows casting rules to :class:`pyspark.sql.types.TimestampType` if the format + is omitted. Equivalent to ``col.cast("timestamp")``. + + .. _datetime pattern: https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + .. versionadded:: 2.2.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + column values to convert. + format: str, optional + format to use to convert timestamp values. + + Returns: + ------- + :class:`~pyspark.sql.Column` + timestamp value as :class:`pyspark.sql.types.TimestampType` type. + + Examples: + -------- + >>> df = spark.createDataFrame([("1997-02-28 10:30:00",)], ["t"]) + >>> df.select(to_timestamp(df.t).alias("dt")).collect() + [Row(dt=datetime.datetime(1997, 2, 28, 10, 30))] + + >>> df = spark.createDataFrame([("1997-02-28 10:30:00",)], ["t"]) + >>> df.select(to_timestamp(df.t, "yyyy-MM-dd HH:mm:ss").alias("dt")).collect() + [Row(dt=datetime.datetime(1997, 2, 28, 10, 30))] + """ # noqa: D205 + return _to_date_or_timestamp(col, _types.TimestampNTZType(), format) + + +def to_timestamp_ltz( + timestamp: "ColumnOrName", + format: Optional["ColumnOrName"] = None, +) -> Column: + """Parses the `timestamp` with the `format` to a timestamp without time zone. + Returns null with invalid input. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + timestamp : :class:`~pyspark.sql.Column` or str + Input column or strings. + format : :class:`~pyspark.sql.Column` or str, optional + format to use to convert type `TimestampType` timestamp values. + + Examples: + -------- + >>> df = spark.createDataFrame([("2016-12-31",)], ["e"]) + >>> df.select(to_timestamp_ltz(df.e, lit("yyyy-MM-dd")).alias("r")).collect() + ... # doctest: +SKIP + [Row(r=datetime.datetime(2016, 12, 31, 0, 0))] + + >>> df = spark.createDataFrame([("2016-12-31",)], ["e"]) + >>> df.select(to_timestamp_ltz(df.e).alias("r")).collect() + ... # doctest: +SKIP + [Row(r=datetime.datetime(2016, 12, 31, 0, 0))] + """ # noqa: D205 + return _to_date_or_timestamp(timestamp, _types.TimestampNTZType(), format) + + +def to_timestamp_ntz( + timestamp: "ColumnOrName", + format: Optional["ColumnOrName"] = None, +) -> Column: + """Parses the `timestamp` with the `format` to a timestamp without time zone. + Returns null with invalid input. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + timestamp : :class:`~pyspark.sql.Column` or str + Input column or strings. + format : :class:`~pyspark.sql.Column` or str, optional + format to use to convert type `TimestampNTZType` timestamp values. + + Examples: + -------- + >>> df = spark.createDataFrame([("2016-04-08",)], ["e"]) + >>> df.select(to_timestamp_ntz(df.e, lit("yyyy-MM-dd")).alias("r")).collect() + ... # doctest: +SKIP + [Row(r=datetime.datetime(2016, 4, 8, 0, 0))] + + >>> df = spark.createDataFrame([("2016-04-08",)], ["e"]) + >>> df.select(to_timestamp_ntz(df.e).alias("r")).collect() + ... # doctest: +SKIP + [Row(r=datetime.datetime(2016, 4, 8, 0, 0))] + """ # noqa: D205 + return _to_date_or_timestamp(timestamp, _types.TimestampNTZType(), format) + + +def try_to_timestamp(col: "ColumnOrName", format: Optional["ColumnOrName"] = None) -> Column: + """Parses the `col` with the `format` to a timestamp. The function always + returns null on an invalid input with/without ANSI SQL mode enabled. The result data type is + consistent with the value of configuration `spark.sql.timestampType`. + .. versionadded:: 3.5.0 + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + column values to convert. + format: str, optional + format to use to convert timestamp values. + + Examples: + -------- + >>> df = spark.createDataFrame([("1997-02-28 10:30:00",)], ["t"]) + >>> df.select(try_to_timestamp(df.t).alias("dt")).collect() + [Row(dt=datetime.datetime(1997, 2, 28, 10, 30))] + >>> df.select(try_to_timestamp(df.t, lit("yyyy-MM-dd HH:mm:ss")).alias("dt")).collect() + [Row(dt=datetime.datetime(1997, 2, 28, 10, 30))] + """ # noqa: D205, D415 + if format is None: + format = lit(["%Y-%m-%d", "%Y-%m-%d %H:%M:%S"]) + + return _invoke_function_over_columns("try_strptime", col, format) + + +def substr(str: "ColumnOrName", pos: "ColumnOrName", len: Optional["ColumnOrName"] = None) -> Column: + """Returns the substring of `str` that starts at `pos` and is of length `len`, + or the slice of byte array that starts at `pos` and is of length `len`. + + .. versionadded:: 3.5.0 + + Parameters + ---------- + src : :class:`~pyspark.sql.Column` or str + A column of string. + pos : :class:`~pyspark.sql.Column` or str + A column of string, the substring of `str` that starts at `pos`. + len : :class:`~pyspark.sql.Column` or str, optional + A column of string, the substring of `str` is of length `len`. + + Examples: + -------- + >>> import pyspark.sql.functions as sf + >>> spark.createDataFrame( + ... [ + ... ( + ... "Spark SQL", + ... 5, + ... 1, + ... ) + ... ], + ... ["a", "b", "c"], + ... ).select(sf.substr("a", "b", "c")).show() + +---------------+ + |substr(a, b, c)| + +---------------+ + | k| + +---------------+ + + >>> import pyspark.sql.functions as sf + >>> spark.createDataFrame( + ... [ + ... ( + ... "Spark SQL", + ... 5, + ... 1, + ... ) + ... ], + ... ["a", "b", "c"], + ... ).select(sf.substr("a", "b")).show() + +------------------------+ + |substr(a, b, 2147483647)| + +------------------------+ + | k SQL| + +------------------------+ + """ # noqa: D205 + if len is not None: + return _invoke_function_over_columns("substring", str, pos, len) + else: + return _invoke_function_over_columns("substring", str, pos) + + +def _unix_diff(col: "ColumnOrName", part: str) -> Column: + return _invoke_function_over_columns( + "date_diff", lit(part), lit("1970-01-01 00:00:00+00:00").cast("timestamp"), col + ) + + +def unix_date(col: "ColumnOrName") -> Column: + """Returns the number of days since 1970-01-01. + + .. versionadded:: 3.5.0 + + Examples: + -------- + >>> spark.conf.set("spark.sql.session.timeZone", "America/Los_Angeles") + >>> df = spark.createDataFrame([("1970-01-02",)], ["t"]) + >>> df.select(unix_date(to_date(df.t)).alias("n")).collect() + [Row(n=1)] + >>> spark.conf.unset("spark.sql.session.timeZone") + """ + return _unix_diff(col, "days") + + +def unix_micros(col: "ColumnOrName") -> Column: + """Returns the number of microseconds since 1970-01-01 00:00:00 UTC. + + .. versionadded:: 3.5.0 + + Examples: + -------- + >>> spark.conf.set("spark.sql.session.timeZone", "America/Los_Angeles") + >>> df = spark.createDataFrame([("2015-07-22 10:00:00",)], ["t"]) + >>> df.select(unix_micros(to_timestamp(df.t)).alias("n")).collect() + [Row(n=1437584400000000)] + >>> spark.conf.unset("spark.sql.session.timeZone") + """ + return _unix_diff(col, "microseconds") + + +def unix_millis(col: "ColumnOrName") -> Column: + """Returns the number of milliseconds since 1970-01-01 00:00:00 UTC. + Truncates higher levels of precision. + + .. versionadded:: 3.5.0 + + Examples: + -------- + >>> spark.conf.set("spark.sql.session.timeZone", "America/Los_Angeles") + >>> df = spark.createDataFrame([("2015-07-22 10:00:00",)], ["t"]) + >>> df.select(unix_millis(to_timestamp(df.t)).alias("n")).collect() + [Row(n=1437584400000)] + >>> spark.conf.unset("spark.sql.session.timeZone") + """ # noqa: D205 + return _unix_diff(col, "milliseconds") + + +def unix_seconds(col: "ColumnOrName") -> Column: + """Returns the number of seconds since 1970-01-01 00:00:00 UTC. + Truncates higher levels of precision. + + .. versionadded:: 3.5.0 + + Examples: + -------- + >>> spark.conf.set("spark.sql.session.timeZone", "America/Los_Angeles") + >>> df = spark.createDataFrame([("2015-07-22 10:00:00",)], ["t"]) + >>> df.select(unix_seconds(to_timestamp(df.t)).alias("n")).collect() + [Row(n=1437584400)] + >>> spark.conf.unset("spark.sql.session.timeZone") + """ # noqa: D205 + return _unix_diff(col, "seconds") + + +def arrays_overlap(a1: "ColumnOrName", a2: "ColumnOrName") -> Column: + """Collection function: returns true if the arrays contain any common non-null element; if not, + returns null if both the arrays are non-empty and any of them contains a null element; returns + false otherwise. + + .. versionadded:: 2.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Returns: + ------- + :class:`~pyspark.sql.Column` + a column of Boolean type. + + Examples: + -------- + >>> df = spark.createDataFrame([(["a", "b"], ["b", "c"]), (["a"], ["b", "c"])], ["x", "y"]) + >>> df.select(arrays_overlap(df.x, df.y).alias("overlap")).collect() + [Row(overlap=True), Row(overlap=False)] + """ # noqa: D205 + a1 = _to_column_expr(a1) + a2 = _to_column_expr(a2) + + a1_has_null = _list_contains_null(a1) + a2_has_null = _list_contains_null(a2) + + return Column( + CaseExpression(FunctionExpression("list_has_any", a1, a2), ConstantExpression(True)).otherwise( + CaseExpression( + (FunctionExpression("len", a1) > 0) & (FunctionExpression("len", a2) > 0) & (a1_has_null | a2_has_null), + ConstantExpression(None), + ).otherwise(ConstantExpression(False)) + ) + ) + + +def _list_contains_null(c: ColumnExpression) -> Expression: + return FunctionExpression( + "list_contains", + FunctionExpression("list_transform", c, LambdaExpression("x", ColumnExpression("x").isnull())), + True, + ) + + +def arrays_zip(*cols: "ColumnOrName") -> Column: + """Collection function: Returns a merged array of structs in which the N-th struct contains all + N-th values of input arrays. If one of the arrays is shorter than others then + resulting struct type value will be a `null` for missing elements. + + .. versionadded:: 2.4.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + cols : :class:`~pyspark.sql.Column` or str + columns of arrays to be merged. + + Returns: + ------- + :class:`~pyspark.sql.Column` + merged array of entries. + + Examples: + -------- + >>> from pyspark.sql.functions import arrays_zip + >>> df = spark.createDataFrame( + ... [([1, 2, 3], [2, 4, 6], [3, 6])], ["vals1", "vals2", "vals3"] + ... ) + >>> df = df.select(arrays_zip(df.vals1, df.vals2, df.vals3).alias("zipped")) + >>> df.show(truncate=False) + +------------------------------------+ + |zipped | + +------------------------------------+ + |[{1, 2, 3}, {2, 4, 6}, {3, 6, NULL}]| + +------------------------------------+ + >>> df.printSchema() + root + |-- zipped: array (nullable = true) + | |-- element: struct (containsNull = false) + | | |-- vals1: long (nullable = true) + | | |-- vals2: long (nullable = true) + | | |-- vals3: long (nullable = true) + """ # noqa: D205 + return _invoke_function_over_columns("list_zip", *cols) + + +def substring(str: "ColumnOrName", pos: int, len: int) -> Column: + """Substring starts at `pos` and is of length `len` when str is String type or + returns the slice of byte array that starts at `pos` in byte and is of length `len` + when str is Binary type. + .. versionadded:: 1.5.0 + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Notes: + ----- + The position is not zero based, but 1 based index. + Parameters + ---------- + str : :class:`~pyspark.sql.Column` or str + target column to work on. + pos : int + starting position in str. + len : int + length of chars. + + Returns: + ------- + :class:`~pyspark.sql.Column` + substring of given value. + + Examples: + -------- + >>> df = spark.createDataFrame( + ... [("abcd",)], + ... [ + ... "s", + ... ], + ... ) + >>> df.select(substring(df.s, 1, 2).alias("s")).collect() + [Row(s='ab')] + """ # noqa: D205 + return _invoke_function( + "substring", + _to_column_expr(str), + ConstantExpression(pos), + ConstantExpression(len), + ) + + +def contains(left: "ColumnOrName", right: "ColumnOrName") -> Column: + """Returns a boolean. The value is True if right is found inside left. + Returns NULL if either input expression is NULL. Otherwise, returns False. + Both left or right must be of STRING or BINARY type. + .. versionadded:: 3.5.0 + Parameters + ---------- + left : :class:`~pyspark.sql.Column` or str + The input column or strings to check, may be NULL. + right : :class:`~pyspark.sql.Column` or str + The input column or strings to find, may be NULL. + + Examples: + -------- + >>> df = spark.createDataFrame([("Spark SQL", "Spark")], ["a", "b"]) + >>> df.select(contains(df.a, df.b).alias("r")).collect() + [Row(r=True)] + >>> df = spark.createDataFrame( + ... [ + ... ( + ... "414243", + ... "4243", + ... ) + ... ], + ... ["c", "d"], + ... ) + >>> df = df.select(to_binary("c").alias("c"), to_binary("d").alias("d")) + >>> df.printSchema() + root + |-- c: binary (nullable = true) + |-- d: binary (nullable = true) + >>> df.select(contains("c", "d"), contains("d", "c")).show() + +--------------+--------------+ + |contains(c, d)|contains(d, c)| + +--------------+--------------+ + | true| false| + +--------------+--------------+ + """ # noqa: D205, D415 + return _invoke_function_over_columns("contains", left, right) + + +def reverse(col: "ColumnOrName") -> Column: + """Collection function: returns a reversed string or an array with reverse order of elements. + .. versionadded:: 1.5.0 + .. versionchanged:: 3.4.0 + Supports Spark Connect. + Parameters + ---------- + col : :class:`~pyspark.sql.Column` or str + name of column or expression + + Returns: + ------- + :class:`~pyspark.sql.Column` + array of elements in reverse order. + + Examples: + -------- + >>> df = spark.createDataFrame([("Spark SQL",)], ["data"]) + >>> df.select(reverse(df.data).alias("s")).collect() + [Row(s='LQS krapS')] + >>> df = spark.createDataFrame([([2, 1, 3],), ([1],), ([],)], ["data"]) + >>> df.select(reverse(df.data).alias("r")).collect() + [Row(r=[3, 1, 2]), Row(r=[1]), Row(r=[])] + """ # noqa: D205, D415 + return _invoke_function("reverse", _to_column_expr(col)) + + +def concat(*cols: "ColumnOrName") -> Column: + """Concatenates multiple input columns together into a single column. + The function works with strings, numeric, binary and compatible array columns. + .. versionadded:: 1.5.0 + .. versionchanged:: 3.4.0 + Supports Spark Connect. + Parameters + ---------- + cols : :class:`~pyspark.sql.Column` or str + target column or columns to work on. + + Returns: + ------- + :class:`~pyspark.sql.Column` + concatenated values. Type of the `Column` depends on input columns' type. + + See Also: + -------- + :meth:`pyspark.sql.functions.array_join` : to concatenate string columns with delimiter + + Examples: + -------- + >>> df = spark.createDataFrame([("abcd", "123")], ["s", "d"]) + >>> df = df.select(concat(df.s, df.d).alias("s")) + >>> df.collect() + [Row(s='abcd123')] + >>> df + DataFrame[s: string] + >>> df = spark.createDataFrame( + ... [([1, 2], [3, 4], [5]), ([1, 2], None, [3])], ["a", "b", "c"] + ... ) + >>> df = df.select(concat(df.a, df.b, df.c).alias("arr")) + >>> df.collect() + [Row(arr=[1, 2, 3, 4, 5]), Row(arr=None)] + >>> df + DataFrame[arr: array] + """ # noqa: D205, D415 + return _invoke_function_over_columns("concat", *cols) + + +def instr(str: "ColumnOrName", substr: str) -> Column: + """Locate the position of the first occurrence of substr column in the given string. + Returns null if either of the arguments are null. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Notes: + ----- + The position is not zero based, but 1 based index. Returns 0 if substr + could not be found in str. + + Parameters + ---------- + str : :class:`~pyspark.sql.Column` or str + target column to work on. + substr : str + substring to look for. + + Returns: + ------- + :class:`~pyspark.sql.Column` + location of the first occurrence of the substring as integer. + + Examples: + -------- + >>> df = spark.createDataFrame( + ... [("abcd",)], + ... [ + ... "s", + ... ], + ... ) + >>> df.select(instr(df.s, "b").alias("s")).collect() + [Row(s=2)] + """ # noqa: D205 + return _invoke_function("instr", _to_column_expr(str), ConstantExpression(substr)) + + +def expr(str: str) -> Column: + """Parses the expression string into the column that it represents. + + .. versionadded:: 1.5.0 + + .. versionchanged:: 3.4.0 + Supports Spark Connect. + + Parameters + ---------- + str : str + expression defined in string. + + Returns: + ------- + :class:`~pyspark.sql.Column` + column representing the expression. + + Examples: + -------- + >>> df = spark.createDataFrame([["Alice"], ["Bob"]], ["name"]) + >>> df.select("name", expr("length(name)")).show() + +-----+------------+ + | name|length(name)| + +-----+------------+ + |Alice| 5| + | Bob| 3| + +-----+------------+ + """ + return Column(SQLExpression(str)) + + +def broadcast(df: "DataFrame") -> "DataFrame": + """The broadcast function in Spark is used to optimize joins by broadcasting a smaller + dataset to all the worker nodes. However, DuckDB operates on a single-node architecture . + As a result, the function simply returns the input DataFrame without applying any modifications + or optimizations, since broadcasting is not applicable in the DuckDB context. + """ # noqa: D205 + return df diff --git a/shared/package-files/1f/1fa084ce2f2eab2707fe2fc43a4361bda2004363632d3d985284e1c1999aebd8/torch_sym_min.py b/shared/package-files/1f/1fa084ce2f2eab2707fe2fc43a4361bda2004363632d3d985284e1c1999aebd8/torch_sym_min.py new file mode 100644 index 0000000000000000000000000000000000000000..b9f4dd8f8496ccfd6c81b7007a96d9a05e6ffce5 --- /dev/null +++ b/shared/package-files/1f/1fa084ce2f2eab2707fe2fc43a4361bda2004363632d3d985284e1c1999aebd8/torch_sym_min.py @@ -0,0 +1,17 @@ +import torch + +from torch._export.db.case import export_case, SupportLevel + + +@export_case( + example_inputs=(torch.ones(3, 2),), + tags={"torch.operator"}, + support_level=SupportLevel.NOT_SUPPORTED_YET, +) +class TorchSymMin(torch.nn.Module): + """ + torch.sym_min operator is not supported in export. + """ + + def forward(self, x): + return x.sum() + torch.sym_min(x.size(0), 100) diff --git a/shared/package-files/1f/1fa21179620eb7cb702f0ab7540ddc82038e41de7f10327ba38f215392b44403/__init__.py b/shared/package-files/1f/1fa21179620eb7cb702f0ab7540ddc82038e41de7f10327ba38f215392b44403/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b17d76e12794b8407063c84d5dbb55b3aac25c99 --- /dev/null +++ b/shared/package-files/1f/1fa21179620eb7cb702f0ab7540ddc82038e41de7f10327ba38f215392b44403/__init__.py @@ -0,0 +1 @@ +from . import mm, mm_common, mm_plus_mm, unpack_mixed_mm diff --git a/shared/package-files/1f/1fa391a6b22ddba5fb0431dfe0507f0b0754140b424700f1675f72c279ab0a0a/ja.msg b/shared/package-files/1f/1fa391a6b22ddba5fb0431dfe0507f0b0754140b424700f1675f72c279ab0a0a/ja.msg new file mode 100644 index 0000000000000000000000000000000000000000..cf70c2f326043e83efc1792226331764d271be6f --- /dev/null +++ b/shared/package-files/1f/1fa391a6b22ddba5fb0431dfe0507f0b0754140b424700f1675f72c279ab0a0a/ja.msg @@ -0,0 +1,44 @@ +# created by tools/loadICU.tcl -- do not edit +namespace eval ::tcl::clock { + ::msgcat::mcset ja DAYS_OF_WEEK_ABBREV [list \ + "\u65e5"\ + "\u6708"\ + "\u706b"\ + "\u6c34"\ + "\u6728"\ + "\u91d1"\ + "\u571f"] + ::msgcat::mcset ja DAYS_OF_WEEK_FULL [list \ + "\u65e5\u66dc\u65e5"\ + "\u6708\u66dc\u65e5"\ + "\u706b\u66dc\u65e5"\ + "\u6c34\u66dc\u65e5"\ + "\u6728\u66dc\u65e5"\ + "\u91d1\u66dc\u65e5"\ + "\u571f\u66dc\u65e5"] + ::msgcat::mcset ja MONTHS_FULL [list \ + "1\u6708"\ + "2\u6708"\ + "3\u6708"\ + "4\u6708"\ + "5\u6708"\ + "6\u6708"\ + "7\u6708"\ + "8\u6708"\ + "9\u6708"\ + "10\u6708"\ + "11\u6708"\ + "12\u6708"] + ::msgcat::mcset ja BCE "\u7d00\u5143\u524d" + ::msgcat::mcset ja CE "\u897f\u66a6" + ::msgcat::mcset ja AM "\u5348\u524d" + ::msgcat::mcset ja PM "\u5348\u5f8c" + ::msgcat::mcset ja DATE_FORMAT "%Y/%m/%d" + ::msgcat::mcset ja TIME_FORMAT "%k:%M:%S" + ::msgcat::mcset ja TIME_FORMAT_12 "%P %I:%M:%S" + ::msgcat::mcset ja DATE_TIME_FORMAT "%Y/%m/%d %k:%M:%S %z" + ::msgcat::mcset ja LOCALE_DATE_FORMAT "%EY\u5e74%m\u6708%d\u65e5" + ::msgcat::mcset ja LOCALE_TIME_FORMAT "%H\u6642%M\u5206%S\u79d2" + ::msgcat::mcset ja LOCALE_DATE_TIME_FORMAT "%EY\u5e74%m\u6708%d\u65e5 (%a) %H\u6642%M\u5206%S\u79d2 %z" + ::msgcat::mcset ja LOCALE_ERAS "{-9223372036854775808 \u897f\u66a6 0} {-3061011600 \u660e\u6cbb 1867} {-1812186000 \u5927\u6b63 1911} {-1357635600 \u662d\u548c 1925} {600220800 \u5e73\u6210 1988} {1556668800 \u4ee4\u548c 2018}" +} diff --git a/shared/package-files/1f/1fa4f3e97d4fa8f569eb01bfeceb231c4a93bd333d23749e6c5e7e59c4dd64e7/_exceptions.py b/shared/package-files/1f/1fa4f3e97d4fa8f569eb01bfeceb231c4a93bd333d23749e6c5e7e59c4dd64e7/_exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..5f50838d373154868ff7414775763a1c66853c65 --- /dev/null +++ b/shared/package-files/1f/1fa4f3e97d4fa8f569eb01bfeceb231c4a93bd333d23749e6c5e7e59c4dd64e7/_exceptions.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +import contextlib +import inspect +import os +import re +from typing import TYPE_CHECKING +import warnings + +if TYPE_CHECKING: + from collections.abc import Generator + from types import FrameType + + +@contextlib.contextmanager +def rewrite_exception(old_name: str, new_name: str) -> Generator[None, None, None]: + """ + Rewrite the message of an exception. + """ + try: + yield + except Exception as err: + if not err.args: + raise + msg = str(err.args[0]) + msg = msg.replace(old_name, new_name) + args: tuple[str, ...] = (msg,) + if len(err.args) > 1: + args = args + err.args[1:] + err.args = args + raise + + +def find_stack_level() -> int: + """ + Find the first place in the stack that is not inside pandas + (tests notwithstanding). + """ + + import pandas as pd + + pkg_dir = os.path.dirname(pd.__file__) + test_dir = os.path.join(pkg_dir, "tests") + + # https://stackoverflow.com/questions/17407119/python-inspect-stack-is-slow + frame: FrameType | None = inspect.currentframe() + try: + n = 0 + while frame: + filename = inspect.getfile(frame) + if filename.startswith(pkg_dir) and not filename.startswith(test_dir): + frame = frame.f_back + n += 1 + else: + break + finally: + # See note in + # https://docs.python.org/3/library/inspect.html#inspect.Traceback + del frame + return n + + +@contextlib.contextmanager +def rewrite_warning( + target_message: str, + target_category: type[Warning], + new_message: str, + new_category: type[Warning] | None = None, +) -> Generator[None, None, None]: + """ + Rewrite the message of a warning. + + Parameters + ---------- + target_message : str + Warning message to match. + target_category : Warning + Warning type to match. + new_message : str + New warning message to emit. + new_category : Warning or None, default None + New warning type to emit. When None, will be the same as target_category. + """ + if new_category is None: + new_category = target_category + with warnings.catch_warnings(record=True) as record: + yield + if len(record) > 0: + match = re.compile(target_message) + for warning in record: + if warning.category is target_category and re.search( + match, str(warning.message) + ): + category = new_category + message: Warning | str = new_message + else: + category, message = warning.category, warning.message + warnings.warn_explicit( + message=message, + category=category, + filename=warning.filename, + lineno=warning.lineno, + ) diff --git a/shared/package-files/1f/1fa66d1b494a8e9e1609ca1470dc5e70ba380b30ecd710ac5189b0237c9e4988/auth.pyi b/shared/package-files/1f/1fa66d1b494a8e9e1609ca1470dc5e70ba380b30ecd710ac5189b0237c9e4988/auth.pyi new file mode 100644 index 0000000000000000000000000000000000000000..f599550108722bb3cba75733b13e542863c75b85 --- /dev/null +++ b/shared/package-files/1f/1fa66d1b494a8e9e1609ca1470dc5e70ba380b30ecd710ac5189b0237c9e4988/auth.pyi @@ -0,0 +1,109 @@ +from typing import Any, Optional + +from boto.auth_handler import AuthHandler + +SIGV4_DETECT: Any + +class HmacKeys: + host: Any + def __init__(self, host, config, provider) -> None: ... + def update_provider(self, provider): ... + def algorithm(self): ... + def sign_string(self, string_to_sign): ... + +class AnonAuthHandler(AuthHandler, HmacKeys): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def add_auth(self, http_request, **kwargs): ... + +class HmacAuthV1Handler(AuthHandler, HmacKeys): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def update_provider(self, provider): ... + def add_auth(self, http_request, **kwargs): ... + +class HmacAuthV2Handler(AuthHandler, HmacKeys): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def update_provider(self, provider): ... + def add_auth(self, http_request, **kwargs): ... + +class HmacAuthV3Handler(AuthHandler, HmacKeys): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def add_auth(self, http_request, **kwargs): ... + +class HmacAuthV3HTTPHandler(AuthHandler, HmacKeys): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def headers_to_sign(self, http_request): ... + def canonical_headers(self, headers_to_sign): ... + def string_to_sign(self, http_request): ... + def add_auth(self, req, **kwargs): ... + +class HmacAuthV4Handler(AuthHandler, HmacKeys): + capability: Any + service_name: Any + region_name: Any + def __init__(self, host, config, provider, service_name: Optional[Any] = ..., region_name: Optional[Any] = ...) -> None: ... + def headers_to_sign(self, http_request): ... + def host_header(self, host, http_request): ... + def query_string(self, http_request): ... + def canonical_query_string(self, http_request): ... + def canonical_headers(self, headers_to_sign): ... + def signed_headers(self, headers_to_sign): ... + def canonical_uri(self, http_request): ... + def payload(self, http_request): ... + def canonical_request(self, http_request): ... + def scope(self, http_request): ... + def split_host_parts(self, host): ... + def determine_region_name(self, host): ... + def determine_service_name(self, host): ... + def credential_scope(self, http_request): ... + def string_to_sign(self, http_request, canonical_request): ... + def signature(self, http_request, string_to_sign): ... + def add_auth(self, req, **kwargs): ... + +class S3HmacAuthV4Handler(HmacAuthV4Handler, AuthHandler): + capability: Any + region_name: Any + def __init__(self, *args, **kwargs) -> None: ... + def clean_region_name(self, region_name): ... + def canonical_uri(self, http_request): ... + def canonical_query_string(self, http_request): ... + def host_header(self, host, http_request): ... + def headers_to_sign(self, http_request): ... + def determine_region_name(self, host): ... + def determine_service_name(self, host): ... + def mangle_path_and_params(self, req): ... + def payload(self, http_request): ... + def add_auth(self, req, **kwargs): ... + def presign(self, req, expires, iso_date: Optional[Any] = ...): ... + +class STSAnonHandler(AuthHandler): + capability: Any + def add_auth(self, http_request, **kwargs): ... + +class QuerySignatureHelper(HmacKeys): + def add_auth(self, http_request, **kwargs): ... + +class QuerySignatureV0AuthHandler(QuerySignatureHelper, AuthHandler): + SignatureVersion: int + capability: Any + +class QuerySignatureV1AuthHandler(QuerySignatureHelper, AuthHandler): + SignatureVersion: int + capability: Any + def __init__(self, *args, **kw) -> None: ... + +class QuerySignatureV2AuthHandler(QuerySignatureHelper, AuthHandler): + SignatureVersion: int + capability: Any + +class POSTPathQSV2AuthHandler(QuerySignatureV2AuthHandler, AuthHandler): + capability: Any + def add_auth(self, req, **kwargs): ... + +def get_auth_handler(host, config, provider, requested_capability: Optional[Any] = ...): ... +def detect_potential_sigv4(func): ... +def detect_potential_s3sigv4(func): ... diff --git a/shared/package-files/1f/1fa8f4a9ac27faa88c96669f64376302e38e418ed8bd0ee96e18855bbd6138c6/custom_obj.py b/shared/package-files/1f/1fa8f4a9ac27faa88c96669f64376302e38e418ed8bd0ee96e18855bbd6138c6/custom_obj.py new file mode 100644 index 0000000000000000000000000000000000000000..8e7f2080a4ee705a2621386c9b69a089d507544a --- /dev/null +++ b/shared/package-files/1f/1fa8f4a9ac27faa88c96669f64376302e38e418ed8bd0ee96e18855bbd6138c6/custom_obj.py @@ -0,0 +1,16 @@ +from dataclasses import dataclass + + +__all__ = ["ScriptObjectMeta"] + + +@dataclass +class ScriptObjectMeta: + """ + Metadata which is stored on nodes representing ScriptObjects. + """ + + # Key into constants table to retrieve the real ScriptObject. + constant_name: str + + class_fqn: str diff --git a/shared/package-files/1f/1fa958f0791424cd7baa4d620a902d6ceac9e20ec2b9a579ba60d12180826180/api.py b/shared/package-files/1f/1fa958f0791424cd7baa4d620a902d6ceac9e20ec2b9a579ba60d12180826180/api.py new file mode 100644 index 0000000000000000000000000000000000000000..fa92bf70788876216f6b6c139f6c4389bd42747a --- /dev/null +++ b/shared/package-files/1f/1fa958f0791424cd7baa4d620a902d6ceac9e20ec2b9a579ba60d12180826180/api.py @@ -0,0 +1,86 @@ +import abc +import torch.nn as nn + +from dataclasses import dataclass +from typing import Dict, List, Optional, Union + +from torch.distributed._shard.sharder import Sharder +from torch.distributed._shard.sharding_spec import ShardingSpec + +@dataclass +class ShardingPlan: + """ + Representation of a sharding plan, describes how to shard a module + across hosts. `plan` is used to shard module parameters according to the spec provided, + `output_plan` and `return_local_tensor` are optional, they are used to specify the output + layout of a module with a spec, and when to convert back to data parallel fashion. + + Args: + plan (Dict[str, Union[:class:`torch.distributed._shard.sharding_spec.ShardingSpec`, + :class:`torch.distributed._shard.sharder.Sharder`]): + a dict describes how to shard a module, there're currently two ways to shard a module: + 1. directly shard a module parameter by a `ShardingSpec`, keyed by the name of + a parameter to a `ShardingSpec`. + 2. shard a submodule by applying a `Sharder` on it, keyed by the name of a module + to a `Sharder` object. + output_plan (Dict[str, :class:`torch.distributed._shard.sharding_spec.ShardingSpec`), optional): + a dict specifies the layout of a module's output which produces a ShardedTensor, + keyed by the name of module to ShardingSpec("" in key means the root module). + Default: `None` + return_local_tensor (List[str], optional): a list of string, each element enables + a module's sharded output to be returned as a Tensor from its local shards to + ensure further processing in a data parallel fashion. ("" in list means the + root module). + Default: None + Example: + Suppose we want to shard a module with two linear layers and then run it with DDP, we also + want to convert the output of the second linear layer back to DDP, we can do it as follows: + + >>> # xdoctest: +REQUIRES(module:torch._C._distributed_c10d) + >>> class MyModule(nn.Module): + >>> def __init__(self): + >>> super().__init__() + >>> self.fc1 = nn.Linear() + >>> self.gelu = nn.GELU() + >>> self.fc2 = nn.Linear() + >>> self.relu = nn.Linear() + >>> + >>> def forward(self, input): + >>> return self.relu(self.fc2(self.gelu(self.fc1(input)))) + + + >>> # xdoctest: +SKIP("Undefined spec1, spec2) + >>> sharding_plan = ShardingPlan( + >>> plan={ + >>> "fc1.weight": spec1, + >>> "fc2.weight": spec2 + >>> }, + >>> output_plan={ + >>> "fc2": output_spec + >>> }, + >>> return_local_tensor=["fc2"] + >>> ) + """ + plan: Dict[str, Union[ShardingSpec, Sharder]] + output_plan: Optional[Dict[str, ShardingSpec]] = None + return_local_tensor: Optional[List[str]] = None + + +class ShardingPlanner(abc.ABC): + """ + Default ShardingPlanner interface, can be extended and + implement advanced sharding strategies. + """ + @abc.abstractmethod + def build_plan(self, module: nn.Module) -> ShardingPlan: + """ + Given a nn.Module, define how to shard the module across + ranks, return a ShardingPlan + Args: + module (:class:`torch.nn.Module`): + The module to apply sharding to. + Returns: + A :class:`torch.distributed._shard.sharding_plan.ShardingPlan` object that + represents how to shard the module. + """ + pass diff --git a/shared/package-files/1f/1fac4060b4aace86139930f6d2cfa7bec6846960a15db41670cb25970ab9cc94/handlers.pyi b/shared/package-files/1f/1fac4060b4aace86139930f6d2cfa7bec6846960a15db41670cb25970ab9cc94/handlers.pyi new file mode 100644 index 0000000000000000000000000000000000000000..11c6b9cc00311876dd4c195d1407cd2f45972112 --- /dev/null +++ b/shared/package-files/1f/1fac4060b4aace86139930f6d2cfa7bec6846960a15db41670cb25970ab9cc94/handlers.pyi @@ -0,0 +1,12 @@ +from typing import Any + +from django.core.handlers.wsgi import WSGIHandler, WSGIRequest + +class StaticFilesHandler(WSGIHandler): + handles_files: bool = ... + application: WSGIHandler = ... + base_url: Any = ... + def __init__(self, application: WSGIHandler) -> None: ... + def get_base_url(self) -> str: ... + def file_path(self, url: str) -> str: ... + def serve(self, request: WSGIRequest) -> Any: ... diff --git a/shared/package-files/1f/1fae001e808107b3092040801cdce48bc3624d53cd0f4872daf27e2aa8921767/CompositeViewCopyKernels.cpp b/shared/package-files/1f/1fae001e808107b3092040801cdce48bc3624d53cd0f4872daf27e2aa8921767/CompositeViewCopyKernels.cpp new file mode 100644 index 0000000000000000000000000000000000000000..47097d7aa4320674bec4bddbb5ac861309334f0c --- /dev/null +++ b/shared/package-files/1f/1fae001e808107b3092040801cdce48bc3624d53cd0f4872daf27e2aa8921767/CompositeViewCopyKernels.cpp @@ -0,0 +1,73 @@ +#define TORCH_ASSERT_ONLY_METHOD_OPERATORS +// ${generated_comment} + +#include +#include +#include + +#ifndef AT_PER_OPERATOR_HEADERS +#include +#else +#include +$ops_headers +#endif + +namespace at { +namespace native { + +// This file contains a number of kernels for aten functions that are fully code-generated. +// TODO: rename this file to something more generic. + +namespace { +at::Tensor clone_arg(const at::Tensor& t) { + return t.clone(); +} + +std::vector clone_arg(const at::TensorList& t_list) { + std::vector out(t_list.size()); + for (const auto& i : c10::irange(t_list.size())) { + out[i] = t_list[i].clone(); + } + return out; +} + +// duped with gen_resize_out_helper from structured kernels +void copy_arg(const at::Tensor& dst, const at::Tensor& src) { + TORCH_CHECK(src.dtype() == dst.dtype(), + "Expected out tensor to have dtype ", src.dtype(), ", but got ", dst.dtype(), " instead"); + TORCH_CHECK(src.device() == dst.device(), + "Expected out tensor to have device ", src.device(), ", but got ", dst.device(), " instead"); + dst.copy_(src); +} + +void copy_arg(const at::TensorList& dst, const at::TensorList& src) { + TORCH_INTERNAL_ASSERT(dst.size() == src.size()); + for (const auto& i : c10::irange(dst.size())) { + copy_arg(dst[i], src[i]); + } +} + +// TODO: this doesn't handle restriding empty tensors correctly; see +// gen_resize_out_helper for the correct algorithm + +void resize_out_helper(const at::Tensor& dst, const at::Tensor& src) { + at::native::resize_output(dst, src.sizes()); +} + +void resize_out_helper(const at::TensorList& dst, const at::TensorList& src) { + TORCH_INTERNAL_ASSERT(dst.size() == src.size()); + for (const auto& i : c10::irange(dst.size())) { + at::native::resize_output(dst[i], src[i].sizes()); + } +} +} + + +${CompositeViewCopyKernel_Definitions} + +${GeneratedCompositeFunctional_Definitions} + +${GeneratedCompositeOut_Definitions} + +} // namespace native +} // namespace at diff --git a/shared/package-files/1f/1fb196dad9b703572937eb11714d389db51fc2cae6f8e453029248fcfedf133f/hp300h b/shared/package-files/1f/1fb196dad9b703572937eb11714d389db51fc2cae6f8e453029248fcfedf133f/hp300h new file mode 100644 index 0000000000000000000000000000000000000000..a846ddfa9138bf0cf0271c81a2a443e64c3c6d90 Binary files /dev/null and b/shared/package-files/1f/1fb196dad9b703572937eb11714d389db51fc2cae6f8e453029248fcfedf133f/hp300h differ diff --git a/shared/package-files/1f/1fb2f26be2e656ece3f572e3e3d1af99e47da4f82d7815da9d82ee0784e35c1f/silu_compositeexplicitautogradnonfunctional_dispatch.h b/shared/package-files/1f/1fb2f26be2e656ece3f572e3e3d1af99e47da4f82d7815da9d82ee0784e35c1f/silu_compositeexplicitautogradnonfunctional_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..f5f19532df803e04b495f8f02703407e73fd9684 --- /dev/null +++ b/shared/package-files/1f/1fb2f26be2e656ece3f572e3e3d1af99e47da4f82d7815da9d82ee0784e35c1f/silu_compositeexplicitautogradnonfunctional_dispatch.h @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautogradnonfunctional { + +TORCH_API at::Tensor silu(const at::Tensor & self); +TORCH_API at::Tensor & silu_(at::Tensor & self); + +} // namespace compositeexplicitautogradnonfunctional +} // namespace at diff --git a/shared/package-files/1f/1fb43c16998f7a5849da8bce85f09186332d0a93728c55ebc8030b64e0eab1d7/termui.py b/shared/package-files/1f/1fb43c16998f7a5849da8bce85f09186332d0a93728c55ebc8030b64e0eab1d7/termui.py new file mode 100644 index 0000000000000000000000000000000000000000..db7a4b286174fdf26f3251631a2066eda2fa5bea --- /dev/null +++ b/shared/package-files/1f/1fb43c16998f7a5849da8bce85f09186332d0a93728c55ebc8030b64e0eab1d7/termui.py @@ -0,0 +1,784 @@ +import inspect +import io +import itertools +import sys +import typing as t +from gettext import gettext as _ + +from ._compat import isatty +from ._compat import strip_ansi +from .exceptions import Abort +from .exceptions import UsageError +from .globals import resolve_color_default +from .types import Choice +from .types import convert_type +from .types import ParamType +from .utils import echo +from .utils import LazyFile + +if t.TYPE_CHECKING: + from ._termui_impl import ProgressBar + +V = t.TypeVar("V") + +# The prompt functions to use. The doc tools currently override these +# functions to customize how they work. +visible_prompt_func: t.Callable[[str], str] = input + +_ansi_colors = { + "black": 30, + "red": 31, + "green": 32, + "yellow": 33, + "blue": 34, + "magenta": 35, + "cyan": 36, + "white": 37, + "reset": 39, + "bright_black": 90, + "bright_red": 91, + "bright_green": 92, + "bright_yellow": 93, + "bright_blue": 94, + "bright_magenta": 95, + "bright_cyan": 96, + "bright_white": 97, +} +_ansi_reset_all = "\033[0m" + + +def hidden_prompt_func(prompt: str) -> str: + import getpass + + return getpass.getpass(prompt) + + +def _build_prompt( + text: str, + suffix: str, + show_default: bool = False, + default: t.Optional[t.Any] = None, + show_choices: bool = True, + type: t.Optional[ParamType] = None, +) -> str: + prompt = text + if type is not None and show_choices and isinstance(type, Choice): + prompt += f" ({', '.join(map(str, type.choices))})" + if default is not None and show_default: + prompt = f"{prompt} [{_format_default(default)}]" + return f"{prompt}{suffix}" + + +def _format_default(default: t.Any) -> t.Any: + if isinstance(default, (io.IOBase, LazyFile)) and hasattr(default, "name"): + return default.name + + return default + + +def prompt( + text: str, + default: t.Optional[t.Any] = None, + hide_input: bool = False, + confirmation_prompt: t.Union[bool, str] = False, + type: t.Optional[t.Union[ParamType, t.Any]] = None, + value_proc: t.Optional[t.Callable[[str], t.Any]] = None, + prompt_suffix: str = ": ", + show_default: bool = True, + err: bool = False, + show_choices: bool = True, +) -> t.Any: + """Prompts a user for input. This is a convenience function that can + be used to prompt a user for input later. + + If the user aborts the input by sending an interrupt signal, this + function will catch it and raise a :exc:`Abort` exception. + + :param text: the text to show for the prompt. + :param default: the default value to use if no input happens. If this + is not given it will prompt until it's aborted. + :param hide_input: if this is set to true then the input value will + be hidden. + :param confirmation_prompt: Prompt a second time to confirm the + value. Can be set to a string instead of ``True`` to customize + the message. + :param type: the type to use to check the value against. + :param value_proc: if this parameter is provided it's a function that + is invoked instead of the type conversion to + convert a value. + :param prompt_suffix: a suffix that should be added to the prompt. + :param show_default: shows or hides the default value in the prompt. + :param err: if set to true the file defaults to ``stderr`` instead of + ``stdout``, the same as with echo. + :param show_choices: Show or hide choices if the passed type is a Choice. + For example if type is a Choice of either day or week, + show_choices is true and text is "Group by" then the + prompt will be "Group by (day, week): ". + + .. versionadded:: 8.0 + ``confirmation_prompt`` can be a custom string. + + .. versionadded:: 7.0 + Added the ``show_choices`` parameter. + + .. versionadded:: 6.0 + Added unicode support for cmd.exe on Windows. + + .. versionadded:: 4.0 + Added the `err` parameter. + + """ + + def prompt_func(text: str) -> str: + f = hidden_prompt_func if hide_input else visible_prompt_func + try: + # Write the prompt separately so that we get nice + # coloring through colorama on Windows + echo(text.rstrip(" "), nl=False, err=err) + # Echo a space to stdout to work around an issue where + # readline causes backspace to clear the whole line. + return f(" ") + except (KeyboardInterrupt, EOFError): + # getpass doesn't print a newline if the user aborts input with ^C. + # Allegedly this behavior is inherited from getpass(3). + # A doc bug has been filed at https://bugs.python.org/issue24711 + if hide_input: + echo(None, err=err) + raise Abort() from None + + if value_proc is None: + value_proc = convert_type(type, default) + + prompt = _build_prompt( + text, prompt_suffix, show_default, default, show_choices, type + ) + + if confirmation_prompt: + if confirmation_prompt is True: + confirmation_prompt = _("Repeat for confirmation") + + confirmation_prompt = _build_prompt(confirmation_prompt, prompt_suffix) + + while True: + while True: + value = prompt_func(prompt) + if value: + break + elif default is not None: + value = default + break + try: + result = value_proc(value) + except UsageError as e: + if hide_input: + echo(_("Error: The value you entered was invalid."), err=err) + else: + echo(_("Error: {e.message}").format(e=e), err=err) # noqa: B306 + continue + if not confirmation_prompt: + return result + while True: + value2 = prompt_func(confirmation_prompt) + is_empty = not value and not value2 + if value2 or is_empty: + break + if value == value2: + return result + echo(_("Error: The two entered values do not match."), err=err) + + +def confirm( + text: str, + default: t.Optional[bool] = False, + abort: bool = False, + prompt_suffix: str = ": ", + show_default: bool = True, + err: bool = False, +) -> bool: + """Prompts for confirmation (yes/no question). + + If the user aborts the input by sending a interrupt signal this + function will catch it and raise a :exc:`Abort` exception. + + :param text: the question to ask. + :param default: The default value to use when no input is given. If + ``None``, repeat until input is given. + :param abort: if this is set to `True` a negative answer aborts the + exception by raising :exc:`Abort`. + :param prompt_suffix: a suffix that should be added to the prompt. + :param show_default: shows or hides the default value in the prompt. + :param err: if set to true the file defaults to ``stderr`` instead of + ``stdout``, the same as with echo. + + .. versionchanged:: 8.0 + Repeat until input is given if ``default`` is ``None``. + + .. versionadded:: 4.0 + Added the ``err`` parameter. + """ + prompt = _build_prompt( + text, + prompt_suffix, + show_default, + "y/n" if default is None else ("Y/n" if default else "y/N"), + ) + + while True: + try: + # Write the prompt separately so that we get nice + # coloring through colorama on Windows + echo(prompt.rstrip(" "), nl=False, err=err) + # Echo a space to stdout to work around an issue where + # readline causes backspace to clear the whole line. + value = visible_prompt_func(" ").lower().strip() + except (KeyboardInterrupt, EOFError): + raise Abort() from None + if value in ("y", "yes"): + rv = True + elif value in ("n", "no"): + rv = False + elif default is not None and value == "": + rv = default + else: + echo(_("Error: invalid input"), err=err) + continue + break + if abort and not rv: + raise Abort() + return rv + + +def echo_via_pager( + text_or_generator: t.Union[t.Iterable[str], t.Callable[[], t.Iterable[str]], str], + color: t.Optional[bool] = None, +) -> None: + """This function takes a text and shows it via an environment specific + pager on stdout. + + .. versionchanged:: 3.0 + Added the `color` flag. + + :param text_or_generator: the text to page, or alternatively, a + generator emitting the text to page. + :param color: controls if the pager supports ANSI colors or not. The + default is autodetection. + """ + color = resolve_color_default(color) + + if inspect.isgeneratorfunction(text_or_generator): + i = t.cast(t.Callable[[], t.Iterable[str]], text_or_generator)() + elif isinstance(text_or_generator, str): + i = [text_or_generator] + else: + i = iter(t.cast(t.Iterable[str], text_or_generator)) + + # convert every element of i to a text type if necessary + text_generator = (el if isinstance(el, str) else str(el) for el in i) + + from ._termui_impl import pager + + return pager(itertools.chain(text_generator, "\n"), color) + + +def progressbar( + iterable: t.Optional[t.Iterable[V]] = None, + length: t.Optional[int] = None, + label: t.Optional[str] = None, + show_eta: bool = True, + show_percent: t.Optional[bool] = None, + show_pos: bool = False, + item_show_func: t.Optional[t.Callable[[t.Optional[V]], t.Optional[str]]] = None, + fill_char: str = "#", + empty_char: str = "-", + bar_template: str = "%(label)s [%(bar)s] %(info)s", + info_sep: str = " ", + width: int = 36, + file: t.Optional[t.TextIO] = None, + color: t.Optional[bool] = None, + update_min_steps: int = 1, +) -> "ProgressBar[V]": + """This function creates an iterable context manager that can be used + to iterate over something while showing a progress bar. It will + either iterate over the `iterable` or `length` items (that are counted + up). While iteration happens, this function will print a rendered + progress bar to the given `file` (defaults to stdout) and will attempt + to calculate remaining time and more. By default, this progress bar + will not be rendered if the file is not a terminal. + + The context manager creates the progress bar. When the context + manager is entered the progress bar is already created. With every + iteration over the progress bar, the iterable passed to the bar is + advanced and the bar is updated. When the context manager exits, + a newline is printed and the progress bar is finalized on screen. + + Note: The progress bar is currently designed for use cases where the + total progress can be expected to take at least several seconds. + Because of this, the ProgressBar class object won't display + progress that is considered too fast, and progress where the time + between steps is less than a second. + + No printing must happen or the progress bar will be unintentionally + destroyed. + + Example usage:: + + with progressbar(items) as bar: + for item in bar: + do_something_with(item) + + Alternatively, if no iterable is specified, one can manually update the + progress bar through the `update()` method instead of directly + iterating over the progress bar. The update method accepts the number + of steps to increment the bar with:: + + with progressbar(length=chunks.total_bytes) as bar: + for chunk in chunks: + process_chunk(chunk) + bar.update(chunks.bytes) + + The ``update()`` method also takes an optional value specifying the + ``current_item`` at the new position. This is useful when used + together with ``item_show_func`` to customize the output for each + manual step:: + + with click.progressbar( + length=total_size, + label='Unzipping archive', + item_show_func=lambda a: a.filename + ) as bar: + for archive in zip_file: + archive.extract() + bar.update(archive.size, archive) + + :param iterable: an iterable to iterate over. If not provided the length + is required. + :param length: the number of items to iterate over. By default the + progressbar will attempt to ask the iterator about its + length, which might or might not work. If an iterable is + also provided this parameter can be used to override the + length. If an iterable is not provided the progress bar + will iterate over a range of that length. + :param label: the label to show next to the progress bar. + :param show_eta: enables or disables the estimated time display. This is + automatically disabled if the length cannot be + determined. + :param show_percent: enables or disables the percentage display. The + default is `True` if the iterable has a length or + `False` if not. + :param show_pos: enables or disables the absolute position display. The + default is `False`. + :param item_show_func: A function called with the current item which + can return a string to show next to the progress bar. If the + function returns ``None`` nothing is shown. The current item can + be ``None``, such as when entering and exiting the bar. + :param fill_char: the character to use to show the filled part of the + progress bar. + :param empty_char: the character to use to show the non-filled part of + the progress bar. + :param bar_template: the format string to use as template for the bar. + The parameters in it are ``label`` for the label, + ``bar`` for the progress bar and ``info`` for the + info section. + :param info_sep: the separator between multiple info items (eta etc.) + :param width: the width of the progress bar in characters, 0 means full + terminal width + :param file: The file to write to. If this is not a terminal then + only the label is printed. + :param color: controls if the terminal supports ANSI colors or not. The + default is autodetection. This is only needed if ANSI + codes are included anywhere in the progress bar output + which is not the case by default. + :param update_min_steps: Render only when this many updates have + completed. This allows tuning for very fast iterators. + + .. versionchanged:: 8.0 + Output is shown even if execution time is less than 0.5 seconds. + + .. versionchanged:: 8.0 + ``item_show_func`` shows the current item, not the previous one. + + .. versionchanged:: 8.0 + Labels are echoed if the output is not a TTY. Reverts a change + in 7.0 that removed all output. + + .. versionadded:: 8.0 + Added the ``update_min_steps`` parameter. + + .. versionchanged:: 4.0 + Added the ``color`` parameter. Added the ``update`` method to + the object. + + .. versionadded:: 2.0 + """ + from ._termui_impl import ProgressBar + + color = resolve_color_default(color) + return ProgressBar( + iterable=iterable, + length=length, + show_eta=show_eta, + show_percent=show_percent, + show_pos=show_pos, + item_show_func=item_show_func, + fill_char=fill_char, + empty_char=empty_char, + bar_template=bar_template, + info_sep=info_sep, + file=file, + label=label, + width=width, + color=color, + update_min_steps=update_min_steps, + ) + + +def clear() -> None: + """Clears the terminal screen. This will have the effect of clearing + the whole visible space of the terminal and moving the cursor to the + top left. This does not do anything if not connected to a terminal. + + .. versionadded:: 2.0 + """ + if not isatty(sys.stdout): + return + + # ANSI escape \033[2J clears the screen, \033[1;1H moves the cursor + echo("\033[2J\033[1;1H", nl=False) + + +def _interpret_color( + color: t.Union[int, t.Tuple[int, int, int], str], offset: int = 0 +) -> str: + if isinstance(color, int): + return f"{38 + offset};5;{color:d}" + + if isinstance(color, (tuple, list)): + r, g, b = color + return f"{38 + offset};2;{r:d};{g:d};{b:d}" + + return str(_ansi_colors[color] + offset) + + +def style( + text: t.Any, + fg: t.Optional[t.Union[int, t.Tuple[int, int, int], str]] = None, + bg: t.Optional[t.Union[int, t.Tuple[int, int, int], str]] = None, + bold: t.Optional[bool] = None, + dim: t.Optional[bool] = None, + underline: t.Optional[bool] = None, + overline: t.Optional[bool] = None, + italic: t.Optional[bool] = None, + blink: t.Optional[bool] = None, + reverse: t.Optional[bool] = None, + strikethrough: t.Optional[bool] = None, + reset: bool = True, +) -> str: + """Styles a text with ANSI styles and returns the new string. By + default the styling is self contained which means that at the end + of the string a reset code is issued. This can be prevented by + passing ``reset=False``. + + Examples:: + + click.echo(click.style('Hello World!', fg='green')) + click.echo(click.style('ATTENTION!', blink=True)) + click.echo(click.style('Some things', reverse=True, fg='cyan')) + click.echo(click.style('More colors', fg=(255, 12, 128), bg=117)) + + Supported color names: + + * ``black`` (might be a gray) + * ``red`` + * ``green`` + * ``yellow`` (might be an orange) + * ``blue`` + * ``magenta`` + * ``cyan`` + * ``white`` (might be light gray) + * ``bright_black`` + * ``bright_red`` + * ``bright_green`` + * ``bright_yellow`` + * ``bright_blue`` + * ``bright_magenta`` + * ``bright_cyan`` + * ``bright_white`` + * ``reset`` (reset the color code only) + + If the terminal supports it, color may also be specified as: + + - An integer in the interval [0, 255]. The terminal must support + 8-bit/256-color mode. + - An RGB tuple of three integers in [0, 255]. The terminal must + support 24-bit/true-color mode. + + See https://en.wikipedia.org/wiki/ANSI_color and + https://gist.github.com/XVilka/8346728 for more information. + + :param text: the string to style with ansi codes. + :param fg: if provided this will become the foreground color. + :param bg: if provided this will become the background color. + :param bold: if provided this will enable or disable bold mode. + :param dim: if provided this will enable or disable dim mode. This is + badly supported. + :param underline: if provided this will enable or disable underline. + :param overline: if provided this will enable or disable overline. + :param italic: if provided this will enable or disable italic. + :param blink: if provided this will enable or disable blinking. + :param reverse: if provided this will enable or disable inverse + rendering (foreground becomes background and the + other way round). + :param strikethrough: if provided this will enable or disable + striking through text. + :param reset: by default a reset-all code is added at the end of the + string which means that styles do not carry over. This + can be disabled to compose styles. + + .. versionchanged:: 8.0 + A non-string ``message`` is converted to a string. + + .. versionchanged:: 8.0 + Added support for 256 and RGB color codes. + + .. versionchanged:: 8.0 + Added the ``strikethrough``, ``italic``, and ``overline`` + parameters. + + .. versionchanged:: 7.0 + Added support for bright colors. + + .. versionadded:: 2.0 + """ + if not isinstance(text, str): + text = str(text) + + bits = [] + + if fg: + try: + bits.append(f"\033[{_interpret_color(fg)}m") + except KeyError: + raise TypeError(f"Unknown color {fg!r}") from None + + if bg: + try: + bits.append(f"\033[{_interpret_color(bg, 10)}m") + except KeyError: + raise TypeError(f"Unknown color {bg!r}") from None + + if bold is not None: + bits.append(f"\033[{1 if bold else 22}m") + if dim is not None: + bits.append(f"\033[{2 if dim else 22}m") + if underline is not None: + bits.append(f"\033[{4 if underline else 24}m") + if overline is not None: + bits.append(f"\033[{53 if overline else 55}m") + if italic is not None: + bits.append(f"\033[{3 if italic else 23}m") + if blink is not None: + bits.append(f"\033[{5 if blink else 25}m") + if reverse is not None: + bits.append(f"\033[{7 if reverse else 27}m") + if strikethrough is not None: + bits.append(f"\033[{9 if strikethrough else 29}m") + bits.append(text) + if reset: + bits.append(_ansi_reset_all) + return "".join(bits) + + +def unstyle(text: str) -> str: + """Removes ANSI styling information from a string. Usually it's not + necessary to use this function as Click's echo function will + automatically remove styling if necessary. + + .. versionadded:: 2.0 + + :param text: the text to remove style information from. + """ + return strip_ansi(text) + + +def secho( + message: t.Optional[t.Any] = None, + file: t.Optional[t.IO[t.AnyStr]] = None, + nl: bool = True, + err: bool = False, + color: t.Optional[bool] = None, + **styles: t.Any, +) -> None: + """This function combines :func:`echo` and :func:`style` into one + call. As such the following two calls are the same:: + + click.secho('Hello World!', fg='green') + click.echo(click.style('Hello World!', fg='green')) + + All keyword arguments are forwarded to the underlying functions + depending on which one they go with. + + Non-string types will be converted to :class:`str`. However, + :class:`bytes` are passed directly to :meth:`echo` without applying + style. If you want to style bytes that represent text, call + :meth:`bytes.decode` first. + + .. versionchanged:: 8.0 + A non-string ``message`` is converted to a string. Bytes are + passed through without style applied. + + .. versionadded:: 2.0 + """ + if message is not None and not isinstance(message, (bytes, bytearray)): + message = style(message, **styles) + + return echo(message, file=file, nl=nl, err=err, color=color) + + +def edit( + text: t.Optional[t.AnyStr] = None, + editor: t.Optional[str] = None, + env: t.Optional[t.Mapping[str, str]] = None, + require_save: bool = True, + extension: str = ".txt", + filename: t.Optional[str] = None, +) -> t.Optional[t.AnyStr]: + r"""Edits the given text in the defined editor. If an editor is given + (should be the full path to the executable but the regular operating + system search path is used for finding the executable) it overrides + the detected editor. Optionally, some environment variables can be + used. If the editor is closed without changes, `None` is returned. In + case a file is edited directly the return value is always `None` and + `require_save` and `extension` are ignored. + + If the editor cannot be opened a :exc:`UsageError` is raised. + + Note for Windows: to simplify cross-platform usage, the newlines are + automatically converted from POSIX to Windows and vice versa. As such, + the message here will have ``\n`` as newline markers. + + :param text: the text to edit. + :param editor: optionally the editor to use. Defaults to automatic + detection. + :param env: environment variables to forward to the editor. + :param require_save: if this is true, then not saving in the editor + will make the return value become `None`. + :param extension: the extension to tell the editor about. This defaults + to `.txt` but changing this might change syntax + highlighting. + :param filename: if provided it will edit this file instead of the + provided text contents. It will not use a temporary + file as an indirection in that case. + """ + from ._termui_impl import Editor + + ed = Editor(editor=editor, env=env, require_save=require_save, extension=extension) + + if filename is None: + return ed.edit(text) + + ed.edit_file(filename) + return None + + +def launch(url: str, wait: bool = False, locate: bool = False) -> int: + """This function launches the given URL (or filename) in the default + viewer application for this file type. If this is an executable, it + might launch the executable in a new session. The return value is + the exit code of the launched application. Usually, ``0`` indicates + success. + + Examples:: + + click.launch('https://click.palletsprojects.com/') + click.launch('/my/downloaded/file', locate=True) + + .. versionadded:: 2.0 + + :param url: URL or filename of the thing to launch. + :param wait: Wait for the program to exit before returning. This + only works if the launched program blocks. In particular, + ``xdg-open`` on Linux does not block. + :param locate: if this is set to `True` then instead of launching the + application associated with the URL it will attempt to + launch a file manager with the file located. This + might have weird effects if the URL does not point to + the filesystem. + """ + from ._termui_impl import open_url + + return open_url(url, wait=wait, locate=locate) + + +# If this is provided, getchar() calls into this instead. This is used +# for unittesting purposes. +_getchar: t.Optional[t.Callable[[bool], str]] = None + + +def getchar(echo: bool = False) -> str: + """Fetches a single character from the terminal and returns it. This + will always return a unicode character and under certain rare + circumstances this might return more than one character. The + situations which more than one character is returned is when for + whatever reason multiple characters end up in the terminal buffer or + standard input was not actually a terminal. + + Note that this will always read from the terminal, even if something + is piped into the standard input. + + Note for Windows: in rare cases when typing non-ASCII characters, this + function might wait for a second character and then return both at once. + This is because certain Unicode characters look like special-key markers. + + .. versionadded:: 2.0 + + :param echo: if set to `True`, the character read will also show up on + the terminal. The default is to not show it. + """ + global _getchar + + if _getchar is None: + from ._termui_impl import getchar as f + + _getchar = f + + return _getchar(echo) + + +def raw_terminal() -> t.ContextManager[int]: + from ._termui_impl import raw_terminal as f + + return f() + + +def pause(info: t.Optional[str] = None, err: bool = False) -> None: + """This command stops execution and waits for the user to press any + key to continue. This is similar to the Windows batch "pause" + command. If the program is not run through a terminal, this command + will instead do nothing. + + .. versionadded:: 2.0 + + .. versionadded:: 4.0 + Added the `err` parameter. + + :param info: The message to print before pausing. Defaults to + ``"Press any key to continue..."``. + :param err: if set to message goes to ``stderr`` instead of + ``stdout``, the same as with echo. + """ + if not isatty(sys.stdin) or not isatty(sys.stdout): + return + + if info is None: + info = _("Press any key to continue...") + + try: + if info: + echo(info, nl=False, err=err) + try: + getchar() + except (KeyboardInterrupt, EOFError): + pass + finally: + if info: + echo(err=err) diff --git a/shared/package-files/1f/1fb551d86fbfb03fc2e519b83f78358910b515608f8389b43060f73f53cbcec9/Vevay b/shared/package-files/1f/1fb551d86fbfb03fc2e519b83f78358910b515608f8389b43060f73f53cbcec9/Vevay new file mode 100644 index 0000000000000000000000000000000000000000..315b4c45aef1f241d025900544133c085fe4f69d Binary files /dev/null and b/shared/package-files/1f/1fb551d86fbfb03fc2e519b83f78358910b515608f8389b43060f73f53cbcec9/Vevay differ diff --git a/shared/package-files/1f/1fba4a0584ef52589b88940470a99e024ca0490c280a4b88cae90d483995abe5/type_caster_pyobject_ptr.h b/shared/package-files/1f/1fba4a0584ef52589b88940470a99e024ca0490c280a4b88cae90d483995abe5/type_caster_pyobject_ptr.h new file mode 100644 index 0000000000000000000000000000000000000000..aa914f9e1563b3480481865f50adb7358f1a7134 --- /dev/null +++ b/shared/package-files/1f/1fba4a0584ef52589b88940470a99e024ca0490c280a4b88cae90d483995abe5/type_caster_pyobject_ptr.h @@ -0,0 +1,61 @@ +// Copyright (c) 2023 The pybind Community. + +#pragma once + +#include "detail/common.h" +#include "detail/descr.h" +#include "cast.h" +#include "pytypes.h" + +PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE) +PYBIND11_NAMESPACE_BEGIN(detail) + +template <> +class type_caster { +public: + static constexpr auto name = const_name("object"); // See discussion under PR #4601. + + // This overload is purely to guard against accidents. + template ::value, int> = 0> + static handle cast(T &&, return_value_policy, handle /*parent*/) { + static_assert(is_same_ignoring_cvref::value, + "Invalid C++ type T for to-Python conversion (type_caster)."); + return nullptr; // Unreachable. + } + + static handle cast(PyObject *src, return_value_policy policy, handle /*parent*/) { + if (src == nullptr) { + throw error_already_set(); + } + if (PyErr_Occurred()) { + raise_from(PyExc_SystemError, "src != nullptr but PyErr_Occurred()"); + throw error_already_set(); + } + if (policy == return_value_policy::take_ownership) { + return src; + } + if (policy == return_value_policy::reference + || policy == return_value_policy::automatic_reference) { + return handle(src).inc_ref(); + } + pybind11_fail("type_caster::cast(): unsupported return_value_policy: " + + std::to_string(static_cast(policy))); + } + + bool load(handle src, bool) { + value = reinterpret_borrow(src); + return true; + } + + template + using cast_op_type = PyObject *; + + explicit operator PyObject *() { return value.ptr(); } + +private: + object value; +}; + +PYBIND11_NAMESPACE_END(detail) +PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE) diff --git a/shared/package-files/1f/1fbaeb7ee6b30d7f698ba0ed063bd9c5ca37f884bcf493448b3f7295e18645eb/linalg_eig_cuda_dispatch.h b/shared/package-files/1f/1fbaeb7ee6b30d7f698ba0ed063bd9c5ca37f884bcf493448b3f7295e18645eb/linalg_eig_cuda_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..f5b1d64d56ef10a989a2b7ebfb99dfedb104ceb3 --- /dev/null +++ b/shared/package-files/1f/1fbaeb7ee6b30d7f698ba0ed063bd9c5ca37f884bcf493448b3f7295e18645eb/linalg_eig_cuda_dispatch.h @@ -0,0 +1,25 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API ::std::tuple linalg_eig(const at::Tensor & self); +TORCH_API ::std::tuple linalg_eig_out(at::Tensor & eigenvalues, at::Tensor & eigenvectors, const at::Tensor & self); +TORCH_API ::std::tuple linalg_eig_outf(const at::Tensor & self, at::Tensor & eigenvalues, at::Tensor & eigenvectors); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/1f/1fbd40f6927ce749af8dbad61eacbc8852360f183bd74d9846d0247dd0a8a228/B_A_S_E_.py b/shared/package-files/1f/1fbd40f6927ce749af8dbad61eacbc8852360f183bd74d9846d0247dd0a8a228/B_A_S_E_.py new file mode 100644 index 0000000000000000000000000000000000000000..0f4b1c3c5a7a3fe53de316dfd9b23fe5096eeb37 --- /dev/null +++ b/shared/package-files/1f/1fbd40f6927ce749af8dbad61eacbc8852360f183bd74d9846d0247dd0a8a228/B_A_S_E_.py @@ -0,0 +1,14 @@ +from .otBase import BaseTTXConverter + + +class table_B_A_S_E_(BaseTTXConverter): + """Baseline table + + The ``BASE`` table contains information needed to align glyphs in + different scripts, from different fonts, or at different sizes + within the same line of text. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/base + """ + + pass diff --git a/shared/package-files/1f/1fbeca624e27a1780aae3e4f585aba40134b1827055d625e968f2b6bcb87a6d9/_pdist_backward_compositeexplicitautograd_dispatch.h b/shared/package-files/1f/1fbeca624e27a1780aae3e4f585aba40134b1827055d625e968f2b6bcb87a6d9/_pdist_backward_compositeexplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..ad6d9cefa6eb230f2a0a508693e61fd9236add4d --- /dev/null +++ b/shared/package-files/1f/1fbeca624e27a1780aae3e4f585aba40134b1827055d625e968f2b6bcb87a6d9/_pdist_backward_compositeexplicitautograd_dispatch.h @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API at::Tensor & _pdist_backward_out(at::Tensor & out, const at::Tensor & grad, const at::Tensor & self, double p, const at::Tensor & pdist); +TORCH_API at::Tensor & _pdist_backward_outf(const at::Tensor & grad, const at::Tensor & self, double p, const at::Tensor & pdist, at::Tensor & out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/1f/1fc001f0b85dcbc5a1817ec5dce1a729fdacfa0f5ba75865fc5c6c0458f1fbfe/distributed.py b/shared/package-files/1f/1fc001f0b85dcbc5a1817ec5dce1a729fdacfa0f5ba75865fc5c6c0458f1fbfe/distributed.py new file mode 100644 index 0000000000000000000000000000000000000000..d8b9ac2fac986049809d62ffa8535981cb7ca0a7 --- /dev/null +++ b/shared/package-files/1f/1fc001f0b85dcbc5a1817ec5dce1a729fdacfa0f5ba75865fc5c6c0458f1fbfe/distributed.py @@ -0,0 +1,144 @@ +#!/usr/bin/env python3 + +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. +import datetime +import socket +from contextlib import closing + +import torch.distributed as dist +from torch.distributed.elastic.utils.logging import get_logger + + +log = get_logger(__name__) + +_ADDRESS_IN_USE = "Address already in use" +_SOCKET_TIMEOUT = "Socket Timeout" + +_MEMBER_CHECKIN = "_tcp_store/num_members" +_LAST_MEMBER_CHECKIN = "_tcp_store/last_member" + + +def create_c10d_store( + is_server: bool, + server_addr: str, + server_port: int = -1, + world_size: int = 1, + timeout: float = (60 * 10), # 10 min + wait_for_workers: bool = True, + retries=3, +): + if server_port == -1 and world_size > 1: + raise ValueError( + f"server_port must be specified when world_size > 1, got server_port={server_port}, world_size={world_size}" + ) + + if server_port != -1: + log.info("sever_port: %s, specified, ignoring retries", server_port) + + # only retry when server_port is NOT static + attempt = retries if server_port == -1 else 1 + while True: + if server_port != -1: + port = server_port + else: + port = get_free_port() + + log.info( + "Creating c10d store on %s:%s\n" + " world_size : %s\n" + " is_server : %s\n" + " timeout(sec): %s\n", + server_addr, port, world_size, is_server, timeout + ) + + try: + store = dist.TCPStore( + host_name=server_addr, + port=port, + world_size=world_size, + is_master=is_server, + timeout=datetime.timedelta(seconds=timeout), + wait_for_workers=wait_for_workers, + ) + # skips full rank check when we don't have to wait for all workers + if wait_for_workers: + _check_full_rank(store, world_size) + log.info("Successfully created c10d store") + return store + except RuntimeError as e: + # this is brittle, but the underlying exception type is not properly pybinded + # so we parse the error msg for now, interestingly this is how torch itself + # detects timeouts and port conflicts in their own unittests + # see - caffe2/torch/testing/_internal/common_utils.py + # TODO properly map the exceptions in pybind (c10d/init.cpp) + if str(e) == _ADDRESS_IN_USE: # this will only happen on the server + if attempt < retries: + log.warning( + "port: %s already in use, attempt: [%s/%s]", port, attempt, retries + ) + attempt += 1 + else: + raise RuntimeError( + f"on {server_addr}, port: {port} already in use" + ) from e + else: + raise + + +def _check_full_rank(store, world_size): + idx = store.add(_MEMBER_CHECKIN, 1) + if idx == world_size: + store.set(_LAST_MEMBER_CHECKIN, "") + + try: + store.get(_LAST_MEMBER_CHECKIN) + except RuntimeError as e: + if str(e) == _SOCKET_TIMEOUT: + raise TimeoutError( + f"timed out waiting for all {world_size} members to join" + ) from e + else: + raise + + +def get_free_port(): + sock = get_socket_with_port() + with closing(sock): + return sock.getsockname()[1] + + +def get_socket_with_port() -> socket.socket: + """ + Returns a free port on localhost that is "reserved" by binding a temporary + socket on it. Close the socket before passing the port to the entity + that requires it. Usage example + + :: + + sock = _get_socket_with_port() + with closing(sock): + port = sock.getsockname()[1] + sock.close() + # there is still a race-condition that some other process + # may grab this port before func() runs + func(port) + """ + + addrs = socket.getaddrinfo( + host="localhost", port=None, family=socket.AF_UNSPEC, type=socket.SOCK_STREAM + ) + for addr in addrs: + family, type, proto, _, _ = addr + s = socket.socket(family, type, proto) + try: + s.bind(("localhost", 0)) + s.listen(0) + return s + except OSError as e: + s.close() + log.info("Socket creation attempt failed.", exc_info=e) + raise RuntimeError("Failed to create a socket") diff --git a/shared/package-files/1f/1fc1cee88630909af2255f3b84a7a9d2bb72c785e65c01e1d480aea6b9266233/test_categorical.py b/shared/package-files/1f/1fc1cee88630909af2255f3b84a7a9d2bb72c785e65c01e1d480aea6b9266233/test_categorical.py new file mode 100644 index 0000000000000000000000000000000000000000..f4aff14a5ce32d19b0c4e6c9ef504ae141bdca67 --- /dev/null +++ b/shared/package-files/1f/1fc1cee88630909af2255f3b84a7a9d2bb72c785e65c01e1d480aea6b9266233/test_categorical.py @@ -0,0 +1,334 @@ +""" +Tests dtype specification during parsing +for all of the parsers defined in parsers.py +""" +from io import StringIO +import os + +import numpy as np +import pytest + +from pandas._libs import parsers as libparsers + +from pandas.core.dtypes.dtypes import CategoricalDtype + +import pandas as pd +from pandas import ( + Categorical, + DataFrame, + Timestamp, +) +import pandas._testing as tm + +pytestmark = pytest.mark.filterwarnings( + "ignore:Passing a BlockManager to DataFrame:DeprecationWarning" +) + +xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail") + + +@xfail_pyarrow # AssertionError: Attributes of DataFrame.iloc[:, 0] are different +@pytest.mark.parametrize( + "dtype", + [ + "category", + CategoricalDtype(), + {"a": "category", "b": "category", "c": CategoricalDtype()}, + ], +) +def test_categorical_dtype(all_parsers, dtype): + # see gh-10153 + parser = all_parsers + data = """a,b,c +1,a,3.4 +1,a,3.4 +2,b,4.5""" + expected = DataFrame( + { + "a": Categorical(["1", "1", "2"]), + "b": Categorical(["a", "a", "b"]), + "c": Categorical(["3.4", "3.4", "4.5"]), + } + ) + actual = parser.read_csv(StringIO(data), dtype=dtype) + tm.assert_frame_equal(actual, expected) + + +@pytest.mark.parametrize("dtype", [{"b": "category"}, {1: "category"}]) +def test_categorical_dtype_single(all_parsers, dtype, request): + # see gh-10153 + parser = all_parsers + data = """a,b,c +1,a,3.4 +1,a,3.4 +2,b,4.5""" + expected = DataFrame( + {"a": [1, 1, 2], "b": Categorical(["a", "a", "b"]), "c": [3.4, 3.4, 4.5]} + ) + if parser.engine == "pyarrow": + mark = pytest.mark.xfail( + strict=False, + reason="Flaky test sometimes gives object dtype instead of Categorical", + ) + request.applymarker(mark) + + actual = parser.read_csv(StringIO(data), dtype=dtype) + tm.assert_frame_equal(actual, expected) + + +@xfail_pyarrow # AssertionError: Attributes of DataFrame.iloc[:, 0] are different +def test_categorical_dtype_unsorted(all_parsers): + # see gh-10153 + parser = all_parsers + data = """a,b,c +1,b,3.4 +1,b,3.4 +2,a,4.5""" + expected = DataFrame( + { + "a": Categorical(["1", "1", "2"]), + "b": Categorical(["b", "b", "a"]), + "c": Categorical(["3.4", "3.4", "4.5"]), + } + ) + actual = parser.read_csv(StringIO(data), dtype="category") + tm.assert_frame_equal(actual, expected) + + +@xfail_pyarrow # AssertionError: Attributes of DataFrame.iloc[:, 0] are different +def test_categorical_dtype_missing(all_parsers): + # see gh-10153 + parser = all_parsers + data = """a,b,c +1,b,3.4 +1,nan,3.4 +2,a,4.5""" + expected = DataFrame( + { + "a": Categorical(["1", "1", "2"]), + "b": Categorical(["b", np.nan, "a"]), + "c": Categorical(["3.4", "3.4", "4.5"]), + } + ) + actual = parser.read_csv(StringIO(data), dtype="category") + tm.assert_frame_equal(actual, expected) + + +@xfail_pyarrow # AssertionError: Attributes of DataFrame.iloc[:, 0] are different +@pytest.mark.slow +def test_categorical_dtype_high_cardinality_numeric(all_parsers, monkeypatch): + # see gh-18186 + # was an issue with C parser, due to DEFAULT_BUFFER_HEURISTIC + parser = all_parsers + heuristic = 2**5 + data = np.sort([str(i) for i in range(heuristic + 1)]) + expected = DataFrame({"a": Categorical(data, ordered=True)}) + with monkeypatch.context() as m: + m.setattr(libparsers, "DEFAULT_BUFFER_HEURISTIC", heuristic) + actual = parser.read_csv(StringIO("a\n" + "\n".join(data)), dtype="category") + actual["a"] = actual["a"].cat.reorder_categories( + np.sort(actual.a.cat.categories), ordered=True + ) + tm.assert_frame_equal(actual, expected) + + +def test_categorical_dtype_utf16(all_parsers, csv_dir_path): + # see gh-10153 + pth = os.path.join(csv_dir_path, "utf16_ex.txt") + parser = all_parsers + encoding = "utf-16" + sep = "\t" + + expected = parser.read_csv(pth, sep=sep, encoding=encoding) + expected = expected.apply(Categorical) + + actual = parser.read_csv(pth, sep=sep, encoding=encoding, dtype="category") + tm.assert_frame_equal(actual, expected) + + +def test_categorical_dtype_chunksize_infer_categories(all_parsers): + # see gh-10153 + parser = all_parsers + data = """a,b +1,a +1,b +1,b +2,c""" + expecteds = [ + DataFrame({"a": [1, 1], "b": Categorical(["a", "b"])}), + DataFrame({"a": [1, 2], "b": Categorical(["b", "c"])}, index=[2, 3]), + ] + + if parser.engine == "pyarrow": + msg = "The 'chunksize' option is not supported with the 'pyarrow' engine" + with pytest.raises(ValueError, match=msg): + parser.read_csv(StringIO(data), dtype={"b": "category"}, chunksize=2) + return + + with parser.read_csv( + StringIO(data), dtype={"b": "category"}, chunksize=2 + ) as actuals: + for actual, expected in zip(actuals, expecteds): + tm.assert_frame_equal(actual, expected) + + +def test_categorical_dtype_chunksize_explicit_categories(all_parsers): + # see gh-10153 + parser = all_parsers + data = """a,b +1,a +1,b +1,b +2,c""" + cats = ["a", "b", "c"] + expecteds = [ + DataFrame({"a": [1, 1], "b": Categorical(["a", "b"], categories=cats)}), + DataFrame( + {"a": [1, 2], "b": Categorical(["b", "c"], categories=cats)}, + index=[2, 3], + ), + ] + dtype = CategoricalDtype(cats) + + if parser.engine == "pyarrow": + msg = "The 'chunksize' option is not supported with the 'pyarrow' engine" + with pytest.raises(ValueError, match=msg): + parser.read_csv(StringIO(data), dtype={"b": dtype}, chunksize=2) + return + + with parser.read_csv(StringIO(data), dtype={"b": dtype}, chunksize=2) as actuals: + for actual, expected in zip(actuals, expecteds): + tm.assert_frame_equal(actual, expected) + + +def test_categorical_dtype_latin1(all_parsers, csv_dir_path): + # see gh-10153 + pth = os.path.join(csv_dir_path, "unicode_series.csv") + parser = all_parsers + encoding = "latin-1" + + expected = parser.read_csv(pth, header=None, encoding=encoding) + expected[1] = Categorical(expected[1]) + + actual = parser.read_csv(pth, header=None, encoding=encoding, dtype={1: "category"}) + tm.assert_frame_equal(actual, expected) + + +@pytest.mark.parametrize("ordered", [False, True]) +@pytest.mark.parametrize( + "categories", + [["a", "b", "c"], ["a", "c", "b"], ["a", "b", "c", "d"], ["c", "b", "a"]], +) +def test_categorical_category_dtype(all_parsers, categories, ordered): + parser = all_parsers + data = """a,b +1,a +1,b +1,b +2,c""" + expected = DataFrame( + { + "a": [1, 1, 1, 2], + "b": Categorical( + ["a", "b", "b", "c"], categories=categories, ordered=ordered + ), + } + ) + + dtype = {"b": CategoricalDtype(categories=categories, ordered=ordered)} + result = parser.read_csv(StringIO(data), dtype=dtype) + tm.assert_frame_equal(result, expected) + + +def test_categorical_category_dtype_unsorted(all_parsers): + parser = all_parsers + data = """a,b +1,a +1,b +1,b +2,c""" + dtype = CategoricalDtype(["c", "b", "a"]) + expected = DataFrame( + { + "a": [1, 1, 1, 2], + "b": Categorical(["a", "b", "b", "c"], categories=["c", "b", "a"]), + } + ) + + result = parser.read_csv(StringIO(data), dtype={"b": dtype}) + tm.assert_frame_equal(result, expected) + + +def test_categorical_coerces_numeric(all_parsers): + parser = all_parsers + dtype = {"b": CategoricalDtype([1, 2, 3])} + + data = "b\n1\n1\n2\n3" + expected = DataFrame({"b": Categorical([1, 1, 2, 3])}) + + result = parser.read_csv(StringIO(data), dtype=dtype) + tm.assert_frame_equal(result, expected) + + +def test_categorical_coerces_datetime(all_parsers): + parser = all_parsers + dti = pd.DatetimeIndex(["2017-01-01", "2018-01-01", "2019-01-01"], freq=None) + dtype = {"b": CategoricalDtype(dti)} + + data = "b\n2017-01-01\n2018-01-01\n2019-01-01" + expected = DataFrame({"b": Categorical(dtype["b"].categories)}) + + result = parser.read_csv(StringIO(data), dtype=dtype) + tm.assert_frame_equal(result, expected) + + +def test_categorical_coerces_timestamp(all_parsers): + parser = all_parsers + dtype = {"b": CategoricalDtype([Timestamp("2014")])} + + data = "b\n2014-01-01\n2014-01-01" + expected = DataFrame({"b": Categorical([Timestamp("2014")] * 2)}) + + result = parser.read_csv(StringIO(data), dtype=dtype) + tm.assert_frame_equal(result, expected) + + +def test_categorical_coerces_timedelta(all_parsers): + parser = all_parsers + dtype = {"b": CategoricalDtype(pd.to_timedelta(["1h", "2h", "3h"]))} + + data = "b\n1h\n2h\n3h" + expected = DataFrame({"b": Categorical(dtype["b"].categories)}) + + result = parser.read_csv(StringIO(data), dtype=dtype) + tm.assert_frame_equal(result, expected) + + +@pytest.mark.parametrize( + "data", + [ + "b\nTrue\nFalse\nNA\nFalse", + "b\ntrue\nfalse\nNA\nfalse", + "b\nTRUE\nFALSE\nNA\nFALSE", + "b\nTrue\nFalse\nNA\nFALSE", + ], +) +def test_categorical_dtype_coerces_boolean(all_parsers, data): + # see gh-20498 + parser = all_parsers + dtype = {"b": CategoricalDtype([False, True])} + expected = DataFrame({"b": Categorical([True, False, None, False])}) + + result = parser.read_csv(StringIO(data), dtype=dtype) + tm.assert_frame_equal(result, expected) + + +def test_categorical_unexpected_categories(all_parsers): + parser = all_parsers + dtype = {"b": CategoricalDtype(["a", "b", "d", "e"])} + + data = "b\nd\na\nc\nd" # Unexpected c + expected = DataFrame({"b": Categorical(list("dacd"), dtype=dtype["b"])}) + + result = parser.read_csv(StringIO(data), dtype=dtype) + tm.assert_frame_equal(result, expected) diff --git a/shared/package-files/1f/1fcc6b9c0194bbc0dffc74ad183db056923e70a3a1a84625104089f5ea773c73/polytools.py b/shared/package-files/1f/1fcc6b9c0194bbc0dffc74ad183db056923e70a3a1a84625104089f5ea773c73/polytools.py new file mode 100644 index 0000000000000000000000000000000000000000..7fa7cf0f0988b5a715371f3ecfd114b79357e3c2 --- /dev/null +++ b/shared/package-files/1f/1fcc6b9c0194bbc0dffc74ad183db056923e70a3a1a84625104089f5ea773c73/polytools.py @@ -0,0 +1,7425 @@ +"""User-friendly public interface to polynomial functions. """ + + +from functools import wraps, reduce +from operator import mul +from typing import Optional + +from sympy.core import ( + S, Expr, Add, Tuple +) +from sympy.core.basic import Basic +from sympy.core.decorators import _sympifyit +from sympy.core.exprtools import Factors, factor_nc, factor_terms +from sympy.core.evalf import ( + pure_complex, evalf, fastlog, _evalf_with_bounded_error, quad_to_mpmath) +from sympy.core.function import Derivative +from sympy.core.mul import Mul, _keep_coeff +from sympy.core.numbers import ilcm, I, Integer, equal_valued +from sympy.core.relational import Relational, Equality +from sympy.core.sorting import ordered +from sympy.core.symbol import Dummy, Symbol +from sympy.core.sympify import sympify, _sympify +from sympy.core.traversal import preorder_traversal, bottom_up +from sympy.logic.boolalg import BooleanAtom +from sympy.polys import polyoptions as options +from sympy.polys.constructor import construct_domain +from sympy.polys.domains import FF, QQ, ZZ +from sympy.polys.domains.domainelement import DomainElement +from sympy.polys.fglmtools import matrix_fglm +from sympy.polys.groebnertools import groebner as _groebner +from sympy.polys.monomials import Monomial +from sympy.polys.orderings import monomial_key +from sympy.polys.polyclasses import DMP, DMF, ANP +from sympy.polys.polyerrors import ( + OperationNotSupported, DomainError, + CoercionFailed, UnificationFailed, + GeneratorsNeeded, PolynomialError, + MultivariatePolynomialError, + ExactQuotientFailed, + PolificationFailed, + ComputationFailed, + GeneratorsError, +) +from sympy.polys.polyutils import ( + basic_from_dict, + _sort_gens, + _unify_gens, + _dict_reorder, + _dict_from_expr, + _parallel_dict_from_expr, +) +from sympy.polys.rationaltools import together +from sympy.polys.rootisolation import dup_isolate_real_roots_list +from sympy.utilities import group, public, filldedent +from sympy.utilities.exceptions import sympy_deprecation_warning +from sympy.utilities.iterables import iterable, sift + + +# Required to avoid errors +import sympy.polys + +import mpmath +from mpmath.libmp.libhyper import NoConvergence + + + +def _polifyit(func): + @wraps(func) + def wrapper(f, g): + g = _sympify(g) + if isinstance(g, Poly): + return func(f, g) + elif isinstance(g, Expr): + try: + g = f.from_expr(g, *f.gens) + except PolynomialError: + if g.is_Matrix: + return NotImplemented + expr_method = getattr(f.as_expr(), func.__name__) + result = expr_method(g) + if result is not NotImplemented: + sympy_deprecation_warning( + """ + Mixing Poly with non-polynomial expressions in binary + operations is deprecated. Either explicitly convert + the non-Poly operand to a Poly with as_poly() or + convert the Poly to an Expr with as_expr(). + """, + deprecated_since_version="1.6", + active_deprecations_target="deprecated-poly-nonpoly-binary-operations", + ) + return result + else: + return func(f, g) + else: + return NotImplemented + return wrapper + + + +@public +class Poly(Basic): + """ + Generic class for representing and operating on polynomial expressions. + + See :ref:`polys-docs` for general documentation. + + Poly is a subclass of Basic rather than Expr but instances can be + converted to Expr with the :py:meth:`~.Poly.as_expr` method. + + .. deprecated:: 1.6 + + Combining Poly with non-Poly objects in binary operations is + deprecated. Explicitly convert both objects to either Poly or Expr + first. See :ref:`deprecated-poly-nonpoly-binary-operations`. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + Create a univariate polynomial: + + >>> Poly(x*(x**2 + x - 1)**2) + Poly(x**5 + 2*x**4 - x**3 - 2*x**2 + x, x, domain='ZZ') + + Create a univariate polynomial with specific domain: + + >>> from sympy import sqrt + >>> Poly(x**2 + 2*x + sqrt(3), domain='R') + Poly(1.0*x**2 + 2.0*x + 1.73205080756888, x, domain='RR') + + Create a multivariate polynomial: + + >>> Poly(y*x**2 + x*y + 1) + Poly(x**2*y + x*y + 1, x, y, domain='ZZ') + + Create a univariate polynomial, where y is a constant: + + >>> Poly(y*x**2 + x*y + 1,x) + Poly(y*x**2 + y*x + 1, x, domain='ZZ[y]') + + You can evaluate the above polynomial as a function of y: + + >>> Poly(y*x**2 + x*y + 1,x).eval(2) + 6*y + 1 + + See Also + ======== + + sympy.core.expr.Expr + + """ + + __slots__ = ('rep', 'gens') + + is_commutative = True + is_Poly = True + _op_priority = 10.001 + + def __new__(cls, rep, *gens, **args): + """Create a new polynomial instance out of something useful. """ + opt = options.build_options(gens, args) + + if 'order' in opt: + raise NotImplementedError("'order' keyword is not implemented yet") + + if isinstance(rep, (DMP, DMF, ANP, DomainElement)): + return cls._from_domain_element(rep, opt) + elif iterable(rep, exclude=str): + if isinstance(rep, dict): + return cls._from_dict(rep, opt) + else: + return cls._from_list(list(rep), opt) + else: + rep = sympify(rep) + + if rep.is_Poly: + return cls._from_poly(rep, opt) + else: + return cls._from_expr(rep, opt) + + # Poly does not pass its args to Basic.__new__ to be stored in _args so we + # have to emulate them here with an args property that derives from rep + # and gens which are instance attributes. This also means we need to + # define _hashable_content. The _hashable_content is rep and gens but args + # uses expr instead of rep (expr is the Basic version of rep). Passing + # expr in args means that Basic methods like subs should work. Using rep + # otherwise means that Poly can remain more efficient than Basic by + # avoiding creating a Basic instance just to be hashable. + + @classmethod + def new(cls, rep, *gens): + """Construct :class:`Poly` instance from raw representation. """ + if not isinstance(rep, DMP): + raise PolynomialError( + "invalid polynomial representation: %s" % rep) + elif rep.lev != len(gens) - 1: + raise PolynomialError("invalid arguments: %s, %s" % (rep, gens)) + + obj = Basic.__new__(cls) + obj.rep = rep + obj.gens = gens + + return obj + + @property + def expr(self): + return basic_from_dict(self.rep.to_sympy_dict(), *self.gens) + + @property + def args(self): + return (self.expr,) + self.gens + + def _hashable_content(self): + return (self.rep,) + self.gens + + @classmethod + def from_dict(cls, rep, *gens, **args): + """Construct a polynomial from a ``dict``. """ + opt = options.build_options(gens, args) + return cls._from_dict(rep, opt) + + @classmethod + def from_list(cls, rep, *gens, **args): + """Construct a polynomial from a ``list``. """ + opt = options.build_options(gens, args) + return cls._from_list(rep, opt) + + @classmethod + def from_poly(cls, rep, *gens, **args): + """Construct a polynomial from a polynomial. """ + opt = options.build_options(gens, args) + return cls._from_poly(rep, opt) + + @classmethod + def from_expr(cls, rep, *gens, **args): + """Construct a polynomial from an expression. """ + opt = options.build_options(gens, args) + return cls._from_expr(rep, opt) + + @classmethod + def _from_dict(cls, rep, opt): + """Construct a polynomial from a ``dict``. """ + gens = opt.gens + + if not gens: + raise GeneratorsNeeded( + "Cannot initialize from 'dict' without generators") + + level = len(gens) - 1 + domain = opt.domain + + if domain is None: + domain, rep = construct_domain(rep, opt=opt) + else: + for monom, coeff in rep.items(): + rep[monom] = domain.convert(coeff) + + return cls.new(DMP.from_dict(rep, level, domain), *gens) + + @classmethod + def _from_list(cls, rep, opt): + """Construct a polynomial from a ``list``. """ + gens = opt.gens + + if not gens: + raise GeneratorsNeeded( + "Cannot initialize from 'list' without generators") + elif len(gens) != 1: + raise MultivariatePolynomialError( + "'list' representation not supported") + + level = len(gens) - 1 + domain = opt.domain + + if domain is None: + domain, rep = construct_domain(rep, opt=opt) + else: + rep = list(map(domain.convert, rep)) + + return cls.new(DMP.from_list(rep, level, domain), *gens) + + @classmethod + def _from_poly(cls, rep, opt): + """Construct a polynomial from a polynomial. """ + if cls != rep.__class__: + rep = cls.new(rep.rep, *rep.gens) + + gens = opt.gens + field = opt.field + domain = opt.domain + + if gens and rep.gens != gens: + if set(rep.gens) != set(gens): + return cls._from_expr(rep.as_expr(), opt) + else: + rep = rep.reorder(*gens) + + if 'domain' in opt and domain: + rep = rep.set_domain(domain) + elif field is True: + rep = rep.to_field() + + return rep + + @classmethod + def _from_expr(cls, rep, opt): + """Construct a polynomial from an expression. """ + rep, opt = _dict_from_expr(rep, opt) + return cls._from_dict(rep, opt) + + @classmethod + def _from_domain_element(cls, rep, opt): + gens = opt.gens + domain = opt.domain + + level = len(gens) - 1 + rep = [domain.convert(rep)] + + return cls.new(DMP.from_list(rep, level, domain), *gens) + + def __hash__(self): + return super().__hash__() + + @property + def free_symbols(self): + """ + Free symbols of a polynomial expression. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y, z + + >>> Poly(x**2 + 1).free_symbols + {x} + >>> Poly(x**2 + y).free_symbols + {x, y} + >>> Poly(x**2 + y, x).free_symbols + {x, y} + >>> Poly(x**2 + y, x, z).free_symbols + {x, y} + + """ + symbols = set() + gens = self.gens + for i in range(len(gens)): + for monom in self.monoms(): + if monom[i]: + symbols |= gens[i].free_symbols + break + + return symbols | self.free_symbols_in_domain + + @property + def free_symbols_in_domain(self): + """ + Free symbols of the domain of ``self``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(x**2 + 1).free_symbols_in_domain + set() + >>> Poly(x**2 + y).free_symbols_in_domain + set() + >>> Poly(x**2 + y, x).free_symbols_in_domain + {y} + + """ + domain, symbols = self.rep.dom, set() + + if domain.is_Composite: + for gen in domain.symbols: + symbols |= gen.free_symbols + elif domain.is_EX: + for coeff in self.coeffs(): + symbols |= coeff.free_symbols + + return symbols + + @property + def gen(self): + """ + Return the principal generator. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 + 1, x).gen + x + + """ + return self.gens[0] + + @property + def domain(self): + """Get the ground domain of a :py:class:`~.Poly` + + Returns + ======= + + :py:class:`~.Domain`: + Ground domain of the :py:class:`~.Poly`. + + Examples + ======== + + >>> from sympy import Poly, Symbol + >>> x = Symbol('x') + >>> p = Poly(x**2 + x) + >>> p + Poly(x**2 + x, x, domain='ZZ') + >>> p.domain + ZZ + """ + return self.get_domain() + + @property + def zero(self): + """Return zero polynomial with ``self``'s properties. """ + return self.new(self.rep.zero(self.rep.lev, self.rep.dom), *self.gens) + + @property + def one(self): + """Return one polynomial with ``self``'s properties. """ + return self.new(self.rep.one(self.rep.lev, self.rep.dom), *self.gens) + + @property + def unit(self): + """Return unit polynomial with ``self``'s properties. """ + return self.new(self.rep.unit(self.rep.lev, self.rep.dom), *self.gens) + + def unify(f, g): + """ + Make ``f`` and ``g`` belong to the same domain. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> f, g = Poly(x/2 + 1), Poly(2*x + 1) + + >>> f + Poly(1/2*x + 1, x, domain='QQ') + >>> g + Poly(2*x + 1, x, domain='ZZ') + + >>> F, G = f.unify(g) + + >>> F + Poly(1/2*x + 1, x, domain='QQ') + >>> G + Poly(2*x + 1, x, domain='QQ') + + """ + _, per, F, G = f._unify(g) + return per(F), per(G) + + def _unify(f, g): + g = sympify(g) + + if not g.is_Poly: + try: + return f.rep.dom, f.per, f.rep, f.rep.per(f.rep.dom.from_sympy(g)) + except CoercionFailed: + raise UnificationFailed("Cannot unify %s with %s" % (f, g)) + + if isinstance(f.rep, DMP) and isinstance(g.rep, DMP): + gens = _unify_gens(f.gens, g.gens) + + dom, lev = f.rep.dom.unify(g.rep.dom, gens), len(gens) - 1 + + if f.gens != gens: + f_monoms, f_coeffs = _dict_reorder( + f.rep.to_dict(), f.gens, gens) + + if f.rep.dom != dom: + f_coeffs = [dom.convert(c, f.rep.dom) for c in f_coeffs] + + F = DMP(dict(list(zip(f_monoms, f_coeffs))), dom, lev) + else: + F = f.rep.convert(dom) + + if g.gens != gens: + g_monoms, g_coeffs = _dict_reorder( + g.rep.to_dict(), g.gens, gens) + + if g.rep.dom != dom: + g_coeffs = [dom.convert(c, g.rep.dom) for c in g_coeffs] + + G = DMP(dict(list(zip(g_monoms, g_coeffs))), dom, lev) + else: + G = g.rep.convert(dom) + else: + raise UnificationFailed("Cannot unify %s with %s" % (f, g)) + + cls = f.__class__ + + def per(rep, dom=dom, gens=gens, remove=None): + if remove is not None: + gens = gens[:remove] + gens[remove + 1:] + + if not gens: + return dom.to_sympy(rep) + + return cls.new(rep, *gens) + + return dom, per, F, G + + def per(f, rep, gens=None, remove=None): + """ + Create a Poly out of the given representation. + + Examples + ======== + + >>> from sympy import Poly, ZZ + >>> from sympy.abc import x, y + + >>> from sympy.polys.polyclasses import DMP + + >>> a = Poly(x**2 + 1) + + >>> a.per(DMP([ZZ(1), ZZ(1)], ZZ), gens=[y]) + Poly(y + 1, y, domain='ZZ') + + """ + if gens is None: + gens = f.gens + + if remove is not None: + gens = gens[:remove] + gens[remove + 1:] + + if not gens: + return f.rep.dom.to_sympy(rep) + + return f.__class__.new(rep, *gens) + + def set_domain(f, domain): + """Set the ground domain of ``f``. """ + opt = options.build_options(f.gens, {'domain': domain}) + return f.per(f.rep.convert(opt.domain)) + + def get_domain(f): + """Get the ground domain of ``f``. """ + return f.rep.dom + + def set_modulus(f, modulus): + """ + Set the modulus of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(5*x**2 + 2*x - 1, x).set_modulus(2) + Poly(x**2 + 1, x, modulus=2) + + """ + modulus = options.Modulus.preprocess(modulus) + return f.set_domain(FF(modulus)) + + def get_modulus(f): + """ + Get the modulus of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 + 1, modulus=2).get_modulus() + 2 + + """ + domain = f.get_domain() + + if domain.is_FiniteField: + return Integer(domain.characteristic()) + else: + raise PolynomialError("not a polynomial over a Galois field") + + def _eval_subs(f, old, new): + """Internal implementation of :func:`subs`. """ + if old in f.gens: + if new.is_number: + return f.eval(old, new) + else: + try: + return f.replace(old, new) + except PolynomialError: + pass + + return f.as_expr().subs(old, new) + + def exclude(f): + """ + Remove unnecessary generators from ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import a, b, c, d, x + + >>> Poly(a + x, a, b, c, d, x).exclude() + Poly(a + x, a, x, domain='ZZ') + + """ + J, new = f.rep.exclude() + gens = [gen for j, gen in enumerate(f.gens) if j not in J] + + return f.per(new, gens=gens) + + def replace(f, x, y=None, **_ignore): + # XXX this does not match Basic's signature + """ + Replace ``x`` with ``y`` in generators list. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(x**2 + 1, x).replace(x, y) + Poly(y**2 + 1, y, domain='ZZ') + + """ + if y is None: + if f.is_univariate: + x, y = f.gen, x + else: + raise PolynomialError( + "syntax supported only in univariate case") + + if x == y or x not in f.gens: + return f + + if x in f.gens and y not in f.gens: + dom = f.get_domain() + + if not dom.is_Composite or y not in dom.symbols: + gens = list(f.gens) + gens[gens.index(x)] = y + return f.per(f.rep, gens=gens) + + raise PolynomialError("Cannot replace %s with %s in %s" % (x, y, f)) + + def match(f, *args, **kwargs): + """Match expression from Poly. See Basic.match()""" + return f.as_expr().match(*args, **kwargs) + + def reorder(f, *gens, **args): + """ + Efficiently apply new order of generators. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(x**2 + x*y**2, x, y).reorder(y, x) + Poly(y**2*x + x**2, y, x, domain='ZZ') + + """ + opt = options.Options((), args) + + if not gens: + gens = _sort_gens(f.gens, opt=opt) + elif set(f.gens) != set(gens): + raise PolynomialError( + "generators list can differ only up to order of elements") + + rep = dict(list(zip(*_dict_reorder(f.rep.to_dict(), f.gens, gens)))) + + return f.per(DMP(rep, f.rep.dom, len(gens) - 1), gens=gens) + + def ltrim(f, gen): + """ + Remove dummy generators from ``f`` that are to the left of + specified ``gen`` in the generators as ordered. When ``gen`` + is an integer, it refers to the generator located at that + position within the tuple of generators of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y, z + + >>> Poly(y**2 + y*z**2, x, y, z).ltrim(y) + Poly(y**2 + y*z**2, y, z, domain='ZZ') + >>> Poly(z, x, y, z).ltrim(-1) + Poly(z, z, domain='ZZ') + + """ + rep = f.as_dict(native=True) + j = f._gen_to_level(gen) + + terms = {} + + for monom, coeff in rep.items(): + + if any(monom[:j]): + # some generator is used in the portion to be trimmed + raise PolynomialError("Cannot left trim %s" % f) + + terms[monom[j:]] = coeff + + gens = f.gens[j:] + + return f.new(DMP.from_dict(terms, len(gens) - 1, f.rep.dom), *gens) + + def has_only_gens(f, *gens): + """ + Return ``True`` if ``Poly(f, *gens)`` retains ground domain. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y, z + + >>> Poly(x*y + 1, x, y, z).has_only_gens(x, y) + True + >>> Poly(x*y + z, x, y, z).has_only_gens(x, y) + False + + """ + indices = set() + + for gen in gens: + try: + index = f.gens.index(gen) + except ValueError: + raise GeneratorsError( + "%s doesn't have %s as generator" % (f, gen)) + else: + indices.add(index) + + for monom in f.monoms(): + for i, elt in enumerate(monom): + if i not in indices and elt: + return False + + return True + + def to_ring(f): + """ + Make the ground domain a ring. + + Examples + ======== + + >>> from sympy import Poly, QQ + >>> from sympy.abc import x + + >>> Poly(x**2 + 1, domain=QQ).to_ring() + Poly(x**2 + 1, x, domain='ZZ') + + """ + if hasattr(f.rep, 'to_ring'): + result = f.rep.to_ring() + else: # pragma: no cover + raise OperationNotSupported(f, 'to_ring') + + return f.per(result) + + def to_field(f): + """ + Make the ground domain a field. + + Examples + ======== + + >>> from sympy import Poly, ZZ + >>> from sympy.abc import x + + >>> Poly(x**2 + 1, x, domain=ZZ).to_field() + Poly(x**2 + 1, x, domain='QQ') + + """ + if hasattr(f.rep, 'to_field'): + result = f.rep.to_field() + else: # pragma: no cover + raise OperationNotSupported(f, 'to_field') + + return f.per(result) + + def to_exact(f): + """ + Make the ground domain exact. + + Examples + ======== + + >>> from sympy import Poly, RR + >>> from sympy.abc import x + + >>> Poly(x**2 + 1.0, x, domain=RR).to_exact() + Poly(x**2 + 1, x, domain='QQ') + + """ + if hasattr(f.rep, 'to_exact'): + result = f.rep.to_exact() + else: # pragma: no cover + raise OperationNotSupported(f, 'to_exact') + + return f.per(result) + + def retract(f, field=None): + """ + Recalculate the ground domain of a polynomial. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> f = Poly(x**2 + 1, x, domain='QQ[y]') + >>> f + Poly(x**2 + 1, x, domain='QQ[y]') + + >>> f.retract() + Poly(x**2 + 1, x, domain='ZZ') + >>> f.retract(field=True) + Poly(x**2 + 1, x, domain='QQ') + + """ + dom, rep = construct_domain(f.as_dict(zero=True), + field=field, composite=f.domain.is_Composite or None) + return f.from_dict(rep, f.gens, domain=dom) + + def slice(f, x, m, n=None): + """Take a continuous subsequence of terms of ``f``. """ + if n is None: + j, m, n = 0, x, m + else: + j = f._gen_to_level(x) + + m, n = int(m), int(n) + + if hasattr(f.rep, 'slice'): + result = f.rep.slice(m, n, j) + else: # pragma: no cover + raise OperationNotSupported(f, 'slice') + + return f.per(result) + + def coeffs(f, order=None): + """ + Returns all non-zero coefficients from ``f`` in lex order. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**3 + 2*x + 3, x).coeffs() + [1, 2, 3] + + See Also + ======== + all_coeffs + coeff_monomial + nth + + """ + return [f.rep.dom.to_sympy(c) for c in f.rep.coeffs(order=order)] + + def monoms(f, order=None): + """ + Returns all non-zero monomials from ``f`` in lex order. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(x**2 + 2*x*y**2 + x*y + 3*y, x, y).monoms() + [(2, 0), (1, 2), (1, 1), (0, 1)] + + See Also + ======== + all_monoms + + """ + return f.rep.monoms(order=order) + + def terms(f, order=None): + """ + Returns all non-zero terms from ``f`` in lex order. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(x**2 + 2*x*y**2 + x*y + 3*y, x, y).terms() + [((2, 0), 1), ((1, 2), 2), ((1, 1), 1), ((0, 1), 3)] + + See Also + ======== + all_terms + + """ + return [(m, f.rep.dom.to_sympy(c)) for m, c in f.rep.terms(order=order)] + + def all_coeffs(f): + """ + Returns all coefficients from a univariate polynomial ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**3 + 2*x - 1, x).all_coeffs() + [1, 0, 2, -1] + + """ + return [f.rep.dom.to_sympy(c) for c in f.rep.all_coeffs()] + + def all_monoms(f): + """ + Returns all monomials from a univariate polynomial ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**3 + 2*x - 1, x).all_monoms() + [(3,), (2,), (1,), (0,)] + + See Also + ======== + all_terms + + """ + return f.rep.all_monoms() + + def all_terms(f): + """ + Returns all terms from a univariate polynomial ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**3 + 2*x - 1, x).all_terms() + [((3,), 1), ((2,), 0), ((1,), 2), ((0,), -1)] + + """ + return [(m, f.rep.dom.to_sympy(c)) for m, c in f.rep.all_terms()] + + def termwise(f, func, *gens, **args): + """ + Apply a function to all terms of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> def func(k, coeff): + ... k = k[0] + ... return coeff//10**(2-k) + + >>> Poly(x**2 + 20*x + 400).termwise(func) + Poly(x**2 + 2*x + 4, x, domain='ZZ') + + """ + terms = {} + + for monom, coeff in f.terms(): + result = func(monom, coeff) + + if isinstance(result, tuple): + monom, coeff = result + else: + coeff = result + + if coeff: + if monom not in terms: + terms[monom] = coeff + else: + raise PolynomialError( + "%s monomial was generated twice" % monom) + + return f.from_dict(terms, *(gens or f.gens), **args) + + def length(f): + """ + Returns the number of non-zero terms in ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 + 2*x - 1).length() + 3 + + """ + return len(f.as_dict()) + + def as_dict(f, native=False, zero=False): + """ + Switch to a ``dict`` representation. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(x**2 + 2*x*y**2 - y, x, y).as_dict() + {(0, 1): -1, (1, 2): 2, (2, 0): 1} + + """ + if native: + return f.rep.to_dict(zero=zero) + else: + return f.rep.to_sympy_dict(zero=zero) + + def as_list(f, native=False): + """Switch to a ``list`` representation. """ + if native: + return f.rep.to_list() + else: + return f.rep.to_sympy_list() + + def as_expr(f, *gens): + """ + Convert a Poly instance to an Expr instance. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> f = Poly(x**2 + 2*x*y**2 - y, x, y) + + >>> f.as_expr() + x**2 + 2*x*y**2 - y + >>> f.as_expr({x: 5}) + 10*y**2 - y + 25 + >>> f.as_expr(5, 6) + 379 + + """ + if not gens: + return f.expr + + if len(gens) == 1 and isinstance(gens[0], dict): + mapping = gens[0] + gens = list(f.gens) + + for gen, value in mapping.items(): + try: + index = gens.index(gen) + except ValueError: + raise GeneratorsError( + "%s doesn't have %s as generator" % (f, gen)) + else: + gens[index] = value + + return basic_from_dict(f.rep.to_sympy_dict(), *gens) + + def as_poly(self, *gens, **args): + """Converts ``self`` to a polynomial or returns ``None``. + + >>> from sympy import sin + >>> from sympy.abc import x, y + + >>> print((x**2 + x*y).as_poly()) + Poly(x**2 + x*y, x, y, domain='ZZ') + + >>> print((x**2 + x*y).as_poly(x, y)) + Poly(x**2 + x*y, x, y, domain='ZZ') + + >>> print((x**2 + sin(y)).as_poly(x, y)) + None + + """ + try: + poly = Poly(self, *gens, **args) + + if not poly.is_Poly: + return None + else: + return poly + except PolynomialError: + return None + + def lift(f): + """ + Convert algebraic coefficients to rationals. + + Examples + ======== + + >>> from sympy import Poly, I + >>> from sympy.abc import x + + >>> Poly(x**2 + I*x + 1, x, extension=I).lift() + Poly(x**4 + 3*x**2 + 1, x, domain='QQ') + + """ + if hasattr(f.rep, 'lift'): + result = f.rep.lift() + else: # pragma: no cover + raise OperationNotSupported(f, 'lift') + + return f.per(result) + + def deflate(f): + """ + Reduce degree of ``f`` by mapping ``x_i**m`` to ``y_i``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(x**6*y**2 + x**3 + 1, x, y).deflate() + ((3, 2), Poly(x**2*y + x + 1, x, y, domain='ZZ')) + + """ + if hasattr(f.rep, 'deflate'): + J, result = f.rep.deflate() + else: # pragma: no cover + raise OperationNotSupported(f, 'deflate') + + return J, f.per(result) + + def inject(f, front=False): + """ + Inject ground domain generators into ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> f = Poly(x**2*y + x*y**3 + x*y + 1, x) + + >>> f.inject() + Poly(x**2*y + x*y**3 + x*y + 1, x, y, domain='ZZ') + >>> f.inject(front=True) + Poly(y**3*x + y*x**2 + y*x + 1, y, x, domain='ZZ') + + """ + dom = f.rep.dom + + if dom.is_Numerical: + return f + elif not dom.is_Poly: + raise DomainError("Cannot inject generators over %s" % dom) + + if hasattr(f.rep, 'inject'): + result = f.rep.inject(front=front) + else: # pragma: no cover + raise OperationNotSupported(f, 'inject') + + if front: + gens = dom.symbols + f.gens + else: + gens = f.gens + dom.symbols + + return f.new(result, *gens) + + def eject(f, *gens): + """ + Eject selected generators into the ground domain. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> f = Poly(x**2*y + x*y**3 + x*y + 1, x, y) + + >>> f.eject(x) + Poly(x*y**3 + (x**2 + x)*y + 1, y, domain='ZZ[x]') + >>> f.eject(y) + Poly(y*x**2 + (y**3 + y)*x + 1, x, domain='ZZ[y]') + + """ + dom = f.rep.dom + + if not dom.is_Numerical: + raise DomainError("Cannot eject generators over %s" % dom) + + k = len(gens) + + if f.gens[:k] == gens: + _gens, front = f.gens[k:], True + elif f.gens[-k:] == gens: + _gens, front = f.gens[:-k], False + else: + raise NotImplementedError( + "can only eject front or back generators") + + dom = dom.inject(*gens) + + if hasattr(f.rep, 'eject'): + result = f.rep.eject(dom, front=front) + else: # pragma: no cover + raise OperationNotSupported(f, 'eject') + + return f.new(result, *_gens) + + def terms_gcd(f): + """ + Remove GCD of terms from the polynomial ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(x**6*y**2 + x**3*y, x, y).terms_gcd() + ((3, 1), Poly(x**3*y + 1, x, y, domain='ZZ')) + + """ + if hasattr(f.rep, 'terms_gcd'): + J, result = f.rep.terms_gcd() + else: # pragma: no cover + raise OperationNotSupported(f, 'terms_gcd') + + return J, f.per(result) + + def add_ground(f, coeff): + """ + Add an element of the ground domain to ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x + 1).add_ground(2) + Poly(x + 3, x, domain='ZZ') + + """ + if hasattr(f.rep, 'add_ground'): + result = f.rep.add_ground(coeff) + else: # pragma: no cover + raise OperationNotSupported(f, 'add_ground') + + return f.per(result) + + def sub_ground(f, coeff): + """ + Subtract an element of the ground domain from ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x + 1).sub_ground(2) + Poly(x - 1, x, domain='ZZ') + + """ + if hasattr(f.rep, 'sub_ground'): + result = f.rep.sub_ground(coeff) + else: # pragma: no cover + raise OperationNotSupported(f, 'sub_ground') + + return f.per(result) + + def mul_ground(f, coeff): + """ + Multiply ``f`` by a an element of the ground domain. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x + 1).mul_ground(2) + Poly(2*x + 2, x, domain='ZZ') + + """ + if hasattr(f.rep, 'mul_ground'): + result = f.rep.mul_ground(coeff) + else: # pragma: no cover + raise OperationNotSupported(f, 'mul_ground') + + return f.per(result) + + def quo_ground(f, coeff): + """ + Quotient of ``f`` by a an element of the ground domain. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(2*x + 4).quo_ground(2) + Poly(x + 2, x, domain='ZZ') + + >>> Poly(2*x + 3).quo_ground(2) + Poly(x + 1, x, domain='ZZ') + + """ + if hasattr(f.rep, 'quo_ground'): + result = f.rep.quo_ground(coeff) + else: # pragma: no cover + raise OperationNotSupported(f, 'quo_ground') + + return f.per(result) + + def exquo_ground(f, coeff): + """ + Exact quotient of ``f`` by a an element of the ground domain. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(2*x + 4).exquo_ground(2) + Poly(x + 2, x, domain='ZZ') + + >>> Poly(2*x + 3).exquo_ground(2) + Traceback (most recent call last): + ... + ExactQuotientFailed: 2 does not divide 3 in ZZ + + """ + if hasattr(f.rep, 'exquo_ground'): + result = f.rep.exquo_ground(coeff) + else: # pragma: no cover + raise OperationNotSupported(f, 'exquo_ground') + + return f.per(result) + + def abs(f): + """ + Make all coefficients in ``f`` positive. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 - 1, x).abs() + Poly(x**2 + 1, x, domain='ZZ') + + """ + if hasattr(f.rep, 'abs'): + result = f.rep.abs() + else: # pragma: no cover + raise OperationNotSupported(f, 'abs') + + return f.per(result) + + def neg(f): + """ + Negate all coefficients in ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 - 1, x).neg() + Poly(-x**2 + 1, x, domain='ZZ') + + >>> -Poly(x**2 - 1, x) + Poly(-x**2 + 1, x, domain='ZZ') + + """ + if hasattr(f.rep, 'neg'): + result = f.rep.neg() + else: # pragma: no cover + raise OperationNotSupported(f, 'neg') + + return f.per(result) + + def add(f, g): + """ + Add two polynomials ``f`` and ``g``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 + 1, x).add(Poly(x - 2, x)) + Poly(x**2 + x - 1, x, domain='ZZ') + + >>> Poly(x**2 + 1, x) + Poly(x - 2, x) + Poly(x**2 + x - 1, x, domain='ZZ') + + """ + g = sympify(g) + + if not g.is_Poly: + return f.add_ground(g) + + _, per, F, G = f._unify(g) + + if hasattr(f.rep, 'add'): + result = F.add(G) + else: # pragma: no cover + raise OperationNotSupported(f, 'add') + + return per(result) + + def sub(f, g): + """ + Subtract two polynomials ``f`` and ``g``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 + 1, x).sub(Poly(x - 2, x)) + Poly(x**2 - x + 3, x, domain='ZZ') + + >>> Poly(x**2 + 1, x) - Poly(x - 2, x) + Poly(x**2 - x + 3, x, domain='ZZ') + + """ + g = sympify(g) + + if not g.is_Poly: + return f.sub_ground(g) + + _, per, F, G = f._unify(g) + + if hasattr(f.rep, 'sub'): + result = F.sub(G) + else: # pragma: no cover + raise OperationNotSupported(f, 'sub') + + return per(result) + + def mul(f, g): + """ + Multiply two polynomials ``f`` and ``g``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 + 1, x).mul(Poly(x - 2, x)) + Poly(x**3 - 2*x**2 + x - 2, x, domain='ZZ') + + >>> Poly(x**2 + 1, x)*Poly(x - 2, x) + Poly(x**3 - 2*x**2 + x - 2, x, domain='ZZ') + + """ + g = sympify(g) + + if not g.is_Poly: + return f.mul_ground(g) + + _, per, F, G = f._unify(g) + + if hasattr(f.rep, 'mul'): + result = F.mul(G) + else: # pragma: no cover + raise OperationNotSupported(f, 'mul') + + return per(result) + + def sqr(f): + """ + Square a polynomial ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x - 2, x).sqr() + Poly(x**2 - 4*x + 4, x, domain='ZZ') + + >>> Poly(x - 2, x)**2 + Poly(x**2 - 4*x + 4, x, domain='ZZ') + + """ + if hasattr(f.rep, 'sqr'): + result = f.rep.sqr() + else: # pragma: no cover + raise OperationNotSupported(f, 'sqr') + + return f.per(result) + + def pow(f, n): + """ + Raise ``f`` to a non-negative power ``n``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x - 2, x).pow(3) + Poly(x**3 - 6*x**2 + 12*x - 8, x, domain='ZZ') + + >>> Poly(x - 2, x)**3 + Poly(x**3 - 6*x**2 + 12*x - 8, x, domain='ZZ') + + """ + n = int(n) + + if hasattr(f.rep, 'pow'): + result = f.rep.pow(n) + else: # pragma: no cover + raise OperationNotSupported(f, 'pow') + + return f.per(result) + + def pdiv(f, g): + """ + Polynomial pseudo-division of ``f`` by ``g``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 + 1, x).pdiv(Poly(2*x - 4, x)) + (Poly(2*x + 4, x, domain='ZZ'), Poly(20, x, domain='ZZ')) + + """ + _, per, F, G = f._unify(g) + + if hasattr(f.rep, 'pdiv'): + q, r = F.pdiv(G) + else: # pragma: no cover + raise OperationNotSupported(f, 'pdiv') + + return per(q), per(r) + + def prem(f, g): + """ + Polynomial pseudo-remainder of ``f`` by ``g``. + + Caveat: The function prem(f, g, x) can be safely used to compute + in Z[x] _only_ subresultant polynomial remainder sequences (prs's). + + To safely compute Euclidean and Sturmian prs's in Z[x] + employ anyone of the corresponding functions found in + the module sympy.polys.subresultants_qq_zz. The functions + in the module with suffix _pg compute prs's in Z[x] employing + rem(f, g, x), whereas the functions with suffix _amv + compute prs's in Z[x] employing rem_z(f, g, x). + + The function rem_z(f, g, x) differs from prem(f, g, x) in that + to compute the remainder polynomials in Z[x] it premultiplies + the divident times the absolute value of the leading coefficient + of the divisor raised to the power degree(f, x) - degree(g, x) + 1. + + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 + 1, x).prem(Poly(2*x - 4, x)) + Poly(20, x, domain='ZZ') + + """ + _, per, F, G = f._unify(g) + + if hasattr(f.rep, 'prem'): + result = F.prem(G) + else: # pragma: no cover + raise OperationNotSupported(f, 'prem') + + return per(result) + + def pquo(f, g): + """ + Polynomial pseudo-quotient of ``f`` by ``g``. + + See the Caveat note in the function prem(f, g). + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 + 1, x).pquo(Poly(2*x - 4, x)) + Poly(2*x + 4, x, domain='ZZ') + + >>> Poly(x**2 - 1, x).pquo(Poly(2*x - 2, x)) + Poly(2*x + 2, x, domain='ZZ') + + """ + _, per, F, G = f._unify(g) + + if hasattr(f.rep, 'pquo'): + result = F.pquo(G) + else: # pragma: no cover + raise OperationNotSupported(f, 'pquo') + + return per(result) + + def pexquo(f, g): + """ + Polynomial exact pseudo-quotient of ``f`` by ``g``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 - 1, x).pexquo(Poly(2*x - 2, x)) + Poly(2*x + 2, x, domain='ZZ') + + >>> Poly(x**2 + 1, x).pexquo(Poly(2*x - 4, x)) + Traceback (most recent call last): + ... + ExactQuotientFailed: 2*x - 4 does not divide x**2 + 1 + + """ + _, per, F, G = f._unify(g) + + if hasattr(f.rep, 'pexquo'): + try: + result = F.pexquo(G) + except ExactQuotientFailed as exc: + raise exc.new(f.as_expr(), g.as_expr()) + else: # pragma: no cover + raise OperationNotSupported(f, 'pexquo') + + return per(result) + + def div(f, g, auto=True): + """ + Polynomial division with remainder of ``f`` by ``g``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 + 1, x).div(Poly(2*x - 4, x)) + (Poly(1/2*x + 1, x, domain='QQ'), Poly(5, x, domain='QQ')) + + >>> Poly(x**2 + 1, x).div(Poly(2*x - 4, x), auto=False) + (Poly(0, x, domain='ZZ'), Poly(x**2 + 1, x, domain='ZZ')) + + """ + dom, per, F, G = f._unify(g) + retract = False + + if auto and dom.is_Ring and not dom.is_Field: + F, G = F.to_field(), G.to_field() + retract = True + + if hasattr(f.rep, 'div'): + q, r = F.div(G) + else: # pragma: no cover + raise OperationNotSupported(f, 'div') + + if retract: + try: + Q, R = q.to_ring(), r.to_ring() + except CoercionFailed: + pass + else: + q, r = Q, R + + return per(q), per(r) + + def rem(f, g, auto=True): + """ + Computes the polynomial remainder of ``f`` by ``g``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 + 1, x).rem(Poly(2*x - 4, x)) + Poly(5, x, domain='ZZ') + + >>> Poly(x**2 + 1, x).rem(Poly(2*x - 4, x), auto=False) + Poly(x**2 + 1, x, domain='ZZ') + + """ + dom, per, F, G = f._unify(g) + retract = False + + if auto and dom.is_Ring and not dom.is_Field: + F, G = F.to_field(), G.to_field() + retract = True + + if hasattr(f.rep, 'rem'): + r = F.rem(G) + else: # pragma: no cover + raise OperationNotSupported(f, 'rem') + + if retract: + try: + r = r.to_ring() + except CoercionFailed: + pass + + return per(r) + + def quo(f, g, auto=True): + """ + Computes polynomial quotient of ``f`` by ``g``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 + 1, x).quo(Poly(2*x - 4, x)) + Poly(1/2*x + 1, x, domain='QQ') + + >>> Poly(x**2 - 1, x).quo(Poly(x - 1, x)) + Poly(x + 1, x, domain='ZZ') + + """ + dom, per, F, G = f._unify(g) + retract = False + + if auto and dom.is_Ring and not dom.is_Field: + F, G = F.to_field(), G.to_field() + retract = True + + if hasattr(f.rep, 'quo'): + q = F.quo(G) + else: # pragma: no cover + raise OperationNotSupported(f, 'quo') + + if retract: + try: + q = q.to_ring() + except CoercionFailed: + pass + + return per(q) + + def exquo(f, g, auto=True): + """ + Computes polynomial exact quotient of ``f`` by ``g``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 - 1, x).exquo(Poly(x - 1, x)) + Poly(x + 1, x, domain='ZZ') + + >>> Poly(x**2 + 1, x).exquo(Poly(2*x - 4, x)) + Traceback (most recent call last): + ... + ExactQuotientFailed: 2*x - 4 does not divide x**2 + 1 + + """ + dom, per, F, G = f._unify(g) + retract = False + + if auto and dom.is_Ring and not dom.is_Field: + F, G = F.to_field(), G.to_field() + retract = True + + if hasattr(f.rep, 'exquo'): + try: + q = F.exquo(G) + except ExactQuotientFailed as exc: + raise exc.new(f.as_expr(), g.as_expr()) + else: # pragma: no cover + raise OperationNotSupported(f, 'exquo') + + if retract: + try: + q = q.to_ring() + except CoercionFailed: + pass + + return per(q) + + def _gen_to_level(f, gen): + """Returns level associated with the given generator. """ + if isinstance(gen, int): + length = len(f.gens) + + if -length <= gen < length: + if gen < 0: + return length + gen + else: + return gen + else: + raise PolynomialError("-%s <= gen < %s expected, got %s" % + (length, length, gen)) + else: + try: + return f.gens.index(sympify(gen)) + except ValueError: + raise PolynomialError( + "a valid generator expected, got %s" % gen) + + def degree(f, gen=0): + """ + Returns degree of ``f`` in ``x_j``. + + The degree of 0 is negative infinity. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(x**2 + y*x + 1, x, y).degree() + 2 + >>> Poly(x**2 + y*x + y, x, y).degree(y) + 1 + >>> Poly(0, x).degree() + -oo + + """ + j = f._gen_to_level(gen) + + if hasattr(f.rep, 'degree'): + return f.rep.degree(j) + else: # pragma: no cover + raise OperationNotSupported(f, 'degree') + + def degree_list(f): + """ + Returns a list of degrees of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(x**2 + y*x + 1, x, y).degree_list() + (2, 1) + + """ + if hasattr(f.rep, 'degree_list'): + return f.rep.degree_list() + else: # pragma: no cover + raise OperationNotSupported(f, 'degree_list') + + def total_degree(f): + """ + Returns the total degree of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(x**2 + y*x + 1, x, y).total_degree() + 2 + >>> Poly(x + y**5, x, y).total_degree() + 5 + + """ + if hasattr(f.rep, 'total_degree'): + return f.rep.total_degree() + else: # pragma: no cover + raise OperationNotSupported(f, 'total_degree') + + def homogenize(f, s): + """ + Returns the homogeneous polynomial of ``f``. + + A homogeneous polynomial is a polynomial whose all monomials with + non-zero coefficients have the same total degree. If you only + want to check if a polynomial is homogeneous, then use + :func:`Poly.is_homogeneous`. If you want not only to check if a + polynomial is homogeneous but also compute its homogeneous order, + then use :func:`Poly.homogeneous_order`. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y, z + + >>> f = Poly(x**5 + 2*x**2*y**2 + 9*x*y**3) + >>> f.homogenize(z) + Poly(x**5 + 2*x**2*y**2*z + 9*x*y**3*z, x, y, z, domain='ZZ') + + """ + if not isinstance(s, Symbol): + raise TypeError("``Symbol`` expected, got %s" % type(s)) + if s in f.gens: + i = f.gens.index(s) + gens = f.gens + else: + i = len(f.gens) + gens = f.gens + (s,) + if hasattr(f.rep, 'homogenize'): + return f.per(f.rep.homogenize(i), gens=gens) + raise OperationNotSupported(f, 'homogeneous_order') + + def homogeneous_order(f): + """ + Returns the homogeneous order of ``f``. + + A homogeneous polynomial is a polynomial whose all monomials with + non-zero coefficients have the same total degree. This degree is + the homogeneous order of ``f``. If you only want to check if a + polynomial is homogeneous, then use :func:`Poly.is_homogeneous`. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> f = Poly(x**5 + 2*x**3*y**2 + 9*x*y**4) + >>> f.homogeneous_order() + 5 + + """ + if hasattr(f.rep, 'homogeneous_order'): + return f.rep.homogeneous_order() + else: # pragma: no cover + raise OperationNotSupported(f, 'homogeneous_order') + + def LC(f, order=None): + """ + Returns the leading coefficient of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(4*x**3 + 2*x**2 + 3*x, x).LC() + 4 + + """ + if order is not None: + return f.coeffs(order)[0] + + if hasattr(f.rep, 'LC'): + result = f.rep.LC() + else: # pragma: no cover + raise OperationNotSupported(f, 'LC') + + return f.rep.dom.to_sympy(result) + + def TC(f): + """ + Returns the trailing coefficient of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**3 + 2*x**2 + 3*x, x).TC() + 0 + + """ + if hasattr(f.rep, 'TC'): + result = f.rep.TC() + else: # pragma: no cover + raise OperationNotSupported(f, 'TC') + + return f.rep.dom.to_sympy(result) + + def EC(f, order=None): + """ + Returns the last non-zero coefficient of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**3 + 2*x**2 + 3*x, x).EC() + 3 + + """ + if hasattr(f.rep, 'coeffs'): + return f.coeffs(order)[-1] + else: # pragma: no cover + raise OperationNotSupported(f, 'EC') + + def coeff_monomial(f, monom): + """ + Returns the coefficient of ``monom`` in ``f`` if there, else None. + + Examples + ======== + + >>> from sympy import Poly, exp + >>> from sympy.abc import x, y + + >>> p = Poly(24*x*y*exp(8) + 23*x, x, y) + + >>> p.coeff_monomial(x) + 23 + >>> p.coeff_monomial(y) + 0 + >>> p.coeff_monomial(x*y) + 24*exp(8) + + Note that ``Expr.coeff()`` behaves differently, collecting terms + if possible; the Poly must be converted to an Expr to use that + method, however: + + >>> p.as_expr().coeff(x) + 24*y*exp(8) + 23 + >>> p.as_expr().coeff(y) + 24*x*exp(8) + >>> p.as_expr().coeff(x*y) + 24*exp(8) + + See Also + ======== + nth: more efficient query using exponents of the monomial's generators + + """ + return f.nth(*Monomial(monom, f.gens).exponents) + + def nth(f, *N): + """ + Returns the ``n``-th coefficient of ``f`` where ``N`` are the + exponents of the generators in the term of interest. + + Examples + ======== + + >>> from sympy import Poly, sqrt + >>> from sympy.abc import x, y + + >>> Poly(x**3 + 2*x**2 + 3*x, x).nth(2) + 2 + >>> Poly(x**3 + 2*x*y**2 + y**2, x, y).nth(1, 2) + 2 + >>> Poly(4*sqrt(x)*y) + Poly(4*y*(sqrt(x)), y, sqrt(x), domain='ZZ') + >>> _.nth(1, 1) + 4 + + See Also + ======== + coeff_monomial + + """ + if hasattr(f.rep, 'nth'): + if len(N) != len(f.gens): + raise ValueError('exponent of each generator must be specified') + result = f.rep.nth(*list(map(int, N))) + else: # pragma: no cover + raise OperationNotSupported(f, 'nth') + + return f.rep.dom.to_sympy(result) + + def coeff(f, x, n=1, right=False): + # the semantics of coeff_monomial and Expr.coeff are different; + # if someone is working with a Poly, they should be aware of the + # differences and chose the method best suited for the query. + # Alternatively, a pure-polys method could be written here but + # at this time the ``right`` keyword would be ignored because Poly + # doesn't work with non-commutatives. + raise NotImplementedError( + 'Either convert to Expr with `as_expr` method ' + 'to use Expr\'s coeff method or else use the ' + '`coeff_monomial` method of Polys.') + + def LM(f, order=None): + """ + Returns the leading monomial of ``f``. + + The Leading monomial signifies the monomial having + the highest power of the principal generator in the + expression f. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(4*x**2 + 2*x*y**2 + x*y + 3*y, x, y).LM() + x**2*y**0 + + """ + return Monomial(f.monoms(order)[0], f.gens) + + def EM(f, order=None): + """ + Returns the last non-zero monomial of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(4*x**2 + 2*x*y**2 + x*y + 3*y, x, y).EM() + x**0*y**1 + + """ + return Monomial(f.monoms(order)[-1], f.gens) + + def LT(f, order=None): + """ + Returns the leading term of ``f``. + + The Leading term signifies the term having + the highest power of the principal generator in the + expression f along with its coefficient. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(4*x**2 + 2*x*y**2 + x*y + 3*y, x, y).LT() + (x**2*y**0, 4) + + """ + monom, coeff = f.terms(order)[0] + return Monomial(monom, f.gens), coeff + + def ET(f, order=None): + """ + Returns the last non-zero term of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(4*x**2 + 2*x*y**2 + x*y + 3*y, x, y).ET() + (x**0*y**1, 3) + + """ + monom, coeff = f.terms(order)[-1] + return Monomial(monom, f.gens), coeff + + def max_norm(f): + """ + Returns maximum norm of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(-x**2 + 2*x - 3, x).max_norm() + 3 + + """ + if hasattr(f.rep, 'max_norm'): + result = f.rep.max_norm() + else: # pragma: no cover + raise OperationNotSupported(f, 'max_norm') + + return f.rep.dom.to_sympy(result) + + def l1_norm(f): + """ + Returns l1 norm of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(-x**2 + 2*x - 3, x).l1_norm() + 6 + + """ + if hasattr(f.rep, 'l1_norm'): + result = f.rep.l1_norm() + else: # pragma: no cover + raise OperationNotSupported(f, 'l1_norm') + + return f.rep.dom.to_sympy(result) + + def clear_denoms(self, convert=False): + """ + Clear denominators, but keep the ground domain. + + Examples + ======== + + >>> from sympy import Poly, S, QQ + >>> from sympy.abc import x + + >>> f = Poly(x/2 + S(1)/3, x, domain=QQ) + + >>> f.clear_denoms() + (6, Poly(3*x + 2, x, domain='QQ')) + >>> f.clear_denoms(convert=True) + (6, Poly(3*x + 2, x, domain='ZZ')) + + """ + f = self + + if not f.rep.dom.is_Field: + return S.One, f + + dom = f.get_domain() + if dom.has_assoc_Ring: + dom = f.rep.dom.get_ring() + + if hasattr(f.rep, 'clear_denoms'): + coeff, result = f.rep.clear_denoms() + else: # pragma: no cover + raise OperationNotSupported(f, 'clear_denoms') + + coeff, f = dom.to_sympy(coeff), f.per(result) + + if not convert or not dom.has_assoc_Ring: + return coeff, f + else: + return coeff, f.to_ring() + + def rat_clear_denoms(self, g): + """ + Clear denominators in a rational function ``f/g``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> f = Poly(x**2/y + 1, x) + >>> g = Poly(x**3 + y, x) + + >>> p, q = f.rat_clear_denoms(g) + + >>> p + Poly(x**2 + y, x, domain='ZZ[y]') + >>> q + Poly(y*x**3 + y**2, x, domain='ZZ[y]') + + """ + f = self + + dom, per, f, g = f._unify(g) + + f = per(f) + g = per(g) + + if not (dom.is_Field and dom.has_assoc_Ring): + return f, g + + a, f = f.clear_denoms(convert=True) + b, g = g.clear_denoms(convert=True) + + f = f.mul_ground(b) + g = g.mul_ground(a) + + return f, g + + def integrate(self, *specs, **args): + """ + Computes indefinite integral of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(x**2 + 2*x + 1, x).integrate() + Poly(1/3*x**3 + x**2 + x, x, domain='QQ') + + >>> Poly(x*y**2 + x, x, y).integrate((0, 1), (1, 0)) + Poly(1/2*x**2*y**2 + 1/2*x**2, x, y, domain='QQ') + + """ + f = self + + if args.get('auto', True) and f.rep.dom.is_Ring: + f = f.to_field() + + if hasattr(f.rep, 'integrate'): + if not specs: + return f.per(f.rep.integrate(m=1)) + + rep = f.rep + + for spec in specs: + if isinstance(spec, tuple): + gen, m = spec + else: + gen, m = spec, 1 + + rep = rep.integrate(int(m), f._gen_to_level(gen)) + + return f.per(rep) + else: # pragma: no cover + raise OperationNotSupported(f, 'integrate') + + def diff(f, *specs, **kwargs): + """ + Computes partial derivative of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(x**2 + 2*x + 1, x).diff() + Poly(2*x + 2, x, domain='ZZ') + + >>> Poly(x*y**2 + x, x, y).diff((0, 0), (1, 1)) + Poly(2*x*y, x, y, domain='ZZ') + + """ + if not kwargs.get('evaluate', True): + return Derivative(f, *specs, **kwargs) + + if hasattr(f.rep, 'diff'): + if not specs: + return f.per(f.rep.diff(m=1)) + + rep = f.rep + + for spec in specs: + if isinstance(spec, tuple): + gen, m = spec + else: + gen, m = spec, 1 + + rep = rep.diff(int(m), f._gen_to_level(gen)) + + return f.per(rep) + else: # pragma: no cover + raise OperationNotSupported(f, 'diff') + + _eval_derivative = diff + + def eval(self, x, a=None, auto=True): + """ + Evaluate ``f`` at ``a`` in the given variable. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y, z + + >>> Poly(x**2 + 2*x + 3, x).eval(2) + 11 + + >>> Poly(2*x*y + 3*x + y + 2, x, y).eval(x, 2) + Poly(5*y + 8, y, domain='ZZ') + + >>> f = Poly(2*x*y + 3*x + y + 2*z, x, y, z) + + >>> f.eval({x: 2}) + Poly(5*y + 2*z + 6, y, z, domain='ZZ') + >>> f.eval({x: 2, y: 5}) + Poly(2*z + 31, z, domain='ZZ') + >>> f.eval({x: 2, y: 5, z: 7}) + 45 + + >>> f.eval((2, 5)) + Poly(2*z + 31, z, domain='ZZ') + >>> f(2, 5) + Poly(2*z + 31, z, domain='ZZ') + + """ + f = self + + if a is None: + if isinstance(x, dict): + mapping = x + + for gen, value in mapping.items(): + f = f.eval(gen, value) + + return f + elif isinstance(x, (tuple, list)): + values = x + + if len(values) > len(f.gens): + raise ValueError("too many values provided") + + for gen, value in zip(f.gens, values): + f = f.eval(gen, value) + + return f + else: + j, a = 0, x + else: + j = f._gen_to_level(x) + + if not hasattr(f.rep, 'eval'): # pragma: no cover + raise OperationNotSupported(f, 'eval') + + try: + result = f.rep.eval(a, j) + except CoercionFailed: + if not auto: + raise DomainError("Cannot evaluate at %s in %s" % (a, f.rep.dom)) + else: + a_domain, [a] = construct_domain([a]) + new_domain = f.get_domain().unify_with_symbols(a_domain, f.gens) + + f = f.set_domain(new_domain) + a = new_domain.convert(a, a_domain) + + result = f.rep.eval(a, j) + + return f.per(result, remove=j) + + def __call__(f, *values): + """ + Evaluate ``f`` at the give values. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y, z + + >>> f = Poly(2*x*y + 3*x + y + 2*z, x, y, z) + + >>> f(2) + Poly(5*y + 2*z + 6, y, z, domain='ZZ') + >>> f(2, 5) + Poly(2*z + 31, z, domain='ZZ') + >>> f(2, 5, 7) + 45 + + """ + return f.eval(values) + + def half_gcdex(f, g, auto=True): + """ + Half extended Euclidean algorithm of ``f`` and ``g``. + + Returns ``(s, h)`` such that ``h = gcd(f, g)`` and ``s*f = h (mod g)``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> f = x**4 - 2*x**3 - 6*x**2 + 12*x + 15 + >>> g = x**3 + x**2 - 4*x - 4 + + >>> Poly(f).half_gcdex(Poly(g)) + (Poly(-1/5*x + 3/5, x, domain='QQ'), Poly(x + 1, x, domain='QQ')) + + """ + dom, per, F, G = f._unify(g) + + if auto and dom.is_Ring: + F, G = F.to_field(), G.to_field() + + if hasattr(f.rep, 'half_gcdex'): + s, h = F.half_gcdex(G) + else: # pragma: no cover + raise OperationNotSupported(f, 'half_gcdex') + + return per(s), per(h) + + def gcdex(f, g, auto=True): + """ + Extended Euclidean algorithm of ``f`` and ``g``. + + Returns ``(s, t, h)`` such that ``h = gcd(f, g)`` and ``s*f + t*g = h``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> f = x**4 - 2*x**3 - 6*x**2 + 12*x + 15 + >>> g = x**3 + x**2 - 4*x - 4 + + >>> Poly(f).gcdex(Poly(g)) + (Poly(-1/5*x + 3/5, x, domain='QQ'), + Poly(1/5*x**2 - 6/5*x + 2, x, domain='QQ'), + Poly(x + 1, x, domain='QQ')) + + """ + dom, per, F, G = f._unify(g) + + if auto and dom.is_Ring: + F, G = F.to_field(), G.to_field() + + if hasattr(f.rep, 'gcdex'): + s, t, h = F.gcdex(G) + else: # pragma: no cover + raise OperationNotSupported(f, 'gcdex') + + return per(s), per(t), per(h) + + def invert(f, g, auto=True): + """ + Invert ``f`` modulo ``g`` when possible. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 - 1, x).invert(Poly(2*x - 1, x)) + Poly(-4/3, x, domain='QQ') + + >>> Poly(x**2 - 1, x).invert(Poly(x - 1, x)) + Traceback (most recent call last): + ... + NotInvertible: zero divisor + + """ + dom, per, F, G = f._unify(g) + + if auto and dom.is_Ring: + F, G = F.to_field(), G.to_field() + + if hasattr(f.rep, 'invert'): + result = F.invert(G) + else: # pragma: no cover + raise OperationNotSupported(f, 'invert') + + return per(result) + + def revert(f, n): + """ + Compute ``f**(-1)`` mod ``x**n``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(1, x).revert(2) + Poly(1, x, domain='ZZ') + + >>> Poly(1 + x, x).revert(1) + Poly(1, x, domain='ZZ') + + >>> Poly(x**2 - 2, x).revert(2) + Traceback (most recent call last): + ... + NotReversible: only units are reversible in a ring + + >>> Poly(1/x, x).revert(1) + Traceback (most recent call last): + ... + PolynomialError: 1/x contains an element of the generators set + + """ + if hasattr(f.rep, 'revert'): + result = f.rep.revert(int(n)) + else: # pragma: no cover + raise OperationNotSupported(f, 'revert') + + return f.per(result) + + def subresultants(f, g): + """ + Computes the subresultant PRS of ``f`` and ``g``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 + 1, x).subresultants(Poly(x**2 - 1, x)) + [Poly(x**2 + 1, x, domain='ZZ'), + Poly(x**2 - 1, x, domain='ZZ'), + Poly(-2, x, domain='ZZ')] + + """ + _, per, F, G = f._unify(g) + + if hasattr(f.rep, 'subresultants'): + result = F.subresultants(G) + else: # pragma: no cover + raise OperationNotSupported(f, 'subresultants') + + return list(map(per, result)) + + def resultant(f, g, includePRS=False): + """ + Computes the resultant of ``f`` and ``g`` via PRS. + + If includePRS=True, it includes the subresultant PRS in the result. + Because the PRS is used to calculate the resultant, this is more + efficient than calling :func:`subresultants` separately. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> f = Poly(x**2 + 1, x) + + >>> f.resultant(Poly(x**2 - 1, x)) + 4 + >>> f.resultant(Poly(x**2 - 1, x), includePRS=True) + (4, [Poly(x**2 + 1, x, domain='ZZ'), Poly(x**2 - 1, x, domain='ZZ'), + Poly(-2, x, domain='ZZ')]) + + """ + _, per, F, G = f._unify(g) + + if hasattr(f.rep, 'resultant'): + if includePRS: + result, R = F.resultant(G, includePRS=includePRS) + else: + result = F.resultant(G) + else: # pragma: no cover + raise OperationNotSupported(f, 'resultant') + + if includePRS: + return (per(result, remove=0), list(map(per, R))) + return per(result, remove=0) + + def discriminant(f): + """ + Computes the discriminant of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 + 2*x + 3, x).discriminant() + -8 + + """ + if hasattr(f.rep, 'discriminant'): + result = f.rep.discriminant() + else: # pragma: no cover + raise OperationNotSupported(f, 'discriminant') + + return f.per(result, remove=0) + + def dispersionset(f, g=None): + r"""Compute the *dispersion set* of two polynomials. + + For two polynomials `f(x)` and `g(x)` with `\deg f > 0` + and `\deg g > 0` the dispersion set `\operatorname{J}(f, g)` is defined as: + + .. math:: + \operatorname{J}(f, g) + & := \{a \in \mathbb{N}_0 | \gcd(f(x), g(x+a)) \neq 1\} \\ + & = \{a \in \mathbb{N}_0 | \deg \gcd(f(x), g(x+a)) \geq 1\} + + For a single polynomial one defines `\operatorname{J}(f) := \operatorname{J}(f, f)`. + + Examples + ======== + + >>> from sympy import poly + >>> from sympy.polys.dispersion import dispersion, dispersionset + >>> from sympy.abc import x + + Dispersion set and dispersion of a simple polynomial: + + >>> fp = poly((x - 3)*(x + 3), x) + >>> sorted(dispersionset(fp)) + [0, 6] + >>> dispersion(fp) + 6 + + Note that the definition of the dispersion is not symmetric: + + >>> fp = poly(x**4 - 3*x**2 + 1, x) + >>> gp = fp.shift(-3) + >>> sorted(dispersionset(fp, gp)) + [2, 3, 4] + >>> dispersion(fp, gp) + 4 + >>> sorted(dispersionset(gp, fp)) + [] + >>> dispersion(gp, fp) + -oo + + Computing the dispersion also works over field extensions: + + >>> from sympy import sqrt + >>> fp = poly(x**2 + sqrt(5)*x - 1, x, domain='QQ') + >>> gp = poly(x**2 + (2 + sqrt(5))*x + sqrt(5), x, domain='QQ') + >>> sorted(dispersionset(fp, gp)) + [2] + >>> sorted(dispersionset(gp, fp)) + [1, 4] + + We can even perform the computations for polynomials + having symbolic coefficients: + + >>> from sympy.abc import a + >>> fp = poly(4*x**4 + (4*a + 8)*x**3 + (a**2 + 6*a + 4)*x**2 + (a**2 + 2*a)*x, x) + >>> sorted(dispersionset(fp)) + [0, 1] + + See Also + ======== + + dispersion + + References + ========== + + 1. [ManWright94]_ + 2. [Koepf98]_ + 3. [Abramov71]_ + 4. [Man93]_ + """ + from sympy.polys.dispersion import dispersionset + return dispersionset(f, g) + + def dispersion(f, g=None): + r"""Compute the *dispersion* of polynomials. + + For two polynomials `f(x)` and `g(x)` with `\deg f > 0` + and `\deg g > 0` the dispersion `\operatorname{dis}(f, g)` is defined as: + + .. math:: + \operatorname{dis}(f, g) + & := \max\{ J(f,g) \cup \{0\} \} \\ + & = \max\{ \{a \in \mathbb{N} | \gcd(f(x), g(x+a)) \neq 1\} \cup \{0\} \} + + and for a single polynomial `\operatorname{dis}(f) := \operatorname{dis}(f, f)`. + + Examples + ======== + + >>> from sympy import poly + >>> from sympy.polys.dispersion import dispersion, dispersionset + >>> from sympy.abc import x + + Dispersion set and dispersion of a simple polynomial: + + >>> fp = poly((x - 3)*(x + 3), x) + >>> sorted(dispersionset(fp)) + [0, 6] + >>> dispersion(fp) + 6 + + Note that the definition of the dispersion is not symmetric: + + >>> fp = poly(x**4 - 3*x**2 + 1, x) + >>> gp = fp.shift(-3) + >>> sorted(dispersionset(fp, gp)) + [2, 3, 4] + >>> dispersion(fp, gp) + 4 + >>> sorted(dispersionset(gp, fp)) + [] + >>> dispersion(gp, fp) + -oo + + Computing the dispersion also works over field extensions: + + >>> from sympy import sqrt + >>> fp = poly(x**2 + sqrt(5)*x - 1, x, domain='QQ') + >>> gp = poly(x**2 + (2 + sqrt(5))*x + sqrt(5), x, domain='QQ') + >>> sorted(dispersionset(fp, gp)) + [2] + >>> sorted(dispersionset(gp, fp)) + [1, 4] + + We can even perform the computations for polynomials + having symbolic coefficients: + + >>> from sympy.abc import a + >>> fp = poly(4*x**4 + (4*a + 8)*x**3 + (a**2 + 6*a + 4)*x**2 + (a**2 + 2*a)*x, x) + >>> sorted(dispersionset(fp)) + [0, 1] + + See Also + ======== + + dispersionset + + References + ========== + + 1. [ManWright94]_ + 2. [Koepf98]_ + 3. [Abramov71]_ + 4. [Man93]_ + """ + from sympy.polys.dispersion import dispersion + return dispersion(f, g) + + def cofactors(f, g): + """ + Returns the GCD of ``f`` and ``g`` and their cofactors. + + Returns polynomials ``(h, cff, cfg)`` such that ``h = gcd(f, g)``, and + ``cff = quo(f, h)`` and ``cfg = quo(g, h)`` are, so called, cofactors + of ``f`` and ``g``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 - 1, x).cofactors(Poly(x**2 - 3*x + 2, x)) + (Poly(x - 1, x, domain='ZZ'), + Poly(x + 1, x, domain='ZZ'), + Poly(x - 2, x, domain='ZZ')) + + """ + _, per, F, G = f._unify(g) + + if hasattr(f.rep, 'cofactors'): + h, cff, cfg = F.cofactors(G) + else: # pragma: no cover + raise OperationNotSupported(f, 'cofactors') + + return per(h), per(cff), per(cfg) + + def gcd(f, g): + """ + Returns the polynomial GCD of ``f`` and ``g``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 - 1, x).gcd(Poly(x**2 - 3*x + 2, x)) + Poly(x - 1, x, domain='ZZ') + + """ + _, per, F, G = f._unify(g) + + if hasattr(f.rep, 'gcd'): + result = F.gcd(G) + else: # pragma: no cover + raise OperationNotSupported(f, 'gcd') + + return per(result) + + def lcm(f, g): + """ + Returns polynomial LCM of ``f`` and ``g``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 - 1, x).lcm(Poly(x**2 - 3*x + 2, x)) + Poly(x**3 - 2*x**2 - x + 2, x, domain='ZZ') + + """ + _, per, F, G = f._unify(g) + + if hasattr(f.rep, 'lcm'): + result = F.lcm(G) + else: # pragma: no cover + raise OperationNotSupported(f, 'lcm') + + return per(result) + + def trunc(f, p): + """ + Reduce ``f`` modulo a constant ``p``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(2*x**3 + 3*x**2 + 5*x + 7, x).trunc(3) + Poly(-x**3 - x + 1, x, domain='ZZ') + + """ + p = f.rep.dom.convert(p) + + if hasattr(f.rep, 'trunc'): + result = f.rep.trunc(p) + else: # pragma: no cover + raise OperationNotSupported(f, 'trunc') + + return f.per(result) + + def monic(self, auto=True): + """ + Divides all coefficients by ``LC(f)``. + + Examples + ======== + + >>> from sympy import Poly, ZZ + >>> from sympy.abc import x + + >>> Poly(3*x**2 + 6*x + 9, x, domain=ZZ).monic() + Poly(x**2 + 2*x + 3, x, domain='QQ') + + >>> Poly(3*x**2 + 4*x + 2, x, domain=ZZ).monic() + Poly(x**2 + 4/3*x + 2/3, x, domain='QQ') + + """ + f = self + + if auto and f.rep.dom.is_Ring: + f = f.to_field() + + if hasattr(f.rep, 'monic'): + result = f.rep.monic() + else: # pragma: no cover + raise OperationNotSupported(f, 'monic') + + return f.per(result) + + def content(f): + """ + Returns the GCD of polynomial coefficients. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(6*x**2 + 8*x + 12, x).content() + 2 + + """ + if hasattr(f.rep, 'content'): + result = f.rep.content() + else: # pragma: no cover + raise OperationNotSupported(f, 'content') + + return f.rep.dom.to_sympy(result) + + def primitive(f): + """ + Returns the content and a primitive form of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(2*x**2 + 8*x + 12, x).primitive() + (2, Poly(x**2 + 4*x + 6, x, domain='ZZ')) + + """ + if hasattr(f.rep, 'primitive'): + cont, result = f.rep.primitive() + else: # pragma: no cover + raise OperationNotSupported(f, 'primitive') + + return f.rep.dom.to_sympy(cont), f.per(result) + + def compose(f, g): + """ + Computes the functional composition of ``f`` and ``g``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 + x, x).compose(Poly(x - 1, x)) + Poly(x**2 - x, x, domain='ZZ') + + """ + _, per, F, G = f._unify(g) + + if hasattr(f.rep, 'compose'): + result = F.compose(G) + else: # pragma: no cover + raise OperationNotSupported(f, 'compose') + + return per(result) + + def decompose(f): + """ + Computes a functional decomposition of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**4 + 2*x**3 - x - 1, x, domain='ZZ').decompose() + [Poly(x**2 - x - 1, x, domain='ZZ'), Poly(x**2 + x, x, domain='ZZ')] + + """ + if hasattr(f.rep, 'decompose'): + result = f.rep.decompose() + else: # pragma: no cover + raise OperationNotSupported(f, 'decompose') + + return list(map(f.per, result)) + + def shift(f, a): + """ + Efficiently compute Taylor shift ``f(x + a)``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 - 2*x + 1, x).shift(2) + Poly(x**2 + 2*x + 1, x, domain='ZZ') + + """ + if hasattr(f.rep, 'shift'): + result = f.rep.shift(a) + else: # pragma: no cover + raise OperationNotSupported(f, 'shift') + + return f.per(result) + + def transform(f, p, q): + """ + Efficiently evaluate the functional transformation ``q**n * f(p/q)``. + + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 - 2*x + 1, x).transform(Poly(x + 1, x), Poly(x - 1, x)) + Poly(4, x, domain='ZZ') + + """ + P, Q = p.unify(q) + F, P = f.unify(P) + F, Q = F.unify(Q) + + if hasattr(F.rep, 'transform'): + result = F.rep.transform(P.rep, Q.rep) + else: # pragma: no cover + raise OperationNotSupported(F, 'transform') + + return F.per(result) + + def sturm(self, auto=True): + """ + Computes the Sturm sequence of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**3 - 2*x**2 + x - 3, x).sturm() + [Poly(x**3 - 2*x**2 + x - 3, x, domain='QQ'), + Poly(3*x**2 - 4*x + 1, x, domain='QQ'), + Poly(2/9*x + 25/9, x, domain='QQ'), + Poly(-2079/4, x, domain='QQ')] + + """ + f = self + + if auto and f.rep.dom.is_Ring: + f = f.to_field() + + if hasattr(f.rep, 'sturm'): + result = f.rep.sturm() + else: # pragma: no cover + raise OperationNotSupported(f, 'sturm') + + return list(map(f.per, result)) + + def gff_list(f): + """ + Computes greatest factorial factorization of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> f = x**5 + 2*x**4 - x**3 - 2*x**2 + + >>> Poly(f).gff_list() + [(Poly(x, x, domain='ZZ'), 1), (Poly(x + 2, x, domain='ZZ'), 4)] + + """ + if hasattr(f.rep, 'gff_list'): + result = f.rep.gff_list() + else: # pragma: no cover + raise OperationNotSupported(f, 'gff_list') + + return [(f.per(g), k) for g, k in result] + + def norm(f): + """ + Computes the product, ``Norm(f)``, of the conjugates of + a polynomial ``f`` defined over a number field ``K``. + + Examples + ======== + + >>> from sympy import Poly, sqrt + >>> from sympy.abc import x + + >>> a, b = sqrt(2), sqrt(3) + + A polynomial over a quadratic extension. + Two conjugates x - a and x + a. + + >>> f = Poly(x - a, x, extension=a) + >>> f.norm() + Poly(x**2 - 2, x, domain='QQ') + + A polynomial over a quartic extension. + Four conjugates x - a, x - a, x + a and x + a. + + >>> f = Poly(x - a, x, extension=(a, b)) + >>> f.norm() + Poly(x**4 - 4*x**2 + 4, x, domain='QQ') + + """ + if hasattr(f.rep, 'norm'): + r = f.rep.norm() + else: # pragma: no cover + raise OperationNotSupported(f, 'norm') + + return f.per(r) + + def sqf_norm(f): + """ + Computes square-free norm of ``f``. + + Returns ``s``, ``f``, ``r``, such that ``g(x) = f(x-sa)`` and + ``r(x) = Norm(g(x))`` is a square-free polynomial over ``K``, + where ``a`` is the algebraic extension of the ground domain. + + Examples + ======== + + >>> from sympy import Poly, sqrt + >>> from sympy.abc import x + + >>> s, f, r = Poly(x**2 + 1, x, extension=[sqrt(3)]).sqf_norm() + + >>> s + 1 + >>> f + Poly(x**2 - 2*sqrt(3)*x + 4, x, domain='QQ') + >>> r + Poly(x**4 - 4*x**2 + 16, x, domain='QQ') + + """ + if hasattr(f.rep, 'sqf_norm'): + s, g, r = f.rep.sqf_norm() + else: # pragma: no cover + raise OperationNotSupported(f, 'sqf_norm') + + return s, f.per(g), f.per(r) + + def sqf_part(f): + """ + Computes square-free part of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**3 - 3*x - 2, x).sqf_part() + Poly(x**2 - x - 2, x, domain='ZZ') + + """ + if hasattr(f.rep, 'sqf_part'): + result = f.rep.sqf_part() + else: # pragma: no cover + raise OperationNotSupported(f, 'sqf_part') + + return f.per(result) + + def sqf_list(f, all=False): + """ + Returns a list of square-free factors of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> f = 2*x**5 + 16*x**4 + 50*x**3 + 76*x**2 + 56*x + 16 + + >>> Poly(f).sqf_list() + (2, [(Poly(x + 1, x, domain='ZZ'), 2), + (Poly(x + 2, x, domain='ZZ'), 3)]) + + >>> Poly(f).sqf_list(all=True) + (2, [(Poly(1, x, domain='ZZ'), 1), + (Poly(x + 1, x, domain='ZZ'), 2), + (Poly(x + 2, x, domain='ZZ'), 3)]) + + """ + if hasattr(f.rep, 'sqf_list'): + coeff, factors = f.rep.sqf_list(all) + else: # pragma: no cover + raise OperationNotSupported(f, 'sqf_list') + + return f.rep.dom.to_sympy(coeff), [(f.per(g), k) for g, k in factors] + + def sqf_list_include(f, all=False): + """ + Returns a list of square-free factors of ``f``. + + Examples + ======== + + >>> from sympy import Poly, expand + >>> from sympy.abc import x + + >>> f = expand(2*(x + 1)**3*x**4) + >>> f + 2*x**7 + 6*x**6 + 6*x**5 + 2*x**4 + + >>> Poly(f).sqf_list_include() + [(Poly(2, x, domain='ZZ'), 1), + (Poly(x + 1, x, domain='ZZ'), 3), + (Poly(x, x, domain='ZZ'), 4)] + + >>> Poly(f).sqf_list_include(all=True) + [(Poly(2, x, domain='ZZ'), 1), + (Poly(1, x, domain='ZZ'), 2), + (Poly(x + 1, x, domain='ZZ'), 3), + (Poly(x, x, domain='ZZ'), 4)] + + """ + if hasattr(f.rep, 'sqf_list_include'): + factors = f.rep.sqf_list_include(all) + else: # pragma: no cover + raise OperationNotSupported(f, 'sqf_list_include') + + return [(f.per(g), k) for g, k in factors] + + def factor_list(f): + """ + Returns a list of irreducible factors of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> f = 2*x**5 + 2*x**4*y + 4*x**3 + 4*x**2*y + 2*x + 2*y + + >>> Poly(f).factor_list() + (2, [(Poly(x + y, x, y, domain='ZZ'), 1), + (Poly(x**2 + 1, x, y, domain='ZZ'), 2)]) + + """ + if hasattr(f.rep, 'factor_list'): + try: + coeff, factors = f.rep.factor_list() + except DomainError: + return S.One, [(f, 1)] + else: # pragma: no cover + raise OperationNotSupported(f, 'factor_list') + + return f.rep.dom.to_sympy(coeff), [(f.per(g), k) for g, k in factors] + + def factor_list_include(f): + """ + Returns a list of irreducible factors of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> f = 2*x**5 + 2*x**4*y + 4*x**3 + 4*x**2*y + 2*x + 2*y + + >>> Poly(f).factor_list_include() + [(Poly(2*x + 2*y, x, y, domain='ZZ'), 1), + (Poly(x**2 + 1, x, y, domain='ZZ'), 2)] + + """ + if hasattr(f.rep, 'factor_list_include'): + try: + factors = f.rep.factor_list_include() + except DomainError: + return [(f, 1)] + else: # pragma: no cover + raise OperationNotSupported(f, 'factor_list_include') + + return [(f.per(g), k) for g, k in factors] + + def intervals(f, all=False, eps=None, inf=None, sup=None, fast=False, sqf=False): + """ + Compute isolating intervals for roots of ``f``. + + For real roots the Vincent-Akritas-Strzebonski (VAS) continued fractions method is used. + + References + ========== + .. [#] Alkiviadis G. Akritas and Adam W. Strzebonski: A Comparative Study of Two Real Root + Isolation Methods . Nonlinear Analysis: Modelling and Control, Vol. 10, No. 4, 297-304, 2005. + .. [#] Alkiviadis G. Akritas, Adam W. Strzebonski and Panagiotis S. Vigklas: Improving the + Performance of the Continued Fractions Method Using new Bounds of Positive Roots. Nonlinear + Analysis: Modelling and Control, Vol. 13, No. 3, 265-279, 2008. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 - 3, x).intervals() + [((-2, -1), 1), ((1, 2), 1)] + >>> Poly(x**2 - 3, x).intervals(eps=1e-2) + [((-26/15, -19/11), 1), ((19/11, 26/15), 1)] + + """ + if eps is not None: + eps = QQ.convert(eps) + + if eps <= 0: + raise ValueError("'eps' must be a positive rational") + + if inf is not None: + inf = QQ.convert(inf) + if sup is not None: + sup = QQ.convert(sup) + + if hasattr(f.rep, 'intervals'): + result = f.rep.intervals( + all=all, eps=eps, inf=inf, sup=sup, fast=fast, sqf=sqf) + else: # pragma: no cover + raise OperationNotSupported(f, 'intervals') + + if sqf: + def _real(interval): + s, t = interval + return (QQ.to_sympy(s), QQ.to_sympy(t)) + + if not all: + return list(map(_real, result)) + + def _complex(rectangle): + (u, v), (s, t) = rectangle + return (QQ.to_sympy(u) + I*QQ.to_sympy(v), + QQ.to_sympy(s) + I*QQ.to_sympy(t)) + + real_part, complex_part = result + + return list(map(_real, real_part)), list(map(_complex, complex_part)) + else: + def _real(interval): + (s, t), k = interval + return ((QQ.to_sympy(s), QQ.to_sympy(t)), k) + + if not all: + return list(map(_real, result)) + + def _complex(rectangle): + ((u, v), (s, t)), k = rectangle + return ((QQ.to_sympy(u) + I*QQ.to_sympy(v), + QQ.to_sympy(s) + I*QQ.to_sympy(t)), k) + + real_part, complex_part = result + + return list(map(_real, real_part)), list(map(_complex, complex_part)) + + def refine_root(f, s, t, eps=None, steps=None, fast=False, check_sqf=False): + """ + Refine an isolating interval of a root to the given precision. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 - 3, x).refine_root(1, 2, eps=1e-2) + (19/11, 26/15) + + """ + if check_sqf and not f.is_sqf: + raise PolynomialError("only square-free polynomials supported") + + s, t = QQ.convert(s), QQ.convert(t) + + if eps is not None: + eps = QQ.convert(eps) + + if eps <= 0: + raise ValueError("'eps' must be a positive rational") + + if steps is not None: + steps = int(steps) + elif eps is None: + steps = 1 + + if hasattr(f.rep, 'refine_root'): + S, T = f.rep.refine_root(s, t, eps=eps, steps=steps, fast=fast) + else: # pragma: no cover + raise OperationNotSupported(f, 'refine_root') + + return QQ.to_sympy(S), QQ.to_sympy(T) + + def count_roots(f, inf=None, sup=None): + """ + Return the number of roots of ``f`` in ``[inf, sup]`` interval. + + Examples + ======== + + >>> from sympy import Poly, I + >>> from sympy.abc import x + + >>> Poly(x**4 - 4, x).count_roots(-3, 3) + 2 + >>> Poly(x**4 - 4, x).count_roots(0, 1 + 3*I) + 1 + + """ + inf_real, sup_real = True, True + + if inf is not None: + inf = sympify(inf) + + if inf is S.NegativeInfinity: + inf = None + else: + re, im = inf.as_real_imag() + + if not im: + inf = QQ.convert(inf) + else: + inf, inf_real = list(map(QQ.convert, (re, im))), False + + if sup is not None: + sup = sympify(sup) + + if sup is S.Infinity: + sup = None + else: + re, im = sup.as_real_imag() + + if not im: + sup = QQ.convert(sup) + else: + sup, sup_real = list(map(QQ.convert, (re, im))), False + + if inf_real and sup_real: + if hasattr(f.rep, 'count_real_roots'): + count = f.rep.count_real_roots(inf=inf, sup=sup) + else: # pragma: no cover + raise OperationNotSupported(f, 'count_real_roots') + else: + if inf_real and inf is not None: + inf = (inf, QQ.zero) + + if sup_real and sup is not None: + sup = (sup, QQ.zero) + + if hasattr(f.rep, 'count_complex_roots'): + count = f.rep.count_complex_roots(inf=inf, sup=sup) + else: # pragma: no cover + raise OperationNotSupported(f, 'count_complex_roots') + + return Integer(count) + + def root(f, index, radicals=True): + """ + Get an indexed root of a polynomial. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> f = Poly(2*x**3 - 7*x**2 + 4*x + 4) + + >>> f.root(0) + -1/2 + >>> f.root(1) + 2 + >>> f.root(2) + 2 + >>> f.root(3) + Traceback (most recent call last): + ... + IndexError: root index out of [-3, 2] range, got 3 + + >>> Poly(x**5 + x + 1).root(0) + CRootOf(x**3 - x**2 + 1, 0) + + """ + return sympy.polys.rootoftools.rootof(f, index, radicals=radicals) + + def real_roots(f, multiple=True, radicals=True): + """ + Return a list of real roots with multiplicities. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(2*x**3 - 7*x**2 + 4*x + 4).real_roots() + [-1/2, 2, 2] + >>> Poly(x**3 + x + 1).real_roots() + [CRootOf(x**3 + x + 1, 0)] + + """ + reals = sympy.polys.rootoftools.CRootOf.real_roots(f, radicals=radicals) + + if multiple: + return reals + else: + return group(reals, multiple=False) + + def all_roots(f, multiple=True, radicals=True): + """ + Return a list of real and complex roots with multiplicities. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(2*x**3 - 7*x**2 + 4*x + 4).all_roots() + [-1/2, 2, 2] + >>> Poly(x**3 + x + 1).all_roots() + [CRootOf(x**3 + x + 1, 0), + CRootOf(x**3 + x + 1, 1), + CRootOf(x**3 + x + 1, 2)] + + """ + roots = sympy.polys.rootoftools.CRootOf.all_roots(f, radicals=radicals) + + if multiple: + return roots + else: + return group(roots, multiple=False) + + def nroots(f, n=15, maxsteps=50, cleanup=True): + """ + Compute numerical approximations of roots of ``f``. + + Parameters + ========== + + n ... the number of digits to calculate + maxsteps ... the maximum number of iterations to do + + If the accuracy `n` cannot be reached in `maxsteps`, it will raise an + exception. You need to rerun with higher maxsteps. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 - 3).nroots(n=15) + [-1.73205080756888, 1.73205080756888] + >>> Poly(x**2 - 3).nroots(n=30) + [-1.73205080756887729352744634151, 1.73205080756887729352744634151] + + """ + if f.is_multivariate: + raise MultivariatePolynomialError( + "Cannot compute numerical roots of %s" % f) + + if f.degree() <= 0: + return [] + + # For integer and rational coefficients, convert them to integers only + # (for accuracy). Otherwise just try to convert the coefficients to + # mpmath.mpc and raise an exception if the conversion fails. + if f.rep.dom is ZZ: + coeffs = [int(coeff) for coeff in f.all_coeffs()] + elif f.rep.dom is QQ: + denoms = [coeff.q for coeff in f.all_coeffs()] + fac = ilcm(*denoms) + coeffs = [int(coeff*fac) for coeff in f.all_coeffs()] + else: + coeffs = [coeff.evalf(n=n).as_real_imag() + for coeff in f.all_coeffs()] + try: + coeffs = [mpmath.mpc(*coeff) for coeff in coeffs] + except TypeError: + raise DomainError("Numerical domain expected, got %s" % \ + f.rep.dom) + + dps = mpmath.mp.dps + mpmath.mp.dps = n + + from sympy.functions.elementary.complexes import sign + try: + # We need to add extra precision to guard against losing accuracy. + # 10 times the degree of the polynomial seems to work well. + roots = mpmath.polyroots(coeffs, maxsteps=maxsteps, + cleanup=cleanup, error=False, extraprec=f.degree()*10) + + # Mpmath puts real roots first, then complex ones (as does all_roots) + # so we make sure this convention holds here, too. + roots = list(map(sympify, + sorted(roots, key=lambda r: (1 if r.imag else 0, r.real, abs(r.imag), sign(r.imag))))) + except NoConvergence: + try: + # If roots did not converge try again with more extra precision. + roots = mpmath.polyroots(coeffs, maxsteps=maxsteps, + cleanup=cleanup, error=False, extraprec=f.degree()*15) + roots = list(map(sympify, + sorted(roots, key=lambda r: (1 if r.imag else 0, r.real, abs(r.imag), sign(r.imag))))) + except NoConvergence: + raise NoConvergence( + 'convergence to root failed; try n < %s or maxsteps > %s' % ( + n, maxsteps)) + finally: + mpmath.mp.dps = dps + + return roots + + def ground_roots(f): + """ + Compute roots of ``f`` by factorization in the ground domain. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**6 - 4*x**4 + 4*x**3 - x**2).ground_roots() + {0: 2, 1: 2} + + """ + if f.is_multivariate: + raise MultivariatePolynomialError( + "Cannot compute ground roots of %s" % f) + + roots = {} + + for factor, k in f.factor_list()[1]: + if factor.is_linear: + a, b = factor.all_coeffs() + roots[-b/a] = k + + return roots + + def nth_power_roots_poly(f, n): + """ + Construct a polynomial with n-th powers of roots of ``f``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> f = Poly(x**4 - x**2 + 1) + + >>> f.nth_power_roots_poly(2) + Poly(x**4 - 2*x**3 + 3*x**2 - 2*x + 1, x, domain='ZZ') + >>> f.nth_power_roots_poly(3) + Poly(x**4 + 2*x**2 + 1, x, domain='ZZ') + >>> f.nth_power_roots_poly(4) + Poly(x**4 + 2*x**3 + 3*x**2 + 2*x + 1, x, domain='ZZ') + >>> f.nth_power_roots_poly(12) + Poly(x**4 - 4*x**3 + 6*x**2 - 4*x + 1, x, domain='ZZ') + + """ + if f.is_multivariate: + raise MultivariatePolynomialError( + "must be a univariate polynomial") + + N = sympify(n) + + if N.is_Integer and N >= 1: + n = int(N) + else: + raise ValueError("'n' must an integer and n >= 1, got %s" % n) + + x = f.gen + t = Dummy('t') + + r = f.resultant(f.__class__.from_expr(x**n - t, x, t)) + + return r.replace(t, x) + + def same_root(f, a, b): + """ + Decide whether two roots of this polynomial are equal. + + Examples + ======== + + >>> from sympy import Poly, cyclotomic_poly, exp, I, pi + >>> f = Poly(cyclotomic_poly(5)) + >>> r0 = exp(2*I*pi/5) + >>> indices = [i for i, r in enumerate(f.all_roots()) if f.same_root(r, r0)] + >>> print(indices) + [3] + + Raises + ====== + + DomainError + If the domain of the polynomial is not :ref:`ZZ`, :ref:`QQ`, + :ref:`RR`, or :ref:`CC`. + MultivariatePolynomialError + If the polynomial is not univariate. + PolynomialError + If the polynomial is of degree < 2. + + """ + if f.is_multivariate: + raise MultivariatePolynomialError( + "Must be a univariate polynomial") + + dom_delta_sq = f.rep.mignotte_sep_bound_squared() + delta_sq = f.domain.get_field().to_sympy(dom_delta_sq) + # We have delta_sq = delta**2, where delta is a lower bound on the + # minimum separation between any two roots of this polynomial. + # Let eps = delta/3, and define eps_sq = eps**2 = delta**2/9. + eps_sq = delta_sq / 9 + + r, _, _, _ = evalf(1/eps_sq, 1, {}) + n = fastlog(r) + # Then 2^n > 1/eps**2. + m = (n // 2) + (n % 2) + # Then 2^(-m) < eps. + ev = lambda x: quad_to_mpmath(_evalf_with_bounded_error(x, m=m)) + + # Then for any complex numbers a, b we will have + # |a - ev(a)| < eps and |b - ev(b)| < eps. + # So if |ev(a) - ev(b)|**2 < eps**2, then + # |ev(a) - ev(b)| < eps, hence |a - b| < 3*eps = delta. + A, B = ev(a), ev(b) + return (A.real - B.real)**2 + (A.imag - B.imag)**2 < eps_sq + + def cancel(f, g, include=False): + """ + Cancel common factors in a rational function ``f/g``. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(2*x**2 - 2, x).cancel(Poly(x**2 - 2*x + 1, x)) + (1, Poly(2*x + 2, x, domain='ZZ'), Poly(x - 1, x, domain='ZZ')) + + >>> Poly(2*x**2 - 2, x).cancel(Poly(x**2 - 2*x + 1, x), include=True) + (Poly(2*x + 2, x, domain='ZZ'), Poly(x - 1, x, domain='ZZ')) + + """ + dom, per, F, G = f._unify(g) + + if hasattr(F, 'cancel'): + result = F.cancel(G, include=include) + else: # pragma: no cover + raise OperationNotSupported(f, 'cancel') + + if not include: + if dom.has_assoc_Ring: + dom = dom.get_ring() + + cp, cq, p, q = result + + cp = dom.to_sympy(cp) + cq = dom.to_sympy(cq) + + return cp/cq, per(p), per(q) + else: + return tuple(map(per, result)) + + def make_monic_over_integers_by_scaling_roots(f): + """ + Turn any univariate polynomial over :ref:`QQ` or :ref:`ZZ` into a monic + polynomial over :ref:`ZZ`, by scaling the roots as necessary. + + Explanation + =========== + + This operation can be performed whether or not *f* is irreducible; when + it is, this can be understood as determining an algebraic integer + generating the same field as a root of *f*. + + Examples + ======== + + >>> from sympy import Poly, S + >>> from sympy.abc import x + >>> f = Poly(x**2/2 + S(1)/4 * x + S(1)/8, x, domain='QQ') + >>> f.make_monic_over_integers_by_scaling_roots() + (Poly(x**2 + 2*x + 4, x, domain='ZZ'), 4) + + Returns + ======= + + Pair ``(g, c)`` + g is the polynomial + + c is the integer by which the roots had to be scaled + + """ + if not f.is_univariate or f.domain not in [ZZ, QQ]: + raise ValueError('Polynomial must be univariate over ZZ or QQ.') + if f.is_monic and f.domain == ZZ: + return f, ZZ.one + else: + fm = f.monic() + c, _ = fm.clear_denoms() + return fm.transform(Poly(fm.gen), c).to_ring(), c + + def galois_group(f, by_name=False, max_tries=30, randomize=False): + """ + Compute the Galois group of this polynomial. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + >>> f = Poly(x**4 - 2) + >>> G, _ = f.galois_group(by_name=True) + >>> print(G) + S4TransitiveSubgroups.D4 + + See Also + ======== + + sympy.polys.numberfields.galoisgroups.galois_group + + """ + from sympy.polys.numberfields.galoisgroups import ( + _galois_group_degree_3, _galois_group_degree_4_lookup, + _galois_group_degree_5_lookup_ext_factor, + _galois_group_degree_6_lookup, + ) + if (not f.is_univariate + or not f.is_irreducible + or f.domain not in [ZZ, QQ] + ): + raise ValueError('Polynomial must be irreducible and univariate over ZZ or QQ.') + gg = { + 3: _galois_group_degree_3, + 4: _galois_group_degree_4_lookup, + 5: _galois_group_degree_5_lookup_ext_factor, + 6: _galois_group_degree_6_lookup, + } + max_supported = max(gg.keys()) + n = f.degree() + if n > max_supported: + raise ValueError(f"Only polynomials up to degree {max_supported} are supported.") + elif n < 1: + raise ValueError("Constant polynomial has no Galois group.") + elif n == 1: + from sympy.combinatorics.galois import S1TransitiveSubgroups + name, alt = S1TransitiveSubgroups.S1, True + elif n == 2: + from sympy.combinatorics.galois import S2TransitiveSubgroups + name, alt = S2TransitiveSubgroups.S2, False + else: + g, _ = f.make_monic_over_integers_by_scaling_roots() + name, alt = gg[n](g, max_tries=max_tries, randomize=randomize) + G = name if by_name else name.get_perm_group() + return G, alt + + @property + def is_zero(f): + """ + Returns ``True`` if ``f`` is a zero polynomial. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(0, x).is_zero + True + >>> Poly(1, x).is_zero + False + + """ + return f.rep.is_zero + + @property + def is_one(f): + """ + Returns ``True`` if ``f`` is a unit polynomial. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(0, x).is_one + False + >>> Poly(1, x).is_one + True + + """ + return f.rep.is_one + + @property + def is_sqf(f): + """ + Returns ``True`` if ``f`` is a square-free polynomial. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 - 2*x + 1, x).is_sqf + False + >>> Poly(x**2 - 1, x).is_sqf + True + + """ + return f.rep.is_sqf + + @property + def is_monic(f): + """ + Returns ``True`` if the leading coefficient of ``f`` is one. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x + 2, x).is_monic + True + >>> Poly(2*x + 2, x).is_monic + False + + """ + return f.rep.is_monic + + @property + def is_primitive(f): + """ + Returns ``True`` if GCD of the coefficients of ``f`` is one. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(2*x**2 + 6*x + 12, x).is_primitive + False + >>> Poly(x**2 + 3*x + 6, x).is_primitive + True + + """ + return f.rep.is_primitive + + @property + def is_ground(f): + """ + Returns ``True`` if ``f`` is an element of the ground domain. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(x, x).is_ground + False + >>> Poly(2, x).is_ground + True + >>> Poly(y, x).is_ground + True + + """ + return f.rep.is_ground + + @property + def is_linear(f): + """ + Returns ``True`` if ``f`` is linear in all its variables. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(x + y + 2, x, y).is_linear + True + >>> Poly(x*y + 2, x, y).is_linear + False + + """ + return f.rep.is_linear + + @property + def is_quadratic(f): + """ + Returns ``True`` if ``f`` is quadratic in all its variables. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(x*y + 2, x, y).is_quadratic + True + >>> Poly(x*y**2 + 2, x, y).is_quadratic + False + + """ + return f.rep.is_quadratic + + @property + def is_monomial(f): + """ + Returns ``True`` if ``f`` is zero or has only one term. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(3*x**2, x).is_monomial + True + >>> Poly(3*x**2 + 1, x).is_monomial + False + + """ + return f.rep.is_monomial + + @property + def is_homogeneous(f): + """ + Returns ``True`` if ``f`` is a homogeneous polynomial. + + A homogeneous polynomial is a polynomial whose all monomials with + non-zero coefficients have the same total degree. If you want not + only to check if a polynomial is homogeneous but also compute its + homogeneous order, then use :func:`Poly.homogeneous_order`. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(x**2 + x*y, x, y).is_homogeneous + True + >>> Poly(x**3 + x*y, x, y).is_homogeneous + False + + """ + return f.rep.is_homogeneous + + @property + def is_irreducible(f): + """ + Returns ``True`` if ``f`` has no factors over its domain. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> Poly(x**2 + x + 1, x, modulus=2).is_irreducible + True + >>> Poly(x**2 + 1, x, modulus=2).is_irreducible + False + + """ + return f.rep.is_irreducible + + @property + def is_univariate(f): + """ + Returns ``True`` if ``f`` is a univariate polynomial. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(x**2 + x + 1, x).is_univariate + True + >>> Poly(x*y**2 + x*y + 1, x, y).is_univariate + False + >>> Poly(x*y**2 + x*y + 1, x).is_univariate + True + >>> Poly(x**2 + x + 1, x, y).is_univariate + False + + """ + return len(f.gens) == 1 + + @property + def is_multivariate(f): + """ + Returns ``True`` if ``f`` is a multivariate polynomial. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x, y + + >>> Poly(x**2 + x + 1, x).is_multivariate + False + >>> Poly(x*y**2 + x*y + 1, x, y).is_multivariate + True + >>> Poly(x*y**2 + x*y + 1, x).is_multivariate + False + >>> Poly(x**2 + x + 1, x, y).is_multivariate + True + + """ + return len(f.gens) != 1 + + @property + def is_cyclotomic(f): + """ + Returns ``True`` if ``f`` is a cyclotomic polnomial. + + Examples + ======== + + >>> from sympy import Poly + >>> from sympy.abc import x + + >>> f = x**16 + x**14 - x**10 + x**8 - x**6 + x**2 + 1 + + >>> Poly(f).is_cyclotomic + False + + >>> g = x**16 + x**14 - x**10 - x**8 - x**6 + x**2 + 1 + + >>> Poly(g).is_cyclotomic + True + + """ + return f.rep.is_cyclotomic + + def __abs__(f): + return f.abs() + + def __neg__(f): + return f.neg() + + @_polifyit + def __add__(f, g): + return f.add(g) + + @_polifyit + def __radd__(f, g): + return g.add(f) + + @_polifyit + def __sub__(f, g): + return f.sub(g) + + @_polifyit + def __rsub__(f, g): + return g.sub(f) + + @_polifyit + def __mul__(f, g): + return f.mul(g) + + @_polifyit + def __rmul__(f, g): + return g.mul(f) + + @_sympifyit('n', NotImplemented) + def __pow__(f, n): + if n.is_Integer and n >= 0: + return f.pow(n) + else: + return NotImplemented + + @_polifyit + def __divmod__(f, g): + return f.div(g) + + @_polifyit + def __rdivmod__(f, g): + return g.div(f) + + @_polifyit + def __mod__(f, g): + return f.rem(g) + + @_polifyit + def __rmod__(f, g): + return g.rem(f) + + @_polifyit + def __floordiv__(f, g): + return f.quo(g) + + @_polifyit + def __rfloordiv__(f, g): + return g.quo(f) + + @_sympifyit('g', NotImplemented) + def __truediv__(f, g): + return f.as_expr()/g.as_expr() + + @_sympifyit('g', NotImplemented) + def __rtruediv__(f, g): + return g.as_expr()/f.as_expr() + + @_sympifyit('other', NotImplemented) + def __eq__(self, other): + f, g = self, other + + if not g.is_Poly: + try: + g = f.__class__(g, f.gens, domain=f.get_domain()) + except (PolynomialError, DomainError, CoercionFailed): + return False + + if f.gens != g.gens: + return False + + if f.rep.dom != g.rep.dom: + return False + + return f.rep == g.rep + + @_sympifyit('g', NotImplemented) + def __ne__(f, g): + return not f == g + + def __bool__(f): + return not f.is_zero + + def eq(f, g, strict=False): + if not strict: + return f == g + else: + return f._strict_eq(sympify(g)) + + def ne(f, g, strict=False): + return not f.eq(g, strict=strict) + + def _strict_eq(f, g): + return isinstance(g, f.__class__) and f.gens == g.gens and f.rep.eq(g.rep, strict=True) + + +@public +class PurePoly(Poly): + """Class for representing pure polynomials. """ + + def _hashable_content(self): + """Allow SymPy to hash Poly instances. """ + return (self.rep,) + + def __hash__(self): + return super().__hash__() + + @property + def free_symbols(self): + """ + Free symbols of a polynomial. + + Examples + ======== + + >>> from sympy import PurePoly + >>> from sympy.abc import x, y + + >>> PurePoly(x**2 + 1).free_symbols + set() + >>> PurePoly(x**2 + y).free_symbols + set() + >>> PurePoly(x**2 + y, x).free_symbols + {y} + + """ + return self.free_symbols_in_domain + + @_sympifyit('other', NotImplemented) + def __eq__(self, other): + f, g = self, other + + if not g.is_Poly: + try: + g = f.__class__(g, f.gens, domain=f.get_domain()) + except (PolynomialError, DomainError, CoercionFailed): + return False + + if len(f.gens) != len(g.gens): + return False + + if f.rep.dom != g.rep.dom: + try: + dom = f.rep.dom.unify(g.rep.dom, f.gens) + except UnificationFailed: + return False + + f = f.set_domain(dom) + g = g.set_domain(dom) + + return f.rep == g.rep + + def _strict_eq(f, g): + return isinstance(g, f.__class__) and f.rep.eq(g.rep, strict=True) + + def _unify(f, g): + g = sympify(g) + + if not g.is_Poly: + try: + return f.rep.dom, f.per, f.rep, f.rep.per(f.rep.dom.from_sympy(g)) + except CoercionFailed: + raise UnificationFailed("Cannot unify %s with %s" % (f, g)) + + if len(f.gens) != len(g.gens): + raise UnificationFailed("Cannot unify %s with %s" % (f, g)) + + if not (isinstance(f.rep, DMP) and isinstance(g.rep, DMP)): + raise UnificationFailed("Cannot unify %s with %s" % (f, g)) + + cls = f.__class__ + gens = f.gens + + dom = f.rep.dom.unify(g.rep.dom, gens) + + F = f.rep.convert(dom) + G = g.rep.convert(dom) + + def per(rep, dom=dom, gens=gens, remove=None): + if remove is not None: + gens = gens[:remove] + gens[remove + 1:] + + if not gens: + return dom.to_sympy(rep) + + return cls.new(rep, *gens) + + return dom, per, F, G + + +@public +def poly_from_expr(expr, *gens, **args): + """Construct a polynomial from an expression. """ + opt = options.build_options(gens, args) + return _poly_from_expr(expr, opt) + + +def _poly_from_expr(expr, opt): + """Construct a polynomial from an expression. """ + orig, expr = expr, sympify(expr) + + if not isinstance(expr, Basic): + raise PolificationFailed(opt, orig, expr) + elif expr.is_Poly: + poly = expr.__class__._from_poly(expr, opt) + + opt.gens = poly.gens + opt.domain = poly.domain + + if opt.polys is None: + opt.polys = True + + return poly, opt + elif opt.expand: + expr = expr.expand() + + rep, opt = _dict_from_expr(expr, opt) + if not opt.gens: + raise PolificationFailed(opt, orig, expr) + + monoms, coeffs = list(zip(*list(rep.items()))) + domain = opt.domain + + if domain is None: + opt.domain, coeffs = construct_domain(coeffs, opt=opt) + else: + coeffs = list(map(domain.from_sympy, coeffs)) + + rep = dict(list(zip(monoms, coeffs))) + poly = Poly._from_dict(rep, opt) + + if opt.polys is None: + opt.polys = False + + return poly, opt + + +@public +def parallel_poly_from_expr(exprs, *gens, **args): + """Construct polynomials from expressions. """ + opt = options.build_options(gens, args) + return _parallel_poly_from_expr(exprs, opt) + + +def _parallel_poly_from_expr(exprs, opt): + """Construct polynomials from expressions. """ + if len(exprs) == 2: + f, g = exprs + + if isinstance(f, Poly) and isinstance(g, Poly): + f = f.__class__._from_poly(f, opt) + g = g.__class__._from_poly(g, opt) + + f, g = f.unify(g) + + opt.gens = f.gens + opt.domain = f.domain + + if opt.polys is None: + opt.polys = True + + return [f, g], opt + + origs, exprs = list(exprs), [] + _exprs, _polys = [], [] + + failed = False + + for i, expr in enumerate(origs): + expr = sympify(expr) + + if isinstance(expr, Basic): + if expr.is_Poly: + _polys.append(i) + else: + _exprs.append(i) + + if opt.expand: + expr = expr.expand() + else: + failed = True + + exprs.append(expr) + + if failed: + raise PolificationFailed(opt, origs, exprs, True) + + if _polys: + # XXX: this is a temporary solution + for i in _polys: + exprs[i] = exprs[i].as_expr() + + reps, opt = _parallel_dict_from_expr(exprs, opt) + if not opt.gens: + raise PolificationFailed(opt, origs, exprs, True) + + from sympy.functions.elementary.piecewise import Piecewise + for k in opt.gens: + if isinstance(k, Piecewise): + raise PolynomialError("Piecewise generators do not make sense") + + coeffs_list, lengths = [], [] + + all_monoms = [] + all_coeffs = [] + + for rep in reps: + monoms, coeffs = list(zip(*list(rep.items()))) + + coeffs_list.extend(coeffs) + all_monoms.append(monoms) + + lengths.append(len(coeffs)) + + domain = opt.domain + + if domain is None: + opt.domain, coeffs_list = construct_domain(coeffs_list, opt=opt) + else: + coeffs_list = list(map(domain.from_sympy, coeffs_list)) + + for k in lengths: + all_coeffs.append(coeffs_list[:k]) + coeffs_list = coeffs_list[k:] + + polys = [] + + for monoms, coeffs in zip(all_monoms, all_coeffs): + rep = dict(list(zip(monoms, coeffs))) + poly = Poly._from_dict(rep, opt) + polys.append(poly) + + if opt.polys is None: + opt.polys = bool(_polys) + + return polys, opt + + +def _update_args(args, key, value): + """Add a new ``(key, value)`` pair to arguments ``dict``. """ + args = dict(args) + + if key not in args: + args[key] = value + + return args + + +@public +def degree(f, gen=0): + """ + Return the degree of ``f`` in the given variable. + + The degree of 0 is negative infinity. + + Examples + ======== + + >>> from sympy import degree + >>> from sympy.abc import x, y + + >>> degree(x**2 + y*x + 1, gen=x) + 2 + >>> degree(x**2 + y*x + 1, gen=y) + 1 + >>> degree(0, x) + -oo + + See also + ======== + + sympy.polys.polytools.Poly.total_degree + degree_list + """ + + f = sympify(f, strict=True) + gen_is_Num = sympify(gen, strict=True).is_Number + if f.is_Poly: + p = f + isNum = p.as_expr().is_Number + else: + isNum = f.is_Number + if not isNum: + if gen_is_Num: + p, _ = poly_from_expr(f) + else: + p, _ = poly_from_expr(f, gen) + + if isNum: + return S.Zero if f else S.NegativeInfinity + + if not gen_is_Num: + if f.is_Poly and gen not in p.gens: + # try recast without explicit gens + p, _ = poly_from_expr(f.as_expr()) + if gen not in p.gens: + return S.Zero + elif not f.is_Poly and len(f.free_symbols) > 1: + raise TypeError(filldedent(''' + A symbolic generator of interest is required for a multivariate + expression like func = %s, e.g. degree(func, gen = %s) instead of + degree(func, gen = %s). + ''' % (f, next(ordered(f.free_symbols)), gen))) + result = p.degree(gen) + return Integer(result) if isinstance(result, int) else S.NegativeInfinity + + +@public +def total_degree(f, *gens): + """ + Return the total_degree of ``f`` in the given variables. + + Examples + ======== + >>> from sympy import total_degree, Poly + >>> from sympy.abc import x, y + + >>> total_degree(1) + 0 + >>> total_degree(x + x*y) + 2 + >>> total_degree(x + x*y, x) + 1 + + If the expression is a Poly and no variables are given + then the generators of the Poly will be used: + + >>> p = Poly(x + x*y, y) + >>> total_degree(p) + 1 + + To deal with the underlying expression of the Poly, convert + it to an Expr: + + >>> total_degree(p.as_expr()) + 2 + + This is done automatically if any variables are given: + + >>> total_degree(p, x) + 1 + + See also + ======== + degree + """ + + p = sympify(f) + if p.is_Poly: + p = p.as_expr() + if p.is_Number: + rv = 0 + else: + if f.is_Poly: + gens = gens or f.gens + rv = Poly(p, gens).total_degree() + + return Integer(rv) + + +@public +def degree_list(f, *gens, **args): + """ + Return a list of degrees of ``f`` in all variables. + + Examples + ======== + + >>> from sympy import degree_list + >>> from sympy.abc import x, y + + >>> degree_list(x**2 + y*x + 1) + (2, 1) + + """ + options.allowed_flags(args, ['polys']) + + try: + F, opt = poly_from_expr(f, *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('degree_list', 1, exc) + + degrees = F.degree_list() + + return tuple(map(Integer, degrees)) + + +@public +def LC(f, *gens, **args): + """ + Return the leading coefficient of ``f``. + + Examples + ======== + + >>> from sympy import LC + >>> from sympy.abc import x, y + + >>> LC(4*x**2 + 2*x*y**2 + x*y + 3*y) + 4 + + """ + options.allowed_flags(args, ['polys']) + + try: + F, opt = poly_from_expr(f, *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('LC', 1, exc) + + return F.LC(order=opt.order) + + +@public +def LM(f, *gens, **args): + """ + Return the leading monomial of ``f``. + + Examples + ======== + + >>> from sympy import LM + >>> from sympy.abc import x, y + + >>> LM(4*x**2 + 2*x*y**2 + x*y + 3*y) + x**2 + + """ + options.allowed_flags(args, ['polys']) + + try: + F, opt = poly_from_expr(f, *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('LM', 1, exc) + + monom = F.LM(order=opt.order) + return monom.as_expr() + + +@public +def LT(f, *gens, **args): + """ + Return the leading term of ``f``. + + Examples + ======== + + >>> from sympy import LT + >>> from sympy.abc import x, y + + >>> LT(4*x**2 + 2*x*y**2 + x*y + 3*y) + 4*x**2 + + """ + options.allowed_flags(args, ['polys']) + + try: + F, opt = poly_from_expr(f, *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('LT', 1, exc) + + monom, coeff = F.LT(order=opt.order) + return coeff*monom.as_expr() + + +@public +def pdiv(f, g, *gens, **args): + """ + Compute polynomial pseudo-division of ``f`` and ``g``. + + Examples + ======== + + >>> from sympy import pdiv + >>> from sympy.abc import x + + >>> pdiv(x**2 + 1, 2*x - 4) + (2*x + 4, 20) + + """ + options.allowed_flags(args, ['polys']) + + try: + (F, G), opt = parallel_poly_from_expr((f, g), *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('pdiv', 2, exc) + + q, r = F.pdiv(G) + + if not opt.polys: + return q.as_expr(), r.as_expr() + else: + return q, r + + +@public +def prem(f, g, *gens, **args): + """ + Compute polynomial pseudo-remainder of ``f`` and ``g``. + + Examples + ======== + + >>> from sympy import prem + >>> from sympy.abc import x + + >>> prem(x**2 + 1, 2*x - 4) + 20 + + """ + options.allowed_flags(args, ['polys']) + + try: + (F, G), opt = parallel_poly_from_expr((f, g), *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('prem', 2, exc) + + r = F.prem(G) + + if not opt.polys: + return r.as_expr() + else: + return r + + +@public +def pquo(f, g, *gens, **args): + """ + Compute polynomial pseudo-quotient of ``f`` and ``g``. + + Examples + ======== + + >>> from sympy import pquo + >>> from sympy.abc import x + + >>> pquo(x**2 + 1, 2*x - 4) + 2*x + 4 + >>> pquo(x**2 - 1, 2*x - 1) + 2*x + 1 + + """ + options.allowed_flags(args, ['polys']) + + try: + (F, G), opt = parallel_poly_from_expr((f, g), *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('pquo', 2, exc) + + try: + q = F.pquo(G) + except ExactQuotientFailed: + raise ExactQuotientFailed(f, g) + + if not opt.polys: + return q.as_expr() + else: + return q + + +@public +def pexquo(f, g, *gens, **args): + """ + Compute polynomial exact pseudo-quotient of ``f`` and ``g``. + + Examples + ======== + + >>> from sympy import pexquo + >>> from sympy.abc import x + + >>> pexquo(x**2 - 1, 2*x - 2) + 2*x + 2 + + >>> pexquo(x**2 + 1, 2*x - 4) + Traceback (most recent call last): + ... + ExactQuotientFailed: 2*x - 4 does not divide x**2 + 1 + + """ + options.allowed_flags(args, ['polys']) + + try: + (F, G), opt = parallel_poly_from_expr((f, g), *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('pexquo', 2, exc) + + q = F.pexquo(G) + + if not opt.polys: + return q.as_expr() + else: + return q + + +@public +def div(f, g, *gens, **args): + """ + Compute polynomial division of ``f`` and ``g``. + + Examples + ======== + + >>> from sympy import div, ZZ, QQ + >>> from sympy.abc import x + + >>> div(x**2 + 1, 2*x - 4, domain=ZZ) + (0, x**2 + 1) + >>> div(x**2 + 1, 2*x - 4, domain=QQ) + (x/2 + 1, 5) + + """ + options.allowed_flags(args, ['auto', 'polys']) + + try: + (F, G), opt = parallel_poly_from_expr((f, g), *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('div', 2, exc) + + q, r = F.div(G, auto=opt.auto) + + if not opt.polys: + return q.as_expr(), r.as_expr() + else: + return q, r + + +@public +def rem(f, g, *gens, **args): + """ + Compute polynomial remainder of ``f`` and ``g``. + + Examples + ======== + + >>> from sympy import rem, ZZ, QQ + >>> from sympy.abc import x + + >>> rem(x**2 + 1, 2*x - 4, domain=ZZ) + x**2 + 1 + >>> rem(x**2 + 1, 2*x - 4, domain=QQ) + 5 + + """ + options.allowed_flags(args, ['auto', 'polys']) + + try: + (F, G), opt = parallel_poly_from_expr((f, g), *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('rem', 2, exc) + + r = F.rem(G, auto=opt.auto) + + if not opt.polys: + return r.as_expr() + else: + return r + + +@public +def quo(f, g, *gens, **args): + """ + Compute polynomial quotient of ``f`` and ``g``. + + Examples + ======== + + >>> from sympy import quo + >>> from sympy.abc import x + + >>> quo(x**2 + 1, 2*x - 4) + x/2 + 1 + >>> quo(x**2 - 1, x - 1) + x + 1 + + """ + options.allowed_flags(args, ['auto', 'polys']) + + try: + (F, G), opt = parallel_poly_from_expr((f, g), *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('quo', 2, exc) + + q = F.quo(G, auto=opt.auto) + + if not opt.polys: + return q.as_expr() + else: + return q + + +@public +def exquo(f, g, *gens, **args): + """ + Compute polynomial exact quotient of ``f`` and ``g``. + + Examples + ======== + + >>> from sympy import exquo + >>> from sympy.abc import x + + >>> exquo(x**2 - 1, x - 1) + x + 1 + + >>> exquo(x**2 + 1, 2*x - 4) + Traceback (most recent call last): + ... + ExactQuotientFailed: 2*x - 4 does not divide x**2 + 1 + + """ + options.allowed_flags(args, ['auto', 'polys']) + + try: + (F, G), opt = parallel_poly_from_expr((f, g), *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('exquo', 2, exc) + + q = F.exquo(G, auto=opt.auto) + + if not opt.polys: + return q.as_expr() + else: + return q + + +@public +def half_gcdex(f, g, *gens, **args): + """ + Half extended Euclidean algorithm of ``f`` and ``g``. + + Returns ``(s, h)`` such that ``h = gcd(f, g)`` and ``s*f = h (mod g)``. + + Examples + ======== + + >>> from sympy import half_gcdex + >>> from sympy.abc import x + + >>> half_gcdex(x**4 - 2*x**3 - 6*x**2 + 12*x + 15, x**3 + x**2 - 4*x - 4) + (3/5 - x/5, x + 1) + + """ + options.allowed_flags(args, ['auto', 'polys']) + + try: + (F, G), opt = parallel_poly_from_expr((f, g), *gens, **args) + except PolificationFailed as exc: + domain, (a, b) = construct_domain(exc.exprs) + + try: + s, h = domain.half_gcdex(a, b) + except NotImplementedError: + raise ComputationFailed('half_gcdex', 2, exc) + else: + return domain.to_sympy(s), domain.to_sympy(h) + + s, h = F.half_gcdex(G, auto=opt.auto) + + if not opt.polys: + return s.as_expr(), h.as_expr() + else: + return s, h + + +@public +def gcdex(f, g, *gens, **args): + """ + Extended Euclidean algorithm of ``f`` and ``g``. + + Returns ``(s, t, h)`` such that ``h = gcd(f, g)`` and ``s*f + t*g = h``. + + Examples + ======== + + >>> from sympy import gcdex + >>> from sympy.abc import x + + >>> gcdex(x**4 - 2*x**3 - 6*x**2 + 12*x + 15, x**3 + x**2 - 4*x - 4) + (3/5 - x/5, x**2/5 - 6*x/5 + 2, x + 1) + + """ + options.allowed_flags(args, ['auto', 'polys']) + + try: + (F, G), opt = parallel_poly_from_expr((f, g), *gens, **args) + except PolificationFailed as exc: + domain, (a, b) = construct_domain(exc.exprs) + + try: + s, t, h = domain.gcdex(a, b) + except NotImplementedError: + raise ComputationFailed('gcdex', 2, exc) + else: + return domain.to_sympy(s), domain.to_sympy(t), domain.to_sympy(h) + + s, t, h = F.gcdex(G, auto=opt.auto) + + if not opt.polys: + return s.as_expr(), t.as_expr(), h.as_expr() + else: + return s, t, h + + +@public +def invert(f, g, *gens, **args): + """ + Invert ``f`` modulo ``g`` when possible. + + Examples + ======== + + >>> from sympy import invert, S, mod_inverse + >>> from sympy.abc import x + + >>> invert(x**2 - 1, 2*x - 1) + -4/3 + + >>> invert(x**2 - 1, x - 1) + Traceback (most recent call last): + ... + NotInvertible: zero divisor + + For more efficient inversion of Rationals, + use the :obj:`~.mod_inverse` function: + + >>> mod_inverse(3, 5) + 2 + >>> (S(2)/5).invert(S(7)/3) + 5/2 + + See Also + ======== + + sympy.core.numbers.mod_inverse + + """ + options.allowed_flags(args, ['auto', 'polys']) + + try: + (F, G), opt = parallel_poly_from_expr((f, g), *gens, **args) + except PolificationFailed as exc: + domain, (a, b) = construct_domain(exc.exprs) + + try: + return domain.to_sympy(domain.invert(a, b)) + except NotImplementedError: + raise ComputationFailed('invert', 2, exc) + + h = F.invert(G, auto=opt.auto) + + if not opt.polys: + return h.as_expr() + else: + return h + + +@public +def subresultants(f, g, *gens, **args): + """ + Compute subresultant PRS of ``f`` and ``g``. + + Examples + ======== + + >>> from sympy import subresultants + >>> from sympy.abc import x + + >>> subresultants(x**2 + 1, x**2 - 1) + [x**2 + 1, x**2 - 1, -2] + + """ + options.allowed_flags(args, ['polys']) + + try: + (F, G), opt = parallel_poly_from_expr((f, g), *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('subresultants', 2, exc) + + result = F.subresultants(G) + + if not opt.polys: + return [r.as_expr() for r in result] + else: + return result + + +@public +def resultant(f, g, *gens, includePRS=False, **args): + """ + Compute resultant of ``f`` and ``g``. + + Examples + ======== + + >>> from sympy import resultant + >>> from sympy.abc import x + + >>> resultant(x**2 + 1, x**2 - 1) + 4 + + """ + options.allowed_flags(args, ['polys']) + + try: + (F, G), opt = parallel_poly_from_expr((f, g), *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('resultant', 2, exc) + + if includePRS: + result, R = F.resultant(G, includePRS=includePRS) + else: + result = F.resultant(G) + + if not opt.polys: + if includePRS: + return result.as_expr(), [r.as_expr() for r in R] + return result.as_expr() + else: + if includePRS: + return result, R + return result + + +@public +def discriminant(f, *gens, **args): + """ + Compute discriminant of ``f``. + + Examples + ======== + + >>> from sympy import discriminant + >>> from sympy.abc import x + + >>> discriminant(x**2 + 2*x + 3) + -8 + + """ + options.allowed_flags(args, ['polys']) + + try: + F, opt = poly_from_expr(f, *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('discriminant', 1, exc) + + result = F.discriminant() + + if not opt.polys: + return result.as_expr() + else: + return result + + +@public +def cofactors(f, g, *gens, **args): + """ + Compute GCD and cofactors of ``f`` and ``g``. + + Returns polynomials ``(h, cff, cfg)`` such that ``h = gcd(f, g)``, and + ``cff = quo(f, h)`` and ``cfg = quo(g, h)`` are, so called, cofactors + of ``f`` and ``g``. + + Examples + ======== + + >>> from sympy import cofactors + >>> from sympy.abc import x + + >>> cofactors(x**2 - 1, x**2 - 3*x + 2) + (x - 1, x + 1, x - 2) + + """ + options.allowed_flags(args, ['polys']) + + try: + (F, G), opt = parallel_poly_from_expr((f, g), *gens, **args) + except PolificationFailed as exc: + domain, (a, b) = construct_domain(exc.exprs) + + try: + h, cff, cfg = domain.cofactors(a, b) + except NotImplementedError: + raise ComputationFailed('cofactors', 2, exc) + else: + return domain.to_sympy(h), domain.to_sympy(cff), domain.to_sympy(cfg) + + h, cff, cfg = F.cofactors(G) + + if not opt.polys: + return h.as_expr(), cff.as_expr(), cfg.as_expr() + else: + return h, cff, cfg + + +@public +def gcd_list(seq, *gens, **args): + """ + Compute GCD of a list of polynomials. + + Examples + ======== + + >>> from sympy import gcd_list + >>> from sympy.abc import x + + >>> gcd_list([x**3 - 1, x**2 - 1, x**2 - 3*x + 2]) + x - 1 + + """ + seq = sympify(seq) + + def try_non_polynomial_gcd(seq): + if not gens and not args: + domain, numbers = construct_domain(seq) + + if not numbers: + return domain.zero + elif domain.is_Numerical: + result, numbers = numbers[0], numbers[1:] + + for number in numbers: + result = domain.gcd(result, number) + + if domain.is_one(result): + break + + return domain.to_sympy(result) + + return None + + result = try_non_polynomial_gcd(seq) + + if result is not None: + return result + + options.allowed_flags(args, ['polys']) + + try: + polys, opt = parallel_poly_from_expr(seq, *gens, **args) + + # gcd for domain Q[irrational] (purely algebraic irrational) + if len(seq) > 1 and all(elt.is_algebraic and elt.is_irrational for elt in seq): + a = seq[-1] + lst = [ (a/elt).ratsimp() for elt in seq[:-1] ] + if all(frc.is_rational for frc in lst): + lc = 1 + for frc in lst: + lc = lcm(lc, frc.as_numer_denom()[0]) + # abs ensures that the gcd is always non-negative + return abs(a/lc) + + except PolificationFailed as exc: + result = try_non_polynomial_gcd(exc.exprs) + + if result is not None: + return result + else: + raise ComputationFailed('gcd_list', len(seq), exc) + + if not polys: + if not opt.polys: + return S.Zero + else: + return Poly(0, opt=opt) + + result, polys = polys[0], polys[1:] + + for poly in polys: + result = result.gcd(poly) + + if result.is_one: + break + + if not opt.polys: + return result.as_expr() + else: + return result + + +@public +def gcd(f, g=None, *gens, **args): + """ + Compute GCD of ``f`` and ``g``. + + Examples + ======== + + >>> from sympy import gcd + >>> from sympy.abc import x + + >>> gcd(x**2 - 1, x**2 - 3*x + 2) + x - 1 + + """ + if hasattr(f, '__iter__'): + if g is not None: + gens = (g,) + gens + + return gcd_list(f, *gens, **args) + elif g is None: + raise TypeError("gcd() takes 2 arguments or a sequence of arguments") + + options.allowed_flags(args, ['polys']) + + try: + (F, G), opt = parallel_poly_from_expr((f, g), *gens, **args) + + # gcd for domain Q[irrational] (purely algebraic irrational) + a, b = map(sympify, (f, g)) + if a.is_algebraic and a.is_irrational and b.is_algebraic and b.is_irrational: + frc = (a/b).ratsimp() + if frc.is_rational: + # abs ensures that the returned gcd is always non-negative + return abs(a/frc.as_numer_denom()[0]) + + except PolificationFailed as exc: + domain, (a, b) = construct_domain(exc.exprs) + + try: + return domain.to_sympy(domain.gcd(a, b)) + except NotImplementedError: + raise ComputationFailed('gcd', 2, exc) + + result = F.gcd(G) + + if not opt.polys: + return result.as_expr() + else: + return result + + +@public +def lcm_list(seq, *gens, **args): + """ + Compute LCM of a list of polynomials. + + Examples + ======== + + >>> from sympy import lcm_list + >>> from sympy.abc import x + + >>> lcm_list([x**3 - 1, x**2 - 1, x**2 - 3*x + 2]) + x**5 - x**4 - 2*x**3 - x**2 + x + 2 + + """ + seq = sympify(seq) + + def try_non_polynomial_lcm(seq) -> Optional[Expr]: + if not gens and not args: + domain, numbers = construct_domain(seq) + + if not numbers: + return domain.to_sympy(domain.one) + elif domain.is_Numerical: + result, numbers = numbers[0], numbers[1:] + + for number in numbers: + result = domain.lcm(result, number) + + return domain.to_sympy(result) + + return None + + result = try_non_polynomial_lcm(seq) + + if result is not None: + return result + + options.allowed_flags(args, ['polys']) + + try: + polys, opt = parallel_poly_from_expr(seq, *gens, **args) + + # lcm for domain Q[irrational] (purely algebraic irrational) + if len(seq) > 1 and all(elt.is_algebraic and elt.is_irrational for elt in seq): + a = seq[-1] + lst = [ (a/elt).ratsimp() for elt in seq[:-1] ] + if all(frc.is_rational for frc in lst): + lc = 1 + for frc in lst: + lc = lcm(lc, frc.as_numer_denom()[1]) + return a*lc + + except PolificationFailed as exc: + result = try_non_polynomial_lcm(exc.exprs) + + if result is not None: + return result + else: + raise ComputationFailed('lcm_list', len(seq), exc) + + if not polys: + if not opt.polys: + return S.One + else: + return Poly(1, opt=opt) + + result, polys = polys[0], polys[1:] + + for poly in polys: + result = result.lcm(poly) + + if not opt.polys: + return result.as_expr() + else: + return result + + +@public +def lcm(f, g=None, *gens, **args): + """ + Compute LCM of ``f`` and ``g``. + + Examples + ======== + + >>> from sympy import lcm + >>> from sympy.abc import x + + >>> lcm(x**2 - 1, x**2 - 3*x + 2) + x**3 - 2*x**2 - x + 2 + + """ + if hasattr(f, '__iter__'): + if g is not None: + gens = (g,) + gens + + return lcm_list(f, *gens, **args) + elif g is None: + raise TypeError("lcm() takes 2 arguments or a sequence of arguments") + + options.allowed_flags(args, ['polys']) + + try: + (F, G), opt = parallel_poly_from_expr((f, g), *gens, **args) + + # lcm for domain Q[irrational] (purely algebraic irrational) + a, b = map(sympify, (f, g)) + if a.is_algebraic and a.is_irrational and b.is_algebraic and b.is_irrational: + frc = (a/b).ratsimp() + if frc.is_rational: + return a*frc.as_numer_denom()[1] + + except PolificationFailed as exc: + domain, (a, b) = construct_domain(exc.exprs) + + try: + return domain.to_sympy(domain.lcm(a, b)) + except NotImplementedError: + raise ComputationFailed('lcm', 2, exc) + + result = F.lcm(G) + + if not opt.polys: + return result.as_expr() + else: + return result + + +@public +def terms_gcd(f, *gens, **args): + """ + Remove GCD of terms from ``f``. + + If the ``deep`` flag is True, then the arguments of ``f`` will have + terms_gcd applied to them. + + If a fraction is factored out of ``f`` and ``f`` is an Add, then + an unevaluated Mul will be returned so that automatic simplification + does not redistribute it. The hint ``clear``, when set to False, can be + used to prevent such factoring when all coefficients are not fractions. + + Examples + ======== + + >>> from sympy import terms_gcd, cos + >>> from sympy.abc import x, y + >>> terms_gcd(x**6*y**2 + x**3*y, x, y) + x**3*y*(x**3*y + 1) + + The default action of polys routines is to expand the expression + given to them. terms_gcd follows this behavior: + + >>> terms_gcd((3+3*x)*(x+x*y)) + 3*x*(x*y + x + y + 1) + + If this is not desired then the hint ``expand`` can be set to False. + In this case the expression will be treated as though it were comprised + of one or more terms: + + >>> terms_gcd((3+3*x)*(x+x*y), expand=False) + (3*x + 3)*(x*y + x) + + In order to traverse factors of a Mul or the arguments of other + functions, the ``deep`` hint can be used: + + >>> terms_gcd((3 + 3*x)*(x + x*y), expand=False, deep=True) + 3*x*(x + 1)*(y + 1) + >>> terms_gcd(cos(x + x*y), deep=True) + cos(x*(y + 1)) + + Rationals are factored out by default: + + >>> terms_gcd(x + y/2) + (2*x + y)/2 + + Only the y-term had a coefficient that was a fraction; if one + does not want to factor out the 1/2 in cases like this, the + flag ``clear`` can be set to False: + + >>> terms_gcd(x + y/2, clear=False) + x + y/2 + >>> terms_gcd(x*y/2 + y**2, clear=False) + y*(x/2 + y) + + The ``clear`` flag is ignored if all coefficients are fractions: + + >>> terms_gcd(x/3 + y/2, clear=False) + (2*x + 3*y)/6 + + See Also + ======== + sympy.core.exprtools.gcd_terms, sympy.core.exprtools.factor_terms + + """ + + orig = sympify(f) + + if isinstance(f, Equality): + return Equality(*(terms_gcd(s, *gens, **args) for s in [f.lhs, f.rhs])) + elif isinstance(f, Relational): + raise TypeError("Inequalities cannot be used with terms_gcd. Found: %s" %(f,)) + + if not isinstance(f, Expr) or f.is_Atom: + return orig + + if args.get('deep', False): + new = f.func(*[terms_gcd(a, *gens, **args) for a in f.args]) + args.pop('deep') + args['expand'] = False + return terms_gcd(new, *gens, **args) + + clear = args.pop('clear', True) + options.allowed_flags(args, ['polys']) + + try: + F, opt = poly_from_expr(f, *gens, **args) + except PolificationFailed as exc: + return exc.expr + + J, f = F.terms_gcd() + + if opt.domain.is_Ring: + if opt.domain.is_Field: + denom, f = f.clear_denoms(convert=True) + + coeff, f = f.primitive() + + if opt.domain.is_Field: + coeff /= denom + else: + coeff = S.One + + term = Mul(*[x**j for x, j in zip(f.gens, J)]) + if equal_valued(coeff, 1): + coeff = S.One + if term == 1: + return orig + + if clear: + return _keep_coeff(coeff, term*f.as_expr()) + # base the clearing on the form of the original expression, not + # the (perhaps) Mul that we have now + coeff, f = _keep_coeff(coeff, f.as_expr(), clear=False).as_coeff_Mul() + return _keep_coeff(coeff, term*f, clear=False) + + +@public +def trunc(f, p, *gens, **args): + """ + Reduce ``f`` modulo a constant ``p``. + + Examples + ======== + + >>> from sympy import trunc + >>> from sympy.abc import x + + >>> trunc(2*x**3 + 3*x**2 + 5*x + 7, 3) + -x**3 - x + 1 + + """ + options.allowed_flags(args, ['auto', 'polys']) + + try: + F, opt = poly_from_expr(f, *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('trunc', 1, exc) + + result = F.trunc(sympify(p)) + + if not opt.polys: + return result.as_expr() + else: + return result + + +@public +def monic(f, *gens, **args): + """ + Divide all coefficients of ``f`` by ``LC(f)``. + + Examples + ======== + + >>> from sympy import monic + >>> from sympy.abc import x + + >>> monic(3*x**2 + 4*x + 2) + x**2 + 4*x/3 + 2/3 + + """ + options.allowed_flags(args, ['auto', 'polys']) + + try: + F, opt = poly_from_expr(f, *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('monic', 1, exc) + + result = F.monic(auto=opt.auto) + + if not opt.polys: + return result.as_expr() + else: + return result + + +@public +def content(f, *gens, **args): + """ + Compute GCD of coefficients of ``f``. + + Examples + ======== + + >>> from sympy import content + >>> from sympy.abc import x + + >>> content(6*x**2 + 8*x + 12) + 2 + + """ + options.allowed_flags(args, ['polys']) + + try: + F, opt = poly_from_expr(f, *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('content', 1, exc) + + return F.content() + + +@public +def primitive(f, *gens, **args): + """ + Compute content and the primitive form of ``f``. + + Examples + ======== + + >>> from sympy.polys.polytools import primitive + >>> from sympy.abc import x + + >>> primitive(6*x**2 + 8*x + 12) + (2, 3*x**2 + 4*x + 6) + + >>> eq = (2 + 2*x)*x + 2 + + Expansion is performed by default: + + >>> primitive(eq) + (2, x**2 + x + 1) + + Set ``expand`` to False to shut this off. Note that the + extraction will not be recursive; use the as_content_primitive method + for recursive, non-destructive Rational extraction. + + >>> primitive(eq, expand=False) + (1, x*(2*x + 2) + 2) + + >>> eq.as_content_primitive() + (2, x*(x + 1) + 1) + + """ + options.allowed_flags(args, ['polys']) + + try: + F, opt = poly_from_expr(f, *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('primitive', 1, exc) + + cont, result = F.primitive() + if not opt.polys: + return cont, result.as_expr() + else: + return cont, result + + +@public +def compose(f, g, *gens, **args): + """ + Compute functional composition ``f(g)``. + + Examples + ======== + + >>> from sympy import compose + >>> from sympy.abc import x + + >>> compose(x**2 + x, x - 1) + x**2 - x + + """ + options.allowed_flags(args, ['polys']) + + try: + (F, G), opt = parallel_poly_from_expr((f, g), *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('compose', 2, exc) + + result = F.compose(G) + + if not opt.polys: + return result.as_expr() + else: + return result + + +@public +def decompose(f, *gens, **args): + """ + Compute functional decomposition of ``f``. + + Examples + ======== + + >>> from sympy import decompose + >>> from sympy.abc import x + + >>> decompose(x**4 + 2*x**3 - x - 1) + [x**2 - x - 1, x**2 + x] + + """ + options.allowed_flags(args, ['polys']) + + try: + F, opt = poly_from_expr(f, *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('decompose', 1, exc) + + result = F.decompose() + + if not opt.polys: + return [r.as_expr() for r in result] + else: + return result + + +@public +def sturm(f, *gens, **args): + """ + Compute Sturm sequence of ``f``. + + Examples + ======== + + >>> from sympy import sturm + >>> from sympy.abc import x + + >>> sturm(x**3 - 2*x**2 + x - 3) + [x**3 - 2*x**2 + x - 3, 3*x**2 - 4*x + 1, 2*x/9 + 25/9, -2079/4] + + """ + options.allowed_flags(args, ['auto', 'polys']) + + try: + F, opt = poly_from_expr(f, *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('sturm', 1, exc) + + result = F.sturm(auto=opt.auto) + + if not opt.polys: + return [r.as_expr() for r in result] + else: + return result + + +@public +def gff_list(f, *gens, **args): + """ + Compute a list of greatest factorial factors of ``f``. + + Note that the input to ff() and rf() should be Poly instances to use the + definitions here. + + Examples + ======== + + >>> from sympy import gff_list, ff, Poly + >>> from sympy.abc import x + + >>> f = Poly(x**5 + 2*x**4 - x**3 - 2*x**2, x) + + >>> gff_list(f) + [(Poly(x, x, domain='ZZ'), 1), (Poly(x + 2, x, domain='ZZ'), 4)] + + >>> (ff(Poly(x), 1)*ff(Poly(x + 2), 4)) == f + True + + >>> f = Poly(x**12 + 6*x**11 - 11*x**10 - 56*x**9 + 220*x**8 + 208*x**7 - \ + 1401*x**6 + 1090*x**5 + 2715*x**4 - 6720*x**3 - 1092*x**2 + 5040*x, x) + + >>> gff_list(f) + [(Poly(x**3 + 7, x, domain='ZZ'), 2), (Poly(x**2 + 5*x, x, domain='ZZ'), 3)] + + >>> ff(Poly(x**3 + 7, x), 2)*ff(Poly(x**2 + 5*x, x), 3) == f + True + + """ + options.allowed_flags(args, ['polys']) + + try: + F, opt = poly_from_expr(f, *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('gff_list', 1, exc) + + factors = F.gff_list() + + if not opt.polys: + return [(g.as_expr(), k) for g, k in factors] + else: + return factors + + +@public +def gff(f, *gens, **args): + """Compute greatest factorial factorization of ``f``. """ + raise NotImplementedError('symbolic falling factorial') + + +@public +def sqf_norm(f, *gens, **args): + """ + Compute square-free norm of ``f``. + + Returns ``s``, ``f``, ``r``, such that ``g(x) = f(x-sa)`` and + ``r(x) = Norm(g(x))`` is a square-free polynomial over ``K``, + where ``a`` is the algebraic extension of the ground domain. + + Examples + ======== + + >>> from sympy import sqf_norm, sqrt + >>> from sympy.abc import x + + >>> sqf_norm(x**2 + 1, extension=[sqrt(3)]) + (1, x**2 - 2*sqrt(3)*x + 4, x**4 - 4*x**2 + 16) + + """ + options.allowed_flags(args, ['polys']) + + try: + F, opt = poly_from_expr(f, *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('sqf_norm', 1, exc) + + s, g, r = F.sqf_norm() + + if not opt.polys: + return Integer(s), g.as_expr(), r.as_expr() + else: + return Integer(s), g, r + + +@public +def sqf_part(f, *gens, **args): + """ + Compute square-free part of ``f``. + + Examples + ======== + + >>> from sympy import sqf_part + >>> from sympy.abc import x + + >>> sqf_part(x**3 - 3*x - 2) + x**2 - x - 2 + + """ + options.allowed_flags(args, ['polys']) + + try: + F, opt = poly_from_expr(f, *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('sqf_part', 1, exc) + + result = F.sqf_part() + + if not opt.polys: + return result.as_expr() + else: + return result + + +def _sorted_factors(factors, method): + """Sort a list of ``(expr, exp)`` pairs. """ + if method == 'sqf': + def key(obj): + poly, exp = obj + rep = poly.rep.rep + return (exp, len(rep), len(poly.gens), str(poly.domain), rep) + else: + def key(obj): + poly, exp = obj + rep = poly.rep.rep + return (len(rep), len(poly.gens), exp, str(poly.domain), rep) + + return sorted(factors, key=key) + + +def _factors_product(factors): + """Multiply a list of ``(expr, exp)`` pairs. """ + return Mul(*[f.as_expr()**k for f, k in factors]) + + +def _symbolic_factor_list(expr, opt, method): + """Helper function for :func:`_symbolic_factor`. """ + coeff, factors = S.One, [] + + args = [i._eval_factor() if hasattr(i, '_eval_factor') else i + for i in Mul.make_args(expr)] + for arg in args: + if arg.is_Number or (isinstance(arg, Expr) and pure_complex(arg)): + coeff *= arg + continue + elif arg.is_Pow and arg.base != S.Exp1: + base, exp = arg.args + if base.is_Number and exp.is_Number: + coeff *= arg + continue + if base.is_Number: + factors.append((base, exp)) + continue + else: + base, exp = arg, S.One + + try: + poly, _ = _poly_from_expr(base, opt) + except PolificationFailed as exc: + factors.append((exc.expr, exp)) + else: + func = getattr(poly, method + '_list') + + _coeff, _factors = func() + if _coeff is not S.One: + if exp.is_Integer: + coeff *= _coeff**exp + elif _coeff.is_positive: + factors.append((_coeff, exp)) + else: + _factors.append((_coeff, S.One)) + + if exp is S.One: + factors.extend(_factors) + elif exp.is_integer: + factors.extend([(f, k*exp) for f, k in _factors]) + else: + other = [] + + for f, k in _factors: + if f.as_expr().is_positive: + factors.append((f, k*exp)) + else: + other.append((f, k)) + + factors.append((_factors_product(other), exp)) + if method == 'sqf': + factors = [(reduce(mul, (f for f, _ in factors if _ == k)), k) + for k in {i for _, i in factors}] + + return coeff, factors + + +def _symbolic_factor(expr, opt, method): + """Helper function for :func:`_factor`. """ + if isinstance(expr, Expr): + if hasattr(expr,'_eval_factor'): + return expr._eval_factor() + coeff, factors = _symbolic_factor_list(together(expr, fraction=opt['fraction']), opt, method) + return _keep_coeff(coeff, _factors_product(factors)) + elif hasattr(expr, 'args'): + return expr.func(*[_symbolic_factor(arg, opt, method) for arg in expr.args]) + elif hasattr(expr, '__iter__'): + return expr.__class__([_symbolic_factor(arg, opt, method) for arg in expr]) + else: + return expr + + +def _generic_factor_list(expr, gens, args, method): + """Helper function for :func:`sqf_list` and :func:`factor_list`. """ + options.allowed_flags(args, ['frac', 'polys']) + opt = options.build_options(gens, args) + + expr = sympify(expr) + + if isinstance(expr, (Expr, Poly)): + if isinstance(expr, Poly): + numer, denom = expr, 1 + else: + numer, denom = together(expr).as_numer_denom() + + cp, fp = _symbolic_factor_list(numer, opt, method) + cq, fq = _symbolic_factor_list(denom, opt, method) + + if fq and not opt.frac: + raise PolynomialError("a polynomial expected, got %s" % expr) + + _opt = opt.clone({"expand": True}) + + for factors in (fp, fq): + for i, (f, k) in enumerate(factors): + if not f.is_Poly: + f, _ = _poly_from_expr(f, _opt) + factors[i] = (f, k) + + fp = _sorted_factors(fp, method) + fq = _sorted_factors(fq, method) + + if not opt.polys: + fp = [(f.as_expr(), k) for f, k in fp] + fq = [(f.as_expr(), k) for f, k in fq] + + coeff = cp/cq + + if not opt.frac: + return coeff, fp + else: + return coeff, fp, fq + else: + raise PolynomialError("a polynomial expected, got %s" % expr) + + +def _generic_factor(expr, gens, args, method): + """Helper function for :func:`sqf` and :func:`factor`. """ + fraction = args.pop('fraction', True) + options.allowed_flags(args, []) + opt = options.build_options(gens, args) + opt['fraction'] = fraction + return _symbolic_factor(sympify(expr), opt, method) + + +def to_rational_coeffs(f): + """ + try to transform a polynomial to have rational coefficients + + try to find a transformation ``x = alpha*y`` + + ``f(x) = lc*alpha**n * g(y)`` where ``g`` is a polynomial with + rational coefficients, ``lc`` the leading coefficient. + + If this fails, try ``x = y + beta`` + ``f(x) = g(y)`` + + Returns ``None`` if ``g`` not found; + ``(lc, alpha, None, g)`` in case of rescaling + ``(None, None, beta, g)`` in case of translation + + Notes + ===== + + Currently it transforms only polynomials without roots larger than 2. + + Examples + ======== + + >>> from sympy import sqrt, Poly, simplify + >>> from sympy.polys.polytools import to_rational_coeffs + >>> from sympy.abc import x + >>> p = Poly(((x**2-1)*(x-2)).subs({x:x*(1 + sqrt(2))}), x, domain='EX') + >>> lc, r, _, g = to_rational_coeffs(p) + >>> lc, r + (7 + 5*sqrt(2), 2 - 2*sqrt(2)) + >>> g + Poly(x**3 + x**2 - 1/4*x - 1/4, x, domain='QQ') + >>> r1 = simplify(1/r) + >>> Poly(lc*r**3*(g.as_expr()).subs({x:x*r1}), x, domain='EX') == p + True + + """ + from sympy.simplify.simplify import simplify + + def _try_rescale(f, f1=None): + """ + try rescaling ``x -> alpha*x`` to convert f to a polynomial + with rational coefficients. + Returns ``alpha, f``; if the rescaling is successful, + ``alpha`` is the rescaling factor, and ``f`` is the rescaled + polynomial; else ``alpha`` is ``None``. + """ + if not len(f.gens) == 1 or not (f.gens[0]).is_Atom: + return None, f + n = f.degree() + lc = f.LC() + f1 = f1 or f1.monic() + coeffs = f1.all_coeffs()[1:] + coeffs = [simplify(coeffx) for coeffx in coeffs] + if len(coeffs) > 1 and coeffs[-2]: + rescale1_x = simplify(coeffs[-2]/coeffs[-1]) + coeffs1 = [] + for i in range(len(coeffs)): + coeffx = simplify(coeffs[i]*rescale1_x**(i + 1)) + if not coeffx.is_rational: + break + coeffs1.append(coeffx) + else: + rescale_x = simplify(1/rescale1_x) + x = f.gens[0] + v = [x**n] + for i in range(1, n + 1): + v.append(coeffs1[i - 1]*x**(n - i)) + f = Add(*v) + f = Poly(f) + return lc, rescale_x, f + return None + + def _try_translate(f, f1=None): + """ + try translating ``x -> x + alpha`` to convert f to a polynomial + with rational coefficients. + Returns ``alpha, f``; if the translating is successful, + ``alpha`` is the translating factor, and ``f`` is the shifted + polynomial; else ``alpha`` is ``None``. + """ + if not len(f.gens) == 1 or not (f.gens[0]).is_Atom: + return None, f + n = f.degree() + f1 = f1 or f1.monic() + coeffs = f1.all_coeffs()[1:] + c = simplify(coeffs[0]) + if c.is_Add and not c.is_rational: + rat, nonrat = sift(c.args, + lambda z: z.is_rational is True, binary=True) + alpha = -c.func(*nonrat)/n + f2 = f1.shift(alpha) + return alpha, f2 + return None + + def _has_square_roots(p): + """ + Return True if ``f`` is a sum with square roots but no other root + """ + coeffs = p.coeffs() + has_sq = False + for y in coeffs: + for x in Add.make_args(y): + f = Factors(x).factors + r = [wx.q for b, wx in f.items() if + b.is_number and wx.is_Rational and wx.q >= 2] + if not r: + continue + if min(r) == 2: + has_sq = True + if max(r) > 2: + return False + return has_sq + + if f.get_domain().is_EX and _has_square_roots(f): + f1 = f.monic() + r = _try_rescale(f, f1) + if r: + return r[0], r[1], None, r[2] + else: + r = _try_translate(f, f1) + if r: + return None, None, r[0], r[1] + return None + + +def _torational_factor_list(p, x): + """ + helper function to factor polynomial using to_rational_coeffs + + Examples + ======== + + >>> from sympy.polys.polytools import _torational_factor_list + >>> from sympy.abc import x + >>> from sympy import sqrt, expand, Mul + >>> p = expand(((x**2-1)*(x-2)).subs({x:x*(1 + sqrt(2))})) + >>> factors = _torational_factor_list(p, x); factors + (-2, [(-x*(1 + sqrt(2))/2 + 1, 1), (-x*(1 + sqrt(2)) - 1, 1), (-x*(1 + sqrt(2)) + 1, 1)]) + >>> expand(factors[0]*Mul(*[z[0] for z in factors[1]])) == p + True + >>> p = expand(((x**2-1)*(x-2)).subs({x:x + sqrt(2)})) + >>> factors = _torational_factor_list(p, x); factors + (1, [(x - 2 + sqrt(2), 1), (x - 1 + sqrt(2), 1), (x + 1 + sqrt(2), 1)]) + >>> expand(factors[0]*Mul(*[z[0] for z in factors[1]])) == p + True + + """ + from sympy.simplify.simplify import simplify + p1 = Poly(p, x, domain='EX') + n = p1.degree() + res = to_rational_coeffs(p1) + if not res: + return None + lc, r, t, g = res + factors = factor_list(g.as_expr()) + if lc: + c = simplify(factors[0]*lc*r**n) + r1 = simplify(1/r) + a = [] + for z in factors[1:][0]: + a.append((simplify(z[0].subs({x: x*r1})), z[1])) + else: + c = factors[0] + a = [] + for z in factors[1:][0]: + a.append((z[0].subs({x: x - t}), z[1])) + return (c, a) + + +@public +def sqf_list(f, *gens, **args): + """ + Compute a list of square-free factors of ``f``. + + Examples + ======== + + >>> from sympy import sqf_list + >>> from sympy.abc import x + + >>> sqf_list(2*x**5 + 16*x**4 + 50*x**3 + 76*x**2 + 56*x + 16) + (2, [(x + 1, 2), (x + 2, 3)]) + + """ + return _generic_factor_list(f, gens, args, method='sqf') + + +@public +def sqf(f, *gens, **args): + """ + Compute square-free factorization of ``f``. + + Examples + ======== + + >>> from sympy import sqf + >>> from sympy.abc import x + + >>> sqf(2*x**5 + 16*x**4 + 50*x**3 + 76*x**2 + 56*x + 16) + 2*(x + 1)**2*(x + 2)**3 + + """ + return _generic_factor(f, gens, args, method='sqf') + + +@public +def factor_list(f, *gens, **args): + """ + Compute a list of irreducible factors of ``f``. + + Examples + ======== + + >>> from sympy import factor_list + >>> from sympy.abc import x, y + + >>> factor_list(2*x**5 + 2*x**4*y + 4*x**3 + 4*x**2*y + 2*x + 2*y) + (2, [(x + y, 1), (x**2 + 1, 2)]) + + """ + return _generic_factor_list(f, gens, args, method='factor') + + +@public +def factor(f, *gens, deep=False, **args): + """ + Compute the factorization of expression, ``f``, into irreducibles. (To + factor an integer into primes, use ``factorint``.) + + There two modes implemented: symbolic and formal. If ``f`` is not an + instance of :class:`Poly` and generators are not specified, then the + former mode is used. Otherwise, the formal mode is used. + + In symbolic mode, :func:`factor` will traverse the expression tree and + factor its components without any prior expansion, unless an instance + of :class:`~.Add` is encountered (in this case formal factorization is + used). This way :func:`factor` can handle large or symbolic exponents. + + By default, the factorization is computed over the rationals. To factor + over other domain, e.g. an algebraic or finite field, use appropriate + options: ``extension``, ``modulus`` or ``domain``. + + Examples + ======== + + >>> from sympy import factor, sqrt, exp + >>> from sympy.abc import x, y + + >>> factor(2*x**5 + 2*x**4*y + 4*x**3 + 4*x**2*y + 2*x + 2*y) + 2*(x + y)*(x**2 + 1)**2 + + >>> factor(x**2 + 1) + x**2 + 1 + >>> factor(x**2 + 1, modulus=2) + (x + 1)**2 + >>> factor(x**2 + 1, gaussian=True) + (x - I)*(x + I) + + >>> factor(x**2 - 2, extension=sqrt(2)) + (x - sqrt(2))*(x + sqrt(2)) + + >>> factor((x**2 - 1)/(x**2 + 4*x + 4)) + (x - 1)*(x + 1)/(x + 2)**2 + >>> factor((x**2 + 4*x + 4)**10000000*(x**2 + 1)) + (x + 2)**20000000*(x**2 + 1) + + By default, factor deals with an expression as a whole: + + >>> eq = 2**(x**2 + 2*x + 1) + >>> factor(eq) + 2**(x**2 + 2*x + 1) + + If the ``deep`` flag is True then subexpressions will + be factored: + + >>> factor(eq, deep=True) + 2**((x + 1)**2) + + If the ``fraction`` flag is False then rational expressions + will not be combined. By default it is True. + + >>> factor(5*x + 3*exp(2 - 7*x), deep=True) + (5*x*exp(7*x) + 3*exp(2))*exp(-7*x) + >>> factor(5*x + 3*exp(2 - 7*x), deep=True, fraction=False) + 5*x + 3*exp(2)*exp(-7*x) + + See Also + ======== + sympy.ntheory.factor_.factorint + + """ + f = sympify(f) + if deep: + def _try_factor(expr): + """ + Factor, but avoid changing the expression when unable to. + """ + fac = factor(expr, *gens, **args) + if fac.is_Mul or fac.is_Pow: + return fac + return expr + + f = bottom_up(f, _try_factor) + # clean up any subexpressions that may have been expanded + # while factoring out a larger expression + partials = {} + muladd = f.atoms(Mul, Add) + for p in muladd: + fac = factor(p, *gens, **args) + if (fac.is_Mul or fac.is_Pow) and fac != p: + partials[p] = fac + return f.xreplace(partials) + + try: + return _generic_factor(f, gens, args, method='factor') + except PolynomialError as msg: + if not f.is_commutative: + return factor_nc(f) + else: + raise PolynomialError(msg) + + +@public +def intervals(F, all=False, eps=None, inf=None, sup=None, strict=False, fast=False, sqf=False): + """ + Compute isolating intervals for roots of ``f``. + + Examples + ======== + + >>> from sympy import intervals + >>> from sympy.abc import x + + >>> intervals(x**2 - 3) + [((-2, -1), 1), ((1, 2), 1)] + >>> intervals(x**2 - 3, eps=1e-2) + [((-26/15, -19/11), 1), ((19/11, 26/15), 1)] + + """ + if not hasattr(F, '__iter__'): + try: + F = Poly(F) + except GeneratorsNeeded: + return [] + + return F.intervals(all=all, eps=eps, inf=inf, sup=sup, fast=fast, sqf=sqf) + else: + polys, opt = parallel_poly_from_expr(F, domain='QQ') + + if len(opt.gens) > 1: + raise MultivariatePolynomialError + + for i, poly in enumerate(polys): + polys[i] = poly.rep.rep + + if eps is not None: + eps = opt.domain.convert(eps) + + if eps <= 0: + raise ValueError("'eps' must be a positive rational") + + if inf is not None: + inf = opt.domain.convert(inf) + if sup is not None: + sup = opt.domain.convert(sup) + + intervals = dup_isolate_real_roots_list(polys, opt.domain, + eps=eps, inf=inf, sup=sup, strict=strict, fast=fast) + + result = [] + + for (s, t), indices in intervals: + s, t = opt.domain.to_sympy(s), opt.domain.to_sympy(t) + result.append(((s, t), indices)) + + return result + + +@public +def refine_root(f, s, t, eps=None, steps=None, fast=False, check_sqf=False): + """ + Refine an isolating interval of a root to the given precision. + + Examples + ======== + + >>> from sympy import refine_root + >>> from sympy.abc import x + + >>> refine_root(x**2 - 3, 1, 2, eps=1e-2) + (19/11, 26/15) + + """ + try: + F = Poly(f) + if not isinstance(f, Poly) and not F.gen.is_Symbol: + # root of sin(x) + 1 is -1 but when someone + # passes an Expr instead of Poly they may not expect + # that the generator will be sin(x), not x + raise PolynomialError("generator must be a Symbol") + except GeneratorsNeeded: + raise PolynomialError( + "Cannot refine a root of %s, not a polynomial" % f) + + return F.refine_root(s, t, eps=eps, steps=steps, fast=fast, check_sqf=check_sqf) + + +@public +def count_roots(f, inf=None, sup=None): + """ + Return the number of roots of ``f`` in ``[inf, sup]`` interval. + + If one of ``inf`` or ``sup`` is complex, it will return the number of roots + in the complex rectangle with corners at ``inf`` and ``sup``. + + Examples + ======== + + >>> from sympy import count_roots, I + >>> from sympy.abc import x + + >>> count_roots(x**4 - 4, -3, 3) + 2 + >>> count_roots(x**4 - 4, 0, 1 + 3*I) + 1 + + """ + try: + F = Poly(f, greedy=False) + if not isinstance(f, Poly) and not F.gen.is_Symbol: + # root of sin(x) + 1 is -1 but when someone + # passes an Expr instead of Poly they may not expect + # that the generator will be sin(x), not x + raise PolynomialError("generator must be a Symbol") + except GeneratorsNeeded: + raise PolynomialError("Cannot count roots of %s, not a polynomial" % f) + + return F.count_roots(inf=inf, sup=sup) + + +@public +def real_roots(f, multiple=True): + """ + Return a list of real roots with multiplicities of ``f``. + + Examples + ======== + + >>> from sympy import real_roots + >>> from sympy.abc import x + + >>> real_roots(2*x**3 - 7*x**2 + 4*x + 4) + [-1/2, 2, 2] + """ + try: + F = Poly(f, greedy=False) + if not isinstance(f, Poly) and not F.gen.is_Symbol: + # root of sin(x) + 1 is -1 but when someone + # passes an Expr instead of Poly they may not expect + # that the generator will be sin(x), not x + raise PolynomialError("generator must be a Symbol") + except GeneratorsNeeded: + raise PolynomialError( + "Cannot compute real roots of %s, not a polynomial" % f) + + return F.real_roots(multiple=multiple) + + +@public +def nroots(f, n=15, maxsteps=50, cleanup=True): + """ + Compute numerical approximations of roots of ``f``. + + Examples + ======== + + >>> from sympy import nroots + >>> from sympy.abc import x + + >>> nroots(x**2 - 3, n=15) + [-1.73205080756888, 1.73205080756888] + >>> nroots(x**2 - 3, n=30) + [-1.73205080756887729352744634151, 1.73205080756887729352744634151] + + """ + try: + F = Poly(f, greedy=False) + if not isinstance(f, Poly) and not F.gen.is_Symbol: + # root of sin(x) + 1 is -1 but when someone + # passes an Expr instead of Poly they may not expect + # that the generator will be sin(x), not x + raise PolynomialError("generator must be a Symbol") + except GeneratorsNeeded: + raise PolynomialError( + "Cannot compute numerical roots of %s, not a polynomial" % f) + + return F.nroots(n=n, maxsteps=maxsteps, cleanup=cleanup) + + +@public +def ground_roots(f, *gens, **args): + """ + Compute roots of ``f`` by factorization in the ground domain. + + Examples + ======== + + >>> from sympy import ground_roots + >>> from sympy.abc import x + + >>> ground_roots(x**6 - 4*x**4 + 4*x**3 - x**2) + {0: 2, 1: 2} + + """ + options.allowed_flags(args, []) + + try: + F, opt = poly_from_expr(f, *gens, **args) + if not isinstance(f, Poly) and not F.gen.is_Symbol: + # root of sin(x) + 1 is -1 but when someone + # passes an Expr instead of Poly they may not expect + # that the generator will be sin(x), not x + raise PolynomialError("generator must be a Symbol") + except PolificationFailed as exc: + raise ComputationFailed('ground_roots', 1, exc) + + return F.ground_roots() + + +@public +def nth_power_roots_poly(f, n, *gens, **args): + """ + Construct a polynomial with n-th powers of roots of ``f``. + + Examples + ======== + + >>> from sympy import nth_power_roots_poly, factor, roots + >>> from sympy.abc import x + + >>> f = x**4 - x**2 + 1 + >>> g = factor(nth_power_roots_poly(f, 2)) + + >>> g + (x**2 - x + 1)**2 + + >>> R_f = [ (r**2).expand() for r in roots(f) ] + >>> R_g = roots(g).keys() + + >>> set(R_f) == set(R_g) + True + + """ + options.allowed_flags(args, []) + + try: + F, opt = poly_from_expr(f, *gens, **args) + if not isinstance(f, Poly) and not F.gen.is_Symbol: + # root of sin(x) + 1 is -1 but when someone + # passes an Expr instead of Poly they may not expect + # that the generator will be sin(x), not x + raise PolynomialError("generator must be a Symbol") + except PolificationFailed as exc: + raise ComputationFailed('nth_power_roots_poly', 1, exc) + + result = F.nth_power_roots_poly(n) + + if not opt.polys: + return result.as_expr() + else: + return result + + +@public +def cancel(f, *gens, _signsimp=True, **args): + """ + Cancel common factors in a rational function ``f``. + + Examples + ======== + + >>> from sympy import cancel, sqrt, Symbol, together + >>> from sympy.abc import x + >>> A = Symbol('A', commutative=False) + + >>> cancel((2*x**2 - 2)/(x**2 - 2*x + 1)) + (2*x + 2)/(x - 1) + >>> cancel((sqrt(3) + sqrt(15)*A)/(sqrt(2) + sqrt(10)*A)) + sqrt(6)/2 + + Note: due to automatic distribution of Rationals, a sum divided by an integer + will appear as a sum. To recover a rational form use `together` on the result: + + >>> cancel(x/2 + 1) + x/2 + 1 + >>> together(_) + (x + 2)/2 + """ + from sympy.simplify.simplify import signsimp + from sympy.polys.rings import sring + options.allowed_flags(args, ['polys']) + + f = sympify(f) + if _signsimp: + f = signsimp(f) + opt = {} + if 'polys' in args: + opt['polys'] = args['polys'] + + if not isinstance(f, (tuple, Tuple)): + if f.is_Number or isinstance(f, Relational) or not isinstance(f, Expr): + return f + f = factor_terms(f, radical=True) + p, q = f.as_numer_denom() + + elif len(f) == 2: + p, q = f + if isinstance(p, Poly) and isinstance(q, Poly): + opt['gens'] = p.gens + opt['domain'] = p.domain + opt['polys'] = opt.get('polys', True) + p, q = p.as_expr(), q.as_expr() + elif isinstance(f, Tuple): + return factor_terms(f) + else: + raise ValueError('unexpected argument: %s' % f) + + from sympy.functions.elementary.piecewise import Piecewise + try: + if f.has(Piecewise): + raise PolynomialError() + R, (F, G) = sring((p, q), *gens, **args) + if not R.ngens: + if not isinstance(f, (tuple, Tuple)): + return f.expand() + else: + return S.One, p, q + except PolynomialError as msg: + if f.is_commutative and not f.has(Piecewise): + raise PolynomialError(msg) + # Handling of noncommutative and/or piecewise expressions + if f.is_Add or f.is_Mul: + c, nc = sift(f.args, lambda x: + x.is_commutative is True and not x.has(Piecewise), + binary=True) + nc = [cancel(i) for i in nc] + return f.func(cancel(f.func(*c)), *nc) + else: + reps = [] + pot = preorder_traversal(f) + next(pot) + for e in pot: + # XXX: This should really skip anything that's not Expr. + if isinstance(e, (tuple, Tuple, BooleanAtom)): + continue + try: + reps.append((e, cancel(e))) + pot.skip() # this was handled successfully + except NotImplementedError: + pass + return f.xreplace(dict(reps)) + + c, (P, Q) = 1, F.cancel(G) + if opt.get('polys', False) and 'gens' not in opt: + opt['gens'] = R.symbols + + if not isinstance(f, (tuple, Tuple)): + return c*(P.as_expr()/Q.as_expr()) + else: + P, Q = P.as_expr(), Q.as_expr() + if not opt.get('polys', False): + return c, P, Q + else: + return c, Poly(P, *gens, **opt), Poly(Q, *gens, **opt) + + +@public +def reduced(f, G, *gens, **args): + """ + Reduces a polynomial ``f`` modulo a set of polynomials ``G``. + + Given a polynomial ``f`` and a set of polynomials ``G = (g_1, ..., g_n)``, + computes a set of quotients ``q = (q_1, ..., q_n)`` and the remainder ``r`` + such that ``f = q_1*g_1 + ... + q_n*g_n + r``, where ``r`` vanishes or ``r`` + is a completely reduced polynomial with respect to ``G``. + + Examples + ======== + + >>> from sympy import reduced + >>> from sympy.abc import x, y + + >>> reduced(2*x**4 + y**2 - x**2 + y**3, [x**3 - x, y**3 - y]) + ([2*x, 1], x**2 + y**2 + y) + + """ + options.allowed_flags(args, ['polys', 'auto']) + + try: + polys, opt = parallel_poly_from_expr([f] + list(G), *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('reduced', 0, exc) + + domain = opt.domain + retract = False + + if opt.auto and domain.is_Ring and not domain.is_Field: + opt = opt.clone({"domain": domain.get_field()}) + retract = True + + from sympy.polys.rings import xring + _ring, _ = xring(opt.gens, opt.domain, opt.order) + + for i, poly in enumerate(polys): + poly = poly.set_domain(opt.domain).rep.to_dict() + polys[i] = _ring.from_dict(poly) + + Q, r = polys[0].div(polys[1:]) + + Q = [Poly._from_dict(dict(q), opt) for q in Q] + r = Poly._from_dict(dict(r), opt) + + if retract: + try: + _Q, _r = [q.to_ring() for q in Q], r.to_ring() + except CoercionFailed: + pass + else: + Q, r = _Q, _r + + if not opt.polys: + return [q.as_expr() for q in Q], r.as_expr() + else: + return Q, r + + +@public +def groebner(F, *gens, **args): + """ + Computes the reduced Groebner basis for a set of polynomials. + + Use the ``order`` argument to set the monomial ordering that will be + used to compute the basis. Allowed orders are ``lex``, ``grlex`` and + ``grevlex``. If no order is specified, it defaults to ``lex``. + + For more information on Groebner bases, see the references and the docstring + of :func:`~.solve_poly_system`. + + Examples + ======== + + Example taken from [1]. + + >>> from sympy import groebner + >>> from sympy.abc import x, y + + >>> F = [x*y - 2*y, 2*y**2 - x**2] + + >>> groebner(F, x, y, order='lex') + GroebnerBasis([x**2 - 2*y**2, x*y - 2*y, y**3 - 2*y], x, y, + domain='ZZ', order='lex') + >>> groebner(F, x, y, order='grlex') + GroebnerBasis([y**3 - 2*y, x**2 - 2*y**2, x*y - 2*y], x, y, + domain='ZZ', order='grlex') + >>> groebner(F, x, y, order='grevlex') + GroebnerBasis([y**3 - 2*y, x**2 - 2*y**2, x*y - 2*y], x, y, + domain='ZZ', order='grevlex') + + By default, an improved implementation of the Buchberger algorithm is + used. Optionally, an implementation of the F5B algorithm can be used. The + algorithm can be set using the ``method`` flag or with the + :func:`sympy.polys.polyconfig.setup` function. + + >>> F = [x**2 - x - 1, (2*x - 1) * y - (x**10 - (1 - x)**10)] + + >>> groebner(F, x, y, method='buchberger') + GroebnerBasis([x**2 - x - 1, y - 55], x, y, domain='ZZ', order='lex') + >>> groebner(F, x, y, method='f5b') + GroebnerBasis([x**2 - x - 1, y - 55], x, y, domain='ZZ', order='lex') + + References + ========== + + 1. [Buchberger01]_ + 2. [Cox97]_ + + """ + return GroebnerBasis(F, *gens, **args) + + +@public +def is_zero_dimensional(F, *gens, **args): + """ + Checks if the ideal generated by a Groebner basis is zero-dimensional. + + The algorithm checks if the set of monomials not divisible by the + leading monomial of any element of ``F`` is bounded. + + References + ========== + + David A. Cox, John B. Little, Donal O'Shea. Ideals, Varieties and + Algorithms, 3rd edition, p. 230 + + """ + return GroebnerBasis(F, *gens, **args).is_zero_dimensional + + +@public +class GroebnerBasis(Basic): + """Represents a reduced Groebner basis. """ + + def __new__(cls, F, *gens, **args): + """Compute a reduced Groebner basis for a system of polynomials. """ + options.allowed_flags(args, ['polys', 'method']) + + try: + polys, opt = parallel_poly_from_expr(F, *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('groebner', len(F), exc) + + from sympy.polys.rings import PolyRing + ring = PolyRing(opt.gens, opt.domain, opt.order) + + polys = [ring.from_dict(poly.rep.to_dict()) for poly in polys if poly] + + G = _groebner(polys, ring, method=opt.method) + G = [Poly._from_dict(g, opt) for g in G] + + return cls._new(G, opt) + + @classmethod + def _new(cls, basis, options): + obj = Basic.__new__(cls) + + obj._basis = tuple(basis) + obj._options = options + + return obj + + @property + def args(self): + basis = (p.as_expr() for p in self._basis) + return (Tuple(*basis), Tuple(*self._options.gens)) + + @property + def exprs(self): + return [poly.as_expr() for poly in self._basis] + + @property + def polys(self): + return list(self._basis) + + @property + def gens(self): + return self._options.gens + + @property + def domain(self): + return self._options.domain + + @property + def order(self): + return self._options.order + + def __len__(self): + return len(self._basis) + + def __iter__(self): + if self._options.polys: + return iter(self.polys) + else: + return iter(self.exprs) + + def __getitem__(self, item): + if self._options.polys: + basis = self.polys + else: + basis = self.exprs + + return basis[item] + + def __hash__(self): + return hash((self._basis, tuple(self._options.items()))) + + def __eq__(self, other): + if isinstance(other, self.__class__): + return self._basis == other._basis and self._options == other._options + elif iterable(other): + return self.polys == list(other) or self.exprs == list(other) + else: + return False + + def __ne__(self, other): + return not self == other + + @property + def is_zero_dimensional(self): + """ + Checks if the ideal generated by a Groebner basis is zero-dimensional. + + The algorithm checks if the set of monomials not divisible by the + leading monomial of any element of ``F`` is bounded. + + References + ========== + + David A. Cox, John B. Little, Donal O'Shea. Ideals, Varieties and + Algorithms, 3rd edition, p. 230 + + """ + def single_var(monomial): + return sum(map(bool, monomial)) == 1 + + exponents = Monomial([0]*len(self.gens)) + order = self._options.order + + for poly in self.polys: + monomial = poly.LM(order=order) + + if single_var(monomial): + exponents *= monomial + + # If any element of the exponents vector is zero, then there's + # a variable for which there's no degree bound and the ideal + # generated by this Groebner basis isn't zero-dimensional. + return all(exponents) + + def fglm(self, order): + """ + Convert a Groebner basis from one ordering to another. + + The FGLM algorithm converts reduced Groebner bases of zero-dimensional + ideals from one ordering to another. This method is often used when it + is infeasible to compute a Groebner basis with respect to a particular + ordering directly. + + Examples + ======== + + >>> from sympy.abc import x, y + >>> from sympy import groebner + + >>> F = [x**2 - 3*y - x + 1, y**2 - 2*x + y - 1] + >>> G = groebner(F, x, y, order='grlex') + + >>> list(G.fglm('lex')) + [2*x - y**2 - y + 1, y**4 + 2*y**3 - 3*y**2 - 16*y + 7] + >>> list(groebner(F, x, y, order='lex')) + [2*x - y**2 - y + 1, y**4 + 2*y**3 - 3*y**2 - 16*y + 7] + + References + ========== + + .. [1] J.C. Faugere, P. Gianni, D. Lazard, T. Mora (1994). Efficient + Computation of Zero-dimensional Groebner Bases by Change of + Ordering + + """ + opt = self._options + + src_order = opt.order + dst_order = monomial_key(order) + + if src_order == dst_order: + return self + + if not self.is_zero_dimensional: + raise NotImplementedError("Cannot convert Groebner bases of ideals with positive dimension") + + polys = list(self._basis) + domain = opt.domain + + opt = opt.clone({ + "domain": domain.get_field(), + "order": dst_order, + }) + + from sympy.polys.rings import xring + _ring, _ = xring(opt.gens, opt.domain, src_order) + + for i, poly in enumerate(polys): + poly = poly.set_domain(opt.domain).rep.to_dict() + polys[i] = _ring.from_dict(poly) + + G = matrix_fglm(polys, _ring, dst_order) + G = [Poly._from_dict(dict(g), opt) for g in G] + + if not domain.is_Field: + G = [g.clear_denoms(convert=True)[1] for g in G] + opt.domain = domain + + return self._new(G, opt) + + def reduce(self, expr, auto=True): + """ + Reduces a polynomial modulo a Groebner basis. + + Given a polynomial ``f`` and a set of polynomials ``G = (g_1, ..., g_n)``, + computes a set of quotients ``q = (q_1, ..., q_n)`` and the remainder ``r`` + such that ``f = q_1*f_1 + ... + q_n*f_n + r``, where ``r`` vanishes or ``r`` + is a completely reduced polynomial with respect to ``G``. + + Examples + ======== + + >>> from sympy import groebner, expand + >>> from sympy.abc import x, y + + >>> f = 2*x**4 - x**2 + y**3 + y**2 + >>> G = groebner([x**3 - x, y**3 - y]) + + >>> G.reduce(f) + ([2*x, 1], x**2 + y**2 + y) + >>> Q, r = _ + + >>> expand(sum(q*g for q, g in zip(Q, G)) + r) + 2*x**4 - x**2 + y**3 + y**2 + >>> _ == f + True + + """ + poly = Poly._from_expr(expr, self._options) + polys = [poly] + list(self._basis) + + opt = self._options + domain = opt.domain + + retract = False + + if auto and domain.is_Ring and not domain.is_Field: + opt = opt.clone({"domain": domain.get_field()}) + retract = True + + from sympy.polys.rings import xring + _ring, _ = xring(opt.gens, opt.domain, opt.order) + + for i, poly in enumerate(polys): + poly = poly.set_domain(opt.domain).rep.to_dict() + polys[i] = _ring.from_dict(poly) + + Q, r = polys[0].div(polys[1:]) + + Q = [Poly._from_dict(dict(q), opt) for q in Q] + r = Poly._from_dict(dict(r), opt) + + if retract: + try: + _Q, _r = [q.to_ring() for q in Q], r.to_ring() + except CoercionFailed: + pass + else: + Q, r = _Q, _r + + if not opt.polys: + return [q.as_expr() for q in Q], r.as_expr() + else: + return Q, r + + def contains(self, poly): + """ + Check if ``poly`` belongs the ideal generated by ``self``. + + Examples + ======== + + >>> from sympy import groebner + >>> from sympy.abc import x, y + + >>> f = 2*x**3 + y**3 + 3*y + >>> G = groebner([x**2 + y**2 - 1, x*y - 2]) + + >>> G.contains(f) + True + >>> G.contains(f + 1) + False + + """ + return self.reduce(poly)[1] == 0 + + +@public +def poly(expr, *gens, **args): + """ + Efficiently transform an expression into a polynomial. + + Examples + ======== + + >>> from sympy import poly + >>> from sympy.abc import x + + >>> poly(x*(x**2 + x - 1)**2) + Poly(x**5 + 2*x**4 - x**3 - 2*x**2 + x, x, domain='ZZ') + + """ + options.allowed_flags(args, []) + + def _poly(expr, opt): + terms, poly_terms = [], [] + + for term in Add.make_args(expr): + factors, poly_factors = [], [] + + for factor in Mul.make_args(term): + if factor.is_Add: + poly_factors.append(_poly(factor, opt)) + elif factor.is_Pow and factor.base.is_Add and \ + factor.exp.is_Integer and factor.exp >= 0: + poly_factors.append( + _poly(factor.base, opt).pow(factor.exp)) + else: + factors.append(factor) + + if not poly_factors: + terms.append(term) + else: + product = poly_factors[0] + + for factor in poly_factors[1:]: + product = product.mul(factor) + + if factors: + factor = Mul(*factors) + + if factor.is_Number: + product = product.mul(factor) + else: + product = product.mul(Poly._from_expr(factor, opt)) + + poly_terms.append(product) + + if not poly_terms: + result = Poly._from_expr(expr, opt) + else: + result = poly_terms[0] + + for term in poly_terms[1:]: + result = result.add(term) + + if terms: + term = Add(*terms) + + if term.is_Number: + result = result.add(term) + else: + result = result.add(Poly._from_expr(term, opt)) + + return result.reorder(*opt.get('gens', ()), **args) + + expr = sympify(expr) + + if expr.is_Poly: + return Poly(expr, *gens, **args) + + if 'expand' not in args: + args['expand'] = False + + opt = options.build_options(gens, args) + + return _poly(expr, opt) + + +def named_poly(n, f, K, name, x, polys): + r"""Common interface to the low-level polynomial generating functions + in orthopolys and appellseqs. + + Parameters + ========== + + n : int + Index of the polynomial, which may or may not equal its degree. + f : callable + Low-level generating function to use. + K : Domain or None + Domain in which to perform the computations. If None, use the smallest + field containing the rationals and the extra parameters of x (see below). + name : str + Name of an arbitrary individual polynomial in the sequence generated + by f, only used in the error message for invalid n. + x : seq + The first element of this argument is the main variable of all + polynomials in this sequence. Any further elements are extra + parameters required by f. + polys : bool, optional + If True, return a Poly, otherwise (default) return an expression. + """ + if n < 0: + raise ValueError("Cannot generate %s of index %s" % (name, n)) + head, tail = x[0], x[1:] + if K is None: + K, tail = construct_domain(tail, field=True) + poly = DMP(f(int(n), *tail, K), K) + if head is None: + poly = PurePoly.new(poly, Dummy('x')) + else: + poly = Poly.new(poly, head) + return poly if polys else poly.as_expr() diff --git a/shared/package-files/1f/1fcd90c1d4f8ee4970374b6867a6cfb7240715da4efe3582a58572c00091ceb0/special_ndtr_compositeimplicitautograd_dispatch.h b/shared/package-files/1f/1fcd90c1d4f8ee4970374b6867a6cfb7240715da4efe3582a58572c00091ceb0/special_ndtr_compositeimplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..83f8103e9590315b062e1f2738ef142ab110839f --- /dev/null +++ b/shared/package-files/1f/1fcd90c1d4f8ee4970374b6867a6cfb7240715da4efe3582a58572c00091ceb0/special_ndtr_compositeimplicitautograd_dispatch.h @@ -0,0 +1,25 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeimplicitautograd { + +TORCH_API at::Tensor special_ndtr(const at::Tensor & self); +TORCH_API at::Tensor & special_ndtr_out(at::Tensor & out, const at::Tensor & self); +TORCH_API at::Tensor & special_ndtr_outf(const at::Tensor & self, at::Tensor & out); + +} // namespace compositeimplicitautograd +} // namespace at diff --git a/shared/package-files/1f/1fd0e29a6139ccbb84a73c98bd35815620494dee5b6cb8fed5179f680cb65d79/densebasic.py b/shared/package-files/1f/1fd0e29a6139ccbb84a73c98bd35815620494dee5b6cb8fed5179f680cb65d79/densebasic.py new file mode 100644 index 0000000000000000000000000000000000000000..410b40bf84423872fdab2498fdc580fb8553100b --- /dev/null +++ b/shared/package-files/1f/1fd0e29a6139ccbb84a73c98bd35815620494dee5b6cb8fed5179f680cb65d79/densebasic.py @@ -0,0 +1,1881 @@ +"""Basic tools for dense recursive polynomials in ``K[x]`` or ``K[X]``. """ + + +from sympy.core.numbers import oo +from sympy.core import igcd +from sympy.polys.monomials import monomial_min, monomial_div +from sympy.polys.orderings import monomial_key + +import random + +def poly_LC(f, K): + """ + Return leading coefficient of ``f``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import poly_LC + + >>> poly_LC([], ZZ) + 0 + >>> poly_LC([ZZ(1), ZZ(2), ZZ(3)], ZZ) + 1 + + """ + if not f: + return K.zero + else: + return f[0] + + +def poly_TC(f, K): + """ + Return trailing coefficient of ``f``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import poly_TC + + >>> poly_TC([], ZZ) + 0 + >>> poly_TC([ZZ(1), ZZ(2), ZZ(3)], ZZ) + 3 + + """ + if not f: + return K.zero + else: + return f[-1] + +dup_LC = dmp_LC = poly_LC +dup_TC = dmp_TC = poly_TC + + +def dmp_ground_LC(f, u, K): + """ + Return the ground leading coefficient. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_ground_LC + + >>> f = ZZ.map([[[1], [2, 3]]]) + + >>> dmp_ground_LC(f, 2, ZZ) + 1 + + """ + while u: + f = dmp_LC(f, K) + u -= 1 + + return dup_LC(f, K) + + +def dmp_ground_TC(f, u, K): + """ + Return the ground trailing coefficient. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_ground_TC + + >>> f = ZZ.map([[[1], [2, 3]]]) + + >>> dmp_ground_TC(f, 2, ZZ) + 3 + + """ + while u: + f = dmp_TC(f, K) + u -= 1 + + return dup_TC(f, K) + + +def dmp_true_LT(f, u, K): + """ + Return the leading term ``c * x_1**n_1 ... x_k**n_k``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_true_LT + + >>> f = ZZ.map([[4], [2, 0], [3, 0, 0]]) + + >>> dmp_true_LT(f, 1, ZZ) + ((2, 0), 4) + + """ + monom = [] + + while u: + monom.append(len(f) - 1) + f, u = f[0], u - 1 + + if not f: + monom.append(0) + else: + monom.append(len(f) - 1) + + return tuple(monom), dup_LC(f, K) + + +def dup_degree(f): + """ + Return the leading degree of ``f`` in ``K[x]``. + + Note that the degree of 0 is negative infinity (the SymPy object -oo). + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dup_degree + + >>> f = ZZ.map([1, 2, 0, 3]) + + >>> dup_degree(f) + 3 + + """ + if not f: + return -oo + return len(f) - 1 + + +def dmp_degree(f, u): + """ + Return the leading degree of ``f`` in ``x_0`` in ``K[X]``. + + Note that the degree of 0 is negative infinity (the SymPy object -oo). + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_degree + + >>> dmp_degree([[[]]], 2) + -oo + + >>> f = ZZ.map([[2], [1, 2, 3]]) + + >>> dmp_degree(f, 1) + 1 + + """ + if dmp_zero_p(f, u): + return -oo + else: + return len(f) - 1 + + +def _rec_degree_in(g, v, i, j): + """Recursive helper function for :func:`dmp_degree_in`.""" + if i == j: + return dmp_degree(g, v) + + v, i = v - 1, i + 1 + + return max([ _rec_degree_in(c, v, i, j) for c in g ]) + + +def dmp_degree_in(f, j, u): + """ + Return the leading degree of ``f`` in ``x_j`` in ``K[X]``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_degree_in + + >>> f = ZZ.map([[2], [1, 2, 3]]) + + >>> dmp_degree_in(f, 0, 1) + 1 + >>> dmp_degree_in(f, 1, 1) + 2 + + """ + if not j: + return dmp_degree(f, u) + if j < 0 or j > u: + raise IndexError("0 <= j <= %s expected, got %s" % (u, j)) + + return _rec_degree_in(f, u, 0, j) + + +def _rec_degree_list(g, v, i, degs): + """Recursive helper for :func:`dmp_degree_list`.""" + degs[i] = max(degs[i], dmp_degree(g, v)) + + if v > 0: + v, i = v - 1, i + 1 + + for c in g: + _rec_degree_list(c, v, i, degs) + + +def dmp_degree_list(f, u): + """ + Return a list of degrees of ``f`` in ``K[X]``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_degree_list + + >>> f = ZZ.map([[1], [1, 2, 3]]) + + >>> dmp_degree_list(f, 1) + (1, 2) + + """ + degs = [-oo]*(u + 1) + _rec_degree_list(f, u, 0, degs) + return tuple(degs) + + +def dup_strip(f): + """ + Remove leading zeros from ``f`` in ``K[x]``. + + Examples + ======== + + >>> from sympy.polys.densebasic import dup_strip + + >>> dup_strip([0, 0, 1, 2, 3, 0]) + [1, 2, 3, 0] + + """ + if not f or f[0]: + return f + + i = 0 + + for cf in f: + if cf: + break + else: + i += 1 + + return f[i:] + + +def dmp_strip(f, u): + """ + Remove leading zeros from ``f`` in ``K[X]``. + + Examples + ======== + + >>> from sympy.polys.densebasic import dmp_strip + + >>> dmp_strip([[], [0, 1, 2], [1]], 1) + [[0, 1, 2], [1]] + + """ + if not u: + return dup_strip(f) + + if dmp_zero_p(f, u): + return f + + i, v = 0, u - 1 + + for c in f: + if not dmp_zero_p(c, v): + break + else: + i += 1 + + if i == len(f): + return dmp_zero(u) + else: + return f[i:] + + +def _rec_validate(f, g, i, K): + """Recursive helper for :func:`dmp_validate`.""" + if not isinstance(g, list): + if K is not None and not K.of_type(g): + raise TypeError("%s in %s in not of type %s" % (g, f, K.dtype)) + + return {i - 1} + elif not g: + return {i} + else: + levels = set() + + for c in g: + levels |= _rec_validate(f, c, i + 1, K) + + return levels + + +def _rec_strip(g, v): + """Recursive helper for :func:`_rec_strip`.""" + if not v: + return dup_strip(g) + + w = v - 1 + + return dmp_strip([ _rec_strip(c, w) for c in g ], v) + + +def dmp_validate(f, K=None): + """ + Return the number of levels in ``f`` and recursively strip it. + + Examples + ======== + + >>> from sympy.polys.densebasic import dmp_validate + + >>> dmp_validate([[], [0, 1, 2], [1]]) + ([[1, 2], [1]], 1) + + >>> dmp_validate([[1], 1]) + Traceback (most recent call last): + ... + ValueError: invalid data structure for a multivariate polynomial + + """ + levels = _rec_validate(f, f, 0, K) + + u = levels.pop() + + if not levels: + return _rec_strip(f, u), u + else: + raise ValueError( + "invalid data structure for a multivariate polynomial") + + +def dup_reverse(f): + """ + Compute ``x**n * f(1/x)``, i.e.: reverse ``f`` in ``K[x]``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dup_reverse + + >>> f = ZZ.map([1, 2, 3, 0]) + + >>> dup_reverse(f) + [3, 2, 1] + + """ + return dup_strip(list(reversed(f))) + + +def dup_copy(f): + """ + Create a new copy of a polynomial ``f`` in ``K[x]``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dup_copy + + >>> f = ZZ.map([1, 2, 3, 0]) + + >>> dup_copy([1, 2, 3, 0]) + [1, 2, 3, 0] + + """ + return list(f) + + +def dmp_copy(f, u): + """ + Create a new copy of a polynomial ``f`` in ``K[X]``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_copy + + >>> f = ZZ.map([[1], [1, 2]]) + + >>> dmp_copy(f, 1) + [[1], [1, 2]] + + """ + if not u: + return list(f) + + v = u - 1 + + return [ dmp_copy(c, v) for c in f ] + + +def dup_to_tuple(f): + """ + Convert `f` into a tuple. + + This is needed for hashing. This is similar to dup_copy(). + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dup_copy + + >>> f = ZZ.map([1, 2, 3, 0]) + + >>> dup_copy([1, 2, 3, 0]) + [1, 2, 3, 0] + + """ + return tuple(f) + + +def dmp_to_tuple(f, u): + """ + Convert `f` into a nested tuple of tuples. + + This is needed for hashing. This is similar to dmp_copy(). + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_to_tuple + + >>> f = ZZ.map([[1], [1, 2]]) + + >>> dmp_to_tuple(f, 1) + ((1,), (1, 2)) + + """ + if not u: + return tuple(f) + v = u - 1 + + return tuple(dmp_to_tuple(c, v) for c in f) + + +def dup_normal(f, K): + """ + Normalize univariate polynomial in the given domain. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dup_normal + + >>> dup_normal([0, 1.5, 2, 3], ZZ) + [1, 2, 3] + + """ + return dup_strip([ K.normal(c) for c in f ]) + + +def dmp_normal(f, u, K): + """ + Normalize a multivariate polynomial in the given domain. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_normal + + >>> dmp_normal([[], [0, 1.5, 2]], 1, ZZ) + [[1, 2]] + + """ + if not u: + return dup_normal(f, K) + + v = u - 1 + + return dmp_strip([ dmp_normal(c, v, K) for c in f ], u) + + +def dup_convert(f, K0, K1): + """ + Convert the ground domain of ``f`` from ``K0`` to ``K1``. + + Examples + ======== + + >>> from sympy.polys.rings import ring + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dup_convert + + >>> R, x = ring("x", ZZ) + + >>> dup_convert([R(1), R(2)], R.to_domain(), ZZ) + [1, 2] + >>> dup_convert([ZZ(1), ZZ(2)], ZZ, R.to_domain()) + [1, 2] + + """ + if K0 is not None and K0 == K1: + return f + else: + return dup_strip([ K1.convert(c, K0) for c in f ]) + + +def dmp_convert(f, u, K0, K1): + """ + Convert the ground domain of ``f`` from ``K0`` to ``K1``. + + Examples + ======== + + >>> from sympy.polys.rings import ring + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_convert + + >>> R, x = ring("x", ZZ) + + >>> dmp_convert([[R(1)], [R(2)]], 1, R.to_domain(), ZZ) + [[1], [2]] + >>> dmp_convert([[ZZ(1)], [ZZ(2)]], 1, ZZ, R.to_domain()) + [[1], [2]] + + """ + if not u: + return dup_convert(f, K0, K1) + if K0 is not None and K0 == K1: + return f + + v = u - 1 + + return dmp_strip([ dmp_convert(c, v, K0, K1) for c in f ], u) + + +def dup_from_sympy(f, K): + """ + Convert the ground domain of ``f`` from SymPy to ``K``. + + Examples + ======== + + >>> from sympy import S + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dup_from_sympy + + >>> dup_from_sympy([S(1), S(2)], ZZ) == [ZZ(1), ZZ(2)] + True + + """ + return dup_strip([ K.from_sympy(c) for c in f ]) + + +def dmp_from_sympy(f, u, K): + """ + Convert the ground domain of ``f`` from SymPy to ``K``. + + Examples + ======== + + >>> from sympy import S + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_from_sympy + + >>> dmp_from_sympy([[S(1)], [S(2)]], 1, ZZ) == [[ZZ(1)], [ZZ(2)]] + True + + """ + if not u: + return dup_from_sympy(f, K) + + v = u - 1 + + return dmp_strip([ dmp_from_sympy(c, v, K) for c in f ], u) + + +def dup_nth(f, n, K): + """ + Return the ``n``-th coefficient of ``f`` in ``K[x]``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dup_nth + + >>> f = ZZ.map([1, 2, 3]) + + >>> dup_nth(f, 0, ZZ) + 3 + >>> dup_nth(f, 4, ZZ) + 0 + + """ + if n < 0: + raise IndexError("'n' must be non-negative, got %i" % n) + elif n >= len(f): + return K.zero + else: + return f[dup_degree(f) - n] + + +def dmp_nth(f, n, u, K): + """ + Return the ``n``-th coefficient of ``f`` in ``K[x]``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_nth + + >>> f = ZZ.map([[1], [2], [3]]) + + >>> dmp_nth(f, 0, 1, ZZ) + [3] + >>> dmp_nth(f, 4, 1, ZZ) + [] + + """ + if n < 0: + raise IndexError("'n' must be non-negative, got %i" % n) + elif n >= len(f): + return dmp_zero(u - 1) + else: + return f[dmp_degree(f, u) - n] + + +def dmp_ground_nth(f, N, u, K): + """ + Return the ground ``n``-th coefficient of ``f`` in ``K[x]``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_ground_nth + + >>> f = ZZ.map([[1], [2, 3]]) + + >>> dmp_ground_nth(f, (0, 1), 1, ZZ) + 2 + + """ + v = u + + for n in N: + if n < 0: + raise IndexError("`n` must be non-negative, got %i" % n) + elif n >= len(f): + return K.zero + else: + d = dmp_degree(f, v) + if d == -oo: + d = -1 + f, v = f[d - n], v - 1 + + return f + + +def dmp_zero_p(f, u): + """ + Return ``True`` if ``f`` is zero in ``K[X]``. + + Examples + ======== + + >>> from sympy.polys.densebasic import dmp_zero_p + + >>> dmp_zero_p([[[[[]]]]], 4) + True + >>> dmp_zero_p([[[[[1]]]]], 4) + False + + """ + while u: + if len(f) != 1: + return False + + f = f[0] + u -= 1 + + return not f + + +def dmp_zero(u): + """ + Return a multivariate zero. + + Examples + ======== + + >>> from sympy.polys.densebasic import dmp_zero + + >>> dmp_zero(4) + [[[[[]]]]] + + """ + r = [] + + for i in range(u): + r = [r] + + return r + + +def dmp_one_p(f, u, K): + """ + Return ``True`` if ``f`` is one in ``K[X]``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_one_p + + >>> dmp_one_p([[[ZZ(1)]]], 2, ZZ) + True + + """ + return dmp_ground_p(f, K.one, u) + + +def dmp_one(u, K): + """ + Return a multivariate one over ``K``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_one + + >>> dmp_one(2, ZZ) + [[[1]]] + + """ + return dmp_ground(K.one, u) + + +def dmp_ground_p(f, c, u): + """ + Return True if ``f`` is constant in ``K[X]``. + + Examples + ======== + + >>> from sympy.polys.densebasic import dmp_ground_p + + >>> dmp_ground_p([[[3]]], 3, 2) + True + >>> dmp_ground_p([[[4]]], None, 2) + True + + """ + if c is not None and not c: + return dmp_zero_p(f, u) + + while u: + if len(f) != 1: + return False + f = f[0] + u -= 1 + + if c is None: + return len(f) <= 1 + else: + return f == [c] + + +def dmp_ground(c, u): + """ + Return a multivariate constant. + + Examples + ======== + + >>> from sympy.polys.densebasic import dmp_ground + + >>> dmp_ground(3, 5) + [[[[[[3]]]]]] + >>> dmp_ground(1, -1) + 1 + + """ + if not c: + return dmp_zero(u) + + for i in range(u + 1): + c = [c] + + return c + + +def dmp_zeros(n, u, K): + """ + Return a list of multivariate zeros. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_zeros + + >>> dmp_zeros(3, 2, ZZ) + [[[[]]], [[[]]], [[[]]]] + >>> dmp_zeros(3, -1, ZZ) + [0, 0, 0] + + """ + if not n: + return [] + + if u < 0: + return [K.zero]*n + else: + return [ dmp_zero(u) for i in range(n) ] + + +def dmp_grounds(c, n, u): + """ + Return a list of multivariate constants. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_grounds + + >>> dmp_grounds(ZZ(4), 3, 2) + [[[[4]]], [[[4]]], [[[4]]]] + >>> dmp_grounds(ZZ(4), 3, -1) + [4, 4, 4] + + """ + if not n: + return [] + + if u < 0: + return [c]*n + else: + return [ dmp_ground(c, u) for i in range(n) ] + + +def dmp_negative_p(f, u, K): + """ + Return ``True`` if ``LC(f)`` is negative. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_negative_p + + >>> dmp_negative_p([[ZZ(1)], [-ZZ(1)]], 1, ZZ) + False + >>> dmp_negative_p([[-ZZ(1)], [ZZ(1)]], 1, ZZ) + True + + """ + return K.is_negative(dmp_ground_LC(f, u, K)) + + +def dmp_positive_p(f, u, K): + """ + Return ``True`` if ``LC(f)`` is positive. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_positive_p + + >>> dmp_positive_p([[ZZ(1)], [-ZZ(1)]], 1, ZZ) + True + >>> dmp_positive_p([[-ZZ(1)], [ZZ(1)]], 1, ZZ) + False + + """ + return K.is_positive(dmp_ground_LC(f, u, K)) + + +def dup_from_dict(f, K): + """ + Create a ``K[x]`` polynomial from a ``dict``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dup_from_dict + + >>> dup_from_dict({(0,): ZZ(7), (2,): ZZ(5), (4,): ZZ(1)}, ZZ) + [1, 0, 5, 0, 7] + >>> dup_from_dict({}, ZZ) + [] + + """ + if not f: + return [] + + n, h = max(f.keys()), [] + + if isinstance(n, int): + for k in range(n, -1, -1): + h.append(f.get(k, K.zero)) + else: + (n,) = n + + for k in range(n, -1, -1): + h.append(f.get((k,), K.zero)) + + return dup_strip(h) + + +def dup_from_raw_dict(f, K): + """ + Create a ``K[x]`` polynomial from a raw ``dict``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dup_from_raw_dict + + >>> dup_from_raw_dict({0: ZZ(7), 2: ZZ(5), 4: ZZ(1)}, ZZ) + [1, 0, 5, 0, 7] + + """ + if not f: + return [] + + n, h = max(f.keys()), [] + + for k in range(n, -1, -1): + h.append(f.get(k, K.zero)) + + return dup_strip(h) + + +def dmp_from_dict(f, u, K): + """ + Create a ``K[X]`` polynomial from a ``dict``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_from_dict + + >>> dmp_from_dict({(0, 0): ZZ(3), (0, 1): ZZ(2), (2, 1): ZZ(1)}, 1, ZZ) + [[1, 0], [], [2, 3]] + >>> dmp_from_dict({}, 0, ZZ) + [] + + """ + if not u: + return dup_from_dict(f, K) + if not f: + return dmp_zero(u) + + coeffs = {} + + for monom, coeff in f.items(): + head, tail = monom[0], monom[1:] + + if head in coeffs: + coeffs[head][tail] = coeff + else: + coeffs[head] = { tail: coeff } + + n, v, h = max(coeffs.keys()), u - 1, [] + + for k in range(n, -1, -1): + coeff = coeffs.get(k) + + if coeff is not None: + h.append(dmp_from_dict(coeff, v, K)) + else: + h.append(dmp_zero(v)) + + return dmp_strip(h, u) + + +def dup_to_dict(f, K=None, zero=False): + """ + Convert ``K[x]`` polynomial to a ``dict``. + + Examples + ======== + + >>> from sympy.polys.densebasic import dup_to_dict + + >>> dup_to_dict([1, 0, 5, 0, 7]) + {(0,): 7, (2,): 5, (4,): 1} + >>> dup_to_dict([]) + {} + + """ + if not f and zero: + return {(0,): K.zero} + + n, result = len(f) - 1, {} + + for k in range(0, n + 1): + if f[n - k]: + result[(k,)] = f[n - k] + + return result + + +def dup_to_raw_dict(f, K=None, zero=False): + """ + Convert a ``K[x]`` polynomial to a raw ``dict``. + + Examples + ======== + + >>> from sympy.polys.densebasic import dup_to_raw_dict + + >>> dup_to_raw_dict([1, 0, 5, 0, 7]) + {0: 7, 2: 5, 4: 1} + + """ + if not f and zero: + return {0: K.zero} + + n, result = len(f) - 1, {} + + for k in range(0, n + 1): + if f[n - k]: + result[k] = f[n - k] + + return result + + +def dmp_to_dict(f, u, K=None, zero=False): + """ + Convert a ``K[X]`` polynomial to a ``dict````. + + Examples + ======== + + >>> from sympy.polys.densebasic import dmp_to_dict + + >>> dmp_to_dict([[1, 0], [], [2, 3]], 1) + {(0, 0): 3, (0, 1): 2, (2, 1): 1} + >>> dmp_to_dict([], 0) + {} + + """ + if not u: + return dup_to_dict(f, K, zero=zero) + + if dmp_zero_p(f, u) and zero: + return {(0,)*(u + 1): K.zero} + + n, v, result = dmp_degree(f, u), u - 1, {} + + if n == -oo: + n = -1 + + for k in range(0, n + 1): + h = dmp_to_dict(f[n - k], v) + + for exp, coeff in h.items(): + result[(k,) + exp] = coeff + + return result + + +def dmp_swap(f, i, j, u, K): + """ + Transform ``K[..x_i..x_j..]`` to ``K[..x_j..x_i..]``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_swap + + >>> f = ZZ.map([[[2], [1, 0]], []]) + + >>> dmp_swap(f, 0, 1, 2, ZZ) + [[[2], []], [[1, 0], []]] + >>> dmp_swap(f, 1, 2, 2, ZZ) + [[[1], [2, 0]], [[]]] + >>> dmp_swap(f, 0, 2, 2, ZZ) + [[[1, 0]], [[2, 0], []]] + + """ + if i < 0 or j < 0 or i > u or j > u: + raise IndexError("0 <= i < j <= %s expected" % u) + elif i == j: + return f + + F, H = dmp_to_dict(f, u), {} + + for exp, coeff in F.items(): + H[exp[:i] + (exp[j],) + + exp[i + 1:j] + + (exp[i],) + exp[j + 1:]] = coeff + + return dmp_from_dict(H, u, K) + + +def dmp_permute(f, P, u, K): + """ + Return a polynomial in ``K[x_{P(1)},..,x_{P(n)}]``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_permute + + >>> f = ZZ.map([[[2], [1, 0]], []]) + + >>> dmp_permute(f, [1, 0, 2], 2, ZZ) + [[[2], []], [[1, 0], []]] + >>> dmp_permute(f, [1, 2, 0], 2, ZZ) + [[[1], []], [[2, 0], []]] + + """ + F, H = dmp_to_dict(f, u), {} + + for exp, coeff in F.items(): + new_exp = [0]*len(exp) + + for e, p in zip(exp, P): + new_exp[p] = e + + H[tuple(new_exp)] = coeff + + return dmp_from_dict(H, u, K) + + +def dmp_nest(f, l, K): + """ + Return a multivariate value nested ``l``-levels. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_nest + + >>> dmp_nest([[ZZ(1)]], 2, ZZ) + [[[[1]]]] + + """ + if not isinstance(f, list): + return dmp_ground(f, l) + + for i in range(l): + f = [f] + + return f + + +def dmp_raise(f, l, u, K): + """ + Return a multivariate polynomial raised ``l``-levels. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_raise + + >>> f = ZZ.map([[], [1, 2]]) + + >>> dmp_raise(f, 2, 1, ZZ) + [[[[]]], [[[1]], [[2]]]] + + """ + if not l: + return f + + if not u: + if not f: + return dmp_zero(l) + + k = l - 1 + + return [ dmp_ground(c, k) for c in f ] + + v = u - 1 + + return [ dmp_raise(c, l, v, K) for c in f ] + + +def dup_deflate(f, K): + """ + Map ``x**m`` to ``y`` in a polynomial in ``K[x]``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dup_deflate + + >>> f = ZZ.map([1, 0, 0, 1, 0, 0, 1]) + + >>> dup_deflate(f, ZZ) + (3, [1, 1, 1]) + + """ + if dup_degree(f) <= 0: + return 1, f + + g = 0 + + for i in range(len(f)): + if not f[-i - 1]: + continue + + g = igcd(g, i) + + if g == 1: + return 1, f + + return g, f[::g] + + +def dmp_deflate(f, u, K): + """ + Map ``x_i**m_i`` to ``y_i`` in a polynomial in ``K[X]``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_deflate + + >>> f = ZZ.map([[1, 0, 0, 2], [], [3, 0, 0, 4]]) + + >>> dmp_deflate(f, 1, ZZ) + ((2, 3), [[1, 2], [3, 4]]) + + """ + if dmp_zero_p(f, u): + return (1,)*(u + 1), f + + F = dmp_to_dict(f, u) + B = [0]*(u + 1) + + for M in F.keys(): + for i, m in enumerate(M): + B[i] = igcd(B[i], m) + + for i, b in enumerate(B): + if not b: + B[i] = 1 + + B = tuple(B) + + if all(b == 1 for b in B): + return B, f + + H = {} + + for A, coeff in F.items(): + N = [ a // b for a, b in zip(A, B) ] + H[tuple(N)] = coeff + + return B, dmp_from_dict(H, u, K) + + +def dup_multi_deflate(polys, K): + """ + Map ``x**m`` to ``y`` in a set of polynomials in ``K[x]``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dup_multi_deflate + + >>> f = ZZ.map([1, 0, 2, 0, 3]) + >>> g = ZZ.map([4, 0, 0]) + + >>> dup_multi_deflate((f, g), ZZ) + (2, ([1, 2, 3], [4, 0])) + + """ + G = 0 + + for p in polys: + if dup_degree(p) <= 0: + return 1, polys + + g = 0 + + for i in range(len(p)): + if not p[-i - 1]: + continue + + g = igcd(g, i) + + if g == 1: + return 1, polys + + G = igcd(G, g) + + return G, tuple([ p[::G] for p in polys ]) + + +def dmp_multi_deflate(polys, u, K): + """ + Map ``x_i**m_i`` to ``y_i`` in a set of polynomials in ``K[X]``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_multi_deflate + + >>> f = ZZ.map([[1, 0, 0, 2], [], [3, 0, 0, 4]]) + >>> g = ZZ.map([[1, 0, 2], [], [3, 0, 4]]) + + >>> dmp_multi_deflate((f, g), 1, ZZ) + ((2, 1), ([[1, 0, 0, 2], [3, 0, 0, 4]], [[1, 0, 2], [3, 0, 4]])) + + """ + if not u: + M, H = dup_multi_deflate(polys, K) + return (M,), H + + F, B = [], [0]*(u + 1) + + for p in polys: + f = dmp_to_dict(p, u) + + if not dmp_zero_p(p, u): + for M in f.keys(): + for i, m in enumerate(M): + B[i] = igcd(B[i], m) + + F.append(f) + + for i, b in enumerate(B): + if not b: + B[i] = 1 + + B = tuple(B) + + if all(b == 1 for b in B): + return B, polys + + H = [] + + for f in F: + h = {} + + for A, coeff in f.items(): + N = [ a // b for a, b in zip(A, B) ] + h[tuple(N)] = coeff + + H.append(dmp_from_dict(h, u, K)) + + return B, tuple(H) + + +def dup_inflate(f, m, K): + """ + Map ``y`` to ``x**m`` in a polynomial in ``K[x]``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dup_inflate + + >>> f = ZZ.map([1, 1, 1]) + + >>> dup_inflate(f, 3, ZZ) + [1, 0, 0, 1, 0, 0, 1] + + """ + if m <= 0: + raise IndexError("'m' must be positive, got %s" % m) + if m == 1 or not f: + return f + + result = [f[0]] + + for coeff in f[1:]: + result.extend([K.zero]*(m - 1)) + result.append(coeff) + + return result + + +def _rec_inflate(g, M, v, i, K): + """Recursive helper for :func:`dmp_inflate`.""" + if not v: + return dup_inflate(g, M[i], K) + if M[i] <= 0: + raise IndexError("all M[i] must be positive, got %s" % M[i]) + + w, j = v - 1, i + 1 + + g = [ _rec_inflate(c, M, w, j, K) for c in g ] + + result = [g[0]] + + for coeff in g[1:]: + for _ in range(1, M[i]): + result.append(dmp_zero(w)) + + result.append(coeff) + + return result + + +def dmp_inflate(f, M, u, K): + """ + Map ``y_i`` to ``x_i**k_i`` in a polynomial in ``K[X]``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_inflate + + >>> f = ZZ.map([[1, 2], [3, 4]]) + + >>> dmp_inflate(f, (2, 3), 1, ZZ) + [[1, 0, 0, 2], [], [3, 0, 0, 4]] + + """ + if not u: + return dup_inflate(f, M[0], K) + + if all(m == 1 for m in M): + return f + else: + return _rec_inflate(f, M, u, 0, K) + + +def dmp_exclude(f, u, K): + """ + Exclude useless levels from ``f``. + + Return the levels excluded, the new excluded ``f``, and the new ``u``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_exclude + + >>> f = ZZ.map([[[1]], [[1], [2]]]) + + >>> dmp_exclude(f, 2, ZZ) + ([2], [[1], [1, 2]], 1) + + """ + if not u or dmp_ground_p(f, None, u): + return [], f, u + + J, F = [], dmp_to_dict(f, u) + + for j in range(0, u + 1): + for monom in F.keys(): + if monom[j]: + break + else: + J.append(j) + + if not J: + return [], f, u + + f = {} + + for monom, coeff in F.items(): + monom = list(monom) + + for j in reversed(J): + del monom[j] + + f[tuple(monom)] = coeff + + u -= len(J) + + return J, dmp_from_dict(f, u, K), u + + +def dmp_include(f, J, u, K): + """ + Include useless levels in ``f``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_include + + >>> f = ZZ.map([[1], [1, 2]]) + + >>> dmp_include(f, [2], 1, ZZ) + [[[1]], [[1], [2]]] + + """ + if not J: + return f + + F, f = dmp_to_dict(f, u), {} + + for monom, coeff in F.items(): + monom = list(monom) + + for j in J: + monom.insert(j, 0) + + f[tuple(monom)] = coeff + + u += len(J) + + return dmp_from_dict(f, u, K) + + +def dmp_inject(f, u, K, front=False): + """ + Convert ``f`` from ``K[X][Y]`` to ``K[X,Y]``. + + Examples + ======== + + >>> from sympy.polys.rings import ring + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_inject + + >>> R, x,y = ring("x,y", ZZ) + + >>> dmp_inject([R(1), x + 2], 0, R.to_domain()) + ([[[1]], [[1], [2]]], 2) + >>> dmp_inject([R(1), x + 2], 0, R.to_domain(), front=True) + ([[[1]], [[1, 2]]], 2) + + """ + f, h = dmp_to_dict(f, u), {} + + v = K.ngens - 1 + + for f_monom, g in f.items(): + g = g.to_dict() + + for g_monom, c in g.items(): + if front: + h[g_monom + f_monom] = c + else: + h[f_monom + g_monom] = c + + w = u + v + 1 + + return dmp_from_dict(h, w, K.dom), w + + +def dmp_eject(f, u, K, front=False): + """ + Convert ``f`` from ``K[X,Y]`` to ``K[X][Y]``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_eject + + >>> dmp_eject([[[1]], [[1], [2]]], 2, ZZ['x', 'y']) + [1, x + 2] + + """ + f, h = dmp_to_dict(f, u), {} + + n = K.ngens + v = u - K.ngens + 1 + + for monom, c in f.items(): + if front: + g_monom, f_monom = monom[:n], monom[n:] + else: + g_monom, f_monom = monom[-n:], monom[:-n] + + if f_monom in h: + h[f_monom][g_monom] = c + else: + h[f_monom] = {g_monom: c} + + for monom, c in h.items(): + h[monom] = K(c) + + return dmp_from_dict(h, v - 1, K) + + +def dup_terms_gcd(f, K): + """ + Remove GCD of terms from ``f`` in ``K[x]``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dup_terms_gcd + + >>> f = ZZ.map([1, 0, 1, 0, 0]) + + >>> dup_terms_gcd(f, ZZ) + (2, [1, 0, 1]) + + """ + if dup_TC(f, K) or not f: + return 0, f + + i = 0 + + for c in reversed(f): + if not c: + i += 1 + else: + break + + return i, f[:-i] + + +def dmp_terms_gcd(f, u, K): + """ + Remove GCD of terms from ``f`` in ``K[X]``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_terms_gcd + + >>> f = ZZ.map([[1, 0], [1, 0, 0], [], []]) + + >>> dmp_terms_gcd(f, 1, ZZ) + ((2, 1), [[1], [1, 0]]) + + """ + if dmp_ground_TC(f, u, K) or dmp_zero_p(f, u): + return (0,)*(u + 1), f + + F = dmp_to_dict(f, u) + G = monomial_min(*list(F.keys())) + + if all(g == 0 for g in G): + return G, f + + f = {} + + for monom, coeff in F.items(): + f[monomial_div(monom, G)] = coeff + + return G, dmp_from_dict(f, u, K) + + +def _rec_list_terms(g, v, monom): + """Recursive helper for :func:`dmp_list_terms`.""" + d, terms = dmp_degree(g, v), [] + + if not v: + for i, c in enumerate(g): + if not c: + continue + + terms.append((monom + (d - i,), c)) + else: + w = v - 1 + + for i, c in enumerate(g): + terms.extend(_rec_list_terms(c, w, monom + (d - i,))) + + return terms + + +def dmp_list_terms(f, u, K, order=None): + """ + List all non-zero terms from ``f`` in the given order ``order``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_list_terms + + >>> f = ZZ.map([[1, 1], [2, 3]]) + + >>> dmp_list_terms(f, 1, ZZ) + [((1, 1), 1), ((1, 0), 1), ((0, 1), 2), ((0, 0), 3)] + >>> dmp_list_terms(f, 1, ZZ, order='grevlex') + [((1, 1), 1), ((1, 0), 1), ((0, 1), 2), ((0, 0), 3)] + + """ + def sort(terms, O): + return sorted(terms, key=lambda term: O(term[0]), reverse=True) + + terms = _rec_list_terms(f, u, ()) + + if not terms: + return [((0,)*(u + 1), K.zero)] + + if order is None: + return terms + else: + return sort(terms, monomial_key(order)) + + +def dup_apply_pairs(f, g, h, args, K): + """ + Apply ``h`` to pairs of coefficients of ``f`` and ``g``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dup_apply_pairs + + >>> h = lambda x, y, z: 2*x + y - z + + >>> dup_apply_pairs([1, 2, 3], [3, 2, 1], h, (1,), ZZ) + [4, 5, 6] + + """ + n, m = len(f), len(g) + + if n != m: + if n > m: + g = [K.zero]*(n - m) + g + else: + f = [K.zero]*(m - n) + f + + result = [] + + for a, b in zip(f, g): + result.append(h(a, b, *args)) + + return dup_strip(result) + + +def dmp_apply_pairs(f, g, h, args, u, K): + """ + Apply ``h`` to pairs of coefficients of ``f`` and ``g``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dmp_apply_pairs + + >>> h = lambda x, y, z: 2*x + y - z + + >>> dmp_apply_pairs([[1], [2, 3]], [[3], [2, 1]], h, (1,), 1, ZZ) + [[4], [5, 6]] + + """ + if not u: + return dup_apply_pairs(f, g, h, args, K) + + n, m, v = len(f), len(g), u - 1 + + if n != m: + if n > m: + g = dmp_zeros(n - m, v, K) + g + else: + f = dmp_zeros(m - n, v, K) + f + + result = [] + + for a, b in zip(f, g): + result.append(dmp_apply_pairs(a, b, h, args, v, K)) + + return dmp_strip(result, u) + + +def dup_slice(f, m, n, K): + """Take a continuous subsequence of terms of ``f`` in ``K[x]``. """ + k = len(f) + + if k >= m: + M = k - m + else: + M = 0 + if k >= n: + N = k - n + else: + N = 0 + + f = f[N:M] + + if not f: + return [] + else: + return f + [K.zero]*m + + +def dmp_slice(f, m, n, u, K): + """Take a continuous subsequence of terms of ``f`` in ``K[X]``. """ + return dmp_slice_in(f, m, n, 0, u, K) + + +def dmp_slice_in(f, m, n, j, u, K): + """Take a continuous subsequence of terms of ``f`` in ``x_j`` in ``K[X]``. """ + if j < 0 or j > u: + raise IndexError("-%s <= j < %s expected, got %s" % (u, u, j)) + + if not u: + return dup_slice(f, m, n, K) + + f, g = dmp_to_dict(f, u), {} + + for monom, coeff in f.items(): + k = monom[j] + + if k < m or k >= n: + monom = monom[:j] + (0,) + monom[j + 1:] + + if monom in g: + g[monom] += coeff + else: + g[monom] = coeff + + return dmp_from_dict(g, u, K) + + +def dup_random(n, a, b, K): + """ + Return a polynomial of degree ``n`` with coefficients in ``[a, b]``. + + Examples + ======== + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.densebasic import dup_random + + >>> dup_random(3, -10, 10, ZZ) #doctest: +SKIP + [-2, -8, 9, -4] + + """ + f = [ K.convert(random.randint(a, b)) for _ in range(0, n + 1) ] + + while not f[0]: + f[0] = K.convert(random.randint(a, b)) + + return f diff --git a/shared/package-files/1f/1fd1ce972196d1722dbf1fc98bae3305092240f7cb6fa0c5030e49e62af32b6f/pyperclip.py b/shared/package-files/1f/1fd1ce972196d1722dbf1fc98bae3305092240f7cb6fa0c5030e49e62af32b6f/pyperclip.py new file mode 100644 index 0000000000000000000000000000000000000000..66eb7117424d20ab9f9a0083041f26a6999507ce --- /dev/null +++ b/shared/package-files/1f/1fd1ce972196d1722dbf1fc98bae3305092240f7cb6fa0c5030e49e62af32b6f/pyperclip.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +import pyperclip + +from prompt_toolkit.selection import SelectionType + +from .base import Clipboard, ClipboardData + +__all__ = [ + "PyperclipClipboard", +] + + +class PyperclipClipboard(Clipboard): + """ + Clipboard that synchronizes with the Windows/Mac/Linux system clipboard, + using the pyperclip module. + """ + + def __init__(self) -> None: + self._data: ClipboardData | None = None + + def set_data(self, data: ClipboardData) -> None: + self._data = data + pyperclip.copy(data.text) + + def get_data(self) -> ClipboardData: + text = pyperclip.paste() + + # When the clipboard data is equal to what we copied last time, reuse + # the `ClipboardData` instance. That way we're sure to keep the same + # `SelectionType`. + if self._data and self._data.text == text: + return self._data + + # Pyperclip returned something else. Create a new `ClipboardData` + # instance. + else: + return ClipboardData( + text=text, + type=SelectionType.LINES if "\n" in text else SelectionType.CHARACTERS, + ) diff --git a/shared/package-files/1f/1fd257755981aabaab48cf3441370a3b16b34984695827ea871ceae3f4e5ad83/pcvt28w b/shared/package-files/1f/1fd257755981aabaab48cf3441370a3b16b34984695827ea871ceae3f4e5ad83/pcvt28w new file mode 100644 index 0000000000000000000000000000000000000000..8fc2b762adff5f4959e18cbd3a51b4493364e4b8 Binary files /dev/null and b/shared/package-files/1f/1fd257755981aabaab48cf3441370a3b16b34984695827ea871ceae3f4e5ad83/pcvt28w differ diff --git a/shared/package-files/1f/1fd7a4cd772dda0811e4787be5644e9d799270fb7c13d74f726d821d5ccb6d86/adm11 b/shared/package-files/1f/1fd7a4cd772dda0811e4787be5644e9d799270fb7c13d74f726d821d5ccb6d86/adm11 new file mode 100644 index 0000000000000000000000000000000000000000..d464b5b70b01257fda15396ad42a06bbd65c7c7d Binary files /dev/null and b/shared/package-files/1f/1fd7a4cd772dda0811e4787be5644e9d799270fb7c13d74f726d821d5ccb6d86/adm11 differ diff --git a/shared/package-files/1f/1fd9696b6ec603c351e9b0205ca87b65edbe402beb9060b394c4662cde6f456a/python_key.py b/shared/package-files/1f/1fd9696b6ec603c351e9b0205ca87b65edbe402beb9060b394c4662cde6f456a/python_key.py new file mode 100644 index 0000000000000000000000000000000000000000..e7c805841a62b015e6fee609d370109ddd45821a --- /dev/null +++ b/shared/package-files/1f/1fd9696b6ec603c351e9b0205ca87b65edbe402beb9060b394c4662cde6f456a/python_key.py @@ -0,0 +1,9 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. +__all__ = ["make_fx", "dispatch_trace", "PythonKeyTracer", "pythonkey_decompose"] +from torch.fx.experimental.proxy_tensor import make_fx, dispatch_trace, PythonKeyTracer, decompose + +pythonkey_decompose = decompose diff --git a/shared/package-files/1f/1fdd761518ac8a418cf524950d042af985f94cd22294160166cd40c2622fdc64/sparse.py b/shared/package-files/1f/1fdd761518ac8a418cf524950d042af985f94cd22294160166cd40c2622fdc64/sparse.py new file mode 100644 index 0000000000000000000000000000000000000000..f37a34118d2d8f73437dee54337a666df1b99a09 --- /dev/null +++ b/shared/package-files/1f/1fdd761518ac8a418cf524950d042af985f94cd22294160166cd40c2622fdc64/sparse.py @@ -0,0 +1 @@ +# The Tensor classes are added to this module by python_tensor.cpp diff --git a/shared/package-files/1f/1fdde8290b85bf7d869fd7f53ccdf3d116f7dc72a4d9e75b1a8f645045c615c5/__init__.py b/shared/package-files/1f/1fdde8290b85bf7d869fd7f53ccdf3d116f7dc72a4d9e75b1a8f645045c615c5/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..19313b70c9527fabb4fd65b3e0a06989a573a1cb --- /dev/null +++ b/shared/package-files/1f/1fdde8290b85bf7d869fd7f53ccdf3d116f7dc72a4d9e75b1a8f645045c615c5/__init__.py @@ -0,0 +1,18 @@ +# flake8: noqa: F401 +r"""QAT Dynamic Modules. + +This package is in the process of being deprecated. +Please, use `torch.ao.nn.qat.dynamic` instead. +""" +from . import dynamic # noqa: F403 +from . import modules # noqa: F403 +from .modules import * # noqa: F403 + +__all__ = [ + "Linear", + "Conv1d", + "Conv2d", + "Conv3d", + "Embedding", + "EmbeddingBag", +] diff --git a/shared/package-files/1f/1fe57433c44e15297f170bddb48942e5de513c493d71c33ec810010a4646e8af/RECORD b/shared/package-files/1f/1fe57433c44e15297f170bddb48942e5de513c493d71c33ec810010a4646e8af/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..e439347fba9b486a950ff45d8468eee7e66517f2 --- /dev/null +++ b/shared/package-files/1f/1fe57433c44e15297f170bddb48942e5de513c493d71c33ec810010a4646e8af/RECORD @@ -0,0 +1,569 @@ +../../../bin/ipython,sha256=JILw_O-veDVQiHWm2633yZrCsJIr_d9aDb1mHzXRxQ0,507 +../../../bin/ipython3,sha256=JILw_O-veDVQiHWm2633yZrCsJIr_d9aDb1mHzXRxQ0,507 +../../../share/man/man1/ipython.1,sha256=PVdQP2hHmHyUEwzLOPcgavnCe9jTDVrM1jKZt4cnF_Q,2058 +IPython/__init__.py,sha256=kGuZEA8-2GMw1OUTlmT-rdGvvVR6rNvQtZinFV00TxA,6615 +IPython/__main__.py,sha256=VLYnhs1K5_mH0zWpOko7hxVBfRxAS2oKRCjO25_nkgE,490 +IPython/__pycache__/__init__.cpython-310.pyc,, +IPython/__pycache__/__main__.cpython-310.pyc,, +IPython/__pycache__/conftest.cpython-310.pyc,, +IPython/__pycache__/consoleapp.cpython-310.pyc,, +IPython/__pycache__/display.cpython-310.pyc,, +IPython/__pycache__/paths.cpython-310.pyc,, +IPython/conftest.py,sha256=SKDzfbcU9GKnTt6rGDUPIYSDl9h4lFsPg69V-jGM9mg,2618 +IPython/consoleapp.py,sha256=JykFsZuW_qOIARJHknArAzc9wyC1HGUD2HvmVhzPc_0,415 +IPython/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +IPython/core/__pycache__/__init__.cpython-310.pyc,, +IPython/core/__pycache__/alias.cpython-310.pyc,, +IPython/core/__pycache__/application.cpython-310.pyc,, +IPython/core/__pycache__/async_helpers.cpython-310.pyc,, +IPython/core/__pycache__/autocall.cpython-310.pyc,, +IPython/core/__pycache__/builtin_trap.cpython-310.pyc,, +IPython/core/__pycache__/compilerop.cpython-310.pyc,, +IPython/core/__pycache__/completer.cpython-310.pyc,, +IPython/core/__pycache__/completerlib.cpython-310.pyc,, +IPython/core/__pycache__/crashhandler.cpython-310.pyc,, +IPython/core/__pycache__/debugger.cpython-310.pyc,, +IPython/core/__pycache__/display.cpython-310.pyc,, +IPython/core/__pycache__/display_functions.cpython-310.pyc,, +IPython/core/__pycache__/display_trap.cpython-310.pyc,, +IPython/core/__pycache__/displayhook.cpython-310.pyc,, +IPython/core/__pycache__/displaypub.cpython-310.pyc,, +IPython/core/__pycache__/error.cpython-310.pyc,, +IPython/core/__pycache__/events.cpython-310.pyc,, +IPython/core/__pycache__/excolors.cpython-310.pyc,, +IPython/core/__pycache__/extensions.cpython-310.pyc,, +IPython/core/__pycache__/formatters.cpython-310.pyc,, +IPython/core/__pycache__/getipython.cpython-310.pyc,, +IPython/core/__pycache__/guarded_eval.cpython-310.pyc,, +IPython/core/__pycache__/history.cpython-310.pyc,, +IPython/core/__pycache__/historyapp.cpython-310.pyc,, +IPython/core/__pycache__/hooks.cpython-310.pyc,, +IPython/core/__pycache__/inputsplitter.cpython-310.pyc,, +IPython/core/__pycache__/inputtransformer.cpython-310.pyc,, +IPython/core/__pycache__/inputtransformer2.cpython-310.pyc,, +IPython/core/__pycache__/interactiveshell.cpython-310.pyc,, +IPython/core/__pycache__/latex_symbols.cpython-310.pyc,, +IPython/core/__pycache__/logger.cpython-310.pyc,, +IPython/core/__pycache__/macro.cpython-310.pyc,, +IPython/core/__pycache__/magic.cpython-310.pyc,, +IPython/core/__pycache__/magic_arguments.cpython-310.pyc,, +IPython/core/__pycache__/oinspect.cpython-310.pyc,, +IPython/core/__pycache__/page.cpython-310.pyc,, +IPython/core/__pycache__/payload.cpython-310.pyc,, +IPython/core/__pycache__/payloadpage.cpython-310.pyc,, +IPython/core/__pycache__/prefilter.cpython-310.pyc,, +IPython/core/__pycache__/profileapp.cpython-310.pyc,, +IPython/core/__pycache__/profiledir.cpython-310.pyc,, +IPython/core/__pycache__/prompts.cpython-310.pyc,, +IPython/core/__pycache__/pylabtools.cpython-310.pyc,, +IPython/core/__pycache__/release.cpython-310.pyc,, +IPython/core/__pycache__/shellapp.cpython-310.pyc,, +IPython/core/__pycache__/splitinput.cpython-310.pyc,, +IPython/core/__pycache__/ultratb.cpython-310.pyc,, +IPython/core/__pycache__/usage.cpython-310.pyc,, +IPython/core/alias.py,sha256=S7q-haVF8diea8Fre7mo2N7IqsjfxTd2zA4fI3rZmkM,10034 +IPython/core/application.py,sha256=nzXXjwBboMIhawWtSE4B4bKVyjgEaYtn2C2ho2Hlw7k,18937 +IPython/core/async_helpers.py,sha256=HGcohjkgpnha39Ec12YgW0eB7F0Cz2Zc0Mj8rX8qHgc,4297 +IPython/core/autocall.py,sha256=109_9e0zV5jcK1ax8SZxp9vsIAu0m_KHbZINEnDSyv8,1991 +IPython/core/builtin_trap.py,sha256=2kYS2hoQQ0eDFQAJE9XTp_sQrBVyadDFO2rdPXZbv2I,3009 +IPython/core/compilerop.py,sha256=BPie6q8NtBWd08bZ4hiHUfPi3wyhakhCkO1wpFRl1r0,7730 +IPython/core/completer.py,sha256=8U_eYDmfck17EcAgvzK4l1-SiCyqB38ABFGrKWQTdA4,117852 +IPython/core/completerlib.py,sha256=QG13-ZWeqHsZ5HjooJtqKqMAH2ZLMeCLuvNP7qu8_-I,12365 +IPython/core/crashhandler.py,sha256=QMtLXKtrtCkRzLoMU7vaCNvC3k7F7JoV1EUZ2I1q1tg,8508 +IPython/core/debugger.py,sha256=1np4weOvmHFI4l0bbON5xxSSq-mPJOyF7Q5pQJpeZ28,38872 +IPython/core/display.py,sha256=4DRAWUiQ1P5eaEAq35a0r4bhIFuWdAxs9KkvBVQLj0c,42503 +IPython/core/display_functions.py,sha256=UkI057nIpcOYynQATKtNzwWXpM8MK2GMICzma8BVAp4,12918 +IPython/core/display_trap.py,sha256=31jM26B3PhNSLJhpyRHuTWscObwVMOlH9PDC2v8HmsU,2098 +IPython/core/displayhook.py,sha256=hNatKE_7sMairKUuXWrPF8YpivFyS-faru2e5H8__m8,12962 +IPython/core/displaypub.py,sha256=4r-xfGXX0yqhYZ8TtfjLndqLrbYFr3TRFFUm1b-pPzE,4944 +IPython/core/error.py,sha256=lL5WP3E0sGNWkBTQL0u795wLQJCSrDCf328ft8TfCjk,1734 +IPython/core/events.py,sha256=McEy6Dtt_YjTIionQv-d3wVRfAAcQFdJt5weP6ie_z8,5251 +IPython/core/excolors.py,sha256=IzILJEC0xPcBbcQx6aFNC280xAUX8Ixbt8MEOibdZs0,4928 +IPython/core/extensions.py,sha256=QQwyuzrtBvn5A27uyvJJSliq8o-tgtQd34Dfwfnij7I,5780 +IPython/core/formatters.py,sha256=sjJmbV29RoXNwZIJMlNXY09ODQ1zfl1qwPJaICt51Ww,34981 +IPython/core/getipython.py,sha256=znwXeOUdFNiyfnJuN6BGmHEk94KjV9mQasXc60QPGF0,912 +IPython/core/guarded_eval.py,sha256=5V3JqgHbcnLvjwfcLMeVbsmJ043U9cEdRNj-KtQrATE,25037 +IPython/core/history.py,sha256=HFUZ4RmooejeY_fFfB-ct8aag81GECjpJ8NSjvMWQDc,34475 +IPython/core/historyapp.py,sha256=Vba0W2a5K-J8WXPurjLahedJt_Erho_p7bCohRLolQU,5909 +IPython/core/hooks.py,sha256=AqFSlbYxpwosX5gvIpr7l1dtNRgvorD8D9_dagwqdVQ,5663 +IPython/core/inputsplitter.py,sha256=QJFtXkBZDPrhFPcN30p6H2YiX9tiE34afQxQWy41bic,29041 +IPython/core/inputtransformer.py,sha256=eJpe_2U_J5Ly9khl_33AvF8EaXaeC_xvGccLmd4Tec0,18184 +IPython/core/inputtransformer2.py,sha256=Pb7M0OY1tdzlLlAvyarcBgmkMjkl2DWJvabXALVNcFM,29393 +IPython/core/interactiveshell.py,sha256=ed0g7BKdgqn9do0a4F7iXBa7N5C4JJ9XUoe_V0Uvbq8,153842 +IPython/core/latex_symbols.py,sha256=YiIWrYezmqutOkwydHg7VVWyNVjPaL6uqfF_iyGEhbk,31288 +IPython/core/logger.py,sha256=t1MEuwcDMJ5SshE36n2KUtcs2LPNWKniIFsKB2_nCCk,8441 +IPython/core/macro.py,sha256=83KmGTzviEMXNLAzfdL-Mwi47zAGmbpFjDSnYPNYpfM,1734 +IPython/core/magic.py,sha256=Z9Ntw-43GZKz6XNJBzBUYYbB1xPa3GTZ34ZBmPh3H5c,28899 +IPython/core/magic_arguments.py,sha256=JWgPRHXdckllfkHq8mk30xXLJKmoB9mABadd8z4_uyk,9734 +IPython/core/magics/__init__.py,sha256=pkd-UfzjDGp5UHuFKjw192vZnigpTP9ftXzG3oLdiS8,1619 +IPython/core/magics/__pycache__/__init__.cpython-310.pyc,, +IPython/core/magics/__pycache__/ast_mod.cpython-310.pyc,, +IPython/core/magics/__pycache__/auto.cpython-310.pyc,, +IPython/core/magics/__pycache__/basic.cpython-310.pyc,, +IPython/core/magics/__pycache__/code.cpython-310.pyc,, +IPython/core/magics/__pycache__/config.cpython-310.pyc,, +IPython/core/magics/__pycache__/display.cpython-310.pyc,, +IPython/core/magics/__pycache__/execution.cpython-310.pyc,, +IPython/core/magics/__pycache__/extension.cpython-310.pyc,, +IPython/core/magics/__pycache__/history.cpython-310.pyc,, +IPython/core/magics/__pycache__/logging.cpython-310.pyc,, +IPython/core/magics/__pycache__/namespace.cpython-310.pyc,, +IPython/core/magics/__pycache__/osm.cpython-310.pyc,, +IPython/core/magics/__pycache__/packaging.cpython-310.pyc,, +IPython/core/magics/__pycache__/pylab.cpython-310.pyc,, +IPython/core/magics/__pycache__/script.cpython-310.pyc,, +IPython/core/magics/ast_mod.py,sha256=2NII5ahWDJGTkns-IcL1qOigbDNiV0zn0WxQ9JcuU-Q,10179 +IPython/core/magics/auto.py,sha256=ZQnw51feGjsxK1KOjRAyY_WQPMwRkrqBa4vzV4X-j-E,4816 +IPython/core/magics/basic.py,sha256=4bI4ANel37YeapLAN7_t0cQvTbauzr1aEZvgcNKIz5s,23133 +IPython/core/magics/code.py,sha256=CB7jt4XSRyCsOrm7r371l_y3ya9-AN2wF7BItXXQaCU,28051 +IPython/core/magics/config.py,sha256=QBL5uY7m-Q7C46mO3q1Yio9s73w1TnI9y__j5E-j44Y,4881 +IPython/core/magics/display.py,sha256=STRq66GlZwcvFyBxbkqslclpP_s9LnqD0ew9Z3S4-Jo,3130 +IPython/core/magics/execution.py,sha256=99jI56S8RaW6RHiPnBBR-j5l8pNwb6lPScXFfGDtO_4,60894 +IPython/core/magics/extension.py,sha256=Jj6OlkM71PS0j1HfEMDc-jU2Exwo9Ff_K0nD7e_W4N0,2477 +IPython/core/magics/history.py,sha256=ASgJ4Do2acCfaB8nPSuOGKORRVPFNNtBNTgosmhrMpk,12628 +IPython/core/magics/logging.py,sha256=eUWzo8aRqmhmbxsjmJYoGdKpf1PtTvyNxafrrDZJSmg,6859 +IPython/core/magics/namespace.py,sha256=enU3JDllAYXVsaSMixrtziXq4bonrCBcxDz0lj23W3o,24823 +IPython/core/magics/osm.py,sha256=qfqUa1qr3BEnQ1KEFGizAYWI15HNxC5sESi-kR1woUw,30696 +IPython/core/magics/packaging.py,sha256=g7a9cVBh5nf98E31PLHJuUglGg772EJzuOFAWfhpRkc,4917 +IPython/core/magics/pylab.py,sha256=wwyGr-CVpnX_UkB8pFUaBILo4PXCIMwZNmXEw0tPT6Q,6626 +IPython/core/magics/script.py,sha256=K1fIlBCjHUVBM7oYrt-OioZD5TL2kC6qfjAwge4IGQY,12543 +IPython/core/oinspect.py,sha256=YFWUrVJCNc1ymTMfWtj1fuDkqEiNLOOqVi14BU8oFuk,39812 +IPython/core/page.py,sha256=3ekRpUguRgRq9C8gX-uFy3Yk5px_dw5MG7dMuirXCAU,11753 +IPython/core/payload.py,sha256=SOvmxRbZgCI_fq4ZoOeMKsblk8rYsuHumUefk-3TaTI,1758 +IPython/core/payloadpage.py,sha256=SFhobOhkr9w_69c8oWVcfZGexDciU4i9Lltztqg6fco,1431 +IPython/core/prefilter.py,sha256=APwfql3v4wIRB7HpCifqLVyWweqe8Gi05k2eMlQqRUI,25588 +IPython/core/profile/README_STARTUP,sha256=Y47GtYQkWy6pdzkqylUNL6eBSZMUIRGwTxXPUF_BBBc,371 +IPython/core/profileapp.py,sha256=3BHKEknttcY_T9rPzk9GeMS_OhIn3n46TeDPvJb-zK8,10631 +IPython/core/profiledir.py,sha256=V2_b4pAR4A8ndjyJdn5xf7F5IRhwsONfbNo4tu6dJvI,8029 +IPython/core/prompts.py,sha256=3icFefY5NVob6-JeUORH_uRK1h4JTygC3oH1HbN4Q0Q,607 +IPython/core/pylabtools.py,sha256=3L26ZLCcrLkAuAr-vZH2ry60T-Lna89Gi_kKTnMh8ac,14018 +IPython/core/release.py,sha256=v8NmIefnZHO056TPbDdrnPvLjM2W80RJkYd-6N_WHJg,2178 +IPython/core/shellapp.py,sha256=I1diBBMEub6JWrEK0LXKQS1Y5VfT1qtsvKFHP3UXOtM,17845 +IPython/core/splitinput.py,sha256=rj9MWhSQK6fw3Nx4b58h0pfQoJlLeOYeQzxwqzMC8zI,4836 +IPython/core/tests/2x2.jpg,sha256=YF88a1SklCHZeEbuKL9H13TJM8t8myvSqgffxh7LgkY,331 +IPython/core/tests/2x2.png,sha256=ZB6RfzGIikj1RojC3sbJNIeiMAjbcfur9IvYVcfi2-I,71 +IPython/core/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +IPython/core/tests/__pycache__/__init__.cpython-310.pyc,, +IPython/core/tests/__pycache__/bad_all.cpython-310.pyc,, +IPython/core/tests/__pycache__/nonascii.cpython-310.pyc,, +IPython/core/tests/__pycache__/nonascii2.cpython-310.pyc,, +IPython/core/tests/__pycache__/print_argv.cpython-310.pyc,, +IPython/core/tests/__pycache__/refbug.cpython-310.pyc,, +IPython/core/tests/__pycache__/simpleerr.cpython-310.pyc,, +IPython/core/tests/__pycache__/tclass.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_alias.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_application.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_async_helpers.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_autocall.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_compilerop.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_completer.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_completerlib.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_debugger.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_display.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_displayhook.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_events.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_exceptiongroup_tb.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_extension.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_formatters.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_guarded_eval.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_handlers.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_history.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_hooks.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_imports.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_inputsplitter.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_inputtransformer.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_inputtransformer2.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_inputtransformer2_line.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_interactiveshell.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_iplib.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_logger.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_magic.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_magic_arguments.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_magic_terminal.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_oinspect.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_page.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_paths.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_prefilter.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_profile.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_prompts.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_pylabtools.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_run.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_shellapp.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_splitinput.cpython-310.pyc,, +IPython/core/tests/__pycache__/test_ultratb.cpython-310.pyc,, +IPython/core/tests/bad_all.py,sha256=GARnHj1buvbHLjoKLiEy7XTqvo91Xb7ckOrNqh8YsnY,206 +IPython/core/tests/daft_extension/__pycache__/daft_extension.cpython-310.pyc,, +IPython/core/tests/daft_extension/daft_extension.py,sha256=P1-QHT4a71h0vbRRPHItoFSTLySzH03tjXvBuEHdJFc,285 +IPython/core/tests/nonascii.py,sha256=dLpEo2Q49dEMmo13f49ac4Hy1zixiDsVXehazBJfi54,135 +IPython/core/tests/nonascii2.py,sha256=D81kLhC1wGgYv9XjY89FKZSyKRz_rTAsKY9dOZ507cs,155 +IPython/core/tests/print_argv.py,sha256=hZW-UX2m6WLotOLClNc3Bt8Anik3UjSbli5bp6OnT2A,32 +IPython/core/tests/refbug.py,sha256=A9Usb4msz_SlT4MMjDoySvoJp-02ucc1mZ12IfmLKqw,1494 +IPython/core/tests/simpleerr.py,sha256=WXX2k9CSDEKY7G7zXXYdZcpcavmFi42e-0JTXWeqDEw,583 +IPython/core/tests/tclass.py,sha256=SqfWzMaQVWHQFPn7_DFI04yvATZcaxJlXAwf9aSoNE8,921 +IPython/core/tests/test_alias.py,sha256=sfvm14mp0lbzFvr374h1j6bfWk9gk7t6XKArGrWIX8I,2007 +IPython/core/tests/test_application.py,sha256=IZZXoWDg4A4QJTqECd7-mdBENzfXnlLcj_r8aKvl8fI,2245 +IPython/core/tests/test_async_helpers.py,sha256=M-K19JzUEBXheQdnS9m1xFsMXV4PZol0gW3KBW7uBEI,8860 +IPython/core/tests/test_autocall.py,sha256=JLFN1yM8D8D9ebdmkioalSmTGDeJayLMzKzFEnZxDpE,1425 +IPython/core/tests/test_compilerop.py,sha256=6Uz1MtsruRp0GL_k8j6tYFR9c77jxEvTOavwya5sMZI,2174 +IPython/core/tests/test_completer.py,sha256=XFrtrBUIJr0pt4tqmAnFzCn6vckIJ3UIlDBqCxfdr9Y,61697 +IPython/core/tests/test_completerlib.py,sha256=OVEWgAxfoxGGkyDix2pD1L9Gime1Abk3ljccFCJH__A,6507 +IPython/core/tests/test_debugger.py,sha256=bV5RCMBHxQj8Qdu_i-zeOzu2PkzVUgMUOLz6AgCFxHE,14501 +IPython/core/tests/test_display.py,sha256=O_5xtc3wd0j4etmDDsVrk9e10QgTROblHPkSsQdPaFk,15946 +IPython/core/tests/test_displayhook.py,sha256=qpnjIMNxvoXKB-Cc4rUK-1epbZJIJiyAvpB5ecB0UKY,3593 +IPython/core/tests/test_events.py,sha256=NY79Nc17cVAmsZYoybzxqeOP7s699M1AtAsayxGbz6g,2287 +IPython/core/tests/test_exceptiongroup_tb.py,sha256=1Hf-2_yGiLzbc6NTO1bvoh1AuPx4jr-1MRHqX6wIZLQ,3599 +IPython/core/tests/test_extension.py,sha256=MsaNMVltHZf_wVfbDR64lz681HDBPa7BHi56KeFh6og,3026 +IPython/core/tests/test_formatters.py,sha256=kRzxuGwRubUSpzPd5jCyEBbntbxLSQjgKGmjunH0sV4,14249 +IPython/core/tests/test_guarded_eval.py,sha256=CH7FM7o4TN4-6yUqNI_4pLW4mYmg0gdEk_10BjTvWb0,15655 +IPython/core/tests/test_handlers.py,sha256=o9oxD0UFYVCb7pazgbn7-PuqU1QK93Cb8pw9s1l6xoM,3286 +IPython/core/tests/test_history.py,sha256=-DNmLket-C0T1nhGBY8uiit1Z_xA6JEmmS952JFCk38,11698 +IPython/core/tests/test_hooks.py,sha256=TXgjnflaoteTBR79n8P4pBkN9yllGclX42a5ewjmdA4,2316 +IPython/core/tests/test_imports.py,sha256=lR-_hRQC-AIe750c4k3AmCbN3spE-KaZevP2Cx8mzNY,1153 +IPython/core/tests/test_inputsplitter.py,sha256=A7pi941xmso6S3dAI4P6z-vHR9p9F4NvPq24XGVbhUU,23190 +IPython/core/tests/test_inputtransformer.py,sha256=zQRaBtWZg4Thjc9ZJFdO4inJZJ1FyYL7bpHerDuT7-o,15755 +IPython/core/tests/test_inputtransformer2.py,sha256=acfQiVdvmAx7albyhAoHmysIrZNRsfMUWHWUN4H8xqY,11350 +IPython/core/tests/test_inputtransformer2_line.py,sha256=4-Jpebco_LW8Yzpf6OmGryugqYTOV9-MHWl6bp9QFrc,2971 +IPython/core/tests/test_interactiveshell.py,sha256=4f9PNeUAkepohol_Pj4jwg7ANW63lpEDGjX0cny-Yg4,39660 +IPython/core/tests/test_iplib.py,sha256=wDI6uHw5MoRcgh8pZ4wnttm-d7tnYZPe5UNBMdtgchQ,6677 +IPython/core/tests/test_logger.py,sha256=MPLAcvIq_ggtO3M0RP62TNUrVVjG7rvCQ0-pSm3MMrk,776 +IPython/core/tests/test_magic.py,sha256=cBLxACFdBk_qkOjtBj_IR6_vok7VuNOoD01SpHQfw8Y,44359 +IPython/core/tests/test_magic_arguments.py,sha256=W8twwUwQKwJCRAP-gvrZhOVDJbyx7dovd9oqzNp8vzU,4936 +IPython/core/tests/test_magic_terminal.py,sha256=LiHprrkhNSf_3HRsAu7XKUSPir7xAoIVVCIOCkJBNPE,5996 +IPython/core/tests/test_oinspect.py,sha256=POF2POBzhHCkQ2H7K4NvCELZsfcljzojR7e7FBeh-Wc,15628 +IPython/core/tests/test_page.py,sha256=dA1r_xWG90NNDvtHpr11JxNUCc_E7QoIEgoUmMLvrdc,772 +IPython/core/tests/test_paths.py,sha256=76KV2HnzOMaulYOq4Q-HzQY3hX1PwW-69L9pai9ojug,7081 +IPython/core/tests/test_prefilter.py,sha256=2jMCKei2EtYDhMFRq0nnRwThITJVqEG9mCt8d705pko,4214 +IPython/core/tests/test_profile.py,sha256=dqVTOo5lQGNa88liGgmRg_XLaO26PqmVH-i_9P-V1Cg,5064 +IPython/core/tests/test_prompts.py,sha256=jbga48K0Fg92Fx92k9JuKz5o74yhhoKP2dzrMKZ8Gy8,845 +IPython/core/tests/test_pylabtools.py,sha256=BWwqDONyLq8nXWpvBkQqh1gMJKIR5KitCxt1XjaDoRg,7880 +IPython/core/tests/test_run.py,sha256=GTHUc_zA2Nht6znLnhjVTstnBLl2PMvqyW4DxaCx4hQ,19369 +IPython/core/tests/test_shellapp.py,sha256=fVIPW5-E87td88SI-aVGtrO_KHEZ-MCxsR3vsHihXvc,1892 +IPython/core/tests/test_splitinput.py,sha256=VTHJGd0RKLHC795BlB9QK58DNRU4ISgORN-EPTEb4eU,1227 +IPython/core/tests/test_ultratb.py,sha256=mnQ5yzgBRUNNPNarp0Is0Ogkapt8CAHjR3U3YdLneWk,12026 +IPython/core/ultratb.py,sha256=VG-ypR5KPJN9TyeUUj3O7_L9yP7GdglNGlY89UXHMt4,55803 +IPython/core/usage.py,sha256=agrZE5eZIvJnXoqI8VV9e-oWZx5LbLxUq9MdQpEyts4,13542 +IPython/display.py,sha256=mVn5l6vUPceloFQJszpRrqtQ3JFhVzGwy7CHvmn-yPU,1497 +IPython/extensions/__init__.py,sha256=V4vSllFd18CVUvDTbXLYqfwTFmPXUiQZGCs5LX2IliE,78 +IPython/extensions/__pycache__/__init__.cpython-310.pyc,, +IPython/extensions/__pycache__/autoreload.cpython-310.pyc,, +IPython/extensions/__pycache__/storemagic.cpython-310.pyc,, +IPython/extensions/autoreload.py,sha256=0LGwni8DV6fjWZ0c3pyZhKNy27Jno_T5mpbsHzmaB4E,23469 +IPython/extensions/storemagic.py,sha256=8kdpgnamB2zYoP8n_Tawd3zrzjahg2w7Iva9QFOgEVc,8161 +IPython/extensions/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +IPython/extensions/tests/__pycache__/__init__.cpython-310.pyc,, +IPython/extensions/tests/__pycache__/test_autoreload.cpython-310.pyc,, +IPython/extensions/tests/__pycache__/test_storemagic.cpython-310.pyc,, +IPython/extensions/tests/test_autoreload.py,sha256=t9LQ5ywf_hGhFQ8mHNTVDMCUy_v5oq_TJQ3ixKyZFYw,23198 +IPython/extensions/tests/test_storemagic.py,sha256=ToLU7rBwOwBU-63KEWEpwT8cGQJ7Rr8RyOE4z9Ys__4,2081 +IPython/external/__init__.py,sha256=-EQHbuUnBe1RS1_CwaLGzNSZQsCJsrxHW_r15smvVW0,126 +IPython/external/__pycache__/__init__.cpython-310.pyc,, +IPython/external/__pycache__/qt_for_kernel.cpython-310.pyc,, +IPython/external/__pycache__/qt_loaders.cpython-310.pyc,, +IPython/external/qt_for_kernel.py,sha256=NHamODujSAq1IrbtFJ5HuEDcuFpjNDtztYjCXlZjyYQ,3443 +IPython/external/qt_loaders.py,sha256=JLtgi7BPSXo4KtMDSRxj5T_Amzf98P7mdDgwn9l7O9A,11510 +IPython/external/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +IPython/external/tests/__pycache__/__init__.cpython-310.pyc,, +IPython/external/tests/__pycache__/test_qt_loaders.cpython-310.pyc,, +IPython/external/tests/test_qt_loaders.py,sha256=EIsNOsGlfMeOWT1OLKDvAAkxWFs_ltO2V1tGKBa4mz0,367 +IPython/lib/__init__.py,sha256=O_m_I8hczvUsgl01oAZd_TelugfR-2oKTXhxqbXHcwk,409 +IPython/lib/__pycache__/__init__.cpython-310.pyc,, +IPython/lib/__pycache__/backgroundjobs.cpython-310.pyc,, +IPython/lib/__pycache__/clipboard.cpython-310.pyc,, +IPython/lib/__pycache__/deepreload.cpython-310.pyc,, +IPython/lib/__pycache__/demo.cpython-310.pyc,, +IPython/lib/__pycache__/display.cpython-310.pyc,, +IPython/lib/__pycache__/editorhooks.cpython-310.pyc,, +IPython/lib/__pycache__/guisupport.cpython-310.pyc,, +IPython/lib/__pycache__/latextools.cpython-310.pyc,, +IPython/lib/__pycache__/lexers.cpython-310.pyc,, +IPython/lib/__pycache__/pretty.cpython-310.pyc,, +IPython/lib/backgroundjobs.py,sha256=9uj1cPtseoXsYYn0gNC1cadPHPz8MvYCa9HpFz3v-_A,17738 +IPython/lib/clipboard.py,sha256=izILyYHBH892cwcz6YlPdujBd6EO8CgI9-yUlLvCnFw,3050 +IPython/lib/deepreload.py,sha256=iymTEcJpP_hpcO1H5GRgb2aODGUtiUFksodoIe9738E,9431 +IPython/lib/demo.py,sha256=hKJousFvJQ8wm2a_tlwqnN_e4V8V-gzXS8UPfoo6-O0,24518 +IPython/lib/display.py,sha256=igyK1cNwqYiHkmvI7oMNdhm6p1qrHT_2R_rx5gYVOtg,24566 +IPython/lib/editorhooks.py,sha256=KmQaAEZawUhHqy9CvRkbmc8BNXx4b1pqqLFhTEBf1CY,3982 +IPython/lib/guisupport.py,sha256=e3gQE2-rYF2Mj9EFqSYOKOjMDmys8o-yae7SEjiOeEs,6300 +IPython/lib/latextools.py,sha256=tpBvrBqWCBAp-qnUKIlmhGswWJdyUxzDmFjoMEHoP8Y,8177 +IPython/lib/lexers.py,sha256=Lr2y_1iXGbyc2TG11_LeyBg7IXFR--0nDUj72KMNaaU,20968 +IPython/lib/pretty.py,sha256=3Y2myPGY4TkTYgTbVzvISWw68lWnDerQ0M-mxQPP4Qg,30458 +IPython/lib/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +IPython/lib/tests/__pycache__/__init__.cpython-310.pyc,, +IPython/lib/tests/__pycache__/test_backgroundjobs.cpython-310.pyc,, +IPython/lib/tests/__pycache__/test_clipboard.cpython-310.pyc,, +IPython/lib/tests/__pycache__/test_deepreload.cpython-310.pyc,, +IPython/lib/tests/__pycache__/test_display.cpython-310.pyc,, +IPython/lib/tests/__pycache__/test_editorhooks.cpython-310.pyc,, +IPython/lib/tests/__pycache__/test_imports.cpython-310.pyc,, +IPython/lib/tests/__pycache__/test_latextools.cpython-310.pyc,, +IPython/lib/tests/__pycache__/test_lexers.cpython-310.pyc,, +IPython/lib/tests/__pycache__/test_pretty.cpython-310.pyc,, +IPython/lib/tests/__pycache__/test_pygments.cpython-310.pyc,, +IPython/lib/tests/test.wav,sha256=y6O86Ch8OfzBfXicO8yG31DyYifGpYMPJgn-NTj1OS4,44144 +IPython/lib/tests/test_backgroundjobs.py,sha256=8_rca5-mEeBAiFW_vhgricTkWoZsVbgSgDy4jP7M_YU,2698 +IPython/lib/tests/test_clipboard.py,sha256=B4u-RAGkcWd5MhoPeYOlmS7SvGQaQrVi0SwrEcOKFCM,630 +IPython/lib/tests/test_deepreload.py,sha256=SQcT4vnTdT2d5-1Fzj4ssCC6h6v-f2xguO01zAnJTCI,1854 +IPython/lib/tests/test_display.py,sha256=gYAAjYV_MJeJf_hEZzs_karq7e3eOiF3tFuZ02sAhic,9313 +IPython/lib/tests/test_editorhooks.py,sha256=dgl3FrxKrYNtRFO9n3hTho5KnmTUiPlwSSXQAZB14fo,884 +IPython/lib/tests/test_imports.py,sha256=59til_pfq_0PFq7-Uhnao05ILUQeqUKNSZe1QCZmWD0,273 +IPython/lib/tests/test_latextools.py,sha256=rh2xReu5pt0v7YZXHY1J7y-UQ8bJxQNs8QxgxZNIpOI,5736 +IPython/lib/tests/test_lexers.py,sha256=2mo5prbF8fTJAx_Ris_zpOKsWrhVHU2lD-XV5tSgjig,6017 +IPython/lib/tests/test_pretty.py,sha256=OPaqf3mav2grBcbGYb3T6aC1gCnDkNiJViFQxqwDkEk,14843 +IPython/lib/tests/test_pygments.py,sha256=PBsPc3BIx1IEJRUaxocBcK741MuQJsASA1yscepMDO8,824 +IPython/paths.py,sha256=iOW1ArUYyCQRXwVZfvHOFB-AcqVAQqb2eLvGOe98xfc,4335 +IPython/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +IPython/sphinxext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +IPython/sphinxext/__pycache__/__init__.cpython-310.pyc,, +IPython/sphinxext/__pycache__/custom_doctests.cpython-310.pyc,, +IPython/sphinxext/__pycache__/ipython_console_highlighting.cpython-310.pyc,, +IPython/sphinxext/__pycache__/ipython_directive.cpython-310.pyc,, +IPython/sphinxext/custom_doctests.py,sha256=6Z078UoaYUlniKTFv4K61LiJe6zt-hvo6ESWb-Y8_gE,4615 +IPython/sphinxext/ipython_console_highlighting.py,sha256=D60MJnG-Dsv4B_Byd9FmA3ow9PJBx2Q1B2BWMQB9XYg,970 +IPython/sphinxext/ipython_directive.py,sha256=-K3216EiyQZV8qMWD4vfLnaek0Qg3bX1G9fcsnQVDjQ,45149 +IPython/terminal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +IPython/terminal/__pycache__/__init__.cpython-310.pyc,, +IPython/terminal/__pycache__/console.cpython-310.pyc,, +IPython/terminal/__pycache__/debugger.cpython-310.pyc,, +IPython/terminal/__pycache__/embed.cpython-310.pyc,, +IPython/terminal/__pycache__/interactiveshell.cpython-310.pyc,, +IPython/terminal/__pycache__/ipapp.cpython-310.pyc,, +IPython/terminal/__pycache__/magics.cpython-310.pyc,, +IPython/terminal/__pycache__/prompts.cpython-310.pyc,, +IPython/terminal/__pycache__/ptutils.cpython-310.pyc,, +IPython/terminal/console.py,sha256=LhKpLPNW6KCk2fPssrMNjxb3dP4tfxuVb75NtjENwN0,691 +IPython/terminal/debugger.py,sha256=rGZVKZmFDxJbC5P3s4XweaH9H0o9bOQv_H_WpOA-8FY,7106 +IPython/terminal/embed.py,sha256=3kW11bdrnpSlmV1s_ev_qp6XDOtyB5KHsAdavA51ewk,16041 +IPython/terminal/interactiveshell.py,sha256=VfGwfJhcj1F1-OkEsXFHEty9fb6cBVd1Dzwpk4nz-ow,37668 +IPython/terminal/ipapp.py,sha256=ehCDMlcLvGv7v3eap1Jg5k3UdAdtgWwgZMvQiNMJcJo,12330 +IPython/terminal/magics.py,sha256=49ZVJzbAUkG_EFpebxIBEqm3tEClvqefoeM6QnxGrrk,7705 +IPython/terminal/prompts.py,sha256=uPwHcYw25bJSc7c6wnnLcEl8xcwtI9nHq-tUhEE_SzI,4062 +IPython/terminal/pt_inputhooks/__init__.py,sha256=jB7MOn9ZtC5qcq9RnCu9kbxjysP5YrN9KbXeYIx79Q4,3606 +IPython/terminal/pt_inputhooks/__pycache__/__init__.cpython-310.pyc,, +IPython/terminal/pt_inputhooks/__pycache__/asyncio.cpython-310.pyc,, +IPython/terminal/pt_inputhooks/__pycache__/glut.cpython-310.pyc,, +IPython/terminal/pt_inputhooks/__pycache__/gtk.cpython-310.pyc,, +IPython/terminal/pt_inputhooks/__pycache__/gtk3.cpython-310.pyc,, +IPython/terminal/pt_inputhooks/__pycache__/gtk4.cpython-310.pyc,, +IPython/terminal/pt_inputhooks/__pycache__/osx.cpython-310.pyc,, +IPython/terminal/pt_inputhooks/__pycache__/pyglet.cpython-310.pyc,, +IPython/terminal/pt_inputhooks/__pycache__/qt.cpython-310.pyc,, +IPython/terminal/pt_inputhooks/__pycache__/tk.cpython-310.pyc,, +IPython/terminal/pt_inputhooks/__pycache__/wx.cpython-310.pyc,, +IPython/terminal/pt_inputhooks/asyncio.py,sha256=sHXYhKqzXmPQMzerxqBRheFqOetx8P4-z7k-J_b3TAE,1844 +IPython/terminal/pt_inputhooks/glut.py,sha256=ATdBrX7p904Y0zXQazeLYSxRD0T9dUNLBuRFOQDXyH4,4997 +IPython/terminal/pt_inputhooks/gtk.py,sha256=qx0OTtDdinx39bD9Fbf6m0JZWBXmuoypr56yUITFtfE,2427 +IPython/terminal/pt_inputhooks/gtk3.py,sha256=eTzGx-SkT1wlplTtuRSPNzPdnnrJQRQ9FmZ_nvmKmP0,280 +IPython/terminal/pt_inputhooks/gtk4.py,sha256=r_MxCT7a0nTHZtqyuZpPgCW2Cl7iuomC0PjgFteSL9c,557 +IPython/terminal/pt_inputhooks/osx.py,sha256=TnndyR_SPbmWC_A--0ORB06rhH7IS2_7kjphfPcRqXo,4448 +IPython/terminal/pt_inputhooks/pyglet.py,sha256=_zyQkcOUGpBoMQ5DGTHbIEIIwtMjN2Ycq5hdfkPE9nQ,2368 +IPython/terminal/pt_inputhooks/qt.py,sha256=IZKKoiNaCPwU1L4Qu4JNQ5pKJtwjuuO64FLb2jrWcP8,3406 +IPython/terminal/pt_inputhooks/tk.py,sha256=1aSYCec97FQpk7HyvIKHFiWBrJrJN7zgXHENQ3DjMEE,3648 +IPython/terminal/pt_inputhooks/wx.py,sha256=RZC045DMr17sMSWS63VZlI_7vkg_evOBZilxJuc6uZQ,7132 +IPython/terminal/ptutils.py,sha256=12mXHNFJT-qaI-KiI_8B5m8rQphAMGDXQiy4IRYjvjA,7481 +IPython/terminal/shortcuts/__init__.py,sha256=4_lbTK3IWIvStupzlwYStRBMxVBooiNcXtAXw0rjrbc,18452 +IPython/terminal/shortcuts/__pycache__/__init__.cpython-310.pyc,, +IPython/terminal/shortcuts/__pycache__/auto_match.cpython-310.pyc,, +IPython/terminal/shortcuts/__pycache__/auto_suggest.cpython-310.pyc,, +IPython/terminal/shortcuts/__pycache__/filters.cpython-310.pyc,, +IPython/terminal/shortcuts/auto_match.py,sha256=6jlu7xrOofUXSccb6A2e8q-Y8li2GyfiRsGvgLuUQFg,3065 +IPython/terminal/shortcuts/auto_suggest.py,sha256=iOnjSSh8dkYZkakRqhley4rmD8OYWdsL24UayDPzW-8,13449 +IPython/terminal/shortcuts/filters.py,sha256=7WESijHpfQjEr9Or19vUel6skw9BSj0oJkdUzc-T0FI,10997 +IPython/terminal/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +IPython/terminal/tests/__pycache__/__init__.cpython-310.pyc,, +IPython/terminal/tests/__pycache__/test_debug_magic.cpython-310.pyc,, +IPython/terminal/tests/__pycache__/test_embed.cpython-310.pyc,, +IPython/terminal/tests/__pycache__/test_help.cpython-310.pyc,, +IPython/terminal/tests/__pycache__/test_interactivshell.cpython-310.pyc,, +IPython/terminal/tests/__pycache__/test_pt_inputhooks.cpython-310.pyc,, +IPython/terminal/tests/__pycache__/test_shortcuts.cpython-310.pyc,, +IPython/terminal/tests/test_debug_magic.py,sha256=vYFqECY6WyrNNcdgme0k6XGQ4DqNzH8OB73dxifVIXI,2448 +IPython/terminal/tests/test_embed.py,sha256=cSElGIEfvrwqK1i6tgEu3ZEhbanqqVrYm5ddeFferds,4804 +IPython/terminal/tests/test_help.py,sha256=aPcn8TmY1sey8wl09fmXyPZR3bUO8WYUzd61VPEjr44,722 +IPython/terminal/tests/test_interactivshell.py,sha256=OPeC4P0Zdm1faZiFwoK3ZLyA96KL3TCmaxhMEXk5vu0,8276 +IPython/terminal/tests/test_pt_inputhooks.py,sha256=Nx-7XeCLr7nSjLRoXnmcRYZO8S4U1boDBOiyCWLCjZ0,1599 +IPython/terminal/tests/test_shortcuts.py,sha256=6N9PlysuqmgdkBzMQJyYzbV9lD1OI8KEGyxz5rR7JwM,14936 +IPython/testing/__init__.py,sha256=9t97XO03Ez9GdZA5FWZYmfyHZt2c3AqQe2dj_0AiPJY,784 +IPython/testing/__pycache__/__init__.cpython-310.pyc,, +IPython/testing/__pycache__/decorators.cpython-310.pyc,, +IPython/testing/__pycache__/globalipapp.cpython-310.pyc,, +IPython/testing/__pycache__/ipunittest.cpython-310.pyc,, +IPython/testing/__pycache__/skipdoctest.cpython-310.pyc,, +IPython/testing/__pycache__/tools.cpython-310.pyc,, +IPython/testing/decorators.py,sha256=aOGYnPwCnAhjAE0uAtVTbrspTWrEYA-60jOwdp-s_oc,6777 +IPython/testing/globalipapp.py,sha256=F-RD6xLFJ2R1jNPycA9zk116GfH8qTsgsYFECWCeDRY,3948 +IPython/testing/ipunittest.py,sha256=lmCOgPk1HuQnfIM4bdYX-eC7X5NmwQON-Rx_PuVPOSI,6540 +IPython/testing/plugin/README.txt,sha256=9Gkx2cWar5iNgkBoZY2HGvEvSEek3tj_MJIDbqNt5Ug,1043 +IPython/testing/plugin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +IPython/testing/plugin/__pycache__/__init__.cpython-310.pyc,, +IPython/testing/plugin/__pycache__/dtexample.cpython-310.pyc,, +IPython/testing/plugin/__pycache__/ipdoctest.cpython-310.pyc,, +IPython/testing/plugin/__pycache__/pytest_ipdoctest.cpython-310.pyc,, +IPython/testing/plugin/__pycache__/setup.cpython-310.pyc,, +IPython/testing/plugin/__pycache__/simple.cpython-310.pyc,, +IPython/testing/plugin/__pycache__/simplevars.cpython-310.pyc,, +IPython/testing/plugin/__pycache__/test_ipdoctest.cpython-310.pyc,, +IPython/testing/plugin/__pycache__/test_refs.cpython-310.pyc,, +IPython/testing/plugin/dtexample.py,sha256=yedUX2aIUpFLkeDyshT5fqaODJg0iQzU_zvGOSr4JLc,2921 +IPython/testing/plugin/ipdoctest.py,sha256=e7X2SCKNvJhiOFcN2LMMgzswIKNnO5emLdM8ZtcO5Qc,11881 +IPython/testing/plugin/pytest_ipdoctest.py,sha256=hn5L3tovmiBkDADvSWYmmGDex80HVRSnWVQaNFSQLdE,29689 +IPython/testing/plugin/setup.py,sha256=945a09Zm2HWWvukd5IVZ4v5p1czQPJfVlr5_Idey2AA,539 +IPython/testing/plugin/simple.py,sha256=YjVhrNz_312zpW3C-U7FiyFG0A49FkE33A8kLXmcUf8,727 +IPython/testing/plugin/simplevars.py,sha256=YZnDvFqQuFcrgzkgmm-koVRJKDnHCf0278Y5S_tyI3g,24 +IPython/testing/plugin/test_combo.txt,sha256=rrXjdOlRh9DltFu3GpuWuD0Hojtj4QQcEBOm52Z3-dE,923 +IPython/testing/plugin/test_example.txt,sha256=CGM8aZIYHlePDdAnR1yX3MfDGu0OceZpUiI_Y4tZGaU,730 +IPython/testing/plugin/test_exampleip.txt,sha256=5gLcj8iCk-WCOGz0ObpQpuZMhGwS1jUMyH3mouGxQJI,814 +IPython/testing/plugin/test_ipdoctest.py,sha256=Lc3qQdZ3amXf9EKA7JlXf30b3BzP8RwdNS9-SMRe2P0,1907 +IPython/testing/plugin/test_refs.py,sha256=y-Y2Q8niRIbaanbwpIzvEwwaHkJfAq10HYfb4bAXHBc,715 +IPython/testing/skipdoctest.py,sha256=haSEhd8EJr2Y0EbXXxv3pGvK6AQ8Lb7SyqkX5O8EU6s,717 +IPython/testing/tests/__init__.py,sha256=J4sAH04HH8RQnex-9174r9l7O15gIPzYUBXCcn6oAC0,558 +IPython/testing/tests/__pycache__/__init__.cpython-310.pyc,, +IPython/testing/tests/__pycache__/test_decorators.cpython-310.pyc,, +IPython/testing/tests/__pycache__/test_ipunittest.cpython-310.pyc,, +IPython/testing/tests/__pycache__/test_tools.cpython-310.pyc,, +IPython/testing/tests/test_decorators.py,sha256=xL30832viv2PxN-7yt7HVElc5vA1OOqWVZuXfqubtT8,3955 +IPython/testing/tests/test_ipunittest.py,sha256=7-1iCczPW2mH7aqcZA6F_yGpV7EBVYz8s_3rI1mNqsc,3301 +IPython/testing/tests/test_tools.py,sha256=3dtqZhP7KiUBaeK-TG7tuRbtpajTXi5BZ2j1JYhdr0M,4157 +IPython/testing/tools.py,sha256=jg2ONzFzRsGq4ZyxcTkXs2eXVTjJic1GHK6Wn2q131g,14105 +IPython/utils/PyColorize.py,sha256=VpRFScmCJxcMpk_mpcFTkeTqbfASBuHtfXt1ruFM7Ww,10875 +IPython/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +IPython/utils/__pycache__/PyColorize.cpython-310.pyc,, +IPython/utils/__pycache__/__init__.cpython-310.pyc,, +IPython/utils/__pycache__/_process_cli.cpython-310.pyc,, +IPython/utils/__pycache__/_process_common.cpython-310.pyc,, +IPython/utils/__pycache__/_process_posix.cpython-310.pyc,, +IPython/utils/__pycache__/_process_win32.cpython-310.pyc,, +IPython/utils/__pycache__/_process_win32_controller.cpython-310.pyc,, +IPython/utils/__pycache__/_sysinfo.cpython-310.pyc,, +IPython/utils/__pycache__/capture.cpython-310.pyc,, +IPython/utils/__pycache__/colorable.cpython-310.pyc,, +IPython/utils/__pycache__/coloransi.cpython-310.pyc,, +IPython/utils/__pycache__/contexts.cpython-310.pyc,, +IPython/utils/__pycache__/daemonize.cpython-310.pyc,, +IPython/utils/__pycache__/data.cpython-310.pyc,, +IPython/utils/__pycache__/decorators.cpython-310.pyc,, +IPython/utils/__pycache__/dir2.cpython-310.pyc,, +IPython/utils/__pycache__/docs.cpython-310.pyc,, +IPython/utils/__pycache__/encoding.cpython-310.pyc,, +IPython/utils/__pycache__/eventful.cpython-310.pyc,, +IPython/utils/__pycache__/frame.cpython-310.pyc,, +IPython/utils/__pycache__/generics.cpython-310.pyc,, +IPython/utils/__pycache__/importstring.cpython-310.pyc,, +IPython/utils/__pycache__/io.cpython-310.pyc,, +IPython/utils/__pycache__/ipstruct.cpython-310.pyc,, +IPython/utils/__pycache__/jsonutil.cpython-310.pyc,, +IPython/utils/__pycache__/localinterfaces.cpython-310.pyc,, +IPython/utils/__pycache__/log.cpython-310.pyc,, +IPython/utils/__pycache__/module_paths.cpython-310.pyc,, +IPython/utils/__pycache__/openpy.cpython-310.pyc,, +IPython/utils/__pycache__/path.cpython-310.pyc,, +IPython/utils/__pycache__/process.cpython-310.pyc,, +IPython/utils/__pycache__/py3compat.cpython-310.pyc,, +IPython/utils/__pycache__/sentinel.cpython-310.pyc,, +IPython/utils/__pycache__/shimmodule.cpython-310.pyc,, +IPython/utils/__pycache__/signatures.cpython-310.pyc,, +IPython/utils/__pycache__/strdispatch.cpython-310.pyc,, +IPython/utils/__pycache__/sysinfo.cpython-310.pyc,, +IPython/utils/__pycache__/syspathcontext.cpython-310.pyc,, +IPython/utils/__pycache__/tempdir.cpython-310.pyc,, +IPython/utils/__pycache__/terminal.cpython-310.pyc,, +IPython/utils/__pycache__/text.cpython-310.pyc,, +IPython/utils/__pycache__/timing.cpython-310.pyc,, +IPython/utils/__pycache__/tokenutil.cpython-310.pyc,, +IPython/utils/__pycache__/traitlets.cpython-310.pyc,, +IPython/utils/__pycache__/tz.cpython-310.pyc,, +IPython/utils/__pycache__/ulinecache.cpython-310.pyc,, +IPython/utils/__pycache__/version.cpython-310.pyc,, +IPython/utils/__pycache__/wildcard.cpython-310.pyc,, +IPython/utils/_process_cli.py,sha256=4B5tCcHgR9_njzdrA069QP3xM78GRnfnbF_YchaVuyU,2020 +IPython/utils/_process_common.py,sha256=5T2LhdNL2ba9rN1lsGLfrx1QV_y852xsBKvttb1gJ7g,7003 +IPython/utils/_process_posix.py,sha256=DWUOgQz4imRJe80iT4mDc-RkX20hcmnrPDuInQYDvrY,8666 +IPython/utils/_process_win32.py,sha256=FpNOzrjU0JlhCXNx3hlxJ_MeVQJhKQYq-9U_3D4VkEk,6132 +IPython/utils/_process_win32_controller.py,sha256=KKqpJW6voLs7kp0A_wRfM03EcAI_iv5BJxglR011qLI,21329 +IPython/utils/_sysinfo.py,sha256=iQ6dW5l79hTTyDtI7NITAd8faVVIS5UHyA66JtmMyd8,45 +IPython/utils/capture.py,sha256=seIkDR1LnmlsapRuvon5oiJhUc0pkUA-r_cCDHcH4AI,5161 +IPython/utils/colorable.py,sha256=SCaeLJJlW14DZvoyaYPL-I6jLs78GA10xh0jCuSw8IY,786 +IPython/utils/coloransi.py,sha256=25RGDkF_JYIz7nNkTaBch9rIqqyA3C7-2TWABP6cKpE,6972 +IPython/utils/contexts.py,sha256=9fViIf4GWOp0-5sfUdjYwDSYdRnFTOMTGMTphqOpiO8,1619 +IPython/utils/daemonize.py,sha256=91wAJwuFXA1FM8wGlbBJCPPF906jFJ-rdJOUp4b_5ZE,200 +IPython/utils/data.py,sha256=36VVGY1b0JG7_zSdbVSy8IzLqM0uT-uB12TBYWgd1lI,1015 +IPython/utils/decorators.py,sha256=qsYLskFlT2bB_Q-87ttBA56lAf-knWLOe5WiOwPdXFE,2680 +IPython/utils/dir2.py,sha256=D8w5dlmaTLY6yyA9AEBDC1nqx4po4Ol6i2tGG9eXuO0,2232 +IPython/utils/docs.py,sha256=QY8n0cFrTS6gePmT3Tppv9Tzgc3Pzlf33XuzAwiE_wE,86 +IPython/utils/encoding.py,sha256=jcvinrdvt1o_5FmQFlfJciB3U_asdkYnG0KogaS5rUQ,2843 +IPython/utils/eventful.py,sha256=idbcT7GyZ43hrX9e6cI2bz7kKr389yMBE9hos6amMzE,138 +IPython/utils/frame.py,sha256=4w8h7PqTC63akE-vyQoTRgDWy3cS_TpblVrIizlWS6s,3048 +IPython/utils/generics.py,sha256=vRjgikNsLi0iZUtTTMN-l7rcZBPOG2uc7dyYFRHLUgs,706 +IPython/utils/importstring.py,sha256=aBtB6LJz7Tsa5kIsi9HprC7g2pTc-a0Jx2SwxkqxPqQ,1050 +IPython/utils/io.py,sha256=QVse5--imYBpBDRdGjGLzg3214t2QeJ_d_-PLLlCs9o,4631 +IPython/utils/ipstruct.py,sha256=XPfl1b0rRjISwyG3P1e2kJLSFHawzcPY71UBoa5v7qo,11856 +IPython/utils/jsonutil.py,sha256=2QsAXueCIbbmjyz37Im9yXU41XK_XGJ9aGA7NGilDIs,148 +IPython/utils/localinterfaces.py,sha256=7Wt6gcjgHX4mcWbx_k3Z1GL4iR388ZRqM3Hhhh4_Uwg,169 +IPython/utils/log.py,sha256=3tYJLqZEa40zTX0tgKnpb-bvj4NhI64PijiRV6mnc78,123 +IPython/utils/module_paths.py,sha256=lBlarunvhPIzQ0cUoZ6yIIYRYYIqMaaGTZ8IIK5A0IY,2327 +IPython/utils/openpy.py,sha256=qnS9T2kfyVw5CLXvTkNivnbMzLZkaZ2v5SVJC2YCWVQ,3417 +IPython/utils/path.py,sha256=vhIlIVAsdmkNQI9Y0YeO-kbKkYsVyjszudfp6g3_93o,11937 +IPython/utils/process.py,sha256=Id0XV9-CzfUInpEWQJTcjJUePte4sQuaJ-pmjgPIxEA,1878 +IPython/utils/py3compat.py,sha256=e6RvspsCQXYsxUuuUJuqkr12ViAcO2Mkz-OpcQYmxic,1602 +IPython/utils/sentinel.py,sha256=pRzWbnR7gjM5R3g0ZqjSo94QNJpxgKWOLXT-yY18FmU,421 +IPython/utils/shimmodule.py,sha256=Sf0hohTA4a6zu7lxyKL_CFOSbMi4Y4D530lejwdaAXQ,2669 +IPython/utils/signatures.py,sha256=dIrPwSPou7WQWs5018lzs3-dEKwG-dX3g4_2_OCvdg4,474 +IPython/utils/strdispatch.py,sha256=LM8jEQo7G77PxpjusJ7EqDEQW4YHYpEyb7xnE6RrEaw,1838 +IPython/utils/sysinfo.py,sha256=WKjgXIILwYqMQ6FHINw-pgOaAZwsrvUJkmBq0_KMRY0,4365 +IPython/utils/syspathcontext.py,sha256=BEEEuRIjnDO63aDtCkmE631SoxbTvHewmtPQwviU00Y,1952 +IPython/utils/tempdir.py,sha256=tHwshFbHXzS-QhDoJX61apoGmQ7k0HmPGvjUvqtZDps,1867 +IPython/utils/terminal.py,sha256=W2Ii4DMjVAwxGsHlXmb5DJ0tO3tu7tfM9z-x40mIGmg,3206 +IPython/utils/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +IPython/utils/tests/__pycache__/__init__.cpython-310.pyc,, +IPython/utils/tests/__pycache__/test_capture.cpython-310.pyc,, +IPython/utils/tests/__pycache__/test_decorators.cpython-310.pyc,, +IPython/utils/tests/__pycache__/test_deprecated.cpython-310.pyc,, +IPython/utils/tests/__pycache__/test_dir2.cpython-310.pyc,, +IPython/utils/tests/__pycache__/test_imports.cpython-310.pyc,, +IPython/utils/tests/__pycache__/test_importstring.cpython-310.pyc,, +IPython/utils/tests/__pycache__/test_io.cpython-310.pyc,, +IPython/utils/tests/__pycache__/test_module_paths.cpython-310.pyc,, +IPython/utils/tests/__pycache__/test_openpy.cpython-310.pyc,, +IPython/utils/tests/__pycache__/test_path.cpython-310.pyc,, +IPython/utils/tests/__pycache__/test_process.cpython-310.pyc,, +IPython/utils/tests/__pycache__/test_pycolorize.cpython-310.pyc,, +IPython/utils/tests/__pycache__/test_shimmodule.cpython-310.pyc,, +IPython/utils/tests/__pycache__/test_sysinfo.cpython-310.pyc,, +IPython/utils/tests/__pycache__/test_tempdir.cpython-310.pyc,, +IPython/utils/tests/__pycache__/test_text.cpython-310.pyc,, +IPython/utils/tests/__pycache__/test_tokenutil.cpython-310.pyc,, +IPython/utils/tests/__pycache__/test_wildcard.cpython-310.pyc,, +IPython/utils/tests/test_capture.py,sha256=VfRuGBA7n521oa_uIN9_c_Lmyo0Vm912wuLV9xtDlCE,5319 +IPython/utils/tests/test_decorators.py,sha256=y_Hp5tjT8YbXe87HLe0-b5qhU9BcEzKMUdzAJdy-OWg,170 +IPython/utils/tests/test_deprecated.py,sha256=5QUNHDR5re_BowvOQKvM4d7vrstS-IPIQB6YNjqw6_o,183 +IPython/utils/tests/test_dir2.py,sha256=XDnqXd1kWF30KeInbzvAqotst7KgbxE-2nC3HbTJBNg,1446 +IPython/utils/tests/test_imports.py,sha256=6SWziRNPdGfA47SpcjXDJG7B6173EHT6vT39juEfBd0,439 +IPython/utils/tests/test_importstring.py,sha256=3ga_tyi0vkn-WbUylEI8EixFsB45NVBH8MR_-e8orWY,1213 +IPython/utils/tests/test_io.py,sha256=WcQb7j_cCE_3Pv4SQI_Gtlyy6fFYYXRZfNXBHvngyCo,1410 +IPython/utils/tests/test_module_paths.py,sha256=S4v2D8Lh9EQImTo8bXWNVxad21-i1-FEYGJs4r_ULlY,3272 +IPython/utils/tests/test_openpy.py,sha256=M_IYXSZPabQQJl3SwXmZCwju4vezIHlcNT9OqRDOQ4w,1219 +IPython/utils/tests/test_path.py,sha256=NzFbghnrUziB7a4-SP9F6wGILxvkgXTWPACTL_yq8ec,16104 +IPython/utils/tests/test_process.py,sha256=RBEWt4efV9UJjO3JnihFuuA6ZFAJj4n4G5nckhOINiU,6134 +IPython/utils/tests/test_pycolorize.py,sha256=T9qQuv3PoGAtUkOopqZYX398L9_i90wrHn6obe7EmN4,1761 +IPython/utils/tests/test_shimmodule.py,sha256=JEFbjzpXdDE-QUzgitFpVtnb0ve5NBjaacgz1uil3Tg,387 +IPython/utils/tests/test_sysinfo.py,sha256=omDs63QvyPXSlJT2jqDihBfVXPx5zLyhnG-25-2M6HE,464 +IPython/utils/tests/test_tempdir.py,sha256=sf_g4uJBGELf7nGZsWQwQlN8-X2PVOv9j2_Zs8-P-oY,1108 +IPython/utils/tests/test_text.py,sha256=2xdzUmdDPJgUCf4ZA8QJ0aDPEskvPiD74bHQYp616N8,7760 +IPython/utils/tests/test_tokenutil.py,sha256=7tXFsKesEBxe_5rkhU5msbkk_fRMRlCo0MwmAV6jH88,3918 +IPython/utils/tests/test_wildcard.py,sha256=VJVK7LxaEYJKv6Tynlj4ye_GRyMHEI_3iT80i3PJuZk,4729 +IPython/utils/text.py,sha256=vwk13dJoJS8DZ5p9mYw-sRNenf_95jM7wxyu1SDo4S4,24423 +IPython/utils/timing.py,sha256=nND-ZUBkHWfYevvbRG-YfOSIFczz_epzMqWK5PH6nqA,4275 +IPython/utils/tokenutil.py,sha256=7DimAl4ZHtkJUhu1LRwk4bgkgqdOnuwkxNPh3XtpA0o,5083 +IPython/utils/traitlets.py,sha256=SnRNQ20hSnvceaWsTIjZRe2R90NAC58PVJl9bMt-41A,143 +IPython/utils/tz.py,sha256=1MelnaJ9CvkP9d9tijklgwak5vJ7Kl5Bf8Oj9ZBywns,2035 +IPython/utils/ulinecache.py,sha256=WySMSMJDRsm1Z5CGY24KdmoA2eLDZEayqWR6V_sIuik,684 +IPython/utils/version.py,sha256=9SuuYeztj_lwbL_o-RLjfC4vJfel3HCde6NWY4KLt60,1223 +IPython/utils/wildcard.py,sha256=6EEc3OEYp-IuSoidL6nwpaHg--GxnzbAJTmFiz77CNE,4612 +ipython-8.20.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +ipython-8.20.0.dist-info/LICENSE,sha256=4OOQdI7UQKuJPKHxNaiKkgqvVAnbuQpbQnx1xeUSaPs,1720 +ipython-8.20.0.dist-info/METADATA,sha256=-bZ4sBc9PgVoH_Oh_yBw5aE1Mr0OchYyyrxcsyexNsM,5867 +ipython-8.20.0.dist-info/RECORD,, +ipython-8.20.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +ipython-8.20.0.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92 +ipython-8.20.0.dist-info/direct_url.json,sha256=YT6JsIqVnE_5W8a8LFov5BcuNXknGrBn9H3IWTguxS0,67 +ipython-8.20.0.dist-info/entry_points.txt,sha256=1078eGaXVuhZyDuwlmp1pWDc3HtDrYO9CZoXGAcGCw8,244 +ipython-8.20.0.dist-info/top_level.txt,sha256=PKjvHtNCBZ9EHTmd2mwJ1J_k3j0F6D1lTFzIcJFFPEU,8 diff --git a/shared/package-files/1f/1fe7909af08f5886c19b50b6b907d9e97026f66db3d07340b42ff16a1e63e906/test_common.py b/shared/package-files/1f/1fe7909af08f5886c19b50b6b907d9e97026f66db3d07340b42ff16a1e63e906/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..80d7994298ec6a2b3e4ef4ee173aeaad75e009a7 --- /dev/null +++ b/shared/package-files/1f/1fe7909af08f5886c19b50b6b907d9e97026f66db3d07340b42ff16a1e63e906/test_common.py @@ -0,0 +1,657 @@ +""" +Tests for the pandas.io.common functionalities +""" +import codecs +import errno +from functools import partial +from io import ( + BytesIO, + StringIO, + UnsupportedOperation, +) +import mmap +import os +from pathlib import Path +import pickle +import tempfile + +import numpy as np +import pytest + +from pandas.compat import is_platform_windows +from pandas.compat.pyarrow import pa_version_under19p0 +import pandas.util._test_decorators as td + +import pandas as pd +import pandas._testing as tm + +import pandas.io.common as icom + +pytestmark = pytest.mark.filterwarnings( + "ignore:Passing a BlockManager to DataFrame:DeprecationWarning" +) + + +class CustomFSPath: + """For testing fspath on unknown objects""" + + def __init__(self, path) -> None: + self.path = path + + def __fspath__(self): + return self.path + + +# Functions that consume a string path and return a string or path-like object +path_types = [str, CustomFSPath, Path] + +try: + from py.path import local as LocalPath + + path_types.append(LocalPath) +except ImportError: + pass + +HERE = os.path.abspath(os.path.dirname(__file__)) + + +# https://github.com/cython/cython/issues/1720 +class TestCommonIOCapabilities: + data1 = """index,A,B,C,D +foo,2,3,4,5 +bar,7,8,9,10 +baz,12,13,14,15 +qux,12,13,14,15 +foo2,12,13,14,15 +bar2,12,13,14,15 +""" + + def test_expand_user(self): + filename = "~/sometest" + expanded_name = icom._expand_user(filename) + + assert expanded_name != filename + assert os.path.isabs(expanded_name) + assert os.path.expanduser(filename) == expanded_name + + def test_expand_user_normal_path(self): + filename = "/somefolder/sometest" + expanded_name = icom._expand_user(filename) + + assert expanded_name == filename + assert os.path.expanduser(filename) == expanded_name + + def test_stringify_path_pathlib(self): + rel_path = icom.stringify_path(Path(".")) + assert rel_path == "." + redundant_path = icom.stringify_path(Path("foo//bar")) + assert redundant_path == os.path.join("foo", "bar") + + @td.skip_if_no("py.path") + def test_stringify_path_localpath(self): + path = os.path.join("foo", "bar") + abs_path = os.path.abspath(path) + lpath = LocalPath(path) + assert icom.stringify_path(lpath) == abs_path + + def test_stringify_path_fspath(self): + p = CustomFSPath("foo/bar.csv") + result = icom.stringify_path(p) + assert result == "foo/bar.csv" + + def test_stringify_file_and_path_like(self): + # GH 38125: do not stringify file objects that are also path-like + fsspec = pytest.importorskip("fsspec") + with tm.ensure_clean() as path: + with fsspec.open(f"file://{path}", mode="wb") as fsspec_obj: + assert fsspec_obj == icom.stringify_path(fsspec_obj) + + @pytest.mark.parametrize("path_type", path_types) + def test_infer_compression_from_path(self, compression_format, path_type): + extension, expected = compression_format + path = path_type("foo/bar.csv" + extension) + compression = icom.infer_compression(path, compression="infer") + assert compression == expected + + @pytest.mark.parametrize("path_type", [str, CustomFSPath, Path]) + def test_get_handle_with_path(self, path_type): + # ignore LocalPath: it creates strange paths: /absolute/~/sometest + with tempfile.TemporaryDirectory(dir=Path.home()) as tmp: + filename = path_type("~/" + Path(tmp).name + "/sometest") + with icom.get_handle(filename, "w") as handles: + assert Path(handles.handle.name).is_absolute() + assert os.path.expanduser(filename) == handles.handle.name + + def test_get_handle_with_buffer(self): + with StringIO() as input_buffer: + with icom.get_handle(input_buffer, "r") as handles: + assert handles.handle == input_buffer + assert not input_buffer.closed + assert input_buffer.closed + + # Test that BytesIOWrapper(get_handle) returns correct amount of bytes every time + def test_bytesiowrapper_returns_correct_bytes(self): + # Test latin1, ucs-2, and ucs-4 chars + data = """a,b,c +1,2,3 +©,®,® +Look,a snake,🐍""" + with icom.get_handle(StringIO(data), "rb", is_text=False) as handles: + result = b"" + chunksize = 5 + while True: + chunk = handles.handle.read(chunksize) + # Make sure each chunk is correct amount of bytes + assert len(chunk) <= chunksize + if len(chunk) < chunksize: + # Can be less amount of bytes, but only at EOF + # which happens when read returns empty + assert len(handles.handle.read()) == 0 + result += chunk + break + result += chunk + assert result == data.encode("utf-8") + + # Test that pyarrow can handle a file opened with get_handle + def test_get_handle_pyarrow_compat(self): + pa_csv = pytest.importorskip("pyarrow.csv") + + # Test latin1, ucs-2, and ucs-4 chars + data = """a,b,c +1,2,3 +©,®,® +Look,a snake,🐍""" + expected = pd.DataFrame( + {"a": ["1", "©", "Look"], "b": ["2", "®", "a snake"], "c": ["3", "®", "🐍"]} + ) + s = StringIO(data) + with icom.get_handle(s, "rb", is_text=False) as handles: + df = pa_csv.read_csv(handles.handle).to_pandas() + if pa_version_under19p0: + expected = expected.astype("object") + tm.assert_frame_equal(df, expected) + assert not s.closed + + def test_iterator(self): + with pd.read_csv(StringIO(self.data1), chunksize=1) as reader: + result = pd.concat(reader, ignore_index=True) + expected = pd.read_csv(StringIO(self.data1)) + tm.assert_frame_equal(result, expected) + + # GH12153 + with pd.read_csv(StringIO(self.data1), chunksize=1) as it: + first = next(it) + tm.assert_frame_equal(first, expected.iloc[[0]]) + tm.assert_frame_equal(pd.concat(it), expected.iloc[1:]) + + @pytest.mark.parametrize( + "reader, module, error_class, fn_ext", + [ + (pd.read_csv, "os", FileNotFoundError, "csv"), + (pd.read_fwf, "os", FileNotFoundError, "txt"), + (pd.read_excel, "xlrd", FileNotFoundError, "xlsx"), + (pd.read_feather, "pyarrow", OSError, "feather"), + (pd.read_hdf, "tables", FileNotFoundError, "h5"), + (pd.read_stata, "os", FileNotFoundError, "dta"), + (pd.read_sas, "os", FileNotFoundError, "sas7bdat"), + (pd.read_json, "os", FileNotFoundError, "json"), + (pd.read_pickle, "os", FileNotFoundError, "pickle"), + ], + ) + def test_read_non_existent(self, reader, module, error_class, fn_ext): + pytest.importorskip(module) + + path = os.path.join(HERE, "data", "does_not_exist." + fn_ext) + msg1 = rf"File (b')?.+does_not_exist\.{fn_ext}'? does not exist" + msg2 = rf"\[Errno 2\] No such file or directory: '.+does_not_exist\.{fn_ext}'" + msg3 = "Expected object or value" + msg4 = "path_or_buf needs to be a string file path or file-like" + msg5 = ( + rf"\[Errno 2\] File .+does_not_exist\.{fn_ext} does not exist: " + rf"'.+does_not_exist\.{fn_ext}'" + ) + msg6 = rf"\[Errno 2\] 没有那个文件或目录: '.+does_not_exist\.{fn_ext}'" + msg7 = ( + rf"\[Errno 2\] File o directory non esistente: '.+does_not_exist\.{fn_ext}'" + ) + msg8 = rf"Failed to open local file.+does_not_exist\.{fn_ext}" + + with pytest.raises( + error_class, + match=rf"({msg1}|{msg2}|{msg3}|{msg4}|{msg5}|{msg6}|{msg7}|{msg8})", + ): + reader(path) + + @pytest.mark.parametrize( + "method, module, error_class, fn_ext", + [ + (pd.DataFrame.to_csv, "os", OSError, "csv"), + (pd.DataFrame.to_html, "os", OSError, "html"), + (pd.DataFrame.to_excel, "xlrd", OSError, "xlsx"), + (pd.DataFrame.to_feather, "pyarrow", OSError, "feather"), + (pd.DataFrame.to_parquet, "pyarrow", OSError, "parquet"), + (pd.DataFrame.to_stata, "os", OSError, "dta"), + (pd.DataFrame.to_json, "os", OSError, "json"), + (pd.DataFrame.to_pickle, "os", OSError, "pickle"), + ], + ) + # NOTE: Missing parent directory for pd.DataFrame.to_hdf is handled by PyTables + def test_write_missing_parent_directory(self, method, module, error_class, fn_ext): + pytest.importorskip(module) + + dummy_frame = pd.DataFrame({"a": [1, 2, 3], "b": [2, 3, 4], "c": [3, 4, 5]}) + + path = os.path.join(HERE, "data", "missing_folder", "does_not_exist." + fn_ext) + + with pytest.raises( + error_class, + match=r"Cannot save file into a non-existent directory: .*missing_folder", + ): + method(dummy_frame, path) + + @pytest.mark.parametrize( + "reader, module, error_class, fn_ext", + [ + (pd.read_csv, "os", FileNotFoundError, "csv"), + (pd.read_table, "os", FileNotFoundError, "csv"), + (pd.read_fwf, "os", FileNotFoundError, "txt"), + (pd.read_excel, "xlrd", FileNotFoundError, "xlsx"), + (pd.read_feather, "pyarrow", OSError, "feather"), + (pd.read_hdf, "tables", FileNotFoundError, "h5"), + (pd.read_stata, "os", FileNotFoundError, "dta"), + (pd.read_sas, "os", FileNotFoundError, "sas7bdat"), + (pd.read_json, "os", FileNotFoundError, "json"), + (pd.read_pickle, "os", FileNotFoundError, "pickle"), + ], + ) + def test_read_expands_user_home_dir( + self, reader, module, error_class, fn_ext, monkeypatch + ): + pytest.importorskip(module) + + path = os.path.join("~", "does_not_exist." + fn_ext) + monkeypatch.setattr(icom, "_expand_user", lambda x: os.path.join("foo", x)) + + msg1 = rf"File (b')?.+does_not_exist\.{fn_ext}'? does not exist" + msg2 = rf"\[Errno 2\] No such file or directory: '.+does_not_exist\.{fn_ext}'" + msg3 = "Unexpected character found when decoding 'false'" + msg4 = "path_or_buf needs to be a string file path or file-like" + msg5 = ( + rf"\[Errno 2\] File .+does_not_exist\.{fn_ext} does not exist: " + rf"'.+does_not_exist\.{fn_ext}'" + ) + msg6 = rf"\[Errno 2\] 没有那个文件或目录: '.+does_not_exist\.{fn_ext}'" + msg7 = ( + rf"\[Errno 2\] File o directory non esistente: '.+does_not_exist\.{fn_ext}'" + ) + msg8 = rf"Failed to open local file.+does_not_exist\.{fn_ext}" + + with pytest.raises( + error_class, + match=rf"({msg1}|{msg2}|{msg3}|{msg4}|{msg5}|{msg6}|{msg7}|{msg8})", + ): + reader(path) + + @pytest.mark.parametrize( + "reader, module, path", + [ + (pd.read_csv, "os", ("io", "data", "csv", "iris.csv")), + (pd.read_table, "os", ("io", "data", "csv", "iris.csv")), + ( + pd.read_fwf, + "os", + ("io", "data", "fixed_width", "fixed_width_format.txt"), + ), + (pd.read_excel, "xlrd", ("io", "data", "excel", "test1.xlsx")), + ( + pd.read_feather, + "pyarrow", + ("io", "data", "feather", "feather-0_3_1.feather"), + ), + pytest.param( + pd.read_hdf, + "tables", + ("io", "data", "legacy_hdf", "datetimetz_object.h5"), + # cleaned-up in https://github.com/pandas-dev/pandas/pull/57387 on main + marks=pytest.mark.xfail(reason="TODO(infer_string)", strict=False), + ), + (pd.read_stata, "os", ("io", "data", "stata", "stata10_115.dta")), + (pd.read_sas, "os", ("io", "sas", "data", "test1.sas7bdat")), + (pd.read_json, "os", ("io", "json", "data", "tsframe_v012.json")), + ( + pd.read_pickle, + "os", + ("io", "data", "pickle", "categorical.0.25.0.pickle"), + ), + ], + ) + def test_read_fspath_all(self, reader, module, path, datapath): + pytest.importorskip(module) + path = datapath(*path) + + mypath = CustomFSPath(path) + result = reader(mypath) + expected = reader(path) + + if path.endswith(".pickle"): + # categorical + tm.assert_categorical_equal(result, expected) + else: + tm.assert_frame_equal(result, expected) + + @pytest.mark.parametrize( + "writer_name, writer_kwargs, module", + [ + ("to_csv", {}, "os"), + ("to_excel", {"engine": "openpyxl"}, "openpyxl"), + ("to_feather", {}, "pyarrow"), + ("to_html", {}, "os"), + ("to_json", {}, "os"), + ("to_latex", {}, "os"), + ("to_pickle", {}, "os"), + ("to_stata", {"time_stamp": pd.to_datetime("2019-01-01 00:00")}, "os"), + ], + ) + def test_write_fspath_all(self, writer_name, writer_kwargs, module): + if writer_name in ["to_latex"]: # uses Styler implementation + pytest.importorskip("jinja2") + p1 = tm.ensure_clean("string") + p2 = tm.ensure_clean("fspath") + df = pd.DataFrame({"A": [1, 2]}) + + with p1 as string, p2 as fspath: + pytest.importorskip(module) + mypath = CustomFSPath(fspath) + writer = getattr(df, writer_name) + + writer(string, **writer_kwargs) + writer(mypath, **writer_kwargs) + with open(string, "rb") as f_str, open(fspath, "rb") as f_path: + if writer_name == "to_excel": + # binary representation of excel contains time creation + # data that causes flaky CI failures + result = pd.read_excel(f_str, **writer_kwargs) + expected = pd.read_excel(f_path, **writer_kwargs) + tm.assert_frame_equal(result, expected) + else: + result = f_str.read() + expected = f_path.read() + assert result == expected + + def test_write_fspath_hdf5(self): + # Same test as write_fspath_all, except HDF5 files aren't + # necessarily byte-for-byte identical for a given dataframe, so we'll + # have to read and compare equality + pytest.importorskip("tables") + + df = pd.DataFrame({"A": [1, 2]}) + p1 = tm.ensure_clean("string") + p2 = tm.ensure_clean("fspath") + + with p1 as string, p2 as fspath: + mypath = CustomFSPath(fspath) + df.to_hdf(mypath, key="bar") + df.to_hdf(string, key="bar") + + result = pd.read_hdf(fspath, key="bar") + expected = pd.read_hdf(string, key="bar") + + tm.assert_frame_equal(result, expected) + + +@pytest.fixture +def mmap_file(datapath): + return datapath("io", "data", "csv", "test_mmap.csv") + + +class TestMMapWrapper: + def test_constructor_bad_file(self, mmap_file): + non_file = StringIO("I am not a file") + non_file.fileno = lambda: -1 + + # the error raised is different on Windows + if is_platform_windows(): + msg = "The parameter is incorrect" + err = OSError + else: + msg = "[Errno 22]" + err = mmap.error + + with pytest.raises(err, match=msg): + icom._maybe_memory_map(non_file, True) + + with open(mmap_file, encoding="utf-8") as target: + pass + + msg = "I/O operation on closed file" + with pytest.raises(ValueError, match=msg): + icom._maybe_memory_map(target, True) + + def test_next(self, mmap_file): + with open(mmap_file, encoding="utf-8") as target: + lines = target.readlines() + + with icom.get_handle( + target, "r", is_text=True, memory_map=True + ) as wrappers: + wrapper = wrappers.handle + assert isinstance(wrapper.buffer.buffer, mmap.mmap) + + for line in lines: + next_line = next(wrapper) + assert next_line.strip() == line.strip() + + with pytest.raises(StopIteration, match=r"^$"): + next(wrapper) + + def test_unknown_engine(self): + with tm.ensure_clean() as path: + df = pd.DataFrame( + 1.1 * np.arange(120).reshape((30, 4)), + columns=pd.Index(list("ABCD")), + index=pd.Index([f"i-{i}" for i in range(30)]), + ) + df.to_csv(path) + with pytest.raises(ValueError, match="Unknown engine"): + pd.read_csv(path, engine="pyt") + + def test_binary_mode(self): + """ + 'encoding' shouldn't be passed to 'open' in binary mode. + + GH 35058 + """ + with tm.ensure_clean() as path: + df = pd.DataFrame( + 1.1 * np.arange(120).reshape((30, 4)), + columns=pd.Index(list("ABCD")), + index=pd.Index([f"i-{i}" for i in range(30)]), + ) + df.to_csv(path, mode="w+b") + tm.assert_frame_equal(df, pd.read_csv(path, index_col=0)) + + @pytest.mark.parametrize("encoding", ["utf-16", "utf-32"]) + @pytest.mark.parametrize("compression_", ["bz2", "xz"]) + def test_warning_missing_utf_bom(self, encoding, compression_): + """ + bz2 and xz do not write the byte order mark (BOM) for utf-16/32. + + https://stackoverflow.com/questions/55171439 + + GH 35681 + """ + df = pd.DataFrame( + 1.1 * np.arange(120).reshape((30, 4)), + columns=pd.Index(list("ABCD")), + index=pd.Index([f"i-{i}" for i in range(30)]), + ) + with tm.ensure_clean() as path: + with tm.assert_produces_warning(UnicodeWarning): + df.to_csv(path, compression=compression_, encoding=encoding) + + # reading should fail (otherwise we wouldn't need the warning) + msg = ( + r"UTF-\d+ stream does not start with BOM|" + r"'utf-\d+' codec can't decode byte" + ) + with pytest.raises(UnicodeError, match=msg): + pd.read_csv(path, compression=compression_, encoding=encoding) + + +def test_is_fsspec_url(): + assert icom.is_fsspec_url("gcs://pandas/somethingelse.com") + assert icom.is_fsspec_url("gs://pandas/somethingelse.com") + # the following is the only remote URL that is handled without fsspec + assert not icom.is_fsspec_url("http://pandas/somethingelse.com") + assert not icom.is_fsspec_url("random:pandas/somethingelse.com") + assert not icom.is_fsspec_url("/local/path") + assert not icom.is_fsspec_url("relative/local/path") + # fsspec URL in string should not be recognized + assert not icom.is_fsspec_url("this is not fsspec://url") + assert not icom.is_fsspec_url("{'url': 'gs://pandas/somethingelse.com'}") + # accept everything that conforms to RFC 3986 schema + assert icom.is_fsspec_url("RFC-3986+compliant.spec://something") + + +@pytest.mark.parametrize("format", ["csv", "json"]) +def test_codecs_encoding(format): + # GH39247 + expected = pd.DataFrame( + 1.1 * np.arange(120).reshape((30, 4)), + columns=pd.Index(list("ABCD")), + index=pd.Index([f"i-{i}" for i in range(30)]), + ) + with tm.ensure_clean() as path: + with open(path, mode="w", encoding="utf-8") as handle: + getattr(expected, f"to_{format}")(handle) + with open(path, encoding="utf-8") as handle: + if format == "csv": + df = pd.read_csv(handle, index_col=0) + else: + df = pd.read_json(handle) + tm.assert_frame_equal(expected, df) + + +def test_codecs_get_writer_reader(): + # GH39247 + expected = pd.DataFrame( + 1.1 * np.arange(120).reshape((30, 4)), + columns=pd.Index(list("ABCD")), + index=pd.Index([f"i-{i}" for i in range(30)]), + ) + with tm.ensure_clean() as path: + with open(path, "wb") as handle: + with codecs.getwriter("utf-8")(handle) as encoded: + expected.to_csv(encoded) + with open(path, "rb") as handle: + with codecs.getreader("utf-8")(handle) as encoded: + df = pd.read_csv(encoded, index_col=0) + tm.assert_frame_equal(expected, df) + + +@pytest.mark.parametrize( + "io_class,mode,msg", + [ + (BytesIO, "t", "a bytes-like object is required, not 'str'"), + (StringIO, "b", "string argument expected, got 'bytes'"), + ], +) +def test_explicit_encoding(io_class, mode, msg): + # GH39247; this test makes sure that if a user provides mode="*t" or "*b", + # it is used. In the case of this test it leads to an error as intentionally the + # wrong mode is requested + expected = pd.DataFrame( + 1.1 * np.arange(120).reshape((30, 4)), + columns=pd.Index(list("ABCD")), + index=pd.Index([f"i-{i}" for i in range(30)]), + ) + with io_class() as buffer: + with pytest.raises(TypeError, match=msg): + expected.to_csv(buffer, mode=f"w{mode}") + + +@pytest.mark.parametrize("encoding_errors", [None, "strict", "replace"]) +@pytest.mark.parametrize("format", ["csv", "json"]) +def test_encoding_errors(encoding_errors, format): + # GH39450 + msg = "'utf-8' codec can't decode byte" + bad_encoding = b"\xe4" + + if format == "csv": + content = b"," + bad_encoding + b"\n" + bad_encoding * 2 + b"," + bad_encoding + reader = partial(pd.read_csv, index_col=0) + else: + content = ( + b'{"' + + bad_encoding * 2 + + b'": {"' + + bad_encoding + + b'":"' + + bad_encoding + + b'"}}' + ) + reader = partial(pd.read_json, orient="index") + with tm.ensure_clean() as path: + file = Path(path) + file.write_bytes(content) + + if encoding_errors != "replace": + with pytest.raises(UnicodeDecodeError, match=msg): + reader(path, encoding_errors=encoding_errors) + else: + df = reader(path, encoding_errors=encoding_errors) + decoded = bad_encoding.decode(errors=encoding_errors) + expected = pd.DataFrame({decoded: [decoded]}, index=[decoded * 2]) + tm.assert_frame_equal(df, expected) + + +def test_bad_encdoing_errors(): + # GH 39777 + with tm.ensure_clean() as path: + with pytest.raises(LookupError, match="unknown error handler name"): + icom.get_handle(path, "w", errors="bad") + + +def test_errno_attribute(): + # GH 13872 + with pytest.raises(FileNotFoundError, match="\\[Errno 2\\]") as err: + pd.read_csv("doesnt_exist") + assert err.errno == errno.ENOENT + + +def test_fail_mmap(): + with pytest.raises(UnsupportedOperation, match="fileno"): + with BytesIO() as buffer: + icom.get_handle(buffer, "rb", memory_map=True) + + +def test_close_on_error(): + # GH 47136 + class TestError: + def close(self): + raise OSError("test") + + with pytest.raises(OSError, match="test"): + with BytesIO() as buffer: + with icom.get_handle(buffer, "rb") as handles: + handles.created_handles.append(TestError()) + + +@pytest.mark.parametrize( + "reader", + [ + pd.read_csv, + pd.read_fwf, + pd.read_excel, + pd.read_feather, + pd.read_hdf, + pd.read_stata, + pd.read_sas, + pd.read_json, + pd.read_pickle, + ], +) +def test_pickle_reader(reader): + # GH 22265 + with BytesIO() as buffer: + pickle.dump(reader, buffer) diff --git a/shared/package-files/1f/1ff7cf9e7e8f762cb983c8e206efe8c5ee79b9076cb0caf2fec6b6346408a738/_reductions_impl.py b/shared/package-files/1f/1ff7cf9e7e8f762cb983c8e206efe8c5ee79b9076cb0caf2fec6b6346408a738/_reductions_impl.py new file mode 100644 index 0000000000000000000000000000000000000000..cfd95800c36f154569e26153cb90f9863b41aa9d --- /dev/null +++ b/shared/package-files/1f/1ff7cf9e7e8f762cb983c8e206efe8c5ee79b9076cb0caf2fec6b6346408a738/_reductions_impl.py @@ -0,0 +1,456 @@ +# mypy: ignore-errors + +""" Implementation of reduction operations, to be wrapped into arrays, dtypes etc +in the 'public' layer. + +Anything here only deals with torch objects, e.g. "dtype" is a torch.dtype instance etc +""" +from __future__ import annotations + +import functools +from typing import Optional + +import torch + +from . import _dtypes_impl, _util +from ._normalizations import ( + ArrayLike, + AxisLike, + DTypeLike, + KeepDims, + NotImplementedType, + OutArray, +) + + +def _deco_axis_expand(func): + """ + Generically handle axis arguments in reductions. + axis is *always* the 2nd arg in the function so no need to have a look at its signature + """ + + @functools.wraps(func) + def wrapped(a, axis=None, *args, **kwds): + if axis is not None: + axis = _util.normalize_axis_tuple(axis, a.ndim) + + if axis == (): + # So we insert a length-one axis and run the reduction along it. + # We cannot return a.clone() as this would sidestep the checks inside the function + newshape = _util.expand_shape(a.shape, axis=0) + a = a.reshape(newshape) + axis = (0,) + + return func(a, axis, *args, **kwds) + + return wrapped + + +def _atleast_float(dtype, other_dtype): + """Return a dtype that is real or complex floating-point. + + For inputs that are boolean or integer dtypes, this returns the default + float dtype; inputs that are complex get converted to the default complex + dtype; real floating-point dtypes (`float*`) get passed through unchanged + """ + if dtype is None: + dtype = other_dtype + if not (dtype.is_floating_point or dtype.is_complex): + return _dtypes_impl.default_dtypes().float_dtype + return dtype + + +@_deco_axis_expand +def count_nonzero(a: ArrayLike, axis: AxisLike = None, *, keepdims: KeepDims = False): + return a.count_nonzero(axis) + + +@_deco_axis_expand +def argmax( + a: ArrayLike, + axis: AxisLike = None, + out: Optional[OutArray] = None, + *, + keepdims: KeepDims = False, +): + if a.is_complex(): + raise NotImplementedError(f"argmax with dtype={a.dtype}.") + + axis = _util.allow_only_single_axis(axis) + + if a.dtype == torch.bool: + # RuntimeError: "argmax_cpu" not implemented for 'Bool' + a = a.to(torch.uint8) + + return torch.argmax(a, axis) + + +@_deco_axis_expand +def argmin( + a: ArrayLike, + axis: AxisLike = None, + out: Optional[OutArray] = None, + *, + keepdims: KeepDims = False, +): + if a.is_complex(): + raise NotImplementedError(f"argmin with dtype={a.dtype}.") + + axis = _util.allow_only_single_axis(axis) + + if a.dtype == torch.bool: + # RuntimeError: "argmin_cpu" not implemented for 'Bool' + a = a.to(torch.uint8) + + return torch.argmin(a, axis) + + +@_deco_axis_expand +def any( + a: ArrayLike, + axis: AxisLike = None, + out: Optional[OutArray] = None, + keepdims: KeepDims = False, + *, + where: NotImplementedType = None, +): + axis = _util.allow_only_single_axis(axis) + axis_kw = {} if axis is None else {"dim": axis} + return torch.any(a, **axis_kw) + + +@_deco_axis_expand +def all( + a: ArrayLike, + axis: AxisLike = None, + out: Optional[OutArray] = None, + keepdims: KeepDims = False, + *, + where: NotImplementedType = None, +): + axis = _util.allow_only_single_axis(axis) + axis_kw = {} if axis is None else {"dim": axis} + return torch.all(a, **axis_kw) + + +@_deco_axis_expand +def amax( + a: ArrayLike, + axis: AxisLike = None, + out: Optional[OutArray] = None, + keepdims: KeepDims = False, + initial: NotImplementedType = None, + where: NotImplementedType = None, +): + if a.is_complex(): + raise NotImplementedError(f"amax with dtype={a.dtype}") + + return a.amax(axis) + + +max = amax + + +@_deco_axis_expand +def amin( + a: ArrayLike, + axis: AxisLike = None, + out: Optional[OutArray] = None, + keepdims: KeepDims = False, + initial: NotImplementedType = None, + where: NotImplementedType = None, +): + if a.is_complex(): + raise NotImplementedError(f"amin with dtype={a.dtype}") + + return a.amin(axis) + + +min = amin + + +@_deco_axis_expand +def ptp( + a: ArrayLike, + axis: AxisLike = None, + out: Optional[OutArray] = None, + keepdims: KeepDims = False, +): + return a.amax(axis) - a.amin(axis) + + +@_deco_axis_expand +def sum( + a: ArrayLike, + axis: AxisLike = None, + dtype: Optional[DTypeLike] = None, + out: Optional[OutArray] = None, + keepdims: KeepDims = False, + initial: NotImplementedType = None, + where: NotImplementedType = None, +): + assert dtype is None or isinstance(dtype, torch.dtype) + + if dtype == torch.bool: + dtype = _dtypes_impl.default_dtypes().int_dtype + + axis_kw = {} if axis is None else {"dim": axis} + return a.sum(dtype=dtype, **axis_kw) + + +@_deco_axis_expand +def prod( + a: ArrayLike, + axis: AxisLike = None, + dtype: Optional[DTypeLike] = None, + out: Optional[OutArray] = None, + keepdims: KeepDims = False, + initial: NotImplementedType = None, + where: NotImplementedType = None, +): + axis = _util.allow_only_single_axis(axis) + + if dtype == torch.bool: + dtype = _dtypes_impl.default_dtypes().int_dtype + + axis_kw = {} if axis is None else {"dim": axis} + return a.prod(dtype=dtype, **axis_kw) + + +product = prod + + +@_deco_axis_expand +def mean( + a: ArrayLike, + axis: AxisLike = None, + dtype: Optional[DTypeLike] = None, + out: Optional[OutArray] = None, + keepdims: KeepDims = False, + *, + where: NotImplementedType = None, +): + dtype = _atleast_float(dtype, a.dtype) + + axis_kw = {} if axis is None else {"dim": axis} + result = a.mean(dtype=dtype, **axis_kw) + + return result + + +@_deco_axis_expand +def std( + a: ArrayLike, + axis: AxisLike = None, + dtype: Optional[DTypeLike] = None, + out: Optional[OutArray] = None, + ddof=0, + keepdims: KeepDims = False, + *, + where: NotImplementedType = None, +): + in_dtype = dtype + dtype = _atleast_float(dtype, a.dtype) + tensor = _util.cast_if_needed(a, dtype) + result = tensor.std(dim=axis, correction=ddof) + return _util.cast_if_needed(result, in_dtype) + + +@_deco_axis_expand +def var( + a: ArrayLike, + axis: AxisLike = None, + dtype: Optional[DTypeLike] = None, + out: Optional[OutArray] = None, + ddof=0, + keepdims: KeepDims = False, + *, + where: NotImplementedType = None, +): + in_dtype = dtype + dtype = _atleast_float(dtype, a.dtype) + tensor = _util.cast_if_needed(a, dtype) + result = tensor.var(dim=axis, correction=ddof) + return _util.cast_if_needed(result, in_dtype) + + +# cumsum / cumprod are almost reductions: +# 1. no keepdims +# 2. axis=None flattens + + +def cumsum( + a: ArrayLike, + axis: AxisLike = None, + dtype: Optional[DTypeLike] = None, + out: Optional[OutArray] = None, +): + if dtype == torch.bool: + dtype = _dtypes_impl.default_dtypes().int_dtype + if dtype is None: + dtype = a.dtype + + (a,), axis = _util.axis_none_flatten(a, axis=axis) + axis = _util.normalize_axis_index(axis, a.ndim) + + return a.cumsum(axis=axis, dtype=dtype) + + +def cumprod( + a: ArrayLike, + axis: AxisLike = None, + dtype: Optional[DTypeLike] = None, + out: Optional[OutArray] = None, +): + if dtype == torch.bool: + dtype = _dtypes_impl.default_dtypes().int_dtype + if dtype is None: + dtype = a.dtype + + (a,), axis = _util.axis_none_flatten(a, axis=axis) + axis = _util.normalize_axis_index(axis, a.ndim) + + return a.cumprod(axis=axis, dtype=dtype) + + +cumproduct = cumprod + + +def average( + a: ArrayLike, + axis=None, + weights: ArrayLike = None, + returned=False, + *, + keepdims=False, +): + if weights is None: + result = mean(a, axis=axis) + wsum = torch.as_tensor(a.numel() / result.numel(), dtype=result.dtype) + else: + if not a.dtype.is_floating_point: + a = a.double() + + # axis & weights + if a.shape != weights.shape: + if axis is None: + raise TypeError( + "Axis must be specified when shapes of a and weights differ." + ) + if weights.ndim != 1: + raise TypeError( + "1D weights expected when shapes of a and weights differ." + ) + if weights.shape[0] != a.shape[axis]: + raise ValueError( + "Length of weights not compatible with specified axis." + ) + + # setup weight to broadcast along axis + weights = torch.broadcast_to(weights, (a.ndim - 1) * (1,) + weights.shape) + weights = weights.swapaxes(-1, axis) + + # do the work + result_dtype = _dtypes_impl.result_type_impl(a, weights) + numerator = sum(a * weights, axis, dtype=result_dtype) + wsum = sum(weights, axis, dtype=result_dtype) + result = numerator / wsum + + # We process keepdims manually because the decorator does not deal with variadic returns + if keepdims: + result = _util.apply_keepdims(result, axis, a.ndim) + + if returned: + if wsum.shape != result.shape: + wsum = torch.broadcast_to(wsum, result.shape).clone() + return result, wsum + else: + return result + + +# Not using deco_axis_expand as it assumes that axis is the second arg +def quantile( + a: ArrayLike, + q: ArrayLike, + axis: AxisLike = None, + out: Optional[OutArray] = None, + overwrite_input=False, + method="linear", + keepdims: KeepDims = False, + *, + interpolation: NotImplementedType = None, +): + if overwrite_input: + # raise NotImplementedError("overwrite_input in quantile not implemented.") + # NumPy documents that `overwrite_input` MAY modify inputs: + # https://numpy.org/doc/stable/reference/generated/numpy.percentile.html#numpy-percentile + # Here we choose to work out-of-place because why not. + pass + + if not a.dtype.is_floating_point: + dtype = _dtypes_impl.default_dtypes().float_dtype + a = a.to(dtype) + + # edge case: torch.quantile only supports float32 and float64 + if a.dtype == torch.float16: + a = a.to(torch.float32) + + if axis is None: + a = a.flatten() + q = q.flatten() + axis = (0,) + else: + axis = _util.normalize_axis_tuple(axis, a.ndim) + + # FIXME(Mario) Doesn't np.quantile accept a tuple? + # torch.quantile does accept a number. If we don't want to implement the tuple behaviour + # (it's deffo low prio) change `normalize_axis_tuple` into a normalize_axis index above. + axis = _util.allow_only_single_axis(axis) + + q = _util.cast_if_needed(q, a.dtype) + + return torch.quantile(a, q, axis=axis, interpolation=method) + + +def percentile( + a: ArrayLike, + q: ArrayLike, + axis: AxisLike = None, + out: Optional[OutArray] = None, + overwrite_input=False, + method="linear", + keepdims: KeepDims = False, + *, + interpolation: NotImplementedType = None, +): + # np.percentile(float_tensor, 30) : q.dtype is int64 => q / 100.0 is float32 + if _dtypes_impl.python_type_for_torch(q.dtype) == int: + q = q.to(_dtypes_impl.default_dtypes().float_dtype) + qq = q / 100.0 + + return quantile( + a, + qq, + axis=axis, + overwrite_input=overwrite_input, + method=method, + keepdims=keepdims, + interpolation=interpolation, + ) + + +def median( + a: ArrayLike, + axis=None, + out: Optional[OutArray] = None, + overwrite_input=False, + keepdims: KeepDims = False, +): + return quantile( + a, + torch.as_tensor(0.5), + axis=axis, + overwrite_input=overwrite_input, + out=out, + keepdims=keepdims, + ) diff --git a/shared/package-files/1f/1ff88d229c7dfa1635710371aa34f677fe525d98496cca3f71aab8feae8b07b2/cversions.py b/shared/package-files/1f/1ff88d229c7dfa1635710371aa34f677fe525d98496cca3f71aab8feae8b07b2/cversions.py new file mode 100644 index 0000000000000000000000000000000000000000..00159c3a8031d8ccd44b226db42090f97014cd9f --- /dev/null +++ b/shared/package-files/1f/1ff88d229c7dfa1635710371aa34f677fe525d98496cca3f71aab8feae8b07b2/cversions.py @@ -0,0 +1,13 @@ +"""Simple script to compute the api hash of the current API. + +The API has is defined by numpy_api_order and ufunc_api_order. + +""" +from os.path import dirname + +from code_generators.genapi import fullapi_hash +from code_generators.numpy_api import full_api + +if __name__ == '__main__': + curdir = dirname(__file__) + print(fullapi_hash(full_api)) diff --git a/shared/package-files/1f/1ffffb430d3d2a55e6856800ca74e4f541316ede98bc1d34a270d46cb2543a3c/compiler.py b/shared/package-files/1f/1ffffb430d3d2a55e6856800ca74e4f541316ede98bc1d34a270d46cb2543a3c/compiler.py new file mode 100644 index 0000000000000000000000000000000000000000..474f6cfd100015e025c1debc8fe63a63d53b135a --- /dev/null +++ b/shared/package-files/1f/1ffffb430d3d2a55e6856800ca74e4f541316ede98bc1d34a270d46cb2543a3c/compiler.py @@ -0,0 +1,571 @@ +r""" +Compiler for a regular grammar. + +Example usage:: + + # Create and compile grammar. + p = compile('add \s+ (?P[^\s]+) \s+ (?P[^\s]+)') + + # Match input string. + m = p.match('add 23 432') + + # Get variables. + m.variables().get('var1') # Returns "23" + m.variables().get('var2') # Returns "432" + + +Partial matches are possible:: + + # Create and compile grammar. + p = compile(''' + # Operators with two arguments. + ((?P[^\s]+) \s+ (?P[^\s]+) \s+ (?P[^\s]+)) | + + # Operators with only one arguments. + ((?P[^\s]+) \s+ (?P[^\s]+)) + ''') + + # Match partial input string. + m = p.match_prefix('add 23') + + # Get variables. (Notice that both operator1 and operator2 contain the + # value "add".) This is because our input is incomplete, and we don't know + # yet in which rule of the regex we we'll end up. It could also be that + # `operator1` and `operator2` have a different autocompleter and we want to + # call all possible autocompleters that would result in valid input.) + m.variables().get('var1') # Returns "23" + m.variables().get('operator1') # Returns "add" + m.variables().get('operator2') # Returns "add" + +""" +from __future__ import annotations + +import re +from typing import Callable, Dict, Iterable, Iterator, Pattern +from typing import Match as RegexMatch + +from .regex_parser import ( + AnyNode, + Lookahead, + Node, + NodeSequence, + Regex, + Repeat, + Variable, + parse_regex, + tokenize_regex, +) + +__all__ = [ + "compile", +] + + +# Name of the named group in the regex, matching trailing input. +# (Trailing input is when the input contains characters after the end of the +# expression has been matched.) +_INVALID_TRAILING_INPUT = "invalid_trailing" + +EscapeFuncDict = Dict[str, Callable[[str], str]] + + +class _CompiledGrammar: + """ + Compiles a grammar. This will take the parse tree of a regular expression + and compile the grammar. + + :param root_node: :class~`.regex_parser.Node` instance. + :param escape_funcs: `dict` mapping variable names to escape callables. + :param unescape_funcs: `dict` mapping variable names to unescape callables. + """ + + def __init__( + self, + root_node: Node, + escape_funcs: EscapeFuncDict | None = None, + unescape_funcs: EscapeFuncDict | None = None, + ) -> None: + self.root_node = root_node + self.escape_funcs = escape_funcs or {} + self.unescape_funcs = unescape_funcs or {} + + #: Dictionary that will map the regex names to Node instances. + self._group_names_to_nodes: dict[ + str, str + ] = {} # Maps regex group names to varnames. + counter = [0] + + def create_group_func(node: Variable) -> str: + name = "n%s" % counter[0] + self._group_names_to_nodes[name] = node.varname + counter[0] += 1 + return name + + # Compile regex strings. + self._re_pattern = "^%s$" % self._transform(root_node, create_group_func) + self._re_prefix_patterns = list( + self._transform_prefix(root_node, create_group_func) + ) + + # Compile the regex itself. + flags = re.DOTALL # Note that we don't need re.MULTILINE! (^ and $ + # still represent the start and end of input text.) + self._re = re.compile(self._re_pattern, flags) + self._re_prefix = [re.compile(t, flags) for t in self._re_prefix_patterns] + + # We compile one more set of regexes, similar to `_re_prefix`, but accept any trailing + # input. This will ensure that we can still highlight the input correctly, even when the + # input contains some additional characters at the end that don't match the grammar.) + self._re_prefix_with_trailing_input = [ + re.compile( + r"(?:{})(?P<{}>.*?)$".format(t.rstrip("$"), _INVALID_TRAILING_INPUT), + flags, + ) + for t in self._re_prefix_patterns + ] + + def escape(self, varname: str, value: str) -> str: + """ + Escape `value` to fit in the place of this variable into the grammar. + """ + f = self.escape_funcs.get(varname) + return f(value) if f else value + + def unescape(self, varname: str, value: str) -> str: + """ + Unescape `value`. + """ + f = self.unescape_funcs.get(varname) + return f(value) if f else value + + @classmethod + def _transform( + cls, root_node: Node, create_group_func: Callable[[Variable], str] + ) -> str: + """ + Turn a :class:`Node` object into a regular expression. + + :param root_node: The :class:`Node` instance for which we generate the grammar. + :param create_group_func: A callable which takes a `Node` and returns the next + free name for this node. + """ + + def transform(node: Node) -> str: + # Turn `AnyNode` into an OR. + if isinstance(node, AnyNode): + return "(?:%s)" % "|".join(transform(c) for c in node.children) + + # Concatenate a `NodeSequence` + elif isinstance(node, NodeSequence): + return "".join(transform(c) for c in node.children) + + # For Regex and Lookahead nodes, just insert them literally. + elif isinstance(node, Regex): + return node.regex + + elif isinstance(node, Lookahead): + before = "(?!" if node.negative else "(=" + return before + transform(node.childnode) + ")" + + # A `Variable` wraps the children into a named group. + elif isinstance(node, Variable): + return f"(?P<{create_group_func(node)}>{transform(node.childnode)})" + + # `Repeat`. + elif isinstance(node, Repeat): + if node.max_repeat is None: + if node.min_repeat == 0: + repeat_sign = "*" + elif node.min_repeat == 1: + repeat_sign = "+" + else: + repeat_sign = "{%i,%s}" % ( + node.min_repeat, + ("" if node.max_repeat is None else str(node.max_repeat)), + ) + + return "(?:{}){}{}".format( + transform(node.childnode), + repeat_sign, + ("" if node.greedy else "?"), + ) + else: + raise TypeError(f"Got {node!r}") + + return transform(root_node) + + @classmethod + def _transform_prefix( + cls, root_node: Node, create_group_func: Callable[[Variable], str] + ) -> Iterable[str]: + """ + Yield all the regular expressions matching a prefix of the grammar + defined by the `Node` instance. + + For each `Variable`, one regex pattern will be generated, with this + named group at the end. This is required because a regex engine will + terminate once a match is found. For autocompletion however, we need + the matches for all possible paths, so that we can provide completions + for each `Variable`. + + - So, in the case of an `Any` (`A|B|C)', we generate a pattern for each + clause. This is one for `A`, one for `B` and one for `C`. Unless some + groups don't contain a `Variable`, then these can be merged together. + - In the case of a `NodeSequence` (`ABC`), we generate a pattern for + each prefix that ends with a variable, and one pattern for the whole + sequence. So, that's one for `A`, one for `AB` and one for `ABC`. + + :param root_node: The :class:`Node` instance for which we generate the grammar. + :param create_group_func: A callable which takes a `Node` and returns the next + free name for this node. + """ + + def contains_variable(node: Node) -> bool: + if isinstance(node, Regex): + return False + elif isinstance(node, Variable): + return True + elif isinstance(node, (Lookahead, Repeat)): + return contains_variable(node.childnode) + elif isinstance(node, (NodeSequence, AnyNode)): + return any(contains_variable(child) for child in node.children) + + return False + + def transform(node: Node) -> Iterable[str]: + # Generate separate pattern for all terms that contain variables + # within this OR. Terms that don't contain a variable can be merged + # together in one pattern. + if isinstance(node, AnyNode): + # If we have a definition like: + # (?P .*) | (?P .*) + # Then we want to be able to generate completions for both the + # name as well as the city. We do this by yielding two + # different regular expressions, because the engine won't + # follow multiple paths, if multiple are possible. + children_with_variable = [] + children_without_variable = [] + for c in node.children: + if contains_variable(c): + children_with_variable.append(c) + else: + children_without_variable.append(c) + + for c in children_with_variable: + yield from transform(c) + + # Merge options without variable together. + if children_without_variable: + yield "|".join( + r for c in children_without_variable for r in transform(c) + ) + + # For a sequence, generate a pattern for each prefix that ends with + # a variable + one pattern of the complete sequence. + # (This is because, for autocompletion, we match the text before + # the cursor, and completions are given for the variable that we + # match right before the cursor.) + elif isinstance(node, NodeSequence): + # For all components in the sequence, compute prefix patterns, + # as well as full patterns. + complete = [cls._transform(c, create_group_func) for c in node.children] + prefixes = [list(transform(c)) for c in node.children] + variable_nodes = [contains_variable(c) for c in node.children] + + # If any child is contains a variable, we should yield a + # pattern up to that point, so that we are sure this will be + # matched. + for i in range(len(node.children)): + if variable_nodes[i]: + for c_str in prefixes[i]: + yield "".join(complete[:i]) + c_str + + # If there are non-variable nodes, merge all the prefixes into + # one pattern. If the input is: "[part1] [part2] [part3]", then + # this gets compiled into: + # (complete1 + (complete2 + (complete3 | partial3) | partial2) | partial1 ) + # For nodes that contain a variable, we skip the "|partial" + # part here, because thees are matched with the previous + # patterns. + if not all(variable_nodes): + result = [] + + # Start with complete patterns. + for i in range(len(node.children)): + result.append("(?:") + result.append(complete[i]) + + # Add prefix patterns. + for i in range(len(node.children) - 1, -1, -1): + if variable_nodes[i]: + # No need to yield a prefix for this one, we did + # the variable prefixes earlier. + result.append(")") + else: + result.append("|(?:") + # If this yields multiple, we should yield all combinations. + assert len(prefixes[i]) == 1 + result.append(prefixes[i][0]) + result.append("))") + + yield "".join(result) + + elif isinstance(node, Regex): + yield "(?:%s)?" % node.regex + + elif isinstance(node, Lookahead): + if node.negative: + yield "(?!%s)" % cls._transform(node.childnode, create_group_func) + else: + # Not sure what the correct semantics are in this case. + # (Probably it's not worth implementing this.) + raise Exception("Positive lookahead not yet supported.") + + elif isinstance(node, Variable): + # (Note that we should not append a '?' here. the 'transform' + # method will already recursively do that.) + for c_str in transform(node.childnode): + yield f"(?P<{create_group_func(node)}>{c_str})" + + elif isinstance(node, Repeat): + # If we have a repetition of 8 times. That would mean that the + # current input could have for instance 7 times a complete + # match, followed by a partial match. + prefix = cls._transform(node.childnode, create_group_func) + + if node.max_repeat == 1: + yield from transform(node.childnode) + else: + for c_str in transform(node.childnode): + if node.max_repeat: + repeat_sign = "{,%i}" % (node.max_repeat - 1) + else: + repeat_sign = "*" + yield "(?:{}){}{}{}".format( + prefix, + repeat_sign, + ("" if node.greedy else "?"), + c_str, + ) + + else: + raise TypeError("Got %r" % node) + + for r in transform(root_node): + yield "^(?:%s)$" % r + + def match(self, string: str) -> Match | None: + """ + Match the string with the grammar. + Returns a :class:`Match` instance or `None` when the input doesn't match the grammar. + + :param string: The input string. + """ + m = self._re.match(string) + + if m: + return Match( + string, [(self._re, m)], self._group_names_to_nodes, self.unescape_funcs + ) + return None + + def match_prefix(self, string: str) -> Match | None: + """ + Do a partial match of the string with the grammar. The returned + :class:`Match` instance can contain multiple representations of the + match. This will never return `None`. If it doesn't match at all, the "trailing input" + part will capture all of the input. + + :param string: The input string. + """ + # First try to match using `_re_prefix`. If nothing is found, use the patterns that + # also accept trailing characters. + for patterns in [self._re_prefix, self._re_prefix_with_trailing_input]: + matches = [(r, r.match(string)) for r in patterns] + matches2 = [(r, m) for r, m in matches if m] + + if matches2 != []: + return Match( + string, matches2, self._group_names_to_nodes, self.unescape_funcs + ) + + return None + + +class Match: + """ + :param string: The input string. + :param re_matches: List of (compiled_re_pattern, re_match) tuples. + :param group_names_to_nodes: Dictionary mapping all the re group names to the matching Node instances. + """ + + def __init__( + self, + string: str, + re_matches: list[tuple[Pattern[str], RegexMatch[str]]], + group_names_to_nodes: dict[str, str], + unescape_funcs: dict[str, Callable[[str], str]], + ): + self.string = string + self._re_matches = re_matches + self._group_names_to_nodes = group_names_to_nodes + self._unescape_funcs = unescape_funcs + + def _nodes_to_regs(self) -> list[tuple[str, tuple[int, int]]]: + """ + Return a list of (varname, reg) tuples. + """ + + def get_tuples() -> Iterable[tuple[str, tuple[int, int]]]: + for r, re_match in self._re_matches: + for group_name, group_index in r.groupindex.items(): + if group_name != _INVALID_TRAILING_INPUT: + regs = re_match.regs + reg = regs[group_index] + node = self._group_names_to_nodes[group_name] + yield (node, reg) + + return list(get_tuples()) + + def _nodes_to_values(self) -> list[tuple[str, str, tuple[int, int]]]: + """ + Returns list of (Node, string_value) tuples. + """ + + def is_none(sl: tuple[int, int]) -> bool: + return sl[0] == -1 and sl[1] == -1 + + def get(sl: tuple[int, int]) -> str: + return self.string[sl[0] : sl[1]] + + return [ + (varname, get(slice), slice) + for varname, slice in self._nodes_to_regs() + if not is_none(slice) + ] + + def _unescape(self, varname: str, value: str) -> str: + unwrapper = self._unescape_funcs.get(varname) + return unwrapper(value) if unwrapper else value + + def variables(self) -> Variables: + """ + Returns :class:`Variables` instance. + """ + return Variables( + [(k, self._unescape(k, v), sl) for k, v, sl in self._nodes_to_values()] + ) + + def trailing_input(self) -> MatchVariable | None: + """ + Get the `MatchVariable` instance, representing trailing input, if there is any. + "Trailing input" is input at the end that does not match the grammar anymore, but + when this is removed from the end of the input, the input would be a valid string. + """ + slices: list[tuple[int, int]] = [] + + # Find all regex group for the name _INVALID_TRAILING_INPUT. + for r, re_match in self._re_matches: + for group_name, group_index in r.groupindex.items(): + if group_name == _INVALID_TRAILING_INPUT: + slices.append(re_match.regs[group_index]) + + # Take the smallest part. (Smaller trailing text means that a larger input has + # been matched, so that is better.) + if slices: + slice = (max(i[0] for i in slices), max(i[1] for i in slices)) + value = self.string[slice[0] : slice[1]] + return MatchVariable("", value, slice) + return None + + def end_nodes(self) -> Iterable[MatchVariable]: + """ + Yields `MatchVariable` instances for all the nodes having their end + position at the end of the input string. + """ + for varname, reg in self._nodes_to_regs(): + # If this part goes until the end of the input string. + if reg[1] == len(self.string): + value = self._unescape(varname, self.string[reg[0] : reg[1]]) + yield MatchVariable(varname, value, (reg[0], reg[1])) + + +class Variables: + def __init__(self, tuples: list[tuple[str, str, tuple[int, int]]]) -> None: + #: List of (varname, value, slice) tuples. + self._tuples = tuples + + def __repr__(self) -> str: + return "{}({})".format( + self.__class__.__name__, + ", ".join(f"{k}={v!r}" for k, v, _ in self._tuples), + ) + + def get(self, key: str, default: str | None = None) -> str | None: + items = self.getall(key) + return items[0] if items else default + + def getall(self, key: str) -> list[str]: + return [v for k, v, _ in self._tuples if k == key] + + def __getitem__(self, key: str) -> str | None: + return self.get(key) + + def __iter__(self) -> Iterator[MatchVariable]: + """ + Yield `MatchVariable` instances. + """ + for varname, value, slice in self._tuples: + yield MatchVariable(varname, value, slice) + + +class MatchVariable: + """ + Represents a match of a variable in the grammar. + + :param varname: (string) Name of the variable. + :param value: (string) Value of this variable. + :param slice: (start, stop) tuple, indicating the position of this variable + in the input string. + """ + + def __init__(self, varname: str, value: str, slice: tuple[int, int]) -> None: + self.varname = varname + self.value = value + self.slice = slice + + self.start = self.slice[0] + self.stop = self.slice[1] + + def __repr__(self) -> str: + return f"{self.__class__.__name__}({self.varname!r}, {self.value!r})" + + +def compile( + expression: str, + escape_funcs: EscapeFuncDict | None = None, + unescape_funcs: EscapeFuncDict | None = None, +) -> _CompiledGrammar: + """ + Compile grammar (given as regex string), returning a `CompiledGrammar` + instance. + """ + return _compile_from_parse_tree( + parse_regex(tokenize_regex(expression)), + escape_funcs=escape_funcs, + unescape_funcs=unescape_funcs, + ) + + +def _compile_from_parse_tree( + root_node: Node, + escape_funcs: EscapeFuncDict | None = None, + unescape_funcs: EscapeFuncDict | None = None, +) -> _CompiledGrammar: + """ + Compile grammar (given as parse tree), returning a `CompiledGrammar` + instance. + """ + return _CompiledGrammar( + root_node, escape_funcs=escape_funcs, unescape_funcs=unescape_funcs + ) diff --git a/shared/package-files/2c/2c006e265504b6c8a313883a0b84803c463315883d5744d19e25d4873f65c8d7/kthvalue_ops.h b/shared/package-files/2c/2c006e265504b6c8a313883a0b84803c463315883d5744d19e25d4873f65c8d7/kthvalue_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..ddae72484fa67da23c973c43a0182a39f7863725 --- /dev/null +++ b/shared/package-files/2c/2c006e265504b6c8a313883a0b84803c463315883d5744d19e25d4873f65c8d7/kthvalue_ops.h @@ -0,0 +1,61 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API kthvalue { + using schema = ::std::tuple (const at::Tensor &, int64_t, int64_t, bool); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::kthvalue") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "kthvalue(Tensor self, int k, int dim=-1, bool keepdim=False) -> (Tensor values, Tensor indices)") + static ::std::tuple call(const at::Tensor & self, int64_t k, int64_t dim, bool keepdim); + static ::std::tuple redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, int64_t k, int64_t dim, bool keepdim); +}; + +struct TORCH_API kthvalue_values { + using schema = ::std::tuple (const at::Tensor &, int64_t, int64_t, bool, at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::kthvalue") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "values") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "kthvalue.values(Tensor self, int k, int dim=-1, bool keepdim=False, *, Tensor(a!) values, Tensor(b!) indices) -> (Tensor(a!) values, Tensor(b!) indices)") + static ::std::tuple call(const at::Tensor & self, int64_t k, int64_t dim, bool keepdim, at::Tensor & values, at::Tensor & indices); + static ::std::tuple redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, int64_t k, int64_t dim, bool keepdim, at::Tensor & values, at::Tensor & indices); +}; + +struct TORCH_API kthvalue_dimname { + using schema = ::std::tuple (const at::Tensor &, int64_t, at::Dimname, bool); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::kthvalue") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "dimname") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "kthvalue.dimname(Tensor self, int k, Dimname dim, bool keepdim=False) -> (Tensor values, Tensor indices)") + static ::std::tuple call(const at::Tensor & self, int64_t k, at::Dimname dim, bool keepdim); + static ::std::tuple redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, int64_t k, at::Dimname dim, bool keepdim); +}; + +struct TORCH_API kthvalue_dimname_out { + using schema = ::std::tuple (const at::Tensor &, int64_t, at::Dimname, bool, at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::kthvalue") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "dimname_out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "kthvalue.dimname_out(Tensor self, int k, Dimname dim, bool keepdim=False, *, Tensor(a!) values, Tensor(b!) indices) -> (Tensor(a!) values, Tensor(b!) indices)") + static ::std::tuple call(const at::Tensor & self, int64_t k, at::Dimname dim, bool keepdim, at::Tensor & values, at::Tensor & indices); + static ::std::tuple redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, int64_t k, at::Dimname dim, bool keepdim, at::Tensor & values, at::Tensor & indices); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/2c/2c058d4a4e16a80b3e872b0e098034792828458589a6bc2c21e1493a9552bc35/multilabel_margin_loss.h b/shared/package-files/2c/2c058d4a4e16a80b3e872b0e098034792828458589a6bc2c21e1493a9552bc35/multilabel_margin_loss.h new file mode 100644 index 0000000000000000000000000000000000000000..dec21ff2320265d7523dce19822c20fe09584724 --- /dev/null +++ b/shared/package-files/2c/2c058d4a4e16a80b3e872b0e098034792828458589a6bc2c21e1493a9552bc35/multilabel_margin_loss.h @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::multilabel_margin_loss.out(Tensor self, Tensor target, int reduction=Mean, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & multilabel_margin_loss_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & target, int64_t reduction=at::Reduction::Mean) { + return at::_ops::multilabel_margin_loss_out::call(self, target, reduction, out); +} +// aten::multilabel_margin_loss.out(Tensor self, Tensor target, int reduction=Mean, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & multilabel_margin_loss_outf(const at::Tensor & self, const at::Tensor & target, int64_t reduction, at::Tensor & out) { + return at::_ops::multilabel_margin_loss_out::call(self, target, reduction, out); +} + +// aten::multilabel_margin_loss(Tensor self, Tensor target, int reduction=Mean) -> Tensor +inline at::Tensor multilabel_margin_loss(const at::Tensor & self, const at::Tensor & target, int64_t reduction=at::Reduction::Mean) { + return at::_ops::multilabel_margin_loss::call(self, target, reduction); +} + +} diff --git a/shared/package-files/2c/2c1508229377cb740f4baa45616c2aa5c6b94a1a160f26996d9e8fc039bf4a60/quotientring.py b/shared/package-files/2c/2c1508229377cb740f4baa45616c2aa5c6b94a1a160f26996d9e8fc039bf4a60/quotientring.py new file mode 100644 index 0000000000000000000000000000000000000000..b29cf0b100ffb13042c757b9d15bfd43c63ae9fb --- /dev/null +++ b/shared/package-files/2c/2c1508229377cb740f4baa45616c2aa5c6b94a1a160f26996d9e8fc039bf4a60/quotientring.py @@ -0,0 +1,201 @@ +"""Implementation of :class:`QuotientRing` class.""" + + +from sympy.polys.agca.modules import FreeModuleQuotientRing +from sympy.polys.domains.ring import Ring +from sympy.polys.polyerrors import NotReversible, CoercionFailed +from sympy.utilities import public + +# TODO +# - successive quotients (when quotient ideals are implemented) +# - poly rings over quotients? +# - division by non-units in integral domains? + +@public +class QuotientRingElement: + """ + Class representing elements of (commutative) quotient rings. + + Attributes: + + - ring - containing ring + - data - element of ring.ring (i.e. base ring) representing self + """ + + def __init__(self, ring, data): + self.ring = ring + self.data = data + + def __str__(self): + from sympy.printing.str import sstr + return sstr(self.data) + " + " + str(self.ring.base_ideal) + + __repr__ = __str__ + + def __bool__(self): + return not self.ring.is_zero(self) + + def __add__(self, om): + if not isinstance(om, self.__class__) or om.ring != self.ring: + try: + om = self.ring.convert(om) + except (NotImplementedError, CoercionFailed): + return NotImplemented + return self.ring(self.data + om.data) + + __radd__ = __add__ + + def __neg__(self): + return self.ring(self.data*self.ring.ring.convert(-1)) + + def __sub__(self, om): + return self.__add__(-om) + + def __rsub__(self, om): + return (-self).__add__(om) + + def __mul__(self, o): + if not isinstance(o, self.__class__): + try: + o = self.ring.convert(o) + except (NotImplementedError, CoercionFailed): + return NotImplemented + return self.ring(self.data*o.data) + + __rmul__ = __mul__ + + def __rtruediv__(self, o): + return self.ring.revert(self)*o + + def __truediv__(self, o): + if not isinstance(o, self.__class__): + try: + o = self.ring.convert(o) + except (NotImplementedError, CoercionFailed): + return NotImplemented + return self.ring.revert(o)*self + + def __pow__(self, oth): + if oth < 0: + return self.ring.revert(self) ** -oth + return self.ring(self.data ** oth) + + def __eq__(self, om): + if not isinstance(om, self.__class__) or om.ring != self.ring: + return False + return self.ring.is_zero(self - om) + + def __ne__(self, om): + return not self == om + + +class QuotientRing(Ring): + """ + Class representing (commutative) quotient rings. + + You should not usually instantiate this by hand, instead use the constructor + from the base ring in the construction. + + >>> from sympy.abc import x + >>> from sympy import QQ + >>> I = QQ.old_poly_ring(x).ideal(x**3 + 1) + >>> QQ.old_poly_ring(x).quotient_ring(I) + QQ[x]/ + + Shorter versions are possible: + + >>> QQ.old_poly_ring(x)/I + QQ[x]/ + + >>> QQ.old_poly_ring(x)/[x**3 + 1] + QQ[x]/ + + Attributes: + + - ring - the base ring + - base_ideal - the ideal used to form the quotient + """ + + has_assoc_Ring = True + has_assoc_Field = False + dtype = QuotientRingElement + + def __init__(self, ring, ideal): + if not ideal.ring == ring: + raise ValueError('Ideal must belong to %s, got %s' % (ring, ideal)) + self.ring = ring + self.base_ideal = ideal + self.zero = self(self.ring.zero) + self.one = self(self.ring.one) + + def __str__(self): + return str(self.ring) + "/" + str(self.base_ideal) + + def __hash__(self): + return hash((self.__class__.__name__, self.dtype, self.ring, self.base_ideal)) + + def new(self, a): + """Construct an element of ``self`` domain from ``a``. """ + if not isinstance(a, self.ring.dtype): + a = self.ring(a) + # TODO optionally disable reduction? + return self.dtype(self, self.base_ideal.reduce_element(a)) + + def __eq__(self, other): + """Returns ``True`` if two domains are equivalent. """ + return isinstance(other, QuotientRing) and \ + self.ring == other.ring and self.base_ideal == other.base_ideal + + def from_ZZ(K1, a, K0): + """Convert a Python ``int`` object to ``dtype``. """ + return K1(K1.ring.convert(a, K0)) + + from_ZZ_python = from_ZZ + from_QQ_python = from_ZZ_python + from_ZZ_gmpy = from_ZZ_python + from_QQ_gmpy = from_ZZ_python + from_RealField = from_ZZ_python + from_GlobalPolynomialRing = from_ZZ_python + from_FractionField = from_ZZ_python + + def from_sympy(self, a): + return self(self.ring.from_sympy(a)) + + def to_sympy(self, a): + return self.ring.to_sympy(a.data) + + def from_QuotientRing(self, a, K0): + if K0 == self: + return a + + def poly_ring(self, *gens): + """Returns a polynomial ring, i.e. ``K[X]``. """ + raise NotImplementedError('nested domains not allowed') + + def frac_field(self, *gens): + """Returns a fraction field, i.e. ``K(X)``. """ + raise NotImplementedError('nested domains not allowed') + + def revert(self, a): + """ + Compute a**(-1), if possible. + """ + I = self.ring.ideal(a.data) + self.base_ideal + try: + return self(I.in_terms_of_generators(1)[0]) + except ValueError: # 1 not in I + raise NotReversible('%s not a unit in %r' % (a, self)) + + def is_zero(self, a): + return self.base_ideal.contains(a.data) + + def free_module(self, rank): + """ + Generate a free module of rank ``rank`` over ``self``. + + >>> from sympy.abc import x + >>> from sympy import QQ + >>> (QQ.old_poly_ring(x)/[x**2 + 1]).free_module(2) + (QQ[x]/)**2 + """ + return FreeModuleQuotientRing(self, rank) diff --git a/shared/package-files/2c/2c15a98d345f81637934b4dc84b644a7a9bb20cb6eec76e22a8ced2dce8a3466/test_scipy_nodes.py b/shared/package-files/2c/2c15a98d345f81637934b4dc84b644a7a9bb20cb6eec76e22a8ced2dce8a3466/test_scipy_nodes.py new file mode 100644 index 0000000000000000000000000000000000000000..c0d1461037eec81ade0c99b18fbbf5a4517ce0b7 --- /dev/null +++ b/shared/package-files/2c/2c15a98d345f81637934b4dc84b644a7a9bb20cb6eec76e22a8ced2dce8a3466/test_scipy_nodes.py @@ -0,0 +1,44 @@ +from itertools import product +from sympy.core.power import Pow +from sympy.core.symbol import symbols +from sympy.functions.elementary.exponential import exp, log +from sympy.functions.elementary.trigonometric import cos +from sympy.core.numbers import pi +from sympy.codegen.scipy_nodes import cosm1, powm1 + +x, y, z = symbols('x y z') + + +def test_cosm1(): + cm1_xy = cosm1(x*y) + ref_xy = cos(x*y) - 1 + for wrt, deriv_order in product([x, y, z], range(3)): + assert ( + cm1_xy.diff(wrt, deriv_order) - + ref_xy.diff(wrt, deriv_order) + ).rewrite(cos).simplify() == 0 + + expr_minus2 = cosm1(pi) + assert expr_minus2.rewrite(cos) == -2 + assert cosm1(3.14).simplify() == cosm1(3.14) # cannot simplify with 3.14 + assert cosm1(pi/2).simplify() == -1 + assert (1/cos(x) - 1 + cosm1(x)/cos(x)).simplify() == 0 + + +def test_powm1(): + cases = { + powm1(x, y): x**y - 1, + powm1(x*y, z): (x*y)**z - 1, + powm1(x, y*z): x**(y*z)-1, + powm1(x*y*z, x*y*z): (x*y*z)**(x*y*z)-1 + } + for pm1_e, ref_e in cases.items(): + for wrt, deriv_order in product([x, y, z], range(3)): + der = pm1_e.diff(wrt, deriv_order) + ref = ref_e.diff(wrt, deriv_order) + delta = (der - ref).rewrite(Pow) + assert delta.simplify() == 0 + + eulers_constant_m1 = powm1(x, 1/log(x)) + assert eulers_constant_m1.rewrite(Pow) == exp(1) - 1 + assert eulers_constant_m1.simplify() == exp(1) - 1 diff --git a/shared/package-files/2c/2c1a77c82e48d93a578429add344a096e9779ef378f362814d8bf2ea4746a7fc/channel_shuffle_native.h b/shared/package-files/2c/2c1a77c82e48d93a578429add344a096e9779ef378f362814d8bf2ea4746a7fc/channel_shuffle_native.h new file mode 100644 index 0000000000000000000000000000000000000000..00ebd5527c4c50afda88c0257bd154414289504b --- /dev/null +++ b/shared/package-files/2c/2c1a77c82e48d93a578429add344a096e9779ef378f362814d8bf2ea4746a7fc/channel_shuffle_native.h @@ -0,0 +1,23 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor & channel_shuffle_out_symint(const at::Tensor & self, c10::SymInt groups, at::Tensor & out); +TORCH_API at::Tensor channel_shuffle(const at::Tensor & self, int64_t groups); +TORCH_API at::Tensor channel_shuffle_quantized_cpu(const at::Tensor & self, int64_t groups); +} // namespace native +} // namespace at diff --git a/shared/package-files/2c/2c1a959892deec16b0012c91f3cba4bf7201bc3300be59989cf2894609567e02/tril_native.h b/shared/package-files/2c/2c1a959892deec16b0012c91f3cba4bf7201bc3300be59989cf2894609567e02/tril_native.h new file mode 100644 index 0000000000000000000000000000000000000000..7859e44a34ec6442314b11262b300a03f391fce8 --- /dev/null +++ b/shared/package-files/2c/2c1a959892deec16b0012c91f3cba4bf7201bc3300be59989cf2894609567e02/tril_native.h @@ -0,0 +1,26 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace native { +struct TORCH_API structured_tril_cpu : public at::meta::structured_tril { +void impl(const at::Tensor & self, int64_t diagonal, const at::Tensor & out); +}; +struct TORCH_API structured_tril_cuda : public at::meta::structured_tril { +void impl(const at::Tensor & self, int64_t diagonal, const at::Tensor & out); +}; +} // namespace native +} // namespace at diff --git a/shared/package-files/2c/2c1c237f52d3b5f09f4d3dd1194abfdcf23f5742d17f61f1b59f8ebeab25c3e7/expression.h b/shared/package-files/2c/2c1c237f52d3b5f09f4d3dd1194abfdcf23f5742d17f61f1b59f8ebeab25c3e7/expression.h new file mode 100644 index 0000000000000000000000000000000000000000..b8ce50675c8c9bb0a3a7081a23c6bd3c2002f2d1 --- /dev/null +++ b/shared/package-files/2c/2c1c237f52d3b5f09f4d3dd1194abfdcf23f5742d17f61f1b59f8ebeab25c3e7/expression.h @@ -0,0 +1,295 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// This API is EXPERIMENTAL. + +#pragma once + +#include +#include +#include +#include +#include + +#include "arrow/compute/type_fwd.h" +#include "arrow/datum.h" +#include "arrow/type_fwd.h" +#include "arrow/util/small_vector.h" + +namespace arrow { +namespace compute { + +/// \defgroup expression-core Expressions to describe data transformations +/// +/// @{ + +/// An unbound expression which maps a single Datum to another Datum. +/// An expression is one of +/// - A literal Datum. +/// - A reference to a single (potentially nested) field of the input Datum. +/// - A call to a compute function, with arguments specified by other Expressions. +class ARROW_EXPORT Expression { + public: + struct Call { + std::string function_name; + std::vector arguments; + std::shared_ptr options; + // Cached hash value + size_t hash; + + // post-Bind properties: + std::shared_ptr function; + const Kernel* kernel = NULLPTR; + std::shared_ptr kernel_state; + TypeHolder type; + + void ComputeHash(); + }; + + std::string ToString() const; + bool Equals(const Expression& other) const; + size_t hash() const; + struct Hash { + size_t operator()(const Expression& expr) const { return expr.hash(); } + }; + + /// Bind this expression to the given input type, looking up Kernels and field types. + /// Some expression simplification may be performed and implicit casts will be inserted. + /// Any state necessary for execution will be initialized and returned. + Result Bind(const TypeHolder& in, ExecContext* = NULLPTR) const; + Result Bind(const Schema& in_schema, ExecContext* = NULLPTR) const; + + // XXX someday + // Clone all KernelState in this bound expression. If any function referenced by this + // expression has mutable KernelState, it is not safe to execute or apply simplification + // passes to it (or copies of it!) from multiple threads. Cloning state produces new + // KernelStates where necessary to ensure that Expressions may be manipulated safely + // on multiple threads. + // Result CloneState() const; + // Status SetState(ExpressionState); + + /// Return true if all an expression's field references have explicit types + /// and all of its functions' kernels are looked up. + bool IsBound() const; + + /// Return true if this expression is composed only of Scalar literals, field + /// references, and calls to ScalarFunctions. + bool IsScalarExpression() const; + + /// Return true if this expression is literal and entirely null. + bool IsNullLiteral() const; + + /// Return true if this expression could evaluate to true. Will return true for any + /// unbound or non-boolean Expressions. IsSatisfiable does not (currently) do any + /// canonicalization or simplification of the expression, so even Expressions + /// which are unsatisfiable may spuriously return `true` here. This function is + /// intended for use in predicate pushdown where a filter expression is simplified + /// by a guarantee, so it assumes that trying to simplify again would be redundant. + bool IsSatisfiable() const; + + // XXX someday + // Result GetPipelines(); + + bool is_valid() const { return impl_ != NULLPTR; } + + /// Access a Call or return nullptr if this expression is not a call + const Call* call() const; + /// Access a Datum or return nullptr if this expression is not a literal + const Datum* literal() const; + /// Access a FieldRef or return nullptr if this expression is not a field_ref + const FieldRef* field_ref() const; + + /// The type to which this expression will evaluate + const DataType* type() const; + // XXX someday + // NullGeneralization::type nullable() const; + + struct Parameter { + FieldRef ref; + + // post-bind properties + TypeHolder type; + ::arrow::internal::SmallVector indices; + }; + const Parameter* parameter() const; + + Expression() = default; + explicit Expression(Call call); + explicit Expression(Datum literal); + explicit Expression(Parameter parameter); + + static bool Identical(const Expression& l, const Expression& r); + + private: + using Impl = std::variant; + std::shared_ptr impl_; +}; + +inline bool operator==(const Expression& l, const Expression& r) { return l.Equals(r); } +inline bool operator!=(const Expression& l, const Expression& r) { return !l.Equals(r); } + +ARROW_EXPORT void PrintTo(const Expression&, std::ostream*); + +// Factories + +ARROW_EXPORT +Expression literal(Datum lit); + +template +Expression literal(Arg&& arg) { + return literal(Datum(std::forward(arg))); +} + +ARROW_EXPORT +Expression field_ref(FieldRef ref); + +ARROW_EXPORT +Expression call(std::string function, std::vector arguments, + std::shared_ptr options = NULLPTR); + +template ::value>::type> +Expression call(std::string function, std::vector arguments, + Options options) { + return call(std::move(function), std::move(arguments), + std::make_shared(std::move(options))); +} + +/// Assemble a list of all fields referenced by an Expression at any depth. +ARROW_EXPORT +std::vector FieldsInExpression(const Expression&); + +/// Check if the expression references any fields. +ARROW_EXPORT +bool ExpressionHasFieldRefs(const Expression&); + +struct ARROW_EXPORT KnownFieldValues; + +/// Assemble a mapping from field references to known values. This derives known values +/// from "equal" and "is_null" Expressions referencing a field and a literal. +ARROW_EXPORT +Result ExtractKnownFieldValues( + const Expression& guaranteed_true_predicate); + +/// @} + +/// \defgroup expression-passes Functions for modification of Expressions +/// +/// @{ +/// +/// These transform bound expressions. Some transforms utilize a guarantee, which is +/// provided as an Expression which is guaranteed to evaluate to true. The +/// guaranteed_true_predicate need not be bound, but canonicalization is currently +/// deferred to producers of guarantees. For example in order to be recognized as a +/// guarantee on a field value, an Expression must be a call to "equal" with field_ref LHS +/// and literal RHS. Flipping the arguments, "is_in" with a one-long value_set, ... or +/// other semantically identical Expressions will not be recognized. + +/// Weak canonicalization which establishes guarantees for subsequent passes. Even +/// equivalent Expressions may result in different canonicalized expressions. +/// TODO this could be a strong canonicalization +ARROW_EXPORT +Result Canonicalize(Expression, ExecContext* = NULLPTR); + +/// Simplify Expressions based on literal arguments (for example, add(null, x) will always +/// be null so replace the call with a null literal). Includes early evaluation of all +/// calls whose arguments are entirely literal. +ARROW_EXPORT +Result FoldConstants(Expression); + +/// Simplify Expressions by replacing with known values of the fields which it references. +ARROW_EXPORT +Result ReplaceFieldsWithKnownValues(const KnownFieldValues& known_values, + Expression); + +/// Simplify an expression by replacing subexpressions based on a guarantee: +/// a boolean expression which is guaranteed to evaluate to `true`. For example, this is +/// used to remove redundant function calls from a filter expression or to replace a +/// reference to a constant-value field with a literal. +ARROW_EXPORT +Result SimplifyWithGuarantee(Expression, + const Expression& guaranteed_true_predicate); + +/// Replace all named field refs (e.g. "x" or "x.y") with field paths (e.g. [0] or [1,3]) +/// +/// This isn't usually needed and does not offer any simplification by itself. However, +/// it can be useful to normalize an expression to paths to make it simpler to work with. +ARROW_EXPORT Result RemoveNamedRefs(Expression expression); + +/// @} + +// Execution + +/// Create an ExecBatch suitable for passing to ExecuteScalarExpression() from a +/// RecordBatch which may have missing or incorrectly ordered columns. +/// Missing fields will be replaced with null scalars. +ARROW_EXPORT Result MakeExecBatch(const Schema& full_schema, + const Datum& partial, + Expression guarantee = literal(true)); + +/// Execute a scalar expression against the provided state and input ExecBatch. This +/// expression must be bound. +ARROW_EXPORT +Result ExecuteScalarExpression(const Expression&, const ExecBatch& input, + ExecContext* = NULLPTR); + +/// Convenience function for invoking against a RecordBatch +ARROW_EXPORT +Result ExecuteScalarExpression(const Expression&, const Schema& full_schema, + const Datum& partial_input, ExecContext* = NULLPTR); + +// Serialization + +ARROW_EXPORT +Result> Serialize(const Expression&); + +ARROW_EXPORT +Result Deserialize(std::shared_ptr); + +/// \defgroup expression-convenience Helpers for convenient expression creation +/// +/// @{ + +ARROW_EXPORT Expression project(std::vector values, + std::vector names); + +ARROW_EXPORT Expression equal(Expression lhs, Expression rhs); + +ARROW_EXPORT Expression not_equal(Expression lhs, Expression rhs); + +ARROW_EXPORT Expression less(Expression lhs, Expression rhs); + +ARROW_EXPORT Expression less_equal(Expression lhs, Expression rhs); + +ARROW_EXPORT Expression greater(Expression lhs, Expression rhs); + +ARROW_EXPORT Expression greater_equal(Expression lhs, Expression rhs); + +ARROW_EXPORT Expression is_null(Expression lhs, bool nan_is_null = false); + +ARROW_EXPORT Expression is_valid(Expression lhs); + +ARROW_EXPORT Expression and_(Expression lhs, Expression rhs); +ARROW_EXPORT Expression and_(const std::vector&); +ARROW_EXPORT Expression or_(Expression lhs, Expression rhs); +ARROW_EXPORT Expression or_(const std::vector&); +ARROW_EXPORT Expression not_(Expression operand); + +/// @} + +} // namespace compute +} // namespace arrow diff --git a/shared/package-files/2c/2c28fac8aafe881013d984b6d2fa55ffc08b7aa5bb9c80ef0e364ee153ac1552/results_rls_R.csv b/shared/package-files/2c/2c28fac8aafe881013d984b6d2fa55ffc08b7aa5bb9c80ef0e364ee153ac1552/results_rls_R.csv new file mode 100644 index 0000000000000000000000000000000000000000..15ed379e15e29e5073179ffa9ef274d1c996867e --- /dev/null +++ b/shared/package-files/2c/2c28fac8aafe881013d984b6d2fa55ffc08b7aa5bb9c80ef0e364ee153ac1552/results_rls_R.csv @@ -0,0 +1,202 @@ +"beta1","beta2","rec_resid","cusum" +20.0003289473666,0.0651315789473821,0.244954345907551,0.00193563605335298 +27.2660687432794,0.01385606874334,0.203040661455013,0.00354006900657476 +38.67905442175,-0.0670068027209533,0.270280443387117,0.00567583258651052 +39.7751950254108,-0.0745053702654907,0.241841533101339,0.00758687110650389 +29.1331849912345,0.00178883071581329,0.415203521341092,0.010867820878631 +18.3066265462468,0.07927114677407,0.397784568256463,0.0140111255990758 +10.3433466424157,0.136079854809809,0.176046592258926,0.0154022506668258 +6.85989720582705,0.160900850388106,0.0938882276325083,0.0161441580525371 +8.20327148258485,0.151342100522645,-0.0456169627715057,0.0157836915441441 +10.2511427486456,0.136788154897673,-0.100272366304063,0.0149913365171122 +10.9957699951444,0.131503464575536,-0.0503494741056537,0.0145934735725493 +11.3175707763209,0.129219955362651,-0.0340711516639038,0.0143242423846087 +10.6654524361781,0.13384553399014,0.0916855645039212,0.0150487442650235 +11.1159086294258,0.130659898477266,-0.0628046014785767,0.0145524605575922 +12.156386729997,0.123317221871426,-0.163723398534085,0.0132587137093544 +12.7326996394925,0.119259115732779,-0.103746490236991,0.0124389060583918 +13.4410659854797,0.114279885481247,-0.153770453685824,0.0112238076571287 +13.6569896037784,0.112764484973186,-0.0567551736551511,0.010775326696588 +14.1144011142444,0.109559572375609,-0.142266908565485,0.00965112962877052 +14.8158432176534,0.104659089244761,-0.237517649981024,0.00777425855343773 +15.6507453043316,0.0988444881094996,-0.308861421756066,0.00533362700952327 +16.1607873501768,0.0952992037891843,-0.223226013059955,0.00356968884658018 +16.5385918090731,0.0926777890181332,-0.19441899414506,0.00203338454820357 +16.6498010517627,0.0919074166590858,-0.0667305825844362,0.0015060776288953 +17.014471754413,0.0893917183701445,-0.228436397901914,-0.000299033139965743 +17.3460818756217,0.0871131227705724,-0.222144348908167,-0.00205442396270116 +17.3843661628274,0.0868509149764685,-0.0285352009690891,-0.00227990991430085 +17.1280162311825,0.0886104513064945,0.25234647696406,-0.000285861035769862 +16.6667783624255,0.091771289167083,0.510364610726381,0.00374705431103636 +16.3226842126683,0.0941262202407745,0.426298113691983,0.00711567386045231 +16.0455621834406,0.0960146002312399,0.353662998951508,0.00991032871326247 +15.85854585646,0.0972808365656299,0.234197517696713,0.0117609640109543 +15.733990938833,0.0981199698632186,0.160737119802357,0.0130311132016079 +15.5472155607408,0.0993737343759857,0.259408244690296,0.0150809643650939 +15.359100577245,0.100632613316582,0.285291985514453,0.0173353495683793 +15.1438436622109,0.102065903516274,0.340269721055102,0.0200241703667954 +14.9504525606908,0.103348110227141,0.326521533003193,0.0226043526008987 +14.8392679441337,0.104081295077877,0.196271786313286,0.0241552977145134 +14.5735361313145,0.105829575321111,0.527326289405741,0.0283222447179351 +14.2099750496454,0.108218482052348,0.819366249673146,0.034796899608796 +13.7874175847374,0.110990470726413,1.06025114550419,0.0431750336453371 +13.3518043480087,0.113834887397852,1.14841860382417,0.0522498693893917 +12.8346569963456,0.117209228903986,1.52569799370484,0.0643059773641323 +12.3367186457394,0.120451583177883,1.5951492085586,0.0769108907700321 +11.9185230337974,0.123154390987991,1.33821597224724,0.0874855105974843 +11.5170468495664,0.125739357672303,1.36169336194335,0.0982456494112033 +11.266515248211,0.127342275661413,0.867738614053158,0.105102544070593 +11.0821361490573,0.128514376720014,0.653394030490114,0.11026568186991 +10.9290164719613,0.129484865504103,0.584740179652795,0.1148863150307 +10.8178656341354,0.130186652348879,0.450648727628674,0.118447353808616 +10.815540474966,0.130201229968511,0.00958837887806173,0.118523121445156 +10.8387662708446,0.130056193898848,-0.101729973630018,0.117719248364499 +10.945328087949,0.129395696123524,-0.474099262131996,0.113972902810797 +11.1085265304914,0.128391482155469,-0.742321517670144,0.108107057534779 +11.080805458722,0.128561827573399,0.139072384001631,0.109206011380655 +11.0781776871062,0.12857788516236,0.013749780020619,0.109314662524749 +10.8745917334063,0.129819717290388,1.15962459122506,0.118478048292875 +10.6044182322985,0.131458118663421,1.59589325604434,0.131088841182699 +10.2429003246852,0.133641433952644,2.25631514703675,0.148918306220968 +9.80473923277081,0.136280688202692,2.92799599642778,0.172055412010052 +9.25022363539014,0.139607925830564,3.90633237289927,0.202923359052794 +8.63802754477139,0.143273443914073,4.61111158580915,0.239360491035316 +8.05948905426918,0.146726439925444,4.59843304875835,0.275697436865482 +7.5349394264988,0.149825974640662,4.13302051978024,0.3083566799489 +7.00821909152587,0.152931416451406,4.42128714242792,0.343293813900952 +6.49494054475082,0.155945401893927,4.5048685993743,0.378891410850131 +6.0988192774942,0.15825221854616,3.50323010316598,0.406574032547477 +5.69919719959164,0.160571875780665,3.72091144830362,0.435976778287651 +5.32563871725321,0.162726735932826,3.5667996236933,0.464161728104023 +5.00672684903167,0.164551848094488,3.08141385283983,0.488511146060907 +4.71008920605094,0.166234013127225,2.87502733736156,0.511229692033032 +4.43756588678741,0.16777195359686,2.74961925042266,0.532957259814663 +4.21384227381131,0.169025609768913,2.30707054752226,0.551187795439038 +4.03276576900703,0.170031456375408,1.88475608800807,0.566081190460091 +3.84792927359839,0.171052217995977,1.99083244967449,0.581812803840935 +3.65581679781767,0.172104735954175,2.10565713861364,0.598451765106961 +3.43271594969956,0.173319986565316,2.53435920069987,0.618478341989467 +3.19551592377813,0.174605121939789,2.80068054404111,0.640609397533247 +2.94174918379039,0.175967331891713,3.02350395609635,0.664501209875634 +2.64977582541515,0.177521141926778,3.53325213433404,0.69242106649816 +2.27804795107949,0.179492726795484,4.75687341104855,0.730010012477248 +1.81207106307359,0.181952378499593,6.22749964103012,0.779219887822632 +1.20006257623398,0.185189423913085,8.93386320080931,0.849815523279275 +0.642700133221933,0.188106533453904,8.13393137937316,0.914090075237443 +0.162044794069806,0.190586654584145,6.84967429813633,0.968216392025478 +-0.388232157105243,0.193419998799898,8.33645466109985,1.03409128858787 +-0.830929504473958,0.195666868854773,6.55661128043321,1.08590181326015 +-1.36043838894161,0.198355531717544,8.48597347596573,1.15295821165562 +-1.91508980963037,0.201167866402037,9.45426514385162,1.22766607773816 +-2.33168037879134,0.203252287238571,7.00041047744203,1.28298351600692 +-2.6861602881266,0.205018905852968,6.23609678997191,1.33226132626232 +-3.11696629519342,0.207164092379631,8.06821700769127,1.39601660142799 +-3.380586761282,0.208457026967588,4.81782679243833,1.43408720272189 +-3.47550271526036,0.208917537856196,1.74135519064351,1.4478474398641 +-3.43518793631723,0.20872442486799,-0.734649496547034,1.44204221911235 +-3.29063290033468,0.20803953649519,-2.65151294543016,1.42108989008103 +-3.11250951812149,0.20720138448128,-3.37731816971661,1.39440222798332 +-2.93711028388834,0.206380820700801,-3.45884008330213,1.36707037745739 +-2.73891519437972,0.205460331097488,-4.02680824821257,1.33525042669758 +-2.54407370559115,0.204559368575348,-4.14575468573189,1.30249055788068 +-2.39053644758188,0.203850927117784,-3.45709420414838,1.27517250334038 +-2.15879795354626,0.202792578446064,-5.27251552247232,1.23350893905721 +-1.88564352691945,0.201557490834808,-6.29472546535112,1.18376784337854 +-1.50072985975385,0.199840034833206,-8.83289566450933,1.11397005620157 +-1.01998602735263,0.197721642567706,-11.0512754269927,1.02664257045003 +-0.530741824639045,0.195584625082435,-11.5172616043355,0.935632848966399 +0.126087783919003,0.192750446012934,-15.5482513416115,0.812770134480102 +0.946410908708773,0.189270304626056,-19.0555049685026,0.662193004300093 +1.86205593933885,0.185436633202073,-21.3782931153237,0.493261137588954 +2.94062744320269,0.180998996286405,-24.7634112972474,0.297579972866728 +3.93046978361501,0.176952871875341,-23.8543722535639,0.109082059947364 +4.7236004422528,0.173709372038306,-20.7823421335204,-0.0551405855326269 +5.4675996884093,0.170687823308056,-20.2975626887207,-0.215532490358468 +6.07736475879185,0.168211429838999,-17.8991553796871,-0.356972113930467 +6.65108884942456,0.165897192554224,-17.4682758358605,-0.495006915364721 +7.19807710004944,0.163707606768037,-17.1913300740697,-0.630853283687656 +7.64857293059005,0.161906308033814,-15.0423509578624,-0.749718359272868 +8.02400343300067,0.160407406629327,-13.2511610676823,-0.854429402534267 +8.27697105170115,0.159393021979789,-9.64098997283795,-0.930612773408131 +8.46390802433729,0.158642656136866,-7.55191041918006,-0.990288179553298 +8.64850604379691,0.157906542316743,-7.6524659626792,-1.05075817839957 +8.8032807335877,0.157293428596627,-6.57881654114708,-1.10274416965953 +8.95446233254623,0.15669939876546,-6.54733003621288,-1.15448135368188 +9.07158780840541,0.15624055040851,-5.26781371598019,-1.1961077641594 +9.1515744845053,0.155929537510679,-3.66905719708923,-1.22510075616445 +9.22290256262306,0.155653781395773,-3.35718417818991,-1.25162931890121 +9.33420751522502,0.155228728073273,-5.2451661212583,-1.29307676745542 +9.47688301586101,0.154691209393847,-6.70164388358391,-1.34603334379105 +9.64454275757949,0.154066975097651,-7.90326731732296,-1.40848518191631 +9.89285589272581,0.153162353373709,-11.3158347636997,-1.4979032229037 +10.22362756085,0.151981737573662,-14.650501628764,-1.61367189419335 +10.5746835692363,0.150742722870912,-15.6856020630384,-1.73761995789998 +11.0290368525466,0.149174121064393,-19.6221318472333,-1.89267458943318 +11.521525763197,0.147496618191182,-21.3110872218343,-2.06107539330502 +12.0097551690352,0.145847744373501,-21.6105380566535,-2.2318424660011 +12.5809716926057,0.143952306536491,-24.9283948322494,-2.42882733520498 +13.1820104607476,0.14198353337863,-26.3928121759554,-2.63738407098313 +13.7756629255838,0.140055020571329,-26.7444571357352,-2.84871951501245 +14.3220873542119,0.13828754257827,-25.6466882741224,-3.05138035896919 +14.8207276171901,0.13668165953396,-24.3380973264228,-3.24370068086631 +15.2481159052797,0.135304978578286,-22.0327586677785,-3.41780415257313 +15.6181829346188,0.134113727245657,-20.031239855858,-3.57609156696746 +15.9254888584187,0.133123389933797,-17.5347244815675,-3.71465144744797 +16.182155368207,0.132294410691331,-15.4547144169649,-3.83677503055452 +16.3834151607406,0.131641182247482,-12.8669102455973,-3.93844971313409 +16.5204878574538,0.131192230298616,-9.39682632316524,-4.01270369605823 +16.63080123604,0.130831250954667,-7.83625560015622,-4.0746260057309 +16.6978177388739,0.130609927017838,-5.07710225196627,-4.11474540891623 +16.701984857604,0.130595862027892,-0.347660671770127,-4.11749263321274 +16.6854899363512,0.130651769492848,1.43643763310767,-4.10614186308969 +16.6411402735019,0.1308047247492,4.1675554165708,-4.07320972429145 +16.5970272924035,0.130956482780881,4.23560772792058,-4.03973983423644 +16.5434552195032,0.131140920196373,5.29688512305167,-3.99788370069179 +16.4980678409499,0.131295685501156,4.49788774495942,-3.96234126664833 +16.4550533870677,0.131442089660633,4.35700314664811,-3.92791210661862 +16.4034997284221,0.131617772322878,5.37560925845634,-3.88543389276675 +16.3600988160341,0.131763871175012,4.50159941501498,-3.84986212900329 +16.3247393980859,0.131881384461121,3.64239912793104,-3.82107978980207 +16.2845302752546,0.132014427026232,4.20163109569142,-3.78787838403979 +16.2354404393816,0.132177427292469,5.30582134897501,-3.74595163618939 +16.1798773405667,0.132361174237754,6.09144757743956,-3.697816848034 +16.1369672582067,0.132500057996333,4.56732062189424,-3.66172575346613 +16.0729892527298,0.132709048388341,7.13935329958349,-3.60531038515291 +15.9868687893218,0.132993853448599,10.1342793363433,-3.52522902801063 +15.8911356599786,0.133312141181979,11.6651084758568,-3.43305101643673 +15.785185002403,0.133664851955115,13.2307698405521,-3.32850110521918 +15.6905768998578,0.133973040333207,11.4667001799168,-3.23789092151739 +15.6133391245925,0.134217442405614,8.91912747186154,-3.16741172820068 +15.5640712059174,0.13436901282478,5.42501709786526,-3.1245430922278 +15.5443250145019,0.134428290724675,2.0902928832644,-3.10802553973481 +15.5052812966114,0.134546068190848,4.28655544877293,-3.07415305937281 +15.4770175815522,0.134630205681346,3.07016536757968,-3.04989252725926 +15.4444079562019,0.134726861461024,3.58608824982803,-3.02155515818277 +15.4270366339921,0.134777267890843,1.85031118379933,-3.00693394775266 +15.4316347413337,0.134764175609174,-0.477068569778691,-3.01070375685796 +15.485223969148,0.134616348041038,-5.22556993240566,-3.0519963557829 +15.5377720379079,0.134472416205775,-5.15548845343067,-3.09273516891207 +15.5864363653653,0.134339998564693,-4.8096502231334,-3.13074115872793 +15.6597153950738,0.134144325745554,-7.04643728132906,-3.18642230208099 +15.7245766055152,0.133972149207703,-6.29666671180733,-3.23617873754313 +15.7994245842376,0.133776242802017,-7.16413965150234,-3.29278996829851 +15.868636133975,0.133595774179426,-6.72874484385436,-3.34596069717585 +15.9023375683116,0.133507356204151,-3.42152965903116,-3.37299771969162 +15.9376135653167,0.133415388659391,-3.60800397413116,-3.40150826743101 +15.9393738216715,0.133410826950409,-0.181502904584986,-3.4029425084305 +15.946239217832,0.133393106351883,-0.717507717778203,-3.40861227436972 +15.9406611757132,0.133407505145555,0.597384933183044,-3.40389172201489 +15.90456013034,0.133501495817669,4.05122277456845,-3.37187884698887 +15.8771653544801,0.133572808058213,3.14316508126937,-3.34704146910768 +15.8412573150016,0.133665967099135,4.17494417410317,-3.31405094414194 +15.7935359722084,0.133789167478241,5.59834503955845,-3.26981266595369 +15.7268054682595,0.133962833301512,8.16726022036199,-3.20527474856718 +15.6569651811967,0.13414318189471,8.55473897390291,-3.1376749632947 +15.5618045186239,0.134389293082345,11.9466775679243,-3.04327198492507 +15.4642740054136,0.134640099683783,12.314988670809,-2.94595860197799 +15.3556432691781,0.134913622023805,13.2582887882595,-2.84119123527038 +15.3324002785773,0.134969408327903,2.54655478870887,-2.82106828851228 +15.4991813437282,0.134592165940367,-15.7222457854785,-2.94530591193266 +15.6789718790788,0.134188841013154,-16.9736944902724,-3.07943251782015 +15.9359054652393,0.133628746925532,-22.7675615343864,-3.25934242221321 +16.1941692821757,0.133070741096307,-22.8916803003747,-3.44023311654675 diff --git a/shared/package-files/2c/2c3d6b88ea1a16f63f1954894cc72eb6cca7e9d94d983400865e92d9bf023796/quantized_rnn_tanh_cell_native.h b/shared/package-files/2c/2c3d6b88ea1a16f63f1954894cc72eb6cca7e9d94d983400865e92d9bf023796/quantized_rnn_tanh_cell_native.h new file mode 100644 index 0000000000000000000000000000000000000000..42ae97a10bbb30d5b64f1078d50588a6d27f15f9 --- /dev/null +++ b/shared/package-files/2c/2c3d6b88ea1a16f63f1954894cc72eb6cca7e9d94d983400865e92d9bf023796/quantized_rnn_tanh_cell_native.h @@ -0,0 +1,21 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor quantized_rnn_tanh_cell(const at::Tensor & input, const at::Tensor & hx, const at::Tensor & w_ih, const at::Tensor & w_hh, const at::Tensor & b_ih, const at::Tensor & b_hh, const at::Tensor & packed_ih, const at::Tensor & packed_hh, const at::Tensor & col_offsets_ih, const at::Tensor & col_offsets_hh, const at::Scalar & scale_ih, const at::Scalar & scale_hh, const at::Scalar & zero_point_ih, const at::Scalar & zero_point_hh); +} // namespace native +} // namespace at diff --git a/shared/package-files/2c/2c3f79a044bb258d8aae810b2be9be8e1bed6ef65a282867b740aaee414c342c/torture.py b/shared/package-files/2c/2c3f79a044bb258d8aae810b2be9be8e1bed6ef65a282867b740aaee414c342c/torture.py new file mode 100644 index 0000000000000000000000000000000000000000..845d5c6d7d017e51e1ed9a8fe3106cfa32fd967f --- /dev/null +++ b/shared/package-files/2c/2c3f79a044bb258d8aae810b2be9be8e1bed6ef65a282867b740aaee414c342c/torture.py @@ -0,0 +1,224 @@ +""" +Torture tests for asymptotics and high precision evaluation of +special functions. + +(Other torture tests may also be placed here.) + +Running this file (gmpy recommended!) takes several CPU minutes. +With Python 2.6+, multiprocessing is used automatically to run tests +in parallel if many cores are available. (A single test may take between +a second and several minutes; possibly more.) + +The idea: + +* We evaluate functions at positive, negative, imaginary, 45- and 135-degree + complex values with magnitudes between 10^-20 to 10^20, at precisions between + 5 and 150 digits (we can go even higher for fast functions). + +* Comparing the result from two different precision levels provides + a strong consistency check (particularly for functions that use + different algorithms at different precision levels). + +* That the computation finishes at all (without failure), within reasonable + time, provides a check that evaluation works at all: that the code runs, + that it doesn't get stuck in an infinite loop, and that it doesn't use + some extremely slowly algorithm where it could use a faster one. + +TODO: + +* Speed up those functions that take long to finish! +* Generalize to test more cases; more options. +* Implement a timeout mechanism. +* Some functions are notably absent, including the following: + * inverse trigonometric functions (some become inaccurate for complex arguments) + * ci, si (not implemented properly for large complex arguments) + * zeta functions (need to modify test not to try too large imaginary values) + * and others... + +""" + + +import sys, os +from timeit import default_timer as clock + +if "-nogmpy" in sys.argv: + sys.argv.remove('-nogmpy') + os.environ['MPMATH_NOGMPY'] = 'Y' + +filt = '' +if not sys.argv[-1].endswith(".py"): + filt = sys.argv[-1] + +from mpmath import * +from mpmath.libmp.backend import exec_ + +def test_asymp(f, maxdps=150, verbose=False, huge_range=False): + dps = [5,15,25,50,90,150,500,1500,5000,10000] + dps = [p for p in dps if p <= maxdps] + def check(x,y,p,inpt): + if abs(x-y)/abs(y) < workprec(20)(power)(10, -p+1): + return + print() + print("Error!") + print("Input:", inpt) + print("dps =", p) + print("Result 1:", x) + print("Result 2:", y) + print("Absolute error:", abs(x-y)) + print("Relative error:", abs(x-y)/abs(y)) + raise AssertionError + exponents = range(-20,20) + if huge_range: + exponents += [-1000, -100, -50, 50, 100, 1000] + for n in exponents: + if verbose: + sys.stdout.write(". ") + mp.dps = 25 + xpos = mpf(10)**n / 1.1287 + xneg = -xpos + ximag = xpos*j + xcomplex1 = xpos*(1+j) + xcomplex2 = xpos*(-1+j) + for i in range(len(dps)): + if verbose: + print("Testing dps = %s" % dps[i]) + mp.dps = dps[i] + new = f(xpos), f(xneg), f(ximag), f(xcomplex1), f(xcomplex2) + if i != 0: + p = dps[i-1] + check(prev[0], new[0], p, xpos) + check(prev[1], new[1], p, xneg) + check(prev[2], new[2], p, ximag) + check(prev[3], new[3], p, xcomplex1) + check(prev[4], new[4], p, xcomplex2) + prev = new + if verbose: + print() + +a1, a2, a3, a4, a5 = 1.5, -2.25, 3.125, 4, 2 + +def test_bernoulli_huge(): + p, q = bernfrac(9000) + assert p % 10**10 == 9636701091 + assert q == 4091851784687571609141381951327092757255270 + mp.dps = 15 + assert str(bernoulli(10**100)) == '-2.58183325604736e+987675256497386331227838638980680030172857347883537824464410652557820800494271520411283004120790908623' + mp.dps = 50 + assert str(bernoulli(10**100)) == '-2.5818332560473632073252488656039475548106223822913e+987675256497386331227838638980680030172857347883537824464410652557820800494271520411283004120790908623' + mp.dps = 15 + +cases = """\ +test_bernoulli_huge() +test_asymp(lambda z: +pi, maxdps=10000) +test_asymp(lambda z: +e, maxdps=10000) +test_asymp(lambda z: +ln2, maxdps=10000) +test_asymp(lambda z: +ln10, maxdps=10000) +test_asymp(lambda z: +phi, maxdps=10000) +test_asymp(lambda z: +catalan, maxdps=5000) +test_asymp(lambda z: +euler, maxdps=5000) +test_asymp(lambda z: +glaisher, maxdps=1000) +test_asymp(lambda z: +khinchin, maxdps=1000) +test_asymp(lambda z: +twinprime, maxdps=150) +test_asymp(lambda z: stieltjes(2), maxdps=150) +test_asymp(lambda z: +mertens, maxdps=150) +test_asymp(lambda z: +apery, maxdps=5000) +test_asymp(sqrt, maxdps=10000, huge_range=True) +test_asymp(cbrt, maxdps=5000, huge_range=True) +test_asymp(lambda z: root(z,4), maxdps=5000, huge_range=True) +test_asymp(lambda z: root(z,-5), maxdps=5000, huge_range=True) +test_asymp(exp, maxdps=5000, huge_range=True) +test_asymp(expm1, maxdps=1500) +test_asymp(ln, maxdps=5000, huge_range=True) +test_asymp(cosh, maxdps=5000) +test_asymp(sinh, maxdps=5000) +test_asymp(tanh, maxdps=1500) +test_asymp(sin, maxdps=5000, huge_range=True) +test_asymp(cos, maxdps=5000, huge_range=True) +test_asymp(tan, maxdps=1500) +test_asymp(agm, maxdps=1500, huge_range=True) +test_asymp(ellipk, maxdps=1500) +test_asymp(ellipe, maxdps=1500) +test_asymp(lambertw, huge_range=True) +test_asymp(lambda z: lambertw(z,-1)) +test_asymp(lambda z: lambertw(z,1)) +test_asymp(lambda z: lambertw(z,4)) +test_asymp(gamma) +test_asymp(loggamma) # huge_range=True ? +test_asymp(ei) +test_asymp(e1) +test_asymp(li, huge_range=True) +test_asymp(ci) +test_asymp(si) +test_asymp(chi) +test_asymp(shi) +test_asymp(erf) +test_asymp(erfc) +test_asymp(erfi) +test_asymp(lambda z: besselj(2, z)) +test_asymp(lambda z: bessely(2, z)) +test_asymp(lambda z: besseli(2, z)) +test_asymp(lambda z: besselk(2, z)) +test_asymp(lambda z: besselj(-2.25, z)) +test_asymp(lambda z: bessely(-2.25, z)) +test_asymp(lambda z: besseli(-2.25, z)) +test_asymp(lambda z: besselk(-2.25, z)) +test_asymp(airyai) +test_asymp(airybi) +test_asymp(lambda z: hyp0f1(a1, z)) +test_asymp(lambda z: hyp1f1(a1, a2, z)) +test_asymp(lambda z: hyp1f2(a1, a2, a3, z)) +test_asymp(lambda z: hyp2f0(a1, a2, z)) +test_asymp(lambda z: hyperu(a1, a2, z)) +test_asymp(lambda z: hyp2f1(a1, a2, a3, z)) +test_asymp(lambda z: hyp2f2(a1, a2, a3, a4, z)) +test_asymp(lambda z: hyp2f3(a1, a2, a3, a4, a5, z)) +test_asymp(lambda z: coulombf(a1, a2, z)) +test_asymp(lambda z: coulombg(a1, a2, z)) +test_asymp(lambda z: polylog(2,z)) +test_asymp(lambda z: polylog(3,z)) +test_asymp(lambda z: polylog(-2,z)) +test_asymp(lambda z: expint(4, z)) +test_asymp(lambda z: expint(-4, z)) +test_asymp(lambda z: expint(2.25, z)) +test_asymp(lambda z: gammainc(2.5, z, 5)) +test_asymp(lambda z: gammainc(2.5, 5, z)) +test_asymp(lambda z: hermite(3, z)) +test_asymp(lambda z: hermite(2.5, z)) +test_asymp(lambda z: legendre(3, z)) +test_asymp(lambda z: legendre(4, z)) +test_asymp(lambda z: legendre(2.5, z)) +test_asymp(lambda z: legenp(a1, a2, z)) +test_asymp(lambda z: legenq(a1, a2, z), maxdps=90) # abnormally slow +test_asymp(lambda z: jtheta(1, z, 0.5)) +test_asymp(lambda z: jtheta(2, z, 0.5)) +test_asymp(lambda z: jtheta(3, z, 0.5)) +test_asymp(lambda z: jtheta(4, z, 0.5)) +test_asymp(lambda z: jtheta(1, z, 0.5, 1)) +test_asymp(lambda z: jtheta(2, z, 0.5, 1)) +test_asymp(lambda z: jtheta(3, z, 0.5, 1)) +test_asymp(lambda z: jtheta(4, z, 0.5, 1)) +test_asymp(barnesg, maxdps=90) +""" + +def testit(line): + if filt in line: + print(line) + t1 = clock() + exec_(line, globals(), locals()) + t2 = clock() + elapsed = t2-t1 + print("Time:", elapsed, "for", line, "(OK)") + +if __name__ == '__main__': + try: + from multiprocessing import Pool + mapf = Pool(None).map + print("Running tests with multiprocessing") + except ImportError: + print("Not using multiprocessing") + mapf = map + t1 = clock() + tasks = cases.splitlines() + mapf(testit, tasks) + t2 = clock() + print("Cumulative wall time:", t2-t1) diff --git a/shared/package-files/2c/2c4051a832148f1a9e7986fe3a22fae1f0c23da826615500d2e8f43cc14915c6/multiline_adjlist.py b/shared/package-files/2c/2c4051a832148f1a9e7986fe3a22fae1f0c23da826615500d2e8f43cc14915c6/multiline_adjlist.py new file mode 100644 index 0000000000000000000000000000000000000000..83986851d1dbb4b0a223f6576bffc8df317b2086 --- /dev/null +++ b/shared/package-files/2c/2c4051a832148f1a9e7986fe3a22fae1f0c23da826615500d2e8f43cc14915c6/multiline_adjlist.py @@ -0,0 +1,391 @@ +""" +************************* +Multi-line Adjacency List +************************* +Read and write NetworkX graphs as multi-line adjacency lists. + +The multi-line adjacency list format is useful for graphs with +nodes that can be meaningfully represented as strings. With this format +simple edge data can be stored but node or graph data is not. + +Format +------ +The first label in a line is the source node label followed by the node degree +d. The next d lines are target node labels and optional edge data. +That pattern repeats for all nodes in the graph. + +The graph with edges a-b, a-c, d-e can be represented as the following +adjacency list (anything following the # in a line is a comment):: + + # example.multiline-adjlist + a 2 + b + c + d 1 + e +""" + +__all__ = [ + "generate_multiline_adjlist", + "write_multiline_adjlist", + "parse_multiline_adjlist", + "read_multiline_adjlist", +] + +import networkx as nx +from networkx.utils import open_file + + +def generate_multiline_adjlist(G, delimiter=" "): + """Generate a single line of the graph G in multiline adjacency list format. + + Parameters + ---------- + G : NetworkX graph + + delimiter : string, optional + Separator for node labels + + Returns + ------- + lines : string + Lines of data in multiline adjlist format. + + Examples + -------- + >>> G = nx.lollipop_graph(4, 3) + >>> for line in nx.generate_multiline_adjlist(G): + ... print(line) + 0 3 + 1 {} + 2 {} + 3 {} + 1 2 + 2 {} + 3 {} + 2 1 + 3 {} + 3 1 + 4 {} + 4 1 + 5 {} + 5 1 + 6 {} + 6 0 + + See Also + -------- + write_multiline_adjlist, read_multiline_adjlist + """ + if G.is_directed(): + if G.is_multigraph(): + for s, nbrs in G.adjacency(): + nbr_edges = [ + (u, data) + for u, datadict in nbrs.items() + for key, data in datadict.items() + ] + deg = len(nbr_edges) + yield str(s) + delimiter + str(deg) + for u, d in nbr_edges: + if d is None: + yield str(u) + else: + yield str(u) + delimiter + str(d) + else: # directed single edges + for s, nbrs in G.adjacency(): + deg = len(nbrs) + yield str(s) + delimiter + str(deg) + for u, d in nbrs.items(): + if d is None: + yield str(u) + else: + yield str(u) + delimiter + str(d) + else: # undirected + if G.is_multigraph(): + seen = set() # helper dict used to avoid duplicate edges + for s, nbrs in G.adjacency(): + nbr_edges = [ + (u, data) + for u, datadict in nbrs.items() + if u not in seen + for key, data in datadict.items() + ] + deg = len(nbr_edges) + yield str(s) + delimiter + str(deg) + for u, d in nbr_edges: + if d is None: + yield str(u) + else: + yield str(u) + delimiter + str(d) + seen.add(s) + else: # undirected single edges + seen = set() # helper dict used to avoid duplicate edges + for s, nbrs in G.adjacency(): + nbr_edges = [(u, d) for u, d in nbrs.items() if u not in seen] + deg = len(nbr_edges) + yield str(s) + delimiter + str(deg) + for u, d in nbr_edges: + if d is None: + yield str(u) + else: + yield str(u) + delimiter + str(d) + seen.add(s) + + +@open_file(1, mode="wb") +def write_multiline_adjlist(G, path, delimiter=" ", comments="#", encoding="utf-8"): + """Write the graph G in multiline adjacency list format to path + + Parameters + ---------- + G : NetworkX graph + + path : string or file + Filename or file handle to write to. + Filenames ending in .gz or .bz2 will be compressed. + + comments : string, optional + Marker for comment lines + + delimiter : string, optional + Separator for node labels + + encoding : string, optional + Text encoding. + + Examples + -------- + >>> G = nx.path_graph(4) + >>> nx.write_multiline_adjlist(G, "test.adjlist") + + The path can be a file handle or a string with the name of the file. If a + file handle is provided, it has to be opened in 'wb' mode. + + >>> fh = open("test.adjlist", "wb") + >>> nx.write_multiline_adjlist(G, fh) + + Filenames ending in .gz or .bz2 will be compressed. + + >>> nx.write_multiline_adjlist(G, "test.adjlist.gz") + + See Also + -------- + read_multiline_adjlist + """ + import sys + import time + + pargs = comments + " ".join(sys.argv) + header = ( + f"{pargs}\n" + + comments + + f" GMT {time.asctime(time.gmtime())}\n" + + comments + + f" {G.name}\n" + ) + path.write(header.encode(encoding)) + + for multiline in generate_multiline_adjlist(G, delimiter): + multiline += "\n" + path.write(multiline.encode(encoding)) + + +def parse_multiline_adjlist( + lines, comments="#", delimiter=None, create_using=None, nodetype=None, edgetype=None +): + """Parse lines of a multiline adjacency list representation of a graph. + + Parameters + ---------- + lines : list or iterator of strings + Input data in multiline adjlist format + + create_using : NetworkX graph constructor, optional (default=nx.Graph) + Graph type to create. If graph instance, then cleared before populated. + + nodetype : Python type, optional + Convert nodes to this type. + + edgetype : Python type, optional + Convert edges to this type. + + comments : string, optional + Marker for comment lines + + delimiter : string, optional + Separator for node labels. The default is whitespace. + + Returns + ------- + G: NetworkX graph + The graph corresponding to the lines in multiline adjacency list format. + + Examples + -------- + >>> lines = [ + ... "1 2", + ... "2 {'weight':3, 'name': 'Frodo'}", + ... "3 {}", + ... "2 1", + ... "5 {'weight':6, 'name': 'Saruman'}", + ... ] + >>> G = nx.parse_multiline_adjlist(iter(lines), nodetype=int) + >>> list(G) + [1, 2, 3, 5] + + """ + from ast import literal_eval + + G = nx.empty_graph(0, create_using) + for line in lines: + p = line.find(comments) + if p >= 0: + line = line[:p] + if not line: + continue + try: + (u, deg) = line.strip().split(delimiter) + deg = int(deg) + except BaseException as err: + raise TypeError(f"Failed to read node and degree on line ({line})") from err + if nodetype is not None: + try: + u = nodetype(u) + except BaseException as err: + raise TypeError( + f"Failed to convert node ({u}) to " f"type {nodetype}" + ) from err + G.add_node(u) + for i in range(deg): + while True: + try: + line = next(lines) + except StopIteration as err: + msg = f"Failed to find neighbor for node ({u})" + raise TypeError(msg) from err + p = line.find(comments) + if p >= 0: + line = line[:p] + if line: + break + vlist = line.strip().split(delimiter) + numb = len(vlist) + if numb < 1: + continue # isolated node + v = vlist.pop(0) + data = "".join(vlist) + if nodetype is not None: + try: + v = nodetype(v) + except BaseException as err: + raise TypeError( + f"Failed to convert node ({v}) " f"to type {nodetype}" + ) from err + if edgetype is not None: + try: + edgedata = {"weight": edgetype(data)} + except BaseException as err: + raise TypeError( + f"Failed to convert edge data ({data}) " f"to type {edgetype}" + ) from err + else: + try: # try to evaluate + edgedata = literal_eval(data) + except: + edgedata = {} + G.add_edge(u, v, **edgedata) + + return G + + +@open_file(0, mode="rb") +def read_multiline_adjlist( + path, + comments="#", + delimiter=None, + create_using=None, + nodetype=None, + edgetype=None, + encoding="utf-8", +): + """Read graph in multi-line adjacency list format from path. + + Parameters + ---------- + path : string or file + Filename or file handle to read. + Filenames ending in .gz or .bz2 will be uncompressed. + + create_using : NetworkX graph constructor, optional (default=nx.Graph) + Graph type to create. If graph instance, then cleared before populated. + + nodetype : Python type, optional + Convert nodes to this type. + + edgetype : Python type, optional + Convert edge data to this type. + + comments : string, optional + Marker for comment lines + + delimiter : string, optional + Separator for node labels. The default is whitespace. + + Returns + ------- + G: NetworkX graph + + Examples + -------- + >>> G = nx.path_graph(4) + >>> nx.write_multiline_adjlist(G, "test.adjlist") + >>> G = nx.read_multiline_adjlist("test.adjlist") + + The path can be a file or a string with the name of the file. If a + file s provided, it has to be opened in 'rb' mode. + + >>> fh = open("test.adjlist", "rb") + >>> G = nx.read_multiline_adjlist(fh) + + Filenames ending in .gz or .bz2 will be compressed. + + >>> nx.write_multiline_adjlist(G, "test.adjlist.gz") + >>> G = nx.read_multiline_adjlist("test.adjlist.gz") + + The optional nodetype is a function to convert node strings to nodetype. + + For example + + >>> G = nx.read_multiline_adjlist("test.adjlist", nodetype=int) + + will attempt to convert all nodes to integer type. + + The optional edgetype is a function to convert edge data strings to + edgetype. + + >>> G = nx.read_multiline_adjlist("test.adjlist") + + The optional create_using parameter is a NetworkX graph container. + The default is Graph(), an undirected graph. To read the data as + a directed graph use + + >>> G = nx.read_multiline_adjlist("test.adjlist", create_using=nx.DiGraph) + + Notes + ----- + This format does not store graph, node, or edge data. + + See Also + -------- + write_multiline_adjlist + """ + lines = (line.decode(encoding) for line in path) + return parse_multiline_adjlist( + lines, + comments=comments, + delimiter=delimiter, + create_using=create_using, + nodetype=nodetype, + edgetype=edgetype, + ) diff --git a/shared/package-files/2c/2c4474c9ff32dfd5960f7591dbbabf9c93179403fab5ffb4dba59b4b7891207b/LegacyBatchedTensorImpl.h b/shared/package-files/2c/2c4474c9ff32dfd5960f7591dbbabf9c93179403fab5ffb4dba59b4b7891207b/LegacyBatchedTensorImpl.h new file mode 100644 index 0000000000000000000000000000000000000000..098fbf9d6292fdeb0fff5e3786b471b742540723 --- /dev/null +++ b/shared/package-files/2c/2c4474c9ff32dfd5960f7591dbbabf9c93179403fab5ffb4dba59b4b7891207b/LegacyBatchedTensorImpl.h @@ -0,0 +1,160 @@ +#pragma once + +#include + +#include +#include +#include + +namespace at { + +// We assume this in a few other places in the codebase, +// but there isn't a centralized definition. +constexpr int64_t kVmapMaxTensorDims = 64; + +// The valid vmap levels range from [0, 64). This effectively means that we +// support a maximum of 64 nested vmaps. +constexpr int64_t kVmapNumLevels = 64; + +// Store this number of elements of BatchDims on the stack. Most people will +// probably use <= 5 nested vmaps, but adjust this number as necessary. +constexpr int64_t kBatchDimsStackSize = 5; + +// a BatchDim represents a "private" dimension on a Tensor created inside of +// vmap. It is a (level, dim) tuple, with the `dim` indicating which dimension +// is being vmap'ed over and the `level` being an identifier for which vmap +// said dimension was created inside. The `dim` corresponds to a "physical +// dim" - it is a dimension index on the underlying physical tensor that is +// being vmapped over. +struct BatchDim { + BatchDim(int64_t level, int64_t dim) : dim_(dim), level_(level) {} + int64_t dim() const { + return dim_; + } + int64_t level() const { + return level_; + } + + private: + int64_t dim_; + int64_t level_; +}; + +using BatchDims = SmallVector; +using BatchDimsRef = ArrayRef; + +// A BatchedTensorImpl holds an underlying Tensor and a list of BatchDim +// NB: We use the term "BatchedTensor" to mean a Tensor that is backed with a +// BatchedTensorImpl. +// +// The batch dimensions are treated as being "private"; they are not +// user-visible. For example, in the following Tensor, +// bt = BatchedTensorImpl(ones(2, 3, 5, 7), [(lvl=1, dim=0), (lvl=2, dim=1)]) +// dimensions 0 and 1 are batch dimensions. +// +// bt.sizes() returns (5, 7); bt.sum(0) performs a reduction over the (public) +// dim 0, which is equivalent to dim 3 in the underlying ones(2, 3, 5, 7) +// tensor. +struct TORCH_API BatchedTensorImpl : public c10::TensorImpl { + explicit BatchedTensorImpl(Tensor value, BatchDims bdims); + + // Returns a reference to BatchDims that represent which dimensions of this + // tensor are private. + BatchDimsRef bdims() const { + return bdims_; + } + + // BatchedTensorImpl wraps a Tensor + const Tensor& value() const { + return value_; + }; + + // Given a public dimension index, return the dimension index in the + // underlying value() tensor. For example, if we have + // bt = BatchedTensorImpl(ones(2, 3, 5, 7), [(lvl=1, dim=0), (lvl=2, + // dim=2)]) + // bt.actualDim(0) -> 1 + // bt.actualDim(1) -> 3 + // bt.actualDim(2) -> Error + int64_t actualDim(int64_t dim, bool wrap_dim = true) const; + + // We have to override this because we opted into CustomStrides + IntArrayRef strides_custom() const override; + // Override a bunch of methods inherited from TensorImpl to return error + // messages. + bool is_contiguous_custom(at::MemoryFormat memory_format) const override; + void set_size(int64_t dim, int64_t new_size) override; + void set_stride(int64_t dim, int64_t new_stride) override; + void set_storage_offset(int64_t storage_offset) override; +#ifdef DEBUG + bool has_storage() const override; +#endif + + private: + // see NOTE: [BatchedTensorImpl levels invariant] + void checkInvariants() const; + const char* tensorimpl_type_name() const override; + + Tensor value_; + + // Note: [BatchedTensorImpl levels invariant] + // There is an invariant that the BatchDims must be stored in increasing + // `level` order. That is, for i < j, bdims_[i].level must be less than + // bdims_[j].level. + BatchDims bdims_; +}; + +// NB: We use the term "BatchedTensor" to mean a Tensor that is backed with a +// BatchedTensorImpl. +inline bool isBatchedTensor(const Tensor& tensor) { + return tensor.unsafeGetTensorImpl()->key_set().has(DispatchKey::Batched); +} + +// It is unsafe to call this on a Tensor that is not backed by a +// BatchedTensorImpl. Please use `maybeGetBatchedImpl` whenever possible. +inline BatchedTensorImpl* unsafeGetBatchedImpl(const Tensor& tensor) { + return static_cast(tensor.unsafeGetTensorImpl()); +} + +inline BatchedTensorImpl* maybeGetBatchedImpl(const Tensor& tensor) { + if (!isBatchedTensor(tensor)) { + return nullptr; + } + return unsafeGetBatchedImpl(tensor); +} + +// Returns a bitset. If bit i is set, then that means dim i is a batchdim. +inline std::bitset createBatchDimBitset( + BatchDimsRef bdims) { + std::bitset is_bdim; + for (const auto& bdim : bdims) { + is_bdim.set(bdim.dim()); + } + return is_bdim; +} + +// Creates a bitset for all of the levels present in `bdims` +inline std::bitset createVmapLevelsBitset(BatchDimsRef bdims) { + std::bitset result; + for (const auto& bdim : bdims) { + result.set(bdim.level()); + } + return result; +} + +inline std::ostream& operator<<(std::ostream& out, const BatchDim& bdim) { + out << "(lvl=" << bdim.level() << ", dim=" << bdim.dim() << ")"; + return out; +} + +// Use this to construct a BatchedTensor from a regular Tensor +TORCH_API Tensor makeBatched(const Tensor& tensor, BatchDims bdims); + +// Adds a batch dim to `tensor`, returning a BatchedTensor +TORCH_API Tensor addBatchDim(const Tensor& tensor, int64_t level, int64_t dim); + +// Checks if an inplace operation on self and other is "vmap compatible". +// See NOTE: [vmap-incompatible in-place operations] for the definition of this. +TORCH_API bool inplaceIsVmapCompatible(const Tensor& self, const Tensor& other); + +} // namespace at diff --git a/shared/package-files/2c/2c48a304492fe496d30659fa202922f2afa80797f0604eed59d26ef80fe8fa46/_sparse_csr_tensor_unsafe_native.h b/shared/package-files/2c/2c48a304492fe496d30659fa202922f2afa80797f0604eed59d26ef80fe8fa46/_sparse_csr_tensor_unsafe_native.h new file mode 100644 index 0000000000000000000000000000000000000000..707fca2f3a77d51ae08cf3402e8ae658d5b6fe8f --- /dev/null +++ b/shared/package-files/2c/2c48a304492fe496d30659fa202922f2afa80797f0604eed59d26ef80fe8fa46/_sparse_csr_tensor_unsafe_native.h @@ -0,0 +1,21 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor _sparse_csr_tensor_unsafe(const at::Tensor & crow_indices, const at::Tensor & col_indices, const at::Tensor & values, at::IntArrayRef size, c10::optional dtype={}, c10::optional layout={}, c10::optional device={}, c10::optional pin_memory={}); +} // namespace native +} // namespace at diff --git a/shared/package-files/2c/2c4c639a104dc05c46fc47d8b82a18f84e3ee1cbaa5f9615e5812fddc07171fe/unicode.py b/shared/package-files/2c/2c4c639a104dc05c46fc47d8b82a18f84e3ee1cbaa5f9615e5812fddc07171fe/unicode.py new file mode 100644 index 0000000000000000000000000000000000000000..7d11ea59c2e645296a2ee53c93b9395f9d99dc5f --- /dev/null +++ b/shared/package-files/2c/2c4c639a104dc05c46fc47d8b82a18f84e3ee1cbaa5f9615e5812fddc07171fe/unicode.py @@ -0,0 +1,2672 @@ +import sys +import operator + +import numpy as np +from llvmlite.ir import IntType, Constant + +from numba.core.cgutils import is_nonelike +from numba.core.extending import ( + models, + register_model, + make_attribute_wrapper, + unbox, + box, + NativeValue, + overload, + overload_method, + intrinsic, + register_jitable, +) +from numba.core.imputils import (lower_constant, lower_cast, lower_builtin, + iternext_impl, impl_ret_new_ref, RefType) +from numba.core.datamodel import register_default, StructModel +from numba.core import types, cgutils +from numba.core.utils import PYVERSION +from numba.core.pythonapi import ( + PY_UNICODE_1BYTE_KIND, + PY_UNICODE_2BYTE_KIND, + PY_UNICODE_4BYTE_KIND, +) +from numba._helperlib import c_helpers +from numba.cpython.hashing import _Py_hash_t +from numba.core.unsafe.bytes import memcpy_region +from numba.core.errors import TypingError +from numba.cpython.unicode_support import (_Py_TOUPPER, _Py_TOLOWER, _Py_UCS4, + _Py_ISALNUM, + _PyUnicode_ToUpperFull, + _PyUnicode_ToLowerFull, + _PyUnicode_ToFoldedFull, + _PyUnicode_ToTitleFull, + _PyUnicode_IsPrintable, + _PyUnicode_IsSpace, + _Py_ISSPACE, + _PyUnicode_IsXidStart, + _PyUnicode_IsXidContinue, + _PyUnicode_IsCased, + _PyUnicode_IsCaseIgnorable, + _PyUnicode_IsUppercase, + _PyUnicode_IsLowercase, + _PyUnicode_IsLineBreak, + _Py_ISLINEBREAK, + _Py_ISLINEFEED, + _Py_ISCARRIAGERETURN, + _PyUnicode_IsTitlecase, + _Py_ISLOWER, + _Py_ISUPPER, + _Py_TAB, + _Py_LINEFEED, + _Py_CARRIAGE_RETURN, + _Py_SPACE, + _PyUnicode_IsAlpha, + _PyUnicode_IsNumeric, + _Py_ISALPHA, + _PyUnicode_IsDigit, + _PyUnicode_IsDecimalDigit) +from numba.cpython import slicing + +if PYVERSION in ((3, 10), (3, 11)): + from numba.core.pythonapi import PY_UNICODE_WCHAR_KIND + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L84-L85 # noqa: E501 +_MAX_UNICODE = 0x10ffff + +# https://github.com/python/cpython/blob/1960eb005e04b7ad8a91018088cfdb0646bc1ca0/Objects/stringlib/fastsearch.h#L31 # noqa: E501 +_BLOOM_WIDTH = types.intp.bitwidth + +# DATA MODEL + + +@register_model(types.UnicodeType) +class UnicodeModel(models.StructModel): + def __init__(self, dmm, fe_type): + members = [ + ('data', types.voidptr), + ('length', types.intp), + ('kind', types.int32), + ('is_ascii', types.uint32), + ('hash', _Py_hash_t), + ('meminfo', types.MemInfoPointer(types.voidptr)), + # A pointer to the owner python str/unicode object + ('parent', types.pyobject), + ] + models.StructModel.__init__(self, dmm, fe_type, members) + + +make_attribute_wrapper(types.UnicodeType, 'data', '_data') +make_attribute_wrapper(types.UnicodeType, 'length', '_length') +make_attribute_wrapper(types.UnicodeType, 'kind', '_kind') +make_attribute_wrapper(types.UnicodeType, 'is_ascii', '_is_ascii') +make_attribute_wrapper(types.UnicodeType, 'hash', '_hash') + + +@register_default(types.UnicodeIteratorType) +class UnicodeIteratorModel(StructModel): + def __init__(self, dmm, fe_type): + members = [('index', types.EphemeralPointer(types.uintp)), + ('data', fe_type.data)] + super(UnicodeIteratorModel, self).__init__(dmm, fe_type, members) + +# CAST + + +def compile_time_get_string_data(obj): + """Get string data from a python string for use at compile-time to embed + the string data into the LLVM module. + """ + from ctypes import ( + CFUNCTYPE, c_void_p, c_int, c_uint, c_ssize_t, c_ubyte, py_object, + POINTER, byref, + ) + + extract_unicode_fn = c_helpers['extract_unicode'] + proto = CFUNCTYPE(c_void_p, py_object, POINTER(c_ssize_t), POINTER(c_int), + POINTER(c_uint), POINTER(c_ssize_t)) + fn = proto(extract_unicode_fn) + length = c_ssize_t() + kind = c_int() + is_ascii = c_uint() + hashv = c_ssize_t() + data = fn(obj, byref(length), byref(kind), byref(is_ascii), byref(hashv)) + if data is None: + raise ValueError("cannot extract unicode data from the given string") + length = length.value + kind = kind.value + is_ascii = is_ascii.value + nbytes = (length + 1) * _kind_to_byte_width(kind) + out = (c_ubyte * nbytes).from_address(data) + return bytes(out), length, kind, is_ascii, hashv.value + + +def make_string_from_constant(context, builder, typ, literal_string): + """ + Get string data by `compile_time_get_string_data()` and return a + unicode_type LLVM value + """ + databytes, length, kind, is_ascii, hashv = \ + compile_time_get_string_data(literal_string) + mod = builder.module + gv = context.insert_const_bytes(mod, databytes) + uni_str = cgutils.create_struct_proxy(typ)(context, builder) + uni_str.data = gv + uni_str.length = uni_str.length.type(length) + uni_str.kind = uni_str.kind.type(kind) + uni_str.is_ascii = uni_str.is_ascii.type(is_ascii) + # Set hash to -1 to indicate that it should be computed. + # We cannot bake in the hash value because of hashseed randomization. + uni_str.hash = uni_str.hash.type(-1) + return uni_str._getvalue() + + +@lower_cast(types.StringLiteral, types.unicode_type) +def cast_from_literal(context, builder, fromty, toty, val): + return make_string_from_constant( + context, builder, toty, fromty.literal_value, + ) + + +# CONSTANT + +@lower_constant(types.unicode_type) +def constant_unicode(context, builder, typ, pyval): + return make_string_from_constant(context, builder, typ, pyval) + + +# BOXING + + +@unbox(types.UnicodeType) +def unbox_unicode_str(typ, obj, c): + """ + Convert a unicode str object to a native unicode structure. + """ + ok, data, length, kind, is_ascii, hashv = \ + c.pyapi.string_as_string_size_and_kind(obj) + uni_str = cgutils.create_struct_proxy(typ)(c.context, c.builder) + uni_str.data = data + uni_str.length = length + uni_str.kind = kind + uni_str.is_ascii = is_ascii + uni_str.hash = hashv + uni_str.meminfo = c.pyapi.nrt_meminfo_new_from_pyobject( + data, # the borrowed data pointer + obj, # the owner pyobject; the call will incref it. + ) + uni_str.parent = obj + + is_error = cgutils.is_not_null(c.builder, c.pyapi.err_occurred()) + return NativeValue(uni_str._getvalue(), is_error=is_error) + + +@box(types.UnicodeType) +def box_unicode_str(typ, val, c): + """ + Convert a native unicode structure to a unicode string + """ + uni_str = cgutils.create_struct_proxy(typ)(c.context, c.builder, value=val) + res = c.pyapi.string_from_kind_and_data( + uni_str.kind, uni_str.data, uni_str.length) + # hash isn't needed now, just compute it so it ends up in the unicodeobject + # hash cache, cpython doesn't always do this, depends how a string was + # created it's safe, just burns the cycles required to hash on @box + c.pyapi.object_hash(res) + c.context.nrt.decref(c.builder, typ, val) + return res + + +# HELPER FUNCTIONS + + +def make_deref_codegen(bitsize): + def codegen(context, builder, signature, args): + data, idx = args + ptr = builder.bitcast(data, IntType(bitsize).as_pointer()) + ch = builder.load(builder.gep(ptr, [idx])) + return builder.zext(ch, IntType(32)) + + return codegen + + +@intrinsic +def deref_uint8(typingctx, data, offset): + sig = types.uint32(types.voidptr, types.intp) + return sig, make_deref_codegen(8) + + +@intrinsic +def deref_uint16(typingctx, data, offset): + sig = types.uint32(types.voidptr, types.intp) + return sig, make_deref_codegen(16) + + +@intrinsic +def deref_uint32(typingctx, data, offset): + sig = types.uint32(types.voidptr, types.intp) + return sig, make_deref_codegen(32) + + +@intrinsic +def _malloc_string(typingctx, kind, char_bytes, length, is_ascii): + """make empty string with data buffer of size alloc_bytes. + + Must set length and kind values for string after it is returned + """ + def details(context, builder, signature, args): + [kind_val, char_bytes_val, length_val, is_ascii_val] = args + + # fill the struct + uni_str_ctor = cgutils.create_struct_proxy(types.unicode_type) + uni_str = uni_str_ctor(context, builder) + # add null padding character + nbytes_val = builder.mul(char_bytes_val, + builder.add(length_val, + Constant(length_val.type, 1))) + uni_str.meminfo = context.nrt.meminfo_alloc(builder, nbytes_val) + uni_str.kind = kind_val + uni_str.is_ascii = is_ascii_val + uni_str.length = length_val + # empty string has hash value -1 to indicate "need to compute hash" + uni_str.hash = context.get_constant(_Py_hash_t, -1) + uni_str.data = context.nrt.meminfo_data(builder, uni_str.meminfo) + # Set parent to NULL + uni_str.parent = cgutils.get_null_value(uni_str.parent.type) + return uni_str._getvalue() + + sig = types.unicode_type(types.int32, types.intp, types.intp, types.uint32) + return sig, details + + +@register_jitable +def _empty_string(kind, length, is_ascii=0): + char_width = _kind_to_byte_width(kind) + s = _malloc_string(kind, char_width, length, is_ascii) + _set_code_point(s, length, np.uint32(0)) # Write NULL character + return s + + +# Disable RefCt for performance. +@register_jitable(_nrt=False) +def _get_code_point(a, i): + if a._kind == PY_UNICODE_1BYTE_KIND: + return deref_uint8(a._data, i) + elif a._kind == PY_UNICODE_2BYTE_KIND: + return deref_uint16(a._data, i) + elif a._kind == PY_UNICODE_4BYTE_KIND: + return deref_uint32(a._data, i) + else: + # there's also a wchar kind, but that's one of the above, + # so skipping for this example + return 0 + +#### + + +def make_set_codegen(bitsize): + def codegen(context, builder, signature, args): + data, idx, ch = args + if bitsize < 32: + ch = builder.trunc(ch, IntType(bitsize)) + ptr = builder.bitcast(data, IntType(bitsize).as_pointer()) + builder.store(ch, builder.gep(ptr, [idx])) + return context.get_dummy_value() + + return codegen + + +@intrinsic +def set_uint8(typingctx, data, idx, ch): + sig = types.void(types.voidptr, types.int64, types.uint32) + return sig, make_set_codegen(8) + + +@intrinsic +def set_uint16(typingctx, data, idx, ch): + sig = types.void(types.voidptr, types.int64, types.uint32) + return sig, make_set_codegen(16) + + +@intrinsic +def set_uint32(typingctx, data, idx, ch): + sig = types.void(types.voidptr, types.int64, types.uint32) + return sig, make_set_codegen(32) + + +@register_jitable(_nrt=False) +def _set_code_point(a, i, ch): + # WARNING: This method is very dangerous: + # * Assumes that data contents can be changed (only allowed for new + # strings) + # * Assumes that the kind of unicode string is sufficiently wide to + # accept ch. Will truncate ch to make it fit. + # * Assumes that i is within the valid boundaries of the function + if a._kind == PY_UNICODE_1BYTE_KIND: + set_uint8(a._data, i, ch) + elif a._kind == PY_UNICODE_2BYTE_KIND: + set_uint16(a._data, i, ch) + elif a._kind == PY_UNICODE_4BYTE_KIND: + set_uint32(a._data, i, ch) + else: + raise AssertionError( + "Unexpected unicode representation in _set_code_point") + + +if PYVERSION in ((3, 12), (3, 13), (3, 14), (3, 15)): + @register_jitable + def _pick_kind(kind1, kind2): + if kind1 == PY_UNICODE_1BYTE_KIND: + return kind2 + elif kind1 == PY_UNICODE_2BYTE_KIND: + if kind2 == PY_UNICODE_4BYTE_KIND: + return kind2 + else: + return kind1 + elif kind1 == PY_UNICODE_4BYTE_KIND: + return kind1 + else: + raise AssertionError( + "Unexpected unicode representation in _pick_kind") +elif PYVERSION in ((3, 10), (3, 11)): + @register_jitable + def _pick_kind(kind1, kind2): + if (kind1 == PY_UNICODE_WCHAR_KIND or kind2 == PY_UNICODE_WCHAR_KIND): + raise AssertionError("PY_UNICODE_WCHAR_KIND unsupported") + + if kind1 == PY_UNICODE_1BYTE_KIND: + return kind2 + elif kind1 == PY_UNICODE_2BYTE_KIND: + if kind2 == PY_UNICODE_4BYTE_KIND: + return kind2 + else: + return kind1 + elif kind1 == PY_UNICODE_4BYTE_KIND: + return kind1 + else: + raise AssertionError( + "Unexpected unicode representation in _pick_kind") +else: + raise NotImplementedError(PYVERSION) + + +@register_jitable +def _pick_ascii(is_ascii1, is_ascii2): + if is_ascii1 == 1 and is_ascii2 == 1: + return types.uint32(1) + return types.uint32(0) + + +if PYVERSION in ((3, 12), (3, 13), (3, 14), (3, 15)): + @register_jitable + def _kind_to_byte_width(kind): + if kind == PY_UNICODE_1BYTE_KIND: + return 1 + elif kind == PY_UNICODE_2BYTE_KIND: + return 2 + elif kind == PY_UNICODE_4BYTE_KIND: + return 4 + else: + raise AssertionError("Unexpected unicode encoding encountered") +elif PYVERSION in ((3, 10), (3, 11)): + @register_jitable + def _kind_to_byte_width(kind): + if kind == PY_UNICODE_1BYTE_KIND: + return 1 + elif kind == PY_UNICODE_2BYTE_KIND: + return 2 + elif kind == PY_UNICODE_4BYTE_KIND: + return 4 + elif kind == PY_UNICODE_WCHAR_KIND: + raise AssertionError("PY_UNICODE_WCHAR_KIND unsupported") + else: + raise AssertionError("Unexpected unicode encoding encountered") +else: + raise NotImplementedError(PYVERSION) + + +@register_jitable(_nrt=False) +def _cmp_region(a, a_offset, b, b_offset, n): + if n == 0: + return 0 + elif a_offset + n > a._length: + return -1 + elif b_offset + n > b._length: + return 1 + + for i in range(n): + a_chr = _get_code_point(a, a_offset + i) + b_chr = _get_code_point(b, b_offset + i) + if a_chr < b_chr: + return -1 + elif a_chr > b_chr: + return 1 + + return 0 + + +@register_jitable +def _codepoint_to_kind(cp): + """ + Compute the minimum unicode kind needed to hold a given codepoint + """ + if cp < 256: + return PY_UNICODE_1BYTE_KIND + elif cp < 65536: + return PY_UNICODE_2BYTE_KIND + else: + # Maximum code point of Unicode 6.0: 0x10ffff (1,114,111) + MAX_UNICODE = 0x10ffff + if cp > MAX_UNICODE: + msg = "Invalid codepoint. Found value greater than Unicode maximum" + raise ValueError(msg) + return PY_UNICODE_4BYTE_KIND + + +@register_jitable +def _codepoint_is_ascii(ch): + """ + Returns true if a codepoint is in the ASCII range + """ + return ch < 128 + + +# PUBLIC API + + +@overload(len) +def unicode_len(s): + if isinstance(s, types.UnicodeType): + def len_impl(s): + return s._length + return len_impl + + +@overload(operator.eq) +def unicode_eq(a, b): + if not (a.is_internal and b.is_internal): + return + if isinstance(a, types.Optional): + check_a = a.type + else: + check_a = a + if isinstance(b, types.Optional): + check_b = b.type + else: + check_b = b + accept = (types.UnicodeType, types.StringLiteral, types.UnicodeCharSeq) + a_unicode = isinstance(check_a, accept) + b_unicode = isinstance(check_b, accept) + if a_unicode and b_unicode: + def eq_impl(a, b): + # handle Optionals at runtime + a_none = a is None + b_none = b is None + if a_none or b_none: + if a_none and b_none: + return True + else: + return False + # the str() is for UnicodeCharSeq, it's a nop else + a = str(a) + b = str(b) + if len(a) != len(b): + return False + return _cmp_region(a, 0, b, 0, len(a)) == 0 + return eq_impl + elif a_unicode ^ b_unicode: + # one of the things is unicode, everything compares False + def eq_impl(a, b): + return False + return eq_impl + + +@overload(operator.ne) +def unicode_ne(a, b): + if not (a.is_internal and b.is_internal): + return + accept = (types.UnicodeType, types.StringLiteral, types.UnicodeCharSeq) + a_unicode = isinstance(a, accept) + b_unicode = isinstance(b, accept) + if a_unicode and b_unicode: + def ne_impl(a, b): + return not (a == b) + return ne_impl + elif a_unicode ^ b_unicode: + # one of the things is unicode, everything compares True + def eq_impl(a, b): + return True + return eq_impl + + +@overload(operator.lt) +def unicode_lt(a, b): + a_unicode = isinstance(a, (types.UnicodeType, types.StringLiteral)) + b_unicode = isinstance(b, (types.UnicodeType, types.StringLiteral)) + if a_unicode and b_unicode: + def lt_impl(a, b): + minlen = min(len(a), len(b)) + eqcode = _cmp_region(a, 0, b, 0, minlen) + if eqcode == -1: + return True + elif eqcode == 0: + return len(a) < len(b) + return False + return lt_impl + + +@overload(operator.gt) +def unicode_gt(a, b): + a_unicode = isinstance(a, (types.UnicodeType, types.StringLiteral)) + b_unicode = isinstance(b, (types.UnicodeType, types.StringLiteral)) + if a_unicode and b_unicode: + def gt_impl(a, b): + minlen = min(len(a), len(b)) + eqcode = _cmp_region(a, 0, b, 0, minlen) + if eqcode == 1: + return True + elif eqcode == 0: + return len(a) > len(b) + return False + return gt_impl + + +@overload(operator.le) +def unicode_le(a, b): + a_unicode = isinstance(a, (types.UnicodeType, types.StringLiteral)) + b_unicode = isinstance(b, (types.UnicodeType, types.StringLiteral)) + if a_unicode and b_unicode: + def le_impl(a, b): + return not (a > b) + return le_impl + + +@overload(operator.ge) +def unicode_ge(a, b): + a_unicode = isinstance(a, (types.UnicodeType, types.StringLiteral)) + b_unicode = isinstance(b, (types.UnicodeType, types.StringLiteral)) + if a_unicode and b_unicode: + def ge_impl(a, b): + return not (a < b) + return ge_impl + + +@overload(operator.contains) +def unicode_contains(a, b): + if isinstance(a, types.UnicodeType) and isinstance(b, types.UnicodeType): + def contains_impl(a, b): + # note parameter swap: contains(a, b) == b in a + return _find(a, b) > -1 + return contains_impl + + +def unicode_idx_check_type(ty, name): + """Check object belongs to one of specific types + ty: type + Type of the object + name: str + Name of the object + """ + thety = ty + # if the type is omitted, the concrete type is the value + if isinstance(ty, types.Omitted): + thety = ty.value + # if the type is optional, the concrete type is the captured type + elif isinstance(ty, types.Optional): + thety = ty.type + + accepted = (types.Integer, types.NoneType) + if thety is not None and not isinstance(thety, accepted): + raise TypingError('"{}" must be {}, not {}'.format(name, accepted, ty)) + + +def unicode_sub_check_type(ty, name): + """Check object belongs to unicode type""" + if not isinstance(ty, types.UnicodeType): + msg = '"{}" must be {}, not {}'.format(name, types.UnicodeType, ty) + raise TypingError(msg) + + +# FAST SEARCH algorithm implementation from cpython + +@register_jitable +def _bloom_add(mask, ch): + mask |= (1 << (ch & (_BLOOM_WIDTH - 1))) + return mask + + +@register_jitable +def _bloom_check(mask, ch): + return mask & (1 << (ch & (_BLOOM_WIDTH - 1))) + + +# https://github.com/python/cpython/blob/1960eb005e04b7ad8a91018088cfdb0646bc1ca0/Objects/stringlib/fastsearch.h#L550 # noqa: E501 +@register_jitable +def _default_find(data, substr, start, end): + """Left finder.""" + m = len(substr) + if m == 0: + return start + + gap = mlast = m - 1 + last = _get_code_point(substr, mlast) + + zero = types.intp(0) + mask = _bloom_add(zero, last) + for i in range(mlast): + ch = _get_code_point(substr, i) + mask = _bloom_add(mask, ch) + if ch == last: + gap = mlast - i - 1 + + i = start + while i <= end - m: + ch = _get_code_point(data, mlast + i) + if ch == last: + j = 0 + while j < mlast: + haystack_ch = _get_code_point(data, i + j) + needle_ch = _get_code_point(substr, j) + if haystack_ch != needle_ch: + break + j += 1 + if j == mlast: + # got a match + return i + + ch = _get_code_point(data, mlast + i + 1) + if _bloom_check(mask, ch) == 0: + i += m + else: + i += gap + else: + ch = _get_code_point(data, mlast + i + 1) + if _bloom_check(mask, ch) == 0: + i += m + i += 1 + + return -1 + + +@register_jitable +def _default_rfind(data, substr, start, end): + """Right finder.""" + m = len(substr) + if m == 0: + return end + + skip = mlast = m - 1 + mfirst = _get_code_point(substr, 0) + mask = _bloom_add(0, mfirst) + i = mlast + while i > 0: + ch = _get_code_point(substr, i) + mask = _bloom_add(mask, ch) + if ch == mfirst: + skip = i - 1 + i -= 1 + + i = end - m + while i >= start: + ch = _get_code_point(data, i) + if ch == mfirst: + j = mlast + while j > 0: + haystack_ch = _get_code_point(data, i + j) + needle_ch = _get_code_point(substr, j) + if haystack_ch != needle_ch: + break + j -= 1 + + if j == 0: + # got a match + return i + + ch = _get_code_point(data, i - 1) + if i > start and _bloom_check(mask, ch) == 0: + i -= m + else: + i -= skip + + else: + ch = _get_code_point(data, i - 1) + if i > start and _bloom_check(mask, ch) == 0: + i -= m + i -= 1 + + return -1 + + +def generate_finder(find_func): + """Generate finder either left or right.""" + def impl(data, substr, start=None, end=None): + length = len(data) + sub_length = len(substr) + if start is None: + start = 0 + if end is None: + end = length + + start, end = _adjust_indices(length, start, end) + if end - start < sub_length: + return -1 + + return find_func(data, substr, start, end) + + return impl + + +_find = register_jitable(generate_finder(_default_find)) +_rfind = register_jitable(generate_finder(_default_rfind)) + + +@overload_method(types.UnicodeType, 'find') +def unicode_find(data, substr, start=None, end=None): + """Implements str.find()""" + if isinstance(substr, types.UnicodeCharSeq): + def find_impl(data, substr, start=None, end=None): + return data.find(str(substr)) + return find_impl + + unicode_idx_check_type(start, 'start') + unicode_idx_check_type(end, 'end') + unicode_sub_check_type(substr, 'substr') + + return _find + + +@overload_method(types.UnicodeType, 'rfind') +def unicode_rfind(data, substr, start=None, end=None): + """Implements str.rfind()""" + if isinstance(substr, types.UnicodeCharSeq): + def rfind_impl(data, substr, start=None, end=None): + return data.rfind(str(substr)) + return rfind_impl + + unicode_idx_check_type(start, 'start') + unicode_idx_check_type(end, 'end') + unicode_sub_check_type(substr, 'substr') + + return _rfind + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L12831-L12857 # noqa: E501 +@overload_method(types.UnicodeType, 'rindex') +def unicode_rindex(s, sub, start=None, end=None): + """Implements str.rindex()""" + unicode_idx_check_type(start, 'start') + unicode_idx_check_type(end, 'end') + unicode_sub_check_type(sub, 'sub') + + def rindex_impl(s, sub, start=None, end=None): + result = s.rfind(sub, start, end) + if result < 0: + raise ValueError('substring not found') + + return result + + return rindex_impl + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L11692-L11718 # noqa: E501 +@overload_method(types.UnicodeType, 'index') +def unicode_index(s, sub, start=None, end=None): + """Implements str.index()""" + unicode_idx_check_type(start, 'start') + unicode_idx_check_type(end, 'end') + unicode_sub_check_type(sub, 'sub') + + def index_impl(s, sub, start=None, end=None): + result = s.find(sub, start, end) + if result < 0: + raise ValueError('substring not found') + + return result + + return index_impl + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L12922-L12976 # noqa: E501 +@overload_method(types.UnicodeType, 'partition') +def unicode_partition(data, sep): + """Implements str.partition()""" + thety = sep + # if the type is omitted, the concrete type is the value + if isinstance(sep, types.Omitted): + thety = sep.value + # if the type is optional, the concrete type is the captured type + elif isinstance(sep, types.Optional): + thety = sep.type + + accepted = (types.UnicodeType, types.UnicodeCharSeq) + if thety is not None and not isinstance(thety, accepted): + msg = '"{}" must be {}, not {}'.format('sep', accepted, sep) + raise TypingError(msg) + + def impl(data, sep): + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/stringlib/partition.h#L7-L60 # noqa: E501 + sep = str(sep) + empty_str = _empty_string(data._kind, 0, data._is_ascii) + sep_length = len(sep) + if data._kind < sep._kind or len(data) < sep_length: + return data, empty_str, empty_str + + if sep_length == 0: + raise ValueError('empty separator') + + pos = data.find(sep) + if pos < 0: + return data, empty_str, empty_str + + return data[0:pos], sep, data[pos + sep_length:len(data)] + + return impl + + +@overload_method(types.UnicodeType, 'count') +def unicode_count(src, sub, start=None, end=None): + + _count_args_types_check(start) + _count_args_types_check(end) + + if isinstance(sub, types.UnicodeType): + def count_impl(src, sub, start=None, end=None): + count = 0 + src_len = len(src) + sub_len = len(sub) + + start = _normalize_slice_idx_count(start, src_len, 0) + end = _normalize_slice_idx_count(end, src_len, src_len) + + if end - start < 0 or start > src_len: + return 0 + + src = src[start : end] + src_len = len(src) + start, end = 0, src_len + if sub_len == 0: + return src_len + 1 + + while (start + sub_len <= src_len): + if src[start : start + sub_len] == sub: + count += 1 + start += sub_len + else: + start += 1 + return count + return count_impl + error_msg = "The substring must be a UnicodeType, not {}" + raise TypingError(error_msg.format(type(sub))) + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L12979-L13033 # noqa: E501 +@overload_method(types.UnicodeType, 'rpartition') +def unicode_rpartition(data, sep): + """Implements str.rpartition()""" + thety = sep + # if the type is omitted, the concrete type is the value + if isinstance(sep, types.Omitted): + thety = sep.value + # if the type is optional, the concrete type is the captured type + elif isinstance(sep, types.Optional): + thety = sep.type + + accepted = (types.UnicodeType, types.UnicodeCharSeq) + if thety is not None and not isinstance(thety, accepted): + msg = '"{}" must be {}, not {}'.format('sep', accepted, sep) + raise TypingError(msg) + + def impl(data, sep): + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/stringlib/partition.h#L62-L115 # noqa: E501 + sep = str(sep) + empty_str = _empty_string(data._kind, 0, data._is_ascii) + sep_length = len(sep) + if data._kind < sep._kind or len(data) < sep_length: + return empty_str, empty_str, data + + if sep_length == 0: + raise ValueError('empty separator') + + pos = data.rfind(sep) + if pos < 0: + return empty_str, empty_str, data + + return data[0:pos], sep, data[pos + sep_length:len(data)] + + return impl + + +# https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/unicodeobject.c#L9342-L9354 # noqa: E501 +@register_jitable +def _adjust_indices(length, start, end): + if end > length: + end = length + if end < 0: + end += length + if end < 0: + end = 0 + if start < 0: + start += length + if start < 0: + start = 0 + + return start, end + + +@overload_method(types.UnicodeType, 'startswith') +def unicode_startswith(s, prefix, start=None, end=None): + if not is_nonelike(start) and not isinstance(start, types.Integer): + raise TypingError( + "When specified, the arg 'start' must be an Integer or None") + + if not is_nonelike(end) and not isinstance(end, types.Integer): + raise TypingError( + "When specified, the arg 'end' must be an Integer or None") + + if isinstance(prefix, types.UniTuple) and \ + isinstance(prefix.dtype, types.UnicodeType): + + def startswith_tuple_impl(s, prefix, start=None, end=None): + for item in prefix: + if s.startswith(item, start, end): + return True + return False + + return startswith_tuple_impl + + elif isinstance(prefix, types.UnicodeCharSeq): + def startswith_char_seq_impl(s, prefix, start=None, end=None): + return s.startswith(str(prefix), start, end) + + return startswith_char_seq_impl + + elif isinstance(prefix, types.UnicodeType): + def startswith_unicode_impl(s, prefix, start=None, end=None): + length, prefix_length = len(s), len(prefix) + if start is None: + start = 0 + if end is None: + end = length + + start, end = _adjust_indices(length, start, end) + if end - start < prefix_length: + return False + + if prefix_length == 0: + return True + + s_slice = s[start:end] + + return _cmp_region(s_slice, 0, prefix, 0, prefix_length) == 0 + + return startswith_unicode_impl + + else: + raise TypingError( + "The arg 'prefix' should be a string or a tuple of strings") + + +@overload_method(types.UnicodeType, 'endswith') +def unicode_endswith(s, substr, start=None, end=None): + if not (start is None or isinstance(start, (types.Omitted, + types.Integer, + types.NoneType))): + raise TypingError('The arg must be a Integer or None') + + if not (end is None or isinstance(end, (types.Omitted, + types.Integer, + types.NoneType))): + raise TypingError('The arg must be a Integer or None') + + if isinstance(substr, (types.Tuple, types.UniTuple)): + def endswith_impl(s, substr, start=None, end=None): + for item in substr: + if s.endswith(item, start, end) is True: + return True + + return False + return endswith_impl + + if isinstance(substr, types.UnicodeType): + def endswith_impl(s, substr, start=None, end=None): + length = len(s) + sub_length = len(substr) + if start is None: + start = 0 + if end is None: + end = length + + start, end = _adjust_indices(length, start, end) + if end - start < sub_length: + return False + + if sub_length == 0: + return True + + s = s[start:end] + offset = len(s) - sub_length + + return _cmp_region(s, offset, substr, 0, sub_length) == 0 + return endswith_impl + + if isinstance(substr, types.UnicodeCharSeq): + def endswith_impl(s, substr, start=None, end=None): + return s.endswith(str(substr), start, end) + return endswith_impl + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L11519-L11595 # noqa: E501 +@overload_method(types.UnicodeType, 'expandtabs') +def unicode_expandtabs(data, tabsize=8): + """Implements str.expandtabs()""" + thety = tabsize + # if the type is omitted, the concrete type is the value + if isinstance(tabsize, types.Omitted): + thety = tabsize.value + # if the type is optional, the concrete type is the captured type + elif isinstance(tabsize, types.Optional): + thety = tabsize.type + + accepted = (types.Integer, int) + if thety is not None and not isinstance(thety, accepted): + raise TypingError( + '"tabsize" must be {}, not {}'.format(accepted, tabsize)) + + def expandtabs_impl(data, tabsize=8): + length = len(data) + j = line_pos = 0 + found = False + for i in range(length): + code_point = _get_code_point(data, i) + if code_point == _Py_TAB: + found = True + if tabsize > 0: + # cannot overflow + incr = tabsize - (line_pos % tabsize) + if j > sys.maxsize - incr: + raise OverflowError('new string is too long') + line_pos += incr + j += incr + else: + if j > sys.maxsize - 1: + raise OverflowError('new string is too long') + line_pos += 1 + j += 1 + if code_point in (_Py_LINEFEED, _Py_CARRIAGE_RETURN): + line_pos = 0 + + if not found: + return data + + res = _empty_string(data._kind, j, data._is_ascii) + j = line_pos = 0 + for i in range(length): + code_point = _get_code_point(data, i) + if code_point == _Py_TAB: + if tabsize > 0: + incr = tabsize - (line_pos % tabsize) + line_pos += incr + for idx in range(j, j + incr): + _set_code_point(res, idx, _Py_SPACE) + j += incr + else: + line_pos += 1 + _set_code_point(res, j, code_point) + j += 1 + if code_point in (_Py_LINEFEED, _Py_CARRIAGE_RETURN): + line_pos = 0 + + return res + + return expandtabs_impl + + +@overload_method(types.UnicodeType, 'split') +def unicode_split(a, sep=None, maxsplit=-1): + if not (maxsplit == -1 or + isinstance(maxsplit, (types.Omitted, types.Integer, + types.IntegerLiteral))): + return None # fail typing if maxsplit is not an integer + + if isinstance(sep, types.UnicodeCharSeq): + def split_impl(a, sep=None, maxsplit=-1): + return a.split(str(sep), maxsplit=maxsplit) + return split_impl + + if isinstance(sep, types.UnicodeType): + def split_impl(a, sep=None, maxsplit=-1): + a_len = len(a) + sep_len = len(sep) + + if sep_len == 0: + raise ValueError('empty separator') + + parts = [] + last = 0 + idx = 0 + + if sep_len == 1 and maxsplit == -1: + sep_code_point = _get_code_point(sep, 0) + for idx in range(a_len): + if _get_code_point(a, idx) == sep_code_point: + parts.append(a[last:idx]) + last = idx + 1 + else: + split_count = 0 + + while idx < a_len and (maxsplit == -1 or + split_count < maxsplit): + if _cmp_region(a, idx, sep, 0, sep_len) == 0: + parts.append(a[last:idx]) + idx += sep_len + last = idx + split_count += 1 + else: + idx += 1 + + if last <= a_len: + parts.append(a[last:]) + + return parts + return split_impl + elif sep is None or isinstance(sep, types.NoneType) or \ + getattr(sep, 'value', False) is None: + def split_whitespace_impl(a, sep=None, maxsplit=-1): + a_len = len(a) + + parts = [] + last = 0 + idx = 0 + split_count = 0 + in_whitespace_block = True + + for idx in range(a_len): + code_point = _get_code_point(a, idx) + is_whitespace = _PyUnicode_IsSpace(code_point) + if in_whitespace_block: + if is_whitespace: + pass # keep consuming space + else: + last = idx # this is the start of the next string + in_whitespace_block = False + else: + if not is_whitespace: + pass # keep searching for whitespace transition + else: + parts.append(a[last:idx]) + in_whitespace_block = True + split_count += 1 + if maxsplit != -1 and split_count == maxsplit: + break + + if last <= a_len and not in_whitespace_block: + parts.append(a[last:]) + + return parts + return split_whitespace_impl + + +def generate_rsplit_whitespace_impl(isspace_func): + """Generate whitespace rsplit func based on either ascii or unicode""" + + def rsplit_whitespace_impl(data, sep=None, maxsplit=-1): + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/stringlib/split.h#L192-L240 # noqa: E501 + if maxsplit < 0: + maxsplit = sys.maxsize + + result = [] + i = len(data) - 1 + while maxsplit > 0: + while i >= 0: + code_point = _get_code_point(data, i) + if not isspace_func(code_point): + break + i -= 1 + if i < 0: + break + j = i + i -= 1 + while i >= 0: + code_point = _get_code_point(data, i) + if isspace_func(code_point): + break + i -= 1 + result.append(data[i + 1:j + 1]) + maxsplit -= 1 + + if i >= 0: + # Only occurs when maxsplit was reached + # Skip any remaining whitespace and copy to beginning of string + while i >= 0: + code_point = _get_code_point(data, i) + if not isspace_func(code_point): + break + i -= 1 + if i >= 0: + result.append(data[0:i + 1]) + + return result[::-1] + + return rsplit_whitespace_impl + + +unicode_rsplit_whitespace_impl = register_jitable( + generate_rsplit_whitespace_impl(_PyUnicode_IsSpace)) +ascii_rsplit_whitespace_impl = register_jitable( + generate_rsplit_whitespace_impl(_Py_ISSPACE)) + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L13095-L13108 # noqa: E501 +@overload_method(types.UnicodeType, 'rsplit') +def unicode_rsplit(data, sep=None, maxsplit=-1): + """Implements str.unicode_rsplit()""" + + def _unicode_rsplit_check_type(ty, name, accepted): + """Check object belongs to one of specified types""" + thety = ty + # if the type is omitted, the concrete type is the value + if isinstance(ty, types.Omitted): + thety = ty.value + # if the type is optional, the concrete type is the captured type + elif isinstance(ty, types.Optional): + thety = ty.type + + if thety is not None and not isinstance(thety, accepted): + raise TypingError( + '"{}" must be {}, not {}'.format(name, accepted, ty)) + + _unicode_rsplit_check_type(sep, 'sep', (types.UnicodeType, + types.UnicodeCharSeq, + types.NoneType)) + _unicode_rsplit_check_type(maxsplit, 'maxsplit', (types.Integer, int)) + + if sep is None or isinstance(sep, (types.NoneType, types.Omitted)): + + def rsplit_whitespace_impl(data, sep=None, maxsplit=-1): + if data._is_ascii: + return ascii_rsplit_whitespace_impl(data, sep, maxsplit) + return unicode_rsplit_whitespace_impl(data, sep, maxsplit) + + return rsplit_whitespace_impl + + def rsplit_impl(data, sep=None, maxsplit=-1): + sep = str(sep) + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/stringlib/split.h#L286-L333 # noqa: E501 + if data._kind < sep._kind or len(data) < len(sep): + return [data] + + def _rsplit_char(data, ch, maxsplit): + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/stringlib/split.h#L242-L284 # noqa: E501 + result = [] + ch_code_point = _get_code_point(ch, 0) + i = j = len(data) - 1 + while i >= 0 and maxsplit > 0: + data_code_point = _get_code_point(data, i) + if data_code_point == ch_code_point: + result.append(data[i + 1 : j + 1]) + j = i = i - 1 + maxsplit -= 1 + i -= 1 + if j >= -1: + result.append(data[0 : j + 1]) + + return result[::-1] + + if maxsplit < 0: + maxsplit = sys.maxsize + + sep_length = len(sep) + + if sep_length == 0: + raise ValueError('empty separator') + if sep_length == 1: + return _rsplit_char(data, sep, maxsplit) + + result = [] + j = len(data) + while maxsplit > 0: + pos = data.rfind(sep, start=0, end=j) + if pos < 0: + break + result.append(data[pos + sep_length:j]) + j = pos + maxsplit -= 1 + + result.append(data[0:j]) + + return result[::-1] + + return rsplit_impl + + +@overload_method(types.UnicodeType, 'center') +def unicode_center(string, width, fillchar=' '): + if not isinstance(width, types.Integer): + raise TypingError('The width must be an Integer') + + if isinstance(fillchar, types.UnicodeCharSeq): + def center_impl(string, width, fillchar=' '): + return string.center(width, str(fillchar)) + return center_impl + + if not (fillchar == ' ' or + isinstance(fillchar, (types.Omitted, types.UnicodeType))): + raise TypingError('The fillchar must be a UnicodeType') + + def center_impl(string, width, fillchar=' '): + str_len = len(string) + fillchar_len = len(fillchar) + + if fillchar_len != 1: + raise ValueError('The fill character must be exactly one ' + 'character long') + + if width <= str_len: + return string + + allmargin = width - str_len + lmargin = (allmargin // 2) + (allmargin & width & 1) + rmargin = allmargin - lmargin + + l_string = fillchar * lmargin + if lmargin == rmargin: + return l_string + string + l_string + else: + return l_string + string + (fillchar * rmargin) + + return center_impl + + +def gen_unicode_Xjust(STRING_FIRST): + def unicode_Xjust(string, width, fillchar=' '): + if not isinstance(width, types.Integer): + raise TypingError('The width must be an Integer') + + if isinstance(fillchar, types.UnicodeCharSeq): + if STRING_FIRST: + def ljust_impl(string, width, fillchar=' '): + return string.ljust(width, str(fillchar)) + return ljust_impl + else: + def rjust_impl(string, width, fillchar=' '): + return string.rjust(width, str(fillchar)) + return rjust_impl + + if not (fillchar == ' ' or + isinstance(fillchar, (types.Omitted, types.UnicodeType))): + raise TypingError('The fillchar must be a UnicodeType') + + def impl(string, width, fillchar=' '): + str_len = len(string) + fillchar_len = len(fillchar) + + if fillchar_len != 1: + raise ValueError('The fill character must be exactly one ' + 'character long') + + if width <= str_len: + return string + + newstr = (fillchar * (width - str_len)) + if STRING_FIRST: + return string + newstr + else: + return newstr + string + + return impl + + return unicode_Xjust + + +overload_method(types.UnicodeType, 'rjust')(gen_unicode_Xjust(False)) +overload_method(types.UnicodeType, 'ljust')(gen_unicode_Xjust(True)) + + +def generate_splitlines_func(is_line_break_func): + """Generate splitlines performer based on ascii or unicode line breaks.""" + def impl(data, keepends): + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/stringlib/split.h#L335-L389 # noqa: E501 + length = len(data) + result = [] + i = j = 0 + while i < length: + # find a line and append it + while i < length: + code_point = _get_code_point(data, i) + if is_line_break_func(code_point): + break + i += 1 + + # skip the line break reading CRLF as one line break + eol = i + if i < length: + if i + 1 < length: + cur_cp = _get_code_point(data, i) + next_cp = _get_code_point(data, i + 1) + if _Py_ISCARRIAGERETURN(cur_cp) and _Py_ISLINEFEED(next_cp): + i += 1 + i += 1 + if keepends: + eol = i + + result.append(data[j:eol]) + j = i + + return result + + return impl + + +_ascii_splitlines = register_jitable(generate_splitlines_func(_Py_ISLINEBREAK)) +_unicode_splitlines = register_jitable(generate_splitlines_func( + _PyUnicode_IsLineBreak)) + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L10196-L10229 # noqa: E501 +@overload_method(types.UnicodeType, 'splitlines') +def unicode_splitlines(data, keepends=False): + """Implements str.splitlines()""" + thety = keepends + # if the type is omitted, the concrete type is the value + if isinstance(keepends, types.Omitted): + thety = keepends.value + # if the type is optional, the concrete type is the captured type + elif isinstance(keepends, types.Optional): + thety = keepends.type + + accepted = (types.Integer, int, types.Boolean, bool) + if thety is not None and not isinstance(thety, accepted): + raise TypingError( + '"{}" must be {}, not {}'.format('keepends', accepted, keepends)) + + def splitlines_impl(data, keepends=False): + if data._is_ascii: + return _ascii_splitlines(data, keepends) + + return _unicode_splitlines(data, keepends) + + return splitlines_impl + + +@register_jitable +def join_list(sep, parts): + parts_len = len(parts) + if parts_len == 0: + return '' + + # Precompute size and char_width of result + sep_len = len(sep) + length = (parts_len - 1) * sep_len + kind = sep._kind + is_ascii = sep._is_ascii + for p in parts: + length += len(p) + kind = _pick_kind(kind, p._kind) + is_ascii = _pick_ascii(is_ascii, p._is_ascii) + + result = _empty_string(kind, length, is_ascii) + + # populate string + part = parts[0] + _strncpy(result, 0, part, 0, len(part)) + dst_offset = len(part) + for idx in range(1, parts_len): + _strncpy(result, dst_offset, sep, 0, sep_len) + dst_offset += sep_len + part = parts[idx] + _strncpy(result, dst_offset, part, 0, len(part)) + dst_offset += len(part) + + return result + + +@overload_method(types.UnicodeType, 'join') +def unicode_join(sep, parts): + + if isinstance(parts, types.List): + if isinstance(parts.dtype, types.UnicodeType): + def join_list_impl(sep, parts): + return join_list(sep, parts) + return join_list_impl + elif isinstance(parts.dtype, types.UnicodeCharSeq): + def join_list_impl(sep, parts): + _parts = [str(p) for p in parts] + return join_list(sep, _parts) + return join_list_impl + else: + pass # lists of any other type not supported + elif isinstance(parts, types.IterableType): + def join_iter_impl(sep, parts): + parts_list = [p for p in parts] + return sep.join(parts_list) + return join_iter_impl + elif isinstance(parts, types.UnicodeType): + # Temporary workaround until UnicodeType is iterable + def join_str_impl(sep, parts): + parts_list = [parts[i] for i in range(len(parts))] + return join_list(sep, parts_list) + return join_str_impl + + +@overload_method(types.UnicodeType, 'zfill') +def unicode_zfill(string, width): + if not isinstance(width, types.Integer): + raise TypingError(" must be an Integer") + + def zfill_impl(string, width): + + str_len = len(string) + + if width <= str_len: + return string + + first_char = string[0] if str_len else '' + padding = '0' * (width - str_len) + + if first_char in ['+', '-']: + newstr = first_char + padding + string[1:] + else: + newstr = padding + string + + return newstr + + return zfill_impl + + +# ------------------------------------------------------------------------------ +# Strip functions +# ------------------------------------------------------------------------------ +@register_jitable +def unicode_strip_left_bound(string, chars): + str_len = len(string) + + i = 0 + if chars is not None: + for i in range(str_len): + if string[i] not in chars: + return i + else: + for i in range(str_len): + if not _PyUnicode_IsSpace(string[i]): + return i + + return str_len + + +@register_jitable +def unicode_strip_right_bound(string, chars): + str_len = len(string) + i = 0 + if chars is not None: + for i in range(str_len - 1, -1, -1): + if string[i] not in chars: + i += 1 + break + else: + for i in range(str_len - 1, -1, -1): + if not _PyUnicode_IsSpace(string[i]): + i += 1 + break + + return i + + +def unicode_strip_types_check(chars): + if isinstance(chars, types.Optional): + chars = chars.type # catch optional type with invalid non-None type + if not (chars is None or isinstance(chars, (types.Omitted, + types.UnicodeType, + types.NoneType))): + raise TypingError('The arg must be a UnicodeType or None') + + +def _count_args_types_check(arg): + if isinstance(arg, types.Optional): + arg = arg.type + if not (arg is None or isinstance(arg, (types.Omitted, + types.Integer, + types.NoneType))): + raise TypingError("The slice indices must be an Integer or None") + + +@overload_method(types.UnicodeType, 'lstrip') +def unicode_lstrip(string, chars=None): + + if isinstance(chars, types.UnicodeCharSeq): + def lstrip_impl(string, chars=None): + return string.lstrip(str(chars)) + return lstrip_impl + + unicode_strip_types_check(chars) + + def lstrip_impl(string, chars=None): + return string[unicode_strip_left_bound(string, chars):] + return lstrip_impl + + +@overload_method(types.UnicodeType, 'rstrip') +def unicode_rstrip(string, chars=None): + + if isinstance(chars, types.UnicodeCharSeq): + def rstrip_impl(string, chars=None): + return string.rstrip(str(chars)) + return rstrip_impl + + unicode_strip_types_check(chars) + + def rstrip_impl(string, chars=None): + return string[:unicode_strip_right_bound(string, chars)] + return rstrip_impl + + +@overload_method(types.UnicodeType, 'strip') +def unicode_strip(string, chars=None): + + if isinstance(chars, types.UnicodeCharSeq): + def strip_impl(string, chars=None): + return string.strip(str(chars)) + return strip_impl + + unicode_strip_types_check(chars) + + def strip_impl(string, chars=None): + lb = unicode_strip_left_bound(string, chars) + rb = unicode_strip_right_bound(string, chars) + return string[lb:rb] + return strip_impl + + +# ------------------------------------------------------------------------------ +# Slice functions +# ------------------------------------------------------------------------------ + +@register_jitable +def normalize_str_idx(idx, length, is_start=True): + """ + Parameters + ---------- + idx : int or None + the index + length : int + the string length + is_start : bool; optional with defaults to True + Is it the *start* or the *stop* of the slice? + + Returns + ------- + norm_idx : int + normalized index + """ + if idx is None: + if is_start: + return 0 + else: + return length + elif idx < 0: + idx += length + + if idx < 0 or idx >= length: + raise IndexError("string index out of range") + + return idx + + +@register_jitable +def _normalize_slice_idx_count(arg, slice_len, default): + """ + Used for unicode_count + + If arg < -slice_len, returns 0 (prevents circle) + + If arg is within slice, e.g -slice_len <= arg < slice_len + returns its real index via arg % slice_len + + If arg > slice_len, returns arg (in this case count must + return 0 if it is start index) + """ + + if arg is None: + return default + if -slice_len <= arg < slice_len: + return arg % slice_len + return 0 if arg < 0 else arg + + +@intrinsic +def _normalize_slice(typingctx, sliceobj, length): + """Fix slice object. + """ + sig = sliceobj(sliceobj, length) + + def codegen(context, builder, sig, args): + [slicetype, lengthtype] = sig.args + [sliceobj, length] = args + slice = context.make_helper(builder, slicetype, sliceobj) + slicing.guard_invalid_slice(context, builder, slicetype, slice) + slicing.fix_slice(builder, slice, length) + return slice._getvalue() + + return sig, codegen + + +@intrinsic +def _slice_span(typingctx, sliceobj): + """Compute the span from the given slice object. + """ + sig = types.intp(sliceobj) + + def codegen(context, builder, sig, args): + [slicetype] = sig.args + [sliceobj] = args + slice = context.make_helper(builder, slicetype, sliceobj) + result_size = slicing.get_slice_length(builder, slice) + return result_size + + return sig, codegen + + +@register_jitable(_nrt=False) +def _strncpy(dst, dst_offset, src, src_offset, n): + if src._kind == dst._kind: + byte_width = _kind_to_byte_width(src._kind) + src_byte_offset = byte_width * src_offset + dst_byte_offset = byte_width * dst_offset + nbytes = n * byte_width + memcpy_region(dst._data, dst_byte_offset, src._data, + src_byte_offset, nbytes, align=1) + else: + for i in range(n): + _set_code_point(dst, dst_offset + i, + _get_code_point(src, src_offset + i)) + + +@intrinsic +def _get_str_slice_view(typingctx, src_t, start_t, length_t): + """Create a slice of a unicode string using a view of its data to avoid + extra allocation. + """ + assert src_t == types.unicode_type + + def codegen(context, builder, sig, args): + src, start, length = args + in_str = cgutils.create_struct_proxy( + types.unicode_type)(context, builder, value=src) + view_str = cgutils.create_struct_proxy( + types.unicode_type)(context, builder) + view_str.meminfo = in_str.meminfo + view_str.kind = in_str.kind + view_str.is_ascii = in_str.is_ascii + view_str.length = length + # hash value -1 to indicate "need to compute hash" + view_str.hash = context.get_constant(_Py_hash_t, -1) + # get a pointer to start of slice data + bw_typ = context.typing_context.resolve_value_type(_kind_to_byte_width) + bw_sig = bw_typ.get_call_type( + context.typing_context, (types.int32,), {}) + bw_impl = context.get_function(bw_typ, bw_sig) + byte_width = bw_impl(builder, (in_str.kind,)) + offset = builder.mul(start, byte_width) + view_str.data = builder.gep(in_str.data, [offset]) + # Set parent pyobject to NULL + view_str.parent = cgutils.get_null_value(view_str.parent.type) + # incref original string + if context.enable_nrt: + context.nrt.incref(builder, sig.args[0], src) + return view_str._getvalue() + + sig = types.unicode_type(types.unicode_type, types.intp, types.intp) + return sig, codegen + + +@overload(operator.getitem) +def unicode_getitem(s, idx): + if isinstance(s, types.UnicodeType): + if isinstance(idx, types.Integer): + def getitem_char(s, idx): + idx = normalize_str_idx(idx, len(s)) + cp = _get_code_point(s, idx) + kind = _codepoint_to_kind(cp) + if kind == s._kind: + return _get_str_slice_view(s, idx, 1) + else: + is_ascii = _codepoint_is_ascii(cp) + ret = _empty_string(kind, 1, is_ascii) + _set_code_point(ret, 0, cp) + return ret + return getitem_char + elif isinstance(idx, types.SliceType): + def getitem_slice(s, idx): + slice_idx = _normalize_slice(idx, len(s)) + span = _slice_span(slice_idx) + + cp = _get_code_point(s, slice_idx.start) + kind = _codepoint_to_kind(cp) + is_ascii = _codepoint_is_ascii(cp) + + # Check slice to see if it's homogeneous in kind + for i in range(slice_idx.start + slice_idx.step, + slice_idx.stop, slice_idx.step): + cp = _get_code_point(s, i) + is_ascii &= _codepoint_is_ascii(cp) + new_kind = _codepoint_to_kind(cp) + if kind != new_kind: + kind = _pick_kind(kind, new_kind) + # TODO: it might be possible to break here if the kind + # is PY_UNICODE_4BYTE_KIND but there are potentially + # strings coming from other internal functions that are + # this wide and also actually ASCII (i.e. kind is larger + # than actually required for storing the code point), so + # it's necessary to continue. + + if slice_idx.step == 1 and kind == s._kind: + # Can return a view, the slice has the same kind as the + # string itself and it's a stride slice 1. + return _get_str_slice_view(s, slice_idx.start, span) + else: + # It's heterogeneous in kind OR stride != 1 + ret = _empty_string(kind, span, is_ascii) + cur = slice_idx.start + for i in range(span): + _set_code_point(ret, i, _get_code_point(s, cur)) + cur += slice_idx.step + return ret + + return getitem_slice + + +# ------------------------------------------------------------------------------ +# String operations +# ------------------------------------------------------------------------------ + + +@overload(operator.add) +@overload(operator.iadd) +def unicode_concat(a, b): + if isinstance(a, types.UnicodeType) and isinstance(b, types.UnicodeType): + def concat_impl(a, b): + new_length = a._length + b._length + new_kind = _pick_kind(a._kind, b._kind) + new_ascii = _pick_ascii(a._is_ascii, b._is_ascii) + result = _empty_string(new_kind, new_length, new_ascii) + for i in range(len(a)): + _set_code_point(result, i, _get_code_point(a, i)) + for j in range(len(b)): + _set_code_point(result, len(a) + j, _get_code_point(b, j)) + return result + return concat_impl + + if isinstance(a, types.UnicodeType) and isinstance(b, types.UnicodeCharSeq): + def concat_impl(a, b): + return a + str(b) + return concat_impl + + +@register_jitable +def _repeat_impl(str_arg, mult_arg): + if str_arg == '' or mult_arg < 1: + return '' + elif mult_arg == 1: + return str_arg + else: + new_length = str_arg._length * mult_arg + new_kind = str_arg._kind + result = _empty_string(new_kind, new_length, str_arg._is_ascii) + # make initial copy into result + len_a = len(str_arg) + _strncpy(result, 0, str_arg, 0, len_a) + # loop through powers of 2 for efficient copying + copy_size = len_a + while 2 * copy_size <= new_length: + _strncpy(result, copy_size, result, 0, copy_size) + copy_size *= 2 + + if not 2 * copy_size == new_length: + # if copy_size not an exact multiple it then needs + # to complete the rest of the copies + rest = new_length - copy_size + _strncpy(result, copy_size, result, copy_size - rest, rest) + return result + + +@overload(operator.mul) +def unicode_repeat(a, b): + if isinstance(a, types.UnicodeType) and isinstance(b, types.Integer): + def wrap(a, b): + return _repeat_impl(a, b) + return wrap + elif isinstance(a, types.Integer) and isinstance(b, types.UnicodeType): + def wrap(a, b): + return _repeat_impl(b, a) + return wrap + + +@overload(operator.not_) +def unicode_not(a): + if isinstance(a, types.UnicodeType): + def impl(a): + return len(a) == 0 + return impl + + +@overload_method(types.UnicodeType, 'replace') +def unicode_replace(s, old_str, new_str, count=-1): + thety = count + if isinstance(count, types.Omitted): + thety = count.value + elif isinstance(count, types.Optional): + thety = count.type + + if not isinstance(thety, (int, types.Integer)): + raise TypingError('Unsupported parameters. The parameters ' + 'must be Integer. Given count: {}'.format(count)) + + if not isinstance(old_str, (types.UnicodeType, types.NoneType)): + raise TypingError('The object must be a UnicodeType.' + ' Given: {}'.format(old_str)) + + if not isinstance(new_str, types.UnicodeType): + raise TypingError('The object must be a UnicodeType.' + ' Given: {}'.format(new_str)) + + def impl(s, old_str, new_str, count=-1): + if count == 0: + return s + if old_str == '': + schars = list(s) + if count == -1: + return new_str + new_str.join(schars) + new_str + split_result = [new_str] + min_count = min(len(schars), count) + for i in range(min_count): + split_result.append(schars[i]) + if i + 1 != min_count: + split_result.append(new_str) + else: + split_result.append(''.join(schars[(i + 1):])) + if count > len(schars): + split_result.append(new_str) + return ''.join(split_result) + schars = s.split(old_str, count) + result = new_str.join(schars) + return result + + return impl + +# ------------------------------------------------------------------------------ +# String `is*()` methods +# ------------------------------------------------------------------------------ + + +# generates isalpha/isalnum +def gen_isAlX(ascii_func, unicode_func): + def unicode_isAlX(data): + + def impl(data): + length = len(data) + if length == 0: + return False + + if length == 1: + code_point = _get_code_point(data, 0) + if data._is_ascii: + return ascii_func(code_point) + else: + return unicode_func(code_point) + + if data._is_ascii: + for i in range(length): + code_point = _get_code_point(data, i) + if not ascii_func(code_point): + return False + + for i in range(length): + code_point = _get_code_point(data, i) + if not unicode_func(code_point): + return False + + return True + + return impl + return unicode_isAlX + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L11928-L11964 # noqa: E501 +overload_method(types.UnicodeType, 'isalpha')(gen_isAlX(_Py_ISALPHA, + _PyUnicode_IsAlpha)) + +_unicode_is_alnum = register_jitable(lambda x: + (_PyUnicode_IsNumeric(x) or + _PyUnicode_IsAlpha(x))) + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L11975-L12006 # noqa: E501 +overload_method(types.UnicodeType, 'isalnum')(gen_isAlX(_Py_ISALNUM, + _unicode_is_alnum)) + + +def _is_upper(is_lower, is_upper, is_title): + # impl is an approximate translation of: + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L11794-L11827 # noqa: E501 + # mixed with: + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/bytes_methods.c#L218-L242 # noqa: E501 + def impl(a): + l = len(a) + if l == 1: + return is_upper(_get_code_point(a, 0)) != 0 + if l == 0: + return False + cased = False + for idx in range(l): + code_point = _get_code_point(a, idx) + if is_lower(code_point) or is_title(code_point): + return False + elif (not cased and is_upper(code_point)): + cased = True + return cased + return impl + + +_always_false = register_jitable(lambda x: False) +_ascii_is_upper = register_jitable(_is_upper(_Py_ISLOWER, _Py_ISUPPER, + _always_false)) +_unicode_is_upper = register_jitable(_is_upper(_PyUnicode_IsLowercase, + _PyUnicode_IsUppercase, + _PyUnicode_IsTitlecase)) + + +@overload_method(types.UnicodeType, 'isupper') +def unicode_isupper(a): + """ + Implements .isupper() + """ + def impl(a): + if a._is_ascii: + return _ascii_is_upper(a) + else: + return _unicode_is_upper(a) + return impl + + +@overload_method(types.UnicodeType, 'isascii') +def unicode_isascii(data): + """Implements UnicodeType.isascii()""" + + def impl(data): + return data._is_ascii + return impl + + +@overload_method(types.UnicodeType, 'istitle') +def unicode_istitle(data): + """ + Implements UnicodeType.istitle() + The algorithm is an approximate translation from CPython: + https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L11829-L11885 # noqa: E501 + """ + + def impl(data): + length = len(data) + if length == 1: + char = _get_code_point(data, 0) + return _PyUnicode_IsUppercase(char) or _PyUnicode_IsTitlecase(char) + + if length == 0: + return False + + cased = False + previous_is_cased = False + for idx in range(length): + char = _get_code_point(data, idx) + if _PyUnicode_IsUppercase(char) or _PyUnicode_IsTitlecase(char): + if previous_is_cased: + return False + previous_is_cased = True + cased = True + elif _PyUnicode_IsLowercase(char): + if not previous_is_cased: + return False + previous_is_cased = True + cased = True + else: + previous_is_cased = False + + return cased + return impl + + +@overload_method(types.UnicodeType, 'islower') +def unicode_islower(data): + """ + impl is an approximate translation of: + https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/unicodeobject.c#L11900-L11933 # noqa: E501 + mixed with: + https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/bytes_methods.c#L131-L156 # noqa: E501 + """ + + def impl(data): + length = len(data) + if length == 1: + return _PyUnicode_IsLowercase(_get_code_point(data, 0)) + if length == 0: + return False + + cased = False + for idx in range(length): + cp = _get_code_point(data, idx) + if _PyUnicode_IsUppercase(cp) or _PyUnicode_IsTitlecase(cp): + return False + elif not cased and _PyUnicode_IsLowercase(cp): + cased = True + return cased + return impl + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L12126-L12161 # noqa: E501 +@overload_method(types.UnicodeType, 'isidentifier') +def unicode_isidentifier(data): + """Implements UnicodeType.isidentifier()""" + + def impl(data): + length = len(data) + if length == 0: + return False + + first_cp = _get_code_point(data, 0) + if not _PyUnicode_IsXidStart(first_cp) and first_cp != 0x5F: + return False + + for i in range(1, length): + code_point = _get_code_point(data, i) + if not _PyUnicode_IsXidContinue(code_point): + return False + + return True + + return impl + + +# generator for simple unicode "isX" methods +def gen_isX(_PyUnicode_IS_func, empty_is_false=True): + def unicode_isX(data): + def impl(data): + length = len(data) + if length == 1: + return _PyUnicode_IS_func(_get_code_point(data, 0)) + + if empty_is_false and length == 0: + return False + + for i in range(length): + code_point = _get_code_point(data, i) + if not _PyUnicode_IS_func(code_point): + return False + + return True + + return impl + return unicode_isX + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L11896-L11925 # noqa: E501 +overload_method(types.UnicodeType, 'isspace')(gen_isX(_PyUnicode_IsSpace)) + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L12096-L12124 # noqa: E501 +overload_method(types.UnicodeType, 'isnumeric')(gen_isX(_PyUnicode_IsNumeric)) + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L12056-L12085 # noqa: E501 +overload_method(types.UnicodeType, 'isdigit')(gen_isX(_PyUnicode_IsDigit)) + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L12017-L12045 # noqa: E501 +overload_method(types.UnicodeType, 'isdecimal')( + gen_isX(_PyUnicode_IsDecimalDigit)) + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L12188-L12213 # noqa: E501 +overload_method(types.UnicodeType, 'isprintable')( + gen_isX(_PyUnicode_IsPrintable, False)) + +# ------------------------------------------------------------------------------ +# String methods that apply a transformation to the characters themselves +# ------------------------------------------------------------------------------ + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L9863-L9908 # noqa: E501 +def case_operation(ascii_func, unicode_func): + """Generate common case operation performer.""" + def impl(data): + length = len(data) + if length == 0: + return _empty_string(data._kind, length, data._is_ascii) + + if data._is_ascii: + res = _empty_string(data._kind, length, 1) + ascii_func(data, res) + return res + + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L9863-L9908 # noqa: E501 + tmp = _empty_string(PY_UNICODE_4BYTE_KIND, 3 * length, data._is_ascii) + # maxchar should be inside of a list to be pass as argument by reference + maxchars = [0] + newlength = unicode_func(data, length, tmp, maxchars) + maxchar = maxchars[0] + newkind = _codepoint_to_kind(maxchar) + res = _empty_string(newkind, newlength, _codepoint_is_ascii(maxchar)) + for i in range(newlength): + _set_code_point(res, i, _get_code_point(tmp, i)) + + return res + + return impl + + +# https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/unicodeobject.c#L9856-L9883 # noqa: E501 +@register_jitable +def _handle_capital_sigma(data, length, idx): + """This is a translation of the function that handles the capital sigma.""" + c = 0 + j = idx - 1 + while j >= 0: + c = _get_code_point(data, j) + if not _PyUnicode_IsCaseIgnorable(c): + break + j -= 1 + final_sigma = (j >= 0 and _PyUnicode_IsCased(c)) + if final_sigma: + j = idx + 1 + while j < length: + c = _get_code_point(data, j) + if not _PyUnicode_IsCaseIgnorable(c): + break + j += 1 + final_sigma = (j == length or (not _PyUnicode_IsCased(c))) + + return 0x3c2 if final_sigma else 0x3c3 + + +# https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/unicodeobject.c#L9885-L9895 # noqa: E501 +@register_jitable +def _lower_ucs4(code_point, data, length, idx, mapped): + """This is a translation of the function that lowers a character.""" + if code_point == 0x3A3: + mapped[0] = _handle_capital_sigma(data, length, idx) + return 1 + return _PyUnicode_ToLowerFull(code_point, mapped) + + +# https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/unicodeobject.c#L9946-L9965 # noqa: E501 +def _gen_unicode_upper_or_lower(lower): + def _do_upper_or_lower(data, length, res, maxchars): + k = 0 + for idx in range(length): + mapped = np.zeros(3, dtype=_Py_UCS4) + code_point = _get_code_point(data, idx) + if lower: + n_res = _lower_ucs4(code_point, data, length, idx, mapped) + else: + # might be needed if call _do_upper_or_lower in unicode_upper + n_res = _PyUnicode_ToUpperFull(code_point, mapped) + for m in mapped[:n_res]: + maxchars[0] = max(maxchars[0], m) + _set_code_point(res, k, m) + k += 1 + return k + return _do_upper_or_lower + + +_unicode_upper = register_jitable(_gen_unicode_upper_or_lower(False)) +_unicode_lower = register_jitable(_gen_unicode_upper_or_lower(True)) + + +def _gen_ascii_upper_or_lower(func): + def _ascii_upper_or_lower(data, res): + for idx in range(len(data)): + code_point = _get_code_point(data, idx) + _set_code_point(res, idx, func(code_point)) + return _ascii_upper_or_lower + + +_ascii_upper = register_jitable(_gen_ascii_upper_or_lower(_Py_TOUPPER)) +_ascii_lower = register_jitable(_gen_ascii_upper_or_lower(_Py_TOLOWER)) + + +@overload_method(types.UnicodeType, 'lower') +def unicode_lower(data): + """Implements .lower()""" + return case_operation(_ascii_lower, _unicode_lower) + + +@overload_method(types.UnicodeType, 'upper') +def unicode_upper(data): + """Implements .upper()""" + return case_operation(_ascii_upper, _unicode_upper) + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L9819-L9834 # noqa: E501 +@register_jitable +def _unicode_casefold(data, length, res, maxchars): + k = 0 + mapped = np.zeros(3, dtype=_Py_UCS4) + for idx in range(length): + mapped.fill(0) + code_point = _get_code_point(data, idx) + n_res = _PyUnicode_ToFoldedFull(code_point, mapped) + for m in mapped[:n_res]: + maxchar = maxchars[0] + maxchars[0] = max(maxchar, m) + _set_code_point(res, k, m) + k += 1 + + return k + + +@register_jitable +def _ascii_casefold(data, res): + for idx in range(len(data)): + code_point = _get_code_point(data, idx) + _set_code_point(res, idx, _Py_TOLOWER(code_point)) + + +@overload_method(types.UnicodeType, 'casefold') +def unicode_casefold(data): + """Implements str.casefold()""" + return case_operation(_ascii_casefold, _unicode_casefold) + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L9737-L9759 # noqa: E501 +@register_jitable +def _unicode_capitalize(data, length, res, maxchars): + k = 0 + maxchar = 0 + mapped = np.zeros(3, dtype=_Py_UCS4) + code_point = _get_code_point(data, 0) + + n_res = _PyUnicode_ToTitleFull(code_point, mapped) + + for m in mapped[:n_res]: + maxchar = max(maxchar, m) + _set_code_point(res, k, m) + k += 1 + for idx in range(1, length): + mapped.fill(0) + code_point = _get_code_point(data, idx) + n_res = _lower_ucs4(code_point, data, length, idx, mapped) + for m in mapped[:n_res]: + maxchar = max(maxchar, m) + _set_code_point(res, k, m) + k += 1 + maxchars[0] = maxchar + return k + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/bytes_methods.c#L361-L382 # noqa: E501 +@register_jitable +def _ascii_capitalize(data, res): + code_point = _get_code_point(data, 0) + _set_code_point(res, 0, _Py_TOUPPER(code_point)) + for idx in range(1, len(data)): + code_point = _get_code_point(data, idx) + _set_code_point(res, idx, _Py_TOLOWER(code_point)) + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L10765-L10774 # noqa: E501 +@overload_method(types.UnicodeType, 'capitalize') +def unicode_capitalize(data): + return case_operation(_ascii_capitalize, _unicode_capitalize) + + +# https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/unicodeobject.c#L9996-L10021 # noqa: E501 +@register_jitable +def _unicode_title(data, length, res, maxchars): + """This is a translation of the function that titles a unicode string.""" + k = 0 + previous_cased = False + mapped = np.empty(3, dtype=_Py_UCS4) + for idx in range(length): + mapped.fill(0) + code_point = _get_code_point(data, idx) + if previous_cased: + n_res = _lower_ucs4(code_point, data, length, idx, mapped) + else: + n_res = _PyUnicode_ToTitleFull(_Py_UCS4(code_point), mapped) + for m in mapped[:n_res]: + maxchar, = maxchars + maxchars[0] = max(maxchar, m) + _set_code_point(res, k, m) + k += 1 + previous_cased = _PyUnicode_IsCased(_Py_UCS4(code_point)) + return k + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/bytes_methods.c#L332-L352 # noqa: E501 +@register_jitable +def _ascii_title(data, res): + """ Does .title() on an ASCII string """ + previous_is_cased = False + for idx in range(len(data)): + code_point = _get_code_point(data, idx) + if _Py_ISLOWER(code_point): + if not previous_is_cased: + code_point = _Py_TOUPPER(code_point) + previous_is_cased = True + elif _Py_ISUPPER(code_point): + if previous_is_cased: + code_point = _Py_TOLOWER(code_point) + previous_is_cased = True + else: + previous_is_cased = False + _set_code_point(res, idx, code_point) + + +# https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/unicodeobject.c#L10023-L10069 # noqa: E501 +@overload_method(types.UnicodeType, 'title') +def unicode_title(data): + """Implements str.title()""" + # https://docs.python.org/3/library/stdtypes.html#str.title + return case_operation(_ascii_title, _unicode_title) + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/bytes_methods.c#L391-L408 # noqa: E501 +@register_jitable +def _ascii_swapcase(data, res): + for idx in range(len(data)): + code_point = _get_code_point(data, idx) + if _Py_ISUPPER(code_point): + code_point = _Py_TOLOWER(code_point) + elif _Py_ISLOWER(code_point): + code_point = _Py_TOUPPER(code_point) + _set_code_point(res, idx, code_point) + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L9761-L9784 # noqa: E501 +@register_jitable +def _unicode_swapcase(data, length, res, maxchars): + k = 0 + maxchar = 0 + mapped = np.empty(3, dtype=_Py_UCS4) + for idx in range(length): + mapped.fill(0) + code_point = _get_code_point(data, idx) + if _PyUnicode_IsUppercase(code_point): + n_res = _lower_ucs4(code_point, data, length, idx, mapped) + elif _PyUnicode_IsLowercase(code_point): + n_res = _PyUnicode_ToUpperFull(code_point, mapped) + else: + n_res = 1 + mapped[0] = code_point + for m in mapped[:n_res]: + maxchar = max(maxchar, m) + _set_code_point(res, k, m) + k += 1 + maxchars[0] = maxchar + return k + + +@overload_method(types.UnicodeType, 'swapcase') +def unicode_swapcase(data): + return case_operation(_ascii_swapcase, _unicode_swapcase) + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Python/bltinmodule.c#L1781-L1824 # noqa: E501 +@overload(ord) +def ol_ord(c): + if isinstance(c, types.UnicodeType): + def impl(c): + lc = len(c) + if lc != 1: + # CPython does TypeError + raise TypeError("ord() expected a character") + return _get_code_point(c, 0) + return impl + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L2005-L2028 # noqa: E501 +# This looks a bit different to the cpython implementation but, with the +# exception of a latin1 fast path is logically the same. It finds the "kind" of +# the codepoint `ch`, creates a length 1 string of that kind and then injects +# the code point into the zero position of that string. Cpython does similar but +# branches for each kind (this is encapsulated in Numba's _set_code_point). +@register_jitable +def _unicode_char(ch): + assert ch <= _MAX_UNICODE + kind = _codepoint_to_kind(ch) + ret = _empty_string(kind, 1, kind == PY_UNICODE_1BYTE_KIND) + _set_code_point(ret, 0, ch) + return ret + + +_out_of_range_msg = "chr() arg not in range(0x%hx)" % _MAX_UNICODE + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L3045-L3055 # noqa: E501 +@register_jitable +def _PyUnicode_FromOrdinal(ordinal): + if (ordinal < 0 or ordinal > _MAX_UNICODE): + raise ValueError(_out_of_range_msg) + + return _unicode_char(_Py_UCS4(ordinal)) + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Python/bltinmodule.c#L715-L720 # noqa: E501 +@overload(chr) +def ol_chr(i): + if isinstance(i, types.Integer): + def impl(i): + return _PyUnicode_FromOrdinal(i) + return impl + + +@overload_method(types.UnicodeType, "__str__") +def unicode_str(s): + return lambda s: s + + +@overload_method(types.UnicodeType, "__repr__") +def unicode_repr(s): + # Can't use f-string as the impl ends up calling str and then repr, which + # then recurses somewhere in imports. + return lambda s: "'" + s + "'" + + +@overload_method(types.Integer, "__str__") +def integer_str(n): + + ten = n(10) + + def impl(n): + flag = False + if n < 0: + n = -n + flag = True + if n == 0: + return '0' + length = flag + 1 + int(np.floor(np.log10(n))) + kind = PY_UNICODE_1BYTE_KIND + char_width = _kind_to_byte_width(kind) + s = _malloc_string(kind, char_width, length, True) + if flag: + _set_code_point(s, 0, ord('-')) + idx = length - 1 + while n > 0: + n, digit = divmod(n, ten) + c = ord('0') + digit + _set_code_point(s, idx, c) + idx -= 1 + return s + return impl + + +@overload_method(types.Integer, "__repr__") +def integer_repr(n): + return lambda n: n.__str__() + + +@overload_method(types.Boolean, "__repr__") +@overload_method(types.Boolean, "__str__") +def boolean_str(b): + return lambda b: 'True' if b else 'False' + + +# ------------------------------------------------------------------------------ +# iteration +# ------------------------------------------------------------------------------ + + +@lower_builtin('getiter', types.UnicodeType) +def getiter_unicode(context, builder, sig, args): + [ty] = sig.args + [data] = args + + iterobj = context.make_helper(builder, sig.return_type) + + # set the index to zero + zero = context.get_constant(types.uintp, 0) + indexptr = cgutils.alloca_once_value(builder, zero) + + iterobj.index = indexptr + + # wire in the unicode type data + iterobj.data = data + + # incref as needed + if context.enable_nrt: + context.nrt.incref(builder, ty, data) + + res = iterobj._getvalue() + return impl_ret_new_ref(context, builder, sig.return_type, res) + + +@lower_builtin('iternext', types.UnicodeIteratorType) +# a new ref counted object is put into result._yield so set the new_ref to True! +@iternext_impl(RefType.NEW) +def iternext_unicode(context, builder, sig, args, result): + [iterty] = sig.args + [iter] = args + + tyctx = context.typing_context + + # get ref to unicode.__getitem__ + fnty = tyctx.resolve_value_type(operator.getitem) + getitem_sig = fnty.get_call_type(tyctx, (types.unicode_type, types.uintp), + {}) + getitem_impl = context.get_function(fnty, getitem_sig) + + # get ref to unicode.__len__ + fnty = tyctx.resolve_value_type(len) + len_sig = fnty.get_call_type(tyctx, (types.unicode_type,), {}) + len_impl = context.get_function(fnty, len_sig) + + # grab unicode iterator struct + iterobj = context.make_helper(builder, iterty, value=iter) + + # find the length of the string + strlen = len_impl(builder, (iterobj.data,)) + + # find the current index + index = builder.load(iterobj.index) + + # see if the index is in range + is_valid = builder.icmp_unsigned('<', index, strlen) + result.set_valid(is_valid) + + with builder.if_then(is_valid): + # return value at index + gotitem = getitem_impl(builder, (iterobj.data, index,)) + result.yield_(gotitem) + + # bump index for next cycle + nindex = cgutils.increment_index(builder, index) + builder.store(nindex, iterobj.index) diff --git a/shared/package-files/2c/2c4d87bd905cb19fed45bfaee379fb6f986707d6b83146e846fe6924a08a9a9f/CompileTimeFunctionPointer.h b/shared/package-files/2c/2c4d87bd905cb19fed45bfaee379fb6f986707d6b83146e846fe6924a08a9a9f/CompileTimeFunctionPointer.h new file mode 100644 index 0000000000000000000000000000000000000000..a5fbd1f3e1f3849b4585a623c37e2a5cf2a0a924 --- /dev/null +++ b/shared/package-files/2c/2c4d87bd905cb19fed45bfaee379fb6f986707d6b83146e846fe6924a08a9a9f/CompileTimeFunctionPointer.h @@ -0,0 +1,57 @@ +#pragma once + +#include +#include + +namespace c10 { + +/** + * Represent a function pointer as a C++ type. + * This allows using the function pointer as a type + * in a template and calling it from inside the template + * allows the compiler to inline the call because it + * knows the function pointer at compile time. + * + * Example 1: + * int add(int a, int b) {return a + b;} + * using Add = TORCH_FN_TYPE(add); + * template struct Executor { + * int execute(int a, int b) { + * return Func::func_ptr()(a, b); + * } + * }; + * Executor executor; + * EXPECT_EQ(3, executor.execute(1, 2)); + * + * Example 2: + * int add(int a, int b) {return a + b;} + * template int execute(Func, int a, int b) { + * return Func::func_ptr()(a, b); + * } + * EXPECT_EQ(3, execute(TORCH_FN(add), 1, 2)); + */ +template +struct CompileTimeFunctionPointer final { + static_assert( + guts::is_function_type::value, + "TORCH_FN can only wrap function types."); + using FuncType = FuncType_; + + static constexpr FuncType* func_ptr() { + return func_ptr_; + } +}; + +template +struct is_compile_time_function_pointer : std::false_type {}; +template +struct is_compile_time_function_pointer< + CompileTimeFunctionPointer> : std::true_type {}; + +} // namespace c10 + +#define TORCH_FN_TYPE(func) \ + ::c10::CompileTimeFunctionPointer< \ + std::remove_pointer_t>, \ + func> +#define TORCH_FN(func) TORCH_FN_TYPE(func)() diff --git a/shared/package-files/2c/2c4e5e916322e4a194aa1da2a59bbb80735df5f6a6de49725e6769b8d5761c7a/check_strict_fusion.h b/shared/package-files/2c/2c4e5e916322e4a194aa1da2a59bbb80735df5f6a6de49725e6769b8d5761c7a/check_strict_fusion.h new file mode 100644 index 0000000000000000000000000000000000000000..87e86d8a7e4b2965a16422cd952418aef7e7db5e --- /dev/null +++ b/shared/package-files/2c/2c4e5e916322e4a194aa1da2a59bbb80735df5f6a6de49725e6769b8d5761c7a/check_strict_fusion.h @@ -0,0 +1,12 @@ + +#pragma once + +#include + +namespace torch { +namespace jit { + +TORCH_API void CheckStrictFusion(std::shared_ptr& graph); + +} // namespace jit +} // namespace torch diff --git a/shared/package-files/2c/2c4f79f3ef82324048dabde5d524319821dd092c3a1d8ebe4615829ddbb3180e/user_array.py b/shared/package-files/2c/2c4f79f3ef82324048dabde5d524319821dd092c3a1d8ebe4615829ddbb3180e/user_array.py new file mode 100644 index 0000000000000000000000000000000000000000..0e96b477ef7456e5ce575b17698323b7ff479dcd --- /dev/null +++ b/shared/package-files/2c/2c4f79f3ef82324048dabde5d524319821dd092c3a1d8ebe4615829ddbb3180e/user_array.py @@ -0,0 +1,286 @@ +""" +Standard container-class for easy multiple-inheritance. + +Try to inherit from the ndarray instead of using this class as this is not +complete. + +""" +from numpy.core import ( + array, asarray, absolute, add, subtract, multiply, divide, + remainder, power, left_shift, right_shift, bitwise_and, bitwise_or, + bitwise_xor, invert, less, less_equal, not_equal, equal, greater, + greater_equal, shape, reshape, arange, sin, sqrt, transpose +) + + +class container: + """ + container(data, dtype=None, copy=True) + + Standard container-class for easy multiple-inheritance. + + Methods + ------- + copy + tostring + byteswap + astype + + """ + def __init__(self, data, dtype=None, copy=True): + self.array = array(data, dtype, copy=copy) + + def __repr__(self): + if self.ndim > 0: + return self.__class__.__name__ + repr(self.array)[len("array"):] + else: + return self.__class__.__name__ + "(" + repr(self.array) + ")" + + def __array__(self, t=None): + if t: + return self.array.astype(t) + return self.array + + # Array as sequence + def __len__(self): + return len(self.array) + + def __getitem__(self, index): + return self._rc(self.array[index]) + + def __setitem__(self, index, value): + self.array[index] = asarray(value, self.dtype) + + def __abs__(self): + return self._rc(absolute(self.array)) + + def __neg__(self): + return self._rc(-self.array) + + def __add__(self, other): + return self._rc(self.array + asarray(other)) + + __radd__ = __add__ + + def __iadd__(self, other): + add(self.array, other, self.array) + return self + + def __sub__(self, other): + return self._rc(self.array - asarray(other)) + + def __rsub__(self, other): + return self._rc(asarray(other) - self.array) + + def __isub__(self, other): + subtract(self.array, other, self.array) + return self + + def __mul__(self, other): + return self._rc(multiply(self.array, asarray(other))) + + __rmul__ = __mul__ + + def __imul__(self, other): + multiply(self.array, other, self.array) + return self + + def __div__(self, other): + return self._rc(divide(self.array, asarray(other))) + + def __rdiv__(self, other): + return self._rc(divide(asarray(other), self.array)) + + def __idiv__(self, other): + divide(self.array, other, self.array) + return self + + def __mod__(self, other): + return self._rc(remainder(self.array, other)) + + def __rmod__(self, other): + return self._rc(remainder(other, self.array)) + + def __imod__(self, other): + remainder(self.array, other, self.array) + return self + + def __divmod__(self, other): + return (self._rc(divide(self.array, other)), + self._rc(remainder(self.array, other))) + + def __rdivmod__(self, other): + return (self._rc(divide(other, self.array)), + self._rc(remainder(other, self.array))) + + def __pow__(self, other): + return self._rc(power(self.array, asarray(other))) + + def __rpow__(self, other): + return self._rc(power(asarray(other), self.array)) + + def __ipow__(self, other): + power(self.array, other, self.array) + return self + + def __lshift__(self, other): + return self._rc(left_shift(self.array, other)) + + def __rshift__(self, other): + return self._rc(right_shift(self.array, other)) + + def __rlshift__(self, other): + return self._rc(left_shift(other, self.array)) + + def __rrshift__(self, other): + return self._rc(right_shift(other, self.array)) + + def __ilshift__(self, other): + left_shift(self.array, other, self.array) + return self + + def __irshift__(self, other): + right_shift(self.array, other, self.array) + return self + + def __and__(self, other): + return self._rc(bitwise_and(self.array, other)) + + def __rand__(self, other): + return self._rc(bitwise_and(other, self.array)) + + def __iand__(self, other): + bitwise_and(self.array, other, self.array) + return self + + def __xor__(self, other): + return self._rc(bitwise_xor(self.array, other)) + + def __rxor__(self, other): + return self._rc(bitwise_xor(other, self.array)) + + def __ixor__(self, other): + bitwise_xor(self.array, other, self.array) + return self + + def __or__(self, other): + return self._rc(bitwise_or(self.array, other)) + + def __ror__(self, other): + return self._rc(bitwise_or(other, self.array)) + + def __ior__(self, other): + bitwise_or(self.array, other, self.array) + return self + + def __pos__(self): + return self._rc(self.array) + + def __invert__(self): + return self._rc(invert(self.array)) + + def _scalarfunc(self, func): + if self.ndim == 0: + return func(self[0]) + else: + raise TypeError( + "only rank-0 arrays can be converted to Python scalars.") + + def __complex__(self): + return self._scalarfunc(complex) + + def __float__(self): + return self._scalarfunc(float) + + def __int__(self): + return self._scalarfunc(int) + + def __hex__(self): + return self._scalarfunc(hex) + + def __oct__(self): + return self._scalarfunc(oct) + + def __lt__(self, other): + return self._rc(less(self.array, other)) + + def __le__(self, other): + return self._rc(less_equal(self.array, other)) + + def __eq__(self, other): + return self._rc(equal(self.array, other)) + + def __ne__(self, other): + return self._rc(not_equal(self.array, other)) + + def __gt__(self, other): + return self._rc(greater(self.array, other)) + + def __ge__(self, other): + return self._rc(greater_equal(self.array, other)) + + def copy(self): + "" + return self._rc(self.array.copy()) + + def tostring(self): + "" + return self.array.tostring() + + def tobytes(self): + "" + return self.array.tobytes() + + def byteswap(self): + "" + return self._rc(self.array.byteswap()) + + def astype(self, typecode): + "" + return self._rc(self.array.astype(typecode)) + + def _rc(self, a): + if len(shape(a)) == 0: + return a + else: + return self.__class__(a) + + def __array_wrap__(self, *args): + return self.__class__(args[0]) + + def __setattr__(self, attr, value): + if attr == 'array': + object.__setattr__(self, attr, value) + return + try: + self.array.__setattr__(attr, value) + except AttributeError: + object.__setattr__(self, attr, value) + + # Only called after other approaches fail. + def __getattr__(self, attr): + if (attr == 'array'): + return object.__getattribute__(self, attr) + return self.array.__getattribute__(attr) + +############################################################# +# Test of class container +############################################################# +if __name__ == '__main__': + temp = reshape(arange(10000), (100, 100)) + + ua = container(temp) + # new object created begin test + print(dir(ua)) + print(shape(ua), ua.shape) # I have changed Numeric.py + + ua_small = ua[:3, :5] + print(ua_small) + # this did not change ua[0,0], which is not normal behavior + ua_small[0, 0] = 10 + print(ua_small[0, 0], ua[0, 0]) + print(sin(ua_small) / 3. * 6. + sqrt(ua_small ** 2)) + print(less(ua_small, 103), type(less(ua_small, 103))) + print(type(ua_small * reshape(arange(15), shape(ua_small)))) + print(reshape(ua_small, (5, 3))) + print(transpose(ua_small)) diff --git a/shared/package-files/2c/2c4fc58f6823fe4ff9d7af7b8e9668be03189e6c0ed620fbb587fa47d3fcc28f/OpenJPEGConfig.cmake b/shared/package-files/2c/2c4fc58f6823fe4ff9d7af7b8e9668be03189e6c0ed620fbb587fa47d3fcc28f/OpenJPEGConfig.cmake new file mode 100644 index 0000000000000000000000000000000000000000..a306985eda81c307facc8e3efdb2938f6f3ff1f7 --- /dev/null +++ b/shared/package-files/2c/2c4fc58f6823fe4ff9d7af7b8e9668be03189e6c0ed620fbb587fa47d3fcc28f/OpenJPEGConfig.cmake @@ -0,0 +1,49 @@ +#----------------------------------------------------------------------------- +# +# OPENJPEGConfig.cmake - CMake configuration file for external projects. +# +# This file is configured by OPENJPEG and used by the UseOPENJPEG.cmake +# module to load OPENJPEG's settings for an external project. + +# The OPENJPEG version number. +set(OPENJPEG_MAJOR_VERSION "2") +set(OPENJPEG_MINOR_VERSION "4") +set(OPENJPEG_BUILD_VERSION "0") + +# The libraries. +set(OPENJPEG_LIBRARIES "openjp2") + +# The CMake macros dir. +set(OPENJPEG_CMAKE_DIR "lib/openjpeg-2.4") + +# The configuration options. +set(OPENJPEG_BUILD_SHARED_LIBS "ON") + +# The "use" file. +set(OPENJPEG_USE_FILE "") + +get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +if(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake) + # This is an install tree + include(${SELF_DIR}/OpenJPEGTargets.cmake) + + set(INC_DIR "/opt/conda/include/openjpeg-2.4") + get_filename_component(OPENJPEG_INCLUDE_DIRS "${INC_DIR}" ABSOLUTE) + +else() + if(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake) + # This is a build tree + set( OPENJPEG_INCLUDE_DIRS ) + + include(${SELF_DIR}/OpenJPEGExports.cmake) + + else() + message(FATAL_ERROR "ooops") + endif() +endif() + +set(OPENJPEG_USE_FILE ${SELF_DIR}/UseOPENJPEG.cmake) + +# Backward compatible part: +set(OPENJPEG_FOUND TRUE) + diff --git a/shared/package-files/2c/2c530fa047ae7fbc34001a5ebe7200ba8c674cbfa7d45d72cc156d076cfb9b4f/sbu.py b/shared/package-files/2c/2c530fa047ae7fbc34001a5ebe7200ba8c674cbfa7d45d72cc156d076cfb9b4f/sbu.py new file mode 100644 index 0000000000000000000000000000000000000000..3c349370a12a4a6c0abea9f6e6ab5bd06a84107e --- /dev/null +++ b/shared/package-files/2c/2c530fa047ae7fbc34001a5ebe7200ba8c674cbfa7d45d72cc156d076cfb9b4f/sbu.py @@ -0,0 +1,110 @@ +import os +from pathlib import Path +from typing import Any, Callable, Optional, Tuple, Union + +from PIL import Image + +from .utils import check_integrity, download_and_extract_archive, download_url +from .vision import VisionDataset + + +class SBU(VisionDataset): + """`SBU Captioned Photo `_ Dataset. + + Args: + root (str or ``pathlib.Path``): Root directory of dataset where tarball + ``SBUCaptionedPhotoDataset.tar.gz`` exists. + transform (callable, optional): A function/transform that takes in a PIL image + and returns a transformed version. E.g, ``transforms.RandomCrop`` + target_transform (callable, optional): A function/transform that takes in the + target and transforms it. + download (bool, optional): If True, downloads the dataset from the internet and + puts it in root directory. If dataset is already downloaded, it is not + downloaded again. + """ + + url = "https://www.cs.rice.edu/~vo9/sbucaptions/SBUCaptionedPhotoDataset.tar.gz" + filename = "SBUCaptionedPhotoDataset.tar.gz" + md5_checksum = "9aec147b3488753cf758b4d493422285" + + def __init__( + self, + root: Union[str, Path], + transform: Optional[Callable] = None, + target_transform: Optional[Callable] = None, + download: bool = True, + ) -> None: + super().__init__(root, transform=transform, target_transform=target_transform) + + if download: + self.download() + + if not self._check_integrity(): + raise RuntimeError("Dataset not found or corrupted. You can use download=True to download it") + + # Read the caption for each photo + self.photos = [] + self.captions = [] + + file1 = os.path.join(self.root, "dataset", "SBU_captioned_photo_dataset_urls.txt") + file2 = os.path.join(self.root, "dataset", "SBU_captioned_photo_dataset_captions.txt") + + for line1, line2 in zip(open(file1), open(file2)): + url = line1.rstrip() + photo = os.path.basename(url) + filename = os.path.join(self.root, "dataset", photo) + if os.path.exists(filename): + caption = line2.rstrip() + self.photos.append(photo) + self.captions.append(caption) + + def __getitem__(self, index: int) -> Tuple[Any, Any]: + """ + Args: + index (int): Index + + Returns: + tuple: (image, target) where target is a caption for the photo. + """ + filename = os.path.join(self.root, "dataset", self.photos[index]) + img = Image.open(filename).convert("RGB") + if self.transform is not None: + img = self.transform(img) + + target = self.captions[index] + if self.target_transform is not None: + target = self.target_transform(target) + + return img, target + + def __len__(self) -> int: + """The number of photos in the dataset.""" + return len(self.photos) + + def _check_integrity(self) -> bool: + """Check the md5 checksum of the downloaded tarball.""" + root = self.root + fpath = os.path.join(root, self.filename) + if not check_integrity(fpath, self.md5_checksum): + return False + return True + + def download(self) -> None: + """Download and extract the tarball, and download each individual photo.""" + + if self._check_integrity(): + print("Files already downloaded and verified") + return + + download_and_extract_archive(self.url, self.root, self.root, self.filename, self.md5_checksum) + + # Download individual photos + with open(os.path.join(self.root, "dataset", "SBU_captioned_photo_dataset_urls.txt")) as fh: + for line in fh: + url = line.rstrip() + try: + download_url(url, os.path.join(self.root, "dataset")) + except OSError: + # The images point to public images on Flickr. + # Note: Images might be removed by users at anytime. + pass diff --git a/shared/package-files/2c/2c5e199aed6f8495bb25ef50f9cc2445cdf13fb461cb2ed79f08f6e99eacbf68/config.py b/shared/package-files/2c/2c5e199aed6f8495bb25ef50f9cc2445cdf13fb461cb2ed79f08f6e99eacbf68/config.py new file mode 100644 index 0000000000000000000000000000000000000000..76d9af14aaf7df47c4551c169f27b05abf9c269e --- /dev/null +++ b/shared/package-files/2c/2c5e199aed6f8495bb25ef50f9cc2445cdf13fb461cb2ed79f08f6e99eacbf68/config.py @@ -0,0 +1,131 @@ +from __future__ import annotations + +import configparser +import json +import os +import warnings +from typing import Any + +conf: dict[str, dict[str, Any]] = {} +default_conf_dir = os.path.join(os.path.expanduser("~"), ".config/fsspec") +conf_dir = os.environ.get("FSSPEC_CONFIG_DIR", default_conf_dir) + + +def set_conf_env(conf_dict, envdict=os.environ): + """Set config values from environment variables + + Looks for variables of the form ``FSSPEC_`` and + ``FSSPEC__``. For ``FSSPEC_`` the value is parsed + as a json dictionary and used to ``update`` the config of the + corresponding protocol. For ``FSSPEC__`` there is no + attempt to convert the string value, but the kwarg keys will be lower-cased. + + The ``FSSPEC__`` variables are applied after the + ``FSSPEC_`` ones. + + Parameters + ---------- + conf_dict : dict(str, dict) + This dict will be mutated + envdict : dict-like(str, str) + Source for the values - usually the real environment + """ + kwarg_keys = [] + for key in envdict: + if key.startswith("FSSPEC_") and len(key) > 7 and key[7] != "_": + if key.count("_") > 1: + kwarg_keys.append(key) + continue + try: + value = json.loads(envdict[key]) + except json.decoder.JSONDecodeError as ex: + warnings.warn( + f"Ignoring environment variable {key} due to a parse failure: {ex}" + ) + else: + if isinstance(value, dict): + _, proto = key.split("_", 1) + conf_dict.setdefault(proto.lower(), {}).update(value) + else: + warnings.warn( + f"Ignoring environment variable {key} due to not being a dict:" + f" {type(value)}" + ) + elif key.startswith("FSSPEC"): + warnings.warn( + f"Ignoring environment variable {key} due to having an unexpected name" + ) + + for key in kwarg_keys: + _, proto, kwarg = key.split("_", 2) + conf_dict.setdefault(proto.lower(), {})[kwarg.lower()] = envdict[key] + + +def set_conf_files(cdir, conf_dict): + """Set config values from files + + Scans for INI and JSON files in the given dictionary, and uses their + contents to set the config. In case of repeated values, later values + win. + + In the case of INI files, all values are strings, and these will not + be converted. + + Parameters + ---------- + cdir : str + Directory to search + conf_dict : dict(str, dict) + This dict will be mutated + """ + if not os.path.isdir(cdir): + return + allfiles = sorted(os.listdir(cdir)) + for fn in allfiles: + if fn.endswith(".ini"): + ini = configparser.ConfigParser() + ini.read(os.path.join(cdir, fn)) + for key in ini: + if key == "DEFAULT": + continue + conf_dict.setdefault(key, {}).update(dict(ini[key])) + if fn.endswith(".json"): + with open(os.path.join(cdir, fn)) as f: + js = json.load(f) + for key in js: + conf_dict.setdefault(key, {}).update(dict(js[key])) + + +def apply_config(cls, kwargs, conf_dict=None): + """Supply default values for kwargs when instantiating class + + Augments the passed kwargs, by finding entries in the config dict + which match the classes ``.protocol`` attribute (one or more str) + + Parameters + ---------- + cls : file system implementation + kwargs : dict + conf_dict : dict of dict + Typically this is the global configuration + + Returns + ------- + dict : the modified set of kwargs + """ + if conf_dict is None: + conf_dict = conf + protos = cls.protocol if isinstance(cls.protocol, (tuple, list)) else [cls.protocol] + kw = {} + for proto in protos: + # default kwargs from the current state of the config + if proto in conf_dict: + kw.update(conf_dict[proto]) + # explicit kwargs always win + kw.update(**kwargs) + kwargs = kw + return kwargs + + +set_conf_files(conf_dir, conf) +set_conf_env(conf) diff --git a/shared/package-files/2c/2c7f0121193395750eab2b2abf5059d9a3b1a61f81763f52511265d7bca5cb21/fix_filter.py b/shared/package-files/2c/2c7f0121193395750eab2b2abf5059d9a3b1a61f81763f52511265d7bca5cb21/fix_filter.py new file mode 100644 index 0000000000000000000000000000000000000000..38e9078f11ac88f346b7ba2468c69dc5a4f74dd5 --- /dev/null +++ b/shared/package-files/2c/2c7f0121193395750eab2b2abf5059d9a3b1a61f81763f52511265d7bca5cb21/fix_filter.py @@ -0,0 +1,94 @@ +# Copyright 2007 Google, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Fixer that changes filter(F, X) into list(filter(F, X)). + +We avoid the transformation if the filter() call is directly contained +in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or +for V in <>:. + +NOTE: This is still not correct if the original code was depending on +filter(F, X) to return a string if X is a string and a tuple if X is a +tuple. That would require type inference, which we don't do. Let +Python 2.6 figure it out. +""" + +# Local imports +from .. import fixer_base +from ..pytree import Node +from ..pygram import python_symbols as syms +from ..fixer_util import Name, ArgList, ListComp, in_special_context, parenthesize + + +class FixFilter(fixer_base.ConditionalFix): + BM_compatible = True + + PATTERN = """ + filter_lambda=power< + 'filter' + trailer< + '(' + arglist< + lambdef< 'lambda' + (fp=NAME | vfpdef< '(' fp=NAME ')'> ) ':' xp=any + > + ',' + it=any + > + ')' + > + [extra_trailers=trailer*] + > + | + power< + 'filter' + trailer< '(' arglist< none='None' ',' seq=any > ')' > + [extra_trailers=trailer*] + > + | + power< + 'filter' + args=trailer< '(' [any] ')' > + [extra_trailers=trailer*] + > + """ + + skip_on = "future_builtins.filter" + + def transform(self, node, results): + if self.should_skip(node): + return + + trailers = [] + if 'extra_trailers' in results: + for t in results['extra_trailers']: + trailers.append(t.clone()) + + if "filter_lambda" in results: + xp = results.get("xp").clone() + if xp.type == syms.test: + xp.prefix = "" + xp = parenthesize(xp) + + new = ListComp(results.get("fp").clone(), + results.get("fp").clone(), + results.get("it").clone(), xp) + new = Node(syms.power, [new] + trailers, prefix="") + + elif "none" in results: + new = ListComp(Name("_f"), + Name("_f"), + results["seq"].clone(), + Name("_f")) + new = Node(syms.power, [new] + trailers, prefix="") + + else: + if in_special_context(node): + return None + + args = results['args'].clone() + new = Node(syms.power, [Name("filter"), args], prefix="") + new = Node(syms.power, [Name("list"), ArgList([new])] + trailers) + new.prefix = "" + new.prefix = node.prefix + return new diff --git a/shared/package-files/2c/2c8bbff3ffd128cbfc11f5c07e4af4f1429848cab98462412c7c83492e6777ef/util.py b/shared/package-files/2c/2c8bbff3ffd128cbfc11f5c07e4af4f1429848cab98462412c7c83492e6777ef/util.py new file mode 100644 index 0000000000000000000000000000000000000000..94e736f56e4f10184da8df0ebe65f58c78079048 --- /dev/null +++ b/shared/package-files/2c/2c8bbff3ffd128cbfc11f5c07e4af4f1429848cab98462412c7c83492e6777ef/util.py @@ -0,0 +1,536 @@ +from sympy.combinatorics.permutations import Permutation, _af_invert, _af_rmul +from sympy.ntheory import isprime + +rmul = Permutation.rmul +_af_new = Permutation._af_new + +############################################ +# +# Utilities for computational group theory +# +############################################ + + +def _base_ordering(base, degree): + r""" + Order `\{0, 1, \dots, n-1\}` so that base points come first and in order. + + Parameters + ========== + + base : the base + degree : the degree of the associated permutation group + + Returns + ======= + + A list ``base_ordering`` such that ``base_ordering[point]`` is the + number of ``point`` in the ordering. + + Examples + ======== + + >>> from sympy.combinatorics import SymmetricGroup + >>> from sympy.combinatorics.util import _base_ordering + >>> S = SymmetricGroup(4) + >>> S.schreier_sims() + >>> _base_ordering(S.base, S.degree) + [0, 1, 2, 3] + + Notes + ===== + + This is used in backtrack searches, when we define a relation `\ll` on + the underlying set for a permutation group of degree `n`, + `\{0, 1, \dots, n-1\}`, so that if `(b_1, b_2, \dots, b_k)` is a base we + have `b_i \ll b_j` whenever `i>> from sympy.combinatorics.util import _check_cycles_alt_sym + >>> from sympy.combinatorics import Permutation + >>> a = Permutation([[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [11, 12]]) + >>> _check_cycles_alt_sym(a) + False + >>> b = Permutation([[0, 1, 2, 3, 4, 5, 6], [7, 8, 9, 10]]) + >>> _check_cycles_alt_sym(b) + True + + See Also + ======== + + sympy.combinatorics.perm_groups.PermutationGroup.is_alt_sym + + """ + n = perm.size + af = perm.array_form + current_len = 0 + total_len = 0 + used = set() + for i in range(n//2): + if i not in used and i < n//2 - total_len: + current_len = 1 + used.add(i) + j = i + while af[j] != i: + current_len += 1 + j = af[j] + used.add(j) + total_len += current_len + if current_len > n//2 and current_len < n - 2 and isprime(current_len): + return True + return False + + +def _distribute_gens_by_base(base, gens): + r""" + Distribute the group elements ``gens`` by membership in basic stabilizers. + + Explanation + =========== + + Notice that for a base `(b_1, b_2, \dots, b_k)`, the basic stabilizers + are defined as `G^{(i)} = G_{b_1, \dots, b_{i-1}}` for + `i \in\{1, 2, \dots, k\}`. + + Parameters + ========== + + base : a sequence of points in `\{0, 1, \dots, n-1\}` + gens : a list of elements of a permutation group of degree `n`. + + Returns + ======= + + List of length `k`, where `k` is + the length of ``base``. The `i`-th entry contains those elements in + ``gens`` which fix the first `i` elements of ``base`` (so that the + `0`-th entry is equal to ``gens`` itself). If no element fixes the first + `i` elements of ``base``, the `i`-th element is set to a list containing + the identity element. + + Examples + ======== + + >>> from sympy.combinatorics.named_groups import DihedralGroup + >>> from sympy.combinatorics.util import _distribute_gens_by_base + >>> D = DihedralGroup(3) + >>> D.schreier_sims() + >>> D.strong_gens + [(0 1 2), (0 2), (1 2)] + >>> D.base + [0, 1] + >>> _distribute_gens_by_base(D.base, D.strong_gens) + [[(0 1 2), (0 2), (1 2)], + [(1 2)]] + + See Also + ======== + + _strong_gens_from_distr, _orbits_transversals_from_bsgs, + _handle_precomputed_bsgs + + """ + base_len = len(base) + degree = gens[0].size + stabs = [[] for _ in range(base_len)] + max_stab_index = 0 + for gen in gens: + j = 0 + while j < base_len - 1 and gen._array_form[base[j]] == base[j]: + j += 1 + if j > max_stab_index: + max_stab_index = j + for k in range(j + 1): + stabs[k].append(gen) + for i in range(max_stab_index + 1, base_len): + stabs[i].append(_af_new(list(range(degree)))) + return stabs + + +def _handle_precomputed_bsgs(base, strong_gens, transversals=None, + basic_orbits=None, strong_gens_distr=None): + """ + Calculate BSGS-related structures from those present. + + Explanation + =========== + + The base and strong generating set must be provided; if any of the + transversals, basic orbits or distributed strong generators are not + provided, they will be calculated from the base and strong generating set. + + Parameters + ========== + + ``base`` - the base + ``strong_gens`` - the strong generators + ``transversals`` - basic transversals + ``basic_orbits`` - basic orbits + ``strong_gens_distr`` - strong generators distributed by membership in basic + stabilizers + + Returns + ======= + + ``(transversals, basic_orbits, strong_gens_distr)`` where ``transversals`` + are the basic transversals, ``basic_orbits`` are the basic orbits, and + ``strong_gens_distr`` are the strong generators distributed by membership + in basic stabilizers. + + Examples + ======== + + >>> from sympy.combinatorics.named_groups import DihedralGroup + >>> from sympy.combinatorics.util import _handle_precomputed_bsgs + >>> D = DihedralGroup(3) + >>> D.schreier_sims() + >>> _handle_precomputed_bsgs(D.base, D.strong_gens, + ... basic_orbits=D.basic_orbits) + ([{0: (2), 1: (0 1 2), 2: (0 2)}, {1: (2), 2: (1 2)}], [[0, 1, 2], [1, 2]], [[(0 1 2), (0 2), (1 2)], [(1 2)]]) + + See Also + ======== + + _orbits_transversals_from_bsgs, _distribute_gens_by_base + + """ + if strong_gens_distr is None: + strong_gens_distr = _distribute_gens_by_base(base, strong_gens) + if transversals is None: + if basic_orbits is None: + basic_orbits, transversals = \ + _orbits_transversals_from_bsgs(base, strong_gens_distr) + else: + transversals = \ + _orbits_transversals_from_bsgs(base, strong_gens_distr, + transversals_only=True) + else: + if basic_orbits is None: + base_len = len(base) + basic_orbits = [None]*base_len + for i in range(base_len): + basic_orbits[i] = list(transversals[i].keys()) + return transversals, basic_orbits, strong_gens_distr + + +def _orbits_transversals_from_bsgs(base, strong_gens_distr, + transversals_only=False, slp=False): + """ + Compute basic orbits and transversals from a base and strong generating set. + + Explanation + =========== + + The generators are provided as distributed across the basic stabilizers. + If the optional argument ``transversals_only`` is set to True, only the + transversals are returned. + + Parameters + ========== + + ``base`` - The base. + ``strong_gens_distr`` - Strong generators distributed by membership in basic + stabilizers. + ``transversals_only`` - bool + A flag switching between returning only the + transversals and both orbits and transversals. + ``slp`` - + If ``True``, return a list of dictionaries containing the + generator presentations of the elements of the transversals, + i.e. the list of indices of generators from ``strong_gens_distr[i]`` + such that their product is the relevant transversal element. + + Examples + ======== + + >>> from sympy.combinatorics import SymmetricGroup + >>> from sympy.combinatorics.util import _distribute_gens_by_base + >>> S = SymmetricGroup(3) + >>> S.schreier_sims() + >>> strong_gens_distr = _distribute_gens_by_base(S.base, S.strong_gens) + >>> (S.base, strong_gens_distr) + ([0, 1], [[(0 1 2), (2)(0 1), (1 2)], [(1 2)]]) + + See Also + ======== + + _distribute_gens_by_base, _handle_precomputed_bsgs + + """ + from sympy.combinatorics.perm_groups import _orbit_transversal + base_len = len(base) + degree = strong_gens_distr[0][0].size + transversals = [None]*base_len + slps = [None]*base_len + if transversals_only is False: + basic_orbits = [None]*base_len + for i in range(base_len): + transversals[i], slps[i] = _orbit_transversal(degree, strong_gens_distr[i], + base[i], pairs=True, slp=True) + transversals[i] = dict(transversals[i]) + if transversals_only is False: + basic_orbits[i] = list(transversals[i].keys()) + if transversals_only: + return transversals + else: + if not slp: + return basic_orbits, transversals + return basic_orbits, transversals, slps + + +def _remove_gens(base, strong_gens, basic_orbits=None, strong_gens_distr=None): + """ + Remove redundant generators from a strong generating set. + + Parameters + ========== + + ``base`` - a base + ``strong_gens`` - a strong generating set relative to ``base`` + ``basic_orbits`` - basic orbits + ``strong_gens_distr`` - strong generators distributed by membership in basic + stabilizers + + Returns + ======= + + A strong generating set with respect to ``base`` which is a subset of + ``strong_gens``. + + Examples + ======== + + >>> from sympy.combinatorics import SymmetricGroup + >>> from sympy.combinatorics.util import _remove_gens + >>> from sympy.combinatorics.testutil import _verify_bsgs + >>> S = SymmetricGroup(15) + >>> base, strong_gens = S.schreier_sims_incremental() + >>> new_gens = _remove_gens(base, strong_gens) + >>> len(new_gens) + 14 + >>> _verify_bsgs(S, base, new_gens) + True + + Notes + ===== + + This procedure is outlined in [1],p.95. + + References + ========== + + .. [1] Holt, D., Eick, B., O'Brien, E. + "Handbook of computational group theory" + + """ + from sympy.combinatorics.perm_groups import _orbit + base_len = len(base) + degree = strong_gens[0].size + if strong_gens_distr is None: + strong_gens_distr = _distribute_gens_by_base(base, strong_gens) + if basic_orbits is None: + basic_orbits = [] + for i in range(base_len): + basic_orbit = _orbit(degree, strong_gens_distr[i], base[i]) + basic_orbits.append(basic_orbit) + strong_gens_distr.append([]) + res = strong_gens[:] + for i in range(base_len - 1, -1, -1): + gens_copy = strong_gens_distr[i][:] + for gen in strong_gens_distr[i]: + if gen not in strong_gens_distr[i + 1]: + temp_gens = gens_copy[:] + temp_gens.remove(gen) + if temp_gens == []: + continue + temp_orbit = _orbit(degree, temp_gens, base[i]) + if temp_orbit == basic_orbits[i]: + gens_copy.remove(gen) + res.remove(gen) + return res + + +def _strip(g, base, orbits, transversals): + """ + Attempt to decompose a permutation using a (possibly partial) BSGS + structure. + + Explanation + =========== + + This is done by treating the sequence ``base`` as an actual base, and + the orbits ``orbits`` and transversals ``transversals`` as basic orbits and + transversals relative to it. + + This process is called "sifting". A sift is unsuccessful when a certain + orbit element is not found or when after the sift the decomposition + does not end with the identity element. + + The argument ``transversals`` is a list of dictionaries that provides + transversal elements for the orbits ``orbits``. + + Parameters + ========== + + ``g`` - permutation to be decomposed + ``base`` - sequence of points + ``orbits`` - a list in which the ``i``-th entry is an orbit of ``base[i]`` + under some subgroup of the pointwise stabilizer of ` + `base[0], base[1], ..., base[i - 1]``. The groups themselves are implicit + in this function since the only information we need is encoded in the orbits + and transversals + ``transversals`` - a list of orbit transversals associated with the orbits + ``orbits``. + + Examples + ======== + + >>> from sympy.combinatorics import Permutation, SymmetricGroup + >>> from sympy.combinatorics.util import _strip + >>> S = SymmetricGroup(5) + >>> S.schreier_sims() + >>> g = Permutation([0, 2, 3, 1, 4]) + >>> _strip(g, S.base, S.basic_orbits, S.basic_transversals) + ((4), 5) + + Notes + ===== + + The algorithm is described in [1],pp.89-90. The reason for returning + both the current state of the element being decomposed and the level + at which the sifting ends is that they provide important information for + the randomized version of the Schreier-Sims algorithm. + + References + ========== + + .. [1] Holt, D., Eick, B., O'Brien, E."Handbook of computational group theory" + + See Also + ======== + + sympy.combinatorics.perm_groups.PermutationGroup.schreier_sims + sympy.combinatorics.perm_groups.PermutationGroup.schreier_sims_random + + """ + h = g._array_form + base_len = len(base) + for i in range(base_len): + beta = h[base[i]] + if beta == base[i]: + continue + if beta not in orbits[i]: + return _af_new(h), i + 1 + u = transversals[i][beta]._array_form + h = _af_rmul(_af_invert(u), h) + return _af_new(h), base_len + 1 + + +def _strip_af(h, base, orbits, transversals, j, slp=[], slps={}): + """ + optimized _strip, with h, transversals and result in array form + if the stripped elements is the identity, it returns False, base_len + 1 + + j h[base[i]] == base[i] for i <= j + + """ + base_len = len(base) + for i in range(j+1, base_len): + beta = h[base[i]] + if beta == base[i]: + continue + if beta not in orbits[i]: + if not slp: + return h, i + 1 + return h, i + 1, slp + u = transversals[i][beta] + if h == u: + if not slp: + return False, base_len + 1 + return False, base_len + 1, slp + h = _af_rmul(_af_invert(u), h) + if slp: + u_slp = slps[i][beta][:] + u_slp.reverse() + u_slp = [(i, (g,)) for g in u_slp] + slp = u_slp + slp + if not slp: + return h, base_len + 1 + return h, base_len + 1, slp + + +def _strong_gens_from_distr(strong_gens_distr): + """ + Retrieve strong generating set from generators of basic stabilizers. + + This is just the union of the generators of the first and second basic + stabilizers. + + Parameters + ========== + + ``strong_gens_distr`` - strong generators distributed by membership in basic + stabilizers + + Examples + ======== + + >>> from sympy.combinatorics import SymmetricGroup + >>> from sympy.combinatorics.util import (_strong_gens_from_distr, + ... _distribute_gens_by_base) + >>> S = SymmetricGroup(3) + >>> S.schreier_sims() + >>> S.strong_gens + [(0 1 2), (2)(0 1), (1 2)] + >>> strong_gens_distr = _distribute_gens_by_base(S.base, S.strong_gens) + >>> _strong_gens_from_distr(strong_gens_distr) + [(0 1 2), (2)(0 1), (1 2)] + + See Also + ======== + + _distribute_gens_by_base + + """ + if len(strong_gens_distr) == 1: + return strong_gens_distr[0][:] + else: + result = strong_gens_distr[0] + for gen in strong_gens_distr[1]: + if gen not in result: + result.append(gen) + return result diff --git a/shared/package-files/2c/2c8dbf866ae08de8b32742f43dee25a3696abe0aaf7ddd170e8bd849baf1f5b9/createsuperuser.pyi b/shared/package-files/2c/2c8dbf866ae08de8b32742f43dee25a3696abe0aaf7ddd170e8bd849baf1f5b9/createsuperuser.pyi new file mode 100644 index 0000000000000000000000000000000000000000..efc0752a0ffa25995aa1e5b02f40deef657a595b --- /dev/null +++ b/shared/package-files/2c/2c8dbf866ae08de8b32742f43dee25a3696abe0aaf7ddd170e8bd849baf1f5b9/createsuperuser.pyi @@ -0,0 +1,9 @@ +import getpass as getpass # noqa: F401 +from typing import Any + +from django.core.management.base import BaseCommand + +class NotRunningInTTYException(Exception): ... + +class Command(BaseCommand): + stdin: Any diff --git a/shared/package-files/2c/2c9a1827949e14228a339b020fdcc77f7be6a18c83bd3769a80eac59879d5207/METADATA b/shared/package-files/2c/2c9a1827949e14228a339b020fdcc77f7be6a18c83bd3769a80eac59879d5207/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..d1e86ce2988608094fcd9bdf4d86ba0d54768404 --- /dev/null +++ b/shared/package-files/2c/2c9a1827949e14228a339b020fdcc77f7be6a18c83bd3769a80eac59879d5207/METADATA @@ -0,0 +1,283 @@ +Metadata-Version: 2.1 +Name: traitlets +Version: 5.7.1 +Summary: Traitlets Python configuration system +Project-URL: Homepage, https://github.com/ipython/traitlets +Author-email: IPython Development Team +License: # Licensing terms + + Traitlets is adapted from enthought.traits, Copyright (c) Enthought, Inc., + under the terms of the Modified BSD License. + + This project is licensed under the terms of the Modified BSD License + (also known as New or Revised or 3-Clause BSD), as follows: + + - Copyright (c) 2001-, IPython Development Team + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + Neither the name of the IPython Development Team nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ## About the IPython Development Team + + The IPython Development Team is the set of all contributors to the IPython project. + This includes all of the IPython subprojects. + + The core team that coordinates development on GitHub can be found here: + https://github.com/jupyter/. + + ## Our Copyright Policy + + IPython uses a shared copyright model. Each contributor maintains copyright + over their contributions to IPython. But, it is important to note that these + contributions are typically only changes to the repositories. Thus, the IPython + source code, in its entirety is not the copyright of any single person or + institution. Instead, it is the collective copyright of the entire IPython + Development Team. If individual contributors want to maintain a record of what + changes/contributions they have specific copyright on, they should indicate + their copyright in the commit message of the change, when they commit the + change to one of the IPython repositories. + + With this in mind, the following banner should be used in any source code file + to indicate the copyright and license terms: + + ``` + # Copyright (c) IPython Development Team. + # Distributed under the terms of the Modified BSD License. + ``` +Keywords: Interactive,Interpreter,Shell,Web +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: Science/Research +Classifier: Intended Audience :: System Administrators +Classifier: License :: OSI Approved :: BSD License +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Requires-Python: >=3.7 +Provides-Extra: docs +Requires-Dist: myst-parser; extra == 'docs' +Requires-Dist: pydata-sphinx-theme; extra == 'docs' +Requires-Dist: sphinx; extra == 'docs' +Provides-Extra: lint +Requires-Dist: black>=22.6.0; extra == 'lint' +Requires-Dist: mdformat>0.7; extra == 'lint' +Requires-Dist: ruff>=0.0.156; extra == 'lint' +Provides-Extra: test +Requires-Dist: pre-commit; extra == 'test' +Requires-Dist: pytest; extra == 'test' +Provides-Extra: typing +Requires-Dist: mypy>=0.990; extra == 'typing' +Description-Content-Type: text/markdown + +# Traitlets + +[![Tests](https://github.com/ipython/traitlets/actions/workflows/tests.yml/badge.svg)](https://github.com/ipython/traitlets/actions/workflows/tests.yml) +[![Documentation Status](https://readthedocs.org/projects/traitlets/badge/?version=latest)](https://traitlets.readthedocs.io/en/latest/?badge=latest) +[![codecov](https://codecov.io/gh/ipython/traitlets/branch/main/graph/badge.svg?token=HcsbLGEmI1)](https://codecov.io/gh/ipython/traitlets) +[![Tidelift](https://tidelift.com/subscription/pkg/pypi-traitlets)](https://tidelift.com/badges/package/pypi/traitlets) + +| | | +| ------------- | ------------------------------------ | +| **home** | https://github.com/ipython/traitlets | +| **pypi-repo** | https://pypi.org/project/traitlets/ | +| **docs** | https://traitlets.readthedocs.io/ | +| **license** | Modified BSD License | + +Traitlets is a pure Python library enabling: + +- the enforcement of strong typing for attributes of Python objects + (typed attributes are called _"traits"_); +- dynamically calculated default values; +- automatic validation and coercion of trait attributes when attempting a + change; +- registering for receiving notifications when trait values change; +- reading configuring values from files or from command line + arguments - a distinct layer on top of traitlets, so you may use + traitlets without the configuration machinery. + +Its implementation relies on the [descriptor](https://docs.python.org/howto/descriptor.html) +pattern, and it is a lightweight pure-python alternative of the +[_traits_ library](https://docs.enthought.com/traits/). + +Traitlets powers the configuration system of IPython and Jupyter +and the declarative API of IPython interactive widgets. + +## Installation + +For a local installation, make sure you have +[pip installed](https://pip.pypa.io/en/stable/installing/) and run: + +```bash +pip install traitlets +``` + +For a **development installation**, clone this repository, change into the +`traitlets` root directory, and run pip: + +```bash +git clone https://github.com/ipython/traitlets.git +cd traitlets +pip install -e . +``` + +## Running the tests + +```bash +pip install "traitlets[test]" +py.test traitlets +``` + +## Code Styling + +`traitlets` has adopted automatic code formatting so you shouldn't +need to worry too much about your code style. +As long as your code is valid, +the pre-commit hook should take care of how it should look. + +To install `pre-commit` locally, run the following:: + +``` +pip install pre-commit +pre-commit install +``` + +You can invoke the pre-commit hook by hand at any time with:: + +``` +pre-commit run +``` + +which should run any autoformatting on your code +and tell you about any errors it couldn't fix automatically. +You may also install [black integration](https://github.com/psf/black#editor-integration) +into your text editor to format code automatically. + +If you have already committed files before setting up the pre-commit +hook with `pre-commit install`, you can fix everything up using +`pre-commit run --all-files`. You need to make the fixing commit +yourself after that. + +Some of the hooks only run on CI by default, but you can invoke them by +running with the `--hook-stage manual` argument. + +## Usage + +Any class with trait attributes must inherit from `HasTraits`. +For the list of available trait types and their properties, see the +[Trait Types](https://traitlets.readthedocs.io/en/latest/trait_types.html) +section of the documentation. + +### Dynamic default values + +To calculate a default value dynamically, decorate a method of your class with +`@default({traitname})`. This method will be called on the instance, and +should return the default value. In this example, the `_username_default` +method is decorated with `@default('username')`: + +```Python +import getpass +from traitlets import HasTraits, Unicode, default + +class Identity(HasTraits): + username = Unicode() + + @default('username') + def _username_default(self): + return getpass.getuser() +``` + +### Callbacks when a trait attribute changes + +When a trait changes, an application can follow this trait change with +additional actions. + +To do something when a trait attribute is changed, decorate a method with +[`traitlets.observe()`](https://traitlets.readthedocs.io/en/latest/api.html?highlight=observe#traitlets.observe). +The method will be called with a single argument, a dictionary which contains +an owner, new value, old value, name of the changed trait, and the event type. + +In this example, the `_num_changed` method is decorated with `` @observe(`num`) ``: + +```Python +from traitlets import HasTraits, Integer, observe + +class TraitletsExample(HasTraits): + num = Integer(5, help="a number").tag(config=True) + + @observe('num') + def _num_changed(self, change): + print("{name} changed from {old} to {new}".format(**change)) +``` + +and is passed the following dictionary when called: + +```Python +{ + 'owner': object, # The HasTraits instance + 'new': 6, # The new value + 'old': 5, # The old value + 'name': "foo", # The name of the changed trait + 'type': 'change', # The event type of the notification, usually 'change' +} +``` + +### Validation and coercion + +Each trait type (`Int`, `Unicode`, `Dict` etc.) may have its own validation or +coercion logic. In addition, we can register custom cross-validators +that may depend on the state of other attributes. For example: + +```Python +from traitlets import HasTraits, TraitError, Int, Bool, validate + +class Parity(HasTraits): + value = Int() + parity = Int() + + @validate('value') + def _valid_value(self, proposal): + if proposal['value'] % 2 != self.parity: + raise TraitError('value and parity should be consistent') + return proposal['value'] + + @validate('parity') + def _valid_parity(self, proposal): + parity = proposal['value'] + if parity not in [0, 1]: + raise TraitError('parity should be 0 or 1') + if self.value % 2 != parity: + raise TraitError('value and parity should be consistent') + return proposal['value'] + +parity_check = Parity(value=2) + +# Changing required parity and value together while holding cross validation +with parity_check.hold_trait_notifications(): + parity_check.value = 1 + parity_check.parity = 1 +``` + +However, we **recommend** that custom cross-validators don't modify the state +of the HasTraits instance. diff --git a/shared/package-files/2c/2ca04c020f363dbce4b8c332d7cbba224b63cee6afa353c863e231b4f181a591/test_equivalence.py b/shared/package-files/2c/2ca04c020f363dbce4b8c332d7cbba224b63cee6afa353c863e231b4f181a591/test_equivalence.py new file mode 100644 index 0000000000000000000000000000000000000000..9babbd5b8d56d64d704978758efb81f8d730274f --- /dev/null +++ b/shared/package-files/2c/2ca04c020f363dbce4b8c332d7cbba224b63cee6afa353c863e231b4f181a591/test_equivalence.py @@ -0,0 +1,284 @@ +import numpy as np +import pytest + +from pandas.core.dtypes.common import is_any_real_numeric_dtype + +import pandas as pd +from pandas import ( + Index, + MultiIndex, + Series, +) +import pandas._testing as tm + + +def test_equals(idx): + assert idx.equals(idx) + assert idx.equals(idx.copy()) + assert idx.equals(idx.astype(object)) + assert idx.equals(idx.to_flat_index()) + assert idx.equals(idx.to_flat_index().astype("category")) + + assert not idx.equals(list(idx)) + assert not idx.equals(np.array(idx)) + + same_values = Index(idx, dtype=object) + assert idx.equals(same_values) + assert same_values.equals(idx) + + if idx.nlevels == 1: + # do not test MultiIndex + assert not idx.equals(Series(idx)) + + +def test_equals_op(idx): + # GH9947, GH10637 + index_a = idx + + n = len(index_a) + index_b = index_a[0:-1] + index_c = index_a[0:-1].append(index_a[-2:-1]) + index_d = index_a[0:1] + with pytest.raises(ValueError, match="Lengths must match"): + index_a == index_b + expected1 = np.array([True] * n) + expected2 = np.array([True] * (n - 1) + [False]) + tm.assert_numpy_array_equal(index_a == index_a, expected1) + tm.assert_numpy_array_equal(index_a == index_c, expected2) + + # test comparisons with numpy arrays + array_a = np.array(index_a) + array_b = np.array(index_a[0:-1]) + array_c = np.array(index_a[0:-1].append(index_a[-2:-1])) + array_d = np.array(index_a[0:1]) + with pytest.raises(ValueError, match="Lengths must match"): + index_a == array_b + tm.assert_numpy_array_equal(index_a == array_a, expected1) + tm.assert_numpy_array_equal(index_a == array_c, expected2) + + # test comparisons with Series + series_a = Series(array_a) + series_b = Series(array_b) + series_c = Series(array_c) + series_d = Series(array_d) + with pytest.raises(ValueError, match="Lengths must match"): + index_a == series_b + + tm.assert_numpy_array_equal(index_a == series_a, expected1) + tm.assert_numpy_array_equal(index_a == series_c, expected2) + + # cases where length is 1 for one of them + with pytest.raises(ValueError, match="Lengths must match"): + index_a == index_d + with pytest.raises(ValueError, match="Lengths must match"): + index_a == series_d + with pytest.raises(ValueError, match="Lengths must match"): + index_a == array_d + msg = "Can only compare identically-labeled Series objects" + with pytest.raises(ValueError, match=msg): + series_a == series_d + with pytest.raises(ValueError, match="Lengths must match"): + series_a == array_d + + # comparing with a scalar should broadcast; note that we are excluding + # MultiIndex because in this case each item in the index is a tuple of + # length 2, and therefore is considered an array of length 2 in the + # comparison instead of a scalar + if not isinstance(index_a, MultiIndex): + expected3 = np.array([False] * (len(index_a) - 2) + [True, False]) + # assuming the 2nd to last item is unique in the data + item = index_a[-2] + tm.assert_numpy_array_equal(index_a == item, expected3) + tm.assert_series_equal(series_a == item, Series(expected3)) + + +def test_compare_tuple(): + # GH#21517 + mi = MultiIndex.from_product([[1, 2]] * 2) + + all_false = np.array([False, False, False, False]) + + result = mi == mi[0] + expected = np.array([True, False, False, False]) + tm.assert_numpy_array_equal(result, expected) + + result = mi != mi[0] + tm.assert_numpy_array_equal(result, ~expected) + + result = mi < mi[0] + tm.assert_numpy_array_equal(result, all_false) + + result = mi <= mi[0] + tm.assert_numpy_array_equal(result, expected) + + result = mi > mi[0] + tm.assert_numpy_array_equal(result, ~expected) + + result = mi >= mi[0] + tm.assert_numpy_array_equal(result, ~all_false) + + +def test_compare_tuple_strs(): + # GH#34180 + + mi = MultiIndex.from_tuples([("a", "b"), ("b", "c"), ("c", "a")]) + + result = mi == ("c", "a") + expected = np.array([False, False, True]) + tm.assert_numpy_array_equal(result, expected) + + result = mi == ("c",) + expected = np.array([False, False, False]) + tm.assert_numpy_array_equal(result, expected) + + +def test_equals_multi(idx): + assert idx.equals(idx) + assert not idx.equals(idx.values) + assert idx.equals(Index(idx.values)) + + assert idx.equal_levels(idx) + assert not idx.equals(idx[:-1]) + assert not idx.equals(idx[-1]) + + # different number of levels + index = MultiIndex( + levels=[Index(list(range(4))), Index(list(range(4))), Index(list(range(4)))], + codes=[ + np.array([0, 0, 1, 2, 2, 2, 3, 3]), + np.array([0, 1, 0, 0, 0, 1, 0, 1]), + np.array([1, 0, 1, 1, 0, 0, 1, 0]), + ], + ) + + index2 = MultiIndex(levels=index.levels[:-1], codes=index.codes[:-1]) + assert not index.equals(index2) + assert not index.equal_levels(index2) + + # levels are different + major_axis = Index(list(range(4))) + minor_axis = Index(list(range(2))) + + major_codes = np.array([0, 0, 1, 2, 2, 3]) + minor_codes = np.array([0, 1, 0, 0, 1, 0]) + + index = MultiIndex( + levels=[major_axis, minor_axis], codes=[major_codes, minor_codes] + ) + assert not idx.equals(index) + assert not idx.equal_levels(index) + + # some of the labels are different + major_axis = Index(["foo", "bar", "baz", "qux"]) + minor_axis = Index(["one", "two"]) + + major_codes = np.array([0, 0, 2, 2, 3, 3]) + minor_codes = np.array([0, 1, 0, 1, 0, 1]) + + index = MultiIndex( + levels=[major_axis, minor_axis], codes=[major_codes, minor_codes] + ) + assert not idx.equals(index) + + +def test_identical(idx): + mi = idx.copy() + mi2 = idx.copy() + assert mi.identical(mi2) + + mi = mi.set_names(["new1", "new2"]) + assert mi.equals(mi2) + assert not mi.identical(mi2) + + mi2 = mi2.set_names(["new1", "new2"]) + assert mi.identical(mi2) + + mi4 = Index(mi.tolist(), tupleize_cols=False) + assert not mi.identical(mi4) + assert mi.equals(mi4) + + +def test_equals_operator(idx): + # GH9785 + assert (idx == idx).all() + + +def test_equals_missing_values(): + # make sure take is not using -1 + i = MultiIndex.from_tuples([(0, pd.NaT), (0, pd.Timestamp("20130101"))]) + result = i[0:1].equals(i[0]) + assert not result + result = i[1:2].equals(i[1]) + assert not result + + +def test_equals_missing_values_differently_sorted(): + # GH#38439 + mi1 = MultiIndex.from_tuples([(81.0, np.nan), (np.nan, np.nan)]) + mi2 = MultiIndex.from_tuples([(np.nan, np.nan), (81.0, np.nan)]) + assert not mi1.equals(mi2) + + mi2 = MultiIndex.from_tuples([(81.0, np.nan), (np.nan, np.nan)]) + assert mi1.equals(mi2) + + +def test_is_(): + mi = MultiIndex.from_tuples(zip(range(10), range(10))) + assert mi.is_(mi) + assert mi.is_(mi.view()) + assert mi.is_(mi.view().view().view().view()) + mi2 = mi.view() + # names are metadata, they don't change id + mi2.names = ["A", "B"] + assert mi2.is_(mi) + assert mi.is_(mi2) + + assert not mi.is_(mi.set_names(["C", "D"])) + # levels are inherent properties, they change identity + mi3 = mi2.set_levels([list(range(10)), list(range(10))]) + assert not mi3.is_(mi2) + # shouldn't change + assert mi2.is_(mi) + mi4 = mi3.view() + + # GH 17464 - Remove duplicate MultiIndex levels + mi4 = mi4.set_levels([list(range(10)), list(range(10))]) + assert not mi4.is_(mi3) + mi5 = mi.view() + mi5 = mi5.set_levels(mi5.levels) + assert not mi5.is_(mi) + + +def test_is_all_dates(idx): + assert not idx._is_all_dates + + +def test_is_numeric(idx): + # MultiIndex is never numeric + assert not is_any_real_numeric_dtype(idx) + + +def test_multiindex_compare(): + # GH 21149 + # Ensure comparison operations for MultiIndex with nlevels == 1 + # behave consistently with those for MultiIndex with nlevels > 1 + + midx = MultiIndex.from_product([[0, 1]]) + + # Equality self-test: MultiIndex object vs self + expected = Series([True, True]) + result = Series(midx == midx) + tm.assert_series_equal(result, expected) + + # Greater than comparison: MultiIndex object vs self + expected = Series([False, False]) + result = Series(midx > midx) + tm.assert_series_equal(result, expected) + + +def test_equals_ea_int_regular_int(): + # GH#46026 + mi1 = MultiIndex.from_arrays([Index([1, 2], dtype="Int64"), [3, 4]]) + mi2 = MultiIndex.from_arrays([[1, 2], [3, 4]]) + assert not mi1.equals(mi2) + assert not mi2.equals(mi1) diff --git a/shared/package-files/2c/2ca094874f8eb9e56fc4eafbb841bc53d710c6b024ed7f960f07e01082947a42/test_iteration.py b/shared/package-files/2c/2ca094874f8eb9e56fc4eafbb841bc53d710c6b024ed7f960f07e01082947a42/test_iteration.py new file mode 100644 index 0000000000000000000000000000000000000000..edc82455234bba0203d817417e7bf122c876bfff --- /dev/null +++ b/shared/package-files/2c/2ca094874f8eb9e56fc4eafbb841bc53d710c6b024ed7f960f07e01082947a42/test_iteration.py @@ -0,0 +1,35 @@ +class TestIteration: + def test_keys(self, datetime_series): + assert datetime_series.keys() is datetime_series.index + + def test_iter_datetimes(self, datetime_series): + for i, val in enumerate(datetime_series): + # pylint: disable-next=unnecessary-list-index-lookup + assert val == datetime_series.iloc[i] + + def test_iter_strings(self, string_series): + for i, val in enumerate(string_series): + # pylint: disable-next=unnecessary-list-index-lookup + assert val == string_series.iloc[i] + + def test_iteritems_datetimes(self, datetime_series): + for idx, val in datetime_series.items(): + assert val == datetime_series[idx] + + def test_iteritems_strings(self, string_series): + for idx, val in string_series.items(): + assert val == string_series[idx] + + # assert is lazy (generators don't define reverse, lists do) + assert not hasattr(string_series.items(), "reverse") + + def test_items_datetimes(self, datetime_series): + for idx, val in datetime_series.items(): + assert val == datetime_series[idx] + + def test_items_strings(self, string_series): + for idx, val in string_series.items(): + assert val == string_series[idx] + + # assert is lazy (generators don't define reverse, lists do) + assert not hasattr(string_series.items(), "reverse") diff --git a/shared/package-files/2c/2ca5985b61257f01cc014b8da6912a622f49ab1f57adcdb0b08f3d593dfe2d85/mode_ops.h b/shared/package-files/2c/2ca5985b61257f01cc014b8da6912a622f49ab1f57adcdb0b08f3d593dfe2d85/mode_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..81465a5a243e67536a7e6006df0072a63c5b520e --- /dev/null +++ b/shared/package-files/2c/2ca5985b61257f01cc014b8da6912a622f49ab1f57adcdb0b08f3d593dfe2d85/mode_ops.h @@ -0,0 +1,61 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API mode { + using schema = ::std::tuple (const at::Tensor &, int64_t, bool); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::mode") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "mode(Tensor self, int dim=-1, bool keepdim=False) -> (Tensor values, Tensor indices)") + static ::std::tuple call(const at::Tensor & self, int64_t dim, bool keepdim); + static ::std::tuple redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, int64_t dim, bool keepdim); +}; + +struct TORCH_API mode_values { + using schema = ::std::tuple (const at::Tensor &, int64_t, bool, at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::mode") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "values") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "mode.values(Tensor self, int dim=-1, bool keepdim=False, *, Tensor(a!) values, Tensor(b!) indices) -> (Tensor(a!) values, Tensor(b!) indices)") + static ::std::tuple call(const at::Tensor & self, int64_t dim, bool keepdim, at::Tensor & values, at::Tensor & indices); + static ::std::tuple redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, int64_t dim, bool keepdim, at::Tensor & values, at::Tensor & indices); +}; + +struct TORCH_API mode_dimname { + using schema = ::std::tuple (const at::Tensor &, at::Dimname, bool); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::mode") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "dimname") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "mode.dimname(Tensor self, Dimname dim, bool keepdim=False) -> (Tensor values, Tensor indices)") + static ::std::tuple call(const at::Tensor & self, at::Dimname dim, bool keepdim); + static ::std::tuple redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, at::Dimname dim, bool keepdim); +}; + +struct TORCH_API mode_dimname_out { + using schema = ::std::tuple (const at::Tensor &, at::Dimname, bool, at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::mode") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "dimname_out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "mode.dimname_out(Tensor self, Dimname dim, bool keepdim=False, *, Tensor(a!) values, Tensor(b!) indices) -> (Tensor(a!) values, Tensor(b!) indices)") + static ::std::tuple call(const at::Tensor & self, at::Dimname dim, bool keepdim, at::Tensor & values, at::Tensor & indices); + static ::std::tuple redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, at::Dimname dim, bool keepdim, at::Tensor & values, at::Tensor & indices); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/2c/2ca6cc1d77b327bd70992b67fb5a280343d45ce7ccb5b83adb9831cbd9b0edf0/nanquantile_compositeimplicitautograd_dispatch.h b/shared/package-files/2c/2ca6cc1d77b327bd70992b67fb5a280343d45ce7ccb5b83adb9831cbd9b0edf0/nanquantile_compositeimplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..6d4c3cb97f7b6f2d01ac8b44c7bff59553213c22 --- /dev/null +++ b/shared/package-files/2c/2ca6cc1d77b327bd70992b67fb5a280343d45ce7ccb5b83adb9831cbd9b0edf0/nanquantile_compositeimplicitautograd_dispatch.h @@ -0,0 +1,28 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeimplicitautograd { + +TORCH_API at::Tensor nanquantile(const at::Tensor & self, const at::Tensor & q, c10::optional dim=c10::nullopt, bool keepdim=false, c10::string_view interpolation="linear"); +TORCH_API at::Tensor & nanquantile_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & q, c10::optional dim=c10::nullopt, bool keepdim=false, c10::string_view interpolation="linear"); +TORCH_API at::Tensor & nanquantile_outf(const at::Tensor & self, const at::Tensor & q, c10::optional dim, bool keepdim, c10::string_view interpolation, at::Tensor & out); +TORCH_API at::Tensor nanquantile(const at::Tensor & self, double q, c10::optional dim=c10::nullopt, bool keepdim=false, c10::string_view interpolation="linear"); +TORCH_API at::Tensor & nanquantile_out(at::Tensor & out, const at::Tensor & self, double q, c10::optional dim=c10::nullopt, bool keepdim=false, c10::string_view interpolation="linear"); +TORCH_API at::Tensor & nanquantile_outf(const at::Tensor & self, double q, c10::optional dim, bool keepdim, c10::string_view interpolation, at::Tensor & out); + +} // namespace compositeimplicitautograd +} // namespace at diff --git a/shared/package-files/2c/2caae371d2f2edec717e2f1b7128562b62280e87a245e73b0527fc7fc1c370b7/macho.py b/shared/package-files/2c/2caae371d2f2edec717e2f1b7128562b62280e87a245e73b0527fc7fc1c370b7/macho.py new file mode 100644 index 0000000000000000000000000000000000000000..950ebd6d57b6d194bc4c61dff3995ab02096cb7a --- /dev/null +++ b/shared/package-files/2c/2caae371d2f2edec717e2f1b7128562b62280e87a245e73b0527fc7fc1c370b7/macho.py @@ -0,0 +1,362 @@ +# Copyright (C) 2014 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +import os +import re +import stat +import sys +from itertools import islice +from subprocess import PIPE, STDOUT, CalledProcessError, Popen, check_output + +from .. import utils +from ..utils import on_mac +from .external import find_preferably_prefixed_executable + +NO_EXT = ( + ".py", + ".pyc", + ".pyo", + ".h", + ".a", + ".c", + ".txt", + ".html", + ".xml", + ".png", + ".jpg", + ".gif", + ".class", + ".in", + ".sh", + ".yaml", + ".md", + ".ac", + ".m4", + ".cc", + ".plist", +) + +MAGIC = { + b"\xca\xfe\xba\xbe": "MachO-universal", + b"\xce\xfa\xed\xfe": "MachO-i386", + b"\xcf\xfa\xed\xfe": "MachO-x86_64", + b"\xfe\xed\xfa\xce": "MachO-ppc", + b"\xfe\xed\xfa\xcf": "MachO-ppc64", +} + +FILETYPE = { + 1: "MH_OBJECT", + 2: "MH_EXECUTE", + 3: "MH_FVMLIB", + 4: "MH_CORE", + 5: "MH_PRELOAD", + 6: "MH_DYLIB", + 7: "MH_DYLINKER", + 8: "MH_BUNDLE", + 9: "MH_DYLIB_STUB", + 10: "MH_DSYM", + 11: "MH_KEXT_BUNDLE", +} + + +def is_macho(path): + if path.endswith(NO_EXT) or os.path.islink(path) or not os.path.isfile(path): + return False + with open(path, "rb") as fi: + head = fi.read(4) + return bool(head in MAGIC) + + +def is_dylib(path, build_prefix): + return human_filetype(path) == "DYLIB" + + +def human_filetype(path, build_prefix): + otool = find_apple_cctools_executable("otool", build_prefix) + output = check_output((otool, "-h", path)).decode("utf-8") + lines = output.splitlines() + if not lines[0].startswith((path, "Mach header")): + raise ValueError( + "Expected `otool -h` output to start with" + f" Mach header or {path}, got:\n{output}" + ) + assert lines[0].startswith((path, "Mach header")), path + + for line in lines: + if line.strip().startswith("0x"): + header = line.split() + filetype = int(header[4]) + return FILETYPE[filetype][3:] + + +def is_dylib_info(lines): + dylib_info = ("LC_ID_DYLIB", "LC_LOAD_DYLIB") + if len(lines) > 1 and lines[1].split()[1] in dylib_info: + return True + return False + + +def is_id_dylib(lines): + if len(lines) > 1 and lines[1].split()[1] == "LC_ID_DYLIB": + return True + return False + + +def is_load_dylib(lines): + if len(lines) > 1 and lines[1].split()[1] == "LC_LOAD_DYLIB": + return True + return False + + +def is_rpath(lines): + if len(lines) > 1 and lines[1].split()[1] == "LC_RPATH": + return True + return False + + +def _get_load_commands(lines): + """yields each load command from the output of otool -l""" + a = 1 # first line is the filename. + for ln, line in enumerate(lines): + if line.startswith("Load command"): + if a < ln: + yield lines[a:ln] + a = ln + yield lines[a:] + + +def _get_matching_load_commands(lines, cb_filter): + """Workhorse function for otool + + Does the work of filtering load commands and making a list + of dicts. The logic for splitting the free-form lines into + keys and values in entirely encoded here. Values that can + be converted to ints are converted to ints. + """ + result = [] + for lcmds in _get_load_commands(lines): + if cb_filter(lcmds): + lcdict = {} + for line in islice(lcmds, 1, len(lcmds)): + listy = line.split() + # This could be prettier, but what we need it to handle + # is fairly simple so let's just hardcode it for speed. + if len(listy) == 2: + key, value = listy + elif listy[0] == "name" or listy[0] == "path": + # Create an entry for 'name offset' if there is one + # as that can be useful if we need to know if there + # is space to patch it for relocation purposes. + if listy[2] == "(offset": + key = listy[0] + " offset" + value = int(listy[3][:-1]) + lcdict[key] = value + key, value = listy[0:2] + elif listy[0] == "time": + key = " ".join(listy[0:3]) + value = " ".join(listy[3:]) + elif listy[0] in ("current", "compatibility"): + key = " ".join(listy[0:2]) + value = listy[2] + try: + value = int(value) + except ValueError: + pass + lcdict[key] = value + result.append(lcdict) + return result + + +def find_apple_cctools_executable(name, build_prefix, nofail=False): + tools = find_preferably_prefixed_executable(name, build_prefix, all_matches=True) + for tool in tools: + try: + if "/usr/bin" in tool: + with open(tool, "rb") as f: + s = f.read() + if s.find(b"usr/lib/libxcselect.dylib") != -1: + # We ask xcrun. + try: + tool_xcr = ( + check_output(["xcrun", "-find", name], stderr=STDOUT) + .decode("utf-8") + .splitlines()[0] + ) + except Exception as e: + log = utils.get_logger(__name__) + log.error( + f"ERROR :: Found `{tool}` but is is an Apple Xcode stub executable\n" + f"and it returned an error:\n{e.output}" + ) + raise e + tool = tool_xcr + if os.path.exists(tool): + return tool + except Exception as _: # noqa + print( + "ERROR :: Failed to run `{}`. Please use `conda` to install `cctools` into your base environment.\n" + " An option on macOS is to install `Xcode` or `Command Line Tools for Xcode`.".format( + tool + ) + ) + sys.exit(1) + return tool + + +def otool(path, build_prefix=None, cb_filter=is_dylib_info): + """A wrapper around otool -l + + Parse the output of the otool -l 'load commands', filtered by + cb_filter, returning a list of dictionairies for the records. + + cb_filter receives the whole load command record, including the + first line, the 'Load Command N' one. All the records have been + pre-stripped of white space. + + The output of otool -l is entirely freeform; delineation between + key and value doesn't formally exist, so that is hard coded. I + didn't want to use regexes to parse it for speed purposes. + + Any key values that can be converted to integers are converted + to integers, the rest are strings. + """ + otool = find_apple_cctools_executable("otool", build_prefix) + lines = check_output([otool, "-l", path], stderr=STDOUT).decode("utf-8") + # llvm-objdump returns 0 for some things that are anything but successful completion. + lines_split = lines.splitlines() + # 'invalid', 'expected' and 'unexpected' are too generic + # here so also check that we do not get 'useful' output. + if len(lines_split) < 10 and ( + re.match( + ".*(is not a Mach-O|invalid|expected|unexpected).*", lines, re.MULTILINE + ) + ): + raise CalledProcessError(-1, otool) + return _get_matching_load_commands(lines_split, cb_filter) + + +def get_dylibs(path, build_prefix=None): + """Return a list of the loaded dylib pathnames""" + dylib_loads = otool(path, build_prefix, is_load_dylib) + return [dylib_load["name"] for dylib_load in dylib_loads] + + +def get_id(path, build_prefix=None): + """Returns the id name of the Mach-O file `path` or an empty string""" + dylib_loads = otool(path, build_prefix, is_id_dylib) + try: + return [dylib_load["name"] for dylib_load in dylib_loads][0] + except: + return "" + + +def get_rpaths(path, build_prefix=None): + """Return a list of the dylib rpaths""" + dylib_loads = otool(path, build_prefix, is_rpath) + return [dylib_load["path"] for dylib_load in dylib_loads] + + +def _chmod(filename, mode): + try: + os.chmod(filename, mode) + except (OSError, utils.PermissionError) as e: + log = utils.get_logger(__name__) + log.warn(str(e)) + + +def install_name_tool(args, build_prefix=None, verbose=False): + args_full = [find_apple_cctools_executable("install_name_tool", build_prefix)] + args_full.extend(args) + if verbose: + print(" ".join(args_full)) + old_mode = stat.S_IMODE(os.stat(args[-1]).st_mode) + new_mode = old_mode | stat.S_IWUSR + if old_mode != new_mode: + _chmod(args[-1], new_mode) + subproc = Popen(args_full, stdout=PIPE, stderr=PIPE) + out, err = subproc.communicate() + out = out.decode("utf-8") + err = err.decode("utf-8") + if old_mode != new_mode: + _chmod(args[-1], old_mode) + return subproc.returncode, out, err + + +def add_rpath(path, rpath, build_prefix=None, verbose=False): + """Add an `rpath` to the Mach-O file at `path`""" + if not is_macho(path): + return + args = ["-add_rpath", rpath, path] + code, _, stderr = install_name_tool(args, build_prefix) + if "Mach-O dynamic shared library stub file" in stderr: + print("Skipping Mach-O dynamic shared library stub file %s\n" % path) + return + elif "would duplicate path, file already has LC_RPATH for:" in stderr: + print("Skipping -add_rpath, file already has LC_RPATH set") + return + else: + print(stderr, file=sys.stderr) + if code: + raise RuntimeError("install_name_tool failed with exit status %d" % code) + + +def delete_rpath(path, rpath, build_prefix=None, verbose=False): + """Delete an `rpath` from the Mach-O file at `path`""" + if not is_macho(path): + return + args = ["-delete_rpath", rpath, path] + code, _, stderr = install_name_tool(args, build_prefix) + if "Mach-O dynamic shared library stub file" in stderr: + print("Skipping Mach-O dynamic shared library stub file %s\n" % path) + return + elif "no LC_RPATH load command with path:" in stderr: + print("Skipping -delete_rpath, file doesn't contain that LC_RPATH") + return + else: + print(stderr, file=sys.stderr) + if code: + raise RuntimeError("install_name_tool failed with exit status %d" % code) + + +def install_name_change(path, build_prefix, cb_func, dylibs, verbose=False): + """Change dynamic shared library load name or id name of Mach-O Binary `path`. + + `cb_func` is called for each shared library load command. The dictionary of + the load command is passed in and the callback returns the new name or None + if the name should be unchanged. + + When dealing with id load commands, `install_name_tool -id` is used. + When dealing with dylib load commands `install_name_tool -change` is used. + """ + + changes = [] + for index, dylib in enumerate(dylibs): + new_name = cb_func(path, dylib) + if new_name: + changes.append((index, new_name)) + + ret = True + for index, new_name in changes: + args = [] + if dylibs[index]["cmd"] == "LC_ID_DYLIB": + args.extend(("-id", new_name, path)) + else: + args.extend(("-change", dylibs[index]["name"], new_name, path)) + code, _, stderr = install_name_tool(args, build_prefix) + if "Mach-O dynamic shared library stub file" in stderr: + print("Skipping Mach-O dynamic shared library stub file %s" % path) + ret = False + continue + else: + print(stderr, file=sys.stderr) + if code: + raise RuntimeError( + "install_name_tool failed with exit status %d, stderr of:\n%s" + % (code, stderr) + ) + return ret + + +if __name__ == "__main__": + if on_mac: + for path in "/bin/ls", "/etc/locate.rc": + print(path, is_macho(path)) diff --git a/shared/package-files/2c/2cabb6a81cafa84b475fc852c20b6bad45955ec0f88063720a831495215f776b/token.py b/shared/package-files/2c/2cabb6a81cafa84b475fc852c20b6bad45955ec0f88063720a831495215f776b/token.py new file mode 100644 index 0000000000000000000000000000000000000000..9d0c0bf0fb0368e15170336a0c60b17f5fa4da40 --- /dev/null +++ b/shared/package-files/2c/2cabb6a81cafa84b475fc852c20b6bad45955ec0f88063720a831495215f776b/token.py @@ -0,0 +1,137 @@ +"""Token constants.""" +# Auto-generated by Tools/scripts/generate_token.py + +__all__ = ['tok_name', 'ISTERMINAL', 'ISNONTERMINAL', 'ISEOF'] + +ENDMARKER = 0 +NAME = 1 +NUMBER = 2 +STRING = 3 +NEWLINE = 4 +INDENT = 5 +DEDENT = 6 +LPAR = 7 +RPAR = 8 +LSQB = 9 +RSQB = 10 +COLON = 11 +COMMA = 12 +SEMI = 13 +PLUS = 14 +MINUS = 15 +STAR = 16 +SLASH = 17 +VBAR = 18 +AMPER = 19 +LESS = 20 +GREATER = 21 +EQUAL = 22 +DOT = 23 +PERCENT = 24 +LBRACE = 25 +RBRACE = 26 +EQEQUAL = 27 +NOTEQUAL = 28 +LESSEQUAL = 29 +GREATEREQUAL = 30 +TILDE = 31 +CIRCUMFLEX = 32 +LEFTSHIFT = 33 +RIGHTSHIFT = 34 +DOUBLESTAR = 35 +PLUSEQUAL = 36 +MINEQUAL = 37 +STAREQUAL = 38 +SLASHEQUAL = 39 +PERCENTEQUAL = 40 +AMPEREQUAL = 41 +VBAREQUAL = 42 +CIRCUMFLEXEQUAL = 43 +LEFTSHIFTEQUAL = 44 +RIGHTSHIFTEQUAL = 45 +DOUBLESTAREQUAL = 46 +DOUBLESLASH = 47 +DOUBLESLASHEQUAL = 48 +AT = 49 +ATEQUAL = 50 +RARROW = 51 +ELLIPSIS = 52 +COLONEQUAL = 53 +OP = 54 +AWAIT = 55 +ASYNC = 56 +TYPE_IGNORE = 57 +TYPE_COMMENT = 58 +SOFT_KEYWORD = 59 +# These aren't used by the C tokenizer but are needed for tokenize.py +ERRORTOKEN = 60 +COMMENT = 61 +NL = 62 +ENCODING = 63 +N_TOKENS = 64 +# Special definitions for cooperation with parser +NT_OFFSET = 256 + +tok_name = {value: name + for name, value in globals().items() + if isinstance(value, int) and not name.startswith('_')} +__all__.extend(tok_name.values()) + +EXACT_TOKEN_TYPES = { + '!=': NOTEQUAL, + '%': PERCENT, + '%=': PERCENTEQUAL, + '&': AMPER, + '&=': AMPEREQUAL, + '(': LPAR, + ')': RPAR, + '*': STAR, + '**': DOUBLESTAR, + '**=': DOUBLESTAREQUAL, + '*=': STAREQUAL, + '+': PLUS, + '+=': PLUSEQUAL, + ',': COMMA, + '-': MINUS, + '-=': MINEQUAL, + '->': RARROW, + '.': DOT, + '...': ELLIPSIS, + '/': SLASH, + '//': DOUBLESLASH, + '//=': DOUBLESLASHEQUAL, + '/=': SLASHEQUAL, + ':': COLON, + ':=': COLONEQUAL, + ';': SEMI, + '<': LESS, + '<<': LEFTSHIFT, + '<<=': LEFTSHIFTEQUAL, + '<=': LESSEQUAL, + '=': EQUAL, + '==': EQEQUAL, + '>': GREATER, + '>=': GREATEREQUAL, + '>>': RIGHTSHIFT, + '>>=': RIGHTSHIFTEQUAL, + '@': AT, + '@=': ATEQUAL, + '[': LSQB, + ']': RSQB, + '^': CIRCUMFLEX, + '^=': CIRCUMFLEXEQUAL, + '{': LBRACE, + '|': VBAR, + '|=': VBAREQUAL, + '}': RBRACE, + '~': TILDE, +} + +def ISTERMINAL(x): + return x < NT_OFFSET + +def ISNONTERMINAL(x): + return x >= NT_OFFSET + +def ISEOF(x): + return x == ENDMARKER diff --git a/shared/package-files/2c/2cafe5ff982716fe83d3662dc89441a79904dd25a61d5102ec26c129edad8e4f/build_py.py b/shared/package-files/2c/2cafe5ff982716fe83d3662dc89441a79904dd25a61d5102ec26c129edad8e4f/build_py.py new file mode 100644 index 0000000000000000000000000000000000000000..d9df95922f3e388ef62da386334549d7d07310ff --- /dev/null +++ b/shared/package-files/2c/2cafe5ff982716fe83d3662dc89441a79904dd25a61d5102ec26c129edad8e4f/build_py.py @@ -0,0 +1,406 @@ +"""distutils.command.build_py + +Implements the Distutils 'build_py' command.""" + +import os +import importlib.util +import sys +import glob + +from ..core import Command +from ..errors import DistutilsOptionError, DistutilsFileError +from ..util import convert_path +from distutils._log import log + + +class build_py(Command): + description = "\"build\" pure Python modules (copy to build directory)" + + user_options = [ + ('build-lib=', 'd', "directory to \"build\" (copy) to"), + ('compile', 'c', "compile .py to .pyc"), + ('no-compile', None, "don't compile .py files [default]"), + ( + 'optimize=', + 'O', + "also compile with optimization: -O1 for \"python -O\", " + "-O2 for \"python -OO\", and -O0 to disable [default: -O0]", + ), + ('force', 'f', "forcibly build everything (ignore file timestamps)"), + ] + + boolean_options = ['compile', 'force'] + negative_opt = {'no-compile': 'compile'} + + def initialize_options(self): + self.build_lib = None + self.py_modules = None + self.package = None + self.package_data = None + self.package_dir = None + self.compile = 0 + self.optimize = 0 + self.force = None + + def finalize_options(self): + self.set_undefined_options( + 'build', ('build_lib', 'build_lib'), ('force', 'force') + ) + + # Get the distribution options that are aliases for build_py + # options -- list of packages and list of modules. + self.packages = self.distribution.packages + self.py_modules = self.distribution.py_modules + self.package_data = self.distribution.package_data + self.package_dir = {} + if self.distribution.package_dir: + for name, path in self.distribution.package_dir.items(): + self.package_dir[name] = convert_path(path) + self.data_files = self.get_data_files() + + # Ick, copied straight from install_lib.py (fancy_getopt needs a + # type system! Hell, *everything* needs a type system!!!) + if not isinstance(self.optimize, int): + try: + self.optimize = int(self.optimize) + assert 0 <= self.optimize <= 2 + except (ValueError, AssertionError): + raise DistutilsOptionError("optimize must be 0, 1, or 2") + + def run(self): + # XXX copy_file by default preserves atime and mtime. IMHO this is + # the right thing to do, but perhaps it should be an option -- in + # particular, a site administrator might want installed files to + # reflect the time of installation rather than the last + # modification time before the installed release. + + # XXX copy_file by default preserves mode, which appears to be the + # wrong thing to do: if a file is read-only in the working + # directory, we want it to be installed read/write so that the next + # installation of the same module distribution can overwrite it + # without problems. (This might be a Unix-specific issue.) Thus + # we turn off 'preserve_mode' when copying to the build directory, + # since the build directory is supposed to be exactly what the + # installation will look like (ie. we preserve mode when + # installing). + + # Two options control which modules will be installed: 'packages' + # and 'py_modules'. The former lets us work with whole packages, not + # specifying individual modules at all; the latter is for + # specifying modules one-at-a-time. + + if self.py_modules: + self.build_modules() + if self.packages: + self.build_packages() + self.build_package_data() + + self.byte_compile(self.get_outputs(include_bytecode=0)) + + def get_data_files(self): + """Generate list of '(package,src_dir,build_dir,filenames)' tuples""" + data = [] + if not self.packages: + return data + for package in self.packages: + # Locate package source directory + src_dir = self.get_package_dir(package) + + # Compute package build directory + build_dir = os.path.join(*([self.build_lib] + package.split('.'))) + + # Length of path to strip from found files + plen = 0 + if src_dir: + plen = len(src_dir) + 1 + + # Strip directory from globbed filenames + filenames = [file[plen:] for file in self.find_data_files(package, src_dir)] + data.append((package, src_dir, build_dir, filenames)) + return data + + def find_data_files(self, package, src_dir): + """Return filenames for package's data files in 'src_dir'""" + globs = self.package_data.get('', []) + self.package_data.get(package, []) + files = [] + for pattern in globs: + # Each pattern has to be converted to a platform-specific path + filelist = glob.glob( + os.path.join(glob.escape(src_dir), convert_path(pattern)) + ) + # Files that match more than one pattern are only added once + files.extend( + [fn for fn in filelist if fn not in files and os.path.isfile(fn)] + ) + return files + + def build_package_data(self): + """Copy data files into build directory""" + for package, src_dir, build_dir, filenames in self.data_files: + for filename in filenames: + target = os.path.join(build_dir, filename) + self.mkpath(os.path.dirname(target)) + self.copy_file( + os.path.join(src_dir, filename), target, preserve_mode=False + ) + + def get_package_dir(self, package): + """Return the directory, relative to the top of the source + distribution, where package 'package' should be found + (at least according to the 'package_dir' option, if any).""" + path = package.split('.') + + if not self.package_dir: + if path: + return os.path.join(*path) + else: + return '' + else: + tail = [] + while path: + try: + pdir = self.package_dir['.'.join(path)] + except KeyError: + tail.insert(0, path[-1]) + del path[-1] + else: + tail.insert(0, pdir) + return os.path.join(*tail) + else: + # Oops, got all the way through 'path' without finding a + # match in package_dir. If package_dir defines a directory + # for the root (nameless) package, then fallback on it; + # otherwise, we might as well have not consulted + # package_dir at all, as we just use the directory implied + # by 'tail' (which should be the same as the original value + # of 'path' at this point). + pdir = self.package_dir.get('') + if pdir is not None: + tail.insert(0, pdir) + + if tail: + return os.path.join(*tail) + else: + return '' + + def check_package(self, package, package_dir): + # Empty dir name means current directory, which we can probably + # assume exists. Also, os.path.exists and isdir don't know about + # my "empty string means current dir" convention, so we have to + # circumvent them. + if package_dir != "": + if not os.path.exists(package_dir): + raise DistutilsFileError( + "package directory '%s' does not exist" % package_dir + ) + if not os.path.isdir(package_dir): + raise DistutilsFileError( + "supposed package directory '%s' exists, " + "but is not a directory" % package_dir + ) + + # Directories without __init__.py are namespace packages (PEP 420). + if package: + init_py = os.path.join(package_dir, "__init__.py") + if os.path.isfile(init_py): + return init_py + + # Either not in a package at all (__init__.py not expected), or + # __init__.py doesn't exist -- so don't return the filename. + return None + + def check_module(self, module, module_file): + if not os.path.isfile(module_file): + log.warning("file %s (for module %s) not found", module_file, module) + return False + else: + return True + + def find_package_modules(self, package, package_dir): + self.check_package(package, package_dir) + module_files = glob.glob(os.path.join(glob.escape(package_dir), "*.py")) + modules = [] + setup_script = os.path.abspath(self.distribution.script_name) + + for f in module_files: + abs_f = os.path.abspath(f) + if abs_f != setup_script: + module = os.path.splitext(os.path.basename(f))[0] + modules.append((package, module, f)) + else: + self.debug_print("excluding %s" % setup_script) + return modules + + def find_modules(self): + """Finds individually-specified Python modules, ie. those listed by + module name in 'self.py_modules'. Returns a list of tuples (package, + module_base, filename): 'package' is a tuple of the path through + package-space to the module; 'module_base' is the bare (no + packages, no dots) module name, and 'filename' is the path to the + ".py" file (relative to the distribution root) that implements the + module. + """ + # Map package names to tuples of useful info about the package: + # (package_dir, checked) + # package_dir - the directory where we'll find source files for + # this package + # checked - true if we have checked that the package directory + # is valid (exists, contains __init__.py, ... ?) + packages = {} + + # List of (package, module, filename) tuples to return + modules = [] + + # We treat modules-in-packages almost the same as toplevel modules, + # just the "package" for a toplevel is empty (either an empty + # string or empty list, depending on context). Differences: + # - don't check for __init__.py in directory for empty package + for module in self.py_modules: + path = module.split('.') + package = '.'.join(path[0:-1]) + module_base = path[-1] + + try: + (package_dir, checked) = packages[package] + except KeyError: + package_dir = self.get_package_dir(package) + checked = 0 + + if not checked: + init_py = self.check_package(package, package_dir) + packages[package] = (package_dir, 1) + if init_py: + modules.append((package, "__init__", init_py)) + + # XXX perhaps we should also check for just .pyc files + # (so greedy closed-source bastards can distribute Python + # modules too) + module_file = os.path.join(package_dir, module_base + ".py") + if not self.check_module(module, module_file): + continue + + modules.append((package, module_base, module_file)) + + return modules + + def find_all_modules(self): + """Compute the list of all modules that will be built, whether + they are specified one-module-at-a-time ('self.py_modules') or + by whole packages ('self.packages'). Return a list of tuples + (package, module, module_file), just like 'find_modules()' and + 'find_package_modules()' do.""" + modules = [] + if self.py_modules: + modules.extend(self.find_modules()) + if self.packages: + for package in self.packages: + package_dir = self.get_package_dir(package) + m = self.find_package_modules(package, package_dir) + modules.extend(m) + return modules + + def get_source_files(self): + return [module[-1] for module in self.find_all_modules()] + + def get_module_outfile(self, build_dir, package, module): + outfile_path = [build_dir] + list(package) + [module + ".py"] + return os.path.join(*outfile_path) + + def get_outputs(self, include_bytecode=1): + modules = self.find_all_modules() + outputs = [] + for package, module, module_file in modules: + package = package.split('.') + filename = self.get_module_outfile(self.build_lib, package, module) + outputs.append(filename) + if include_bytecode: + if self.compile: + outputs.append( + importlib.util.cache_from_source(filename, optimization='') + ) + if self.optimize > 0: + outputs.append( + importlib.util.cache_from_source( + filename, optimization=self.optimize + ) + ) + + outputs += [ + os.path.join(build_dir, filename) + for package, src_dir, build_dir, filenames in self.data_files + for filename in filenames + ] + + return outputs + + def build_module(self, module, module_file, package): + if isinstance(package, str): + package = package.split('.') + elif not isinstance(package, (list, tuple)): + raise TypeError( + "'package' must be a string (dot-separated), list, or tuple" + ) + + # Now put the module source file into the "build" area -- this is + # easy, we just copy it somewhere under self.build_lib (the build + # directory for Python source). + outfile = self.get_module_outfile(self.build_lib, package, module) + dir = os.path.dirname(outfile) + self.mkpath(dir) + return self.copy_file(module_file, outfile, preserve_mode=0) + + def build_modules(self): + modules = self.find_modules() + for package, module, module_file in modules: + # Now "build" the module -- ie. copy the source file to + # self.build_lib (the build directory for Python source). + # (Actually, it gets copied to the directory for this package + # under self.build_lib.) + self.build_module(module, module_file, package) + + def build_packages(self): + for package in self.packages: + # Get list of (package, module, module_file) tuples based on + # scanning the package directory. 'package' is only included + # in the tuple so that 'find_modules()' and + # 'find_package_tuples()' have a consistent interface; it's + # ignored here (apart from a sanity check). Also, 'module' is + # the *unqualified* module name (ie. no dots, no package -- we + # already know its package!), and 'module_file' is the path to + # the .py file, relative to the current directory + # (ie. including 'package_dir'). + package_dir = self.get_package_dir(package) + modules = self.find_package_modules(package, package_dir) + + # Now loop over the modules we found, "building" each one (just + # copy it to self.build_lib). + for package_, module, module_file in modules: + assert package == package_ + self.build_module(module, module_file, package) + + def byte_compile(self, files): + if sys.dont_write_bytecode: + self.warn('byte-compiling is disabled, skipping.') + return + + from ..util import byte_compile + + prefix = self.build_lib + if prefix[-1] != os.sep: + prefix = prefix + os.sep + + # XXX this code is essentially the same as the 'byte_compile() + # method of the "install_lib" command, except for the determination + # of the 'prefix' string. Hmmm. + if self.compile: + byte_compile( + files, optimize=0, force=self.force, prefix=prefix, dry_run=self.dry_run + ) + if self.optimize > 0: + byte_compile( + files, + optimize=self.optimize, + force=self.force, + prefix=prefix, + dry_run=self.dry_run, + ) diff --git a/shared/package-files/2c/2cb519ed919a8a8fa2e5da4a2a328249e4ae7e69fa4fca62f650dc167bd2caad/_openssl.py b/shared/package-files/2c/2cb519ed919a8a8fa2e5da4a2a328249e4ae7e69fa4fca62f650dc167bd2caad/_openssl.py new file mode 100644 index 0000000000000000000000000000000000000000..9951cf75c404b94c13a0a7b49c011b686aa1ccde --- /dev/null +++ b/shared/package-files/2c/2cb519ed919a8a8fa2e5da4a2a328249e4ae7e69fa4fca62f650dc167bd2caad/_openssl.py @@ -0,0 +1,66 @@ +import contextlib +import os +import re +import ssl +import typing + +# candidates based on https://github.com/tiran/certifi-system-store by Christian Heimes +_CA_FILE_CANDIDATES = [ + # Alpine, Arch, Fedora 34+, OpenWRT, RHEL 9+, BSD + "/etc/ssl/cert.pem", + # Fedora <= 34, RHEL <= 9, CentOS <= 9 + "/etc/pki/tls/cert.pem", + # Debian, Ubuntu (requires ca-certificates) + "/etc/ssl/certs/ca-certificates.crt", + # SUSE + "/etc/ssl/ca-bundle.pem", +] + +_HASHED_CERT_FILENAME_RE = re.compile(r"^[0-9a-fA-F]{8}\.[0-9]$") + + +@contextlib.contextmanager +def _configure_context(ctx: ssl.SSLContext) -> typing.Iterator[None]: + # First, check whether the default locations from OpenSSL + # seem like they will give us a usable set of CA certs. + # ssl.get_default_verify_paths already takes care of: + # - getting cafile from either the SSL_CERT_FILE env var + # or the path configured when OpenSSL was compiled, + # and verifying that that path exists + # - getting capath from either the SSL_CERT_DIR env var + # or the path configured when OpenSSL was compiled, + # and verifying that that path exists + # In addition we'll check whether capath appears to contain certs. + defaults = ssl.get_default_verify_paths() + if defaults.cafile or (defaults.capath and _capath_contains_certs(defaults.capath)): + ctx.set_default_verify_paths() + else: + # cafile from OpenSSL doesn't exist + # and capath from OpenSSL doesn't contain certs. + # Let's search other common locations instead. + for cafile in _CA_FILE_CANDIDATES: + if os.path.isfile(cafile): + ctx.load_verify_locations(cafile=cafile) + break + + yield + + +def _capath_contains_certs(capath: str) -> bool: + """Check whether capath exists and contains certs in the expected format.""" + if not os.path.isdir(capath): + return False + for name in os.listdir(capath): + if _HASHED_CERT_FILENAME_RE.match(name): + return True + return False + + +def _verify_peercerts_impl( + ssl_context: ssl.SSLContext, + cert_chain: list[bytes], + server_hostname: str | None = None, +) -> None: + # This is a no-op because we've enabled SSLContext's built-in + # verification via verify_mode=CERT_REQUIRED, and don't need to repeat it. + pass diff --git a/shared/package-files/2c/2cb9ce201c4fd8003d0f6d4d76880f99cedc1cbfd19b4ef6f5fa9547a1ce6eaf/eval.py b/shared/package-files/2c/2cb9ce201c4fd8003d0f6d4d76880f99cedc1cbfd19b4ef6f5fa9547a1ce6eaf/eval.py new file mode 100644 index 0000000000000000000000000000000000000000..7bb623cba375539072e462cb1180f4ac85221ee1 --- /dev/null +++ b/shared/package-files/2c/2cb9ce201c4fd8003d0f6d4d76880f99cedc1cbfd19b4ef6f5fa9547a1ce6eaf/eval.py @@ -0,0 +1,421 @@ +""" +Top level ``eval`` module. +""" +from __future__ import annotations + +import tokenize +from typing import TYPE_CHECKING +import warnings + +from pandas.util._exceptions import find_stack_level +from pandas.util._validators import validate_bool_kwarg + +from pandas.core.dtypes.common import ( + is_extension_array_dtype, + is_string_dtype, +) + +from pandas.core.computation.engines import ENGINES +from pandas.core.computation.expr import ( + PARSERS, + Expr, +) +from pandas.core.computation.parsing import tokenize_string +from pandas.core.computation.scope import ensure_scope +from pandas.core.generic import NDFrame + +from pandas.io.formats.printing import pprint_thing + +if TYPE_CHECKING: + from pandas.core.computation.ops import BinOp + + +def _check_engine(engine: str | None) -> str: + """ + Make sure a valid engine is passed. + + Parameters + ---------- + engine : str + String to validate. + + Raises + ------ + KeyError + * If an invalid engine is passed. + ImportError + * If numexpr was requested but doesn't exist. + + Returns + ------- + str + Engine name. + """ + from pandas.core.computation.check import NUMEXPR_INSTALLED + from pandas.core.computation.expressions import USE_NUMEXPR + + if engine is None: + engine = "numexpr" if USE_NUMEXPR else "python" + + if engine not in ENGINES: + valid_engines = list(ENGINES.keys()) + raise KeyError( + f"Invalid engine '{engine}' passed, valid engines are {valid_engines}" + ) + + # TODO: validate this in a more general way (thinking of future engines + # that won't necessarily be import-able) + # Could potentially be done on engine instantiation + if engine == "numexpr" and not NUMEXPR_INSTALLED: + raise ImportError( + "'numexpr' is not installed or an unsupported version. Cannot use " + "engine='numexpr' for query/eval if 'numexpr' is not installed" + ) + + return engine + + +def _check_parser(parser: str): + """ + Make sure a valid parser is passed. + + Parameters + ---------- + parser : str + + Raises + ------ + KeyError + * If an invalid parser is passed + """ + if parser not in PARSERS: + raise KeyError( + f"Invalid parser '{parser}' passed, valid parsers are {PARSERS.keys()}" + ) + + +def _check_resolvers(resolvers): + if resolvers is not None: + for resolver in resolvers: + if not hasattr(resolver, "__getitem__"): + name = type(resolver).__name__ + raise TypeError( + f"Resolver of type '{name}' does not " + "implement the __getitem__ method" + ) + + +def _check_expression(expr): + """ + Make sure an expression is not an empty string + + Parameters + ---------- + expr : object + An object that can be converted to a string + + Raises + ------ + ValueError + * If expr is an empty string + """ + if not expr: + raise ValueError("expr cannot be an empty string") + + +def _convert_expression(expr) -> str: + """ + Convert an object to an expression. + + This function converts an object to an expression (a unicode string) and + checks to make sure it isn't empty after conversion. This is used to + convert operators to their string representation for recursive calls to + :func:`~pandas.eval`. + + Parameters + ---------- + expr : object + The object to be converted to a string. + + Returns + ------- + str + The string representation of an object. + + Raises + ------ + ValueError + * If the expression is empty. + """ + s = pprint_thing(expr) + _check_expression(s) + return s + + +def _check_for_locals(expr: str, stack_level: int, parser: str): + at_top_of_stack = stack_level == 0 + not_pandas_parser = parser != "pandas" + + if not_pandas_parser: + msg = "The '@' prefix is only supported by the pandas parser" + elif at_top_of_stack: + msg = ( + "The '@' prefix is not allowed in top-level eval calls.\n" + "please refer to your variables by name without the '@' prefix." + ) + + if at_top_of_stack or not_pandas_parser: + for toknum, tokval in tokenize_string(expr): + if toknum == tokenize.OP and tokval == "@": + raise SyntaxError(msg) + + +def eval( + expr: str | BinOp, # we leave BinOp out of the docstr bc it isn't for users + parser: str = "pandas", + engine: str | None = None, + local_dict=None, + global_dict=None, + resolvers=(), + level: int = 0, + target=None, + inplace: bool = False, +): + """ + Evaluate a Python expression as a string using various backends. + + The following arithmetic operations are supported: ``+``, ``-``, ``*``, + ``/``, ``**``, ``%``, ``//`` (python engine only) along with the following + boolean operations: ``|`` (or), ``&`` (and), and ``~`` (not). + Additionally, the ``'pandas'`` parser allows the use of :keyword:`and`, + :keyword:`or`, and :keyword:`not` with the same semantics as the + corresponding bitwise operators. :class:`~pandas.Series` and + :class:`~pandas.DataFrame` objects are supported and behave as they would + with plain ol' Python evaluation. + + Parameters + ---------- + expr : str + The expression to evaluate. This string cannot contain any Python + `statements + `__, + only Python `expressions + `__. + parser : {'pandas', 'python'}, default 'pandas' + The parser to use to construct the syntax tree from the expression. The + default of ``'pandas'`` parses code slightly different than standard + Python. Alternatively, you can parse an expression using the + ``'python'`` parser to retain strict Python semantics. See the + :ref:`enhancing performance ` documentation for + more details. + engine : {'python', 'numexpr'}, default 'numexpr' + + The engine used to evaluate the expression. Supported engines are + + - None : tries to use ``numexpr``, falls back to ``python`` + - ``'numexpr'`` : This default engine evaluates pandas objects using + numexpr for large speed ups in complex expressions with large frames. + - ``'python'`` : Performs operations as if you had ``eval``'d in top + level python. This engine is generally not that useful. + + More backends may be available in the future. + local_dict : dict or None, optional + A dictionary of local variables, taken from locals() by default. + global_dict : dict or None, optional + A dictionary of global variables, taken from globals() by default. + resolvers : list of dict-like or None, optional + A list of objects implementing the ``__getitem__`` special method that + you can use to inject an additional collection of namespaces to use for + variable lookup. For example, this is used in the + :meth:`~DataFrame.query` method to inject the + ``DataFrame.index`` and ``DataFrame.columns`` + variables that refer to their respective :class:`~pandas.DataFrame` + instance attributes. + level : int, optional + The number of prior stack frames to traverse and add to the current + scope. Most users will **not** need to change this parameter. + target : object, optional, default None + This is the target object for assignment. It is used when there is + variable assignment in the expression. If so, then `target` must + support item assignment with string keys, and if a copy is being + returned, it must also support `.copy()`. + inplace : bool, default False + If `target` is provided, and the expression mutates `target`, whether + to modify `target` inplace. Otherwise, return a copy of `target` with + the mutation. + + Returns + ------- + ndarray, numeric scalar, DataFrame, Series, or None + The completion value of evaluating the given code or None if ``inplace=True``. + + Raises + ------ + ValueError + There are many instances where such an error can be raised: + + - `target=None`, but the expression is multiline. + - The expression is multiline, but not all them have item assignment. + An example of such an arrangement is this: + + a = b + 1 + a + 2 + + Here, there are expressions on different lines, making it multiline, + but the last line has no variable assigned to the output of `a + 2`. + - `inplace=True`, but the expression is missing item assignment. + - Item assignment is provided, but the `target` does not support + string item assignment. + - Item assignment is provided and `inplace=False`, but the `target` + does not support the `.copy()` method + + See Also + -------- + DataFrame.query : Evaluates a boolean expression to query the columns + of a frame. + DataFrame.eval : Evaluate a string describing operations on + DataFrame columns. + + Notes + ----- + The ``dtype`` of any objects involved in an arithmetic ``%`` operation are + recursively cast to ``float64``. + + See the :ref:`enhancing performance ` documentation for + more details. + + Examples + -------- + >>> df = pd.DataFrame({"animal": ["dog", "pig"], "age": [10, 20]}) + >>> df + animal age + 0 dog 10 + 1 pig 20 + + We can add a new column using ``pd.eval``: + + >>> pd.eval("double_age = df.age * 2", target=df) + animal age double_age + 0 dog 10 20 + 1 pig 20 40 + """ + inplace = validate_bool_kwarg(inplace, "inplace") + + exprs: list[str | BinOp] + if isinstance(expr, str): + _check_expression(expr) + exprs = [e.strip() for e in expr.splitlines() if e.strip() != ""] + else: + # ops.BinOp; for internal compat, not intended to be passed by users + exprs = [expr] + multi_line = len(exprs) > 1 + + if multi_line and target is None: + raise ValueError( + "multi-line expressions are only valid in the " + "context of data, use DataFrame.eval" + ) + engine = _check_engine(engine) + _check_parser(parser) + _check_resolvers(resolvers) + + ret = None + first_expr = True + target_modified = False + + for expr in exprs: + expr = _convert_expression(expr) + _check_for_locals(expr, level, parser) + + # get our (possibly passed-in) scope + env = ensure_scope( + level + 1, + global_dict=global_dict, + local_dict=local_dict, + resolvers=resolvers, + target=target, + ) + + parsed_expr = Expr(expr, engine=engine, parser=parser, env=env) + + if engine == "numexpr" and ( + ( + is_extension_array_dtype(parsed_expr.terms.return_type) + and not is_string_dtype(parsed_expr.terms.return_type) + ) + or getattr(parsed_expr.terms, "operand_types", None) is not None + and any( + (is_extension_array_dtype(elem) and not is_string_dtype(elem)) + for elem in parsed_expr.terms.operand_types + ) + ): + warnings.warn( + "Engine has switched to 'python' because numexpr does not support " + "extension array dtypes. Please set your engine to python manually.", + RuntimeWarning, + stacklevel=find_stack_level(), + ) + engine = "python" + + # construct the engine and evaluate the parsed expression + eng = ENGINES[engine] + eng_inst = eng(parsed_expr) + ret = eng_inst.evaluate() + + if parsed_expr.assigner is None: + if multi_line: + raise ValueError( + "Multi-line expressions are only valid " + "if all expressions contain an assignment" + ) + if inplace: + raise ValueError("Cannot operate inplace if there is no assignment") + + # assign if needed + assigner = parsed_expr.assigner + if env.target is not None and assigner is not None: + target_modified = True + + # if returning a copy, copy only on the first assignment + if not inplace and first_expr: + try: + target = env.target + if isinstance(target, NDFrame): + target = target.copy(deep=None) + else: + target = target.copy() + except AttributeError as err: + raise ValueError("Cannot return a copy of the target") from err + else: + target = env.target + + # TypeError is most commonly raised (e.g. int, list), but you + # get IndexError if you try to do this assignment on np.ndarray. + # we will ignore numpy warnings here; e.g. if trying + # to use a non-numeric indexer + try: + if inplace and isinstance(target, NDFrame): + target.loc[:, assigner] = ret + else: + target[assigner] = ret # pyright: ignore[reportGeneralTypeIssues] + except (TypeError, IndexError) as err: + raise ValueError("Cannot assign expression output to target") from err + + if not resolvers: + resolvers = ({assigner: ret},) + else: + # existing resolver needs updated to handle + # case of mutating existing column in copy + for resolver in resolvers: + if assigner in resolver: + resolver[assigner] = ret + break + else: + resolvers += ({assigner: ret},) + + ret = None + first_expr = False + + # We want to exclude `inplace=None` as being False. + if inplace is False: + return target if target_modified else ret diff --git a/shared/package-files/2c/2cbd7035d2d86c77117d035b4eb4a1e553c8c841d83c8494942975707a4e8631/construction.py b/shared/package-files/2c/2cbd7035d2d86c77117d035b4eb4a1e553c8c841d83c8494942975707a4e8631/construction.py new file mode 100644 index 0000000000000000000000000000000000000000..59e87f28a3dce82395abc16d3bb3ef63d155c820 --- /dev/null +++ b/shared/package-files/2c/2cbd7035d2d86c77117d035b4eb4a1e553c8c841d83c8494942975707a4e8631/construction.py @@ -0,0 +1,821 @@ +""" +Constructor functions intended to be shared by pd.array, Series.__init__, +and Index.__new__. + +These should not depend on core.internals. +""" +from __future__ import annotations + +from collections.abc import Sequence +from typing import ( + TYPE_CHECKING, + Optional, + Union, + cast, + overload, +) +import warnings + +import numpy as np +from numpy import ma + +from pandas._config import using_string_dtype + +from pandas._libs import lib +from pandas._libs.tslibs import ( + Period, + get_supported_dtype, + is_supported_dtype, +) +from pandas._typing import ( + AnyArrayLike, + ArrayLike, + Dtype, + DtypeObj, + T, +) +from pandas.util._exceptions import find_stack_level + +from pandas.core.dtypes.base import ExtensionDtype +from pandas.core.dtypes.cast import ( + construct_1d_arraylike_from_scalar, + construct_1d_object_array_from_listlike, + maybe_cast_to_datetime, + maybe_cast_to_integer_array, + maybe_convert_platform, + maybe_infer_to_datetimelike, + maybe_promote, +) +from pandas.core.dtypes.common import ( + is_list_like, + is_object_dtype, + is_string_dtype, + pandas_dtype, +) +from pandas.core.dtypes.dtypes import NumpyEADtype +from pandas.core.dtypes.generic import ( + ABCDataFrame, + ABCExtensionArray, + ABCIndex, + ABCSeries, +) +from pandas.core.dtypes.missing import isna + +import pandas.core.common as com + +if TYPE_CHECKING: + from pandas import ( + Index, + Series, + ) + from pandas.core.arrays.base import ExtensionArray + + +def array( + data: Sequence[object] | AnyArrayLike, + dtype: Dtype | None = None, + copy: bool = True, +) -> ExtensionArray: + """ + Create an array. + + Parameters + ---------- + data : Sequence of objects + The scalars inside `data` should be instances of the + scalar type for `dtype`. It's expected that `data` + represents a 1-dimensional array of data. + + When `data` is an Index or Series, the underlying array + will be extracted from `data`. + + dtype : str, np.dtype, or ExtensionDtype, optional + The dtype to use for the array. This may be a NumPy + dtype or an extension type registered with pandas using + :meth:`pandas.api.extensions.register_extension_dtype`. + + If not specified, there are two possibilities: + + 1. When `data` is a :class:`Series`, :class:`Index`, or + :class:`ExtensionArray`, the `dtype` will be taken + from the data. + 2. Otherwise, pandas will attempt to infer the `dtype` + from the data. + + Note that when `data` is a NumPy array, ``data.dtype`` is + *not* used for inferring the array type. This is because + NumPy cannot represent all the types of data that can be + held in extension arrays. + + Currently, pandas will infer an extension dtype for sequences of + + ============================== ======================================= + Scalar Type Array Type + ============================== ======================================= + :class:`pandas.Interval` :class:`pandas.arrays.IntervalArray` + :class:`pandas.Period` :class:`pandas.arrays.PeriodArray` + :class:`datetime.datetime` :class:`pandas.arrays.DatetimeArray` + :class:`datetime.timedelta` :class:`pandas.arrays.TimedeltaArray` + :class:`int` :class:`pandas.arrays.IntegerArray` + :class:`float` :class:`pandas.arrays.FloatingArray` + :class:`str` :class:`pandas.arrays.StringArray` or + :class:`pandas.arrays.ArrowStringArray` + :class:`bool` :class:`pandas.arrays.BooleanArray` + ============================== ======================================= + + The ExtensionArray created when the scalar type is :class:`str` is determined by + ``pd.options.mode.string_storage`` if the dtype is not explicitly given. + + For all other cases, NumPy's usual inference rules will be used. + copy : bool, default True + Whether to copy the data, even if not necessary. Depending + on the type of `data`, creating the new array may require + copying data, even if ``copy=False``. + + Returns + ------- + ExtensionArray + The newly created array. + + Raises + ------ + ValueError + When `data` is not 1-dimensional. + + See Also + -------- + numpy.array : Construct a NumPy array. + Series : Construct a pandas Series. + Index : Construct a pandas Index. + arrays.NumpyExtensionArray : ExtensionArray wrapping a NumPy array. + Series.array : Extract the array stored within a Series. + + Notes + ----- + Omitting the `dtype` argument means pandas will attempt to infer the + best array type from the values in the data. As new array types are + added by pandas and 3rd party libraries, the "best" array type may + change. We recommend specifying `dtype` to ensure that + + 1. the correct array type for the data is returned + 2. the returned array type doesn't change as new extension types + are added by pandas and third-party libraries + + Additionally, if the underlying memory representation of the returned + array matters, we recommend specifying the `dtype` as a concrete object + rather than a string alias or allowing it to be inferred. For example, + a future version of pandas or a 3rd-party library may include a + dedicated ExtensionArray for string data. In this event, the following + would no longer return a :class:`arrays.NumpyExtensionArray` backed by a + NumPy array. + + >>> pd.array(['a', 'b'], dtype=str) + + ['a', 'b'] + Length: 2, dtype: str32 + + This would instead return the new ExtensionArray dedicated for string + data. If you really need the new array to be backed by a NumPy array, + specify that in the dtype. + + >>> pd.array(['a', 'b'], dtype=np.dtype(" + ['a', 'b'] + Length: 2, dtype: str32 + + Finally, Pandas has arrays that mostly overlap with NumPy + + * :class:`arrays.DatetimeArray` + * :class:`arrays.TimedeltaArray` + + When data with a ``datetime64[ns]`` or ``timedelta64[ns]`` dtype is + passed, pandas will always return a ``DatetimeArray`` or ``TimedeltaArray`` + rather than a ``NumpyExtensionArray``. This is for symmetry with the case of + timezone-aware data, which NumPy does not natively support. + + >>> pd.array(['2015', '2016'], dtype='datetime64[ns]') + + ['2015-01-01 00:00:00', '2016-01-01 00:00:00'] + Length: 2, dtype: datetime64[ns] + + >>> pd.array(["1h", "2h"], dtype='timedelta64[ns]') + + ['0 days 01:00:00', '0 days 02:00:00'] + Length: 2, dtype: timedelta64[ns] + + Examples + -------- + If a dtype is not specified, pandas will infer the best dtype from the values. + See the description of `dtype` for the types pandas infers for. + + >>> pd.array([1, 2]) + + [1, 2] + Length: 2, dtype: Int64 + + >>> pd.array([1, 2, np.nan]) + + [1, 2, ] + Length: 3, dtype: Int64 + + >>> pd.array([1.1, 2.2]) + + [1.1, 2.2] + Length: 2, dtype: Float64 + + >>> pd.array(["a", None, "c"]) + + ['a', , 'c'] + Length: 3, dtype: string + + >>> with pd.option_context("string_storage", "pyarrow"): + ... arr = pd.array(["a", None, "c"]) + ... + >>> arr + + ['a', , 'c'] + Length: 3, dtype: string + + >>> pd.array([pd.Period('2000', freq="D"), pd.Period("2000", freq="D")]) + + ['2000-01-01', '2000-01-01'] + Length: 2, dtype: period[D] + + You can use the string alias for `dtype` + + >>> pd.array(['a', 'b', 'a'], dtype='category') + ['a', 'b', 'a'] + Categories (2, object): ['a', 'b'] + + Or specify the actual dtype + + >>> pd.array(['a', 'b', 'a'], + ... dtype=pd.CategoricalDtype(['a', 'b', 'c'], ordered=True)) + ['a', 'b', 'a'] + Categories (3, object): ['a' < 'b' < 'c'] + + If pandas does not infer a dedicated extension type a + :class:`arrays.NumpyExtensionArray` is returned. + + >>> pd.array([1 + 1j, 3 + 2j]) + + [(1+1j), (3+2j)] + Length: 2, dtype: complex128 + + As mentioned in the "Notes" section, new extension types may be added + in the future (by pandas or 3rd party libraries), causing the return + value to no longer be a :class:`arrays.NumpyExtensionArray`. Specify the + `dtype` as a NumPy dtype if you need to ensure there's no future change in + behavior. + + >>> pd.array([1, 2], dtype=np.dtype("int32")) + + [1, 2] + Length: 2, dtype: int32 + + `data` must be 1-dimensional. A ValueError is raised when the input + has the wrong dimensionality. + + >>> pd.array(1) + Traceback (most recent call last): + ... + ValueError: Cannot pass scalar '1' to 'pandas.array'. + """ + from pandas.core.arrays import ( + BooleanArray, + DatetimeArray, + ExtensionArray, + FloatingArray, + IntegerArray, + IntervalArray, + NumpyExtensionArray, + PeriodArray, + TimedeltaArray, + ) + from pandas.core.arrays.string_ import StringDtype + + if lib.is_scalar(data): + msg = f"Cannot pass scalar '{data}' to 'pandas.array'." + raise ValueError(msg) + elif isinstance(data, ABCDataFrame): + raise TypeError("Cannot pass DataFrame to 'pandas.array'") + + if dtype is None and isinstance(data, (ABCSeries, ABCIndex, ExtensionArray)): + # Note: we exclude np.ndarray here, will do type inference on it + dtype = data.dtype + + data = extract_array(data, extract_numpy=True) + + # this returns None for not-found dtypes. + if dtype is not None: + dtype = pandas_dtype(dtype) + + if isinstance(data, ExtensionArray) and (dtype is None or data.dtype == dtype): + # e.g. TimedeltaArray[s], avoid casting to NumpyExtensionArray + if copy: + return data.copy() + return data + + if isinstance(dtype, ExtensionDtype): + cls = dtype.construct_array_type() + return cls._from_sequence(data, dtype=dtype, copy=copy) + + if dtype is None: + inferred_dtype = lib.infer_dtype(data, skipna=True) + if inferred_dtype == "period": + period_data = cast(Union[Sequence[Optional[Period]], AnyArrayLike], data) + return PeriodArray._from_sequence(period_data, copy=copy) + + elif inferred_dtype == "interval": + return IntervalArray(data, copy=copy) + + elif inferred_dtype.startswith("datetime"): + # datetime, datetime64 + try: + return DatetimeArray._from_sequence(data, copy=copy) + except ValueError: + # Mixture of timezones, fall back to NumpyExtensionArray + pass + + elif inferred_dtype.startswith("timedelta"): + # timedelta, timedelta64 + return TimedeltaArray._from_sequence(data, copy=copy) + + elif inferred_dtype == "string": + # StringArray/ArrowStringArray depending on pd.options.mode.string_storage + dtype = StringDtype() + cls = dtype.construct_array_type() + return cls._from_sequence(data, dtype=dtype, copy=copy) + + elif inferred_dtype == "integer": + return IntegerArray._from_sequence(data, copy=copy) + elif inferred_dtype == "empty" and not hasattr(data, "dtype") and not len(data): + return FloatingArray._from_sequence(data, copy=copy) + elif ( + inferred_dtype in ("floating", "mixed-integer-float") + and getattr(data, "dtype", None) != np.float16 + ): + # GH#44715 Exclude np.float16 bc FloatingArray does not support it; + # we will fall back to NumpyExtensionArray. + return FloatingArray._from_sequence(data, copy=copy) + + elif inferred_dtype == "boolean": + return BooleanArray._from_sequence(data, dtype="boolean", copy=copy) + + # Pandas overrides NumPy for + # 1. datetime64[ns,us,ms,s] + # 2. timedelta64[ns,us,ms,s] + # so that a DatetimeArray is returned. + if lib.is_np_dtype(dtype, "M") and is_supported_dtype(dtype): + return DatetimeArray._from_sequence(data, dtype=dtype, copy=copy) + if lib.is_np_dtype(dtype, "m") and is_supported_dtype(dtype): + return TimedeltaArray._from_sequence(data, dtype=dtype, copy=copy) + + elif lib.is_np_dtype(dtype, "mM"): + warnings.warn( + r"datetime64 and timedelta64 dtype resolutions other than " + r"'s', 'ms', 'us', and 'ns' are deprecated. " + r"In future releases passing unsupported resolutions will " + r"raise an exception.", + FutureWarning, + stacklevel=find_stack_level(), + ) + + return NumpyExtensionArray._from_sequence(data, dtype=dtype, copy=copy) + + +_typs = frozenset( + { + "index", + "rangeindex", + "multiindex", + "datetimeindex", + "timedeltaindex", + "periodindex", + "categoricalindex", + "intervalindex", + "series", + } +) + + +@overload +def extract_array( + obj: Series | Index, extract_numpy: bool = ..., extract_range: bool = ... +) -> ArrayLike: + ... + + +@overload +def extract_array( + obj: T, extract_numpy: bool = ..., extract_range: bool = ... +) -> T | ArrayLike: + ... + + +def extract_array( + obj: T, extract_numpy: bool = False, extract_range: bool = False +) -> T | ArrayLike: + """ + Extract the ndarray or ExtensionArray from a Series or Index. + + For all other types, `obj` is just returned as is. + + Parameters + ---------- + obj : object + For Series / Index, the underlying ExtensionArray is unboxed. + + extract_numpy : bool, default False + Whether to extract the ndarray from a NumpyExtensionArray. + + extract_range : bool, default False + If we have a RangeIndex, return range._values if True + (which is a materialized integer ndarray), otherwise return unchanged. + + Returns + ------- + arr : object + + Examples + -------- + >>> extract_array(pd.Series(['a', 'b', 'c'], dtype='category')) + ['a', 'b', 'c'] + Categories (3, object): ['a', 'b', 'c'] + + Other objects like lists, arrays, and DataFrames are just passed through. + + >>> extract_array([1, 2, 3]) + [1, 2, 3] + + For an ndarray-backed Series / Index the ndarray is returned. + + >>> extract_array(pd.Series([1, 2, 3])) + array([1, 2, 3]) + + To extract all the way down to the ndarray, pass ``extract_numpy=True``. + + >>> extract_array(pd.Series([1, 2, 3]), extract_numpy=True) + array([1, 2, 3]) + """ + typ = getattr(obj, "_typ", None) + if typ in _typs: + # i.e. isinstance(obj, (ABCIndex, ABCSeries)) + if typ == "rangeindex": + if extract_range: + # error: "T" has no attribute "_values" + return obj._values # type: ignore[attr-defined] + return obj + + # error: "T" has no attribute "_values" + return obj._values # type: ignore[attr-defined] + + elif extract_numpy and typ == "npy_extension": + # i.e. isinstance(obj, ABCNumpyExtensionArray) + # error: "T" has no attribute "to_numpy" + return obj.to_numpy() # type: ignore[attr-defined] + + return obj + + +def ensure_wrapped_if_datetimelike(arr): + """ + Wrap datetime64 and timedelta64 ndarrays in DatetimeArray/TimedeltaArray. + """ + if isinstance(arr, np.ndarray): + if arr.dtype.kind == "M": + from pandas.core.arrays import DatetimeArray + + dtype = get_supported_dtype(arr.dtype) + return DatetimeArray._from_sequence(arr, dtype=dtype) + + elif arr.dtype.kind == "m": + from pandas.core.arrays import TimedeltaArray + + dtype = get_supported_dtype(arr.dtype) + return TimedeltaArray._from_sequence(arr, dtype=dtype) + + return arr + + +def sanitize_masked_array(data: ma.MaskedArray) -> np.ndarray: + """ + Convert numpy MaskedArray to ensure mask is softened. + """ + mask = ma.getmaskarray(data) + if mask.any(): + dtype, fill_value = maybe_promote(data.dtype, np.nan) + dtype = cast(np.dtype, dtype) + data = ma.asarray(data.astype(dtype, copy=True)) + data.soften_mask() # set hardmask False if it was True + data[mask] = fill_value + else: + data = data.copy() + return data + + +def sanitize_array( + data, + index: Index | None, + dtype: DtypeObj | None = None, + copy: bool = False, + *, + allow_2d: bool = False, +) -> ArrayLike: + """ + Sanitize input data to an ndarray or ExtensionArray, copy if specified, + coerce to the dtype if specified. + + Parameters + ---------- + data : Any + index : Index or None, default None + dtype : np.dtype, ExtensionDtype, or None, default None + copy : bool, default False + allow_2d : bool, default False + If False, raise if we have a 2D Arraylike. + + Returns + ------- + np.ndarray or ExtensionArray + """ + original_dtype = dtype + if isinstance(data, ma.MaskedArray): + data = sanitize_masked_array(data) + + if isinstance(dtype, NumpyEADtype): + # Avoid ending up with a NumpyExtensionArray + dtype = dtype.numpy_dtype + + object_index = False + if isinstance(data, ABCIndex) and data.dtype == object and dtype is None: + object_index = True + + # extract ndarray or ExtensionArray, ensure we have no NumpyExtensionArray + data = extract_array(data, extract_numpy=True, extract_range=True) + + if isinstance(data, np.ndarray) and data.ndim == 0: + if dtype is None: + dtype = data.dtype + data = lib.item_from_zerodim(data) + elif isinstance(data, range): + # GH#16804 + data = range_to_ndarray(data) + copy = False + + if not is_list_like(data): + if index is None: + raise ValueError("index must be specified when data is not list-like") + if isinstance(data, str) and using_string_dtype() and original_dtype is None: + from pandas.core.arrays.string_ import StringDtype + + dtype = StringDtype(na_value=np.nan) + data = construct_1d_arraylike_from_scalar(data, len(index), dtype) + + return data + + elif isinstance(data, ABCExtensionArray): + # it is already ensured above this is not a NumpyExtensionArray + # Until GH#49309 is fixed this check needs to come before the + # ExtensionDtype check + if dtype is not None: + subarr = data.astype(dtype, copy=copy) + elif copy: + subarr = data.copy() + else: + subarr = data + + elif isinstance(dtype, ExtensionDtype): + # create an extension array from its dtype + _sanitize_non_ordered(data) + cls = dtype.construct_array_type() + if not hasattr(data, "__array__"): + data = list(data) + subarr = cls._from_sequence(data, dtype=dtype, copy=copy) + + # GH#846 + elif isinstance(data, np.ndarray): + if isinstance(data, np.matrix): + data = data.A + + if dtype is None: + subarr = data + if data.dtype == object: + subarr = maybe_infer_to_datetimelike(data) + if object_index and using_string_dtype() and is_string_dtype(subarr): + # Avoid inference when string option is set + subarr = data + elif data.dtype.kind == "U" and using_string_dtype(): + from pandas.core.arrays.string_ import StringDtype + + dtype = StringDtype(na_value=np.nan) + subarr = dtype.construct_array_type()._from_sequence(data, dtype=dtype) + + if ( + subarr is data + or (subarr.dtype == "str" and subarr.dtype.storage == "python") # type: ignore[union-attr] + ) and copy: + subarr = subarr.copy() + + else: + # we will try to copy by-definition here + subarr = _try_cast(data, dtype, copy) + + elif hasattr(data, "__array__"): + # e.g. dask array GH#38645 + if not copy: + data = np.asarray(data) + else: + data = np.array(data, copy=copy) + return sanitize_array( + data, + index=index, + dtype=dtype, + copy=False, + allow_2d=allow_2d, + ) + + else: + _sanitize_non_ordered(data) + # materialize e.g. generators, convert e.g. tuples, abc.ValueView + data = list(data) + + if len(data) == 0 and dtype is None: + # We default to float64, matching numpy + subarr = np.array([], dtype=np.float64) + + elif dtype is not None: + subarr = _try_cast(data, dtype, copy) + + else: + subarr = maybe_convert_platform(data) + if subarr.dtype == object: + subarr = cast(np.ndarray, subarr) + subarr = maybe_infer_to_datetimelike(subarr) + + subarr = _sanitize_ndim(subarr, data, dtype, index, allow_2d=allow_2d) + + if isinstance(subarr, np.ndarray): + # at this point we should have dtype be None or subarr.dtype == dtype + dtype = cast(np.dtype, dtype) + subarr = _sanitize_str_dtypes(subarr, data, dtype, copy) + + return subarr + + +def range_to_ndarray(rng: range) -> np.ndarray: + """ + Cast a range object to ndarray. + """ + # GH#30171 perf avoid realizing range as a list in np.array + try: + arr = np.arange(rng.start, rng.stop, rng.step, dtype="int64") + except OverflowError: + # GH#30173 handling for ranges that overflow int64 + if (rng.start >= 0 and rng.step > 0) or (rng.step < 0 <= rng.stop): + try: + arr = np.arange(rng.start, rng.stop, rng.step, dtype="uint64") + except OverflowError: + arr = construct_1d_object_array_from_listlike(list(rng)) + else: + arr = construct_1d_object_array_from_listlike(list(rng)) + return arr + + +def _sanitize_non_ordered(data) -> None: + """ + Raise only for unordered sets, e.g., not for dict_keys + """ + if isinstance(data, (set, frozenset)): + raise TypeError(f"'{type(data).__name__}' type is unordered") + + +def _sanitize_ndim( + result: ArrayLike, + data, + dtype: DtypeObj | None, + index: Index | None, + *, + allow_2d: bool = False, +) -> ArrayLike: + """ + Ensure we have a 1-dimensional result array. + """ + if getattr(result, "ndim", 0) == 0: + raise ValueError("result should be arraylike with ndim > 0") + + if result.ndim == 1: + # the result that we want + result = _maybe_repeat(result, index) + + elif result.ndim > 1: + if isinstance(data, np.ndarray): + if allow_2d: + return result + raise ValueError( + f"Data must be 1-dimensional, got ndarray of shape {data.shape} instead" + ) + if is_object_dtype(dtype) and isinstance(dtype, ExtensionDtype): + # i.e. NumpyEADtype("O") + + result = com.asarray_tuplesafe(data, dtype=np.dtype("object")) + cls = dtype.construct_array_type() + result = cls._from_sequence(result, dtype=dtype) + else: + # error: Argument "dtype" to "asarray_tuplesafe" has incompatible type + # "Union[dtype[Any], ExtensionDtype, None]"; expected "Union[str, + # dtype[Any], None]" + result = com.asarray_tuplesafe(data, dtype=dtype) # type: ignore[arg-type] + return result + + +def _sanitize_str_dtypes( + result: np.ndarray, data, dtype: np.dtype | None, copy: bool +) -> np.ndarray: + """ + Ensure we have a dtype that is supported by pandas. + """ + + # This is to prevent mixed-type Series getting all casted to + # NumPy string type, e.g. NaN --> '-1#IND'. + if issubclass(result.dtype.type, str): + # GH#16605 + # If not empty convert the data to dtype + # GH#19853: If data is a scalar, result has already the result + if not lib.is_scalar(data): + if not np.all(isna(data)): + data = np.asarray(data, dtype=dtype) + if not copy: + result = np.asarray(data, dtype=object) + else: + result = np.array(data, dtype=object, copy=copy) + return result + + +def _maybe_repeat(arr: ArrayLike, index: Index | None) -> ArrayLike: + """ + If we have a length-1 array and an index describing how long we expect + the result to be, repeat the array. + """ + if index is not None: + if 1 == len(arr) != len(index): + arr = arr.repeat(len(index)) + return arr + + +def _try_cast( + arr: list | np.ndarray, + dtype: np.dtype, + copy: bool, +) -> ArrayLike: + """ + Convert input to numpy ndarray and optionally cast to a given dtype. + + Parameters + ---------- + arr : ndarray or list + Excludes: ExtensionArray, Series, Index. + dtype : np.dtype + copy : bool + If False, don't copy the data if not needed. + + Returns + ------- + np.ndarray or ExtensionArray + """ + is_ndarray = isinstance(arr, np.ndarray) + + if dtype == object: + if not is_ndarray: + subarr = construct_1d_object_array_from_listlike(arr) + return subarr + return ensure_wrapped_if_datetimelike(arr).astype(dtype, copy=copy) + + elif dtype.kind == "U": + # TODO: test cases with arr.dtype.kind in "mM" + if is_ndarray: + arr = cast(np.ndarray, arr) + shape = arr.shape + if arr.ndim > 1: + arr = arr.ravel() + else: + shape = (len(arr),) + return lib.ensure_string_array(arr, convert_na_value=False, copy=copy).reshape( + shape + ) + + elif dtype.kind in "mM": + return maybe_cast_to_datetime(arr, dtype) + + # GH#15832: Check if we are requesting a numeric dtype and + # that we can convert the data to the requested dtype. + elif dtype.kind in "iu": + # this will raise if we have e.g. floats + + subarr = maybe_cast_to_integer_array(arr, dtype) + elif not copy: + subarr = np.asarray(arr, dtype=dtype) + else: + subarr = np.array(arr, dtype=dtype, copy=copy) + + return subarr diff --git a/shared/package-files/2c/2cd0a9c7ebc91359ce70d559f3f60151e5bd9b8889d2d4ac42d8210000719efb/test_function_type.py b/shared/package-files/2c/2cd0a9c7ebc91359ce70d559f3f60151e5bd9b8889d2d4ac42d8210000719efb/test_function_type.py new file mode 100644 index 0000000000000000000000000000000000000000..0d5ece91a619077f10f3c5603174fdee89b611c9 --- /dev/null +++ b/shared/package-files/2c/2cd0a9c7ebc91359ce70d559f3f60151e5bd9b8889d2d4ac42d8210000719efb/test_function_type.py @@ -0,0 +1,1483 @@ +import re +import sys +import unittest +import types as pytypes +from numba import jit, njit, cfunc, types, int64, float64, float32, errors +from numba import literal_unroll, typeof +from numba.core.config import IS_WIN32 +import ctypes +import warnings + +from .support import TestCase, MemoryLeakMixin +from .support import redirect_c_stderr, captured_stderr + +import numpy as np + + +def dump(foo): # FOR DEBUGGING, TO BE REMOVED + from numba.core import function + foo_type = function.fromobject(foo) + foo_sig = foo_type.signature() + foo.compile(foo_sig) + print('{" LLVM IR OF "+foo.__name__+" ":*^70}') + print(foo.inspect_llvm(foo_sig.args)) + print('{"":*^70}') + + +# Decorators for transforming a Python function to different kinds of +# functions: + +def mk_cfunc_func(sig): + def cfunc_func(func): + assert isinstance(func, pytypes.FunctionType), repr(func) + f = cfunc(sig)(func) + f.pyfunc = func + return f + return cfunc_func + + +def njit_func(func): + assert isinstance(func, pytypes.FunctionType), repr(func) + f = jit(nopython=True)(func) + f.pyfunc = func + return f + + +def mk_njit_with_sig_func(sig): + def njit_with_sig_func(func): + assert isinstance(func, pytypes.FunctionType), repr(func) + f = jit(sig, nopython=True)(func) + f.pyfunc = func + return f + return njit_with_sig_func + + +def mk_ctypes_func(sig): + def ctypes_func(func, sig=int64(int64)): + assert isinstance(func, pytypes.FunctionType), repr(func) + cfunc = mk_cfunc_func(sig)(func) + addr = cfunc._wrapper_address + if sig == int64(int64): + f = ctypes.CFUNCTYPE(ctypes.c_int64)(addr) + f.pyfunc = func + return f + raise NotImplementedError( + f'ctypes decorator for {func} with signature {sig}') + return ctypes_func + + +class WAP(types.WrapperAddressProtocol): + """An example implementation of wrapper address protocol. + + """ + def __init__(self, func, sig): + self.pyfunc = func + self.cfunc = cfunc(sig)(func) + self.sig = sig + + def __wrapper_address__(self): + return self.cfunc._wrapper_address + + def signature(self): + return self.sig + + def __call__(self, *args, **kwargs): + return self.pyfunc(*args, **kwargs) + + +def mk_wap_func(sig): + def wap_func(func): + return WAP(func, sig) + return wap_func + + +class TestFunctionType(TestCase): + """Test first-class functions in the context of a Numba jit compiled + function. + + """ + + def test_in__(self): + """Function is passed in as an argument. + """ + + def a(i): + return i + 1 + + def foo(f): + return 0 + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), + njit_func, + mk_njit_with_sig_func(sig), + mk_ctypes_func(sig), + mk_wap_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__, jit=jit_opts): + a_ = decor(a) + self.assertEqual(jit_(foo)(a_), foo(a)) + + def test_in_call__(self): + """Function is passed in as an argument and called. + Also test different return values. + """ + + def a_i64(i): + return i + 1234567 + + def a_f64(i): + return i + 1.5 + + def a_str(i): + return "abc" + + def foo(f): + return f(123) + + for f, sig in [(a_i64, int64(int64)), (a_f64, float64(int64))]: + for decor in [mk_cfunc_func(sig), njit_func, + mk_njit_with_sig_func(sig), + mk_wap_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest( + sig=sig, decor=decor.__name__, jit=jit_opts): + f_ = decor(f) + self.assertEqual(jit_(foo)(f_), foo(f)) + + def test_in_call_out(self): + """Function is passed in as an argument, called, and returned. + """ + + def a(i): + return i + 1 + + def foo(f): + f(123) + return f + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), njit_func, + mk_njit_with_sig_func(sig), mk_wap_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + r1 = jit_(foo)(a_).pyfunc + r2 = foo(a) + self.assertEqual(r1, r2) + + def test_in_seq_call(self): + """Functions are passed in as arguments, used as tuple items, and + called. + + """ + def a(i): + return i + 1 + + def b(i): + return i + 2 + + def foo(f, g): + r = 0 + for f_ in (f, g): + r = r + f_(r) + return r + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), mk_wap_func(sig), + mk_njit_with_sig_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + b_ = decor(b) + self.assertEqual(jit_(foo)(a_, b_), foo(a, b)) + + def test_in_ns_seq_call(self): + """Functions are passed in as an argument and via namespace scoping + (mixed pathways), used as tuple items, and called. + + """ + + def a(i): + return i + 1 + + def b(i): + return i + 2 + + def mkfoo(b_): + def foo(f): + r = 0 + for f_ in (f, b_): + r = r + f_(r) + return r + return foo + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), + mk_njit_with_sig_func(sig), mk_wap_func(sig), + mk_ctypes_func(sig)][:-1]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + b_ = decor(b) + self.assertEqual(jit_(mkfoo(b_))(a_), mkfoo(b)(a)) + + def test_ns_call(self): + """Function is passed in via namespace scoping and called. + + """ + + def a(i): + return i + 1 + + def mkfoo(a_): + def foo(): + return a_(123) + return foo + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), njit_func, + mk_njit_with_sig_func(sig), mk_wap_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + self.assertEqual(jit_(mkfoo(a_))(), mkfoo(a)()) + + def test_ns_out(self): + """Function is passed in via namespace scoping and returned. + + """ + def a(i): + return i + 1 + + def mkfoo(a_): + def foo(): + return a_ + return foo + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), njit_func, + mk_njit_with_sig_func(sig), mk_wap_func(sig), + mk_ctypes_func(sig)][:-1]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + self.assertEqual(jit_(mkfoo(a_))().pyfunc, mkfoo(a)()) + + def test_ns_call_out(self): + """Function is passed in via namespace scoping, called, and then + returned. + + """ + def a(i): + return i + 1 + + def mkfoo(a_): + def foo(): + a_(123) + return a_ + return foo + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), njit_func, + mk_njit_with_sig_func(sig), mk_wap_func(sig), + mk_ctypes_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + self.assertEqual(jit_(mkfoo(a_))().pyfunc, mkfoo(a)()) + + def test_in_overload(self): + """Function is passed in as an argument and called with different + argument types. + + """ + def a(i): + return i + 1 + + def foo(f): + r1 = f(123) + r2 = f(123.45) + return (r1, r2) + + for decor in [njit_func]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + self.assertEqual(jit_(foo)(a_), foo(a)) + + def test_ns_overload(self): + """Function is passed in via namespace scoping and called with + different argument types. + + """ + def a(i): + return i + 1 + + def mkfoo(a_): + def foo(): + r1 = a_(123) + r2 = a_(123.45) + return (r1, r2) + return foo + + for decor in [njit_func]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + self.assertEqual(jit_(mkfoo(a_))(), mkfoo(a)()) + + def test_in_choose(self): + """Functions are passed in as arguments and called conditionally. + + """ + def a(i): + return i + 1 + + def b(i): + return i + 2 + + def foo(a, b, choose_left): + if choose_left: + r = a(1) + else: + r = b(2) + return r + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), njit_func, + mk_njit_with_sig_func(sig), mk_wap_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + b_ = decor(b) + self.assertEqual(jit_(foo)(a_, b_, True), foo(a, b, True)) + self.assertEqual(jit_(foo)(a_, b_, False), + foo(a, b, False)) + self.assertNotEqual(jit_(foo)(a_, b_, True), + foo(a, b, False)) + + def test_ns_choose(self): + """Functions are passed in via namespace scoping and called + conditionally. + + """ + def a(i): + return i + 1 + + def b(i): + return i + 2 + + def mkfoo(a_, b_): + def foo(choose_left): + if choose_left: + r = a_(1) + else: + r = b_(2) + return r + return foo + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), njit_func, + mk_njit_with_sig_func(sig), mk_wap_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + b_ = decor(b) + self.assertEqual(jit_(mkfoo(a_, b_))(True), + mkfoo(a, b)(True)) + self.assertEqual(jit_(mkfoo(a_, b_))(False), + mkfoo(a, b)(False)) + self.assertNotEqual(jit_(mkfoo(a_, b_))(True), + mkfoo(a, b)(False)) + + def test_in_choose_out(self): + """Functions are passed in as arguments and returned conditionally. + + """ + def a(i): + return i + 1 + + def b(i): + return i + 2 + + def foo(a, b, choose_left): + if choose_left: + return a + else: + return b + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), njit_func, + mk_njit_with_sig_func(sig), mk_wap_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + b_ = decor(b) + self.assertEqual(jit_(foo)(a_, b_, True).pyfunc, + foo(a, b, True)) + self.assertEqual(jit_(foo)(a_, b_, False).pyfunc, + foo(a, b, False)) + self.assertNotEqual(jit_(foo)(a_, b_, True).pyfunc, + foo(a, b, False)) + + def test_in_choose_func_value(self): + """Functions are passed in as arguments, selected conditionally and + called. + + """ + def a(i): + return i + 1 + + def b(i): + return i + 2 + + def foo(a, b, choose_left): + if choose_left: + f = a + else: + f = b + return f(1) + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), mk_wap_func(sig), njit_func, + mk_njit_with_sig_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + b_ = decor(b) + self.assertEqual(jit_(foo)(a_, b_, True), foo(a, b, True)) + self.assertEqual(jit_(foo)(a_, b_, False), + foo(a, b, False)) + self.assertNotEqual(jit_(foo)(a_, b_, True), + foo(a, b, False)) + + def test_in_pick_func_call(self): + """Functions are passed in as items of tuple argument, retrieved via + indexing, and called. + + """ + def a(i): + return i + 1 + + def b(i): + return i + 2 + + def foo(funcs, i): + f = funcs[i] + r = f(123) + return r + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), mk_wap_func(sig), + mk_njit_with_sig_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + b_ = decor(b) + self.assertEqual(jit_(foo)((a_, b_), 0), foo((a, b), 0)) + self.assertEqual(jit_(foo)((a_, b_), 1), foo((a, b), 1)) + self.assertNotEqual(jit_(foo)((a_, b_), 0), foo((a, b), 1)) + + def test_in_iter_func_call(self): + """Functions are passed in as items of tuple argument, retrieved via + indexing, and called within a variable for-loop. + + """ + def a(i): + return i + 1 + + def b(i): + return i + 2 + + def foo(funcs, n): + r = 0 + for i in range(n): + f = funcs[i] + r = r + f(r) + return r + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), mk_wap_func(sig), + mk_njit_with_sig_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + b_ = decor(b) + self.assertEqual(jit_(foo)((a_, b_), 2), foo((a, b), 2)) + + def test_experimental_feature_warning(self): + @jit(nopython=True) + def more(x): + return x + 1 + + @jit(nopython=True) + def less(x): + return x - 1 + + @jit(nopython=True) + def foo(sel, x): + fn = more if sel else less + return fn(x) + + with warnings.catch_warnings(record=True) as ws: + warnings.simplefilter("always") + res = foo(True, 10) + + self.assertEqual(res, 11) + self.assertEqual(foo(False, 10), 9) + + self.assertGreaterEqual(len(ws), 1) + pat = "First-class function type feature is experimental" + for w in ws: + if pat in str(w.message): + break + else: + self.fail("missing warning") + + +class TestFunctionTypeExtensions(TestCase): + """Test calling external library functions within Numba jit compiled + functions. + + """ + + def test_wrapper_address_protocol_libm(self): + """Call cos and sinf from standard math library. + + """ + import ctypes.util + + class LibM(types.WrapperAddressProtocol): + + def __init__(self, fname): + if IS_WIN32: + lib = ctypes.cdll.msvcrt + else: + libpath = ctypes.util.find_library('m') + lib = ctypes.cdll.LoadLibrary(libpath) + self.lib = lib + self._name = fname + if fname == 'cos': + # test for double-precision math function + addr = ctypes.cast(self.lib.cos, ctypes.c_voidp).value + signature = float64(float64) + elif fname == 'sinf': + # test for single-precision math function + # Other 32/64 bit platforms define sinf as the + # single-precision sin function + addr = ctypes.cast(self.lib.sinf, ctypes.c_voidp).value + signature = float32(float32) + else: + raise NotImplementedError( + f'wrapper address of `{fname}`' + f' with signature `{signature}`') + self._signature = signature + self._address = addr + + def __repr__(self): + return f'{type(self).__name__}({self._name!r})' + + def __wrapper_address__(self): + return self._address + + def signature(self): + return self._signature + + mycos = LibM('cos') + mysin = LibM('sinf') + + def myeval(f, x): + return f(x) + + # Not testing forceobj=True as it requires implementing + # LibM.__call__ using ctypes which would be out-of-scope here. + for jit_opts in [dict(nopython=True)]: + jit_ = jit(**jit_opts) + with self.subTest(jit=jit_opts): + if mycos.signature() is not None: + self.assertEqual(jit_(myeval)(mycos, 0.0), 1.0) + if mysin.signature() is not None: + self.assertEqual(jit_(myeval)(mysin, float32(0.0)), 0.0) + + def test_compilation_results(self): + """Turn the existing compilation results of a dispatcher instance to + first-class functions with precise types. + """ + + @jit(nopython=True) + def add_template(x, y): + return x + y + + # Trigger compilations + self.assertEqual(add_template(1, 2), 3) + self.assertEqual(add_template(1.2, 3.4), 4.6) + + cres1, cres2 = add_template.overloads.values() + + # Turn compilation results into first-class functions + iadd = types.CompileResultWAP(cres1) + fadd = types.CompileResultWAP(cres2) + + @jit(nopython=True) + def foo(add, x, y): + return add(x, y) + + @jit(forceobj=True) + def foo_obj(add, x, y): + return add(x, y) + + self.assertEqual(foo(iadd, 3, 4), 7) + self.assertEqual(foo(fadd, 3.4, 4.5), 7.9) + + self.assertEqual(foo_obj(iadd, 3, 4), 7) + self.assertEqual(foo_obj(fadd, 3.4, 4.5), 7.9) + + +class TestMiscIssues(TestCase): + """Test issues of using first-class functions in the context of Numba + jit compiled functions. + + """ + + def test_issue_3405_using_cfunc(self): + + @cfunc('int64()') + def a(): + return 2 + + @cfunc('int64()') + def b(): + return 3 + + def g(arg): + if arg: + f = a + else: + f = b + return f() + + self.assertEqual(jit(nopython=True)(g)(True), 2) + self.assertEqual(jit(nopython=True)(g)(False), 3) + + def test_issue_3405_using_njit(self): + + @jit(nopython=True) + def a(): + return 2 + + @jit(nopython=True) + def b(): + return 3 + + def g(arg): + if not arg: + f = b + else: + f = a + return f() + + self.assertEqual(jit(nopython=True)(g)(True), 2) + self.assertEqual(jit(nopython=True)(g)(False), 3) + + def test_pr4967_example(self): + + @cfunc('int64(int64)') + def a(i): + return i + 1 + + @cfunc('int64(int64)') + def b(i): + return i + 2 + + @jit(nopython=True) + def foo(f, g): + i = f(2) + seq = (f, g) + for fun in seq: + i += fun(i) + return i + + a_ = a._pyfunc + b_ = b._pyfunc + self.assertEqual(foo(a, b), + a_(2) + a_(a_(2)) + b_(a_(2) + a_(a_(2)))) + + def test_pr4967_array(self): + import numpy as np + + @cfunc("intp(intp[:], float64[:])") + def foo1(x, y): + return x[0] + y[0] + + @cfunc("intp(intp[:], float64[:])") + def foo2(x, y): + return x[0] - y[0] + + def bar(fx, fy, i): + a = np.array([10], dtype=np.intp) + b = np.array([12], dtype=np.float64) + if i == 0: + f = fx + elif i == 1: + f = fy + else: + return + return f(a, b) + + r = jit(nopython=True, no_cfunc_wrapper=True)(bar)(foo1, foo2, 0) + self.assertEqual(r, bar(foo1, foo2, 0)) + self.assertNotEqual(r, bar(foo1, foo2, 1)) + + def test_reference_example(self): + import numba + + @numba.njit + def composition(funcs, x): + r = x + for f in funcs[::-1]: + r = f(r) + return r + + @numba.cfunc("double(double)") + def a(x): + return x + 1.0 + + @numba.njit() + def b(x): + return x * x + + r = composition((a, b, b, a), 0.5) + self.assertEqual(r, (0.5 + 1.0) ** 4 + 1.0) + + r = composition((b, a, b, b, a), 0.5) + self.assertEqual(r, ((0.5 + 1.0) ** 4 + 1.0) ** 2) + + def test_apply_function_in_function(self): + + def foo(f, f_inner): + return f(f_inner) + + @cfunc('int64(float64)') + def f_inner(i): + return int64(i * 3) + + @cfunc(int64(types.FunctionType(f_inner._sig))) + def f(f_inner): + return f_inner(123.4) + + self.assertEqual(jit(nopython=True)(foo)(f, f_inner), + foo(f._pyfunc, f_inner._pyfunc)) + + def test_function_with_none_argument(self): + + @cfunc(int64(types.none)) + def a(i): + return 1 + + @jit(nopython=True) + def foo(f): + return f(None) + + self.assertEqual(foo(a), 1) + + def test_constant_functions(self): + + @jit(nopython=True) + def a(): + return 123 + + @jit(nopython=True) + def b(): + return 456 + + @jit(nopython=True) + def foo(): + return a() + b() + + r = foo() + if r != 123 + 456: + print(foo.overloads[()].library.get_llvm_str()) + self.assertEqual(r, 123 + 456) + + def test_generators(self): + + @jit(forceobj=True) + def gen(xs): + for x in xs: + x += 1 + yield x + + @jit(forceobj=True) + def con(gen_fn, xs): + return [it for it in gen_fn(xs)] + + self.assertEqual(con(gen, (1, 2, 3)), [2, 3, 4]) + + @jit(nopython=True) + def gen_(xs): + for x in xs: + x += 1 + yield x + self.assertEqual(con(gen_, (1, 2, 3)), [2, 3, 4]) + + def test_jit_support(self): + + @jit(nopython=True) + def foo(f, x): + return f(x) + + @jit() + def a(x): + return x + 1 + + @jit() + def a2(x): + return x - 1 + + @jit() + def b(x): + return x + 1.5 + + self.assertEqual(foo(a, 1), 2) + a2(5) # pre-compile + self.assertEqual(foo(a2, 2), 1) + self.assertEqual(foo(a2, 3), 2) + self.assertEqual(foo(a, 2), 3) + self.assertEqual(foo(a, 1.5), 2.5) + self.assertEqual(foo(a2, 1), 0) + self.assertEqual(foo(a, 2.5), 3.5) + self.assertEqual(foo(b, 1.5), 3.0) + self.assertEqual(foo(b, 1), 2.5) + + def test_signature_mismatch(self): + @jit(nopython=True) + def f1(x): + return x + + @jit(nopython=True) + def f2(x): + return x + + @jit(nopython=True) + def foo(disp1, disp2, sel): + if sel == 1: + fn = disp1 + else: + fn = disp2 + return fn([1]), fn(2) + + with self.assertRaises(errors.UnsupportedError) as cm: + foo(f1, f2, sel=1) + self.assertRegex( + str(cm.exception), 'mismatch of function types:') + + # this works because `sel == 1` condition is optimized away: + self.assertEqual(foo(f1, f1, sel=1), ([1], 2)) + + def test_unique_dispatcher(self): + # In general, the type of a dispatcher instance is imprecise + # and when used as an input to type-inference, the typing will + # likely fail. However, if a dispatcher instance contains + # exactly one overload and compilation is disabled for the dispatcher, + # then the type of dispatcher instance is interpreted as precise + # and is transformed to a FunctionType instance with the defined + # signature of the single overload. + + def foo_template(funcs, x): + r = x + for f in funcs: + r = f(r) + return r + + a = jit(nopython=True)(lambda x: x + 1) + b = jit(nopython=True)(lambda x: x + 2) + foo = jit(nopython=True)(foo_template) + + # compiling and disabling compilation for `a` is sufficient, + # `b` will inherit its type from the container Tuple type + a(0) + a.disable_compile() + + r = foo((a, b), 0) + self.assertEqual(r, 3) + # the Tuple type of foo's first argument is a precise FunctionType: + self.assertEqual(foo.signatures[0][0].dtype.is_precise(), True) + + def test_zero_address(self): + + sig = int64() + + @cfunc(sig) + def test(): + return 123 + + class Good(types.WrapperAddressProtocol): + """A first-class function type with valid address. + """ + + def __wrapper_address__(self): + return test.address + + def signature(self): + return sig + + class Bad(types.WrapperAddressProtocol): + """A first-class function type with invalid 0 address. + """ + + def __wrapper_address__(self): + return 0 + + def signature(self): + return sig + + class BadToGood(types.WrapperAddressProtocol): + """A first-class function type with invalid address that is + recovered to a valid address. + """ + + counter = -1 + + def __wrapper_address__(self): + self.counter += 1 + return test.address * min(1, self.counter) + + def signature(self): + return sig + + good = Good() + bad = Bad() + bad2good = BadToGood() + + @jit(int64(sig.as_type())) + def foo(func): + return func() + + @jit(int64()) + def foo_good(): + return good() + + @jit(int64()) + def foo_bad(): + return bad() + + @jit(int64()) + def foo_bad2good(): + return bad2good() + + self.assertEqual(foo(good), 123) + + self.assertEqual(foo_good(), 123) + + with self.assertRaises(ValueError) as cm: + foo(bad) + self.assertRegex( + str(cm.exception), + 'wrapper address of <.*> instance must be a positive') + + with self.assertRaises(RuntimeError) as cm: + foo_bad() + self.assertRegex( + str(cm.exception), r'.* function address is null') + + self.assertEqual(foo_bad2good(), 123) + + def test_issue_5470(self): + + @njit() + def foo1(): + return 10 + + @njit() + def foo2(): + return 20 + + formulae_foo = (foo1, foo1) + + @njit() + def bar_scalar(f1, f2): + return f1() + f2() + + @njit() + def bar(): + return bar_scalar(*formulae_foo) + + self.assertEqual(bar(), 20) + + formulae_foo = (foo1, foo2) + + @njit() + def bar(): + return bar_scalar(*formulae_foo) + + self.assertEqual(bar(), 30) + + def test_issue_5540(self): + + @njit(types.int64(types.int64)) + def foo(x): + return x + 1 + + @njit + def bar_bad(foos): + f = foos[0] + return f(x=1) + + @njit + def bar_good(foos): + f = foos[0] + return f(1) + + self.assertEqual(bar_good((foo, )), 2) + + # new/old style error handling + with self.assertRaises((errors.UnsupportedError, + errors.TypingError)) as cm: + bar_bad((foo, )) + + self.assertRegex( + str(cm.exception), + r'.*first-class function call cannot use keyword arguments') + + def test_issue_5615(self): + + @njit + def foo1(x): + return x + 1 + + @njit + def foo2(x): + return x + 2 + + @njit + def bar(fcs): + x = 0 + a = 10 + i, j = fcs[0] + x += i(j(a)) + for t in literal_unroll(fcs): + i, j = t + x += i(j(a)) + return x + + tup = ((foo1, foo2), (foo2, foo1)) + + self.assertEqual(bar(tup), 39) + + def test_issue_5685(self): + + @njit + def foo1(): + return 1 + + @njit + def foo2(x): + return x + 1 + + @njit + def foo3(x): + return x + 2 + + @njit + def bar(fcs): + r = 0 + for pair in literal_unroll(fcs): + f1, f2 = pair + r += f1() + f2(2) + return r + + self.assertEqual(bar(((foo1, foo2),)), 4) + self.assertEqual(bar(((foo1, foo2), (foo1, foo3))), 9) # reproducer + + def test_issue_10758(self): + # See https://github.com/numba/numba/issues/10758 + # Two functions with different signatures can't be unified. That used + # to hit a bare assert and raise an AssertionError with no message. + + @cfunc(float64(float64)) + def f(x): + return x + 1.0 + + @cfunc(int64(int64)) + def g(x): + return x + 1 + + @cfunc(float64(float64)) + def h(x): + return x + 2.0 + + @njit + def foo(pair, x): + return pair[0](x), pair[1](x) + + with self.assertRaisesRegex(ValueError, 'mismatch of argument types:'): + foo((f, g), 1.0) # reproducer + + # matching signatures still unify + self.assertEqual(foo((f, h), 1.0), (2.0, 3.0)) + + +class TestBasicSubtyping(TestCase): + def test_basic(self): + """ + Test that a dispatcher object *with* a pre-compiled overload + can be used as input to another function with locked-down signature + """ + a = 1 + + @njit + def foo(x): + return x + 1 + + foo(a) + int_int_fc = types.FunctionType(types.int64(types.int64,)) + + @njit(types.int64(int_int_fc)) + def bar(fc): + return fc(a) + + self.assertEqual(bar(foo), foo(a)) + + def test_basic2(self): + """ + Test that a dispatcher object *without* a pre-compiled overload + can be used as input to another function with locked-down signature + """ + a = 1 + + @njit + def foo(x): + return x + 1 + + int_int_fc = types.FunctionType(types.int64(types.int64,)) + + @njit(types.int64(int_int_fc)) + def bar(fc): + return fc(a) + + self.assertEqual(bar(foo), foo(a)) + + def test_basic3(self): + """ + Test that a dispatcher object *without* a pre-compiled overload + can be used as input to another function with locked-down signature and + that it behaves as a truly generic function (foo1 does not get locked) + """ + a = 1 + + @njit + def foo1(x): + return x + 1 + + @njit + def foo2(x): + return x + 2 + + int_int_fc = types.FunctionType(types.int64(types.int64,)) + + @njit(types.int64(int_int_fc)) + def bar(fc): + return fc(a) + + self.assertEqual(bar(foo1) + 1, bar(foo2)) + + def test_basic4(self): + """ + Test that a dispatcher object can be used as input to another + function with signature as part of a tuple + """ + a = 1 + + @njit + def foo1(x): + return x + 1 + + @njit + def foo2(x): + return x + 2 + + tup = (foo1, foo2) + int_int_fc = types.FunctionType(types.int64(types.int64,)) + + @njit(types.int64(types.UniTuple(int_int_fc, 2))) + def bar(fcs): + x = 0 + for i in range(2): + x += fcs[i](a) + return x + self.assertEqual(bar(tup), foo1(a) + foo2(a)) + + def test_basic5(self): + a = 1 + + @njit + def foo1(x): + return x + 1 + + @njit + def foo2(x): + return x + 2 + + @njit + def bar1(x): + return x / 10 + + @njit + def bar2(x): + return x / 1000 + + tup = (foo1, foo2) + tup_bar = (bar1, bar2) + int_int_fc = types.FunctionType(types.int64(types.int64,)) + + flt_flt_fc = types.FunctionType(types.float64(types.float64,)) + + @njit((types.UniTuple(int_int_fc, 2), types.UniTuple(flt_flt_fc, 2))) + def bar(fcs, ffs): + x = 0 + for i in range(2): + x += fcs[i](a) + for fn in ffs: + x += fn(a) + return x + + got = bar(tup, tup_bar) + expected = foo1(a) + foo2(a) + bar1(a) + bar2(a) + self.assertEqual(got, expected) + + +class TestMultiFunctionType(MemoryLeakMixin, TestCase): + + def test_base(self): + # The test is adapted from https://github.com/numba/numba/issues/9071 + nb_array = typeof(np.ones(2)) + callee_int_type = types.FunctionType(int64(int64)) + sig_int = int64(callee_int_type, int64) + callee_array_type = types.FunctionType(float64(nb_array)) + sig_array = float64(callee_array_type, nb_array) + + @njit([sig_int, sig_array]) + def caller(callee, a): + return callee(a) + + @njit + def callee_int(b): + return b + + @njit + def callee_array(c): + return c.sum() + + b = 1 + c = np.ones(2) + + self.assertEqual(caller(callee_int, b), b) + self.assertEqual(caller(callee_array, c), c.sum()) + + +class TestInliningFunctionType(MemoryLeakMixin, TestCase): + def count_num_bb_in_cfg(self, dispatcher): + dot = dispatcher.inspect_cfg(dispatcher.signatures[0]).dot + num_of_nodes = re.findall(r"Node0x[0-9a-z]+", dot) + return len(num_of_nodes) + + def test_inlining_global_dispatcher(self): + @njit + def add(x, y): + return x + y + + fnty = types.FunctionType(int64(int64, int64)) + + @njit(int64(fnty, int64, int64)) + def callme(fn, x, y): + c = 0 + for i in range(100): + c += fn(x, y) + return c + + @njit + def bar(x, y): + return callme(add, x, y) + + res = bar(123, 321) + self.assertEqual(100 * (123 + 321), res) + # There's only one BB because LLVM will be able to fully optimize + # the reduce-add loop if add() is properly inlined. + self.assertEqual(self.count_num_bb_in_cfg(bar), 1) + + def test_not_inlining_dispatcher_args(self): + @njit + def add(x, y): + return x + y + + fnty = types.FunctionType(int64(int64, int64)) + + @njit(int64(fnty, int64, int64)) + def callme(fn, x, y): + c = 0 + for i in range(100): + c += fn(x, y) + return c + + res = callme(add, 123, 321) + + self.assertEqual(100 * (123 + 321), res) + # Since add() is not inline-able. The number of BB will be greater + # than 1. See test_inlining_global_dispatcher(). + self.assertGreater(self.count_num_bb_in_cfg(callme), 1) + + +class TestExceptionInFunctionType(MemoryLeakMixin, TestCase): + def test_exception_raising(self): + class MyError(Exception): + pass + + @njit + def add(x, y): + res = x + y + if res > 100: + raise MyError(res) + return res + + fnty = types.FunctionType(int64(int64, int64)) + + @njit(int64(fnty)) + def callme(fn): + c = 0 + for i in range(100): + c = fn(c, i) + return c + + @njit + def bar(): + return callme(add) + + # Pass Dispatcher as a global reference + with self.assertRaises(MyError) as exc: + bar() + self.assertEqual(exc.exception.args, (105,)) + + # Pass Dispatcher by argument + with self.assertRaises(MyError) as exc: + callme(add) + self.assertEqual(exc.exception.args, (105,)) + + def test_exception_ignored_in_cfunc(self): + class MyError(Exception): + pass + + @njit + def add(x, y): + res = x + y + if res > 100: + raise MyError(res) + return res + + fnty = types.FunctionType(int64(int64, int64)) + + @njit(int64(fnty, int64, int64)) + def callme(fn, x, y): + return fn(x, y) + + # Cfunc as argument will ignore raised exception + @cfunc(int64(int64, int64)) + def c_add(x, y): + return add(x, y) + + self.assertEqual(callme(c_add, 12, 32), 44) + + # If unittest is buffering (-b), the message goes to Python level stderr + # otherwise, it goes to C stderr. + with redirect_c_stderr() as c_stderr, captured_stderr() as stderr: + # raise ignored and result is garbage + callme(c_add, 100, 1) + sys.stderr.flush() + + err = c_stderr.read() + if not err: + err = stderr.getvalue() + + self.assertIn("Exception ignored in:", err) + self.assertIn(str(MyError(101)), err) + + +class TestFunctionTypeReturnMismatch(TestCase): + """https://github.com/numba/numba/issues/10755""" + + def test_literal_str_vs_unicode(self): + @jit + def gm(): + return "hello" + + @jit((types.FunctionType(types.unicode_type()),)) + def probe(fn): + r = fn() + return len(r), r == "hello", r == "" + + self.assertEqual(probe(gm), (5, True, False)) + self.assertEqual(list(gm.nopython_signatures), + [types.unicode_type()]) + + def test_literal_int_vs_float64(self): + @jit + def gm(): + return 7 + + @jit((types.FunctionType(float64()),)) + def probe(fn): + return fn() + + self.assertEqual(probe(gm), 7.0) + self.assertEqual(list(gm.nopython_signatures), [float64()]) + + def test_preexisting_literal_str_mismatch(self): + # Pre-existing () -> Literal[str] overload is keyed by args only, + # so compile(sig) does not replace it, mismatch must raise. + @jit + def gm(): + return "hello" + + self.assertEqual(gm(), "hello") + + @jit((types.FunctionType(types.unicode_type()),)) + def probe(fn): + r = fn() + return len(r), r == "hello", r == "" + + with self.assertRaises(TypeError) as raises: + probe(gm) + self.assertIn("mismatch of return type", str(raises.exception)) + + +if __name__ == '__main__': + unittest.main() diff --git a/shared/package-files/2c/2cd1ab913b65eb449d9229843d8289b2070015c7270b1f67be6e8551398fc04d/EXPERIMENTS.md b/shared/package-files/2c/2cd1ab913b65eb449d9229843d8289b2070015c7270b1f67be6e8551398fc04d/EXPERIMENTS.md new file mode 100644 index 0000000000000000000000000000000000000000..4256df6d4020ecbaad029ad6c7834e67852bbac7 --- /dev/null +++ b/shared/package-files/2c/2cd1ab913b65eb449d9229843d8289b2070015c7270b1f67be6e8551398fc04d/EXPERIMENTS.md @@ -0,0 +1,9036 @@ +# Experiments + +All learned weights are initialized here from scratch. Validation windows are used only for selection and diagnostics. Screen evaluations span all 97 configurations, sampling at most 192 instances per configuration with seed 2026 and recomputing Seasonal Naive on exactly that subset. Full validation uses the supplied reference. Neither scale is the held-out reward scale. + +## E0: contract bootstrap +- Hypothesis: maintain a runnable package while training the first candidate. +- Changed factor: none; provided Seasonal Naive formula, with no learned parameters. +- Seed: deterministic. Measured compute: no training. +- Checkpoint hash: not applicable. +- Outcome: provisional package published with atomic directory exchange. + +## E1: direct long-horizon quantile forecasting +- Hypothesis: a direct horizon objective and explicit seasonal context features reduce long-horizon median drift and the underestimation of uncertainty from short-patch autoregression. +- Changed factors relative to the supplied baseline: 6,758,720-parameter encoder/decoder (4 encoder and 3 decoder layers, width 256), 32-point patches, variable 512–4096-point context, direct 32/128/512/1024-step objectives, monotone nine-quantile head. Context features contain recent levels, fixed damped slope and four-cycle primary/secondary seasonal averages; all weights are globally fixed at inference. +- Corpus: all 95 mounted allow-listed directories, deterministic source-capped sample totaling 958,745,103 points / 3.835 GB and 357,789 series. Shortest retained series: 16 points. At most eight shuffled shards per source, up to approximately 24M points/source. Series exceeding 131,072 points are cropped at a random position. Packing took under two minutes on six workers. +- Mixture: directory weight proportional to capped points^0.25, climate multiplier 0.35, low-frequency competition-source multiplier 3. Synthetic proportion 20%. Exact logic is in provenance/data.py. +- Synthetic generator: newly generated damped trends, Fourier seasonality, AR noise, intermittent demand and changepoints. No downloaded synthetic assets. +- Training seed: 17. AdamW 3e-4, batch 128, 400-step warmup, cosine decay, bf16, one H100. Run planned for 12,000 steps with snapshots every 1,000 steps. +- Control: randomly initialized model with zero output projection (fixed seasonal mixture and fixed initial interval widths) saved at step 0 to distinguish learning from the forecasting prior. +- Completed 12,000 steps in 349.9 seconds on one H100. Measured group skills, checkpoint hashes and outcomes are recorded below. + +## Known limits and next decisions +- This first run jointly changes the architecture and objective; it does not isolate their individual causal contributions. +- The initial corpus pack samples shuffled shards but takes early Arrow record batches within each selected shard. Later runs should test a wider source sample if validation plateaus. +- 10-second daily seasonality exceeds the 4,096-point encoder window. Longer fixed context summaries are a planned ablation after initial diagnostics. + +## E1 control, step 0, screening +- Checkpoint SHA-256: `81be0f24c44a558e29dffcabb4ac15ae3c944e1afe2860851683d155f920ec2f`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 7.037512302398682 seconds. +- Overall skill 0.000921; relative MASE 1.194471; relative WQL 0.835649. +- term skill: long=0.0466, medium=0.0284, short=-0.0280. +- domain skill: Econ/Fin=-1.0735, Energy=-0.1019, Healthcare=-0.0966, Nature=0.2991, Sales=0.3167, Transport=0.2140, Web/CloudOps=-0.1294. +- frequency skill: A=-0.6469, D=0.1541, H=0.1205, M=-0.3393, Q=-0.5490, S=-2.2691, T=0.1079, W=-0.0412. +- variates skill: multivariate=0.0528, univariate=-0.0424. +- Outcome: Untrained seasonal-mixture prior barely exceeds Seasonal Naive overall and fails badly on 10-second and low-frequency configurations. + +## E1 step 1000, seed 17, screening +- Checkpoint SHA-256: `ebdd9eaa223c2bb6e38b8faec6f465a227fcd735b654a26f3b617a757addb0d3`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 6.581991195678711 seconds. +- Overall skill 0.210443; relative MASE 0.932765; relative WQL 0.668336. +- term skill: long=0.2339, medium=0.2517, short=0.1848. +- domain skill: Econ/Fin=-0.1600, Energy=0.0730, Healthcare=-0.0312, Nature=0.3679, Sales=0.2919, Transport=0.3892, Web/CloudOps=0.2547. +- frequency skill: A=0.3078, D=0.2651, H=0.3157, M=-0.3962, Q=0.0682, S=-0.6697, T=0.2839, W=0.0983. +- variates skill: multivariate=0.2140, univariate=0.2076. +- Outcome: Improves the control by 0.2095 screening skill after about 34 seconds on one H100. Selected for first neural publication and full validation. + +## E1 step 1000, full validation +- Checkpoint SHA-256: `see model_manifest.json`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.206132; relative MASE 0.931220; relative WQL 0.676774. +- term skill: long=0.2265, medium=0.2444, short=0.1829. +- domain skill: Econ/Fin=-0.1543, Energy=0.0590, Healthcare=-0.0112, Nature=0.3688, Sales=0.3043, Transport=0.3878, Web/CloudOps=0.2461. +- frequency skill: A=0.2746, D=0.2676, H=0.3116, M=-0.3493, Q=0.0397, S=-0.6697, T=0.2712, W=0.1025. +- variates skill: multivariate=0.2097, univariate=0.2033. +- Outcome: Full 151,170-instance validation skill 0.2061, with no failed configurations. Package inference took 29.5 seconds while training shared the sole GPU. First neural publication verified. + +## E1 step 2000, screening +- Checkpoint SHA-256: `a513ac4f03aceb93a860d5e5eca70010c0101fdea794df4a9a8ae472647fb9c9`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 5.98806357383728 seconds. +- Overall skill 0.249671; relative MASE 0.890745; relative WQL 0.632048. +- term skill: long=0.2727, medium=0.2872, short=0.2257. +- domain skill: Econ/Fin=-0.0533, Energy=0.1151, Healthcare=0.1665, Nature=0.4084, Sales=0.2984, Transport=0.3867, Web/CloudOps=0.2855. +- frequency skill: A=0.3280, D=0.2894, H=0.3291, M=-0.1483, Q=0.1703, S=-0.4627, T=0.3239, W=0.1185. +- variates skill: multivariate=0.2588, univariate=0.2423. +- Outcome: Improves screening skill to 0.2497 after 66.8 seconds of training; candidate for replacement. + +## E1 step 3000, screening +- Checkpoint SHA-256: `74da538d2365426496a12c965c0c0cdc1d3962a798bd2e2c5fed950c1f663f30`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 6.051600933074951 seconds. +- Overall skill 0.246085; relative MASE 0.894210; relative WQL 0.635631. +- term skill: long=0.2835, medium=0.2774, short=0.2187. +- domain skill: Econ/Fin=-0.1111, Energy=0.1198, Healthcare=-0.0532, Nature=0.3956, Sales=0.3188, Transport=0.4123, Web/CloudOps=0.3004. +- frequency skill: A=0.3478, D=0.2585, H=0.3298, M=-0.3174, Q=0.1517, S=-0.6889, T=0.3620, W=0.1126. +- variates skill: multivariate=0.2552, univariate=0.2388. +- Outcome: Slight regression to 0.2461 relative to step 2000. Negative checkpoint-selection result; not selected. + +## E2 fixed longer-history feature ablation, step 2000 seed 17 +- Checkpoint SHA-256: `25ac85db67c041c92870e2ea2e8b198bb768f5c5ed64f42b78d6ec207ffe3a18`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 6.066685438156128 seconds. +- Overall skill 0.249089; relative MASE 0.890661; relative WQL 0.633088. +- term skill: long=0.2741, medium=0.2855, short=0.2248. +- domain skill: Econ/Fin=-0.0532, Energy=0.1146, Healthcare=0.1651, Nature=0.4048, Sales=0.2986, Transport=0.3880, Web/CloudOps=0.2859. +- frequency skill: A=0.3273, D=0.2892, H=0.3291, M=-0.1495, Q=0.1705, S=-0.4627, T=0.3228, W=0.1166. +- variates skill: multivariate=0.2572, univariate=0.2426. +- Outcome: No training. Changed only history available to seasonal summaries from 4,096 to 16,384 points, with the encoder unchanged. Skill decreased 0.24967 to 0.24909. Rejected. Validation 10-second histories are shorter than one daily cycle, so additional history cannot supply that feature. + +## E1 step 4000, screening +- Checkpoint SHA-256: `f1b4e5f798688a56a693daf799fa21e69ec21c9c1710cae8dafbdb833c9ee069`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 5.961170196533203 seconds. +- Overall skill 0.266471; relative MASE 0.874789; relative WQL 0.615080. +- term skill: long=0.2537, medium=0.2846, short=0.2643. +- domain skill: Econ/Fin=-0.0360, Energy=0.1306, Healthcare=0.1810, Nature=0.3894, Sales=0.3301, Transport=0.4253, Web/CloudOps=0.3121. +- frequency skill: A=0.3647, D=0.2978, H=0.3375, M=-0.0981, Q=0.1458, S=-0.2890, T=0.3375, W=0.1196. +- variates skill: multivariate=0.2648, univariate=0.2678. +- Outcome: Best ungated checkpoint so far; improved short-horizon performance, with some long-horizon regression. + +## E1 step 6000, screening +- Checkpoint SHA-256: `f38cdb1b49938007c20bdfdfa7c4fc7d7aba6516192f388f37088891411eab7f`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 6.802650451660156 seconds. +- Overall skill 0.258313; relative MASE 0.878300; relative WQL 0.626324. +- term skill: long=0.2951, medium=0.3035, short=0.2254. +- domain skill: Econ/Fin=-0.0599, Energy=0.1417, Healthcare=0.2750, Nature=0.3683, Sales=0.3181, Transport=0.4116, Web/CloudOps=0.2761. +- frequency skill: A=0.3490, D=0.2962, H=0.3475, M=-0.0679, Q=0.1442, S=-0.6390, T=0.3416, W=0.0785. +- variates skill: multivariate=0.2482, univariate=0.2662. +- Outcome: Overall regression relative to step 4000 despite improvement on medium and long horizons. Not selected by overall skill. + +## E3 seasonal confidence gate, step 4000 seed 17 +- Checkpoint SHA-256: `f1b4e5f798688a56a693daf799fa21e69ec21c9c1710cae8dafbdb833c9ee069`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 9.475942373275757 seconds. +- Overall skill 0.301779; relative MASE 0.827721; relative WQL 0.588981. +- term skill: long=0.3338, medium=0.3656, short=0.2627. +- domain skill: Econ/Fin=-0.0087, Energy=0.1326, Healthcare=0.1954, Nature=0.3891, Sales=0.3285, Transport=0.4242, Web/CloudOps=0.4509. +- frequency skill: A=0.3647, D=0.2945, H=0.3455, M=-0.0632, Q=0.1395, S=0.3700, T=0.3389, W=0.1159. +- variates skill: multivariate=0.3379, univariate=0.2716. +- Outcome: No additional training. Fixed gate: weight=clip(1 - mean squared seasonal difference / (0.25 * context variance), 0, 0.98). Blend neural quantiles with a last-four-cycle seasonal mean and Gaussian intervals based on seasonal differences. Each instance uses only its own context; no optimized or adapted parameters. Skill increases 0.26647 to 0.30178; selected for full validation. + +## E3 step 4000 gate, full validation +- Checkpoint SHA-256: `see model_manifest.json`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.296168; relative MASE 0.830141; relative WQL 0.596742. +- term skill: long=0.3262, medium=0.3621, short=0.2569. +- domain skill: Econ/Fin=-0.0444, Energy=0.1210, Healthcare=0.2106, Nature=0.3890, Sales=0.3389, Transport=0.4244, Web/CloudOps=0.4426. +- frequency skill: A=0.2806, D=0.2946, H=0.3404, M=-0.0364, Q=0.1048, S=0.3700, T=0.3291, W=0.1093. +- variates skill: multivariate=0.3332, univariate=0.2652. +- Outcome: Selected and published. Full validation skill 0.296168 versus 0.206132 for the initial neural package; no failures. Full inference took 39.8 seconds while sharing one GPU with training. This is validation skill, not a held-out reward claim. + +## E1 step 8000, seed 17, ungated screening +- Checkpoint SHA-256: `ebbae91cb50acf1b1436fcbcdce1637195dd6e5006580d3d8e94a4e102aed0ad`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 5.500704050064087 seconds. +- Overall skill 0.276275; relative MASE 0.864160; relative WQL 0.606113. +- term skill: long=0.2954, medium=0.3094, short=0.2557. +- domain skill: Econ/Fin=-0.0085, Energy=0.1522, Healthcare=0.1826, Nature=0.3866, Sales=0.3192, Transport=0.4212, Web/CloudOps=0.3315. +- frequency skill: A=0.3679, D=0.3262, H=0.3533, M=-0.2016, Q=0.1316, S=-0.4192, T=0.3605, W=0.1103. +- variates skill: multivariate=0.2735, univariate=0.2785. +- Outcome: Included in final checkpoint selection; compare to weight-averaged result below. + +## E1 step 8000, seed 17, gated screening +- Checkpoint SHA-256: `ebbae91cb50acf1b1436fcbcdce1637195dd6e5006580d3d8e94a4e102aed0ad`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 6.228765964508057 seconds. +- Overall skill 0.312772; relative MASE 0.813977; relative WQL 0.580216. +- term skill: long=0.3671, medium=0.3752, short=0.2645. +- domain skill: Econ/Fin=-0.0003, Energy=0.1512, Healthcare=0.1999, Nature=0.3863, Sales=0.3176, Transport=0.4184, Web/CloudOps=0.4791. +- frequency skill: A=0.3679, D=0.3227, H=0.3559, M=-0.1576, Q=0.1357, S=0.3651, T=0.3604, W=0.1062. +- variates skill: multivariate=0.3530, univariate=0.2790. +- Outcome: Included in final checkpoint selection; compare to weight-averaged result below. + +## E1 step 10000, seed 17, ungated screening +- Checkpoint SHA-256: `3845afb6035396030b9a5182037287db092814d68caa4c96a7c415eb1d3b3a0a`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 6.094600439071655 seconds. +- Overall skill 0.285838; relative MASE 0.855761; relative WQL 0.595993. +- term skill: long=0.2974, medium=0.3249, short=0.2658. +- domain skill: Econ/Fin=0.0083, Energy=0.1537, Healthcare=0.1904, Nature=0.3858, Sales=0.3164, Transport=0.4217, Web/CloudOps=0.3674. +- frequency skill: A=0.3494, D=0.3058, H=0.3594, M=-0.1439, Q=0.1128, S=-0.2516, T=0.3685, W=0.1234. +- variates skill: multivariate=0.2917, univariate=0.2812. +- Outcome: Included in final checkpoint selection; compare to weight-averaged result below. + +## E1 step 10000, seed 17, gated screening +- Checkpoint SHA-256: `3845afb6035396030b9a5182037287db092814d68caa4c96a7c415eb1d3b3a0a`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 7.704133749008179 seconds. +- Overall skill 0.317743; relative MASE 0.805746; relative WQL 0.577695. +- term skill: long=0.3656, medium=0.3815, short=0.2718. +- domain skill: Econ/Fin=0.0087, Energy=0.1540, Healthcare=0.2110, Nature=0.3855, Sales=0.3148, Transport=0.4194, Web/CloudOps=0.4916. +- frequency skill: A=0.3494, D=0.3033, H=0.3612, M=-0.1027, Q=0.1231, S=0.3756, T=0.3699, W=0.1199. +- variates skill: multivariate=0.3600, univariate=0.2821. +- Outcome: Included in final checkpoint selection; compare to weight-averaged result below. + +## E1 step 12000, seed 17, ungated screening +- Checkpoint SHA-256: `629130a69f89561219b286c1e805d89b8b4662fce0e4b75e731e8764d9066e98`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 5.807793855667114 seconds. +- Overall skill 0.284471; relative MASE 0.856118; relative WQL 0.598027. +- term skill: long=0.2877, medium=0.3155, short=0.2710. +- domain skill: Econ/Fin=0.0294, Energy=0.1544, Healthcare=0.2252, Nature=0.3903, Sales=0.3151, Transport=0.4273, Web/CloudOps=0.3413. +- frequency skill: A=0.3430, D=0.3172, H=0.3585, M=-0.1807, Q=0.1231, S=-0.2708, T=0.3565, W=0.1685. +- variates skill: multivariate=0.2854, univariate=0.2837. +- Outcome: Included in final checkpoint selection; compare to weight-averaged result below. + +## E1 step 12000, seed 17, gated screening +- Checkpoint SHA-256: `629130a69f89561219b286c1e805d89b8b4662fce0e4b75e731e8764d9066e98`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 7.750269889831543 seconds. +- Overall skill 0.315453; relative MASE 0.812477; relative WQL 0.576760. +- term skill: long=0.3585, medium=0.3794, short=0.2715. +- domain skill: Econ/Fin=0.0081, Energy=0.1534, Healthcare=0.2414, Nature=0.3899, Sales=0.3136, Transport=0.4251, Web/CloudOps=0.4722. +- frequency skill: A=0.3430, D=0.3141, H=0.3577, M=-0.1400, Q=0.1249, S=0.3722, T=0.3572, W=0.1641. +- variates skill: multivariate=0.3552, univariate=0.2820. +- Outcome: Included in final checkpoint selection; compare to weight-averaged result below. + +## E4 stochastic weight average, seed 17, gated screening +- Checkpoint SHA-256: `a346a09ba0b8d196b58acc22a76f7944109b2bba04ea2b7cf7566de24aa2d8db`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 7.737564325332642 seconds. +- Overall skill 0.320612; relative MASE 0.803931; relative WQL 0.574139. +- term skill: long=0.3654, medium=0.3823, short=0.2769. +- domain skill: Econ/Fin=0.0210, Energy=0.1663, Healthcare=0.2341, Nature=0.3839, Sales=0.3192, Transport=0.4246, Web/CloudOps=0.4812. +- frequency skill: A=0.3645, D=0.3114, H=0.3584, M=-0.0937, Q=0.1411, S=0.3729, T=0.3725, W=0.1398. +- variates skill: multivariate=0.3557, univariate=0.2913. +- Outcome: Arithmetic weight average of steps 8000, 9000, 10000, 11000 and 12000. Total underlying training 349.9 seconds on one H100 for 12,000 steps / 1,536,000 windows. Averaging uses no validation labels or training updates. Screening skill 0.320612 exceeds the best individual checkpoint 0.317743; selected for full validation. + +## E3 confidence and quantile-width sweep +- Fixed global settings, selected only on validation; no model updates. Seed and checkpoint: E1 step 8000, seed 17. +- Measured CPU time: 10.7 seconds. The original threshold 0.25 and width multiplier 1.0 won; no tuned change was adopted. +- (variance threshold, width multiplier) (0.25, 1.0): skill 0.312772; term skills {'short': 0.2645319168347662, 'medium': 0.37524061562171485, 'long': 0.36711552655262625}. +- (variance threshold, width multiplier) (0.5, 1.0): skill 0.311338; term skills {'short': 0.26128183571880415, 'medium': 0.3766834137570718, 'long': 0.36686872500364487}. +- (variance threshold, width multiplier) (0.25, 0.75): skill 0.310114; term skills {'short': 0.26357949467631236, 'medium': 0.3710044838302994, 'long': 0.36223509497654094}. +- (variance threshold, width multiplier) (0.1, 1.0): skill 0.309380; term skills {'short': 0.2645827018541862, 'medium': 0.3687788042390393, 'long': 0.3590704635989247}. +- (variance threshold, width multiplier) (0.25, 1.25): skill 0.308716; term skills {'short': 0.25806263726485956, 'medium': 0.3732424245969126, 'long': 0.3664492202082874}. +- (variance threshold, width multiplier) (0.5, 0.75): skill 0.308480; term skills {'short': 0.2599791649373039, 'medium': 0.3724274186615034, 'long': 0.36196930941343286}. +- (variance threshold, width multiplier) (0.5, 1.25): skill 0.307830; term skills {'short': 0.25575126666422066, 'medium': 0.3747816871597687, 'long': 0.3663051398261168}. +- (variance threshold, width multiplier) (0.1, 0.75): skill 0.306923; term skills {'short': 0.26386190560263856, 'medium': 0.3650190620286501, 'long': 0.35398875275507513}. +- (variance threshold, width multiplier) (0.1, 1.25): skill 0.305043; term skills {'short': 0.2579337472130613, 'medium': 0.36611831669487493, 'long': 0.3583403545682865}. +- (variance threshold, width multiplier) (1.0, 1.0): skill 0.300332; term skills {'short': 0.24300377373135085, 'medium': 0.37515035650362993, 'long': 0.3625716315021771}. +- (variance threshold, width multiplier) (1.0, 0.75): skill 0.297470; term skills {'short': 0.24163138399697548, 'medium': 0.37101264403024414, 'long': 0.3577626408389879}. +- (variance threshold, width multiplier) (1.0, 1.25): skill 0.296900; term skills {'short': 0.23759298244372884, 'medium': 0.3732464838258517, 'long': 0.3619922948184182}. +- (variance threshold, width multiplier) (0.0, 1.0): skill 0.276275; term skills {'short': 0.25565045294773825, 'medium': 0.30935443355536374, 'long': 0.29541709470756516}. +- (variance threshold, width multiplier) (0.0, 0.75): skill 0.274035; term skills {'short': 0.2552205537396286, 'medium': 0.30589300644316675, 'long': 0.289930620063797}. +- (variance threshold, width multiplier) (0.0, 1.25): skill 0.271354; term skills {'short': 0.2486798921582145, 'medium': 0.30569315727356094, 'long': 0.29429049771287774}. + +## E5 capacity and exponential averaging +- Hypothesis: increased capacity reduces residual errors after direct-horizon training; exponential weight averaging reduces checkpoint noise. +- Changed factors: width 512, six encoder and four decoder layers, 37,002,816 parameters; 24,000-step schedule at 2e-4; seed 23. Same source sample, mixture, synthetic generator, batch 128 and horizon distribution as E1. Training-only EMA decay min(0.999, 1-1/(step+1)). +- Completed on the sole H100; raw and EMA snapshots were evaluated across all 97 configurations. No causal claim isolates size from seed/schedule changes. + +## E4 averaged small model, full validation +- Checkpoint SHA-256: `see model_manifest.json`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.315325; relative MASE 0.806359; relative WQL 0.581354. +- term skill: long=0.3584, medium=0.3790, short=0.2715. +- domain skill: Econ/Fin=-0.0034, Energy=0.1557, Healthcare=0.2457, Nature=0.3833, Sales=0.3308, Transport=0.4241, Web/CloudOps=0.4729. +- frequency skill: A=0.2978, D=0.3142, H=0.3526, M=-0.0698, Q=0.1192, S=0.3729, T=0.3632, W=0.1318. +- variates skill: multivariate=0.3509, univariate=0.2856. +- Outcome: Full validation skill 0.315325, relative MASE 0.806359 and relative WQL 0.581354, all 97 configurations valid. Inference took 37.2 seconds while sharing one H100 with training. Selected over the step-4000 gated package. + +## E6 sign symmetry, averaged small model, seed 17 +- Checkpoint SHA-256: `a346a09ba0b8d196b58acc22a76f7944109b2bba04ea2b7cf7566de24aa2d8db`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 7.13059401512146 seconds. +- Overall skill 0.328463; relative MASE 0.794174; relative WQL 0.567837. +- term skill: long=0.3740, medium=0.3863, short=0.2861. +- domain skill: Econ/Fin=0.0049, Energy=0.1627, Healthcare=0.2543, Nature=0.3978, Sales=0.3314, Transport=0.4439, Web/CloudOps=0.4889. +- frequency skill: A=0.2986, D=0.3191, H=0.3677, M=-0.0077, Q=0.1661, S=0.3711, T=0.3792, W=0.1244. +- variates skill: multivariate=0.3628, univariate=0.2998. +- Outcome: No additional training. Average the forecasts from x and negated x with quantile order reversed, then apply positivity and the same fixed seasonal gate. Screening skill rises 0.320612 to 0.328463. Hypothesis: sign symmetry reduces finite-sample neural bias. Selected for full validation. + +## E6 sign symmetry, averaged small model, full validation +- Checkpoint SHA-256: `see model_manifest.json`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.323978; relative MASE 0.795773; relative WQL 0.574292. +- term skill: long=0.3666, medium=0.3832, short=0.2823. +- domain skill: Econ/Fin=-0.0072, Energy=0.1517, Healthcare=0.2646, Nature=0.3974, Sales=0.3433, Transport=0.4439, Web/CloudOps=0.4816. +- frequency skill: A=0.2459, D=0.3222, H=0.3623, M=0.0177, Q=0.1587, S=0.3711, T=0.3705, W=0.1158. +- variates skill: multivariate=0.3586, univariate=0.2951. +- Outcome: Full validation skill 0.323978 versus 0.315325 without sign symmetry. Relative MASE 0.795773, relative WQL 0.574292, zero failed configurations, 42.3 seconds of inference. Selected for atomic publication. + +## E7 coarse temporal resolution at inference, small averaged model +- Checkpoint SHA-256: `a346a09ba0b8d196b58acc22a76f7944109b2bba04ea2b7cf7566de24aa2d8db`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 8.896855354309082 seconds. +- Overall skill 0.320862; relative MASE 0.803289; relative WQL 0.574174. +- term skill: long=0.3616, medium=0.3660, short=0.2861. +- domain skill: Econ/Fin=0.0049, Energy=0.1601, Healthcare=0.2543, Nature=0.4043, Sales=0.3314, Transport=0.4281, Web/CloudOps=0.4698. +- frequency skill: A=0.2986, D=0.3191, H=0.3444, M=-0.0077, Q=0.1661, S=0.3686, T=0.3804, W=0.1244. +- variates skill: multivariate=0.3567, univariate=0.2909. +- Outcome: Negative result: for horizons >=400, average the sign-symmetric prediction with a four-step-aggregated prediction from the same weights, then apply the unchanged seasonal gate. Screening skill falls from 0.328463 to 0.320862, so this is rejected. No training or fitted context parameters. + +## E8 median and predictable-series loss weighting +- Hypothesis: optimizing median error explicitly and weighting by context seasonal error aligns pretraining with MASE and quantile loss. +- Initial weights: E4 averaged small model, trained here from random initialization; no external pretrained assets. +- Changed factor: loss = mean over valid steps of 0.5 times mean pinball loss plus 0.25 times absolute median error, weighted per instance by clip(1/(0.25 + normalized context seasonal absolute difference), 0.25, 4). Weights are normalized across the batch. Training-only calculation; inference model unchanged. +- Seed 31, batch 256, 6,000 steps, AdamW 1e-4 with 400-step warmup and cosine decay, same source sample and synthetic generator. EMA as E5. +- Compute: 272.9 seconds elapsed on the sole H100, shared concurrently with E5. Underlying initial pretraining used 349.9 seconds. + +## E8 step 1000, seed 31, symmetric screening +- Checkpoint SHA-256: `e7cb5c4b4f04ba1ca873bc725f5e4345874520a96cbd3f079e4f631fd3c46d50`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 7.978966474533081 seconds. +- Overall skill 0.331642; relative MASE 0.791898; relative WQL 0.564091. +- term skill: long=0.3735, medium=0.3891, short=0.2910. +- domain skill: Econ/Fin=-0.0197, Energy=0.1668, Healthcare=0.2894, Nature=0.4040, Sales=0.3301, Transport=0.4439, Web/CloudOps=0.4906. +- frequency skill: A=0.2646, D=0.3158, H=0.3714, M=0.0669, Q=0.1387, S=0.3726, T=0.3764, W=0.1424. +- variates skill: multivariate=0.3652, univariate=0.3036. +- Outcome: EMA at 6000 is best overall and selected for full validation; raw checkpoints show greater variance. + +## E8 ema 1000, seed 31, symmetric screening +- Checkpoint SHA-256: `dab309aff5a3a28936391b84b3ebd9d5dfc208e53c1e1602e4f5c599e3004c33`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 8.16230034828186 seconds. +- Overall skill 0.332263; relative MASE 0.790121; relative WQL 0.564310. +- term skill: long=0.3745, medium=0.3873, short=0.2925. +- domain skill: Econ/Fin=0.0051, Energy=0.1638, Healthcare=0.2952, Nature=0.4011, Sales=0.3311, Transport=0.4450, Web/CloudOps=0.4919. +- frequency skill: A=0.3239, D=0.3220, H=0.3698, M=0.0488, Q=0.1636, S=0.3751, T=0.3783, W=0.1317. +- variates skill: multivariate=0.3653, univariate=0.3047. +- Outcome: EMA at 6000 is best overall and selected for full validation; raw checkpoints show greater variance. + +## E8 step 2000, seed 31, symmetric screening +- Checkpoint SHA-256: `111cf52c0662c60aebb44355135a65675a09d898995deeb4dd2f8f2b66339a0f`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 9.85259199142456 seconds. +- Overall skill 0.326318; relative MASE 0.796087; relative WQL 0.570097. +- term skill: long=0.3658, medium=0.3826, short=0.2873. +- domain skill: Econ/Fin=-0.0159, Energy=0.1477, Healthcare=0.3155, Nature=0.4038, Sales=0.3247, Transport=0.4419, Web/CloudOps=0.4862. +- frequency skill: A=0.2949, D=0.3163, H=0.3678, M=0.0654, Q=0.1519, S=0.3722, T=0.3655, W=0.1286. +- variates skill: multivariate=0.3573, univariate=0.3006. +- Outcome: EMA at 6000 is best overall and selected for full validation; raw checkpoints show greater variance. + +## E8 ema 2000, seed 31, symmetric screening +- Checkpoint SHA-256: `5fa525d923b4af5949f2415cf0ad0b325dae7623f07aae06b3131bdbda08c209`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 14.634822130203247 seconds. +- Overall skill 0.332843; relative MASE 0.789360; relative WQL 0.563874. +- term skill: long=0.3745, medium=0.3875, short=0.2936. +- domain skill: Econ/Fin=0.0007, Energy=0.1627, Healthcare=0.3135, Nature=0.4026, Sales=0.3309, Transport=0.4452, Web/CloudOps=0.4913. +- frequency skill: A=0.3152, D=0.3249, H=0.3696, M=0.0640, Q=0.1700, S=0.3757, T=0.3784, W=0.1261. +- variates skill: multivariate=0.3645, univariate=0.3065. +- Outcome: EMA at 6000 is best overall and selected for full validation; raw checkpoints show greater variance. + +## E8 step 4000, seed 31, symmetric screening +- Checkpoint SHA-256: `8ce9867a6005c28005b32d163254c088279f2a46febeadc433b403aeffc29066`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 20.403828620910645 seconds. +- Overall skill 0.333292; relative MASE 0.789778; relative WQL 0.562816. +- term skill: long=0.3723, medium=0.3857, short=0.2961. +- domain skill: Econ/Fin=-0.0157, Energy=0.1603, Healthcare=0.3279, Nature=0.4080, Sales=0.3286, Transport=0.4450, Web/CloudOps=0.4921. +- frequency skill: A=0.2821, D=0.3254, H=0.3697, M=0.0826, Q=0.1490, S=0.3718, T=0.3810, W=0.1182. +- variates skill: multivariate=0.3645, univariate=0.3073. +- Outcome: EMA at 6000 is best overall and selected for full validation; raw checkpoints show greater variance. + +## E8 ema 4000, seed 31, symmetric screening +- Checkpoint SHA-256: `e61535b34efac923328f1dd464f5ab8ab05913438f86125d8b933f1b166281d9`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 10.288180112838745 seconds. +- Overall skill 0.334221; relative MASE 0.787768; relative WQL 0.562681. +- term skill: long=0.3735, medium=0.3879, short=0.2964. +- domain skill: Econ/Fin=-0.0016, Energy=0.1638, Healthcare=0.3235, Nature=0.4037, Sales=0.3295, Transport=0.4477, Web/CloudOps=0.4916. +- frequency skill: A=0.3041, D=0.3326, H=0.3704, M=0.0629, Q=0.1674, S=0.3746, T=0.3813, W=0.1128. +- variates skill: multivariate=0.3653, univariate=0.3084. +- Outcome: EMA at 6000 is best overall and selected for full validation; raw checkpoints show greater variance. + +## E8 step 6000, seed 31, symmetric screening +- Checkpoint SHA-256: `15833e7668d9cd11ed55a4820b4700d71c6f734415d11490c7e8beb654abfa12`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 21.2668559551239 seconds. +- Overall skill 0.334430; relative MASE 0.788174; relative WQL 0.562038. +- term skill: long=0.3762, medium=0.3886, short=0.2953. +- domain skill: Econ/Fin=-0.0108, Energy=0.1611, Healthcare=0.3518, Nature=0.4037, Sales=0.3298, Transport=0.4457, Web/CloudOps=0.4924. +- frequency skill: A=0.2760, D=0.3360, H=0.3690, M=0.0736, Q=0.1605, S=0.3759, T=0.3813, W=0.1132. +- variates skill: multivariate=0.3660, univariate=0.3081. +- Outcome: EMA at 6000 is best overall and selected for full validation; raw checkpoints show greater variance. + +## E8 ema 6000, seed 31, symmetric screening +- Checkpoint SHA-256: `70a3768d667df75f0d6565e831cdca8cf7c179c8546252e5902f7b7ec68ab7aa`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 11.340764284133911 seconds. +- Overall skill 0.335038; relative MASE 0.787307; relative WQL 0.561630. +- term skill: long=0.3762, medium=0.3878, short=0.2968. +- domain skill: Econ/Fin=-0.0053, Energy=0.1637, Healthcare=0.3401, Nature=0.4031, Sales=0.3292, Transport=0.4464, Web/CloudOps=0.4934. +- frequency skill: A=0.2894, D=0.3329, H=0.3693, M=0.0767, Q=0.1622, S=0.3763, T=0.3828, W=0.1162. +- variates skill: multivariate=0.3659, univariate=0.3094. +- Outcome: EMA at 6000 is best overall and selected for full validation; raw checkpoints show greater variance. + +## E9 neural context 512 for horizons <=128, seed 17 +- Checkpoint SHA-256: `a346a09ba0b8d196b58acc22a76f7944109b2bba04ea2b7cf7566de24aa2d8db`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 10.416622161865234 seconds. +- Overall skill 0.320871; relative MASE 0.803968; relative WQL 0.573675. +- term skill: long=0.3740, medium=0.3863, short=0.2718. +- domain skill: Econ/Fin=0.0457, Energy=0.1466, Healthcare=0.2113, Nature=0.3887, Sales=0.3285, Transport=0.4330, Web/CloudOps=0.4911. +- frequency skill: A=0.2986, D=0.2904, H=0.3587, M=-0.0099, Q=0.1658, S=0.3756, T=0.3687, W=0.1716. +- variates skill: multivariate=0.3665, univariate=0.2822. +- Outcome: Only the neural input is shortened; the seasonal confidence gate retains 4096 points. 512 loses skill; 1024/2048 improve by less than 0.001 over the control. Not adopted pending a larger effect. + +## E9 neural context 1024 for horizons <=128, seed 17 +- Checkpoint SHA-256: `a346a09ba0b8d196b58acc22a76f7944109b2bba04ea2b7cf7566de24aa2d8db`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 19.072535276412964 seconds. +- Overall skill 0.329251; relative MASE 0.796444; relative WQL 0.564891. +- term skill: long=0.3740, medium=0.3863, short=0.2876. +- domain skill: Econ/Fin=0.0323, Energy=0.1629, Healthcare=0.1832, Nature=0.3978, Sales=0.3361, Transport=0.4415, Web/CloudOps=0.4998. +- frequency skill: A=0.2986, D=0.3031, H=0.3649, M=-0.0077, Q=0.1661, S=0.3761, T=0.3907, W=0.1240. +- variates skill: multivariate=0.3738, univariate=0.2915. +- Outcome: Only the neural input is shortened; the seasonal confidence gate retains 4096 points. 512 loses skill; 1024/2048 improve by less than 0.001 over the control. Not adopted pending a larger effect. + +## E9 neural context 2048 for horizons <=128, seed 17 +- Checkpoint SHA-256: `a346a09ba0b8d196b58acc22a76f7944109b2bba04ea2b7cf7566de24aa2d8db`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 9.426023244857788 seconds. +- Overall skill 0.329063; relative MASE 0.794285; relative WQL 0.566744. +- term skill: long=0.3740, medium=0.3863, short=0.2872. +- domain skill: Econ/Fin=0.0227, Energy=0.1628, Healthcare=0.2235, Nature=0.3975, Sales=0.3314, Transport=0.4448, Web/CloudOps=0.4931. +- frequency skill: A=0.2986, D=0.3154, H=0.3656, M=-0.0077, Q=0.1661, S=0.3738, T=0.3847, W=0.1224. +- variates skill: multivariate=0.3651, univariate=0.2989. +- Outcome: Only the neural input is shortened; the seasonal confidence gate retains 4096 points. 512 loses skill; 1024/2048 improve by less than 0.001 over the control. Not adopted pending a larger effect. + +## E10 fixed 50/50 ensemble diagnostic +- Checkpoint SHA-256: `see model_manifest.json`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 4.082070589065552 seconds. +- Overall skill 0.332712; relative MASE 0.791350; relative WQL 0.562676. +- term skill: long=0.3746, medium=0.3901, short=0.2921. +- domain skill: Econ/Fin=-0.0029, Energy=0.1641, Healthcare=0.3036, Nature=0.4055, Sales=0.3288, Transport=0.4500, Web/CloudOps=0.4870. +- frequency skill: A=0.2971, D=0.3243, H=0.3712, M=0.0353, Q=0.1843, S=0.3742, T=0.3778, W=0.1385. +- variates skill: multivariate=0.3658, univariate=0.3052. +- Outcome: Average of E8 EMA4000 and E5 EMA12000, both with sign symmetry and the same fixed seasonal gate. Skill 0.332712 is below E8 alone (0.334221). Rejected for now; both members would forecast every instance. + +## E8 EMA6000, full validation +- Checkpoint SHA-256: `see model_manifest.json`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.330109; relative MASE 0.789610; relative WQL 0.568323. +- term skill: long=0.3687, medium=0.3851, short=0.2920. +- domain skill: Econ/Fin=-0.0223, Energy=0.1525, Healthcare=0.3475, Nature=0.4024, Sales=0.3415, Transport=0.4461, Web/CloudOps=0.4860. +- frequency skill: A=0.2370, D=0.3358, H=0.3639, M=0.0960, Q=0.1447, S=0.3763, T=0.3738, W=0.1061. +- variates skill: multivariate=0.3616, univariate=0.3039. +- Outcome: Full validation skill 0.330109, relative MASE 0.789610, relative WQL 0.568323, zero failed configurations. Inference took 48.1 seconds while sharing the one H100. Improves the previous published 0.323978 and is selected for atomic publication. + +## E11 matched corpus-coverage experiment +- Hypothesis: broader source coverage improves generalization after the initial model has plateaued. +- Expanded sample: 95 directories, 1,032,415 series, 5,653,290,832 points (22.613 GB), versus 357,789 series and 958,745,103 points (3.835 GB). Per-source cap rises from 24M to 192M points, Arrow record batches are shuffled within each selected shard, and the per-series crop cap rises from 131,072 to 1,048,576. The same deterministic directory-hash seeds and at most eight sampled shards per directory are used. +- Two matched continuations start from E8 EMA6000: original sample control and expanded sample. Both use seed 41, batch 256, the E8 loss, 6,000 steps, AdamW 1e-4 and the same schedule/EMA. Training uses only corpus/synthetic data. +- Runs share the single H100 with E5; CPU threads are limited to three per new trainer. Completed matched runs: control 363.4 s, expanded 364.8 s; the expanded corpus did not improve either matched checkpoint. Detailed results are below. + +## E12 fixed continuity correction +- Hypothesis: a direct-horizon head can miss the immediate level of a smooth history, and a small decaying correction should reduce short-horizon error. No training or context fitting. E8 EMA6000 weights, seed 31. +- Fixed formula: ratio=mean(square(first differences))/variance over the last 512 points; w=clip(1-ratio/0.5,0,0.95); bias=w*(last value + median of the last eight differences - first forecast median). Add bias*exp(-step/tau) to each quantile, then retain the existing positivity rule. Skip sparse missing-value differences. +- Initial diagnostic needed a missing-value guard; invalid intermediate scores were discarded. A positivity-lookback mismatch in the probe was also corrected so tau=0 exactly reproduces the control. +- CPU sweep took 6.0 seconds; final verified control and all candidate scores follow. Tau 24 selected for package/full validation. +- tau=0: skill 0.335038, relative MASE 0.787307, relative WQL 0.561630, group skills {'term': {'short': 0.2967927346774093, 'medium': 0.38776799350809343, 'long': 0.37616349665047677}, 'domain': {'Econ/Fin': -0.005273788909573085, 'Energy': 0.16374587322817125, 'Healthcare': 0.34007707190705616, 'Nature': 0.4030815329292825, 'Sales': 0.32924485226314826, 'Transport': 0.4464324047455728, 'Web/CloudOps': 0.4934311796492926}, 'freq': {'A-DEC': 0.2893784388532201, 'Q-DEC': 0.16218093798601307, 'M': 0.07665328507242941, 'W-SUN': -0.31450314757766273, 'D': 0.332876404786148, 'H': 0.3693479345200832, '15T': 0.14228566862247327, 'W-FRI': 0.032405497411887585, '10T': 0.4887742379514316, 'W-TUE': 0.309664207244038, 'W-THU': 0.14794979612329628, 'W-WED': 0.29198895648742507, '5T': 0.5120305409377247, '10S': 0.3762720731817548}}. +- tau=2: skill 0.337508, relative MASE 0.783332, relative WQL 0.560293, group skills {'term': {'short': 0.30112159439110886, 'medium': 0.3882128168958763, 'long': 0.3763449044348186}, 'domain': {'Econ/Fin': 0.012010642573481944, 'Energy': 0.1687336419481582, 'Healthcare': 0.33847751009406857, 'Nature': 0.4038059435050727, 'Sales': 0.32920024652725177, 'Transport': 0.4463400575252827, 'Web/CloudOps': 0.4950030531002031}, 'freq': {'A-DEC': 0.2973561434987757, 'Q-DEC': 0.17698071591831765, 'M': 0.07233297868059718, 'W-SUN': -0.2582996069171355, 'D': 0.3346112879714367, 'H': 0.36855118351366944, '15T': 0.14569114456054433, 'W-FRI': 0.021432593572035197, '10T': 0.5064176027092252, 'W-TUE': 0.3132256284193611, 'W-THU': 0.1516542652623164, 'W-WED': 0.29198895648742507, '5T': 0.5121886153783087, '10S': 0.38181456512243606}}. +- tau=8: skill 0.339730, relative MASE 0.781190, relative WQL 0.558067, group skills {'term': {'short': 0.30468677533784194, 'medium': 0.3890128603479147, 'long': 0.3768542253336602}, 'domain': {'Econ/Fin': 0.04357586882889164, 'Energy': 0.17060177779549268, 'Healthcare': 0.3292576172809155, 'Nature': 0.4040895491577191, 'Sales': 0.32915095007230155, 'Transport': 0.4455718893158739, 'Web/CloudOps': 0.498582535356759}, 'freq': {'A-DEC': 0.30427943534005153, 'Q-DEC': 0.18739632573970566, 'M': 0.05811644843967234, 'W-SUN': -0.14993519310493708, 'D': 0.33691177813304396, 'H': 0.36800946318922256, '15T': 0.15562275067857723, 'W-FRI': 0.015293948848938421, '10T': 0.5022238811405833, 'W-TUE': 0.308852394109824, 'W-THU': 0.16531962754891327, 'W-WED': 0.29198895648742507, '5T': 0.5124270255950129, '10S': 0.3959332124123227}}. +- tau=24: skill 0.341604, relative MASE 0.780976, relative WQL 0.555056, group skills {'term': {'short': 0.30735425505077896, 'medium': 0.38984232067302926, 'long': 0.37791322023985785}, 'domain': {'Econ/Fin': 0.07789629542475163, 'Energy': 0.16814859423491146, 'Healthcare': 0.32219860777640197, 'Nature': 0.4027938268275436, 'Sales': 0.32911299366848257, 'Transport': 0.4440214473788372, 'Web/CloudOps': 0.505502554697025}, 'freq': {'A-DEC': 0.30701454754159097, 'Q-DEC': 0.18894276751813088, 'M': 0.04173508991923269, 'W-SUN': -0.06710914169849702, 'D': 0.33891978173454174, 'H': 0.36806701600948255, '15T': 0.16691265843751302, 'W-FRI': 0.011149977535114819, '10T': 0.48062823437029445, 'W-TUE': 0.3054618645258299, 'W-THU': 0.17135723270801106, 'W-WED': 0.29198895648742507, '5T': 0.5128629288387704, '10S': 0.42606586812368186}}. +- tau=64: skill 0.340824, relative MASE 0.783313, relative WQL 0.554713, group skills {'term': {'short': 0.3064164746371565, 'medium': 0.38779908004530583, 'long': 0.3787937309532532}, 'domain': {'Econ/Fin': 0.09969949435020342, 'Energy': 0.15974598777640392, 'Healthcare': 0.3189527251466179, 'Nature': 0.4009254556920715, 'Sales': 0.32909545704191134, 'Transport': 0.44166143132149305, 'Web/CloudOps': 0.5103628293774518}, 'freq': {'A-DEC': 0.3079352359976604, 'Q-DEC': 0.18879190434187287, 'M': 0.03049481695615497, 'W-SUN': -0.03231570437562303, 'D': 0.33992332397958547, 'H': 0.36593420410508737, '15T': 0.1654947222236236, 'W-FRI': 0.009213828856730832, '10T': 0.46016772262416383, 'W-TUE': 0.3040006089982843, 'W-THU': 0.17343046632698478, 'W-WED': 0.29198895648742507, '5T': 0.5128850832828526, '10S': 0.4486615108502494}}. +- tau=128: skill 0.338292, relative MASE 0.786639, relative WQL 0.556618, group skills {'term': {'short': 0.3043668884529205, 'medium': 0.38176748757743373, 'long': 0.37868472074438897}, 'domain': {'Econ/Fin': 0.10637792737302931, 'Energy': 0.1531270206619928, 'Healthcare': 0.31816668045459984, 'Nature': 0.39985518410953147, 'Sales': 0.3290895550941987, 'Transport': 0.4399018505526925, 'Web/CloudOps': 0.5082609219137205}, 'freq': {'A-DEC': 0.3082114553822066, 'Q-DEC': 0.1886335736447592, 'M': 0.026327746733658897, 'W-SUN': -0.021307580325764297, 'D': 0.34025742210101806, 'H': 0.3625439077766571, '15T': 0.1628300810039216, 'W-FRI': 0.00856370190545519, '10T': 0.4513327819863723, 'W-TUE': 0.30351149262807786, 'W-THU': 0.1740816133131421, 'W-WED': 0.29198895648742507, '5T': 0.512369368619311, '10S': 0.44352723463256316}}. + +## E12 continuity prior, full validation +- Checkpoint SHA-256: `see model_manifest.json`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.336914; relative MASE 0.783869; relative WQL 0.560914. +- term skill: long=0.3705, medium=0.3876, short=0.3028. +- domain skill: Econ/Fin=0.0580, Energy=0.1590, Healthcare=0.3286, Nature=0.4018, Sales=0.3415, Transport=0.4438, Web/CloudOps=0.4980. +- frequency skill: A=0.2499, D=0.3408, H=0.3619, M=0.0606, Q=0.1682, S=0.4261, T=0.3809, W=0.1368. +- variates skill: multivariate=0.3731, univariate=0.3066. +- Outcome: Full validation skill 0.336914 versus 0.330109 without the correction, relative MASE 0.783869 and relative WQL 0.560914; zero failures. Package inference took 69.8 seconds while three trainers shared the sole H100. Selected for atomic publication. + +## E11 corpus_control_ema1000 +- Checkpoint SHA-256: `f81bf26e2a17265332fdb3b29204d140703d7c3e9d9abdd7e3297715a7b1153a`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 10.393452167510986 seconds. +- Overall skill 0.335216; relative MASE 0.787169; relative WQL 0.561427. +- term skill: long=0.3757, medium=0.3878, short=0.2973. +- domain skill: Econ/Fin=-0.0001, Energy=0.1627, Healthcare=0.3427, Nature=0.4053, Sales=0.3297, Transport=0.4460, Web/CloudOps=0.4926. +- frequency skill: A=0.3085, D=0.3314, H=0.3702, M=0.0765, Q=0.1659, S=0.3764, T=0.3820, W=0.1191. +- variates skill: multivariate=0.3656, univariate=0.3100. +- Outcome: Matched comparison: original sample control stays near the parent model; expanded corpus is consistently slightly worse. Neither continuation is selected. Compute: control 363.4 s, expanded 364.8 s elapsed while sharing one H100. + +## E11 corpus_control_ema3000 +- Checkpoint SHA-256: `c72daec0504f6082965d689dd9a9f1a7005ac0d9694fb8d4de3d2622db9d615b`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 10.011096715927124 seconds. +- Overall skill 0.334832; relative MASE 0.787218; relative WQL 0.562040. +- term skill: long=0.3765, medium=0.3877, short=0.2963. +- domain skill: Econ/Fin=0.0014, Energy=0.1632, Healthcare=0.3213, Nature=0.4049, Sales=0.3317, Transport=0.4468, Web/CloudOps=0.4939. +- frequency skill: A=0.2922, D=0.3214, H=0.3695, M=0.0723, Q=0.1640, S=0.3781, T=0.3850, W=0.1283. +- variates skill: multivariate=0.3670, univariate=0.3081. +- Outcome: Matched comparison: original sample control stays near the parent model; expanded corpus is consistently slightly worse. Neither continuation is selected. Compute: control 363.4 s, expanded 364.8 s elapsed while sharing one H100. + +## E11 corpus_control_ema6000 +- Checkpoint SHA-256: `fa23c895ff4926b3d0df6d15267718a1dda41ad9386abbfef1306becb262da1c`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 7.355180501937866 seconds. +- Overall skill 0.334809; relative MASE 0.788444; relative WQL 0.561205. +- term skill: long=0.3770, medium=0.3879, short=0.2960. +- domain skill: Econ/Fin=-0.0139, Energy=0.1615, Healthcare=0.3361, Nature=0.4053, Sales=0.3305, Transport=0.4466, Web/CloudOps=0.4951. +- frequency skill: A=0.2945, D=0.3215, H=0.3707, M=0.0639, Q=0.1501, S=0.3778, T=0.3855, W=0.1254. +- variates skill: multivariate=0.3680, univariate=0.3071. +- Outcome: Matched comparison: original sample control stays near the parent model; expanded corpus is consistently slightly worse. Neither continuation is selected. Compute: control 363.4 s, expanded 364.8 s elapsed while sharing one H100. + +## E11 corpus_expanded_ema1000 +- Checkpoint SHA-256: `8c0f66d7a2377fa37b4d3358c89ae9b5786a6f5f0223b1480fb7a0b20b17ebc8`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 10.571230411529541 seconds. +- Overall skill 0.333782; relative MASE 0.789135; relative WQL 0.562448. +- term skill: long=0.3749, medium=0.3867, short=0.2955. +- domain skill: Econ/Fin=-0.0143, Energy=0.1614, Healthcare=0.3302, Nature=0.4029, Sales=0.3292, Transport=0.4472, Web/CloudOps=0.4938. +- frequency skill: A=0.2932, D=0.3308, H=0.3695, M=0.0696, Q=0.1628, S=0.3754, T=0.3818, W=0.1103. +- variates skill: multivariate=0.3653, univariate=0.3075. +- Outcome: Matched comparison: original sample control stays near the parent model; expanded corpus is consistently slightly worse. Neither continuation is selected. Compute: control 363.4 s, expanded 364.8 s elapsed while sharing one H100. + +## E11 corpus_expanded_ema3000 +- Checkpoint SHA-256: `51586b5ce1a426dc2f3adf42aba9599b731b62ab316159dafe681e77317015a2`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 10.598361253738403 seconds. +- Overall skill 0.333836; relative MASE 0.789352; relative WQL 0.562201. +- term skill: long=0.3750, medium=0.3869, short=0.2954. +- domain skill: Econ/Fin=-0.0087, Energy=0.1631, Healthcare=0.3250, Nature=0.4036, Sales=0.3303, Transport=0.4468, Web/CloudOps=0.4922. +- frequency skill: A=0.3132, D=0.3259, H=0.3690, M=0.0696, Q=0.1693, S=0.3752, T=0.3829, W=0.1162. +- variates skill: multivariate=0.3659, univariate=0.3071. +- Outcome: Matched comparison: original sample control stays near the parent model; expanded corpus is consistently slightly worse. Neither continuation is selected. Compute: control 363.4 s, expanded 364.8 s elapsed while sharing one H100. + +## E11 corpus_expanded_ema6000 +- Checkpoint SHA-256: `b82b9da6afa6b7ec864a5c4f9829a2a68b29f0923d0c556a998b9d79623d9ba9`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 7.799206972122192 seconds. +- Overall skill 0.333432; relative MASE 0.790380; relative WQL 0.562151. +- term skill: long=0.3759, medium=0.3881, short=0.2938. +- domain skill: Econ/Fin=-0.0272, Energy=0.1621, Healthcare=0.3299, Nature=0.4047, Sales=0.3298, Transport=0.4459, Web/CloudOps=0.4936. +- frequency skill: A=0.3024, D=0.3227, H=0.3691, M=0.0639, Q=0.1574, S=0.3794, T=0.3834, W=0.1166. +- variates skill: multivariate=0.3662, univariate=0.3061. +- Outcome: Matched comparison: original sample control stays near the parent model; expanded corpus is consistently slightly worse. Neither continuation is selected. Compute: control 363.4 s, expanded 364.8 s elapsed while sharing one H100. + +## E5 direct_large_ema12000_gate +- Checkpoint SHA-256: `202e23ba9d7560bf2bd67a609d024449facabdfd338c9268bc013ff6b613168f`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 11.02167820930481 seconds. +- Overall skill 0.314336; relative MASE 0.813757; relative WQL 0.577734. +- term skill: long=0.3670, medium=0.3868, short=0.2623. +- domain skill: Econ/Fin=-0.0160, Energy=0.1404, Healthcare=0.2477, Nature=0.3897, Sales=0.3170, Transport=0.4355, Web/CloudOps=0.4760. +- frequency skill: A=0.3627, D=0.3141, H=0.3649, M=-0.1520, Q=0.1593, S=0.3730, T=0.3518, W=0.1342. +- variates skill: multivariate=0.3564, univariate=0.2788. +- Outcome: 37M capacity run from random initialization; seed 23. Final run: 24,000 steps / 3,072,000 windows in 1073.9 s elapsed on the sole H100, shared with other experiments. Most checkpoints lag the small model; EMA reduces checkpoint variance. Final raw checkpoint is stronger than final EMA in gated inference, so it will receive a full inference-rule comparison. + +## E5 direct_large_ema16000_gate +- Checkpoint SHA-256: `8ba1220059af5a85180b3ad740402a48b2d38172598510da796339378e529a73`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 9.176010131835938 seconds. +- Overall skill 0.322612; relative MASE 0.806599; relative WQL 0.568877. +- term skill: long=0.3668, medium=0.3875, short=0.2777. +- domain skill: Econ/Fin=0.0042, Energy=0.1444, Healthcare=0.3056, Nature=0.3937, Sales=0.3266, Transport=0.4361, Web/CloudOps=0.4847. +- frequency skill: A=0.3573, D=0.3049, H=0.3646, M=-0.0462, Q=0.1603, S=0.3803, T=0.3607, W=0.1797. +- variates skill: multivariate=0.3644, univariate=0.2874. +- Outcome: 37M capacity run from random initialization; seed 23. Final run: 24,000 steps / 3,072,000 windows in 1073.9 s elapsed on the sole H100, shared with other experiments. Most checkpoints lag the small model; EMA reduces checkpoint variance. Final raw checkpoint is stronger than final EMA in gated inference, so it will receive a full inference-rule comparison. + +## E5 direct_large_ema20000_gate +- Checkpoint SHA-256: `1ec9d54fa1270442b0023da3f7fc23f5fa5291e58210a55f63878983afccc606`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 11.57221269607544 seconds. +- Overall skill 0.324943; relative MASE 0.805088; relative WQL 0.566028. +- term skill: long=0.3666, medium=0.3878, short=0.2821. +- domain skill: Econ/Fin=0.0218, Energy=0.1439, Healthcare=0.2912, Nature=0.4039, Sales=0.3250, Transport=0.4352, Web/CloudOps=0.4880. +- frequency skill: A=0.3533, D=0.3058, H=0.3660, M=-0.0485, Q=0.1544, S=0.3756, T=0.3665, W=0.1840. +- variates skill: multivariate=0.3678, univariate=0.2887. +- Outcome: 37M capacity run from random initialization; seed 23. Final run: 24,000 steps / 3,072,000 windows in 1073.9 s elapsed on the sole H100, shared with other experiments. Most checkpoints lag the small model; EMA reduces checkpoint variance. Final raw checkpoint is stronger than final EMA in gated inference, so it will receive a full inference-rule comparison. + +## E5 direct_large_ema2000_gate +- Checkpoint SHA-256: `bea7fbebdc754a6cef068a4b835e644d896305e928b4a63974c731874dc49028`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 7.918560028076172 seconds. +- Overall skill 0.279056; relative MASE 0.848285; relative WQL 0.612718. +- term skill: long=0.3485, medium=0.3540, short=0.2185. +- domain skill: Econ/Fin=-0.0871, Energy=0.1232, Healthcare=0.1986, Nature=0.3855, Sales=0.3094, Transport=0.3731, Web/CloudOps=0.4269. +- frequency skill: A=0.3054, D=0.2729, H=0.3360, M=-0.1424, Q=0.1034, S=0.3706, T=0.2968, W=0.1303. +- variates skill: multivariate=0.3283, univariate=0.2373. +- Outcome: 37M capacity run from random initialization; seed 23. Final run: 24,000 steps / 3,072,000 windows in 1073.9 s elapsed on the sole H100, shared with other experiments. Most checkpoints lag the small model; EMA reduces checkpoint variance. Final raw checkpoint is stronger than final EMA in gated inference, so it will receive a full inference-rule comparison. + +## E5 direct_large_ema24000_gate +- Checkpoint SHA-256: `e5bb7f70c0adbf61b4292cfc40a419e6757854a255ef0c47d3d47c7f2d68b7a2`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 8.641167879104614 seconds. +- Overall skill 0.323234; relative MASE 0.806197; relative WQL 0.568114. +- term skill: long=0.3665, medium=0.3864, short=0.2795. +- domain skill: Econ/Fin=0.0385, Energy=0.1492, Healthcare=0.2588, Nature=0.4037, Sales=0.3217, Transport=0.4347, Web/CloudOps=0.4807. +- frequency skill: A=0.3645, D=0.3062, H=0.3653, M=-0.0563, Q=0.1548, S=0.3766, T=0.3656, W=0.1664. +- variates skill: multivariate=0.3653, univariate=0.2877. +- Outcome: 37M capacity run from random initialization; seed 23. Final run: 24,000 steps / 3,072,000 windows in 1073.9 s elapsed on the sole H100, shared with other experiments. Most checkpoints lag the small model; EMA reduces checkpoint variance. Final raw checkpoint is stronger than final EMA in gated inference, so it will receive a full inference-rule comparison. + +## E5 direct_large_ema4000_gate +- Checkpoint SHA-256: `2f45a9ce8bed8e0e3ebe37ba98ac36ab8b9a630a615856760f46c0763fa78b5c`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 8.853939056396484 seconds. +- Overall skill 0.296679; relative MASE 0.830007; relative WQL 0.595971. +- term skill: long=0.3569, medium=0.3692, short=0.2413. +- domain skill: Econ/Fin=-0.0411, Energy=0.1331, Healthcare=0.1511, Nature=0.3889, Sales=0.3253, Transport=0.4031, Web/CloudOps=0.4590. +- frequency skill: A=0.3534, D=0.2760, H=0.3509, M=-0.1255, Q=0.1495, S=0.3734, T=0.3314, W=0.1185. +- variates skill: multivariate=0.3480, univariate=0.2530. +- Outcome: 37M capacity run from random initialization; seed 23. Final run: 24,000 steps / 3,072,000 windows in 1073.9 s elapsed on the sole H100, shared with other experiments. Most checkpoints lag the small model; EMA reduces checkpoint variance. Final raw checkpoint is stronger than final EMA in gated inference, so it will receive a full inference-rule comparison. + +## E5 direct_large_ema8000_gate +- Checkpoint SHA-256: `1b15662821b8c7a20d973f548dacabd237f470ffd1c75457c0b92011d3f0cc88`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 9.06697702407837 seconds. +- Overall skill 0.310188; relative MASE 0.816631; relative WQL 0.582688. +- term skill: long=0.3619, medium=0.3788, short=0.2604. +- domain skill: Econ/Fin=-0.0143, Energy=0.1404, Healthcare=0.2015, Nature=0.3934, Sales=0.3255, Transport=0.4210, Web/CloudOps=0.4744. +- frequency skill: A=0.3680, D=0.2929, H=0.3581, M=-0.0609, Q=0.1607, S=0.3679, T=0.3513, W=0.1178. +- variates skill: multivariate=0.3533, univariate=0.2739. +- Outcome: 37M capacity run from random initialization; seed 23. Final run: 24,000 steps / 3,072,000 windows in 1073.9 s elapsed on the sole H100, shared with other experiments. Most checkpoints lag the small model; EMA reduces checkpoint variance. Final raw checkpoint is stronger than final EMA in gated inference, so it will receive a full inference-rule comparison. + +## E5 direct_large_step12000_gate +- Checkpoint SHA-256: `8788d76e331dcd9cca1d6dab37db34b4c8b1257fc83da49b532c11643cd0ebfa`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 14.492464065551758 seconds. +- Overall skill 0.304901; relative MASE 0.821804; relative WQL 0.587930. +- term skill: long=0.3555, medium=0.3694, short=0.2575. +- domain skill: Econ/Fin=-0.0110, Energy=0.1063, Healthcare=0.2456, Nature=0.3830, Sales=0.2991, Transport=0.4416, Web/CloudOps=0.4763. +- frequency skill: A=0.3131, D=0.3025, H=0.3517, M=-0.0499, Q=0.1271, S=0.3821, T=0.3324, W=0.1350. +- variates skill: multivariate=0.3451, univariate=0.2712. +- Outcome: 37M capacity run from random initialization; seed 23. Final run: 24,000 steps / 3,072,000 windows in 1073.9 s elapsed on the sole H100, shared with other experiments. Most checkpoints lag the small model; EMA reduces checkpoint variance. Final raw checkpoint is stronger than final EMA in gated inference, so it will receive a full inference-rule comparison. + +## E5 direct_large_step16000_gate +- Checkpoint SHA-256: `beb43e784be8db8ee5ec14e83fa9c68f7ce897790441453eb6d72cceedb80650`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 9.434912919998169 seconds. +- Overall skill 0.311197; relative MASE 0.820659; relative WQL 0.578132. +- term skill: long=0.3577, medium=0.3731, short=0.2667. +- domain skill: Econ/Fin=-0.0270, Energy=0.1289, Healthcare=0.2653, Nature=0.3904, Sales=0.3264, Transport=0.4341, Web/CloudOps=0.4732. +- frequency skill: A=0.3445, D=0.2986, H=0.3593, M=-0.0768, Q=0.1596, S=0.3715, T=0.3463, W=0.1472. +- variates skill: multivariate=0.3513, univariate=0.2775. +- Outcome: 37M capacity run from random initialization; seed 23. Final run: 24,000 steps / 3,072,000 windows in 1073.9 s elapsed on the sole H100, shared with other experiments. Most checkpoints lag the small model; EMA reduces checkpoint variance. Final raw checkpoint is stronger than final EMA in gated inference, so it will receive a full inference-rule comparison. + +## E5 direct_large_step20000_gate +- Checkpoint SHA-256: `9332e5088244bd4a2a1ad5b6470a108ebaa6bc387a525202f6bf954d9796b1a6`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 11.937657117843628 seconds. +- Overall skill 0.319529; relative MASE 0.811224; relative WQL 0.570793. +- term skill: long=0.3661, medium=0.3842, short=0.2737. +- domain skill: Econ/Fin=0.0113, Energy=0.1395, Healthcare=0.3332, Nature=0.3983, Sales=0.3058, Transport=0.4236, Web/CloudOps=0.4804. +- frequency skill: A=0.3483, D=0.3114, H=0.3599, M=-0.0666, Q=0.1435, S=0.3671, T=0.3551, W=0.1967. +- variates skill: multivariate=0.3633, univariate=0.2825. +- Outcome: 37M capacity run from random initialization; seed 23. Final run: 24,000 steps / 3,072,000 windows in 1073.9 s elapsed on the sole H100, shared with other experiments. Most checkpoints lag the small model; EMA reduces checkpoint variance. Final raw checkpoint is stronger than final EMA in gated inference, so it will receive a full inference-rule comparison. + +## E5 direct_large_step2000_gate +- Checkpoint SHA-256: `f16c3270e2d4adafc8dbc1416687932a81b040bed29ad21887f7f8953437ba86`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 8.376563549041748 seconds. +- Overall skill 0.284757; relative MASE 0.840864; relative WQL 0.608389. +- term skill: long=0.3356, medium=0.3611, short=0.2319. +- domain skill: Econ/Fin=-0.0840, Energy=0.1152, Healthcare=0.2242, Nature=0.3840, Sales=0.3264, Transport=0.3898, Web/CloudOps=0.4386. +- frequency skill: A=0.2579, D=0.2746, H=0.3418, M=-0.0497, Q=0.1253, S=0.3787, T=0.2935, W=0.1458. +- variates skill: multivariate=0.3309, univariate=0.2458. +- Outcome: 37M capacity run from random initialization; seed 23. Final run: 24,000 steps / 3,072,000 windows in 1073.9 s elapsed on the sole H100, shared with other experiments. Most checkpoints lag the small model; EMA reduces checkpoint variance. Final raw checkpoint is stronger than final EMA in gated inference, so it will receive a full inference-rule comparison. + +## E5 direct_large_step24000_gate +- Checkpoint SHA-256: `b7e4f38aebcd2cf38ce484edaad8d19851317fb3b8df485e2faa0d0423cbcb48`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 7.831688165664673 seconds. +- Overall skill 0.326279; relative MASE 0.802486; relative WQL 0.565617. +- term skill: long=0.3671, medium=0.3874, short=0.2845. +- domain skill: Econ/Fin=0.0453, Energy=0.1487, Healthcare=0.3262, Nature=0.4087, Sales=0.3234, Transport=0.4251, Web/CloudOps=0.4821. +- frequency skill: A=0.3544, D=0.3106, H=0.3612, M=-0.0014, Q=0.1548, S=0.3765, T=0.3668, W=0.1910. +- variates skill: multivariate=0.3662, univariate=0.2927. +- Outcome: 37M capacity run from random initialization; seed 23. Final run: 24,000 steps / 3,072,000 windows in 1073.9 s elapsed on the sole H100, shared with other experiments. Most checkpoints lag the small model; EMA reduces checkpoint variance. Final raw checkpoint is stronger than final EMA in gated inference, so it will receive a full inference-rule comparison. + +## E5 direct_large_step4000_gate +- Checkpoint SHA-256: `a085c48b8bac06dba51118942d58b632dfc8fd934455232b2f1f7c7329f1ae76`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 8.682147979736328 seconds. +- Overall skill 0.291006; relative MASE 0.830831; relative WQL 0.605023. +- term skill: long=0.3451, medium=0.3504, short=0.2444. +- domain skill: Econ/Fin=-0.0403, Energy=0.0877, Healthcare=0.2367, Nature=0.3707, Sales=0.3185, Transport=0.4275, Web/CloudOps=0.4638. +- frequency skill: A=0.2862, D=0.2949, H=0.3327, M=-0.1134, Q=0.1567, S=0.3705, T=0.3243, W=0.1248. +- variates skill: multivariate=0.3352, univariate=0.2538. +- Outcome: 37M capacity run from random initialization; seed 23. Final run: 24,000 steps / 3,072,000 windows in 1073.9 s elapsed on the sole H100, shared with other experiments. Most checkpoints lag the small model; EMA reduces checkpoint variance. Final raw checkpoint is stronger than final EMA in gated inference, so it will receive a full inference-rule comparison. + +## E5 direct_large_step8000_gate +- Checkpoint SHA-256: `7c0ca8d6f3023ecefc12818560b9bac64e044102cb27d478978c48ce82276c38`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 8.785595417022705 seconds. +- Overall skill 0.307945; relative MASE 0.812528; relative WQL 0.589444. +- term skill: long=0.3650, medium=0.3688, short=0.2592. +- domain skill: Econ/Fin=-0.0843, Energy=0.1539, Healthcare=0.1762, Nature=0.3845, Sales=0.3220, Transport=0.4223, Web/CloudOps=0.4730. +- frequency skill: A=0.3235, D=0.2684, H=0.3578, M=-0.0688, Q=0.1156, S=0.3591, T=0.3615, W=0.1148. +- variates skill: multivariate=0.3471, univariate=0.2751. +- Outcome: 37M capacity run from random initialization; seed 23. Final run: 24,000 steps / 3,072,000 windows in 1073.9 s elapsed on the sole H100, shared with other experiments. Most checkpoints lag the small model; EMA reduces checkpoint variance. Final raw checkpoint is stronger than final EMA in gated inference, so it will receive a full inference-rule comparison. + +## E13/E14 matched large-model continuations +- Parent: raw E5 step 24000 (random-init pretraining here, seed 23), selected after final gated and sign-symmetric/continuity comparisons. +- Three runs share seed 43, batch 256, 6,000 steps, AdamW 8e-5 with 400-step warmup/cosine decay, the original packed sample, and the E8 median/seasonal-error-weighted objective. All use EMA. GPU: the one H100; three CPU threads per trainer. +- large_loss: unchanged synthetic generator, control for applying E8 loss to the larger model. +- large_synth: replace half of the 20% synthetic windows with newly generated integrated colored innovations, stochastic local-linear trends with level shifts, or sharp periodic pulses with slowly drifting amplitude. Generator is in large_synth/data.py; no external synthetic assets. +- large_sign: independently negate each sampled context and target with probability 0.5. Context seasonal scales are sign-invariant. Data RNG is shared with augmentation, so later draws diverge from the control despite the matched seed; this is a single-seed comparison. +- All inference rules remain fixed (sign symmetry, seasonal confidence gate and 24-step continuity). Results pending. + +## E15 final-checkpoint ensemble +- Hypothesis: the differently trained small and large models have complementary median and distribution errors. Fixed equal weights, both members forecast every instance. E8 EMA6000 (seed31 continuation of seed17) plus E5 raw24000 (seed23). Same fixed inference rules applied separately before averaging. +- Cached prediction diagnostic skill 0.344733 exceeds the small model 0.341604 and large model 0.343219. Actual bundled inference and full validation are required before publication. + +## E15 actual bundled ensemble screening +- Checkpoint SHA-256: `91cb9b3fc2422fc376ecab7813213a7156b6baee963da620f06e82f1aaeaea39`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 21.611496925354004 seconds. +- Overall skill 0.344715; relative MASE 0.780210; relative WQL 0.550363. +- term skill: long=0.3780, medium=0.3928, short=0.3118. +- domain skill: Econ/Fin=0.0849, Energy=0.1725, Healthcare=0.3305, Nature=0.4119, Sales=0.3307, Transport=0.4448, Web/CloudOps=0.5036. +- frequency skill: A=0.2873, D=0.3348, H=0.3699, M=0.0563, Q=0.1938, S=0.4258, T=0.3912, W=0.1713. +- variates skill: multivariate=0.3825, univariate=0.3130. +- Outcome: Actual package inference skill 0.344715, within 0.000019 of cached averaging; zero failures. The difference comes from numerical batching. Full package inference remains required. + +## E15 bundled ensemble, full validation +- Checkpoint SHA-256: `91cb9b3fc2422fc376ecab7813213a7156b6baee963da620f06e82f1aaeaea39`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.340239; relative MASE 0.782773; relative WQL 0.556081. +- term skill: long=0.3706, medium=0.3906, short=0.3076. +- domain skill: Econ/Fin=0.0668, Energy=0.1633, Healthcare=0.3369, Nature=0.4112, Sales=0.3436, Transport=0.4446, Web/CloudOps=0.4963. +- frequency skill: A=0.2315, D=0.3371, H=0.3638, M=0.0773, Q=0.1704, S=0.4258, T=0.3837, W=0.1660. +- variates skill: multivariate=0.3783, univariate=0.3083. +- Outcome: Full skill 0.340239, relative MASE 0.782773, relative WQL 0.556081, zero failed configurations. Improves the previous published 0.336914. Relocated package inference took 119.3 seconds while three 37M trainers shared the sole H100. Repeated example calls were bitwise identical, finite and monotone. Selected for atomic publication. + +## E16 earlier-window diagnostic +- Hypothesis: a second cutoff reveals whether gains on single-series configurations are stable over time. +- Constructed the immediately preceding nonoverlapping window from each selected validation context (never used for training). All 97 configurations remain; short histories with fewer than H+8 points are omitted. Seasonal-error scales use the available capped prefix and Seasonal Naive is recomputed on that same input, so these are diagnostic scores on a separate scale. +- The small E8 EMA6000 model improves from 0.308552 without continuity to 0.314127 with it. The large parent scores 0.312321; the first sign-augmented checkpoint scores 0.312240. Thus continuity is supported at both cutoffs, while the first sign-augmentation gain does not yet repeat on the earlier cutoff. No weights or rules are adapted on the diagnostic contexts. + +## Full-validation checkpoint identity audit +- valid-report-1000.json: `ebdd9eaa223c2bb6e38b8faec6f465a227fcd735b654a26f3b617a757addb0d3`, skill 0.206132. +- valid-report-4000-gate.json: `f1b4e5f798688a56a693daf799fa21e69ec21c9c1710cae8dafbdb833c9ee069`, skill 0.296168. +- valid-report-swa-gate.json: `a346a09ba0b8d196b58acc22a76f7944109b2bba04ea2b7cf7566de24aa2d8db`, skill 0.315325. +- valid-report-symmetric.json: `a346a09ba0b8d196b58acc22a76f7944109b2bba04ea2b7cf7566de24aa2d8db`, skill 0.323978. +- valid-report-objective.json: `70a3768d667df75f0d6565e831cdca8cf7c179c8546252e5902f7b7ec68ab7aa`, skill 0.330109. +- valid-report-continuity.json: `70a3768d667df75f0d6565e831cdca8cf7c179c8546252e5902f7b7ec68ab7aa`, skill 0.336914. +- valid-report-ensemble.json: `91cb9b3fc2422fc376ecab7813213a7156b6baee963da620f06e82f1aaeaea39`, skill 0.340239. + +## E13/E14 large_loss_ema1000_continuity +- Checkpoint SHA-256: `872c92ee27b0d63f310b7be7434ffe3d5342b19a42d48fefd0a468b87501b28e`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 14.880280256271362 seconds. +- Overall skill 0.342546; relative MASE 0.782779; relative WQL 0.552194. +- term skill: long=0.3792, medium=0.3907, short=0.3082. +- domain skill: Econ/Fin=0.0879, Energy=0.1741, Healthcare=0.2781, Nature=0.4155, Sales=0.3277, Transport=0.4454, Web/CloudOps=0.5007. +- frequency skill: A=0.2788, D=0.3141, H=0.3715, M=0.0511, Q=0.1869, S=0.4248, T=0.3925, W=0.1774. +- variates skill: multivariate=0.3827, univariate=0.3087. +- Outcome: Matched large-model continuation. Final EMA6000: sign augmentation wins (0.349298) over revised-loss control (0.346864) and richer synthetic generator (0.343184). Compute: control 618.3 s, synthetic 613.1 s, sign 617.9 s elapsed while sharing one H100. + +## E13/E14 large_loss_ema3000_continuity +- Checkpoint SHA-256: `18c2788192e4028dd45255512b1c4bcddf12a50eb813e34fa0987b8949d75f15`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 14.631194829940796 seconds. +- Overall skill 0.345993; relative MASE 0.778768; relative WQL 0.549233. +- term skill: long=0.3793, medium=0.3902, short=0.3147. +- domain skill: Econ/Fin=0.0850, Energy=0.1714, Healthcare=0.3423, Nature=0.4181, Sales=0.3281, Transport=0.4479, Web/CloudOps=0.5015. +- frequency skill: A=0.2956, D=0.3232, H=0.3727, M=0.0705, Q=0.1917, S=0.4274, T=0.3904, W=0.1972. +- variates skill: multivariate=0.3829, univariate=0.3150. +- Outcome: Matched large-model continuation. Final EMA6000: sign augmentation wins (0.349298) over revised-loss control (0.346864) and richer synthetic generator (0.343184). Compute: control 618.3 s, synthetic 613.1 s, sign 617.9 s elapsed while sharing one H100. + +## E13/E14 large_loss_ema6000_continuity +- Checkpoint SHA-256: `f5c7327b365832e8bd2d1b7b01e61c334f5bf620f5cae5f4d45feef2041090e8`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 9.797317266464233 seconds. +- Overall skill 0.346864; relative MASE 0.778052; relative WQL 0.548275. +- term skill: long=0.3803, medium=0.3907, short=0.3157. +- domain skill: Econ/Fin=0.0848, Energy=0.1765, Healthcare=0.3460, Nature=0.4171, Sales=0.3275, Transport=0.4491, Web/CloudOps=0.4990. +- frequency skill: A=0.2988, D=0.3201, H=0.3724, M=0.0715, Q=0.1909, S=0.4236, T=0.3942, W=0.2029. +- variates skill: multivariate=0.3831, univariate=0.3165. +- Outcome: Matched large-model continuation. Final EMA6000: sign augmentation wins (0.349298) over revised-loss control (0.346864) and richer synthetic generator (0.343184). Compute: control 618.3 s, synthetic 613.1 s, sign 617.9 s elapsed while sharing one H100. + +## E13/E14 large_sign_ema1000_continuity +- Checkpoint SHA-256: `393950048f9d0487869b7aa5e6bd01e7ea1715dba16b1367ee8be353eac7f408`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 14.772316932678223 seconds. +- Overall skill 0.347448; relative MASE 0.776694; relative WQL 0.548252. +- term skill: long=0.3829, medium=0.3908, short=0.3157. +- domain skill: Econ/Fin=0.0975, Energy=0.1743, Healthcare=0.3647, Nature=0.4116, Sales=0.3348, Transport=0.4489, Web/CloudOps=0.5001. +- frequency skill: A=0.3764, D=0.3250, H=0.3728, M=0.0605, Q=0.1918, S=0.4294, T=0.3920, W=0.1973. +- variates skill: multivariate=0.3811, univariate=0.3193. +- Outcome: Matched large-model continuation. Final EMA6000: sign augmentation wins (0.349298) over revised-loss control (0.346864) and richer synthetic generator (0.343184). Compute: control 618.3 s, synthetic 613.1 s, sign 617.9 s elapsed while sharing one H100. + +## E13/E14 large_sign_ema3000_continuity +- Checkpoint SHA-256: `24a38240b540c1311317103b880d4be47e17b7de883f535ef95977a3acc596dd`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 14.933598279953003 seconds. +- Overall skill 0.348060; relative MASE 0.775887; relative WQL 0.547794. +- term skill: long=0.3822, medium=0.3909, short=0.3171. +- domain skill: Econ/Fin=0.1095, Energy=0.1761, Healthcare=0.3575, Nature=0.4106, Sales=0.3331, Transport=0.4503, Web/CloudOps=0.5000. +- frequency skill: A=0.3842, D=0.3252, H=0.3741, M=0.0510, Q=0.1966, S=0.4324, T=0.3901, W=0.2089. +- variates skill: multivariate=0.3815, univariate=0.3201. +- Outcome: Matched large-model continuation. Final EMA6000: sign augmentation wins (0.349298) over revised-loss control (0.346864) and richer synthetic generator (0.343184). Compute: control 618.3 s, synthetic 613.1 s, sign 617.9 s elapsed while sharing one H100. + +## E13/E14 large_sign_ema6000_continuity +- Checkpoint SHA-256: `96c9d350412c076594f4cc026aaf7396eacc45478f3d402c5d60dcf85dce8547`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 9.297121286392212 seconds. +- Overall skill 0.349298; relative MASE 0.774499; relative WQL 0.546694. +- term skill: long=0.3853, medium=0.3928, short=0.3172. +- domain skill: Econ/Fin=0.1160, Energy=0.1799, Healthcare=0.3608, Nature=0.4057, Sales=0.3338, Transport=0.4511, Web/CloudOps=0.5017. +- frequency skill: A=0.3836, D=0.3247, H=0.3752, M=0.0334, Q=0.1968, S=0.4300, T=0.3937, W=0.2168. +- variates skill: multivariate=0.3827, univariate=0.3214. +- Outcome: Matched large-model continuation. Final EMA6000: sign augmentation wins (0.349298) over revised-loss control (0.346864) and richer synthetic generator (0.343184). Compute: control 618.3 s, synthetic 613.1 s, sign 617.9 s elapsed while sharing one H100. + +## E13/E14 large_synth_ema1000_continuity +- Checkpoint SHA-256: `c04fc8cad141754a2cb540b636cc3ac7744554cc85e201b4b291e777b2aee196`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 15.066582441329956 seconds. +- Overall skill 0.343871; relative MASE 0.781301; relative WQL 0.551010. +- term skill: long=0.3732, medium=0.3938, short=0.3118. +- domain skill: Econ/Fin=0.1001, Energy=0.1746, Healthcare=0.2638, Nature=0.4169, Sales=0.3281, Transport=0.4461, Web/CloudOps=0.5042. +- frequency skill: A=0.3050, D=0.3243, H=0.3716, M=-0.0066, Q=0.1903, S=0.4298, T=0.3943, W=0.1851. +- variates skill: multivariate=0.3847, univariate=0.3094. +- Outcome: Matched large-model continuation. Final EMA6000: sign augmentation wins (0.349298) over revised-loss control (0.346864) and richer synthetic generator (0.343184). Compute: control 618.3 s, synthetic 613.1 s, sign 617.9 s elapsed while sharing one H100. + +## E13/E14 large_synth_ema3000_continuity +- Checkpoint SHA-256: `aa73bdf3e3b2d44e69c716f2dc788789949b96d69f4cd92c2b0169bfd4dc89ce`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 14.854033946990967 seconds. +- Overall skill 0.343138; relative MASE 0.782085; relative WQL 0.551689. +- term skill: long=0.3690, medium=0.3946, short=0.3119. +- domain skill: Econ/Fin=0.1103, Energy=0.1771, Healthcare=0.2214, Nature=0.4199, Sales=0.3279, Transport=0.4472, Web/CloudOps=0.5016. +- frequency skill: A=0.2856, D=0.3228, H=0.3725, M=0.0162, Q=0.1940, S=0.4277, T=0.3929, W=0.1727. +- variates skill: multivariate=0.3849, univariate=0.3079. +- Outcome: Matched large-model continuation. Final EMA6000: sign augmentation wins (0.349298) over revised-loss control (0.346864) and richer synthetic generator (0.343184). Compute: control 618.3 s, synthetic 613.1 s, sign 617.9 s elapsed while sharing one H100. + +## E13/E14 large_synth_ema6000_continuity +- Checkpoint SHA-256: `f23469b8d187d0304e0accdc424ddd2233ed87dd77b97500176eec73644e0591`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 9.708917140960693 seconds. +- Overall skill 0.343184; relative MASE 0.781828; relative WQL 0.551793. +- term skill: long=0.3706, medium=0.3947, short=0.3112. +- domain skill: Econ/Fin=0.1127, Energy=0.1747, Healthcare=0.2160, Nature=0.4195, Sales=0.3267, Transport=0.4485, Web/CloudOps=0.5041. +- frequency skill: A=0.2764, D=0.3186, H=0.3736, M=0.0181, Q=0.1970, S=0.4302, T=0.3934, W=0.1723. +- variates skill: multivariate=0.3851, univariate=0.3077. +- Outcome: Matched large-model continuation. Final EMA6000: sign augmentation wins (0.349298) over revised-loss control (0.346864) and richer synthetic generator (0.343184). Compute: control 618.3 s, synthetic 613.1 s, sign 617.9 s elapsed while sharing one H100. + +## E16 earlier-window diagnostic large_loss6000 +- Checkpoint SHA-256: `f5c7327b365832e8bd2d1b7b01e61c334f5bf620f5cae5f4d45feef2041090e8`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 9.924073696136475 seconds. +- Overall skill 0.311219; relative MASE 0.824887; relative WQL 0.575132. +- term skill: long=0.3825, medium=0.3465, short=0.2673. +- domain skill: Econ/Fin=0.1171, Energy=0.2168, Healthcare=0.3670, Nature=0.3256, Sales=0.3803, Transport=0.3468, Web/CloudOps=0.4260. +- frequency skill: A=0.2543, D=0.3358, H=0.3410, M=0.1505, Q=0.2187, S=0.3402, T=0.3096, W=0.2343. +- variates skill: multivariate=0.3301, univariate=0.2958. +- Outcome: Model selection only. Seasonal Naive is recomputed on the earlier cutoff and capped-history scale. Final sign augmentation improves both main and earlier cutoffs; the richer synthetic generator does not beat its control. No diagnostic labels enter training. + +## E16 earlier-window diagnostic large_parent +- Checkpoint SHA-256: `b7e4f38aebcd2cf38ce484edaad8d19851317fb3b8df485e2faa0d0423cbcb48`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 15.111237525939941 seconds. +- Overall skill 0.312321; relative MASE 0.824141; relative WQL 0.573812. +- term skill: long=0.3880, medium=0.3443, short=0.2678. +- domain skill: Econ/Fin=0.1255, Energy=0.2150, Healthcare=0.3460, Nature=0.3326, Sales=0.3821, Transport=0.3403, Web/CloudOps=0.4349. +- frequency skill: A=0.2124, D=0.3388, H=0.3399, M=0.1428, Q=0.2091, S=0.3387, T=0.3160, W=0.2326. +- variates skill: multivariate=0.3359, univariate=0.2930. +- Outcome: Model selection only. Seasonal Naive is recomputed on the earlier cutoff and capped-history scale. Final sign augmentation improves both main and earlier cutoffs; the richer synthetic generator does not beat its control. No diagnostic labels enter training. + +## E16 earlier-window diagnostic large_sign1000 +- Checkpoint SHA-256: `393950048f9d0487869b7aa5e6bd01e7ea1715dba16b1367ee8be353eac7f408`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 14.428916931152344 seconds. +- Overall skill 0.312240; relative MASE 0.821151; relative WQL 0.576037. +- term skill: long=0.3855, medium=0.3437, short=0.2691. +- domain skill: Econ/Fin=0.1296, Energy=0.2106, Healthcare=0.3560, Nature=0.3340, Sales=0.3905, Transport=0.3466, Web/CloudOps=0.4302. +- frequency skill: A=0.3161, D=0.3390, H=0.3442, M=0.1574, Q=0.2111, S=0.3426, T=0.3054, W=0.2304. +- variates skill: multivariate=0.3287, univariate=0.2988. +- Outcome: Model selection only. Seasonal Naive is recomputed on the earlier cutoff and capped-history scale. Final sign augmentation improves both main and earlier cutoffs; the richer synthetic generator does not beat its control. No diagnostic labels enter training. + +## E16 earlier-window diagnostic large_sign6000 +- Checkpoint SHA-256: `96c9d350412c076594f4cc026aaf7396eacc45478f3d402c5d60dcf85dce8547`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 9.61752462387085 seconds. +- Overall skill 0.318367; relative MASE 0.813893; relative WQL 0.570866. +- term skill: long=0.3826, medium=0.3453, short=0.2811. +- domain skill: Econ/Fin=0.1456, Energy=0.2164, Healthcare=0.3902, Nature=0.3427, Sales=0.3912, Transport=0.3501, Web/CloudOps=0.4291. +- frequency skill: A=0.3181, D=0.3498, H=0.3477, M=0.1673, Q=0.2198, S=0.3427, T=0.3048, W=0.2686. +- variates skill: multivariate=0.3320, univariate=0.3073. +- Outcome: Model selection only. Seasonal Naive is recomputed on the earlier cutoff and capped-history scale. Final sign augmentation improves both main and earlier cutoffs; the richer synthetic generator does not beat its control. No diagnostic labels enter training. + +## E16 earlier-window diagnostic large_synth6000 +- Checkpoint SHA-256: `f23469b8d187d0304e0accdc424ddd2233ed87dd77b97500176eec73644e0591`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 9.829549789428711 seconds. +- Overall skill 0.311804; relative MASE 0.824530; relative WQL 0.574404. +- term skill: long=0.3704, medium=0.3520, short=0.2715. +- domain skill: Econ/Fin=0.1602, Energy=0.2091, Healthcare=0.3496, Nature=0.3283, Sales=0.3808, Transport=0.3477, Web/CloudOps=0.4301. +- frequency skill: A=0.2270, D=0.3331, H=0.3416, M=0.1436, Q=0.2168, S=0.3434, T=0.3110, W=0.2438. +- variates skill: multivariate=0.3289, univariate=0.2979. +- Outcome: Model selection only. Seasonal Naive is recomputed on the earlier cutoff and capped-history scale. Final sign augmentation improves both main and earlier cutoffs; the richer synthetic generator does not beat its control. No diagnostic labels enter training. + +## E16 earlier-window diagnostic small_continuity +- Checkpoint SHA-256: `70a3768d667df75f0d6565e831cdca8cf7c179c8546252e5902f7b7ec68ab7aa`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 12.578126668930054 seconds. +- Overall skill 0.314127; relative MASE 0.818301; relative WQL 0.574876. +- term skill: long=0.3797, medium=0.3430, short=0.2755. +- domain skill: Econ/Fin=0.1152, Energy=0.2137, Healthcare=0.3801, Nature=0.3283, Sales=0.3845, Transport=0.3460, Web/CloudOps=0.4366. +- frequency skill: A=0.2537, D=0.3362, H=0.3448, M=0.1858, Q=0.2208, S=0.3366, T=0.3083, W=0.2433. +- variates skill: multivariate=0.3331, univariate=0.2986. +- Outcome: Model selection only. Seasonal Naive is recomputed on the earlier cutoff and capped-history scale. Final sign augmentation improves both main and earlier cutoffs; the richer synthetic generator does not beat its control. No diagnostic labels enter training. + +## E16 earlier-window diagnostic small_no_continuity +- Checkpoint SHA-256: `70a3768d667df75f0d6565e831cdca8cf7c179c8546252e5902f7b7ec68ab7aa`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 11.378507137298584 seconds. +- Overall skill 0.308552; relative MASE 0.826361; relative WQL 0.578561. +- term skill: long=0.3803, medium=0.3416, short=0.2654. +- domain skill: Econ/Fin=0.0571, Energy=0.2115, Healthcare=0.3152, Nature=0.3257, Sales=0.3845, Transport=0.3471, Web/CloudOps=0.4427. +- frequency skill: A=0.2363, D=0.3288, H=0.3546, M=0.1261, Q=0.1813, S=0.3403, T=0.3019, W=0.2031. +- variates skill: multivariate=0.3334, univariate=0.2881. +- Outcome: Model selection only. Seasonal Naive is recomputed on the earlier cutoff and capped-history scale. Final sign augmentation improves both main and earlier cutoffs; the richer synthetic generator does not beat its control. No diagnostic labels enter training. + +## E14 final sign-augmented single model, full validation +- Checkpoint SHA-256: `96c9d350412c076594f4cc026aaf7396eacc45478f3d402c5d60dcf85dce8547`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.344508; relative MASE 0.777383; relative WQL 0.552713. +- term skill: long=0.3776, medium=0.3912, short=0.3123. +- domain skill: Econ/Fin=0.0926, Energy=0.1707, Healthcare=0.3648, Nature=0.4053, Sales=0.3446, Transport=0.4514, Web/CloudOps=0.4943. +- frequency skill: A=0.2937, D=0.3275, H=0.3694, M=0.0521, Q=0.1776, S=0.4300, T=0.3859, W=0.2124. +- variates skill: multivariate=0.3784, univariate=0.3162. +- Outcome: Full skill 0.344508, relative MASE 0.777383, relative WQL 0.552713, zero failures. Outperforms the published two-model ensemble (0.340239) and also improves the earlier-cutoff diagnostic. Full inference 57.2 s. Relocated repeated example calls are bitwise deterministic, finite and monotone. Selected for atomic publication. + +## E18 remove symmetric inference after sign-augmented training +- Checkpoint SHA-256: `96c9d350412c076594f4cc026aaf7396eacc45478f3d402c5d60dcf85dce8547`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 13.020774841308594 seconds. +- Overall skill 0.345482; relative MASE 0.778014; relative WQL 0.550625. +- term skill: long=0.3817, medium=0.3909, short=0.3125. +- domain skill: Econ/Fin=0.1197, Energy=0.1784, Healthcare=0.3304, Nature=0.4074, Sales=0.3304, Transport=0.4474, Web/CloudOps=0.4960. +- frequency skill: A=0.3782, D=0.3248, H=0.3710, M=0.0198, Q=0.1916, S=0.4321, T=0.3889, W=0.2113. +- variates skill: multivariate=0.3767, univariate=0.3195. +- Outcome: Negative result: removing the x/-x average lowers screening skill from 0.349298 to 0.345482 despite sign-augmented training. We retain symmetric inference; the speed saving is not needed for the contract budget. + +## E17 16-point projection conversion before continuation +- Checkpoint SHA-256: `d69531bfde5bf801e7f36c515bf15fd0cae0bd84f7d1479d35f4a7b67f26b508`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 17.147535800933838 seconds. +- Overall skill 0.341987; relative MASE 0.782323; relative WQL 0.553456. +- term skill: long=0.3765, medium=0.3855, short=0.3105. +- domain skill: Econ/Fin=0.0851, Energy=0.1664, Healthcare=0.3542, Nature=0.4067, Sales=0.3482, Transport=0.4386, Web/CloudOps=0.4996. +- frequency skill: A=0.2894, D=0.3469, H=0.3634, M=-0.0442, Q=0.1930, S=0.4414, T=0.3853, W=0.1987. +- variates skill: multivariate=0.3808, univariate=0.3093. +- Outcome: Conversion of our own E14 EMA6000 checkpoint loses screening skill from 0.349298 to 0.341987 before updates. Input/query projection halves are folded by summation, constant-feature activation preserved, first 16 output rows retained, and physical sine positions remain in 32-point units. No external weights. Continuation is needed. + +## E17 matched patch-resolution continuation +- Hypothesis: finer patches improve short-horizon detail and align common seasonal periods more closely without shortening context. +- Control: 32-point patches, 37,002,816 parameters; treatment: 16-point patches, 36,764,960 parameters, initialized by conversion of the same owned parent E14 EMA6000. Only patch projections and positional spacing change. Physical position units remain 32 points; metadata horizon is floored at 32 to preserve short-horizon conditioning. +- Both use the same window stream: seed47, batch256, 6000steps, AdamW8e-5, same sign-augmented sampler and median/seasonal-error-weighted loss/EMA. Context remains4096, maximum output1024. One H100 shared between runs. +- Conversion code: patch16/convert.py. The converted checkpoint retains its parent hash and conversion description. Training and runtime require the model in patch16/model.py, copied to patch16_inference/model.py. Results pending final matched checkpoints. + +## E17 patch16_trial_ema1000 +- Checkpoint SHA-256: `396a7e827e8ddd068535f96f590e710f1931818c4e0b4cc589648bf68c830ba1`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 14.109450101852417 seconds. +- Overall skill 0.348957; relative MASE 0.771301; relative WQL 0.549536. +- term skill: long=0.3832, medium=0.3926, short=0.3175. +- domain skill: Econ/Fin=0.0969, Energy=0.1735, Healthcare=0.3953, Nature=0.4077, Sales=0.3495, Transport=0.4526, Web/CloudOps=0.4982. +- frequency skill: A=0.3699, D=0.3389, H=0.3688, M=0.0874, Q=0.1860, S=0.4381, T=0.3905, W=0.1934. +- variates skill: multivariate=0.3799, univariate=0.3232. +- Outcome: Matched seed47/window-stream comparison. Final patch16 skill 0.351398 exceeds patch32 0.350171, mainly through median error. Compute: control447.6s, patch16 563.2s, sharing one H100. Earlier-cutoff and full-package validation are pending before selection. + +## E17 patch16_trial_ema3000 +- Checkpoint SHA-256: `aad4bb2f079c957b1c2a064fc245e660bd9992bf0a01b57c9a48b0d33a44436e`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 13.450159549713135 seconds. +- Overall skill 0.348611; relative MASE 0.772343; relative WQL 0.549378. +- term skill: long=0.3843, medium=0.3974, short=0.3144. +- domain skill: Econ/Fin=0.1014, Energy=0.1753, Healthcare=0.3863, Nature=0.4037, Sales=0.3479, Transport=0.4516, Web/CloudOps=0.4997. +- frequency skill: A=0.3647, D=0.3298, H=0.3718, M=0.0756, Q=0.1866, S=0.4393, T=0.3930, W=0.1879. +- variates skill: multivariate=0.3823, univariate=0.3204. +- Outcome: Matched seed47/window-stream comparison. Final patch16 skill 0.351398 exceeds patch32 0.350171, mainly through median error. Compute: control447.6s, patch16 563.2s, sharing one H100. Earlier-cutoff and full-package validation are pending before selection. + +## E17 patch16_trial_ema6000 +- Checkpoint SHA-256: `0ff54447074e0271d2e331c7d3e6e9e0fdd73353e4d8cef0175ff627385f71c3`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 10.25124716758728 seconds. +- Overall skill 0.351398; relative MASE 0.770359; relative WQL 0.546090. +- term skill: long=0.3847, medium=0.3993, short=0.3185. +- domain skill: Econ/Fin=0.1048, Energy=0.1768, Healthcare=0.3969, Nature=0.4061, Sales=0.3499, Transport=0.4528, Web/CloudOps=0.5033. +- frequency skill: A=0.3673, D=0.3318, H=0.3738, M=0.0802, Q=0.1913, S=0.4391, T=0.3969, W=0.1924. +- variates skill: multivariate=0.3843, univariate=0.3240. +- Outcome: Matched seed47/window-stream comparison. Final patch16 skill 0.351398 exceeds patch32 0.350171, mainly through median error. Compute: control447.6s, patch16 563.2s, sharing one H100. Earlier-cutoff and full-package validation are pending before selection. + +## E17 patch32_control_ema1000 +- Checkpoint SHA-256: `56edd93dd7e80399be57a359574b2fb89eba843fa1ddf01f1d3f3a2d9c2fd73b`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 12.499926567077637 seconds. +- Overall skill 0.347764; relative MASE 0.775926; relative WQL 0.548263. +- term skill: long=0.3840, medium=0.3930, short=0.3148. +- domain skill: Econ/Fin=0.1090, Energy=0.1783, Healthcare=0.3531, Nature=0.4057, Sales=0.3333, Transport=0.4508, Web/CloudOps=0.5005. +- frequency skill: A=0.3826, D=0.3190, H=0.3738, M=0.0404, Q=0.1937, S=0.4305, T=0.3927, W=0.2146. +- variates skill: multivariate=0.3815, univariate=0.3196. +- Outcome: Matched seed47/window-stream comparison. Final patch16 skill 0.351398 exceeds patch32 0.350171, mainly through median error. Compute: control447.6s, patch16 563.2s, sharing one H100. Earlier-cutoff and full-package validation are pending before selection. + +## E17 patch32_control_ema3000 +- Checkpoint SHA-256: `fe46ac478011854b20eeba3bbde42023f299e2d8544d223f046be0e234ae7c6e`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 15.177376747131348 seconds. +- Overall skill 0.349507; relative MASE 0.774280; relative WQL 0.546496. +- term skill: long=0.3853, medium=0.3964, short=0.3160. +- domain skill: Econ/Fin=0.1062, Energy=0.1803, Healthcare=0.3631, Nature=0.4048, Sales=0.3322, Transport=0.4510, Web/CloudOps=0.5041. +- frequency skill: A=0.3765, D=0.3187, H=0.3755, M=0.0515, Q=0.1928, S=0.4362, T=0.3953, W=0.2095. +- variates skill: multivariate=0.3848, univariate=0.3199. +- Outcome: Matched seed47/window-stream comparison. Final patch16 skill 0.351398 exceeds patch32 0.350171, mainly through median error. Compute: control447.6s, patch16 563.2s, sharing one H100. Earlier-cutoff and full-package validation are pending before selection. + +## E17 patch32_control_ema6000 +- Checkpoint SHA-256: `3ee55007ebabdc41a5bbb6553dcd0c4b86e90b717dd1cff758d2318f538c0929`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 9.685351848602295 seconds. +- Overall skill 0.350171; relative MASE 0.774332; relative WQL 0.545345. +- term skill: long=0.3851, medium=0.3971, short=0.3171. +- domain skill: Econ/Fin=0.1122, Energy=0.1816, Healthcare=0.3633, Nature=0.4023, Sales=0.3323, Transport=0.4516, Web/CloudOps=0.5054. +- frequency skill: A=0.3791, D=0.3172, H=0.3768, M=0.0518, Q=0.1910, S=0.4349, T=0.3964, W=0.2119. +- variates skill: multivariate=0.3854, univariate=0.3207. +- Outcome: Matched seed47/window-stream comparison. Final patch16 skill 0.351398 exceeds patch32 0.350171, mainly through median error. Compute: control447.6s, patch16 563.2s, sharing one H100. Earlier-cutoff and full-package validation are pending before selection. + +## E19 prefix-consistent direct decoder +- Hypothesis: requested total horizon should not change predictions of the same first steps. The context-only probe compared H48 versus H720 after all inference rules; mean absolute median-prefix differences were 0.0059–0.0582 context standard deviations across six sampled configurations (prefix_probe.json). +- Change: future-query self-attention becomes causal and the total-horizon metadata feature is replaced by its constant training-mixture mean. Forecasts remain direct and parallel; no generated output is fed back. Encoder/cross attention and all data/loss settings stay unchanged. +- Seed47, batch256, 6000steps, same original E14 EMA6000 parent and sampled-window stream as E17 patch32_control. Reuse that completed control instead of repeating it. Only the new decoder variant trains. Runtime/model: prefix_consistent/model.py, copied into prefix_inference. +- Results pending. + +## E17 patch16, full validation +- Checkpoint SHA-256: `0ff54447074e0271d2e331c7d3e6e9e0fdd73353e4d8cef0175ff627385f71c3`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.346729; relative MASE 0.773486; relative WQL 0.551739. +- term skill: long=0.3768, medium=0.3979, short=0.3138. +- domain skill: Econ/Fin=0.0839, Energy=0.1675, Healthcare=0.4022, Nature=0.4059, Sales=0.3593, Transport=0.4530, Web/CloudOps=0.4957. +- frequency skill: A=0.2818, D=0.3356, H=0.3684, M=0.0967, Q=0.1741, S=0.4391, T=0.3887, W=0.1870. +- variates skill: multivariate=0.3799, univariate=0.3190. +- Outcome: Full skill 0.346729, relative MASE 0.773486 and relative WQL 0.551739, zero failures; improves the previous published 0.344508. Inference 57.5 seconds. Earlier-window skill 0.322486 versus control 0.319021. Relocated repeated example outputs are bitwise identical, finite and monotone. Initial assembly failed on a symlinked lineage path, was never published, and was rebuilt after canonicalizing paths; the missing-output score from that failed pipeline is discarded. + +## E19 prefix_consistent_ema1000 +- Checkpoint SHA-256: `aa797f3356c30e1859821bd807202298774b8d44b59b8325cc73956796a83b21`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 10.920389413833618 seconds. +- Overall skill 0.347132; relative MASE 0.775797; relative WQL 0.549418. +- term skill: long=0.3820, medium=0.3928, short=0.3146. +- domain skill: Econ/Fin=0.1091, Energy=0.1769, Healthcare=0.3709, Nature=0.4082, Sales=0.3333, Transport=0.4492, Web/CloudOps=0.4954. +- frequency skill: A=0.3824, D=0.3200, H=0.3727, M=0.0361, Q=0.1918, S=0.4265, T=0.3902, W=0.2278. +- variates skill: multivariate=0.3798, univariate=0.3199. +- Outcome: Final skill 0.349313 is below the reused matched patch32 control (0.350171). This training recipe does not improve the score; not selected. Training elapsed 288.9 seconds on one H100. + +## E19 prefix_consistent_ema3000 +- Checkpoint SHA-256: `11094f18080cd31f38a7f33d1df852adc957d9f1705653360b21e790e55b6648`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 10.28545594215393 seconds. +- Overall skill 0.348148; relative MASE 0.775101; relative WQL 0.548201. +- term skill: long=0.3814, medium=0.3951, short=0.3158. +- domain skill: Econ/Fin=0.1060, Energy=0.1786, Healthcare=0.3758, Nature=0.4101, Sales=0.3323, Transport=0.4489, Web/CloudOps=0.4963. +- frequency skill: A=0.3799, D=0.3215, H=0.3735, M=0.0487, Q=0.1876, S=0.4294, T=0.3915, W=0.2202. +- variates skill: multivariate=0.3812, univariate=0.3206. +- Outcome: Final skill 0.349313 is below the reused matched patch32 control (0.350171). This training recipe does not improve the score; not selected. Training elapsed 288.9 seconds on one H100. + +## E19 prefix_consistent_ema6000 +- Checkpoint SHA-256: `2572d0401c85966c3936b3feed906dee4206ca403a778c2356406aca57988ef7`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 9.322679996490479 seconds. +- Overall skill 0.349313; relative MASE 0.774658; relative WQL 0.546555. +- term skill: long=0.3800, medium=0.3960, short=0.3181. +- domain skill: Econ/Fin=0.1130, Energy=0.1774, Healthcare=0.3765, Nature=0.4114, Sales=0.3328, Transport=0.4502, Web/CloudOps=0.4987. +- frequency skill: A=0.3795, D=0.3224, H=0.3737, M=0.0589, Q=0.1895, S=0.4294, T=0.3930, W=0.2214. +- variates skill: multivariate=0.3825, univariate=0.3216. +- Outcome: Final skill 0.349313 is below the reused matched patch32 control (0.350171). This training recipe does not improve the score; not selected. Training elapsed 288.9 seconds on one H100. + +## E20: learned cross-variable adapter on the frozen E17 backbone +Hypothesis: a jointly trained attention layer can exploit synchronized channels, especially on multivariate energy and weather series. Only a new 1.05M-parameter axial attention adapter is optimized; every backbone weight is frozen. Adapter output starts at zero, and univariate contexts bypass it exactly. Attention is confined to the channels of one instance. Context rows are grouped by whole instance in inference. +Training: seed 53, 6,000 steps, 32 groups per batch, 2/3/4/8 variates, learning rate 2e-4 with 200-step warmup, AdamW, same median/quantile seasonal-scaled objective as E17, EMA. Joint pack has 334,868,547 aligned observations from 26 allow-listed directories. Thirty percent locally generated multivariate series use mixtures of latent seasonal/AR drivers with random channel lags, optional integrated noise, and observation noise. Channel signs/scales and missing observations are augmented. No validation observations are used by training. The new adapter is zero-initialized so step 0 supplies an inference grouping control. + +## E21: longer context at inference, without retraining +Hypothesis: the encoder can benefit from histories longer than its 4,096-point training maximum. Hold E17 weights and all rules fixed and compare 8,192/16,384-point context caps with the current 4,096-point cap on all 97 screen configurations. This is a selection diagnostic, not adaptation; checkpoint tensor values are unchanged. + +## E22: function-preserving depth expansion +Hypothesis: more learned capacity can improve the persistent energy and economic errors. Expand E17 from 6 encoder/4 decoder layers to 12 encoder/8 decoder layers, 72,499,488 parameters. Keep original blocks at even positions and insert random blocks with zero attention and feedforward output projections at odd positions. The initial enlarged model produces bitwise identical quantiles in a synthetic bf16 forward check. Conversion seed 59; both the expanded model and a continued 36.8M control will use seed 59, identical sampled windows, sign augmentation, revised seasonal-scaled median/quantile loss, and 24,000 AdamW steps, batch 256, learning rate 8e-5. Data remains packed_sample from 95 allowed sources plus the original local generator. GPU jobs share the single H100 if overlapping; elapsed training-process seconds will be reported. + +## E21 untrained 8192 context cap +- Checkpoint SHA-256: `4cdcd096105c711926d1be912debeecf2999cc4e70389385ea60e516a211d035`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 11.263309001922607 seconds. +- Overall skill 0.350147; relative MASE 0.769937; relative WQL 0.548498. +- term skill: long=0.3906, medium=0.3940, short=0.3160. +- domain skill: Econ/Fin=0.1042, Energy=0.1740, Healthcare=0.4046, Nature=0.3925, Sales=0.3499, Transport=0.4581, Web/CloudOps=0.5047. +- frequency skill: A=0.3673, D=0.3338, H=0.3751, M=0.0802, Q=0.1913, S=0.4410, T=0.3905, W=0.1924. +- variates skill: multivariate=0.3814, univariate=0.3241. +- Outcome: Screen skill 0.350147 is below the 4096-point parent 0.351398. Not selected. + +## E21 untrained 16384 context cap +- Checkpoint SHA-256: `a7504466f8d21bf752f3d99c32927a57cd63d0af5d5f15618ef4e8e1bdbeeb47`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 14.697236776351929 seconds. +- Overall skill 0.347052; relative MASE 0.771167; relative WQL 0.552852. +- term skill: long=0.3936, medium=0.3900, short=0.3107. +- domain skill: Econ/Fin=0.1042, Energy=0.1694, Healthcare=0.4046, Nature=0.3838, Sales=0.3499, Transport=0.4577, Web/CloudOps=0.5032. +- frequency skill: A=0.3673, D=0.3345, H=0.3752, M=0.0802, Q=0.1913, S=0.4410, T=0.3807, W=0.1924. +- variates skill: multivariate=0.3779, univariate=0.3214. +- Outcome: Below the 4096-point parent; longer context needs training and is not selected. + +## E23: fixed local-level diffusion prior (negative result) +Hypothesis: smooth series might benefit from a decaying blend with their last value and random-walk intervals. Keep E17 forecasts fixed, estimate RMS consecutive differences from the last 512 context points, and blend Gaussian last-value forecasts with weight capped at 0.8, active only where squared-difference/context-variance ratio is below 0.05. Sweep decay 24/96/384 steps; no training, no fitting, no new random seed. All variants substantially regress on the 97-configuration screen, so none is adopted. Probe elapsed 5.3 CPU seconds. Parent checkpoint SHA-256: 0ff54447074e0271d2e331c7d3e6e9e0fdd73353e4d8cef0175ff627385f71c3. +- Decay 0: skill 0.3513976241007074; term skills {"short": 0.3185422008330211, "medium": 0.3993234467710519, "long": 0.38466658538687104}; domain skills {"Econ/Fin": 0.1047749678551001, "Energy": 0.17678999618615132, "Healthcare": 0.3968888878939394, "Nature": 0.4060764075001204, "Sales": 0.349917064856452, "Transport": 0.4527521728604965, "Web/CloudOps": 0.50332745421581}. +- Decay 24: skill 0.34165742688714285; term skills {"short": 0.30882663252618237, "medium": 0.38422047231265555, "long": 0.3803807240673608}; domain skills {"Econ/Fin": 0.09820862504146799, "Energy": 0.14638236482304767, "Healthcare": 0.3994101685341417, "Nature": 0.4097541459355638, "Sales": 0.34991701707454004, "Transport": 0.45281938688271317, "Web/CloudOps": 0.49437598362265067}. +- Decay 96: skill 0.3235906270632306; term skills {"short": 0.30736381494165377, "medium": 0.31870169010171356, "long": 0.3688721255257502}; domain skills {"Econ/Fin": 0.09505897302445243, "Energy": 0.1285464282539771, "Healthcare": 0.3977611664977332, "Nature": 0.41574057336372194, "Sales": 0.34991700862256025, "Transport": 0.45284743770041946, "Web/CloudOps": 0.43886394048274135}. +- Decay 384: skill 0.28712372958270105; term skills {"short": 0.30561653681994894, "medium": 0.2119589494208397, "long": 0.3091633781775974}; domain skills {"Econ/Fin": 0.09383616546291695, "Energy": 0.10801096739511007, "Healthcare": 0.3957240300486188, "Nature": 0.4179314810204363, "Sales": 0.3499170061816316, "Transport": 0.4526991548827556, "Web/CloudOps": 0.3016411139705769}. + +## E20 joint adapter full validation +- Checkpoint SHA-256: `88beaafe52bd88300ebd46afc3a0d950246c280c738ac52367203d6c776a3053`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.348181; relative MASE 0.773070; relative WQL 0.549586. +- term skill: long=0.3789, medium=0.3973, short=0.3159. +- domain skill: Econ/Fin=0.0839, Energy=0.1670, Healthcare=0.4022, Nature=0.4151, Sales=0.3593, Transport=0.4530, Web/CloudOps=0.4958. +- frequency skill: A=0.2818, D=0.3370, H=0.3714, M=0.0967, Q=0.1741, S=0.4354, T=0.3901, W=0.1878. +- variates skill: multivariate=0.3830, univariate=0.3190. +- Outcome: Full validation improves from 0.346729 to 0.348181 with no failures. Main screen improves from 0.351398 to 0.352838, but the earlier-window diagnostic regresses from 0.322486 to 0.321225. Selected on the task full validation metric, with this temporal limitation recorded. Training 157.8 process seconds on the single shared H100; full inference 63.7 seconds excluding startup. Frozen backbone equality, within-instance isolation, and repeated relocated example determinism verified. + +## E20 joint adapter screen +- Checkpoint SHA-256: `88beaafe52bd88300ebd46afc3a0d950246c280c738ac52367203d6c776a3053`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 15.721086978912354 seconds. +- Overall skill 0.352838; relative MASE 0.769945; relative WQL 0.543959. +- term skill: long=0.3868, medium=0.3987, short=0.3205. +- domain skill: Econ/Fin=0.1048, Energy=0.1763, Healthcare=0.3969, Nature=0.4152, Sales=0.3499, Transport=0.4528, Web/CloudOps=0.5034. +- frequency skill: A=0.3673, D=0.3332, H=0.3768, M=0.0802, Q=0.1913, S=0.4354, T=0.3982, W=0.1932. +- variates skill: multivariate=0.3874, univariate=0.3240. +- Outcome: The added adapter improves weather forecasts most; some ETT and cloud configurations regress. Original univariate forecasts are unchanged. + +## E20 joint adapter earlier-window diagnostic +- Checkpoint SHA-256: `88beaafe52bd88300ebd46afc3a0d950246c280c738ac52367203d6c776a3053`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 16.06979727745056 seconds. +- Overall skill 0.321225; relative MASE 0.812345; relative WQL 0.567168. +- term skill: long=0.3839, medium=0.3520, short=0.2830. +- domain skill: Econ/Fin=0.1423, Energy=0.2143, Healthcare=0.3841, Nature=0.3485, Sales=0.3968, Transport=0.3596, Web/CloudOps=0.4341. +- frequency skill: A=0.3026, D=0.3536, H=0.3503, M=0.1681, Q=0.2189, S=0.3405, T=0.3157, W=0.2466. +- variates skill: multivariate=0.3338, univariate=0.3110. +- Outcome: Temporal diagnostic regression; this limits confidence in the small primary-validation gain. + +## E24: seasonal-template recency +Hypothesis: averaging the last four cycles induces bias when level or amplitude changes. Compare fixed 4/2/1-cycle means, four-cycle mean shifted to the latest cycle mean, and exponentially weighted four-cycle mean. The rest of the E17 forecaster and all confidence thresholds are fixed. Validation only; no parameter fitting. Centering improves the main screen 0.351398 to 0.353163 but decreases the earlier-window diagnostic 0.322486 to 0.321979. Other variants show larger temporal disagreement. Detailed per-configuration and group results remain in research/seasonal_recency/{screen,backcast}.json. Probe runtime: 15.3 and 15.0 CPU seconds. No variant published yet. + +## E25: learned recency features +Hypothesis: adding level and amplitude change features to future queries lets the model learn when seasonal recency matters, instead of imposing a uniform template rule. Add a zero-initialized 32,768-parameter query projection receiving, for each of the two periods, latest-cycle minus four-cycle mean and the phase template times the latest/four-cycle standard deviation ratio minus one. Ratios are clipped to [0.5,2]; features require three observed cycles. Existing query and median heads stay structurally unchanged. Starting function is preserved; all weights are then trained. Same seed 59, parent E17, 24,000-step learning-rate schedule, batch 256 and identical sampler stream as E22's 36.8M control. Checkpoints every 3,000 steps; an unpromising trial can be stopped early. No validation data is used by training. + +## E26: second earlier-cutoff diagnostic +Create a second nonoverlapping diagnostic window by removing another forecast horizon from E16 inputs. All observations remain within supplied validation histories and are never passed to trainers. 94 configurations and 8,934 instances have usable normalizers; Seasonal Naive and seasonal-error normalizers are recomputed for these prefixes. This diagnostic has its own scale and cannot be compared directly to primary validation or held-out reward. Purpose: assess temporal stability of the adapter and recency changes after the first earlier diagnostic disagreed with primary validation. + +E26 eligibility correction: SZ_TAXI long has exactly one seasonal period (96 points) left, so its prefix seasonal error is undefined. It is excluded from this diagnostic, alongside two configurations with insufficient context. An initial reference attempt detected the undefined metric; no candidate was selected on that invalid draft. + +E26 paired comparison on the 94 common configurations: adapter minus parent mean log geometric error by cutoff = [-0.0023015101916589752, 0.0019472848873323858, 0.0034041402255075566]. Positive means worse; the three-cutoff mean is 0.0010166383070603225. The adapter improves primary full validation but regresses on both earlier cutoffs, so its apparent gain is not temporally robust. + +E24 complete recency-rule ablation; parent checkpoint SHA-256 0ff54447074e0271d2e331c7d3e6e9e0fdd73353e4d8cef0175ff627385f71c3. No training, no random seed; model weights unchanged. + +screen diagnostic, 15.3 CPU seconds total: +- (4, 'mean'): skill 0.3513976241007074; group skills {"term": {"short": 0.3185422008330211, "medium": 0.3993234467710519, "long": 0.38466658538687104}, "domain": {"Econ/Fin": 0.1047749678551001, "Energy": 0.17678999618615132, "Healthcare": 0.3968888878939394, "Nature": 0.4060764075001204, "Sales": 0.349917064856452, "Transport": 0.4527521728604965, "Web/CloudOps": 0.50332745421581}, "freq": {"A-DEC": 0.3672744916070976, "Q-DEC": 0.19127390925064935, "M": 0.08024694183722458, "W-SUN": 0.035758619864346475, "D": 0.3318015817783623, "H": 0.37383534533108864, "15T": 0.1940857197364374, "W-FRI": -0.03678057554518466, "10T": 0.4946120106982924, "W-TUE": 0.552193186183172, "W-THU": 0.16944597286444163, "W-WED": 0.3192454708946336, "5T": 0.5069054537063827, "10S": 0.43906058031696027}} +- (2, 'mean'): skill 0.3515869592249251; group skills {"term": {"short": 0.31946055343361235, "medium": 0.395564454113736, "long": 0.3871567716641673}, "domain": {"Econ/Fin": 0.12253197026836216, "Energy": 0.18298948886090993, "Healthcare": 0.39741811166060514, "Nature": 0.40643913101885387, "Sales": 0.34900834734187824, "Transport": 0.45646747263938636, "Web/CloudOps": 0.4921796292797348}, "freq": {"A-DEC": 0.3672744916070976, "Q-DEC": 0.19172301173815798, "M": 0.07891640026491331, "W-SUN": 0.04042355013060539, "D": 0.3321769544067552, "H": 0.38073675441614074, "15T": 0.20117188206554237, "W-FRI": -0.03695866316509533, "10T": 0.49452343668884957, "W-TUE": 0.552193186183172, "W-THU": 0.16944597286444163, "W-WED": 0.3192454708946336, "5T": 0.5070472862431538, "10S": 0.3973951356554515}} +- (1, 'mean'): skill 0.3435908999493934; group skills {"term": {"short": 0.3116909988543801, "medium": 0.38160533975903543, "long": 0.384670295110323}, "domain": {"Econ/Fin": 0.13426770743669836, "Energy": 0.18216526583305703, "Healthcare": 0.40167072012279914, "Nature": 0.4064404130881688, "Sales": 0.3492754711813856, "Transport": 0.4589127441324581, "Web/CloudOps": 0.45693278131755455}, "freq": {"A-DEC": 0.3672744916070976, "Q-DEC": 0.19143020771042418, "M": 0.08285832779020297, "W-SUN": 0.04327272071755062, "D": 0.33288417189993846, "H": 0.38267829909706397, "15T": 0.19937252608994493, "W-FRI": -0.037004579119138015, "10T": 0.4945270610078465, "W-TUE": 0.552193186183172, "W-THU": 0.16944597286444163, "W-WED": 0.3192454708946336, "5T": 0.5067187989779461, "10S": 0.25271387987938276}} +- (4, 'centered'): skill 0.3531633226160329; group skills {"term": {"short": 0.3207293873053654, "medium": 0.3969450585806461, "long": 0.38964518179731034}, "domain": {"Econ/Fin": 0.12636396756466373, "Energy": 0.1800705780909143, "Healthcare": 0.3992839589819721, "Nature": 0.40602447440489264, "Sales": 0.34961552641405835, "Transport": 0.45585497734478375, "Web/CloudOps": 0.5005422814848317}, "freq": {"A-DEC": 0.3672744916070976, "Q-DEC": 0.19175192579993316, "M": 0.07909511983098594, "W-SUN": 0.042408325150654624, "D": 0.33302767036606196, "H": 0.37896395394765425, "15T": 0.19862358212653608, "W-FRI": -0.03667482636982777, "10T": 0.49458872561779677, "W-TUE": 0.552193186183172, "W-THU": 0.16944597286444163, "W-WED": 0.3192454708946336, "5T": 0.5067600572208003, "10S": 0.43120160792893125}} +- (4, 'exponential'): skill 0.3506285650976836; group skills {"term": {"short": 0.31758444696147214, "medium": 0.39583120771209657, "long": 0.38712405721550214}, "domain": {"Econ/Fin": 0.11941316839573946, "Energy": 0.1820733009344513, "Healthcare": 0.39881728965443064, "Nature": 0.4063573767251085, "Sales": 0.3492900874450249, "Transport": 0.45600364485060096, "Web/CloudOps": 0.4900268042948257}, "freq": {"A-DEC": 0.3672744916070976, "Q-DEC": 0.19155754727480623, "M": 0.08126365276376935, "W-SUN": 0.0395554234837493, "D": 0.3321922474298862, "H": 0.3798686284876259, "15T": 0.19972610305133176, "W-FRI": -0.036894372612062964, "10T": 0.49455551047271673, "W-TUE": 0.552193186183172, "W-THU": 0.16944597286444163, "W-WED": 0.3192454708946336, "5T": 0.507021365412977, "10S": 0.38828731350299905}} + +backcast diagnostic, 15.0 CPU seconds total: +- (4, 'mean'): skill 0.3224855500998881; group skills {"term": {"short": 0.2849500928667269, "medium": 0.35106641415497664, "long": 0.3858074289185036}, "domain": {"Econ/Fin": 0.14231294402320693, "Energy": 0.22033739564654398, "Healthcare": 0.38413791496286065, "Nature": 0.34419561689971845, "Sales": 0.3968014140531252, "Transport": 0.35961999575754544, "Web/CloudOps": 0.43501924471773445}, "freq": {"A-DEC": 0.30258726538887626, "Q-DEC": 0.21891811984740894, "M": 0.16812726492063224, "W-SUN": -0.010729530876487425, "D": 0.35222355718445886, "H": 0.3519096502404674, "15T": 0.2228803711964017, "W-FRI": 0.24958026063282224, "10T": 0.28160966000223076, "W-TUE": 0.5071080326855618, "W-THU": 0.17681316314370377, "W-WED": 0.3400228795320346, "5T": 0.41752089397176684, "10S": 0.3420520567149261}} +- (2, 'mean'): skill 0.31641087380554034; group skills {"term": {"short": 0.2768742380592605, "medium": 0.34943272384716806, "long": 0.38006754913357355}, "domain": {"Econ/Fin": 0.1588024863579226, "Energy": 0.21997369353201524, "Healthcare": 0.371350308865825, "Nature": 0.34524192786763674, "Sales": 0.3968014140531252, "Transport": 0.3617399277122316, "Web/CloudOps": 0.4078808317401613}, "freq": {"A-DEC": 0.30258726538887626, "Q-DEC": 0.21832950345882607, "M": 0.1660037727174999, "W-SUN": -0.006617407115359519, "D": 0.3510532765644364, "H": 0.35322947177285846, "15T": 0.2251426669096147, "W-FRI": 0.2495544318494044, "10T": 0.28154255982923526, "W-TUE": 0.5071080326855618, "W-THU": 0.17681316314370377, "W-WED": 0.3400228795320346, "5T": 0.417584870977882, "10S": 0.23197125321775225}} +- (1, 'mean'): skill 0.31723500000228033; group skills {"term": {"short": 0.28111182113787236, "medium": 0.34369676593720844, "long": 0.3794207668157681}, "domain": {"Econ/Fin": 0.16484876593565279, "Energy": 0.2163334841815111, "Healthcare": 0.34937996041769215, "Nature": 0.3461425603980003, "Sales": 0.3968014140531252, "Transport": 0.36432827783243815, "Web/CloudOps": 0.4170717985814322}, "freq": {"A-DEC": 0.30258726538887626, "Q-DEC": 0.21811526606513132, "M": 0.17155750755784438, "W-SUN": -0.004083126467642861, "D": 0.34319459279654896, "H": 0.35193709208671076, "15T": 0.22385514627514524, "W-FRI": 0.249535867076202, "10T": 0.28142605167103807, "W-TUE": 0.5071080326855618, "W-THU": 0.17681316314370377, "W-WED": 0.3400228795320346, "5T": 0.41764726501313276, "10S": 0.27470089184112967}} +- (4, 'centered'): skill 0.3219793532222529; group skills {"term": {"short": 0.28513766744425706, "medium": 0.34881946541915476, "long": 0.3853894132385529}, "domain": {"Econ/Fin": 0.15718749322076342, "Energy": 0.220305778786681, "Healthcare": 0.3623301744180454, "Nature": 0.34528108993797224, "Sales": 0.3968014140531252, "Transport": 0.3641900819387449, "Web/CloudOps": 0.4312095523303556}, "freq": {"A-DEC": 0.30258726538887626, "Q-DEC": 0.21945119732749618, "M": 0.17114892410654747, "W-SUN": -0.005425657907346837, "D": 0.3478712397506638, "H": 0.3538545808265424, "15T": 0.22504062323947938, "W-FRI": 0.24955455634324242, "10T": 0.28170410454547445, "W-TUE": 0.5071080326855618, "W-THU": 0.17681316314370377, "W-WED": 0.3400228795320346, "5T": 0.4176757195719526, "10S": 0.32801909847059685}} +- (4, 'exponential'): skill 0.3212088988374776; group skills {"term": {"short": 0.282531844032045, "medium": 0.3501930275891618, "long": 0.386723067036399}, "domain": {"Econ/Fin": 0.15471014663681715, "Energy": 0.22088089450488246, "Healthcare": 0.3714910427574707, "Nature": 0.3450102784118355, "Sales": 0.3968014140531252, "Transport": 0.3619509561390626, "Web/CloudOps": 0.4275124121699033}, "freq": {"A-DEC": 0.30258726538887626, "Q-DEC": 0.21855293965122158, "M": 0.16975398671452624, "W-SUN": -0.007489648663621784, "D": 0.3494275697398366, "H": 0.3534238823299253, "15T": 0.22624199923728783, "W-FRI": 0.24956090397954467, "10T": 0.28154140034619046, "W-TUE": 0.5071080326855618, "W-THU": 0.17681316314370377, "W-WED": 0.3400228795320346, "5T": 0.4176567607348064, "10S": 0.31322950674661665}} + +backcast2 diagnostic, 11.3 CPU seconds total: +- (4, 'mean'): skill 0.3455098962011296; group skills {"term": {"short": 0.3290580626564209, "medium": 0.3700339540817553, "long": 0.36380280474970406}, "domain": {"Econ/Fin": 0.08514981056677962, "Energy": 0.22004402556428637, "Healthcare": 0.34077993948093876, "Nature": 0.45181894051147786, "Sales": 0.5552026876860963, "Transport": 0.4089471064366391, "Web/CloudOps": 0.4235634025112891}, "freq": {"A-DEC": 0.33512027886093443, "Q-DEC": 0.14846418792970395, "M": 0.1666731962215917, "W-SUN": 0.04822698344798482, "D": 0.4221052975732391, "H": 0.37954447462865715, "15T": 0.09066258444282005, "W-FRI": 0.10650868616967224, "10T": 0.4524242293365175, "W-TUE": 0.0831470254212826, "W-THU": 0.26812593887733527, "W-WED": 0.5394413576371667, "5T": 0.45460956828782484, "10S": 0.2830610169711695}} +- (2, 'mean'): skill 0.34268288377692957; group skills {"term": {"short": 0.3260103214844039, "medium": 0.3650713522346687, "long": 0.36394907927583375}, "domain": {"Econ/Fin": 0.10626345560515471, "Energy": 0.21855508043330296, "Healthcare": 0.33494058443346464, "Nature": 0.45181894051147786, "Sales": 0.5552026876860963, "Transport": 0.41262361590216645, "Web/CloudOps": 0.40733619806789245}, "freq": {"A-DEC": 0.33512027886093443, "Q-DEC": 0.14853117890045908, "M": 0.15637649692786237, "W-SUN": 0.05109649829750129, "D": 0.4226979938774772, "H": 0.3810140667041473, "15T": 0.10084524164002151, "W-FRI": 0.10650868616967224, "10T": 0.4522402959584214, "W-TUE": 0.0831470254212826, "W-THU": 0.26812593887733527, "W-WED": 0.5394413576371667, "5T": 0.45675628129488266, "10S": 0.20569731261667445}} +- (1, 'mean'): skill 0.3445039461555758; group skills {"term": {"short": 0.332077466515454, "medium": 0.3668808106296455, "long": 0.3542531601492346}, "domain": {"Econ/Fin": 0.10936035558443968, "Energy": 0.21764038800605967, "Healthcare": 0.3307656098951277, "Nature": 0.45181894051147786, "Sales": 0.5552026876860963, "Transport": 0.41137296882664487, "Web/CloudOps": 0.4178001938815905}, "freq": {"A-DEC": 0.33512027886093443, "Q-DEC": 0.14899214852623166, "M": 0.14771341656467907, "W-SUN": 0.05292218751297184, "D": 0.42303155789223856, "H": 0.3788342098211268, "15T": 0.10485120143271387, "W-FRI": 0.10650868616967224, "10T": 0.45177551404888616, "W-TUE": 0.0831470254212826, "W-THU": 0.26812593887733527, "W-WED": 0.5394413576371667, "5T": 0.4576208051300459, "10S": 0.24855961647506852}} +- (4, 'centered'): skill 0.34598093527842033; group skills {"term": {"short": 0.3300325159298324, "medium": 0.3728154676891604, "long": 0.3603198134443867}, "domain": {"Econ/Fin": 0.10766883532595528, "Energy": 0.21948028584715717, "Healthcare": 0.3411805258187349, "Nature": 0.45181894051147786, "Sales": 0.5552026876860963, "Transport": 0.41219265214646406, "Web/CloudOps": 0.4193348965687418}, "freq": {"A-DEC": 0.33512027886093443, "Q-DEC": 0.14770244416717793, "M": 0.16665926477245963, "W-SUN": 0.05081321100071179, "D": 0.4226895384052014, "H": 0.3801908053318377, "15T": 0.10067740700220107, "W-FRI": 0.10650868616967224, "10T": 0.45281662963561176, "W-TUE": 0.0831470254212826, "W-THU": 0.26812593887733527, "W-WED": 0.5394413576371667, "5T": 0.4517952090885672, "10S": 0.27767832330559383}} +- (4, 'exponential'): skill 0.3469706591030196; group skills {"term": {"short": 0.330791312305022, "medium": 0.3720978115862891, "long": 0.36385111952680094}, "domain": {"Econ/Fin": 0.1001234277395946, "Energy": 0.2202025077634595, "Healthcare": 0.336380045647639, "Nature": 0.45181894051147786, "Sales": 0.5552026876860963, "Transport": 0.41155494383831315, "Web/CloudOps": 0.4258605737282435}, "freq": {"A-DEC": 0.33512027886093443, "Q-DEC": 0.1486686416475177, "M": 0.15834250660686766, "W-SUN": 0.05058427650785369, "D": 0.42264469285933903, "H": 0.38114337578655855, "15T": 0.10061532381315941, "W-FRI": 0.10650868616967224, "10T": 0.4522176935148189, "W-TUE": 0.0831470254212826, "W-THU": 0.26812593887733527, "W-WED": 0.5394413576371667, "5T": 0.45594734272112136, "10S": 0.2839470264038111}} + +Centered four-cycle templates improve primary full validation and the second earlier diagnostic, while slightly reducing the first earlier diagnostic. They replace the joint adapter package: full validation 0.348797 versus adapter 0.348181, with better temporal stability. The joint adapter remains an archived experiment after worsening on both earlier cutoffs. + +## E24 centered seasonal template full validation +- Checkpoint SHA-256: `0ff54447074e0271d2e331c7d3e6e9e0fdd73353e4d8cef0175ff627385f71c3`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.348797; relative MASE 0.771273; relative WQL 0.549826. +- term skill: long=0.3827, medium=0.3957, short=0.3161. +- domain skill: Econ/Fin=0.1051, Energy=0.1719, Healthcare=0.4042, Nature=0.4059, Sales=0.3592, Transport=0.4561, Web/CloudOps=0.4931. +- frequency skill: A=0.2818, D=0.3368, H=0.3739, M=0.0954, Q=0.1765, S=0.4312, T=0.3905, W=0.1880. +- variates skill: multivariate=0.3783, univariate=0.3243. +- Outcome: Published. Same 36,764,960 learned parameters as E17; fixed seasonal template now preserves four-cycle shape while aligning its mean to the latest cycle. Full validation 0.348797 with zero failures; screen 0.353163; earlier diagnostics 0.321979 and 0.345981. Full inference 79.6 seconds while three training processes shared the one H100. Repeated relocated examples bitwise identical, finite, monotone. + +## E27: quantile width calibration diagnostic +Hypothesis: the changed training objective and sign-averaged forecasts may change interval calibration relative to the early E3 width sweep. Hold current E24 medians fixed and compare global width multipliers 0.75, 1.0 and 1.25, preserving positivity and monotone deciles. No training or new random seed. Evaluate primary full validation and both earlier diagnostics; retain the same multiplier for every instance and horizon if adopted. Record per-configuration decile coverage to distinguish interval calibration from point-forecast errors. + +## E28: stronger seasonal-error scaling in the training loss +Hypothesis: the existing floor 0.25 and maximum weight 4 underweight highly predictable series, whose small seasonal-error denominators make small biases costly in MASE. Change only this loss factor to floor 0.05 and maximum weight 20. The weight is derived from training contexts only; no validation observations enter gradients. Same E17 parent, seed 59, batch 256, sampled windows, 8e-5 learning rate and 24,000-step schedule as E22 control. Assess at 3,000 and 6,000 steps before deciding whether to continue. No architecture or inference changes. All training processes use the same single H100. + +E27 completed: global interval-width calibration is unchanged. The 1.0 multiplier wins on all three cutoffs; 0.75 and 1.25 are rejected. Parent checkpoint SHA-256: 0ff54447074e0271d2e331c7d3e6e9e0fdd73353e4d8cef0175ff627385f71c3. + +full, 21.961196422576904 CPU seconds: +- Width 0.75: skill 0.3452164549545038; group skills {"term": {"short": 0.313465550024141, "medium": 0.3915340298847654, "long": 0.37755696642578507}, "domain": {"Econ/Fin": 0.10580171688867446, "Energy": 0.16637482564763484, "Healthcare": 0.40914268073244664, "Nature": 0.4019524649941506, "Sales": 0.3530144630644825, "Transport": 0.4556672339606386, "Web/CloudOps": 0.4876214368641769}, "freq": {"A-DEC": 0.28725493449470174, "Q-DEC": 0.1801084712445944, "M": 0.11175276948966328, "W-SUN": 0.0323370845377442, "D": 0.3312199981338694, "H": 0.3695069715804825, "15T": 0.18168253390246492, "W-FRI": -0.056487631535321325, "10T": 0.49352637886384465, "W-TUE": 0.5378585205934543, "W-THU": 0.18433827097062172, "W-WED": 0.31349093490925006, "5T": 0.49222999321979144, "10S": 0.42390324244202104}} +- Width 1.0: skill 0.3487966789303172; group skills {"term": {"short": 0.3161336626027256, "medium": 0.3956796502512826, "long": 0.38269594016340247}, "domain": {"Econ/Fin": 0.10510484967413847, "Energy": 0.171919600185363, "Healthcare": 0.4042072222593659, "Nature": 0.40589812140398485, "Sales": 0.3591878025853771, "Transport": 0.4560779320618533, "Web/CloudOps": 0.4931146707071308}, "freq": {"A-DEC": 0.2818339423423022, "Q-DEC": 0.17653014662394806, "M": 0.09542703722254098, "W-SUN": 0.028486795465021086, "D": 0.336759380183841, "H": 0.3739148859162613, "15T": 0.18778774397400844, "W-FRI": -0.055524607369072276, "10T": 0.49458872561912703, "W-TUE": 0.552193186183172, "W-THU": 0.16944597281618878, "W-WED": 0.3192454710115562, "5T": 0.4977061545271937, "10S": 0.431201607928979}} +- Width 1.25: skill 0.34610650213535965; group skills {"term": {"short": 0.31181715347067873, "medium": 0.39425414652966917, "long": 0.3825681229603841}, "domain": {"Econ/Fin": 0.09501414185590251, "Energy": 0.17012785606235192, "Healthcare": 0.3929707629727902, "Nature": 0.4039288459201795, "Sales": 0.3578978997303499, "Transport": 0.4512528387663022, "Web/CloudOps": 0.49362461046923467}, "freq": {"A-DEC": 0.2690929347470029, "Q-DEC": 0.16432266959209074, "M": 0.07072014222773326, "W-SUN": 0.01173769854460438, "D": 0.3347121204957273, "H": 0.37299271990393135, "15T": 0.18526873151735845, "W-FRI": -0.07163417179692866, "10T": 0.49168735086319126, "W-TUE": 0.562370097705067, "W-THU": 0.14458649403408286, "W-WED": 0.32018515385552937, "5T": 0.4992200637780666, "10S": 0.43174911263031324}} + +backcast, 8.311058759689331 CPU seconds: +- Width 0.75: skill 0.31957721298205577; group skills {"term": {"short": 0.2849135227503923, "medium": 0.3430617259135954, "long": 0.3812505435660858}, "domain": {"Econ/Fin": 0.16020201234615272, "Energy": 0.21754177729190793, "Healthcare": 0.3694068614617043, "Nature": 0.3429441402339167, "Sales": 0.39134717268523767, "Transport": 0.36216325202164235, "Web/CloudOps": 0.42635659392097536}, "freq": {"A-DEC": 0.3052930254291859, "Q-DEC": 0.22988988761857532, "M": 0.17459013453754524, "W-SUN": 0.007398260950902569, "D": 0.3450062706602839, "H": 0.3480315684129901, "15T": 0.22233620685464417, "W-FRI": 0.30096387619142784, "10T": 0.27185481492835484, "W-TUE": 0.5329255178801061, "W-THU": 0.18370602390723068, "W-WED": 0.33814381573585706, "5T": 0.40916267988319677, "10S": 0.3313031636056427}} +- Width 1.0: skill 0.3219793532184254; group skills {"term": {"short": 0.28513766744059266, "medium": 0.34881946541549136, "long": 0.3853894132342357}, "domain": {"Econ/Fin": 0.15718749322715975, "Energy": 0.22030577879293345, "Healthcare": 0.3623301744205766, "Nature": 0.34528108990726747, "Sales": 0.39680141405427904, "Transport": 0.36419008193684854, "Web/CloudOps": 0.431209552326686}, "freq": {"A-DEC": 0.30258726544387415, "Q-DEC": 0.2194511972962907, "M": 0.1711489239900802, "W-SUN": -0.005425657920283156, "D": 0.3478712397620801, "H": 0.35385458082566135, "15T": 0.22504062321275653, "W-FRI": 0.24955455634173984, "10T": 0.2817041045341433, "W-TUE": 0.5071080326855618, "W-THU": 0.17681316324492524, "W-WED": 0.3400228795175667, "5T": 0.41767571957575267, "10S": 0.32801909847013033}} +- Width 1.25: skill 0.31790201775956073; group skills {"term": {"short": 0.2784084543186459, "medium": 0.34919365386981416, "long": 0.38309258280714664}, "domain": {"Econ/Fin": 0.14485063305112178, "Energy": 0.2160406174537144, "Healthcare": 0.34843021568184673, "Nature": 0.3414042631923321, "Sales": 0.3949701602051685, "Transport": 0.36064559654919026, "Web/CloudOps": 0.43041506837139865}, "freq": {"A-DEC": 0.289217486212048, "Q-DEC": 0.20086669955100855, "M": 0.15692994437261798, "W-SUN": -0.02840754711998872, "D": 0.34384490006115054, "H": 0.35403896763656184, "15T": 0.21854779190662021, "W-FRI": 0.19508006514698906, "10T": 0.2864956555409153, "W-TUE": 0.4740288982750931, "W-THU": 0.15896541765809558, "W-WED": 0.3390816757566152, "5T": 0.42177642249121394, "10S": 0.3165112734495428}} + +backcast2, 8.009549379348755 CPU seconds: +- Width 0.75: skill 0.34409820450993134; group skills {"term": {"short": 0.3290162458924437, "medium": 0.3688383955368778, "long": 0.3584446274583232}, "domain": {"Econ/Fin": 0.1059670159637679, "Energy": 0.2168683811981844, "Healthcare": 0.3413880194250112, "Nature": 0.45062953387079285, "Sales": 0.5547232267111362, "Transport": 0.4100430663915112, "Web/CloudOps": 0.41729590695067253}, "freq": {"A-DEC": 0.34005157942217423, "Q-DEC": 0.1412869592685284, "M": 0.16881189749680703, "W-SUN": 0.047625092062016594, "D": 0.4231522928214516, "H": 0.37698957063440086, "15T": 0.0904235813541534, "W-FRI": 0.11812283700385673, "10T": 0.44881967454327965, "W-TUE": 0.07442882063540968, "W-THU": 0.2788710322691663, "W-WED": 0.5437864115591705, "5T": 0.444848784038935, "10S": 0.2913075712082248}} +- Width 1.0: skill 0.34598093529199403; group skills {"term": {"short": 0.33003251595401095, "medium": 0.3728154676872124, "long": 0.3603198134466531}, "domain": {"Econ/Fin": 0.10766883533558247, "Energy": 0.2194802858514432, "Healthcare": 0.34118052581938385, "Nature": 0.4518189405691444, "Sales": 0.5552026877071643, "Transport": 0.4121926521487488, "Web/CloudOps": 0.41933489656663536}, "freq": {"A-DEC": 0.33512027884784024, "Q-DEC": 0.14770244414049571, "M": 0.16665926486843274, "W-SUN": 0.05081321100210512, "D": 0.42268953844805357, "H": 0.3801908053296258, "15T": 0.10067740700216166, "W-FRI": 0.10650868616810949, "10T": 0.45281662963431724, "W-TUE": 0.0831470254212826, "W-THU": 0.2681259389949434, "W-WED": 0.5394413576971099, "5T": 0.45179520908580906, "10S": 0.2776783233055614}} +- Width 1.25: skill 0.3413902485820186; group skills {"term": {"short": 0.32419069585401805, "medium": 0.37023913422459476, "long": 0.35685627734091574}, "domain": {"Econ/Fin": 0.09962820431101826, "Energy": 0.21472017584206793, "Healthcare": 0.3337184668053308, "Nature": 0.44788650255350915, "Sales": 0.5519703061689909, "Transport": 0.4091113202517557, "Web/CloudOps": 0.41471225075769447}, "freq": {"A-DEC": 0.3220090566072281, "Q-DEC": 0.14689640454759956, "M": 0.15748943073554222, "W-SUN": 0.043428818988100804, "D": 0.4159786673838306, "H": 0.3773278172245832, "15T": 0.1020767647441726, "W-FRI": 0.08603022609757915, "10T": 0.45227993224331775, "W-TUE": 0.07815927778447074, "W-THU": 0.25035502046342106, "W-WED": 0.53163473233605, "5T": 0.4537783408350755, "10S": 0.2545513618912605}} + +Decile coverage uses <=, so ties at zero contribute excess lower-tail coverage on intermittent nonnegative series. Coverage alone is not evidence for changing intervals; the proper quantile loss favors the existing widths. + +## E22 control 3000-step checkpoint +- Checkpoint SHA-256: `8fcb7dd923c415a0a93261be09f4b29a73674bc6188f33afb50130d615643715`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 16.52501678466797 seconds. +- Overall skill 0.350784; relative MASE 0.771331; relative WQL 0.546434. +- term skill: long=0.3855, medium=0.3992, short=0.3171. +- domain skill: Econ/Fin=0.1025, Energy=0.1770, Healthcare=0.3901, Nature=0.4076, Sales=0.3484, Transport=0.4531, Web/CloudOps=0.5016. +- frequency skill: A=0.3699, D=0.3270, H=0.3752, M=0.0777, Q=0.1894, S=0.4382, T=0.3953, W=0.1970. +- variates skill: multivariate=0.3839, univariate=0.3232. +- Outcome: Matched continuation control; primary screen 0.350784. Continuing training. + +## E22 control 6000-step checkpoint +- Checkpoint SHA-256: `ae199bb31299e77f3035e227d61bf9b41fa84ae4eb9825f4d5d2bc7aef813934`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 15.943427324295044 seconds. +- Overall skill 0.352399; relative MASE 0.769997; relative WQL 0.544661. +- term skill: long=0.3861, medium=0.4001, short=0.3195. +- domain skill: Econ/Fin=0.1064, Energy=0.1818, Healthcare=0.3888, Nature=0.4095, Sales=0.3482, Transport=0.4533, Web/CloudOps=0.5013. +- frequency skill: A=0.3691, D=0.3297, H=0.3767, M=0.0899, Q=0.1951, S=0.4372, T=0.3967, W=0.1945. +- variates skill: multivariate=0.3861, univariate=0.3242. +- Outcome: Screen 0.352399; 869.5 elapsed training-process seconds through this checkpoint on shared single H100. Continuing training. + +## E22 expanded depth 3000-step checkpoint +- Checkpoint SHA-256: `606808eaa8f41a4d8ffd7a336639c197cdb656b462d7b74cda0425a9c7b7ab88`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.74061632156372 seconds. +- Overall skill 0.349903; relative MASE 0.771470; relative WQL 0.547820. +- term skill: long=0.3846, medium=0.3995, short=0.3157. +- domain skill: Econ/Fin=0.1036, Energy=0.1753, Healthcare=0.3821, Nature=0.4103, Sales=0.3478, Transport=0.4524, Web/CloudOps=0.5003. +- frequency skill: A=0.3697, D=0.3271, H=0.3737, M=0.0851, Q=0.1912, S=0.4378, T=0.3939, W=0.1942. +- variates skill: multivariate=0.3823, univariate=0.3229. +- Outcome: Screen 0.349903 versus matched control 0.350784. 768.0 elapsed training-process seconds. Continuing to assess a longer run. + +## E25 learned recency 3000-step checkpoint +- Checkpoint SHA-256: `ff6465dac03192cfc5f8837d8c6ab9524b0fb81c1a73867ff6e08aaf83a53398`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 18.54782772064209 seconds. +- Overall skill 0.351702; relative MASE 0.770454; relative WQL 0.545509. +- term skill: long=0.3852, medium=0.3988, short=0.3191. +- domain skill: Econ/Fin=0.1014, Energy=0.1767, Healthcare=0.4078, Nature=0.4093, Sales=0.3476, Transport=0.4541, Web/CloudOps=0.5002. +- frequency skill: A=0.3707, D=0.3341, H=0.3745, M=0.0812, Q=0.1898, S=0.4360, T=0.3954, W=0.1980. +- variates skill: multivariate=0.3834, univariate=0.3253. +- Outcome: Screen 0.351702 versus matched control 0.350784. 510.3 elapsed training-process seconds. This is a modest early improvement; further checkpoints and temporal diagnostics remain. + +## E22 control 6000 with centered seasonal template, full validation +- Checkpoint SHA-256: `ae199bb31299e77f3035e227d61bf9b41fa84ae4eb9825f4d5d2bc7aef813934`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.349953; relative MASE 0.770650; relative WQL 0.548317. +- term skill: long=0.3842, medium=0.3966, short=0.3172. +- domain skill: Econ/Fin=0.1065, Energy=0.1770, Healthcare=0.3987, Nature=0.4093, Sales=0.3570, Transport=0.4567, Web/CloudOps=0.4912. +- frequency skill: A=0.2855, D=0.3349, H=0.3766, M=0.1068, Q=0.1785, S=0.4296, T=0.3905, W=0.1906. +- variates skill: multivariate=0.3802, univariate=0.3248. +- Outcome: Published: full validation 0.349953 versus previous 0.348797, with zero failures. Earlier diagnostics improve to 0.322147 and 0.348634 from 0.321979 and 0.345981. Full inference took 98.8 seconds while four training processes shared the one H100. Repeated relocated example checks passed. Training continues beyond this milestone. + +## E22 control 6000 centered, earlier diagnostic +- Checkpoint SHA-256: `ae199bb31299e77f3035e227d61bf9b41fa84ae4eb9825f4d5d2bc7aef813934`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 21.958669662475586 seconds. +- Overall skill 0.322147; relative MASE 0.812166; relative WQL 0.565752. +- term skill: long=0.3872, medium=0.3503, short=0.2840. +- domain skill: Econ/Fin=0.1531, Energy=0.2205, Healthcare=0.3579, Nature=0.3475, Sales=0.3966, Transport=0.3647, Web/CloudOps=0.4317. +- frequency skill: A=0.3153, D=0.3426, H=0.3545, M=0.1663, Q=0.2129, S=0.3286, T=0.3204, W=0.2542. +- variates skill: multivariate=0.3358, univariate=0.3111. +- Outcome: Small improvement over the preceding package. + +## E22 control 6000 centered, second earlier diagnostic +- Checkpoint SHA-256: `ae199bb31299e77f3035e227d61bf9b41fa84ae4eb9825f4d5d2bc7aef813934`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 21.61665678024292 seconds. +- Overall skill 0.348634; relative MASE 0.779607; relative WQL 0.544220. +- term skill: long=0.3637, medium=0.3753, short=0.3325. +- domain skill: Econ/Fin=0.1024, Energy=0.2199, Healthcare=0.3508, Nature=0.4590, Sales=0.5576, Transport=0.4153, Web/CloudOps=0.4205. +- frequency skill: A=0.3380, D=0.4233, H=0.3833, M=0.1690, Q=0.1387, S=0.2800, T=0.3398, W=0.2426. +- variates skill: multivariate=0.3512, univariate=0.3465. +- Outcome: Improvement over the preceding package. + +## E29: coarse memory of older context (prepared) +Hypothesis: a separately trained memory can extract useful information from points 4,097–16,384 without changing the frozen backbone’s treatment of its recent 4,096 points. Older observations are normalized using the recent window and averaged in groups of four, then encoded by two extra blocks. A zero-output cross-attention projection adds this memory to recent encoder states. Initial function is preserved; recent seasonal and continuity rules remain unchanged. The added embedding and two encoder blocks start from copies of our own trained weights, and the cross-attention output starts at zero. No external weights. Total 44,401,952 parameters; 7,636,992 trainable. Eight-step batch-16 smoke run on allowed packed_sample with seed 67 produced finite weights and updated only the history module. Full training has not started. + +## E30: seasonal amplitude alignment +Hypothesis: four-cycle shape averaging also lags changes in seasonal amplitude. Starting from E24 centered templates, scale their deviations around the mean to the latest cycle standard deviation, correcting both variance estimates for observation noise inferred from seasonal differences. Scale ratio is clipped to [0.5,2], and amplitude alignment requires at least 75% finite observations in the latest cycle. All thresholds, intervals, learned weights and confidence gates remain fixed. Compare centered versus aligned templates on three diagnostic cutoffs using cached E17 raw forecasts; no training or new random seed. + +E30 initial amplitude-alignment results, parent checkpoint SHA-256 0ff54447074e0271d2e331c7d3e6e9e0fdd73353e4d8cef0175ff627385f71c3: + +screen, 7.7 CPU seconds total: +- (4, 'centered'): skill 0.3531633226160329; group skills {"term": {"short": 0.3207293873053654, "medium": 0.3969450585806461, "long": 0.38964518179731034}, "domain": {"Econ/Fin": 0.12636396756466373, "Energy": 0.1800705780909143, "Healthcare": 0.3992839589819721, "Nature": 0.40602447440489264, "Sales": 0.34961552641405835, "Transport": 0.45585497734478375, "Web/CloudOps": 0.5005422814848317}, "freq": {"A-DEC": 0.3672744916070976, "Q-DEC": 0.19175192579993316, "M": 0.07909511983098594, "W-SUN": 0.042408325150654624, "D": 0.33302767036606196, "H": 0.37896395394765425, "15T": 0.19862358212653608, "W-FRI": -0.03667482636982777, "10T": 0.49458872561779677, "W-TUE": 0.552193186183172, "W-THU": 0.16944597286444163, "W-WED": 0.3192454708946336, "5T": 0.5067600572208003, "10S": 0.43120160792893125}} +- (4, 'aligned'): skill 0.35398462796791796; group skills {"term": {"short": 0.3217411363550048, "medium": 0.39832598201137914, "long": 0.3894451118078128}, "domain": {"Econ/Fin": 0.128986533479437, "Energy": 0.1846259909517678, "Healthcare": 0.3989632452392111, "Nature": 0.40602447440489264, "Sales": 0.34961552641405835, "Transport": 0.45834957050423264, "Web/CloudOps": 0.4970505147956361}, "freq": {"A-DEC": 0.3672744916070976, "Q-DEC": 0.1913923357266032, "M": 0.07925704481777684, "W-SUN": 0.04248196090218248, "D": 0.332866037279251, "H": 0.38330094783509405, "15T": 0.20143473054459382, "W-FRI": -0.036466297970424444, "10T": 0.49454418004359824, "W-TUE": 0.552193186183172, "W-THU": 0.16944597286444163, "W-WED": 0.3192454708946336, "5T": 0.506404214769247, "10S": 0.4192979394083295}} + +backcast, 8.3 CPU seconds total: +- (4, 'centered'): skill 0.3219793532222529; group skills {"term": {"short": 0.28513766744425706, "medium": 0.34881946541915476, "long": 0.3853894132385529}, "domain": {"Econ/Fin": 0.15718749322076342, "Energy": 0.220305778786681, "Healthcare": 0.3623301744180454, "Nature": 0.34528108993797224, "Sales": 0.3968014140531252, "Transport": 0.3641900819387449, "Web/CloudOps": 0.4312095523303556}, "freq": {"A-DEC": 0.30258726538887626, "Q-DEC": 0.21945119732749618, "M": 0.17114892410654747, "W-SUN": -0.005425657907346837, "D": 0.3478712397506638, "H": 0.3538545808265424, "15T": 0.22504062323947938, "W-FRI": 0.24955455634324242, "10T": 0.28170410454547445, "W-TUE": 0.5071080326855618, "W-THU": 0.17681316314370377, "W-WED": 0.3400228795320346, "5T": 0.4176757195719526, "10S": 0.32801909847059685}} +- (4, 'aligned'): skill 0.32199923078598136; group skills {"term": {"short": 0.2839405542344856, "medium": 0.34882959423473925, "long": 0.38815021409803896}, "domain": {"Econ/Fin": 0.15740802100053652, "Energy": 0.21807242823144724, "Healthcare": 0.36213507616373974, "Nature": 0.3461350653810715, "Sales": 0.3968014140531252, "Transport": 0.3649195243648111, "Web/CloudOps": 0.4328434979914423}, "freq": {"A-DEC": 0.30258726538887626, "Q-DEC": 0.2183391142623865, "M": 0.1754893176389558, "W-SUN": -0.004377726385369485, "D": 0.3466775300728464, "H": 0.3524837610290207, "15T": 0.2254592175464284, "W-FRI": 0.24954835437149747, "10T": 0.2817431568124176, "W-TUE": 0.5071080326855618, "W-THU": 0.17681316314370377, "W-WED": 0.3400228795320346, "5T": 0.41754999889925704, "10S": 0.3353593007357636}} + +backcast2, 9.4 CPU seconds total: +- (4, 'centered'): skill 0.34598093527842033; group skills {"term": {"short": 0.3300325159298324, "medium": 0.3728154676891604, "long": 0.3603198134443867}, "domain": {"Econ/Fin": 0.10766883532595528, "Energy": 0.21948028584715717, "Healthcare": 0.3411805258187349, "Nature": 0.45181894051147786, "Sales": 0.5552026876860963, "Transport": 0.41219265214646406, "Web/CloudOps": 0.4193348965687418}, "freq": {"A-DEC": 0.33512027886093443, "Q-DEC": 0.14770244416717793, "M": 0.16665926477245963, "W-SUN": 0.05081321100071179, "D": 0.4226895384052014, "H": 0.3801908053318377, "15T": 0.10067740700220107, "W-FRI": 0.10650868616967224, "10T": 0.45281662963561176, "W-TUE": 0.0831470254212826, "W-THU": 0.26812593887733527, "W-WED": 0.5394413576371667, "5T": 0.4517952090885672, "10S": 0.27767832330559383}} +- (4, 'aligned'): skill 0.3467340001955017; group skills {"term": {"short": 0.3300823793890595, "medium": 0.3753689052243039, "long": 0.36094597324048516}, "domain": {"Econ/Fin": 0.10766542601267182, "Energy": 0.22063331078456605, "Healthcare": 0.33410091914860696, "Nature": 0.45181894051147786, "Sales": 0.5552026876860963, "Transport": 0.4141243473009397, "Web/CloudOps": 0.42142071217676347}, "freq": {"A-DEC": 0.33512027886093443, "Q-DEC": 0.14888883016351762, "M": 0.15492673811864788, "W-SUN": 0.05041601533475526, "D": 0.4227650502464607, "H": 0.38160118363487416, "15T": 0.10559542335780892, "W-FRI": 0.10650868616967224, "10T": 0.4528840561650268, "W-TUE": 0.0831470254212826, "W-THU": 0.26812593887733527, "W-WED": 0.5394413576371667, "5T": 0.45189525302575095, "10S": 0.2812440461970862}} + +The new rule improves all three aggregate diagnostics on the E17 weights. A complete package evaluation with the newer E22 control weights is in progress before adoption. + +E29 zero-initialization verification: all 97 screen configurations exactly reproduce the E17 centered runtime skill 0.3531633226160329. Evaluation 21.35 seconds on the shared H100. The eight-step smoke changed the history output projection by 1.4182e-5 maximum while all frozen backbone weights remained bitwise equal and all weights finite. + +## E25 learned recency 6000-step checkpoint +- Checkpoint SHA-256: `dbbc4ff247028db1f339846b58c16c74d41a4a7b87e6a834988d95ee04c16734`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 19.591322422027588 seconds. +- Overall skill 0.352851; relative MASE 0.769426; relative WQL 0.544305. +- term skill: long=0.3876, medium=0.3997, short=0.3198. +- domain skill: Econ/Fin=0.1086, Energy=0.1828, Healthcare=0.3943, Nature=0.4120, Sales=0.3475, Transport=0.4545, Web/CloudOps=0.4982. +- frequency skill: A=0.3715, D=0.3323, H=0.3775, M=0.0905, Q=0.1942, S=0.4343, T=0.3965, W=0.1950. +- variates skill: multivariate=0.3855, univariate=0.3256. +- Outcome: Screen 0.352851 versus matched control 0.352399; modest improvement persists. Temporal diagnostics and later checkpoints remain. + +## E30 amplitude aligned template, full validation +- Checkpoint SHA-256: `ae199bb31299e77f3035e227d61bf9b41fa84ae4eb9825f4d5d2bc7aef813934`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.350837; relative MASE 0.770162; relative WQL 0.547174. +- term skill: long=0.3846, medium=0.3975, short=0.3183. +- domain skill: Econ/Fin=0.1090, Energy=0.1818, Healthcare=0.3984, Nature=0.4093, Sales=0.3570, Transport=0.4592, Web/CloudOps=0.4877. +- frequency skill: A=0.2855, D=0.3348, H=0.3812, M=0.1070, Q=0.1786, S=0.4173, T=0.3911, W=0.1906. +- variates skill: multivariate=0.3791, univariate=0.3274. +- Outcome: Published. With the E22 control 6000-step weights, full validation improves 0.349953 to 0.350837, first earlier diagnostic 0.322147 to 0.322219, and second earlier diagnostic 0.348634 to 0.349310. No failures; deterministic relocated example checks passed. Full inference 96.8 seconds while sharing the one H100 with four training processes. All template changes are fixed formulas; learned parameters remain unchanged. + +## E30 aligned template first earlier diagnostic +- Checkpoint SHA-256: `ae199bb31299e77f3035e227d61bf9b41fa84ae4eb9825f4d5d2bc7aef813934`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 20.561070680618286 seconds. +- Overall skill 0.322219; relative MASE 0.811128; relative WQL 0.566355. +- term skill: long=0.3898, medium=0.3504, short=0.2830. +- domain skill: Econ/Fin=0.1533, Energy=0.2182, Healthcare=0.3588, Nature=0.3483, Sales=0.3966, Transport=0.3655, Web/CloudOps=0.4333. +- frequency skill: A=0.3153, D=0.3418, H=0.3532, M=0.1706, Q=0.2117, S=0.3358, T=0.3205, W=0.2543. +- variates skill: multivariate=0.3369, univariate=0.3103. +- Outcome: Small improvement over centered templates. + +## E30 aligned template second earlier diagnostic +- Checkpoint SHA-256: `ae199bb31299e77f3035e227d61bf9b41fa84ae4eb9825f4d5d2bc7aef813934`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 20.08868408203125 seconds. +- Overall skill 0.349310; relative MASE 0.778190; relative WQL 0.544080. +- term skill: long=0.3643, medium=0.3777, short=0.3325. +- domain skill: Econ/Fin=0.1024, Energy=0.2210, Healthcare=0.3434, Nature=0.4590, Sales=0.5576, Transport=0.4172, Web/CloudOps=0.4224. +- frequency skill: A=0.3380, D=0.4234, H=0.3847, M=0.1568, Q=0.1399, S=0.2828, T=0.3413, W=0.2426. +- variates skill: multivariate=0.3522, univariate=0.3470. +- Outcome: Improvement over centered templates. + +## E28 stronger seasonal loss 3000-step checkpoint +- Checkpoint SHA-256: `a514371332282d8ff1cf42e0c2127683e6bb95bfb98c1a6df6332c604d72c865`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 20.41924524307251 seconds. +- Overall skill 0.350569; relative MASE 0.771378; relative WQL 0.546763. +- term skill: long=0.3829, medium=0.3988, short=0.3180. +- domain skill: Econ/Fin=0.1028, Energy=0.1748, Healthcare=0.4041, Nature=0.4086, Sales=0.3488, Transport=0.4526, Web/CloudOps=0.4996. +- frequency skill: A=0.3725, D=0.3288, H=0.3734, M=0.0932, Q=0.1901, S=0.4387, T=0.3933, W=0.1988. +- variates skill: multivariate=0.3818, univariate=0.3246. +- Outcome: Screen 0.350569 versus matched control 0.350784. No gain at this checkpoint; continue to 6000 steps before deciding. + +E29 full trial started from the E22 control 6000-step backbone, seed 67, batch 64, 6,000 steps, learning rate 2e-4 with 200-step warmup and cosine decay. Only the 7.64M history-memory parameters train. Batch size is reduced to fit concurrent experiments on the one H100. Context lengths 8,192/16,384 with probabilities 0.4/0.6; horizon mixture remains 32/128/512/1024. Inference uses the current amplitude-aligned seasonal rule on the recent 4,096 points, so the additional history affects only the learned memory. The parent differs from the newly published E25 branch; zero-step evaluation supplies the exact matched control. + +## E25 learned recency 6000 with aligned templates, full validation +- Checkpoint SHA-256: `dbbc4ff247028db1f339846b58c16c74d41a4a7b87e6a834988d95ee04c16734`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.351407; relative MASE 0.769733; relative WQL 0.546517. +- term skill: long=0.3860, medium=0.3973, short=0.3189. +- domain skill: Econ/Fin=0.1113, Energy=0.1828, Healthcare=0.4050, Nature=0.4118, Sales=0.3571, Transport=0.4604, Web/CloudOps=0.4845. +- frequency skill: A=0.2870, D=0.3384, H=0.3819, M=0.1083, Q=0.1800, S=0.4144, T=0.3909, W=0.1904. +- variates skill: multivariate=0.3786, univariate=0.3289. +- Outcome: Published. Full validation 0.351407 versus preceding 0.350837; earlier diagnostics 0.323269 and 0.350071 versus 0.322219 and 0.349310. No failures; repeated relocated examples are bitwise identical, finite and monotone. Total 36,797,728 parameters. Full inference 96.7 seconds while the one H100 was shared with training. Training continues. + +## E25 recency 6000 aligned first earlier diagnostic +- Checkpoint SHA-256: `dbbc4ff247028db1f339846b58c16c74d41a4a7b87e6a834988d95ee04c16734`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 20.321524143218994 seconds. +- Overall skill 0.323269; relative MASE 0.809492; relative WQL 0.565744. +- term skill: long=0.3896, medium=0.3509, short=0.2848. +- domain skill: Econ/Fin=0.1588, Energy=0.2200, Healthcare=0.3660, Nature=0.3488, Sales=0.3987, Transport=0.3659, Web/CloudOps=0.4318. +- frequency skill: A=0.3196, D=0.3433, H=0.3536, M=0.1780, Q=0.2165, S=0.3305, T=0.3218, W=0.2570. +- variates skill: multivariate=0.3369, univariate=0.3122. +- Outcome: Improves the matched continued model with the same aligned-template runtime. + +## E25 recency 6000 aligned second earlier diagnostic +- Checkpoint SHA-256: `dbbc4ff247028db1f339846b58c16c74d41a4a7b87e6a834988d95ee04c16734`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 20.002116203308105 seconds. +- Overall skill 0.350071; relative MASE 0.777410; relative WQL 0.543353. +- term skill: long=0.3631, medium=0.3788, short=0.3338. +- domain skill: Econ/Fin=0.1067, Energy=0.2234, Healthcare=0.3529, Nature=0.4590, Sales=0.5596, Transport=0.4165, Web/CloudOps=0.4198. +- frequency skill: A=0.3409, D=0.4269, H=0.3856, M=0.1584, Q=0.1427, S=0.2730, T=0.3428, W=0.2398. +- variates skill: multivariate=0.3525, univariate=0.3481. +- Outcome: Improves the matched continued model with the same aligned-template runtime. + +E22 depth trial pruned after two matched comparisons: 3000-step skill 0.349903 versus control 0.350784, and 6000-step skill 0.351873 versus control 0.352399. The 6000-step checkpoint cost 1961.8 elapsed training-process seconds, versus 869.5 for the control under different shared-GPU contention. The planned 24,000 steps were not completed. This establishes no benefit at the tested budgets, not that greater depth can never help. Saved checkpoints remain available. Stop receipt: [{"pid": 4519, "kind": "training", "elapsed_seconds": 2108}, {"pid": 4914, "kind": "watcher", "elapsed_seconds": 1723}]. + +## E22 expanded depth 6000-step checkpoint +- Checkpoint SHA-256: `a1efd06cff13f7f47559d83d37ea63f6bc65692df49fd2bfe039502d33978632`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 29.713934898376465 seconds. +- Overall skill 0.351873; relative MASE 0.770476; relative WQL 0.545206. +- term skill: long=0.3864, medium=0.4005, short=0.3182. +- domain skill: Econ/Fin=0.1070, Energy=0.1815, Healthcare=0.3779, Nature=0.4133, Sales=0.3487, Transport=0.4524, Web/CloudOps=0.4999. +- frequency skill: A=0.3690, D=0.3292, H=0.3764, M=0.0873, Q=0.1951, S=0.4370, T=0.3963, W=0.1928. +- variates skill: multivariate=0.3859, univariate=0.3234. +- Outcome: Below the matched 36.8M control for the second comparison. Stop this trial and retain its checkpoints; prioritize the smaller learned-feature and history-memory experiments on one H100. + +## E31: stochastic seasonal amplitude in synthetic pretraining (prepared) +Hypothesis: the original generator has constant Fourier amplitudes, whereas the added recency features describe changing amplitudes. Modulate the seasonal component in half of synthetic draws by a positive AR log-amplitude with time constant 100–10,000, stationary log standard deviation 0.05–0.4 and log-value clipping [-2,2]. The modulation is applied before trends, observation noise, missing values and intermittence. A separate RNG seed = main seed + 100003 preserves all source selection, corpus windows, horizon/context choices and original generator random draws relative to E25. Planned seed 59 and E17 initialization allow comparison with existing E25 checkpoints without retraining a control. No training started yet. + +## E29 history memory 1000-step checkpoint +- Checkpoint SHA-256: `a3bdc3a7525ed869d48fc1ce2b54785bb82aa64573e3b3d8a0de98df10680af3`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.969539165496826 seconds. +- Overall skill 0.355846; relative MASE 0.766420; relative WQL 0.541393. +- term skill: long=0.3920, medium=0.3994, short=0.3237. +- domain skill: Econ/Fin=0.1304, Energy=0.1908, Healthcare=0.3939, Nature=0.4095, Sales=0.3479, Transport=0.4592, Web/CloudOps=0.4963. +- frequency skill: A=0.3691, D=0.3317, H=0.3867, M=0.0892, Q=0.1952, S=0.4178, T=0.4001, W=0.1953. +- variates skill: multivariate=0.3846, univariate=0.3320. +- Outcome: Improves the matched zero-step screen score 0.354979. Elapsed training-process time 104.3 seconds on the shared single H100. Temporal diagnostics determine whether the gain transfers across cutoffs. + +## E29 history memory 3000-step checkpoint +- Checkpoint SHA-256: `81b1e8dfae60e87a20a2f0ff6d3464a608c8b86624cfc3383ca29441e9f1fd92`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 20.785941123962402 seconds. +- Overall skill 0.356376; relative MASE 0.765914; relative WQL 0.540860. +- term skill: long=0.3932, medium=0.3995, short=0.3240. +- domain skill: Econ/Fin=0.1306, Energy=0.1923, Healthcare=0.3934, Nature=0.4102, Sales=0.3479, Transport=0.4591, Web/CloudOps=0.4965. +- frequency skill: A=0.3691, D=0.3318, H=0.3878, M=0.0892, Q=0.1952, S=0.4179, T=0.4005, W=0.1953. +- variates skill: multivariate=0.3854, univariate=0.3323. +- Outcome: Improves the matched zero-step screen score 0.354979. Elapsed training-process time 283.3 seconds on the shared single H100. Temporal diagnostics determine whether the gain transfers across cutoffs. + +E31 training started: seed 59, batch 256, 24,000-step schedule, learning rate 8e-5, E17 initialization, same query-feature architecture as E25. Tests verified that all corpus-only rows are identical to E25 and that the main RNG states remain identical after both corpus-only and synthetic-only batches; 11 of 32 synthetic test rows changed. The independent modulation stream is seed 100062. Evaluate at 3000/6000 steps before extending this trial. + +## E22 control 12000 with aligned templates, full validation +- Checkpoint SHA-256: `69e01d3fbc013287a1e63346e7cefbbe82acfb98f7d446459d52c931515bd8a8`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.355096; relative MASE 0.766848; relative WQL 0.542351. +- term skill: long=0.3891, medium=0.3999, short=0.3233. +- domain skill: Econ/Fin=0.1147, Energy=0.1853, Healthcare=0.3958, Nature=0.4163, Sales=0.3582, Transport=0.4612, Web/CloudOps=0.4938. +- frequency skill: A=0.2887, D=0.3392, H=0.3848, M=0.1131, Q=0.1870, S=0.4202, T=0.3967, W=0.1906. +- variates skill: multivariate=0.3845, univariate=0.3307. +- Outcome: Published. Full validation 0.355096 versus preceding E25-6000 package 0.351407, first earlier diagnostic 0.325963 versus 0.323269, and second earlier diagnostic 0.352462 versus 0.350071. No failures; repeated relocated examples are bitwise identical, finite and monotone. Full inference 98.8 seconds under shared H100 contention. The matched E25-12000 checkpoint is still training. + +## E22 control12000 aligned first earlier diagnostic +- Checkpoint SHA-256: `69e01d3fbc013287a1e63346e7cefbbe82acfb98f7d446459d52c931515bd8a8`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 22.49058723449707 seconds. +- Overall skill 0.325963; relative MASE 0.809373; relative WQL 0.561330. +- term skill: long=0.3895, medium=0.3521, short=0.2893. +- domain skill: Econ/Fin=0.1619, Energy=0.2209, Healthcare=0.3713, Nature=0.3541, Sales=0.3962, Transport=0.3666, Web/CloudOps=0.4365. +- frequency skill: A=0.3123, D=0.3490, H=0.3551, M=0.1691, Q=0.2293, S=0.3380, T=0.3258, W=0.2557. +- variates skill: multivariate=0.3406, univariate=0.3141. +- Outcome: Improves the preceding package. + +## E22 control12000 aligned second earlier diagnostic +- Checkpoint SHA-256: `69e01d3fbc013287a1e63346e7cefbbe82acfb98f7d446459d52c931515bd8a8`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 21.788399934768677 seconds. +- Overall skill 0.352462; relative MASE 0.775936; relative WQL 0.540386. +- term skill: long=0.3649, medium=0.3793, short=0.3372. +- domain skill: Econ/Fin=0.1068, Energy=0.2227, Healthcare=0.3661, Nature=0.4623, Sales=0.5608, Transport=0.4167, Web/CloudOps=0.4248. +- frequency skill: A=0.3383, D=0.4276, H=0.3860, M=0.1616, Q=0.1520, S=0.2793, T=0.3458, W=0.2493. +- variates skill: multivariate=0.3545, univariate=0.3508. +- Outcome: Improves the preceding package. + +## E32: transfer the learned history memory to the improved backbone +Hypothesis: the frozen history memory learns useful features that remain compatible with a later continuation of the same backbone architecture. Combine E29 history-memory tensors at 6000 steps with every backbone tensor from E22 control at 12000 steps. This is a deterministic combination of our own trained assets, with no new training and no external weights. Both parent checkpoint hashes and full training lineages are retained. The publication utility now traverses both parent branches and declares all their sources and generator seeds. Compare to the E22-12000 aligned-template runtime across three cutoffs before adoption. + +## E29 history memory 6000-step screen +- Checkpoint SHA-256: `5c3b98e648e31f0d2aa61a150700be8147ba2638c975510fc15bdb311531cf43`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 43.3264684677124 seconds. +- Overall skill 0.357127; relative MASE 0.765099; relative WQL 0.540174. +- term skill: long=0.3941, medium=0.3993, short=0.3251. +- domain skill: Econ/Fin=0.1303, Energy=0.1925, Healthcare=0.3999, Nature=0.4104, Sales=0.3479, Transport=0.4597, Web/CloudOps=0.4973. +- frequency skill: A=0.3691, D=0.3342, H=0.3893, M=0.0892, Q=0.1952, S=0.4179, T=0.4002, W=0.1953. +- variates skill: multivariate=0.3861, univariate=0.3331. +- Outcome: Screen 0.357127 versus zero-step 0.354979. Training completed in 531.4 process seconds on the shared single H100. First earlier diagnostic regresses while the second improves; do not publish standalone without broader evidence. + +## E29 history memory first earlier diagnostic +- Checkpoint SHA-256: `5c3b98e648e31f0d2aa61a150700be8147ba2638c975510fc15bdb311531cf43`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 22.55209970474243 seconds. +- Overall skill 0.321189; relative MASE 0.812469; relative WQL 0.567141. +- term skill: long=0.3883, medium=0.3470, short=0.2831. +- domain skill: Econ/Fin=0.1541, Energy=0.2165, Healthcare=0.3555, Nature=0.3461, Sales=0.3966, Transport=0.3649, Web/CloudOps=0.4336. +- frequency skill: A=0.3153, D=0.3408, H=0.3550, M=0.1706, Q=0.2117, S=0.3336, T=0.3162, W=0.2543. +- variates skill: multivariate=0.3353, univariate=0.3098. +- Outcome: Regresses from the matched parent 0.322219 to 0.321189. + +## E29 history memory second earlier diagnostic +- Checkpoint SHA-256: `5c3b98e648e31f0d2aa61a150700be8147ba2638c975510fc15bdb311531cf43`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 22.82407259941101 seconds. +- Overall skill 0.350315; relative MASE 0.776760; relative WQL 0.543398. +- term skill: long=0.3664, medium=0.3780, short=0.3334. +- domain skill: Econ/Fin=0.1037, Energy=0.2222, Healthcare=0.3446, Nature=0.4601, Sales=0.5576, Transport=0.4171, Web/CloudOps=0.4239. +- frequency skill: A=0.3380, D=0.4241, H=0.3857, M=0.1568, Q=0.1399, S=0.2820, T=0.3431, W=0.2426. +- variates skill: multivariate=0.3544, univariate=0.3470. +- Outcome: Improves from the matched parent 0.349310 to 0.350315. + +## E28 stronger seasonal loss 6000-step checkpoint +- Checkpoint SHA-256: `6208c74c3a6902d0410708741fd3ee609649e28732e5d5ee2696169685768e9b`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 19.053489208221436 seconds. +- Overall skill 0.352533; relative MASE 0.769384; relative WQL 0.544869. +- term skill: long=0.3857, medium=0.3986, short=0.3205. +- domain skill: Econ/Fin=0.1093, Energy=0.1807, Healthcare=0.4083, Nature=0.4098, Sales=0.3497, Transport=0.4525, Web/CloudOps=0.4985. +- frequency skill: A=0.3742, D=0.3386, H=0.3743, M=0.0874, Q=0.1946, S=0.4388, T=0.3951, W=0.1953. +- variates skill: multivariate=0.3844, univariate=0.3260. +- Outcome: Screen 0.352533 versus matched control 0.352399; first earlier diagnostic 0.322419 versus control 0.322598. Differences are small and inconsistent; continue to the 12000-step comparison. Training time through 6000: 1375.1 process seconds. + +## E22 pruned depth model earlier diagnostic +- Checkpoint SHA-256: `a1efd06cff13f7f47559d83d37ea63f6bc65692df49fd2bfe039502d33978632`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 29.58867907524109 seconds. +- Overall skill 0.322537; relative MASE 0.811436; relative WQL 0.565609. +- term skill: long=0.3876, medium=0.3519, short=0.2839. +- domain skill: Econ/Fin=0.1430, Energy=0.2205, Healthcare=0.3835, Nature=0.3473, Sales=0.3985, Transport=0.3592, Web/CloudOps=0.4331. +- frequency skill: A=0.3156, D=0.3515, H=0.3521, M=0.1655, Q=0.2142, S=0.3417, T=0.3184, W=0.2490. +- variates skill: multivariate=0.3364, univariate=0.3113. +- Outcome: Score 0.322537 versus matched control 0.322598, confirming no useful advantage in the tested budgets. + +## E33: global quantile ensemble of the newer backbone and transferred memory +Hypothesis: averaging the unmodified E22-12000 forecasts with E32 reduces the history memory’s temporal instability. Compare fixed backbone weights 0.25/0.5/0.75, with the complementary weight on the memory model, across all three diagnostics. Both members must forecast every instance in any deployed package. This is a cached-output diagnostic first, with no training or per-dataset choice. Actual package inference and full validation remain required before publication. + +## E32 transferred history memory screen +- Checkpoint SHA-256: `c5a6d1fa7f637f2fa36f9176d66f39a71f8f3c8c84fef8098ec03a88a59f68e7`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 24.279379844665527 seconds. +- Overall skill 0.361285; relative MASE 0.762270; relative WQL 0.535186. +- term skill: long=0.3979, medium=0.4009, short=0.3306. +- domain skill: Econ/Fin=0.1354, Energy=0.1960, Healthcare=0.4004, Nature=0.4175, Sales=0.3496, Transport=0.4614, Web/CloudOps=0.5026. +- frequency skill: A=0.3746, D=0.3390, H=0.3931, M=0.0951, Q=0.1983, S=0.4210, T=0.4049, W=0.1967. +- variates skill: multivariate=0.3911, univariate=0.3365. +- Outcome: Main-screen gain persists on the newer backbone, but the first earlier diagnostic remains below its matched control. Not published standalone. + +## E32 transferred history memory first earlier +- Checkpoint SHA-256: `c5a6d1fa7f637f2fa36f9176d66f39a71f8f3c8c84fef8098ec03a88a59f68e7`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 24.01271629333496 seconds. +- Overall skill 0.324581; relative MASE 0.811091; relative WQL 0.562442. +- term skill: long=0.3866, medium=0.3491, short=0.2893. +- domain skill: Econ/Fin=0.1617, Energy=0.2185, Healthcare=0.3678, Nature=0.3513, Sales=0.3962, Transport=0.3659, Web/CloudOps=0.4368. +- frequency skill: A=0.3123, D=0.3475, H=0.3561, M=0.1691, Q=0.2293, S=0.3357, T=0.3214, W=0.2557. +- variates skill: multivariate=0.3385, univariate=0.3133. +- Outcome: Main-screen gain persists on the newer backbone, but the first earlier diagnostic remains below its matched control. Not published standalone. + +## E32 transferred history memory second earlier +- Checkpoint SHA-256: `c5a6d1fa7f637f2fa36f9176d66f39a71f8f3c8c84fef8098ec03a88a59f68e7`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 23.5328631401062 seconds. +- Overall skill 0.352606; relative MASE 0.775583; relative WQL 0.540391. +- term skill: long=0.3677, medium=0.3779, short=0.3370. +- domain skill: Econ/Fin=0.1079, Energy=0.2224, Healthcare=0.3668, Nature=0.4615, Sales=0.5608, Transport=0.4165, Web/CloudOps=0.4263. +- frequency skill: A=0.3383, D=0.4283, H=0.3855, M=0.1616, Q=0.1520, S=0.2804, T=0.3462, W=0.2493. +- variates skill: multivariate=0.3553, univariate=0.3504. +- Outcome: Main-screen gain persists on the newer backbone, but the first earlier diagnostic remains below its matched control. Not published standalone. + +E33 cached ensemble results. Neither member required new training. Backbone weights 0.25/0.5/0.75 apply globally to every instance; complementary weight is on E32. All tested mixtures retain a small first-earlier-cutoff regression. No ensemble is published yet; the simpler backbone continuations are still improving. +- screen, base weight 0.25: skill 0.3609597107729168; elapsed 31.589441299438477 CPU seconds; groups {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7485062013261629, "rel_wql_gmean": 0.48497053192140965}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7187220659985801, "rel_wql_gmean": 0.49872959388387217}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7854775479522941, "rel_wql_gmean": 0.5715754588019885}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8766794111084217, "rel_wql_gmean": 0.8521904674160014}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9458381742339477, "rel_wql_gmean": 0.6841214470602749}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6357518097122528, "rel_wql_gmean": 0.5708050606184818}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8296139742081163, "rel_wql_gmean": 0.40898901267743815}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8283216000359614, "rel_wql_gmean": 0.510813353500822}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6491485866452709, "rel_wql_gmean": 0.4469444592152844}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.564775788716386, "rel_wql_gmean": 0.4386209893190716}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6092189862308618, "rel_wql_gmean": 0.6444119562488515}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7923969772018941, "rel_wql_gmean": 0.5529928138595462}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7344815207835862, "rel_wql_gmean": 0.502366984331498}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9818087731317099, "rel_wql_gmean": 0.8332936324629011}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7734447483921444, "rel_wql_gmean": 0.8291183442517216}, "S": {"n_configs": 6, "rel_mase_gmean": 0.662205210700223, "rel_wql_gmean": 0.5065947056042907}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7321702800096546, "rel_wql_gmean": 0.4836230433794967}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9308497588724332, "rel_wql_gmean": 0.6931956959471695}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7176036435313308, "rel_wql_gmean": 0.5172069567399432}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.800284652420953, "rel_wql_gmean": 0.5506355529979893}}} +- screen, base weight 0.5: skill 0.36051700538130327; elapsed 1.6923091411590576 CPU seconds; groups {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7491443694259866, "rel_wql_gmean": 0.48552116951145263}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.717943946501363, "rel_wql_gmean": 0.49885742655549165}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7862261945539069, "rel_wql_gmean": 0.572174296426093}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8767314570553127, "rel_wql_gmean": 0.8518426772129285}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9464868100785462, "rel_wql_gmean": 0.6847020626617584}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6391927294627128, "rel_wql_gmean": 0.5728774819722747}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8288486290328975, "rel_wql_gmean": 0.4095777628918776}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.828359895013336, "rel_wql_gmean": 0.5108331535102516}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6492097960109925, "rel_wql_gmean": 0.44703510569395916}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5650725913141991, "rel_wql_gmean": 0.43904253902223594}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6107048585981317, "rel_wql_gmean": 0.6453081988530746}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7937577174837149, "rel_wql_gmean": 0.5536527716998109}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7349129886012886, "rel_wql_gmean": 0.5033244078192418}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9816729369571708, "rel_wql_gmean": 0.83284954955612}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7729642350253297, "rel_wql_gmean": 0.8282079386900584}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6624714487276662, "rel_wql_gmean": 0.5067064419332115}, "T": {"n_configs": 30, "rel_mase_gmean": 0.732172046143732, "rel_wql_gmean": 0.4837994768895142}, "W": {"n_configs": 8, "rel_mase_gmean": 0.930849298960232, "rel_wql_gmean": 0.6931955559830537}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.717793296521423, "rel_wql_gmean": 0.5179713349770367}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.8008210552601016, "rel_wql_gmean": 0.5508732181941426}}} +- screen, base weight 0.75: skill 0.3599500839851063; elapsed 1.4231245517730713 CPU seconds; groups {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.750042489425022, "rel_wql_gmean": 0.48623104748726004}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7173897864210821, "rel_wql_gmean": 0.4991516788000004}, "short": {"n_configs": 55, "rel_mase_gmean": 0.78703598003334, "rel_wql_gmean": 0.5728330044823371}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8768876674480677, "rel_wql_gmean": 0.8515997053654789}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9473562016160542, "rel_wql_gmean": 0.6855548779843715}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.642561102977203, "rel_wql_gmean": 0.5749859696863521}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8285232450849535, "rel_wql_gmean": 0.4102456883415478}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8284086809446388, "rel_wql_gmean": 0.5108547074028001}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6493066620546145, "rel_wql_gmean": 0.44715612803391697}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5654188677782281, "rel_wql_gmean": 0.4395078746093791}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6122299433463864, "rel_wql_gmean": 0.6462324836335608}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7950974689907988, "rel_wql_gmean": 0.5543319910897211}, "H": {"n_configs": 31, "rel_mase_gmean": 0.735615332675693, "rel_wql_gmean": 0.5044620646385107}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9815783490405571, "rel_wql_gmean": 0.832453381029195}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7726561980040161, "rel_wql_gmean": 0.8274692503440843}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6627478709382408, "rel_wql_gmean": 0.5068543440740843}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7323316854508894, "rel_wql_gmean": 0.4840907541003884}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9308491431521891, "rel_wql_gmean": 0.6931954208513348}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7182293746317306, "rel_wql_gmean": 0.5189159515589695}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.8014062938450294, "rel_wql_gmean": 0.5511589238591919}}} +- backcast, base weight 0.25: skill 0.32516390659459127; elapsed 25.728330373764038 CPU seconds; groups {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7877573688004119, "rel_wql_gmean": 0.4757505244331779}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7777646324659491, "rel_wql_gmean": 0.5427449141803178}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8320626409877416, "rel_wql_gmean": 0.6069233027764227}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8731645869233648, "rel_wql_gmean": 0.8046317212772931}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9000885899955989, "rel_wql_gmean": 0.6764463826118567}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6763673902063786, "rel_wql_gmean": 0.5893498915999001}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9498042213778831, "rel_wql_gmean": 0.44171639005646535}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7353166304138659, "rel_wql_gmean": 0.495785420303292}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7449699119735571, "rel_wql_gmean": 0.5393127533664154}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6755793289890412, "rel_wql_gmean": 0.4696226318380198}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.651838123897038, "rel_wql_gmean": 0.7256129506047462}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8480816283629858, "rel_wql_gmean": 0.5013822816935581}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7872906478235149, "rel_wql_gmean": 0.5262643957494131}, "M": {"n_configs": 5, "rel_mase_gmean": 0.867272967035772, "rel_wql_gmean": 0.7959646950903766}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7634980658181472, "rel_wql_gmean": 0.7778879435047819}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8611665698543136, "rel_wql_gmean": 0.5114505986034271}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7774300159704559, "rel_wql_gmean": 0.5898942963102115}, "W": {"n_configs": 8, "rel_mase_gmean": 0.921455165311994, "rel_wql_gmean": 0.6011456983078217}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.8054278932888852, "rel_wql_gmean": 0.5417010935787644}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.8142697614393413, "rel_wql_gmean": 0.5786920991268066}}} +- backcast, base weight 0.5: skill 0.3255906425540577; elapsed 7.025062561035156 CPU seconds; groups {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7868531100085023, "rel_wql_gmean": 0.47494194797983313}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7767176724724971, "rel_wql_gmean": 0.5419949281040547}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8318845792654018, "rel_wql_gmean": 0.606991975463184}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8731690390439605, "rel_wql_gmean": 0.8045484945388448}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8993476870381677, "rel_wql_gmean": 0.6755669234996251}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6753662260274707, "rel_wql_gmean": 0.5885861458424224}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9483032085189914, "rel_wql_gmean": 0.441350380267718}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7353166304138659, "rel_wql_gmean": 0.495785420303292}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7446948865024733, "rel_wql_gmean": 0.5392154113246899}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6755391890283506, "rel_wql_gmean": 0.469748030722515}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.651838123897038, "rel_wql_gmean": 0.7256129506047462}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8475410369158077, "rel_wql_gmean": 0.5011421156521402}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7875436876281503, "rel_wql_gmean": 0.5262880067026078}, "M": {"n_configs": 5, "rel_mase_gmean": 0.867272967035772, "rel_wql_gmean": 0.7959646950903766}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7634980658181472, "rel_wql_gmean": 0.7778879435047819}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8607773505813321, "rel_wql_gmean": 0.5107840537486803}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7758285204666452, "rel_wql_gmean": 0.5890117516972101}, "W": {"n_configs": 8, "rel_mase_gmean": 0.921455165311994, "rel_wql_gmean": 0.6011456983078217}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.8047280897548712, "rel_wql_gmean": 0.5410867356076619}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.8138657265706295, "rel_wql_gmean": 0.5785877053648649}}} +- backcast, base weight 0.75: skill 0.32585558132181525; elapsed 1.4801208972930908 CPU seconds; groups {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7864118030472989, "rel_wql_gmean": 0.47433966987370835}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7760856247602924, "rel_wql_gmean": 0.541419709057465}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8317549187410698, "rel_wql_gmean": 0.6071042148592315}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8731809073153128, "rel_wql_gmean": 0.8044818649657144}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8991776752660365, "rel_wql_gmean": 0.6750015559883032}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6743591342425898, "rel_wql_gmean": 0.5878184243392145}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9471433052106504, "rel_wql_gmean": 0.4410648488568812}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7353166304138659, "rel_wql_gmean": 0.495785420303292}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.744443044974495, "rel_wql_gmean": 0.5391442286013897}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6755193180086204, "rel_wql_gmean": 0.46990600477296696}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.651838123897038, "rel_wql_gmean": 0.7256129506047462}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8470002930114933, "rel_wql_gmean": 0.5009052086170435}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7882647172004155, "rel_wql_gmean": 0.5264910423859007}, "M": {"n_configs": 5, "rel_mase_gmean": 0.867272967035772, "rel_wql_gmean": 0.7959646950903766}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7634980658181472, "rel_wql_gmean": 0.7778879435047819}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8604064218762162, "rel_wql_gmean": 0.5101551146076984}, "T": {"n_configs": 30, "rel_mase_gmean": 0.774442079728573, "rel_wql_gmean": 0.5883004763096262}, "W": {"n_configs": 8, "rel_mase_gmean": 0.921455165311994, "rel_wql_gmean": 0.6011456983078217}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.8044577867215783, "rel_wql_gmean": 0.5406785466562373}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.8135190933822734, "rel_wql_gmean": 0.5785199260327762}}} +- backcast2, base weight 0.25: skill 0.35287154434047796; elapsed 32.718568563461304 CPU seconds; groups {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7953937401265897, "rel_wql_gmean": 0.5030106493089533}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7678643593783896, "rel_wql_gmean": 0.5028055430553253}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7711270557942318, "rel_wql_gmean": 0.5695813024863108}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8805482364783594, "rel_wql_gmean": 0.9042209924611244}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9117289903338895, "rel_wql_gmean": 0.6620020860753241}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6839866145665877, "rel_wql_gmean": 0.5864976160474622}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7748252117778318, "rel_wql_gmean": 0.3733068662798137}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5489740065972382, "rel_wql_gmean": 0.3513233844778427}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6725766506204502, "rel_wql_gmean": 0.5061420572217049}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6870083960785978, "rel_wql_gmean": 0.4794994231705838}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5819327138083403, "rel_wql_gmean": 0.7523849571908706}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7299533930809837, "rel_wql_gmean": 0.4479740157977664}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7604275957811419, "rel_wql_gmean": 0.4953118153144008}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8158365215321529, "rel_wql_gmean": 0.8615342594759124}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8252565936089924, "rel_wql_gmean": 0.8713357271735944}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9122753788008492, "rel_wql_gmean": 0.5679295721865012}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7657639848982667, "rel_wql_gmean": 0.5579672183603664}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8655383325021186, "rel_wql_gmean": 0.6510826830966135}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7902445203946336, "rel_wql_gmean": 0.5253027568920817}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7633236727962595, "rel_wql_gmean": 0.5525218103974238}}} +- backcast2, base weight 0.5: skill 0.35293362223391267; elapsed 1.2891087532043457 CPU seconds; groups {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.795490811324907, "rel_wql_gmean": 0.5038189345476245}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7674326315874551, "rel_wql_gmean": 0.5023119643797436}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7711829671563578, "rel_wql_gmean": 0.5693457082014003}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8808378054392396, "rel_wql_gmean": 0.9044589957290904}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9113735276107076, "rel_wql_gmean": 0.6617472008949459}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6842243004747667, "rel_wql_gmean": 0.5865985548061023}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7748130011917327, "rel_wql_gmean": 0.37282859138217267}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5489740065972382, "rel_wql_gmean": 0.3513233844778427}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6724189210776539, "rel_wql_gmean": 0.5061490326925873}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6872511298933153, "rel_wql_gmean": 0.47991505019019964}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5819327138083403, "rel_wql_gmean": 0.7523849571908706}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7301681468376378, "rel_wql_gmean": 0.4481185117970856}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7599867700948899, "rel_wql_gmean": 0.49504239452481336}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8158365215321529, "rel_wql_gmean": 0.8615342594759124}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8252565936089924, "rel_wql_gmean": 0.8713357271735944}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9125454167444352, "rel_wql_gmean": 0.5681445429462755}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7659127026855528, "rel_wql_gmean": 0.5579048015053354}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8655383325021186, "rel_wql_gmean": 0.6510826830966135}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7903908108689007, "rel_wql_gmean": 0.5252368408110905}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7631277150357363, "rel_wql_gmean": 0.5524454383766455}}} +- backcast2, base weight 0.75: skill 0.35279424558075034; elapsed 1.3640234470367432 CPU seconds; groups {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7960013691972241, "rel_wql_gmean": 0.5048538794748333}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7673586435302413, "rel_wql_gmean": 0.5020153819167671}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7714553413789935, "rel_wql_gmean": 0.5691840862467166}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.881145657719554, "rel_wql_gmean": 0.9047199305925011}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9115950570456508, "rel_wql_gmean": 0.6618010993808187}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6844817312954508, "rel_wql_gmean": 0.5867080808867043}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7754005359113609, "rel_wql_gmean": 0.3724980616976047}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5489740065972382, "rel_wql_gmean": 0.3513233844778427}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.672286131185056, "rel_wql_gmean": 0.506183419259456}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6875722190026725, "rel_wql_gmean": 0.48037847185063465}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5819327138083403, "rel_wql_gmean": 0.7523849571908706}, "D": {"n_configs": 15, "rel_mase_gmean": 0.730395963063022, "rel_wql_gmean": 0.4482700955304752}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7602248518219639, "rel_wql_gmean": 0.4950255629831832}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8158365215321529, "rel_wql_gmean": 0.8615342594759124}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8252565936089924, "rel_wql_gmean": 0.8713357271735944}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9128726300303336, "rel_wql_gmean": 0.5684332751933325}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7662563237934747, "rel_wql_gmean": 0.5579847239947101}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8655383325021186, "rel_wql_gmean": 0.6510826830966135}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7911061856256687, "rel_wql_gmean": 0.5254140703891469}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7629991415479856, "rel_wql_gmean": 0.5524144817860636}}} + +## E34: multivariate attention with end-to-end pretraining and univariate rehearsal +Hypothesis: E20’s frozen backbone could not fully learn how to interpret cross-channel signals. Start from E22 control at 12000, add the same zero-output cross-variable attention layer, and train all 37,816,096 parameters. Three quarters of batches use the original 95-source univariate sampler, batch 128; one quarter use synchronized multivariate records, 32 groups with 2/3/4/8 channels. Six thousand steps, learning rate 4e-5 with 200-step warmup and cosine decay; main seed 73, independent joint-sampler seed 10073. Use only packed_sample and packed_joint and their local generators. This changes the training mixture and trainable parameter set together; it is a candidate method comparison, not a claim that either factor alone causes any gain. Zero-step output is the matched inference control. No validation observations enter gradients. + +## E25 learned recency 12000 with aligned templates, full validation +- Checkpoint SHA-256: `8ccb6870a025e1097331a3a288b1183741a413f3460fbf3352d0c589c6a4394c`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.355628; relative MASE 0.765858; relative WQL 0.542156. +- term skill: long=0.3899, medium=0.4001, short=0.3239. +- domain skill: Econ/Fin=0.1162, Energy=0.1854, Healthcare=0.4030, Nature=0.4169, Sales=0.3571, Transport=0.4622, Web/CloudOps=0.4930. +- frequency skill: A=0.2912, D=0.3393, H=0.3859, M=0.1107, Q=0.1840, S=0.4221, T=0.3964, W=0.1942. +- variates skill: multivariate=0.3851, univariate=0.3311. +- Outcome: Published. Full validation 0.355628 versus matched E22-12000 package 0.355096; earlier diagnostics 0.327844 and 0.354561 versus 0.325963 and 0.352462. No failures. Repeated relocated examples are bitwise identical, finite and monotone. This extends the recency-feature benefit to a third matched training checkpoint. + +## E25 recency12000 first earlier diagnostic +- Checkpoint SHA-256: `8ccb6870a025e1097331a3a288b1183741a413f3460fbf3352d0c589c6a4394c`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 21.109707355499268 seconds. +- Overall skill 0.327844; relative MASE 0.806911; relative WQL 0.559904. +- term skill: long=0.3932, medium=0.3529, short=0.2909. +- domain skill: Econ/Fin=0.1636, Energy=0.2224, Healthcare=0.3816, Nature=0.3533, Sales=0.3955, Transport=0.3666, Web/CloudOps=0.4404. +- frequency skill: A=0.3134, D=0.3502, H=0.3567, M=0.1636, Q=0.2250, S=0.3402, T=0.3276, W=0.2656. +- variates skill: multivariate=0.3437, univariate=0.3150. +- Outcome: Improves the matched control. + +## E25 recency12000 second earlier diagnostic +- Checkpoint SHA-256: `8ccb6870a025e1097331a3a288b1183741a413f3460fbf3352d0c589c6a4394c`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 20.91800332069397 seconds. +- Overall skill 0.354561; relative MASE 0.773267; relative WQL 0.538742. +- term skill: long=0.3642, medium=0.3828, short=0.3397. +- domain skill: Econ/Fin=0.1095, Energy=0.2259, Healthcare=0.3738, Nature=0.4621, Sales=0.5594, Transport=0.4168, Web/CloudOps=0.4281. +- frequency skill: A=0.3385, D=0.4319, H=0.3875, M=0.1660, Q=0.1478, S=0.2841, T=0.3480, W=0.2461. +- variates skill: multivariate=0.3588, univariate=0.3511. +- Outcome: Improves the matched control. + +Measured continuation compute (elapsed training-process seconds, shared single H100; these are not additive dedicated GPU-seconds): +- depth36_control, step 1000: 124.8 seconds. +- depth36_control, step 3000: 365.5 seconds. +- depth36_control, step 6000: 869.5 seconds. +- depth36_control, step 12000: 2211.3 seconds. +- recency_features, step 1000: 168.9 seconds. +- recency_features, step 3000: 510.3 seconds. +- recency_features, step 6000: 1158.7 seconds. +- recency_features, step 12000: 2481.6 seconds. +- strong_loss, step 1000: 224.1 seconds. +- strong_loss, step 3000: 672.8 seconds. +- strong_loss, step 6000: 1375.1 seconds. +- amplitude_synth, step 1000: 227.1 seconds. +- amplitude_synth, step 3000: 678.7 seconds. +- joint_rehearsal, step 1000: 172.6 seconds. + +## E35: explicit local trend increments in future queries (prepared) +Hypothesis: the original damped trend feature clips normalized slopes at 0.03 per step, suppressing trends in short annual and quarterly contexts. Add two zero-initialized query features from differences of adjacent 4-point and 16-point means, extrapolated to each future step and softly capped at 3 context standard deviations. Each mean needs at least half its observations and at least two finite values. This is a fixed context calculation, not a fitted per-instance model. A separate 16,384-parameter query projection preserves the existing recency projection and all pretrained-in-this-workspace tensors. Planned E17 initialization, seed 59, batch 256 and 24,000-step schedule match E25 exactly; no new synthetic generator. Training not yet started. + +E28 stopped after the 12000-step comparison. Screen 0.355930 is below matched control 0.356664; earlier checkpoints gave small inconsistent differences. Training through 12000 took 2731.8 process seconds on the shared H100. Checkpoints are retained, but the stronger seasonal-error weighting is not adopted. + +## E28 stronger seasonal loss 12000-step checkpoint +- Checkpoint SHA-256: `9f67f75960a568c9bc42fdb2ec99c8852bb5136ae869b7f63ac3fd6aeb359aab`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 21.34673237800598 seconds. +- Overall skill 0.355930; relative MASE 0.766619; relative WQL 0.541111. +- term skill: long=0.3886, medium=0.4019, short=0.3241. +- domain skill: Econ/Fin=0.1123, Energy=0.1843, Healthcare=0.4078, Nature=0.4143, Sales=0.3492, Transport=0.4532, Web/CloudOps=0.5040. +- frequency skill: A=0.3801, D=0.3350, H=0.3784, M=0.1213, Q=0.1929, S=0.4399, T=0.3989, W=0.1948. +- variates skill: multivariate=0.3880, univariate=0.3292. +- Outcome: Below matched control; stop this branch after three comparisons without a consistent advantage. + +E35 training started with the planned matched seed 59, batch 256, learning rate 8e-5 and 24000-step schedule, replacing E28 GPU work. A synthetic forward check verified bitwise equality at zero projection, and backward propagation produced finite nonzero gradients for the new trend projection. No additional training source or generator is introduced. + +## E31 synthetic amplitude 3000-step screen +- Checkpoint SHA-256: `6f3e68f1b70e9cde6872473dc4d834c16195e72656ba974eb39d48413a10af63`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 22.430498361587524 seconds. +- Overall skill 0.352625; relative MASE 0.768870; relative WQL 0.545079. +- term skill: long=0.3854, medium=0.3995, short=0.3204. +- domain skill: Econ/Fin=0.1023, Energy=0.1772, Healthcare=0.4136, Nature=0.4097, Sales=0.3467, Transport=0.4530, Web/CloudOps=0.5025. +- frequency skill: A=0.3691, D=0.3356, H=0.3748, M=0.0875, Q=0.1887, S=0.4366, T=0.3965, W=0.1978. +- variates skill: multivariate=0.3840, univariate=0.3265. +- Outcome: Improves matched E25-3000 screen from 0.351702 to 0.352625. First earlier diagnostic improves 0.321665 to 0.322014. Keep training to assess persistence. + +## E34 joint rehearsal 1000-step screen +- Checkpoint SHA-256: `394f2003a6c00cdcb0f2b944d1e9cc8ae4f7aca9e513bf46dbb1f8a2489c8670`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.026655912399292 seconds. +- Overall skill 0.360583; relative MASE 0.762757; relative WQL 0.536022. +- term skill: long=0.3975, medium=0.4014, short=0.3292. +- domain skill: Econ/Fin=0.1394, Energy=0.1926, Healthcare=0.3956, Nature=0.4177, Sales=0.3466, Transport=0.4620, Web/CloudOps=0.5034. +- frequency skill: A=0.3785, D=0.3382, H=0.3903, M=0.0963, Q=0.1994, S=0.4210, T=0.4059, W=0.1960. +- variates skill: multivariate=0.3895, univariate=0.3366. +- Outcome: Improves matched zero-step control on main screen and both earlier diagnostics. Later checkpoints are needed before selecting a package. + +## E34 joint rehearsal 3000-step screen +- Checkpoint SHA-256: `6dd1560fb4d63eae0fa8d414252b55329371e397cee44dcff4c656ff3e2f3416`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 22.9136745929718 seconds. +- Overall skill 0.358556; relative MASE 0.764675; relative WQL 0.538072. +- term skill: long=0.3976, medium=0.4016, short=0.3253. +- domain skill: Econ/Fin=0.1364, Energy=0.1912, Healthcare=0.3737, Nature=0.4189, Sales=0.3465, Transport=0.4616, Web/CloudOps=0.5016. +- frequency skill: A=0.3793, D=0.3315, H=0.3904, M=0.0787, Q=0.2012, S=0.4202, T=0.4046, W=0.1966. +- variates skill: multivariate=0.3887, univariate=0.3335. +- Outcome: Screen falls below the zero-step control after the earlier gain; do not publish this checkpoint. Continue to the planned 6000-step endpoint to assess the lower learning rate. + +## E36: equal-weight control and recency ensemble +Hypothesis: averaging two strong continuations reduces differences across validation cutoffs. Compare a fixed 50/50 quantile average of E25 recency12000 and E22 control18000, each forecasting every instance with the aligned seasonal rule. No training or new data; no dataset-specific selection. Screen and both earlier diagnostics are computed from cached forecasts before constructing a runtime package. + +## E37: fixed zero-mass projection +Hypothesis: small positive forecasts on histories with an observed mass at exactly zero cause disproportionate median error. Diagnostic candidates snap nonnegative quantiles below 0, 0.001, 0.005 or 0.02 context standard deviations to zero, only when the recent4096 history is nonnegative and contains at least4 zeros comprising at least10% of observed points. All thresholds are fixed globally; no per-instance fitting. Test the same four candidates at all three validation cutoffs using E25 recency12000 aligned outputs. No training and no extra data. + +E37 initial sweep: threshold0.02 improved screen 0.359868→0.360509, first earlier0.327844→0.328180 and second earlier0.354561→0.354943. Smaller nonzero thresholds gave smaller gains. Build and fully evaluate the0.02 runtime. A separate follow-up will compare0.05 and0.1 to assess whether the original upper endpoint truncated the useful range; no additional fitted parameters. + +## E38: broader packed corpus for the 36.8M recency model (prepared) +Hypothesis: the earlier negative corpus-expansion result at6.7M parameters may not hold for the larger, more-trained model. Compare packed_sample (0.959B points) with packed_expanded (5.653B points), initializing both from E25 recency12000. Keep source mixture weights calculated from packed_sample in both arms, isolating broader series and crop coverage from source-reweighting. Seed79, batch256, learning rate5e-5, 12000-step schedule, saves every3000, same architecture/loss/window mixture/synthetic generator. Each arm uses two Torch CPU threads. Training will start after current jobs release GPU capacity. No new corpus directories or generators. + +E37 wider sweep: thresholds0.02/0.05/0.1 gave screen0.360509/0.362121/0.364736, earlier1 0.328180/0.328643/0.329276, earlier2 0.354943/0.355475/0.356263. All three improve with the larger threshold. A final bracket at0.1/0.2/0.4/0.8 will locate an interior useful range before full runtime selection. + +## E39: bounded quantiles during pretraining (prepared) +Hypothesis: the current continuous output head incurs small positive errors on genuinely zero-valued futures. Extend the existing nonnegativity heuristic symmetrically inside the training forward pass: histories entirely nonnegative clamp normalized output quantiles at standardized zero; entirely nonpositive histories clamp above at zero. This lets pinball loss learn exact boundary probability mass through negative latent quantiles, rather than requiring exact equality of a continuous prediction. No additional model parameters. Match E38 packed_sample control: own E25 recency12000 initialization, seed79, batch256, LR5e-5, 12000 steps, original source mixture and generator. Training not yet started; this is separate from the fixed E37 inference projection. + +E37 final bracket selected threshold0.4: screen/earlier1/earlier2 =0.370559/0.330696/0.357884, versus parent0.359868/0.327844/0.354561. Threshold0.8 regresses to0.364344/0.327637/0.350745, providing an interior optimum common to all three cutoffs. No finer sweep is planned. Assemble and fully evaluate threshold0.4 before publication. + +E36 equal-weight blend gives screen0.361191, earlier1 0.328179, earlier2 0.354067. The main screen remains below control18000 alone (0.361735), and second earlier remains below recency12000 (0.354561). Not selected; no ensemble runtime is published. + +E38 packed_sample control started with the planned seed79 and schedule after E34 completed. A sampler check confirmed bitwise equality with the original sampler and identical source probabilities for both packed corpora. The expanded arm remains prepared, awaiting GPU capacity. + +## E22 control18000 full validation with aligned seasonal rule +- Checkpoint SHA-256: `b7bbb7473a317145235c133492a0d743a90a01ff252577a4c8a4651db008a138`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.357537; relative MASE 0.764724; relative WQL 0.539749. +- term skill: long=0.3898, medium=0.4009, short=0.3270. +- domain skill: Econ/Fin=0.1117, Energy=0.1855, Healthcare=0.4146, Nature=0.4204, Sales=0.3566, Transport=0.4642, Web/CloudOps=0.4949. +- frequency skill: A=0.2833, D=0.3419, H=0.3872, M=0.1236, Q=0.1877, S=0.4206, T=0.3976, W=0.1997. +- variates skill: multivariate=0.3862, univariate=0.3338. +- Outcome: Improves full validation to0.357537; first and second earlier0.327746/0.352885 remain slightly below published recency12000. Candidate retained while matched recency18000 is evaluated. + +## E31 amplitude synthetic 6000-step screen +- Checkpoint SHA-256: `7fe2746b237fb2699c2d8c812595666df0888cde656498043e01847bb552c783`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 21.376917362213135 seconds. +- Overall skill 0.355543; relative MASE 0.766576; relative WQL 0.541792. +- term skill: long=0.3869, medium=0.3997, short=0.3251. +- domain skill: Econ/Fin=0.1054, Energy=0.1826, Healthcare=0.4173, Nature=0.4166, Sales=0.3471, Transport=0.4535, Web/CloudOps=0.5020. +- frequency skill: A=0.3700, D=0.3444, H=0.3777, M=0.0986, Q=0.1941, S=0.4367, T=0.3980, W=0.1929. +- variates skill: multivariate=0.3869, univariate=0.3294. +- Outcome: Screen0.355543 improves matched E25-6000 0.352851. First earlier0.324002 is effectively tied with matched0.324008; second earlier0.349572 improves matched0.349098. Continue to12000. + +## E34 joint rehearsal 6000-step screen +- Checkpoint SHA-256: `44aa5f702a58845a427ad76818631e808362b7dc236a3648232db47d621db219`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 21.278470993041992 seconds. +- Overall skill 0.360025; relative MASE 0.763498; relative WQL 0.536437. +- term skill: long=0.3986, medium=0.4027, short=0.3272. +- domain skill: Econ/Fin=0.1375, Energy=0.1934, Healthcare=0.3748, Nature=0.4209, Sales=0.3465, Transport=0.4619, Web/CloudOps=0.5031. +- frequency skill: A=0.3720, D=0.3320, H=0.3916, M=0.0873, Q=0.1998, S=0.4184, T=0.4071, W=0.1973. +- variates skill: multivariate=0.3917, univariate=0.3337. +- Outcome: Final screen0.360025 improves parent0.359242 but is below the1000-step peak0.360583. Evaluate both earlier cutoffs; do not publish solely from the small screen gain. + +E34 completed6000 steps in1049.5 training-process seconds. Earlier1/earlier2 =0.326344/0.350746: first improves parent0.325963, second regresses from0.352462. The1000-step checkpoint remains the better joint candidate, but neither is selected over the stronger recency model. All weights are archived. + +## E37 threshold0.02 full package validation +- Checkpoint SHA-256: `8ccb6870a025e1097331a3a288b1183741a413f3460fbf3352d0c589c6a4394c`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.356254; relative MASE 0.764978; relative WQL 0.541726. +- term skill: long=0.3904, medium=0.4005, short=0.3246. +- domain skill: Econ/Fin=0.1162, Energy=0.1871, Healthcare=0.4030, Nature=0.4175, Sales=0.3571, Transport=0.4622, Web/CloudOps=0.4933. +- frequency skill: A=0.2912, D=0.3393, H=0.3863, M=0.1108, Q=0.1840, S=0.4221, T=0.3979, W=0.1942. +- variates skill: multivariate=0.3855, univariate=0.3320. +- Outcome: Full skill0.356254 improves parent0.355628 with zero failed configurations. Repeated relocated examples are bitwise identical, finite and monotone. Temporarily published while the larger, consistently better threshold0.4 completes full validation. + +## E40: zero-mass projection with empirical phase probability +E37 helps solar and several zero-heavy channels but slightly hurts some sales and cloud series. Hypothesis: a quantile should be snapped only when the observed zero probability supports its level. Keep threshold0.4 fixed; compare unrestricted E37, global observed zero fraction, and phase-specific zero frequencies from the last4 or8 primary seasonal cycles. For phase estimates with at least3 observations use (zero_count+0.5)/(count+1), otherwise the global fraction. Only levels at or below that zero probability are eligible. All rules are fixed context formulas, applied independently per variate. Compare cached E25 recency12000 forecasts on all three cutoffs; no training. + +E37 final selection: use the18,000-step recency checkpoint with threshold0.4. Full validation0.370171 exceeds12,000-step+0.4 at0.366390; earlier1 improves0.330696→0.332400, while earlier2 decreases0.357884→0.356697. The three-cutoff mean improves, and all three exceed the previously published12,000-step+0.02 package. Prefer the newer checkpoint for its full-validation and first-earlier gains; retain the second-earlier regression as a limitation. Both candidate packages passed repeated relocated example inference, with exact equality, finite outputs and monotone quantiles. +- Measured depth36_control step18000: 3529.7 elapsed training-process seconds on the shared single H100. +- Measured recency_features step18000: 4008.8 elapsed training-process seconds on the shared single H100. +- Measured amplitude_synth step6000: 1498.1 elapsed training-process seconds on the shared single H100. +- Measured joint_rehearsal step6000: 1049.5 elapsed training-process seconds on the shared single H100. + +## E37 threshold0.4 on recency12000 full validation +- Checkpoint SHA-256: `8ccb6870a025e1097331a3a288b1183741a413f3460fbf3352d0c589c6a4394c`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.366390; relative MASE 0.754640; relative WQL 0.531990. +- term skill: long=0.3917, medium=0.4037, short=0.3414. +- domain skill: Econ/Fin=0.1162, Energy=0.2258, Healthcare=0.4030, Nature=0.4203, Sales=0.3559, Transport=0.4622, Web/CloudOps=0.4911. +- frequency skill: A=0.2912, D=0.3374, H=0.3884, M=0.1159, Q=0.1840, S=0.4221, T=0.4262, W=0.1943. +- variates skill: multivariate=0.3853, univariate=0.3509. +- Outcome: Full0.366390, earlier1 0.330696, earlier2 0.357884. Clear improvement over the same checkpoint without zero projection. Superseded by the18000-step candidate on full validation and average across cutoffs. + +## E25 plus E37 recency18000 threshold0.4 full validation +- Checkpoint SHA-256: `f6d2c41a690159a5b9c2034be45718c408a30b0d34d9607c9a768b9926781bbd`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.370171; relative MASE 0.750532; relative WQL 0.528537. +- term skill: long=0.3932, medium=0.4057, short=0.3469. +- domain skill: Econ/Fin=0.1099, Energy=0.2275, Healthcare=0.4340, Nature=0.4253, Sales=0.3541, Transport=0.4653, Web/CloudOps=0.4932. +- frequency skill: A=0.2819, D=0.3468, H=0.3906, M=0.1220, Q=0.1866, S=0.4218, T=0.4285, W=0.2054. +- variates skill: multivariate=0.3878, univariate=0.3558. +- Outcome: Published atomically. Full skill0.370171; earlier1 0.332400 and earlier2 0.356697. All97 configurations and151170 instances scored, zero failures. Actual package repeated examples are bitwise deterministic, finite and monotone; full inference118.1 seconds under concurrent training. + +## Published recency18000 zero0.4 first earlier diagnostic +- Checkpoint SHA-256: `f6d2c41a690159a5b9c2034be45718c408a30b0d34d9607c9a768b9926781bbd`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 24.86830711364746 seconds. +- Overall skill 0.332400; relative MASE 0.801955; relative WQL 0.555755. +- term skill: long=0.3980, medium=0.3574, short=0.2953. +- domain skill: Econ/Fin=0.1526, Energy=0.2268, Healthcare=0.3995, Nature=0.3561, Sales=0.3986, Transport=0.3699, Web/CloudOps=0.4472. +- frequency skill: A=0.2996, D=0.3516, H=0.3643, M=0.1721, Q=0.2330, S=0.3397, T=0.3325, W=0.2660. +- variates skill: multivariate=0.3492, univariate=0.3187. +- Outcome: Improves the previous published package and the12000-step zero0.4 candidate. + +## Published recency18000 zero0.4 second earlier diagnostic +- Checkpoint SHA-256: `f6d2c41a690159a5b9c2034be45718c408a30b0d34d9607c9a768b9926781bbd`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 24.40335988998413 seconds. +- Overall skill 0.356697; relative MASE 0.773731; relative WQL 0.534862. +- term skill: long=0.3657, medium=0.3874, short=0.3411. +- domain skill: Econ/Fin=0.1045, Energy=0.2331, Healthcare=0.3610, Nature=0.4656, Sales=0.5516, Transport=0.4179, Web/CloudOps=0.4303. +- frequency skill: A=0.3474, D=0.4275, H=0.3891, M=0.1599, Q=0.1548, S=0.2798, T=0.3574, W=0.2434. +- variates skill: multivariate=0.3611, univariate=0.3531. +- Outcome: Improves the previous published package; slightly below the12000-step zero0.4 candidate. + +## E37 complete diagnostic sweep receipts +All use the own recency12000 checkpoint SHA-256 `8ccb6870a025e1097331a3a288b1183741a413f3460fbf3352d0c589c6a4394c`; no training, fixed inference seed0. Compute below is CPU diagnostic elapsed time, not GPU training time. + +zero_mass, screen: 4.03 seconds. +- Setting 0.0: skill 0.359868; term short=0.3284, medium=0.4016, long=0.3960; domain Econ/Fin=0.1374, Energy=0.1931, Healthcare=0.3970, Nature=0.4170, Sales=0.3479, Transport=0.4621, Web/CloudOps=0.5005. +- Setting 0.001: skill 0.359874; term short=0.3284, medium=0.4016, long=0.3960; domain Econ/Fin=0.1374, Energy=0.1931, Healthcare=0.3970, Nature=0.4170, Sales=0.3479, Transport=0.4621, Web/CloudOps=0.5005. +- Setting 0.005: skill 0.359953; term short=0.3285, medium=0.4017, long=0.3961; domain Econ/Fin=0.1374, Energy=0.1933, Healthcare=0.3970, Nature=0.4171, Sales=0.3479, Transport=0.4621, Web/CloudOps=0.5006. +- Setting 0.02: skill 0.360509; term short=0.3292, medium=0.4020, long=0.3966; domain Econ/Fin=0.1374, Energy=0.1948, Healthcare=0.3970, Nature=0.4176, Sales=0.3480, Transport=0.4621, Web/CloudOps=0.5008. + +zero_mass, backcast: 3.65 seconds. +- Setting 0.0: skill 0.327844; term short=0.2909, medium=0.3529, long=0.3932; domain Econ/Fin=0.1636, Energy=0.2224, Healthcare=0.3816, Nature=0.3533, Sales=0.3955, Transport=0.3666, Web/CloudOps=0.4404. +- Setting 0.001: skill 0.327849; term short=0.2909, medium=0.3529, long=0.3932; domain Econ/Fin=0.1636, Energy=0.2224, Healthcare=0.3816, Nature=0.3533, Sales=0.3955, Transport=0.3666, Web/CloudOps=0.4404. +- Setting 0.005: skill 0.327890; term short=0.2909, medium=0.3529, long=0.3933; domain Econ/Fin=0.1636, Energy=0.2225, Healthcare=0.3816, Nature=0.3534, Sales=0.3955, Transport=0.3666, Web/CloudOps=0.4404. +- Setting 0.02: skill 0.328180; term short=0.2912, medium=0.3532, long=0.3937; domain Econ/Fin=0.1636, Energy=0.2229, Healthcare=0.3816, Nature=0.3537, Sales=0.3955, Transport=0.3666, Web/CloudOps=0.4409. + +zero_mass, backcast2: 3.62 seconds. +- Setting 0.0: skill 0.354561; term short=0.3397, medium=0.3828, long=0.3642; domain Econ/Fin=0.1095, Energy=0.2259, Healthcare=0.3738, Nature=0.4621, Sales=0.5594, Transport=0.4168, Web/CloudOps=0.4281. +- Setting 0.001: skill 0.354567; term short=0.3397, medium=0.3828, long=0.3642; domain Econ/Fin=0.1095, Energy=0.2259, Healthcare=0.3738, Nature=0.4621, Sales=0.5594, Transport=0.4168, Web/CloudOps=0.4282. +- Setting 0.005: skill 0.354631; term short=0.3398, medium=0.3829, long=0.3643; domain Econ/Fin=0.1095, Energy=0.2260, Healthcare=0.3738, Nature=0.4622, Sales=0.5594, Transport=0.4168, Web/CloudOps=0.4282. +- Setting 0.02: skill 0.354943; term short=0.3400, medium=0.3834, long=0.3646; domain Econ/Fin=0.1095, Energy=0.2266, Healthcare=0.3738, Nature=0.4627, Sales=0.5594, Transport=0.4168, Web/CloudOps=0.4283. + +zero_mass_wide, screen: 3.91 seconds. +- Setting 0.0: skill 0.359868; term short=0.3284, medium=0.4016, long=0.3960; domain Econ/Fin=0.1374, Energy=0.1931, Healthcare=0.3970, Nature=0.4170, Sales=0.3479, Transport=0.4621, Web/CloudOps=0.5005. +- Setting 0.02: skill 0.360509; term short=0.3292, medium=0.4020, long=0.3966; domain Econ/Fin=0.1374, Energy=0.1948, Healthcare=0.3970, Nature=0.4176, Sales=0.3480, Transport=0.4621, Web/CloudOps=0.5008. +- Setting 0.05: skill 0.362121; term short=0.3316, medium=0.4026, long=0.3972; domain Econ/Fin=0.1374, Energy=0.1998, Healthcare=0.3970, Nature=0.4186, Sales=0.3483, Transport=0.4621, Web/CloudOps=0.5012. +- Setting 0.1: skill 0.364736; term short=0.3357, medium=0.4036, long=0.3981; domain Econ/Fin=0.1374, Energy=0.2086, Healthcare=0.3970, Nature=0.4195, Sales=0.3487, Transport=0.4621, Web/CloudOps=0.5017. + +zero_mass_wide, backcast: 3.55 seconds. +- Setting 0.0: skill 0.327844; term short=0.2909, medium=0.3529, long=0.3932; domain Econ/Fin=0.1636, Energy=0.2224, Healthcare=0.3816, Nature=0.3533, Sales=0.3955, Transport=0.3666, Web/CloudOps=0.4404. +- Setting 0.02: skill 0.328180; term short=0.2912, medium=0.3532, long=0.3937; domain Econ/Fin=0.1636, Energy=0.2229, Healthcare=0.3816, Nature=0.3537, Sales=0.3955, Transport=0.3666, Web/CloudOps=0.4409. +- Setting 0.05: skill 0.328643; term short=0.2914, medium=0.3540, long=0.3942; domain Econ/Fin=0.1636, Energy=0.2235, Healthcare=0.3816, Nature=0.3546, Sales=0.3957, Transport=0.3666, Web/CloudOps=0.4415. +- Setting 0.1: skill 0.329276; term short=0.2917, medium=0.3550, long=0.3953; domain Econ/Fin=0.1636, Energy=0.2243, Healthcare=0.3816, Nature=0.3553, Sales=0.3959, Transport=0.3666, Web/CloudOps=0.4426. + +zero_mass_wide, backcast2: 3.53 seconds. +- Setting 0.0: skill 0.354561; term short=0.3397, medium=0.3828, long=0.3642; domain Econ/Fin=0.1095, Energy=0.2259, Healthcare=0.3738, Nature=0.4621, Sales=0.5594, Transport=0.4168, Web/CloudOps=0.4281. +- Setting 0.02: skill 0.354943; term short=0.3400, medium=0.3834, long=0.3646; domain Econ/Fin=0.1095, Energy=0.2266, Healthcare=0.3738, Nature=0.4627, Sales=0.5594, Transport=0.4168, Web/CloudOps=0.4283. +- Setting 0.05: skill 0.355475; term short=0.3406, medium=0.3840, long=0.3651; domain Econ/Fin=0.1095, Energy=0.2278, Healthcare=0.3738, Nature=0.4637, Sales=0.5595, Transport=0.4168, Web/CloudOps=0.4284. +- Setting 0.1: skill 0.356263; term short=0.3413, medium=0.3849, long=0.3660; domain Econ/Fin=0.1095, Energy=0.2295, Healthcare=0.3738, Nature=0.4650, Sales=0.5595, Transport=0.4168, Web/CloudOps=0.4287. + +zero_mass_range, screen: 3.63 seconds. +- Setting 0.1: skill 0.364736; term short=0.3357, medium=0.4036, long=0.3981; domain Econ/Fin=0.1374, Energy=0.2086, Healthcare=0.3970, Nature=0.4195, Sales=0.3487, Transport=0.4621, Web/CloudOps=0.5017. +- Setting 0.2: skill 0.368575; term short=0.3420, medium=0.4046, long=0.3988; domain Econ/Fin=0.1374, Energy=0.2225, Healthcare=0.3970, Nature=0.4210, Sales=0.3475, Transport=0.4621, Web/CloudOps=0.5015. +- Setting 0.4: skill 0.370559; term short=0.3458, medium=0.4052, long=0.3979; domain Econ/Fin=0.1374, Energy=0.2332, Healthcare=0.3970, Nature=0.4205, Sales=0.3463, Transport=0.4621, Web/CloudOps=0.4986. +- Setting 0.8: skill 0.364344; term short=0.3385, medium=0.4008, long=0.3925; domain Econ/Fin=0.1374, Energy=0.2220, Healthcare=0.3970, Nature=0.4198, Sales=0.3444, Transport=0.4621, Web/CloudOps=0.4869. + +zero_mass_range, backcast: 3.50 seconds. +- Setting 0.1: skill 0.329276; term short=0.2917, medium=0.3550, long=0.3953; domain Econ/Fin=0.1636, Energy=0.2243, Healthcare=0.3816, Nature=0.3553, Sales=0.3959, Transport=0.3666, Web/CloudOps=0.4426. +- Setting 0.2: skill 0.330173; term short=0.2923, medium=0.3563, long=0.3966; domain Econ/Fin=0.1636, Energy=0.2253, Healthcare=0.3816, Nature=0.3560, Sales=0.3970, Transport=0.3666, Web/CloudOps=0.4444. +- Setting 0.4: skill 0.330696; term short=0.2928, medium=0.3550, long=0.3988; domain Econ/Fin=0.1636, Energy=0.2247, Healthcare=0.3816, Nature=0.3559, Sales=0.3972, Transport=0.3666, Web/CloudOps=0.4472. +- Setting 0.8: skill 0.327637; term short=0.2916, medium=0.3471, long=0.3961; domain Econ/Fin=0.1636, Energy=0.2180, Healthcare=0.3815, Nature=0.3525, Sales=0.3939, Transport=0.3666, Web/CloudOps=0.4454. + +zero_mass_range, backcast2: 3.39 seconds. +- Setting 0.1: skill 0.356263; term short=0.3413, medium=0.3849, long=0.3660; domain Econ/Fin=0.1095, Energy=0.2295, Healthcare=0.3738, Nature=0.4650, Sales=0.5595, Transport=0.4168, Web/CloudOps=0.4287. +- Setting 0.2: skill 0.357389; term short=0.3423, medium=0.3862, long=0.3671; domain Econ/Fin=0.1095, Energy=0.2319, Healthcare=0.3738, Nature=0.4665, Sales=0.5592, Transport=0.4168, Web/CloudOps=0.4293. +- Setting 0.4: skill 0.357884; term short=0.3425, medium=0.3883, long=0.3665; domain Econ/Fin=0.1095, Energy=0.2327, Healthcare=0.3738, Nature=0.4661, Sales=0.5573, Transport=0.4168, Web/CloudOps=0.4312. +- Setting 0.8: skill 0.350745; term short=0.3358, medium=0.3808, long=0.3588; domain Econ/Fin=0.1095, Energy=0.2213, Healthcare=0.3737, Nature=0.4523, Sales=0.5499, Transport=0.4168, Web/CloudOps=0.4272. + +zero_phase, screen: 4.24 seconds. +- Setting None: skill 0.370559; term short=0.3458, medium=0.4052, long=0.3979; domain Econ/Fin=0.1374, Energy=0.2332, Healthcare=0.3970, Nature=0.4205, Sales=0.3463, Transport=0.4621, Web/CloudOps=0.4986. +- Setting 0: skill 0.367375; term short=0.3412, medium=0.4029, long=0.3972; domain Econ/Fin=0.1374, Energy=0.2196, Healthcare=0.3970, Nature=0.4183, Sales=0.3529, Transport=0.4621, Web/CloudOps=0.5008. +- Setting 4: skill 0.369637; term short=0.3443, medium=0.4040, long=0.3986; domain Econ/Fin=0.1374, Energy=0.2277, Healthcare=0.3970, Nature=0.4202, Sales=0.3515, Transport=0.4621, Web/CloudOps=0.5001. +- Setting 8: skill 0.369822; term short=0.3448, medium=0.4037, long=0.3986; domain Econ/Fin=0.1374, Energy=0.2278, Healthcare=0.3970, Nature=0.4202, Sales=0.3518, Transport=0.4621, Web/CloudOps=0.5007. + +zero_phase, backcast: 4.22 seconds. +- Setting None: skill 0.330696; term short=0.2928, medium=0.3550, long=0.3988; domain Econ/Fin=0.1636, Energy=0.2247, Healthcare=0.3816, Nature=0.3559, Sales=0.3972, Transport=0.3666, Web/CloudOps=0.4472. +- Setting 0: skill 0.328679; term short=0.2917, medium=0.3538, long=0.3940; domain Econ/Fin=0.1636, Energy=0.2231, Healthcare=0.3816, Nature=0.3547, Sales=0.4001, Transport=0.3666, Web/CloudOps=0.4412. +- Setting 4: skill 0.329503; term short=0.2920, medium=0.3549, long=0.3957; domain Econ/Fin=0.1636, Energy=0.2254, Healthcare=0.3816, Nature=0.3555, Sales=0.3995, Transport=0.3666, Web/CloudOps=0.4415. +- Setting 8: skill 0.329633; term short=0.2921, medium=0.3549, long=0.3960; domain Econ/Fin=0.1636, Energy=0.2252, Healthcare=0.3816, Nature=0.3555, Sales=0.4003, Transport=0.3666, Web/CloudOps=0.4420. + +zero_phase, backcast2: 3.98 seconds. +- Setting None: skill 0.357884; term short=0.3425, medium=0.3883, long=0.3665; domain Econ/Fin=0.1095, Energy=0.2327, Healthcare=0.3738, Nature=0.4661, Sales=0.5573, Transport=0.4168, Web/CloudOps=0.4312. +- Setting 0: skill 0.355941; term short=0.3416, medium=0.3833, long=0.3653; domain Econ/Fin=0.1095, Energy=0.2288, Healthcare=0.3738, Nature=0.4641, Sales=0.5605, Transport=0.4168, Web/CloudOps=0.4286. +- Setting 4: skill 0.357313; term short=0.3424, medium=0.3856, long=0.3670; domain Econ/Fin=0.1095, Energy=0.2321, Healthcare=0.3738, Nature=0.4661, Sales=0.5605, Transport=0.4168, Web/CloudOps=0.4289. +- Setting 8: skill 0.357230; term short=0.3422, medium=0.3858, long=0.3672; domain Econ/Fin=0.1095, Energy=0.2314, Healthcare=0.3738, Nature=0.4664, Sales=0.5608, Transport=0.4168, Web/CloudOps=0.4291. + +E40 outcome: unrestricted E37 threshold0.4 beats all global/phase-probability guards on every cutoff. Phase4 gives0.369637/0.329503/0.357313; phase8 gives0.369822/0.329633/0.357230; unrestricted gives0.370559/0.330696/0.357884. Do not add the probability guard. + +E36 component checkpoint hashes: recency12000 `8ccb6870a025e1097331a3a288b1183741a413f3460fbf3352d0c589c6a4394c`; control18000 `b7bbb7473a317145235c133492a0d743a90a01ff252577a4c8a4651db008a138`. These were cached diagnostic blends only, without additional training. + +## E41: learned zero-probability classifier with a frozen backbone +Hypothesis: a classifier trained on allowed windows can make the zero projection conditional on future zero probability more accurately than the empirical guards rejected in E40. Freeze E25 recency18000 and train only a small MLP on decoder representations, global zero fraction, two four-cycle phase zero frequencies and absolute normalized median forecast. The classifier receives BCE loss for exact-zero futures only on sign-homogeneous contexts containing at least4 zeros and10% zeros. At inference, average probabilities from both sign orientations and allow the existing threshold0.4 projection only for quantile levels at or below that probability. Every instance passes through the same backbone and classifier. Bias5 initialization makes probability0.993 and preserves E37 forecasts. Own packed_sample and unchanged synthetic generator; seed83, batch128, LR2e-4, 6000-step schedule, one Torch CPU thread. This adds no external data and trains no backbone parameters. + +## E35 explicit trend inputs 3000-step screen +- Checkpoint SHA-256: `17d346dde232341672545210839ea10fc6e147d6e1d65d2457497d790fc652f6`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.317448616027832 seconds. +- Overall skill 0.351994; relative MASE 0.770114; relative WQL 0.545259. +- term skill: long=0.3848, medium=0.3991, short=0.3197. +- domain skill: Econ/Fin=0.1029, Energy=0.1770, Healthcare=0.4091, Nature=0.4082, Sales=0.3492, Transport=0.4538, Web/CloudOps=0.5011. +- frequency skill: A=0.3685, D=0.3335, H=0.3745, M=0.0901, Q=0.1894, S=0.4379, T=0.3955, W=0.1971. +- variates skill: multivariate=0.3833, univariate=0.3260. +- Outcome: Small improvement over matched E25: screen0.351994 versus0.351702, first earlier0.321829 versus0.321665. Continue to6000 to determine whether this persists. + +E35 training through3000 took850.6 elapsed process seconds on the shared H100. + +## E42: match training decoder horizons to available labels (prepared) +Hypothesis: short pretraining series supply fewer finite future labels than the requested32/128/512/1024 horizon, yet the current decoder sees every requested future token and receives that larger horizon in its metadata. During training only, infer each row's available horizon as its last finite target position, rounded up to the patch boundary; use that length for horizon metadata and mask unused future tokens as self-attention keys in every decoder layer. The label mask and loss remain unchanged. At inference the full requested horizon is used exactly as before, with no new inputs or fitting. Match E38 packed_sample control: own recency12000 initialization, seed79, batch256, LR5e-5, 12000 steps, unchanged sampler. No new model parameters or data. Planned to begin after the small frozen classifier releases memory; GPU evaluations are serialized to bound peak memory. + +E38 expanded corpus arm training started at 2026-10-22T04:02:57Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E41 initialization check: all original backbone tensors match the parent bitwise. With identical screen batches, every quantile in all97 configurations is bitwise equal to the parent; maximum difference0. The parent direct-screen score is0.374499664. The cached subset of full-validation predictions scores0.374469795 because batch composition and padding differ slightly; matched direct evaluations are used for E41 comparisons. The classifier has75,920 trainable parameters; total36,873,648. At1000/3000 steps, screen0.373402/0.374243 remains below the unchanged parent. Continue to the planned6000-step endpoint. + +E42 data diagnostic (only packed pretraining data, seed79, 640 windows per requested horizon): H32: 6.4% partial futures, mean available31.0; H128: 14.5% partial futures, mean available117.9; H512: 16.7% partial futures, mean available456.8; H1024: 19.2% partial futures, mean available886.4. CPU elapsed 0.93 seconds. A forward check verified bitwise unchanged ordinary inference and agreement within5.4e-7 between a padded masked short target and an actual short-horizon call. + +E35 first three cutoff comparisons at3000 steps: screen0.351994 versus matched0.351702; earlier1 0.321829 versus0.321665; earlier2 0.346465 versus0.346396. All gains are small; keep the6000-step comparison before drawing an architectural conclusion. + +## E22 depth36 control final24000-step screen +- Checkpoint SHA-256: `d60cdc55e693df0caf601ded61031be859ee027b0da46585586a3c6a3b5276ba`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 22.044859170913696 seconds. +- Overall skill 0.359867; relative MASE 0.762956; relative WQL 0.537082. +- term skill: long=0.3922, medium=0.4034, short=0.3293. +- domain skill: Econ/Fin=0.1126, Energy=0.1866, Healthcare=0.4038, Nature=0.4208, Sales=0.3464, Transport=0.4583, Web/CloudOps=0.5101. +- frequency skill: A=0.3718, D=0.3396, H=0.3822, M=0.0911, Q=0.1974, S=0.4422, T=0.4054, W=0.2072. +- variates skill: multivariate=0.3956, univariate=0.3299. +- Outcome: Final mean-template screen0.359867 improves its18000-step0.359224 but remains below E25 recency18000 at0.361265. Finished5206.4 elapsed training-process seconds; no new package selected. GPU capacity transferred to E38 expanded corpus arm. + +E42 partial target horizons training started at 2026-10-22T04:06:37Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E43: recheck fixed prior strengths on the stronger backbone +Hypothesis: the seasonal and continuity corrections selected on earlier models may be too strong after continued pretraining. Cache uncorrected symmetric neural forecasts from E25 recency18000, then compare all nine combinations of seasonal blend strength0/0.5/1 and continuity blend strength0/0.5/1. The candidate seasonal forecast is the existing aligned rule; partial strength interpolates it with the neural forecast. Continuity strength similarly interpolates the existing tau24 correction with its input. Keep the selected zero-mass threshold0.4 fixed and apply it last. Use the same global settings on all three cutoffs. No training or new data; inference seed0. + +## E41 frozen zero classifier3000-step screen +- Checkpoint SHA-256: `08b5cc376746c87331cee4628ec56126adf48076aa08ffd2f2bd3f74427d4d96`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 27.868639707565308 seconds. +- Overall skill 0.374243; relative MASE 0.746287; relative WQL 0.524694. +- term skill: long=0.3998, medium=0.4060, short=0.3515. +- domain skill: Econ/Fin=0.1332, Energy=0.2307, Healthcare=0.4319, Nature=0.4244, Sales=0.3502, Transport=0.4650, Web/CloudOps=0.5035. +- frequency skill: A=0.3692, D=0.3463, H=0.3950, M=0.1023, Q=0.2006, S=0.4218, T=0.4344, W=0.2127. +- variates skill: multivariate=0.3931, univariate=0.3588. +- Outcome: Screen0.374243 is below unchanged parent0.374500. Earlier1 0.331330 versus0.332400; earlier2 0.356106 versus0.356697. The classifier repairs some sales and cloud errors but gives back more solar improvement; no package change. + +## E44: training-consistent trend summary on short contexts +Code review found that the original trend basis chooses its averaging width from padded tensor width: min(128,max(4,c//4)). Training always pads to at least512, making this width128, whereas short inference batches often select smaller widths. This also makes the fixed trend summary sensitive to batch padding. Test a globally fixed128-point width at inference, preserving the exact formula used throughout training. It uses only each row's observed values; other features and all selected corrections remain unchanged. No new parameters, training or data. Compare the recency18000 checkpoint on the screen and both earlier windows before selecting a package. + +E44 first diagnostic launch failed before producing a forecast: a source-edit comment accidentally hid the adjacent recent-mean assignment. Corrected the assignment and restarted all three diagnostics; no failed output was scored or published. + +## E41 frozen zero classifier final6000-step screen +- Checkpoint SHA-256: `9dcf4fa821ca636b648447e0516258a3da7056b5e98ec944d0251c73e5ae3006`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 27.14689803123474 seconds. +- Overall skill 0.374576; relative MASE 0.746312; relative WQL 0.524117. +- term skill: long=0.3999, medium=0.4061, short=0.3520. +- domain skill: Econ/Fin=0.1332, Energy=0.2315, Healthcare=0.4319, Nature=0.4249, Sales=0.3502, Transport=0.4650, Web/CloudOps=0.5037. +- frequency skill: A=0.3692, D=0.3465, H=0.3951, M=0.1017, Q=0.2006, S=0.4218, T=0.4353, W=0.2127. +- variates skill: multivariate=0.3934, univariate=0.3592. +- Outcome: Final screen0.374576 versus unchanged parent0.374500 is nearly tied. Both earlier cutoffs regress:0.331200 versus0.332400 and0.356162 versus0.356697. Do not select this classifier; retain fixed zero projection. Training took559.8 process seconds; backbone stayed frozen. + +## E43 complete prior-strength comparison +Checkpoint SHA-256 `f6d2c41a690159a5b9c2034be45718c408a30b0d34d9607c9a768b9926781bbd`; fixed inference seed0; no training. + +screen: 10.68 CPU diagnostic seconds. +- Seasonal0.0, continuity0.0: skill0.352854; term short=0.3372, medium=0.3820, long=0.3635; domain Econ/Fin=0.0649, Energy=0.2249, Healthcare=0.3918, Nature=0.4305, Sales=0.3458, Transport=0.4676, Web/CloudOps=0.4394. +- Seasonal0.0, continuity0.5: skill0.358015; term short=0.3463, medium=0.3820, long=0.3639; domain Econ/Fin=0.1059, Energy=0.2325, Healthcare=0.4145, Nature=0.4284, Sales=0.3457, Transport=0.4662, Web/CloudOps=0.4421. +- Seasonal0.0, continuity1.0: skill0.358419; term short=0.3472, medium=0.3814, long=0.3642; domain Econ/Fin=0.1280, Energy=0.2289, Healthcare=0.4280, Nature=0.4258, Sales=0.3457, Transport=0.4637, Web/CloudOps=0.4444. +- Seasonal0.5, continuity0.0: skill0.361594; term short=0.3390, medium=0.3982, long=0.3816; domain Econ/Fin=0.0723, Energy=0.2304, Healthcare=0.3951, Nature=0.4304, Sales=0.3450, Transport=0.4683, Web/CloudOps=0.4668. +- Seasonal0.5, continuity0.5: skill0.367185; term short=0.3491, medium=0.3978, long=0.3823; domain Econ/Fin=0.1132, Energy=0.2381, Healthcare=0.4171, Nature=0.4282, Sales=0.3449, Transport=0.4670, Web/CloudOps=0.4713. +- Seasonal0.5, continuity1.0: skill0.367831; term short=0.3505, medium=0.3970, long=0.3826; domain Econ/Fin=0.1347, Energy=0.2340, Healthcare=0.4301, Nature=0.4256, Sales=0.3449, Transport=0.4647, Web/CloudOps=0.4751. +- Seasonal1.0, continuity0.0: skill0.366912; term short=0.3385, medium=0.4065, long=0.3980; domain Econ/Fin=0.0640, Energy=0.2315, Healthcare=0.3974, Nature=0.4301, Sales=0.3440, Transport=0.4682, Web/CloudOps=0.4881. +- Seasonal1.0, continuity0.5: skill0.373401; term short=0.3497, medium=0.4072, long=0.3989; domain Econ/Fin=0.1094, Energy=0.2393, Healthcare=0.4192, Nature=0.4280, Sales=0.3439, Transport=0.4672, Web/CloudOps=0.4952. +- Seasonal1.0, continuity1.0: skill0.374500; term short=0.3517, medium=0.4069, long=0.3994; domain Econ/Fin=0.1332, Energy=0.2347, Healthcare=0.4319, Nature=0.4254, Sales=0.3438, Transport=0.4650, Web/CloudOps=0.5007. + +backcast: 11.26 CPU diagnostic seconds. +- Seasonal0.0, continuity0.0: skill0.307142; term short=0.2826, medium=0.3351, long=0.3410; domain Econ/Fin=0.1076, Energy=0.2255, Healthcare=0.3430, Nature=0.3552, Sales=0.3986, Transport=0.3768, Web/CloudOps=0.3599. +- Seasonal0.0, continuity0.5: skill0.312170; term short=0.2916, medium=0.3354, long=0.3411; domain Econ/Fin=0.1400, Energy=0.2277, Healthcare=0.3844, Nature=0.3556, Sales=0.3986, Transport=0.3764, Web/CloudOps=0.3620. +- Seasonal0.0, continuity1.0: skill0.314938; term short=0.2967, medium=0.3353, long=0.3409; domain Econ/Fin=0.1539, Energy=0.2269, Healthcare=0.4209, Nature=0.3555, Sales=0.3986, Transport=0.3753, Web/CloudOps=0.3636. +- Seasonal0.5, continuity0.0: skill0.318715; term short=0.2868, medium=0.3483, long=0.3683; domain Econ/Fin=0.1210, Energy=0.2277, Healthcare=0.3359, Nature=0.3556, Sales=0.3986, Transport=0.3747, Web/CloudOps=0.4076. +- Seasonal0.5, continuity0.5: skill0.323130; term short=0.2948, medium=0.3486, long=0.3682; domain Econ/Fin=0.1519, Energy=0.2300, Healthcare=0.3781, Nature=0.3560, Sales=0.3986, Transport=0.3744, Web/CloudOps=0.4072. +- Seasonal0.5, continuity1.0: skill0.325194; term short=0.2988, medium=0.3485, long=0.3679; domain Econ/Fin=0.1645, Energy=0.2291, Healthcare=0.4163, Nature=0.3559, Sales=0.3986, Transport=0.3733, Web/CloudOps=0.4059. +- Seasonal1.0, continuity0.0: skill0.326613; term short=0.2844, medium=0.3570, long=0.3986; domain Econ/Fin=0.1011, Energy=0.2252, Healthcare=0.3156, Nature=0.3558, Sales=0.3986, Transport=0.3713, Web/CloudOps=0.4530. +- Seasonal1.0, continuity0.5: skill0.330837; term short=0.2922, medium=0.3575, long=0.3984; domain Econ/Fin=0.1366, Energy=0.2277, Healthcare=0.3596, Nature=0.3563, Sales=0.3986, Transport=0.3710, Web/CloudOps=0.4510. +- Seasonal1.0, continuity1.0: skill0.332400; term short=0.2953, medium=0.3574, long=0.3980; domain Econ/Fin=0.1526, Energy=0.2268, Healthcare=0.3995, Nature=0.3561, Sales=0.3986, Transport=0.3699, Web/CloudOps=0.4472. + +backcast2: 10.77 CPU diagnostic seconds. +- Seasonal0.0, continuity0.0: skill0.342833; term short=0.3444, medium=0.3372, long=0.3447; domain Econ/Fin=0.0850, Energy=0.2421, Healthcare=0.3909, Nature=0.4651, Sales=0.5517, Transport=0.4200, Web/CloudOps=0.3492. +- Seasonal0.0, continuity0.5: skill0.343238; term short=0.3448, medium=0.3374, long=0.3451; domain Econ/Fin=0.1046, Energy=0.2395, Healthcare=0.3778, Nature=0.4655, Sales=0.5516, Transport=0.4195, Web/CloudOps=0.3541. +- Seasonal0.0, continuity1.0: skill0.341670; term short=0.3421, medium=0.3372, long=0.3453; domain Econ/Fin=0.1096, Energy=0.2345, Healthcare=0.3641, Nature=0.4656, Sales=0.5516, Transport=0.4183, Web/CloudOps=0.3571. +- Seasonal0.5, continuity0.0: skill0.353176; term short=0.3476, medium=0.3630, long=0.3580; domain Econ/Fin=0.0889, Energy=0.2454, Healthcare=0.3896, Nature=0.4651, Sales=0.5517, Transport=0.4202, Web/CloudOps=0.3933. +- Seasonal0.5, continuity0.5: skill0.353075; term short=0.3473, medium=0.3630, long=0.3584; domain Econ/Fin=0.1076, Energy=0.2421, Healthcare=0.3764, Nature=0.4655, Sales=0.5516, Transport=0.4198, Web/CloudOps=0.3966. +- Seasonal0.5, continuity1.0: skill0.350860; term short=0.3435, medium=0.3626, long=0.3584; domain Econ/Fin=0.1107, Energy=0.2362, Healthcare=0.3627, Nature=0.4656, Sales=0.5516, Transport=0.4185, Web/CloudOps=0.3980. +- Seasonal1.0, continuity0.0: skill0.359824; term short=0.3464, medium=0.3881, long=0.3655; domain Econ/Fin=0.0796, Energy=0.2431, Healthcare=0.3878, Nature=0.4651, Sales=0.5517, Transport=0.4196, Web/CloudOps=0.4291. +- Seasonal1.0, continuity0.5: skill0.359396; term short=0.3456, medium=0.3880, long=0.3658; domain Econ/Fin=0.1008, Energy=0.2396, Healthcare=0.3747, Nature=0.4655, Sales=0.5516, Transport=0.4192, Web/CloudOps=0.4307. +- Seasonal1.0, continuity1.0: skill0.356697; term short=0.3411, medium=0.3874, long=0.3657; domain Econ/Fin=0.1045, Energy=0.2331, Healthcare=0.3610, Nature=0.4656, Sales=0.5516, Transport=0.4179, Web/CloudOps=0.4303. + +E43 outcome: retain both corrections at full strength. Seasonal full strength wins at every cutoff. Full continuity wins the main screen and first earlier cutoff; removing or weakening it helps the second earlier cutoff. Half continuity has essentially the same three-cutoff average but lowers the main screen, so the current rule is retained. This confirms that the fixed corrections still contribute after additional pretraining. + +E39 pre-launch correction: require at least one strictly positive or negative observed value before imposing the corresponding training bound. All-zero contexts otherwise satisfy both signs and would force every quantile to zero. Such contexts retain the original unconstrained training forward pass; the existing final nonnegative inference projection remains unchanged. This correction was made before E39 training started. + +E44 selected: full validation0.371267 versus previous0.370171; matched direct screen0.375386 versus0.374500; earlier1 0.333401 versus0.332400; earlier2 0.357015 versus0.356697. All improve. Full package inference took116.2 seconds under concurrent training, with97 configurations and151170 instances, zero failures and no quantile crossings. Repeated relocated examples are bitwise identical. With the actual trained model, adding left padding to histories of lengths8/16/40 changes raw forecasts by at most3.82e-6 in float32, consistent with numerical reduction differences. The averaging width is now independent of batch padding and matches all pretraining context lengths. No training or parameter changes were needed. + +## E44 fixed128 trend summary full package validation +- Checkpoint SHA-256: `f6d2c41a690159a5b9c2034be45718c408a30b0d34d9607c9a768b9926781bbd`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.371267; relative MASE 0.749824; relative WQL 0.527198. +- term skill: long=0.3932, medium=0.4057, short=0.3489. +- domain skill: Econ/Fin=0.1097, Energy=0.2283, Healthcare=0.4445, Nature=0.4270, Sales=0.3536, Transport=0.4653, Web/CloudOps=0.4932. +- frequency skill: A=0.2900, D=0.3545, H=0.3906, M=0.1144, Q=0.1842, S=0.4218, T=0.4285, W=0.2081. +- variates skill: multivariate=0.3889, univariate=0.3569. +- Outcome: Published atomically. Full0.371267, screen0.375386, first earlier0.333401, second earlier0.357015. All improve over the previous package; repeated relocated inference is bitwise deterministic and all151170 instances score successfully. + +## E44 first earlier diagnostic +- Checkpoint SHA-256: `f6d2c41a690159a5b9c2034be45718c408a30b0d34d9607c9a768b9926781bbd`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 24.190837860107422 seconds. +- Overall skill 0.333401; relative MASE 0.800857; relative WQL 0.554849. +- term skill: long=0.3980, medium=0.3574, short=0.2971. +- domain skill: Econ/Fin=0.1546, Energy=0.2269, Healthcare=0.4152, Nature=0.3561, Sales=0.3982, Transport=0.3697, Web/CloudOps=0.4472. +- frequency skill: A=0.3057, D=0.3535, H=0.3642, M=0.1858, Q=0.2322, S=0.3397, T=0.3325, W=0.2671. +- variates skill: multivariate=0.3493, univariate=0.3205. +- Outcome: Improves the preceding published package. + +## E44 second earlier diagnostic +- Checkpoint SHA-256: `f6d2c41a690159a5b9c2034be45718c408a30b0d34d9607c9a768b9926781bbd`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 24.125259160995483 seconds. +- Overall skill 0.357015; relative MASE 0.773709; relative WQL 0.534347. +- term skill: long=0.3657, medium=0.3874, short=0.3417. +- domain skill: Econ/Fin=0.1037, Energy=0.2341, Healthcare=0.3586, Nature=0.4669, Sales=0.5519, Transport=0.4175, Web/CloudOps=0.4304. +- frequency skill: A=0.3474, D=0.4297, H=0.3890, M=0.1482, Q=0.1491, S=0.2798, T=0.3574, W=0.2484. +- variates skill: multivariate=0.3619, univariate=0.3530. +- Outcome: Improves the preceding published package. + +E35 follow-up: compare both6000-step models again with the now-selected E44 fixed128 basis and E37 zero0.4 rule. The old adaptive-width basis may interact with the new learned short-trend features, so this paired diagnostic will check whether their small gain changes once training/inference formulas agree. No retraining or new thresholds. + +## E31 amplitude synthetic12000-step screen +- Checkpoint SHA-256: `88d6ebecc5342e428b803fcb60af38cafa8f94383976621f3f200abee9b2eb0e`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.205806970596313 seconds. +- Overall skill 0.358165; relative MASE 0.764973; relative WQL 0.538519. +- term skill: long=0.3902, medium=0.4022, short=0.3275. +- domain skill: Econ/Fin=0.1122, Energy=0.1848, Healthcare=0.3959, Nature=0.4185, Sales=0.3479, Transport=0.4568, Web/CloudOps=0.5094. +- frequency skill: A=0.3775, D=0.3345, H=0.3814, M=0.0974, Q=0.1993, S=0.4416, T=0.4040, W=0.1998. +- variates skill: multivariate=0.3933, univariate=0.3287. +- Outcome: Mean-template screen0.358165 remains above matched E25-12000 0.357241, after gains at3000 and6000. The advantage is smaller than at6000; continue to18000 and24000 before selecting a new package. + +## E35 explicit trend6000-step screen +- Checkpoint SHA-256: `2ad3f9148954d7b3a16365ec529767cc3a0803b4488c7a475838725497c13565`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.423240423202515 seconds. +- Overall skill 0.353152; relative MASE 0.769279; relative WQL 0.543902. +- term skill: long=0.3873, medium=0.3990, short=0.3208. +- domain skill: Econ/Fin=0.1103, Energy=0.1816, Healthcare=0.3998, Nature=0.4115, Sales=0.3496, Transport=0.4548, Web/CloudOps=0.4989. +- frequency skill: A=0.3705, D=0.3396, H=0.3769, M=0.0764, Q=0.1986, S=0.4369, T=0.3960, W=0.1933. +- variates skill: multivariate=0.3851, univariate=0.3265. +- Outcome: Mean-template screen0.353152 versus matched E25 0.352851; earlier1 0.323894 versus0.324008; earlier2 0.349429 versus0.349098. With all selected fixed rules, screen0.366300 versus matched0.366032. The effect remains small; retain checkpoints and compare at12000. + +amplitude_synth through12000: 3311.5 elapsed training-process seconds on the shared H100. + +trend_features through6000: 1795.6 elapsed training-process seconds on the shared H100. + +E39 bounded quantiles training started at 2026-10-22T04:19:57Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E25 recency final24000-step matched mean-template screen +- Checkpoint SHA-256: `1530fbb577a87ca4eb39da83d6fee9b8ee5bc924202e021e3a7b56493112f564`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 24.549001216888428 seconds. +- Overall skill 0.361808; relative MASE 0.760201; relative WQL 0.535765. +- term skill: long=0.3930, medium=0.4043, short=0.3321. +- domain skill: Econ/Fin=0.1144, Energy=0.1875, Healthcare=0.4304, Nature=0.4242, Sales=0.3432, Transport=0.4595, Web/CloudOps=0.5080. +- frequency skill: A=0.3731, D=0.3487, H=0.3832, M=0.0957, Q=0.1965, S=0.4423, T=0.4054, W=0.2079. +- variates skill: multivariate=0.3953, univariate=0.3338. +- Outcome: Final screen0.361808 versus matched E22-24000 0.359867. The learned recency features improve the matched comparison at every evaluated checkpoint. Completed5879.4 elapsed training-process seconds; full validation with selected fixed rules is pending. + +## E38 expanded corpus3000-step screen +- Checkpoint SHA-256: `13cb3d2a222cd09f622eff3fe1657c4aebe2b1f2ca22a226462ecd0bb2c94026`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.664713144302368 seconds. +- Overall skill 0.358667; relative MASE 0.763557; relative WQL 0.538674. +- term skill: long=0.3925, medium=0.4038, short=0.3268. +- domain skill: Econ/Fin=0.1145, Energy=0.1852, Healthcare=0.4021, Nature=0.4196, Sales=0.3470, Transport=0.4576, Web/CloudOps=0.5080. +- frequency skill: A=0.3749, D=0.3373, H=0.3835, M=0.0979, Q=0.1983, S=0.4405, T=0.4029, W=0.1974. +- variates skill: multivariate=0.3933, univariate=0.3297. +- Outcome: Screen0.358667 versus matched packed_sample control0.358802: nearly tied. Broader corpus coverage has not yet provided a clear advantage. Continue to6000 and12000; source probabilities remain fixed to the original mixture. + +## E38 packed_sample control6000-step screen +- Checkpoint SHA-256: `3b6a1f25cef4ecafcb7bde8ee9faf1cbe4c68a0c2fbb9594ce26eb3c222f3720`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.290119647979736 seconds. +- Overall skill 0.358628; relative MASE 0.763471; relative WQL 0.538799. +- term skill: long=0.3894, medium=0.4025, short=0.3286. +- domain skill: Econ/Fin=0.1093, Energy=0.1839, Healthcare=0.4157, Nature=0.4245, Sales=0.3451, Transport=0.4579, Web/CloudOps=0.5041. +- frequency skill: A=0.3762, D=0.3427, H=0.3805, M=0.1014, Q=0.1966, S=0.4404, T=0.4018, W=0.2035. +- variates skill: multivariate=0.3910, univariate=0.3316. +- Outcome: Screen0.358628 versus this restart at3000 0.358802. This restart has not surpassed uninterrupted E25 continuation. Retain as the matched control for corpus coverage, bounded quantiles and partial target horizons; assess after learning-rate decay. + +## E45: average late recency checkpoints +Hypothesis: uniform parameter averaging of the same training trajectory can reduce checkpoint variation without adding inference cost. Average own E25 EMA checkpoints at18000/21000/24000 in FP32, retaining their shared configuration. This is one model with fixed averaged weights; every parent was trained here from the same random-initialization lineage, seed59. No additional data or gradient updates. Use the selected aligned seasonal rule, continuity, zero0.4 and fixed128 trend basis. Evaluate all three cutoffs before building a full candidate. The averaging script and every parent hash are preserved. + +E25 final24000-step package selected: full0.371479 versus18000-step0.371267; direct screen0.375502 versus0.375386; first earlier0.334180 versus0.333401; second earlier0.358275 versus0.357015. All improve. Full inference126.1 seconds under concurrent training;97 configurations,151170 instances, zero failures and no quantile crossings. Repeated relocated examples are bitwise identical, finite and monotone. Fixed rules are unchanged from E44. + +E45 outcome: the uniform18000/21000/24000 EMA average scores0.375408/0.333912/0.358081 on the three cutoffs, below the final24000 checkpoint at0.375502/0.334180/0.358275 on every cutoff. Not selected; no full package evaluation. No training compute; parameter averaging was not separately timed, and individual diagnostic evaluation times are recorded below. + +## E25 final24000-step package with selected fixed rules +- Checkpoint SHA-256: `1530fbb577a87ca4eb39da83d6fee9b8ee5bc924202e021e3a7b56493112f564`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.371479; relative MASE 0.748783; relative WQL 0.527575. +- term skill: long=0.3935, medium=0.4057, short=0.3491. +- domain skill: Econ/Fin=0.1165, Energy=0.2279, Healthcare=0.4442, Nature=0.4287, Sales=0.3521, Transport=0.4652, Web/CloudOps=0.4925. +- frequency skill: A=0.2919, D=0.3570, H=0.3902, M=0.1164, Q=0.1836, S=0.4232, T=0.4289, W=0.2028. +- variates skill: multivariate=0.3893, univariate=0.3569. +- Outcome: Published atomically. Full0.371479, screen0.375502, earlier1 0.334180, earlier2 0.358275. All improve over the preceding18000-step package. All151170 instances score; repeated relocated examples are bitwise deterministic, finite and monotone. + +## Published recency24000 first earlier diagnostic +- Checkpoint SHA-256: `1530fbb577a87ca4eb39da83d6fee9b8ee5bc924202e021e3a7b56493112f564`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 24.669825792312622 seconds. +- Overall skill 0.334180; relative MASE 0.799611; relative WQL 0.554415. +- term skill: long=0.3968, medium=0.3571, short=0.2993. +- domain skill: Econ/Fin=0.1593, Energy=0.2277, Healthcare=0.4063, Nature=0.3608, Sales=0.3980, Transport=0.3712, Web/CloudOps=0.4466. +- frequency skill: A=0.3097, D=0.3512, H=0.3634, M=0.1820, Q=0.2352, S=0.3426, T=0.3343, W=0.2771. +- variates skill: multivariate=0.3511, univariate=0.3204. +- Outcome: Improves the preceding package. + +## Published recency24000 second earlier diagnostic +- Checkpoint SHA-256: `1530fbb577a87ca4eb39da83d6fee9b8ee5bc924202e021e3a7b56493112f564`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 25.378834009170532 seconds. +- Overall skill 0.358275; relative MASE 0.771140; relative WQL 0.534029. +- term skill: long=0.3653, medium=0.3854, short=0.3449. +- domain skill: Econ/Fin=0.1098, Energy=0.2362, Healthcare=0.3503, Nature=0.4701, Sales=0.5516, Transport=0.4194, Web/CloudOps=0.4299. +- frequency skill: A=0.3501, D=0.4315, H=0.3891, M=0.1569, Q=0.1519, S=0.2833, T=0.3571, W=0.2551. +- variates skill: multivariate=0.3625, univariate=0.3548. +- Outcome: Improves the preceding package. + +## E45 averaged late EMA screen +- Checkpoint SHA-256: `9b3541cfc195324574d22e27a8e3ac38edf7408712372933c645c892f39fa746`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.790673971176147 seconds. +- Overall skill 0.375408; relative MASE 0.746595; relative WQL 0.522527. +- term skill: long=0.3999, medium=0.4064, short=0.3534. +- domain skill: Econ/Fin=0.1379, Energy=0.2352, Healthcare=0.4383, Nature=0.4274, Sales=0.3404, Transport=0.4653, Web/CloudOps=0.5004. +- frequency skill: A=0.3761, D=0.3516, H=0.3953, M=0.0934, Q=0.2004, S=0.4222, T=0.4355, W=0.2141. +- variates skill: multivariate=0.3931, univariate=0.3610. +- Outcome: Below the final24000 checkpoint on all three cutoffs; not selected. + +## E42 partial target horizons3000-step screen +- Checkpoint SHA-256: `fce955a709ee54429c943e3962df49055444d5a15453865a01e4883614425917`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.083299160003662 seconds. +- Overall skill 0.358812; relative MASE 0.763592; relative WQL 0.538405. +- term skill: long=0.3907, medium=0.4016, short=0.3287. +- domain skill: Econ/Fin=0.1123, Energy=0.1842, Healthcare=0.4163, Nature=0.4220, Sales=0.3469, Transport=0.4589, Web/CloudOps=0.5047. +- frequency skill: A=0.3754, D=0.3440, H=0.3817, M=0.1026, Q=0.1980, S=0.4409, T=0.3995, W=0.2076. +- variates skill: multivariate=0.3908, univariate=0.3321. +- Outcome: Screen0.358812 versus matched control0.358802 is effectively tied. Gains in annual, quarterly, monthly and weekly groups are offset by minute-frequency losses. Continue to6000 and12000 to assess persistence. + +## E46: use forecast slopes for the fixed continuity correction +A per-channel diagnostic found that several ETT2 short-horizon forecasts underreact to a rebound after the latest trough: truth rises about1.1–1.9 context standard deviations in multiple channels, while the model rises only0.6–0.9. The current continuity anchor extrapolates the previous eight differences and may continue the old direction across a turn. Keep the smoothness gate, tau24, seasonal rule and zero0.4 fixed; compare past8 (current), zero slope, first forecast difference, and median of the first eight forecast differences. These are fixed transformations, with no fitting. Reuse the E25-18000 raw forecast caches for a paired diagnostic on all three cutoffs; their old short-context trend basis is unchanged within this comparison. Any selected variant must transfer to the latest fixed128 package before publication. + +## E47: frozen-backbone confidence-query projection (prepared) +Hypothesis: fixed lag-difference statistics provide information about local noise and seasonal repeatability that the decoder may otherwise infer inefficiently from raw patches. Add a zero-initialized linear projection of six log-scaled normalized statistics: MAE and RMS difference at lag1 over512 points, and at each of the two frequency-derived periods over at most8 cycles. Fewer than8 valid pairs use neutral defaults1 and sqrt(2). The3072 new parameters affect decoder queries; freeze the complete E25 recency24000 backbone. Train with the original weighted quantile/median loss after averaging both sign orientations, matching inference. Own packed_sample and unchanged local generator, seed89, planned6000 steps atLR2e-4. Choose batch64 or32 after measuring maximum-shape memory, keeping the six existing trainers and serialized evaluations within the one H100. No new training data. + +E47 memory check at batch64 (paired batch128), context4096 and horizon1024 used1134.4 MiB peak allocated and1160.0 MiB peak reserved Torch memory. Gradients were finite; no optimizer update or checkpoint was made from the random fixture. Start the planned6000-step run at batch64 with only3072 trainable parameters. + +## E46 complete slope comparison +No training; checkpoint SHA-256 `f6d2c41a690159a5b9c2034be45718c408a30b0d34d9607c9a768b9926781bbd`; fixed inference seed0. + +screen: 9.50 CPU diagnostic seconds. +- past8: skill0.374500; term short=0.3517, medium=0.4069, long=0.3994; domain Econ/Fin=0.1332, Energy=0.2347, Healthcare=0.4319, Nature=0.4254, Sales=0.3438, Transport=0.4650, Web/CloudOps=0.5007; freq A-DEC=0.3692, Q-DEC=0.2006, M=0.1023, W-SUN=0.0521, D=0.3442, H=0.3953, 15T=0.2125, W-FRI=-0.0051, 10T=0.6138, W-TUE=0.5773, W-THU=0.1903, W-WED=0.3133, 5T=0.5112, 10S=0.4218. +- none: skill0.370718; term short=0.3457, medium=0.4054, long=0.3986; domain Econ/Fin=0.1111, Energy=0.2246, Healthcare=0.4321, Nature=0.4266, Sales=0.3438, Transport=0.4648, Web/CloudOps=0.4996; freq A-DEC=0.3202, Q-DEC=0.1821, M=0.1025, W-SUN=0.0486, D=0.3438, H=0.3946, 15T=0.2087, W-FRI=0.0306, 10T=0.5876, W-TUE=0.5831, W-THU=0.1779, W-WED=0.3133, 5T=0.5117, 10S=0.4176. +- future1: skill0.374205; term short=0.3511, medium=0.4072, long=0.3991; domain Econ/Fin=0.1137, Energy=0.2347, Healthcare=0.4268, Nature=0.4274, Sales=0.3439, Transport=0.4665, Web/CloudOps=0.5017; freq A-DEC=0.3598, Q-DEC=0.1662, M=0.1001, W-SUN=0.0181, D=0.3420, H=0.3984, 15T=0.2072, W-FRI=0.0122, 10T=0.6164, W-TUE=0.5675, W-THU=0.1755, W-WED=0.3133, 5T=0.5109, 10S=0.4256. +- future8: skill0.373161; term short=0.3495, medium=0.4067, long=0.3990; domain Econ/Fin=0.1251, Energy=0.2298, Healthcare=0.4305, Nature=0.4272, Sales=0.3439, Transport=0.4643, Web/CloudOps=0.5016; freq A-DEC=0.3602, Q-DEC=0.1852, M=0.1008, W-SUN=0.0383, D=0.3439, H=0.3960, 15T=0.2096, W-FRI=-0.0017, 10T=0.6059, W-TUE=0.5789, W-THU=0.1738, W-WED=0.3133, 5T=0.5112, 10S=0.4252. + +backcast: 9.40 CPU diagnostic seconds. +- past8: skill0.332400; term short=0.2953, medium=0.3574, long=0.3980; domain Econ/Fin=0.1526, Energy=0.2268, Healthcare=0.3995, Nature=0.3561, Sales=0.3986, Transport=0.3699, Web/CloudOps=0.4472; freq A-DEC=0.2996, Q-DEC=0.2330, M=0.1721, W-SUN=-0.0043, D=0.3516, H=0.3643, 15T=0.2254, W-FRI=0.2597, 10T=0.3130, W-TUE=0.5335, W-THU=0.2049, W-WED=0.3474, 5T=0.4329, 10S=0.3397. +- none: skill0.329297; term short=0.2895, medium=0.3574, long=0.3980; domain Econ/Fin=0.1286, Energy=0.2253, Healthcare=0.3653, Nature=0.3586, Sales=0.3986, Transport=0.3702, Web/CloudOps=0.4470; freq A-DEC=0.2562, Q-DEC=0.2285, M=0.1591, W-SUN=-0.0090, D=0.3530, H=0.3630, 15T=0.2276, W-FRI=0.2653, 10T=0.3102, W-TUE=0.4340, W-THU=0.1790, W-WED=0.3474, 5T=0.4328, 10S=0.3392. +- future1: skill0.331443; term short=0.2936, medium=0.3572, long=0.3981; domain Econ/Fin=0.1560, Energy=0.2259, Healthcare=0.3803, Nature=0.3573, Sales=0.3986, Transport=0.3708, Web/CloudOps=0.4467; freq A-DEC=0.2946, Q-DEC=0.2075, M=0.1779, W-SUN=-0.0420, D=0.3531, H=0.3699, 15T=0.2218, W-FRI=0.2626, 10T=0.3062, W-TUE=0.4321, W-THU=0.1844, W-WED=0.3474, 5T=0.4320, 10S=0.3387. +- future8: skill0.330724; term short=0.2923, medium=0.3572, long=0.3980; domain Econ/Fin=0.1495, Energy=0.2260, Healthcare=0.3767, Nature=0.3568, Sales=0.3986, Transport=0.3706, Web/CloudOps=0.4462; freq A-DEC=0.2971, Q-DEC=0.2312, M=0.1706, W-SUN=-0.0239, D=0.3528, H=0.3662, 15T=0.2272, W-FRI=0.2646, 10T=0.3066, W-TUE=0.4419, W-THU=0.1812, W-WED=0.3474, 5T=0.4320, 10S=0.3363. + +backcast2: 9.16 CPU diagnostic seconds. +- past8: skill0.356697; term short=0.3411, medium=0.3874, long=0.3657; domain Econ/Fin=0.1045, Energy=0.2331, Healthcare=0.3610, Nature=0.4656, Sales=0.5516, Transport=0.4179, Web/CloudOps=0.4303; freq A-DEC=0.3474, Q-DEC=0.1548, M=0.1599, W-SUN=0.0316, D=0.4275, H=0.3891, 15T=0.1072, W-FRI=0.1243, 10T=0.4930, W-TUE=0.0782, W-THU=0.3037, W-WED=0.5352, 5T=0.4648, 10S=0.2798. +- none: skill0.356132; term short=0.3406, medium=0.3873, long=0.3643; domain Econ/Fin=0.0852, Energy=0.2311, Healthcare=0.3675, Nature=0.4661, Sales=0.5516, Transport=0.4189, Web/CloudOps=0.4316; freq A-DEC=0.3237, Q-DEC=0.1547, M=0.1618, W-SUN=0.0515, D=0.4258, H=0.3870, 15T=0.1053, W-FRI=0.1317, 10T=0.4935, W-TUE=0.1348, W-THU=0.2945, W-WED=0.5352, 5T=0.4648, 10S=0.2854. +- future1: skill0.355261; term short=0.3386, medium=0.3872, long=0.3657; domain Econ/Fin=0.1174, Energy=0.2356, Healthcare=0.3303, Nature=0.4652, Sales=0.5516, Transport=0.4184, Web/CloudOps=0.4253; freq A-DEC=0.3497, Q-DEC=0.1386, M=0.1530, W-SUN=0.0379, D=0.4238, H=0.3954, 15T=0.1038, W-FRI=0.1264, 10T=0.4929, W-TUE=-0.1191, W-THU=0.2956, W-WED=0.5352, 5T=0.4644, 10S=0.2668. +- future8: skill0.355137; term short=0.3386, medium=0.3873, long=0.3650; domain Econ/Fin=0.1032, Energy=0.2310, Healthcare=0.3342, Nature=0.4659, Sales=0.5516, Transport=0.4189, Web/CloudOps=0.4316; freq A-DEC=0.3492, Q-DEC=0.1479, M=0.1571, W-SUN=0.0462, D=0.4251, H=0.3890, 15T=0.1053, W-FRI=0.1264, 10T=0.4931, W-TUE=-0.1021, W-THU=0.2982, W-WED=0.5352, 5T=0.4643, 10S=0.2886. + +E46 outcome: retain the existing past-eight-difference slope. It beats zero slope and both forecast-derived slopes on every cutoff. The local turning-point explanation does not justify changing the global correction. + +## E48: phase diffusion in synthetic seasonal series (queued) +Hypothesis: varying seasonal phase teaches the model when distant cycles should lose confidence, complementing E31's amplitude variation. Keep E31 unchanged except that half of synthetic calls add a Brownian phase to each Fourier period, shared across its harmonics. Draw one-cycle fundamental correlation log-uniformly from 0.90 to 0.999, with increment standard deviation sqrt(-2 log(correlation) / period). Phase RNG seed is 200062, independent of sampler seed 59 and amplitude seed 100062. Real corpus windows, frequency choices, all original generator draws, and amplitude draws remain matched to E31. A data-only check of 256 rows at each synthetic fraction 0, 0.2 and 1 verified equal original and amplitude RNG states; all corpus-only arrays were bitwise equal, and every finite output stayed finite (8.30 CPU seconds). No validation labels are used in this generator or training. + +Initialize from our E17 patch16 EMA6000; same E25 architecture, batch 256, LR 8e-5, 24000-step cosine schedule, seed 59, save every 3000. Compare to cached E31 at matched checkpoints and three cutoffs before publication. Queue after E38 control completes 12000, retaining at most six heavy trainers on the one H100. Directory phase_synth contains code and sampler_check.json; generator must be declared separately in sources_used if selected. + +## E49: uncertainty shape in the fixed seasonal correction +Hypothesis: rare seasonal jumps inflate Gaussian RMS intervals in otherwise regular series. Keep the selected seasonal median, confidence gate, continuity correction and zero projection fixed; compare Gaussian RMS intervals with centered empirical seasonal-difference quantiles and Gaussian MAD intervals. All widths use the same sqrt((1+1/cycles)/2) averaging correction. Empirical residual median is subtracted so the median forecast is unchanged. These are fixed context formulas, with no optimization. Reuse E25-18000 raw caches for an inexpensive paired test across three cutoffs; transfer any consistent improvement to the current E25-24000 fixed128 runtime before publication. No training and no new sources. + +## E38 expanded-corpus 6000-step screen +- Checkpoint SHA-256: `6f0068b79fbc501fb1ec9a76c88d91ceb9ffca46096900c18f5157a19784678f`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.27088236808777 seconds. +- Overall skill 0.358532; relative MASE 0.764393; relative WQL 0.538311. +- term skill: long=0.3918, medium=0.4028, short=0.3272. +- domain skill: Econ/Fin=0.1142, Energy=0.1855, Healthcare=0.3972, Nature=0.4197, Sales=0.3475, Transport=0.4581, Web/CloudOps=0.5080. +- frequency skill: A=0.3713, D=0.3310, H=0.3829, M=0.1077, Q=0.2043, S=0.4384, T=0.4038, W=0.2044. +- variates skill: multivariate=0.3933, univariate=0.3295. +- Outcome: Skill 0.358532 versus matched control 0.358628: near tie, with no demonstrated benefit from the larger packed corpus. Continue to 12000. + +## E39 bounded quantiles 3000-step screen +- Checkpoint SHA-256: `3932f19e396a2ec597a047116ad2e4b680a0e7c9638472434388843bd358b4c7`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.178418159484863 seconds. +- Overall skill 0.358466; relative MASE 0.764176; relative WQL 0.538575. +- term skill: long=0.3917, medium=0.4021, short=0.3274. +- domain skill: Econ/Fin=0.1098, Energy=0.1842, Healthcare=0.4143, Nature=0.4191, Sales=0.3505, Transport=0.4583, Web/CloudOps=0.5059. +- frequency skill: A=0.3753, D=0.3428, H=0.3828, M=0.0891, Q=0.1957, S=0.4411, T=0.4011, W=0.1992. +- variates skill: multivariate=0.3924, univariate=0.3301. +- Outcome: Skill 0.358466 versus control 0.358802: a small regression. Continue to 6000 before selection. + +## E35 trend-query features 12000-step screen +- Checkpoint SHA-256: `269be0627257c53343aac6d0609231865bd112be7e01944d966624160150d4a8`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 27.890631914138794 seconds. +- Overall skill 0.357547; relative MASE 0.765787; relative WQL 0.538983. +- term skill: long=0.3905, medium=0.4007, short=0.3268. +- domain skill: Econ/Fin=0.1107, Energy=0.1852, Healthcare=0.4068, Nature=0.4159, Sales=0.3502, Transport=0.4572, Web/CloudOps=0.5058. +- frequency skill: A=0.3786, D=0.3384, H=0.3803, M=0.0973, Q=0.2012, S=0.4413, T=0.4010, W=0.2023. +- variates skill: multivariate=0.3916, univariate=0.3291. +- Outcome: Skill 0.357547 versus recency control 0.357241: another small gain. Matched earlier-cutoff checks are running. + +## E31 amplitude variation 18000-step screen +- Checkpoint SHA-256: `f0d8484d5f1bee554939ffbe769b95e42ba94e0739db7c680fac1c9a132f8f43`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 28.11006808280945 seconds. +- Overall skill 0.361640; relative MASE 0.761418; relative WQL 0.535190. +- term skill: long=0.3939, medium=0.4045, short=0.3314. +- domain skill: Econ/Fin=0.1093, Energy=0.1877, Healthcare=0.4199, Nature=0.4206, Sales=0.3451, Transport=0.4594, Web/CloudOps=0.5124. +- frequency skill: A=0.3693, D=0.3400, H=0.3834, M=0.0980, Q=0.2014, S=0.4419, T=0.4075, W=0.2126. +- variates skill: multivariate=0.3966, univariate=0.3324. +- Outcome: Skill 0.361640 versus recency control 0.361265: a small gain persists. Transfer to the current fixed inference rules on three cutoffs before selection. + +## E42 paired comparison: large_corpus_control 6000, screen +- Checkpoint SHA-256: `3b6a1f25cef4ecafcb7bde8ee9faf1cbe4c68a0c2fbb9594ce26eb3c222f3720`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.290119647979736 seconds. +- Overall skill 0.358628; relative MASE 0.763471; relative WQL 0.538799. +- term skill: long=0.3894, medium=0.4025, short=0.3286. +- domain skill: Econ/Fin=0.1093, Energy=0.1839, Healthcare=0.4157, Nature=0.4245, Sales=0.3451, Transport=0.4579, Web/CloudOps=0.5041. +- frequency skill: A=0.3762, D=0.3427, H=0.3805, M=0.1014, Q=0.1966, S=0.4404, T=0.4018, W=0.2035. +- variates skill: multivariate=0.3910, univariate=0.3316. +- Outcome: Matched seed 79, same parent and data stream. This isolates training with per-row available target horizons; assess the three cutoffs jointly. + +## E42 paired comparison: partial_targets 6000, screen +- Checkpoint SHA-256: `67562486b099a350da53c3caa5ff0932fe7fecdfe72c1879b064b2a9bb173dfb`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.865007400512695 seconds. +- Overall skill 0.359222; relative MASE 0.762879; relative WQL 0.538220. +- term skill: long=0.3896, medium=0.4026, short=0.3295. +- domain skill: Econ/Fin=0.1138, Energy=0.1865, Healthcare=0.4140, Nature=0.4258, Sales=0.3420, Transport=0.4581, Web/CloudOps=0.5030. +- frequency skill: A=0.3767, D=0.3422, H=0.3805, M=0.1063, Q=0.1975, S=0.4407, T=0.4017, W=0.2108. +- variates skill: multivariate=0.3906, univariate=0.3331. +- Outcome: Matched seed 79, same parent and data stream. This isolates training with per-row available target horizons; assess the three cutoffs jointly. + +## E42 paired comparison: large_corpus_control 6000, backcast +- Checkpoint SHA-256: `3b6a1f25cef4ecafcb7bde8ee9faf1cbe4c68a0c2fbb9594ce26eb3c222f3720`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 27.584256172180176 seconds. +- Overall skill 0.329632; relative MASE 0.806661; relative WQL 0.557102. +- term skill: long=0.3889, medium=0.3561, short=0.2948. +- domain skill: Econ/Fin=0.1442, Energy=0.2289, Healthcare=0.4117, Nature=0.3487, Sales=0.3954, Transport=0.3632, Web/CloudOps=0.4421. +- frequency skill: A=0.3117, D=0.3564, H=0.3572, M=0.1570, Q=0.2265, S=0.3417, T=0.3299, W=0.2668. +- variates skill: multivariate=0.3466, univariate=0.3158. +- Outcome: Matched seed 79, same parent and data stream. This isolates training with per-row available target horizons; assess the three cutoffs jointly. + +## E42 paired comparison: partial_targets 6000, backcast +- Checkpoint SHA-256: `67562486b099a350da53c3caa5ff0932fe7fecdfe72c1879b064b2a9bb173dfb`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 27.306365728378296 seconds. +- Overall skill 0.330300; relative MASE 0.806062; relative WQL 0.556406. +- term skill: long=0.3903, medium=0.3564, short=0.2953. +- domain skill: Econ/Fin=0.1490, Energy=0.2297, Healthcare=0.4089, Nature=0.3480, Sales=0.3970, Transport=0.3635, Web/CloudOps=0.4436. +- frequency skill: A=0.3192, D=0.3533, H=0.3582, M=0.1614, Q=0.2265, S=0.3433, T=0.3300, W=0.2726. +- variates skill: multivariate=0.3477, univariate=0.3161. +- Outcome: Matched seed 79, same parent and data stream. This isolates training with per-row available target horizons; assess the three cutoffs jointly. + +## E42 paired comparison: large_corpus_control 6000, backcast2 +- Checkpoint SHA-256: `3b6a1f25cef4ecafcb7bde8ee9faf1cbe4c68a0c2fbb9594ce26eb3c222f3720`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 26.882598161697388 seconds. +- Overall skill 0.352570; relative MASE 0.776245; relative WQL 0.539992. +- term skill: long=0.3679, medium=0.3749, short=0.3381. +- domain skill: Econ/Fin=0.0867, Energy=0.2280, Healthcare=0.3674, Nature=0.4604, Sales=0.5586, Transport=0.4130, Web/CloudOps=0.4272. +- frequency skill: A=0.3401, D=0.4293, H=0.3864, M=0.1768, Q=0.1515, S=0.2810, T=0.3448, W=0.2406. +- variates skill: multivariate=0.3588, univariate=0.3475. +- Outcome: Matched seed 79, same parent and data stream. This isolates training with per-row available target horizons; assess the three cutoffs jointly. + +## E42 paired comparison: partial_targets 6000, backcast2 +- Checkpoint SHA-256: `67562486b099a350da53c3caa5ff0932fe7fecdfe72c1879b064b2a9bb173dfb`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 27.302276849746704 seconds. +- Overall skill 0.352901; relative MASE 0.775671; relative WQL 0.539838. +- term skill: long=0.3689, medium=0.3760, short=0.3379. +- domain skill: Econ/Fin=0.0894, Energy=0.2294, Healthcare=0.3710, Nature=0.4595, Sales=0.5574, Transport=0.4132, Web/CloudOps=0.4264. +- frequency skill: A=0.3430, D=0.4260, H=0.3868, M=0.1778, Q=0.1500, S=0.2820, T=0.3450, W=0.2490. +- variates skill: multivariate=0.3587, univariate=0.3482. +- Outcome: Matched seed 79, same parent and data stream. This isolates training with per-row available target horizons; assess the three cutoffs jointly. + +## E49 complete seasonal interval comparison +No training; inference seed 0. Own E25-18000 checkpoint SHA-256 f6d2c41a690159a5b9c2034be45718c408a30b0d34d9607c9a768b9926781bbd. + +screen: 12.53 CPU diagnostic seconds. +- gaussian: skill 0.374500; term: short=0.3517, medium=0.4069, long=0.3994; domain: Econ/Fin=0.1332, Energy=0.2347, Healthcare=0.4319, Nature=0.4254, Sales=0.3438, Transport=0.4650, Web/CloudOps=0.5007; freq: A-DEC=0.3692, Q-DEC=0.2006, M=0.1023, W-SUN=0.0521, D=0.3442, H=0.3953, 15T=0.2125, W-FRI=-0.0051, 10T=0.6138, W-TUE=0.5773, W-THU=0.1903, W-WED=0.3133, 5T=0.5112, 10S=0.4218. +- empirical: skill 0.374034; term: short=0.3515, medium=0.4062, long=0.3984; domain: Econ/Fin=0.1322, Energy=0.2332, Healthcare=0.4326, Nature=0.4254, Sales=0.3438, Transport=0.4650, Web/CloudOps=0.5005; freq: A-DEC=0.3692, Q-DEC=0.2007, M=0.1029, W-SUN=0.0515, D=0.3443, H=0.3941, 15T=0.2120, W-FRI=-0.0051, 10T=0.6138, W-TUE=0.5773, W-THU=0.1903, W-WED=0.3133, 5T=0.5112, 10S=0.4208. +- mad: skill 0.373768; term: short=0.3513, medium=0.4061, long=0.3979; domain: Econ/Fin=0.1328, Energy=0.2325, Healthcare=0.4325, Nature=0.4254, Sales=0.3438, Transport=0.4649, Web/CloudOps=0.5001; freq: A-DEC=0.3692, Q-DEC=0.2007, M=0.1027, W-SUN=0.0515, D=0.3444, H=0.3938, 15T=0.2115, W-FRI=-0.0051, 10T=0.6138, W-TUE=0.5773, W-THU=0.1903, W-WED=0.3133, 5T=0.5112, 10S=0.4194. + +backcast: 12.04 CPU diagnostic seconds. +- gaussian: skill 0.332400; term: short=0.2953, medium=0.3574, long=0.3980; domain: Econ/Fin=0.1526, Energy=0.2268, Healthcare=0.3995, Nature=0.3561, Sales=0.3986, Transport=0.3699, Web/CloudOps=0.4472; freq: A-DEC=0.2996, Q-DEC=0.2330, M=0.1721, W-SUN=-0.0043, D=0.3516, H=0.3643, 15T=0.2254, W-FRI=0.2597, 10T=0.3130, W-TUE=0.5335, W-THU=0.2049, W-WED=0.3474, 5T=0.4329, 10S=0.3397. +- empirical: skill 0.332227; term: short=0.2954, medium=0.3563, long=0.3981; domain: Econ/Fin=0.1521, Energy=0.2257, Healthcare=0.3995, Nature=0.3558, Sales=0.3986, Transport=0.3697, Web/CloudOps=0.4482; freq: A-DEC=0.2996, Q-DEC=0.2331, M=0.1717, W-SUN=-0.0053, D=0.3516, H=0.3630, 15T=0.2257, W-FRI=0.2597, 10T=0.3130, W-TUE=0.5335, W-THU=0.2049, W-WED=0.3474, 5T=0.4330, 10S=0.3436. +- mad: skill 0.331760; term: short=0.2949, medium=0.3559, long=0.3977; domain: Econ/Fin=0.1517, Energy=0.2248, Healthcare=0.3984, Nature=0.3554, Sales=0.3986, Transport=0.3696, Web/CloudOps=0.4480; freq: A-DEC=0.2996, Q-DEC=0.2330, M=0.1720, W-SUN=-0.0052, D=0.3511, H=0.3620, 15T=0.2253, W-FRI=0.2597, 10T=0.3129, W-TUE=0.5335, W-THU=0.2049, W-WED=0.3474, 5T=0.4330, 10S=0.3430. + +backcast2: 10.81 CPU diagnostic seconds. +- gaussian: skill 0.356697; term: short=0.3411, medium=0.3874, long=0.3657; domain: Econ/Fin=0.1045, Energy=0.2331, Healthcare=0.3610, Nature=0.4656, Sales=0.5516, Transport=0.4179, Web/CloudOps=0.4303; freq: A-DEC=0.3474, Q-DEC=0.1548, M=0.1599, W-SUN=0.0316, D=0.4275, H=0.3891, 15T=0.1072, W-FRI=0.1243, 10T=0.4930, W-TUE=0.0782, W-THU=0.3037, W-WED=0.5352, 5T=0.4648, 10S=0.2798. +- empirical: skill 0.356537; term: short=0.3408, medium=0.3876, long=0.3655; domain: Econ/Fin=0.1035, Energy=0.2316, Healthcare=0.3619, Nature=0.4656, Sales=0.5516, Transport=0.4178, Web/CloudOps=0.4315; freq: A-DEC=0.3474, Q-DEC=0.1549, M=0.1602, W-SUN=0.0311, D=0.4277, H=0.3876, 15T=0.1075, W-FRI=0.1243, 10T=0.4929, W-TUE=0.0782, W-THU=0.3037, W-WED=0.5352, 5T=0.4648, 10S=0.2846. +- mad: skill 0.356717; term: short=0.3409, medium=0.3871, long=0.3665; domain: Econ/Fin=0.1039, Energy=0.2307, Healthcare=0.3619, Nature=0.4656, Sales=0.5516, Transport=0.4176, Web/CloudOps=0.4335; freq: A-DEC=0.3474, Q-DEC=0.1549, M=0.1602, W-SUN=0.0312, D=0.4278, H=0.3869, 15T=0.1072, W-FRI=0.1243, 10T=0.4929, W-TUE=0.0782, W-THU=0.3037, W-WED=0.5352, 5T=0.4648, 10S=0.2923. + +Outcome: retain Gaussian RMS intervals. Centered empirical intervals lose at all three cutoffs. MAD loses on the main and first earlier cutoff, with only a negligible second-earlier gain. Median MASE is exactly unchanged for every setting as intended. No transfer or package change. + +## E35 matched 12000 comparison: recency_features, screen +- Checkpoint SHA-256: `8ccb6870a025e1097331a3a288b1183741a413f3460fbf3352d0c589c6a4394c`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 20.589985609054565 seconds. +- Overall skill 0.357241; relative MASE 0.765658; relative WQL 0.539588. +- term skill: long=0.3912, medium=0.4026, short=0.3252. +- domain skill: Econ/Fin=0.1133, Energy=0.1855, Healthcare=0.3939, Nature=0.4171, Sales=0.3483, Transport=0.4566, Web/CloudOps=0.5065. +- frequency skill: A=0.3781, D=0.3343, H=0.3817, M=0.0906, Q=0.1961, S=0.4411, T=0.4020, W=0.1998. +- variates skill: multivariate=0.3920, univariate=0.3281. +- Outcome: Trend features gain slightly on the main screen but lose on both earlier cutoffs. Stop this branch; its extra features are not selected. + +## E35 matched 12000 comparison: trend_features, screen +- Checkpoint SHA-256: `269be0627257c53343aac6d0609231865bd112be7e01944d966624160150d4a8`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 27.890631914138794 seconds. +- Overall skill 0.357547; relative MASE 0.765787; relative WQL 0.538983. +- term skill: long=0.3905, medium=0.4007, short=0.3268. +- domain skill: Econ/Fin=0.1107, Energy=0.1852, Healthcare=0.4068, Nature=0.4159, Sales=0.3502, Transport=0.4572, Web/CloudOps=0.5058. +- frequency skill: A=0.3786, D=0.3384, H=0.3803, M=0.0973, Q=0.2012, S=0.4413, T=0.4010, W=0.2023. +- variates skill: multivariate=0.3916, univariate=0.3291. +- Outcome: Trend features gain slightly on the main screen but lose on both earlier cutoffs. Stop this branch; its extra features are not selected. + +## E35 matched 12000 comparison: recency_features, backcast +- Checkpoint SHA-256: `8ccb6870a025e1097331a3a288b1183741a413f3460fbf3352d0c589c6a4394c`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 27.742298364639282 seconds. +- Overall skill 0.328112; relative MASE 0.807765; relative WQL 0.558868. +- term skill: long=0.3899, medium=0.3548, short=0.2920. +- domain skill: Econ/Fin=0.1488, Energy=0.2248, Healthcare=0.4036, Nature=0.3514, Sales=0.3955, Transport=0.3613, Web/CloudOps=0.4413. +- frequency skill: A=0.3134, D=0.3558, H=0.3562, M=0.1567, Q=0.2256, S=0.3420, T=0.3267, W=0.2651. +- variates skill: multivariate=0.3435, univariate=0.3156. +- Outcome: Trend features gain slightly on the main screen but lose on both earlier cutoffs. Stop this branch; its extra features are not selected. + +## E35 matched 12000 comparison: trend_features, backcast +- Checkpoint SHA-256: `269be0627257c53343aac6d0609231865bd112be7e01944d966624160150d4a8`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 27.06494641304016 seconds. +- Overall skill 0.327724; relative MASE 0.808759; relative WQL 0.558826. +- term skill: long=0.3886, medium=0.3555, short=0.2916. +- domain skill: Econ/Fin=0.1436, Energy=0.2247, Healthcare=0.3984, Nature=0.3522, Sales=0.3952, Transport=0.3621, Web/CloudOps=0.4411. +- frequency skill: A=0.3149, D=0.3546, H=0.3559, M=0.1602, Q=0.2281, S=0.3419, T=0.3284, W=0.2545. +- variates skill: multivariate=0.3441, univariate=0.3144. +- Outcome: Trend features gain slightly on the main screen but lose on both earlier cutoffs. Stop this branch; its extra features are not selected. + +## E35 matched 12000 comparison: recency_features, backcast2 +- Checkpoint SHA-256: `8ccb6870a025e1097331a3a288b1183741a413f3460fbf3352d0c589c6a4394c`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 27.009191036224365 seconds. +- Overall skill 0.353202; relative MASE 0.774939; relative WQL 0.539846. +- term skill: long=0.3671, medium=0.3766, short=0.3388. +- domain skill: Econ/Fin=0.0874, Energy=0.2254, Healthcare=0.3808, Nature=0.4621, Sales=0.5594, Transport=0.4116, Web/CloudOps=0.4293. +- frequency skill: A=0.3385, D=0.4312, H=0.3856, M=0.1786, Q=0.1474, S=0.2819, T=0.3451, W=0.2459. +- variates skill: multivariate=0.3594, univariate=0.3481. +- Outcome: Trend features gain slightly on the main screen but lose on both earlier cutoffs. Stop this branch; its extra features are not selected. + +## E35 matched 12000 comparison: trend_features, backcast2 +- Checkpoint SHA-256: `269be0627257c53343aac6d0609231865bd112be7e01944d966624160150d4a8`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 26.192188262939453 seconds. +- Overall skill 0.353075; relative MASE 0.775525; relative WQL 0.539650. +- term skill: long=0.3664, medium=0.3761, short=0.3391. +- domain skill: Econ/Fin=0.0837, Energy=0.2262, Healthcare=0.3801, Nature=0.4640, Sales=0.5598, Transport=0.4112, Web/CloudOps=0.4272. +- frequency skill: A=0.3402, D=0.4277, H=0.3854, M=0.1847, Q=0.1490, S=0.2774, T=0.3477, W=0.2433. +- variates skill: multivariate=0.3593, univariate=0.3480. +- Outcome: Trend features gain slightly on the main screen but lose on both earlier cutoffs. Stop this branch; its extra features are not selected. + +## E50: paired-sign loss for a frozen-backbone output head +Hypothesis: training against the averaged positive/negative forecasts used at inference can improve calibration over separately scoring the two orientations. Both arms initialize from our selected E25-24000 checkpoint with fixed128 trend features and freeze every parameter except the existing 147744-parameter output head. Both forward the same context and its sign reflection, consuming identical seed97 data windows. Control scores each orientation independently; candidate averages the two normalized forecasts before the original weighted quantile/median loss. This isolates the loss rather than data augmentation or forward compute. Same packed_sample, original local generator and independent sign augmentation, batch64, LR5e-5, 6000-step cosine schedule, save1000. No new data, no validation training, no parameter additions. + +A maximum-shape random fixture (paired batch128, context4096, horizon1024) verified finite gradients and measured peak Torch allocation697 MiB for the individual-loss control and729 MiB for the paired-loss candidate, with822 MiB reserved in each. No optimizer update or checkpoint was made from the fixture. Start the control after the rejected E35 trainer exits; start the paired arm after E47 finishes, keeping to one H100. The same fixed runtime evaluates both. + +E50 head_control training started at 2026-10-22T04:52:57Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E50 head_paired training started at 2026-10-22T04:53:18Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E35 stopped cleanly at step 13309, with 4327.0 elapsed process seconds at the stop request. Final checkpoint SHA-256 `be7cce34037750ef56be8a183b68af46dc2deec184ad228cd4c60ab91b51eb48`. The last validation was the paired 12000-step comparison above; the stop checkpoint was saved for provenance, not selected. + +## E31 amplitude 18000 with selected fixed rules, screen +- Checkpoint SHA-256: `f0d8484d5f1bee554939ffbe769b95e42ba94e0739db7c680fac1c9a132f8f43`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 27.18380904197693 seconds. +- Overall skill 0.375271; relative MASE 0.747344; relative WQL 0.522231. +- term skill: long=0.4000, medium=0.4069, short=0.3529. +- domain skill: Econ/Fin=0.1337, Energy=0.2361, Healthcare=0.4224, Nature=0.4258, Sales=0.3419, Transport=0.4649, Web/CloudOps=0.5043. +- frequency skill: A=0.3721, D=0.3448, H=0.3951, M=0.0876, Q=0.2019, S=0.4223, T=0.4386, W=0.2158. +- variates skill: multivariate=0.3950, univariate=0.3591. +- Outcome: The earlier mean-template screening gain does not transfer to the selected aligned/zero0.4/fixed128 runtime: below recency18000 at every cutoff. Do not publish; finish the planned 24000 for a matched late comparison. + +## E31 amplitude 18000 with selected fixed rules, backcast +- Checkpoint SHA-256: `f0d8484d5f1bee554939ffbe769b95e42ba94e0739db7c680fac1c9a132f8f43`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 27.348726511001587 seconds. +- Overall skill 0.333200; relative MASE 0.800924; relative WQL 0.555137. +- term skill: long=0.3941, medium=0.3576, short=0.2985. +- domain skill: Econ/Fin=0.1568, Energy=0.2260, Healthcare=0.4100, Nature=0.3583, Sales=0.3987, Transport=0.3697, Web/CloudOps=0.4467. +- frequency skill: A=0.3095, D=0.3534, H=0.3637, M=0.1993, Q=0.2273, S=0.3378, T=0.3326, W=0.2601. +- variates skill: multivariate=0.3488, univariate=0.3205. +- Outcome: The earlier mean-template screening gain does not transfer to the selected aligned/zero0.4/fixed128 runtime: below recency18000 at every cutoff. Do not publish; finish the planned 24000 for a matched late comparison. + +## E31 amplitude 18000 with selected fixed rules, backcast2 +- Checkpoint SHA-256: `f0d8484d5f1bee554939ffbe769b95e42ba94e0739db7c680fac1c9a132f8f43`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 27.135295629501343 seconds. +- Overall skill 0.356896; relative MASE 0.774845; relative WQL 0.533762. +- term skill: long=0.3678, medium=0.3811, short=0.3433. +- domain skill: Econ/Fin=0.1063, Energy=0.2350, Healthcare=0.3543, Nature=0.4630, Sales=0.5538, Transport=0.4181, Web/CloudOps=0.4317. +- frequency skill: A=0.3487, D=0.4308, H=0.3887, M=0.1298, Q=0.1454, S=0.2825, T=0.3581, W=0.2487. +- variates skill: multivariate=0.3617, univariate=0.3530. +- Outcome: The earlier mean-template screening gain does not transfer to the selected aligned/zero0.4/fixed128 runtime: below recency18000 at every cutoff. Do not publish; finish the planned 24000 for a matched late comparison. + +## E51: last optimizer weights versus EMA weights +The late E25 EMA checkpoints continue to improve, and averaging older EMA checkpoints regressed in E45. Check whether the final optimizer iterate is ahead of its lagging EMA or instead suffers from update noise. No training or inference-rule change: evaluate step024000 against the selected ema024000 with the identical fixed128/aligned/zero0.4 runtime. Only transfer to earlier cutoffs and full validation if the main screen improves. Both candidates have the same seed59 training lineage. + +## E47 confidence projection 1000-step screen +- Checkpoint SHA-256: `b2df8695413e53c7d62ec8f265affc31a43ca26e7b99b50e0a75f47782b95bfe`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 27.31796908378601 seconds. +- Overall skill 0.375491; relative MASE 0.746025; relative WQL 0.522786. +- term skill: long=0.3994, medium=0.4067, short=0.3536. +- domain skill: Econ/Fin=0.1396, Energy=0.2349, Healthcare=0.4370, Nature=0.4288, Sales=0.3397, Transport=0.4653, Web/CloudOps=0.5002. +- frequency skill: A=0.3765, D=0.3531, H=0.3948, M=0.0934, Q=0.1985, S=0.4235, T=0.4361, W=0.2100. +- variates skill: multivariate=0.3936, univariate=0.3607. +- Outcome: Backbone unchanged. Earlier checkpoints essentially tied; the 6000-step checkpoint gains 0.000291 over the parent. Earlier-cutoff checks are pending before any selection. + +## E47 confidence projection 3000-step screen +- Checkpoint SHA-256: `653081261875b023a5d8dea02c999762fa8a2a4601ce7b6ad3b55559172290ab`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 28.364450693130493 seconds. +- Overall skill 0.375482; relative MASE 0.745987; relative WQL 0.522828. +- term skill: long=0.3995, medium=0.4066, short=0.3536. +- domain skill: Econ/Fin=0.1394, Energy=0.2348, Healthcare=0.4379, Nature=0.4283, Sales=0.3403, Transport=0.4653, Web/CloudOps=0.5004. +- frequency skill: A=0.3762, D=0.3534, H=0.3949, M=0.0912, Q=0.1983, S=0.4238, T=0.4362, W=0.2092. +- variates skill: multivariate=0.3937, univariate=0.3606. +- Outcome: Backbone unchanged. Earlier checkpoints essentially tied; the 6000-step checkpoint gains 0.000291 over the parent. Earlier-cutoff checks are pending before any selection. + +## E47 confidence projection 6000-step screen +- Checkpoint SHA-256: `0bad97e8994aac49ea173443db0a4fa8d72d33f9eb9e2660f06de75f7f1403eb`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.593000650405884 seconds. +- Overall skill 0.375793; relative MASE 0.745649; relative WQL 0.522544. +- term skill: long=0.3998, medium=0.4067, short=0.3540. +- domain skill: Econ/Fin=0.1396, Energy=0.2348, Healthcare=0.4406, Nature=0.4284, Sales=0.3399, Transport=0.4658, Web/CloudOps=0.5006. +- frequency skill: A=0.3762, D=0.3542, H=0.3951, M=0.0954, Q=0.1982, S=0.4239, T=0.4362, W=0.2090. +- variates skill: multivariate=0.3937, univariate=0.3611. +- Outcome: Backbone unchanged. Earlier checkpoints essentially tied; the 6000-step checkpoint gains 0.000291 over the parent. Earlier-cutoff checks are pending before any selection. + +E47 completed 6000 steps in 818.8 elapsed training-loop seconds on the shared H100. Every original model tensor is bitwise equal to the frozen E25-24000 parent; only the 3072 confidence-projection parameters changed. + +E48 phase_synth training started at 2026-10-22T04:54:48Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E51 final optimizer iterate, screen +- Checkpoint SHA-256: `32b70d0e88532fb98746ea032c10be587383d80ed7b0951b41f778a39c9dc68b`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.315549850463867 seconds. +- Overall skill 0.374536; relative MASE 0.746570; relative WQL 0.524003. +- term skill: long=0.3980, medium=0.4073, short=0.3522. +- domain skill: Econ/Fin=0.1389, Energy=0.2328, Healthcare=0.4348, Nature=0.4279, Sales=0.3409, Transport=0.4652, Web/CloudOps=0.4998. +- frequency skill: A=0.3701, D=0.3497, H=0.3936, M=0.0914, Q=0.1977, S=0.4222, T=0.4369, W=0.2087. +- variates skill: multivariate=0.3931, univariate=0.3594. +- Outcome: Skill 0.374536 is below the selected EMA24000 skill 0.375502. Retain EMA weights; no earlier-window or full evaluation is needed. + +## E39 bounded quantiles 6000-step screen +- Checkpoint SHA-256: `4af38aa561df4d38c1f6df090f8a5dc364c38786eb2ab38933646d827cbe7669`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.320833683013916 seconds. +- Overall skill 0.357854; relative MASE 0.764623; relative WQL 0.539287. +- term skill: long=0.3907, medium=0.4019, short=0.3268. +- domain skill: Econ/Fin=0.1103, Energy=0.1849, Healthcare=0.4072, Nature=0.4203, Sales=0.3470, Transport=0.4571, Web/CloudOps=0.5050. +- frequency skill: A=0.3756, D=0.3402, H=0.3810, M=0.0920, Q=0.1957, S=0.4423, T=0.4023, W=0.1961. +- variates skill: multivariate=0.3917, univariate=0.3295. +- Outcome: Skill 0.357854 is below matched control 0.358628, following a smaller 3000-step regression. Stop this branch; retain the current inference-only positivity projection. + +## E52: varied requested horizons during partial-target training +E42's correct per-row horizon conditioning improves all three cutoffs at 6000 steps. Hypothesis: exposing the decoder to intermediate requested horizons will also reduce mismatch between four fixed training horizon lengths and arbitrary inference lengths. Match E42's parent E25-12000, seed79, packed_sample, source probabilities, batch256, LR5e-5 and 12000-step schedule. Keep half the sampled target windows unchanged; for the other half, independently choose a prefix length uniformly from one-quarter to the full batch horizon, rounded upward to a 16-step patch boundary. Mask only later training labels. The existing E42 loss masks unused future tokens and sets each row's horizon metadata. Corpus contexts and periods, original generator and sampler random draws remain unchanged. Independent horizon RNG seed300082. + +A data-only check at all four horizon sizes verified identical context/period arrays and exact preservation of every retained target value (0.66 CPU seconds). No validation labels enter training. No new model parameters or inference behavior; this is a training-window augmentation. Start after rejected E39 exits and compare against cached E42 at 3000/6000/12000. + +E52 horizon_jitter training started at 2026-10-22T04:56:42Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E47 confidence projection 6000, backcast +- Checkpoint SHA-256: `0bad97e8994aac49ea173443db0a4fa8d72d33f9eb9e2660f06de75f7f1403eb`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 25.725136041641235 seconds. +- Overall skill 0.334126; relative MASE 0.799732; relative WQL 0.554420. +- term skill: long=0.3968, medium=0.3571, short=0.2992. +- domain skill: Econ/Fin=0.1592, Energy=0.2275, Healthcare=0.4065, Nature=0.3605, Sales=0.3971, Transport=0.3716, Web/CloudOps=0.4467. +- frequency skill: A=0.3079, D=0.3510, H=0.3635, M=0.1810, Q=0.2346, S=0.3430, T=0.3344, W=0.2764. +- variates skill: multivariate=0.3510, univariate=0.3204. +- Outcome: Main screen gains 0.000291; first earlier cutoff loses only 0.000054; second earlier cutoff gains 0.000224. Proceed to full validation before deciding whether to replace the package. + +## E47 confidence projection 6000, backcast2 +- Checkpoint SHA-256: `0bad97e8994aac49ea173443db0a4fa8d72d33f9eb9e2660f06de75f7f1403eb`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 24.6521155834198 seconds. +- Overall skill 0.358499; relative MASE 0.770987; relative WQL 0.533762. +- term skill: long=0.3652, medium=0.3856, short=0.3452. +- domain skill: Econ/Fin=0.1095, Energy=0.2361, Healthcare=0.3507, Nature=0.4706, Sales=0.5514, Transport=0.4202, Web/CloudOps=0.4300. +- frequency skill: A=0.3495, D=0.4316, H=0.3891, M=0.1571, Q=0.1507, S=0.2825, T=0.3576, W=0.2564. +- variates skill: multivariate=0.3624, univariate=0.3553. +- Outcome: Main screen gains 0.000291; first earlier cutoff loses only 0.000054; second earlier cutoff gains 0.000224. Proceed to full validation before deciding whether to replace the package. + +E39 stopped cleanly at step 6298, with 2199.0 elapsed process seconds at the stop request. Final checkpoint SHA-256 `d1018a12abdb14c369ba55a561c3091bbc7dc4b25337345a0af68aa15e9afec2`. This stop checkpoint was retained for provenance and was not selected. + +## E53: within-cycle variance for seasonal confidence +Hypothesis: total variance over up to eight cycles can be dominated by a long trend, artificially lowering the seasonal-difference/variance ratio and assigning high seasonal confidence even to a nonseasonal ramp. Change only the gate denominator to pooled within-cycle variance, subtracting each cycle's finite-observation mean before pooling squared deviations. Compare the existing global variance and this within-cycle variance, with the selected aligned template, Gaussian RMS intervals, continuity and zero0.4 unchanged. Use cached E25-18000 forecasts across three cutoffs; no training, optimization or new source data. A selected formula must transfer to the current checkpoint and fixed128 runtime before publication. + +## E47 confidence projection 6000, exact full package validation +- Checkpoint SHA-256: `0bad97e8994aac49ea173443db0a4fa8d72d33f9eb9e2660f06de75f7f1403eb`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.371766; relative MASE 0.748576; relative WQL 0.527239. +- term skill: long=0.3937, medium=0.4056, short=0.3496. +- domain skill: Econ/Fin=0.1167, Energy=0.2278, Healthcare=0.4464, Nature=0.4283, Sales=0.3521, Transport=0.4660, Web/CloudOps=0.4929. +- frequency skill: A=0.2915, D=0.3581, H=0.3903, M=0.1171, Q=0.1834, S=0.4239, T=0.4292, W=0.2017. +- variates skill: multivariate=0.3895, univariate=0.3573. +- Outcome: Selected for publication: skill 0.371766 versus 0.371479 for the previous package; relative MASE 0.748576 and WQL 0.527239. All 97 configurations and 151170 instances passed, with no quantile crossings. Actual package inference took 140.57 seconds on the one H100 while five heavy training runs and two head-only runs shared it. Relocation/determinism checks precede the atomic replacement. + +## E53 complete seasonal variance comparison +No training; inference seed 0. E25-18000 checkpoint SHA-256 f6d2c41a690159a5b9c2034be45718c408a30b0d34d9607c9a768b9926781bbd. + +screen: 8.50 CPU diagnostic seconds. +- global: skill 0.374500; term: short=0.3517, medium=0.4069, long=0.3994; domain: Econ/Fin=0.1332, Energy=0.2347, Healthcare=0.4319, Nature=0.4254, Sales=0.3438, Transport=0.4650, Web/CloudOps=0.5007; freq: A-DEC=0.3692, Q-DEC=0.2006, M=0.1023, W-SUN=0.0521, D=0.3442, H=0.3953, 15T=0.2125, W-FRI=-0.0051, 10T=0.6138, W-TUE=0.5773, W-THU=0.1903, W-WED=0.3133, 5T=0.5112, 10S=0.4218. +- within_cycle: skill 0.374386; term: short=0.3515, medium=0.4068, long=0.3994; domain: Econ/Fin=0.1320, Energy=0.2346, Healthcare=0.4305, Nature=0.4254, Sales=0.3450, Transport=0.4650, Web/CloudOps=0.5007; freq: A-DEC=0.3692, Q-DEC=0.2024, M=0.1005, W-SUN=0.0487, D=0.3444, H=0.3951, 15T=0.2124, W-FRI=-0.0050, 10T=0.6139, W-TUE=0.5773, W-THU=0.1903, W-WED=0.3133, 5T=0.5112, 10S=0.4218. + +backcast: 8.12 CPU diagnostic seconds. +- global: skill 0.332400; term: short=0.2953, medium=0.3574, long=0.3980; domain: Econ/Fin=0.1526, Energy=0.2268, Healthcare=0.3995, Nature=0.3561, Sales=0.3986, Transport=0.3699, Web/CloudOps=0.4472; freq: A-DEC=0.2996, Q-DEC=0.2330, M=0.1721, W-SUN=-0.0043, D=0.3516, H=0.3643, 15T=0.2254, W-FRI=0.2597, 10T=0.3130, W-TUE=0.5335, W-THU=0.2049, W-WED=0.3474, 5T=0.4329, 10S=0.3397. +- within_cycle: skill 0.332143; term: short=0.2948, medium=0.3575, long=0.3979; domain: Econ/Fin=0.1529, Energy=0.2266, Healthcare=0.3952, Nature=0.3561, Sales=0.3986, Transport=0.3704, Web/CloudOps=0.4471; freq: A-DEC=0.2996, Q-DEC=0.2353, M=0.1665, W-SUN=-0.0082, D=0.3519, H=0.3640, 15T=0.2255, W-FRI=0.2597, 10T=0.3130, W-TUE=0.5335, W-THU=0.2049, W-WED=0.3474, 5T=0.4329, 10S=0.3396. + +backcast2: 7.99 CPU diagnostic seconds. +- global: skill 0.356697; term: short=0.3411, medium=0.3874, long=0.3657; domain: Econ/Fin=0.1045, Energy=0.2331, Healthcare=0.3610, Nature=0.4656, Sales=0.5516, Transport=0.4179, Web/CloudOps=0.4303; freq: A-DEC=0.3474, Q-DEC=0.1548, M=0.1599, W-SUN=0.0316, D=0.4275, H=0.3891, 15T=0.1072, W-FRI=0.1243, 10T=0.4930, W-TUE=0.0782, W-THU=0.3037, W-WED=0.5352, 5T=0.4648, 10S=0.2798. +- within_cycle: skill 0.356794; term: short=0.3414, medium=0.3873, long=0.3654; domain: Econ/Fin=0.1040, Energy=0.2329, Healthcare=0.3653, Nature=0.4656, Sales=0.5516, Transport=0.4179, Web/CloudOps=0.4301; freq: A-DEC=0.3474, Q-DEC=0.1544, M=0.1677, W-SUN=0.0298, D=0.4273, H=0.3891, 15T=0.1064, W-FRI=0.1243, 10T=0.4930, W-TUE=0.0782, W-THU=0.3037, W-WED=0.5352, 5T=0.4647, 10S=0.2791. + +Outcome: retain total history variance. Within-cycle variance loses on the main and first earlier cutoff, with only a small second-earlier gain. The trend-related failure mode does not justify changing the global formula. + +E47 relocation and determinism passed: the candidate and a separately copied package in a fresh /tmp directory produced bitwise identical, finite, monotone quantiles for univariate daily, univariate hourly and multivariate medium-horizon examples. Both ran with /tmp as the working directory. Publish the complete candidate atomically after these checks. + +## E54: train the full model with longer raw context +E21's untrained extension and E29's frozen, coarsened history memory did not provide consistent gains. Hypothesis: adapting all existing parameters to raw 8192-point histories can use older cycles without the mismatch of an untrained extension or lossy extra memory. Two matched arms initialize from our E25-24000 EMA, with identical model size, original loss, seed101, packed_sample, source probabilities, batch128, LR3e-5 and 12000-step schedule. The sampler draws context sizes512/1024/2048/8192 with probabilities0.1/0.15/0.35/0.4 in both arms. The control then keeps only the last4096 points; the candidate keeps8192. Future labels and sampler RNG are matched exactly, including synthetic draws and aggregation. Both train every model parameter. This comparison changes only the retained raw history. + +At inference, positivity and the fixed seasonal rule continue to inspect only the recent4096 observations; continuity and zero projection retain their existing lookbacks. The candidate's neural encoder and normalization use up to8192. No external weights or new source data are introduced; the parameter count is unchanged. New generator/sign-augmentation seed101 must be declared if selected. Maximum-shape batch128/context8192/horizon1024 memory check, including allocated placeholders for Adam moments and EMA, measured9960 MiB peak allocated and10530 MiB reserved, with finite gradients in4.37 seconds. No optimizer update or checkpoint came from this random fixture. Queue the control after E50 head_control completes; queue the longer-context arm after E38 expanded corpus completes, preserving the one-H100 allocation. + +E54 data check passed in3.26 CPU seconds: all four sampled context sizes produced identical future labels, period metadata, overlapping recent history and sampler RNG states between the two arms. + +E54 long_context_control training started at 2026-10-22T05:04:35Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E55: transfer the matched partial-target training difference +E42's 6000-step checkpoint improves all three cutoffs over its exact seed/data/initialization-matched E38 control, but both restarted trajectories began from an older E25 checkpoint. Hypothesis: the parameter difference between these matched runs isolates a useful training correction that can transfer to the selected later model. Form one fixed model with weights = current E47 confidence6000 + E42 partial6000 - E38 control6000 for their common backbone tensors, leaving the confidence projection unchanged. Use coefficient1 with no grid search. This is a deterministic composition of our own trained weights, with all three parent hashes recorded. No new training or data, and one model forecasts every instance. Evaluate the main screen first; if promising, require earlier-cutoff and exact full-package checks. + +## E50 head_control 1000-step screen +- Checkpoint SHA-256: `a88f59494b256bf95addea9f00fa7b631cd67dc762228f523d95eec8047a05d8`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.136118412017822 seconds. +- Overall skill 0.375630; relative MASE 0.745780; relative WQL 0.522726. +- term skill: long=0.3996, medium=0.4068, short=0.3537. +- domain skill: Econ/Fin=0.1403, Energy=0.2347, Healthcare=0.4405, Nature=0.4291, Sales=0.3396, Transport=0.4656, Web/CloudOps=0.4997. +- frequency skill: A=0.3779, D=0.3539, H=0.3951, M=0.0943, Q=0.1980, S=0.4231, T=0.4359, W=0.2102. +- variates skill: multivariate=0.3935, univariate=0.3610. +- Outcome: Small gains at1000 are lost at3000 and6000. Paired loss trails the matched individual-loss control at the later checkpoints; neither arm surpasses the selected confidence model. No package replacement. + +## E50 head_control 3000-step screen +- Checkpoint SHA-256: `75b9f4860e4c4345f2cedb6eb2f9ffe5c9e65aede03a314c72b20b1e8a1f7aaf`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 27.069400310516357 seconds. +- Overall skill 0.375411; relative MASE 0.746024; relative WQL 0.522921. +- term skill: long=0.3996, medium=0.4066, short=0.3534. +- domain skill: Econ/Fin=0.1387, Energy=0.2345, Healthcare=0.4401, Nature=0.4293, Sales=0.3399, Transport=0.4650, Web/CloudOps=0.4996. +- frequency skill: A=0.3759, D=0.3533, H=0.3949, M=0.0963, Q=0.1980, S=0.4231, T=0.4355, W=0.2102. +- variates skill: multivariate=0.3933, univariate=0.3608. +- Outcome: Small gains at1000 are lost at3000 and6000. Paired loss trails the matched individual-loss control at the later checkpoints; neither arm surpasses the selected confidence model. No package replacement. + +## E50 head_control 6000-step screen +- Checkpoint SHA-256: `dd8fc459f097a0bc0c7cb133473130aa32e1dc520fd7f03ff50dc26366d1122e`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 24.82920217514038 seconds. +- Overall skill 0.375304; relative MASE 0.746102; relative WQL 0.523045. +- term skill: long=0.3996, medium=0.4065, short=0.3532. +- domain skill: Econ/Fin=0.1404, Energy=0.2343, Healthcare=0.4375, Nature=0.4291, Sales=0.3402, Transport=0.4652, Web/CloudOps=0.4997. +- frequency skill: A=0.3770, D=0.3531, H=0.3950, M=0.0965, Q=0.1987, S=0.4230, T=0.4355, W=0.2086. +- variates skill: multivariate=0.3931, univariate=0.3607. +- Outcome: Small gains at1000 are lost at3000 and6000. Paired loss trails the matched individual-loss control at the later checkpoints; neither arm surpasses the selected confidence model. No package replacement. + +E50 head_control completed6000 steps in 685.6 elapsed training-loop seconds. Every non-head tensor remains bitwise equal to the E25-24000 parent. + +## E50 head_paired 1000-step screen +- Checkpoint SHA-256: `337e19aac481543a8ba78bd837f00c8a714315313e665b1b5a038d009a905a2a`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.40800166130066 seconds. +- Overall skill 0.375721; relative MASE 0.745631; relative WQL 0.522677. +- term skill: long=0.3997, medium=0.4067, short=0.3539. +- domain skill: Econ/Fin=0.1403, Energy=0.2344, Healthcare=0.4425, Nature=0.4292, Sales=0.3396, Transport=0.4658, Web/CloudOps=0.4998. +- frequency skill: A=0.3786, D=0.3544, H=0.3951, M=0.0952, Q=0.1978, S=0.4234, T=0.4358, W=0.2099. +- variates skill: multivariate=0.3935, univariate=0.3612. +- Outcome: Small gains at1000 are lost at3000 and6000. Paired loss trails the matched individual-loss control at the later checkpoints; neither arm surpasses the selected confidence model. No package replacement. + +## E50 head_paired 3000-step screen +- Checkpoint SHA-256: `1043bbd666890cb730f2931875860ed661f54bae5236a7c93bbbe03764487222`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 27.516828536987305 seconds. +- Overall skill 0.375342; relative MASE 0.746117; relative WQL 0.522970. +- term skill: long=0.3997, medium=0.4065, short=0.3533. +- domain skill: Econ/Fin=0.1387, Energy=0.2340, Healthcare=0.4415, Nature=0.4295, Sales=0.3399, Transport=0.4651, Web/CloudOps=0.4994. +- frequency skill: A=0.3750, D=0.3534, H=0.3947, M=0.0981, Q=0.1978, S=0.4235, T=0.4353, W=0.2097. +- variates skill: multivariate=0.3930, univariate=0.3609. +- Outcome: Small gains at1000 are lost at3000 and6000. Paired loss trails the matched individual-loss control at the later checkpoints; neither arm surpasses the selected confidence model. No package replacement. + +## E50 head_paired 6000-step screen +- Checkpoint SHA-256: `8aacc5fadfa1a9d214aeba0cd1f39bde9aaf038b9ee2a487dafa57b9e904479e`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.942206621170044 seconds. +- Overall skill 0.375234; relative MASE 0.746235; relative WQL 0.523068. +- term skill: long=0.3997, medium=0.4064, short=0.3531. +- domain skill: Econ/Fin=0.1405, Energy=0.2337, Healthcare=0.4385, Nature=0.4294, Sales=0.3403, Transport=0.4654, Web/CloudOps=0.4995. +- frequency skill: A=0.3760, D=0.3533, H=0.3947, M=0.0981, Q=0.1988, S=0.4234, T=0.4354, W=0.2077. +- variates skill: multivariate=0.3928, univariate=0.3609. +- Outcome: Small gains at1000 are lost at3000 and6000. Paired loss trails the matched individual-loss control at the later checkpoints; neither arm surpasses the selected confidence model. No package replacement. + +E50 head_paired completed6000 steps in 687.3 elapsed training-loop seconds. Every non-head tensor remains bitwise equal to the E25-24000 parent. + +## E38 original corpus control12000, matched screening +- Checkpoint SHA-256: `7f9ba5e01ac59c51a3b63d3067b442e23e15d0abc51ddbcccdd04d6083ae4add`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.037413597106934 seconds. +- Overall skill 0.360533; relative MASE 0.761352; relative WQL 0.537094. +- term skill: long=0.3910, medium=0.4047, short=0.3305. +- domain skill: Econ/Fin=0.1118, Energy=0.1871, Healthcare=0.4084, Nature=0.4251, Sales=0.3445, Transport=0.4588, Web/CloudOps=0.5084. +- frequency skill: A=0.3744, D=0.3432, H=0.3820, M=0.0997, Q=0.1999, S=0.4419, T=0.4062, W=0.2010. +- variates skill: multivariate=0.3952, univariate=0.3315. +- Outcome: The restarted control improves over its12000-step parent but remains below uninterrupted E25-24000. Retain as the paired reference for corpus expansion and partial-target training. + +## E38 original corpus control12000, selected fixed inference rules +- Checkpoint SHA-256: `7f9ba5e01ac59c51a3b63d3067b442e23e15d0abc51ddbcccdd04d6083ae4add`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.83461022377014 seconds. +- Overall skill 0.373819; relative MASE 0.747477; relative WQL 0.524569. +- term skill: long=0.3971, medium=0.4072, short=0.3512. +- domain skill: Econ/Fin=0.1366, Energy=0.2343, Healthcare=0.4105, Nature=0.4297, Sales=0.3412, Transport=0.4642, Web/CloudOps=0.5006. +- frequency skill: A=0.3777, D=0.3471, H=0.3939, M=0.0915, Q=0.2002, S=0.4231, T=0.4362, W=0.2036. +- variates skill: multivariate=0.3936, univariate=0.3576. +- Outcome: The restarted control improves over its12000-step parent but remains below uninterrupted E25-24000. Retain as the paired reference for corpus expansion and partial-target training. + +E38 original-corpus control completed12000 steps in 3967.3 elapsed training-loop seconds. E48 phase_synth replaced it on the same H100 after completion. + +## E55 matched partial-target weight difference, screen +- Checkpoint SHA-256: `031411940fdebc895e3cf681512924f680e7feaccdfbda46f85890397fe20bd0`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.02963423728943 seconds. +- Overall skill 0.375848; relative MASE 0.745876; relative WQL 0.522292. +- term skill: long=0.3998, medium=0.4069, short=0.3540. +- domain skill: Econ/Fin=0.1449, Energy=0.2367, Healthcare=0.4308, Nature=0.4298, Sales=0.3356, Transport=0.4655, Web/CloudOps=0.5000. +- frequency skill: A=0.3786, D=0.3503, H=0.3960, M=0.1012, Q=0.2008, S=0.4236, T=0.4351, W=0.2163. +- variates skill: multivariate=0.3939, univariate=0.3611. +- Outcome: Skill 0.375848 is only 0.000056 above the selected E47 model. Check both earlier cutoffs before a full-package evaluation; no replacement yet. + +## E56: bounded influence of difficult training windows +Hypothesis: a linear average of normalized window losses gives unusually difficult or abruptly changing futures too much influence, while the benchmark aggregates relative configuration errors geometrically. Keep the original per-window weighted quantile/median loss and context-only seasonal weights, but replace each window loss L by 0.25*log1p(L/0.25) before averaging. The derivative is bounded by1 and declines for difficult windows; this is a robust surrogate, not a claim to exactly optimize benchmark skill. The scale0.25 is fixed in advance, with no sweep. + +Match E38 original-corpus control exactly: parent E25-12000, seed79, packed_sample, source weights, batch256, LR5e-5, 12000-step schedule and save3000. No new source data, architecture or inference rule. Queue after E42 completes12000, then compare against cached control checkpoints and earlier cutoffs. The loss scale is saved in training arguments. + +## E55 transferred partial-target update, backcast +- Checkpoint SHA-256: `031411940fdebc895e3cf681512924f680e7feaccdfbda46f85890397fe20bd0`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 24.927225589752197 seconds. +- Overall skill 0.335000; relative MASE 0.798832; relative WQL 0.553589. +- term skill: long=0.3978, medium=0.3567, short=0.3005. +- domain skill: Econ/Fin=0.1675, Energy=0.2279, Healthcare=0.4021, Nature=0.3600, Sales=0.3983, Transport=0.3718, Web/CloudOps=0.4491. +- frequency skill: A=0.3286, D=0.3484, H=0.3640, M=0.1855, Q=0.2333, S=0.3447, T=0.3347, W=0.2831. +- variates skill: multivariate=0.3522, univariate=0.3210. +- Outcome: Mixed transfer: main +0.000056, first earlier +0.000874, second earlier -0.000595 versus E47. Keep the published package. Revisit the same coefficient with the final12000-step matched checkpoints; no full-package test of this6000-step composition. + +## E55 transferred partial-target update, backcast2 +- Checkpoint SHA-256: `031411940fdebc895e3cf681512924f680e7feaccdfbda46f85890397fe20bd0`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 23.91679048538208 seconds. +- Overall skill 0.357904; relative MASE 0.771656; relative WQL 0.534289. +- term skill: long=0.3649, medium=0.3860, short=0.3441. +- domain skill: Econ/Fin=0.1130, Energy=0.2354, Healthcare=0.3520, Nature=0.4680, Sales=0.5482, Transport=0.4200, Web/CloudOps=0.4303. +- frequency skill: A=0.3535, D=0.4265, H=0.3897, M=0.1535, Q=0.1485, S=0.2805, T=0.3574, W=0.2617. +- variates skill: multivariate=0.3618, univariate=0.3547. +- Outcome: Mixed transfer: main +0.000056, first earlier +0.000874, second earlier -0.000595 versus E47. Keep the published package. Revisit the same coefficient with the final12000-step matched checkpoints; no full-package test of this6000-step composition. + +E54 long_context_8192 training started at 2026-10-22T05:11:31Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E38 expanded corpus final12000, matched screen +- Checkpoint SHA-256: `8aa07643add22cc1f8e45c069d19ff54bda8c0853c8e7076eb5923467942327b`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.707714796066284 seconds. +- Overall skill 0.359331; relative MASE 0.763140; relative WQL 0.537852. +- term skill: long=0.3931, medium=0.4039, short=0.3277. +- domain skill: Econ/Fin=0.1164, Energy=0.1854, Healthcare=0.3936, Nature=0.4242, Sales=0.3431, Transport=0.4578, Web/CloudOps=0.5093. +- frequency skill: A=0.3748, D=0.3312, H=0.3834, M=0.1029, Q=0.2013, S=0.4405, T=0.4056, W=0.2056. +- variates skill: multivariate=0.3951, univariate=0.3293. +- Outcome: Skill 0.359331 versus matched original-corpus control0.360533. The early near tie becomes a final regression. Do not select the expanded corpus for the current model; retain all packed data and receipts for future experiments. + +E38 expanded-corpus arm completed12000 steps in 4098.4 elapsed training-loop seconds. E54 long_context_8192 started after its process exited on the same H100. + +## E48 synthetic phase diffusion3000, matched screen +- Checkpoint SHA-256: `06c74c2540e7fd208186a407ae6c38fcdeafe5e152887e1d7642d65c18084e64`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.34250235557556 seconds. +- Overall skill 0.353459; relative MASE 0.767933; relative WQL 0.544338. +- term skill: long=0.3849, medium=0.3994, short=0.3222. +- domain skill: Econ/Fin=0.1025, Energy=0.1767, Healthcare=0.4158, Nature=0.4111, Sales=0.3476, Transport=0.4532, Web/CloudOps=0.5044. +- frequency skill: A=0.3736, D=0.3385, H=0.3748, M=0.0857, Q=0.1907, S=0.4365, T=0.3973, W=0.1999. +- variates skill: multivariate=0.3856, univariate=0.3267. +- Outcome: Skill0.353459 versus amplitude-only E31 score0.352625 at the same step/seed/data stream. Earlier-cutoff checks are pending; continue the trial. + +E56 log_window_loss training started at 2026-10-22T05:14:05Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E57: period-relative phase projections with a frozen backbone +Hypothesis: encoder and future-query attention can use seasonal history more efficiently when supplied explicit relative phase for each frequency-derived period, rather than having to reconstruct it from generic position embeddings and scalar period metadata. Add zero-initialized linear projections of per-point sine/cosine phase for the two periods to context patches and future-query patches. Positions are relative to the forecast origin; periods below2 yield zero features, and missing context positions are masked. There are65536 new parameters, with no calendar dates or dataset identifiers. + +Initialize from the selected E47 confidence6000 package; freeze every existing parameter, including the confidence projection. Train only the two phase projections on packed_sample and the unchanged local synthetic/sign generator, seed107, paired-sign weighted quantile/median loss, batch64, LR2e-4, 6000-step cosine schedule, save1000. Confirm zero-initialization equivalence and maximum-shape memory before starting alongside the six existing trainers on the one H100. No new source data. + +E57 checks passed: the zero-initialized model is bitwise equal to the parent on mixed-frequency, partially missing CPU contexts. Maximum-shape paired batch128/context4096/horizon1024 used3647 MiB peak allocated and3920 MiB reserved, including EMA and optimizer-state placeholders, with finite gradients in1.20 seconds. No optimizer update or checkpoint came from these fixtures. Start batch64 as planned; train only65536 projection parameters. + +## E52 varied requested horizons3000, matched screen +- Checkpoint SHA-256: `ef30f8bd58927ec0a18dc5c68a7b18c0d8066c0b3ff6dbe31b6fec82af26eb0c`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.744144678115845 seconds. +- Overall skill 0.359510; relative MASE 0.763513; relative WQL 0.537290. +- term skill: long=0.3912, medium=0.4026, short=0.3294. +- domain skill: Econ/Fin=0.1112, Energy=0.1841, Healthcare=0.4177, Nature=0.4232, Sales=0.3464, Transport=0.4589, Web/CloudOps=0.5065. +- frequency skill: A=0.3765, D=0.3429, H=0.3831, M=0.1035, Q=0.1995, S=0.4418, T=0.4003, W=0.2081. +- variates skill: multivariate=0.3922, univariate=0.3323. +- Outcome: Skill0.359510 versus E42 partial-target control0.358812. The gain is promising; matched earlier-cutoff evaluations are queued. + +## E48 matched3000 comparison: amplitude_synth, backcast +- Checkpoint SHA-256: `6f3e68f1b70e9cde6872473dc4d834c16195e72656ba974eb39d48413a10af63`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 23.832332372665405 seconds. +- Overall skill 0.322014; relative MASE 0.811414; relative WQL 0.566499. +- term skill: long=0.3860, medium=0.3513, short=0.2839. +- domain skill: Econ/Fin=0.1393, Energy=0.2195, Healthcare=0.3717, Nature=0.3475, Sales=0.3988, Transport=0.3598, Web/CloudOps=0.4348. +- frequency skill: A=0.3171, D=0.3485, H=0.3526, M=0.1707, Q=0.2099, S=0.3414, T=0.3170, W=0.2493. +- variates skill: multivariate=0.3360, univariate=0.3107. +- Outcome: Phase diffusion gains at all three cutoffs at3000: main+0.000834, earlier1+0.000612, earlier2+0.000501. Continue to6000 and later matched checkpoints. + +## E48 matched3000 comparison: phase_synth, backcast +- Checkpoint SHA-256: `06c74c2540e7fd208186a407ae6c38fcdeafe5e152887e1d7642d65c18084e64`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 25.44191288948059 seconds. +- Overall skill 0.322626; relative MASE 0.811284; relative WQL 0.565567. +- term skill: long=0.3871, medium=0.3526, short=0.2840. +- domain skill: Econ/Fin=0.1401, Energy=0.2216, Healthcare=0.3676, Nature=0.3459, Sales=0.3983, Transport=0.3597, Web/CloudOps=0.4368. +- frequency skill: A=0.3175, D=0.3449, H=0.3527, M=0.1680, Q=0.2099, S=0.3428, T=0.3207, W=0.2496. +- variates skill: multivariate=0.3385, univariate=0.3097. +- Outcome: Phase diffusion gains at all three cutoffs at3000: main+0.000834, earlier1+0.000612, earlier2+0.000501. Continue to6000 and later matched checkpoints. + +## E48 matched3000 comparison: amplitude_synth, backcast2 +- Checkpoint SHA-256: `6f3e68f1b70e9cde6872473dc4d834c16195e72656ba974eb39d48413a10af63`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 27.063983917236328 seconds. +- Overall skill 0.346071; relative MASE 0.781652; relative WQL 0.547076. +- term skill: long=0.3649, medium=0.3705, short=0.3294. +- domain skill: Econ/Fin=0.0773, Energy=0.2205, Healthcare=0.3375, Nature=0.4551, Sales=0.5561, Transport=0.4102, Web/CloudOps=0.4240. +- frequency skill: A=0.3378, D=0.4197, H=0.3812, M=0.1601, Q=0.1370, S=0.2856, T=0.3361, W=0.2413. +- variates skill: multivariate=0.3528, univariate=0.3406. +- Outcome: Phase diffusion gains at all three cutoffs at3000: main+0.000834, earlier1+0.000612, earlier2+0.000501. Continue to6000 and later matched checkpoints. + +## E48 matched3000 comparison: phase_synth, backcast2 +- Checkpoint SHA-256: `06c74c2540e7fd208186a407ae6c38fcdeafe5e152887e1d7642d65c18084e64`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 26.462491750717163 seconds. +- Overall skill 0.346572; relative MASE 0.781891; relative WQL 0.546071. +- term skill: long=0.3645, medium=0.3710, short=0.3303. +- domain skill: Econ/Fin=0.0768, Energy=0.2203, Healthcare=0.3341, Nature=0.4562, Sales=0.5562, Transport=0.4104, Web/CloudOps=0.4261. +- frequency skill: A=0.3370, D=0.4191, H=0.3813, M=0.1474, Q=0.1380, S=0.2827, T=0.3397, W=0.2426. +- variates skill: multivariate=0.3544, univariate=0.3402. +- Outcome: Phase diffusion gains at all three cutoffs at3000: main+0.000834, earlier1+0.000612, earlier2+0.000501. Continue to6000 and later matched checkpoints. + +## E42 final12000, matched mean-template screen +- Checkpoint SHA-256: `a0ef29e85d0cf01677a6a58e4a9f91b077073c4af95f85234eec2ddc223f4837`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.56895399093628 seconds. +- Overall skill 0.361108; relative MASE 0.761463; relative WQL 0.536050. +- term skill: long=0.3906, medium=0.4043, short=0.3319. +- domain skill: Econ/Fin=0.1096, Energy=0.1895, Healthcare=0.4193, Nature=0.4256, Sales=0.3404, Transport=0.4593, Web/CloudOps=0.5063. +- frequency skill: A=0.3721, D=0.3420, H=0.3825, M=0.1108, Q=0.1995, S=0.4420, T=0.4045, W=0.2122. +- variates skill: multivariate=0.3937, univariate=0.3339. +- Outcome: The partial-target change still improves over its matched original-corpus control. The direct model remains below the published later E25/E47 lineage. Earlier-cutoff checks and the prespecified final-checkpoint weight-difference transfer are pending. + +## E42 final12000, selected fixed inference rules +- Checkpoint SHA-256: `a0ef29e85d0cf01677a6a58e4a9f91b077073c4af95f85234eec2ddc223f4837`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 27.01974844932556 seconds. +- Overall skill 0.374349; relative MASE 0.747467; relative WQL 0.523688. +- term skill: long=0.3969, medium=0.4067, short=0.3525. +- domain skill: Econ/Fin=0.1345, Energy=0.2359, Healthcare=0.4230, Nature=0.4302, Sales=0.3371, Transport=0.4647, Web/CloudOps=0.4986. +- frequency skill: A=0.3753, D=0.3458, H=0.3943, M=0.1064, Q=0.1999, S=0.4233, T=0.4344, W=0.2143. +- variates skill: multivariate=0.3921, univariate=0.3599. +- Outcome: The partial-target change still improves over its matched original-corpus control. The direct model remains below the published later E25/E47 lineage. Earlier-cutoff checks and the prespecified final-checkpoint weight-difference transfer are pending. + +E42 completed12000 steps in 4034.2 elapsed training-loop seconds. E56 replaced it on the same H100. + +## E52 matched3000 comparison: partial_targets, backcast +- Checkpoint SHA-256: `fce955a709ee54429c943e3962df49055444d5a15453865a01e4883614425917`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 25.31913948059082 seconds. +- Overall skill 0.329377; relative MASE 0.806571; relative WQL 0.557590. +- term skill: long=0.3896, medium=0.3560, short=0.2940. +- domain skill: Econ/Fin=0.1487, Energy=0.2246, Healthcare=0.4210, Nature=0.3485, Sales=0.3987, Transport=0.3621, Web/CloudOps=0.4433. +- frequency skill: A=0.3183, D=0.3586, H=0.3563, M=0.1681, Q=0.2258, S=0.3434, T=0.3271, W=0.2657. +- variates skill: multivariate=0.3451, univariate=0.3166. +- Outcome: Horizon jitter gains main+0.000697 and earlier2+0.000423, but loses earlier1 by0.000300. Continue to6000 to assess whether the effect persists; no package change. + +## E52 matched3000 comparison: horizon_jitter, backcast +- Checkpoint SHA-256: `ef30f8bd58927ec0a18dc5c68a7b18c0d8066c0b3ff6dbe31b6fec82af26eb0c`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 27.87836766242981 seconds. +- Overall skill 0.329077; relative MASE 0.807099; relative WQL 0.557723. +- term skill: long=0.3896, medium=0.3557, short=0.2936. +- domain skill: Econ/Fin=0.1451, Energy=0.2244, Healthcare=0.4181, Nature=0.3490, Sales=0.3989, Transport=0.3628, Web/CloudOps=0.4429. +- frequency skill: A=0.3192, D=0.3567, H=0.3569, M=0.1660, Q=0.2272, S=0.3431, T=0.3263, W=0.2674. +- variates skill: multivariate=0.3446, univariate=0.3165. +- Outcome: Horizon jitter gains main+0.000697 and earlier2+0.000423, but loses earlier1 by0.000300. Continue to6000 to assess whether the effect persists; no package change. + +## E52 matched3000 comparison: partial_targets, backcast2 +- Checkpoint SHA-256: `fce955a709ee54429c943e3962df49055444d5a15453865a01e4883614425917`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 27.110735416412354 seconds. +- Overall skill 0.352022; relative MASE 0.776423; relative WQL 0.540782. +- term skill: long=0.3678, medium=0.3760, short=0.3367. +- domain skill: Econ/Fin=0.0867, Energy=0.2248, Healthcare=0.3701, Nature=0.4601, Sales=0.5593, Transport=0.4130, Web/CloudOps=0.4281. +- frequency skill: A=0.3418, D=0.4285, H=0.3860, M=0.1767, Q=0.1499, S=0.2821, T=0.3437, W=0.2407. +- variates skill: multivariate=0.3578, univariate=0.3473. +- Outcome: Horizon jitter gains main+0.000697 and earlier2+0.000423, but loses earlier1 by0.000300. Continue to6000 to assess whether the effect persists; no package change. + +## E52 matched3000 comparison: horizon_jitter, backcast2 +- Checkpoint SHA-256: `ef30f8bd58927ec0a18dc5c68a7b18c0d8066c0b3ff6dbe31b6fec82af26eb0c`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 26.243326425552368 seconds. +- Overall skill 0.352445; relative MASE 0.776496; relative WQL 0.540026. +- term skill: long=0.3678, medium=0.3759, short=0.3375. +- domain skill: Econ/Fin=0.0824, Energy=0.2247, Healthcare=0.3724, Nature=0.4606, Sales=0.5600, Transport=0.4138, Web/CloudOps=0.4293. +- frequency skill: A=0.3405, D=0.4280, H=0.3865, M=0.1811, Q=0.1490, S=0.2826, T=0.3439, W=0.2424. +- variates skill: multivariate=0.3585, univariate=0.3475. +- Outcome: Horizon jitter gains main+0.000697 and earlier2+0.000423, but loses earlier1 by0.000300. Continue to6000 to assess whether the effect persists; no package change. + +## E57 period-relative phase projection, initial screen +- Checkpoint SHA-256: `275e6d68dda364b71999bf311a8ce7acf09ae4fb4642b8e07c404dd1bd9849ca`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 29.636561393737793 seconds. +- Overall skill 0.375793; relative MASE 0.745649; relative WQL 0.522544. +- term skill: long=0.3998, medium=0.4067, short=0.3540. +- domain skill: Econ/Fin=0.1396, Energy=0.2348, Healthcare=0.4406, Nature=0.4284, Sales=0.3399, Transport=0.4658, Web/CloudOps=0.5006. +- frequency skill: A=0.3762, D=0.3542, H=0.3951, M=0.0954, Q=0.1982, S=0.4239, T=0.4362, W=0.2090. +- variates skill: multivariate=0.3937, univariate=0.3611. +- Outcome: Exactly equal to the E47 parent score0.3757929301726527, validating the zero-initialized runtime before training. + +## E55 final12000 matched training difference, screen +- Checkpoint SHA-256: `721d1029284ea6f36d4c6f169eb001382a97a2848953fad84e3e62fb5a222802`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 28.509355783462524 seconds. +- Overall skill 0.375956; relative MASE 0.746201; relative WQL 0.521885. +- term skill: long=0.3991, medium=0.4059, short=0.3549. +- domain skill: Econ/Fin=0.1387, Energy=0.2371, Healthcare=0.4442, Nature=0.4287, Sales=0.3348, Transport=0.4657, Web/CloudOps=0.4989. +- frequency skill: A=0.3739, D=0.3506, H=0.3961, M=0.1054, Q=0.1984, S=0.4235, T=0.4345, W=0.2191. +- variates skill: multivariate=0.3928, univariate=0.3622. +- Outcome: Skill0.375956 versus selected E47 score0.375793. This is a larger screen gain than the6000-step difference; evaluate both earlier cutoffs before selecting. + +## E57 period-relative phase projections1000, screen +- Checkpoint SHA-256: `2deeff17c98c6993f9da1713c973fe0f803358a717c021e81438cdf203ae5f51`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 29.055758476257324 seconds. +- Overall skill 0.375590; relative MASE 0.745958; relative WQL 0.522667. +- term skill: long=0.3989, medium=0.4062, short=0.3542. +- domain skill: Econ/Fin=0.1398, Energy=0.2354, Healthcare=0.4399, Nature=0.4278, Sales=0.3393, Transport=0.4661, Web/CloudOps=0.4996. +- frequency skill: A=0.3762, D=0.3549, H=0.3950, M=0.0942, Q=0.1970, S=0.4219, T=0.4359, W=0.2092. +- variates skill: multivariate=0.3933, univariate=0.3612. +- Outcome: Skill0.375590 is slightly below the parent0.375793. Continue to3000/6000 to assess whether training recovers, as the previous confidence projection did late in its schedule. + +## E42 final12000 matched comparison: large_corpus_control, backcast +- Checkpoint SHA-256: `7f9ba5e01ac59c51a3b63d3067b442e23e15d0abc51ddbcccdd04d6083ae4add`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 27.9762020111084 seconds. +- Overall skill 0.330213; relative MASE 0.806120; relative WQL 0.556510. +- term skill: long=0.3888, medium=0.3557, short=0.2960. +- domain skill: Econ/Fin=0.1456, Energy=0.2279, Healthcare=0.4182, Nature=0.3493, Sales=0.3975, Transport=0.3647, Web/CloudOps=0.4422. +- frequency skill: A=0.2987, D=0.3583, H=0.3572, M=0.1590, Q=0.2332, S=0.3409, T=0.3303, W=0.2690. +- variates skill: multivariate=0.3460, univariate=0.3174. +- Outcome: Final partial-target model gains main+0.000575 and earlier1+0.000861, but loses earlier2 by0.000358. Direct model remains below the published later lineage. + +## E42 final12000 matched comparison: partial_targets, backcast +- Checkpoint SHA-256: `a0ef29e85d0cf01677a6a58e4a9f91b077073c4af95f85234eec2ddc223f4837`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 27.47197651863098 seconds. +- Overall skill 0.331074; relative MASE 0.805060; relative WQL 0.555811. +- term skill: long=0.3901, medium=0.3561, short=0.2969. +- domain skill: Econ/Fin=0.1467, Energy=0.2289, Healthcare=0.4192, Nature=0.3505, Sales=0.3984, Transport=0.3646, Web/CloudOps=0.4431. +- frequency skill: A=0.3115, D=0.3560, H=0.3581, M=0.1677, Q=0.2337, S=0.3423, T=0.3297, W=0.2763. +- variates skill: multivariate=0.3468, univariate=0.3183. +- Outcome: Final partial-target model gains main+0.000575 and earlier1+0.000861, but loses earlier2 by0.000358. Direct model remains below the published later lineage. + +## E55 final12000 transferred difference, backcast +- Checkpoint SHA-256: `721d1029284ea6f36d4c6f169eb001382a97a2848953fad84e3e62fb5a222802`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 26.976391792297363 seconds. +- Overall skill 0.335609; relative MASE 0.797954; relative WQL 0.553184. +- term skill: long=0.3979, medium=0.3572, short=0.3014. +- domain skill: Econ/Fin=0.1631, Energy=0.2288, Healthcare=0.4091, Nature=0.3616, Sales=0.3971, Transport=0.3715, Web/CloudOps=0.4491. +- frequency skill: A=0.3254, D=0.3493, H=0.3647, M=0.1918, Q=0.2328, S=0.3430, T=0.3345, W=0.2857. +- variates skill: multivariate=0.3525, univariate=0.3218. +- Outcome: Transfer gains main+0.000163 and earlier1+0.001483, but loses earlier2 by0.001028. Average gain across the three cutoffs is positive; run exact full validation before deciding whether to publish this tradeoff. + +## E42 final12000 matched comparison: large_corpus_control, backcast2 +- Checkpoint SHA-256: `7f9ba5e01ac59c51a3b63d3067b442e23e15d0abc51ddbcccdd04d6083ae4add`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 26.495740175247192 seconds. +- Overall skill 0.353454; relative MASE 0.776299; relative WQL 0.538480. +- term skill: long=0.3687, medium=0.3751, short=0.3393. +- domain skill: Econ/Fin=0.0914, Energy=0.2288, Healthcare=0.3664, Nature=0.4591, Sales=0.5548, Transport=0.4142, Web/CloudOps=0.4303. +- frequency skill: A=0.3473, D=0.4293, H=0.3865, M=0.1743, Q=0.1540, S=0.2821, T=0.3466, W=0.2433. +- variates skill: multivariate=0.3605, univariate=0.3477. +- Outcome: Final partial-target model gains main+0.000575 and earlier1+0.000861, but loses earlier2 by0.000358. Direct model remains below the published later lineage. + +## E42 final12000 matched comparison: partial_targets, backcast2 +- Checkpoint SHA-256: `a0ef29e85d0cf01677a6a58e4a9f91b077073c4af95f85234eec2ddc223f4837`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 27.049270629882812 seconds. +- Overall skill 0.353096; relative MASE 0.776739; relative WQL 0.538771. +- term skill: long=0.3692, medium=0.3760, short=0.3381. +- domain skill: Econ/Fin=0.0920, Energy=0.2294, Healthcare=0.3671, Nature=0.4574, Sales=0.5540, Transport=0.4141, Web/CloudOps=0.4294. +- frequency skill: A=0.3519, D=0.4253, H=0.3874, M=0.1772, Q=0.1555, S=0.2805, T=0.3464, W=0.2443. +- variates skill: multivariate=0.3599, univariate=0.3476. +- Outcome: Final partial-target model gains main+0.000575 and earlier1+0.000861, but loses earlier2 by0.000358. Direct model remains below the published later lineage. + +## E55 final12000 transferred difference, backcast2 +- Checkpoint SHA-256: `721d1029284ea6f36d4c6f169eb001382a97a2848953fad84e3e62fb5a222802`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 26.92556405067444 seconds. +- Overall skill 0.357472; relative MASE 0.772231; relative WQL 0.534610. +- term skill: long=0.3642, medium=0.3858, short=0.3437. +- domain skill: Econ/Fin=0.1127, Energy=0.2350, Healthcare=0.3474, Nature=0.4678, Sales=0.5489, Transport=0.4199, Web/CloudOps=0.4300. +- frequency skill: A=0.3556, D=0.4262, H=0.3901, M=0.1532, Q=0.1527, S=0.2796, T=0.3567, W=0.2577. +- variates skill: multivariate=0.3616, univariate=0.3541. +- Outcome: Transfer gains main+0.000163 and earlier1+0.001483, but loses earlier2 by0.001028. Average gain across the three cutoffs is positive; run exact full validation before deciding whether to publish this tradeoff. + +E31 amplitude-varying synthetic run completed24000 steps in7471.1 elapsed training-loop seconds on the shared H100. Final checkpoint is being checked with the selected fixed inference rules at all three cutoffs. + +## E58: increase width from our own trained model (preparing) +Repeated continuations of the36.8M model show diminishing gains. Hypothesis: more capacity can improve learning from the allowed corpus after a function-preserving initialization, given a sufficiently long matched schedule. Widen the selected E47 model from d512/heads8 to d1024/heads16, retaining enc6/dec4 and patch16. Duplicate hidden representations; duplicate input columns with weights divided by2; duplicate output rows. Preserve attention K/V grouping, repeat layernorm vectors, and repeat the original512-dimensional positional vector. Verify the unperturbed conversion on fixed synthetic fixtures. Then add independently seeded1%-of-tensor-standard-deviation noise to matrix weights to break duplicated-neuron symmetry, measuring the resulting prediction change. This is an initialization derived only from our own trained weights. + +A matched original-width control will use the same parent, data windows, seed113 and original sign-augmented loss. Proposed batch128, LR3e-5 and24000-step schedule are subject to a maximum-shape memory check after E31 releases its training slot. For widened matrices with duplicated input columns, use half the base learning rate and twice the weight decay to retain comparable initial functional update/decay scales; other parameters use the original rate. These settings and any necessary memory-driven batch adjustment will be recorded before training. No external weights or data. + +## E55 final12000 transferred update, exact full package validation +- Checkpoint SHA-256: `721d1029284ea6f36d4c6f169eb001382a97a2848953fad84e3e62fb5a222802`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.372143; relative MASE 0.748865; relative WQL 0.526402. +- term skill: long=0.3930, medium=0.4049, short=0.3509. +- domain skill: Econ/Fin=0.1163, Energy=0.2302, Healthcare=0.4510, Nature=0.4286, Sales=0.3487, Transport=0.4659, Web/CloudOps=0.4912. +- frequency skill: A=0.2931, D=0.3551, H=0.3913, M=0.1284, Q=0.1851, S=0.4235, T=0.4275, W=0.2120. +- variates skill: multivariate=0.3885, univariate=0.3588. +- Outcome: Select for publication after relocation and determinism checks. Full skill0.372143 improves on E47 score0.371766. All97 configurations and151170 instances passed, with no quantile crossings; actual inference123.68 seconds. Earlier temporal diagnostics retain a tradeoff: first earlier cutoff+0.001483, second earlier cutoff-0.001028. The mean gain across the main and two earlier screens is positive; this is validation selection, not a held-out reward claim. + +E58 conversion produced 146477344 parameters. Maximum normalized-quantile difference before noise was 0.000001669; after the fixed1% matrix noise it was 0.018048. Conversion took 2.38 CPU seconds. Parent hash and noise seed113 are recorded in wide_capacity_initial.pt.json. + +Maximum-shape memory checks, including optimizer moments and EMA placeholders, used13326 MiB reserved at batch128 and10708 MiB at batch96; both had finite gradients. Choose batch96 for both arms to preserve evaluation headroom. Increase the planned schedule from24000 to32000 steps so the planned number of windows remains3072000 per arm. Save/evaluate4000,8000,16000,24000,32000. Base LR3e-5, seed113, unchanged context/horizon mixture and packed_sample. Wider-matrix LR multiplier0.5 and decay multiplier2 remain as declared. Start the wide arm now that E31 has exited; queue the original-width control after E57 completes. Research and package inference use batch64 for both widths to keep memory comparable. + +E55 relocation/determinism checks passed: the candidate and a separate fresh /tmp copy, both launched from /tmp, produced bitwise identical finite monotone quantiles for daily, hourly and multivariate medium-horizon examples. Publish the complete model/report/manifest/provenance/log bundle atomically. + +## E59: equal-weight ensemble of complementary training variants +The final E31 amplitude-varying model improves both earlier cutoffs over its recency24000 control, while its main fixed-rule screen is lower. The selected E55 transfer has the opposite second-earlier tradeoff. Hypothesis: an equal-weight average can reduce these differences. Reuse cached quantiles for E55 partial_delta12k and E31 amplitude24000, with both members forecasting every instance. Test only the fixed50/50 average, with and without applying the selected zero0.4 projection once more after averaging; averaging two zero-projected forecasts can otherwise introduce small positive values. No weight sweep or training. If promising, build and validate the actual two-member runtime before publication. + +## E31 final24000 with selected fixed rules, screen +- Checkpoint SHA-256: `ecab9102fc11909555044c67dffda85280e06a375f1733351c7e9a39bf2ce9bb`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.934752464294434 seconds. +- Overall skill 0.375166; relative MASE 0.746944; relative WQL 0.522686. +- term skill: long=0.3998, medium=0.4070, short=0.3527. +- domain skill: Econ/Fin=0.1414, Energy=0.2355, Healthcare=0.4087, Nature=0.4266, Sales=0.3412, Transport=0.4655, Web/CloudOps=0.5053. +- frequency skill: A=0.3762, D=0.3445, H=0.3950, M=0.0900, Q=0.2023, S=0.4234, T=0.4389, W=0.2104. +- variates skill: multivariate=0.3958, univariate=0.3582. +- Outcome: Relative to E25 recency24000: main-0.000336, earlier1+0.000565, earlier2+0.000635. Do not replace the main package with this model alone. Test the prespecified equal-weight blend with the selected E55 model. + +## E31 final24000 with selected fixed rules, backcast +- Checkpoint SHA-256: `ecab9102fc11909555044c67dffda85280e06a375f1733351c7e9a39bf2ce9bb`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 23.675416946411133 seconds. +- Overall skill 0.334745; relative MASE 0.799254; relative WQL 0.553722. +- term skill: long=0.3965, medium=0.3574, short=0.3003. +- domain skill: Econ/Fin=0.1603, Energy=0.2277, Healthcare=0.4000, Nature=0.3619, Sales=0.3979, Transport=0.3709, Web/CloudOps=0.4497. +- frequency skill: A=0.3115, D=0.3485, H=0.3643, M=0.1990, Q=0.2289, S=0.3403, T=0.3365, W=0.2702. +- variates skill: multivariate=0.3522, univariate=0.3205. +- Outcome: Relative to E25 recency24000: main-0.000336, earlier1+0.000565, earlier2+0.000635. Do not replace the main package with this model alone. Test the prespecified equal-weight blend with the selected E55 model. + +## E31 final24000 with selected fixed rules, backcast2 +- Checkpoint SHA-256: `ecab9102fc11909555044c67dffda85280e06a375f1733351c7e9a39bf2ce9bb`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 24.473368406295776 seconds. +- Overall skill 0.358910; relative MASE 0.771616; relative WQL 0.532644. +- term skill: long=0.3672, medium=0.3833, short=0.3462. +- domain skill: Econ/Fin=0.1126, Energy=0.2349, Healthcare=0.3493, Nature=0.4705, Sales=0.5536, Transport=0.4202, Web/CloudOps=0.4327. +- frequency skill: A=0.3556, D=0.4300, H=0.3901, M=0.1370, Q=0.1497, S=0.2870, T=0.3573, W=0.2669. +- variates skill: multivariate=0.3623, univariate=0.3562. +- Outcome: Relative to E25 recency24000: main-0.000336, earlier1+0.000565, earlier2+0.000635. Do not replace the main package with this model alone. Test the prespecified equal-weight blend with the selected E55 model. + +## E59 cached equal-weight comparison +No training; fixed inference seed0 and ensemble weight0.5 for each member. Member weights: selected E55 partial_delta12k SHA-256 721d1029284ea6f36d4c6f169eb001382a97a2848953fad84e3e62fb5a222802; amplitude24000 hash is recorded in its matched reports. + +screen: 2.65 CPU diagnostic seconds. +- average: skill 0.376116; term: short=0.3545, medium=0.4069, long=0.3997; domain: Econ/Fin=0.1408, Energy=0.2367, Healthcare=0.4304, Nature=0.4279, Sales=0.3385, Transport=0.4658, Web/CloudOps=0.5025; freq: A-DEC=0.3755, Q-DEC=0.2008, M=0.0994, W-SUN=0.0865, D=0.3491, H=0.3958, 15T=0.2143, W-FRI=-0.0164, 10T=0.6125, W-TUE=0.5565, W-THU=0.2049, W-WED=0.3155, 5T=0.5141, 10S=0.4235. +- average_then_zero: skill 0.376000; term: short=0.3545, medium=0.4068, long=0.3994; domain: Econ/Fin=0.1408, Energy=0.2367, Healthcare=0.4304, Nature=0.4277, Sales=0.3386, Transport=0.4658, Web/CloudOps=0.5021; freq: A-DEC=0.3755, Q-DEC=0.2008, M=0.0999, W-SUN=0.0865, D=0.3489, H=0.3957, 15T=0.2143, W-FRI=-0.0164, 10T=0.6124, W-TUE=0.5565, W-THU=0.2049, W-WED=0.3154, 5T=0.5138, 10S=0.4235. + +backcast: 2.59 CPU diagnostic seconds. +- average: skill 0.335702; term: short=0.3015, medium=0.3577, long=0.3976; domain: Econ/Fin=0.1625, Energy=0.2286, Healthcare=0.4066, Nature=0.3622, Sales=0.3978, Transport=0.3714, Web/CloudOps=0.4500; freq: A-DEC=0.3193, Q-DEC=0.2313, M=0.1979, W-SUN=0.0360, D=0.3493, H=0.3648, 15T=0.2260, W-FRI=0.2606, 10T=0.3193, W-TUE=0.5296, W-THU=0.2330, W-WED=0.3440, 5T=0.4376, 10S=0.3419. +- average_then_zero: skill 0.335612; term: short=0.3014, medium=0.3575, long=0.3976; domain: Econ/Fin=0.1625, Energy=0.2286, Healthcare=0.4066, Nature=0.3619, Sales=0.3980, Transport=0.3714, Web/CloudOps=0.4498; freq: A-DEC=0.3193, Q-DEC=0.2313, M=0.1983, W-SUN=0.0360, D=0.3491, H=0.3648, 15T=0.2260, W-FRI=0.2606, 10T=0.3188, W-TUE=0.5296, W-THU=0.2330, W-WED=0.3440, 5T=0.4372, 10S=0.3419. + +backcast2: 2.43 CPU diagnostic seconds. +- average: skill 0.358667; term: short=0.3455, medium=0.3850, long=0.3661; domain: Econ/Fin=0.1134, Energy=0.2353, Healthcare=0.3493, Nature=0.4696, Sales=0.5519, Transport=0.4203, Web/CloudOps=0.4320; freq: A-DEC=0.3562, Q-DEC=0.1515, M=0.1452, W-SUN=0.0558, D=0.4288, H=0.3904, 15T=0.1044, W-FRI=0.1452, 10T=0.4937, W-TUE=0.1018, W-THU=0.3276, W-WED=0.5366, 5T=0.4664, 10S=0.2839. +- average_then_zero: skill 0.358497; term: short=0.3453, medium=0.3849, long=0.3659; domain: Econ/Fin=0.1134, Energy=0.2352, Healthcare=0.3493, Nature=0.4693, Sales=0.5513, Transport=0.4203, Web/CloudOps=0.4318; freq: A-DEC=0.3562, Q-DEC=0.1515, M=0.1452, W-SUN=0.0558, D=0.4286, H=0.3904, 15T=0.1044, W-FRI=0.1452, 10T=0.4927, W-TUE=0.1018, W-THU=0.3276, W-WED=0.5364, 5T=0.4661, 10S=0.2839. + +Outcome: plain averaging wins all three cutoffs over the selected single model. Reapplying the zero projection after averaging is worse at every cutoff. Build the actual two-member package and verify cached/runtime agreement, full validation and relocation before publication. + +E58 wide_capacity_control training started at 2026-10-22T05:35:38Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E59 actual two-member runtime produced bitwise identical quantiles to the cached plain50/50 average for every point in all97 main-screen configurations. Its screening skill is0.37611643951533646, matching the probe exactly. Proceed to actual full-package inference and scoring. + +## E57 period-relative phase projections3000, screen +- Checkpoint SHA-256: `740fed81313fbb2dc2060173ae11ed120d6cca9600620cd1c9d9331ccac699e5`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.340542793273926 seconds. +- Overall skill 0.375400; relative MASE 0.745694; relative WQL 0.523171. +- term skill: long=0.3995, medium=0.4066, short=0.3534. +- domain skill: Econ/Fin=0.1392, Energy=0.2355, Healthcare=0.4394, Nature=0.4265, Sales=0.3394, Transport=0.4660, Web/CloudOps=0.4999. +- frequency skill: A=0.3762, D=0.3544, H=0.3946, M=0.0943, Q=0.1976, S=0.4227, T=0.4359, W=0.2085. +- variates skill: multivariate=0.3928, univariate=0.3611. +- Outcome: The6000-step score0.375840 is only0.000047 above its E47 parent, after earlier regressions. Existing model tensors remain bitwise unchanged. Check earlier cutoffs before selecting any use of these projections. + +## E57 period-relative phase projections6000, screen +- Checkpoint SHA-256: `956fb0c541a5ae81aaccd7b059143720c5b55d0c030df0162d2eae0736701832`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 29.05087399482727 seconds. +- Overall skill 0.375840; relative MASE 0.745321; relative WQL 0.522695. +- term skill: long=0.3997, medium=0.4065, short=0.3542. +- domain skill: Econ/Fin=0.1396, Energy=0.2356, Healthcare=0.4472, Nature=0.4272, Sales=0.3377, Transport=0.4655, Web/CloudOps=0.4998. +- frequency skill: A=0.3762, D=0.3562, H=0.3947, M=0.0979, Q=0.1989, S=0.4232, T=0.4357, W=0.2089. +- variates skill: multivariate=0.3935, univariate=0.3614. +- Outcome: The6000-step score0.375840 is only0.000047 above its E47 parent, after earlier regressions. Existing model tensors remain bitwise unchanged. Check earlier cutoffs before selecting any use of these projections. + +E57 completed6000 steps in1147.4 elapsed training-loop seconds. Every pre-existing tensor is bitwise equal to the E47 parent; only the65536 phase-projection parameters changed. E58 original-width control started after this process exited. + +## E58 widened initialization, main screen at batch64 +- Checkpoint SHA-256: `495eed9e1a09379b3cbcdadbee447d2c519a2cff8239c0756cf94f49f8a1b55e`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 43.54188299179077 seconds. +- Overall skill 0.375710; relative MASE 0.745704; relative WQL 0.522645. +- term skill: long=0.3998, medium=0.4067, short=0.3538. +- domain skill: Econ/Fin=0.1394, Energy=0.2348, Healthcare=0.4397, Nature=0.4283, Sales=0.3400, Transport=0.4658, Web/CloudOps=0.5006. +- frequency skill: A=0.3762, D=0.3540, H=0.3951, M=0.0946, Q=0.1984, S=0.4240, T=0.4362, W=0.2087. +- variates skill: multivariate=0.3937, univariate=0.3610. +- Outcome: Initial score0.375710 remains close to the original model before any larger-model training. The matched original-width initialization at the same inference batch size is being checked. + +## E56 log window loss3000, matched screen +- Checkpoint SHA-256: `14dd06fb6dff3c336f5aa26b8525d7ccb921a80b3e7be4d22b285584c14ff3bd`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 28.476420640945435 seconds. +- Overall skill 0.357135; relative MASE 0.765561; relative WQL 0.539835. +- term skill: long=0.3893, medium=0.3998, short=0.3270. +- domain skill: Econ/Fin=0.1142, Energy=0.1808, Healthcare=0.3930, Nature=0.4235, Sales=0.3538, Transport=0.4615, Web/CloudOps=0.5024. +- frequency skill: A=0.3804, D=0.3293, H=0.3825, M=0.1125, Q=0.2032, S=0.4413, T=0.3984, W=0.2094. +- variates skill: multivariate=0.3893, univariate=0.3303. +- Outcome: Score0.357135 regresses versus original-loss control0.358802. Continue to6000 before deciding whether to stop this objective. + +## E48 phase diffusion6000, matched screen +- Checkpoint SHA-256: `8d6371333e936bbfc2aa746819bfd0cedd392f873ce79c1d6f729b205c3f0b87`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.55935049057007 seconds. +- Overall skill 0.356225; relative MASE 0.765189; relative WQL 0.541626. +- term skill: long=0.3862, medium=0.3999, short=0.3266. +- domain skill: Econ/Fin=0.1072, Energy=0.1811, Healthcare=0.4144, Nature=0.4178, Sales=0.3484, Transport=0.4543, Web/CloudOps=0.5048. +- frequency skill: A=0.3702, D=0.3423, H=0.3775, M=0.0903, Q=0.1971, S=0.4361, T=0.4007, W=0.2000. +- variates skill: multivariate=0.3887, univariate=0.3292. +- Outcome: Score0.356225 versus amplitude-only0.355543: the main gain persists at6000. Earlier cutoffs are being evaluated. + +## E52 varied requested horizons6000, matched screen +- Checkpoint SHA-256: `1276edf6f471ab96e61e61ead3cb813a58a4cadfac530d2c190072d9b211c182`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 27.603736400604248 seconds. +- Overall skill 0.359683; relative MASE 0.762743; relative WQL 0.537542. +- term skill: long=0.3900, medium=0.4024, short=0.3303. +- domain skill: Econ/Fin=0.1129, Energy=0.1876, Healthcare=0.4160, Nature=0.4253, Sales=0.3425, Transport=0.4576, Web/CloudOps=0.5040. +- frequency skill: A=0.3774, D=0.3429, H=0.3812, M=0.1107, Q=0.1984, S=0.4413, T=0.4021, W=0.2071. +- variates skill: multivariate=0.3915, univariate=0.3332. +- Outcome: Score0.359683 versus E42 partial-target control0.359222: a smaller main gain persists. Check both earlier cutoffs. + +## E54 original-context control6000, screen +- Checkpoint SHA-256: `14d964cb2b828f8e81c8b656b33da583b2f5fb48a3f003d043ba7c0b88cd3137`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.69702458381653 seconds. +- Overall skill 0.374515; relative MASE 0.746663; relative WQL 0.523973. +- term skill: long=0.3995, medium=0.4071, short=0.3516. +- domain skill: Econ/Fin=0.1381, Energy=0.2362, Healthcare=0.4110, Nature=0.4291, Sales=0.3380, Transport=0.4658, Web/CloudOps=0.5007. +- frequency skill: A=0.3757, D=0.3496, H=0.3960, M=0.0674, Q=0.2005, S=0.4225, T=0.4371, W=0.2070. +- variates skill: multivariate=0.3945, univariate=0.3581. +- Outcome: Fresh continuation is below the E25 parent. Keep as the matched source-window/seed reference for the8192-context arm. + +## E48 matched6000 comparison: amplitude_synth, backcast +- Checkpoint SHA-256: `7fe2746b237fb2699c2d8c812595666df0888cde656498043e01847bb552c783`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 21.44511580467224 seconds. +- Overall skill 0.324002; relative MASE 0.810229; relative WQL 0.564005. +- term skill: long=0.3880, medium=0.3521, short=0.2864. +- domain skill: Econ/Fin=0.1415, Energy=0.2210, Healthcare=0.3855, Nature=0.3485, Sales=0.3980, Transport=0.3607, Web/CloudOps=0.4366. +- frequency skill: A=0.3171, D=0.3509, H=0.3541, M=0.1703, Q=0.2160, S=0.3413, T=0.3204, W=0.2494. +- variates skill: multivariate=0.3381, univariate=0.3126. +- Outcome: Phase diffusion retains a main gain but loses about0.0011 at both earlier cutoffs. The earlier3000-step gains did not persist. Stop this branch; it is not selected. + +## E48 matched6000 comparison: phase_synth, backcast +- Checkpoint SHA-256: `8d6371333e936bbfc2aa746819bfd0cedd392f873ce79c1d6f729b205c3f0b87`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 26.959611415863037 seconds. +- Overall skill 0.322903; relative MASE 0.811500; relative WQL 0.564954. +- term skill: long=0.3870, medium=0.3532, short=0.2843. +- domain skill: Econ/Fin=0.1406, Energy=0.2220, Healthcare=0.3697, Nature=0.3497, Sales=0.3989, Transport=0.3583, Web/CloudOps=0.4353. +- frequency skill: A=0.3141, D=0.3444, H=0.3533, M=0.1676, Q=0.2139, S=0.3417, T=0.3204, W=0.2546. +- variates skill: multivariate=0.3382, univariate=0.3105. +- Outcome: Phase diffusion retains a main gain but loses about0.0011 at both earlier cutoffs. The earlier3000-step gains did not persist. Stop this branch; it is not selected. + +## E48 matched6000 comparison: amplitude_synth, backcast2 +- Checkpoint SHA-256: `7fe2746b237fb2699c2d8c812595666df0888cde656498043e01847bb552c783`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 20.365211486816406 seconds. +- Overall skill 0.349572; relative MASE 0.778615; relative WQL 0.543345. +- term skill: long=0.3660, medium=0.3724, short=0.3345. +- domain skill: Econ/Fin=0.0821, Energy=0.2234, Healthcare=0.3611, Nature=0.4581, Sales=0.5590, Transport=0.4121, Web/CloudOps=0.4247. +- frequency skill: A=0.3403, D=0.4277, H=0.3841, M=0.1545, Q=0.1409, S=0.2820, T=0.3394, W=0.2470. +- variates skill: multivariate=0.3548, univariate=0.3453. +- Outcome: Phase diffusion retains a main gain but loses about0.0011 at both earlier cutoffs. The earlier3000-step gains did not persist. Stop this branch; it is not selected. + +## E48 matched6000 comparison: phase_synth, backcast2 +- Checkpoint SHA-256: `8d6371333e936bbfc2aa746819bfd0cedd392f873ce79c1d6f729b205c3f0b87`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 25.906906366348267 seconds. +- Overall skill 0.348439; relative MASE 0.780846; relative WQL 0.543682. +- term skill: long=0.3636, medium=0.3707, short=0.3341. +- domain skill: Econ/Fin=0.0817, Energy=0.2219, Healthcare=0.3552, Nature=0.4580, Sales=0.5591, Transport=0.4110, Web/CloudOps=0.4239. +- frequency skill: A=0.3402, D=0.4247, H=0.3827, M=0.1524, Q=0.1420, S=0.2780, T=0.3407, W=0.2441. +- variates skill: multivariate=0.3541, univariate=0.3439. +- Outcome: Phase diffusion retains a main gain but loses about0.0011 at both earlier cutoffs. The earlier3000-step gains did not persist. Stop this branch; it is not selected. + +## E59 equal-weight two-member ensemble, exact full package validation +- Checkpoint SHA-256: `a5f575ec44defbc0ca0c4aeb29618bbcc0e09f726985851eee4027ea698cfadd`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.372254; relative MASE 0.748754; relative WQL 0.526294. +- term skill: long=0.3937, medium=0.4059, short=0.3504. +- domain skill: Econ/Fin=0.1179, Energy=0.2297, Healthcare=0.4376, Nature=0.4278, Sales=0.3512, Transport=0.4661, Web/CloudOps=0.4950. +- frequency skill: A=0.2917, D=0.3537, H=0.3910, M=0.1216, Q=0.1860, S=0.4235, T=0.4302, W=0.2080. +- variates skill: multivariate=0.3905, univariate=0.3573. +- Outcome: Select after relocation/determinism checks: full skill0.372254 versus single-model0.372143; relative MASE0.748754 and WQL0.526294. All97 configurations and151170 instances passed with no quantile crossings. Actual package inference234.68 seconds while training shared the one H100. Main screening and both earlier cutoffs improve; every member forecasts every instance with fixed equal weights. + +E48 stopped cleanly at step7631, after 2736.0 elapsed process seconds at the stop request. Final checkpoint SHA-256 `702c419a404c2aad31011fb824ace504576f5e74244fc4228229fdfb2d970a9a`. The stop checkpoint is retained for provenance and is not selected. + +E59 relocation/determinism passed: the two-member candidate and a separate /tmp copy, both launched from /tmp, produced bitwise identical finite monotone forecasts on daily, hourly and multivariate medium-horizon examples. The complete two-member package is ready for atomic publication. + +## E57 phase projections final6000, backcast +- Checkpoint SHA-256: `956fb0c541a5ae81aaccd7b059143720c5b55d0c030df0162d2eae0736701832`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 25.856826066970825 seconds. +- Overall skill 0.333418; relative MASE 0.800235; relative WQL 0.555251. +- term skill: long=0.3968, medium=0.3558, short=0.2984. +- domain skill: Econ/Fin=0.1603, Energy=0.2271, Healthcare=0.4058, Nature=0.3594, Sales=0.3943, Transport=0.3716, Web/CloudOps=0.4455. +- frequency skill: A=0.3079, D=0.3513, H=0.3638, M=0.1776, Q=0.2354, S=0.3427, T=0.3327, W=0.2745. +- variates skill: multivariate=0.3498, univariate=0.3201. +- Outcome: Reject this feature addition: main gain0.000047 is offset by earlier1 loss0.000708 and earlier2 loss0.000030 versus the frozen E47 parent. No package change from this branch. + +## E52 varied requested horizons6000, backcast +- Checkpoint SHA-256: `1276edf6f471ab96e61e61ead3cb813a58a4cadfac530d2c190072d9b211c182`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 24.876362562179565 seconds. +- Overall skill 0.330107; relative MASE 0.806559; relative WQL 0.556384. +- term skill: long=0.3900, medium=0.3554, short=0.2954. +- domain skill: Econ/Fin=0.1459, Energy=0.2294, Healthcare=0.4132, Nature=0.3489, Sales=0.3970, Transport=0.3634, Web/CloudOps=0.4423. +- frequency skill: A=0.3187, D=0.3539, H=0.3583, M=0.1613, Q=0.2281, S=0.3442, T=0.3292, W=0.2708. +- variates skill: multivariate=0.3469, univariate=0.3164. +- Outcome: Relative to E42 partial-target control6000: main+0.000461, earlier1-0.000193, earlier2+0.000278. Continue to the final12000 checkpoint; a small positive average effect persists. + +## E57 phase projections final6000, backcast2 +- Checkpoint SHA-256: `956fb0c541a5ae81aaccd7b059143720c5b55d0c030df0162d2eae0736701832`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 25.712015867233276 seconds. +- Overall skill 0.358470; relative MASE 0.770691; relative WQL 0.534015. +- term skill: long=0.3646, medium=0.3858, short=0.3453. +- domain skill: Econ/Fin=0.1102, Energy=0.2363, Healthcare=0.3561, Nature=0.4700, Sales=0.5508, Transport=0.4205, Web/CloudOps=0.4287. +- frequency skill: A=0.3495, D=0.4331, H=0.3891, M=0.1593, Q=0.1505, S=0.2824, T=0.3568, W=0.2548. +- variates skill: multivariate=0.3620, univariate=0.3556. +- Outcome: Reject this feature addition: main gain0.000047 is offset by earlier1 loss0.000708 and earlier2 loss0.000030 versus the frozen E47 parent. No package change from this branch. + +## E52 varied requested horizons6000, backcast2 +- Checkpoint SHA-256: `1276edf6f471ab96e61e61ead3cb813a58a4cadfac530d2c190072d9b211c182`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 24.18545150756836 seconds. +- Overall skill 0.353179; relative MASE 0.775830; relative WQL 0.539265. +- term skill: long=0.3689, medium=0.3764, short=0.3382. +- domain skill: Econ/Fin=0.0847, Energy=0.2293, Healthcare=0.3759, Nature=0.4588, Sales=0.5595, Transport=0.4134, Web/CloudOps=0.4274. +- frequency skill: A=0.3432, D=0.4263, H=0.3869, M=0.1771, Q=0.1489, S=0.2829, T=0.3454, W=0.2495. +- variates skill: multivariate=0.3591, univariate=0.3484. +- Outcome: Relative to E42 partial-target control6000: main+0.000461, earlier1-0.000193, earlier2+0.000278. Continue to the final12000 checkpoint; a small positive average effect persists. + +## E60 filtered shared drivers for a frozen cross-channel adapter +Hypothesis: earlier joint adapters saw lagged shared latent drivers but no channel-specific response filtering. A synthetic fast driver and a smoothed response may better represent thermal and energy relationships. Compare original joint generation against causal exponential filtering of half the channels in half the synthetic groups. Filtering time constant is log-uniform from1 to316 steps, applied before observation noise with256 warmup points and stationary initial level. Real windows, latent drivers, coefficients, noise, signs and scales use matched main RNG draws. +- Parent: own E55 partial_delta12k checkpoint, SHA-256721d1029284ea6f36d4c6f169eb001382a97a2848953fad84e3e62fb5a222802. All original weights frozen. Add the previously tested zero-output cross-channel attention adapter (1051136 parameters). Every instance is forecast; one-channel inputs have the identity adapter. +- Data: the26 allow-listed sources in packed_joint plus the original locally generated multivariate latent-driver generator. Synthetic fraction0.30. Candidate adds the declared filtered-response generator. No validation input or labels enter training. +- Matched seed137; independent filter seed400140. Groups16, channels2/3/4/8 with probabilities0.4/0.2/0.2/0.2; contexts512/1024/2048/4096 and horizons32/128/512/1024 follow the original joint sampler. Paired-sign loss in both arms, AdamW LR0.0002,6000 steps, save1000/3000/6000 for diagnostics. One shared H100; training elapsed time will be recorded separately for each arm. +- Selection: compare all97 configurations and both earlier cutoffs against the frozen parent and matched control. First verify sampler matching, identity initialization and maximum-shape memory without optimizer updates. No outcome yet. + +## E56 logarithmic window loss3000 +- Checkpoint SHA-256: `14dd06fb6dff3c336f5aa26b8525d7ccb921a80b3e7be4d22b285584c14ff3bd`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 28.476420640945435 seconds. +- Overall skill 0.357135; relative MASE 0.765561; relative WQL 0.539835. +- term skill: long=0.3893, medium=0.3998, short=0.3270. +- domain skill: Econ/Fin=0.1142, Energy=0.1808, Healthcare=0.3930, Nature=0.4235, Sales=0.3538, Transport=0.4615, Web/CloudOps=0.5024. +- frequency skill: A=0.3804, D=0.3293, H=0.3825, M=0.1125, Q=0.2032, S=0.4413, T=0.3984, W=0.2094. +- variates skill: multivariate=0.3893, univariate=0.3303. +- Outcome: Below matched control; the loss transformation is not selected. + +## E56 logarithmic window loss6000 +- Checkpoint SHA-256: `3346c86c6ce73e739fdd2a286b7cd4c1dab7430f6ee1ea8056b8db4943c48d66`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 21.688469886779785 seconds. +- Overall skill 0.357689; relative MASE 0.764496; relative WQL 0.539655. +- term skill: long=0.3904, medium=0.4011, short=0.3270. +- domain skill: Econ/Fin=0.1167, Energy=0.1822, Healthcare=0.3871, Nature=0.4260, Sales=0.3525, Transport=0.4624, Web/CloudOps=0.5018. +- frequency skill: A=0.3766, D=0.3301, H=0.3834, M=0.1073, Q=0.2061, S=0.4406, T=0.3995, W=0.2098. +- variates skill: multivariate=0.3901, univariate=0.3306. +- Outcome: Skill0.357689 versus matched control0.358628; second regression. Stop and retain existing linear window loss. + +## E54 recent4096 matched control final12000 +- Checkpoint SHA-256: `372edd6a03da9f577992a9cf6363b26efe7b11b35fc3aed2d50868566efd0c71`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.02079463005066 seconds. +- Overall skill 0.375764; relative MASE 0.744880; relative WQL 0.523131. +- term skill: long=0.4000, medium=0.4083, short=0.3532. +- domain skill: Econ/Fin=0.1410, Energy=0.2368, Healthcare=0.4240, Nature=0.4300, Sales=0.3368, Transport=0.4653, Web/CloudOps=0.5016. +- frequency skill: A=0.3753, D=0.3535, H=0.3960, M=0.0712, Q=0.2025, S=0.4230, T=0.4374, W=0.2130. +- variates skill: multivariate=0.3961, univariate=0.3591. +- Outcome: Finished12000 steps in2491.2 training-loop seconds. Small gain over frozen parent; await the8192 arm before interpretation. + +## E58 widened146M first4000 +- Checkpoint SHA-256: `a8e3dbf8f591804fb3ac6c72ac632dd9e18038e4da7f195208e56f85f41ecd29`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 34.12893605232239 seconds. +- Overall skill 0.374121; relative MASE 0.747837; relative WQL 0.523810. +- term skill: long=0.3989, medium=0.4070, short=0.3512. +- domain skill: Econ/Fin=0.1400, Energy=0.2366, Healthcare=0.4144, Nature=0.4278, Sales=0.3414, Transport=0.4641, Web/CloudOps=0.4992. +- frequency skill: A=0.3730, D=0.3465, H=0.3947, M=0.0955, Q=0.1987, S=0.4198, T=0.4367, W=0.2046. +- variates skill: multivariate=0.3940, univariate=0.3578. +- Outcome: Ahead of matched37M control by0.000510, but below initial checkpoint. Continue the prespecified longer capacity comparison. + +## E58 matched37M first4000 +- Checkpoint SHA-256: `65969ac2e314e6103c326ab0fe1c550d53a285833d9f983e1c1cdff0d7fb66b3`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.00419569015503 seconds. +- Overall skill 0.373612; relative MASE 0.748644; relative WQL 0.524097. +- term skill: long=0.3990, medium=0.4070, short=0.3502. +- domain skill: Econ/Fin=0.1392, Energy=0.2363, Healthcare=0.4121, Nature=0.4272, Sales=0.3410, Transport=0.4638, Web/CloudOps=0.4989. +- frequency skill: A=0.3725, D=0.3451, H=0.3948, M=0.0947, Q=0.1985, S=0.4190, T=0.4363, W=0.2034. +- variates skill: multivariate=0.3937, univariate=0.3572. +- Outcome: Below starting checkpoint; matched capacity comparison continues. + +E56 stop receipt: {"stopped_utc": "2026-10-22T05:53:09.078048+00:00", "reason": "Main screen below matched E38 control at both3000 and6000; prune negative branch.", "final_checkpoint": "/workspace/research/runs/log_window_loss/ema006767.pt", "final_checkpoint_sha256": "ec25440f0d11ac776874679e366255ce9cf54138f2e6802efba22bc88157d06c", "final_step": 6767, "elapsed_training_process_seconds": null} + +E56 measured training-process elapsed time was2298.259 seconds (the previous receipt field was null because the reader used the wrong key; corrected in log_window_loss_stop_receipt.json). + +E60 checks passed: { + "cpu_check_seconds": 1.9617000540019944, + "changed_synthetic_context_values": 21054, + "identity_matches_parent_bitwise": true, + "main_and_filter_rng_matched": true, + "real_windows_unchanged": true, + "optimizer_updates": 0, + "gpu_fixture_seconds": 1.0786702629411593, + "allocated_mib": 2625.63525390625, + "reserved_mib": 3872.0, + "parameters": 37851936, + "trainable_parameters": 1051136, + "loss": 0.3574138879776001 +} +Both arms now start on the shared H100. No optimizer updates occurred during fixtures. + +## E61 log-uniform autoregressive memory in synthetic windows +Hypothesis: the original AR coefficient uniform0.2..0.995 overwhelmingly supplies rapidly decorrelating noise. Energy and short-horizon electricity remain weak across cutoffs; slow stochastic level variation may be missing. Change only the AR coefficient draw to phi=exp(-1/tau), log10(tau) uniform0..4. Keep the existing zero initial state and sqrt(1-phi^2) innovation normalization. All Fourier seasons, trends, changepoints, intermittency, observation-noise draws, synthetic fraction and real-window draws remain matched. +- Matched reference is the already completed E42 partial_targets run; do not retrain it. Same own E25 recency12000 initialization, seed79, packed_sample95-source corpus, B256, AdamW LR0.00005,12000 steps, saves3000/6000/12000. The E42 handling of partially observed targets is unchanged. +- Source declaration if selected: original local generator plus the modified log-uniform AR-time-constant generator, seed79. No new external data or pretrained assets. +- Scheduled after E52 releases its H100 allocation. Validate main screening and both earlier cutoffs against E42 at matched steps, then consider a matched parameter-difference transfer only if the learned effect is useful. No outcome yet. + +E61 sampler checks passed: {"cpu_seconds": 4.961035819957033, "main_rng_matched": true, "real_windows_unchanged": true, "periods_and_missing_masks_unchanged": true, "changed_synthetic_context_values": 31554, "optimizer_updates": 0} + +## E60 joint_filtered_control_ema0 +- Checkpoint SHA-256: `3a7e46a74247ccf366c4e2b950fe1e1cc3625c52f7db1f6fdebab261d1d66ae8`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 24.121415376663208 seconds. +- Overall skill 0.375956; relative MASE 0.746201; relative WQL 0.521885. +- term skill: long=0.3991, medium=0.4059, short=0.3549. +- domain skill: Econ/Fin=0.1387, Energy=0.2371, Healthcare=0.4442, Nature=0.4287, Sales=0.3348, Transport=0.4657, Web/CloudOps=0.4989. +- frequency skill: A=0.3739, D=0.3506, H=0.3961, M=0.1054, Q=0.1984, S=0.4235, T=0.4345, W=0.2191. +- variates skill: multivariate=0.3928, univariate=0.3622. +- Outcome: Initial identity is exact. At1000 both adapters show a small main-screen improvement; filtered versus control difference0.000043 is inconclusive. Continue to matched3000/6000 and earlier-cutoff diagnostics. + +## E60 joint_filtered_control_ema1000 +- Checkpoint SHA-256: `8f3493cddbf6579a69ed813b056f8a16110f6309d7589016703b68022bef205c`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.04537320137024 seconds. +- Overall skill 0.376238; relative MASE 0.745929; relative WQL 0.521603. +- term skill: long=0.4000, medium=0.4050, short=0.3554. +- domain skill: Econ/Fin=0.1387, Energy=0.2375, Healthcare=0.4442, Nature=0.4301, Sales=0.3348, Transport=0.4657, Web/CloudOps=0.4986. +- frequency skill: A=0.3739, D=0.3521, H=0.3962, M=0.1054, Q=0.1984, S=0.4213, T=0.4350, W=0.2191. +- variates skill: multivariate=0.3934, univariate=0.3622. +- Outcome: Initial identity is exact. At1000 both adapters show a small main-screen improvement; filtered versus control difference0.000043 is inconclusive. Continue to matched3000/6000 and earlier-cutoff diagnostics. + +## E60 joint_filtered_candidate_ema1000 +- Checkpoint SHA-256: `444ffa52005a89ef409a284a2a952d82da7f760e17f1ea865f118b1bb878fec5`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.930442571640015 seconds. +- Overall skill 0.376281; relative MASE 0.745845; relative WQL 0.521590. +- term skill: long=0.4002, medium=0.4050, short=0.3554. +- domain skill: Econ/Fin=0.1387, Energy=0.2376, Healthcare=0.4442, Nature=0.4299, Sales=0.3348, Transport=0.4657, Web/CloudOps=0.4988. +- frequency skill: A=0.3739, D=0.3524, H=0.3961, M=0.1054, Q=0.1984, S=0.4208, T=0.4351, W=0.2191. +- variates skill: multivariate=0.3935, univariate=0.3622. +- Outcome: Initial identity is exact. At1000 both adapters show a small main-screen improvement; filtered versus control difference0.000043 is inconclusive. Continue to matched3000/6000 and earlier-cutoff diagnostics. + +## E58 matched37M at8000 +- Checkpoint SHA-256: `2e8a53df1226d34548c14d2f6aa29531e9562825e077658040ad03cf1584e407`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.826340913772583 seconds. +- Overall skill 0.374665; relative MASE 0.746940; relative WQL 0.523529. +- term skill: long=0.3997, medium=0.4070, short=0.3518. +- domain skill: Econ/Fin=0.1410, Energy=0.2366, Healthcare=0.4123, Nature=0.4301, Sales=0.3395, Transport=0.4651, Web/CloudOps=0.4997. +- frequency skill: A=0.3794, D=0.3492, H=0.3961, M=0.0913, Q=0.2022, S=0.4225, T=0.4363, W=0.2001. +- variates skill: multivariate=0.3935, univariate=0.3592. +- Outcome: Recovered from the4000-step dip but remains below its parent. Await the matched146M checkpoint. + +## E31 amplitude synthesis final24000 with original mean-template runtime +- Checkpoint SHA-256: `ecab9102fc11909555044c67dffda85280e06a375f1733351c7e9a39bf2ce9bb`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 24.28603458404541 seconds. +- Overall skill 0.361862; relative MASE 0.761019; relative WQL 0.535099. +- term skill: long=0.3937, medium=0.4047, short=0.3318. +- domain skill: Econ/Fin=0.1167, Energy=0.1881, Healthcare=0.4079, Nature=0.4215, Sales=0.3445, Transport=0.4600, Web/CloudOps=0.5131. +- frequency skill: A=0.3736, D=0.3413, H=0.3832, M=0.0977, Q=0.2001, S=0.4426, T=0.4085, W=0.2080. +- variates skill: multivariate=0.3973, univariate=0.3321. +- Outcome: Finished24000 steps in7471.1 training-loop seconds. Original-rule screening score slightly exceeds matched E25; current-rule and ensemble comparisons are recorded separately. This checkpoint is member1 of E59. + +## E60 joint_filtered_control_ema3000 +- Checkpoint SHA-256: `97b73dfac1a108dd79b419bef760ae281f25de78496cf982297bcd6c46f2bf3b`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.558463096618652 seconds. +- Overall skill 0.376364; relative MASE 0.746340; relative WQL 0.521106. +- term skill: long=0.4004, medium=0.4033, short=0.3562. +- domain skill: Econ/Fin=0.1387, Energy=0.2353, Healthcare=0.4442, Nature=0.4338, Sales=0.3348, Transport=0.4657, Web/CloudOps=0.4989. +- frequency skill: A=0.3739, D=0.3535, H=0.3966, M=0.1054, Q=0.1984, S=0.4217, T=0.4342, W=0.2193. +- variates skill: multivariate=0.3937, univariate=0.3622. +- Outcome: Both remain ahead of the frozen parent on the main screen. Unfiltered control now leads by 0.000084; earlier-cutoff evaluations are running. Continue both to 6000 as specified. + +## E60 joint_filtered_candidate_ema3000 +- Checkpoint SHA-256: `c37a8eddae4fc7419ea3ae0a28efc99dd6346e84f2d1807b5b6cb4013eeb2699`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.436699151992798 seconds. +- Overall skill 0.376280; relative MASE 0.746320; relative WQL 0.521261. +- term skill: long=0.4005, medium=0.4035, short=0.3559. +- domain skill: Econ/Fin=0.1387, Energy=0.2352, Healthcare=0.4442, Nature=0.4324, Sales=0.3348, Transport=0.4657, Web/CloudOps=0.4997. +- frequency skill: A=0.3739, D=0.3528, H=0.3961, M=0.1054, Q=0.1984, S=0.4201, T=0.4351, W=0.2193. +- variates skill: multivariate=0.3935, univariate=0.3622. +- Outcome: Both remain ahead of the frozen parent on the main screen. Unfiltered control now leads by 0.000084; earlier-cutoff evaluations are running. Continue both to 6000 as specified. + +## E62 matched horizon-training correction transferred to the selected backbone +Hypothesis: E52's varied requested horizons may add to E42's partial-target correction when transferred to the later E47 backbone. Repeat the successful E55 matched-difference method with the E52 final checkpoint: E47 confidence6000 + E52 horizon_jitter12000 - E38 control12000. Coefficient is fixed at 1.0, with no sweep. This is equivalently the E55 backbone plus the E52-minus-E42 horizon-training difference, apart from floating-point order. Confidence projection remains unchanged. All three parents originate from our own random initialization and permitted sources. +- No new training or data. CPU merge records parent hashes and elapsed time; the candidate will use the current fixed inference rules. +- Compare the main screen and both earlier cutoffs against E55 and the current E59 package before any full validation or publication. A single main-screen gain is insufficient. No outcome yet. + +E61 long_memory_synth training started at 2026-10-22T06:01:39Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E60 joint_filtered_control at3000, backcast_evals +- Checkpoint SHA-256: `97b73dfac1a108dd79b419bef760ae281f25de78496cf982297bcd6c46f2bf3b`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 25.748270750045776 seconds. +- Overall skill 0.334618; relative MASE 0.799261; relative WQL 0.553928. +- term skill: long=0.3961, medium=0.3571, short=0.3004. +- domain skill: Econ/Fin=0.1631, Energy=0.2278, Healthcare=0.4091, Nature=0.3620, Sales=0.3971, Transport=0.3715, Web/CloudOps=0.4461. +- frequency skill: A=0.3254, D=0.3492, H=0.3639, M=0.1918, Q=0.2328, S=0.3399, T=0.3325, W=0.2872. +- variates skill: multivariate=0.3503, univariate=0.3218. +- Outcome: Reject the adapter branch: both earlier cutoffs regress against E55, by more than the main-screen gain. Filtering does not fix this failure. Prune both runs before their planned6000 endpoint; retain stop checkpoints for provenance. + +## E60 joint_filtered_control at3000, backcast2_evals +- Checkpoint SHA-256: `97b73dfac1a108dd79b419bef760ae281f25de78496cf982297bcd6c46f2bf3b`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 23.68830132484436 seconds. +- Overall skill 0.355826; relative MASE 0.774983; relative WQL 0.535445. +- term skill: long=0.3630, medium=0.3845, short=0.3417. +- domain skill: Econ/Fin=0.1127, Energy=0.2316, Healthcare=0.3474, Nature=0.4679, Sales=0.5489, Transport=0.4199, Web/CloudOps=0.4270. +- frequency skill: A=0.3556, D=0.4260, H=0.3879, M=0.1532, Q=0.1527, S=0.2768, T=0.3543, W=0.2578. +- variates skill: multivariate=0.3579, univariate=0.3541. +- Outcome: Reject the adapter branch: both earlier cutoffs regress against E55, by more than the main-screen gain. Filtering does not fix this failure. Prune both runs before their planned6000 endpoint; retain stop checkpoints for provenance. + +## E60 joint_filtered_candidate at3000, backcast_evals +- Checkpoint SHA-256: `c37a8eddae4fc7419ea3ae0a28efc99dd6346e84f2d1807b5b6cb4013eeb2699`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 24.67229199409485 seconds. +- Overall skill 0.334545; relative MASE 0.799017; relative WQL 0.554218. +- term skill: long=0.3960, medium=0.3575, short=0.3001. +- domain skill: Econ/Fin=0.1631, Energy=0.2272, Healthcare=0.4091, Nature=0.3627, Sales=0.3971, Transport=0.3715, Web/CloudOps=0.4460. +- frequency skill: A=0.3254, D=0.3486, H=0.3640, M=0.1918, Q=0.2328, S=0.3383, T=0.3328, W=0.2870. +- variates skill: multivariate=0.3502, univariate=0.3218. +- Outcome: Reject the adapter branch: both earlier cutoffs regress against E55, by more than the main-screen gain. Filtering does not fix this failure. Prune both runs before their planned6000 endpoint; retain stop checkpoints for provenance. + +## E60 joint_filtered_candidate at3000, backcast2_evals +- Checkpoint SHA-256: `c37a8eddae4fc7419ea3ae0a28efc99dd6346e84f2d1807b5b6cb4013eeb2699`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 24.532593488693237 seconds. +- Overall skill 0.356065; relative MASE 0.774672; relative WQL 0.535261. +- term skill: long=0.3639, medium=0.3845, short=0.3418. +- domain skill: Econ/Fin=0.1127, Energy=0.2321, Healthcare=0.3474, Nature=0.4679, Sales=0.5489, Transport=0.4199, Web/CloudOps=0.4274. +- frequency skill: A=0.3556, D=0.4256, H=0.3883, M=0.1532, Q=0.1527, S=0.2764, T=0.3550, W=0.2576. +- variates skill: multivariate=0.3584, univariate=0.3541. +- Outcome: Reject the adapter branch: both earlier cutoffs regress against E55, by more than the main-screen gain. Filtering does not fix this failure. Prune both runs before their planned6000 endpoint; retain stop checkpoints for provenance. + +## E63 corpus expansion at 146M capacity +Hypothesis: E38's larger packed corpus did not improve the 37M model over 12,000 continuation steps, but a larger model with a longer schedule may benefit from the additional diversity. Add one matched data arm to E58: the same 146M initialization and optimization, using packed_expanded instead of packed_sample. The already-running E58 146M arm is the control; it is not retrained. +- Both packs contain the same 95 allow-listed directories. Source probabilities are read from packed_sample in both arms, so this changes within-source diversity rather than source balance. The expanded pack contains 5,653,290,832 points versus 958,745,103 in the control. No new generator or external source. +- Same own wide_capacity_initial checkpoint, seed 113, B96, 32,000 steps, base LR 0.00003, matched width-dependent AdamW groups, independently sign-augmented loss and EMA. Same runtime and batch64 for validation. All parameters train. +- First verify that the new loader reproduces the control's sampler exactly when given the control pack, and that expanded source probabilities match. The model and maximum tensor shapes are unchanged from the measured E58 memory fixture. +- Start after E60 adapter jobs stop. Compare checkpoints at 4000/8000/16000/24000/32000; evaluate earlier cutoffs before selection. This explicitly tests the interaction of corpus diversity and capacity, rather than repeating the small-model data comparison. No outcome yet. + +E63 checks passed: {"cpu_seconds": 6.780377898016013, "control_sampler_bitwise_equal": true, "source_probabilities_identical": true, "optimizer_updates": 0, "initial_checkpoint_sha256": "c3d41b52987eb033dcc60b4cd59e13e8adb75e319fe5f5bc043296faaac04849"} + +E60 joint_filtered_control stopped: {"final_step": 4691, "final_checkpoint": "/workspace/research/runs/joint_filtered_control/ema004691.pt", "checkpoint_sha256": "8d48a377b49cfd980a973aa9505565a537ed69c27c621ccf39b19d5787fb720b", "last_logged_training_seconds": 592.3, "last_logged_step": 4650, "all_original_tensors_bitwise_unchanged": true, "reason": "Both earlier cutoffs regress at3000 by more than the main gain; negative branch pruned."} + +E60 joint_filtered_candidate stopped: {"final_step": 4648, "final_checkpoint": "/workspace/research/runs/joint_filtered_candidate/ema004648.pt", "checkpoint_sha256": "1574e71b8877b5620a5929a55df22347c9475184194dec37ccb38c0eb71ed9c8", "last_logged_training_seconds": 590.2, "last_logged_step": 4600, "all_original_tensors_bitwise_unchanged": true, "reason": "Both earlier cutoffs regress at3000 by more than the main gain; negative branch pruned."} + +## E52 varied requested horizons final12000 +- Checkpoint SHA-256: `830179d763916a1065fc615d2c5e22f4a3b5b19390dde707ab0f057e13cadff6`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.63369631767273 seconds. +- Overall skill 0.362379; relative MASE 0.760035; relative WQL 0.534923. +- term skill: long=0.3913, medium=0.4055, short=0.3334. +- domain skill: Econ/Fin=0.1099, Energy=0.1916, Healthcare=0.4150, Nature=0.4272, Sales=0.3410, Transport=0.4599, Web/CloudOps=0.5083. +- frequency skill: A=0.3715, D=0.3433, H=0.3828, M=0.1086, Q=0.1994, S=0.4416, T=0.4075, W=0.2138. +- variates skill: multivariate=0.3960, univariate=0.3343. +- Outcome: Completed in3887.5 training-loop seconds (3897.218 process seconds). Main improves versus matched E42; inspect both earlier cutoffs and E62 transfer. + +## E52 final12000 first earlier cutoff +- Checkpoint SHA-256: `830179d763916a1065fc615d2c5e22f4a3b5b19390dde707ab0f057e13cadff6`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 19.096883296966553 seconds. +- Overall skill 0.331566; relative MASE 0.804478; relative WQL 0.555396. +- term skill: long=0.3906, medium=0.3563, short=0.2975. +- domain skill: Econ/Fin=0.1463, Energy=0.2302, Healthcare=0.4120, Nature=0.3520, Sales=0.3984, Transport=0.3650, Web/CloudOps=0.4442. +- frequency skill: A=0.3138, D=0.3562, H=0.3588, M=0.1622, Q=0.2341, S=0.3415, T=0.3316, W=0.2747. +- variates skill: multivariate=0.3480, univariate=0.3182. +- Outcome: Improves over E42 by0.000492. + +## E52 final12000 second earlier cutoff +- Checkpoint SHA-256: `830179d763916a1065fc615d2c5e22f4a3b5b19390dde707ab0f057e13cadff6`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 18.59932589530945 seconds. +- Overall skill 0.353232; relative MASE 0.776549; relative WQL 0.538676. +- term skill: long=0.3692, medium=0.3768, short=0.3380. +- domain skill: Econ/Fin=0.0898, Energy=0.2297, Healthcare=0.3632, Nature=0.4567, Sales=0.5538, Transport=0.4144, Web/CloudOps=0.4314. +- frequency skill: A=0.3506, D=0.4238, H=0.3876, M=0.1727, Q=0.1527, S=0.2824, T=0.3479, W=0.2436. +- variates skill: multivariate=0.3614, univariate=0.3466. +- Outcome: Improves over E42 by0.000136. The final horizon variation treatment improves all three matched screening windows. + +## E62 transferred horizon correction main screen +- Checkpoint SHA-256: `22c08571978be31ba57368eb983089a40a44d56d4ae5e17da41afd2a761a258c`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.18038821220398 seconds. +- Overall skill 0.377343; relative MASE 0.744367; relative WQL 0.520847. +- term skill: long=0.3993, medium=0.4068, short=0.3570. +- domain skill: Econ/Fin=0.1398, Energy=0.2376, Healthcare=0.4513, Nature=0.4321, Sales=0.3339, Transport=0.4661, Web/CloudOps=0.4995. +- frequency skill: A=0.3721, D=0.3559, H=0.3958, M=0.1049, Q=0.1994, S=0.4226, T=0.4360, W=0.2230. +- variates skill: multivariate=0.3942, univariate=0.3636. +- Outcome: Main gain0.001387 over E55. CPU composition1.266 seconds; await both earlier-cutoff checks before full validation. + +## E62 transferred horizon correction first earlier cutoff +- Checkpoint SHA-256: `22c08571978be31ba57368eb983089a40a44d56d4ae5e17da41afd2a761a258c`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 22.59067988395691 seconds. +- Overall skill 0.336227; relative MASE 0.797258; relative WQL 0.552638. +- term skill: long=0.3980, medium=0.3585, short=0.3020. +- domain skill: Econ/Fin=0.1632, Energy=0.2299, Healthcare=0.4035, Nature=0.3641, Sales=0.3973, Transport=0.3720, Web/CloudOps=0.4497. +- frequency skill: A=0.3264, D=0.3494, H=0.3653, M=0.1894, Q=0.2332, S=0.3419, T=0.3364, W=0.2851. +- variates skill: multivariate=0.3539, univariate=0.3218. +- Outcome: Improves over E55 by0.000618 and current E59 ensemble by0.000525; second earlier cutoff pending. + +## E64 replace the horizon-corrected member in the fixed equal-weight ensemble +Hypothesis: E62 improves all three windows against E55, but the current E59 ensemble remains stronger at the second earlier cutoff. Replace only member0 of E59 with E62 and retain the amplitude-trained member1, applying the same equal quantile average after each member's fixed rules. No new weights, training, blend coefficient or postprocessing is introduced. Every member still forecasts every instance. +- Use cached forecasts first on the main screen and both earlier cutoffs. Compare the candidate ensemble with E62 alone and E59. Validate the actual package if the composition offers a useful improvement. + +## E62 transferred horizon correction second earlier cutoff +- Checkpoint SHA-256: `22c08571978be31ba57368eb983089a40a44d56d4ae5e17da41afd2a761a258c`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 21.85834312438965 seconds. +- Overall skill 0.357693; relative MASE 0.772232; relative WQL 0.534241. +- term skill: long=0.3647, medium=0.3858, short=0.3439. +- domain skill: Econ/Fin=0.1095, Energy=0.2360, Healthcare=0.3457, Nature=0.4673, Sales=0.5494, Transport=0.4200, Web/CloudOps=0.4312. +- frequency skill: A=0.3533, D=0.4246, H=0.3905, M=0.1533, Q=0.1508, S=0.2809, T=0.3574, W=0.2594. +- variates skill: multivariate=0.3632, univariate=0.3532. +- Outcome: Improves over E55 by0.000222. All three screening windows improve against the single-model parent; E59 still leads at this cutoff. Proceed to full validation and the fixed E64 ensemble comparison. + +E64 member checkpoint hashes: 22c08571978be31ba57368eb983089a40a44d56d4ae5e17da41afd2a761a258c, ecab9102fc11909555044c67dffda85280e06a375f1733351c7e9a39bf2ce9bb. + +E64 cached screen: skill 0.376788946; relative MASE 0.745126449; relative WQL 0.521243098; CPU elapsed 4.12 seconds. Group skill: {"term": {"short": 0.3554964007817075, "medium": 0.4073693459600539, "long": 0.3998307241854733}, "domain": {"Econ/Fin": 0.14130300023652653, "Energy": 0.2369496172656066, "Healthcare": 0.4331271903068751, "Nature": 0.4295973732895463, "Sales": 0.3381125790990753, "Transport": 0.4660477929672022, "Web/CloudOps": 0.5028903628931379}, "freq": {"A-DEC": 0.37465521703273497, "Q-DEC": 0.20133386157730448, "M": 0.09799796329514798, "W-SUN": 0.09310304137899561, "D": 0.35177652554445227, "H": 0.39569724381500315, "15T": 0.21510285937582785, "W-FRI": -0.01717810068114023, "10T": 0.6134978939570246, "W-TUE": 0.5590219029222432, "W-THU": 0.20713023925638596, "W-WED": 0.3147893218102069, "5T": 0.5146554293758923, "10S": 0.42304338912946016}}. + +E64 cached backcast: skill 0.336038010; relative MASE 0.797789283; relative WQL 0.552583914; CPU elapsed 3.90 seconds. Group skill: {"term": {"short": 0.3017705847743448, "medium": 0.3583628431586988, "long": 0.3977762964359516}, "domain": {"Econ/Fin": 0.16247452271830498, "Energy": 0.22924210402608347, "Healthcare": 0.4037429866174578, "Nature": 0.3634291235876055, "Sales": 0.3979195783227222, "Transport": 0.3717322673047254, "Web/CloudOps": 0.45027750430374125}, "freq": {"A-DEC": 0.31962125220900417, "Q-DEC": 0.23151630865404227, "M": 0.19676862244049742, "W-SUN": 0.04104954385433246, "D": 0.3494141749986718, "H": 0.36512969667883677, "15T": 0.22647340624655954, "W-FRI": 0.26044659511767176, "10T": 0.3206375756185784, "W-TUE": 0.5251272756681418, "W-THU": 0.23336875275806457, "W-WED": 0.34380336710053805, "5T": 0.4388723441407405, "10S": 0.34124569112919356}}. + +E64 cached backcast2: skill 0.358773194; relative MASE 0.771487726; relative WQL 0.532959635; CPU elapsed 3.84 seconds. Group skill: {"term": {"short": 0.3455453575305818, "medium": 0.3850562697420571, "long": 0.3662794409758179}, "domain": {"Econ/Fin": 0.11178929070509958, "Energy": 0.2358139051710867, "Healthcare": 0.3485087569088834, "Nature": 0.46931745466541086, "Sales": 0.5520970513032182, "Transport": 0.4203697870790297, "Web/CloudOps": 0.4324624263189104}, "freq": {"A-DEC": 0.3552674881858966, "Q-DEC": 0.15052699940899794, "M": 0.14543941174604302, "W-SUN": 0.05780563284435891, "D": 0.4280091613762501, "H": 0.39053406736994467, "15T": 0.10558086695082369, "W-FRI": 0.14677601366514947, "10T": 0.4931102944101511, "W-TUE": 0.10259191794259981, "W-THU": 0.32777977287160787, "W-WED": 0.5368109233756173, "5T": 0.46691593361082795, "10S": 0.2842010268357835}}. + +E64 improves over current E59 on all three cutoffs. Versus E62 alone, it trails on the main screen and first earlier cutoff but gains at the second. Both complete packages will receive full validation; the current root remains E59 until that comparison and determinism checks finish. + +E64 actual package matches the cached equal-weight composition bitwise for every quantile in all 97 screening configurations. Proceed to exact full-package validation. + +## E65 recent normalization with an 8192-point encoder context +Hypothesis: adding older history changes the normalization reference as well as supplying extra observations. E54's final8192 model scores0.375118 versus its matched4096 control0.375764. Test whether retaining the recent4096 mean and standard deviation makes older context easier to use. The encoder still receives all8192 points; every point and future target uses the recent reference frame. If the recent segment has no finite observations, fall back to the full available context. +- Change only normalization. Same E54 initialization from own recency24000, seed101, matched packed_sample windows, B128, LR0.00003,12000 steps, maximum context8192 and sample context8192. Contexts of at most4096 retain the original formula. Fixed inference corrections still see only4096 observations. The existing E54 long-context run is the control. No new sources or generators. +- Training-data diagnostic: 256 real allowed-corpus windows, seed151;101 had sufficient older and recent history. Full/recent standard-deviation ratio p10/p50/p90 was0.932/1.003/1.255; absolute mean shift in recent standard deviations was0.0068/0.0512/0.4089. This motivates testing the frame, without establishing it as the cause of the regression. Diagnostic CPU time1.90 seconds; no validation data used. +- Verify exact equivalence for contexts at most4096 and finite fallback behavior before launch. Check main screens at3000/6000/12000 and earlier cutoffs before selection. No outcome yet. + +E65 checks passed: {"cpu_seconds": 0.7186618210980669, "short_context_normalization_bitwise_equal": true, "short_context_forecast_bitwise_equal": true, "recent_reference_and_empty_recent_fallback_verified": true, "all_missing_finite": true, "optimizer_updates": 0} + +## E62 exact full-package validation +- Checkpoint SHA-256: `22c08571978be31ba57368eb983089a40a44d56d4ae5e17da41afd2a761a258c`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.373420; relative MASE 0.747096; relative WQL 0.525505. +- term skill: long=0.3931, medium=0.4057, short=0.3528. +- domain skill: Econ/Fin=0.1173, Energy=0.2305, Healthcare=0.4574, Nature=0.4321, Sales=0.3479, Transport=0.4663, Web/CloudOps=0.4919. +- frequency skill: A=0.2918, D=0.3600, H=0.3910, M=0.1281, Q=0.1853, S=0.4226, T=0.4289, W=0.2156. +- variates skill: multivariate=0.3899, univariate=0.3600. +- Outcome: Full skill0.373420 versus E59 published0.372254. All97 configurations and151170 instances pass; no quantile crossings. Actual inference116.659 seconds. Await E64 full comparison and relocation/determinism before choosing the next publication. + +## E54 context8192 final12000 +- Checkpoint SHA-256: `90a1a9da78714594078b3cafd32b1812d633f5d6bf85ba8bfa60d09fbc3ebd38`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.50181746482849 seconds. +- Overall skill 0.375118; relative MASE 0.744591; relative WQL 0.524419. +- term skill: long=0.4042, medium=0.4057, short=0.3513. +- domain skill: Econ/Fin=0.1426, Energy=0.2337, Healthcare=0.4381, Nature=0.4222, Sales=0.3378, Transport=0.4707, Web/CloudOps=0.5001. +- frequency skill: A=0.3749, D=0.3573, H=0.3955, M=0.0779, Q=0.2010, S=0.4259, T=0.4332, W=0.2127. +- variates skill: multivariate=0.3910, univariate=0.3622. +- Outcome: Finished in3285.3 training-loop seconds (3296.255 process seconds). Main skill0.375118 remains below matched4096 control0.375764. Do not select this checkpoint; E65 isolates the normalization-frame hypothesis. + +## E58 widened146M at8000 +- Checkpoint SHA-256: `822fdf9f16fb741ab5e23728ad13cac2838a70ad4cfa23a191c9373294a6b4d5`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 33.286028146743774 seconds. +- Overall skill 0.374330; relative MASE 0.747410; relative WQL 0.523759. +- term skill: long=0.3993, medium=0.4074, short=0.3512. +- domain skill: Econ/Fin=0.1416, Energy=0.2364, Healthcare=0.4073, Nature=0.4301, Sales=0.3397, Transport=0.4652, Web/CloudOps=0.4995. +- frequency skill: A=0.3799, D=0.3459, H=0.3958, M=0.0911, Q=0.2002, S=0.4225, T=0.4364, W=0.2039. +- variates skill: multivariate=0.3933, univariate=0.3588. +- Outcome: Main skill0.374330 versus matched37M0.374665, reversing the small4000-step advantage. Both remain below initialization. Continue the prespecified32000-step capacity comparison; no capacity conclusion or package change yet. + +## E64 exact full-package validation after operator recovery +- Checkpoint SHA-256: `35306ec57b81c42e8fbdfab14adc96293400eee0dbd808fadbb3c973f9ff427e`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.372871; relative MASE 0.747913; relative WQL 0.525850. +- term skill: long=0.3938, medium=0.4063, short=0.3513. +- domain skill: Econ/Fin=0.1184, Energy=0.2299, Healthcare=0.4400, Nature=0.4295, Sales=0.3508, Transport=0.4663, Web/CloudOps=0.4954. +- frequency skill: A=0.2911, D=0.3562, H=0.3909, M=0.1203, Q=0.1862, S=0.4230, T=0.4309, W=0.2097. +- variates skill: multivariate=0.3912, univariate=0.3579. +- Outcome: Full skill0.372871 beats E59 but trails E62 single0.373420. Both pass relocation/determinism. Select E62 single, retaining E64 as a replayable alternative. E64 full inference79.236 seconds on an otherwise idle H100; do not compare that timing directly with concurrent-training measurements. + +## Operator interruption and recovery, 2026-10-22 +All previous container processes were confirmed ended; the H100 was idle. No credentials were inspected. Completed reports and atomic checkpoints were retained. E64 full validation was rerun because no completed report survived. Both E62 and E64 passed asset hashes and independent relocation: [ + { + "package": "/run-state/workspace/research/candidate-horizon-delta12k", + "checkpoint_sha256": "22c08571978be31ba57368eb983089a40a44d56d4ae5e17da41afd2a761a258c", + "configurations": 3, + "bitwise_equal_after_relocation": true, + "finite_and_monotone": true, + "seconds": 6.016964558046311 + }, + { + "package": "/run-state/workspace/research/candidate-horizon-ensemble", + "checkpoint_sha256": "35306ec57b81c42e8fbdfab14adc96293400eee0dbd808fadbb3c973f9ff427e", + "configurations": 3, + "bitwise_equal_after_relocation": true, + "finite_and_monotone": true, + "seconds": 6.803807514021173 + } +] + + +Publication decision: E62 single has the highest exact full-validation skill among replayed candidates (0.373419858), improves all three screening cutoffs versus E55, and wins the main screen and first earlier cutoff against E64. E64 retains a second-earlier-cutoff advantage but is lower on full validation. Publish E62 with complete runtime, all own-checkpoint lineage, generator code, pinned requirements, this experiment log and the full report. Scores remain on the validation scale, not the held-out reward scale. + +## E66 matched recovery of interrupted research runs +The operator interruption ended all trainers. E58 146M had step/EMA8000, while its37M control also had12000; neither had Adam or sampler state. Both arms restart from their own step8000 and EMA8000, preserving a common comparison point. Fresh AdamW and a shared new sampler seed179 begin at global step8001, with400-step rewarmup and the original cosine schedule through32000. This is a documented matched continuation, not an exact resumption of the old optimizer trajectory. Existing control12000 is retained but is not the recovered comparison control. +- E63 expanded146M had only initialization saved, so it restarts from its own initial checkpoint with original seed113. It will receive the identical optimizer/stream reset at global8000 to match E58 recovery. E61 slow-memory and E65 recent normalization had no completed checkpoints, so they restart from their declared parent, original seeds and settings. No baseline or completed scientific comparison is retrained. +- New driver saves weights, EMA, optimizer, CPU/CUDA RNG, sampler and batch RNG states, and the prefetched next batch atomically every1000 steps. Independent interrupted/continuous fixture: {"seed": 191, "steps": 4, "batch": 2, "fixture_parameters": 164384, "purpose": "recovery fixture only; never selected", "maximum_model_difference": 1.2101430968414206e-14, "maximum_ema_difference": 2.4147350785597155e-15, "maximum_optimizer_difference": 7.095019016745141e-16, "rng_and_prefetched_batch_bitwise_equal": true, "note": "Complete state restored; GPU training replay differs by floating-point roundoff, so training replay is not claimed bitwise identical. Package inference checks are separately bitwise."}. Four optimizer updates per fixture path used only permitted data; fixture weights are never candidates. +- Work lost after the last usable checkpoints: E58 large at least800 steps, control at least1550 beyond its latest12000 (the matched restart also intentionally returns to8000); E63 at least1700; E61 at least2150; E65 at least300. Last logged elapsed times before interruption:2432.6,2101.5,388.0,542.2,71.8 seconds respectively. These are concurrent process times, not summed exclusive GPU time. + +## E67 end-to-end paired-sign training on the selected horizon-corrected model +Hypothesis: E50 updated only the output head and did not sustain a paired-loss gain. The full encoder/decoder may be able to learn complementary sign-orientation forecasts when optimized through the exact neural average used in inference. Compare two full-model continuations from own E62: both forward x and -x, but the control scores each orientation separately while the candidate scores their ordered-quantile average. This changes the loss, not the sampled windows, number of forward passes, architecture or inference. +- Both arms retain E52 random requested-horizon prefixes and E42 partial-target future-key masking, now integrated with the selected confidence features. At inference the requested horizon is fully available and the forward pass must remain bitwise identical at initialization to E62. +- Own parent horizon_delta12k.pt (SHA-25622c08571978be31ba57368eb983089a40a44d56d4ae5e17da41afd2a761a258c); seed197, independent horizon seed300200, packed_sample95 allowed sources and the same local generator, B64 distinct windows /128 signed rows, LR0.00002,12000 steps, all parameters train. Same warmup400 and cosine schedule. Every runtime member forecasts every instance; no validation data are used for gradients. +- Check initialization identity, paired-loss sign symmetry and the independence of unused future tokens. Measure maximum-shape memory before launch. Compare main and both earlier cutoffs; a main-only gain is insufficient. Complete recovery state includes both sampler RNGs. No outcome yet. + +E67 checks passed: { + "cpu_seconds": 3.4358641319558956, + "initial_forecast_bitwise_parent": true, + "unused_future_tokens_do_not_change_requested_prefix": true, + "paired_loss_sign_symmetric": true, + "matched_sampler_main_and_horizon_rng": true, + "gpu_fixture_seconds": 3.137407455011271, + "allocated_mib": 5783.81689453125, + "reserved_mib": 6266.0, + "optimizer_updates": 0 +}. Current allocated/reserved process footprint fits both additional paired arms within the single80GB H100. Each new arm uses about6.3GiB reserved at maximum shape. + +## E68 fixed upward quantile-level shift +Hypothesis: E62 coverage diagnostics show upper-tail underprediction in several groups, while lower-tail excess inclusive coverage is largely due to ties at exact zero. Test one globally fixed quantile-function shift from level p to p+0.025, linearly interpolating between adjacent predicted deciles and extrapolating the uppermost interval. This is equivalent to75% of q(p)+25% of q(p+0.1), with upper-end linear extrapolation. It shifts the median as well as intervals. No dataset-specific parameters, context optimization, new training or weight fitting. +- Apply after the existing fixed rules. Monotonicity and nonnegative quantiles for nonnegative histories are preserved by upward interpolation/extrapolation. Compare only unchanged and the predeclared+0.025 setting on the main screen and both earlier cutoffs. No coefficient sweep. +- Descriptive coverage files horizon_delta_calibration_bounds.json and calibration_diagnostic.py retain strict/inclusive tie bounds. Parent weights SHA-25622c08571978be31ba57368eb983089a40a44d56d4ae5e17da41afd2a761a258c. No outcome yet. + +E68 screen, CPU elapsed2.34 seconds: +- unchanged: skill0.377343216, relative MASE0.744366865, relative WQL0.520847298; group skill {"term": {"short": 0.35695456496017197, "medium": 0.4068421174843613, "long": 0.3992704749750494}, "domain": {"Econ/Fin": 0.1398359119561744, "Energy": 0.23759505750828103, "Healthcare": 0.4512562626750727, "Nature": 0.4321373180939323, "Sales": 0.33393397659338675, "Transport": 0.46608088355848554, "Web/CloudOps": 0.49950488336015364}, "freq": {"A-DEC": 0.37212708500173697, "Q-DEC": 0.19935115627243538, "M": 0.10494660003314427, "W-SUN": 0.09001322152715163, "D": 0.355915177294738, "H": 0.39579077444245214, "15T": 0.214120657226064, "W-FRI": -0.015604695485733178, "10T": 0.6146535484250835, "W-TUE": 0.5792731324380282, "W-THU": 0.21095087378926547, "W-WED": 0.3154347093297968, "5T": 0.5103163560669302, "10S": 0.42256110774455713}}. +- shift_up_0025: skill0.376908525, relative MASE0.742757759, relative WQL0.522704720; group skill {"term": {"short": 0.3566597008609087, "medium": 0.404403536500499, "long": 0.4005186267241073}, "domain": {"Econ/Fin": 0.14287974364263867, "Energy": 0.23414603173384185, "Healthcare": 0.43949354133666974, "Nature": 0.4298630701436009, "Sales": 0.32658918319903174, "Transport": 0.470151191104459, "Web/CloudOps": 0.5032582354135502}, "freq": {"A-DEC": 0.380333567897149, "Q-DEC": 0.20181706747540706, "M": 0.08925268144424381, "W-SUN": 0.07477217948655135, "D": 0.35474663372376547, "H": 0.3940149463382252, "15T": 0.21958831724211048, "W-FRI": -0.0580596428780249, "10T": 0.6129399194069542, "W-TUE": 0.5699015681127257, "W-THU": 0.21136203731846115, "W-WED": 0.3102694893262884, "5T": 0.5147323912192434, "10S": 0.4303777414462714}}. + +E68 backcast, CPU elapsed2.34 seconds: +- unchanged: skill0.336227035, relative MASE0.797257690, relative WQL0.552637565; group skill {"term": {"short": 0.3019534316321959, "medium": 0.35847999416902554, "long": 0.3980452217736976}, "domain": {"Econ/Fin": 0.16321936365108436, "Energy": 0.22989895953120598, "Healthcare": 0.4035339334978575, "Nature": 0.3640809439324144, "Sales": 0.39727796653561065, "Transport": 0.37202575172526886, "Web/CloudOps": 0.4496899590670599}, "freq": {"A-DEC": 0.32642568966436736, "Q-DEC": 0.23316387018660967, "M": 0.18942546327646903, "W-SUN": 0.03722616253430944, "D": 0.3493567465552936, "H": 0.3653486861566616, "15T": 0.22544143675041628, "W-FRI": 0.2612228517292393, "10T": 0.32002639781339237, "W-TUE": 0.5369423215086733, "W-THU": 0.24695593621438172, "W-WED": 0.34366857690318564, "5T": 0.43841920169431536, "10S": 0.34189056734107803}}. +- shift_up_0025: skill0.333181127, relative MASE0.800191338, relative WQL0.555676359; group skill {"term": {"short": 0.30012284957976143, "medium": 0.3563718754867885, "long": 0.3913827408796766}, "domain": {"Econ/Fin": 0.16216091726465265, "Energy": 0.22830088335034404, "Healthcare": 0.4226177811841181, "Nature": 0.3541417493195709, "Sales": 0.38842247511482564, "Transport": 0.3660239875770892, "Web/CloudOps": 0.4469561601104274}, "freq": {"A-DEC": 0.3265608246880194, "Q-DEC": 0.22474554051269913, "M": 0.18267190809841738, "W-SUN": 0.03302751086137623, "D": 0.35103471245845674, "H": 0.36176195029219793, "15T": 0.21821690985575604, "W-FRI": 0.25908813449545354, "10T": 0.3119130318041733, "W-TUE": 0.5410511096762922, "W-THU": 0.24171213296902283, "W-WED": 0.34305917574568634, "5T": 0.43719448871859334, "10S": 0.33922568556395327}}. + +E68 backcast2, CPU elapsed2.31 seconds: +- unchanged: skill0.357693384, relative MASE0.772231694, relative WQL0.534240944; group skill {"term": {"short": 0.34387576099815587, "medium": 0.38579809375160923, "long": 0.36474587566145333}, "domain": {"Econ/Fin": 0.10948663145426041, "Energy": 0.23595983020029976, "Healthcare": 0.3456833197210143, "Nature": 0.4672524394882832, "Sales": 0.5493882044206345, "Transport": 0.4200285125423293, "Web/CloudOps": 0.4311910731987415}, "freq": {"A-DEC": 0.3532937085689807, "Q-DEC": 0.15079546315571057, "M": 0.15334987951579737, "W-SUN": 0.053222430353438654, "D": 0.42461678912892176, "H": 0.39045164404809307, "15T": 0.1063009642103484, "W-FRI": 0.14702837959358672, "10T": 0.4925745835795794, "W-TUE": 0.10051793538767262, "W-THU": 0.31968494040001116, "W-WED": 0.5361596335033245, "5T": 0.4655530740312157, "10S": 0.280869499353007}}. +- shift_up_0025: skill0.352929872, relative MASE0.775985000, relative WQL0.539571964; group skill {"term": {"short": 0.3397486152051552, "medium": 0.38072074318949967, "long": 0.3585956199908913}, "domain": {"Econ/Fin": 0.10581887733310036, "Energy": 0.23338234809030112, "Healthcare": 0.3418028155977272, "Nature": 0.4611553878945821, "Sales": 0.543948848409417, "Transport": 0.4138948091247504, "Web/CloudOps": 0.42581951888726777}, "freq": {"A-DEC": 0.3525707634011239, "Q-DEC": 0.14006676676474916, "M": 0.14537682622646142, "W-SUN": 0.05718515322639861, "D": 0.42470757896302946, "H": 0.38580382383546696, "15T": 0.0967294266428953, "W-FRI": 0.16016050379952163, "10T": 0.4943536981461871, "W-TUE": 0.05512451342569891, "W-THU": 0.29480125149705005, "W-WED": 0.5302395339818361, "5T": 0.4614399225720033, "10S": 0.2693556274034984}}. + +E68 rejected: the fixed upward quantile shift loses on all three windows, including -0.00305 and -0.00476 at the earlier cutoffs. Main median MASE improves slightly but WQL worsens. Descriptive coverage imbalance does not justify a global quantile shift. Retain E62 quantiles unchanged; no further coefficient sweep. + +## E69 persistent stochastic volatility in synthetic training windows — prepared, not launched +Hypothesis: the local generator changes seasonal amplitude in E31 but its observation-noise scale stays constant throughout a window. Teach conditional uncertainty under persistent volatility by multiplying the Gaussian/AR noise component by an independent positive log-OU curve in half of synthetic windows. Leave signal, AR coefficient, observation-noise draws, real windows and the main RNG unchanged. +- Proposed matched reference: completed E42 partial-target training. Same own recency12000 parent, seed79, packed_sample, B256, LR0.00005,12000 steps and original schedule. Only the noise envelope differs; no architecture or inference change. +- Independent generator seed500082; log time constant uniform1.5..3.5 (about32..3162 steps), log standard deviation uniform0.1..0.8, stationary Gaussian initial log state, exp(logcurve-0.5*sd^2), log envelope clipped[-2.5,2.5]. Synthetic fraction remains0.2, so roughly10% of all windows receive the new envelope. +- Verify real-window and main-RNG equality before launch. Queue only when a GPU allocation is released; no training has started. Final selection requires main and both earlier-cutoff evidence. + +E69 preparation checks: {"cpu_seconds": 4.379837638000026, "main_rng_matched": true, "real_windows_unchanged": true, "periods_and_missing_masks_unchanged": true, "changed_synthetic_context_values": 52057, "optimizer_updates": 0} + +## E67 full_paired_control at1000 +- Checkpoint SHA-256: `0aa7ece151109e13af73e7ca2d6b75baa95e67898a6273a081ed38e92cfc63cd`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.88213801383972 seconds. +- Overall skill 0.376434; relative MASE 0.745243; relative WQL 0.521755. +- term skill: long=0.3984, medium=0.4065, short=0.3558. +- domain skill: Econ/Fin=0.1332, Energy=0.2361, Healthcare=0.4573, Nature=0.4305, Sales=0.3351, Transport=0.4660, Web/CloudOps=0.4983. +- frequency skill: A=0.3675, D=0.3539, H=0.3948, M=0.1051, Q=0.1982, S=0.4219, T=0.4350, W=0.2252. +- variates skill: multivariate=0.3925, univariate=0.3634. +- Outcome: Paired objective leads the matched individual-orientation control by0.000426, but both trail the frozen E62 parent0.377343. Continue to3000 before interpreting the early optimization drop. + +## E67 full_paired_candidate at1000 +- Checkpoint SHA-256: `256329643ba1d7074386d227f4dafd6bdbf0faca5bf2280a60be51ddf2ad90ee`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.336730480194092 seconds. +- Overall skill 0.376860; relative MASE 0.744723; relative WQL 0.521407. +- term skill: long=0.3991, medium=0.4063, short=0.3564. +- domain skill: Econ/Fin=0.1316, Energy=0.2364, Healthcare=0.4620, Nature=0.4301, Sales=0.3350, Transport=0.4669, Web/CloudOps=0.4985. +- frequency skill: A=0.3655, D=0.3560, H=0.3951, M=0.1058, Q=0.1980, S=0.4230, T=0.4348, W=0.2256. +- variates skill: multivariate=0.3926, univariate=0.3640. +- Outcome: Paired objective leads the matched individual-orientation control by0.000426, but both trail the frozen E62 parent0.377343. Continue to3000 before interpreting the early optimization drop. + +Additional historical diagnostic: valid_backcast3 contains93 configurations and8812 instances, derived only from existing validation histories. This cutoff was not used in earlier selection. Compare E62 and its E55 predecessor, plus the fixed amplitude ensemble option; all outputs are selection/diagnostics only. Scales use capped prefixes and its own Seasonal Naive baseline. + +## Previously unused third earlier cutoff: horizon_delta12k +- Checkpoint SHA-256: `22c08571978be31ba57368eb983089a40a44d56d4ae5e17da41afd2a761a258c`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 25.37537980079651 seconds. +- Overall skill 0.387789; relative MASE 0.738165; relative WQL 0.507749. +- term skill: long=0.3944, medium=0.3602, short=0.3954. +- domain skill: Econ/Fin=0.1725, Energy=0.3191, Healthcare=0.2442, Nature=0.5053, Sales=0.3990, Transport=0.5060, Web/CloudOps=0.3880. +- frequency skill: A=0.3565, D=0.4418, H=0.4032, M=0.1118, Q=0.2628, S=0.2833, T=0.4297, W=0.2606. +- variates skill: multivariate=0.3722, univariate=0.3998. +- Outcome: 93 configurations and8812 instances have enough remaining history. E62 retains a small0.000124 gain over E55 here; amplitude-only is lower. Scores are diagnostic and have their own Seasonal Naive reference. Retain the published E62 while checking the fixed ensemble combinations. + +## Previously unused third earlier cutoff: partial_delta12k +- Checkpoint SHA-256: `721d1029284ea6f36d4c6f169eb001382a97a2848953fad84e3e62fb5a222802`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 25.088595867156982 seconds. +- Overall skill 0.387664; relative MASE 0.738315; relative WQL 0.507852. +- term skill: long=0.3943, medium=0.3601, short=0.3953. +- domain skill: Econ/Fin=0.1728, Energy=0.3188, Healthcare=0.2482, Nature=0.5065, Sales=0.3984, Transport=0.5041, Web/CloudOps=0.3876. +- frequency skill: A=0.3519, D=0.4408, H=0.4034, M=0.1157, Q=0.2629, S=0.2853, T=0.4287, W=0.2628. +- variates skill: multivariate=0.3721, univariate=0.3997. +- Outcome: 93 configurations and8812 instances have enough remaining history. E62 retains a small0.000124 gain over E55 here; amplitude-only is lower. Scores are diagnostic and have their own Seasonal Naive reference. Retain the published E62 while checking the fixed ensemble combinations. + +## Previously unused third earlier cutoff: amplitude_fixed_ema24000 +- Checkpoint SHA-256: `ecab9102fc11909555044c67dffda85280e06a375f1733351c7e9a39bf2ce9bb`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 24.98914361000061 seconds. +- Overall skill 0.386555; relative MASE 0.740761; relative WQL 0.508011. +- term skill: long=0.3906, medium=0.3617, short=0.3941. +- domain skill: Econ/Fin=0.1763, Energy=0.3186, Healthcare=0.2144, Nature=0.5055, Sales=0.3950, Transport=0.5054, Web/CloudOps=0.3892. +- frequency skill: A=0.3670, D=0.4397, H=0.4032, M=0.1018, Q=0.2609, S=0.2818, T=0.4298, W=0.2517. +- variates skill: multivariate=0.3715, univariate=0.3982. +- Outcome: 93 configurations and8812 instances have enough remaining history. E62 retains a small0.000124 gain over E55 here; amplitude-only is lower. Scores are diagnostic and have their own Seasonal Naive reference. Retain the published E62 while checking the fixed ensemble combinations. + +Third earlier cutoff, fixed horizon+amplitude ensemble: skill0.387712467, relative MASE0.738747107, relative WQL0.507475454; CPU1.61 seconds; group skill {"term": {"short": 0.3954701763614715, "medium": 0.36122355126648487, "long": 0.39279890497296066}, "domain": {"Econ/Fin": 0.1751736307959596, "Energy": 0.31921698125326037, "Healthcare": 0.23298033105692906, "Nature": 0.5060089627880903, "Sales": 0.3975145877969797, "Transport": 0.5058849307923443, "Web/CloudOps": 0.3889682376441502}, "freq": {"A-DEC": 0.3624040337196054, "Q-DEC": 0.2624518143609271, "M": 0.10707417310085743, "W-SUN": 0.1583361093273692, "D": 0.4418985852875217, "H": 0.403440739007801, "15T": 0.2601635557329961, "W-FRI": 0.014090974305712378, "10T": 0.6023775368816131, "W-TUE": 0.24266767576389037, "W-THU": 0.3814500446358562, "W-WED": 0.36993536616236844, "5T": 0.4629495965892555, "10S": 0.28289459770032044}}. + +Third earlier cutoff, fixed partial+amplitude ensemble: skill0.387583102, relative MASE0.738907219, relative WQL0.507579906; CPU1.63 seconds; group skill {"term": {"short": 0.39530402146176624, "medium": 0.36114921433277336, "long": 0.39271964935249504}, "domain": {"Econ/Fin": 0.17527256907786126, "Energy": 0.31900374729462777, "Healthcare": 0.23531552352603602, "Nature": 0.5063494545833882, "Sales": 0.3972024195554572, "Transport": 0.5049447049689553, "Web/CloudOps": 0.3887045854899489}, "freq": {"A-DEC": 0.36012619804016577, "Q-DEC": 0.2622822707122595, "M": 0.10906468169471106, "W-SUN": 0.15682778156902044, "D": 0.44126848409451547, "H": 0.4035052878161369, "15T": 0.26032721770481526, "W-FRI": 0.011894162492874005, "10T": 0.6016201297891219, "W-TUE": 0.2491326450741952, "W-THU": 0.38350286292612645, "W-WED": 0.3695417432322957, "5T": 0.4619676858363392, "10S": 0.2838781358710065}}. + +The new historical check does not overturn the publication: E62 beats E55 individually at this fourth available window, while the fixed ensemble comparison remains a documented alternative. Full validation and main screening still favor the published single model. + +## E70 training-only compiler throughput diagnostic +Hypothesis: operator/kernel overhead limits the many small transformer operations on one H100. Benchmark torch.compile on the existing own E62 model and unpaired training loss, using64 permitted pretraining windows of context2048/horizon512, seed223. No optimizer updates; no validation examples; no compiler change to the published runtime. Compare eager and compiled loss, gradient direction and absolute differences, then alternate20-step forward/backward timing blocks three times under the existing shared-GPU load. Compilation uses two CPU workers. Any numerical or performance difference is recorded before considering a separate training experiment. No outcome yet. + +## E58/E66 recovered37M control at global12000 +- Checkpoint SHA-256: `5341c5600f5fd3f82a33a9a756ce30ee980973e90c0163455ea2ce545601b051`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 29.337642669677734 seconds. +- Overall skill 0.374083; relative MASE 0.747749; relative WQL 0.523935. +- term skill: long=0.3989, medium=0.4070, short=0.3511. +- domain skill: Econ/Fin=0.1395, Energy=0.2360, Healthcare=0.4006, Nature=0.4331, Sales=0.3401, Transport=0.4656, Web/CloudOps=0.4984. +- frequency skill: A=0.3744, D=0.3455, H=0.3952, M=0.0891, Q=0.1999, S=0.4216, T=0.4369, W=0.2041. +- variates skill: multivariate=0.3932, univariate=0.3585. +- Outcome: Skill0.374083, below its own8000 EMA0.374665 and initial parent0.375793. First4000 updates after the documented optimizer reset; await the matched146M result. Training losses over shared steps9550..10500 are nearly equal: large0.345200, control0.345264. + +## E67 full_paired_control at3000 +- Checkpoint SHA-256: `c98f8d82047e6e0ecd00f144307623afdd581ee6624d880063f810d090e1a473`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 27.129313945770264 seconds. +- Overall skill 0.378018; relative MASE 0.743740; relative WQL 0.520156. +- term skill: long=0.4008, medium=0.4068, short=0.3576. +- domain skill: Econ/Fin=0.1354, Energy=0.2381, Healthcare=0.4531, Nature=0.4314, Sales=0.3329, Transport=0.4660, Web/CloudOps=0.5026. +- frequency skill: A=0.3720, D=0.3538, H=0.3970, M=0.1035, Q=0.1971, S=0.4224, T=0.4379, W=0.2235. +- variates skill: multivariate=0.3959, univariate=0.3634. +- Outcome: Both exceed the E62 main screen0.377343. Paired0.378318 leads control0.378018; check both earlier cutoffs before selection. Training continues toward6000. + +## E67 full_paired_candidate at3000 +- Checkpoint SHA-256: `2a19ebe0d41c1a18feaba318041795be4d268ce890162a5035e6fc6bf1844238`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.954200506210327 seconds. +- Overall skill 0.378318; relative MASE 0.743356; relative WQL 0.519924. +- term skill: long=0.4020, medium=0.4066, short=0.3577. +- domain skill: Econ/Fin=0.1339, Energy=0.2391, Healthcare=0.4511, Nature=0.4303, Sales=0.3325, Transport=0.4661, Web/CloudOps=0.5042. +- frequency skill: A=0.3674, D=0.3531, H=0.3978, M=0.1030, Q=0.1972, S=0.4232, T=0.4383, W=0.2236. +- variates skill: multivariate=0.3969, univariate=0.3631. +- Outcome: Both exceed the E62 main screen0.377343. Paired0.378318 leads control0.378018; check both earlier cutoffs before selection. Training continues toward6000. + +## E67 full_paired_control_ema3000 evals +- Checkpoint SHA-256: `c98f8d82047e6e0ecd00f144307623afdd581ee6624d880063f810d090e1a473`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 27.129313945770264 seconds. +- Overall skill 0.378018; relative MASE 0.743740; relative WQL 0.520156. +- term skill: long=0.4008, medium=0.4068, short=0.3576. +- domain skill: Econ/Fin=0.1354, Energy=0.2381, Healthcare=0.4531, Nature=0.4314, Sales=0.3329, Transport=0.4660, Web/CloudOps=0.5026. +- frequency skill: A=0.3720, D=0.3538, H=0.3970, M=0.1035, Q=0.1971, S=0.4224, T=0.4379, W=0.2235. +- variates skill: multivariate=0.3959, univariate=0.3634. +- Outcome: Matched whole-model sign-loss comparison; all parameters train, seed 197. Main screen improves; earlier cutoffs are mixed. Complete package validation follows. + +## E67 full_paired_control_ema3000 backcast_evals +- Checkpoint SHA-256: `c98f8d82047e6e0ecd00f144307623afdd581ee6624d880063f810d090e1a473`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 26.22196912765503 seconds. +- Overall skill 0.336172; relative MASE 0.797227; relative WQL 0.552750. +- term skill: long=0.3984, medium=0.3579, short=0.3019. +- domain skill: Econ/Fin=0.1591, Energy=0.2292, Healthcare=0.4105, Nature=0.3647, Sales=0.3944, Transport=0.3718, Web/CloudOps=0.4497. +- frequency skill: A=0.3173, D=0.3530, H=0.3656, M=0.1894, Q=0.2304, S=0.3411, T=0.3359, W=0.2800. +- variates skill: multivariate=0.3535, univariate=0.3220. +- Outcome: Matched whole-model sign-loss comparison; all parameters train, seed 197. Main screen improves; earlier cutoffs are mixed. Complete package validation follows. + +## E67 full_paired_control_ema3000 backcast2_evals +- Checkpoint SHA-256: `c98f8d82047e6e0ecd00f144307623afdd581ee6624d880063f810d090e1a473`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 26.114278316497803 seconds. +- Overall skill 0.357963; relative MASE 0.772252; relative WQL 0.533779. +- term skill: long=0.3643, medium=0.3867, short=0.3442. +- domain skill: Econ/Fin=0.1073, Energy=0.2363, Healthcare=0.3529, Nature=0.4659, Sales=0.5494, Transport=0.4196, Web/CloudOps=0.4322. +- frequency skill: A=0.3515, D=0.4255, H=0.3911, M=0.1494, Q=0.1504, S=0.2817, T=0.3589, W=0.2528. +- variates skill: multivariate=0.3643, univariate=0.3528. +- Outcome: Matched whole-model sign-loss comparison; all parameters train, seed 197. Main screen improves; earlier cutoffs are mixed. Complete package validation follows. + +## E67 full_paired_candidate_ema3000 evals +- Checkpoint SHA-256: `2a19ebe0d41c1a18feaba318041795be4d268ce890162a5035e6fc6bf1844238`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.954200506210327 seconds. +- Overall skill 0.378318; relative MASE 0.743356; relative WQL 0.519924. +- term skill: long=0.4020, medium=0.4066, short=0.3577. +- domain skill: Econ/Fin=0.1339, Energy=0.2391, Healthcare=0.4511, Nature=0.4303, Sales=0.3325, Transport=0.4661, Web/CloudOps=0.5042. +- frequency skill: A=0.3674, D=0.3531, H=0.3978, M=0.1030, Q=0.1972, S=0.4232, T=0.4383, W=0.2236. +- variates skill: multivariate=0.3969, univariate=0.3631. +- Outcome: Matched whole-model sign-loss comparison; all parameters train, seed 197. Main screen improves; earlier cutoffs are mixed. Complete package validation follows. + +## E67 full_paired_candidate_ema3000 backcast_evals +- Checkpoint SHA-256: `2a19ebe0d41c1a18feaba318041795be4d268ce890162a5035e6fc6bf1844238`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 26.824409246444702 seconds. +- Overall skill 0.335739; relative MASE 0.797824; relative WQL 0.553058. +- term skill: long=0.3982, medium=0.3579, short=0.3012. +- domain skill: Econ/Fin=0.1554, Energy=0.2283, Healthcare=0.4138, Nature=0.3640, Sales=0.3938, Transport=0.3730, Web/CloudOps=0.4488. +- frequency skill: A=0.3126, D=0.3515, H=0.3664, M=0.1838, Q=0.2305, S=0.3411, T=0.3345, W=0.2832. +- variates skill: multivariate=0.3522, univariate=0.3223. +- Outcome: Matched whole-model sign-loss comparison; all parameters train, seed 197. Main screen improves; earlier cutoffs are mixed. Complete package validation follows. + +## E67 full_paired_candidate_ema3000 backcast2_evals +- Checkpoint SHA-256: `2a19ebe0d41c1a18feaba318041795be4d268ce890162a5035e6fc6bf1844238`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 26.085822582244873 seconds. +- Overall skill 0.358235; relative MASE 0.771602; relative WQL 0.533775. +- term skill: long=0.3637, medium=0.3876, short=0.3445. +- domain skill: Econ/Fin=0.1066, Energy=0.2361, Healthcare=0.3468, Nature=0.4694, Sales=0.5483, Transport=0.4212, Web/CloudOps=0.4313. +- frequency skill: A=0.3537, D=0.4237, H=0.3911, M=0.1509, Q=0.1498, S=0.2809, T=0.3593, W=0.2593. +- variates skill: multivariate=0.3635, univariate=0.3540. +- Outcome: Matched whole-model sign-loss comparison; all parameters train, seed 197. Main screen improves; earlier cutoffs are mixed. Complete package validation follows. + +## long_memory_synth_recovery_ema3000 +- Checkpoint SHA-256: `c8d675cce3857f6c065a231ccbd4f2dfb76c6c49236da051d13b450287006a6f`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.661465406417847 seconds. +- Overall skill 0.360588; relative MASE 0.761649; relative WQL 0.536793. +- term skill: long=0.3910, medium=0.4017, short=0.3318. +- domain skill: Econ/Fin=0.1155, Energy=0.1829, Healthcare=0.4341, Nature=0.4242, Sales=0.3463, Transport=0.4592, Web/CloudOps=0.5066. +- frequency skill: A=0.3750, D=0.3500, H=0.3816, M=0.1111, Q=0.2000, S=0.4415, T=0.4013, W=0.2067. +- variates skill: multivariate=0.3919, univariate=0.3345. +- Outcome: E61 slower synthetic AR dynamics; seed79; improves main screen over matched E42 at3000 steps. Continue and check earlier cutoffs. + +## recent_normalization_recovery_ema3000 +- Checkpoint SHA-256: `a55a5681f52782a142f44595f69d5aef59579fa7f64124c72b9de918189d8ff9`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 33.14950752258301 seconds. +- Overall skill 0.373434; relative MASE 0.747021; relative WQL 0.525533. +- term skill: long=0.3987, medium=0.4024, short=0.3519. +- domain skill: Econ/Fin=0.1428, Energy=0.2320, Healthcare=0.4255, Nature=0.4235, Sales=0.3398, Transport=0.4701, Web/CloudOps=0.4974. +- frequency skill: A=0.3847, D=0.3515, H=0.3961, M=0.0795, Q=0.2007, S=0.4234, T=0.4320, W=0.2036. +- variates skill: multivariate=0.3889, univariate=0.3609. +- Outcome: E65 recent4096 normalization with8192 context; seed101; improves matched E54 3000-step long-context result .372681. Continue. + +### E70 compiler cache infrastructure diagnostic +Both the default and /tmp Triton caches reject child-directory-to-parent os.replace with EXDEV. Same-parent replacement succeeds. A local SiblingFileCacheManager preserves Triton keys and group formats while writing unique same-parent temporary files. Byte, text, overwrite and group fixtures passed (initial fixture used an invalid nonhex key; corrected before accepting the fixture). No installed library files, model parameters, optimizer state or inference runtime were changed. Retrying the identical training-only compile benchmark; no optimizer updates. + +### E70 fixed-shape compiler benchmark outcome +Seed223, B64, C2048, H512, own E62 checkpoint 22c08571978be31ba57368eb983089a40a44d56d4ae5e17da41afd2a761a258c; no optimizer updates and only allowed training windows. Compilation 51.065s; total benchmark 80.009s. Alternating three blocks: eager mean0.119890s versus compiled mean0.064745s, speedup1.852. Loss0.228576794 vs0.228607744; gradient cosine0.998925465, maximum absolute gradient difference0.000610351562. bf16 arithmetic differs slightly; this is not bitwise training equivalence. Other experiments shared the H100. Variable-shape compatibility is being checked before use in training; published inference is unchanged. + +## E71 finer eight-point patches — prepared, not launched +Hypothesis: E17 benefited from32→16-point patches, and the current model still has short-horizon energy errors. Test16→8-point patches while preserving physical position units and all attention/MLP/confidence parameters. Fold the two halves of context, query and recency input projections by summation and keep the first8 output rows, as in the earlier resolution experiment. This is an own-weight initialization, not an exact function-preserving conversion. Initialize from E62, use seed197/B64/LR2e-5/12000 steps with paired sign loss, and compare to the already-running E67 paired16-point arm. Keep the identical sampler and its16-point random-prefix rounding; only model patch resolution changes. CPU fixtures and initial evaluation precede training. No additional data or synthetic generator. Waiting for training memory to become available. + +E70 variable-shape follow-up: torch.compile(dynamic=True, fullgraph=True) failed in the installed PyTorch tensorification pass: TensorReferenceAnalysis lacks python_mod. No optimizer updates occurred. Test static shape specialization with a64-graph cache limit instead, preserving the existing16 context/horizon combinations. Dynamic failure log: compiler_variable_shapes.log. + +## E72 convex mixtures of training windows — prepared, not launched +Hypothesis: interpolating real dynamics can expand effective corpus diversity and regularize the forecast mapping beyond drawing additional series. On25% of sampled rows, choose a different row with the same two periods, normalize the donor using context-only mean/std into the primary context units, then combine context and future separately with a Beta(2,2) coefficient. Missing positions use mask intersection; require8 common observed context points and1 common future label. Both real and existing locally synthetic rows are eligible. Independent seed600200 preserves the main corpus/generator stream and requested-horizon stream. Planned own E62 initialization, seed197, paired loss, B64, LR2e-5,12000 steps, identical E67 paired control settings. No inference changes. Fixtures: {"cpu_seconds": 2.7141120220185257, "seed": 197, "mixture_seed": 600200, "rows": 192, "changed_context_rows": 43, "main_and_horizon_rng_matched": true, "changing_labels_does_not_change_contexts": true, "finite_masks_respected": true, "optimizer_updates": 0}. Await training allocation. + +### E58 symmetry diagnostic +Seed239, four allowed training windows, no optimizer updates, CPU5.262225491984282s. At global12000, duplicate-stream encoder5 activations differ by only0.001181 relative RMS, versus0.001124 at initialization. Sampled duplicate-row matrix cosines remain0.99987–0.99997. The nearly redundant streams weaken the interpretation that this experiment tested useful extra capacity. Full measurements: wide_capacity_symmetry_diagnostic.json. No current weights changed. + +## E73 independently initialized extra feature stream — prepared, not launched +Hypothesis: widening by near-identical copies keeps the extra neurons redundant. Build a146,477,344-parameter model with the original512 features and a separate randomly initialized512-feature stream. Inherited linear maps occupy their original blocks; new internal maps are independently random; cross-stream maps and new output-head columns start at zero. Layer normalization operates on each512-feature group separately so the parent function survives initialization. All maps, including cross-stream connections, will train. This changes initialization and normalization grouping relative to E58. Conversion seed241; own E47 parent. Same training seed113, B96, LR3e-5,32000-step schedule and optimizer/sampler reset at8000 with seed179 as the completed/recovered small control. Use unit LR multipliers because original columns are no longer duplicated or divided. No new data or generator. Conversion fixture: {"method": "independent random feature stream with block-diagonal inherited projections, zero cross-stream projections and zero new output columns; separate512-feature layer normalization", "parent_sha256": "0bad97e8994aac49ea173443db0a4fa8d72d33f9eb9e2660f06de75f7f1403eb", "random_initialization_seed": 241, "fixture_max_abs_difference": 1.6689300537109375e-06, "new_stream_activation": {"relative_rms_difference": 1.4169212579727173}, "learning_rate_multipliers": "one for every parameter", "checkpoint_sha256": "d164d8b12223032b23948d0dcb17389d10f8e739a30a1ade5f677d2a948e965b", "parameters": 146477344, "cpu_seconds": 2.802320774004329, "optimizer_updates": 0}. Initial screen and gradient checks precede training. + +### E70 static shape specialization outcome +All four tested context/horizon shapes compiled and produced finite gradients; returning to2048/512 reused graph1, with four unique graphs total. Loss differences remained below0.00007. First calls took47.33,38.52,51.27,46.47 seconds; steady forward/backward speedups ranged1.60–1.94 under shared load. Complete result compiler_static_shapes_result.json, elapsed208.31172983598663s. Static specialization is usable, but16 training shapes incur compilation cost and bf16 arithmetic changes; existing active training runs remain eager. + +## E58/E66 recovered146M at global12000 +- Checkpoint SHA-256: `3d39cb54e80093bf97c2d95eda6bd30fefa65ec47b33ba70838dc881321e31ea`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 41.74531269073486 seconds. +- Overall skill 0.373963; relative MASE 0.747878; relative WQL 0.524045. +- term skill: long=0.3982, medium=0.4082, short=0.3507. +- domain skill: Econ/Fin=0.1409, Energy=0.2357, Healthcare=0.3980, Nature=0.4325, Sales=0.3406, Transport=0.4658, Web/CloudOps=0.4987. +- frequency skill: A=0.3756, D=0.3419, H=0.3949, M=0.0902, Q=0.1997, S=0.4220, T=0.4377, W=0.2068. +- variates skill: multivariate=0.3930, univariate=0.3584. +- Outcome: Diagnostic checkpoint; training continues. See experiment hypothesis and matched controls above. + +## E63 expanded corpus at146M first4000 +- Checkpoint SHA-256: `c89939a906b619e3d119a26d2edf1b567ff902930ca78b3e58cdce5903ed3077`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 41.43943977355957 seconds. +- Overall skill 0.373186; relative MASE 0.749492; relative WQL 0.524216. +- term skill: long=0.3994, medium=0.4061, short=0.3496. +- domain skill: Econ/Fin=0.1406, Energy=0.2371, Healthcare=0.4020, Nature=0.4224, Sales=0.3395, Transport=0.4650, Web/CloudOps=0.5007. +- frequency skill: A=0.3699, D=0.3383, H=0.3939, M=0.1020, Q=0.2066, S=0.4209, T=0.4379, W=0.2018. +- variates skill: multivariate=0.3928, univariate=0.3571. +- Outcome: Diagnostic checkpoint; training continues. See experiment hypothesis and matched controls above. + +## E61 slow AR3000 first earlier cutoff +- Checkpoint SHA-256: `c8d675cce3857f6c065a231ccbd4f2dfb76c6c49236da051d13b450287006a6f`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 26.004189491271973 seconds. +- Overall skill 0.329626; relative MASE 0.805342; relative WQL 0.558025. +- term skill: long=0.3886, medium=0.3565, short=0.2947. +- domain skill: Econ/Fin=0.1530, Energy=0.2229, Healthcare=0.4151, Nature=0.3515, Sales=0.3980, Transport=0.3624, Web/CloudOps=0.4448. +- frequency skill: A=0.3216, D=0.3548, H=0.3555, M=0.1730, Q=0.2272, S=0.3450, T=0.3293, W=0.2673. +- variates skill: multivariate=0.3459, univariate=0.3164. +- Outcome: Diagnostic checkpoint; training continues. See experiment hypothesis and matched controls above. + +## E61 slow AR3000 second earlier cutoff +- Checkpoint SHA-256: `c8d675cce3857f6c065a231ccbd4f2dfb76c6c49236da051d13b450287006a6f`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 25.961536407470703 seconds. +- Overall skill 0.353271; relative MASE 0.774762; relative WQL 0.539854. +- term skill: long=0.3691, medium=0.3752, short=0.3388. +- domain skill: Econ/Fin=0.0921, Energy=0.2250, Healthcare=0.3726, Nature=0.4619, Sales=0.5589, Transport=0.4127, Web/CloudOps=0.4305. +- frequency skill: A=0.3401, D=0.4317, H=0.3862, M=0.1746, Q=0.1512, S=0.2822, T=0.3452, W=0.2437. +- variates skill: multivariate=0.3595, univariate=0.3482. +- Outcome: Diagnostic checkpoint; training continues. See experiment hypothesis and matched controls above. + +## E67 paired3000 third earlier cutoff +- Checkpoint SHA-256: `2a19ebe0d41c1a18feaba318041795be4d268ce890162a5035e6fc6bf1844238`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 26.884973287582397 seconds. +- Overall skill 0.389069; relative MASE 0.736752; relative WQL 0.506597. +- term skill: long=0.3965, medium=0.3605, short=0.3968. +- domain skill: Econ/Fin=0.1707, Energy=0.3208, Healthcare=0.2592, Nature=0.5054, Sales=0.3991, Transport=0.5053, Web/CloudOps=0.3895. +- frequency skill: A=0.3624, D=0.4436, H=0.4039, M=0.1198, Q=0.2578, S=0.2862, T=0.4305, W=0.2611. +- variates skill: multivariate=0.3741, univariate=0.4006. +- Outcome: Diagnostic checkpoint; training continues. See experiment hypothesis and matched controls above. + +## E67 candidate3000 complete package validation +- Checkpoint SHA-256: `2a19ebe0d41c1a18feaba318041795be4d268ce890162a5035e6fc6bf1844238`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.374401; relative MASE 0.746075; relative WQL 0.524578. +- term skill: long=0.3961, medium=0.4055, short=0.3534. +- domain skill: Econ/Fin=0.1115, Energy=0.2320, Healthcare=0.4573, Nature=0.4303, Sales=0.3470, Transport=0.4663, Web/CloudOps=0.4964. +- frequency skill: A=0.2888, D=0.3569, H=0.3930, M=0.1278, Q=0.1823, S=0.4232, T=0.4312, W=0.2160. +- variates skill: multivariate=0.3926, univariate=0.3596. +- Outcome: Full public-package validation. Training seed197, B64 distinct windows with both signs, LR2e-5;3000-step checkpoint at687.5s of training-loop elapsed time on the shared single H100. Exact public inference 129.863s. Paired candidate wins full validation and main screen; it improves earlier cutoffs2/3 versus E62, but loses0.000488 on cutoff1. Control full skill0.374180 versus paired0.374401. Select paired3000 with this temporal tradeoff recorded; training continues. + +## E67 control3000 complete package validation +- Checkpoint SHA-256: `c98f8d82047e6e0ecd00f144307623afdd581ee6624d880063f810d090e1a473`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.374180; relative MASE 0.746358; relative WQL 0.524749. +- term skill: long=0.3948, medium=0.4057, short=0.3535. +- domain skill: Econ/Fin=0.1134, Energy=0.2311, Healthcare=0.4600, Nature=0.4313, Sales=0.3473, Transport=0.4663, Web/CloudOps=0.4949. +- frequency skill: A=0.2923, D=0.3579, H=0.3922, M=0.1281, Q=0.1825, S=0.4224, T=0.4308, W=0.2163. +- variates skill: multivariate=0.3915, univariate=0.3600. +- Outcome: Full public-package validation. Training seed197, B64 distinct windows with both signs, LR2e-5;3000-step checkpoint at687.5s of training-loop elapsed time on the shared single H100. Exact public inference 131.546s. Paired candidate wins full validation and main screen; it improves earlier cutoffs2/3 versus E62, but loses0.000488 on cutoff1. Control full skill0.374180 versus paired0.374401. Select paired3000 with this temporal tradeoff recorded; training continues. + +E67 publication decision: paired3000 checkpoint2a19ebe0d41c1a18feaba318041795be4d268ce890162a5035e6fc6bf1844238, full0.3744010291; main0.3783180328; earlier cutoffs0.3357387876/0.3582353306/0.3890690875. Relative to published E62, full gain0.000981171, main gain0.000974817, earlier changes-0.000488248/+0.000541947/+0.001280498. All97 full configurations and151170 instances pass with no quantile crossings. Three example configurations are bitwise equal after independent relocation; runtime/weight hashes verified. The published inference remains eager. + +## E74 equal ensemble of E62 and its paired3000 continuation +Hypothesis: fixed forecast averaging can retain the parent's stronger first earlier cutoff while preserving gains from paired-sign training. Test exactly one equal-weight quantile mean after each model's existing fixed rules, without a weight sweep or additional zero projection. Both models would forecast every instance. Reuse cached predictions for screening; no training, new seed or source. Evaluate main and all three earlier cutoffs, then full validation only if promising; an actual packaged replay remains required before publication. Members: E62 hash22c08571978be31ba57368eb983089a40a44d56d4ae5e17da41afd2a761a258c, E67 hash2a19ebe0d41c1a18feaba318041795be4d268ce890162a5035e6fc6bf1844238. + +## full_paired_control_ema6000 +- Checkpoint SHA-256: `4517cc18d0d7b022c728a208b53bb0088fcefe249246640d26e688ba800cf84c`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 27.108938932418823 seconds. +- Overall skill 0.377544; relative MASE 0.744699; relative WQL 0.520279. +- term skill: long=0.3999, medium=0.4077, short=0.3567. +- domain skill: Econ/Fin=0.1294, Energy=0.2391, Healthcare=0.4588, Nature=0.4300, Sales=0.3396, Transport=0.4652, Web/CloudOps=0.4999. +- frequency skill: A=0.3728, D=0.3542, H=0.3955, M=0.1113, Q=0.1942, S=0.4228, T=0.4360, W=0.2279. +- variates skill: multivariate=0.3946, univariate=0.3636. +- Outcome: Paired6000 main improves to0.378455; matched control0.377544. Graft initialization reproduces parent0.375793 within numerical precision. Earlier paired diagnostics and future training determine selection. + +## full_paired_candidate_ema6000 +- Checkpoint SHA-256: `b797a18346b75d6cc1f541b56f880cd43055890f86b872bb37425b1c92609e71`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.94004225730896 seconds. +- Overall skill 0.378455; relative MASE 0.743557; relative WQL 0.519554. +- term skill: long=0.4019, medium=0.4071, short=0.3578. +- domain skill: Econ/Fin=0.1262, Energy=0.2397, Healthcare=0.4622, Nature=0.4291, Sales=0.3379, Transport=0.4657, Web/CloudOps=0.5030. +- frequency skill: A=0.3687, D=0.3544, H=0.3962, M=0.1031, Q=0.1932, S=0.4249, T=0.4385, W=0.2281. +- variates skill: multivariate=0.3972, univariate=0.3631. +- Outcome: Paired6000 main improves to0.378455; matched control0.377544. Graft initialization reproduces parent0.375793 within numerical precision. Earlier paired diagnostics and future training determine selection. + +## wide_graft_initial +- Checkpoint SHA-256: `d164d8b12223032b23948d0dcb17389d10f8e739a30a1ade5f677d2a948e965b`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 44.365342140197754 seconds. +- Overall skill 0.375793; relative MASE 0.745650; relative WQL 0.522544. +- term skill: long=0.3998, medium=0.4067, short=0.3540. +- domain skill: Econ/Fin=0.1396, Energy=0.2348, Healthcare=0.4405, Nature=0.4284, Sales=0.3399, Transport=0.4658, Web/CloudOps=0.5006. +- frequency skill: A=0.3762, D=0.3542, H=0.3951, M=0.0953, Q=0.1981, S=0.4239, T=0.4362, W=0.2089. +- variates skill: multivariate=0.3938, univariate=0.3611. +- Outcome: Paired6000 main improves to0.378455; matched control0.377544. Graft initialization reproduces parent0.375793 within numerical precision. Earlier paired diagnostics and future training determine selection. + +E74 valid_screen: skill0.37807862274263027, relativeMASE0.7436448167242383, relativeWQL0.5201222287724669, CPU0.8619319740100764s; group skills {"term": {"short": 0.35759494914169054, "medium": 0.40699311016073325, "long": 0.40082709768107416}, "domain": {"Econ/Fin": 0.1373283443599086, "Energy": 0.23867787085456083, "Healthcare": 0.4514094815443358, "Nature": 0.4314394439880541, "Sales": 0.3334613777872122, "Transport": 0.46623492569656166, "Web/CloudOps": 0.5020547204722161}, "freq": {"A-DEC": 0.3700186215632586, "Q-DEC": 0.1986150873665018, "M": 0.10412662722790622, "W-SUN": 0.07901894069086524, "D": 0.35481222927845457, "H": 0.39699199743484126, "15T": 0.21413878856050306, "W-FRI": -0.0023901912492456656, "10T": 0.615926427622083, "W-TUE": 0.5812846025030445, "W-THU": 0.20706119312963223, "W-WED": 0.31744777723871154, "5T": 0.5126119145163621, "10S": 0.4229238092063159}}. + +E74 valid_backcast: skill0.3362925418425802, relativeMASE0.7972981372266922, relativeWQL0.552500463058947, CPU0.8971402349998243s; group skills {"term": {"short": 0.30190782919949666, "medium": 0.35857372233263296, "long": 0.3983345998796374}, "domain": {"Econ/Fin": 0.15970397473963605, "Energy": 0.22932627079926182, "Healthcare": 0.40921062898616656, "Nature": 0.3642338798926953, "Sales": 0.395796512384459, "Transport": 0.3726773780449273, "Web/CloudOps": 0.4497268240013762}, "freq": {"A-DEC": 0.31984516176318767, "Q-DEC": 0.23213469399614717, "M": 0.1867528733976035, "W-SUN": 0.027286458584816375, "D": 0.35084294376677716, "H": 0.36615049422003554, "15T": 0.22473053922570885, "W-FRI": 0.2587886969661052, "10T": 0.3198607928100037, "W-TUE": 0.5430562436146349, "W-THU": 0.24609593870252322, "W-WED": 0.3423884364810911, "5T": 0.4378462658914031, "10S": 0.34158786712809996}}. + +E74 valid_backcast2: skill0.3582180334801286, relativeMASE0.771690389912856, relativeWQL0.5337426744378997, CPU0.6840074959909543s; group skills {"term": {"short": 0.3444537095616398, "medium": 0.3869421164002306, "long": 0.36441392284164364}, "domain": {"Econ/Fin": 0.10841961881158191, "Energy": 0.2363021419988357, "Healthcare": 0.34644304914503876, "Nature": 0.4685938042819019, "Sales": 0.5492137665291525, "Transport": 0.4207857629370483, "Web/CloudOps": 0.4314575495135424}, "freq": {"A-DEC": 0.3538974701075839, "Q-DEC": 0.1504553008739551, "M": 0.15220470977886436, "W-SUN": 0.04613015348540839, "D": 0.42446352745465865, "H": 0.39096253798739566, "15T": 0.10670219795421398, "W-FRI": 0.14873972396574198, "10T": 0.4961638002828159, "W-TUE": 0.08195477095370607, "W-THU": 0.32491052813791066, "W-WED": 0.5372312006064026, "5T": 0.46600691242017644, "10S": 0.28101678592852175}}. + +E74 valid_backcast3: skill0.38866584889169165, relativeMASE0.7372042201081582, relativeWQL0.506955107034635, CPU0.6765452020335943s; group skills {"term": {"short": 0.39634584808261863, "medium": 0.36050403977747736, "long": 0.39564160116149116}, "domain": {"Econ/Fin": 0.17218827750208232, "Energy": 0.32018031275863146, "Healthcare": 0.251739940360198, "Nature": 0.505730039991936, "Sales": 0.3992528233665873, "Transport": 0.5057485203797758, "Web/CloudOps": 0.38900692766706535}, "freq": {"A-DEC": 0.35992280976221613, "Q-DEC": 0.2607290890980446, "M": 0.1158596568834448, "W-SUN": 0.14646809588021303, "D": 0.4430503070010823, "H": 0.40373923909167875, "15T": 0.26167249262649306, "W-FRI": 0.026229112650416053, "10T": 0.6033044583572338, "W-TUE": 0.2614261172432897, "W-THU": 0.3805020665242401, "W-WED": 0.37420834670061953, "5T": 0.4617999415682724, "10S": 0.28494980458180186}}. + +E74 fixed ensemble recovers cutoff1 but is below the paired member on main and cutoffs2/3. Check cached full validation before deciding; no mixture coefficient tuning. + +E73 gradient fixture: {"cpu_seconds": 3.0038612950011156, "seed": 251, "allowed_training_windows": 2, "loss": 0.6392828226089478, "initial_gradients": {"head_new_columns": 1.3039275407791138, "encoder0_new_to_old_attention": 0.16236796975135803, "decoder3_new_to_old_ff": 0.3286978602409363}, "all_gradients_finite": true, "optimizer_updates": 0}. All gradients finite, with nonzero gradient to new output columns and new-to-old attention/feedforward maps at initialization. + +## E67 paired6000 backcast_evals +- Checkpoint SHA-256: `b797a18346b75d6cc1f541b56f880cd43055890f86b872bb37425b1c92609e71`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 27.112698793411255 seconds. +- Overall skill 0.335119; relative MASE 0.798971; relative WQL 0.553296. +- term skill: long=0.3996, medium=0.3567, short=0.2999. +- domain skill: Econ/Fin=0.1484, Energy=0.2276, Healthcare=0.4122, Nature=0.3651, Sales=0.3962, Transport=0.3724, Web/CloudOps=0.4480. +- frequency skill: A=0.3127, D=0.3525, H=0.3668, M=0.1712, Q=0.2359, S=0.3414, T=0.3328, W=0.2844. +- variates skill: multivariate=0.3517, univariate=0.3216. +- Outcome: Compared with paired3000, cutoff1 loses0.000620 and cutoff2 gains0.001211. Main gains0.000137. Complete package validation and third earlier cutoff follow; keep paired3000 published meanwhile. + +## E67 paired6000 backcast2_evals +- Checkpoint SHA-256: `b797a18346b75d6cc1f541b56f880cd43055890f86b872bb37425b1c92609e71`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 25.65610408782959 seconds. +- Overall skill 0.359446; relative MASE 0.769629; relative WQL 0.533126. +- term skill: long=0.3637, medium=0.3914, short=0.3451. +- domain skill: Econ/Fin=0.0947, Energy=0.2369, Healthcare=0.3640, Nature=0.4722, Sales=0.5483, Transport=0.4203, Web/CloudOps=0.4322. +- frequency skill: A=0.3460, D=0.4239, H=0.3913, M=0.1623, Q=0.1478, S=0.2801, T=0.3609, W=0.2646. +- variates skill: multivariate=0.3635, univariate=0.3561. +- Outcome: Compared with paired3000, cutoff1 loses0.000620 and cutoff2 gains0.001211. Main gains0.000137. Complete package validation and third earlier cutoff follow; keep paired3000 published meanwhile. + +E74 cached full validation: skill0.37416157579966614, relativeMASE0.7463637996830615, relativeWQL0.5247758979895311, CPU1.7625104649923742s; group skills {"term": {"short": 0.35339006443372445, "medium": 0.4058776358425863, "long": 0.39478447597143573}, "domain": {"Econ/Fin": 0.1148260686606345, "Energy": 0.2315840307823489, "Healthcare": 0.45764579718017184, "Nature": 0.4314211475708052, "Sales": 0.3476654519885174, "Transport": 0.46645466438647154, "Web/CloudOps": 0.49435858431787905}, "freq": {"A-DEC": 0.2905258409636121, "Q-DEC": 0.18415390225031736, "M": 0.12808227393650784, "W-SUN": 0.042170378733840996, "D": 0.3587361531705563, "H": 0.39218267210684865, "15T": 0.20355479619501637, "W-FRI": -0.021429381368383904, "10T": 0.615926427622083, "W-TUE": 0.5812846025030445, "W-THU": 0.20706119312963223, "W-WED": 0.31744777723871154, "5T": 0.5037733014006005, "10S": 0.4229238092063159}}. Below paired3000 skill0.374401 by0.000239. Reject: the first earlier-cutoff benefit does not outweigh lower full/main/other-earlier scores. No ensemble package is published and no weight sweep follows. + +E71 initial8-point model main screen0.3622169411 versus E62 parent0.3773432163; conversion intentionally changes function. CPU fixture0.9008s verifies constant-input projection folding, unchanged inherited tensors, finite/ordered forecasts at6/18/720/900 steps. Training recovery must justify this initialization cost. + +E58/E63 resource decision fixed before the next results: at global16000, stop the near-duplicate width trial if it remains below both its E47 parent and the matched small control; preserve a complete recovery checkpoint. At8000, assess expanded-corpus146M against its same-width original-corpus8000. Prioritize the independent-stream E73 initialization when a large training slot is released. Existing runs retain eager arithmetic. + +## E67 paired6000 exact full package +- Checkpoint SHA-256: `b797a18346b75d6cc1f541b56f880cd43055890f86b872bb37425b1c92609e71`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.374279; relative MASE 0.746472; relative WQL 0.524502. +- term skill: long=0.3958, medium=0.4059, short=0.3532. +- domain skill: Econ/Fin=0.1029, Energy=0.2327, Healthcare=0.4651, Nature=0.4291, Sales=0.3514, Transport=0.4660, Web/CloudOps=0.4952. +- frequency skill: A=0.2886, D=0.3570, H=0.3913, M=0.1264, Q=0.1824, S=0.4249, T=0.4314, W=0.2203. +- variates skill: multivariate=0.3928, univariate=0.3591. +- Outcome: Paired6000 full0.374279 is below published3000 full0.374401 despite main/earlier2/earlier3 gains; retain3000 while training continues. Recent normalization6000 improves matched long-context baseline0.373979 and slightly exceeds4096 control0.374515; continue to12000. + +## E67 paired6000 third earlier cutoff +- Checkpoint SHA-256: `b797a18346b75d6cc1f541b56f880cd43055890f86b872bb37425b1c92609e71`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 25.89822793006897 seconds. +- Overall skill 0.389533; relative MASE 0.736193; relative WQL 0.506212. +- term skill: long=0.3966, medium=0.3607, short=0.3974. +- domain skill: Econ/Fin=0.1634, Energy=0.3178, Healthcare=0.2808, Nature=0.5081, Sales=0.3977, Transport=0.5055, Web/CloudOps=0.3908. +- frequency skill: A=0.3558, D=0.4451, H=0.4045, M=0.1415, Q=0.2554, S=0.2895, T=0.4276, W=0.2643. +- variates skill: multivariate=0.3722, univariate=0.4028. +- Outcome: Paired6000 full0.374279 is below published3000 full0.374401 despite main/earlier2/earlier3 gains; retain3000 while training continues. Recent normalization6000 improves matched long-context baseline0.373979 and slightly exceeds4096 control0.374515; continue to12000. + +## E65 recent normalization6000 +- Checkpoint SHA-256: `1c5bc9b814879a43941f6e59b6d2024152ec9db43014e2b4431195e52366f1ea`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 34.534422874450684 seconds. +- Overall skill 0.374709; relative MASE 0.745557; relative WQL 0.524426. +- term skill: long=0.4014, medium=0.4044, short=0.3523. +- domain skill: Econ/Fin=0.1384, Energy=0.2354, Healthcare=0.4238, Nature=0.4264, Sales=0.3389, Transport=0.4711, Web/CloudOps=0.4974. +- frequency skill: A=0.3756, D=0.3531, H=0.3970, M=0.0716, Q=0.2013, S=0.4239, T=0.4343, W=0.2078. +- variates skill: multivariate=0.3915, univariate=0.3610. +- Outcome: Paired6000 full0.374279 is below published3000 full0.374401 despite main/earlier2/earlier3 gains; retain3000 while training continues. Recent normalization6000 improves matched long-context baseline0.373979 and slightly exceeds4096 control0.374515; continue to12000. + +E67 paired6000 full public inference131.433437s on the shared single H100; all97 configurations and151170 instances passed. The original3k publication remains selected by full validation, with the temporal tradeoff documented. + +## E75 training loss after fixed inference transformations — prepared, not launched +Hypothesis: paired training aligns sign averaging but still scores raw neural forecasts, whereas inference changes them with seasonal and continuity priors and exact-zero projection. Compute the same fixed context statistics without model gradients, then apply the transforms differentiably to forecasts before the existing normalized median/quantile loss. Gradients include the continuity correction's dependence on the first forecast; zero/positivity thresholds remain fixed and piecewise differentiable. The target transform and seasonal loss weight stay unchanged. Planned E62 initialization, seed197, paired loss, B64, LR2e-5,12000 steps, identical data stream to E67 paired. No new data/generator and no inference changes. CPU implementation comparison: {"cpu_seconds": 0.11522011604392901, "seed": 263, "fixtures": [{"context": 8, "horizon": 6, "maximum_absolute_difference": 0.0, "finite_gradients": true}, {"context": 64, "horizon": 18, "maximum_absolute_difference": 2.384185791015625e-07, "finite_gradients": true}, {"context": 512, "horizon": 128, "maximum_absolute_difference": 1.1920928955078125e-06, "finite_gradients": true}, {"context": 4096, "horizon": 900, "maximum_absolute_difference": 7.152557373046875e-07, "finite_gradients": true}], "optimizer_updates": 0}. Fixture agreement is numerical, not bitwise, because training computes context statistics in float64. Await a training slot and one allowed-window end-to-end gradient check. + +## E61 slow AR6000 evals +- Checkpoint SHA-256: `fea5b5290a3a9be5618eaeaf67e918e4f677d5be908d562040ce4bdfeb549bd9`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.034730434417725 seconds. +- Overall skill 0.361281; relative MASE 0.760333; relative WQL 0.536557. +- term skill: long=0.3915, medium=0.4029, short=0.3324. +- domain skill: Econ/Fin=0.1215, Energy=0.1845, Healthcare=0.4313, Nature=0.4272, Sales=0.3429, Transport=0.4577, Web/CloudOps=0.5068. +- frequency skill: A=0.3788, D=0.3481, H=0.3812, M=0.1116, Q=0.2006, S=0.4421, T=0.4034, W=0.2113. +- variates skill: multivariate=0.3930, univariate=0.3349. +- Outcome: Main skill0.361281 exceeds matched partial-target0.359222. Compare both earlier windows with E42; continue to12000. + +## E61 slow AR6000 backcast_evals +- Checkpoint SHA-256: `fea5b5290a3a9be5618eaeaf67e918e4f677d5be908d562040ce4bdfeb549bd9`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 25.68802785873413 seconds. +- Overall skill 0.331040; relative MASE 0.803953; relative WQL 0.556635. +- term skill: long=0.3886, medium=0.3569, short=0.2972. +- domain skill: Econ/Fin=0.1588, Energy=0.2277, Healthcare=0.4061, Nature=0.3526, Sales=0.3967, Transport=0.3629, Web/CloudOps=0.4452. +- frequency skill: A=0.3244, D=0.3518, H=0.3577, M=0.1682, Q=0.2306, S=0.3442, T=0.3314, W=0.2762. +- variates skill: multivariate=0.3484, univariate=0.3169. +- Outcome: Main skill0.361281 exceeds matched partial-target0.359222. Compare both earlier windows with E42; continue to12000. + +## E61 slow AR6000 backcast2_evals +- Checkpoint SHA-256: `fea5b5290a3a9be5618eaeaf67e918e4f677d5be908d562040ce4bdfeb549bd9`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 25.468894004821777 seconds. +- Overall skill 0.354097; relative MASE 0.774005; relative WQL 0.539002. +- term skill: long=0.3704, medium=0.3752, short=0.3398. +- domain skill: Econ/Fin=0.0990, Energy=0.2275, Healthcare=0.3686, Nature=0.4617, Sales=0.5571, Transport=0.4131, Web/CloudOps=0.4308. +- frequency skill: A=0.3441, D=0.4303, H=0.3862, M=0.1683, Q=0.1512, S=0.2846, T=0.3470, W=0.2514. +- variates skill: multivariate=0.3602, univariate=0.3491. +- Outcome: Main skill0.361281 exceeds matched partial-target0.359222. Compare both earlier windows with E42; continue to12000. + +E73 compiler fixture: {"seed": 271, "batch": 16, "context": 512, "horizon": 128, "eager_loss": 0.2625328004360199, "compiled_loss": 0.26252102851867676, "gradient_cosine": 0.9994836559992685, "maximum_gradient_difference": 0.003173828125, "compile_and_gradient_comparison_seconds": 65.4888255270198, "total_seconds": 66.77216628700262, "optimizer_updates": 0, "source": "allowed packed_sample and own generator"}. Static compilation is numerically close, not bitwise; use it for the32k-step independent-stream trial to amortize the16 shape compilations. This implementation difference from the existing eager small control is explicit. Loss formula, sampler, optimizer and schedule stay fixed. + +E75 allowed-window end-to-end fixture: {"cpu_seconds": 2.641128608956933, "seed": 269, "allowed_training_and_own_synthetic_windows": 8, "loss": 0.2808418869972229, "gradient_norm": 0.18120726943016052, "all_gradients_finite": true, "optimizer_updates": 0}. No optimizer updates. + +E69 is now queued after the slow-AR trainer PID980 exits with ema012000.pt, using its declared eager settings and the same allocation. Queue receipt volatility_synth_queue.json and watcher watch_volatility_synth.log identify the run. No E69 training has started yet. + +E71 maximum-shape GPU fixture: {"seed": 277, "batch": 64, "signed_rows": 128, "context": 4096, "horizon": 1024, "optimizer_updates": 0, "loss": 0.2055814117193222, "seconds": 10.965134899015538, "peak_allocated_mib": 10373.298828125, "peak_reserved_mib": 10992.0}. Passed without optimizer updates. Queue after both E67 trainers finish12000, so its larger working set reuses their combined allocation. + +E75 queued after E65 recent-normalization finishes12000. Both new queues require the predecessor final EMA before starting, and use the declared eager settings. E72 mixup remains prepared only; E73 awaits the prespecified width checkpoint decision. + +## E76 transfer the matched slow-AR6000 correction +E61 improves the main and both earlier cutoffs at6000 versus E42. Hypothesis: this learned synthetic-dynamics correction also helps the selected paired3000 model. Form exactly base(E67 paired3000)+candidate(E61 slowAR6000)-control(E42 partial6000), coefficient1.0 on matching tensors; keep the base confidence projection unchanged. All three checkpoints were trained here on declared sources. No coefficient sweep, new training, data or inference changes. Compare the main and earlier screens before full replay. + +## E76 slow-AR correction evals +- Checkpoint SHA-256: `8562cb05319ed04fdd8544a1af80bf1688ba55284e59b4689aa646e34e38a105`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.135655403137207 seconds. +- Overall skill 0.379721; relative MASE 0.741564; relative WQL 0.518831. +- term skill: long=0.4036, medium=0.4064, short=0.3597. +- domain skill: Econ/Fin=0.1442, Energy=0.2362, Healthcare=0.4597, Nature=0.4330, Sales=0.3350, Transport=0.4655, Web/CloudOps=0.5071. +- frequency skill: A=0.3715, D=0.3604, H=0.3974, M=0.0968, Q=0.1987, S=0.4260, T=0.4397, W=0.2230. +- variates skill: multivariate=0.3981, univariate=0.3647. +- Outcome: Fixed coefficient1.0 matched own-model correction improves all three screens over paired3000. Full public-package validation and the third earlier cutoff follow before publication. No additional optimization. + +## E76 slow-AR correction backcast_evals +- Checkpoint SHA-256: `8562cb05319ed04fdd8544a1af80bf1688ba55284e59b4689aa646e34e38a105`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 25.913641452789307 seconds. +- Overall skill 0.336781; relative MASE 0.795517; relative WQL 0.552923. +- term skill: long=0.3965, medium=0.3587, short=0.3036. +- domain skill: Econ/Fin=0.1684, Energy=0.2257, Healthcare=0.4092, Nature=0.3689, Sales=0.3927, Transport=0.3721, Web/CloudOps=0.4520. +- frequency skill: A=0.3199, D=0.3498, H=0.3654, M=0.1876, Q=0.2323, S=0.3437, T=0.3374, W=0.2878. +- variates skill: multivariate=0.3539, univariate=0.3228. +- Outcome: Fixed coefficient1.0 matched own-model correction improves all three screens over paired3000. Full public-package validation and the third earlier cutoff follow before publication. No additional optimization. + +## E76 slow-AR correction backcast2_evals +- Checkpoint SHA-256: `8562cb05319ed04fdd8544a1af80bf1688ba55284e59b4689aa646e34e38a105`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 25.258840799331665 seconds. +- Overall skill 0.360577; relative MASE 0.768980; relative WQL 0.531693. +- term skill: long=0.3677, medium=0.3876, short=0.3472. +- domain skill: Econ/Fin=0.1192, Energy=0.2354, Healthcare=0.3433, Nature=0.4736, Sales=0.5465, Transport=0.4203, Web/CloudOps=0.4380. +- frequency skill: A=0.3515, D=0.4289, H=0.3897, M=0.1383, Q=0.1499, S=0.2861, T=0.3643, W=0.2654. +- variates skill: multivariate=0.3674, univariate=0.3550. +- Outcome: Fixed coefficient1.0 matched own-model correction improves all three screens over paired3000. Full public-package validation and the third earlier cutoff follow before publication. No additional optimization. + +E76 CPU composition receipt: {"method": "matched training delta", "formula": "base + candidate - control", "coefficient": 1.0, "parent_hashes": {"/workspace/research/runs/full_paired_candidate/ema003000.pt": "2a19ebe0d41c1a18feaba318041795be4d268ce890162a5035e6fc6bf1844238", "/workspace/research/runs/long_memory_synth_recovery/ema006000.pt": "fea5b5290a3a9be5618eaeaf67e918e4f677d5be908d562040ce4bdfeb549bd9", "/workspace/research/runs/partial_targets/ema006000.pt": "67562486b099a350da53c3caa5ff0932fe7fecdfe72c1879b064b2a9bb173dfb"}, "seconds": 1.1477709169848822}. + +## E77 slow-AR synthesis during full paired-sign training — prepared, not launched +E61's matched correction transfers favorably to the selected model on three screens. Hypothesis: training the confidence/horizon-aware model directly with the same slow-AR prior can improve on composing an older-backbone correction. Reuse E67's exact E62 initialization, seed197, B64, LR2e-5,12000-step schedule, paired-sign loss and independent horizon RNG300200. Change only synthetic AR phi fromU(.2,.995) toexp(-10**(-U(0,4))), preserving the main RNG calls and zero initial state. This yields time constants log-uniform1..10000 and keeps innovation variance normalized as before. Compare to the already-computed E67 paired control. No inference change, new corpus or validation training. Prioritize after a training allocation is released; E72 mixup remains an unlaunched alternative. + +## E76 slow-AR correction third earlier cutoff +- Checkpoint SHA-256: `8562cb05319ed04fdd8544a1af80bf1688ba55284e59b4689aa646e34e38a105`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 25.890827178955078 seconds. +- Overall skill 0.389281; relative MASE 0.737064; relative WQL 0.506031. +- term skill: long=0.3949, medium=0.3619, short=0.3971. +- domain skill: Econ/Fin=0.1812, Energy=0.3198, Healthcare=0.2311, Nature=0.5053, Sales=0.3996, Transport=0.5073, Web/CloudOps=0.3940. +- frequency skill: A=0.3622, D=0.4457, H=0.4032, M=0.1047, Q=0.2602, S=0.2878, T=0.4313, W=0.2630. +- variates skill: multivariate=0.3743, univariate=0.4008. +- Outcome: Publish E76: full0.375612 improves paired3000 full0.374401; main0.379721 and earlier0.336781/0.360577/0.389281 all improve. All97 configurations and151170 instances pass; zero crossings. Fixed coefficient1.0 composition of own trained checkpoints; no additional training. + +## E76 slow-AR correction full package validation +- Checkpoint SHA-256: `8562cb05319ed04fdd8544a1af80bf1688ba55284e59b4689aa646e34e38a105`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.375612; relative MASE 0.744415; relative WQL 0.523713. +- term skill: long=0.3976, medium=0.4054, short=0.3551. +- domain skill: Econ/Fin=0.1204, Energy=0.2291, Healthcare=0.4651, Nature=0.4330, Sales=0.3487, Transport=0.4658, Web/CloudOps=0.4992. +- frequency skill: A=0.2896, D=0.3638, H=0.3924, M=0.1218, Q=0.1820, S=0.4260, T=0.4325, W=0.2151. +- variates skill: multivariate=0.3936, univariate=0.3609. +- Outcome: Publish E76: full0.375612 improves paired3000 full0.374401; main0.379721 and earlier0.336781/0.360577/0.389281 all improve. All97 configurations and151170 instances pass; zero crossings. Fixed coefficient1.0 composition of own trained checkpoints; no additional training. + +E76 published checkpoint SHA2568562cb05319ed04fdd8544a1af80bf1688ba55284e59b4689aa646e34e38a105. Public full inference132.224730s on the shared H100. Relocation fixture15.725434s: three example configurations, bitwise identical, finite and monotone; all runtime/weight hashes verified. The checker initially ran before candidate assembly completed and was restarted after the package existed; the infrastructure error log is retained separately. No inference runtime change. + +E77 sampler fixture: {"seed": 197, "main_and_horizon_rng_matched": true, "real_windows_bitwise_equal": true, "changed_synthetic_context_values": 37211, "cpu_seconds": 4.491440053971019, "optimizer_updates": 0}. Prepared only; no optimizer updates or launch yet. + +## wide_capacity_146m_recovery_ema16000 +- Checkpoint SHA-256: `ad4960e948e64ecf25ec3be4cdc50bae6c7076d15cd7470b028f6ac703bb1081`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 40.720494747161865 seconds. +- Overall skill 0.375817; relative MASE 0.745785; relative WQL 0.522408. +- term skill: long=0.3987, medium=0.4075, short=0.3541. +- domain skill: Econ/Fin=0.1398, Energy=0.2372, Healthcare=0.4246, Nature=0.4298, Sales=0.3438, Transport=0.4655, Web/CloudOps=0.5003. +- frequency skill: A=0.3787, D=0.3494, H=0.3971, M=0.0940, Q=0.1979, S=0.4232, T=0.4362, W=0.2114. +- variates skill: multivariate=0.3941, univariate=0.3609. +- Outcome: Original-corpus146M at16000 reaches0.375817, above its E47 parent0.375793 and matched small control0.375510: retain the planned continuation. Expanded corpus at8000 scores0.374266 versus original-corpus8000 .374330, an essentially tied result after a worse4000 checkpoint. Stop the expanded branch, preserve full recovery state, and prioritize an initialization that actually diversifies features. This is inconclusive for data scaling, not proof that expanded data is harmful. + +## wide_corpus_expanded_recovery_ema8000 +- Checkpoint SHA-256: `fbab74444b04d805cc04ec612964fcad5e66766d55c3f566a8dc870328ca4493`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 40.68104600906372 seconds. +- Overall skill 0.374266; relative MASE 0.747150; relative WQL 0.524049. +- term skill: long=0.4008, medium=0.4075, short=0.3504. +- domain skill: Econ/Fin=0.1428, Energy=0.2366, Healthcare=0.4040, Nature=0.4268, Sales=0.3397, Transport=0.4655, Web/CloudOps=0.5014. +- frequency skill: A=0.3790, D=0.3421, H=0.3958, M=0.1065, Q=0.2072, S=0.4225, T=0.4375, W=0.1966. +- variates skill: multivariate=0.3942, univariate=0.3579. +- Outcome: Original-corpus146M at16000 reaches0.375817, above its E47 parent0.375793 and matched small control0.375510: retain the planned continuation. Expanded corpus at8000 scores0.374266 versus original-corpus8000 .374330, an essentially tied result after a worse4000 checkpoint. Stop the expanded branch, preserve full recovery state, and prioritize an initialization that actually diversifies features. This is inconclusive for data scaling, not proof that expanded data is harmful. + +E63 stop requested after8000 evaluation. No validation gain justifies continuing the nearly duplicated-width expanded-data arm while E73 is ready; the complete recovery state will allow later continuation. E73 takes that allocation with seed113/B96/LR3e-5/32000, reset at8000 toseed179, and static compiled loss. Its separate feature-group normalization and independent stream are the research changes; compiler numerical differences were measured explicitly. + +E75 maximum-shape bf16 GPU fixture: {"seed": 281, "batch": 64, "context": 4096, "horizon": 1024, "optimizer_updates": 0, "loss": 0.22305740416049957, "seconds": 10.91669597796863, "peak_allocated_mib": 5362.6640625, "peak_reserved_mib": 5694.0}. All model gradients finite; no optimizer updates. + +E73 independent feature stream with static compilation, seed113 training started at 2026-10-22T07:07:01Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E71 eight-point patches, seed197 training started at 2026-10-22T07:08:06Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E63 stop receipt: {"experiment": "E63 expanded146M stopped", "step": 8501, "training_loop_seconds": 2892.9847088330425, "checkpoint_sha256": "1d578f0a2278a3a4ad7011e24957797dde52c70b7e2c6f8b369aaf8227ac7133", "ema": "/workspace/research/runs/wide_corpus_expanded_recovery/ema008501.pt", "complete_recovery": "/workspace/research/runs/wide_corpus_expanded_recovery/recovery.pt", "selection_checkpoint_step": 8000, "selection_skill": 0.3742660744379728, "outcome": "Essentially tied with original-corpus same-width8000 .3743298586; prioritize independent stream. Data scaling remains inconclusive."}. + +## E67 full_paired_control final12000 +- Checkpoint SHA-256: `b79cfdeefa1b2b20af89c8484a447dc96bfdd31234f2b08346468c8d9ece62bd`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 20.30943751335144 seconds. +- Overall skill 0.377243; relative MASE 0.745277; relative WQL 0.520379. +- term skill: long=0.4013, medium=0.4067, short=0.3560. +- domain skill: Econ/Fin=0.1346, Energy=0.2365, Healthcare=0.4485, Nature=0.4306, Sales=0.3336, Transport=0.4666, Web/CloudOps=0.5025. +- frequency skill: A=0.3681, D=0.3525, H=0.3948, M=0.1073, Q=0.2012, S=0.4245, T=0.4384, W=0.2186. +- variates skill: multivariate=0.3950, univariate=0.3628. +- Outcome: Seed197/B64/LR2e-5; final12000 is worse than the selected paired3000 and its published slow-AR correction. No publication. Matched control and candidate complete; no baseline rerun. + +## E67 full_paired_candidate final12000 +- Checkpoint SHA-256: `26d529aeaaee4484b0b4375fdc379779b08b38ac5077f0147587421f4f5fc8b0`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 21.91175127029419 seconds. +- Overall skill 0.377427; relative MASE 0.744720; relative WQL 0.520460. +- term skill: long=0.4032, medium=0.4055, short=0.3560. +- domain skill: Econ/Fin=0.1326, Energy=0.2359, Healthcare=0.4464, Nature=0.4299, Sales=0.3326, Transport=0.4667, Web/CloudOps=0.5051. +- frequency skill: A=0.3614, D=0.3505, H=0.3948, M=0.1036, Q=0.1986, S=0.4251, T=0.4404, W=0.2181. +- variates skill: multivariate=0.3963, univariate=0.3620. +- Outcome: Seed197/B64/LR2e-5; final12000 is worse than the selected paired3000 and its published slow-AR correction. No publication. Matched control and candidate complete; no baseline rerun. + +E67 complete measured training loop times on the shared H100: individual control2794.8358459s; paired candidate2794.8673859s. These are overlapping wall times, not additive exclusive GPU seconds. + +## Operator recovery2 — 2026-10-22 +The operator reports152594 research seconds remaining; all old processes ended. Published E76 verified SHA2568562cb05319ed04fdd8544a1af80bf1688ba55284e59b4689aa646e34e38a105 and full validation0.3756123475. Resume complete optimizer/EMA/RNG/prefetched-batch checkpoints: E58/E66 wide17000 and control23000, E61 slowAR8000, E65 recent normalization9000. Their prior last logged steps17200/23750/8450/9600 represent at least200/750/450/600 unsaved updates discarded. Original phase logs remain intact, latest elapsed3043.3/3041.0/3037.0/3034.3s respectively. E73 graft had no checkpoint or logged50-step interval; E71 patch8 reached200/63.0s with no checkpoint. Restart both from saved own initialization with unchanged seeds. Compiler caches were absent after recovery, so E73 recompiles static shapes. E63 remains stopped; E67 remains complete. Phase commands/PIDs/timing are recorded in recovery2_launch_receipt.json and *_recovery2.log; queued E69/E75/E77 retain predeclared settings. + +## E78 multiple persistent scales in synthetic residuals — prepared, not launched +Hypothesis: the slow-AR improvement reflects missing persistent residual dynamics, but a single decay rate per synthetic sequence cannot represent fast variation superimposed on slow level changes. Compare four independent OU components to E77's one component. Keep the original component and main RNG draws; add three components with log-uniform time constants1..10000 from an independent RNG seed700200, then divide their sum by2 to preserve asymptotic stationary variance. All components retain zero initial state, isolating multiple scales from initialization. Other synthetic structure,20% synthetic fraction, real windows, horizon augmentation, architecture and loss remain unchanged. ParentE62, seed197/B64/LR2e-5/12000, paired-sign loss, main/horizon RNG identical to E77. This generator uses no external data. Prepare and check on allowed training windows; launch only after a suitable allocation is released. + +E78 sampler fixture passed: { "seed": 197, "extra_seed": 700200, "real_windows_bitwise_equal": 211, "synthetic_windows": 45, "changed_context_values": 26747, "main_and_horizon_rng_matched": true, "finite_masks_and_periods_matched": true, "cpu_seconds": 4.07623768504709, "optimizer_updates": 0 }; prepared only, no optimizer updates. + +## E58/E66 recovered37M control24000 +- Checkpoint SHA-256: `0a77157c454bf7a913b41493f052666ed1cfce3d65206b6c969fb8d95e6314a7`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.700880765914917 seconds. +- Overall skill 0.375681; relative MASE 0.745320; relative WQL 0.522962. +- term skill: long=0.4008, medium=0.4066, short=0.3534. +- domain skill: Econ/Fin=0.1417, Energy=0.2348, Healthcare=0.4210, Nature=0.4300, Sales=0.3397, Transport=0.4677, Web/CloudOps=0.5018. +- frequency skill: A=0.3784, D=0.3533, H=0.3961, M=0.0763, Q=0.2029, S=0.4222, T=0.4370, W=0.2113. +- variates skill: multivariate=0.3953, univariate=0.3596. +- Outcome: Seed113, matched reset at8000 toseed179. Skill0.375681 remains slightly below E47parent0.375793; continue the predeclared schedule to32000. E58large24000 is pending. + +## E79 fresh pretraining at37M and146M — prepared, not launched +Hypothesis: duplicating a mature smaller representation and continuing at a small learning rate limits the useful benefit of capacity. Test distinct random initializations under one matched modern recipe. Both arms use the same direct encoder/decoder architecture (patch16,6encoder/4decoder blocks, recency/confidence inputs and partial-target masks); widths512/1024 with8/16heads are the only architectural difference. Every tensor is initialized here with seed307; no parent weights. Both use packed_sample,20% own synthetic windows, the proven slow-AR time-constant prior1..10000, independent horizon-prefix augmentation seed300310, paired-sign objective, seed307 sampling, batch48 distinct/96signed rows, AdamW LR2e-4,400-step warmup and96000-step cosine schedule, EMA. Both use the same static compiled loss after a numerical/memory fixture. Save every1000; screen4000/8000/16000/24000/48000/72000/96000, with earlier cutoffs for promising candidates. This is a matched width comparison within the new recipe; comparisons to the old published lineage are model-selection comparisons, not clean causal claims about width. Reuse no released or baseline weights. Launch only after existing allocations release. The extended schedule supplies4.608M distinct sampled windows per arm; stop a clearly unpromising branch when its checkpoints establish that result. + +## E71 patch8 first1000 +- Checkpoint SHA-256: `67648eaef1f0a4fe5a7c5526f25c2c8724735720463d99250e814632841f9ada`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 32.271108627319336 seconds. +- Overall skill 0.374708; relative MASE 0.748109; relative WQL 0.522638. +- term skill: long=0.3990, medium=0.3996, short=0.3553. +- domain skill: Econ/Fin=0.1322, Energy=0.2323, Healthcare=0.4676, Nature=0.4328, Sales=0.3481, Transport=0.4583, Web/CloudOps=0.4952. +- frequency skill: A=0.3712, D=0.3577, H=0.3912, M=0.0847, Q=0.1944, S=0.4235, T=0.4328, W=0.2289. +- variates skill: multivariate=0.3876, univariate=0.3643. +- Outcome: Seed197/B64/LR2e-5; recovers most of the conversion loss, from initial0.362217 to0.374708. Still below matched patch16 paired1000 at0.376860 and parentE62 at0.377343; continue to3000/6000 before a decision. + +E79 initial checkpoint receipts: [ { "path": "/workspace/research/random_capacity_512_initial.pt", "sha256": "19da01694123fcb13df815689ca66460d0da596bd31dfabfabb08dda6f7801e4", "parameters": 36800800, "seed": 307, "cpu_seconds": 0.5544250560924411, "optimizer_updates": 0 }, { "path": "/workspace/research/random_capacity_1024_initial.pt", "sha256": "c9693619ca6277c26fef3b2bde37ff6796bec97b3af9f94588bbc5ddd329ec90", "parameters": 146477344, "seed": 307, "cpu_seconds": 2.0617611361667514, "optimizer_updates": 0 } ] + +E79 width512 fixture: { "width": 512, "initialization_seed": 307, "fixture_seed": 313, "optimizer_updates": 0, "maximum_shape_memory": { "batch": 48, "signed_rows": 96, "context": 4096, "horizon": 1024, "loss": 0.6031821966171265, "peak_allocated_mib": 4520.62451171875, "peak_reserved_mib": 4784.0 }, "eager_loss": 0.3412420153617859, "compiled_loss": 0.3412419855594635, "gradient_cosine": 0.9999952735476323, "max_gradient_difference": 4.57763671875e-05, "compile_comparison_seconds": 53.98739787377417, "total_seconds": 63.50496790325269, "source": "allowed packed_sample and own synthetic generator only" } + +E79 width1024 fixture: { "width": 1024, "initialization_seed": 307, "fixture_seed": 313, "optimizer_updates": 0, "maximum_shape_memory": { "batch": 48, "signed_rows": 96, "context": 4096, "horizon": 1024, "loss": 0.6031821966171265, "peak_allocated_mib": 10162.86376953125, "peak_reserved_mib": 10694.0 }, "eager_loss": 0.3412420153617859, "compiled_loss": 0.3412419855594635, "gradient_cosine": 0.9999932382274589, "max_gradient_difference": 6.103515625e-05, "compile_comparison_seconds": 62.02263342216611, "total_seconds": 72.94260076899081, "source": "allowed packed_sample and own synthetic generator only" } + +E79 both arms are queued after E58wide and E71patch8 release their allocations; their complete recovery files must exist. Queue receipts random_capacity_512_queue.json and random_capacity_1024_queue.json preserve exact commands. Both use B48/96000/seed307/static compilation. No training has started. Compiler caches are backed up under research/compiler_cache_backup and can be restored to the same /tmp paths after another recovery. + +postloss started 2026-10-22T07:27:21.677278+00:00 after recent_normalization_recovery completed. Original predeclared settings and seed retained. + +## Operator recovery3 — 2026-10-23 +Operator reports151596 research seconds remaining; all prior processes ended. Submission E76 hash verified unchanged. Resume complete state at wide20000/control28000/slowAR10000/patch8 2000. Last logged steps20100/28400/10850/2700 imply at least100/400/850/700 discarded unsaved updates; phase2 elapsed768.6/769.5/767.8/770.0s. Graft reached100 updates/722.7s without checkpoint; restart own seed113 initialization, restored compiler caches (13.8722s). Recent normalization completed12000 with final phase training loop708.0175s; do not retrain. Volatility/paired-slowAR and fresh-width queues restored with new dependencies. Postloss reached200/43.0s with nonfinite losses, no checkpoint; numerical diagnosis precedes restarting. Prior phase logs retained; no credential access. + +E75 numerical failure diagnosed on allowed-corpus step53, seed197, without optimizer updates: one row has context magnitude2.2842e18 and float32 variance accumulation overflow, yielding infinite normalization scale. The normalized neural output is finite, but conversion to raw units produces nonfinite values. Context postprocessing statistics themselves remain finite. Add a float64 fallback only on rows with nonfinite mean/scale; ordinary-row arithmetic remains bitwise unchanged. Restart this experiment from E62 after regression checks; no affected checkpoint will be selected. This correction is part of this comparison and will be retained in its inference runtime if selected. + +## E65 recent normalization final12000 +- Checkpoint SHA-256: `1fea846895698d0e33384a63e228b17de602d03154e41ad0c81d5cc060ed182f`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 31.676968097686768 seconds. +- Overall skill 0.375806; relative MASE 0.744151; relative WQL 0.523574. +- term skill: long=0.4022, medium=0.4055, short=0.3535. +- domain skill: Econ/Fin=0.1427, Energy=0.2348, Healthcare=0.4380, Nature=0.4255, Sales=0.3383, Transport=0.4706, Web/CloudOps=0.4994. +- frequency skill: A=0.3754, D=0.3572, H=0.3959, M=0.0785, Q=0.2042, S=0.4248, T=0.4352, W=0.2109. +- variates skill: multivariate=0.3924, univariate=0.3622. +- Outcome: Seed101/B128/LR3e-5. Main0.375806 narrowly exceeds4096-control0.375764 and8192-full-normalization0.375118; evaluate earlier windows against both matched controls. Final resumed phase708.0175 training-loop seconds; prior interrupted phases are retained separately. + +E75 numerical regression passed: ordinary rows bitwise original; observed overflowing row now finite loss2.6841469 and all gradients finite,7.0381s,0optimizer updates. Fixed-parent replay of250original training batches found no nonfinite postprocessed forecasts in21.9482s. Restarted seed197/B64/LR2e-5/12000 from E62. Future validation uses postloss_inference with the same overflow fallback. The first earlier-control evaluation launch used the old trend summary runtime by mistake and was cancelled; corrected comparisons are named long_context_control_fixed128_ema12000. No selection uses the cancelled diagnostic. + +E76 descriptive paired full-validation comparison against E67paired3000: improvement0.0012113184,51/97configurations improve. Resampling dataset-directory clusters (28keys, seed317,5000draws) gives skill-delta percentiles[-0.0006681,0.0012221,0.0031907]. The range crosses zero and adaptive validation reuse prevents a held-out significance claim. Retain E76 based on measured full/earlier scores, while recognizing this is a small improvement. Largest gains include us_births daily and bizitobs_l2c short; ETT2 minute short worsens. Full per-configuration log-error differences retained in slow_ar_delta6k_comparison.json. + +## E80 matched control for the overflow correction — prepared +E75 needs a numerical fallback for rare overflowing training rows. To isolate its postprocessing-aware objective, prepare a control with exactly the same fallback but the original E67 paired-sign loss. ParentE62,seed197,B64,LR2e-5,12000steps, matching data/horizon RNG. No other inference or training change. This is a newly required numerical control, not a baseline rerun. + +## E81 equal ensemble of E76 and recent-normalization12000 +The longer-history candidate has a stronger second earlier cutoff but lower main/first-earlier performance than E76. Test whether averaging their postprocessed quantiles reduces complementary errors. Fixed equal weights; every member must forecast every instance if packaged. Compare cached main and both earlier predictions first. No coefficient sweep, new fitting, data or training. Reject unless the diagnostic tradeoff justifies full public-package replay. + +E80 overflow-only paired control queued alongside fresh-capacity arms after the old wide/patch8 allocations release. E78 multiscale-AR queued after postloss releases its allocation. Both use declared seed197/B64/LR2e-5/12000 settings; every command is retained in its queue receipt. Neither has started. + +## E65 matched comparison recent_normalization_recovery backcast_evals +- Checkpoint SHA-256: `1fea846895698d0e33384a63e228b17de602d03154e41ad0c81d5cc060ed182f`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 23.444558143615723 seconds. +- Overall skill 0.335105; relative MASE 0.796743; relative WQL 0.554866. +- term skill: long=0.4010, medium=0.3564, short=0.2994. +- domain skill: Econ/Fin=0.1646, Energy=0.2213, Healthcare=0.4212, Nature=0.3540, Sales=0.3970, Transport=0.3770, Web/CloudOps=0.4538. +- frequency skill: A=0.3179, D=0.3541, H=0.3610, M=0.1841, Q=0.2288, S=0.3371, T=0.3395, W=0.2758. +- variates skill: multivariate=0.3510, univariate=0.3221. +- Outcome: Recent normalization main0.375806/earlier0.335105/0.361614; full-normalization8192 main0.375118/earlier0.335778/0.361619;4096control main0.375764/earlier0.335548/0.359190. Temporal tradeoff, no single-member publication. Test complementary equal ensemble with E76 as declared E81. + +## E65 matched comparison recent_normalization_recovery backcast2_evals +- Checkpoint SHA-256: `1fea846895698d0e33384a63e228b17de602d03154e41ad0c81d5cc060ed182f`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 23.86247205734253 seconds. +- Overall skill 0.361614; relative MASE 0.766245; relative WQL 0.531861. +- term skill: long=0.3676, medium=0.3942, short=0.3463. +- domain skill: Econ/Fin=0.1074, Energy=0.2351, Healthcare=0.3566, Nature=0.4647, Sales=0.5547, Transport=0.4203, Web/CloudOps=0.4480. +- frequency skill: A=0.3496, D=0.4310, H=0.3890, M=0.1517, Q=0.1448, S=0.2876, T=0.3677, W=0.2567. +- variates skill: multivariate=0.3709, univariate=0.3540. +- Outcome: Recent normalization main0.375806/earlier0.335105/0.361614; full-normalization8192 main0.375118/earlier0.335778/0.361619;4096control main0.375764/earlier0.335548/0.359190. Temporal tradeoff, no single-member publication. Test complementary equal ensemble with E76 as declared E81. + +## E65 matched comparison long_context_control_fixed128 backcast_evals +- Checkpoint SHA-256: `372edd6a03da9f577992a9cf6363b26efe7b11b35fc3aed2d50868566efd0c71`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 21.399088382720947 seconds. +- Overall skill 0.335548; relative MASE 0.797825; relative WQL 0.553375. +- term skill: long=0.3998, medium=0.3578, short=0.3002. +- domain skill: Econ/Fin=0.1618, Energy=0.2279, Healthcare=0.4256, Nature=0.3575, Sales=0.3966, Transport=0.3721, Web/CloudOps=0.4487. +- frequency skill: A=0.3187, D=0.3539, H=0.3656, M=0.1845, Q=0.2285, S=0.3427, T=0.3351, W=0.2751. +- variates skill: multivariate=0.3528, univariate=0.3215. +- Outcome: Recent normalization main0.375806/earlier0.335105/0.361614; full-normalization8192 main0.375118/earlier0.335778/0.361619;4096control main0.375764/earlier0.335548/0.359190. Temporal tradeoff, no single-member publication. Test complementary equal ensemble with E76 as declared E81. + +## E65 matched comparison long_context_control_fixed128 backcast2_evals +- Checkpoint SHA-256: `372edd6a03da9f577992a9cf6363b26efe7b11b35fc3aed2d50868566efd0c71`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 21.050649642944336 seconds. +- Overall skill 0.359190; relative MASE 0.769269; relative WQL 0.533801. +- term skill: long=0.3663, medium=0.3893, short=0.3445. +- domain skill: Econ/Fin=0.1046, Energy=0.2371, Healthcare=0.3554, Nature=0.4689, Sales=0.5535, Transport=0.4194, Web/CloudOps=0.4333. +- frequency skill: A=0.3493, D=0.4307, H=0.3894, M=0.1531, Q=0.1429, S=0.2835, T=0.3601, W=0.2577. +- variates skill: multivariate=0.3643, univariate=0.3551. +- Outcome: Recent normalization main0.375806/earlier0.335105/0.361614; full-normalization8192 main0.375118/earlier0.335778/0.361619;4096control main0.375764/earlier0.335548/0.359190. Temporal tradeoff, no single-member publication. Test complementary equal ensemble with E76 as declared E81. + +## E65 matched comparison long_context_8192 backcast_evals +- Checkpoint SHA-256: `90a1a9da78714594078b3cafd32b1812d633f5d6bf85ba8bfa60d09fbc3ebd38`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 24.02571153640747 seconds. +- Overall skill 0.335778; relative MASE 0.796740; relative WQL 0.553746. +- term skill: long=0.4000, medium=0.3562, short=0.3012. +- domain skill: Econ/Fin=0.1625, Energy=0.2211, Healthcare=0.4240, Nature=0.3584, Sales=0.3963, Transport=0.3783, Web/CloudOps=0.4528. +- frequency skill: A=0.3183, D=0.3550, H=0.3608, M=0.1825, Q=0.2283, S=0.3383, T=0.3410, W=0.2775. +- variates skill: multivariate=0.3516, univariate=0.3229. +- Outcome: Recent normalization main0.375806/earlier0.335105/0.361614; full-normalization8192 main0.375118/earlier0.335778/0.361619;4096control main0.375764/earlier0.335548/0.359190. Temporal tradeoff, no single-member publication. Test complementary equal ensemble with E76 as declared E81. + +## E65 matched comparison long_context_8192 backcast2_evals +- Checkpoint SHA-256: `90a1a9da78714594078b3cafd32b1812d633f5d6bf85ba8bfa60d09fbc3ebd38`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 24.033729791641235 seconds. +- Overall skill 0.361619; relative MASE 0.766647; relative WQL 0.531576. +- term skill: long=0.3678, medium=0.3937, short=0.3464. +- domain skill: Econ/Fin=0.1060, Energy=0.2331, Healthcare=0.3615, Nature=0.4677, Sales=0.5540, Transport=0.4209, Web/CloudOps=0.4469. +- frequency skill: A=0.3484, D=0.4320, H=0.3875, M=0.1537, Q=0.1444, S=0.2887, T=0.3679, W=0.2592. +- variates skill: multivariate=0.3695, univariate=0.3552. +- Outcome: Recent normalization main0.375806/earlier0.335105/0.361614; full-normalization8192 main0.375118/earlier0.335778/0.361619;4096control main0.375764/earlier0.335548/0.359190. Temporal tradeoff, no single-member publication. Test complementary equal ensemble with E76 as declared E81. + +E81 main: {"composition": "equal quantile mean after each member applies its own fixed rules", "skill_score": 0.3792404374337234, "rel_mase_gmean": 0.7413362113099933, "rel_wql_gmean": 0.5197944315124549, "groups": {"term": {"short": 0.3580501678473965, "medium": 0.4075051608812147, "long": 0.40436165270683755}, "domain": {"Econ/Fin": 0.14514965737880325, "Energy": 0.23693703384364162, "Healthcare": 0.4508892358362413, "Nature": 0.43068317186356664, "Sales": 0.3372290847442204, "Transport": 0.46921029381701185, "Web/CloudOps": 0.5049832577126345}, "freq": {"A-DEC": 0.3741084316720569, "Q-DEC": 0.2032048606604645, "M": 0.09063626527124269, "W-SUN": 0.11024985736894433, "D": 0.35966521985300126, "H": 0.39764382964309264, "15T": 0.21216406035245483, "W-FRI": -0.006517286299776881, "10T": 0.6144670200764979, "W-TUE": 0.5505379760713061, "W-THU": 0.20290227669295913, "W-WED": 0.3148429295780334, "5T": 0.5200294927472697, "10S": 0.42580083885860065}}, "cpu_seconds": 1.3077636559028178, "members": ["/workspace/research/evals/slow_ar_delta6k", "/workspace/research/evals/recent_normalization_recovery_ema12000"], "selection_only": true} + +E81 backcast: {"composition": "equal quantile mean after each member applies its own fixed rules", "skill_score": 0.3372609628923202, "rel_mase_gmean": 0.7949387478174683, "rel_wql_gmean": 0.5525243706037937, "groups": {"term": {"short": 0.30267748548708406, "medium": 0.3587870572492281, "long": 0.4004504376989413}, "domain": {"Econ/Fin": 0.16791580188275335, "Energy": 0.2249147271500851, "Healthcare": 0.41565091499514417, "Nature": 0.36337531871749584, "Sales": 0.3953576986774914, "Transport": 0.37558039099633533, "Web/CloudOps": 0.45422426929296467}, "freq": {"A-DEC": 0.3198896505754395, "Q-DEC": 0.2324966250821987, "M": 0.1868807358115966, "W-SUN": 0.05675657061089712, "D": 0.35253814976953, "H": 0.3643205260222693, "15T": 0.2214260132321374, "W-FRI": 0.25870400902354673, "10T": 0.32373236597235966, "W-TUE": 0.534873854215015, "W-THU": 0.23833675077582528, "W-WED": 0.34309889609685684, "5T": 0.44852116184278545, "10S": 0.34093317446682636}}, "cpu_seconds": 0.9129793490283191, "members": ["/workspace/research/backcast_evals/slow_ar_delta6k", "/workspace/research/backcast_evals/recent_normalization_recovery_ema12000"], "selection_only": true} + +E81 backcast2: {"composition": "equal quantile mean after each member applies its own fixed rules", "skill_score": 0.36253066634723885, "rel_mase_gmean": 0.7663699578325764, "rel_wql_gmean": 0.5302493230514544, "groups": {"term": {"short": 0.3479807306166687, "medium": 0.39255912185019026, "long": 0.3693846383480154}, "domain": {"Econ/Fin": 0.1149608358698847, "Energy": 0.23668310113177404, "Healthcare": 0.35088547046370666, "Nature": 0.47069187269468127, "Sales": 0.5515284168852219, "Transport": 0.42149224872299274, "Web/CloudOps": 0.44469672192663035}, "freq": {"A-DEC": 0.3516200787127538, "Q-DEC": 0.14815814613753098, "M": 0.1464874832493296, "W-SUN": 0.06348262953040695, "D": 0.4307487103712574, "H": 0.3906466140437964, "15T": 0.10333300498128906, "W-FRI": 0.155407323458577, "10T": 0.5012397694349602, "W-TUE": 0.09030520980227696, "W-THU": 0.32093855640615543, "W-WED": 0.5365268550523004, "5T": 0.4842228628098807, "10S": 0.2879093531003366}}, "cpu_seconds": 0.9467690440360457, "members": ["/workspace/research/backcast2_evals/slow_ar_delta6k", "/workspace/research/backcast2_evals/recent_normalization_recovery_ema12000"], "selection_only": true} + +E81 actual candidate hash500fdde392c269ef1a6830477580bc7890b711824097ac711885bf0220e657cb,73,598,528parameters, contains original4096 E76 and recent-normalized8192 E65. Full package replay and relocation verification started. Candidate-only, submission unchanged. + +## E71 patch8 at3000 +- Checkpoint SHA-256: `5be1ccd5e5539619e4f5ff221a4088437e7267ceb34928015a0348187e4a575e`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 28.875902891159058 seconds. +- Overall skill 0.378312; relative MASE 0.744947; relative WQL 0.518823. +- term skill: long=0.4027, medium=0.4023, short=0.3592. +- domain skill: Econ/Fin=0.1391, Energy=0.2401, Healthcare=0.4515, Nature=0.4387, Sales=0.3471, Transport=0.4584, Web/CloudOps=0.4997. +- frequency skill: A=0.3807, D=0.3546, H=0.3955, M=0.0952, Q=0.1935, S=0.4235, T=0.4386, W=0.2325. +- variates skill: multivariate=0.3942, univariate=0.3653. +- Outcome: Seed197, interrupted then full-state resumed at2000. Main0.378312 essentially matches E67paired16-point3000 at0.378318. Continue to6000; no publication on this near tie. + +Recovery-frequency change verified on the tiny permitted-data fixture: { "maximum_model_difference": 1.5543122344752192e-15, "maximum_ema_difference": 3.0531133177191805e-16, "batch_rng_equal": true, "sampler_rng_equal": true, "seconds": 29.735046536196023, "selection_checkpoint_every": 4, "recovery_checkpoint_every": 2, "fixture_only": true }; increasing recovery-state saves preserves the sampler stream and model/EMA up to measured GPU roundoff. Newly launched jobs default to complete-state saves every250steps, while selection weights remain every1000. Already-running processes retain their original code/schedule. + +## E82 final slow-AR correction transfer — predeclared comparison +When E61 completes12000, replace the6000-step correction with its12000-step counterpart: E67paired3000 + E61slowAR12000 - E42partial12000, coefficient1.0, confidence-only tensor retained from base. This is the already-planned final matched comparison, not addition on top of E76. No coefficient sweep or further training. Check all four screening cutoffs, then full public package only if justified. slow_ar_final_comparison.py executes the fixed composition and screens after the atomic EMA exists. + +## E81 equal long-history ensemble full package +- Checkpoint SHA-256: `500fdde392c269ef1a6830477580bc7890b711824097ac711885bf0220e657cb`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.375233; relative MASE 0.744322; relative WQL 0.524415. +- term skill: long=0.3984, medium=0.4064, short=0.3536. +- domain skill: Econ/Fin=0.1215, Energy=0.2298, Healthcare=0.4558, Nature=0.4307, Sales=0.3504, Transport=0.4695, Web/CloudOps=0.4976. +- frequency skill: A=0.2913, D=0.3631, H=0.3929, M=0.1149, Q=0.1839, S=0.4258, T=0.4330, W=0.2096. +- variates skill: multivariate=0.3929, univariate=0.3608. +- Outcome: Reject for publication: full0.375233 is below selected E76 0.375612, despite first/second-earlier gains. All97configs/151170instances valid, zero crossings. Public inference213.940586s on shared H100. No coefficient sweep; retain singleton E76. + +volatility_synth started 2026-10-23T02:55:46.196186+00:00 after long_memory_synth_recovery completed. Original predeclared settings and seed retained. + +## E75 corrected postloss first1000 +- Checkpoint SHA-256: `d33a29e773434d2f0faf2bc85b73151354dcb98bedc83f28c44e776835310afa`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 22.844736576080322 seconds. +- Overall skill 0.376671; relative MASE 0.745163; relative WQL 0.521416. +- term skill: long=0.3992, medium=0.4062, short=0.3560. +- domain skill: Econ/Fin=0.1257, Energy=0.2385, Healthcare=0.4569, Nature=0.4304, Sales=0.3363, Transport=0.4666, Web/CloudOps=0.4975. +- frequency skill: A=0.3694, D=0.3556, H=0.3962, M=0.0824, Q=0.1976, S=0.4232, T=0.4357, W=0.2250. +- variates skill: multivariate=0.3926, univariate=0.3637. +- Outcome: Finite training after the verified normalization fallback. Main0.376671 is slightly below E67paired1000 at0.376860; continue to3000/6000, with newly queued overflow-only E80 control needed to isolate the objective. + +paired_long_memory started 2026-10-23T02:56:31.210459+00:00 after wide_capacity_control_recovery completed. Original predeclared settings and seed retained. + +## E61 slowAR final12000 +- Checkpoint SHA-256: `c27613689514c4d0cd008f3f5e6bf35a14d2ff170c3786820981e52c373de10e`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.156561374664307 seconds. +- Overall skill 0.362914; relative MASE 0.759071; relative WQL 0.534704. +- term skill: long=0.3926, medium=0.4046, short=0.3342. +- domain skill: Econ/Fin=0.1187, Energy=0.1874, Healthcare=0.4331, Nature=0.4271, Sales=0.3429, Transport=0.4595, Web/CloudOps=0.5091. +- frequency skill: A=0.3722, D=0.3472, H=0.3824, M=0.1132, Q=0.2021, S=0.4423, T=0.4070, W=0.2137. +- variates skill: multivariate=0.3958, univariate=0.3355. +- Outcome: Seed79; main0.362914 improves matched E42partial12000 at0.361108. Completed final resumed phase569.4896 training-loop seconds; prior interrupted phase logs retained. E82 transfers the final matched correction to selected paired3000, compared with the already published6000 correction. + +E75 overflow source replay identifies bitcoin_with_missing (seed197,step53,row37), with daily periods7/365 and observed values from6.0e11 to2.28e18. These scales can be legitimate crypto quantities; no data-cleaning or filtering rule is inferred. Source diagnostic0.9295CPU seconds, no optimizer updates. The numerical fallback addresses the representation range. + +E81 relocated package checks passed: three example configurations bitwise equal, finite and monotone,21.2942s. Third-earlier cached ensemble0.389488 slightly exceeds E76 0.389281, but main/full remain lower, so the publication decision remains rejection. The long-history member alone scores0.386764 at this third cutoff. + +## E58/E66 recovered37M control final32000 +- Checkpoint SHA-256: `570983ddd4f6d8e136906f1669798d938ecd93738da55f624afc5b25606249bb`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.769165754318237 seconds. +- Overall skill 0.375305; relative MASE 0.746308; relative WQL 0.522900. +- term skill: long=0.3997, medium=0.4059, short=0.3535. +- domain skill: Econ/Fin=0.1400, Energy=0.2324, Healthcare=0.4362, Nature=0.4284, Sales=0.3384, Transport=0.4676, Web/CloudOps=0.5011. +- frequency skill: A=0.3825, D=0.3508, H=0.3940, M=0.0846, Q=0.2029, S=0.4232, T=0.4370, W=0.2159. +- variates skill: multivariate=0.3936, univariate=0.3604. +- Outcome: Final0.375305 below E47parent0.375793 and own24000 at0.375681. Final resumed phase616.7562 training-loop seconds; prior phase logs retained. No publication. Its allocation now trains E77pairedslowAR. + +E61 final12k EMA hashc27613689514c4d0cd008f3f5e6bf35a14d2ff170c3786820981e52c373de10e. Last resumed phase569.4895656s; phase2 reached10850 in767.8s, phase1 reached8450 in3037.0s, original pre-recovery attempt reached2150 in542.2s. These are overlapping process elapsed times, with discarded unsaved updates counted as spent compute; not exclusive GPU seconds. E65 final resumed phase708.0175s, prior phases3034.3s and71.8s. + +## E82 slowAR final correction evals +- Checkpoint SHA-256: `f74bea6307738c331bd53618fde99f32238a72a0a85beb941f51446054e95c4c`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.064879655838013 seconds. +- Overall skill 0.379181; relative MASE 0.741695; relative WQL 0.519643. +- term skill: long=0.4028, medium=0.4057, short=0.3593. +- domain skill: Econ/Fin=0.1465, Energy=0.2342, Healthcare=0.4607, Nature=0.4319, Sales=0.3354, Transport=0.4660, Web/CloudOps=0.5068. +- frequency skill: A=0.3720, D=0.3593, H=0.3969, M=0.1007, Q=0.1994, S=0.4227, T=0.4390, W=0.2245. +- variates skill: multivariate=0.3977, univariate=0.3640. +- Outcome: Reject replacement of E76: final correction main0.379181/earlier0.336511/0.360111 loses three screens to6000 correction0.379721/0.336781/0.360577. Third-earlier improves0.389784 versus0.389281. Fixed coefficient1; no further sweep or full replay justified by this tradeoff. Retain E76. + +## E82 slowAR final correction backcast_evals +- Checkpoint SHA-256: `f74bea6307738c331bd53618fde99f32238a72a0a85beb941f51446054e95c4c`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 24.045677423477173 seconds. +- Overall skill 0.336511; relative MASE 0.796069; relative WQL 0.552989. +- term skill: long=0.3975, medium=0.3593, short=0.3024. +- domain skill: Econ/Fin=0.1707, Energy=0.2251, Healthcare=0.4072, Nature=0.3664, Sales=0.3935, Transport=0.3727, Web/CloudOps=0.4527. +- frequency skill: A=0.3195, D=0.3490, H=0.3653, M=0.1930, Q=0.2358, S=0.3419, T=0.3374, W=0.2844. +- variates skill: multivariate=0.3537, univariate=0.3225. +- Outcome: Reject replacement of E76: final correction main0.379181/earlier0.336511/0.360111 loses three screens to6000 correction0.379721/0.336781/0.360577. Third-earlier improves0.389784 versus0.389281. Fixed coefficient1; no further sweep or full replay justified by this tradeoff. Retain E76. + +## E82 slowAR final correction backcast2_evals +- Checkpoint SHA-256: `f74bea6307738c331bd53618fde99f32238a72a0a85beb941f51446054e95c4c`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 23.12555480003357 seconds. +- Overall skill 0.360111; relative MASE 0.768417; relative WQL 0.532858. +- term skill: long=0.3671, medium=0.3887, short=0.3461. +- domain skill: Econ/Fin=0.1203, Energy=0.2346, Healthcare=0.3518, Nature=0.4695, Sales=0.5471, Transport=0.4199, Web/CloudOps=0.4385. +- frequency skill: A=0.3524, D=0.4264, H=0.3900, M=0.1434, Q=0.1516, S=0.2859, T=0.3636, W=0.2642. +- variates skill: multivariate=0.3674, univariate=0.3541. +- Outcome: Reject replacement of E76: final correction main0.379181/earlier0.336511/0.360111 loses three screens to6000 correction0.379721/0.336781/0.360577. Third-earlier improves0.389784 versus0.389281. Fixed coefficient1; no further sweep or full replay justified by this tradeoff. Retain E76. + +## E82 slowAR final correction backcast3_evals +- Checkpoint SHA-256: `f74bea6307738c331bd53618fde99f32238a72a0a85beb941f51446054e95c4c`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 23.64928960800171 seconds. +- Overall skill 0.389784; relative MASE 0.736377; relative WQL 0.505671. +- term skill: long=0.3953, medium=0.3617, short=0.3980. +- domain skill: Econ/Fin=0.1860, Energy=0.3200, Healthcare=0.2362, Nature=0.5068, Sales=0.3992, Transport=0.5052, Web/CloudOps=0.3945. +- frequency skill: A=0.3688, D=0.4453, H=0.4034, M=0.1130, Q=0.2642, S=0.2924, T=0.4309, W=0.2637. +- variates skill: multivariate=0.3749, univariate=0.4013. +- Outcome: Reject replacement of E76: final correction main0.379181/earlier0.336511/0.360111 loses three screens to6000 correction0.379721/0.336781/0.360577. Third-earlier improves0.389784 versus0.389281. Fixed coefficient1; no further sweep or full replay justified by this tradeoff. Retain E76. + +E82 composition receipt: {"method": "matched training delta", "formula": "base + candidate - control", "coefficient": 1.0, "parent_hashes": {"/workspace/research/runs/full_paired_candidate/ema003000.pt": "2a19ebe0d41c1a18feaba318041795be4d268ce890162a5035e6fc6bf1844238", "/workspace/research/runs/long_memory_synth_recovery/ema012000.pt": "c27613689514c4d0cd008f3f5e6bf35a14d2ff170c3786820981e52c373de10e", "/workspace/research/runs/partial_targets/ema012000.pt": "a0ef29e85d0cf01677a6a58e4a9f91b077073c4af95f85234eec2ddc223f4837"}, "seconds": 1.2579920410644263} + +## E61 slowAR final12k backcast_evals +- Checkpoint SHA-256: `c27613689514c4d0cd008f3f5e6bf35a14d2ff170c3786820981e52c373de10e`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 23.161132097244263 seconds. +- Overall skill 0.332462; relative MASE 0.802575; relative WQL 0.555221. +- term skill: long=0.3889, medium=0.3582, short=0.2991. +- domain skill: Econ/Fin=0.1592, Energy=0.2274, Healthcare=0.4159, Nature=0.3553, Sales=0.3990, Transport=0.3647, Web/CloudOps=0.4455. +- frequency skill: A=0.3164, D=0.3542, H=0.3581, M=0.1781, Q=0.2386, S=0.3429, T=0.3325, W=0.2793. +- variates skill: multivariate=0.3483, univariate=0.3196. +- Outcome: Final direct slow-AR improves E42partial12k on both earlier cutoffs:0.332462 versus0.331074 and0.354079 versus0.353096. Matched synthetic-prior benefit survives the full schedule, while transferring its final delta is weaker than transferring6000 at the selected backbone. + +## E61 slowAR final12k backcast2_evals +- Checkpoint SHA-256: `c27613689514c4d0cd008f3f5e6bf35a14d2ff170c3786820981e52c373de10e`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 22.80446219444275 seconds. +- Overall skill 0.354079; relative MASE 0.774604; relative WQL 0.538615. +- term skill: long=0.3715, medium=0.3752, short=0.3393. +- domain skill: Econ/Fin=0.1039, Energy=0.2274, Healthcare=0.3615, Nature=0.4600, Sales=0.5536, Transport=0.4138, Web/CloudOps=0.4332. +- frequency skill: A=0.3506, D=0.4274, H=0.3872, M=0.1661, Q=0.1581, S=0.2852, T=0.3480, W=0.2482. +- variates skill: multivariate=0.3615, univariate=0.3480. +- Outcome: Final direct slow-AR improves E42partial12k on both earlier cutoffs:0.332462 versus0.331074 and0.354079 versus0.353096. Matched synthetic-prior benefit survives the full schedule, while transferring its final delta is weaker than transferring6000 at the selected backbone. + +E73 usage diagnostic on8allowed-corpus windows,seed337,C512,H128,5.8388CPU seconds,0optimizer updates: initial added-head contribution is zero; atEMA2000 its output RMS is0.00924times the inherited head contribution. Cross-stream query-weight norm rises from0 to0.01672times within-stream norm; head-input streams remain distinct (relative RMS difference1.4274). Distinct features are being used, but this alone does not establish validation improvement. Full receipt wide_graft_usage2k.json includes hashes. + +## E75 corrected postloss3000 +- Checkpoint SHA-256: `82c785d40998e155a20290c9965c346c26cd397fa0f3cf36278377ad2aed5c7d`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 24.580218076705933 seconds. +- Overall skill 0.378814; relative MASE 0.742602; relative WQL 0.519622. +- term skill: long=0.4027, medium=0.4070, short=0.3582. +- domain skill: Econ/Fin=0.1222, Energy=0.2441, Healthcare=0.4509, Nature=0.4321, Sales=0.3355, Transport=0.4650, Web/CloudOps=0.5021. +- frequency skill: A=0.3710, D=0.3521, H=0.4006, M=0.0768, Q=0.1947, S=0.4220, T=0.4401, W=0.2249. +- variates skill: multivariate=0.3963, univariate=0.3645. +- Outcome: Main0.378814 exceeds original E67paired3000 at0.378318, but remains below selected E76 at0.379721. Check earlier cutoffs; numerical-only control E80 remains queued, so causal attribution to postprocessing loss is provisional. + +## E83 combine postprocessing-aware3000 with the selected slow-AR6000 correction +E75 improves the original paired3000 main screen, while E76 demonstrates that the matched slow-AR6000 correction transfers across cutoffs. Test a fixed composition: E75postloss3000 + E61slowAR6000 - E42partial6000. Keep E75 confidence parameters, its verified overflow fallback and all inference rules. Coefficient1.0, no sweep; evaluate all four screening cutoffs before full replay/publication. This is a predictive composition test; E80 is still needed to separate the numerical correction from the postprocessing-aware loss. No additional training or validation gradients. + +## E77 pairedslowAR first1000 +- Checkpoint SHA-256: `278af3b837eee9032d80e20e70dc9155bd1f272983232826f16ff9df95547846`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 24.467870473861694 seconds. +- Overall skill 0.377046; relative MASE 0.744404; relative WQL 0.521319. +- term skill: long=0.3994, medium=0.4062, short=0.3566. +- domain skill: Econ/Fin=0.1382, Energy=0.2363, Healthcare=0.4530, Nature=0.4321, Sales=0.3345, Transport=0.4673, Web/CloudOps=0.4987. +- frequency skill: A=0.3685, D=0.3562, H=0.3951, M=0.1012, Q=0.1989, S=0.4234, T=0.4360, W=0.2232. +- variates skill: multivariate=0.3931, univariate=0.3639. +- Outcome: Seed197/B64/LR2e-5; main0.377046 slightly exceeds original paired1000 at0.376860. Early checkpoint only; continue matched3000/6000/12000 comparison. + +## E75 postloss3000 backcast_evals +- Checkpoint SHA-256: `82c785d40998e155a20290c9965c346c26cd397fa0f3cf36278377ad2aed5c7d`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 24.485270261764526 seconds. +- Overall skill 0.333947; relative MASE 0.800204; relative WQL 0.554393. +- term skill: long=0.3971, medium=0.3587, short=0.2981. +- domain skill: Econ/Fin=0.1484, Energy=0.2303, Healthcare=0.3976, Nature=0.3612, Sales=0.3967, Transport=0.3722, Web/CloudOps=0.4461. +- frequency skill: A=0.3136, D=0.3467, H=0.3696, M=0.1659, Q=0.2280, S=0.3365, T=0.3319, W=0.2801. +- variates skill: multivariate=0.3510, univariate=0.3200. +- Outcome: Both earlier cutoffs regress against original E67paired3000:0.333947 versus0.335739 and0.357605 versus0.358235, exceeding the main gain. Prune corrected postloss continuation, preserve complete recovery and checkpoints, and release its allocation to E78multiscale. E83 composition screening continues; E80 numerical-only control remains needed for attribution. + +## E75 postloss3000 backcast2_evals +- Checkpoint SHA-256: `82c785d40998e155a20290c9965c346c26cd397fa0f3cf36278377ad2aed5c7d`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 23.475824117660522 seconds. +- Overall skill 0.357605; relative MASE 0.772196; relative WQL 0.534413. +- term skill: long=0.3631, medium=0.3873, short=0.3437. +- domain skill: Econ/Fin=0.1041, Energy=0.2395, Healthcare=0.3227, Nature=0.4712, Sales=0.5519, Transport=0.4212, Web/CloudOps=0.4278. +- frequency skill: A=0.3532, D=0.4162, H=0.3932, M=0.1558, Q=0.1493, S=0.2753, T=0.3604, W=0.2566. +- variates skill: multivariate=0.3621, univariate=0.3540. +- Outcome: Both earlier cutoffs regress against original E67paired3000:0.333947 versus0.335739 and0.357605 versus0.358235, exceeding the main gain. Prune corrected postloss continuation, preserve complete recovery and checkpoints, and release its allocation to E78multiscale. E83 composition screening continues; E80 numerical-only control remains needed for attribution. + +multiscale_ar seed197 training started at 2026-10-23T03:01:47Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E75 stop receipt: {"experiment": "E75 corrected postloss stopped", "step": 3653, "checkpoint_sha256": "760314a6d65350417c4a58e32eb21cebaac953dc83820d300a4b6b24b0977cb1", "weights": "/workspace/research/runs/postloss/ema003653.pt", "recovery": "/workspace/research/runs/postloss/recovery.pt", "training_loop_final_record": {"completed_step": 3653, "training_process_loop_seconds": 799.9150489440653}, "process_receipt": {"command": ["python3", "/workspace/research/recovery/train.py", "--code-dir", "/workspace/research/postloss", "--packed", "/workspace/research/packed_sample", "--source-weights-from", "/workspace/research/packed_sample", "--out", "/workspace/research/runs/postloss", "--initialize-from", "/workspace/research/horizon_delta12k.pt", "--steps", "12000", "--batch", "64", "--lr", "2e-05", "--seed", "197", "--stop-file", "/workspace/research/postloss.stop", "--loss-mode", "paired"], "status": "complete", "pid": 1280, "log": "/workspace/research/postloss_recovery3.log", "started_utc": "2026-10-23T02:48:16Z", "note": "Restart own E62 initialization after verified float32 variance-overflow correction; original seed and recipe unchanged.", "returncode": 0, "process_seconds": 810.3138020890765}, "outcome": "Both earlier3000 cutoffs regress; E83 saved-checkpoint composition remains in screening, E80 numerical control queued."} + +## E83 postloss+slowAR evals +- Checkpoint SHA-256: `0ae7875b49b99a44c295dc2b8243327aeacadc25b2354988abb2c37250359a49`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.666229724884033 seconds. +- Overall skill 0.380251; relative MASE 0.741085; relative WQL 0.518280. +- term skill: long=0.4038, medium=0.4070, short=0.3603. +- domain skill: Econ/Fin=0.1348, Energy=0.2414, Healthcare=0.4552, Nature=0.4344, Sales=0.3382, Transport=0.4643, Web/CloudOps=0.5059. +- frequency skill: A=0.3743, D=0.3567, H=0.4003, M=0.0763, Q=0.1987, S=0.4254, T=0.4419, W=0.2242. +- variates skill: multivariate=0.3980, univariate=0.3658. +- Outcome: Main0.380251 improves selectedE76 0.379721, while all earlier scores0.335421/0.360099/0.389069 are below E76 0.336781/0.360577/0.389281. Complete public full validation to check whether the main gain extends beyond the capped screen; report the temporal regressions explicitly. No publication yet. + +## E83 postloss+slowAR backcast_evals +- Checkpoint SHA-256: `0ae7875b49b99a44c295dc2b8243327aeacadc25b2354988abb2c37250359a49`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 23.061537742614746 seconds. +- Overall skill 0.335421; relative MASE 0.797508; relative WQL 0.553807. +- term skill: long=0.3950, medium=0.3597, short=0.3013. +- domain skill: Econ/Fin=0.1640, Energy=0.2281, Healthcare=0.3974, Nature=0.3657, Sales=0.3962, Transport=0.3713, Web/CloudOps=0.4494. +- frequency skill: A=0.3211, D=0.3463, H=0.3688, M=0.1723, Q=0.2313, S=0.3404, T=0.3344, W=0.2853. +- variates skill: multivariate=0.3526, univariate=0.3214. +- Outcome: Main0.380251 improves selectedE76 0.379721, while all earlier scores0.335421/0.360099/0.389069 are below E76 0.336781/0.360577/0.389281. Complete public full validation to check whether the main gain extends beyond the capped screen; report the temporal regressions explicitly. No publication yet. + +## E83 postloss+slowAR backcast2_evals +- Checkpoint SHA-256: `0ae7875b49b99a44c295dc2b8243327aeacadc25b2354988abb2c37250359a49`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 23.91576099395752 seconds. +- Overall skill 0.360099; relative MASE 0.769700; relative WQL 0.531990. +- term skill: long=0.3671, medium=0.3869, short=0.3468. +- domain skill: Econ/Fin=0.1196, Energy=0.2390, Healthcare=0.3200, Nature=0.4758, Sales=0.5509, Transport=0.4203, Web/CloudOps=0.4338. +- frequency skill: A=0.3513, D=0.4228, H=0.3920, M=0.1454, Q=0.1495, S=0.2810, T=0.3646, W=0.2628. +- variates skill: multivariate=0.3658, univariate=0.3555. +- Outcome: Main0.380251 improves selectedE76 0.379721, while all earlier scores0.335421/0.360099/0.389069 are below E76 0.336781/0.360577/0.389281. Complete public full validation to check whether the main gain extends beyond the capped screen; report the temporal regressions explicitly. No publication yet. + +## E83 postloss+slowAR backcast3_evals +- Checkpoint SHA-256: `0ae7875b49b99a44c295dc2b8243327aeacadc25b2354988abb2c37250359a49`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 23.31220841407776 seconds. +- Overall skill 0.389069; relative MASE 0.739022; relative WQL 0.505041. +- term skill: long=0.3936, medium=0.3628, short=0.3969. +- domain skill: Econ/Fin=0.1785, Energy=0.3245, Healthcare=0.2109, Nature=0.5039, Sales=0.4010, Transport=0.5082, Web/CloudOps=0.3908. +- frequency skill: A=0.3606, D=0.4409, H=0.4062, M=0.1151, Q=0.2596, S=0.2759, T=0.4323, W=0.2589. +- variates skill: multivariate=0.3734, univariate=0.4011. +- Outcome: Main0.380251 improves selectedE76 0.379721, while all earlier scores0.335421/0.360099/0.389069 are below E76 0.336781/0.360577/0.389281. Complete public full validation to check whether the main gain extends beyond the capped screen; report the temporal regressions explicitly. No publication yet. + +E83 CPU composition receipt: {"method": "matched training delta", "formula": "base + candidate - control", "coefficient": 1.0, "parent_hashes": {"/workspace/research/runs/postloss/ema003000.pt": "82c785d40998e155a20290c9965c346c26cd397fa0f3cf36278377ad2aed5c7d", "/workspace/research/runs/long_memory_synth_recovery/ema006000.pt": "fea5b5290a3a9be5618eaeaf67e918e4f677d5be908d562040ce4bdfeb549bd9", "/workspace/research/runs/partial_targets/ema006000.pt": "67562486b099a350da53c3caa5ff0932fe7fecdfe72c1879b064b2a9bb173dfb"}, "seconds": 1.0092943429481238} + +## E83 postprocessing-aware3000 plus slowAR6000 full public-package replay +- Checkpoint SHA-256: `0ae7875b49b99a44c295dc2b8243327aeacadc25b2354988abb2c37250359a49`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.376131; relative MASE 0.743936; relative WQL 0.523180. +- term skill: long=0.3978, medium=0.4059, short=0.3557. +- domain skill: Econ/Fin=0.1127, Energy=0.2338, Healthcare=0.4604, Nature=0.4345, Sales=0.3517, Transport=0.4644, Web/CloudOps=0.4981. +- frequency skill: A=0.2909, D=0.3608, H=0.3952, M=0.1011, Q=0.1844, S=0.4254, T=0.4346, W=0.2165. +- variates skill: multivariate=0.3936, univariate=0.3619. +- Outcome: Publish as best full primary validation: skill0.376130733 versus E76 0.375612348; relMASE0.743936224 and relWQL0.523180415, 97 configurations/151170 instances, zero failures. Public inference120.396952s; independent relocation14.861885s gave bitwise equal finite ordered forecasts on three examples. All three earlier cutoffs regress versus E76, so this is a narrow primary-validation selection, not evidence of broad temporal improvement. Keep E76 as the more stable rollback. No training in this composition; coefficient1.0 fixed, source training seeds197/79; hashes and parent compute above. E80 numerical-only control remains queued. + +E83 descriptive cluster comparison: {"candidate": "/workspace/research/valid-report-postloss-slow-ar.json", "parent": "/workspace/research/valid-report-slow-ar-delta6k.json", "candidate_hash": "0ae7875b49b99a44c295dc2b8243327aeacadc25b2354988abb2c37250359a49", "parent_hash": "8562cb05319ed04fdd8544a1af80bf1688ba55284e59b4689aa646e34e38a105", "skill_difference": 0.0005183850211532004, "n_configs": 97, "n_dataset_clusters": 28, "improved_configs": 51, "bootstrap_seed": 317, "bootstrap_samples": 5000, "dataset_cluster_delta_percentiles": {"p025": -0.0027720070621055277, "p50": 0.0002985771391603165, "p975": 0.004193731829011101}, "note": "Descriptive resampling only. Adaptive validation selection and reused windows prevent treating this as a held-out significance test."} + +## E58/E66 recovered146M at global24000 +- Checkpoint SHA-256: `8f9a786a85c8fcd3d4aaba9e5651a68b6f2df74d5cdc0e30907a4293dd297492`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 37.02190327644348 seconds. +- Overall skill 0.375978; relative MASE 0.744657; relative WQL 0.522931. +- term skill: long=0.4006, medium=0.4073, short=0.3537. +- domain skill: Econ/Fin=0.1411, Energy=0.2353, Healthcare=0.4235, Nature=0.4300, Sales=0.3398, Transport=0.4674, Web/CloudOps=0.5021. +- frequency skill: A=0.3775, D=0.3521, H=0.3962, M=0.0785, Q=0.2030, S=0.4233, T=0.4372, W=0.2148. +- variates skill: multivariate=0.3957, univariate=0.3598. +- Outcome: Matched 37M control24000 is0.375680951 and original E47parent0.375792930. Widened model0.375977511 is modestly higher; continue planned32000, no publication against stronger E83. Seed113 then recovery reset179, batch96, baseLR3e-5; complete recovery retained. + +## E73 independent feature stream first4000 +- Checkpoint SHA-256: `c16f146c285d9e5c8c9ae60e54af3d9d1dae3f48e1cf2104e37676062df8ad5e`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 40.91307091712952 seconds. +- Overall skill 0.372085; relative MASE 0.750057; relative WQL 0.525664. +- term skill: long=0.3976, medium=0.4060, short=0.3484. +- domain skill: Econ/Fin=0.1401, Energy=0.2348, Healthcare=0.4070, Nature=0.4248, Sales=0.3416, Transport=0.4634, Web/CloudOps=0.4971. +- frequency skill: A=0.3733, D=0.3439, H=0.3937, M=0.0971, Q=0.1987, S=0.4185, T=0.4336, W=0.2014. +- variates skill: multivariate=0.3914, univariate=0.3563. +- Outcome: Main0.372084568 regresses versus own function-preserving initialization0.375792503 and original-width parent. New-stream usage was nonzero at2000; use planned8000 to distinguish transient feature learning from persistent degradation. Seed113/B96/LR3e-5, compiled static loss; no publication. + +## E78 multiscale AR first1000 +- Checkpoint SHA-256: `a3c57dba6318728692a87990bf652a9a8469fa4fb24bf925e79a6f72510936d3`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 24.617778062820435 seconds. +- Overall skill 0.377072; relative MASE 0.744319; relative WQL 0.521335. +- term skill: long=0.3993, medium=0.4061, short=0.3568. +- domain skill: Econ/Fin=0.1341, Energy=0.2362, Healthcare=0.4612, Nature=0.4310, Sales=0.3345, Transport=0.4671, Web/CloudOps=0.4985. +- frequency skill: A=0.3662, D=0.3563, H=0.3950, M=0.1046, Q=0.1987, S=0.4232, T=0.4355, W=0.2248. +- variates skill: multivariate=0.3928, univariate=0.3643. +- Outcome: Main0.377071682 is effectively tied with E77 single slowAR1000 at0.377046018 and above E67 original AR1000 at0.376859515. Early checkpoint, continue matched3000/6000/12000. Seed197, extraRNG700200, B64/LR2e-5, unchanged corpus and main/horizon RNG. + +## E84 daily and weekly aggregation of permitted real series +Hypothesis: the original two/four-fold aggregation rarely exposes coarse energy and other dynamics. On20% of real rows, independently consider a daily or weekly block average of the same allowed series at the original cutoff. Only exact integral frequency ratios are used; require8 context blocks and1 future block. Select equally among eligible daily/weekly choices. Finite-value averages use float64 sums and disjoint past/future blocks. Context and target can be shorter than requested and remain masked; periods become[7,365] or[52,1]. All original sampling/random draws and original local synthetic windows remain unchanged; extra RNGseed900200. Planned own E62 initialization, seed197, paired B64, LR2e-5/12000steps match E67. This tests coarser real-series augmentation, not additional external data. Queue after E77 to stay within one H100. +Training-only fixture: {"seed": 197, "aggregation_seed": 900200, "diagnostic_shapes_seed": 331, "cpu_seconds": 3.8464299628976732, "rows": 4096, "aggregated_rows": 459, "main_and_horizon_rng_matched": true, "nonaggregated_rows_bitwise_equal": true, "changing_future_does_not_change_context": true, "before_period_counts": {"(24, 168)": 932, "(1440, 10080)": 160, "(288, 2016)": 805, "(12, 1)": 214, "(48, 336)": 249, "(4, 1)": 235, "(7, 365)": 513, "(96, 672)": 244, "(52, 1)": 148, "(144, 1008)": 149, "(2, 91)": 5, "(1, 1)": 153, "(900, 21600)": 23, "(360, 8640)": 73, "(4, 28)": 54, "(12, 84)": 30, "(720, 5040)": 14, "(6, 42)": 24, "(360, 2520)": 7, "(450, 10800)": 3, "(72, 504)": 51, "(4, 182)": 6, "(36, 252)": 3, "(1, 7)": 1}, "after_period_counts": {"(52, 1)": 352, "(1440, 10080)": 131, "(288, 2016)": 692, "(12, 1)": 214, "(48, 336)": 231, "(4, 1)": 235, "(7, 365)": 704, "(96, 672)": 223, "(24, 168)": 778, "(1, 1)": 153, "(900, 21600)": 23, "(360, 8640)": 73, "(144, 1008)": 133, "(4, 28)": 38, "(12, 84)": 26, "(720, 5040)": 10, "(360, 2520)": 6, "(450, 10800)": 3, "(72, 504)": 41, "(2, 91)": 3, "(4, 182)": 6, "(36, 252)": 3, "(6, 42)": 17, "(1, 7)": 1}, "factor_counts": {"168": 73, "288": 97, "2016": 37, "7": 66, "1440": 26, "24": 90, "48": 14, "96": 20, "28": 12, "144": 4, "336": 6, "4": 4, "10080": 8, "1008": 1, "672": 1}, "aggregated_context_percentiles": [8.0, 48.0, 4096.0], "aggregated_target_percentiles": [1.0, 60.0, 1024.0], "optimizer_updates": 0} + +## E71 patch8 at6000 +- Checkpoint SHA-256: `308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 32.29093050956726 seconds. +- Overall skill 0.381179; relative MASE 0.741215; relative WQL 0.516638. +- term skill: long=0.4036, medium=0.4049, short=0.3630. +- domain skill: Econ/Fin=0.1328, Energy=0.2446, Healthcare=0.4760, Nature=0.4387, Sales=0.3481, Transport=0.4598, Web/CloudOps=0.5005. +- frequency skill: A=0.3764, D=0.3587, H=0.3961, M=0.1191, Q=0.1895, S=0.4235, T=0.4409, W=0.2396. +- variates skill: multivariate=0.3970, univariate=0.3683. +- Outcome: Main0.381178739 exceeds matched E67paired6000 0.378455389 and selected E83main0.380250568. Test all three earlier cutoffs and full public replay before publication. Architecture change only; seed197/B64/LR2e-5; checkpoints resumed with full optimizer and RNG state. + +## E77 paired slowAR at3000 +- Checkpoint SHA-256: `0691cb2a1f55203c949dcdd159bc9da17d56a3cccbba57fa2c61a9f74b769376`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 24.542114734649658 seconds. +- Overall skill 0.378238; relative MASE 0.743200; relative WQL 0.520166. +- term skill: long=0.4019, medium=0.4056, short=0.3580. +- domain skill: Econ/Fin=0.1408, Energy=0.2382, Healthcare=0.4444, Nature=0.4319, Sales=0.3325, Transport=0.4662, Web/CloudOps=0.5040. +- frequency skill: A=0.3686, D=0.3549, H=0.3971, M=0.0926, Q=0.1967, S=0.4234, T=0.4392, W=0.2222. +- variates skill: multivariate=0.3972, univariate=0.3627. +- Outcome: Main0.378238485 is slightly below original E67paired3000 0.378318033; continue planned6000 before choosing. Seed197/B64/LR2e-5, main and requested-horizon sampling matched. + +## E85 transfer the slow-AR correction to the finer-patch model +E71patch8 at6000 improves the main screen and first earlier cutoff. E76 previously showed a matched slow-AR6000 correction improves all four cutoffs on patch16. Test one fixed composition: patch8_6000 + fold16to8(slowAR6000 - partial6000), where the linear fold is exactly E71 initialization: sum projection halves, retain first8 output positions, other tensors unchanged. Confidence parameters remain those of patch8. This is a transfer hypothesis, not exact function preservation. Coefficient1 with no sweep, original inference rules, all four cutoffs before full replay/publication. No new optimizer updates or random draws; original training seeds197 and79. Script patch8_delta/merge.py and all parent hashes retained. + +## E86 learn the added feature stream while freezing inherited parameters — prepared +E73 at4000 underperforms its function-preserving starting model despite using the new stream. Hypothesis: a low-rate update of every parameter disturbs the mature function while learning the random additions too slowly. Reuse exactly E73 independent-stream initialization, but protect all36,800,800 inherited entries and train the109,676,544 new/cross-stream entries atLR2e-4 for8000steps. Original seed113/B96/source/context/horizon/loss unchanged. This changes trainable scope and learning rate together and is a method comparison, not a one-factor causal attribution. Gradient entries for protected blocks are zeroed before clipping; inherited values are restored after AdamW to cancel its weight decay. References reconstruct from the saved checkpoint on resume. All outputs still come from one146M model; inference has no adaptation or freezing machinery. Await E73next8000 before allocation. +Fixture on6 allowed-corpus windows, discarded copy only: {"cpu_seconds": 8.51362281711772, "seed": 347, "optimizer_updates_on_discarded_fixture_copy": 3, "allowed_corpus_windows": 6, "protected_parameters": 36800800, "trainable_parameters": 109676544, "all_inherited_parameters_bitwise_equal_to_parent": true, "recovery_reference_reconstruction_equal": true, "new_head_max_change": 0.0006009560311213136, "losses": [0.3154084384441376, 0.5418640375137329, 3.4678804874420166], "selection_checkpoint_written": false} + +## E71 patch8 at6000 first earlier +- Checkpoint SHA-256: `308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 31.848629474639893 seconds. +- Overall skill 0.337263; relative MASE 0.796725; relative WQL 0.551283. +- term skill: long=0.4004, medium=0.3547, short=0.3044. +- domain skill: Econ/Fin=0.1652, Energy=0.2281, Healthcare=0.4272, Nature=0.3699, Sales=0.4068, Transport=0.3692, Web/CloudOps=0.4462. +- frequency skill: A=0.3305, D=0.3545, H=0.3635, M=0.2050, Q=0.2352, S=0.3470, T=0.3351, W=0.2877. +- variates skill: multivariate=0.3553, univariate=0.3226. +- Outcome: Earlier skills0.337262777/0.360619944/0.384512704. First two exceed E83 and E76; third regresses materially against both, including E83 0.389069333. Record this temporal tradeoff. Full primary validation0.377160271 exceeds E83 0.376130733. + +## E71 patch8 at6000 second earlier +- Checkpoint SHA-256: `308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 30.961294412612915 seconds. +- Overall skill 0.360620; relative MASE 0.769294; relative WQL 0.531405. +- term skill: long=0.3643, medium=0.3909, short=0.3471. +- domain skill: Econ/Fin=0.1073, Energy=0.2373, Healthcare=0.3614, Nature=0.4729, Sales=0.5535, Transport=0.4233, Web/CloudOps=0.4312. +- frequency skill: A=0.3265, D=0.4302, H=0.3900, M=0.1513, Q=0.1529, S=0.2830, T=0.3613, W=0.2737. +- variates skill: multivariate=0.3599, univariate=0.3612. +- Outcome: Earlier skills0.337262777/0.360619944/0.384512704. First two exceed E83 and E76; third regresses materially against both, including E83 0.389069333. Record this temporal tradeoff. Full primary validation0.377160271 exceeds E83 0.376130733. + +## E71 patch8 at6000 third earlier +- Checkpoint SHA-256: `308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 30.769143104553223 seconds. +- Overall skill 0.384513; relative MASE 0.743664; relative WQL 0.509403. +- term skill: long=0.3930, medium=0.3668, short=0.3880. +- domain skill: Econ/Fin=0.1775, Energy=0.3064, Healthcare=0.2392, Nature=0.5093, Sales=0.3974, Transport=0.5038, Web/CloudOps=0.3894. +- frequency skill: A=0.3445, D=0.4405, H=0.4005, M=0.1373, Q=0.2471, S=0.2972, T=0.4240, W=0.2382. +- variates skill: multivariate=0.3641, univariate=0.4002. +- Outcome: Earlier skills0.337262777/0.360619944/0.384512704. First two exceed E83 and E76; third regresses materially against both, including E83 0.389069333. Record this temporal tradeoff. Full primary validation0.377160271 exceeds E83 0.376130733. + +## E71 patch8 at6000 full public-package replay +- Checkpoint SHA-256: `308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.377160; relative MASE 0.744341; relative WQL 0.521172. +- term skill: long=0.3977, medium=0.4038, short=0.3585. +- domain skill: Econ/Fin=0.1125, Energy=0.2381, Healthcare=0.4791, Nature=0.4387, Sales=0.3613, Transport=0.4600, Web/CloudOps=0.4920. +- frequency skill: A=0.2981, D=0.3626, H=0.3904, M=0.1423, Q=0.1804, S=0.4235, T=0.4341, W=0.2328. +- variates skill: multivariate=0.3923, univariate=0.3649. +- Outcome: Publish strongest full primary candidate: skill0.377160271, relMASE0.744340532 and relWQL0.521171845; 97 configurations/151170 instances and zero failures. Inference149.631765s under shared H100; relocation14.860671s, three configurations bitwise equal, finite and ordered. Earlier cutoffs1/2 improve but cutoff3 falls to0.384512704 from E83 0.389069333. This selection is based on primary full validation, with a material earlier-window tradeoff. Seed197/B64/LR2e-5; model36,665,488 parameters. Training continues to12000; E85slowAR transfer currently lowers main skill. + +E71 descriptive full comparison: {"candidate": "/workspace/research/valid-report-patch8-6k.json", "parent": "/workspace/research/valid-report-postloss-slow-ar.json", "candidate_hash": "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "parent_hash": "0ae7875b49b99a44c295dc2b8243327aeacadc25b2354988abb2c37250359a49", "skill_difference": 0.001029538022933929, "n_configs": 97, "n_dataset_clusters": 28, "improved_configs": 51, "bootstrap_seed": 317, "bootstrap_samples": 5000, "dataset_cluster_delta_percentiles": {"p025": -0.0037342410536253257, "p50": 0.0011012262742491896, "p975": 0.005930261648940039}, "note": "Descriptive resampling only. Adaptive validation selection and reused windows prevent treating this as a held-out significance test."} + +## E87 equal ensemble of postloss+slowAR and patch8_6000 +E71 improves full and first two earlier scores but regresses on the third. Its per-configuration differences against E83 run in both directions. Test a single predeclared equal average of their final quantiles, every member on every instance, to reduce these disagreements. No coefficient sweep or per-dataset rules; no additional training. Screen all four cutoffs with cached forecasts, then require a complete public-package replay if promising. Member hashes0ae7875b49b99a44c295dc2b8243327aeacadc25b2354988abb2c37250359a49 and308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988. + +E87 cached valid_screen: {"composition": "equal quantile mean after each member applies its own fixed rules", "skill_score": 0.38368555666405846, "rel_mase_gmean": 0.7380746260326486, "rel_wql_gmean": 0.5146410398989778, "groups": {"term": {"short": 0.36538266249250273, "medium": 0.4082837973759923, "long": 0.4054283252594051}, "domain": {"Econ/Fin": 0.13784772212566998, "Energy": 0.24686600590076013, "Healthcare": 0.4744445530216731, "Nature": 0.43858582844670857, "Sales": 0.34499044135263635, "Transport": 0.4641713711179224, "Web/CloudOps": 0.504852655777996}, "freq": {"A-DEC": 0.37872174128763647, "Q-DEC": 0.19576783224250183, "M": 0.10352329460914667, "W-SUN": 0.0815487165237122, "D": 0.3619759620437517, "H": 0.40136898241411867, "15T": 0.21618729924976976, "W-FRI": 0.0005727425187482815, "10T": 0.6270627319464949, "W-TUE": 0.6195479435809044, "W-THU": 0.20656160899192244, "W-WED": 0.3284622519828829, "5T": 0.5178170596317864, "10S": 0.4250896621077831}}, "cpu_seconds": 0.8467225290369242, "members": ["/workspace/research/evals/postloss_slow_ar_delta6k", "/workspace/research/evals/patch8_ema6000"], "selection_only": true} + +E87 cached valid_backcast: {"composition": "equal quantile mean after each member applies its own fixed rules", "skill_score": 0.33897078175106665, "rel_mase_gmean": 0.7947425391953629, "rel_wql_gmean": 0.549812808335635, "groups": {"term": {"short": 0.30566345086890123, "medium": 0.3596853813715456, "long": 0.4000253823922667}, "domain": {"Econ/Fin": 0.16860733481230095, "Energy": 0.23127409233361262, "Healthcare": 0.41508771848830917, "Nature": 0.3697364579642294, "Sales": 0.40314036211800997, "Transport": 0.3731226096810256, "Web/CloudOps": 0.44992972632456585}, "freq": {"A-DEC": 0.32848231511958337, "Q-DEC": 0.23562309290129158, "M": 0.19041732638938724, "W-SUN": 0.025351943698138202, "D": 0.3534437856481293, "H": 0.3688302027123801, "15T": 0.22312808413257845, "W-FRI": 0.2396493514491056, "10T": 0.3237622247956604, "W-TUE": 0.5543034150109358, "W-THU": 0.2604484095221261, "W-WED": 0.35736004737028026, "5T": 0.4409641017446271, "10S": 0.3450492950879055}}, "cpu_seconds": 0.7932982260826975, "members": ["/workspace/research/backcast_evals/postloss_slow_ar_delta6k", "/workspace/research/backcast_evals/patch8_ema6000"], "selection_only": true} + +E87 cached valid_backcast2: {"composition": "equal quantile mean after each member applies its own fixed rules", "skill_score": 0.36315845377936284, "rel_mase_gmean": 0.7669826024462578, "rel_wql_gmean": 0.5287827307935709, "groups": {"term": {"short": 0.3500710560941004, "medium": 0.39152062222827344, "long": 0.36789234736191556}, "domain": {"Econ/Fin": 0.11764473029610945, "Energy": 0.2411172995160572, "Healthcare": 0.3456990033484809, "Nature": 0.4766227701429041, "Sales": 0.5542499449658524, "Transport": 0.4240681895536792, "Web/CloudOps": 0.43520532523252287}, "freq": {"A-DEC": 0.3426922609629939, "Q-DEC": 0.15231664461723582, "M": 0.15186824306557356, "W-SUN": 0.05088825731569291, "D": 0.4296455306851713, "H": 0.39379373998466227, "15T": 0.10856607437428756, "W-FRI": 0.14720063917754334, "10T": 0.5085351252790775, "W-TUE": 0.07220161720253104, "W-THU": 0.3450882445488662, "W-WED": 0.5601701661454508, "5T": 0.47180636145224786, "10S": 0.2848018841721206}}, "cpu_seconds": 0.8004084089770913, "members": ["/workspace/research/backcast2_evals/postloss_slow_ar_delta6k", "/workspace/research/backcast2_evals/patch8_ema6000"], "selection_only": true} + +E87 cached valid_backcast3: {"composition": "equal quantile mean after each member applies its own fixed rules", "skill_score": 0.3893067316884232, "rel_mase_gmean": 0.7388677045007551, "rel_wql_gmean": 0.5047537816165226, "groups": {"term": {"short": 0.3954965650939142, "medium": 0.3665319698411411, "long": 0.3951340525388045}, "domain": {"Econ/Fin": 0.18260879016430553, "Energy": 0.31821834617690903, "Healthcare": 0.23007490883688486, "Nature": 0.5085775372702099, "Sales": 0.40095301819850215, "Transport": 0.5083874509785007, "Web/CloudOps": 0.39193111101214995}, "freq": {"A-DEC": 0.3560016768547195, "Q-DEC": 0.2553722438340734, "M": 0.12861913252670398, "W-SUN": 0.15123578049216402, "D": 0.44398634475249976, "H": 0.40571804459976457, "15T": 0.25382261362712966, "W-FRI": 0.03470000993227129, "10T": 0.6063950584074473, "W-TUE": 0.24994144625076442, "W-THU": 0.35649129369337096, "W-WED": 0.3788996637883131, "5T": 0.4648714119960353, "10S": 0.2886025572123534}}, "cpu_seconds": 0.7890921849757433, "members": ["/workspace/research/backcast3_evals/postloss_slow_ar_delta6k", "/workspace/research/backcast3_evals/patch8_ema6000"], "selection_only": true} + +E87 cached equal ensemble improves all four cutoffs over both members:0.383686/0.338971/0.363158/0.389307. Assemble exact per-member model code and start full public-package validation. No coefficient search or new optimization. + +## E88 matched late slow-AR continuation of patch8 — prepared +E71patch8 improves primary validation, while mapping the E61slowAR weight correction onto it lowers the main screen. Test direct training instead: preserve E71 complete model/EMA/AdamW/RNG/prefetched-batch state exactly at8000, then continue to12000 with only the synthetic AR coefficient law changed fromU(.2,.995) toexp(-10**(-U(0,4))). Reuse the already verified E77 data implementation and E71 model. All corpus windows, signs, horizon prefixes, batch64, seed197, original LR2e-5 cosine schedule and optimizer state stay matched. The saved prefetched batch is consumed once unchanged, so the changed generator starts with the following batch. No new random initialization, external data or validation training. Queue after E69 volatility releases its memory. Compare the unchanged E71 final12000 and the candidate; screen9000/12000 and earlier cutoffs for promising results. + +## E85 patch8 slowAR correction evals +- Checkpoint SHA-256: `7047bf350ed55e595b47c5f8e0b1712429d049d00967b5b126d1cd039b1c7ba4`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 32.3618426322937 seconds. +- Overall skill 0.379635; relative MASE 0.743623; relative WQL 0.517537. +- term skill: long=0.4040, medium=0.4057, short=0.3597. +- domain skill: Econ/Fin=0.1422, Energy=0.2420, Healthcare=0.4441, Nature=0.4393, Sales=0.3494, Transport=0.4592, Web/CloudOps=0.5028. +- frequency skill: A=0.3775, D=0.3606, H=0.3953, M=0.0567, Q=0.1914, S=0.4261, T=0.4427, W=0.2368. +- variates skill: multivariate=0.3979, univariate=0.3647. +- Outcome: Reject for primary selection: patch8 slowAR transfer main0.379634840 is below patch8 parent0.381178739; earlier1/2 improve to0.339492623/0.363603669, but earlier3 slightly regresses to0.384319115 versus0.384512704. This transfer trades main performance for earlier1/2 and does not dominate. No full replay; E88 tests direct training on slowAR instead. Fixed coefficient1, CPU composition1.039392s, no optimization. + +## E85 patch8 slowAR correction backcast_evals +- Checkpoint SHA-256: `7047bf350ed55e595b47c5f8e0b1712429d049d00967b5b126d1cd039b1c7ba4`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 32.34789538383484 seconds. +- Overall skill 0.339493; relative MASE 0.792721; relative WQL 0.550345. +- term skill: long=0.4006, medium=0.3577, short=0.3072. +- domain skill: Econ/Fin=0.1745, Energy=0.2254, Healthcare=0.4254, Nature=0.3780, Sales=0.4071, Transport=0.3673, Web/CloudOps=0.4527. +- frequency skill: A=0.3339, D=0.3537, H=0.3634, M=0.2145, Q=0.2368, S=0.3480, T=0.3408, W=0.2893. +- variates skill: multivariate=0.3590, univariate=0.3235. +- Outcome: Reject for primary selection: patch8 slowAR transfer main0.379634840 is below patch8 parent0.381178739; earlier1/2 improve to0.339492623/0.363603669, but earlier3 slightly regresses to0.384319115 versus0.384512704. This transfer trades main performance for earlier1/2 and does not dominate. No full replay; E88 tests direct training on slowAR instead. Fixed coefficient1, CPU composition1.039392s, no optimization. + +## E85 patch8 slowAR correction backcast2_evals +- Checkpoint SHA-256: `7047bf350ed55e595b47c5f8e0b1712429d049d00967b5b126d1cd039b1c7ba4`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 31.240530729293823 seconds. +- Overall skill 0.363604; relative MASE 0.765287; relative WQL 0.529214. +- term skill: long=0.3689, medium=0.3919, short=0.3503. +- domain skill: Econ/Fin=0.1175, Energy=0.2366, Healthcare=0.3619, Nature=0.4770, Sales=0.5513, Transport=0.4209, Web/CloudOps=0.4416. +- frequency skill: A=0.3278, D=0.4365, H=0.3885, M=0.1369, Q=0.1530, S=0.2924, T=0.3673, W=0.2792. +- variates skill: multivariate=0.3657, univariate=0.3619. +- Outcome: Reject for primary selection: patch8 slowAR transfer main0.379634840 is below patch8 parent0.381178739; earlier1/2 improve to0.339492623/0.363603669, but earlier3 slightly regresses to0.384319115 versus0.384512704. This transfer trades main performance for earlier1/2 and does not dominate. No full replay; E88 tests direct training on slowAR instead. Fixed coefficient1, CPU composition1.039392s, no optimization. + +## E85 patch8 slowAR correction backcast3_evals +- Checkpoint SHA-256: `7047bf350ed55e595b47c5f8e0b1712429d049d00967b5b126d1cd039b1c7ba4`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 30.950783491134644 seconds. +- Overall skill 0.384319; relative MASE 0.743701; relative WQL 0.509698. +- term skill: long=0.3926, medium=0.3666, short=0.3878. +- domain skill: Econ/Fin=0.1844, Energy=0.3057, Healthcare=0.2112, Nature=0.5108, Sales=0.3977, Transport=0.5024, Web/CloudOps=0.3936. +- frequency skill: A=0.3446, D=0.4387, H=0.3996, M=0.1104, Q=0.2522, S=0.2976, T=0.4263, W=0.2439. +- variates skill: multivariate=0.3656, univariate=0.3987. +- Outcome: Reject for primary selection: patch8 slowAR transfer main0.379634840 is below patch8 parent0.381178739; earlier1/2 improve to0.339492623/0.363603669, but earlier3 slightly regresses to0.384319115 versus0.384512704. This transfer trades main performance for earlier1/2 and does not dominate. No full replay; E88 tests direct training on slowAR instead. Fixed coefficient1, CPU composition1.039392s, no optimization. + +## E69 stochastic volatility first3000 +- Checkpoint SHA-256: `f68cd2d694ecf03ff038c6a2f49657eb2f211f213d68c7dec3ed5cc0c5592c5c`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.498825311660767 seconds. +- Overall skill 0.359482; relative MASE 0.763227; relative WQL 0.537539. +- term skill: long=0.3909, medium=0.4022, short=0.3296. +- domain skill: Econ/Fin=0.1126, Energy=0.1841, Healthcare=0.4243, Nature=0.4229, Sales=0.3462, Transport=0.4587, Web/CloudOps=0.5052. +- frequency skill: A=0.3751, D=0.3459, H=0.3825, M=0.1061, Q=0.1992, S=0.4403, T=0.3990, W=0.2102. +- variates skill: multivariate=0.3912, univariate=0.3331. +- Outcome: Main0.359481571 exceeds matched E42partial3000 0.358812323, while E61slowAR3000 was0.360587999. Continue6000 to assess persistence before transfer or earlier-window selection. Seed79/B256/LR5e-5, independent generatorRNG500082, same real windows. + +## E78 multiscale AR at3000 +- Checkpoint SHA-256: `185d1a3d5d32a3cad539fb3a83bf98ae06a56606a35bafaf8deecd75c8b496d1`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 24.39926815032959 seconds. +- Overall skill 0.378048; relative MASE 0.743609; relative WQL 0.520198. +- term skill: long=0.4028, medium=0.4059, short=0.3572. +- domain skill: Econ/Fin=0.1377, Energy=0.2383, Healthcare=0.4460, Nature=0.4316, Sales=0.3318, Transport=0.4664, Web/CloudOps=0.5035. +- frequency skill: A=0.3675, D=0.3526, H=0.3972, M=0.1004, Q=0.1981, S=0.4242, T=0.4386, W=0.2228. +- variates skill: multivariate=0.3966, univariate=0.3629. +- Outcome: Main0.378048480 is slightly below E77single slowAR3000 0.378238485 and E67original AR3000 0.378318033. Continue planned6000; no publication or evidence of a gain yet. Seed197/B64/LR2e-5, extraRNG700200, main/horizon draws matched. + +E85 exact composition receipt: { + "method": "matched training delta with fixed linear patch conversion", + "formula": "patch8_base + fold16to8(slowAR6000 - partial6000)", + "coefficient": 1.0, + "mapping": "sum input/query/recency halves; take first8 output positions; other tensors unchanged", + "exact_function_preservation": false, + "parent_hashes": { + "/workspace/research/runs/patch8/ema006000.pt": "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", + "/workspace/research/runs/long_memory_synth_recovery/ema006000.pt": "fea5b5290a3a9be5618eaeaf67e918e4f677d5be908d562040ce4bdfeb549bd9", + "/workspace/research/runs/partial_targets/ema006000.pt": "67562486b099a350da53c3caa5ff0932fe7fecdfe72c1879b064b2a9bb173dfb" + }, + "seconds": 1.0393919900525361, + "checkpoint_sha256": "7047bf350ed55e595b47c5f8e0b1712429d049d00967b5b126d1cd039b1c7ba4", + "optimizer_updates": 0 +} + +Measured checkpoint compute through current selection milestones: +```json +{ + "E71 patch8 selected6000": { + "phase_log": "patch8_recovery3.log", + "checkpoint_loop_record": { + "step": 6000, + "loss": 0.27341755777597426, + "seconds": 1302.8, + "lr": 1.2000000000000002e-05, + "grad_norm": 0.12276209145784378, + "context": 2048, + "horizon": 512 + }, + "prior_interrupted_logged_seconds": { + "initial_unsaved_attempt": 63.0, + "recovery2_last_logged2700_resumed_from2000": 770.0 + }, + "total_logged_process_loop_seconds_including_repeated_work": 2135.8 + }, + "E58 recoveredwide24000": { + "phase_log": "wide_capacity_146m_recovery_recovery3.log", + "checkpoint_loop_record": { + "step": 24000, + "loss": 0.3451157429814339, + "seconds": 1117.3, + "lr": 9.51471862576143e-06, + "grad_norm": 0.31578314304351807, + "context": 2048, + "horizon": 1024 + } + }, + "E73 graft4000": { + "phase_log": "wide_graft_recovery3.log", + "checkpoint_loop_record": { + "step": 4000, + "loss": 0.34949749410152436, + "seconds": 1146.4, + "lr": 2.908655439013544e-05, + "grad_norm": 0.47331908345222473, + "context": 1024, + "horizon": 1024 + } + }, + "E69 volatility3000": { + "phase_log": "volatility_synth_recovery3.log", + "checkpoint_loop_record": { + "step": 3000, + "loss": 0.33109228551387787, + "seconds": 977.8, + "lr": 4.4142135623730954e-05, + "grad_norm": 0.13540834188461304, + "context": 2048, + "horizon": 1024 + } + }, + "E77 pairedslowAR3000": { + "phase_log": "paired_long_memory_recovery3.log", + "checkpoint_loop_record": { + "step": 3000, + "loss": 0.31684702143073085, + "seconds": 624.8, + "lr": 1.765685424949238e-05, + "grad_norm": 1.3133997917175293, + "context": 2048, + "horizon": 1024 + } + }, + "E78 multiscale3000": { + "phase_log": "multiscale_ar_train.log", + "checkpoint_loop_record": { + "step": 3000, + "loss": 0.3144953328371048, + "seconds": 637.3, + "lr": 1.765685424949238e-05, + "grad_norm": 1.2501322031021118, + "context": 2048, + "horizon": 1024 + } + }, + "note": "These are concurrent training-process loop measurements on the one H100, not exclusive GPU seconds. Prefix records exclude startup and may exclude unlogged tails before operator interruption. Earlier parent training is recorded separately in the lineage experiments." +} +``` + +E88 launcher correction: naming the launcher queue.py shadowed Python standard-library queue during Torch import, causing a circular-import failure before snapshotting or training. Renamed it launch.py and restarted while E71recovery8000 was still present. Also renamed the E84launcher to avoid the same import hazard in future sampler checks. Existing E84 queued process is unchanged. No optimizer updates or validation results were affected. + +E88 preserved complete exact8000 state: { + "snapshot": "/workspace/research/patch8_recovery008000.pt", + "step": 8000, + "sha256": "2fa4b6f18df4a5f2eed7e1bc153f8f5e3755584305569db42e047f3b1312f5d5", + "snapshot_process_seconds_including_wait": 2.3576558139175177, + "prefetched_batch_preserved": true +} + +## E87 equal patch16/patch8 ensemble complete public-package replay +- Checkpoint SHA-256: `65e5698c0ee4fe1e9ae0607db6ef56c573aa4b82ec009b63ea1a861e4aec741d`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.379630; relative MASE 0.741025; relative WQL 0.519360. +- term skill: long=0.3995, medium=0.4072, short=0.3609. +- domain skill: Econ/Fin=0.1168, Energy=0.2399, Healthcare=0.4788, Nature=0.4386, Sales=0.3583, Transport=0.4643, Web/CloudOps=0.4967. +- frequency skill: A=0.2977, D=0.3660, H=0.3960, M=0.1275, Q=0.1843, S=0.4251, T=0.4366, W=0.2280. +- variates skill: multivariate=0.3954, univariate=0.3668. +- Outcome: Publish strongest replayable candidate: full skill0.379629893, relMASE0.741025239, relWQL0.519360272; 97 configurations/151170 instances, zero failures. Both members forecast every instance with fixed .5/.5 weights, total73,466,288 parameters. Full inference229.446591s on the shared H100, relocation22.524727s with bitwise-equal finite ordered forecasts on3 examples. Actual package quantiles are bitwise equal to the independent member average on electricity hourly short, solar minute short and ETT2hourly long. Cached diagnostic skill0.383685557/0.338970782/0.363158454/0.389306732 exceeds each member at all four cutoffs. No additional training or coefficient sweep; member training seeds/compute recorded above. + +E87 composition verification: { + "cpu_seconds": 0.016339811962097883, + "comparisons": [ + { + "config_id": "electricity__H__short", + "shape": [ + 370, + 1, + 9, + 48 + ], + "bitwise_equal_to_fixed_member_average": true, + "max_abs_difference": 0.0, + "max_scaled_difference": 0.0 + }, + { + "config_id": "solar__T__short", + "shape": [ + 137, + 1, + 9, + 48 + ], + "bitwise_equal_to_fixed_member_average": true, + "max_abs_difference": 0.0, + "max_scaled_difference": 0.0 + }, + { + "config_id": "ett2__H__long", + "shape": [ + 1, + 7, + 9, + 720 + ], + "bitwise_equal_to_fixed_member_average": true, + "max_abs_difference": 0.0, + "max_scaled_difference": 0.0 + } + ], + "no_new_inference_or_training": true +} + +E87 descriptive cluster comparison: {"candidate": "/workspace/research/valid-report-mixed-patch-ensemble.json", "parent": "/workspace/research/valid-report-patch8-6k.json", "candidate_hash": "65e5698c0ee4fe1e9ae0607db6ef56c573aa4b82ec009b63ea1a861e4aec741d", "parent_hash": "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "skill_difference": 0.002469622689308837, "n_configs": 97, "n_dataset_clusters": 28, "improved_configs": 53, "bootstrap_seed": 317, "bootstrap_samples": 5000, "dataset_cluster_delta_percentiles": {"p025": 0.0003627411169234291, "p50": 0.002411418344102745, "p975": 0.004671754347801495}, "note": "Descriptive resampling only. Adaptive validation selection and reused windows prevent treating this as a held-out significance test."} + +## E77 paired slowAR at6000 +- Checkpoint SHA-256: `d471571ef423a63db1ab1b70922d691c31df6099238b1d2e53cb0b48b343a353`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 24.37148094177246 seconds. +- Overall skill 0.378677; relative MASE 0.743065; relative WQL 0.519526. +- term skill: long=0.4020, medium=0.4060, short=0.3586. +- domain skill: Econ/Fin=0.1354, Energy=0.2384, Healthcare=0.4567, Nature=0.4305, Sales=0.3378, Transport=0.4664, Web/CloudOps=0.5036. +- frequency skill: A=0.3690, D=0.3556, H=0.3958, M=0.1000, Q=0.1944, S=0.4250, T=0.4395, W=0.2269. +- variates skill: multivariate=0.3981, univariate=0.3628. +- Outcome: Main0.378677489 modestly exceeds matched E67paired6000 0.378455389, after3000 was slightly behind. Continue planned12000 and check three earlier cutoffs; this remains below selected individual E71 and ensemble E87. Seed197/B64/LR2e-5, same real-window and requested-horizon RNG. + +## E73 independent stream at8000, prune continuation +- Checkpoint SHA-256: `c75d9f9ceae94e22370c2cc8ce4aac6ca83f5474d32e9ca3c571d5aa381d8d4a`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 41.07528495788574 seconds. +- Overall skill 0.373597; relative MASE 0.747769; relative WQL 0.524735. +- term skill: long=0.3982, medium=0.4061, short=0.3509. +- domain skill: Econ/Fin=0.1426, Energy=0.2349, Healthcare=0.4024, Nature=0.4298, Sales=0.3401, Transport=0.4643, Web/CloudOps=0.4998. +- frequency skill: A=0.3809, D=0.3443, H=0.3950, M=0.0990, Q=0.2037, S=0.4221, T=0.4345, W=0.2060. +- variates skill: multivariate=0.3921, univariate=0.3585. +- Outcome: Main0.373596872 recovers from4000 0.372084568 but remains below its function-preserving start0.375792503 and matched original-width parent. Prune after this second negative checkpoint to prioritize E86 frozen-inherited higher-rate training; this does not establish that further E73 training could never recover. Checkpoint8000 training loop2058.7s this recovery plus722.7s logged in the prior interrupted attempt; complete stop receipt follows. Seed113/B96/LR3e-5, compiled static loss; resetseed179 occurred at8001 while waiting for evaluation. + +E86 frozen inherited stream seed113 training started at 2026-10-23T03:23:23Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E73 stop receipt: {"experiment": "E73 stopped after negative8000", "final_loop": {"completed_step": 8683, "training_process_loop_seconds": 2219.4671748820692}, "checkpoint": "/workspace/research/runs/wide_graft/ema008683.pt", "sha256": "36c21e4662c5c6e07cd3c2a34ecba515bc986d29deaef5e1856e6950c30e7db7", "complete_recovery": "/workspace/research/runs/wide_graft/recovery.pt"} + +## E77 paired slowAR6000 backcast_evals +- Checkpoint SHA-256: `d471571ef423a63db1ab1b70922d691c31df6099238b1d2e53cb0b48b343a353`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 24.434251308441162 seconds. +- Overall skill 0.337098; relative MASE 0.795494; relative WQL 0.552410. +- term skill: long=0.3992, medium=0.3581, short=0.3032. +- domain skill: Econ/Fin=0.1599, Energy=0.2277, Healthcare=0.4115, Nature=0.3693, Sales=0.3963, Transport=0.3724, Web/CloudOps=0.4511. +- frequency skill: A=0.3147, D=0.3511, H=0.3673, M=0.1858, Q=0.2368, S=0.3433, T=0.3357, W=0.2891. +- variates skill: multivariate=0.3547, univariate=0.3227. +- Outcome: Earlier0.337098369/0.360407088/0.389754840 each exceeds matched E67paired6000 0.335118632/0.359446144/0.389533029, with main0.378677489 also above0.378455389. Supports slower synthetic AR dynamics in the actual paired objective. Continue12000 and queued E88 patch8 continuation; selected E87ensemble remains stronger on primary validation. + +## E77 paired slowAR6000 backcast2_evals +- Checkpoint SHA-256: `d471571ef423a63db1ab1b70922d691c31df6099238b1d2e53cb0b48b343a353`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 23.03375768661499 seconds. +- Overall skill 0.360407; relative MASE 0.768163; relative WQL 0.532542. +- term skill: long=0.3654, medium=0.3912, short=0.3462. +- domain skill: Econ/Fin=0.1057, Energy=0.2366, Healthcare=0.3597, Nature=0.4721, Sales=0.5486, Transport=0.4198, Web/CloudOps=0.4360. +- frequency skill: A=0.3457, D=0.4251, H=0.3918, M=0.1564, Q=0.1512, S=0.2811, T=0.3637, W=0.2618. +- variates skill: multivariate=0.3657, univariate=0.3561. +- Outcome: Earlier0.337098369/0.360407088/0.389754840 each exceeds matched E67paired6000 0.335118632/0.359446144/0.389533029, with main0.378677489 also above0.378455389. Supports slower synthetic AR dynamics in the actual paired objective. Continue12000 and queued E88 patch8 continuation; selected E87ensemble remains stronger on primary validation. + +## E77 paired slowAR6000 backcast3_evals +- Checkpoint SHA-256: `d471571ef423a63db1ab1b70922d691c31df6099238b1d2e53cb0b48b343a353`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 21.342447519302368 seconds. +- Overall skill 0.389755; relative MASE 0.736028; relative WQL 0.505958. +- term skill: long=0.3958, medium=0.3615, short=0.3978. +- domain skill: Econ/Fin=0.1734, Energy=0.3172, Healthcare=0.2610, Nature=0.5086, Sales=0.3982, Transport=0.5051, Web/CloudOps=0.3947. +- frequency skill: A=0.3572, D=0.4437, H=0.4041, M=0.1316, Q=0.2594, S=0.2895, T=0.4297, W=0.2664. +- variates skill: multivariate=0.3731, univariate=0.4026. +- Outcome: Earlier0.337098369/0.360407088/0.389754840 each exceeds matched E67paired6000 0.335118632/0.359446144/0.389533029, with main0.378677489 also above0.378455389. Supports slower synthetic AR dynamics in the actual paired objective. Continue12000 and queued E88 patch8 continuation; selected E87ensemble remains stronger on primary validation. + +## E89 matched patch4 versus patch8 continuation — prepared +E71 finer patches improved primary full validation. Test another halving of patch length. Both arms initialize from own E71EMA6000, with candidate applying the same fixed linear fold8to4 and first4 output rows. Positions preserve physical time units. Candidate starts functionally different, so record its zero-step screen. Width512/heads8/6encoder/4decoder/context4096/horizon1024 unchanged. New matched sampling seed401, B32 distinct/64signed, paired loss, LR2e-5/12000steps and fresh AdamW/EMA. Both use original synthetic generator and the same source and horizon-prefix streams; horizon truncation remains rounded16 in both to isolate model patch length. Candidate versus control changes patch length, while comparisons against E71 are method selections with a new optimizer/batch/seed. Measure maximum-shape memory before queuing both arms after E78 and E86 release their allocations. Screen1000/3000/6000/12000; earlier windows and full package replay for promising candidates. No external data or weights. + +## E89 patch4 zero-step conversion +- Checkpoint SHA-256: `60a834e264452f3acddfdf191115c6af7ce6e972d959909bf701bac5517420ed`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 52.6757493019104 seconds. +- Overall skill 0.370553; relative MASE 0.752738; relative WQL 0.526349. +- term skill: long=0.3989, medium=0.3945, short=0.3498. +- domain skill: Econ/Fin=0.1324, Energy=0.2289, Healthcare=0.4183, Nature=0.4394, Sales=0.3492, Transport=0.4525, Web/CloudOps=0.4931. +- frequency skill: A=0.3342, D=0.3388, H=0.3842, M=0.1611, Q=0.1857, S=0.4158, T=0.4284, W=0.2377. +- variates skill: multivariate=0.3847, univariate=0.3590. +- Outcome: Initial screen0.370553128 is below source E71patch8_6000 0.381178739, as expected from a non-function-preserving patch fold. This is the baseline before new training, not an improvement. Candidate/control maximum-shape checks are finite and fit: reserved11376/6224MiB including EMA and AdamW moment storage. Both B32/seed401 arms are queued after E78 and E86. + +E89 patch4_initial.json: { + "method": "sum input/query/recency halves and keep first4 output rows; same physical position coordinates", + "exact_function_preservation": false, + "parent_sha256": "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", + "checkpoint_sha256": "60a834e264452f3acddfdf191115c6af7ce6e972d959909bf701bac5517420ed", + "parameters": 36597832, + "cpu_seconds": 0.6177915919106454, + "optimizer_updates": 0 +} + +E89 patch4_memory_check.json: { + "seed": 401, + "batch": 32, + "signed_rows": 64, + "patch": 4, + "context": 4096, + "horizon": 1024, + "EMA_and_AdamW_moment_storage_present": true, + "optimizer_updates": 0, + "loss": 0.2863434851169586, + "seconds": 10.160149822942913, + "peak_allocated_mib": 10789.2275390625, + "peak_reserved_mib": 11376.0 +} + +E89 patch4_control_memory_check.json: { + "seed": 401, + "batch": 32, + "signed_rows": 64, + "patch": 8, + "context": 4096, + "horizon": 1024, + "EMA_and_AdamW_moment_storage_present": true, + "optimizer_updates": 0, + "loss": 0.30326029658317566, + "seconds": 10.05252459505573, + "peak_allocated_mib": 5778.71923828125, + "peak_reserved_mib": 6224.0 +} + +E89 candidate and control queued after PIDs2497(E78) and3946(E86), with their complete recovery files required; inferred total memory replaces those two allocations while preserving evaluation headroom. + +## E86 protected inherited stream first1000 +- Checkpoint SHA-256: `048d9f14388ad2409cd2a3f0b352d5fc1b8525f2e1e5e196707a36fe84a193bc`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 41.35012197494507 seconds. +- Overall skill 0.372364; relative MASE 0.749500; relative WQL 0.525586. +- term skill: long=0.3978, medium=0.4046, short=0.3494. +- domain skill: Econ/Fin=0.1443, Energy=0.2339, Healthcare=0.4085, Nature=0.4257, Sales=0.3367, Transport=0.4639, Web/CloudOps=0.4980. +- frequency skill: A=0.3876, D=0.3511, H=0.3944, M=0.0661, Q=0.1958, S=0.4208, T=0.4323, W=0.2051. +- variates skill: multivariate=0.3906, univariate=0.3575. +- Outcome: Main0.372363971 is below own initialization0.375792503. Higher-rate added/cross-stream learning still changes predictions despite protecting inherited tensors. Continue predeclared3000 comparison before deciding. Seed113/B96/LR2e-4, compiled loss, 36,800,800 inherited parameters protected and109,676,544 new/cross-stream parameters train. + +## E78 multiscale AR at6000 +- Checkpoint SHA-256: `d517ab35a8bdaeb1b0d14d4fb1879a984cedec0663bc09e3a602497facbcf473`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 21.888899564743042 seconds. +- Overall skill 0.378668; relative MASE 0.743166; relative WQL 0.519472. +- term skill: long=0.4027, medium=0.4063, short=0.3582. +- domain skill: Econ/Fin=0.1300, Energy=0.2384, Healthcare=0.4669, Nature=0.4301, Sales=0.3370, Transport=0.4663, Web/CloudOps=0.5026. +- frequency skill: A=0.3680, D=0.3559, H=0.3959, M=0.1037, Q=0.1941, S=0.4255, T=0.4387, W=0.2279. +- variates skill: multivariate=0.3972, univariate=0.3635. +- Outcome: Main0.378667589 is effectively tied with E77single slowAR6000 0.378677489; both slightly exceed original E67paired6000 0.378455389. No demonstrated gain from adding AR components. Continue planned12000 endpoint; no publication. + +## E69 stochastic volatility at6000 +- Checkpoint SHA-256: `1161e76a6d17ace780f0bf63d6961a2ea28a4036ee5a29ee78b9e9897e7661ee`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.00778031349182 seconds. +- Overall skill 0.359792; relative MASE 0.762404; relative WQL 0.537598. +- term skill: long=0.3895, medium=0.4029, short=0.3305. +- domain skill: Econ/Fin=0.1133, Energy=0.1860, Healthcare=0.4240, Nature=0.4263, Sales=0.3419, Transport=0.4578, Web/CloudOps=0.5034. +- frequency skill: A=0.3769, D=0.3446, H=0.3811, M=0.1104, Q=0.1982, S=0.4402, T=0.4011, W=0.2124. +- variates skill: multivariate=0.3908, univariate=0.3340. +- Outcome: Main0.359791528 exceeds matched E42partial6000 0.359221833; E61slowAR6000 remains stronger at0.361281186. Check the first two earlier cutoffs to decide whether the volatility gain generalizes. Seed79/B256/LR5e-5, extraRNG500082; full continuation is planned12000. + +E86 actual GPU-trained EMA1000 preservation audit: { + "checkpoint": "/workspace/research/runs/wide_graft_frozen/ema001000.pt", + "step": 1000, + "cpu_seconds": 1.7478242949582636, + "inherited_parameters": 36800800, + "inherited_bitwise_equal_to_E47": true, + "changed_added_or_cross_stream_parameters": 109676526, + "optimizer_updates": 0 +} + +## E69 volatility6000 backcast_evals +- Checkpoint SHA-256: `1161e76a6d17ace780f0bf63d6961a2ea28a4036ee5a29ee78b9e9897e7661ee`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 22.790717124938965 seconds. +- Overall skill 0.330896; relative MASE 0.805425; relative WQL 0.555856. +- term skill: long=0.3909, medium=0.3566, short=0.2960. +- domain skill: Econ/Fin=0.1469, Energy=0.2301, Healthcare=0.4125, Nature=0.3497, Sales=0.3988, Transport=0.3637, Web/CloudOps=0.4436. +- frequency skill: A=0.3198, D=0.3550, H=0.3590, M=0.1648, Q=0.2278, S=0.3421, T=0.3294, W=0.2744. +- variates skill: multivariate=0.3479, univariate=0.3170. +- Outcome: Main0.359791528 and earlier1 0.330895782 improve matched E42partial6000 0.359221833/0.330299984; earlier2 0.352505400 is below control0.352900879. Mixed temporal evidence, so no transfer or publication. Finish predeclared12000 before deciding; E88 remains queued after this allocation. + +## E69 volatility6000 backcast2_evals +- Checkpoint SHA-256: `1161e76a6d17ace780f0bf63d6961a2ea28a4036ee5a29ee78b9e9897e7661ee`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 22.497740983963013 seconds. +- Overall skill 0.352505; relative MASE 0.776021; relative WQL 0.540255. +- term skill: long=0.3678, medium=0.3769, short=0.3372. +- domain skill: Econ/Fin=0.0890, Energy=0.2282, Healthcare=0.3738, Nature=0.4582, Sales=0.5585, Transport=0.4133, Web/CloudOps=0.4263. +- frequency skill: A=0.3446, D=0.4275, H=0.3868, M=0.1756, Q=0.1499, S=0.2802, T=0.3442, W=0.2458. +- variates skill: multivariate=0.3580, univariate=0.3481. +- Outcome: Main0.359791528 and earlier1 0.330895782 improve matched E42partial6000 0.359221833/0.330299984; earlier2 0.352505400 is below control0.352900879. Mixed temporal evidence, so no transfer or publication. Finish predeclared12000 before deciding; E88 remains queued after this allocation. + +## E86 protected inherited stream at3000 +- Checkpoint SHA-256: `45ac18a80765f03bca329ccef8d4c81f39fae8cb3f555e4e261b9a38c5fd253f`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 41.0149462223053 seconds. +- Overall skill 0.373573; relative MASE 0.748714; relative WQL 0.524113. +- term skill: long=0.3985, medium=0.4063, short=0.3506. +- domain skill: Econ/Fin=0.1401, Energy=0.2337, Healthcare=0.4215, Nature=0.4251, Sales=0.3422, Transport=0.4636, Web/CloudOps=0.5006. +- frequency skill: A=0.3797, D=0.3460, H=0.3949, M=0.0960, Q=0.1979, S=0.4211, T=0.4348, W=0.2041. +- variates skill: multivariate=0.3931, univariate=0.3576. +- Outcome: Main0.373573070 improves from1000 0.372363971 and reaches roughly E73unrestricted8000 0.373596872 in fewer updates, but still trails the starting model0.375792503. Continue planned6000/8000 to test recovery. This compares different trainable scopes and learning rates together. Actual EMA1000 audit showed all36,800,800 inherited entries bitwise unchanged; added connections can still change the inherited stream activations. + +E84 coarse aggregation seed197 training started at 2026-10-23T03:37:37Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E77 paired slowAR final12000 +- Checkpoint SHA-256: `61cdf64f284aaa5bd97be010a29178d8b6dc796af35898d9b0ea2a76dce7dd0e`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.205326557159424 seconds. +- Overall skill 0.377696; relative MASE 0.743749; relative WQL 0.520690. +- term skill: long=0.4033, medium=0.4049, short=0.3568. +- domain skill: Econ/Fin=0.1435, Energy=0.2349, Healthcare=0.4451, Nature=0.4300, Sales=0.3324, Transport=0.4672, Web/CloudOps=0.5053. +- frequency skill: A=0.3634, D=0.3546, H=0.3953, M=0.0987, Q=0.2009, S=0.4254, T=0.4404, W=0.2126. +- variates skill: multivariate=0.3967, univariate=0.3621. +- Outcome: Final main0.377696007 exceeds matched E67paired12000 0.377427077 but is below its own6000 checkpoint0.378677489; retain6000 for the method comparison. Training completed12000 in2453.330776 process-loop seconds on the shared H100, seed197/B64/LR2e-5. E84coarse aggregation started after this trainer exited. No publication against stronger E87ensemble. + +overflow_control seed197 training started at 2026-10-23T03:43:42Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E90 training loss scale for daily and weekly windows — prepared +The task metadata confirms daily and weekly MASE uses lag1, while the current training weight uses the first modeled seasonal period,7/52. Hypothesis: matching this scale improves coarse-frequency forecasting. Change only the lag used by the context seasonal-MAE loss weight for exact period pairs[7,365] and[52,1] to1; all other periods, weighting formula, forecasts and inference rules remain unchanged. Match E80overflow-only control: own E62 initialization, seed197/B64/paired loss/LR2e-5/12000steps, same original sampler and horizon RNG, verified float64 overflow fallback in both. Compare against E80, not the older normalization implementation. No generator or training source change. Queue after E84 releases its allocation. + +E79 fresh512 seed307 training started at 2026-10-23T03:43:44Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:43:44Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:43:56Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:43:56Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:43:57Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:43:57Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:44:10Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:44:10Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:44:11Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:44:11Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:44:12Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:44:12Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:44:12Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:44:12Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:44:24Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:44:24Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:44:25Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:44:25Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:44:26Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:44:26Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:44:26Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:44:26Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:44:27Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:44:27Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:44:27Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:44:27Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:44:28Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:44:28Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:44:28Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:44:28Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:44:39Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:44:39Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:44:41Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:44:41Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:44:41Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:44:41Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:44:42Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:44:42Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:44:45Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:44:45Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:44:46Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:44:46Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:44:50Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:44:50Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:44:50Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:44:50Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:44:50Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:44:50Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh1024 seed307 training started at 2026-10-23T03:44:51Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:44:51Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E79 startup failure and clean matched restart +{ + "started_utc": "2026-10-23T03:43:44Z", + "cleanup_utc": "2026-10-23T03:47:40.492921+00:00", + "cause": "legacy random_capacity/queue.py shadowed stdlib queue inside compiler workers and launched recursive duplicate E79 trainers; OOM then closed pool errors", + "saved_checkpoints": 0, + "discarded_partial_optimizer_updates": "not recoverable from interleaved/overwritten logs; no model selected", + "established_trainers_affected": false, + "terminated_related_processes": 50, + "remedy": "rename and guard launchers; exclusive output-directory and receipt locks; clean fresh restart", + "numerical_recipe_correction": "both fresh arms now include previously verified float64 statistics fallback only for nonfinite float32 mean/scale; initial weights/seeds/source streams unchanged" +} +The incident interval is wall time on the sole shared H100; duplicate per-process compute cannot be reconstructed exactly because legacy launchers reused log paths. Original failed logs and receipts are retained. No valid E79 checkpoint exists from this attempt. The updated numerical normalization is shared by both fresh widths; width remains the only difference between their recipes. + +E79 corrected-normalization fixture: {"normalization_overflow_fallback": true, "width": 512, "initialization_seed": 307, "fixture_seed": 313, "optimizer_updates": 0, "maximum_shape_memory": {"batch": 48, "signed_rows": 96, "context": 4096, "horizon": 1024, "loss": 0.6031821966171265, "peak_allocated_mib": 4521.12451171875, "peak_reserved_mib": 4784.0}, "eager_loss": 0.3412420153617859, "compiled_loss": 0.3412419855594635, "gradient_cosine": 0.9999952735476323, "max_gradient_difference": 4.57763671875e-05, "compile_comparison_seconds": 43.313792017987, "total_seconds": 50.912394708022475, "source": "allowed packed_sample and own synthetic generator only"} + +E90 fixture and queue: { + "seed": 419, + "cpu_seconds": 1.048940374981612, + "forward_bitwise_unchanged": true, + "hourly_monthly_loss_bitwise_unchanged": true, + "mixed_loss_before": 0.4770006537437439, + "mixed_loss_after": 0.4904267191886902, + "all_gradients_finite": true, + "optimizer_updates": 0, + "diagnostic_input": "four locally generated random/smooth contexts; never used in selected weights" +} +Queued after E84(PID4254), using E80 as the matched control. + +E79 duplicate-output guard fixture: { + "duplicate_rejected_before_model_loading": true, + "optimizer_updates": 0, + "cpu_seconds": 1.6497254162095487 +} +With the training code directory on the import path, queue now resolves to the Python standard library. No queue.py/torch.py/multiprocessing.py/concurrent.py shadow files remain under research. + +E79 corrected-normalization fixture: {"normalization_overflow_fallback": true, "width": 1024, "initialization_seed": 307, "fixture_seed": 313, "optimizer_updates": 0, "maximum_shape_memory": {"batch": 48, "signed_rows": 96, "context": 4096, "horizon": 1024, "loss": 0.6031821966171265, "peak_allocated_mib": 10162.86376953125, "peak_reserved_mib": 10696.0}, "eager_loss": 0.3412420153617859, "compiled_loss": 0.3412419855594635, "gradient_cosine": 0.9999932382274589, "max_gradient_difference": 6.103515625e-05, "compile_comparison_seconds": 40.99431764590554, "total_seconds": 49.15364895504899, "source": "allowed packed_sample and own synthetic generator only"} + +E79 fresh1024 seed307 training started at 2026-10-23T03:50:34Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 fresh512 seed307 training started at 2026-10-23T03:50:34Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E89 patch4_candidate seed401 training started at 2026-10-23T03:50:45Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E89 patch4_control seed401 training started at 2026-10-23T03:50:45Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E58/E66 widened146M final32000 +- Checkpoint SHA-256: `ecbb1f28a9bced1c7ecc078593908435320a618cde23bf034719b92b14c12b96`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.13470983505249 seconds. +- Overall skill 0.375306; relative MASE 0.746016; relative WQL 0.523103. +- term skill: long=0.3994, medium=0.4059, short=0.3536. +- domain skill: Econ/Fin=0.1403, Energy=0.2325, Healthcare=0.4376, Nature=0.4286, Sales=0.3380, Transport=0.4675, Web/CloudOps=0.5006. +- frequency skill: A=0.3821, D=0.3507, H=0.3942, M=0.0875, Q=0.2028, S=0.4235, T=0.4362, W=0.2179. +- variates skill: multivariate=0.3934, univariate=0.3605. +- Outcome: Final0.375305635 is effectively identical to matched37Mcontrol0.375304864 and below own E47parent0.375792930. The small24000 advantage did not persist. This rejects a benefit from this duplicated-width continuation, not from fresh larger pretraining. Final recovery3 loop3443.875463s; previous phases recorded separately; seed113/reset179/B96/LR3e-5. E79 tests fresh capacity instead. + +## E86 protected inherited stream at6000 +- Checkpoint SHA-256: `73dfe63b77e9f981fec42ceff6b2c9ec8b69e887c6d1d42830629c729c989625`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 30.87101984024048 seconds. +- Overall skill 0.373645; relative MASE 0.748615; relative WQL 0.524061. +- term skill: long=0.3977, medium=0.4063, short=0.3511. +- domain skill: Econ/Fin=0.1394, Energy=0.2337, Healthcare=0.4357, Nature=0.4267, Sales=0.3377, Transport=0.4634, Web/CloudOps=0.4976. +- frequency skill: A=0.3780, D=0.3487, H=0.3934, M=0.1091, Q=0.2016, S=0.4221, T=0.4332, W=0.2062. +- variates skill: multivariate=0.3912, univariate=0.3593. +- Outcome: Main0.373645290 barely improves3000 0.373573070 and remains below starting model0.375792503. Finish planned8000, then release allocation to E89. Seed113/B96/LR2e-4; no publication. + +## E84 coarse-data first1000 +- Checkpoint SHA-256: `207329fa0c16814d1fa72b3683219761f5ca3b692fa7059730f76c3fe0e93712`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 24.292750597000122 seconds. +- Overall skill 0.377433; relative MASE 0.744088; relative WQL 0.520892. +- term skill: long=0.4001, medium=0.4067, short=0.3569. +- domain skill: Econ/Fin=0.1311, Energy=0.2365, Healthcare=0.4620, Nature=0.4308, Sales=0.3347, Transport=0.4671, Web/CloudOps=0.5002. +- frequency skill: A=0.3669, D=0.3545, H=0.3965, M=0.1063, Q=0.1974, S=0.4228, T=0.4351, W=0.2289. +- variates skill: multivariate=0.3942, univariate=0.3638. +- Outcome: Main0.377433346 exceeds matched E67paired1000 0.376859515. Early evidence only; same seed197/B64/LR2e-5, independent aggregationRNG900200; no inference changes. + +## E84 coarse-data at3000 +- Checkpoint SHA-256: `75b4b41869254617288521d3c0c3539c9d60c6cad6b259b6ff166d1c9fd78c29`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 18.35591197013855 seconds. +- Overall skill 0.378023; relative MASE 0.743608; relative WQL 0.520241. +- term skill: long=0.4019, medium=0.4064, short=0.3573. +- domain skill: Econ/Fin=0.1364, Energy=0.2363, Healthcare=0.4484, Nature=0.4319, Sales=0.3319, Transport=0.4672, Web/CloudOps=0.5044. +- frequency skill: A=0.3677, D=0.3514, H=0.3990, M=0.1053, Q=0.1979, S=0.4219, T=0.4378, W=0.2193. +- variates skill: multivariate=0.3966, univariate=0.3628. +- Outcome: Main0.378023141 is slightly below matched E67paired3000 0.378318033 after the first1000 gain. Continue6000/12000 and inspect frequency groups; no consistent gain yet. + +## E80 overflow-only control first1000 +- Checkpoint SHA-256: `fb64456ba0c2ebef979b8525274132618fe542f67e7193036e4a013de6629f5c`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 18.763219356536865 seconds. +- Overall skill 0.376804; relative MASE 0.744768; relative WQL 0.521468. +- term skill: long=0.3990, medium=0.4062, short=0.3563. +- domain skill: Econ/Fin=0.1319, Energy=0.2364, Healthcare=0.4621, Nature=0.4300, Sales=0.3347, Transport=0.4668, Web/CloudOps=0.4982. +- frequency skill: A=0.3657, D=0.3559, H=0.3950, M=0.1061, Q=0.1979, S=0.4228, T=0.4347, W=0.2257. +- variates skill: multivariate=0.3925, univariate=0.3640. +- Outcome: Main0.376804394 is effectively tied with original E67paired1000 0.376859515, and slightly above E75postloss1000 0.376670711. Numerical correction alone has not shown a predictive gain yet. Continue matched3000/6000/12000. + +## E78 multiscale AR final12000 +- Checkpoint SHA-256: `a9b6f03e211513684787db1d518696925351987e524cb969c3d3a184afde6f25`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 18.768662929534912 seconds. +- Overall skill 0.377173; relative MASE 0.744921; relative WQL 0.520745. +- term skill: long=0.4032, medium=0.4047, short=0.3559. +- domain skill: Econ/Fin=0.1376, Energy=0.2351, Healthcare=0.4499, Nature=0.4288, Sales=0.3321, Transport=0.4667, Web/CloudOps=0.5043. +- frequency skill: A=0.3628, D=0.3520, H=0.3946, M=0.1047, Q=0.2008, S=0.4249, T=0.4400, W=0.2136. +- variates skill: multivariate=0.3959, univariate=0.3619. +- Outcome: Final0.377172928 is below matched E77single slowAR12000 0.377696007 and original E67paired12000 0.377427077. At6000 it nearly tied single slowAR; no gain from extra components. Completed planned endpoint; retain negative result and release this allocation for queued E89 after E86 finishes. + +E88 patch8 late slowAR seed197 training started at 2026-10-23T03:55:05Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E86 protected inherited stream final8000 +- Checkpoint SHA-256: `8c868d08f583249ae38cd9173b7f19c530825dda785fe66011be60d3e1a6b2f4`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 30.288848638534546 seconds. +- Overall skill 0.373894; relative MASE 0.748106; relative WQL 0.524001. +- term skill: long=0.3986, medium=0.4065, short=0.3511. +- domain skill: Econ/Fin=0.1434, Energy=0.2349, Healthcare=0.4214, Nature=0.4283, Sales=0.3364, Transport=0.4640, Web/CloudOps=0.4986. +- frequency skill: A=0.3812, D=0.3459, H=0.3944, M=0.1025, Q=0.2000, S=0.4216, T=0.4346, W=0.2079. +- variates skill: multivariate=0.3920, univariate=0.3591. +- Outcome: Final0.373894042 remains below its own initialization0.375792503. Protecting inherited tensors while training additions at a higher rate improved recovery speed but did not improve the forecast model. Completed8000 in1625.057884loopseconds on the shared H100. Effective protected/trainable counts36,800,800/109,676,544; seed113/B96/LR2e-4. Released allocation to E89; retain as negative result. + +## E80 overflow-only control at3000 +- Checkpoint SHA-256: `2084f1888f8d9e5afe2c740769ea2b4167086cdd62dfb4014bc3a338c00d4c12`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 22.62967348098755 seconds. +- Overall skill 0.378664; relative MASE 0.743020; relative WQL 0.519581. +- term skill: long=0.4024, medium=0.4069, short=0.3581. +- domain skill: Econ/Fin=0.1345, Energy=0.2391, Healthcare=0.4537, Nature=0.4314, Sales=0.3327, Transport=0.4661, Web/CloudOps=0.5041. +- frequency skill: A=0.3682, D=0.3548, H=0.3976, M=0.1042, Q=0.1968, S=0.4234, T=0.4386, W=0.2234. +- variates skill: multivariate=0.3971, univariate=0.3636. +- Outcome: Main0.378663825 exceeds original E67paired3000 0.378318033 and nearly matches E75postloss3000 0.378813891. Most of the earlier raw main gain may come from the numerical correction rather than the postprocessing-aware loss. Check earlier cutoffs using the same overflow-safe runtime before attributing the remaining difference. Same seed197/B64/LR2e-5. + +## E84 coarse data at6000 +- Checkpoint SHA-256: `79cce8767ec35ed8ba6045957f2ef4147adb8fe312b03c50dc20ae635255926f`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 22.568254947662354 seconds. +- Overall skill 0.378304; relative MASE 0.743340; relative WQL 0.519958. +- term skill: long=0.4018, medium=0.4073, short=0.3574. +- domain skill: Econ/Fin=0.1325, Energy=0.2353, Healthcare=0.4579, Nature=0.4332, Sales=0.3368, Transport=0.4657, Web/CloudOps=0.5045. +- frequency skill: A=0.3681, D=0.3543, H=0.3963, M=0.1037, Q=0.1944, S=0.4243, T=0.4385, W=0.2257. +- variates skill: multivariate=0.3970, univariate=0.3630. +- Outcome: Main0.378304411 remains slightly below matched E67paired6000 0.378455389. Continue planned12000, then assess overall/frequency behavior; no consistent aggregate gain yet. Seed197/B64/LR2e-5, same base/source/horizon streams apart from independent coarse aggregation. + +## E89 patch8 matched control first1000 +- Checkpoint SHA-256: `ebf6cd1845311b149118beb13364892445388f124e9f706bffe7a317ab97b762`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 29.399544715881348 seconds. +- Overall skill 0.380274; relative MASE 0.743092; relative WQL 0.516841. +- term skill: long=0.4036, medium=0.4039, short=0.3617. +- domain skill: Econ/Fin=0.1303, Energy=0.2425, Healthcare=0.4624, Nature=0.4416, Sales=0.3473, Transport=0.4610, Web/CloudOps=0.5001. +- frequency skill: A=0.3689, D=0.3561, H=0.3952, M=0.1038, Q=0.1908, S=0.4222, T=0.4419, W=0.2419. +- variates skill: multivariate=0.3965, univariate=0.3670. +- Outcome: Control0.380274173 is below its shared starting E71patch8_6000 0.381178739. The patch4 candidate is still approaching1000. Fresh AdamW/EMA, seed401/B32/LR2e-5; wait for the matched comparison. + +Completed process loop receipts: E71 recovery3 final12000=3333.747876572s (earlier interrupted prefixes separately logged); E78 final12000=2448.526446433s; E86 final8000=1625.057883863s. All overlapped other training on the one H100 and are not exclusive GPU times. + +## E71 patch8 final12000 +- Checkpoint SHA-256: `313d035b782188253ecd27c0da37030b397b82e4fa596f3a944994be3f1d203f`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 28.39552927017212 seconds. +- Overall skill 0.379468; relative MASE 0.743587; relative WQL 0.517842. +- term skill: long=0.4043, medium=0.4042, short=0.3599. +- domain skill: Econ/Fin=0.1408, Energy=0.2402, Healthcare=0.4302, Nature=0.4416, Sales=0.3430, Transport=0.4619, Web/CloudOps=0.5048. +- frequency skill: A=0.3766, D=0.3605, H=0.3949, M=0.0689, Q=0.1914, S=0.4241, T=0.4445, W=0.2231. +- variates skill: multivariate=0.3987, univariate=0.3637. +- Outcome: Final main0.379467684 is below selected6000 0.381178739. Retain6000 as published ensemble member. Seed197/B64/LR2e-5; recovery3 loop3333.747877s, previous recovery phases recorded separately; no further continuation in this run. + +## E69 volatility final12000 +- Checkpoint SHA-256: `adddab6f07cb65843a1356ee2a3b36985fd56ecacc6fdb7703c465b0cfe21f5a`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 18.7578706741333 seconds. +- Overall skill 0.360846; relative MASE 0.761644; relative WQL 0.536363. +- term skill: long=0.3901, medium=0.4048, short=0.3314. +- domain skill: Econ/Fin=0.1094, Energy=0.1887, Healthcare=0.4132, Nature=0.4274, Sales=0.3422, Transport=0.4584, Web/CloudOps=0.5066. +- frequency skill: A=0.3708, D=0.3402, H=0.3826, M=0.1173, Q=0.1994, S=0.4419, T=0.4041, W=0.2107. +- variates skill: multivariate=0.3938, univariate=0.3333. +- Outcome: Final main0.360845700 is below matched E42partial12000 0.361108160. Earlier6000 diagnostics were mixed. The early main gain did not persist; no transfer or publication. Seed79/B256/LR5e-5; final recovery3 loop3542.503298s. Released allocation to E88. + +## E89 patch4 candidate first1000 +- Checkpoint SHA-256: `a0b4f56f9b3bbf26a94ee72a8f3487c1fb42c009c79ccb8fcef8538ffdb96e7f`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 47.17473244667053 seconds. +- Overall skill 0.378251; relative MASE 0.744567; relative WQL 0.519191. +- term skill: long=0.4036, medium=0.4019, short=0.3589. +- domain skill: Econ/Fin=0.1342, Energy=0.2339, Healthcare=0.4544, Nature=0.4415, Sales=0.3520, Transport=0.4631, Web/CloudOps=0.5002. +- frequency skill: A=0.3613, D=0.3424, H=0.3929, M=0.1696, Q=0.1890, S=0.4219, T=0.4368, W=0.2442. +- variates skill: multivariate=0.3925, univariate=0.3667. +- Outcome: Main0.378250742 improves folded initialization0.370553128 but trails matched patch8control1000 0.380274173 and shared original patch8parent0.381178739. Continue planned comparison; seed401/B32/LR2e-5. + +## E80 overflow-only3000 earlier cutoff1 +- Checkpoint SHA-256: `2084f1888f8d9e5afe2c740769ea2b4167086cdd62dfb4014bc3a338c00d4c12`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 22.02164888381958 seconds. +- Overall skill 0.336120; relative MASE 0.797369; relative WQL 0.552739. +- term skill: long=0.3981, medium=0.3582, short=0.3019. +- domain skill: Econ/Fin=0.1557, Energy=0.2287, Healthcare=0.4162, Nature=0.3643, Sales=0.3941, Transport=0.3729, Web/CloudOps=0.4489. +- frequency skill: A=0.3135, D=0.3521, H=0.3666, M=0.1852, Q=0.2300, S=0.3411, T=0.3348, W=0.2843. +- variates skill: multivariate=0.3527, univariate=0.3226. +- Outcome: Earlier0.336119626 exceeds E75postloss0.333946620 and original E67paired0.335738788. Numerical fix alone is a better base here; seed197/B64/LR2e-5, no extra optimization. + +## E80 overflow-only3000 earlier cutoff2 +- Checkpoint SHA-256: `2084f1888f8d9e5afe2c740769ea2b4167086cdd62dfb4014bc3a338c00d4c12`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 21.807528972625732 seconds. +- Overall skill 0.358235; relative MASE 0.771665; relative WQL 0.533732. +- term skill: long=0.3635, medium=0.3875, short=0.3446. +- domain skill: Econ/Fin=0.1067, Energy=0.2360, Healthcare=0.3485, Nature=0.4691, Sales=0.5486, Transport=0.4210, Web/CloudOps=0.4314. +- frequency skill: A=0.3545, D=0.4236, H=0.3910, M=0.1500, Q=0.1497, S=0.2812, T=0.3593, W=0.2599. +- variates skill: multivariate=0.3633, univariate=0.3541. +- Outcome: Earlier0.358234785 exceeds E75postloss0.357604589 and essentially ties original E67paired0.358235331. Main and first two earlier cutoffs warrant one fixed slowAR delta composition; no validation gradients. + +## E80 overflow-only3000 earlier cutoff3 +- Checkpoint SHA-256: `2084f1888f8d9e5afe2c740769ea2b4167086cdd62dfb4014bc3a338c00d4c12`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 21.630401849746704 seconds. +- Overall skill 0.388792; relative MASE 0.737171; relative WQL 0.506769. +- term skill: long=0.3965, medium=0.3607, short=0.3962. +- domain skill: Econ/Fin=0.1707, Energy=0.3203, Healthcare=0.2577, Nature=0.5049, Sales=0.3995, Transport=0.5052, Web/CloudOps=0.3898. +- frequency skill: A=0.3632, D=0.4429, H=0.4039, M=0.1158, Q=0.2578, S=0.2865, T=0.4303, W=0.2614. +- variates skill: multivariate=0.3742, univariate=0.4001. +- Outcome: Earlier0.388791691 is slightly below original E67paired0.389069088. Numerical correction does not improve every cutoff. Keep all outcomes; assess one predeclared fixed composition across all four cutoffs. + +## E91 predeclared overflow-safe base plus slow-AR correction +Hypothesis: the overflow-only E80 paired3000 base retains the useful numerical correction without E75 postprocessing-aware objective regressions, while the independently matched E61 slowAR6000 minus E42partial6000 correction retains its previous benefit. Apply exactly one coefficient1 composition: E80paired3000 + E61slowAR6000 - E42partial6000. No coefficient sweep, no additional optimizer updates, no validation targets used in weight construction. All three parents were trained on allowed corpus/synthetic data from our own scratch lineage. Base seed197/B64/LR2e-5; matched delta parents seed79/B256/LR5e-5. Use the exact postloss_inference overflow-safe model with unchanged fixed inference rules. Evaluate all four established cutoffs, and only then consider equal-weight ensemble replacement with E71patch8_6000 and a full public-contract replay. + +## E80 overflow-only control at6000 +- Checkpoint SHA-256: `b19875c52ed5024383fb69ccc48cb07a5629ad8011abf134c7dcfcdc50fae2af`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 22.57701802253723 seconds. +- Overall skill 0.378289; relative MASE 0.743925; relative WQL 0.519575. +- term skill: long=0.4014, medium=0.4069, short=0.3578. +- domain skill: Econ/Fin=0.1256, Energy=0.2394, Healthcare=0.4638, Nature=0.4293, Sales=0.3386, Transport=0.4657, Web/CloudOps=0.5023. +- frequency skill: A=0.3687, D=0.3551, H=0.3958, M=0.1068, Q=0.1918, S=0.4249, T=0.4380, W=0.2268. +- variates skill: multivariate=0.3966, univariate=0.3633. +- Outcome: Main0.378288765 is below its3000 0.378663825 and matched original E67paired6000 0.378455389. The numerical correction is required for rare finite overflows but its forecasting gain is not monotonic. Continue planned12000; seed197/B64/LR2e-5. + +## E89 patch8 matched control at3000 +- Checkpoint SHA-256: `9083c6be954ec65ec6248801e719d6f182cd3d12bf116f8fc5fc4796675141c4`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 33.57180857658386 seconds. +- Overall skill 0.378946; relative MASE 0.744701; relative WQL 0.517938. +- term skill: long=0.4043, medium=0.4024, short=0.3597. +- domain skill: Econ/Fin=0.1384, Energy=0.2401, Healthcare=0.4325, Nature=0.4444, Sales=0.3407, Transport=0.4620, Web/CloudOps=0.5013. +- frequency skill: A=0.3736, D=0.3524, H=0.3933, M=0.0834, Q=0.1970, S=0.4232, T=0.4439, W=0.2376. +- variates skill: multivariate=0.3975, univariate=0.3638. +- Outcome: Control0.378945686 is below first1000 and original selected6000 parent. Continue matched patch4 comparison; seed401/B32/LR2e-5. + +## E88 late slowAR first9000 +- Checkpoint SHA-256: `fbd4b0d4f29fb162929a3cf9cd4bb0ae264a2e15d860519e0fc08fa314b6820d`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 30.04508352279663 seconds. +- Overall skill 0.380434; relative MASE 0.741856; relative WQL 0.517434. +- term skill: long=0.4054, medium=0.4044, short=0.3611. +- domain skill: Econ/Fin=0.1423, Energy=0.2409, Healthcare=0.4434, Nature=0.4404, Sales=0.3436, Transport=0.4625, Web/CloudOps=0.5050. +- frequency skill: A=0.3803, D=0.3586, H=0.3955, M=0.0778, Q=0.1920, S=0.4256, T=0.4443, W=0.2331. +- variates skill: multivariate=0.3993, univariate=0.3650. +- Outcome: Main0.380434469 exceeds original E71final12000 but is below selected E71earlier6000. Evaluate the exact original9000 checkpoint before attributing a gain to the late AR change. Resume8000 preserved optimizer/EMA/allRNG/prefetched batch; seed197/B64/global12kLRschedule. + +## E91 overflow-safe plus slowAR valid_screen +- Checkpoint SHA-256: `59b90e76823bd4b339c7b5d290c7afbdca9d1ba81848760aa5f80ee941cdd089`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.561925172805786 seconds. +- Overall skill 0.379922; relative MASE 0.741449; relative WQL 0.518575. +- term skill: long=0.4039, medium=0.4067, short=0.3598. +- domain skill: Econ/Fin=0.1450, Energy=0.2359, Healthcare=0.4601, Nature=0.4339, Sales=0.3351, Transport=0.4657, Web/CloudOps=0.5073. +- frequency skill: A=0.3727, D=0.3616, H=0.3973, M=0.0940, Q=0.1982, S=0.4264, T=0.4400, W=0.2228. +- variates skill: multivariate=0.3984, univariate=0.3648. +- Outcome: Fixed coefficient1 composition; zero optimizer updates, merge CPU1.173140s. Main0.379921968 is slightly below E83main0.380250568, but all three earlier cutoffs improve E83. Next compare one fixed equal ensemble with selected E71patch8_6000 across all four cutoffs; validation selection only. + +## E91 overflow-safe plus slowAR valid_backcast +- Checkpoint SHA-256: `59b90e76823bd4b339c7b5d290c7afbdca9d1ba81848760aa5f80ee941cdd089`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 26.259706020355225 seconds. +- Overall skill 0.337178; relative MASE 0.795032; relative WQL 0.552597. +- term skill: long=0.3962, medium=0.3594, short=0.3042. +- domain skill: Econ/Fin=0.1688, Energy=0.2262, Healthcare=0.4114, Nature=0.3695, Sales=0.3929, Transport=0.3721, Web/CloudOps=0.4520. +- frequency skill: A=0.3205, D=0.3501, H=0.3656, M=0.1901, Q=0.2319, S=0.3439, T=0.3378, W=0.2886. +- variates skill: multivariate=0.3544, univariate=0.3232. +- Outcome: Fixed coefficient1 composition; zero optimizer updates, merge CPU1.173140s. Main0.379921968 is slightly below E83main0.380250568, but all three earlier cutoffs improve E83. Next compare one fixed equal ensemble with selected E71patch8_6000 across all four cutoffs; validation selection only. + +## E91 overflow-safe plus slowAR valid_backcast2 +- Checkpoint SHA-256: `59b90e76823bd4b339c7b5d290c7afbdca9d1ba81848760aa5f80ee941cdd089`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 25.369709968566895 seconds. +- Overall skill 0.360453; relative MASE 0.769235; relative WQL 0.531723. +- term skill: long=0.3677, medium=0.3870, short=0.3472. +- domain skill: Econ/Fin=0.1196, Energy=0.2351, Healthcare=0.3437, Nature=0.4735, Sales=0.5473, Transport=0.4202, Web/CloudOps=0.4377. +- frequency skill: A=0.3522, D=0.4289, H=0.3897, M=0.1376, Q=0.1497, S=0.2867, T=0.3638, W=0.2656. +- variates skill: multivariate=0.3670, univariate=0.3551. +- Outcome: Fixed coefficient1 composition; zero optimizer updates, merge CPU1.173140s. Main0.379921968 is slightly below E83main0.380250568, but all three earlier cutoffs improve E83. Next compare one fixed equal ensemble with selected E71patch8_6000 across all four cutoffs; validation selection only. + +## E91 overflow-safe plus slowAR valid_backcast3 +- Checkpoint SHA-256: `59b90e76823bd4b339c7b5d290c7afbdca9d1ba81848760aa5f80ee941cdd089`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 25.158844232559204 seconds. +- Overall skill 0.389176; relative MASE 0.737055; relative WQL 0.506212. +- term skill: long=0.3949, medium=0.3621, short=0.3969. +- domain skill: Econ/Fin=0.1809, Energy=0.3196, Healthcare=0.2279, Nature=0.5059, Sales=0.4000, Transport=0.5071, Web/CloudOps=0.3940. +- frequency skill: A=0.3624, D=0.4461, H=0.4034, M=0.1001, Q=0.2604, S=0.2871, T=0.4311, W=0.2634. +- variates skill: multivariate=0.3742, univariate=0.4008. +- Outcome: Fixed coefficient1 composition; zero optimizer updates, merge CPU1.173140s. Main0.379921968 is slightly below E83main0.380250568, but all three earlier cutoffs improve E83. Next compare one fixed equal ensemble with selected E71patch8_6000 across all four cutoffs; validation selection only. + +## E92 robust normalization — prepared, not launched +Hypothesis: rare large history observations dominate the current mean/RMS scale and compress typical dynamics. Change only the context normalization to winsorized statistics: center a clipping interval on the finite-value median, radius6 times the mean absolute deviation from that median; estimate mean and standard deviation of the clipped history in float64, retain the existing relative scale floor, and normalize the original history with the existing ±30 bound. This uses a mean absolute deviation, rather than median deviation, to retain scale for intermittent series. All-missing and constant histories use the same safe count/floor conventions. No future observations enter normalization. Initialize own E62 checkpoint; seed197/B64/LR2e-5/12000 paired steps, same original corpus/synthetic/horizon streams as E80overflow-only control. No new parameters, sources, or synthetic generator. A separate runtime will use identical robust statistics. Check finite outputs/gradients, affine and sign behavior, and unchanged loss machinery on locally generated fixtures before launch. Queue only after E80 releases its allocation. + +### E91 fixed ensemble outcome — retain E87 +[ + { + "cutoff": "valid_screen", + "candidate": 0.38295755880742377, + "published": 0.38368555666405846, + "cpu_seconds": 0.7978230791632086, + "groups": { + "term": { + "short": 0.3641412739810047, + "medium": 0.4081748699742944, + "long": 0.4053387686104565 + }, + "domain": { + "Econ/Fin": 0.14196055084083636, + "Energy": 0.2436181245717931, + "Healthcare": 0.47044789997945524, + "Nature": 0.43843771854824554, + "Sales": 0.3435316624897278, + "Transport": 0.4646935796341666, + "Web/CloudOps": 0.50560991569805 + }, + "freq": { + "A-DEC": 0.37806371948108464, + "Q-DEC": 0.1953743898001734, + "M": 0.10835758037283183, + "W-SUN": 0.09200217288388479, + "D": 0.36288028663668526, + "H": 0.39989339265058577, + "15T": 0.21574107475831517, + "W-FRI": 0.00590529614346913, + "10T": 0.6203515795555475, + "W-TUE": 0.5998659430846229, + "W-THU": 0.20928566575491192, + "W-WED": 0.32755565821641586, + "5T": 0.5196292524760446, + "10S": 0.4253796526525012 + } + } + }, + { + "cutoff": "valid_backcast", + "candidate": 0.33965252002132096, + "published": 0.33897078175106665, + "cpu_seconds": 0.8413949671667069, + "groups": { + "term": { + "short": 0.30682882244621934, + "medium": 0.3594584814302525, + "long": 0.4004578178388881 + }, + "domain": { + "Econ/Fin": 0.17015181674919277, + "Energy": 0.23013645693798135, + "Healthcare": 0.4218451623665679, + "Nature": 0.3716837571447873, + "Sales": 0.4016515190787069, + "Transport": 0.3732465934225949, + "Web/CloudOps": 0.450994086374909 + }, + "freq": { + "A-DEC": 0.3282816505284657, + "Q-DEC": 0.23566016127363243, + "M": 0.19914077895872262, + "W-SUN": 0.03865936211094867, + "D": 0.355074708701307, + "H": 0.36721923281513913, + "15T": 0.22292257615547317, + "W-FRI": 0.23702394178468034, + "10T": 0.32706954225689555, + "W-TUE": 0.5531057781818784, + "W-THU": 0.26381006300655674, + "W-WED": 0.35364720411869544, + "5T": 0.44270238618668056, + "10S": 0.34631632390506784 + } + } + }, + { + "cutoff": "valid_backcast2", + "candidate": 0.36318271604290864, + "published": 0.36315845377936284, + "cpu_seconds": 0.7982894480228424, + "groups": { + "term": { + "short": 0.3500873123601329, + "medium": 0.39140163998387134, + "long": 0.3681031208336688 + }, + "domain": { + "Econ/Fin": 0.11631521324076821, + "Energy": 0.23897422330833784, + "Healthcare": 0.3563145060249002, + "Nature": 0.4759919302878802, + "Sales": 0.5526652479550637, + "Transport": 0.42387192299481313, + "Web/CloudOps": 0.436824697056448 + }, + "freq": { + "A-DEC": 0.34293470421447503, + "Q-DEC": 0.15231508648525816, + "M": 0.14735330101758526, + "W-SUN": 0.05191699540908579, + "D": 0.4322785270529358, + "H": 0.39262772604483, + "15T": 0.10591962461225035, + "W-FRI": 0.14794480975291435, + "10T": 0.5077330623307716, + "W-TUE": 0.09268217269468071, + "W-THU": 0.34555097504792365, + "W-WED": 0.5579990641356007, + "5T": 0.4724634827891697, + "10S": 0.2869202644785588 + } + } + }, + { + "cutoff": "valid_backcast3", + "candidate": 0.3889402057921222, + "published": 0.3893067316884232, + "cpu_seconds": 1.0883019380271435, + "groups": { + "term": { + "short": 0.3948070762587602, + "medium": 0.36614080286851436, + "long": 0.3957100819716167 + }, + "domain": { + "Econ/Fin": 0.18258306326920215, + "Energy": 0.3151836976978215, + "Healthcare": 0.23576266671317847, + "Nature": 0.5094192054942891, + "Sales": 0.4006642315236326, + "Transport": 0.5077376839877803, + "Web/CloudOps": 0.39340413209496183 + }, + "freq": { + "A-DEC": 0.3560985343152149, + "Q-DEC": 0.25541091598546395, + "M": 0.11989423475215888, + "W-SUN": 0.15976888148282853, + "D": 0.4460752118885134, + "H": 0.40415283128676627, + "15T": 0.2542013440411708, + "W-FRI": 0.03652589348537405, + "10T": 0.6009630559934178, + "W-TUE": 0.25771359383581927, + "W-THU": 0.35674611651454924, + "W-WED": 0.37808927325032227, + "5T": 0.4654632139858025, + "10S": 0.29366540153879894 + } + } + } +] +The E91/E71 equal ensemble loses main0.382957559 versus E870.383685557 and third earlier0.388940206 versus0.389306732. First earlier improves0.339652520 versus0.338970782; second is effectively tied0.363182716 versus0.363158454. No consistent replacement gain; retain E87 and do not spend a full replay. E91 checkpoint SHA59b90e76823bd4b339c7b5d290c7afbdca9d1ba81848760aa5f80ee941cdd089, coefficient1, no optimization. The postloss-related earlier regressions were real, but removing that objective does not improve the selected equal ensemble overall. + +E92 CPU fixture passed: finite outputs/gradients, ordered quantiles, midpoint-median sign symmetry, affine behavior on nonconstant rows, eight own-generated contexts, seed431, zero updates,1.487883s. GPU autocast fixture queued. + +## E88 exact original patch8 control at9000 +- Checkpoint SHA-256: `342436626bc9219f068c118aefbe6ffb106f91e9f88acb01a9ee704cdfb7aa6b`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 34.10145950317383 seconds. +- Overall skill 0.380329; relative MASE 0.741988; relative WQL 0.517518. +- term skill: long=0.4051, medium=0.4042, short=0.3611. +- domain skill: Econ/Fin=0.1410, Energy=0.2410, Healthcare=0.4471, Nature=0.4399, Sales=0.3435, Transport=0.4623, Web/CloudOps=0.5043. +- frequency skill: A=0.3807, D=0.3585, H=0.3953, M=0.0838, Q=0.1923, S=0.4254, T=0.4436, W=0.2332. +- variates skill: multivariate=0.3986, univariate=0.3654. +- Outcome: Original9000 main0.380329158 versus E88late slowAR9000 0.380434469, a small0.000105310 gain after1000 changed steps. Both below original selected6000 0.381178739; continue exact final12000 comparison. One failed evaluator invocation used a nonexistent path and did no inference; rerun with full_paired_inference succeeded. + +E92 GPU bf16 paired-gradient fixture passed, seed433,8.773601s, zero optimizer updates. Queue behind E80PID4371; unchanged declared12k schedule. + +Provenance hardening for E88: publisher now includes the immutable external recovery008000 snapshot as a lineage parent and records its hash/step, in addition to the original initialization. This preserves the original8000-step recipe before the late slowAR change. Mutable within-run recovery files remain excluded to avoid self-referencing lineage; no training state or weights changed. + +## Permitted-sampler coverage diagnostic, seed449 +Independent E79sampler audit generated48000 windows in4.262272CPU seconds, zero optimizer updates, no validation data read, active training streams untouched. Full source probabilities and finite-history/target summaries are sampler_coverage_audit.json. Monthly[12,1] accounts for5.1104% of rows: medianfinitecontext43, medianfinitetarget57,42.68%histories below32. Quarterly[4,1] accounts for5.2792%: mediancontext33,target46,47.95%histories below32. Weekly[52,1] accounts for3.8188%: mediancontext51,target82,30.44%histories below32. Current synthetic-period list contains no[52,1]weekly case. These are training-distribution diagnostics, not performance evidence; context and target marginal medians do not imply every row has that ratio. Original sampler20%synthetic/randomC-H recipe preserved. + +## E79 fresh37M first4000 +- Checkpoint SHA-256: `dc04a05abefdb903497a3311e7eac289ccdeae75db0ada66d02e05e431ba4f1a`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 29.426799774169922 seconds. +- Overall skill 0.341862; relative MASE 0.775670; relative WQL 0.558415. +- term skill: long=0.3667, medium=0.3845, short=0.3148. +- domain skill: Econ/Fin=0.1118, Energy=0.2099, Healthcare=0.3250, Nature=0.4095, Sales=0.3041, Transport=0.4280, Web/CloudOps=0.4683. +- frequency skill: A=0.3520, D=0.3280, H=0.3608, M=-0.0493, Q=0.1682, S=0.4263, T=0.3918, W=0.2320. +- variates skill: multivariate=0.3630, univariate=0.3246. +- Outcome: Fresh random seed307/B48/LR2e-4/96000 static-compiled paired training, original random initialization hash19da01694123fcb13df815689ca66460d0da596bd31dfabfabb08dda6f7801e4. Main0.341861940 is below the published mature lineage but a promising early learning curve. Wait for the matched146M4000 result and planned8000/16000 checkpoints. Both arms share the corrected float64 overflow fallback and slowAR generator. Startup failures and discarded work were recorded separately; no baseline weights used. + +## E89 patch4 candidate at3000 +- Checkpoint SHA-256: `87fcd88001d63389726ff55885ef09933f912034662816cf2080d2f08a041542`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 58.48912262916565 seconds. +- Overall skill 0.379843; relative MASE 0.742829; relative WQL 0.517743. +- term skill: long=0.4040, medium=0.4031, short=0.3611. +- domain skill: Econ/Fin=0.1466, Energy=0.2356, Healthcare=0.4515, Nature=0.4449, Sales=0.3476, Transport=0.4665, Web/CloudOps=0.4992. +- frequency skill: A=0.3695, D=0.3423, H=0.3937, M=0.1494, Q=0.2020, S=0.4211, T=0.4409, W=0.2524. +- variates skill: multivariate=0.3948, univariate=0.3676. +- Outcome: Candidate main0.379842915 now exceeds matched patch8control3000 0.378945686 by0.000897230, though below selected starting parent0.381178739. Monthly skill0.1494 and weekly0.2524 are encouraging; daily0.3423 remains weak. Continue the declared6000/12000 comparisons before considering ensemble complementarity. Seed401/B32/LR2e-5; same original generator and matched fresh optimizer. + +E90 daily-weekly loss scale seed197 training started at 2026-10-23T04:12:55Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E93 patch8 encoder with patch4 forecast blocks — prepared +Hypothesis: E89patch4 improves monthly/weekly behavior by refining forecast blocks; part of the gain may survive with the cheaper patch8 encoder. Decouple input and output patch sizes, keeping input8 and output4. Initialize exactly from own E71patch8 EMA6000: retain all encoder/input tensors, fold query/recency halves and keep the first4 head rows as in E89. No function-preservation claim for output4; input8/output8 must reproduce the old implementation exactly. All other training settings match E89: seed401/B32/LR2e-5/12000 paired steps, original normalization and synthetic generator, horizonRNG300404, fresh optimizer/EMA. Compare with existing E89patch8control and fullpatch4 at1000/3000/6000/12000. No new data/generator or external weights. Queue after E88 releases its allocation, after equivalence and maximum-shape CUDA checks. + +## E84 coarse aggregation final12000 +- Checkpoint SHA-256: `bb3e1d1ef6b57ad9517e69c5f3c4fd5caac6e4fd0f50fa9273df2cd2b13b8a70`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.56629729270935 seconds. +- Overall skill 0.377144; relative MASE 0.744785; relative WQL 0.520888. +- term skill: long=0.4036, medium=0.4057, short=0.3553. +- domain skill: Econ/Fin=0.1335, Energy=0.2339, Healthcare=0.4474, Nature=0.4322, Sales=0.3330, Transport=0.4658, Web/CloudOps=0.5048. +- frequency skill: A=0.3623, D=0.3529, H=0.3953, M=0.1038, Q=0.1971, S=0.4244, T=0.4404, W=0.2071. +- variates skill: multivariate=0.3962, univariate=0.3616. +- Outcome: Final0.377143853 is below matched E67paired12000 0.377427077. Daily skill improves0.352881088 versus0.350503003, but weekly drops0.207079293 versus0.218111206. Short term loses0.000773 while long/medium gain slightly. The targeted daily/weekly augmentation is mixed and not selected. Seed197/B64/LR2e-5, final training loop2103.526387s. E90loss-scale-only starts in the released allocation. + +## E89 patch8 matched control at6000 +- Checkpoint SHA-256: `9e8f798ceb2e1b49d8bd92ba334c42470e780b8d6b62a14195bb268ae8ba872a`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 33.938090801239014 seconds. +- Overall skill 0.377735; relative MASE 0.746288; relative WQL 0.518853. +- term skill: long=0.4024, medium=0.4020, short=0.3584. +- domain skill: Econ/Fin=0.1414, Energy=0.2382, Healthcare=0.4376, Nature=0.4420, Sales=0.3419, Transport=0.4600, Web/CloudOps=0.4997. +- frequency skill: A=0.3730, D=0.3564, H=0.3927, M=0.0689, Q=0.1989, S=0.4229, T=0.4411, W=0.2355. +- variates skill: multivariate=0.3951, univariate=0.3636. +- Outcome: Main0.377734884 continues below original selected parent0.381178739 and control3000 0.378945686. Preserve this matched reference for fullpatch4 and E93splitpatch; seed401/B32/LR2e-5. Continue planned12000. + +E93 initialization SHA0719b4dce554764ef69181d8b19d8da11849ef32b35391ffee6700e639a73114;36,601,928parameters, CPUconversion0.663439s. CPUfixture1.433205s proves equal8/8 implementation bitwise unchanged and all converted tensors exactly match E89full4 except the retained input8 projection. CUDAmaximumshapeB32C4096H1024, EMA/moments present, finite loss/gradients,7082MiB reserved,10.871036s. Zero optimizer updates in fixtures. Queued behind E88PID7349 as declared. + +## E93 input8/output4 zero-step conversion +- Checkpoint SHA-256: `0719b4dce554764ef69181d8b19d8da11849ef32b35391ffee6700e639a73114`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 36.244373083114624 seconds. +- Overall skill 0.375817; relative MASE 0.747921; relative WQL 0.520916. +- term skill: long=0.4024, medium=0.4024, short=0.3547. +- domain skill: Econ/Fin=0.1375, Energy=0.2390, Healthcare=0.4236, Nature=0.4343, Sales=0.3477, Transport=0.4607, Web/CloudOps=0.4989. +- frequency skill: A=0.3643, D=0.3468, H=0.3925, M=0.0737, Q=0.1911, S=0.4237, T=0.4382, W=0.2424. +- variates skill: multivariate=0.3939, univariate=0.3610. +- Outcome: Initial main0.375817443 is below shared E71patch8parent0.381178739 but above fullpatch4 conversion0.370553128. Keeping the input projection preserves more initial accuracy; this is initialization behavior, not evidence for trained superiority. Conversion0.663439CPU seconds; no optimizer updates; queued matched seed401/B32/LR2e-5/12000 continuation. + +## E87 validation-only context/error audit +Read the established9473-instance screen, both selected member prediction caches, and the cached SeasonalNaive reference; no optimization or changed inference. Compute fixed context4096/recent512 level shifts, scale ratios, and RMS/mean-absolute-deviation ratios, then macro aggregate conditional median-error ratios over represented configurations. CPU2.732488s, zero optimizer updates; complete bins/counts/per-channel metrics in context_error_audit.json. Median-error ratios across recent-level-shift bins[0,.25),[.25,.75),[.75,1.5),[1.5,inf) are.73083,.71495,.77366,.88600. Last bin has only40rows/eightconfigurations. Outlier-dominance bins do not show a monotonic weakness; the highest ratio bin performs relatively well against SeasonalNaive. These are descriptive validation subsets, with different configurations represented; not benchmark skill, independent evidence, or causal estimates. No inference-rule change follows from this audit. + +## E79 fresh146M first4000 +- Checkpoint SHA-256: `ce1d3cf0e49de7acc168ca818424fef4c58feebc49e35ebccd79e6a7450c810a`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 41.41028594970703 seconds. +- Overall skill 0.328134; relative MASE 0.791714; relative WQL 0.570160. +- term skill: long=0.3561, medium=0.3699, short=0.3002. +- domain skill: Econ/Fin=0.1210, Energy=0.2038, Healthcare=0.2653, Nature=0.3940, Sales=0.2893, Transport=0.4160, Web/CloudOps=0.4518. +- frequency skill: A=0.3724, D=0.3122, H=0.3525, M=-0.0778, Q=0.2007, S=0.4142, T=0.3812, W=0.1775. +- variates skill: multivariate=0.3500, univariate=0.3102. +- Outcome: Main0.328133919 trails matched37M4000 0.341861940. Both use own random seed307, batch48, LR2e-4/96000, identical sampled windows and modern paired/slowAR/horizon recipe. This is early optimization, not evidence that larger capacity cannot improve. Continue planned8000/16000 while inspecting matched training loss. Static-compiler startup/abandoned duplicate launches were recorded separately. + +E93 input8/output4 seed401 training started at 2026-10-23T04:18:59Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E79 matched training-loss diagnostic at first4000: mean50-step-block losses37M/146M over steps1..400=.434227/.430111,401..1000=.397594/.402231,1001..2000=.381371/.386349,2001..3000=.374289/.377926,3001..4000=.361665/.366583. The larger model starts slightly better during warmup but trails after reachingLR2e-4. This is consistent with an optimization mismatch, not proof of its cause. First4000 training-loop times including static compilation:37M1106.1s,146M1563.7s; both share the sole H100. + +## E94 fresh146M with half learning rate — prepared +Hypothesis: the commonLR2e-4 is too aggressive at width1024, obscuring capacity benefits. Add one matched fresh146M arm withLR1e-4 only; same original random initialization SHA c9693619ca6277c26fef3b2bde37ff6796bec97b3af9f94588bbc5ddd329ec90, seed307, B48,96000-step cosine horizon,400 warmup, static compiled paired loss, allowed packed_sample/source weights, slowAR synthetic generator, requested-horizon augmentation, overflow fallback, optimizer/EMA, save/checkpoint cadence. All original E79 arms continue unchanged. Reuse the exact code and already verified width1024 maximum-shape/compiled-gradient fixtures; no architecture or memory change warrants rerunning them. Screen4000/8000/16000/24000, continuing longer only if supported. Queue after E89patch8control releases its allocation. No pretrained assets, new sources or generators. + +## E79 fresh37M at8000 +- Checkpoint SHA-256: `5e821b81ac42babdc67ed0f5368da07941be075784d1ded6ab6c65539458faf0`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 29.999473094940186 seconds. +- Overall skill 0.353509; relative MASE 0.763149; relative WQL 0.547666. +- term skill: long=0.3727, medium=0.3917, short=0.3307. +- domain skill: Econ/Fin=0.1196, Energy=0.2092, Healthcare=0.3930, Nature=0.4203, Sales=0.3250, Transport=0.4394, Web/CloudOps=0.4807. +- frequency skill: A=0.3577, D=0.3366, H=0.3677, M=0.0393, Q=0.1747, S=0.4203, T=0.4060, W=0.2420. +- variates skill: multivariate=0.3701, univariate=0.3400. +- Outcome: Main0.353508836 improves4000 0.341861940, still below the mature published model. Continue declared16k/24k/48k; own random seed307/B48/LR2e-4/96k, no pretrained assets. Fresh146M is still before its matched8k. + +## E90 daily-weekly loss scale first1000 +- Checkpoint SHA-256: `e0e1e3967da656eaa8184317b080a5f2064081d0d53e969c4f8a4894fa92d4f2`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.965925931930542 seconds. +- Overall skill 0.376961; relative MASE 0.744602; relative WQL 0.521322. +- term skill: long=0.3990, medium=0.4061, short=0.3567. +- domain skill: Econ/Fin=0.1300, Energy=0.2364, Healthcare=0.4663, Nature=0.4300, Sales=0.3344, Transport=0.4667, Web/CloudOps=0.4984. +- frequency skill: A=0.3661, D=0.3567, H=0.3951, M=0.1038, Q=0.1981, S=0.4227, T=0.4348, W=0.2267. +- variates skill: multivariate=0.3927, univariate=0.3641. +- Outcome: Main0.376961315 slightly exceeds matched overflow-only E801000 0.376804394. Too early for a method-selection claim; inspect3k/6k and frequency groups. Seed197/B64/LR2e-5, only exactdaily/weeklyseasonallosslag changes. + +## E88 late patch8 slowAR final12000 +- Checkpoint SHA-256: `81e020113b23e84d1df64458e7c1b4a4f6ad6ee24f7cdb601aeb3fbe5d20251f`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 33.93403601646423 seconds. +- Overall skill 0.379111; relative MASE 0.744397; relative WQL 0.517873. +- term skill: long=0.4044, medium=0.4045, short=0.3590. +- domain skill: Econ/Fin=0.1445, Energy=0.2396, Healthcare=0.4185, Nature=0.4414, Sales=0.3428, Transport=0.4624, Web/CloudOps=0.5058. +- frequency skill: A=0.3764, D=0.3621, H=0.3953, M=0.0393, Q=0.1919, S=0.4250, T=0.4450, W=0.2233. +- variates skill: multivariate=0.3996, univariate=0.3623. +- Outcome: Final0.379111337 is below exact original E71final12000 0.379467684. Its small9k gain did not persist, and neither checkpoint exceeds selected6k parent0.381178739. Reject the late slowAR continuation; no new package or earlier-cutoff selection. Resumed8000->12000 completed in1415.491672loopseconds, preserving original optimizer/EMA/RNG/prefetched batch; seed197/B64/same globalcosine. E93 starts in the released allocation. + +E92 robust normalization seed197 training started at 2026-10-23T04:21:37Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E95 broader source coverage at fixed packed volume — preparation +Hypothesis: restricting each large source to eight shards and early record batches limits the useful diversity, especially for buildings (127shards) and each climate source (96shards). Prepare packed_stratified with the same95allowlisted directories,24Mpoint/source soft cap, min16, maxcrop131072 as packed_sample. Select a uniform shuffled order of flattened series across every shard and record batch; take the first finite crops until the cap. Keep exact per-row frequency, exclude all-missing crops, and use independent deterministic per-series crop RNG. Thus coverage, row-frequency handling and empty-crop filtering are declared changes; this is not a claim that each can be isolated if actual mixed-frequency cases occur. Source mixture probabilities will remain those from packed_sample in any training comparison. No external data or validation values enter packing. + +Packer fixtures cover scalar, variable-channel and fixed-channel Arrow targets, null parents/variates, all-missing series, differing row frequencies and long crops:44retained series replay exactly, two fresh outputs have identical hashes,0.240463CPU seconds, zero updates. Initial fixture caught Arrow boolean conversion requiring zero_copy_only=False; fixed before any real-data packing. Per-directory receipts record selected source coordinates, shard coverage, binary hashes and elapsed time; output-wide lock and final atomic meta.json prevent reading an incomplete pack. + +Planned first training comparison, contingent on the completed real-data audit: own E62 parent, seed197/B64/LR2e-5/12000 paired steps with the exact E80overflow-control model/data code, changing only the packed corpus while retaining source probabilities from packed_sample. Screen1k/3k/6k/12k. No fresh training is launched yet; prefer the E90allocation after it finishes. A later fresh-capacity/data comparison remains a separate decision. + +## E80 overflow-only final12000 +- Checkpoint SHA-256: `f11d056b95f1c5eeef174265ebc51742952600e0dae1fa52900860447d5be819`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 24.899142265319824 seconds. +- Overall skill 0.377424; relative MASE 0.744802; relative WQL 0.520408. +- term skill: long=0.4025, medium=0.4056, short=0.3563. +- domain skill: Econ/Fin=0.1303, Energy=0.2363, Healthcare=0.4508, Nature=0.4285, Sales=0.3332, Transport=0.4665, Web/CloudOps=0.5051. +- frequency skill: A=0.3608, D=0.3513, H=0.3946, M=0.1037, Q=0.1974, S=0.4251, T=0.4405, W=0.2175. +- variates skill: multivariate=0.3963, univariate=0.3620. +- Outcome: Final0.377423946 effectively ties original E67paired12000 0.377427077; strongest main checkpoint remained3000. Numerical correction is still required for rare overflow but does not cause a consistent predictive gain by itself. Completed2264.013627training-loop seconds on sharedH100, seed197/B64/LR2e-5. E92robust normalization starts in its allocation. + +## E90 daily-weekly loss scale at3000 +- Checkpoint SHA-256: `a985b1af082ccd6e23a9ec3fd6d6bdd8e8f9ae44900d2c0e1f8d3737cd9fd8d3`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.59094786643982 seconds. +- Overall skill 0.378417; relative MASE 0.743144; relative WQL 0.519906. +- term skill: long=0.4018, medium=0.4067, short=0.3579. +- domain skill: Econ/Fin=0.1345, Energy=0.2395, Healthcare=0.4551, Nature=0.4311, Sales=0.3328, Transport=0.4655, Web/CloudOps=0.5031. +- frequency skill: A=0.3691, D=0.3557, H=0.3972, M=0.1020, Q=0.1974, S=0.4233, T=0.4378, W=0.2245. +- variates skill: multivariate=0.3966, univariate=0.3635. +- Outcome: Main0.378417277 trails matched E803000 0.378663825 after a small first1000 gain. Continue6000/12000 and inspect targeted frequency groups; no publication. Seed197/B64/LR2e-5. + +## E92 robust normalization first1000 +- Checkpoint SHA-256: `0067828e667139743a9908ff3a6d68f704197a1609935c64ae6f7a15c84884fa`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 27.180058240890503 seconds. +- Overall skill 0.377596; relative MASE 0.742948; relative WQL 0.521418. +- term skill: long=0.3986, medium=0.4060, short=0.3580. +- domain skill: Econ/Fin=0.1327, Energy=0.2358, Healthcare=0.4628, Nature=0.4326, Sales=0.3487, Transport=0.4670, Web/CloudOps=0.4977. +- frequency skill: A=0.3673, D=0.3569, H=0.3949, M=0.1225, Q=0.1981, S=0.4216, T=0.4346, W=0.2284. +- variates skill: multivariate=0.3923, univariate=0.3656. +- Outcome: Main0.377596201 exceeds matched E801000 0.376804394 by0.000791807. Early evidence only; changes fixed context mean/RMS estimation to median-centered winsorized statistics, retaining original history normalization bounds. Continue3000/6000 and earlier cutoffs if the gain persists. Seed197/B64/LR2e-5. + +## E93 input8/output4 first1000 +- Checkpoint SHA-256: `0aecc5af0ac9b0caf9949bd6601f2fe4ad96c5fdc9e1287c1ff2237439367b7a`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 35.963313579559326 seconds. +- Overall skill 0.379099; relative MASE 0.744060; relative WQL 0.518128. +- term skill: long=0.4046, medium=0.4041, short=0.3591. +- domain skill: Econ/Fin=0.1359, Energy=0.2378, Healthcare=0.4437, Nature=0.4406, Sales=0.3497, Transport=0.4667, Web/CloudOps=0.5000. +- frequency skill: A=0.3584, D=0.3472, H=0.3946, M=0.1244, Q=0.1932, S=0.4224, T=0.4398, W=0.2474. +- variates skill: multivariate=0.3943, univariate=0.3667. +- Outcome: Main0.379098968 exceeds fullpatch4 E891000 0.378250742 but trails matched patch8control1000 0.380274173. Keeping input8 retains initial accuracy; assess later recovery against both existing arms before an architectural conclusion. Seed401/B32/LR2e-5. + +E95 pack completed in109.068074s on two CPUworkers:95directories,342661series,952527771points (3.810GB), versus original357789series/958745103points. Identical softcaps, actualpointcount0.65%lower because overshoot/serieslengths differ. Building127/127shards, borg31/31, eachlargeclimate96/96 are represented. No selected candidate row differed from its shardfirst frequency;103all-missing crops excluded. Exact real-data audit replayed260series acrossall95dirs against independent Arrow row/var access, including frequencies and cropstarts; source probabilities bitwise equal to original. Seed461,7.897138CPU seconds, no validationdata/optimizerupdates. Training nowqueued afterE90PID8949 under the predeclared E80matched recipe. + +## E89 fullpatch4 at6000 +- Checkpoint SHA-256: `e50a2d43bb3b6b66a94a6a2d9d62f0cb3e404310352e0357cfe0f2a874a21727`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 58.3371467590332 seconds. +- Overall skill 0.380541; relative MASE 0.742008; relative WQL 0.517151. +- term skill: long=0.4046, medium=0.4023, short=0.3625. +- domain skill: Econ/Fin=0.1470, Energy=0.2361, Healthcare=0.4746, Nature=0.4451, Sales=0.3448, Transport=0.4655, Web/CloudOps=0.4969. +- frequency skill: A=0.3637, D=0.3535, H=0.3958, M=0.1449, Q=0.2068, S=0.4213, T=0.4378, W=0.2471. +- variates skill: multivariate=0.3932, univariate=0.3703. +- Outcome: Main0.380540506 improves3000 0.379842915 and beats matched patch8control6000 0.377734884, but remains below selected starting E71patch8parent0.381178739. Check all three earlier cutoffs to assess stability and possible ensemble complementarity. Seed401/B32/LR2e-5; same original generator and fresh optimizer. + +## E93 input8/output4 at3000 +- Checkpoint SHA-256: `1b82ca84aca9aaa2b8b6b1f944a865b6aad7560257f88b053ea5f62bf63a4eb8`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 35.112743854522705 seconds. +- Overall skill 0.379808; relative MASE 0.743342; relative WQL 0.517444. +- term skill: long=0.4052, medium=0.4025, short=0.3608. +- domain skill: Econ/Fin=0.1447, Energy=0.2358, Healthcare=0.4455, Nature=0.4421, Sales=0.3442, Transport=0.4692, Web/CloudOps=0.5011. +- frequency skill: A=0.3652, D=0.3489, H=0.3934, M=0.1161, Q=0.2001, S=0.4227, T=0.4417, W=0.2532. +- variates skill: multivariate=0.3949, univariate=0.3675. +- Outcome: Main0.379808189 nearly matches fullpatch4_3000 0.379842915 and exceeds matched patch8control3000 0.378945686. Much of the early finer-patch gain may be retained by output blocks alone, with7082MiB max-shape reserve versus11376MiB fullpatch4. Continue6000/12000; seed401/B32/LR2e-5. + +## E92 robust normalization at3000 +- Checkpoint SHA-256: `348934d9fbcc8f2a8c45f7ebdc6cd971678d190bcf6ec0c0bd1cf80a12334bbc`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.601238489151 seconds. +- Overall skill 0.378938; relative MASE 0.741788; relative WQL 0.519985. +- term skill: long=0.4019, medium=0.4060, short=0.3591. +- domain skill: Econ/Fin=0.1339, Energy=0.2386, Healthcare=0.4552, Nature=0.4314, Sales=0.3481, Transport=0.4662, Web/CloudOps=0.5030. +- frequency skill: A=0.3665, D=0.3532, H=0.3965, M=0.1254, Q=0.1981, S=0.4218, T=0.4381, W=0.2295. +- variates skill: multivariate=0.3961, univariate=0.3649. +- Outcome: Main0.378937598 exceeds matched overflow-only E803000 0.378663825 by0.000273773 and postlossE753000 0.378813891 by0.000123707. Small primary gain persists; check all three earlier cutoffs before any composition or selection. Same seed197/B64/LR2e-5. Float64 robust statistics replace the old normalization throughout both network and context loss-scale calculation. + +## E96 equal three-resolution ensemble — predeclared selection probe +Hypothesis: fullpatch4 E89EMA6000 adds complementary monthly/weekly behavior to the published E87patch16/patch8 pair. Test exactly equal1/3 quantile averaging after each member applies its own unchanged rules, ordered E83postloss+slowAR, E71patch8_6000, E89patch4_6000. No coefficient sweep, no additional optimization, no dataset/frequency selection. Every member must forecast every instance if packaged. Compare all four established cached cutoffs; require a complete public-contract replay and relocation/composition checks before any publication. E89patch4_6000 hash e50a2d43bb3b6b66a94a6a2d9d62f0cb3e404310352e0357cfe0f2a874a21727; earlier cutoffs currently running. + +E94 fresh146M halfLR seed307 training started at 2026-10-23T04:36:27Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E96 main cached probe: skill0.384594982171353,relMASE0.737391433574142,relWQL0.513598773629635,CPU1.411123s; currentE87main0.383685556664058. Promising0.000909426 main improvement with fixed1/3 weights; assemble a separate candidate while the remaining earlier-cutoff predictions finish. No publication before full public-contract replay/checks. + +## E89 patch4_6000 backcast_evals +- Checkpoint SHA-256: `e50a2d43bb3b6b66a94a6a2d9d62f0cb3e404310352e0357cfe0f2a874a21727`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 57.45131206512451 seconds. +- Overall skill 0.336072; relative MASE 0.796655; relative WQL 0.553314. +- term skill: long=0.4016, medium=0.3589, short=0.2999. +- domain skill: Econ/Fin=0.1775, Energy=0.2230, Healthcare=0.4006, Nature=0.3706, Sales=0.4131, Transport=0.3680, Web/CloudOps=0.4502. +- frequency skill: A=0.3160, D=0.3472, H=0.3715, M=0.2107, Q=0.2381, S=0.3496, T=0.3318, W=0.2614. +- variates skill: multivariate=0.3526, univariate=0.3226. +- Outcome: All three earlier cutoffs trail selected E71patch8_6000, so no standalone replacement. The predeclared equal three-model ensemble gains on main/earlier1/earlier2 and nearly ties earlier3; assess exact package replay. + +## E89 patch4_6000 backcast2_evals +- Checkpoint SHA-256: `e50a2d43bb3b6b66a94a6a2d9d62f0cb3e404310352e0357cfe0f2a874a21727`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 50.43167591094971 seconds. +- Overall skill 0.360368; relative MASE 0.769660; relative WQL 0.531571. +- term skill: long=0.3665, medium=0.3905, short=0.3460. +- domain skill: Econ/Fin=0.1116, Energy=0.2401, Healthcare=0.3295, Nature=0.4708, Sales=0.5563, Transport=0.4201, Web/CloudOps=0.4365. +- frequency skill: A=0.2963, D=0.4200, H=0.3926, M=0.1575, Q=0.1533, S=0.2829, T=0.3608, W=0.2868. +- variates skill: multivariate=0.3615, univariate=0.3594. +- Outcome: All three earlier cutoffs trail selected E71patch8_6000, so no standalone replacement. The predeclared equal three-model ensemble gains on main/earlier1/earlier2 and nearly ties earlier3; assess exact package replay. + +## E89 patch4_6000 backcast3_evals +- Checkpoint SHA-256: `e50a2d43bb3b6b66a94a6a2d9d62f0cb3e404310352e0357cfe0f2a874a21727`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 55.502692461013794 seconds. +- Overall skill 0.383331; relative MASE 0.748104; relative WQL 0.508326. +- term skill: long=0.3963, medium=0.3680, short=0.3844. +- domain skill: Econ/Fin=0.1767, Energy=0.3066, Healthcare=0.2424, Nature=0.4983, Sales=0.3975, Transport=0.5047, Web/CloudOps=0.3929. +- frequency skill: A=0.3000, D=0.4228, H=0.4042, M=0.1613, Q=0.2599, S=0.3033, T=0.4260, W=0.2276. +- variates skill: multivariate=0.3668, univariate=0.3960. +- Outcome: All three earlier cutoffs trail selected E71patch8_6000, so no standalone replacement. The predeclared equal three-model ensemble gains on main/earlier1/earlier2 and nearly ties earlier3; assess exact package replay. + +## E92 robust_3000 backcast_evals +- Checkpoint SHA-256: `348934d9fbcc8f2a8c45f7ebdc6cd971678d190bcf6ec0c0bd1cf80a12334bbc`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 26.711654901504517 seconds. +- Overall skill 0.335781; relative MASE 0.797334; relative WQL 0.553328. +- term skill: long=0.3997, medium=0.3581, short=0.3006. +- domain skill: Econ/Fin=0.1550, Energy=0.2286, Healthcare=0.4082, Nature=0.3646, Sales=0.3970, Transport=0.3731, Web/CloudOps=0.4489. +- frequency skill: A=0.3150, D=0.3499, H=0.3669, M=0.1858, Q=0.2309, S=0.3411, T=0.3343, W=0.2844. +- variates skill: multivariate=0.3520, univariate=0.3226. +- Outcome: Earlier cutoff is below matched E80overflow-only3000. The main gain does not repeat temporally; continue the declared6k/12k training but do not select or transfer this3k checkpoint. + +## E92 robust_3000 backcast2_evals +- Checkpoint SHA-256: `348934d9fbcc8f2a8c45f7ebdc6cd971678d190bcf6ec0c0bd1cf80a12334bbc`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 25.730652570724487 seconds. +- Overall skill 0.358075; relative MASE 0.771535; relative WQL 0.534088. +- term skill: long=0.3627, medium=0.3886, short=0.3441. +- domain skill: Econ/Fin=0.1063, Energy=0.2373, Healthcare=0.3471, Nature=0.4675, Sales=0.5490, Transport=0.4200, Web/CloudOps=0.4314. +- frequency skill: A=0.3543, D=0.4241, H=0.3906, M=0.1525, Q=0.1489, S=0.2804, T=0.3600, W=0.2550. +- variates skill: multivariate=0.3640, univariate=0.3532. +- Outcome: Earlier cutoff is below matched E80overflow-only3000. The main gain does not repeat temporally; continue the declared6k/12k training but do not select or transfer this3k checkpoint. + +## E92 robust_3000 backcast3_evals +- Checkpoint SHA-256: `348934d9fbcc8f2a8c45f7ebdc6cd971678d190bcf6ec0c0bd1cf80a12334bbc`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 25.396876335144043 seconds. +- Overall skill 0.387946; relative MASE 0.738909; relative WQL 0.506977. +- term skill: long=0.3950, medium=0.3615, short=0.3950. +- domain skill: Econ/Fin=0.1698, Energy=0.3214, Healthcare=0.2587, Nature=0.5024, Sales=0.3958, Transport=0.5033, Web/CloudOps=0.3888. +- frequency skill: A=0.3650, D=0.4381, H=0.4044, M=0.1203, Q=0.2538, S=0.2862, T=0.4293, W=0.2622. +- variates skill: multivariate=0.3739, univariate=0.3988. +- Outcome: Earlier cutoff is below matched E80overflow-only3000. The main gain does not repeat temporally; continue the declared6k/12k training but do not select or transfer this3k checkpoint. + +### E96 four-cutoff equal ensemble selection +{ + "valid_screen": { + "candidate": 0.384594982171353, + "E87": 0.38368555666405846, + "cpu_seconds": 1.4111226599197835, + "groups": { + "term": { + "short": 0.3668858469093572, + "medium": 0.4077230710992221, + "long": 0.40635338876251526 + }, + "domain": { + "Econ/Fin": 0.14395536397825648, + "Energy": 0.24582427470581425, + "Healthcare": 0.4767476122577817, + "Nature": 0.44212246483547213, + "Sales": 0.34646504369353526, + "Transport": 0.46693421316839256, + "Web/CloudOps": 0.5034023313828211 + }, + "freq": { + "A-DEC": 0.37656040036707195, + "Q-DEC": 0.20077338922637145, + "M": 0.1185115893357509, + "W-SUN": 0.10525031522270123, + "D": 0.36189985298754856, + "H": 0.40144834519193306, + "15T": 0.21610876368843102, + "W-FRI": 0.015068318308339101, + "10T": 0.6264434570332911, + "W-TUE": 0.6245141515082602, + "W-THU": 0.20878118292775294, + "W-WED": 0.32985721333447826, + "5T": 0.5176096384720621, + "10S": 0.4242433666861485 + } + } + }, + "valid_backcast": { + "candidate": 0.33975008510701665, + "E87": 0.33897078175106665, + "cpu_seconds": 1.2138579529710114, + "groups": { + "term": { + "short": 0.30570414138317814, + "medium": 0.3609015682591047, + "long": 0.4020582836765434 + }, + "domain": { + "Econ/Fin": 0.1743856017696448, + "Energy": 0.23046498734519416, + "Healthcare": 0.4113970603320174, + "Nature": 0.3716618234366038, + "Sales": 0.408030987603086, + "Transport": 0.3731794302285525, + "Web/CloudOps": 0.451509629697311 + }, + "freq": { + "A-DEC": 0.3279717662601809, + "Q-DEC": 0.2380599535136222, + "M": 0.19905386528004188, + "W-SUN": 0.04880471728272662, + "D": 0.35315023295661196, + "H": 0.3711978117933119, + "15T": 0.22358807419379623, + "W-FRI": 0.22824822674434042, + "10T": 0.322600023714811, + "W-TUE": 0.547413555209586, + "W-THU": 0.24438059706818105, + "W-WED": 0.3628856336883284, + "5T": 0.4412301876136191, + "10S": 0.3475276102698931 + } + } + }, + "valid_backcast2": { + "candidate": 0.36472017597795625, + "E87": 0.36315845377936284, + "cpu_seconds": 1.3266870640218258, + "groups": { + "term": { + "short": 0.35192307261410094, + "medium": 0.39289736169887557, + "long": 0.36886086281920194 + }, + "domain": { + "Econ/Fin": 0.11936723839740782, + "Energy": 0.24270008941522314, + "Healthcare": 0.34837441457268725, + "Nature": 0.4771559710187644, + "Sales": 0.556902251507494, + "Transport": 0.4248139750422676, + "Web/CloudOps": 0.43759149119826346 + }, + "freq": { + "A-DEC": 0.3311026308933668, + "Q-DEC": 0.15378540101465998, + "M": 0.16020062601089513, + "W-SUN": 0.06801117727416384, + "D": 0.4305843857907744, + "H": 0.3953546731641614, + "15T": 0.10577250483830014, + "W-FRI": 0.15138877778445536, + "10T": 0.5095975609862264, + "W-TUE": 0.10847360375070303, + "W-THU": 0.3459885667095576, + "W-WED": 0.5660655173116367, + "5T": 0.4731902812063754, + "10S": 0.28592028110498247 + } + } + }, + "valid_backcast3": { + "candidate": 0.389238119545644, + "E87": 0.3893067316884232, + "cpu_seconds": 1.2415199128445238, + "groups": { + "term": { + "short": 0.39417395687284207, + "medium": 0.36821605147108216, + "long": 0.396861173789945 + }, + "domain": { + "Econ/Fin": 0.18370373648624572, + "Energy": 0.31629238352886546, + "Healthcare": 0.2377535675450031, + "Nature": 0.5072143926034133, + "Sales": 0.40117499834543047, + "Transport": 0.5090476109622039, + "Web/CloudOps": 0.39339169169310506 + }, + "freq": { + "A-DEC": 0.3399962169002898, + "Q-DEC": 0.25825750036173534, + "M": 0.14131510737146213, + "W-SUN": 0.1672885644844745, + "D": 0.4408980632536098, + "H": 0.4067494659465881, + "15T": 0.2551059021117046, + "W-FRI": 0.016583036267497464, + "10T": 0.6063638743127748, + "W-TUE": 0.2532467022883038, + "W-THU": 0.3464821396686204, + "W-WED": 0.3777825141129817, + "5T": 0.46382868467749705, + "10S": 0.29461185618122454 + } + } + } +} +Three gains and effectively tied third cutoff justify full public-interface replay. Candidate descriptor1503d92ce031ec0c0e0533ece20d0516a0eceb134802d51746e24a44c4b5ee9b,110064120parameters. Every member retains its exact model code; shared postprocessing hashes checked during assembly. E87 remains published pending complete replay and checks. + +Fresh37M state preservation: wait for its complete recovery024000 state and archive model/EMA/Adam/allRNG/prefetchedbatch to random_capacity_512_recovery024000.pt. This is a zero-update checkpoint snapshot, not a new experiment or a changed active schedule. It preserves the option of a later controlled annealing comparison without repeating pretraining. No continuation is queued. + +Data preparation extension, no training scheduled: create packed_stratified_large with192Mpoint/source softcaps using the identical E95all-shard code/min16/maxcrop131072 and directory/per-series RNGs. Because global series order and crops are cap-independent, the24Mpack should be an exact per-source binary/record prefix of the192Mpack. Check that invariant before any future data-scaling experiment. This artifact is separate from E95training, which remains queued on the24Mpack. No new source directories/generators or validation data. Two CPUworkers; GPUtraining schedules unchanged. + +## E79 fresh146M at8000 +- Checkpoint SHA-256: `12ad3e4b1be6b38b31a3dee057805e2a532f48fe3723f6bcefb15ba63ca8ee97`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 39.91020727157593 seconds. +- Overall skill 0.343979; relative MASE 0.773251; relative WQL 0.556563. +- term skill: long=0.3755, medium=0.3854, short=0.3146. +- domain skill: Econ/Fin=0.1160, Energy=0.1969, Healthcare=0.3682, Nature=0.4144, Sales=0.3129, Transport=0.4343, Web/CloudOps=0.4719. +- frequency skill: A=0.3662, D=0.3440, H=0.3640, M=-0.0514, Q=0.1891, S=0.4174, T=0.3968, W=0.1930. +- variates skill: multivariate=0.3619, univariate=0.3293. +- Outcome: Main0.343979357 improves4000 0.328133919; still below matched37M8000 0.353508836, with a narrowing gap. Continue declared16k/24k; seed307/B48/LR2e-4/96k. E94halfLR is a separate matched optimization arm. + +## E79 fresh37M at16000 +- Checkpoint SHA-256: `a83c2bee0b284ab22ebb5107d79e2ff2ecd29a7de9a384d46d175dbffcf2c5b4`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 29.48415732383728 seconds. +- Overall skill 0.355318; relative MASE 0.763624; relative WQL 0.544266. +- term skill: long=0.3802, medium=0.3960, short=0.3290. +- domain skill: Econ/Fin=0.1292, Energy=0.2122, Healthcare=0.3475, Nature=0.4103, Sales=0.3304, Transport=0.4455, Web/CloudOps=0.4937. +- frequency skill: A=0.3719, D=0.3210, H=0.3755, M=0.0179, Q=0.1815, S=0.4231, T=0.4098, W=0.2504. +- variates skill: multivariate=0.3787, univariate=0.3361. +- Outcome: Main0.355318072 improves8000 0.353508836 only modestly. Continue original96k schedule unchanged and preserve complete24kstate for a possible later annealing comparison. Seed307/B48/LR2e-4, own scratch initialization. + +## E90 daily-weekly loss scale at6000 +- Checkpoint SHA-256: `d6b3d3e30290a9360789d236565ecb0acf410d4605bb50821f30b7886ed2d349`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.801913261413574 seconds. +- Overall skill 0.378435; relative MASE 0.743624; relative WQL 0.519542. +- term skill: long=0.4018, medium=0.4074, short=0.3577. +- domain skill: Econ/Fin=0.1254, Energy=0.2397, Healthcare=0.4663, Nature=0.4297, Sales=0.3355, Transport=0.4644, Web/CloudOps=0.5032. +- frequency skill: A=0.3677, D=0.3561, H=0.3960, M=0.0989, Q=0.1934, S=0.4243, T=0.4382, W=0.2295. +- variates skill: multivariate=0.3971, univariate=0.3632. +- Outcome: Main0.378434765 slightly exceeds matched E806000 0.378288765, reversing its small3k deficit. Effect is inconsistent and small; finish12k, then assess targeted frequency groups. Seed197/B64/LR2e-5. + +## E89 patch8 control final12000 +- Checkpoint SHA-256: `80519b37e670050b23c231718210bf49aaa64b5396e301a44975140d8075a85a`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 35.017725229263306 seconds. +- Overall skill 0.380847; relative MASE 0.742398; relative WQL 0.516367. +- term skill: long=0.4032, medium=0.4046, short=0.3626. +- domain skill: Econ/Fin=0.1449, Energy=0.2438, Healthcare=0.4363, Nature=0.4433, Sales=0.3387, Transport=0.4634, Web/CloudOps=0.5028. +- frequency skill: A=0.3691, D=0.3616, H=0.3940, M=0.0837, Q=0.1978, S=0.4249, T=0.4461, W=0.2290. +- variates skill: multivariate=0.3988, univariate=0.3662. +- Outcome: Final0.380847096 rebounds from6000 0.377734884 as the learning rate falls; still below initial selected E71parent0.381178739. Preserve as the final matched reference for fullpatch4 and input8/output4, which are still training. Seed401/B32/LR2e-5; do not infer final architectural superiority from the6k comparison alone. Released allocation to E94fresh146M halfLR. + +## Larger all-shard data preparation, no optimizer updates +Same fixed global-series order and crop rules as E95, raising only the per-directory cap from24M to192M points. Packed5,354,822,975points in1,059,868series across95allowed directories;125.173232s with2CPU workers. Independent260series Arrow replay plus binary/record-prefix checks for all95directories passed in19.984999s, seed461; source probabilities bitwise match the original source mixture. The24M pack is exactly a prefix within every source. Audit stratified_large_audit.json; no validation read and no training on this larger pack scheduled yet. + +E89patch8control final12000 training loop2729.052105s on shared singleH100; validation/hash/group results recorded above. No continuation of completed control. + +## E92 robust normalization at6000 +- Checkpoint SHA-256: `3c76ff01356bdf0de6219a0937fe43c25175caef19d4324b4e73c39310659fce`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.452584981918335 seconds. +- Overall skill 0.377780; relative MASE 0.743560; relative WQL 0.520681. +- term skill: long=0.4010, medium=0.4074, short=0.3568. +- domain skill: Econ/Fin=0.1250, Energy=0.2380, Healthcare=0.4626, Nature=0.4291, Sales=0.3516, Transport=0.4654, Web/CloudOps=0.5006. +- frequency skill: A=0.3659, D=0.3537, H=0.3957, M=0.1211, Q=0.1920, S=0.4237, T=0.4359, W=0.2278. +- variates skill: multivariate=0.3949, univariate=0.3638. +- Outcome: Main0.377780381 is below matched overflow-only E80at6000 0.378288765; earlier3k already regressed at all three cutoffs. Continue the predeclared final12k but no6k selection or composition. Seed197/B64/LR2e-5; normalization is the only changed factor. + +## E96 three-patch equal ensemble full public replay — selected +- Checkpoint SHA-256: `1503d92ce031ec0c0e0533ece20d0516a0eceb134802d51746e24a44c4b5ee9b`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.380721; relative MASE 0.740204; relative WQL 0.518109. +- term skill: long=0.4003, medium=0.4066, short=0.3628. +- domain skill: Econ/Fin=0.1244, Energy=0.2393, Healthcare=0.4812, Nature=0.4421, Sales=0.3603, Transport=0.4671, Web/CloudOps=0.4951. +- frequency skill: A=0.2988, D=0.3660, H=0.3960, M=0.1437, Q=0.1866, S=0.4242, T=0.4364, W=0.2370. +- variates skill: multivariate=0.3947, univariate=0.3694. +- Outcome: Full validation skill0.380721445 improves E87by0.001091552; relativeMASE0.740203875 andrelativeWQL0.518108512 both improve. All97configs/151170instances,0failures,441.765573 inference seconds on shared singleH100. Every member forecasts every instance, equal1/3 weights fixed before replay; no extra training. Relocation bitwise/finite/ordered checks passed in33.315708s; independent third-member public replay10.848689s and bitwise three-member composition0.027575CPU s passed. Three of four selection cutoffs improve; third earlier loss0.0000686. Full55/97configs improve; descriptive dataset-bootstrap interval spans zero, so the small adaptive-validation gain is not a held-out significance claim. Publish the strongest complete replayable candidate; continue research. + +## E97 explicit weekly synthetic coverage — preparation +Hypothesis: the existing20% synthetic mixture omits[52,1]weekly seasonality, contributing to weak weekly transfer. Replace exactly a Bernoulli1/11 share of synthetic windows with the same own Fourier/trend/AR/intermittency/changepoint generator atperiods[52,1]. The total synthetic fraction remains20%; all ten original period families retain expected weight1/11 and the new weekly family gains1/11. Always consume the original generator first; independent RNGseed1000200 chooses/re-generates weekly windows, preserving every real row and non-replaced synthetic row and the original sampler/horizon streams bitwise. No other history/target-length change. Match E80overflow-only: ownE62 initialization,seed197/B64/LR2e-5/12000paired steps,original packed_sample/source probabilities/model/loss/runtime. Screen1/3/6/12k; require sampler stream/recovery checks before queueing after E92 completes. No validation used for generation or optimization; declare the new local generator if published. + +E97sampler check: {"seed": 467, "rows": 7680, "original_synthetic_rows": 1543, "replaced_weekly_rows": 134, "probability": 0.09090909090909091, "original_and_horizon_rng_bitwise_preserved": true, "unmodified_rows_bitwise_preserved": true, "finite_masks_unchanged": true, "all_numpy_rng_recovery_exact": true, "model_sha256": "44eeb23c037e91b8f67e432615ce46540a7ac4242919785f9c4218de23121499", "model_bitwise_unchanged": true, "seconds": 3.6882259079720825, "optimizer_updates": 0, "validation_data_read": false} +Queue declared after E92PID9354, requiring its final recovery. Existing model code is byte-identical to E80, so no new GPU arithmetic fixture is needed for this data-only change. Full command is weekly_synth_queue.json; launcher weekly_synth/launch.py. + +## E93 input8/output4 at6000 +- Checkpoint SHA-256: `8afbf4d2008aa7d5dab4ecbdcd1685f1a59b8fcb739a39f65fa8ba4b8cb4be9d`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 36.958359479904175 seconds. +- Overall skill 0.380224; relative MASE 0.742564; relative WQL 0.517292. +- term skill: long=0.4044, medium=0.4022, short=0.3620. +- domain skill: Econ/Fin=0.1461, Energy=0.2357, Healthcare=0.4662, Nature=0.4406, Sales=0.3432, Transport=0.4673, Web/CloudOps=0.5003. +- frequency skill: A=0.3656, D=0.3580, H=0.3941, M=0.1089, Q=0.2009, S=0.4225, T=0.4400, W=0.2482. +- variates skill: multivariate=0.3938, univariate=0.3692. +- Outcome: Main0.380224037 is between matched fullpatch4at6000 0.380540506 and patch8control0.377734884, below selected starting E71parent0.381178739. The decoder-only refinement recovers most of the full-resolution gain at lower encoder cost; continue final12k before any ensemble replacement. Seed401/B32/LR2e-5, same original generator. + +## E98 completion of deliberately pruned E75 schedule — declared revisit +E75 was intentionally stopped at3653 after earlier-cutoff regressions; that decision and its stopfile remain intact. E89patch8control subsequently recovered from0.377734884 at6k to0.380847096 at12k as learning rate decayed, showing that an intermediate trough can conceal a late recovery. Revisit the incomplete E75 schedule under a separate output, postloss_completion, by preserving and restoring its exact3653 model/EMA/Adam/allRNG/prefetched state. Continue original steps3654..12000 with the unchanged12k cosine schedule,seed197/B64/LR2e-5,original data/generator and postprocessing-aware objective. No new recipe factor and no reset; this is a completion of a previously pruned experiment, not an independent replication. Model/data/torch_post code byte-match the original archived provenance. Compare6k/12k against E80overflow-only, and examine earlier cutoffs before any composition. Queue only after E93 releases its allocation; retain original postloss.stop and all negative results. + +E98exact restart snapshot: {"source": "/workspace/research/runs/postloss/recovery.pt", "output": "/workspace/research/postloss_recovery003653.pt", "step": 3653, "sha256": "7d81547596356906fbac3a9aa3d47f84c27eabf845ba26e2c3c74ec369923c01", "seconds": 1.7649966378230602, "preserves": "model, EMA, optimizer, all RNG states and prefetched batch", "optimizer_updates": 0} +Queued after E93PID9274; launcher postloss/launch_completion.py, completecommand postloss_completion_queue.json. No GPU fixture repeated because model/loss/data code is identical to already verified E75, and no new optimizer update occurred during preparation. + +## E79 fresh37M at24000 +- Checkpoint SHA-256: `fbdb51213b3cf165273c4ea83c2386ec0bd496b182e31d57f421eee29c0da28a`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 29.551169872283936 seconds. +- Overall skill 0.357902; relative MASE 0.763517; relative WQL 0.539988. +- term skill: long=0.3831, medium=0.3912, short=0.3346. +- domain skill: Econ/Fin=0.1259, Energy=0.2164, Healthcare=0.3681, Nature=0.4073, Sales=0.3362, Transport=0.4526, Web/CloudOps=0.4919. +- frequency skill: A=0.3818, D=0.3384, H=0.3762, M=0.0189, Q=0.1970, S=0.4195, T=0.4130, W=0.2313. +- variates skill: multivariate=0.3766, univariate=0.3426. +- Outcome: Main0.357901602 improves16k0.355318072 but still trails the mature scratch lineage. Continue original96k schedule unchanged. Exact24k model/EMA/Adam/allRNG/prefetch snapshot preserved for a separately declared cooldown comparison; no continuation launched yet. Seed307/B48/LR2e-4/static compiled paired loss/slowAR original source mixture. + +E79small immutable24k snapshot: {"source": "/workspace/research/runs/random_capacity_512/recovery.pt", "output": "/workspace/research/random_capacity_512_recovery024000.pt", "step": 24000, "sha256": "32de72f3d09f8eee785c1d19a279541348de7ba129f79d62e5824e1223e19322", "seconds": 2.042371174087748, "preserves": "model, EMA, optimizer, all RNG states and prefetched batch", "optimizer_updates": 0} + +## E99 matched early cooldown of fresh37M model — declared +Hypothesis: E79fresh37M is held back by the still-high96k-schedule learning rate, rather than only a lack of capacity. Branch from the exact immutable24000 training state (SHA32de72f3d09f8eee785c1d19a279541348de7ba129f79d62e5824e1223e19322), preserving model/EMA/Adam/allRNG/prefetched batch. Change only the next12000-step learning-rate schedule: smoothly cosine-decay from the original step24000 rate0.00017656854249492381 to0.00001 at36000, with no optimizer reset or rewarmup. Original E79continues its96k schedule unchanged. Same seed307/B48/static compiled paired objective/slowAR generator/original pack and source probabilities. Compare candidate and original at global30000/36000; earlier windows only for a promising candidate. Queue after E89fullpatch4 releases its allocation. Default schedule arithmetic was verified bitwise at140000steps across three existing recipes; cooldown joins exactly and decreases monotonically. No GPU arithmetic or model change; reuse existing compiled/eager-gradient fixtures. +E99schedule checks: {"default_steps_bitwise_equal": 140000, "join_step": 24000, "join_lr": 0.00017656854249492381, "end_step": 36000, "end_lr": 1e-05, "schedule": "cosine from original step24000 rate to1e-5 by36000, no warmup/reset", "optimizer_updates": 0, "validation_data_read": false, "seconds": 0.14022667310200632} + +## E94 fresh146M halfLR first4000 +- Checkpoint SHA-256: `62c59ba50647d301fd5afd846b25c03271fe35b7d97fe63f5b2f7b931957090b`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 41.465235233306885 seconds. +- Overall skill 0.336895; relative MASE 0.784082; relative WQL 0.560794. +- term skill: long=0.3621, medium=0.3772, short=0.3107. +- domain skill: Econ/Fin=0.1179, Energy=0.2132, Healthcare=0.2861, Nature=0.4034, Sales=0.2941, Transport=0.4230, Web/CloudOps=0.4607. +- frequency skill: A=0.3563, D=0.3278, H=0.3600, M=-0.0301, Q=0.1751, S=0.4173, T=0.3872, W=0.1853. +- variates skill: multivariate=0.3571, univariate=0.3204. +- Outcome: Lower LR1e-4 improves matched146M4k main0.328133919 to0.336895196, still below37Mcontrol0.341861940. All three terms improve over high-LR146M; large capacity is not yet better than the smaller model. Afterwarmup its matched training loss beats high-LR146M consistently and slightly beats37M by steps2001..4000. Continue8k/16k before selecting a larger-corpus fresh recipe. Same initial weights/seed307/B48/data/objective; only learning rate changed. + +E79/E94matched first4k loss/compute: {"random_capacity_512": {"1-400": 0.4342267720028758, "401-1000": 0.3975941499322653, "1001-2000": 0.381371116399765, "2001-3000": 0.37428912545740606, "3001-4000": 0.3616653003469109, "through4000_loop_seconds": 1106.1}, "random_capacity_1024": {"1-400": 0.4301105997338891, "401-1000": 0.40223139939208824, "1001-2000": 0.3863489354848862, "2001-3000": 0.3779264837577939, "3001-4000": 0.36658306304365396, "through4000_loop_seconds": 1563.7}, "random_capacity_1024_halflr": {"1-400": 0.4339301012828946, "401-1000": 0.39748335411151253, "1001-2000": 0.3812341860383749, "2001-3000": 0.3728542738109827, "3001-4000": 0.36091782905161385, "through4000_loop_seconds": 1064.5}}. Shared-H100 process times include differing compiler-cache warm-up and are not exclusiveGPU efficiency measurements. + +E95 all-shard corpus seed197 training started at 2026-10-23T04:58:12Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E90 daily-weekly loss scale final12000 +- Checkpoint SHA-256: `4c5641b649529f9ac36c8679289c64bacf0b30e11dae8428620a0d59e56ffabc`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 24.18997550010681 seconds. +- Overall skill 0.377373; relative MASE 0.744776; relative WQL 0.520511. +- term skill: long=0.4024, medium=0.4060, short=0.3561. +- domain skill: Econ/Fin=0.1328, Energy=0.2359, Healthcare=0.4455, Nature=0.4306, Sales=0.3355, Transport=0.4657, Web/CloudOps=0.5050. +- frequency skill: A=0.3617, D=0.3526, H=0.3946, M=0.1059, Q=0.1975, S=0.4251, T=0.4399, W=0.2154. +- variates skill: multivariate=0.3960, univariate=0.3621. +- Outcome: Final main0.377373344 is effectively tied but slightly below matched E80overflow-only0.377423946. The isolated seasonal-loss-lag change has no sustained overall gain across1k/3k/6k/12k. Seed197/B64/LR2e-5; completed2702.166704 shared-H100 training-loop seconds. No candidate publication; E95broader-source-coverage starts in the released allocation. + +## E100 equal probability-distribution pool — predeclared cached comparison +Hypothesis: E96quantile averaging omits dispersion due to disagreement among its three members. Keep exactly the E83/E71/E89fixed models and equalweights, but average their CDFs and invert for the nine deciles. Each member distribution is piecewise-linear through its predicted deciles, extended to probabilities0/1 by one adjacent endpoint spacing; repeated quantiles retain atoms. Evaluate all four cached cutoffs, with no coefficient/tail-setting sweep and zero optimizer updates. Every member still forecasts every instance. Initial local fixture found only5.55e-17roundoff around exactzero; enforcing the mathematical bound between member quantiles at each level corrected it before any validation read. Identical-member, uniform-mixture, sign/affine, finite/ordered and chunk-size checks passed: {"seed": 479, "identical_members_bitwise_identity": true, "uniform_mixture_exact_within_float32": true, "atoms_at_zero_preserved": true, "ordered_finite": true, "chunk_size_bitwise_independent": true, "sign_reflection_and_affine_equivariance": true, "optimizer_updates": 0, "seconds": 0.09868191904388368} + +## E95 all-shard source coverage first1000 +- Checkpoint SHA-256: `17b2a03d282c141dbd68ac7f68df4626802f1a0323fff313f1a28192c5068b5b`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.06695008277893 seconds. +- Overall skill 0.377028; relative MASE 0.744820; relative WQL 0.521057. +- term skill: long=0.3997, medium=0.4068, short=0.3562. +- domain skill: Econ/Fin=0.1378, Energy=0.2376, Healthcare=0.4487, Nature=0.4311, Sales=0.3344, Transport=0.4669, Web/CloudOps=0.4993. +- frequency skill: A=0.3724, D=0.3543, H=0.3951, M=0.1080, Q=0.1986, S=0.4218, T=0.4370, W=0.2193. +- variates skill: multivariate=0.3940, univariate=0.3632. +- Outcome: Main0.377028371 exceeds matched E80at1000 0.376804394 by0.000223977. Medium/long improve while short is nearly unchanged; still below E62initialization0.377343216, so no selection claim yet. Continue3k/6k/12k. Seed197/B64/LR2e-5; pack coverage changes at nearly identical volume, same original source probabilities/model/loss/generator. + +E97 weekly synthetic coverage seed197 training started at 2026-10-23T05:06:47Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +### E100 probability-pool outcome — rejected +{"cutoff": "valid_screen", "skill_score": 0.38447708223972143, "rel_mase_gmean": 0.7377458188534619, "rel_wql_gmean": 0.5135487760227904, "groups": {"term": {"short": 0.36645074748329265, "medium": 0.40785519113120783, "long": 0.4067636672388967}, "domain": {"Econ/Fin": 0.14348007471775803, "Energy": 0.2450499585597603, "Healthcare": 0.4778661939355727, "Nature": 0.44167938695480613, "Sales": 0.34589247896287667, "Transport": 0.46735333815132574, "Web/CloudOps": 0.5036629603237621}, "freq": {"A-DEC": 0.37569899250005157, "Q-DEC": 0.20013922343000312, "M": 0.12148678908575261, "W-SUN": 0.10281895779812733, "D": 0.3613770705448509, "H": 0.40132102430667216, "15T": 0.21622161251725824, "W-FRI": 0.010849753325401168, "10T": 0.6253364743600922, "W-TUE": 0.6270406616896087, "W-THU": 0.2100424900094875, "W-WED": 0.3297769734384489, "5T": 0.5175830091172531, "10S": 0.424444633099896}}, "cpu_seconds": 59.980443592881784, "member_checkpoint_hashes": ["0ae7875b49b99a44c295dc2b8243327aeacadc25b2354988abb2c37250359a49", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "e50a2d43bb3b6b66a94a6a2d9d62f0cb3e404310352e0357cfe0f2a874a21727"], "quantile_mean_skill": 0.384594982171353, "skill_difference": -0.00011789993163158208} +{"cutoff": "valid_backcast", "skill_score": 0.3396884750452879, "rel_mase_gmean": 0.7937686109009007, "rel_wql_gmean": 0.5492927082278539, "groups": {"term": {"short": 0.305359424616949, "medium": 0.3615421761351466, "long": 0.4019782542502155}, "domain": {"Econ/Fin": 0.17397857577775933, "Energy": 0.23077587806776068, "Healthcare": 0.4105170158829923, "Nature": 0.37090555838048966, "Sales": 0.40754241032517846, "Transport": 0.3735854351257373, "Web/CloudOps": 0.4515115490492597}, "freq": {"A-DEC": 0.3285015352119629, "Q-DEC": 0.23809442338781928, "M": 0.19846718923537676, "W-SUN": 0.044551228029835244, "D": 0.3527581961201992, "H": 0.37195542467805676, "15T": 0.22380832764902536, "W-FRI": 0.22713834170412128, "10T": 0.3209843494303689, "W-TUE": 0.5471337430335201, "W-THU": 0.24671528715780322, "W-WED": 0.36065042452889085, "5T": 0.440176624512733, "10S": 0.34765351732372307}}, "cpu_seconds": 57.84474289207719, "member_checkpoint_hashes": ["0ae7875b49b99a44c295dc2b8243327aeacadc25b2354988abb2c37250359a49", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "e50a2d43bb3b6b66a94a6a2d9d62f0cb3e404310352e0357cfe0f2a874a21727"], "quantile_mean_skill": 0.33975008510701665, "skill_difference": -6.161006172877848e-05} +{"cutoff": "valid_backcast2", "skill_score": 0.3643569364713283, "rel_mase_gmean": 0.7656814703595871, "rel_wql_gmean": 0.5276895417390272, "groups": {"term": {"short": 0.35141014761082046, "medium": 0.3925477275360366, "long": 0.36889675295988844}, "domain": {"Econ/Fin": 0.11837724372992486, "Energy": 0.24257682706622608, "Healthcare": 0.3484957338430069, "Nature": 0.4765403493474547, "Sales": 0.5563991023520016, "Transport": 0.425156500116473, "Web/CloudOps": 0.43670286593915697}, "freq": {"A-DEC": 0.32966975290636025, "Q-DEC": 0.15381819951222442, "M": 0.15901923467685497, "W-SUN": 0.06330956349285344, "D": 0.43027727492156853, "H": 0.39548623856812215, "15T": 0.10618336189249866, "W-FRI": 0.14996401232455647, "10T": 0.5090292906528928, "W-TUE": 0.11021265661815505, "W-THU": 0.34484214889524656, "W-WED": 0.565895835912684, "5T": 0.47197167812560914, "10S": 0.2855930392816969}}, "cpu_seconds": 55.48255044897087, "member_checkpoint_hashes": ["0ae7875b49b99a44c295dc2b8243327aeacadc25b2354988abb2c37250359a49", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "e50a2d43bb3b6b66a94a6a2d9d62f0cb3e404310352e0357cfe0f2a874a21727"], "quantile_mean_skill": 0.36472017597795625, "skill_difference": -0.000363239506627977} +{"cutoff": "valid_backcast3", "skill_score": 0.3894908456851319, "rel_mase_gmean": 0.7395191359520792, "rel_wql_gmean": 0.5040051154624993, "groups": {"term": {"short": 0.3944986218711739, "medium": 0.3683905810196345, "long": 0.3969887061132117}, "domain": {"Econ/Fin": 0.18408496490995196, "Energy": 0.3168114104271367, "Healthcare": 0.23983131130227353, "Nature": 0.5064220935312094, "Sales": 0.40140535360155616, "Transport": 0.5096985006120188, "Web/CloudOps": 0.393462743970424}, "freq": {"A-DEC": 0.34218212975771833, "Q-DEC": 0.25834447555512075, "M": 0.14460929216407215, "W-SUN": 0.16537651572223833, "D": 0.4408650435087358, "H": 0.40698403946159434, "15T": 0.25514902945862916, "W-FRI": 0.019067740904430974, "10T": 0.6070205489033722, "W-TUE": 0.25089200168813297, "W-THU": 0.3450365084609506, "W-WED": 0.378097845878244, "5T": 0.46374932773306954, "10S": 0.2954018250276097}}, "cpu_seconds": 54.93674235115759, "member_checkpoint_hashes": ["0ae7875b49b99a44c295dc2b8243327aeacadc25b2354988abb2c37250359a49", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "e50a2d43bb3b6b66a94a6a2d9d62f0cb3e404310352e0357cfe0f2a874a21727"], "quantile_mean_skill": 0.389238119545644, "skill_difference": 0.0002527261394879021} +Probability pooling loses main and the first two earlier cutoffs, improving only the third. Retain E96 equal quantile averaging; no full replay or runtime publication. Zero optimizer updates; full CPU comparison time228.244479s, local fixture seed479. + +## E101 own-ensemble distillation — prepared, not queued + + +Prepared design, not yet queued. Complete the listed checks and record the exact experiment before launch. No external models, weights or data. + +Hypothesis: the larger fresh model can learn useful conditional forecasts faster when its proper real-target objective is supplemented by dense quantile targets from our own mature scratch-trained ensemble. This differs from the failed direct width conversions and protected random feature grafts: all student parameters begin at the same random initialization as E94. + +Match E94 exactly: own random_capacity_1024_initial.pt, seed307, batch48 distinct windows/96 signed rows, learning rate1e-4,96000-step schedule,400warmup, compiled paired-sign loss, original packed_sample/source probabilities,20% own slow-AR synthetic generator, original requested-horizon stream. Only the additional teacher loss changes. E94 remains the real-target-only control. + +Teacher: frozen E96 three members, descriptor1503d92ce031ec0c0e0533ece20d0516a0eceb134802d51746e24a44c4b5ee9b. Use each member's sign-averaged normalized neural quantiles BEFORE fixed postprocessing, then equal averaging. All members share the same ordinary-row normalization at training shapes (contexts are multiples of512); verify that. Pass the same per-row available forecast lengths to each member's partial-target mask. Mask teacher loss on rows with any nonfinite member normalization/output; retain the original real-target objective on those rows. The student loss and runtime remain the original E94 neural objective and fixed inference rules, so there is no simultaneous postprocessing-aware-loss change. + +Add coefficient0.5 times a teacher L1 objective: per valid target step,0.5*mean(abs(student_quantiles-teacher_quantiles)) +0.25*abs(student_median-teacher_median); average over the same valid target positions and apply the same context seasonal-error weight, normalized over teacher-valid rows. No coefficient sweep. The real-target objective is unchanged and retains weight1. Teacher targets are constants, with no gradients or updates to teacher weights. All teacher windows come only from the allowed sampler; no validation inputs or labels enter training. + +Compute teacher targets outside the compiled student objective. Student model state/config must retain exactly E94 keys and parameter count; teacher modules must not be registered on the student or enter its optimizer/EMA/checkpoints. Record teacher descriptor and all three checkpoint hashes in training args/lineage, and automatically declare own-teacher pseudo-target generation in sources_used on publication. Archive teacher code and generation code in provenance; deployed inference loads only the student. + +Required checks: zero teacher coefficient reproduces original loss/gradients on identical own-generated fixtures; teacher sign averaging/normalization matches independent raw-member forward passes; teacher parameters remain unchanged and have no gradients; student gradients finite; complete sampler/RNG recovery unchanged; eager/compiled gradient comparison; maximum-shape memory including student EMA/Adam and teacher weights. Initial fixture has zero optimizer updates. Runtime is unchanged random_capacity_inference. + +Potential allocation: queue only after both E99cooldown and E97weekly training finish, using their queue processes/checkpoint dependencies rather than unknown future trainer PIDs. Their released combined memory is sufficient for146M student plus frozen teacher. Watch4/8/16/24k before deciding longer allocation. Do not launch until code, checks, exact recipe declaration and source-lineage handling are complete. + +CPUfixture: {"seed": 487, "seconds": 5.1773834731429815, "teacher_descriptor_sha256": "1503d92ce031ec0c0e0533ece20d0516a0eceb134802d51746e24a44c4b5ee9b", "teacher_parameters": 110064120, "teacher_weights_frozen_bitwise": true, "teacher_gradients_absent": true, "independent_raw_member_average_bitwise": true, "ordinary_normalization_bitwise_same": true, "overflow_teacher_row_excluded_only_from_auxiliary": true, "sign_reflection_equivariant": true, "zero_coefficient_loss_and_gradients_bitwise_control": true, "student_state_keys_unchanged": true, "sampler_code_bitwise_control": true, "all_student_gradients_finite": true, "real_loss": 7.174529552459717, "combined_loss": 7.284832954406738, "optimizer_updates": 0, "validation_data_read": false} +Frozen teacher assets copied to distill_teacher_E96; descriptor unchanged. No student optimizer updates yet. + +## E92 robust normalization final12000 — rejected +- Checkpoint SHA-256: `25be8396d4a8c6ea98c67bca79060c4979a2829661016f0ed51b4e98c897c688`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.238795042037964 seconds. +- Overall skill 0.377099; relative MASE 0.744448; relative WQL 0.521199. +- term skill: long=0.4035, medium=0.4066, short=0.3549. +- domain skill: Econ/Fin=0.1295, Energy=0.2365, Healthcare=0.4448, Nature=0.4270, Sales=0.3471, Transport=0.4672, Web/CloudOps=0.5036. +- frequency skill: A=0.3570, D=0.3466, H=0.3946, M=0.1215, Q=0.1971, S=0.4235, T=0.4392, W=0.2223. +- variates skill: multivariate=0.3955, univariate=0.3620. +- Outcome: Final main0.377099312 is below matched overflow-only E80final0.377423946. The3k main gain did not transfer to any earlier cutoff, and6k/final main also regress. Reject this normalization change; retain ordinary statistics with the overflow-only fallback. Seed197/B64/LR2e-5, no new sources/generator. E97weekly-synthetic run has started in the released allocation. + +E92finalcompute: {"completed_step": 12000, "training_process_loop_seconds": 2692.7444765449036} + +## E79 fresh37M at30000, E99 future matched control +- Checkpoint SHA-256: `7965d1fe4b831143de6280ae873ec61a8024dbb6a14da5dfae1ef58098c33a59`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 28.895771265029907 seconds. +- Overall skill 0.358564; relative MASE 0.761438; relative WQL 0.540346. +- term skill: long=0.3844, medium=0.3900, short=0.3358. +- domain skill: Econ/Fin=0.1162, Energy=0.2193, Healthcare=0.3709, Nature=0.4110, Sales=0.3395, Transport=0.4511, Web/CloudOps=0.4907. +- frequency skill: A=0.3754, D=0.3312, H=0.3793, M=0.0636, Q=0.1845, S=0.4178, T=0.4155, W=0.2110. +- variates skill: multivariate=0.3768, univariate=0.3436. +- Outcome: Main0.358563990 improves24k0.357901602 by0.000662387 under the original96k schedule. This is the exact global30k control for the separately queued E99cooldown; no E99outcome yet. Seed307/B48/LR2e-4; continue unchanged original schedule. + +## E79 fresh146M at16000 +- Checkpoint SHA-256: `959ff6c885777e971d4ee25729d3406485404a69a0bbfe320959506b180e9e35`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 39.40332913398743 seconds. +- Overall skill 0.349499; relative MASE 0.768924; relative WQL 0.550316. +- term skill: long=0.3865, medium=0.3939, short=0.3166. +- domain skill: Econ/Fin=0.1199, Energy=0.2111, Healthcare=0.2664, Nature=0.4047, Sales=0.3301, Transport=0.4402, Web/CloudOps=0.4965. +- frequency skill: A=0.3766, D=0.3221, H=0.3700, M=-0.0589, Q=0.1818, S=0.4218, T=0.4156, W=0.1984. +- variates skill: multivariate=0.3768, univariate=0.3269. +- Outcome: Main0.349499286 improves8k0.343979357 but still trails matched37M16k0.355318072. Gap narrows to0.005818787; no capacity advantage established. Same seed307/B48/LR2e-4; continue24k while E94halfLR comparison matures. + +## E95 all-shard source coverage at3000 +- Checkpoint SHA-256: `ed98a18948ae0ad7cc18f1e2eb653f9af6bd6545ad81daa897b167b5ccf529ce`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.239446878433228 seconds. +- Overall skill 0.376742; relative MASE 0.745627; relative WQL 0.520972. +- term skill: long=0.4002, medium=0.4075, short=0.3552. +- domain skill: Econ/Fin=0.1328, Energy=0.2374, Healthcare=0.4444, Nature=0.4331, Sales=0.3350, Transport=0.4645, Web/CloudOps=0.5005. +- frequency skill: A=0.3721, D=0.3540, H=0.3968, M=0.0980, Q=0.1953, S=0.4214, T=0.4362, W=0.2177. +- variates skill: multivariate=0.3948, univariate=0.3620. +- Outcome: Main0.376741687 falls below matched E80at3000 0.378663825, reversing the small1k advantage. Broader uniform source coverage has not shown a sustained benefit in this mature-model continuation. Continue declared6k/12k before any data-mixture conclusion. Seed197/B64/LR2e-5, nearly matched packed volume and identical source probabilities. + +E98 complete original E75 schedule training started at 2026-10-23T05:11:48Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E101GPUfixture: {"initialization_seed": 307, "fixture_seed": 491, "optimizer_updates": 0, "maximum_shape_memory": {"batch": 48, "signed_rows": 96, "context": 4096, "horizon": 1024, "student_parameters": 146477344, "teacher_parameters": 110064120, "loss": 0.7845079898834229, "teacher_valid_fraction": 1.0, "peak_allocated_mib": 10583.0390625, "peak_reserved_mib": 11116.0}, "eager_loss": 0.3347933888435364, "compiled_loss": 0.3347933888435364, "gradient_cosine": 0.9999896108063672, "max_gradient_difference": 6.866455078125e-05, "teacher_gradients_absent": true, "compile_comparison_seconds": 54.64838738180697, "total_seconds": 79.89753107703291, "source": "allowed packed_sample and own slowAR generator only; frozen scratch-trained E96 neural teacher"} +Checks passed, zero optimizer updates. E101nowqueued after E99queuePID10701 and E97queuePID10513 both end, requiring their saved recovery checkpoints. These are dependency-launcher PIDs, not unknown future trainer PIDs. Exact recipe/command in distill_ensemble_queue.json; immutable teacher package distill_teacher_E96. Compare E94real-target-only at matching checkpoints. Student inference uses unchanged random_capacity_inference and contains no teacher dependency. + +## E93 input8/output4 final12000 +- Checkpoint SHA-256: `1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 35.806113958358765 seconds. +- Overall skill 0.381712; relative MASE 0.740742; relative WQL 0.516077. +- term skill: long=0.4058, medium=0.4052, short=0.3629. +- domain skill: Econ/Fin=0.1468, Energy=0.2396, Healthcare=0.4600, Nature=0.4409, Sales=0.3373, Transport=0.4706, Web/CloudOps=0.5017. +- frequency skill: A=0.3633, D=0.3624, H=0.3942, M=0.1027, Q=0.1968, S=0.4248, T=0.4434, W=0.2445. +- variates skill: multivariate=0.3961, univariate=0.3700. +- Outcome: Final main0.381711986 exceeds matched E89patch8control12k0.380847096 and starting selected E71parent0.381178739. The smaller output blocks help at the final schedule; check all three earlier cutoffs and matched fullpatch4 final before any selection or architectural conclusion. Training loop3153.565149s, sharedH100; seed401/B32/LR2e-5, unchanged generator. E98exactpostloss completion started in the released allocation. + +## E97 weekly synthetic coverage first1000 +- Checkpoint SHA-256: `abd335075c429adc73f20e1e291146903a767a3e5c5a52669768863d5585031a`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.452547311782837 seconds. +- Overall skill 0.378319; relative MASE 0.743092; relative WQL 0.520107. +- term skill: long=0.3993, medium=0.4061, short=0.3590. +- domain skill: Econ/Fin=0.1270, Energy=0.2360, Healthcare=0.4896, Nature=0.4309, Sales=0.3352, Transport=0.4671, Web/CloudOps=0.4981. +- frequency skill: A=0.3664, D=0.3562, H=0.3957, M=0.1213, Q=0.1976, S=0.4232, T=0.4346, W=0.2365. +- variates skill: multivariate=0.3927, univariate=0.3666. +- Outcome: Main0.378319040 exceeds matched E80at1000 0.376804394 by0.001514645. Monthly skill rises0.10610to0.12127 and weekly0.22573to0.23646; most overall gain is short-term. Original real and unchanged synthetic windows/RNG remain bitwise matched. Continue3k/6k/12k before selection. Seed197/B64/LR2e-5, independentweeklyseed1000200, total20%synthetic unchanged. + +## E94 fresh146M halfLR at8000 +- Checkpoint SHA-256: `650a1a4177cae63f3ceab8a2255fbd2f9d281a7e83e8d380a34bb956bd690884`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 38.053096294403076 seconds. +- Overall skill 0.347153; relative MASE 0.771841; relative WQL 0.552198. +- term skill: long=0.3712, medium=0.3767, short=0.3259. +- domain skill: Econ/Fin=0.1161, Energy=0.2093, Healthcare=0.3516, Nature=0.4137, Sales=0.3243, Transport=0.4423, Web/CloudOps=0.4676. +- frequency skill: A=0.3714, D=0.3436, H=0.3637, M=0.0157, Q=0.1571, S=0.4182, T=0.3966, W=0.2130. +- variates skill: multivariate=0.3599, univariate=0.3368. +- Outcome: Main0.347153427 beats matched high-LR146M8k0.343979357, but remains below37M8k0.353508836. The rate benefit persists but shrinks versus4k; continue16k/24k before choosing a larger-corpus fresh recipe. Same owninit/seed307/B48/96k, only LR differs from E79wide. + +## E102 fixed E96 third-member replacement with E93final — predeclared +Replace only the fullpatch4 EMA6000 member with split input8/output4 EMA12000. Retain E83patch16 and E71patch8_6000, ordered equal1/3 quantile averaging after each unchanged member rule. Every member forecasts every instance. No new optimization, no coefficient sweep or configuration-specific selection. Compare all four established cached cutoffs, requiring full public replay and relocation/composition checks before publication. E93final individual main0.381711986 exceeds its control and parent; earlier cutoffs are currently running. The E101teacher remains the immutable E96 ensemble regardless of this selection result. + +E99 fresh37M early cooldown training started at 2026-10-23T05:15:29Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E89 fullpatch4 final12000 +- Checkpoint SHA-256: `a263e545cafb309e8b22dde151e6a8bd37166e1db346170ad7bd33f4a11cd6a3`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 51.19871735572815 seconds. +- Overall skill 0.381640; relative MASE 0.741276; relative WQL 0.515825. +- term skill: long=0.4055, medium=0.4047, short=0.3631. +- domain skill: Econ/Fin=0.1486, Energy=0.2408, Healthcare=0.4740, Nature=0.4424, Sales=0.3396, Transport=0.4680, Web/CloudOps=0.4971. +- frequency skill: A=0.3603, D=0.3552, H=0.3960, M=0.1392, Q=0.2025, S=0.4227, T=0.4401, W=0.2492. +- variates skill: multivariate=0.3948, univariate=0.3709. +- Outcome: Final main0.381640078 exceeds matched patch8control0.380847096, essentially ties the cheaper E93input8/output4 final0.381711986, and exceeds selected starting E71parent0.381178739. Training loop5066.016522s on sharedH100, seed401/B32/LR2e-5; actual memory advantage of E93 is supported by maximum-shape checks, while process timings are concurrent rather than exclusive. Evaluate all three earlier cutoffs before choosing a replacement for E96thirdmember. E99cooldown starts in the released allocation. + +## E103 fixed E96 third-member replacement with E89final — predeclared +Test the completed fullpatch4 EMA12000 as the third member, retaining E83patch16/E71patch8 and equal1/3 quantile averaging with unchanged per-member rules. This is the counterpart to E102splitpatch-final replacement, motivated by the near-tie of the matched architecture continuations at12k. No coefficient or per-config choice; every member forecasts every instance. Compare all four cached cutoffs against E96/E102 before selecting the next full replay. No additional optimizer updates. + +Recovery-provenance maintenance: trainer now carries immutable external resume snapshots in parent_checkpoints across subsequent restarts from a run's own mutable recovery.pt. This preserves E98/E99prefix ancestry after another operator recovery and avoids linking mutable source-run recovery files. Metadata only, no training arithmetic changed. CURRENT snapshots now explicitly record the known compiler environment for compiled jobs, including those whose launchers passed it via subprocess environment rather than an env command prefix. No credentials were read. + +### E102 four-cutoff replacement results +{"cutoff": "valid_screen", "skill_score": 0.38490788212550675, "rel_mase_gmean": 0.7369849187976256, "rel_wql_gmean": 0.5133596411831329, "groups": {"term": {"short": 0.3670856470642414, "medium": 0.4084718855262034, "long": 0.40650615955402314}, "domain": {"Econ/Fin": 0.1435289463184154, "Energy": 0.2468980568665663, "Healthcare": 0.4746000842796365, "Nature": 0.44061471938672714, "Sales": 0.3438839562187085, "Transport": 0.4681588575437192, "Web/CloudOps": 0.5046164356104859}, "freq": {"A-DEC": 0.37543835684208393, "Q-DEC": 0.19718024023430158, "M": 0.10850755704828396, "W-SUN": 0.10914931929038174, "D": 0.364713649661322, "H": 0.40088295006065944, "15T": 0.21696396975859744, "W-FRI": 0.016303274872958684, "10T": 0.6274098133659913, "W-TUE": 0.6163821514248893, "W-THU": 0.20854279501175432, "W-WED": 0.32935722968495507, "5T": 0.5196886329209323, "10S": 0.42527389349857736}}, "cpu_seconds": 1.1513165449723601, "member_checkpoint_hashes": ["0ae7875b49b99a44c295dc2b8243327aeacadc25b2354988abb2c37250359a49", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "E96skill": 0.384594982171353, "difference": 0.0003128999541537336} +{"cutoff": "valid_backcast", "skill_score": 0.3397943577904946, "rel_mase_gmean": 0.7942938342926791, "rel_wql_gmean": 0.5487534602272348, "groups": {"term": {"short": 0.3060609208737005, "medium": 0.36022438378162913, "long": 0.40207177797998805}, "domain": {"Econ/Fin": 0.17314936720715002, "Energy": 0.2319064310330724, "Healthcare": 0.40898749701599635, "Nature": 0.3714427052655884, "Sales": 0.4054545766888219, "Transport": 0.37346761267845907, "Web/CloudOps": 0.4512796397157435}, "freq": {"A-DEC": 0.32636255116793356, "Q-DEC": 0.2369053047170233, "M": 0.1881408754401731, "W-SUN": 0.05514520346862939, "D": 0.35254747200062386, "H": 0.37162220001802326, "15T": 0.2225810499701737, "W-FRI": 0.23076747912755158, "10T": 0.32531767521178967, "W-TUE": 0.5449536336522042, "W-THU": 0.2550583257373391, "W-WED": 0.36148774693113794, "5T": 0.441771392840713, "10S": 0.34781169339869}}, "cpu_seconds": 0.9792960570193827, "member_checkpoint_hashes": ["0ae7875b49b99a44c295dc2b8243327aeacadc25b2354988abb2c37250359a49", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "E96skill": 0.33975008510701665, "difference": 4.427268347795277e-05} +{"cutoff": "valid_backcast2", "skill_score": 0.3650870167535245, "rel_mase_gmean": 0.7649173761305604, "rel_wql_gmean": 0.527003973075039, "groups": {"term": {"short": 0.3525196178413804, "medium": 0.3930479998451024, "long": 0.3688394487554716}, "domain": {"Econ/Fin": 0.12187550267974279, "Energy": 0.24171273109616453, "Healthcare": 0.3558210371956918, "Nature": 0.4786187053429537, "Sales": 0.5559745534466993, "Transport": 0.42514365668969034, "Web/CloudOps": 0.4369290048270271}, "freq": {"A-DEC": 0.3369941826448156, "Q-DEC": 0.15634597829751584, "M": 0.16659776433783968, "W-SUN": 0.07034227201826782, "D": 0.4307838193118658, "H": 0.3947195332904091, "15T": 0.10843788342786231, "W-FRI": 0.15292520112219465, "10T": 0.5097026958567001, "W-TUE": 0.1163232645897253, "W-THU": 0.349832844039044, "W-WED": 0.5634413265331784, "5T": 0.4725475721543746, "10S": 0.2849619587969022}}, "cpu_seconds": 1.3131735338829458, "member_checkpoint_hashes": ["0ae7875b49b99a44c295dc2b8243327aeacadc25b2354988abb2c37250359a49", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "E96skill": 0.36472017597795625, "difference": 0.00036684077556825567} +{"cutoff": "valid_backcast3", "skill_score": 0.38962589808404846, "rel_mase_gmean": 0.7393031561148107, "rel_wql_gmean": 0.5039293302189662, "groups": {"term": {"short": 0.3950146881429296, "medium": 0.3683351816334438, "long": 0.3962356024661119}, "domain": {"Econ/Fin": 0.1866323514229733, "Energy": 0.31708138786412254, "Healthcare": 0.2340457735690984, "Nature": 0.5075633858787092, "Sales": 0.3999844088004907, "Transport": 0.5091845709202749, "Web/CloudOps": 0.3939387141464573}, "freq": {"A-DEC": 0.35740138324250814, "Q-DEC": 0.2545638826926907, "M": 0.14196420345262517, "W-SUN": 0.1692422167486961, "D": 0.44092551174968075, "H": 0.4060276831713958, "15T": 0.2544847257167575, "W-FRI": 0.03945021050804143, "10T": 0.6073743483329828, "W-TUE": 0.25124832856283164, "W-THU": 0.3470992258549631, "W-WED": 0.3775958266712779, "5T": 0.46513388285277635, "10S": 0.29273333259972834}}, "cpu_seconds": 0.9749888752121478, "member_checkpoint_hashes": ["0ae7875b49b99a44c295dc2b8243327aeacadc25b2354988abb2c37250359a49", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "E96skill": 0.389238119545644, "difference": 0.00038777853840443743} + +### E103 four-cutoff replacement results +{"cutoff": "valid_screen", "skill_score": 0.38500541763348517, "rel_mase_gmean": 0.7370491942191689, "rel_wql_gmean": 0.5131520925694101, "groups": {"term": {"short": 0.36722493789915567, "medium": 0.40845783827201154, "long": 0.4066128546537624}, "domain": {"Econ/Fin": 0.14488968734284446, "Energy": 0.2473756772173874, "Healthcare": 0.4777300437443104, "Nature": 0.4411115514129288, "Sales": 0.3448077959265311, "Transport": 0.46774095296357987, "Web/CloudOps": 0.5033387584756153}, "freq": {"A-DEC": 0.37541665630455645, "Q-DEC": 0.19911678292032942, "M": 0.11881300866622979, "W-SUN": 0.1096477052731838, "D": 0.362528588146091, "H": 0.4015705047657928, "15T": 0.21804762920144782, "W-FRI": 0.016363727924622262, "10T": 0.6271485862780906, "W-TUE": 0.6209733756670539, "W-THU": 0.20999017480896343, "W-WED": 0.3297749874361884, "5T": 0.5175349566789766, "10S": 0.42462313787098094}}, "cpu_seconds": 1.0732698428910226, "member_checkpoint_hashes": ["0ae7875b49b99a44c295dc2b8243327aeacadc25b2354988abb2c37250359a49", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "a263e545cafb309e8b22dde151e6a8bd37166e1db346170ad7bd33f4a11cd6a3"], "E96skill": 0.384594982171353, "difference": 0.00041043546213215265} +{"cutoff": "valid_backcast", "skill_score": 0.3398214546118604, "rel_mase_gmean": 0.7942044163673427, "rel_wql_gmean": 0.5487701941828703, "groups": {"term": {"short": 0.305847769661334, "medium": 0.3615040967825627, "long": 0.40146856729517433}, "domain": {"Econ/Fin": 0.17464373027255042, "Energy": 0.23108171914379005, "Healthcare": 0.41082426569988595, "Nature": 0.3718443434112704, "Sales": 0.40646820364012926, "Transport": 0.3728762819285243, "Web/CloudOps": 0.4515441161888809}, "freq": {"A-DEC": 0.32427594695442885, "Q-DEC": 0.23945276396724646, "M": 0.19719617479508833, "W-SUN": 0.052844558516275786, "D": 0.35260466772957, "H": 0.3721367040211806, "15T": 0.2223065777034271, "W-FRI": 0.22845992938029724, "10T": 0.3234396022330981, "W-TUE": 0.5459245154169383, "W-THU": 0.24711082469129164, "W-WED": 0.36312061525273154, "5T": 0.4404099962380955, "10S": 0.3485327044406994}}, "cpu_seconds": 0.9945498188026249, "member_checkpoint_hashes": ["0ae7875b49b99a44c295dc2b8243327aeacadc25b2354988abb2c37250359a49", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "a263e545cafb309e8b22dde151e6a8bd37166e1db346170ad7bd33f4a11cd6a3"], "E96skill": 0.33975008510701665, "difference": 7.13695048437657e-05} +{"cutoff": "valid_backcast2", "skill_score": 0.3647180336171173, "rel_mase_gmean": 0.7654029032858002, "rel_wql_gmean": 0.5272820041297973, "groups": {"term": {"short": 0.3518878749308295, "medium": 0.3927580540668256, "long": 0.3691077522689188}, "domain": {"Econ/Fin": 0.12218990276622621, "Energy": 0.24251138907504843, "Healthcare": 0.34933847363414383, "Nature": 0.4781212829897, "Sales": 0.55694372735719, "Transport": 0.4243899770061409, "Web/CloudOps": 0.43650428576145894}, "freq": {"A-DEC": 0.33629748314335295, "Q-DEC": 0.1560373253956937, "M": 0.16237816345656342, "W-SUN": 0.07189010798504825, "D": 0.43022756178029165, "H": 0.39543965655443114, "15T": 0.10619855263453626, "W-FRI": 0.15256288862137302, "10T": 0.5099262713842705, "W-TUE": 0.11275167806759523, "W-THU": 0.3476561865337633, "W-WED": 0.565409644514056, "5T": 0.4712731877671763, "10S": 0.2859728774327921}}, "cpu_seconds": 0.9891702111344784, "member_checkpoint_hashes": ["0ae7875b49b99a44c295dc2b8243327aeacadc25b2354988abb2c37250359a49", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "a263e545cafb309e8b22dde151e6a8bd37166e1db346170ad7bd33f4a11cd6a3"], "E96skill": 0.36472017597795625, "difference": -2.142360838952584e-06} +{"cutoff": "valid_backcast3", "skill_score": 0.38952531921448574, "rel_mase_gmean": 0.7397344287798532, "rel_wql_gmean": 0.5038015284686523, "groups": {"term": {"short": 0.39470492326109163, "medium": 0.3679378045902095, "long": 0.39702622151428124}, "domain": {"Econ/Fin": 0.18635232828843817, "Energy": 0.3167555032477224, "Healthcare": 0.2321529881554648, "Nature": 0.5080109601079104, "Sales": 0.40020731613048277, "Transport": 0.5096409724474877, "Web/CloudOps": 0.3934863582665823}, "freq": {"A-DEC": 0.34966366686932726, "Q-DEC": 0.25774901005566275, "M": 0.13921842550571784, "W-SUN": 0.1678888068666432, "D": 0.4412824281729495, "H": 0.40605210717475726, "15T": 0.2556303886920226, "W-FRI": 0.03145225561173515, "10T": 0.6068260917454812, "W-TUE": 0.2595682801406983, "W-THU": 0.3474528636749996, "W-WED": 0.3763281957599267, "5T": 0.4644139584813969, "10S": 0.29384233335279064}}, "cpu_seconds": 1.3381098771933466, "member_checkpoint_hashes": ["0ae7875b49b99a44c295dc2b8243327aeacadc25b2354988abb2c37250359a49", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "a263e545cafb309e8b22dde151e6a8bd37166e1db346170ad7bd33f4a11cd6a3"], "E96skill": 0.389238119545644, "difference": 0.00028719966884172} +Next full replay: E102 improves all four cutoffs and has the cheaper input8 encoder. E103 is slightly stronger on main/first earlier but weaker thanE102 onsecond/third; secondearlier effectivelyties E96. E103is retained as a cached alternative, without a claimed full-suite result. No new optimizer updates in either ensemble composition. + +## E97 weekly synthetic coverage at3000 +- Checkpoint SHA-256: `a5619c3da9cb9049d92c9582e7fd74dea3e3d474bf5cf8499522e739cd202305`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.279794216156006 seconds. +- Overall skill 0.380663; relative MASE 0.740647; relative WQL 0.517896. +- term skill: long=0.4025, medium=0.4068, short=0.3617. +- domain skill: Econ/Fin=0.1317, Energy=0.2379, Healthcare=0.4904, Nature=0.4332, Sales=0.3335, Transport=0.4661, Web/CloudOps=0.5036. +- frequency skill: A=0.3690, D=0.3546, H=0.3977, M=0.1269, Q=0.1964, S=0.4224, T=0.4386, W=0.2419. +- variates skill: multivariate=0.3970, univariate=0.3674. +- Outcome: Main0.380663183 exceeds matched E80at3000 0.378663825 by0.001999358, sustaining the1k gain. Earlier cutoffs are now running; no independent-model publication yet. Seed197/B64/LR2e-5, exact original real/non-replaced synthetic streams preserved, weekly replacement1/11 of20%synthetic. + +## E104 transfer the matched weekly-synthesis correction — predeclared +Hypothesis: E97weekly3000 minus E80overflow-control3000 isolates the new weekly synthetic coverage and can improve E83, while retaining E83postprocessing-aware and slowAR contributions. Apply exactly coefficient1: E83postloss_slow_ar_delta6k + E97weekly_synthEMA3000 - E80overflow_controlEMA3000. All model keys/configurations align; all weights were trained here on allowed data, with the delta pair sharing seed197/B64/LR2e-5 and original sampler/horizon streams. No coefficient sweep or optimizer updates. E97earlier results are not yet available at declaration. Evaluate the fixed composition at all four cutoffs and then its fixed equal1/3 ensemble with E71patch8_6000 and E93splitpatch_12000, replacing only E102firstmember. Use unchanged postloss_inference numerical fallback and fixed rules. This is a predictive composition test, with full public replay/checks required for any publication. E101teacher remains frozen E96. + +## E93 split patch final earlier cutoff1 +- Checkpoint SHA-256: `1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 35.36992645263672 seconds. +- Overall skill 0.336872; relative MASE 0.797481; relative WQL 0.551410. +- term skill: long=0.4020, medium=0.3579, short=0.3016. +- domain skill: Econ/Fin=0.1748, Energy=0.2280, Healthcare=0.3931, Nature=0.3699, Sales=0.4068, Transport=0.3691, Web/CloudOps=0.4509. +- frequency skill: A=0.3160, D=0.3464, H=0.3726, M=0.1800, Q=0.2360, S=0.3514, T=0.3341, W=0.2756. +- variates skill: multivariate=0.3569, univariate=0.3205. +- Outcome: Fixed final12000 checkpoint, seed401/B32/LR2e-5. Used for the predeclared equal-member replacement comparison E102/E103; validation only, no further optimizer updates. + +## E93 split patch final earlier cutoff2 +- Checkpoint SHA-256: `1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 31.873882293701172 seconds. +- Overall skill 0.361104; relative MASE 0.770556; relative WQL 0.529731. +- term skill: long=0.3665, medium=0.3913, short=0.3470. +- domain skill: Econ/Fin=0.1207, Energy=0.2377, Healthcare=0.3430, Nature=0.4729, Sales=0.5545, Transport=0.4214, Web/CloudOps=0.4356. +- frequency skill: A=0.3185, D=0.4195, H=0.3908, M=0.1553, Q=0.1616, S=0.2820, T=0.3625, W=0.2958. +- variates skill: multivariate=0.3609, univariate=0.3613. +- Outcome: Fixed final12000 checkpoint, seed401/B32/LR2e-5. Used for the predeclared equal-member replacement comparison E102/E103; validation only, no further optimizer updates. + +## E93 split patch final earlier cutoff3 +- Checkpoint SHA-256: `1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 33.14549136161804 seconds. +- Overall skill 0.385555; relative MASE 0.745119; relative WQL 0.506687. +- term skill: long=0.3946, medium=0.3685, short=0.3886. +- domain skill: Econ/Fin=0.1861, Energy=0.3097, Healthcare=0.2354, Nature=0.5014, Sales=0.3950, Transport=0.5057, Web/CloudOps=0.3950. +- frequency skill: A=0.3543, D=0.4270, H=0.4025, M=0.1610, Q=0.2496, S=0.2977, T=0.4286, W=0.2436. +- variates skill: multivariate=0.3696, univariate=0.3979. +- Outcome: Fixed final12000 checkpoint, seed401/B32/LR2e-5. Used for the predeclared equal-member replacement comparison E102/E103; validation only, no further optimizer updates. + +## E89 full patch4 final earlier cutoff1 +- Checkpoint SHA-256: `a263e545cafb309e8b22dde151e6a8bd37166e1db346170ad7bd33f4a11cd6a3`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 55.011173486709595 seconds. +- Overall skill 0.336345; relative MASE 0.797972; relative WQL 0.551947. +- term skill: long=0.3997, medium=0.3611, short=0.3004. +- domain skill: Econ/Fin=0.1781, Energy=0.2248, Healthcare=0.3992, Nature=0.3709, Sales=0.4088, Transport=0.3668, Web/CloudOps=0.4509. +- frequency skill: A=0.3067, D=0.3457, H=0.3740, M=0.2061, Q=0.2429, S=0.3533, T=0.3298, W=0.2654. +- variates skill: multivariate=0.3532, univariate=0.3226. +- Outcome: Fixed final12000 checkpoint, seed401/B32/LR2e-5. Used for the predeclared equal-member replacement comparison E102/E103; validation only, no further optimizer updates. + +## E89 full patch4 final earlier cutoff2 +- Checkpoint SHA-256: `a263e545cafb309e8b22dde151e6a8bd37166e1db346170ad7bd33f4a11cd6a3`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 54.35282373428345 seconds. +- Overall skill 0.359845; relative MASE 0.771620; relative WQL 0.531089. +- term skill: long=0.3668, medium=0.3902, short=0.3451. +- domain skill: Econ/Fin=0.1192, Energy=0.2393, Healthcare=0.3219, Nature=0.4739, Sales=0.5564, Transport=0.4186, Web/CloudOps=0.4338. +- frequency skill: A=0.3129, D=0.4161, H=0.3924, M=0.1622, Q=0.1597, S=0.2850, T=0.3585, W=0.2927. +- variates skill: multivariate=0.3606, univariate=0.3592. +- Outcome: Fixed final12000 checkpoint, seed401/B32/LR2e-5. Used for the predeclared equal-member replacement comparison E102/E103; validation only, no further optimizer updates. + +## E89 full patch4 final earlier cutoff3 +- Checkpoint SHA-256: `a263e545cafb309e8b22dde151e6a8bd37166e1db346170ad7bd33f4a11cd6a3`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 54.33600902557373 seconds. +- Overall skill 0.384241; relative MASE 0.747472; relative WQL 0.507256. +- term skill: long=0.3960, medium=0.3667, short=0.3865. +- domain skill: Econ/Fin=0.1847, Energy=0.3079, Healthcare=0.2301, Nature=0.5006, Sales=0.3948, Transport=0.5062, Web/CloudOps=0.3930. +- frequency skill: A=0.3322, D=0.4254, H=0.4016, M=0.1568, Q=0.2587, S=0.3002, T=0.4273, W=0.2401. +- variates skill: multivariate=0.3670, univariate=0.3975. +- Outcome: Fixed final12000 checkpoint, seed401/B32/LR2e-5. Used for the predeclared equal-member replacement comparison E102/E103; validation only, no further optimizer updates. + +## E95 all-shard coverage at6000 +- Checkpoint SHA-256: `78a3c47718545643662029245141e6d39e64cf0853d2502f20222123ce3cd5c7`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.874247789382935 seconds. +- Overall skill 0.376043; relative MASE 0.746531; relative WQL 0.521508. +- term skill: long=0.4012, medium=0.4068, short=0.3538. +- domain skill: Econ/Fin=0.1318, Energy=0.2380, Healthcare=0.4414, Nature=0.4294, Sales=0.3318, Transport=0.4670, Web/CloudOps=0.4991. +- frequency skill: A=0.3714, D=0.3507, H=0.3948, M=0.0936, Q=0.1963, S=0.4213, T=0.4386, W=0.2145. +- variates skill: multivariate=0.3939, univariate=0.3614. +- Outcome: Skill0.376043220 falls below matched E80control6000 0.378288765. Continue the declared12000 schedule; broader coverage at fixed volume has not improved the mature model. + +## E98 original postloss schedule at6000 +- Checkpoint SHA-256: `7f1a2200b0f6a2cd63a378b001010e4a4a9776eba76c800ee1d61c23fc8bf9cb`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.866560697555542 seconds. +- Overall skill 0.377594; relative MASE 0.744160; relative WQL 0.520572. +- term skill: long=0.4019, medium=0.4066, short=0.3564. +- domain skill: Econ/Fin=0.1081, Energy=0.2440, Healthcare=0.4585, Nature=0.4289, Sales=0.3383, Transport=0.4638, Web/CloudOps=0.5007. +- frequency skill: A=0.3681, D=0.3493, H=0.3983, M=0.0713, Q=0.1895, S=0.4227, T=0.4403, W=0.2264. +- variates skill: multivariate=0.3955, univariate=0.3630. +- Outcome: Exact optimizer/RNG continuation from originalE75step3653; no reset. Skill0.377594313 is below E75at3000 0.378813891 and E80at6000 0.378288765. Continue to predeclared12000; no checkpoint replacement. + +## E79 fresh37M original schedule at36000 +- Checkpoint SHA-256: `06778302f2e405ecd30fd00407523d03be8756c7a6029c38a26360cbeb98becf`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 29.79560947418213 seconds. +- Overall skill 0.364859; relative MASE 0.756433; relative WQL 0.533298. +- term skill: long=0.3873, medium=0.3910, short=0.3457. +- domain skill: Econ/Fin=0.1266, Energy=0.2248, Healthcare=0.4265, Nature=0.4125, Sales=0.3402, Transport=0.4559, Web/CloudOps=0.4912. +- frequency skill: A=0.3896, D=0.3497, H=0.3830, M=0.0639, Q=0.1985, S=0.4187, T=0.4195, W=0.2201. +- variates skill: multivariate=0.3809, univariate=0.3518. +- Outcome: Original96k schedule control, seed307/B48/LR2e-4. Skill0.364859034 improves on30k0.358563990; compare E99cooldown at the same step when available. + +## E105 nested corpus volume at fixed source probabilities — predeclared +Hypothesis: the mature model may benefit from more distinct allowed series beyond the all-shard coverage change. Compare against E95 using the exactly nested packed_stratified_large instead of packed_stratified. Source probabilities stay bitwise those of packed_sample, all95directories, all model/optimizer/EMA/horizon settings unchanged: ownE62initial SHA22c08571978be31ba57368eb983089a40a44d56d4ae5e17da41afd2a761a258c, seed197/B64/LR2e-5/12000steps, paired loss, overflow_control code, postloss_inference runtime. Per-directory softcap192M versus24M points; total5,354,822,975points/1,059,868series versus952,527,771points/342,661series. Same global series order and per-series crop rules, exact binary/record prefix checked for all95dirs. stratified_large_audit.json replays260actualseries and verifies source probabilities, seed461,19.984999CPU seconds,0optimizerupdates/no validationreads. More series changes the sampler trajectory; this is a single-seed volume comparison, not identical sampled rows. E95at6000 currently trails E80; E105 tests whether volume recovers that deficit. Queue after E95 in its allocation. Screens1000/3000/6000/12000; earlier cutoffs and full replay required before publication. No added training data sources or new generator. + +## E106 spectral smoothness prior in synthetic residuals — preparation +Hypothesis: the original white/AR1 synthetic residuals underrepresent smooth stochastic changes. Replace only the noise residual in half of synthetic windows (total synthetic share unchanged20%) with a unit-marginal-variance stationary Gaussian draw generated here by FFT. Equal kernel-family prior: Matérn nu0.5/1.5/2.5 or squared-exponential; length scale10**U(0,4) steps. Generate a periodic FFT field of next-power-of-two length at least4times the window and keep its prefix; normalize by theoretical spectral variance, never by realized future values. Keep the original Fourier components, trend, changepoint, intermittent and positivity transforms, periods and observed masks. Always consume the original residual RNG before replacement; independent spectral seed1100200 preserves the full original sampler/horizon streams and all non-replaced rows. This differs from E14's multi-family whole-series replacement and E78's four-AR-component sum. Comparator E80: ownE62initial SHA22c08571978be31ba57368eb983089a40a44d56d4ae5e17da41afd2a761a258c, seed197/B64/LR2e-5/12000steps, paired loss, oldpacked_sample/sourceweights, overflow-safe model unchanged. CPU distribution/RNG checks required before launch; no validation in generator or training. Queue after E98 when checks pass. Screen1000/3000/6000/12000 and earlier cutoffs for promising checkpoints; no coefficient sweep. +E106 CPU audit passed: seed499,7680paired candidate/control windows,1535synthetic rows,743spectral replacements. All non-replaced rows, period labels, finite masks and original/horizon RNG states are bitwise unchanged; saving/restoring all NumPy states replays the next batch exactly. Model file byte-identical toE80 SHA44eeb23c037e91b8f67e432615ce46540a7ac4242919785f9c4218de23121499. Four kernel-family empirical variances/autocovariances over1024draws each match their declared discrete spectral covariances within0.005 (tolerance0.045); extreme length scales1/10000 and window lengths8/40/5120 remain finite. Sampler comparison4.179206CPU seconds,total4.517388seconds,0optimizerupdates/no validationread. Receipt spectral_synth_checks.json. Queued after E98queue10664; full training metadata and publisher generator provenance added. + +## E102 split-patch replacement full public replay +- Checkpoint SHA-256: `2dedb7fd1052bf72a38fc005cc8c89f65d42a50260830de0f0efbb5f16a30b4f`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.381163; relative MASE 0.739673; relative WQL 0.517741. +- term skill: long=0.4007, medium=0.4074, short=0.3631. +- domain skill: Econ/Fin=0.1245, Energy=0.2404, Healthcare=0.4799, Nature=0.4407, Sales=0.3581, Transport=0.4683, Web/CloudOps=0.4964. +- frequency skill: A=0.2968, D=0.3691, H=0.3956, M=0.1343, Q=0.1868, S=0.4253, T=0.4379, W=0.2354. +- variates skill: multivariate=0.3952, univariate=0.3698. +- Outcome: Fixed equal1/3 ensemble E83patch16/E71patch8_6000/E93input8output4_12000. Full skill0.38116304998662165 exceeds E96full0.3807214453622526 by0.00044160462436904; zero failures across97configurations/151170instances. Inference358.197612shared-H100 seconds. Relocation already bitwise; independent component/composition checks pending before atomic publication. Validation selection only; no held-out reward claim. + +E102 final checks all passed before publication: split_ensemble_validation_receipt.json completes allfive steps in510.069582wall seconds including lock waits. Public inference358.197612seconds. Relocated three-example inference is bitwise identical/finite/ordered,31.745146seconds. Independent public third-member replay plus orderedfloat32 component mean exactly match bundled output for three complete actual configurations; see split_patch_composition_replay.json and split_ensemble_composition_checks.json. Descriptor2dedb7fd1052bf72a38fc005cc8c89f65d42a50260830de0f0efbb5f16a30b4f;110,068,216parameters. Selected for atomic publication over E96. Allfour diagnostic cutoffs improve; full-term skills long0.400651,medium0.407396,short0.363109. Descriptive group/config comparison and cluster bootstrap saved in split_ensemble_comparison.json; no held-out significance claim. E101teacher remains immutable E96. + +## E107 learned use of sixteen-cycle centered seasonal summaries — preparation +Hypothesis: within the existing4096-point context, averaging more observed cycles can reduce phase-pattern noise, while centering each cycle prevents old levels from biasing the forecast. Add fixed context features for each of the two existing frequency periods: the16cycle-minus4cycle mean of cycle-centered phase observations and the16cycle support fraction. Enable a phase only with at least8observed cycles, at least2recent cycles and period>=2. A zero-initialized linear query projection exposes these four features to the existing decoder; a separate zero-initialized two-gate head adds tanh-bounded multiples of the two template differences to the median. All quantiles shift together; original interval widths are unchanged initially. The initial function must be exactly preserved and all parameters train. No increased context, raw-memory encoder or fitted seasonal parameters; this differs from E29/E54 older-history experiments. Comparator E80uses the same ownE62initial, seed197/B64/LR2e-5/12000steps, paired loss, original corpus/generator/horizon streams and overflow fallback. New weights start exactlyzero, conversion seed503; no external weights. Audit independent feature arithmetic, initialization equivalence, gradient flow and max-shape GPU memory before launch. Screen1000/3000/6000/12000, earlier/fullreplay for selection. Queue after E105 when ready; no launch yet. + +## E97 weekly synthetic coverage at6000 +- Checkpoint SHA-256: `de053e5baf9641e9245519990d6e5193fc91392cb76e72ceffee1ce63f578fca`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.010923624038696 seconds. +- Overall skill 0.380716; relative MASE 0.741210; relative WQL 0.517415. +- term skill: long=0.4022, medium=0.4073, short=0.3617. +- domain skill: Econ/Fin=0.1254, Energy=0.2389, Healthcare=0.4994, Nature=0.4301, Sales=0.3392, Transport=0.4658, Web/CloudOps=0.5031. +- frequency skill: A=0.3704, D=0.3555, H=0.3964, M=0.1253, Q=0.1936, S=0.4249, T=0.4385, W=0.2461. +- variates skill: multivariate=0.3971, univariate=0.3673. +- Outcome: Main0.380715730 exceeds matched E80at6000 0.378288765 by0.002426965; nearly ties E97at3000. Continue declared12000 schedule. + +## E99 early cooldown at30000 +- Checkpoint SHA-256: `ffa1f38d24165a7167a319a609bc03fa14cbe471ea7785659f10d7c953889661`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 28.24539875984192 seconds. +- Overall skill 0.363004; relative MASE 0.756412; relative WQL 0.536432. +- term skill: long=0.3857, medium=0.3920, short=0.3425. +- domain skill: Econ/Fin=0.1135, Energy=0.2193, Healthcare=0.4094, Nature=0.4163, Sales=0.3443, Transport=0.4551, Web/CloudOps=0.4933. +- frequency skill: A=0.3737, D=0.3414, H=0.3797, M=0.0903, Q=0.1811, S=0.4171, T=0.4196, W=0.2193. +- variates skill: multivariate=0.3812, univariate=0.3481. +- Outcome: Skill0.363004205 exceeds original E79at30000 0.358563990 by0.004440216. Same immutable24000optimizer/EMA/RNG state, only the declared LR cooldown differs. Continue to36000 before schedule selection. + +## E97 weekly3000 earlier cutoff1 +- Checkpoint SHA-256: `a5619c3da9cb9049d92c9582e7fd74dea3e3d474bf5cf8499522e739cd202305`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 26.978241682052612 seconds. +- Overall skill 0.336324; relative MASE 0.797606; relative WQL 0.552235. +- term skill: long=0.3979, medium=0.3586, short=0.3021. +- domain skill: Econ/Fin=0.1518, Energy=0.2284, Healthcare=0.4155, Nature=0.3672, Sales=0.3939, Transport=0.3733, Web/CloudOps=0.4489. +- frequency skill: A=0.3129, D=0.3516, H=0.3666, M=0.1788, Q=0.2305, S=0.3410, T=0.3350, W=0.2907. +- variates skill: multivariate=0.3530, univariate=0.3227. +- Outcome: Fixed3000checkpoint, seed197/B64/LR2e-5. Matched E80earlier scores0.336119626/0.358234785/0.388791691. Candidate first/third improve slightly and second regresses; mixed standalone evidence. E104 matched-delta composition evaluated separately. + +## E97 weekly3000 earlier cutoff2 +- Checkpoint SHA-256: `a5619c3da9cb9049d92c9582e7fd74dea3e3d474bf5cf8499522e739cd202305`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 26.026545524597168 seconds. +- Overall skill 0.357608; relative MASE 0.772348; relative WQL 0.534302. +- term skill: long=0.3634, medium=0.3874, short=0.3435. +- domain skill: Econ/Fin=0.1055, Energy=0.2359, Healthcare=0.3296, Nature=0.4704, Sales=0.5497, Transport=0.4211, Web/CloudOps=0.4319. +- frequency skill: A=0.3536, D=0.4229, H=0.3913, M=0.1492, Q=0.1501, S=0.2808, T=0.3592, W=0.2527. +- variates skill: multivariate=0.3632, univariate=0.3530. +- Outcome: Fixed3000checkpoint, seed197/B64/LR2e-5. Matched E80earlier scores0.336119626/0.358234785/0.388791691. Candidate first/third improve slightly and second regresses; mixed standalone evidence. E104 matched-delta composition evaluated separately. + +## E97 weekly3000 earlier cutoff3 +- Checkpoint SHA-256: `a5619c3da9cb9049d92c9582e7fd74dea3e3d474bf5cf8499522e739cd202305`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 25.23224711418152 seconds. +- Overall skill 0.389288; relative MASE 0.737704; relative WQL 0.505581. +- term skill: long=0.3960, medium=0.3604, short=0.3973. +- domain skill: Econ/Fin=0.1690, Energy=0.3192, Healthcare=0.2786, Nature=0.5046, Sales=0.3991, Transport=0.5056, Web/CloudOps=0.3897. +- frequency skill: A=0.3644, D=0.4424, H=0.4032, M=0.1383, Q=0.2578, S=0.2856, T=0.4308, W=0.2610. +- variates skill: multivariate=0.3738, univariate=0.4012. +- Outcome: Fixed3000checkpoint, seed197/B64/LR2e-5. Matched E80earlier scores0.336119626/0.358234785/0.388791691. Candidate first/third improve slightly and second regresses; mixed standalone evidence. E104 matched-delta composition evaluated separately. + +## E104 weekly matched-delta standalone valid_screen +- Checkpoint SHA-256: `094c7c694406075967f392a0d9ac1146bac984a90ab468c59d660a1b92fa7ba2`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.348880529403687 seconds. +- Overall skill 0.381830; relative MASE 0.739086; relative WQL 0.517036. +- term skill: long=0.4034, medium=0.4069, short=0.3634. +- domain skill: Econ/Fin=0.1309, Energy=0.2397, Healthcare=0.4832, Nature=0.4388, Sales=0.3386, Transport=0.4639, Web/CloudOps=0.5053. +- frequency skill: A=0.3743, D=0.3550, H=0.4003, M=0.1128, Q=0.1977, S=0.4242, T=0.4413, W=0.2371. +- variates skill: multivariate=0.3976, univariate=0.3690. +- Outcome: Fixed E83 + E97weekly3000 - E80overflow3000, coefficient1. Merge1.392576CPU seconds, no optimizer updates. Standalone improves main/first earlier versus E83 and declines at second/third; fixed equal ensemble assessed separately. + +## E104 weekly matched-delta standalone valid_backcast +- Checkpoint SHA-256: `094c7c694406075967f392a0d9ac1146bac984a90ab468c59d660a1b92fa7ba2`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 31.152572631835938 seconds. +- Overall skill 0.336131; relative MASE 0.797469; relative WQL 0.552651. +- term skill: long=0.3953, medium=0.3602, short=0.3023. +- domain skill: Econ/Fin=0.1601, Energy=0.2285, Healthcare=0.3995, Nature=0.3691, Sales=0.3960, Transport=0.3717, Web/CloudOps=0.4496. +- frequency skill: A=0.3204, D=0.3464, H=0.3692, M=0.1755, Q=0.2317, S=0.3401, T=0.3348, W=0.2897. +- variates skill: multivariate=0.3531, univariate=0.3223. +- Outcome: Fixed E83 + E97weekly3000 - E80overflow3000, coefficient1. Merge1.392576CPU seconds, no optimizer updates. Standalone improves main/first earlier versus E83 and declines at second/third; fixed equal ensemble assessed separately. + +## E104 weekly matched-delta standalone valid_backcast2 +- Checkpoint SHA-256: `094c7c694406075967f392a0d9ac1146bac984a90ab468c59d660a1b92fa7ba2`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 24.71313166618347 seconds. +- Overall skill 0.359266; relative MASE 0.771102; relative WQL 0.532407. +- term skill: long=0.3665, medium=0.3870, short=0.3455. +- domain skill: Econ/Fin=0.1182, Energy=0.2385, Healthcare=0.3103, Nature=0.4745, Sales=0.5516, Transport=0.4204, Web/CloudOps=0.4341. +- frequency skill: A=0.3507, D=0.4222, H=0.3921, M=0.1412, Q=0.1508, S=0.2801, T=0.3641, W=0.2573. +- variates skill: multivariate=0.3652, univariate=0.3544. +- Outcome: Fixed E83 + E97weekly3000 - E80overflow3000, coefficient1. Merge1.392576CPU seconds, no optimizer updates. Standalone improves main/first earlier versus E83 and declines at second/third; fixed equal ensemble assessed separately. + +## E104 weekly matched-delta standalone valid_backcast3 +- Checkpoint SHA-256: `094c7c694406075967f392a0d9ac1146bac984a90ab468c59d660a1b92fa7ba2`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 27.16672372817993 seconds. +- Overall skill 0.388450; relative MASE 0.741068; relative WQL 0.504669. +- term skill: long=0.3933, medium=0.3623, short=0.3962. +- domain skill: Econ/Fin=0.1766, Energy=0.3223, Healthcare=0.2292, Nature=0.5006, Sales=0.4004, Transport=0.5087, Web/CloudOps=0.3907. +- frequency skill: A=0.3616, D=0.4377, H=0.4053, M=0.1372, Q=0.2595, S=0.2755, T=0.4323, W=0.2534. +- variates skill: multivariate=0.3728, univariate=0.4005. +- Outcome: Fixed E83 + E97weekly3000 - E80overflow3000, coefficient1. Merge1.392576CPU seconds, no optimizer updates. Standalone improves main/first earlier versus E83 and declines at second/third; fixed equal ensemble assessed separately. + +## E104 fixed equal ensemble four-cutoff result +{"composition": "equal quantile mean after each member applies its own fixed rules", "skill_score": 0.3854686334562757, "rel_mase_gmean": 0.736317060829138, "rel_wql_gmean": 0.5128888362858817, "groups": {"term": {"short": 0.36816414362245353, "medium": 0.408440542958879, "long": 0.40638695737391495}, "domain": {"Econ/Fin": 0.1425263103369776, "Energy": 0.24632269833233222, "Healthcare": 0.4841127370370696, "Nature": 0.4419832586228435, "Sales": 0.34402063532792737, "Transport": 0.46813360862898734, "Web/CloudOps": 0.5044110005980553}, "freq": {"A-DEC": 0.3754462639697367, "Q-DEC": 0.19683288984300373, "M": 0.12041158797480767, "W-SUN": 0.10445402624428435, "D": 0.36437209338558496, "H": 0.40083310684490536, "15T": 0.21665767736788544, "W-FRI": 0.012382553366723226, "10T": 0.627237041718931, "W-TUE": 0.6419405160293805, "W-THU": 0.2063343746335743, "W-WED": 0.3296903939083894, "5T": 0.5194953263110145, "10S": 0.42496228760958743}}, "configs": [{"config_id": "m4_yearly__A__short", "leaderboard_key": "m4_yearly/A/short", "dataset": "m4_yearly", "term": "short", "freq": "A-DEC", "prediction_length": 6, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Econ/Fin", "n_cohorts": 3, "skipped_series": 235, "dropped_containers": 11, "metrics": {"mase": 2.795416976588694, "wql": 0.08756880337104156, "wsql_by_level": [0.05252887822448462, 0.07932989461227326, 0.0959700106880147, 0.10455763068237416, 0.1063572505530461, 0.10658406951368415, 0.09915145380020426, 0.08468878326621433, 0.05895125899907835], "n_valid_labels": 1152, "n_masked_labels": 0, "mae_median": 549.2148649295171, "n_mase_elements": 1152, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6126392994384536, "wql": 0.6366998812301077}}, {"config_id": "m4_quarterly__Q__short", "leaderboard_key": "m4_quarterly/Q/short", "dataset": "m4_quarterly", "term": "short", "freq": "Q-DEC", "prediction_length": 8, "seasonality": 4, "n_variates": 1, "n_instances": 192, "domain": "Econ/Fin", "n_cohorts": 3, "dropped_containers": 95, "metrics": {"mase": 1.268227388475534, "wql": 0.07681830668494384, "wsql_by_level": [0.04042083458880533, 0.06359275473978293, 0.08000831523251448, 0.09091168162013274, 0.09651369946150555, 0.09673283523414461, 0.09151898821247428, 0.0778237643192909, 0.05384188675584369], "n_valid_labels": 1536, "n_masked_labels": 0, "mae_median": 519.8114858369032, "n_mase_elements": 1536, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7767149083028737, "wql": 0.8305201817838648}}, {"config_id": "m4_monthly__M__short", "leaderboard_key": "m4_monthly/M/short", "dataset": "m4_monthly", "term": "short", "freq": "M", "prediction_length": 18, "seasonality": 12, "n_variates": 1, "n_instances": 192, "domain": "Econ/Fin", "n_cohorts": 3, "dropped_containers": 499, "metrics": {"mase": 0.9387358782206154, "wql": 0.11285109298383048, "wsql_by_level": [0.06134478839940721, 0.09485179214060362, 0.11540523935164874, 0.12890946874409262, 0.136647556715382, 0.13749452198589188, 0.13098699298148542, 0.11774639704301346, 0.0922730794929493], "n_valid_labels": 3456, "n_masked_labels": 0, "mae_median": 646.7568616337246, "n_mase_elements": 3456, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.816335853241079, "wql": 0.8288358266707591}}, {"config_id": "m4_weekly__W__short", "leaderboard_key": "m4_weekly/W/short", "dataset": "m4_weekly", "term": "short", "freq": "W-SUN", "prediction_length": 13, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Econ/Fin", "n_cohorts": 2, "dropped_containers": 4, "metrics": {"mase": 2.8867052151722588, "wql": 0.05404656893968851, "wsql_by_level": [0.029807414872656677, 0.04605890529290171, 0.05673686200647567, 0.06333934400212216, 0.06718069790237324, 0.0684244799429442, 0.06408761552005404, 0.053931994669479406, 0.036851806248189484], "n_valid_labels": 2496, "n_masked_labels": 0, "mae_median": 333.4642290518834, "n_mase_elements": 2496, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.098295162106453, "wql": 0.7302250057916019}}, {"config_id": "m4_daily__D__short", "leaderboard_key": "m4_daily/D/short", "dataset": "m4_daily", "term": "short", "freq": "D", "prediction_length": 14, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Econ/Fin", "n_cohorts": 2, "dropped_containers": 23, "metrics": {"mase": 3.1936882256260537, "wql": 0.019256542436877896, "wsql_by_level": [0.011530887742870673, 0.016857927154135987, 0.020548250829197437, 0.022889113930561356, 0.02395622004597089, 0.023773593914345643, 0.022079570197996758, 0.01863521994753962, 0.013038098169282733], "n_valid_labels": 2688, "n_masked_labels": 0, "mae_median": 172.77467766262237, "n_mase_elements": 2688, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.023209338914692, "wql": 1.0250642421255833}}, {"config_id": "m4_hourly__H__short", "leaderboard_key": "m4_hourly/H/short", "dataset": "m4_hourly", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Econ/Fin", "n_cohorts": 1, "metrics": {"mase": 1.2094391645761666, "wql": 0.038116260503183425, "wsql_by_level": [0.019263175762145472, 0.03230955303590387, 0.04137014097843697, 0.046555300547802186, 0.048861706646772, 0.04826905847853227, 0.04460205648239837, 0.03699396057937847, 0.024821392017281237], "n_valid_labels": 9216, "n_masked_labels": 0, "mae_median": 391.8570696660835, "n_mase_elements": 9216, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.0001696160920521, "wql": 1.1030515057204093}}, {"config_id": "electricity__T__short", "leaderboard_key": "electricity/15T/short", "dataset": "electricity/15T", "term": "short", "freq": "15T", "prediction_length": 48, "seasonality": 96, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.9824612882781023, "wql": 0.04899481001536353, "wsql_by_level": [0.028395811361843548, 0.044092878604357774, 0.05412045723259588, 0.05992756900431569, 0.06226886608424658, 0.0607567109377272, 0.055284712749889435, 0.0456100312892153, 0.03049625287408038], "n_valid_labels": 9216, "n_masked_labels": 0, "mae_median": 35.737774749823274, "n_mase_elements": 9216, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9154363074357945, "wql": 0.870276133011924}}, {"config_id": "electricity__T__medium", "leaderboard_key": "electricity/15T/medium", "dataset": "electricity/15T", "term": "medium", "freq": "15T", "prediction_length": 480, "seasonality": 96, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.9138171992921842, "wql": 0.06777267665914909, "wsql_by_level": [0.03736362960213149, 0.05831936817269399, 0.07212694659974693, 0.08075107449309941, 0.08507402474802193, 0.0848937494604228, 0.07937858123492646, 0.06702806179388453, 0.04501865382741436], "n_valid_labels": 92160, "n_masked_labels": 0, "mae_median": 50.67895454541528, "n_mase_elements": 92160, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6101086438088109, "wql": 0.5783935026933213}}, {"config_id": "electricity__T__long", "leaderboard_key": "electricity/15T/long", "dataset": "electricity/15T", "term": "long", "freq": "15T", "prediction_length": 720, "seasonality": 96, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.8447145538964363, "wql": 0.06827385263696915, "wsql_by_level": [0.034366406591681255, 0.054758756540683524, 0.06867134398777669, 0.07815171621716906, 0.08360791483416628, 0.08514868000485296, 0.08210597264875295, 0.07291497326855305, 0.05473890963908665], "n_valid_labels": 138240, "n_masked_labels": 0, "mae_median": 58.010600292991874, "n_mase_elements": 138240, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.793087238785798, "wql": 0.6830225886678682}}, {"config_id": "electricity__H__short", "leaderboard_key": "electricity/H/short", "dataset": "electricity/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.0541225658397144, "wql": 0.08072226170236818, "wsql_by_level": [0.052059029989780965, 0.07381706780740498, 0.08940650364012412, 0.09766545900035152, 0.10082063296922232, 0.09910661858775432, 0.09154474356341316, 0.07554767215719776, 0.046532627606064456], "n_valid_labels": 9216, "n_masked_labels": 0, "mae_median": 390.0401897939802, "n_mase_elements": 9216, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.0354875111412227, "wql": 1.135230642035518}}, {"config_id": "electricity__H__medium", "leaderboard_key": "electricity/H/medium", "dataset": "electricity/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.987906550246096, "wql": 0.05831413221480887, "wsql_by_level": [0.035281333139195646, 0.05204886496969009, 0.06226172565504222, 0.06849759857719877, 0.07160528468705928, 0.07136948746888597, 0.06706557636024374, 0.05729945878038814, 0.03939786029557599], "n_valid_labels": 91680, "n_masked_labels": 480, "mae_median": 123.75324168954644, "n_mase_elements": 91680, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 1}, "relative": {"mase": 0.8019251745922997, "wql": 0.5430069851629276}}, {"config_id": "electricity__H__long", "leaderboard_key": "electricity/H/long", "dataset": "electricity/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.1658983357361172, "wql": 0.07357137105462702, "wsql_by_level": [0.03806675818908281, 0.059142989437638696, 0.07342462305723155, 0.08285541620257916, 0.08838165621663885, 0.09018932974142142, 0.08792010941992093, 0.07996623752695645, 0.06219521970017341], "n_valid_labels": 138240, "n_masked_labels": 0, "mae_median": 186.11038970290943, "n_mase_elements": 138240, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8774867972029426, "wql": 0.5455441107583858}}, {"config_id": "electricity__D__short", "leaderboard_key": "electricity/D/short", "dataset": "electricity/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.5099228588256168, "wql": 0.07527743513872845, "wsql_by_level": [0.028622408054189894, 0.04768450605964861, 0.06725250904152086, 0.08213824752270928, 0.09297724078143454, 0.09881426714227798, 0.09865420796317632, 0.09083260698582611, 0.07052092269777245], "n_valid_labels": 5760, "n_masked_labels": 0, "mae_median": 7288.701407634384, "n_mase_elements": 5760, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8926983627507425, "wql": 0.79849359571092}}, {"config_id": "electricity__W__short", "leaderboard_key": "electricity/W/short", "dataset": "electricity/W", "term": "short", "freq": "W-FRI", "prediction_length": 8, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.4392953288002797, "wql": 0.07420910508641608, "wsql_by_level": [0.028263841036851898, 0.04947998113827854, 0.07029779814024846, 0.08377757347254892, 0.09415267782839486, 0.09698646132937698, 0.09468528173713849, 0.08549470200807237, 0.06474362908683412], "n_valid_labels": 1528, "n_masked_labels": 8, "mae_median": 51115.92140796921, "n_mase_elements": 1528, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 1}, "relative": {"mase": 1.0668448666538084, "wql": 1.0087383094433606}}, {"config_id": "solar__T__short", "leaderboard_key": "solar/10T/short", "dataset": "solar/10T", "term": "short", "freq": "10T", "prediction_length": 48, "seasonality": 144, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.01781347502043181, "wql": 0.42143977766900104, "wsql_by_level": [0.17504993687835133, 0.3294048479026965, 0.42535470871197667, 0.47927406289283053, 0.5120761379588328, 0.5104829060919627, 0.5115224252725261, 0.4839584145927364, 0.36583455871909654], "n_valid_labels": 6576, "n_masked_labels": 0, "mae_median": 0.04948667653070405, "n_mase_elements": 6576, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.1120657611865516, "wql": 0.03477638127025891}}, {"config_id": "solar__T__medium", "leaderboard_key": "solar/10T/medium", "dataset": "solar/10T", "term": "medium", "freq": "10T", "prediction_length": 480, "seasonality": 144, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.6985151810314955, "wql": 0.2855006101463456, "wsql_by_level": [0.2169575653904273, 0.3172811042774564, 0.3523149180545522, 0.35215603486356883, 0.3379716322295703, 0.318100703509344, 0.28609829522194585, 0.2334167585437219, 0.15520847922652367], "n_valid_labels": 65760, "n_masked_labels": 0, "mae_median": 1.6148956313713991, "n_mase_elements": 65760, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8384101144161774, "wql": 0.5052721781327353}}, {"config_id": "solar__T__long", "leaderboard_key": "solar/10T/long", "dataset": "solar/10T", "term": "long", "freq": "10T", "prediction_length": 720, "seasonality": 144, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.6978424350693991, "wql": 0.22233494197166248, "wsql_by_level": [0.166332992574431, 0.2595059797989555, 0.29659837268966455, 0.29931074035142674, 0.27858571503504526, 0.24242162336894557, 0.19627915034004179, 0.1502371646644031, 0.11174273892204904], "n_valid_labels": 98640, "n_masked_labels": 0, "mae_median": 1.6368925869296436, "n_mase_elements": 98640, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.32577257090458905, "wql": 0.24615579268877133}}, {"config_id": "solar__H__short", "leaderboard_key": "solar/H/short", "dataset": "solar/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.8617467091885954, "wql": 0.3293434646453593, "wsql_by_level": [0.21653214324107156, 0.3608860084185891, 0.4238913877404794, 0.4319325450630538, 0.4078626713071489, 0.3677051265706955, 0.31726362737950115, 0.25946595473130807, 0.1785517173563864], "n_valid_labels": 6576, "n_masked_labels": 0, "mae_median": 11.249563878051452, "n_mase_elements": 6576, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8153283079097247, "wql": 0.546812071142352}}, {"config_id": "solar__H__medium", "leaderboard_key": "solar/H/medium", "dataset": "solar/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.2022744177567275, "wql": 0.4450076691075868, "wsql_by_level": [0.45330812773553775, 0.5680630656352184, 0.5907064246201226, 0.5694126752918893, 0.523723531935585, 0.46059598495992393, 0.38173554779181534, 0.28563632923846516, 0.1718873347597239], "n_valid_labels": 65760, "n_masked_labels": 0, "mae_median": 15.694438455592719, "n_mase_elements": 65760, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8723069938406994, "wql": 0.45972699007357887}}, {"config_id": "solar__H__long", "leaderboard_key": "solar/H/long", "dataset": "solar/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.0399757532265896, "wql": 0.3554566364255842, "wsql_by_level": [0.4236411108275793, 0.4641399602000191, 0.4632445721303884, 0.44104649567727083, 0.40539762952064134, 0.35730628180110435, 0.2962660494071995, 0.2203389636641255, 0.12772866460192975], "n_valid_labels": 98640, "n_masked_labels": 0, "mae_median": 13.666343091270907, "n_mase_elements": 98640, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9698189740538452, "wql": 0.3937320083199028}}, {"config_id": "solar__D__short", "leaderboard_key": "solar/D/short", "dataset": "solar/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.1393415951992427, "wql": 0.28779881110159267, "wsql_by_level": [0.246847555738178, 0.35144868180361505, 0.3848117555811675, 0.3828138817256278, 0.3563405183132376, 0.3142248147378668, 0.25713374018742813, 0.18831075367532824, 0.1082575981518845], "n_valid_labels": 4110, "n_masked_labels": 0, "mae_median": 288.3019393257271, "n_mase_elements": 4110, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9762506655223895, "wql": 0.6104917515406019}}, {"config_id": "solar__W__short", "leaderboard_key": "solar/W/short", "dataset": "solar/W", "term": "short", "freq": "W-FRI", "prediction_length": 8, "seasonality": 1, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.0268852032580833, "wql": 0.12052706700107489, "wsql_by_level": [0.05818950699285998, 0.11595881963990586, 0.14642893441175975, 0.15527060942685042, 0.15356069013241036, 0.14427571098979933, 0.12882774565443475, 0.1071060410364652, 0.0751255447251884], "n_valid_labels": 1096, "n_masked_labels": 0, "mae_median": 942.9758961252923, "n_mase_elements": 1096, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.0188790216573897, "wql": 0.8676660533162098}}, {"config_id": "hospital__M__short", "leaderboard_key": "hospital/M/short", "dataset": "hospital", "term": "short", "freq": "M", "prediction_length": 12, "seasonality": 12, "n_variates": 1, "n_instances": 192, "domain": "Healthcare", "n_cohorts": 1, "metrics": {"mase": 0.7847733130457222, "wql": 0.053420509620148826, "wsql_by_level": [0.027790076786016814, 0.04430160082100439, 0.05484753898873574, 0.06334639970768964, 0.06797641550890926, 0.06789033535039125, 0.06360322310563211, 0.05369613414971308, 0.03733286216324714], "n_valid_labels": 2304, "n_masked_labels": 0, "mae_median": 24.31328149450322, "n_mase_elements": 2304, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8685161977502073, "wql": 0.9428099884765189}}, {"config_id": "covid_deaths__D__short", "leaderboard_key": "covid_deaths/D/short", "dataset": "covid_deaths", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Healthcare", "n_cohorts": 1, "metrics": {"mase": 38.23095597530944, "wql": 0.07565835856235899, "wsql_by_level": [0.06488312664714146, 0.09355169771892499, 0.10868264832032903, 0.10597437880207744, 0.09027346424775537, 0.056965212817616045, 0.04246456866517384, 0.053367319049436694, 0.06476281079277596], "n_valid_labels": 5760, "n_masked_labels": 0, "mae_median": 119.48539306917745, "n_mase_elements": 4980, "n_seasonal_error_zero": 26, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8523760722942941, "wql": 0.601940457311472}}, {"config_id": "us_births__D__short", "leaderboard_key": "us_births/D/short", "dataset": "us_births/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 1, "domain": "Healthcare", "n_cohorts": 1, "metrics": {"mase": 0.4683471073212719, "wql": 0.02690163787960409, "wsql_by_level": [0.012519404448211847, 0.018547585448283086, 0.024551840767867615, 0.02741222552467023, 0.030394372626209108, 0.03538051003031574, 0.037291790440225105, 0.03347683644816188, 0.022540175182492208], "n_valid_labels": 30, "n_masked_labels": 0, "mae_median": 309.30022786458335, "n_mase_elements": 30, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.2011708799119241, "wql": 0.20603760414131309}}, {"config_id": "us_births__M__short", "leaderboard_key": "us_births/M/short", "dataset": "us_births/M", "term": "short", "freq": "M", "prediction_length": 12, "seasonality": 12, "n_variates": 1, "n_instances": 1, "domain": "Healthcare", "n_cohorts": 1, "metrics": {"mase": 0.2632496713784672, "wql": 0.007624636894155283, "wsql_by_level": [0.005740636266914142, 0.00669562959867952, 0.006415264111996609, 0.007365210476773466, 0.007865769392696903, 0.007709336643382707, 0.009020174329738895, 0.009829421143081944, 0.007980290084133368], "n_valid_labels": 12, "n_masked_labels": 0, "mae_median": 2469.2708333333335, "n_mase_elements": 12, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8707902315739978, "wql": 0.686792676525858}}, {"config_id": "us_births__W__short", "leaderboard_key": "us_births/W/short", "dataset": "us_births/W", "term": "short", "freq": "W-TUE", "prediction_length": 8, "seasonality": 1, "n_variates": 1, "n_instances": 1, "domain": "Healthcare", "n_cohorts": 1, "metrics": {"mase": 1.3439668302592565, "wql": 0.015538928857283843, "wsql_by_level": [0.008149730706929493, 0.015485149708547646, 0.018908646300848733, 0.01980101172362688, 0.019660444668581117, 0.0187701796519375, 0.016784749749211507, 0.013938410631079623, 0.0083520365747921], "n_valid_labels": 8, "n_masked_labels": 0, "mae_median": 1462.5478515625, "n_mase_elements": 8, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.3483189786698818, "wql": 0.3680723759322161}}, {"config_id": "saugeenday__D__short", "leaderboard_key": "saugeen/D/short", "dataset": "saugeenday/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 3.2379394826019117, "wql": 0.32258585175584387, "wsql_by_level": [0.15009877492359122, 0.2699071963054936, 0.36480964084176287, 0.429573899167784, 0.45823803356515874, 0.42717553516290857, 0.3351583385200374, 0.2215160947494623, 0.24679515256639606], "n_valid_labels": 30, "n_masked_labels": 0, "mae_median": 14.235928344726563, "n_mase_elements": 30, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8305675631954952, "wql": 0.5953264411491401}}, {"config_id": "saugeenday__M__short", "leaderboard_key": "saugeen/M/short", "dataset": "saugeenday/M", "term": "short", "freq": "M", "prediction_length": 12, "seasonality": 12, "n_variates": 1, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.447265017966201, "wql": 0.2307741278381414, "wsql_by_level": [0.11948748410211966, 0.20558068850434347, 0.25366673650790045, 0.2711589268222958, 0.2666016298699337, 0.25080164410889916, 0.2536812298869933, 0.2631835026219238, 0.19280530811886343], "n_valid_labels": 12, "n_masked_labels": 0, "mae_median": 7.753377676010132, "n_mase_elements": 12, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.346044379035233, "wql": 0.882496776385616}}, {"config_id": "saugeenday__W__short", "leaderboard_key": "saugeen/W/short", "dataset": "saugeenday/W", "term": "short", "freq": "W-THU", "prediction_length": 8, "seasonality": 1, "n_variates": 1, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.7330330272586232, "wql": 0.24147546142758547, "wsql_by_level": [0.10751263398587159, 0.18331227585741458, 0.2502510695301909, 0.3133840201557028, 0.3592666151397, 0.36245011569972874, 0.2884292388494765, 0.13843016727866211, 0.1702430163515221], "n_valid_labels": 8, "n_masked_labels": 0, "mae_median": 8.785351753234863, "n_mase_elements": 8, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.2892549439821193, "wql": 0.4028557997401655}}, {"config_id": "temperature_rain_with_missing__D__short", "leaderboard_key": "temperature_rain/D/short", "dataset": "temperature_rain_with_missing", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 1.9559930019720881, "wql": 0.4947299668702683, "wsql_by_level": [0.1802116378075862, 0.33158236937698643, 0.4579114859648925, 0.5564406030720168, 0.6162810537447235, 0.6492325225743822, 0.6515226891383746, 0.5857612147562478, 0.42362612539720557], "n_valid_labels": 5760, "n_masked_labels": 0, "mae_median": 6.430995614538632, "n_mase_elements": 5760, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6695614586247304, "wql": 0.4691966328995636}}, {"config_id": "kdd_cup_2018_with_missing__H__short", "leaderboard_key": "kdd_cup_2018/H/short", "dataset": "kdd_cup_2018_with_missing/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Nature", "n_cohorts": 2, "metrics": {"mase": 0.5205984182413413, "wql": 0.37434376546657755, "wsql_by_level": [0.14874802649519717, 0.249307214916932, 0.33521712975229895, 0.410567172978763, 0.4656408160355961, 0.490297506901656, 0.48628563319462764, 0.44844947895039156, 0.3345809099737359], "n_valid_labels": 8214, "n_masked_labels": 1002, "mae_median": 11.944559938516282, "n_mase_elements": 8214, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7847300683952065, "wql": 0.5948636206793396}}, {"config_id": "kdd_cup_2018_with_missing__H__medium", "leaderboard_key": "kdd_cup_2018/H/medium", "dataset": "kdd_cup_2018_with_missing/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Nature", "n_cohorts": 2, "metrics": {"mase": 0.9403458002900037, "wql": 0.46836186898669285, "wsql_by_level": [0.18146211048472, 0.33377540218943186, 0.4570456131597061, 0.5504150893516991, 0.6088735954505923, 0.6247770468735193, 0.5930208842717021, 0.5088418252502578, 0.35704525384860764], "n_valid_labels": 83394, "n_masked_labels": 8766, "mae_median": 20.235989950861445, "n_mase_elements": 83394, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.730416022325679, "wql": 0.4444610118863832}}, {"config_id": "kdd_cup_2018_with_missing__H__long", "leaderboard_key": "kdd_cup_2018/H/long", "dataset": "kdd_cup_2018_with_missing/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Nature", "n_cohorts": 2, "metrics": {"mase": 0.8626181081013944, "wql": 0.48346631841404303, "wsql_by_level": [0.1879849503192842, 0.33672916352113014, 0.46084527271172426, 0.5559294727548728, 0.6193657068681274, 0.6438925278545381, 0.6255484892201704, 0.5490170982348758, 0.37188418424166453], "n_valid_labels": 125466, "n_masked_labels": 12774, "mae_median": 18.72813091088498, "n_mase_elements": 125466, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8894528621182541, "wql": 0.3782618005091297}}, {"config_id": "kdd_cup_2018_with_missing__D__short", "leaderboard_key": "kdd_cup_2018/D/short", "dataset": "kdd_cup_2018_with_missing/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Nature", "n_cohorts": 2, "metrics": {"mase": 1.0411937701254517, "wql": 0.4017401138759986, "wsql_by_level": [0.17039599861666724, 0.30036137669036833, 0.3951034986671659, 0.4626857576284326, 0.5043410347516797, 0.5198680964731249, 0.5064294526635623, 0.4485036332408756, 0.3079721761521109], "n_valid_labels": 5469, "n_masked_labels": 291, "mae_median": 14.86369142490634, "n_mase_elements": 5469, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8448323206680709, "wql": 0.4519564588216427}}, {"config_id": "car_parts_with_missing__M__short", "leaderboard_key": "car_parts/M/short", "dataset": "car_parts_with_missing", "term": "short", "freq": "M", "prediction_length": 12, "seasonality": 12, "n_variates": 1, "n_instances": 192, "domain": "Sales", "n_cohorts": 1, "metrics": {"mase": 1.4856197613408295, "wql": 1.1765739846415382, "wsql_by_level": [0.347378921593696, 0.6162032901660557, 0.8861393399177081, 1.163433632451788, 1.3996605600026089, 1.579024745281525, 1.6780076107891573, 1.620651945864646, 1.2986658157066575], "n_valid_labels": 2244, "n_masked_labels": 60, "mae_median": 0.6567925889851814, "n_mase_elements": 2088, "n_seasonal_error_zero": 14, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9767913606049345, "wql": 0.7210111618390951}}, {"config_id": "restaurant__D__short", "leaderboard_key": "restaurant/D/short", "dataset": "restaurant", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Sales", "n_cohorts": 13, "skipped_series": 1, "metrics": {"mase": 0.699855230782104, "wql": 0.27002494185730236, "wsql_by_level": [0.14043272840861099, 0.2258430954556171, 0.28520270278041004, 0.3234761507573261, 0.34280856791706654, 0.3415619693520698, 0.31838648863722496, 0.2699097244944028, 0.1826030489129928], "n_valid_labels": 5052, "n_masked_labels": 708, "mae_median": 7.281492835717454, "n_mase_elements": 5052, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.709182128880753, "wql": 0.40231357659350614}}, {"config_id": "hierarchical_sales__D__short", "leaderboard_key": "hierarchical_sales/D/short", "dataset": "hierarchical_sales/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 118, "domain": "Sales", "n_cohorts": 1, "metrics": {"mase": 0.9601874654243095, "wql": 0.6321255477753337, "wsql_by_level": [0.19862388530516814, 0.3730169278374515, 0.5264879563294177, 0.6595736148618315, 0.7652012576813627, 0.8399677859584039, 0.8725574744659007, 0.8262736512102663, 0.6274273763282014], "n_valid_labels": 3304, "n_masked_labels": 236, "mae_median": 3.000821033830937, "n_mase_elements": 3304, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8763760759910977, "wql": 0.4333250079859994}}, {"config_id": "hierarchical_sales__W__short", "leaderboard_key": "hierarchical_sales/W/short", "dataset": "hierarchical_sales/W", "term": "short", "freq": "W-WED", "prediction_length": 8, "seasonality": 1, "n_variates": 1, "n_instances": 118, "domain": "Sales", "n_cohorts": 1, "metrics": {"mase": 0.8202442974975183, "wql": 0.40248813326840344, "wsql_by_level": [0.1461635361113414, 0.2613576072043297, 0.3528116270399404, 0.4256032260565851, 0.4830573802552875, 0.5212339277970817, 0.5351582677907385, 0.5065778532959115, 0.3904297738644151], "n_valid_labels": 944, "n_masked_labels": 0, "mae_median": 11.794992176784298, "n_mase_elements": 944, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8241952573447494, "wql": 0.5451559736781498}}, {"config_id": "LOOP_SEATTLE__T__short", "leaderboard_key": "loop_seattle/5T/short", "dataset": "LOOP_SEATTLE/5T", "term": "short", "freq": "5T", "prediction_length": 48, "seasonality": 288, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.42519817427238726, "wql": 0.031181385576846916, "wsql_by_level": [0.019991528972427054, 0.02862708174718625, 0.034158205344288976, 0.037402554486037624, 0.0387730100623944, 0.038081308079914646, 0.035126824198851936, 0.02929620986760633, 0.019175747432914985], "n_valid_labels": 9216, "n_masked_labels": 0, "mae_median": 2.516321830658449, "n_mase_elements": 9216, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6679218720728912, "wql": 0.5267364609894027}}, {"config_id": "LOOP_SEATTLE__T__medium", "leaderboard_key": "loop_seattle/5T/medium", "dataset": "LOOP_SEATTLE/5T", "term": "medium", "freq": "5T", "prediction_length": 480, "seasonality": 288, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.6153700402510184, "wql": 0.05035107470783137, "wsql_by_level": [0.03952728883626551, 0.05328890428855708, 0.060342494227199305, 0.0630604828177886, 0.062388730693246866, 0.05825063883612515, 0.05095447011576748, 0.04017562129751607, 0.025171041258016308], "n_valid_labels": 92160, "n_masked_labels": 0, "mae_median": 3.792207310537601, "n_mase_elements": 92160, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.3930037647961648, "wql": 0.3676395081796952}}, {"config_id": "LOOP_SEATTLE__T__long", "leaderboard_key": "loop_seattle/5T/long", "dataset": "LOOP_SEATTLE/5T", "term": "long", "freq": "5T", "prediction_length": 720, "seasonality": 288, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.6761649990417691, "wql": 0.0572653168383857, "wsql_by_level": [0.04464085282520972, 0.06137228261772506, 0.06953601879031288, 0.07232146505861785, 0.07082666909956455, 0.06575204178086193, 0.057327744747106474, 0.04516514571291398, 0.028445630913158826], "n_valid_labels": 138240, "n_masked_labels": 0, "mae_median": 4.172172207085209, "n_mase_elements": 138240, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.42402706126430506, "wql": 0.38779650693166234}}, {"config_id": "LOOP_SEATTLE__H__short", "leaderboard_key": "loop_seattle/H/short", "dataset": "LOOP_SEATTLE/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.6765087096621438, "wql": 0.043084712418972035, "wsql_by_level": [0.03528189165819572, 0.04652347491581842, 0.05148850420576167, 0.05320583232573008, 0.05219769809306395, 0.04947828167100879, 0.04395338924341385, 0.03450724079183582, 0.021126098865920005], "n_valid_labels": 9216, "n_masked_labels": 0, "mae_median": 3.1703119290889137, "n_mase_elements": 9216, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.3365815681101067, "wql": 0.3199350052903054}}, {"config_id": "LOOP_SEATTLE__H__medium", "leaderboard_key": "loop_seattle/H/medium", "dataset": "LOOP_SEATTLE/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.7292184192203195, "wql": 0.05217279238334474, "wsql_by_level": [0.04425665343251407, 0.05828015503094614, 0.0639051096731201, 0.06473293891349434, 0.062383728766628496, 0.05750692334672778, 0.05049835212803286, 0.04099334550485246, 0.026997924653786365], "n_valid_labels": 92160, "n_masked_labels": 0, "mae_median": 3.477931014522134, "n_mase_elements": 92160, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6389119611838323, "wql": 0.3503693234376778}}, {"config_id": "LOOP_SEATTLE__H__long", "leaderboard_key": "loop_seattle/H/long", "dataset": "LOOP_SEATTLE/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.716336874401693, "wql": 0.05060183047334479, "wsql_by_level": [0.042326896443685355, 0.05512505028509922, 0.06045247252338499, 0.06163221696794006, 0.06009255595339377, 0.056268611642367385, 0.05016698696722147, 0.041354068187107, 0.027997615289903844], "n_valid_labels": 138240, "n_masked_labels": 0, "mae_median": 3.373641640123808, "n_mase_elements": 138240, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.5728641867081193, "wql": 0.2878770265416452}}, {"config_id": "LOOP_SEATTLE__D__short", "leaderboard_key": "loop_seattle/D/short", "dataset": "LOOP_SEATTLE/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.6223643606000772, "wql": 0.027812585959345843, "wsql_by_level": [0.020193561936795393, 0.028768861819276254, 0.03316673265530382, 0.03484293197107184, 0.03434676837941751, 0.032068569956341296, 0.028439043963701557, 0.023200065216247664, 0.015286737735957246], "n_valid_labels": 5760, "n_masked_labels": 0, "mae_median": 1.9391787310441335, "n_mase_elements": 5760, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.5152328993290893, "wql": 0.3111097947854181}}, {"config_id": "SZ_TAXI__T__short", "leaderboard_key": "sz_taxi/15T/short", "dataset": "SZ_TAXI/15T", "term": "short", "freq": "15T", "prediction_length": 48, "seasonality": 96, "n_variates": 1, "n_instances": 156, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.5228579784923939, "wql": 0.1970768936004838, "wsql_by_level": [0.10235310180573008, 0.16716537193245276, 0.21124872256221705, 0.2388910729780476, 0.2508754203710049, 0.24788375961668113, 0.22992413632960368, 0.19350285463576386, 0.13184760217285352], "n_valid_labels": 7488, "n_masked_labels": 0, "mae_median": 2.807908297890408, "n_mase_elements": 7488, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.721074961455623, "wql": 0.6518174809201931}}, {"config_id": "SZ_TAXI__T__medium", "leaderboard_key": "sz_taxi/15T/medium", "dataset": "SZ_TAXI/15T", "term": "medium", "freq": "15T", "prediction_length": 480, "seasonality": 96, "n_variates": 1, "n_instances": 156, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.4667788179289419, "wql": 0.19457245178550936, "wsql_by_level": [0.10116326516600097, 0.16112263364312396, 0.20181353850447256, 0.22790857986297222, 0.24114373914778028, 0.24148401288875812, 0.22849603678209912, 0.20024771765220972, 0.14777254242216753], "n_valid_labels": 74880, "n_masked_labels": 0, "mae_median": 2.6688034212137905, "n_mase_elements": 74880, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7350787932775339, "wql": 0.49685998962622685}}, {"config_id": "SZ_TAXI__T__long", "leaderboard_key": "sz_taxi/15T/long", "dataset": "SZ_TAXI/15T", "term": "long", "freq": "15T", "prediction_length": 720, "seasonality": 96, "n_variates": 1, "n_instances": 156, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.4980129818863368, "wql": 0.21872471124890402, "wsql_by_level": [0.115304589447597, 0.1808413247621152, 0.2239024911223661, 0.25036149025498944, 0.2633789287653999, 0.26498570979372804, 0.2558955406474298, 0.23366484942790997, 0.18018747701860072], "n_valid_labels": 112320, "n_masked_labels": 0, "mae_median": 2.92501272927982, "n_mase_elements": 112320, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.818532286161662, "wql": 0.4804784573972439}}, {"config_id": "SZ_TAXI__H__short", "leaderboard_key": "sz_taxi/H/short", "dataset": "SZ_TAXI/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 156, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.4818650986186548, "wql": 0.13137636241942816, "wsql_by_level": [0.07027531157556749, 0.10955661008410027, 0.13567807139460025, 0.15209392037294905, 0.15971802754840733, 0.15941767608567592, 0.15145593641185795, 0.13686964832319354, 0.10732205997850143], "n_valid_labels": 7488, "n_masked_labels": 0, "mae_median": 1.7657058466388544, "n_mase_elements": 7488, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7916113352519928, "wql": 0.6361103130073918}}, {"config_id": "M_DENSE__H__short", "leaderboard_key": "m_dense/H/short", "dataset": "M_DENSE/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 30, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.70816880088421, "wql": 0.12777595583992035, "wsql_by_level": [0.0940416557167201, 0.12730103163408915, 0.14547232558437032, 0.15496933303481944, 0.15639081556034648, 0.14938035993420723, 0.13527714716477465, 0.11226154476456596, 0.07488938916538992], "n_valid_labels": 1440, "n_masked_labels": 0, "mae_median": 98.50395038790172, "n_mase_elements": 1440, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8098302153525787, "wql": 0.6730978396901373}}, {"config_id": "M_DENSE__H__medium", "leaderboard_key": "m_dense/H/medium", "dataset": "M_DENSE/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 1, "n_instances": 30, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.7813052589383122, "wql": 0.13916150958667817, "wsql_by_level": [0.0839468237473706, 0.12200603082797291, 0.1442479668226164, 0.1581304855238339, 0.16666886566377695, 0.16843687032708576, 0.1611353821990735, 0.14238774187967418, 0.10549341928869949], "n_valid_labels": 14400, "n_masked_labels": 0, "mae_median": 97.8280440486802, "n_mase_elements": 14400, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6668565885084394, "wql": 0.39789275746283403}}, {"config_id": "M_DENSE__H__long", "leaderboard_key": "m_dense/H/long", "dataset": "M_DENSE/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 1, "n_instances": 30, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 1.0764692554309299, "wql": 0.17809570501739747, "wsql_by_level": [0.08815323250629209, 0.1410735540862456, 0.17854143324240113, 0.20517321300852073, 0.22310047192928828, 0.2285954304677697, 0.2190965517658008, 0.18834030598237086, 0.13078715216788814], "n_valid_labels": 21600, "n_masked_labels": 0, "mae_median": 130.75150047112393, "n_mase_elements": 21600, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9962526555087059, "wql": 0.4636470652582325}}, {"config_id": "M_DENSE__D__short", "leaderboard_key": "m_dense/D/short", "dataset": "M_DENSE/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 30, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 1.033643950960055, "wql": 0.09542454774756803, "wsql_by_level": [0.06347547236550455, 0.09393188407318352, 0.11335914009161366, 0.12391438627455373, 0.12531051830391837, 0.1169795823579093, 0.10132838913546541, 0.07562780002886973, 0.04489375709709404], "n_valid_labels": 900, "n_masked_labels": 0, "mae_median": 73.44017768436008, "n_mase_elements": 900, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.025757335852437, "wql": 0.47901057475682746}}, {"config_id": "ett1__T__short", "leaderboard_key": "ett1/15T/short", "dataset": "ett1/15T", "term": "short", "freq": "15T", "prediction_length": 48, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.7877373638727412, "wql": 0.27766561273673457, "wsql_by_level": [0.17115798799986884, 0.26325074213497096, 0.31732494743666456, 0.3486148190888516, 0.35724245077913813, 0.35352405536602427, 0.31859189379715164, 0.24150481804585935, 0.12777879998208178], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 1.3056446033006068, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6534624112178543, "wql": 0.577214746526443}}, {"config_id": "ett1__T__medium", "leaderboard_key": "ett1/15T/medium", "dataset": "ett1/15T", "term": "medium", "freq": "15T", "prediction_length": 480, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.9498380421522724, "wql": 0.3705354577532055, "wsql_by_level": [0.18479904170851444, 0.3262891631785495, 0.43720298942516617, 0.4902123894444339, 0.49835194618526213, 0.4725493348123783, 0.410498000302961, 0.3181601290123875, 0.19675612570919634], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 1.6250812006056377, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.2262810923768237, "wql": 0.8446611031596755}}, {"config_id": "ett1__T__long", "leaderboard_key": "ett1/15T/long", "dataset": "ett1/15T", "term": "long", "freq": "15T", "prediction_length": 720, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.307144751187593, "wql": 0.484231353164451, "wsql_by_level": [0.32044519379308123, 0.4796127755126053, 0.5892257298256933, 0.6426452886050719, 0.6392561091822294, 0.5873755132834569, 0.49750931033550294, 0.37792387166450886, 0.22408838627790922], "n_valid_labels": 5040, "n_masked_labels": 0, "mae_median": 2.1915924136447886, "n_mase_elements": 5040, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9849832397532534, "wql": 0.8353424856889321}}, {"config_id": "ett1__H__short", "leaderboard_key": "ett1/H/short", "dataset": "ett1/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.7726356581245624, "wql": 0.34251968289765683, "wsql_by_level": [0.19759934766088905, 0.3031639190338136, 0.3731717231822459, 0.42378386420456776, 0.44475795105448696, 0.44057830291431305, 0.40092626065039877, 0.31933512444671125, 0.17936065293148531], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 5.374857471989734, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7399586764835896, "wql": 0.6790479669247866}}, {"config_id": "ett1__H__medium", "leaderboard_key": "ett1/H/medium", "dataset": "ett1/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.3991428670417723, "wql": 0.4332363035852189, "wsql_by_level": [0.30410618415640356, 0.4704771858545054, 0.5392114172157767, 0.5576007510909506, 0.5436870557396306, 0.5015203970655315, 0.43198146856622777, 0.33937526714055377, 0.21116700543738964], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 8.319531202429374, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.1434762057287606, "wql": 0.7877949971718228}}, {"config_id": "ett1__H__long", "leaderboard_key": "ett1/H/long", "dataset": "ett1/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.436061394009377, "wql": 0.4187041967200971, "wsql_by_level": [0.3100586483740042, 0.47347088300421175, 0.5447297538736405, 0.5578969570024439, 0.5319711553700133, 0.4751547539889456, 0.3955262397911802, 0.2974199205118426, 0.18210945856459188], "n_valid_labels": 5040, "n_masked_labels": 0, "mae_median": 8.957151509213837, "n_mase_elements": 5040, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.0027919313374156, "wql": 0.7239955943608372}}, {"config_id": "ett1__D__short", "leaderboard_key": "ett1/D/short", "dataset": "ett1/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.7379944124041118, "wql": 0.33756847378928573, "wsql_by_level": [0.1620133170878742, 0.2962002627857162, 0.3988072918909074, 0.4513767846788654, 0.4528711596212441, 0.4241558967561161, 0.36387028038267033, 0.2908148576147514, 0.19800641328542687], "n_valid_labels": 210, "n_masked_labels": 0, "mae_median": 143.75229959487916, "n_mase_elements": 210, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9558890891083643, "wql": 0.6956112870175899}}, {"config_id": "ett1__W__short", "leaderboard_key": "ett1/W/short", "dataset": "ett1/W", "term": "short", "freq": "W-THU", "prediction_length": 8, "seasonality": 1, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.0401542904755747, "wql": 0.19655578741796256, "wsql_by_level": [0.1417659685354361, 0.19202323511237912, 0.23171246827783198, 0.23833150059355862, 0.2226324734280471, 0.21453460320583057, 0.21010518507123527, 0.1822399923304321, 0.13565666020691236], "n_valid_labels": 56, "n_masked_labels": 0, "mae_median": 555.6324206760952, "n_mase_elements": 56, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8358595974022779, "wql": 0.7614204440831972}}, {"config_id": "ett2__T__short", "leaderboard_key": "ett2/15T/short", "dataset": "ett2/15T", "term": "short", "freq": "15T", "prediction_length": 48, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.0694336064769143, "wql": 0.1300259440329757, "wsql_by_level": [0.07024619154982942, 0.10910481518272273, 0.1369538766922629, 0.1554215670776755, 0.16554360726393702, 0.16515344449365948, 0.15417793517110404, 0.13000491823775007, 0.08362714062784012], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 2.6415581504503884, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.403778404354072, "wql": 1.3842912839493247}}, {"config_id": "ett2__T__medium", "leaderboard_key": "ett2/15T/medium", "dataset": "ett2/15T", "term": "medium", "freq": "15T", "prediction_length": 480, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.8013788268197071, "wql": 0.09589557037266866, "wsql_by_level": [0.062442344077559137, 0.09532673585996267, 0.11402786174212132, 0.1225096423836964, 0.12218240427468238, 0.11474202571235899, 0.1006774633802991, 0.07950371576259843, 0.051647940160739494], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 1.8594081902516164, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8877389913113496, "wql": 0.7025782241924592}}, {"config_id": "ett2__T__long", "leaderboard_key": "ett2/15T/long", "dataset": "ett2/15T", "term": "long", "freq": "15T", "prediction_length": 720, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.0070280976302255, "wql": 0.12508008701264237, "wsql_by_level": [0.0861425888728795, 0.1261291943561307, 0.15091368842654168, 0.1631320691714223, 0.16156487527481217, 0.1485440862740269, 0.12629619158849958, 0.09799194762903372, 0.06500614152043467], "n_valid_labels": 5040, "n_masked_labels": 0, "mae_median": 2.4367197962529543, "n_mase_elements": 5040, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9530875983260918, "wql": 0.7464822626784796}}, {"config_id": "ett2__H__short", "leaderboard_key": "ett2/H/short", "dataset": "ett2/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.7005212020970276, "wql": 0.0760180875396463, "wsql_by_level": [0.05297798128578211, 0.07899861436753486, 0.09249208354052788, 0.09768586778808594, 0.09564036146174022, 0.08604012801734809, 0.0730743783629783, 0.06183555113359217, 0.045417821899227155], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 5.863916364454088, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7064821802191489, "wql": 0.637125813789166}}, {"config_id": "ett2__H__medium", "leaderboard_key": "ett2/H/medium", "dataset": "ett2/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 2.6997179603989685, "wql": 0.26034717331086205, "wsql_by_level": [0.10473916331099253, 0.18863697282489295, 0.26186317542946996, 0.3193415719452675, 0.35743111979962355, 0.36208092114892465, 0.330859277439312, 0.2626379885729415, 0.15553436932633372], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 20.329321246146268, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.0191178708314248, "wql": 0.7528429238363763}}, {"config_id": "ett2__H__long", "leaderboard_key": "ett2/H/long", "dataset": "ett2/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 3.2217239655101504, "wql": 0.3559165218046931, "wsql_by_level": [0.2900237568768538, 0.39104001404476496, 0.43848327271807586, 0.4553130903730483, 0.44681216585979033, 0.4122155914838351, 0.35228942504880745, 0.26646637709171755, 0.15060500274534422], "n_valid_labels": 5040, "n_masked_labels": 0, "mae_median": 25.212170086302315, "n_mase_elements": 5040, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.0157463673452953, "wql": 0.9611658017781922}}, {"config_id": "ett2__D__short", "leaderboard_key": "ett2/D/short", "dataset": "ett2/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 4.734661744814033, "wql": 0.32867900858724947, "wsql_by_level": [0.3016735859700118, 0.39890578527586945, 0.4314240723591547, 0.430661558111209, 0.40573626215401437, 0.3589212649061593, 0.29505514020428636, 0.21482601335951942, 0.1209073949450205], "n_valid_labels": 210, "n_masked_labels": 0, "mae_median": 548.6558208556403, "n_mase_elements": 210, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.006424061452747, "wql": 1.031392816210494}}, {"config_id": "ett2__W__short", "leaderboard_key": "ett2/W/short", "dataset": "ett2/W", "term": "short", "freq": "W-THU", "prediction_length": 8, "seasonality": 1, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.6321554468961936, "wql": 0.17309921274194798, "wsql_by_level": [0.10348270441451943, 0.17462612359193827, 0.20931293600096204, 0.22361376288623414, 0.22312351495354324, 0.20781433434280577, 0.1750220314962269, 0.14161511914865027, 0.09928238784265167], "n_valid_labels": 56, "n_masked_labels": 0, "mae_median": 2171.5529644829885, "n_mase_elements": 56, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9231329960664922, "wql": 0.8190583801256105}}, {"config_id": "jena_weather__T__short", "leaderboard_key": "jena_weather/10T/short", "dataset": "jena_weather/10T", "term": "short", "freq": "10T", "prediction_length": 48, "seasonality": 144, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.4136366926205477, "wql": 0.01826307160877487, "wsql_by_level": [0.0066087252793233554, 0.011898878670890902, 0.015671763715629672, 0.018800183444110972, 0.021650031026221712, 0.02338061649971047, 0.024199116963668072, 0.022989197851183103, 0.01916913102823559], "n_valid_labels": 1008, "n_masked_labels": 0, "mae_median": 3.411707038030265, "n_mase_elements": 1008, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.5427111850349482, "wql": 0.1336250356188434}}, {"config_id": "jena_weather__T__medium", "leaderboard_key": "jena_weather/10T/medium", "dataset": "jena_weather/10T", "term": "medium", "freq": "10T", "prediction_length": 480, "seasonality": 144, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.8092460761827927, "wql": 0.08302469555381571, "wsql_by_level": [0.023866667411919253, 0.04969422934316776, 0.07292001673125874, 0.09019619510717572, 0.10190225442268169, 0.10859629677824016, 0.10887568558944763, 0.10266840189325654, 0.08850251270719396], "n_valid_labels": 10080, "n_masked_labels": 0, "mae_median": 17.233196419801576, "n_mase_elements": 10080, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8275817045838775, "wql": 0.3642966052609432}}, {"config_id": "jena_weather__T__long", "leaderboard_key": "jena_weather/10T/long", "dataset": "jena_weather/10T", "term": "long", "freq": "10T", "prediction_length": 720, "seasonality": 144, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.71085785589237, "wql": 0.07753375982735178, "wsql_by_level": [0.026517810899215753, 0.05158263867650761, 0.07151602829720438, 0.08621359050795607, 0.09551192887993631, 0.0986228221593162, 0.09749944405281147, 0.09151698890186007, 0.07882258607135817], "n_valid_labels": 15120, "n_masked_labels": 0, "mae_median": 16.328159357761105, "n_mase_elements": 15120, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7849992115784338, "wql": 0.31921246064856895}}, {"config_id": "jena_weather__H__short", "leaderboard_key": "jena_weather/H/short", "dataset": "jena_weather/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.501028407452742, "wql": 0.05475492069058009, "wsql_by_level": [0.021104770494709237, 0.04377233789533583, 0.057354816974309435, 0.06463419667570057, 0.06637619051863189, 0.06578395304758333, 0.06397621320592457, 0.06058291153542194, 0.04920889586760403], "n_valid_labels": 1008, "n_masked_labels": 0, "mae_median": 11.091345129694442, "n_mase_elements": 1008, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6599621484749805, "wql": 0.29836444197683304}}, {"config_id": "jena_weather__H__medium", "leaderboard_key": "jena_weather/H/medium", "dataset": "jena_weather/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.8128829413765802, "wql": 0.08957674510059367, "wsql_by_level": [0.041600030760003424, 0.07088384477188964, 0.088614759505003, 0.09871587715928565, 0.10349411265634889, 0.10705025355950666, 0.1073536633919154, 0.10222347904294532, 0.08625468505844502], "n_valid_labels": 10080, "n_masked_labels": 0, "mae_median": 17.826358951349487, "n_mase_elements": 10080, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7591849551593689, "wql": 0.246023059258878}}, {"config_id": "jena_weather__H__long", "leaderboard_key": "jena_weather/H/long", "dataset": "jena_weather/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.9833592005773739, "wql": 0.11928175584415124, "wsql_by_level": [0.06021289491839813, 0.10980343022798765, 0.13527727841893505, 0.14548322832648072, 0.14471711673100054, 0.1395123022974652, 0.12994232757621146, 0.11532789130025589, 0.09325933280062645], "n_valid_labels": 15120, "n_masked_labels": 0, "mae_median": 25.224927203146795, "n_mase_elements": 15120, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.658841755665935, "wql": 0.2687262784398826}}, {"config_id": "jena_weather__D__short", "leaderboard_key": "jena_weather/D/short", "dataset": "jena_weather/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 1.4535239618710496, "wql": 0.11146099179186322, "wsql_by_level": [0.05772887196401991, 0.1000696255021768, 0.12447077518288599, 0.13643453611532597, 0.14036779213683404, 0.13622245910614034, 0.12708195479253323, 0.1064783364660867, 0.074294574860766], "n_valid_labels": 630, "n_masked_labels": 0, "mae_median": 24.466817761288073, "n_mase_elements": 630, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7823702149104226, "wql": 0.48171649762027424}}, {"config_id": "bitbrains_fast_storage__T__short", "leaderboard_key": "bitbrains_fast_storage/5T/short", "dataset": "bitbrains_fast_storage/5T", "term": "short", "freq": "5T", "prediction_length": 48, "seasonality": 288, "n_variates": 2, "n_instances": 192, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.6396329283345135, "wql": 0.4893255945916352, "wsql_by_level": [0.20707631155256367, 0.3426775091737015, 0.44425791785215585, 0.5136279327329788, 0.569970469171546, 0.6190315287681786, 0.6357219087280306, 0.5964443919918374, 0.4751223813537247], "n_valid_labels": 16726, "n_masked_labels": 1706, "mae_median": 135.9774617170374, "n_mase_elements": 16078, "n_seasonal_error_zero": 12, "n_seasonal_error_nan": 4}, "relative": {"mase": 0.4336113552721743, "wql": 0.19973415252734247}}, {"config_id": "bitbrains_fast_storage__T__medium", "leaderboard_key": "bitbrains_fast_storage/5T/medium", "dataset": "bitbrains_fast_storage/5T", "term": "medium", "freq": "5T", "prediction_length": 480, "seasonality": 288, "n_variates": 2, "n_instances": 192, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 1.2823505350856539, "wql": 0.9204756719991529, "wsql_by_level": [0.7068885439884177, 1.2199587038249335, 1.2986491543478493, 1.242500227271508, 1.1296531051462149, 0.9783808120520179, 0.797424797059384, 0.5826653607547148, 0.3281603435473359], "n_valid_labels": 173366, "n_masked_labels": 10954, "mae_median": 531.1822922052705, "n_mase_elements": 169900, "n_seasonal_error_zero": 2, "n_seasonal_error_nan": 20}, "relative": {"mase": 0.8995106320827394, "wql": 0.922140110905034}}, {"config_id": "bitbrains_fast_storage__T__long", "leaderboard_key": "bitbrains_fast_storage/5T/long", "dataset": "bitbrains_fast_storage/5T", "term": "long", "freq": "5T", "prediction_length": 720, "seasonality": 288, "n_variates": 2, "n_instances": 192, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 1.003057003333043, "wql": 0.4342224496133564, "wsql_by_level": [0.23793413043329423, 0.4048407657343644, 0.49331326145922405, 0.5436802338256669, 0.5607834178723312, 0.5400986043326984, 0.4897609579905021, 0.3945289451674268, 0.24306172970469872], "n_valid_labels": 263236, "n_masked_labels": 13244, "mae_median": 455.6692861078686, "n_mase_elements": 252350, "n_seasonal_error_zero": 12, "n_seasonal_error_nan": 12}, "relative": {"mase": 0.8278558454895827, "wql": 0.6744046853095246}}, {"config_id": "bitbrains_fast_storage__H__short", "leaderboard_key": "bitbrains_fast_storage/H/short", "dataset": "bitbrains_fast_storage/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 2, "n_instances": 192, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 1.566240723083086, "wql": 0.460430501484308, "wsql_by_level": [0.3284192317937252, 0.5271802482699615, 0.5968982554258156, 0.6041513004765608, 0.5733865939898345, 0.5132410217013492, 0.4367964799587199, 0.3447941864604242, 0.21900719528238058], "n_valid_labels": 17892, "n_masked_labels": 540, "mae_median": 397.57576030244593, "n_mase_elements": 17316, "n_seasonal_error_zero": 12, "n_seasonal_error_nan": 6}, "relative": {"mase": 0.9109722316466803, "wql": 0.766521326783759}}, {"config_id": "bitbrains_rnd__T__short", "leaderboard_key": "bitbrains_rnd/5T/short", "dataset": "bitbrains_rnd/5T", "term": "short", "freq": "5T", "prediction_length": 48, "seasonality": 288, "n_variates": 2, "n_instances": 192, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.5211174300914677, "wql": 0.19250376266775776, "wsql_by_level": [0.11130984871831118, 0.16474338601595379, 0.1979934855669115, 0.21911239798363313, 0.22465474438653157, 0.22210064241016592, 0.21243437961395384, 0.20082723783963055, 0.17935774147472835], "n_valid_labels": 17856, "n_masked_labels": 576, "mae_median": 102.21508052536883, "n_mase_elements": 17376, "n_seasonal_error_zero": 10, "n_seasonal_error_nan": 12}, "relative": {"mase": 0.634958543756279, "wql": 0.20032237276725073}}, {"config_id": "bitbrains_rnd__T__medium", "leaderboard_key": "bitbrains_rnd/5T/medium", "dataset": "bitbrains_rnd/5T", "term": "medium", "freq": "5T", "prediction_length": 480, "seasonality": 288, "n_variates": 2, "n_instances": 192, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.9277904693654061, "wql": 0.8123310042815085, "wsql_by_level": [0.3793326641892228, 0.7323109225631247, 0.8980399863374966, 0.9736284030250074, 0.9945762735485142, 0.9695789961224563, 0.9065584121238849, 0.8071500210131923, 0.6498033596106778], "n_valid_labels": 179348, "n_masked_labels": 4972, "mae_median": 312.3318546654097, "n_mase_elements": 176510, "n_seasonal_error_zero": 2, "n_seasonal_error_nan": 8}, "relative": {"mase": 0.8958969667427079, "wql": 0.8584347201196296}}, {"config_id": "bitbrains_rnd__T__long", "leaderboard_key": "bitbrains_rnd/5T/long", "dataset": "bitbrains_rnd/5T", "term": "long", "freq": "5T", "prediction_length": 720, "seasonality": 288, "n_variates": 2, "n_instances": 192, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.8388015954178812, "wql": 0.8515044254818762, "wsql_by_level": [0.4453629273731855, 0.6063950180783263, 0.7172052349133586, 0.8185647701585127, 0.912490397348722, 1.0057434139863084, 1.0799059574881968, 1.1114984838279558, 0.96637362616232], "n_valid_labels": 262774, "n_masked_labels": 13706, "mae_median": 239.42580187128624, "n_mase_elements": 256386, "n_seasonal_error_zero": 2, "n_seasonal_error_nan": 22}, "relative": {"mase": 0.8795781411608433, "wql": 0.7119784512335846}}, {"config_id": "bitbrains_rnd__H__short", "leaderboard_key": "bitbrains_rnd/H/short", "dataset": "bitbrains_rnd/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 2, "n_instances": 192, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.7868212161796346, "wql": 0.6295687211926445, "wsql_by_level": [0.15042726171777046, 0.31537820331132177, 0.5139129442012994, 0.6825863404660105, 0.8273207875925015, 0.8954290416125545, 0.8778721210277796, 0.802465268498955, 0.6007265223056075], "n_valid_labels": 18028, "n_masked_labels": 404, "mae_median": 320.7036235593324, "n_mase_elements": 17472, "n_seasonal_error_zero": 4, "n_seasonal_error_nan": 16}, "relative": {"mase": 0.6557939572938044, "wql": 0.6541876308215867}}, {"config_id": "bizitobs_application__S__short", "leaderboard_key": "bizitobs_application/10S/short", "dataset": "bizitobs_application", "term": "short", "freq": "10S", "prediction_length": 60, "seasonality": 360, "n_variates": 2, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.5365259750149728, "wql": 0.009654993860777627, "wsql_by_level": [0.005724845362497532, 0.00920887429438802, 0.011466729962842885, 0.01266084206423771, 0.012951872384924368, 0.012313010096105564, 0.010544246709686766, 0.00775752984075642, 0.004266994031559382], "n_valid_labels": 120, "n_masked_labels": 0, "mae_median": 335.13487946192424, "n_mase_elements": 120, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.38500187920526924, "wql": 0.52459756299694}}, {"config_id": "bizitobs_application__S__medium", "leaderboard_key": "bizitobs_application/10S/medium", "dataset": "bizitobs_application", "term": "medium", "freq": "10S", "prediction_length": 600, "seasonality": 360, "n_variates": 2, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.670653392134585, "wql": 0.008981826130304946, "wsql_by_level": [0.0053366038757372, 0.008049966794615416, 0.00992207713123076, 0.011052931794968844, 0.01154130838274721, 0.011256373314944335, 0.010204657507417605, 0.008291323572934061, 0.005181192798149096], "n_valid_labels": 1200, "n_masked_labels": 0, "mae_median": 276.3001642068227, "n_mase_elements": 1200, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7302938272520174, "wql": 0.6535816313232373}}, {"config_id": "bizitobs_application__S__long", "leaderboard_key": "bizitobs_application/10S/long", "dataset": "bizitobs_application", "term": "long", "freq": "10S", "prediction_length": 900, "seasonality": 360, "n_variates": 2, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.7073717633687269, "wql": 0.00936897182344085, "wsql_by_level": [0.0056248523183692915, 0.008790223831655883, 0.010743770191326657, 0.011757188151021558, 0.011915729308279865, 0.011455608273473097, 0.010329936196961464, 0.008389199827276088, 0.00531423831260375], "n_valid_labels": 1800, "n_masked_labels": 0, "mae_median": 290.33115371280246, "n_mase_elements": 1800, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9447672897600948, "wql": 0.7238819059421883}}, {"config_id": "bizitobs_service__S__short", "leaderboard_key": "bizitobs_service/10S/short", "dataset": "bizitobs_service", "term": "short", "freq": "10S", "prediction_length": 60, "seasonality": 360, "n_variates": 2, "n_instances": 21, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.5056253458415603, "wql": 0.008997030137135983, "wsql_by_level": [0.005544246292032471, 0.008735699680501302, 0.01078215627564844, 0.011832983659387085, 0.012001755131681273, 0.011368232217467607, 0.009836286187428203, 0.007227603780454877, 0.0036443080096225976], "n_valid_labels": 2520, "n_masked_labels": 0, "mae_median": 16.092892949141206, "n_mase_elements": 2520, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.4788533738841219, "wql": 0.352616776583892}}, {"config_id": "bizitobs_service__S__medium", "leaderboard_key": "bizitobs_service/10S/medium", "dataset": "bizitobs_service", "term": "medium", "freq": "10S", "prediction_length": 600, "seasonality": 360, "n_variates": 2, "n_instances": 21, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.6760128108560223, "wql": 0.00981458802096833, "wsql_by_level": [0.0060991305699777745, 0.009245982524425041, 0.011209319536050581, 0.012253208488651208, 0.012497058851992919, 0.012008801468687425, 0.010785806750653507, 0.00873847968665123, 0.0054935043116252965], "n_valid_labels": 25200, "n_masked_labels": 0, "mae_median": 15.762687789265598, "n_mase_elements": 25200, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7081158524164899, "wql": 0.4174036444620968}}, {"config_id": "bizitobs_service__S__long", "leaderboard_key": "bizitobs_service/10S/long", "dataset": "bizitobs_service", "term": "long", "freq": "10S", "prediction_length": 900, "seasonality": 360, "n_variates": 2, "n_instances": 21, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.7411342906991989, "wql": 0.010556989822489177, "wsql_by_level": [0.006410213440200779, 0.009894457883444204, 0.012035222781647042, 0.013195692023143005, 0.013489119352055726, 0.013023600495377506, 0.011666882061255542, 0.009323164267890002, 0.0059745560973887835], "n_valid_labels": 37800, "n_masked_labels": 0, "mae_median": 17.23687046433836, "n_mase_elements": 37800, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8911148567780734, "wql": 0.4458379328384122}}, {"config_id": "bizitobs_l2c__T__short", "leaderboard_key": "bizitobs_l2c/5T/short", "dataset": "bizitobs_l2c/5T", "term": "short", "freq": "5T", "prediction_length": 48, "seasonality": 288, "n_variates": 7, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.18322311795554455, "wql": 0.054518895403781596, "wsql_by_level": [0.036908051629222303, 0.055444112480953024, 0.06565553562335827, 0.06940281424515697, 0.06840994660832993, 0.06426975462043978, 0.0553060782947343, 0.04397503126257423, 0.031298733869265495], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 1.7574006347429185, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.2372922751834896, "wql": 0.24675367177697805}}, {"config_id": "bizitobs_l2c__T__medium", "leaderboard_key": "bizitobs_l2c/5T/medium", "dataset": "bizitobs_l2c/5T", "term": "medium", "freq": "5T", "prediction_length": 480, "seasonality": 288, "n_variates": 7, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.4610753969735693, "wql": 0.1528605630177465, "wsql_by_level": [0.12384610134301514, 0.1678060742527983, 0.18818114349117637, 0.18628440521650788, 0.1788416975151349, 0.17203827233629065, 0.15227199762905824, 0.11956653494393596, 0.08690884043180094], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 3.9802337528694243, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.3198153451739089, "wql": 0.324605479579304}}, {"config_id": "bizitobs_l2c__T__long", "leaderboard_key": "bizitobs_l2c/5T/long", "dataset": "bizitobs_l2c/5T", "term": "long", "freq": "5T", "prediction_length": 720, "seasonality": 288, "n_variates": 7, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.7459196494649294, "wql": 0.28002923026495735, "wsql_by_level": [0.14189577835254674, 0.22637030369472252, 0.289039711240719, 0.3354423425265624, 0.37103875275917725, 0.37788119691475053, 0.3580260520587308, 0.27691033483740524, 0.1436586000000015], "n_valid_labels": 5040, "n_masked_labels": 0, "mae_median": 6.787637180119517, "n_mase_elements": 5040, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.44346423004685526, "wql": 0.41450854587151004}}, {"config_id": "bizitobs_l2c__H__short", "leaderboard_key": "bizitobs_l2c/H/short", "dataset": "bizitobs_l2c/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.7505402275148327, "wql": 0.2262536880109035, "wsql_by_level": [0.13227568214422789, 0.2326930988529389, 0.30614538883800735, 0.329868513126158, 0.3282708313225938, 0.28868459830168486, 0.20890769001996812, 0.13036976360724126, 0.07906762588531176], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 6.868164217365639, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.4736514683215731, "wql": 0.4059262777826502}}, {"config_id": "bizitobs_l2c__H__medium", "leaderboard_key": "bizitobs_l2c/H/medium", "dataset": "bizitobs_l2c/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.35672871360610625, "wql": 0.2151929516544161, "wsql_by_level": [0.11857116283033574, 0.1845369054539126, 0.21966346683797974, 0.24345271425312393, 0.2562009800788367, 0.25523936841907074, 0.24786605846265178, 0.23175813842136378, 0.17944777013246996], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 3.5065599092326702, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.22075296885394705, "wql": 0.19268863222793592}}, {"config_id": "bizitobs_l2c__H__long", "leaderboard_key": "bizitobs_l2c/H/long", "dataset": "bizitobs_l2c/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.4325885606544303, "wql": 0.21763516941937858, "wsql_by_level": [0.11999215158299158, 0.19215285432455603, 0.2356988499450652, 0.2593403749509408, 0.26444359568403997, 0.25745491168733164, 0.24400614746013263, 0.21989427543055365, 0.16573336370879574], "n_valid_labels": 5040, "n_masked_labels": 0, "mae_median": 3.9954311957050646, "n_mase_elements": 5040, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.3379006855428726, "wql": 0.21475638959074228}}], "cpu_seconds": 1.3254058239981532, "members": ["/workspace/research/evals/weekly_slow_ar_delta3k", "/workspace/research/evals/patch8_ema6000", "/workspace/research/evals/split_patch_ema12000"], "member_checkpoint_hashes": ["094c7c694406075967f392a0d9ac1146bac984a90ab468c59d660a1b92fa7ba2", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "weights": [0.3333333333333333, 0.3333333333333333, 0.3333333333333333], "selection_only": true, "cutoff": "valid_screen", "E102skill": 0.38490788212550675, "difference": 0.0005607513307689382} +{"composition": "equal quantile mean after each member applies its own fixed rules", "skill_score": 0.34022701617855455, "rel_mase_gmean": 0.793943875648557, "rel_wql_gmean": 0.5482760224393256, "groups": {"term": {"short": 0.30679900406441385, "medium": 0.36032523598865074, "long": 0.4021215513716557}, "domain": {"Econ/Fin": 0.1721308320213788, "Energy": 0.23201167666328837, "Healthcare": 0.41340649703065946, "Nature": 0.3726147779766633, "Sales": 0.40537645795323973, "Transport": 0.3736005845535242, "Web/CloudOps": 0.4512360055080098}, "freq": {"A-DEC": 0.32618793542255464, "Q-DEC": 0.23705558696487827, "M": 0.18927345845861632, "W-SUN": 0.04774678469324367, "D": 0.3525759177381407, "H": 0.3717309606412096, "15T": 0.22268456202455988, "W-FRI": 0.23138568044707775, "10T": 0.32565055179276703, "W-TUE": 0.5626997768481531, "W-THU": 0.2588925082219147, "W-WED": 0.36108396742238325, "5T": 0.44162689257641674, "10S": 0.34789392531645824}}, "configs": [{"config_id": "m4_yearly__A__short", "leaderboard_key": "m4_yearly/A/short", "dataset": "m4_yearly", "term": "short", "freq": "A-DEC", "prediction_length": 6, "seasonality": 1, "n_variates": 1, "n_instances": 152, "domain": "Econ/Fin", "n_cohorts": 3, "skipped_series": 235, "dropped_containers": 11, "metrics": {"mase": 3.037902337626994, "wql": 0.09815505039265969, "wsql_by_level": [0.05160042192944336, 0.0811926081610661, 0.10477089379142959, 0.11816640740805852, 0.12242559934653295, 0.12257290813667518, 0.11503862092825626, 0.09804872106545864, 0.06957927276701664], "n_valid_labels": 912, "n_masked_labels": 0, "mae_median": 521.7503059788754, "n_mase_elements": 912, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6383825071799306, "wql": 0.7112079251290501}}, {"config_id": "m4_quarterly__Q__short", "leaderboard_key": "m4_quarterly/Q/short", "dataset": "m4_quarterly", "term": "short", "freq": "Q-DEC", "prediction_length": 8, "seasonality": 4, "n_variates": 1, "n_instances": 190, "domain": "Econ/Fin", "n_cohorts": 3, "dropped_containers": 95, "metrics": {"mase": 1.1658471474205265, "wql": 0.07590016082227818, "wsql_by_level": [0.04536972898090432, 0.06673398496299082, 0.0791267276623346, 0.08758012702442965, 0.09189271723631638, 0.09232417412241245, 0.08807945136398072, 0.07637413311013558, 0.05562040293699915], "n_valid_labels": 1520, "n_masked_labels": 0, "mae_median": 470.5227991405286, "n_mase_elements": 1520, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7561361981507358, "wql": 0.7698139287671926}}, {"config_id": "m4_monthly__M__short", "leaderboard_key": "m4_monthly/M/short", "dataset": "m4_monthly", "term": "short", "freq": "M", "prediction_length": 18, "seasonality": 12, "n_variates": 1, "n_instances": 192, "domain": "Econ/Fin", "n_cohorts": 3, "dropped_containers": 499, "metrics": {"mase": 0.9139769716535198, "wql": 0.0871699317752213, "wsql_by_level": [0.04608788598960208, 0.07304806082562258, 0.09096215954844103, 0.10182623614350343, 0.10779716433420318, 0.10903505271737492, 0.1032173746742856, 0.08877763366532075, 0.06377781807863801], "n_valid_labels": 3456, "n_masked_labels": 0, "mae_median": 488.5874289362519, "n_mase_elements": 3456, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7164257853065333, "wql": 0.6235116787717548}}, {"config_id": "m4_weekly__W__short", "leaderboard_key": "m4_weekly/W/short", "dataset": "m4_weekly", "term": "short", "freq": "W-SUN", "prediction_length": 13, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Econ/Fin", "n_cohorts": 2, "dropped_containers": 4, "metrics": {"mase": 3.1100809288727103, "wql": 0.055098038079052614, "wsql_by_level": [0.032602047194699495, 0.04785429715208218, 0.05725972722518824, 0.06333705164638065, 0.06706519071059011, 0.06758570043383451, 0.06409405578058587, 0.05605318360657813, 0.04003108896153436], "n_valid_labels": 2496, "n_masked_labels": 0, "mae_median": 336.8346457389685, "n_mase_elements": 2496, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.158338248458987, "wql": 0.7828336733837569}}, {"config_id": "m4_daily__D__short", "leaderboard_key": "m4_daily/D/short", "dataset": "m4_daily", "term": "short", "freq": "D", "prediction_length": 14, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Econ/Fin", "n_cohorts": 2, "dropped_containers": 23, "metrics": {"mase": 3.365311284055928, "wql": 0.01953638209252006, "wsql_by_level": [0.01299470704967311, 0.019569479837904673, 0.02314227463682247, 0.024675381709502498, 0.02471096336713756, 0.023348724884659326, 0.020517867021259475, 0.016315514473370443, 0.010552525852351015], "n_valid_labels": 2688, "n_masked_labels": 0, "mae_median": 178.2896702403114, "n_mase_elements": 2688, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.147522273526741, "wql": 1.1860716967977745}}, {"config_id": "m4_hourly__H__short", "leaderboard_key": "m4_hourly/H/short", "dataset": "m4_hourly", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Econ/Fin", "n_cohorts": 1, "metrics": {"mase": 1.1122722486534364, "wql": 0.03736682604153149, "wsql_by_level": [0.01874741392379996, 0.03145967904991591, 0.04068737146647257, 0.0456794174593893, 0.04753805000550144, 0.04721690942603064, 0.04404922953445294, 0.03685106292326483, 0.024072300584955922], "n_valid_labels": 9216, "n_masked_labels": 0, "mae_median": 352.90519963156515, "n_mase_elements": 9216, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8953871829604685, "wql": 0.7944626922388952}}, {"config_id": "electricity__T__short", "leaderboard_key": "electricity/15T/short", "dataset": "electricity/15T", "term": "short", "freq": "15T", "prediction_length": 48, "seasonality": 96, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.7414485035347453, "wql": 0.05874078023278089, "wsql_by_level": [0.03660522792607276, 0.054623159839400255, 0.06574675212827316, 0.07161938696534081, 0.07289646506205745, 0.0709393775615199, 0.06491803982321434, 0.05428902047892521, 0.03702959231022416], "n_valid_labels": 9216, "n_masked_labels": 0, "mae_median": 24.881237040894728, "n_mase_elements": 9168, "n_seasonal_error_zero": 1, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9007102952311252, "wql": 0.8955152027394758}}, {"config_id": "electricity__T__medium", "leaderboard_key": "electricity/15T/medium", "dataset": "electricity/15T", "term": "medium", "freq": "15T", "prediction_length": 480, "seasonality": 96, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.8341249217131992, "wql": 0.0588387869460271, "wsql_by_level": [0.032029932243865376, 0.05030349324262281, 0.06257228393377615, 0.07028636322757713, 0.07393768470060368, 0.0734247240139721, 0.06850076640753922, 0.05820932687517861, 0.040284507869108886], "n_valid_labels": 92160, "n_masked_labels": 0, "mae_median": 42.24310534259891, "n_mase_elements": 92160, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7399527532889328, "wql": 0.6348937040939772}}, {"config_id": "electricity__T__long", "leaderboard_key": "electricity/15T/long", "dataset": "electricity/15T", "term": "long", "freq": "15T", "prediction_length": 720, "seasonality": 96, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.7783637870874349, "wql": 0.05518133110407022, "wsql_by_level": [0.03188683872861633, 0.048383447963460495, 0.05900291425963093, 0.06546503930631685, 0.06854103198610194, 0.06818039746638782, 0.06368531022730614, 0.05412012180224378, 0.03736687819656763], "n_valid_labels": 138240, "n_masked_labels": 0, "mae_median": 44.27354983369999, "n_mase_elements": 137520, "n_seasonal_error_zero": 1, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7682049221663798, "wql": 0.6060938006492076}}, {"config_id": "electricity__H__short", "leaderboard_key": "electricity/H/short", "dataset": "electricity/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.005195247495848, "wql": 0.1076856363194789, "wsql_by_level": [0.056397069100389094, 0.08542071182630076, 0.10586568127503418, 0.12027328825594023, 0.12946795446135537, 0.13311199502313206, 0.12999302041997104, 0.1175107840454948, 0.0911302224676928], "n_valid_labels": 9216, "n_masked_labels": 0, "mae_median": 469.98805135850694, "n_mase_elements": 9216, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9662502361868567, "wql": 0.9473149320482348}}, {"config_id": "electricity__H__medium", "leaderboard_key": "electricity/H/medium", "dataset": "electricity/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 1, "n_instances": 191, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.278985998725151, "wql": 0.08168963046658351, "wsql_by_level": [0.038246727237136076, 0.06055069824767401, 0.07688735765720536, 0.08883191357429941, 0.09690449614467006, 0.10127365248392153, 0.100903593259357, 0.09422247612259164, 0.07738575947239647], "n_valid_labels": 91680, "n_masked_labels": 0, "mae_median": 167.4791256503792, "n_mase_elements": 91680, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8050794219396586, "wql": 0.6818928301208295}}, {"config_id": "electricity__H__long", "leaderboard_key": "electricity/H/long", "dataset": "electricity/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.005989986542046, "wql": 0.0717512335841778, "wsql_by_level": [0.049766060526332916, 0.0693342995653751, 0.08060650327958628, 0.08627758903474247, 0.0875531085760828, 0.0847966155464082, 0.07769951011733353, 0.06513523172470284, 0.04459218388703604], "n_valid_labels": 138240, "n_masked_labels": 0, "mae_median": 167.4959181247693, "n_mase_elements": 138240, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8444221392598532, "wql": 0.49822417172241473}}, {"config_id": "electricity__D__short", "leaderboard_key": "electricity/D/short", "dataset": "electricity/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.1917353430285285, "wql": 0.05653707378588931, "wsql_by_level": [0.028734693953438258, 0.046048837523563535, 0.0540482446124841, 0.06007380156021994, 0.06768452994506077, 0.07239000603555543, 0.07146735784754593, 0.06328271681240813, 0.045103475782727644], "n_valid_labels": 5760, "n_masked_labels": 0, "mae_median": 4460.843291813383, "n_mase_elements": 5760, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9078475373444427, "wql": 0.7012293467791362}}, {"config_id": "electricity__W__short", "leaderboard_key": "electricity/W/short", "dataset": "electricity/W", "term": "short", "freq": "W-FRI", "prediction_length": 8, "seasonality": 1, "n_variates": 1, "n_instances": 191, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.1478089106300988, "wql": 0.05751283904096939, "wsql_by_level": [0.042071013341648984, 0.06220590585953188, 0.07164510277304512, 0.07673931931529472, 0.0740760284170807, 0.06473270874411347, 0.045854636942121274, 0.04171226851328447, 0.03857856746260389], "n_valid_labels": 1528, "n_masked_labels": 0, "mae_median": 34350.672626595224, "n_mase_elements": 1528, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8916680515190532, "wql": 0.7078612687253304}}, {"config_id": "solar__T__short", "leaderboard_key": "solar/10T/short", "dataset": "solar/10T", "term": "short", "freq": "10T", "prediction_length": 48, "seasonality": 144, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 2.2569681674637607, "wql": 0.27450083346814824, "wsql_by_level": [0.17580773794424964, 0.26214253166540347, 0.30958668541568485, 0.3326243908805928, 0.3385805727016281, 0.3285689033235246, 0.3036853577440995, 0.2542765365056289, 0.16523478503252242], "n_valid_labels": 6576, "n_masked_labels": 0, "mae_median": 4.793607888196044, "n_mase_elements": 6576, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7899645662054536, "wql": 0.7814825817695297}}, {"config_id": "solar__T__medium", "leaderboard_key": "solar/10T/medium", "dataset": "solar/10T", "term": "medium", "freq": "10T", "prediction_length": 480, "seasonality": 144, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.411404056768297, "wql": 0.4897848466734051, "wsql_by_level": [0.339130686589927, 0.5559608554346483, 0.6400826123950002, 0.6509103069605772, 0.6176635830074539, 0.5558985852383285, 0.46434349103858485, 0.3527329145514503, 0.23134058484467496], "n_valid_labels": 65760, "n_masked_labels": 0, "mae_median": 3.0150506714476757, "n_mase_elements": 65760, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8376883417448442, "wql": 0.6607978423819508}}, {"config_id": "solar__T__long", "leaderboard_key": "solar/10T/long", "dataset": "solar/10T", "term": "long", "freq": "10T", "prediction_length": 720, "seasonality": 144, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.430149138591592, "wql": 0.5495577844671765, "wsql_by_level": [0.4157401410782553, 0.6083748609468729, 0.6967427243138244, 0.7227016883592806, 0.7000813698397036, 0.6349690598273663, 0.5349107411605489, 0.39991406028280785, 0.23258541439592897], "n_valid_labels": 98640, "n_masked_labels": 0, "mae_median": 3.0458078342487633, "n_mase_elements": 98640, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.964859187184016, "wql": 0.657464015239788}}, {"config_id": "solar__H__short", "leaderboard_key": "solar/H/short", "dataset": "solar/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.6032989531688455, "wql": 0.1562461810465075, "wsql_by_level": [0.1269083400787946, 0.16975321749136202, 0.1870554715552497, 0.19526095379716882, 0.19537370345968197, 0.1804040518453034, 0.15323976337516274, 0.11880742989820889, 0.07941269791763558], "n_valid_labels": 6576, "n_masked_labels": 0, "mae_median": 8.069525182930924, "n_mase_elements": 6576, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9112658674603129, "wql": 0.4977486438341271}}, {"config_id": "solar__H__medium", "leaderboard_key": "solar/H/medium", "dataset": "solar/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.8298881294707111, "wql": 0.20765944252671026, "wsql_by_level": [0.13702955611790757, 0.20442243059967066, 0.24086463443054604, 0.2603003402361452, 0.26689643592954443, 0.25744601781061316, 0.2300159089787736, 0.1781150671560422, 0.09384459148114953], "n_valid_labels": 65760, "n_masked_labels": 0, "mae_median": 11.036797324489177, "n_mase_elements": 65760, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6338663004639878, "wql": 0.30866947754193164}}, {"config_id": "solar__H__long", "leaderboard_key": "solar/H/long", "dataset": "solar/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.8664748980834234, "wql": 0.24149192208142528, "wsql_by_level": [0.20212932324840507, 0.26476239855549133, 0.29158481759233384, 0.2990499375543338, 0.29371152501441994, 0.2763990815201093, 0.2440782241170833, 0.19064763041624877, 0.11106436071440225], "n_valid_labels": 98640, "n_masked_labels": 0, "mae_median": 11.45228937594979, "n_mase_elements": 98640, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9187700921037038, "wql": 0.31406052602147916}}, {"config_id": "solar__D__short", "leaderboard_key": "solar/D/short", "dataset": "solar/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.8662851913167189, "wql": 0.18096753724081802, "wsql_by_level": [0.13449481850277614, 0.2025700781264022, 0.23433717425007533, 0.24304762270253996, 0.23482219503100754, 0.21122660012807895, 0.17501660705638253, 0.12582756656144395, 0.06736517280865549], "n_valid_labels": 4110, "n_masked_labels": 0, "mae_median": 219.74637008444236, "n_mase_elements": 4110, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9695104857715756, "wql": 0.46212316645231355}}, {"config_id": "solar__W__short", "leaderboard_key": "solar/W/short", "dataset": "solar/W", "term": "short", "freq": "W-FRI", "prediction_length": 8, "seasonality": 1, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.4968143843922421, "wql": 0.07159665674111809, "wsql_by_level": [0.08119457306313575, 0.08510824224183965, 0.07550284183365813, 0.06882739354028107, 0.0698621354913643, 0.0725424822367246, 0.07162788277173564, 0.06606170669939873, 0.05364265279192507], "n_valid_labels": 1096, "n_masked_labels": 0, "mae_median": 491.3424066696724, "n_mase_elements": 1096, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8469430211434178, "wql": 0.6528724385888193}}, {"config_id": "hospital__M__short", "leaderboard_key": "hospital/M/short", "dataset": "hospital", "term": "short", "freq": "M", "prediction_length": 12, "seasonality": 12, "n_variates": 1, "n_instances": 192, "domain": "Healthcare", "n_cohorts": 1, "metrics": {"mase": 0.8481243709218815, "wql": 0.0665162351031477, "wsql_by_level": [0.03760282071491459, 0.05621833396756983, 0.06829957085769918, 0.0773011330794918, 0.08258827118115555, 0.08398543271819885, 0.07980048778138711, 0.06773460883029214, 0.045115456797620405], "n_valid_labels": 2304, "n_masked_labels": 0, "mae_median": 29.84849091122548, "n_mase_elements": 2304, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8634206906224304, "wql": 0.9269797009125593}}, {"config_id": "covid_deaths__D__short", "leaderboard_key": "covid_deaths/D/short", "dataset": "covid_deaths", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Healthcare", "n_cohorts": 1, "metrics": {"mase": 41.65824528650925, "wql": 0.09378869450337197, "wsql_by_level": [0.06893365326520318, 0.09745776414805045, 0.11347630040720862, 0.11327189144529728, 0.10493573295622083, 0.10197121627492853, 0.08579602466634267, 0.0759116145972824, 0.08234405276981378], "n_valid_labels": 5760, "n_masked_labels": 0, "mae_median": 104.63141933064779, "n_mase_elements": 4830, "n_seasonal_error_zero": 31, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.902118695367908, "wql": 0.6264220401997149}}, {"config_id": "us_births__D__short", "leaderboard_key": "us_births/D/short", "dataset": "us_births/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 1, "domain": "Healthcare", "n_cohorts": 1, "metrics": {"mase": 0.7505052337781618, "wql": 0.03418652269517344, "wsql_by_level": [0.019749713764894636, 0.03171121505489005, 0.03927113138939224, 0.04338475020201229, 0.0447388278680091, 0.04228310721274306, 0.03756746364626895, 0.029155380423803685, 0.01981711469454688], "n_valid_labels": 30, "n_masked_labels": 0, "mae_median": 494.60712890625, "n_mase_elements": 30, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.4887905216980433, "wql": 0.32205892136256864}}, {"config_id": "us_births__M__short", "leaderboard_key": "us_births/M/short", "dataset": "us_births/M", "term": "short", "freq": "M", "prediction_length": 12, "seasonality": 12, "n_variates": 1, "n_instances": 1, "domain": "Healthcare", "n_cohorts": 1, "metrics": {"mase": 0.4641970150847043, "wql": 0.010839906647462445, "wsql_by_level": [0.007690452660143038, 0.011101179131491754, 0.013314852898448347, 0.013933100581369, 0.01413719115604733, 0.012927403511671366, 0.01051376419769212, 0.008277431100709318, 0.005663784589589735], "n_valid_labels": 12, "n_masked_labels": 0, "mae_median": 4419.627604166667, "n_mase_elements": 12, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6064599747287054, "wql": 0.5841568114542499}}, {"config_id": "us_births__W__short", "leaderboard_key": "us_births/W/short", "dataset": "us_births/W", "term": "short", "freq": "W-TUE", "prediction_length": 8, "seasonality": 1, "n_variates": 1, "n_instances": 1, "domain": "Healthcare", "n_cohorts": 1, "metrics": {"mase": 0.4843569991561676, "wql": 0.005578090588797161, "wsql_by_level": [0.0035051770054383377, 0.0061232056864479805, 0.007010747861980568, 0.0072738841606162915, 0.006934070457851651, 0.006446740210251619, 0.005279154454708256, 0.00407659575081509, 0.003553239711064651], "n_valid_labels": 8, "n_masked_labels": 0, "mae_median": 526.111328125, "n_mase_elements": 8, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.4492358442736684, "wql": 0.4256817161992966}}, {"config_id": "saugeenday__D__short", "leaderboard_key": "saugeen/D/short", "dataset": "saugeenday/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 1.675554660589966, "wql": 0.31344431652848964, "wsql_by_level": [0.12161772616823995, 0.19689573333266563, 0.2341903522250219, 0.2574401621359866, 0.3589836675399531, 0.4293852679891742, 0.45935019692894014, 0.4411765039690803, 0.3219592384673449], "n_valid_labels": 30, "n_masked_labels": 0, "mae_median": 7.4788263956705725, "n_mase_elements": 30, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.2879724425121457, "wql": 0.4718377991729083}}, {"config_id": "saugeenday__M__short", "leaderboard_key": "saugeen/M/short", "dataset": "saugeenday/M", "term": "short", "freq": "M", "prediction_length": 12, "seasonality": 12, "n_variates": 1, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.5927630646565163, "wql": 0.3203269447356998, "wsql_by_level": [0.12598857865704416, 0.18968222121544395, 0.24040851967481697, 0.3136420374208496, 0.38228621366892634, 0.42160177466840687, 0.45474315632306894, 0.43669600555236926, 0.3178939954403716], "n_valid_labels": 12, "n_masked_labels": 0, "mae_median": 10.376739422480265, "n_mase_elements": 12, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.3051388914641786, "wql": 1.0458487266954335}}, {"config_id": "saugeenday__W__short", "leaderboard_key": "saugeen/W/short", "dataset": "saugeenday/W", "term": "short", "freq": "W-THU", "prediction_length": 8, "seasonality": 1, "n_variates": 1, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.3519638114323024, "wql": 0.2662752495211793, "wsql_by_level": [0.11372987147884636, 0.18552782814033983, 0.23128901181167458, 0.27377207562527, 0.32433923441108065, 0.3547655413558739, 0.39123735928434705, 0.3490464389655082, 0.17276988461767362], "n_valid_labels": 8, "n_masked_labels": 0, "mae_median": 4.22625607252121, "n_mase_elements": 8, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8894037617219445, "wql": 0.24018150950267242}}, {"config_id": "temperature_rain_with_missing__D__short", "leaderboard_key": "temperature_rain/D/short", "dataset": "temperature_rain_with_missing", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 1.5515686319785789, "wql": 0.5381728314133933, "wsql_by_level": [0.18632494166550886, 0.34708943125977854, 0.48836454284916286, 0.6053340733310679, 0.686717752974089, 0.7200669298086018, 0.7158889436906286, 0.6381245989700771, 0.4556442681716257], "n_valid_labels": 5760, "n_masked_labels": 0, "mae_median": 6.085248474554371, "n_mase_elements": 5760, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.054893375281003, "wql": 0.5056231367221576}}, {"config_id": "kdd_cup_2018_with_missing__H__short", "leaderboard_key": "kdd_cup_2018/H/short", "dataset": "kdd_cup_2018_with_missing/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 176, "domain": "Nature", "n_cohorts": 2, "metrics": {"mase": 0.9314590653179857, "wql": 0.4144698581629218, "wsql_by_level": [0.17042770636579477, 0.31958737278243426, 0.43495208981935, 0.5140882428507184, 0.5569903741134093, 0.5563970412640289, 0.5050260744081512, 0.40239699224894754, 0.27036282961346225], "n_valid_labels": 8071, "n_masked_labels": 377, "mae_median": 18.78991258007594, "n_mase_elements": 8071, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8075459670396663, "wql": 0.7189950739967459}}, {"config_id": "kdd_cup_2018_with_missing__H__medium", "leaderboard_key": "kdd_cup_2018/H/medium", "dataset": "kdd_cup_2018_with_missing/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 1, "n_instances": 183, "domain": "Nature", "n_cohorts": 2, "metrics": {"mase": 0.8480288628030781, "wql": 0.470069973426411, "wsql_by_level": [0.17893876446622387, 0.32772203748762174, 0.4507381237346121, 0.5418444741746805, 0.5981812239304258, 0.6181714963553333, 0.5994242556270963, 0.5328490400735261, 0.38276034498817996], "n_valid_labels": 84423, "n_masked_labels": 3417, "mae_median": 17.355613578305753, "n_mase_elements": 84423, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7006489300316523, "wql": 0.412321717770212}}, {"config_id": "kdd_cup_2018_with_missing__H__long", "leaderboard_key": "kdd_cup_2018/H/long", "dataset": "kdd_cup_2018_with_missing/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 1, "n_instances": 182, "domain": "Nature", "n_cohorts": 2, "metrics": {"mase": 0.857558379067222, "wql": 0.47829225390599056, "wsql_by_level": [0.17818917454251948, 0.3338041316392467, 0.4596481048436853, 0.5522913851434088, 0.61105096369842, 0.6339827967625987, 0.6151859222096626, 0.5407691871915298, 0.37970861912284326], "n_valid_labels": 124627, "n_masked_labels": 6413, "mae_median": 18.779386165107308, "n_mase_elements": 124627, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7889175398800053, "wql": 0.3718634450419643}}, {"config_id": "kdd_cup_2018_with_missing__D__short", "leaderboard_key": "kdd_cup_2018/D/short", "dataset": "kdd_cup_2018_with_missing/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 184, "domain": "Nature", "n_cohorts": 2, "metrics": {"mase": 1.1398713402362113, "wql": 0.4452585200870648, "wsql_by_level": [0.23439720860283367, 0.3630833673662009, 0.4535136492570833, 0.5149219367451351, 0.5514592922543351, 0.5604099266997383, 0.5370881317145794, 0.4682844182400131, 0.32416874990366445], "n_valid_labels": 5433, "n_masked_labels": 87, "mae_median": 16.537140032977618, "n_mase_elements": 5433, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.0568695442143516, "wql": 0.517322856079971}}, {"config_id": "car_parts_with_missing__M__short", "leaderboard_key": "car_parts/M/short", "dataset": "car_parts_with_missing", "term": "short", "freq": "M", "prediction_length": 12, "seasonality": 12, "n_variates": 1, "n_instances": 187, "domain": "Sales", "n_cohorts": 1, "metrics": {"mase": 0.8263689971998104, "wql": 1.2192532765615771, "wsql_by_level": [0.2766903109814157, 0.6254175547601963, 0.9438783489916143, 1.2223525838813596, 1.4755679973457547, 1.657124344371809, 1.7430252986469423, 1.6540169406612468, 1.375206109413854], "n_valid_labels": 2244, "n_masked_labels": 0, "mae_median": 0.748962544107315, "n_mase_elements": 1368, "n_seasonal_error_zero": 73, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9001036285124183, "wql": 0.7882894800168283}}, {"config_id": "restaurant__D__short", "leaderboard_key": "restaurant/D/short", "dataset": "restaurant", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 188, "domain": "Sales", "n_cohorts": 13, "skipped_series": 1, "metrics": {"mase": 0.7032572725336931, "wql": 0.29388985640575416, "wsql_by_level": [0.14388509764644014, 0.2374718115070401, 0.3045734092783732, 0.35000386166169445, 0.37377117701051293, 0.37533248318597334, 0.3520210542915942, 0.3000197969740691, 0.20793001609608977], "n_valid_labels": 4908, "n_masked_labels": 732, "mae_median": 7.39111940554224, "n_mase_elements": 4879, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 1}, "relative": {"mase": 0.6372438611435927, "wql": 0.3962249469444833}}, {"config_id": "hierarchical_sales__D__short", "leaderboard_key": "hierarchical_sales/D/short", "dataset": "hierarchical_sales/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 118, "domain": "Sales", "n_cohorts": 1, "metrics": {"mase": 0.7348890090260285, "wql": 0.5734915322577943, "wsql_by_level": [0.2123124849189796, 0.37864348610574, 0.5201218954642599, 0.6358867324597284, 0.7166157852320038, 0.7657184055714783, 0.7738833937793305, 0.6742189100170203, 0.4840226967716072], "n_valid_labels": 3422, "n_masked_labels": 118, "mae_median": 2.345021497085908, "n_mase_elements": 3422, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.637460473750277, "wql": 0.335251124750253}}, {"config_id": "hierarchical_sales__W__short", "leaderboard_key": "hierarchical_sales/W/short", "dataset": "hierarchical_sales/W", "term": "short", "freq": "W-WED", "prediction_length": 8, "seasonality": 1, "n_variates": 1, "n_instances": 118, "domain": "Sales", "n_cohorts": 1, "metrics": {"mase": 0.811843611649546, "wql": 0.428206896002995, "wsql_by_level": [0.14393482815309452, 0.2502359699546728, 0.33823247780256843, 0.41385793315226654, 0.47960619545690814, 0.5352625072635407, 0.5769880606821238, 0.5938267044023506, 0.5219173871594297], "n_valid_labels": 944, "n_masked_labels": 0, "mae_median": 13.82576631034835, "n_mase_elements": 944, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7478520895769962, "wql": 0.5458481728861894}}, {"config_id": "LOOP_SEATTLE__T__short", "leaderboard_key": "loop_seattle/5T/short", "dataset": "LOOP_SEATTLE/5T", "term": "short", "freq": "5T", "prediction_length": 48, "seasonality": 288, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.5864394836519787, "wql": 0.05428408817899554, "wsql_by_level": [0.04479178098907267, 0.06000763809732082, 0.06637466849100017, 0.06788984760988573, 0.06605520506110114, 0.061294463229775095, 0.053358117703003374, 0.042244454810520214, 0.026540617619280685], "n_valid_labels": 9216, "n_masked_labels": 0, "mae_median": 3.9955498398695557, "n_mase_elements": 9216, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8253045664949409, "wql": 0.7091877102191098}}, {"config_id": "LOOP_SEATTLE__T__medium", "leaderboard_key": "loop_seattle/5T/medium", "dataset": "LOOP_SEATTLE/5T", "term": "medium", "freq": "5T", "prediction_length": 480, "seasonality": 288, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.74182900729652, "wql": 0.06788873443760415, "wsql_by_level": [0.05357422454078263, 0.07493314508780921, 0.08472113983743966, 0.08724279381143979, 0.08435672147263845, 0.07730137093578172, 0.06638934676629683, 0.051380998284025835, 0.03109886920222329], "n_valid_labels": 92160, "n_masked_labels": 0, "mae_median": 4.579496950264244, "n_mase_elements": 92160, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.755158697865816, "wql": 0.6385961674510584}}, {"config_id": "LOOP_SEATTLE__T__long", "leaderboard_key": "loop_seattle/5T/long", "dataset": "LOOP_SEATTLE/5T", "term": "long", "freq": "5T", "prediction_length": 720, "seasonality": 288, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.7465064067482573, "wql": 0.0718782304981459, "wsql_by_level": [0.05180627157965504, 0.07442746588233085, 0.08624474272042683, 0.09078284999619254, 0.08968703608200657, 0.08429582001894365, 0.07419009199650099, 0.058873657814727316, 0.03659613839252939], "n_valid_labels": 138240, "n_masked_labels": 0, "mae_median": 4.707955171464494, "n_mase_elements": 138240, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7823282219272191, "wql": 0.6217114573451009}}, {"config_id": "LOOP_SEATTLE__H__short", "leaderboard_key": "loop_seattle/H/short", "dataset": "LOOP_SEATTLE/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.7790671230574661, "wql": 0.056192889416918024, "wsql_by_level": [0.04702487987186681, 0.0623758295313483, 0.06896356914078333, 0.07004562495761203, 0.06746910304840772, 0.06199981916614292, 0.05439636364683567, 0.04431985166795878, 0.029140963721306687], "n_valid_labels": 9216, "n_masked_labels": 0, "mae_median": 3.5669649561039276, "n_mase_elements": 9216, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8684396521913409, "wql": 0.6895963495119618}}, {"config_id": "LOOP_SEATTLE__H__medium", "leaderboard_key": "loop_seattle/H/medium", "dataset": "LOOP_SEATTLE/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.7919756972825184, "wql": 0.056683030945589144, "wsql_by_level": [0.0497444993514591, 0.06313123056500668, 0.06854955380599254, 0.06947031458062264, 0.06742205770250141, 0.06256440075956698, 0.05523141115237446, 0.04481747578808889, 0.029216334804689603], "n_valid_labels": 92160, "n_masked_labels": 0, "mae_median": 3.7603892812712325, "n_mase_elements": 92160, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6638118359610692, "wql": 0.37381839332646466}}, {"config_id": "LOOP_SEATTLE__H__long", "leaderboard_key": "loop_seattle/H/long", "dataset": "LOOP_SEATTLE/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.738829739885067, "wql": 0.052308953536778224, "wsql_by_level": [0.039299238664245624, 0.05255967792580262, 0.05936548448019612, 0.062281229622256615, 0.06242582927152043, 0.06017755752451767, 0.055325450299709304, 0.04694625617869633, 0.032399857864059314], "n_valid_labels": 138240, "n_masked_labels": 0, "mae_median": 3.517151350220148, "n_mase_elements": 138240, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6601483744160617, "wql": 0.30585123119424396}}, {"config_id": "LOOP_SEATTLE__D__short", "leaderboard_key": "loop_seattle/D/short", "dataset": "LOOP_SEATTLE/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.6562146459533866, "wql": 0.029987287094365996, "wsql_by_level": [0.018323798041140163, 0.02760173533914183, 0.03314279031738056, 0.03620883489365932, 0.037273057818275786, 0.036196217843546305, 0.03324895703842775, 0.028101569026567724, 0.019788623531154504], "n_valid_labels": 5760, "n_masked_labels": 0, "mae_median": 2.1110521952311196, "n_mase_elements": 5760, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6250123240755511, "wql": 0.3491149302247672}}, {"config_id": "SZ_TAXI__T__short", "leaderboard_key": "sz_taxi/15T/short", "dataset": "SZ_TAXI/15T", "term": "short", "freq": "15T", "prediction_length": 48, "seasonality": 96, "n_variates": 1, "n_instances": 156, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.4626850814794651, "wql": 0.1808778853917687, "wsql_by_level": [0.09152374229134473, 0.14991132036443927, 0.19007622164072213, 0.2160504160188806, 0.2286942847375343, 0.22882632172005063, 0.2147448931457453, 0.18291428918473465, 0.12515947942246664], "n_valid_labels": 7488, "n_masked_labels": 0, "mae_median": 2.496985606481987, "n_mase_elements": 7488, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7548541376291873, "wql": 0.6456545135962624}}, {"config_id": "SZ_TAXI__T__medium", "leaderboard_key": "sz_taxi/15T/medium", "dataset": "SZ_TAXI/15T", "term": "medium", "freq": "15T", "prediction_length": 480, "seasonality": 96, "n_variates": 1, "n_instances": 156, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.5008475574542578, "wql": 0.24294826960572802, "wsql_by_level": [0.1144784379080718, 0.18109881224225755, 0.22839716900666954, 0.2632517694336473, 0.28869728020287816, 0.30456811389744826, 0.3066071083453445, 0.28593691229547863, 0.21349882311975676], "n_valid_labels": 74880, "n_masked_labels": 0, "mae_median": 3.186576861898866, "n_mase_elements": 74880, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.843510613849713, "wql": 0.5671558774065893}}, {"config_id": "SZ_TAXI__T__long", "leaderboard_key": "sz_taxi/15T/long", "dataset": "SZ_TAXI/15T", "term": "long", "freq": "15T", "prediction_length": 720, "seasonality": 96, "n_variates": 1, "n_instances": 156, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 1.2714380607200964, "wql": 0.5053214252545055, "wsql_by_level": [0.3837884898338214, 0.5145672121895367, 0.5878809607458092, 0.6205584479386093, 0.619577141276385, 0.5883309106434682, 0.5283571131532746, 0.4297701066185521, 0.27506244489109344], "n_valid_labels": 112320, "n_masked_labels": 0, "mae_median": 7.75467368370671, "n_mase_elements": 112320, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8566686903348999, "wql": 0.7853460499598182}}, {"config_id": "SZ_TAXI__H__short", "leaderboard_key": "sz_taxi/H/short", "dataset": "SZ_TAXI/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 156, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.47345451712987424, "wql": 0.13107144630496928, "wsql_by_level": [0.07168371404348971, 0.11062127195213284, 0.13574895353242047, 0.15137690630330758, 0.15985518210004876, 0.15975554696182498, 0.15159900283284908, 0.13529366643313054, 0.10370877258551961], "n_valid_labels": 7488, "n_masked_labels": 0, "mae_median": 1.7788976422031202, "n_mase_elements": 7488, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8187380577833887, "wql": 0.6338111871439569}}, {"config_id": "M_DENSE__H__short", "leaderboard_key": "m_dense/H/short", "dataset": "M_DENSE/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 30, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.6673477339598097, "wql": 0.13381121739461577, "wsql_by_level": [0.07646318303094778, 0.11560903093371483, 0.14019385353585342, 0.15541976040070474, 0.16345965850577704, 0.16431241336887312, 0.1564272476816878, 0.13593208290942133, 0.09648372618456158], "n_valid_labels": 1440, "n_masked_labels": 0, "mae_median": 91.79810526702138, "n_mase_elements": 1440, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.48186482983036266, "wql": 0.5419359172124095}}, {"config_id": "M_DENSE__H__medium", "leaderboard_key": "m_dense/H/medium", "dataset": "M_DENSE/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 1, "n_instances": 30, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 1.1023516251122774, "wql": 0.22740508980268567, "wsql_by_level": [0.10112015585497222, 0.16695728722522082, 0.2175547342833934, 0.25686230897469, 0.28505085746368725, 0.2978260076547916, 0.29139076819452586, 0.2557078083184608, 0.1741758802544288], "n_valid_labels": 14400, "n_masked_labels": 0, "mae_median": 150.24812372797066, "n_mase_elements": 14400, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9159202242343034, "wql": 0.619367971150801}}, {"config_id": "M_DENSE__H__long", "leaderboard_key": "m_dense/H/long", "dataset": "M_DENSE/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 1, "n_instances": 30, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.877295611800436, "wql": 0.23923573976712356, "wsql_by_level": [0.13525328549690072, 0.21459976076575216, 0.26852823138537474, 0.2991725933161364, 0.30700966487585296, 0.2939798674862894, 0.26147771508661855, 0.21698062485528127, 0.15611991463590622], "n_valid_labels": 21600, "n_masked_labels": 0, "mae_median": 131.68062999712097, "n_mase_elements": 21600, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7276824551361437, "wql": 0.4362160022315357}}, {"config_id": "M_DENSE__D__short", "leaderboard_key": "m_dense/D/short", "dataset": "M_DENSE/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 30, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.8196729786938285, "wql": 0.11209314497244116, "wsql_by_level": [0.0807601741683664, 0.11281415574834637, 0.12866431854257337, 0.13424117321141613, 0.13110805376462456, 0.12534945960064903, 0.11722106015594659, 0.10267272744110614, 0.07600718211894188], "n_valid_labels": 900, "n_masked_labels": 0, "mae_median": 56.234031346639, "n_mase_elements": 900, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6243486437915622, "wql": 0.37453130535027723}}, {"config_id": "ett1__T__short", "leaderboard_key": "ett1/15T/short", "dataset": "ett1/15T", "term": "short", "freq": "15T", "prediction_length": 48, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.5708853042944508, "wql": 0.2463715128723785, "wsql_by_level": [0.16400218592871096, 0.2209048333404705, 0.25009514187287185, 0.28636883518720563, 0.30217447690601895, 0.3066069876564013, 0.28578592381915535, 0.23769464717162778, 0.1637105839689438], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 0.82533742073879, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6103915361813244, "wql": 0.47356494274680283}}, {"config_id": "ett1__T__medium", "leaderboard_key": "ett1/15T/medium", "dataset": "ett1/15T", "term": "medium", "freq": "15T", "prediction_length": 480, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.9656647615391196, "wql": 0.3351660915837733, "wsql_by_level": [0.2219368106918946, 0.3472761207016973, 0.41775119517537523, 0.4446392771767811, 0.43434917469794937, 0.4033060833000697, 0.3397643262596162, 0.2539064451094817, 0.1535653911410951], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 1.6562388141462137, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9821210166045352, "wql": 0.7574072980094135}}, {"config_id": "ett1__T__long", "leaderboard_key": "ett1/15T/long", "dataset": "ett1/15T", "term": "long", "freq": "15T", "prediction_length": 720, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.9981941011380466, "wql": 0.3341812007426018, "wsql_by_level": [0.17604461969397395, 0.30606202331419974, 0.39350708727911426, 0.44093391078866023, 0.4533487609029168, 0.43228551872328214, 0.37722060649662625, 0.2807368069639273, 0.14749147252071573], "n_valid_labels": 5040, "n_masked_labels": 0, "mae_median": 1.78651595814634, "n_mase_elements": 5040, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9510582227463917, "wql": 0.716810411846765}}, {"config_id": "ett1__H__short", "leaderboard_key": "ett1/H/short", "dataset": "ett1/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.0872611679136062, "wql": 0.34736108490237666, "wsql_by_level": [0.1514118953058142, 0.32051725290272637, 0.42456589444848597, 0.46715596044238133, 0.46963146146470147, 0.4384089289055736, 0.37952209792833436, 0.2978647374627226, 0.17717153526065016], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 6.745783526073431, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.1773105697244175, "wql": 0.905695260450443}}, {"config_id": "ett1__H__medium", "leaderboard_key": "ett1/H/medium", "dataset": "ett1/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.2143995688190363, "wql": 0.2937695158276702, "wsql_by_level": [0.16182556979140045, 0.2566703247646637, 0.3179489848185056, 0.3541190232345261, 0.3704390450363359, 0.3672515650523988, 0.34074828752681774, 0.2844462990740073, 0.19047654315037613], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 7.120665203544887, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8713861852411183, "wql": 0.6837159505652904}}, {"config_id": "ett1__H__long", "leaderboard_key": "ett1/H/long", "dataset": "ett1/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.108403107049459, "wql": 0.26932565727244423, "wsql_by_level": [0.18580205173921305, 0.2691977943702413, 0.31432952759334043, 0.3357948938746346, 0.3368756881855405, 0.32147375815247675, 0.28621902161368934, 0.22914730127554972, 0.1450908786473119], "n_valid_labels": 5040, "n_masked_labels": 0, "mae_median": 6.310423026872533, "n_mase_elements": 5040, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7644035739323134, "wql": 0.5072743027547193}}, {"config_id": "ett1__D__short", "leaderboard_key": "ett1/D/short", "dataset": "ett1/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.3338834402028559, "wql": 0.2206528626585563, "wsql_by_level": [0.15649360362438544, 0.2303063783024349, 0.2682668707833516, 0.28042882156590027, 0.2818932849855062, 0.2623312262814881, 0.222607064312146, 0.16755314667045879, 0.11599536740133552], "n_valid_labels": 210, "n_masked_labels": 0, "mae_median": 115.04867627677463, "n_mase_elements": 210, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6945867018524801, "wql": 0.5679786095136372}}, {"config_id": "ett1__W__short", "leaderboard_key": "ett1/W/short", "dataset": "ett1/W", "term": "short", "freq": "W-THU", "prediction_length": 8, "seasonality": 1, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.7872141092783826, "wql": 0.350722739439398, "wsql_by_level": [0.25740515084491233, 0.36722578222770363, 0.4341312748791001, 0.4698497916628444, 0.47558501620376037, 0.43992886363316525, 0.3682594082264771, 0.2352245408730326, 0.10889482640358612], "n_valid_labels": 56, "n_masked_labels": 0, "mae_median": 1206.4078138896398, "n_mase_elements": 56, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.1878188416566207, "wql": 0.9823258018145309}}, {"config_id": "ett2__T__short", "leaderboard_key": "ett2/15T/short", "dataset": "ett2/15T", "term": "short", "freq": "15T", "prediction_length": 48, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.7334312991377362, "wql": 0.09034943889243417, "wsql_by_level": [0.04996557085755058, 0.08156682729735686, 0.100392275643997, 0.11005223439949974, 0.11454438833014206, 0.11198991891836993, 0.10268340572706176, 0.08531853826517385, 0.056631790592755686], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 1.6327879840419406, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9502422871919158, "wql": 0.8986485212055849}}, {"config_id": "ett2__T__medium", "leaderboard_key": "ett2/15T/medium", "dataset": "ett2/15T", "term": "medium", "freq": "15T", "prediction_length": 480, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.9688128767833858, "wql": 0.11409979342549387, "wsql_by_level": [0.07361681477023599, 0.11133464695296702, 0.13270487095982894, 0.1440311981626583, 0.14805075627645434, 0.14162851828917508, 0.12419906598251608, 0.09503742561681594, 0.05629484381879317], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 2.1427634680022796, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.04290069549812, "wql": 0.7905715012820052}}, {"config_id": "ett2__T__long", "leaderboard_key": "ett2/15T/long", "dataset": "ett2/15T", "term": "long", "freq": "15T", "prediction_length": 720, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.1814935595212168, "wql": 0.1518794297450886, "wsql_by_level": [0.08573930208102536, 0.1256910603887048, 0.15486537904412703, 0.17940530803092924, 0.19544675389931845, 0.19590265286986644, 0.18027881898760942, 0.1487984125519407, 0.10078717985227596], "n_valid_labels": 5040, "n_masked_labels": 0, "mae_median": 2.6614835896640128, "n_mase_elements": 5040, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.0221257530089185, "wql": 0.8109950843353438}}, {"config_id": "ett2__H__short", "leaderboard_key": "ett2/H/short", "dataset": "ett2/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.9103654412061127, "wql": 0.1138812898763956, "wsql_by_level": [0.060818171359859466, 0.10352711408995882, 0.1280990270501541, 0.14037094991506227, 0.14472871297163692, 0.14151891524938315, 0.130715044030325, 0.10698919780618057, 0.06816447641500023], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 8.656774342060089, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.0134098694730314, "wql": 0.9397892290630341}}, {"config_id": "ett2__H__medium", "leaderboard_key": "ett2/H/medium", "dataset": "ett2/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.8694182427593795, "wql": 0.25023382477764383, "wsql_by_level": [0.220076891420819, 0.28039882522030457, 0.30656915583097655, 0.31040645068461287, 0.29721700118072714, 0.27393192051510545, 0.24077174371249124, 0.19556643453938347, 0.12716599989437424], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 16.37365030462942, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8224600750099719, "wql": 0.7992166251430929}}, {"config_id": "ett2__H__long", "leaderboard_key": "ett2/H/long", "dataset": "ett2/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 2.23374691186863, "wql": 0.19834196458622855, "wsql_by_level": [0.10201105137789299, 0.16346227198220944, 0.20400863175825276, 0.2298445545815791, 0.2453488648604956, 0.248015414715013, 0.2371621949432866, 0.20775795738618005, 0.14746673967114723], "n_valid_labels": 5040, "n_masked_labels": 0, "mae_median": 14.948326876998342, "n_mase_elements": 5040, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9277932661452751, "wql": 0.6905087978434369}}, {"config_id": "ett2__D__short", "leaderboard_key": "ett2/D/short", "dataset": "ett2/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 3.404406995021055, "wql": 0.1918257823859732, "wsql_by_level": [0.10945473409087089, 0.16743746408255653, 0.20527960686654992, 0.2285801873993269, 0.23887596568471434, 0.2355004008313435, 0.22034273377818359, 0.1887640988490374, 0.13219684989117594], "n_valid_labels": 210, "n_masked_labels": 0, "mae_median": 348.4026689252683, "n_mase_elements": 210, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.987838692674619, "wql": 0.873445782463934}}, {"config_id": "ett2__W__short", "leaderboard_key": "ett2/W/short", "dataset": "ett2/W", "term": "short", "freq": "W-THU", "prediction_length": 8, "seasonality": 1, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.9115859642912271, "wql": 0.1204472615024173, "wsql_by_level": [0.08616865338245543, 0.11273013021246696, 0.11918473584177104, 0.12394733728017499, 0.13595853548360168, 0.1461198671533806, 0.1436604493547486, 0.12448990089370228, 0.09176574391945433], "n_valid_labels": 56, "n_masked_labels": 0, "mae_median": 1376.942128249577, "n_mase_elements": 56, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9785192706599976, "wql": 0.6793186610726261}}, {"config_id": "jena_weather__T__short", "leaderboard_key": "jena_weather/10T/short", "dataset": "jena_weather/10T", "term": "short", "freq": "10T", "prediction_length": 48, "seasonality": 144, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.6567776950876182, "wql": 0.10390181982960771, "wsql_by_level": [0.032702103921265824, 0.051871420161722005, 0.08150691540344444, 0.1085879172513168, 0.1283605940657619, 0.14296673640107685, 0.14603120266302402, 0.1352920872213466, 0.10779740137751087], "n_valid_labels": 1008, "n_masked_labels": 0, "mae_median": 23.64989696035073, "n_mase_elements": 1008, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.0386262245009232, "wql": 0.7307616392787628}}, {"config_id": "jena_weather__T__medium", "leaderboard_key": "jena_weather/10T/medium", "dataset": "jena_weather/10T", "term": "medium", "freq": "10T", "prediction_length": 480, "seasonality": 144, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.8367471886797653, "wql": 0.07105917062773195, "wsql_by_level": [0.03440606641296538, 0.05942451747618064, 0.07495589803699289, 0.08474438180798205, 0.08929319800113891, 0.08794267549414034, 0.08171248813648332, 0.07016853398959526, 0.056884776294108874], "n_valid_labels": 10080, "n_masked_labels": 0, "mae_median": 15.519449593482488, "n_mase_elements": 10080, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8940784095923496, "wql": 0.3328005013577497}}, {"config_id": "jena_weather__T__long", "leaderboard_key": "jena_weather/10T/long", "dataset": "jena_weather/10T", "term": "long", "freq": "10T", "prediction_length": 720, "seasonality": 144, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.6355318728376552, "wql": 0.06488234596988064, "wsql_by_level": [0.03484147055585464, 0.057717572158342695, 0.07169477064502051, 0.08002494830477477, 0.08232802171025812, 0.07914022773691949, 0.07143942419855309, 0.059993541794748216, 0.04676113662445417], "n_valid_labels": 15120, "n_masked_labels": 0, "mae_median": 14.16328993834735, "n_mase_elements": 15120, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6594381615983075, "wql": 0.2739286586856853}}, {"config_id": "jena_weather__H__short", "leaderboard_key": "jena_weather/H/short", "dataset": "jena_weather/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.7566441877218407, "wql": 0.08283165018375324, "wsql_by_level": [0.030581945405944517, 0.05137454871395742, 0.07062253019359829, 0.08460918614431572, 0.09420930226255605, 0.10199047834610948, 0.1089697787648516, 0.11031500836157337, 0.0928120734608727], "n_valid_labels": 1008, "n_masked_labels": 0, "mae_median": 16.5090222686191, "n_mase_elements": 1008, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8336503105845321, "wql": 0.4801528639999464}}, {"config_id": "jena_weather__H__medium", "leaderboard_key": "jena_weather/H/medium", "dataset": "jena_weather/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 1.099199699911339, "wql": 0.11812050772931568, "wsql_by_level": [0.11657790757847461, 0.13855340831394772, 0.14632593379857026, 0.14388637692896508, 0.13452738848123366, 0.1231768233627765, 0.10804714815512985, 0.08870020748898999, 0.06328937545575362], "n_valid_labels": 10080, "n_masked_labels": 0, "mae_median": 24.37716235135583, "n_mase_elements": 10080, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7300963316874448, "wql": 0.33088668826658996}}, {"config_id": "jena_weather__H__long", "leaderboard_key": "jena_weather/H/long", "dataset": "jena_weather/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 1.0287052164817878, "wql": 0.08571698754034823, "wsql_by_level": [0.05112869529819806, 0.07881822275377764, 0.09521211722243107, 0.1028508759819873, 0.10438748307772369, 0.10052790069166972, 0.09273136046856695, 0.08167146928105229, 0.06412476308772742], "n_valid_labels": 15120, "n_masked_labels": 0, "mae_median": 20.256139428320107, "n_mase_elements": 15120, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.023473634676717, "wql": 0.2175284728920603}}, {"config_id": "jena_weather__D__short", "leaderboard_key": "jena_weather/D/short", "dataset": "jena_weather/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 1.2260421303547482, "wql": 0.07062996890613342, "wsql_by_level": [0.037566261048266984, 0.06001960183833484, 0.07579125133427225, 0.08643661282874487, 0.09088247242255622, 0.0878164474304829, 0.08223889554683157, 0.06890530160982503, 0.04601287609588614], "n_valid_labels": 630, "n_masked_labels": 0, "mae_median": 17.63552465090798, "n_mase_elements": 630, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.0409201289037093, "wql": 0.36279590867078565}}, {"config_id": "bitbrains_fast_storage__T__short", "leaderboard_key": "bitbrains_fast_storage/5T/short", "dataset": "bitbrains_fast_storage/5T", "term": "short", "freq": "5T", "prediction_length": 48, "seasonality": 288, "n_variates": 2, "n_instances": 189, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.5495690409618929, "wql": 0.4640114691068969, "wsql_by_level": [0.2735727210349164, 0.41126061433918715, 0.4773614782159531, 0.5097300459438864, 0.5302770091595749, 0.5516661797740225, 0.5459540768906436, 0.4995231463148054, 0.37675795028908265], "n_valid_labels": 18124, "n_masked_labels": 20, "mae_median": 164.91747839772205, "n_mase_elements": 17454, "n_seasonal_error_zero": 12, "n_seasonal_error_nan": 2}, "relative": {"mase": 0.5592570882200334, "wql": 0.23452315349567934}}, {"config_id": "bitbrains_fast_storage__T__medium", "leaderboard_key": "bitbrains_fast_storage/5T/medium", "dataset": "bitbrains_fast_storage/5T", "term": "medium", "freq": "5T", "prediction_length": 480, "seasonality": 288, "n_variates": 2, "n_instances": 184, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.8537420640137354, "wql": 0.3475119141408658, "wsql_by_level": [0.14851780246237994, 0.2619325858301886, 0.3562623489519422, 0.4308924916002662, 0.48124148139269113, 0.49618091496030575, 0.4684975993344411, 0.3563007186937533, 0.12778128404182415], "n_valid_labels": 175364, "n_masked_labels": 1276, "mae_median": 375.3476695428092, "n_mase_elements": 173750, "n_seasonal_error_zero": 2, "n_seasonal_error_nan": 4}, "relative": {"mase": 0.802478242122517, "wql": 0.5530322889608165}}, {"config_id": "bitbrains_fast_storage__T__long", "leaderboard_key": "bitbrains_fast_storage/5T/long", "dataset": "bitbrains_fast_storage/5T", "term": "long", "freq": "5T", "prediction_length": 720, "seasonality": 288, "n_variates": 2, "n_instances": 182, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.7621650331510523, "wql": 0.5470072015588816, "wsql_by_level": [0.2968334547515154, 0.47999623085957555, 0.5998344678722822, 0.6776370093847325, 0.7144447053365166, 0.7064816013600345, 0.6484886354250166, 0.5162975409801511, 0.2830511680601104], "n_valid_labels": 262080, "n_masked_labels": 0, "mae_median": 425.5427895169757, "n_mase_elements": 254880, "n_seasonal_error_zero": 10, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8682223785356328, "wql": 0.7114087638496536}}, {"config_id": "bitbrains_fast_storage__H__short", "leaderboard_key": "bitbrains_fast_storage/H/short", "dataset": "bitbrains_fast_storage/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 2, "n_instances": 188, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.8782510282113798, "wql": 0.6249780145611263, "wsql_by_level": [0.3414958373352421, 0.6040678304015741, 0.7731398110158448, 0.8418376720783018, 0.8374039796915037, 0.7631582332493825, 0.644374016270727, 0.49883149361525647, 0.32049325739230455], "n_valid_labels": 18042, "n_masked_labels": 6, "mae_median": 491.7578944897342, "n_mase_elements": 17466, "n_seasonal_error_zero": 12, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8937180939836543, "wql": 0.878934753600448}}, {"config_id": "bitbrains_rnd__T__short", "leaderboard_key": "bitbrains_rnd/5T/short", "dataset": "bitbrains_rnd/5T", "term": "short", "freq": "5T", "prediction_length": 48, "seasonality": 288, "n_variates": 2, "n_instances": 186, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.9855778026707239, "wql": 0.7002636946401669, "wsql_by_level": [0.15854831614964782, 0.3073962918894868, 0.4502861740964458, 0.5910852639913861, 0.7274652658554417, 0.8632444042222703, 0.9908741198357276, 1.103960010980373, 1.1095134047407234], "n_valid_labels": 17856, "n_masked_labels": 0, "mae_median": 262.20216032318325, "n_mase_elements": 17376, "n_seasonal_error_zero": 10, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8265802855038655, "wql": 0.5333497188237823}}, {"config_id": "bitbrains_rnd__T__medium", "leaderboard_key": "bitbrains_rnd/5T/medium", "dataset": "bitbrains_rnd/5T", "term": "medium", "freq": "5T", "prediction_length": 480, "seasonality": 288, "n_variates": 2, "n_instances": 190, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 1.1074614495310078, "wql": 0.4739412828125972, "wsql_by_level": [0.13849494472882778, 0.2729460200568033, 0.3875664515868339, 0.48722993987297364, 0.5719146863149911, 0.6424389237087188, 0.6892778516686807, 0.6756300539499801, 0.39997267342556553], "n_valid_labels": 181300, "n_masked_labels": 1100, "mae_median": 165.4849557380094, "n_mase_elements": 177590, "n_seasonal_error_zero": 2, "n_seasonal_error_nan": 8}, "relative": {"mase": 0.8509824401976337, "wql": 0.5825912354590667}}, {"config_id": "bitbrains_rnd__T__long", "leaderboard_key": "bitbrains_rnd/5T/long", "dataset": "bitbrains_rnd/5T", "term": "long", "freq": "5T", "prediction_length": 720, "seasonality": 288, "n_variates": 2, "n_instances": 183, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.7321179294190999, "wql": 0.7556704428037802, "wsql_by_level": [0.43086307309383404, 0.7640450817796286, 0.895850551794913, 0.9424746594341056, 0.9326704461007479, 0.8834700216740905, 0.7873138681072934, 0.6612523873598382, 0.5030938958895704], "n_valid_labels": 261076, "n_masked_labels": 2444, "mae_median": 173.10021903609947, "n_mase_elements": 257668, "n_seasonal_error_zero": 4, "n_seasonal_error_nan": 4}, "relative": {"mase": 0.9271972181904886, "wql": 0.4452092664511326}}, {"config_id": "bitbrains_rnd__H__short", "leaderboard_key": "bitbrains_rnd/H/short", "dataset": "bitbrains_rnd/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 2, "n_instances": 187, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 1.111504471519387, "wql": 0.4003264076306634, "wsql_by_level": [0.14237119303408338, 0.25782396189694645, 0.3626456361992451, 0.43885336274804965, 0.48894998551374863, 0.5224329418408078, 0.5128626702070823, 0.49009149966704707, 0.38690641756895994], "n_valid_labels": 17622, "n_masked_labels": 330, "mae_median": 149.52690210467262, "n_mase_elements": 16992, "n_seasonal_error_zero": 6, "n_seasonal_error_nan": 14}, "relative": {"mase": 0.8684486324844234, "wql": 0.481850025263346}}, {"config_id": "bizitobs_application__S__short", "leaderboard_key": "bizitobs_application/10S/short", "dataset": "bizitobs_application", "term": "short", "freq": "10S", "prediction_length": 60, "seasonality": 360, "n_variates": 2, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.7019078777385723, "wql": 0.007163020842642658, "wsql_by_level": [0.0048323953217077175, 0.007428689548045082, 0.00880632022869619, 0.00922815800829287, 0.009240588644501887, 0.008852255472677557, 0.007735533214100556, 0.005460030581390467, 0.002883216564371579], "n_valid_labels": 120, "n_masked_labels": 0, "mae_median": 237.88245471318564, "n_mase_elements": 120, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9708410885426743, "wql": 0.6045244118723399}}, {"config_id": "bizitobs_application__S__medium", "leaderboard_key": "bizitobs_application/10S/medium", "dataset": "bizitobs_application", "term": "medium", "freq": "10S", "prediction_length": 600, "seasonality": 360, "n_variates": 2, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.6817085244875766, "wql": 0.00908305176245739, "wsql_by_level": [0.0062095942843725885, 0.008970014505947982, 0.01051934205054723, 0.011257378777146233, 0.011346542971008068, 0.010808225766877181, 0.009729047591349151, 0.007907085317193958, 0.005000234597674131], "n_valid_labels": 1200, "n_masked_labels": 0, "mae_median": 278.2595032596588, "n_mase_elements": 1200, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8879461934578673, "wql": 0.7616154085572984}}, {"config_id": "bizitobs_application__S__long", "leaderboard_key": "bizitobs_application/10S/long", "dataset": "bizitobs_application", "term": "long", "freq": "10S", "prediction_length": 900, "seasonality": 360, "n_variates": 2, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.47039677164969534, "wql": 0.0069275774196375945, "wsql_by_level": [0.004539485797206928, 0.006361344864985718, 0.007201870509530482, 0.007636722525801759, 0.008063931285277545, 0.008292973433903702, 0.008112719388224904, 0.007130441459236186, 0.005008707512571115], "n_valid_labels": 1800, "n_masked_labels": 0, "mae_median": 192.6971052148607, "n_mase_elements": 1800, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8535136868258836, "wql": 0.5544770786481568}}, {"config_id": "bizitobs_service__S__short", "leaderboard_key": "bizitobs_service/10S/short", "dataset": "bizitobs_service", "term": "short", "freq": "10S", "prediction_length": 60, "seasonality": 360, "n_variates": 2, "n_instances": 21, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.4949962544597988, "wql": 0.006549953409254277, "wsql_by_level": [0.004442757460789555, 0.006606321187581675, 0.007784137504677365, 0.008214760553852686, 0.008319303075487582, 0.00793713373963574, 0.007023749197421014, 0.005407263156896729, 0.003214154806946143], "n_valid_labels": 2520, "n_masked_labels": 0, "mae_median": 11.094890022940106, "n_mase_elements": 2520, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6821867814552184, "wql": 0.35568480632273597}}, {"config_id": "bizitobs_service__S__medium", "leaderboard_key": "bizitobs_service/10S/medium", "dataset": "bizitobs_service", "term": "medium", "freq": "10S", "prediction_length": 600, "seasonality": 360, "n_variates": 2, "n_instances": 21, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.7127825594019868, "wql": 0.01067594117051045, "wsql_by_level": [0.007043672747066382, 0.010247076607099828, 0.01214680903015517, 0.013113579326992524, 0.013293415891855499, 0.012830367828236839, 0.01160501471039321, 0.009510649916310737, 0.006292884476483866], "n_valid_labels": 25200, "n_masked_labels": 0, "mae_median": 17.058138304800977, "n_mase_elements": 25200, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.884530481811879, "wql": 0.48693155408691524}}, {"config_id": "bizitobs_service__S__long", "leaderboard_key": "bizitobs_service/10S/long", "dataset": "bizitobs_service", "term": "long", "freq": "10S", "prediction_length": 900, "seasonality": 360, "n_variates": 2, "n_instances": 21, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.5855097987971744, "wql": 0.008541787992337763, "wsql_by_level": [0.005347169484117975, 0.00742687531847613, 0.008760381786199532, 0.009707581076710757, 0.010341851103091921, 0.010532398012756468, 0.010036556837851937, 0.00865577178193952, 0.006067506529895632], "n_valid_labels": 37800, "n_masked_labels": 0, "mae_median": 13.017232756930053, "n_mase_elements": 37800, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8298664374836866, "wql": 0.36298022285353765}}, {"config_id": "bizitobs_l2c__T__short", "leaderboard_key": "bizitobs_l2c/5T/short", "dataset": "bizitobs_l2c/5T", "term": "short", "freq": "5T", "prediction_length": 48, "seasonality": 288, "n_variates": 7, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.22382198847707513, "wql": 0.08186275444872211, "wsql_by_level": [0.037408019609334854, 0.0587024836969484, 0.07274663658623153, 0.08546096903659495, 0.09553181181020633, 0.1023533552907774, 0.10414736405542024, 0.09814263389813305, 0.0822715160548523], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 2.464862904378346, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.3141628202629681, "wql": 0.40902169334995897}}, {"config_id": "bizitobs_l2c__T__medium", "leaderboard_key": "bizitobs_l2c/5T/medium", "dataset": "bizitobs_l2c/5T", "term": "medium", "freq": "5T", "prediction_length": 480, "seasonality": 288, "n_variates": 7, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.4407966027857633, "wql": 0.520422498817802, "wsql_by_level": [0.22978402310712473, 0.36165335731056003, 0.46592120999148956, 0.5478746493831328, 0.6186311495874676, 0.6448182830937803, 0.6550486809870452, 0.6207646219800333, 0.5393065139195853], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 4.267838733288504, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.4960515060225297, "wql": 0.41974068372145845}}, {"config_id": "bizitobs_l2c__T__long", "leaderboard_key": "bizitobs_l2c/5T/long", "dataset": "bizitobs_l2c/5T", "term": "long", "freq": "5T", "prediction_length": 720, "seasonality": 288, "n_variates": 7, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.3944093443876808, "wql": 0.670821020204813, "wsql_by_level": [0.20348635948821533, 0.4055405210610619, 0.5543135992200804, 0.673438203664718, 0.7792245439047436, 0.8435686573300065, 0.8817232379021219, 0.879307778029058, 0.8167862812433121], "n_valid_labels": 5040, "n_masked_labels": 0, "mae_median": 3.6977173183408993, "n_mase_elements": 5040, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.2558446503954267, "wql": 0.276780534576553}}, {"config_id": "bizitobs_l2c__H__short", "leaderboard_key": "bizitobs_l2c/H/short", "dataset": "bizitobs_l2c/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.40004485130097434, "wql": 0.9345752346818303, "wsql_by_level": [0.9007532928297839, 0.9956025797043763, 0.9990633699137654, 1.0538246849540982, 1.051375534094755, 1.0057298018953584, 0.930539836300793, 0.8177558526503745, 0.6565321597931688], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 3.639788052355427, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.5082574591296873, "wql": 0.4082143613285467}}, {"config_id": "bizitobs_l2c__H__medium", "leaderboard_key": "bizitobs_l2c/H/medium", "dataset": "bizitobs_l2c/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.5221058974261685, "wql": 0.27240897937295977, "wsql_by_level": [0.13013451384900276, 0.22117940454590101, 0.2751250741357467, 0.3115947965021312, 0.3368170295202441, 0.3416225788178767, 0.3309159542200145, 0.29263050398847507, 0.2116609587772456], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 4.964060758289304, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.37993860849764666, "wql": 0.3088321968073675}}, {"config_id": "bizitobs_l2c__H__long", "leaderboard_key": "bizitobs_l2c/H/long", "dataset": "bizitobs_l2c/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.5968389877417738, "wql": 0.3011822329583366, "wsql_by_level": [0.14526495877212975, 0.25054966257046185, 0.31308607361678453, 0.34185030922902476, 0.3954609389648448, 0.396417300782174, 0.3591385200219045, 0.2966344116703586, 0.21223792099734698], "n_valid_labels": 5040, "n_masked_labels": 0, "mae_median": 5.701087109615938, "n_mase_elements": 5040, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.4490006084453436, "wql": 0.28811590287425715}}], "cpu_seconds": 1.1467377638909966, "members": ["/workspace/research/backcast_evals/weekly_slow_ar_delta3k", "/workspace/research/backcast_evals/patch8_ema6000", "/workspace/research/backcast_evals/split_patch_ema12000"], "member_checkpoint_hashes": ["094c7c694406075967f392a0d9ac1146bac984a90ab468c59d660a1b92fa7ba2", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "weights": [0.3333333333333333, 0.3333333333333333, 0.3333333333333333], "selection_only": true, "cutoff": "valid_backcast", "E102skill": 0.3397943577904946, "difference": 0.0004326583880599477} +{"composition": "equal quantile mean after each member applies its own fixed rules", "skill_score": 0.36494952219954613, "rel_mase_gmean": 0.7652921044693154, "rel_wql_gmean": 0.5269740887164148, "groups": {"term": {"short": 0.35231864866246176, "medium": 0.39298299792182056, "long": 0.3687947028461305}, "domain": {"Econ/Fin": 0.12172660354585485, "Energy": 0.24152286056809502, "Healthcare": 0.3524592910484051, "Nature": 0.4788459673908466, "Sales": 0.5562200646344707, "Transport": 0.42520099368193554, "Web/CloudOps": 0.4370802681174131}, "freq": {"A-DEC": 0.3367893179024516, "Q-DEC": 0.15679817162375864, "M": 0.16573415798569047, "W-SUN": 0.06797376532770616, "D": 0.43063552907975755, "H": 0.3947520428143986, "15T": 0.10816823329454162, "W-FRI": 0.15582466897824498, "10T": 0.5091318264307638, "W-TUE": 0.09072022101156729, "W-THU": 0.35383995123098644, "W-WED": 0.563658397919643, "5T": 0.47248290588277875, "10S": 0.28530046798638997}}, "configs": [{"config_id": "m4_yearly__A__short", "leaderboard_key": "m4_yearly/A/short", "dataset": "m4_yearly", "term": "short", "freq": "A-DEC", "prediction_length": 6, "seasonality": 1, "n_variates": 1, "n_instances": 117, "domain": "Econ/Fin", "n_cohorts": 3, "skipped_series": 235, "dropped_containers": 11, "metrics": {"mase": 2.9310956808598876, "wql": 0.1120823955071256, "wsql_by_level": [0.05644202792579237, 0.0905053717375648, 0.11408590505170658, 0.12930253744442674, 0.13960575186697724, 0.1391001159288124, 0.13444935326991628, 0.11877412643252444, 0.08647636990640943], "n_valid_labels": 702, "n_masked_labels": 0, "mae_median": 497.2042572803986, "n_mase_elements": 702, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.5810671768613991, "wql": 0.7569665373702766}}, {"config_id": "m4_quarterly__Q__short", "leaderboard_key": "m4_quarterly/Q/short", "dataset": "m4_quarterly", "term": "short", "freq": "Q-DEC", "prediction_length": 8, "seasonality": 4, "n_variates": 1, "n_instances": 187, "domain": "Econ/Fin", "n_cohorts": 3, "dropped_containers": 95, "metrics": {"mase": 1.6478859979869742, "wql": 0.10829988142949554, "wsql_by_level": [0.056003642707730145, 0.08983228427039322, 0.11123343407784438, 0.12480187246088971, 0.1322823443816346, 0.13234772923365642, 0.12698538731234796, 0.11318215410203093, 0.0880300843189324], "n_valid_labels": 1496, "n_masked_labels": 0, "mae_median": 658.2217914356905, "n_mase_elements": 1496, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8236951165880326, "wql": 0.8631704972613484}}, {"config_id": "m4_monthly__M__short", "leaderboard_key": "m4_monthly/M/short", "dataset": "m4_monthly", "term": "short", "freq": "M", "prediction_length": 18, "seasonality": 12, "n_variates": 1, "n_instances": 192, "domain": "Econ/Fin", "n_cohorts": 3, "dropped_containers": 499, "metrics": {"mase": 1.2065657349170607, "wql": 0.11616278210500203, "wsql_by_level": [0.06629914650161015, 0.10673308107406702, 0.1299410869238568, 0.1420671300945937, 0.146201258287822, 0.14056828824772014, 0.12820119810683464, 0.10795273317008502, 0.07750111653842881], "n_valid_labels": 3456, "n_masked_labels": 0, "mae_median": 685.2708041403029, "n_mase_elements": 3438, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 1}, "relative": {"mase": 0.8023830743189523, "wql": 0.8362369063369826}}, {"config_id": "m4_weekly__W__short", "leaderboard_key": "m4_weekly/W/short", "dataset": "m4_weekly", "term": "short", "freq": "W-SUN", "prediction_length": 13, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Econ/Fin", "n_cohorts": 2, "dropped_containers": 4, "metrics": {"mase": 3.4120286945915503, "wql": 0.06543789387564042, "wsql_by_level": [0.03568810513079098, 0.05573298663766547, 0.06941860827544521, 0.07742239160518294, 0.08155154894880773, 0.0820178043222598, 0.07725284580870735, 0.06601944523015421, 0.0438373089217501], "n_valid_labels": 2496, "n_masked_labels": 0, "mae_median": 421.99554291443945, "n_mase_elements": 2496, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.055884538770714, "wql": 0.8226968671486973}}, {"config_id": "m4_daily__D__short", "leaderboard_key": "m4_daily/D/short", "dataset": "m4_daily", "term": "short", "freq": "D", "prediction_length": 14, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Econ/Fin", "n_cohorts": 2, "dropped_containers": 23, "metrics": {"mase": 3.198081444911027, "wql": 0.017990809522792868, "wsql_by_level": [0.011334370410659413, 0.01708152964339461, 0.020489328746587362, 0.02218487101773786, 0.022524596765804428, 0.02176468750400583, 0.01964995836602746, 0.01603944649549975, 0.010848496755419105], "n_valid_labels": 2688, "n_masked_labels": 0, "mae_median": 160.98624503044854, "n_mase_elements": 2688, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.104570424679131, "wql": 1.1209370715015687}}, {"config_id": "m4_hourly__H__short", "leaderboard_key": "m4_hourly/H/short", "dataset": "m4_hourly", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Econ/Fin", "n_cohorts": 1, "metrics": {"mase": 1.2051508031734401, "wql": 0.035455791086468784, "wsql_by_level": [0.022635859061656737, 0.031868857116692025, 0.03783818151612068, 0.042129871543003294, 0.044377254084510626, 0.043981818274749666, 0.04074230287417112, 0.03367133925465812, 0.021856636052656822], "n_valid_labels": 9216, "n_masked_labels": 0, "mae_median": 324.76857741891257, "n_mase_elements": 9216, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9686625638484314, "wql": 0.9635541079372303}}, {"config_id": "electricity__T__short", "leaderboard_key": "electricity/15T/short", "dataset": "electricity/15T", "term": "short", "freq": "15T", "prediction_length": 48, "seasonality": 96, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.061137228646092, "wql": 0.04591758165497868, "wsql_by_level": [0.026081163297573977, 0.040577145372865414, 0.04973832461946903, 0.05510200546983552, 0.057696196719431804, 0.057247755878974904, 0.05347010788765257, 0.044527117196815375, 0.028818418452189545], "n_valid_labels": 9216, "n_masked_labels": 0, "mae_median": 31.861565152073226, "n_mase_elements": 9168, "n_seasonal_error_zero": 1, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9505070462344758, "wql": 0.9362673863304282}}, {"config_id": "electricity__T__medium", "leaderboard_key": "electricity/15T/medium", "dataset": "electricity/15T", "term": "medium", "freq": "15T", "prediction_length": 480, "seasonality": 96, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.7747484929662815, "wql": 0.05309715861514194, "wsql_by_level": [0.030180252210181283, 0.04596581504333987, 0.05636227583964971, 0.06297520734873935, 0.06639451806383717, 0.06627160807306913, 0.06197078540317996, 0.05236928965253693, 0.035384675901744045], "n_valid_labels": 92160, "n_masked_labels": 0, "mae_median": 37.07979084028054, "n_mase_elements": 92160, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7208015867064266, "wql": 0.6017494925974258}}, {"config_id": "electricity__T__long", "leaderboard_key": "electricity/15T/long", "dataset": "electricity/15T", "term": "long", "freq": "15T", "prediction_length": 720, "seasonality": 96, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.9631048407873014, "wql": 0.06530777451639308, "wsql_by_level": [0.03868243596033826, 0.05779712956476083, 0.07041444297527456, 0.07805245423605922, 0.08156683542619748, 0.0810059250720502, 0.07510093629409416, 0.06302772507444722, 0.04212208604431579], "n_valid_labels": 138240, "n_masked_labels": 0, "mae_median": 54.271278551763494, "n_mase_elements": 137520, "n_seasonal_error_zero": 1, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8373763327252927, "wql": 0.682692595415901}}, {"config_id": "electricity__H__short", "leaderboard_key": "electricity/H/short", "dataset": "electricity/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.1860486086671909, "wql": 0.12013049348037932, "wsql_by_level": [0.096727096738415, 0.13408846786092338, 0.150329087482554, 0.15458854056498766, 0.14894639634645762, 0.13563981815790846, 0.11593386248863469, 0.08978187340561354, 0.05513929827791953], "n_valid_labels": 9216, "n_masked_labels": 0, "mae_median": 491.3261660417807, "n_mase_elements": 9216, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9624248739757734, "wql": 1.2265362305458265}}, {"config_id": "electricity__H__medium", "leaderboard_key": "electricity/H/medium", "dataset": "electricity/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 1, "n_instances": 191, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.0450184810481011, "wql": 0.06694406280534905, "wsql_by_level": [0.04150106060160619, 0.06102083502791941, 0.07311294372802071, 0.07970163345112803, 0.08197371341192622, 0.08039645950436046, 0.07485210114064052, 0.06415357520889897, 0.04578424317364093], "n_valid_labels": 91680, "n_masked_labels": 0, "mae_median": 130.55320361785553, "n_mase_elements": 91680, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8449165096305236, "wql": 0.5871682426273181}}, {"config_id": "electricity__H__long", "leaderboard_key": "electricity/H/long", "dataset": "electricity/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.9998993403902402, "wql": 0.06818011784879856, "wsql_by_level": [0.03836064953172228, 0.05651673040533495, 0.06909567595139311, 0.07748233882709064, 0.0822167438527255, 0.08330189576376698, 0.08018491768541545, 0.07164780265095338, 0.05481430597078458], "n_valid_labels": 138240, "n_masked_labels": 0, "mae_median": 156.94477863154995, "n_mase_elements": 138240, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8216033574470202, "wql": 0.47852007257023116}}, {"config_id": "electricity__D__short", "leaderboard_key": "electricity/D/short", "dataset": "electricity/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.1131579576678026, "wql": 0.04849914537664307, "wsql_by_level": [0.028828026115528017, 0.04565428828905595, 0.05588957267330372, 0.06014304029525304, 0.06103558996707249, 0.05887061087185514, 0.053607789451018385, 0.043479301282370944, 0.028984089444329876], "n_valid_labels": 5760, "n_masked_labels": 0, "mae_median": 3925.439582457104, "n_mase_elements": 5760, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7985622713150854, "wql": 0.556481621909801}}, {"config_id": "electricity__W__short", "leaderboard_key": "electricity/W/short", "dataset": "electricity/W", "term": "short", "freq": "W-FRI", "prediction_length": 8, "seasonality": 1, "n_variates": 1, "n_instances": 191, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.0793149662245882, "wql": 0.04086397317219995, "wsql_by_level": [0.022948895531247317, 0.03184474849617729, 0.037373845841537426, 0.04288584810894898, 0.0465127528640773, 0.0479516852887964, 0.049952008912604984, 0.04849472174460474, 0.039811251761805055], "n_valid_labels": 1511, "n_masked_labels": 17, "mae_median": 19573.32892012328, "n_mase_elements": 1488, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 5}, "relative": {"mase": 0.8656625303046482, "wql": 0.6713736379674927}}, {"config_id": "solar__T__short", "leaderboard_key": "solar/10T/short", "dataset": "solar/10T", "term": "short", "freq": "10T", "prediction_length": 48, "seasonality": 144, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.19084156010689463, "wql": 0.4343575072579486, "wsql_by_level": [0.20779253832517464, 0.3849556409106096, 0.48689698493658684, 0.5496040418311166, 0.5736991639310752, 0.5627726299759063, 0.5065792133568167, 0.3869834899753305, 0.24993386207892077], "n_valid_labels": 6576, "n_masked_labels": 0, "mae_median": 0.43314461463919574, "n_mase_elements": 6576, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.772953237778248, "wql": 0.2251192058640265}}, {"config_id": "solar__T__medium", "leaderboard_key": "solar/10T/medium", "dataset": "solar/10T", "term": "medium", "freq": "10T", "prediction_length": 480, "seasonality": 144, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.035240092542235, "wql": 0.2947679001329638, "wsql_by_level": [0.19672717626798267, 0.3161935250005014, 0.37869650273195526, 0.3992906209489416, 0.3845364049578158, 0.3504917996538294, 0.29357824325670967, 0.21489950037823272, 0.11849732800070568], "n_valid_labels": 65760, "n_masked_labels": 0, "mae_median": 2.1841585941461465, "n_mase_elements": 65760, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8174635334771951, "wql": 0.5190789613049622}}, {"config_id": "solar__T__long", "leaderboard_key": "solar/10T/long", "dataset": "solar/10T", "term": "long", "freq": "10T", "prediction_length": 720, "seasonality": 144, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.2519314274970368, "wql": 0.446648833448481, "wsql_by_level": [0.37457636523739346, 0.5490203140498611, 0.5980099238426476, 0.5891475795016288, 0.5450058799385539, 0.47844673954273, 0.39681956532878426, 0.299551662152704, 0.18926147144202576], "n_valid_labels": 98640, "n_masked_labels": 0, "mae_median": 2.5721531510475453, "n_mase_elements": 98640, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8011385519783164, "wql": 0.5653112957646796}}, {"config_id": "solar__H__short", "leaderboard_key": "solar/H/short", "dataset": "solar/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.2511227283133475, "wql": 0.6311422099652426, "wsql_by_level": [0.5670637267850912, 0.8627076067697685, 0.8957423054194338, 0.8377163362117935, 0.742347572107844, 0.6315121972069098, 0.5094404688815857, 0.3863295401040202, 0.24742013620073655], "n_valid_labels": 6576, "n_masked_labels": 0, "mae_median": 16.6063073140262, "n_mase_elements": 6576, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8899817189144198, "wql": 0.6968449432343201}}, {"config_id": "solar__H__medium", "leaderboard_key": "solar/H/medium", "dataset": "solar/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.9325988326921647, "wql": 0.2717962382032388, "wsql_by_level": [0.2388186398097979, 0.3059638219945535, 0.33189523266564636, 0.3363412715892501, 0.3268453555834686, 0.30505546211175677, 0.26838445234232905, 0.20983039989810057, 0.12303150783424639], "n_valid_labels": 65760, "n_masked_labels": 0, "mae_median": 12.333341748959446, "n_mase_elements": 65760, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.930396450637462, "wql": 0.3948994384819965}}, {"config_id": "solar__H__long", "leaderboard_key": "solar/H/long", "dataset": "solar/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.7256882690377002, "wql": 0.18953329380033834, "wsql_by_level": [0.129437628172716, 0.19180382598905768, 0.2248972203588008, 0.23937464205632103, 0.2393617476759598, 0.22600921676530114, 0.19935205530955077, 0.1577053847749484, 0.09785792310038957], "n_valid_labels": 98640, "n_masked_labels": 0, "mae_median": 9.873129255650301, "n_mase_elements": 98640, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8624529299069983, "wql": 0.26015448798234825}}, {"config_id": "solar__D__short", "leaderboard_key": "solar/D/short", "dataset": "solar/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.577381964419038, "wql": 0.12152042589107188, "wsql_by_level": [0.08003448281021071, 0.11780832849619896, 0.14114201439510723, 0.15296349702749676, 0.15540871822133015, 0.14868468500616785, 0.1310813522291261, 0.1030661446792501, 0.06349461015475899], "n_valid_labels": 4110, "n_masked_labels": 0, "mae_median": 153.8461724608484, "n_mase_elements": 4110, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7416265839767592, "wql": 0.3262377109510743}}, {"config_id": "solar__W__short", "leaderboard_key": "solar/W/short", "dataset": "solar/W", "term": "short", "freq": "W-FRI", "prediction_length": 8, "seasonality": 1, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.409378944950785, "wql": 0.13747223830275362, "wsql_by_level": [0.09879871761569382, 0.13926128338425484, 0.1642148838804733, 0.17956636196376843, 0.18085820246876824, 0.17296996304258708, 0.1497466687389315, 0.10583791387032208, 0.04599614975998329], "n_valid_labels": 1096, "n_masked_labels": 0, "mae_median": 1462.9799609775962, "n_mase_elements": 1096, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.944606579751424, "wql": 0.9250532999889218}}, {"config_id": "hospital__M__short", "leaderboard_key": "hospital/M/short", "dataset": "hospital", "term": "short", "freq": "M", "prediction_length": 12, "seasonality": 12, "n_variates": 1, "n_instances": 192, "domain": "Healthcare", "n_cohorts": 1, "metrics": {"mase": 1.1872953754864706, "wql": 0.09033552842454197, "wsql_by_level": [0.05327101396064397, 0.08275308836121681, 0.10064665406714206, 0.1115716767764172, 0.11642451859276132, 0.11378717724161538, 0.10397332258146984, 0.08258679382620689, 0.04800551041340429], "n_valid_labels": 2304, "n_masked_labels": 0, "mae_median": 39.48999405755765, "n_mase_elements": 2304, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9163974870962155, "wql": 1.0227912518950282}}, {"config_id": "covid_deaths__D__short", "leaderboard_key": "covid_deaths/D/short", "dataset": "covid_deaths", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Healthcare", "n_cohorts": 1, "metrics": {"mase": 48.12474977081638, "wql": 0.17856830413663605, "wsql_by_level": [0.10029766305721693, 0.15761679068042614, 0.19909568121718552, 0.21568803436801545, 0.20598700534658185, 0.17979196516825632, 0.16843612027495572, 0.19314640964449412, 0.18705506747259212], "n_valid_labels": 5760, "n_masked_labels": 0, "mae_median": 140.89114211581312, "n_mase_elements": 4560, "n_seasonal_error_zero": 40, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9664090981300282, "wql": 0.6744684525277332}}, {"config_id": "us_births__D__short", "leaderboard_key": "us_births/D/short", "dataset": "us_births/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 1, "domain": "Healthcare", "n_cohorts": 1, "metrics": {"mase": 0.32740795206129847, "wql": 0.019424147474869674, "wsql_by_level": [0.019445241568923403, 0.02336107806595078, 0.024346462543590804, 0.022189927979153222, 0.01986436201877285, 0.018588094716870982, 0.01862441358842597, 0.01624212076957937, 0.012155626022559683], "n_valid_labels": 30, "n_masked_labels": 0, "mae_median": 215.50846354166666, "n_mase_elements": 30, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.2451931851581462, "wql": 0.19108750531666133}}, {"config_id": "us_births__M__short", "leaderboard_key": "us_births/M/short", "dataset": "us_births/M", "term": "short", "freq": "M", "prediction_length": 12, "seasonality": 12, "n_variates": 1, "n_instances": 1, "domain": "Healthcare", "n_cohorts": 1, "metrics": {"mase": 0.5608100261546994, "wql": 0.012788781420142236, "wsql_by_level": [0.006231326829633014, 0.010045851851306103, 0.013142028587465819, 0.016606814968716254, 0.01778984021264595, 0.017387134849044243, 0.015351196474565468, 0.011324881306241222, 0.007219957701662052], "n_valid_labels": 12, "n_masked_labels": 0, "mae_median": 5432.84375, "n_mase_elements": 12, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7526712423658174, "wql": 0.7276728033996893}}, {"config_id": "us_births__W__short", "leaderboard_key": "us_births/W/short", "dataset": "us_births/W", "term": "short", "freq": "W-TUE", "prediction_length": 8, "seasonality": 1, "n_variates": 1, "n_instances": 1, "domain": "Healthcare", "n_cohorts": 1, "metrics": {"mase": 1.1354599702535948, "wql": 0.01303864029036468, "wsql_by_level": [0.007080270651410994, 0.013386538091011058, 0.016205541384536514, 0.016823123103362852, 0.016890607474384648, 0.01559078204241586, 0.013600947329397275, 0.010634957345017647, 0.007134995191745283], "n_valid_labels": 8, "n_masked_labels": 0, "mae_median": 1227.296875, "n_mase_elements": 8, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9935615260068812, "wql": 0.8321474763622507}}, {"config_id": "saugeenday__D__short", "leaderboard_key": "saugeen/D/short", "dataset": "saugeenday/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 1.6507610560614754, "wql": 0.3521973340896551, "wsql_by_level": [0.12364373939688048, 0.21335570906115603, 0.2886726770445971, 0.3680583703859994, 0.43830693765189266, 0.4855708578366647, 0.4964484369014292, 0.44846730034139826, 0.3072519781868776], "n_valid_labels": 30, "n_masked_labels": 0, "mae_median": 7.373783683776855, "n_mase_elements": 30, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.969809350802278, "wql": 0.41490670800427915}}, {"config_id": "saugeenday__M__short", "leaderboard_key": "saugeen/M/short", "dataset": "saugeenday/M", "term": "short", "freq": "M", "prediction_length": 12, "seasonality": 12, "n_variates": 1, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.6558419406565725, "wql": 0.367224836950706, "wsql_by_level": [0.14533155878930448, 0.2609865011154885, 0.35636153526869563, 0.40374047557186615, 0.42543790813955895, 0.4503184706943847, 0.48092014120937, 0.4654226900962902, 0.31650425167139495], "n_valid_labels": 12, "n_masked_labels": 0, "mae_median": 11.517845710118612, "n_mase_elements": 12, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7959641353687992, "wql": 0.8558915681597892}}, {"config_id": "saugeenday__W__short", "leaderboard_key": "saugeen/W/short", "dataset": "saugeenday/W", "term": "short", "freq": "W-THU", "prediction_length": 8, "seasonality": 1, "n_variates": 1, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.2623838915907404, "wql": 0.23391760552191043, "wsql_by_level": [0.09660638083203833, 0.15169760153288214, 0.19252882576794153, 0.2191029896774264, 0.24334744767371147, 0.27529677515189954, 0.3370562819009359, 0.3534970620350443, 0.23612508512531416], "n_valid_labels": 8, "n_masked_labels": 0, "mae_median": 3.1556949615478516, "n_mase_elements": 8, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.511931989647992, "wql": 0.20502447442064026}}, {"config_id": "temperature_rain_with_missing__D__short", "leaderboard_key": "temperature_rain/D/short", "dataset": "temperature_rain_with_missing", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.6836916958010785, "wql": 0.5503255914030781, "wsql_by_level": [0.18114413832866588, 0.3458062364826655, 0.48865794463237877, 0.6058729128405423, 0.6908055643666081, 0.7396425302133325, 0.7430349579054545, 0.6656114143928422, 0.4923546234652134], "n_valid_labels": 5732, "n_masked_labels": 28, "mae_median": 4.245014685762957, "n_mase_elements": 5732, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.718970185522625, "wql": 0.3548679503623587}}, {"config_id": "kdd_cup_2018_with_missing__H__short", "leaderboard_key": "kdd_cup_2018/H/short", "dataset": "kdd_cup_2018_with_missing/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 176, "domain": "Nature", "n_cohorts": 2, "metrics": {"mase": 0.7467770125483886, "wql": 0.5260201815505297, "wsql_by_level": [0.21229944031244535, 0.3721926050004192, 0.5035340156300437, 0.6039977449411132, 0.6722016352233492, 0.6978572592385401, 0.6792612003265401, 0.5930794710528546, 0.3997582622294606], "n_valid_labels": 7994, "n_masked_labels": 454, "mae_median": 16.75100575813598, "n_mase_elements": 7994, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.1490537608893228, "wql": 0.906615565799268}}, {"config_id": "kdd_cup_2018_with_missing__H__medium", "leaderboard_key": "kdd_cup_2018/H/medium", "dataset": "kdd_cup_2018_with_missing/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 1, "n_instances": 183, "domain": "Nature", "n_cohorts": 2, "metrics": {"mase": 0.8271580987122301, "wql": 0.47418914844558135, "wsql_by_level": [0.1758515949546377, 0.3340822655272025, 0.4615559865178126, 0.5534118165702606, 0.6105013952742315, 0.6298848044936609, 0.6073596316789519, 0.5290803286201458, 0.36597451237332823], "n_valid_labels": 83400, "n_masked_labels": 4440, "mae_median": 17.40643863505485, "n_mase_elements": 83400, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7219635400561616, "wql": 0.4031871638198852}}, {"config_id": "kdd_cup_2018_with_missing__H__long", "leaderboard_key": "kdd_cup_2018/H/long", "dataset": "kdd_cup_2018_with_missing/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 1, "n_instances": 182, "domain": "Nature", "n_cohorts": 2, "metrics": {"mase": 0.8417188469943878, "wql": 0.454385779300152, "wsql_by_level": [0.1910487834514514, 0.3444472331626547, 0.4627891880034824, 0.5450057049080962, 0.5913329213644287, 0.5991410023559574, 0.5635978125533547, 0.47551081396307016, 0.3165985539388721], "n_valid_labels": 124670, "n_masked_labels": 6370, "mae_median": 19.157532229761546, "n_mase_elements": 124670, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7860392483075707, "wql": 0.367081603822145}}, {"config_id": "kdd_cup_2018_with_missing__D__short", "leaderboard_key": "kdd_cup_2018/D/short", "dataset": "kdd_cup_2018_with_missing/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 184, "domain": "Nature", "n_cohorts": 2, "metrics": {"mase": 0.9731026563071604, "wql": 0.3618683962324938, "wsql_by_level": [0.16891787704362585, 0.28076358810240654, 0.3650952627657956, 0.42573921467526593, 0.46175204430315486, 0.4694310730435063, 0.4460503358614484, 0.37872282481547914, 0.26034334548176175], "n_valid_labels": 5452, "n_masked_labels": 68, "mae_median": 14.280525457100316, "n_mase_elements": 5452, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6954914997585044, "wql": 0.4101977548318569}}, {"config_id": "restaurant__D__short", "leaderboard_key": "restaurant/D/short", "dataset": "restaurant", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 187, "domain": "Sales", "n_cohorts": 13, "skipped_series": 1, "metrics": {"mase": 0.8266709730317843, "wql": 0.32644913849321516, "wsql_by_level": [0.17724339906405612, 0.27715916260973633, 0.34594166785126407, 0.38876537515995313, 0.40968647661066604, 0.40748798070518794, 0.38082780692388535, 0.3245481243241838, 0.22638225319000363], "n_valid_labels": 4315, "n_masked_labels": 1295, "mae_median": 8.628766249671044, "n_mase_elements": 4315, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.680304862437252, "wql": 0.44520610487500445}}, {"config_id": "hierarchical_sales__D__short", "leaderboard_key": "hierarchical_sales/D/short", "dataset": "hierarchical_sales/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 118, "domain": "Sales", "n_cohorts": 1, "metrics": {"mase": 0.8848156527449037, "wql": 0.6636354646686073, "wsql_by_level": [0.2153590107876379, 0.3775907377845517, 0.52773037847808, 0.667930906163994, 0.7958236864677126, 0.8865128577171479, 0.9300890829888578, 0.8900604788298458, 0.6816220427996388], "n_valid_labels": 3540, "n_masked_labels": 0, "mae_median": 2.8348408718525016, "n_mase_elements": 3540, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.47269492857869055, "wql": 0.28022514514941543}}, {"config_id": "hierarchical_sales__W__short", "leaderboard_key": "hierarchical_sales/W/short", "dataset": "hierarchical_sales/W", "term": "short", "freq": "W-WED", "prediction_length": 8, "seasonality": 1, "n_variates": 1, "n_instances": 118, "domain": "Sales", "n_cohorts": 1, "metrics": {"mase": 0.688349341334979, "wql": 0.29516711557019454, "wsql_by_level": [0.1342657644058261, 0.2174622471569406, 0.2773994812659516, 0.31980641655424935, 0.3454592294020399, 0.35325513921582674, 0.3499432804581461, 0.34068254486517663, 0.3182299368075937], "n_valid_labels": 944, "n_masked_labels": 0, "mae_median": 8.317736043515852, "n_mase_elements": 944, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.5465837254098869, "wql": 0.3483345457519338}}, {"config_id": "LOOP_SEATTLE__T__short", "leaderboard_key": "loop_seattle/5T/short", "dataset": "LOOP_SEATTLE/5T", "term": "short", "freq": "5T", "prediction_length": 48, "seasonality": 288, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.619426023168628, "wql": 0.05831865403682283, "wsql_by_level": [0.049583559939091526, 0.06606104296761284, 0.07287325962414125, 0.07397327966108512, 0.07086285002412619, 0.06507150056332438, 0.05602616211356297, 0.04372435605975259, 0.026691875378708634], "n_valid_labels": 9216, "n_masked_labels": 0, "mae_median": 4.120602800407344, "n_mase_elements": 9216, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6824586969691046, "wql": 0.6127625347157203}}, {"config_id": "LOOP_SEATTLE__T__medium", "leaderboard_key": "loop_seattle/5T/medium", "dataset": "LOOP_SEATTLE/5T", "term": "medium", "freq": "5T", "prediction_length": 480, "seasonality": 288, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.7236690091469337, "wql": 0.06901664939356221, "wsql_by_level": [0.04922209623783197, 0.07109489674952088, 0.08254247176331708, 0.08696535020990583, 0.08605364420060367, 0.08101989432401416, 0.07156044535768286, 0.05703689116016593, 0.03565415453901756], "n_valid_labels": 92160, "n_masked_labels": 0, "mae_median": 4.532584031478877, "n_mase_elements": 92160, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7535041326714996, "wql": 0.6331818372782158}}, {"config_id": "LOOP_SEATTLE__T__long", "leaderboard_key": "loop_seattle/5T/long", "dataset": "LOOP_SEATTLE/5T", "term": "long", "freq": "5T", "prediction_length": 720, "seasonality": 288, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.9310019968557798, "wql": 0.08766539101773935, "wsql_by_level": [0.07174411347309662, 0.09762971655843491, 0.1090345068249475, 0.1119508330221983, 0.1082489733907105, 0.09931322948368128, 0.08533728131102443, 0.06591531123592403, 0.03981455385963659], "n_valid_labels": 138240, "n_masked_labels": 0, "mae_median": 5.83313470481619, "n_mase_elements": 138240, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.5499788486325501, "wql": 0.4985434566000823}}, {"config_id": "LOOP_SEATTLE__H__short", "leaderboard_key": "loop_seattle/H/short", "dataset": "LOOP_SEATTLE/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.7641490521664479, "wql": 0.05575730791788738, "wsql_by_level": [0.04469594671245008, 0.05916655714182244, 0.06637444331492785, 0.06834809212645392, 0.06708957262978296, 0.06274388862715742, 0.05594740748580088, 0.0463437666888313, 0.031106096533759616], "n_valid_labels": 9216, "n_masked_labels": 0, "mae_median": 3.549170459750005, "n_mase_elements": 9216, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7266364371020412, "wql": 0.6132222335435451}}, {"config_id": "LOOP_SEATTLE__H__medium", "leaderboard_key": "loop_seattle/H/medium", "dataset": "LOOP_SEATTLE/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.7162499484103702, "wql": 0.05008735845492902, "wsql_by_level": [0.03665382381247482, 0.049308702031704406, 0.055949295159185286, 0.05912453730737827, 0.059721017375504205, 0.05809575317953436, 0.053877582653537544, 0.045993586237147575, 0.032061928337894674], "n_valid_labels": 92160, "n_masked_labels": 0, "mae_median": 3.3963020701685713, "n_mase_elements": 92160, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6383153449125551, "wql": 0.34264036822884186}}, {"config_id": "LOOP_SEATTLE__H__long", "leaderboard_key": "loop_seattle/H/long", "dataset": "LOOP_SEATTLE/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.6730999548261424, "wql": 0.04738473747520454, "wsql_by_level": [0.03741420298926475, 0.049003076365163316, 0.05456816163843598, 0.05670344612452634, 0.056392474262329954, 0.053872629865046366, 0.04903879186669284, 0.04124862630978554, 0.028221227855595804], "n_valid_labels": 138240, "n_masked_labels": 0, "mae_median": 3.1660571400395217, "n_mase_elements": 138240, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6479154578840101, "wql": 0.2831342224745045}}, {"config_id": "LOOP_SEATTLE__D__short", "leaderboard_key": "loop_seattle/D/short", "dataset": "LOOP_SEATTLE/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.5869527498943429, "wql": 0.026517682768301874, "wsql_by_level": [0.018836363470185382, 0.026725220148757133, 0.03085448306553965, 0.032604502211547, 0.032476990740548155, 0.030763722380641685, 0.027792403818444496, 0.022993790058456615, 0.015611669020596772], "n_valid_labels": 5760, "n_masked_labels": 0, "mae_median": 1.8353070232603286, "n_mase_elements": 5760, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.5674112681823771, "wql": 0.3153108094409606}}, {"config_id": "SZ_TAXI__T__short", "leaderboard_key": "sz_taxi/15T/short", "dataset": "SZ_TAXI/15T", "term": "short", "freq": "15T", "prediction_length": 48, "seasonality": 96, "n_variates": 1, "n_instances": 156, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.5275099821911426, "wql": 0.20434423431930657, "wsql_by_level": [0.1063352570127323, 0.17224981969772526, 0.21653015626983474, 0.2443338898174095, 0.2577343162728452, 0.25695140799535693, 0.23999858073348534, 0.20446561578853037, 0.14049906528583933], "n_valid_labels": 7488, "n_masked_labels": 0, "mae_median": 2.828674548874095, "n_mase_elements": 7488, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7528484432860356, "wql": 0.6706520413345237}}, {"config_id": "SZ_TAXI__T__medium", "leaderboard_key": "sz_taxi/15T/medium", "dataset": "SZ_TAXI/15T", "term": "medium", "freq": "15T", "prediction_length": 480, "seasonality": 96, "n_variates": 1, "n_instances": 156, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 1.2247380279585667, "wql": 0.4606462422807205, "wsql_by_level": [0.35271563027858044, 0.46916671844764296, 0.5347574666973072, 0.5645971811346638, 0.5639857267667516, 0.5360861472248911, 0.4816248899642675, 0.3916217673837492, 0.25126065262863073], "n_valid_labels": 74880, "n_masked_labels": 0, "mae_median": 7.516599158164984, "n_mase_elements": 74880, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8464958215201235, "wql": 0.8074034064141411}}, {"config_id": "SZ_TAXI__H__short", "leaderboard_key": "sz_taxi/H/short", "dataset": "SZ_TAXI/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 156, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.48236939748182234, "wql": 0.1354479873405955, "wsql_by_level": [0.07083712908538735, 0.1105372186115372, 0.13693856479136124, 0.15434980584193558, 0.16477553303477152, 0.16617163715875705, 0.15956254128526853, 0.14421913712925524, 0.11164031912708551], "n_valid_labels": 7488, "n_masked_labels": 0, "mae_median": 1.8412857813400945, "n_mase_elements": 7488, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8145983157874067, "wql": 0.628189930360445}}, {"config_id": "M_DENSE__H__short", "leaderboard_key": "m_dense/H/short", "dataset": "M_DENSE/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 30, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.6162997543359653, "wql": 0.10877191722864998, "wsql_by_level": [0.06842868632873086, 0.09740792301646804, 0.1160604477140447, 0.12857126860399587, 0.13560961697225254, 0.13573949532414786, 0.12534388643656147, 0.10358798916803391, 0.06819794149361473], "n_valid_labels": 1440, "n_masked_labels": 0, "mae_median": 81.5105882300271, "n_mase_elements": 1440, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.46661331281821217, "wql": 0.4736986381907257}}, {"config_id": "M_DENSE__H__medium", "leaderboard_key": "m_dense/H/medium", "dataset": "M_DENSE/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 1, "n_instances": 30, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.9148011108326657, "wql": 0.24504539102617562, "wsql_by_level": [0.14577099949003738, 0.22502219095496742, 0.27481079495526645, 0.30219021195853174, 0.30826281677348044, 0.2953885829843998, 0.2648341688065938, 0.22490004916309475, 0.1642287041492086], "n_valid_labels": 14400, "n_masked_labels": 0, "mae_median": 125.8994382126795, "n_mase_elements": 14400, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8400498271111567, "wql": 0.503397100948463}}, {"config_id": "M_DENSE__H__long", "leaderboard_key": "m_dense/H/long", "dataset": "M_DENSE/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 1, "n_instances": 30, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.7819969830359697, "wql": 0.19776195024018062, "wsql_by_level": [0.15134470327137428, 0.20260209627716286, 0.22826577814636828, 0.23789205268069274, 0.23559926372484558, 0.22473934562755532, 0.2048769050860482, 0.17312237115020496, 0.12141503619737332], "n_valid_labels": 21600, "n_masked_labels": 0, "mae_median": 120.48273391845049, "n_mase_elements": 21600, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6098391116491899, "wql": 0.40316645461133116}}, {"config_id": "M_DENSE__D__short", "leaderboard_key": "m_dense/D/short", "dataset": "M_DENSE/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 30, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.7738065478738333, "wql": 0.12120110479278938, "wsql_by_level": [0.08607953195096542, 0.11947397605395241, 0.14036146571913397, 0.15063517229645662, 0.15061120626314242, 0.14340735182437886, 0.12780760139289363, 0.10374263393804896, 0.06869100369613208], "n_valid_labels": 900, "n_masked_labels": 0, "mae_median": 77.02082595825195, "n_mase_elements": 900, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.549989437783038, "wql": 0.47290777871154444}}, {"config_id": "ett1__T__short", "leaderboard_key": "ett1/15T/short", "dataset": "ett1/15T", "term": "short", "freq": "15T", "prediction_length": 48, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.107083738198638, "wql": 0.5316922568983645, "wsql_by_level": [0.5029810745408837, 0.6338315695950164, 0.6753554104316974, 0.6742020897094367, 0.6409019880677244, 0.5812692632016984, 0.49237570731020813, 0.373691657366816, 0.21062155186179923], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 2.062846050642076, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9245781564552206, "wql": 1.0262072040911547}}, {"config_id": "ett1__T__medium", "leaderboard_key": "ett1/15T/medium", "dataset": "ett1/15T", "term": "medium", "freq": "15T", "prediction_length": 480, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.0151525991880934, "wql": 0.3436310755687199, "wsql_by_level": [0.18236583162500872, 0.3237334768715601, 0.40952103959242186, 0.45340760079656006, 0.4644181827193618, 0.44080993665116874, 0.3842897872189889, 0.285010745952635, 0.14912307869077415], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 1.8481640429681214, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9760175426447272, "wql": 0.7797003304065692}}, {"config_id": "ett1__T__long", "leaderboard_key": "ett1/15T/long", "dataset": "ett1/15T", "term": "long", "freq": "15T", "prediction_length": 720, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.27307247294281, "wql": 0.3282946572402945, "wsql_by_level": [0.1986055679793525, 0.32963009334568827, 0.40464662823603, 0.4298134323826024, 0.4252601705899528, 0.3950404252046606, 0.34232899486159035, 0.2677727721923813, 0.16155383037039198], "n_valid_labels": 5040, "n_masked_labels": 0, "mae_median": 1.8683039446764196, "n_mase_elements": 5040, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.0291183243563582, "wql": 0.9052467154063255}}, {"config_id": "ett1__H__short", "leaderboard_key": "ett1/H/short", "dataset": "ett1/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.9129143559624434, "wql": 0.34525472332347, "wsql_by_level": [0.22660598368120843, 0.3171342306770723, 0.3892051243710807, 0.4526477770519681, 0.4649088283402593, 0.43816249084566516, 0.37952975924819127, 0.2841396536602566, 0.1549586620355285], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 5.417795660705971, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.720688952054486, "wql": 0.49139043771251073}}, {"config_id": "ett1__H__medium", "leaderboard_key": "ett1/H/medium", "dataset": "ett1/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.0214294966412503, "wql": 0.24595398164793053, "wsql_by_level": [0.17406814006790872, 0.25245690613813665, 0.2916652230833364, 0.3078214520838479, 0.304365418806307, 0.2861875993700716, 0.2538061200774976, 0.2059109555179105, 0.13730401968635877], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 5.731355004216589, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6755707955775141, "wql": 0.4958830967109687}}, {"config_id": "ett1__H__long", "leaderboard_key": "ett1/H/long", "dataset": "ett1/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.9184933289661569, "wql": 0.2433123192760126, "wsql_by_level": [0.148087687622324, 0.2254563058854089, 0.2648049834729476, 0.28675883967819676, 0.297921759296374, 0.29718192906862895, 0.27793974878550404, 0.23383002176933265, 0.15782959790539627], "n_valid_labels": 5040, "n_masked_labels": 0, "mae_median": 5.45492329030549, "n_mase_elements": 5040, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7635105614810753, "wql": 0.4861402649246405}}, {"config_id": "ett1__D__short", "leaderboard_key": "ett1/D/short", "dataset": "ett1/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.2362219565396784, "wql": 0.21211818079512806, "wsql_by_level": [0.12759474468457743, 0.20016557795687595, 0.2450403479988854, 0.2690227946277039, 0.27601033694224114, 0.26289772789069005, 0.23030779703065501, 0.18160797888721447, 0.11641632113730907], "n_valid_labels": 210, "n_masked_labels": 0, "mae_median": 101.23239531744095, "n_mase_elements": 210, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.1437216981005118, "wql": 0.5927534593021693}}, {"config_id": "ett1__W__short", "leaderboard_key": "ett1/W/short", "dataset": "ett1/W", "term": "short", "freq": "W-THU", "prediction_length": 8, "seasonality": 1, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.5817972675735799, "wql": 0.2921973343828827, "wsql_by_level": [0.17739626287432736, 0.2657361769468288, 0.33113457925827, 0.35921673551398514, 0.3726774138843192, 0.3692334104671081, 0.32880365974566456, 0.2511231373457456, 0.17445463340969528], "n_valid_labels": 56, "n_masked_labels": 0, "mae_median": 887.4289741516113, "n_mase_elements": 56, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9560732123503632, "wql": 0.8619209911132996}}, {"config_id": "ett2__T__short", "leaderboard_key": "ett2/15T/short", "dataset": "ett2/15T", "term": "short", "freq": "15T", "prediction_length": 48, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.2112942226535321, "wql": 0.10603323316944578, "wsql_by_level": [0.05555965645990992, 0.09118557231149862, 0.11608241426198763, 0.13235425709829884, 0.14054109753033928, 0.1378913565280705, 0.12474886142503079, 0.09823391892168855, 0.057701963988187825], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 2.3284006239402864, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.325018254897407, "wql": 1.0341219872765686}}, {"config_id": "ett2__T__medium", "leaderboard_key": "ett2/15T/medium", "dataset": "ett2/15T", "term": "medium", "freq": "15T", "prediction_length": 480, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.1125619361426078, "wql": 0.14794900206922662, "wsql_by_level": [0.07797574792800502, 0.11103643536660461, 0.14002828934016004, 0.1709334350168507, 0.19261772408209973, 0.1960801454455856, 0.18402660763026965, 0.15401239083343302, 0.10483024298003114], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 2.5729244746528344, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9696438663585314, "wql": 0.8447528997618089}}, {"config_id": "ett2__T__long", "leaderboard_key": "ett2/15T/long", "dataset": "ett2/15T", "term": "long", "freq": "15T", "prediction_length": 720, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 3.132940668573695, "wql": 0.40124570231715473, "wsql_by_level": [0.37730294414013316, 0.46656567513758473, 0.5038930442282548, 0.5078262594027046, 0.48564469472572414, 0.4406983717335641, 0.3738659991398243, 0.2859758751299265, 0.16943845721667647], "n_valid_labels": 5040, "n_masked_labels": 0, "mae_median": 6.437485706969488, "n_mase_elements": 5040, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.1117072218371524, "wql": 1.2608097043818878}}, {"config_id": "ett2__H__short", "leaderboard_key": "ett2/H/short", "dataset": "ett2/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.6563529338448054, "wql": 0.0862884390726809, "wsql_by_level": [0.06938829387567377, 0.10122261034470352, 0.11337074919837953, 0.1117961904391991, 0.09917241903269325, 0.08668258638540494, 0.07708285140796965, 0.06754543705426297, 0.050334813915841346], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 5.987722199587595, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8289956718205904, "wql": 0.7613814868523202}}, {"config_id": "ett2__H__medium", "leaderboard_key": "ett2/H/medium", "dataset": "ett2/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 2.2075137248499512, "wql": 0.18439759967917982, "wsql_by_level": [0.08817730746844442, 0.1412533046409432, 0.17940398523137663, 0.2063651328459806, 0.22440375088238398, 0.2319564432707547, 0.2276133614516551, 0.205835015194146, 0.15457009612693381], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 14.37627405598732, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9145284159882985, "wql": 0.7521615481310319}}, {"config_id": "ett2__H__long", "leaderboard_key": "ett2/H/long", "dataset": "ett2/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.394798318269394, "wql": 0.1611886217250057, "wsql_by_level": [0.11527137813406174, 0.16411191658426302, 0.1910512770653619, 0.2027425152895694, 0.20221066171358998, 0.19019332494177116, 0.16763191820242476, 0.13294724491987017, 0.0845373586741391], "n_valid_labels": 5040, "n_masked_labels": 0, "mae_median": 12.173998493500171, "n_mase_elements": 5040, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.0851923982475131, "wql": 0.6065658921590206}}, {"config_id": "ett2__D__short", "leaderboard_key": "ett2/D/short", "dataset": "ett2/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.6994531212586015, "wql": 0.13292929996003863, "wsql_by_level": [0.11347945972700656, 0.1474595699205491, 0.1646314501935089, 0.16653716913443242, 0.16051770159505488, 0.14520457750039695, 0.12595022495289165, 0.10029361350798896, 0.0722899331085184], "n_valid_labels": 210, "n_masked_labels": 0, "mae_median": 231.56498560905456, "n_mase_elements": 210, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.0461322783283002, "wql": 0.6669074142925306}}, {"config_id": "ett2__W__short", "leaderboard_key": "ett2/W/short", "dataset": "ett2/W", "term": "short", "freq": "W-THU", "prediction_length": 8, "seasonality": 1, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 2.7207313917731892, "wql": 0.2439608460673083, "wsql_by_level": [0.2123043410143094, 0.2360606948537212, 0.2628012649520402, 0.2949735441893475, 0.3030302356922222, 0.2900898749855996, 0.255908406398546, 0.2048120514281047, 0.13566720109188443], "n_valid_labels": 56, "n_masked_labels": 0, "mae_median": 3183.673274074282, "n_mase_elements": 56, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9881762125721921, "wql": 0.8515882038546841}}, {"config_id": "jena_weather__T__short", "leaderboard_key": "jena_weather/10T/short", "dataset": "jena_weather/10T", "term": "short", "freq": "10T", "prediction_length": 48, "seasonality": 144, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.3693799156133635, "wql": 0.03857587237506894, "wsql_by_level": [0.010771764445689159, 0.02024841146306703, 0.027892457408170743, 0.034847879870089984, 0.04111959615798594, 0.046979672544462864, 0.05141035091302487, 0.05522032308707679, 0.05869239548605312], "n_valid_labels": 1008, "n_masked_labels": 0, "mae_median": 6.649642039245616, "n_mase_elements": 1008, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.620697524222115, "wql": 0.26077522062932934}}, {"config_id": "jena_weather__T__medium", "leaderboard_key": "jena_weather/10T/medium", "dataset": "jena_weather/10T", "term": "medium", "freq": "10T", "prediction_length": 480, "seasonality": 144, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.5413986589833613, "wql": 0.05367567446141438, "wsql_by_level": [0.03001228670780097, 0.04860846118302179, 0.06016931792661841, 0.06723564070031182, 0.06922530584714544, 0.06652758814760626, 0.0591056417206643, 0.04727754051934235, 0.034919287400218005], "n_valid_labels": 10080, "n_masked_labels": 0, "mae_median": 11.876657931865859, "n_mase_elements": 10080, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7181975850720205, "wql": 0.26429131030519104}}, {"config_id": "jena_weather__T__long", "leaderboard_key": "jena_weather/10T/long", "dataset": "jena_weather/10T", "term": "long", "freq": "10T", "prediction_length": 720, "seasonality": 144, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.7594754178515889, "wql": 0.06366694627814617, "wsql_by_level": [0.035884214832891774, 0.0529284746807158, 0.06322715370665824, 0.06983585961097323, 0.07315002437881775, 0.07568589020748705, 0.07452279102216243, 0.06934186160871068, 0.05842624645489858], "n_valid_labels": 15120, "n_masked_labels": 0, "mae_median": 12.655410731558948, "n_mase_elements": 15120, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7458502225804546, "wql": 0.25538232386627097}}, {"config_id": "jena_weather__H__short", "leaderboard_key": "jena_weather/H/short", "dataset": "jena_weather/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.33191519473523495, "wql": 0.04738684853278885, "wsql_by_level": [0.027985432833509728, 0.038955617603439664, 0.04517740355470951, 0.050102263715761174, 0.05421992312086661, 0.05573756454830676, 0.05730162379080594, 0.05367931504126654, 0.043322492586433725], "n_valid_labels": 1008, "n_masked_labels": 0, "mae_median": 9.382634961705966, "n_mase_elements": 1008, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.37532523759556985, "wql": 0.25553695505697527}}, {"config_id": "jena_weather__H__medium", "leaderboard_key": "jena_weather/H/medium", "dataset": "jena_weather/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.9677294126704467, "wql": 0.08082793326156262, "wsql_by_level": [0.052850077276572836, 0.07992208185597273, 0.09437410985182884, 0.10050465489996874, 0.10006670080201084, 0.09254463400255994, 0.08109815551600089, 0.06981744828458945, 0.056273536864559486], "n_valid_labels": 10080, "n_masked_labels": 0, "mae_median": 19.92106823067713, "n_mase_elements": 10080, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.0177542533513237, "wql": 0.25349829803305995}}, {"config_id": "jena_weather__H__long", "leaderboard_key": "jena_weather/H/long", "dataset": "jena_weather/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 1.3942574079014727, "wql": 0.11464388218242544, "wsql_by_level": [0.07528698117500926, 0.1105696461852858, 0.13315981104348013, 0.14245028978155674, 0.14196177356913645, 0.13467972619837376, 0.12119504127525058, 0.10021379760450566, 0.07227787280923058], "n_valid_labels": 15120, "n_masked_labels": 0, "mae_median": 28.905303384889336, "n_mase_elements": 15120, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9458660496522819, "wql": 0.2947195312591485}}, {"config_id": "jena_weather__D__short", "leaderboard_key": "jena_weather/D/short", "dataset": "jena_weather/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 1.5093121737156134, "wql": 0.09724836964952815, "wsql_by_level": [0.06768729792131656, 0.09533974371540223, 0.11081749220812914, 0.11844442995185328, 0.12076572727729964, 0.11604674267461824, 0.10497925816880616, 0.08433185101141111, 0.056822783916916975], "n_valid_labels": 630, "n_masked_labels": 0, "mae_median": 24.450099781597594, "n_mase_elements": 630, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9063957442681962, "wql": 0.48151458212352155}}, {"config_id": "bitbrains_fast_storage__T__short", "leaderboard_key": "bitbrains_fast_storage/5T/short", "dataset": "bitbrains_fast_storage/5T", "term": "short", "freq": "5T", "prediction_length": 48, "seasonality": 288, "n_variates": 2, "n_instances": 189, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.7873417787456084, "wql": 0.17004234287352293, "wsql_by_level": [0.10419149307524825, 0.14694589153060567, 0.17381513031474, 0.1885775453605322, 0.19636511235874685, 0.194198080946545, 0.18048859045029986, 0.1699597711345186, 0.17583947069047004], "n_valid_labels": 18144, "n_masked_labels": 0, "mae_median": 76.28833707197467, "n_mase_elements": 17472, "n_seasonal_error_zero": 12, "n_seasonal_error_nan": 2}, "relative": {"mase": 0.9301168785823798, "wql": 0.13950583511064976}}, {"config_id": "bitbrains_fast_storage__T__medium", "leaderboard_key": "bitbrains_fast_storage/5T/medium", "dataset": "bitbrains_fast_storage/5T", "term": "medium", "freq": "5T", "prediction_length": 480, "seasonality": 288, "n_variates": 2, "n_instances": 182, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.7112655547226566, "wql": 0.5879802217038006, "wsql_by_level": [0.3335109407036411, 0.5510798369187269, 0.6640653949799512, 0.7292558148169821, 0.756650871113682, 0.7358371570152223, 0.6711333545136516, 0.5422782560286026, 0.308010369243744], "n_valid_labels": 174720, "n_masked_labels": 0, "mae_median": 395.6898486661917, "n_mase_elements": 173760, "n_seasonal_error_zero": 2, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8132431660475362, "wql": 0.7421229429809829}}, {"config_id": "bitbrains_fast_storage__T__long", "leaderboard_key": "bitbrains_fast_storage/5T/long", "dataset": "bitbrains_fast_storage/5T", "term": "long", "freq": "5T", "prediction_length": 720, "seasonality": 288, "n_variates": 2, "n_instances": 182, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.7214092088082876, "wql": 0.4972824133703841, "wsql_by_level": [0.3064214127552295, 0.5225172656270939, 0.5818980520212783, 0.5960653227032154, 0.593892465089494, 0.5760645833731588, 0.5375496968441965, 0.4615169686208724, 0.29961595329891844], "n_valid_labels": 262080, "n_masked_labels": 0, "mae_median": 443.1621442951751, "n_mase_elements": 252000, "n_seasonal_error_zero": 10, "n_seasonal_error_nan": 4}, "relative": {"mase": 0.7804660417878175, "wql": 0.7032124595530006}}, {"config_id": "bitbrains_fast_storage__H__short", "leaderboard_key": "bitbrains_fast_storage/H/short", "dataset": "bitbrains_fast_storage/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 2, "n_instances": 188, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.5690350150639927, "wql": 0.34840789929643523, "wsql_by_level": [0.16967738691785286, 0.302882880307531, 0.39966400144092246, 0.4525647753293816, 0.46521437463772825, 0.4470010118091984, 0.4027574753294348, 0.31925003082592074, 0.17665915706994673], "n_valid_labels": 18048, "n_masked_labels": 0, "mae_median": 335.3995370736956, "n_mase_elements": 17472, "n_seasonal_error_zero": 12, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7843670429667351, "wql": 0.6042522353305465}}, {"config_id": "bitbrains_rnd__T__short", "leaderboard_key": "bitbrains_rnd/5T/short", "dataset": "bitbrains_rnd/5T", "term": "short", "freq": "5T", "prediction_length": 48, "seasonality": 288, "n_variates": 2, "n_instances": 186, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 1.1762276768493416, "wql": 0.29305788852580017, "wsql_by_level": [0.0941130412093545, 0.16622963545994934, 0.226678972851334, 0.27978610366565937, 0.3269947778695106, 0.3686592579693599, 0.4020833311541577, 0.41608000269585727, 0.3568958738570189], "n_valid_labels": 17856, "n_masked_labels": 0, "mae_median": 52.206851834061446, "n_mase_elements": 17376, "n_seasonal_error_zero": 10, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.853011114931803, "wql": 0.302634558662142}}, {"config_id": "bitbrains_rnd__T__medium", "leaderboard_key": "bitbrains_rnd/5T/medium", "dataset": "bitbrains_rnd/5T", "term": "medium", "freq": "5T", "prediction_length": 480, "seasonality": 288, "n_variates": 2, "n_instances": 188, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.7018403923087395, "wql": 0.8763071749093687, "wsql_by_level": [0.4593097018225786, 0.9207738511644981, 1.0929373491978462, 1.1319649154348952, 1.1000326475380773, 1.0137410432291196, 0.8788118060722624, 0.7181236981849387, 0.5710695615401022], "n_valid_labels": 178498, "n_masked_labels": 1982, "mae_median": 195.70914827139654, "n_mase_elements": 177486, "n_seasonal_error_zero": 2, "n_seasonal_error_nan": 4}, "relative": {"mase": 0.8424568913342672, "wql": 0.4601642426171456}}, {"config_id": "bitbrains_rnd__T__long", "leaderboard_key": "bitbrains_rnd/5T/long", "dataset": "bitbrains_rnd/5T", "term": "long", "freq": "5T", "prediction_length": 720, "seasonality": 288, "n_variates": 2, "n_instances": 181, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 1.1018156833060604, "wql": 0.6628716401107811, "wsql_by_level": [0.20530593636375716, 0.3717069457920215, 0.518072770111531, 0.6517749761797804, 0.7620512965890279, 0.8697410983682754, 0.9144529240804049, 0.9053833830481348, 0.7673554304640974], "n_valid_labels": 260626, "n_masked_labels": 14, "mae_median": 209.089716706767, "n_mase_elements": 246232, "n_seasonal_error_zero": 4, "n_seasonal_error_nan": 16}, "relative": {"mase": 0.7693993451517863, "wql": 0.6084504573504855}}, {"config_id": "bitbrains_rnd__H__short", "leaderboard_key": "bitbrains_rnd/H/short", "dataset": "bitbrains_rnd/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 2, "n_instances": 180, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 1.2215021770399326, "wql": 0.36860351639044364, "wsql_by_level": [0.14886295299375826, 0.2641160652678832, 0.3535642757534057, 0.44892928556562695, 0.5143735939904236, 0.5221533797370183, 0.46486019908891, 0.3523978235325424, 0.2481740715844244], "n_valid_labels": 17280, "n_masked_labels": 0, "mae_median": 250.59353141244387, "n_mase_elements": 16992, "n_seasonal_error_zero": 6, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8251812853807775, "wql": 0.4597046797120189}}, {"config_id": "bizitobs_application__S__short", "leaderboard_key": "bizitobs_application/10S/short", "dataset": "bizitobs_application", "term": "short", "freq": "10S", "prediction_length": 60, "seasonality": 360, "n_variates": 2, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.4062655295463454, "wql": 0.006554902715506177, "wsql_by_level": [0.001765639491537941, 0.003677057251152104, 0.005721009967562471, 0.00740489998704737, 0.008884389930746837, 0.009561424272219617, 0.009204914185693592, 0.00775450057763828, 0.00502028877595738], "n_valid_labels": 120, "n_masked_labels": 0, "mae_median": 226.22181529998778, "n_mase_elements": 120, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.0914920939774215, "wql": 0.8113244574488367}}, {"config_id": "bizitobs_application__S__medium", "leaderboard_key": "bizitobs_application/10S/medium", "dataset": "bizitobs_application", "term": "medium", "freq": "10S", "prediction_length": 600, "seasonality": 360, "n_variates": 2, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.4703034034625197, "wql": 0.00669723470787308, "wsql_by_level": [0.004606076681672416, 0.006445194841912462, 0.007311925529992874, 0.0077634796399292105, 0.007855401423663174, 0.007724686936390077, 0.007453408045348879, 0.006523392176113295, 0.004591547095835339], "n_valid_labels": 1200, "n_masked_labels": 0, "mae_median": 187.96784063339234, "n_mase_elements": 1200, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8849852965089385, "wql": 0.5926567331089186}}, {"config_id": "bizitobs_application__S__long", "leaderboard_key": "bizitobs_application/10S/long", "dataset": "bizitobs_application", "term": "long", "freq": "10S", "prediction_length": 900, "seasonality": 360, "n_variates": 2, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.6654016738485262, "wql": 0.011677349915199205, "wsql_by_level": [0.011072168278189536, 0.01512204458353631, 0.016228991617481307, 0.015169236927761277, 0.01320514614232288, 0.010918002761176599, 0.008785145277329313, 0.007835656948784589, 0.00675975670021103], "n_valid_labels": 1800, "n_masked_labels": 0, "mae_median": 323.02682648764716, "n_mase_elements": 1800, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.0038139945754476, "wql": 0.8458267168495301}}, {"config_id": "bizitobs_service__S__short", "leaderboard_key": "bizitobs_service/10S/short", "dataset": "bizitobs_service", "term": "short", "freq": "10S", "prediction_length": 60, "seasonality": 360, "n_variates": 2, "n_instances": 21, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.5911467133771469, "wql": 0.008201373646660888, "wsql_by_level": [0.004057122255436924, 0.00663481674992507, 0.00848352286574821, 0.009837478530932867, 0.010565611856506289, 0.010618757352089779, 0.009928090259344657, 0.008306594949895255, 0.005380368000068941], "n_valid_labels": 2520, "n_masked_labels": 0, "mae_median": 13.990628957348905, "n_mase_elements": 2520, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7740464521109395, "wql": 0.4906841904603532}}, {"config_id": "bizitobs_service__S__medium", "leaderboard_key": "bizitobs_service/10S/medium", "dataset": "bizitobs_service", "term": "medium", "freq": "10S", "prediction_length": 600, "seasonality": 360, "n_variates": 2, "n_instances": 21, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.5845086884755826, "wql": 0.008399305981727882, "wsql_by_level": [0.0053232467060303525, 0.007428680774369053, 0.008813081163579473, 0.009741711463396563, 0.010266253138463466, 0.010284305113961138, 0.009685945822732973, 0.008290074331809337, 0.005760455321208573], "n_valid_labels": 25200, "n_masked_labels": 0, "mae_median": 12.938362117326921, "n_mase_elements": 25200, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8394513110829915, "wql": 0.394265471797736}}, {"config_id": "bizitobs_service__S__long", "leaderboard_key": "bizitobs_service/10S/long", "dataset": "bizitobs_service", "term": "long", "freq": "10S", "prediction_length": 900, "seasonality": 360, "n_variates": 2, "n_instances": 21, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.7293534428628334, "wql": 0.010389260259255953, "wsql_by_level": [0.0072624646328127065, 0.010321832856757153, 0.012023497528620112, 0.012818662254133417, 0.012900946360225922, 0.01232845830991949, 0.011047585669131875, 0.008907567335014127, 0.00589232738668876], "n_valid_labels": 37800, "n_masked_labels": 0, "mae_median": 16.5367922705065, "n_mase_elements": 37800, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8900132461854047, "wql": 0.40257154138262724}}, {"config_id": "bizitobs_l2c__T__short", "leaderboard_key": "bizitobs_l2c/5T/short", "dataset": "bizitobs_l2c/5T", "term": "short", "freq": "5T", "prediction_length": 48, "seasonality": 288, "n_variates": 7, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.2095262378348314, "wql": 0.0739445046795741, "wsql_by_level": [0.033110671484900586, 0.052002194573316715, 0.06505702329612414, 0.0770106599351185, 0.08776760413787124, 0.09483606922862413, 0.09668902741370758, 0.09005576656204753, 0.06897152548445652], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 2.1584483129637584, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.3275733914863857, "wql": 0.396731646948172}}, {"config_id": "bizitobs_l2c__T__medium", "leaderboard_key": "bizitobs_l2c/5T/medium", "dataset": "bizitobs_l2c/5T", "term": "medium", "freq": "5T", "prediction_length": 480, "seasonality": 288, "n_variates": 7, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.3440786668313065, "wql": 0.5938867322323665, "wsql_by_level": [0.13600572828480512, 0.36147536137441144, 0.47508819657130597, 0.5721192663332282, 0.6723217686989006, 0.7375980346365651, 0.7914280009022922, 0.8207589470617863, 0.7781852862280043], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 3.633236852332595, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.22607178220419485, "wql": 0.2819516465789851}}, {"config_id": "bizitobs_l2c__T__long", "leaderboard_key": "bizitobs_l2c/5T/long", "dataset": "bizitobs_l2c/5T", "term": "long", "freq": "5T", "prediction_length": 720, "seasonality": 288, "n_variates": 7, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.45511087159958724, "wql": 0.19160275633213286, "wsql_by_level": [0.11921702306453705, 0.1798427767400755, 0.21040762287704848, 0.2321147763267757, 0.24018903730717306, 0.2330038092952642, 0.20994098572164058, 0.17722710493187102, 0.12248167072481017], "n_valid_labels": 5040, "n_masked_labels": 0, "mae_median": 5.020375507525982, "n_mase_elements": 5040, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.45570853675646317, "wql": 0.5185063261158916}}, {"config_id": "bizitobs_l2c__H__short", "leaderboard_key": "bizitobs_l2c/H/short", "dataset": "bizitobs_l2c/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.43744211877725736, "wql": 0.306751021444636, "wsql_by_level": [0.12845518194518704, 0.22146909752749813, 0.28943233655169903, 0.33668810146483885, 0.37014855030159677, 0.38925141609197206, 0.38404756827844544, 0.3604672440158595, 0.2807996968246274], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 5.071506102525053, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.3840288994664711, "wql": 0.4652754878218807}}, {"config_id": "bizitobs_l2c__H__medium", "leaderboard_key": "bizitobs_l2c/H/medium", "dataset": "bizitobs_l2c/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.6304829242294927, "wql": 0.2828865952176213, "wsql_by_level": [0.15106216711713033, 0.25351171362375946, 0.3105823304861972, 0.34165283339413277, 0.37635173300444147, 0.3679158123250064, 0.3232675397260872, 0.25181060871544203, 0.16982461856639489], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 5.9699882950345495, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.44472341451408304, "wql": 0.3287825561336583}}], "cpu_seconds": 1.0800957710016519, "members": ["/workspace/research/backcast2_evals/weekly_slow_ar_delta3k", "/workspace/research/backcast2_evals/patch8_ema6000", "/workspace/research/backcast2_evals/split_patch_ema12000"], "member_checkpoint_hashes": ["094c7c694406075967f392a0d9ac1146bac984a90ab468c59d660a1b92fa7ba2", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "weights": [0.3333333333333333, 0.3333333333333333, 0.3333333333333333], "selection_only": true, "cutoff": "valid_backcast2", "E102skill": 0.3650870167535245, "difference": -0.00013749455397837895} +{"composition": "equal quantile mean after each member applies its own fixed rules", "skill_score": 0.3895560076325473, "rel_mase_gmean": 0.7397944917104605, "rel_wql_gmean": 0.5037099789104116, "groups": {"term": {"short": 0.39497499447719087, "medium": 0.36817084374084685, "long": 0.3961751351498505}, "domain": {"Econ/Fin": 0.1867078283664393, "Energy": 0.31635325174873963, "Healthcare": 0.2409392551732944, "Nature": 0.5066352280851036, "Sales": 0.39984868686183916, "Transport": 0.5093415403788037, "Web/CloudOps": 0.3940107201665548}, "freq": {"A-DEC": 0.35784995850867973, "Q-DEC": 0.25447966877928774, "M": 0.148976696722656, "W-SUN": 0.1683943609547428, "D": 0.4400873284135568, "H": 0.4057663179487805, "15T": 0.2545202824131877, "W-FRI": 0.03968631706726722, "10T": 0.6070409132004327, "W-TUE": 0.2726738628251745, "W-THU": 0.3390868412221538, "W-WED": 0.37715156511841175, "5T": 0.4653160336561383, "10S": 0.2927867937240686}}, "configs": [{"config_id": "m4_yearly__A__short", "leaderboard_key": "m4_yearly/A/short", "dataset": "m4_yearly", "term": "short", "freq": "A-DEC", "prediction_length": 6, "seasonality": 1, "n_variates": 1, "n_instances": 72, "domain": "Econ/Fin", "n_cohorts": 3, "skipped_series": 235, "dropped_containers": 11, "metrics": {"mase": 1.9968311000247458, "wql": 0.09431077343688035, "wsql_by_level": [0.057351370674834486, 0.08460425826103793, 0.09675036185704364, 0.10488426826187748, 0.1141929048203329, 0.11318498653042676, 0.10820881729176861, 0.09524758021703066, 0.07437241301757068], "n_valid_labels": 432, "n_masked_labels": 0, "mae_median": 386.90164022092466, "n_mase_elements": 432, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.5327260887435096, "wql": 0.7740500878413724}}, {"config_id": "m4_quarterly__Q__short", "leaderboard_key": "m4_quarterly/Q/short", "dataset": "m4_quarterly", "term": "short", "freq": "Q-DEC", "prediction_length": 8, "seasonality": 4, "n_variates": 1, "n_instances": 164, "domain": "Econ/Fin", "n_cohorts": 3, "dropped_containers": 95, "metrics": {"mase": 1.3466628410343882, "wql": 0.07619546429116468, "wsql_by_level": [0.042053495533562364, 0.06642435787204258, 0.0810742047190762, 0.08988202179447301, 0.09444603993760482, 0.09470428424835266, 0.08887245008707427, 0.07575735078687426, 0.052544973641421994], "n_valid_labels": 1312, "n_masked_labels": 0, "mae_median": 467.81559930196624, "n_mase_elements": 1312, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7201529208440769, "wql": 0.7717813094641036}}, {"config_id": "m4_monthly__M__short", "leaderboard_key": "m4_monthly/M/short", "dataset": "m4_monthly", "term": "short", "freq": "M", "prediction_length": 18, "seasonality": 12, "n_variates": 1, "n_instances": 148, "domain": "Econ/Fin", "n_cohorts": 3, "dropped_containers": 499, "metrics": {"mase": 1.3586919716401007, "wql": 0.1137018990727708, "wsql_by_level": [0.07387143973071765, 0.10365601243650747, 0.12558889012990404, 0.13686400165768292, 0.13963017215907328, 0.13580584565048176, 0.12544054841260036, 0.10674629458647017, 0.07571388689149945], "n_valid_labels": 2664, "n_masked_labels": 0, "mae_median": 632.0187633502949, "n_mase_elements": 2664, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.779267946142973, "wql": 0.7562270530823811}}, {"config_id": "m4_weekly__W__short", "leaderboard_key": "m4_weekly/W/short", "dataset": "m4_weekly", "term": "short", "freq": "W-SUN", "prediction_length": 13, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Econ/Fin", "n_cohorts": 2, "dropped_containers": 4, "metrics": {"mase": 3.1376710929808236, "wql": 0.05610427278366708, "wsql_by_level": [0.03207904965590628, 0.04743180538291435, 0.057305160776317136, 0.06428230854640059, 0.06812246664712152, 0.06918429210907566, 0.06656931715735032, 0.0586662174764149, 0.04129783730150303], "n_valid_labels": 2496, "n_masked_labels": 0, "mae_median": 347.26442183898047, "n_mase_elements": 2496, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9927479701235363, "wql": 0.6966198468336456}}, {"config_id": "m4_daily__D__short", "leaderboard_key": "m4_daily/D/short", "dataset": "m4_daily", "term": "short", "freq": "D", "prediction_length": 14, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Econ/Fin", "n_cohorts": 2, "dropped_containers": 23, "metrics": {"mase": 2.899294632917307, "wql": 0.01782209940529695, "wsql_by_level": [0.012368559288437032, 0.017953943856232044, 0.020997375199711395, 0.022303848398829706, 0.02211073841633459, 0.020777217756722845, 0.018327784517731156, 0.014925917277556348, 0.01063350993611742], "n_valid_labels": 2688, "n_masked_labels": 0, "mae_median": 157.58748077210925, "n_mase_elements": 2688, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.1233738943586717, "wql": 1.1683129880583574}}, {"config_id": "m4_hourly__H__short", "leaderboard_key": "m4_hourly/H/short", "dataset": "m4_hourly", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Econ/Fin", "n_cohorts": 1, "metrics": {"mase": 1.1448737645362772, "wql": 0.030195311576824854, "wsql_by_level": [0.01450632321854546, 0.023160041176966722, 0.029678064430175035, 0.0358304213678648, 0.03931481124092293, 0.04008023758962699, 0.037634115512838316, 0.031165855762965624, 0.02038793389151782], "n_valid_labels": 9216, "n_masked_labels": 0, "mae_median": 292.94997708439445, "n_mase_elements": 9216, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9366634566620275, "wql": 0.7293334098979858}}, {"config_id": "electricity__T__short", "leaderboard_key": "electricity/15T/short", "dataset": "electricity/15T", "term": "short", "freq": "15T", "prediction_length": 48, "seasonality": 96, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.6963746720913301, "wql": 0.05573553609690128, "wsql_by_level": [0.03357291719577235, 0.05048769495355534, 0.06113133394546291, 0.0673339201516293, 0.06955087669417274, 0.06858196942696926, 0.06365083936968094, 0.052885465011481225, 0.034424808123387406], "n_valid_labels": 9216, "n_masked_labels": 0, "mae_median": 23.270813270649846, "n_mase_elements": 9168, "n_seasonal_error_zero": 1, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8564447332091749, "wql": 0.8239957863230027}}, {"config_id": "electricity__T__medium", "leaderboard_key": "electricity/15T/medium", "dataset": "electricity/15T", "term": "medium", "freq": "15T", "prediction_length": 480, "seasonality": 96, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.9086374800774779, "wql": 0.06562175592497879, "wsql_by_level": [0.03810428198148621, 0.058562556936855206, 0.07160368470090045, 0.07931327378437407, 0.08240346934426789, 0.08132439285170404, 0.07526672608421923, 0.06265865854174585, 0.04135875909925615], "n_valid_labels": 92160, "n_masked_labels": 0, "mae_median": 45.90769322239002, "n_mase_elements": 92160, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7273277053860124, "wql": 0.6700476497993054}}, {"config_id": "electricity__T__long", "leaderboard_key": "electricity/15T/long", "dataset": "electricity/15T", "term": "long", "freq": "15T", "prediction_length": 720, "seasonality": 96, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.525505258771378, "wql": 0.10136274316991528, "wsql_by_level": [0.044960879821685326, 0.07365369312572438, 0.09534593040703065, 0.11150829597624808, 0.12236944961760891, 0.12791602471238733, 0.1272245464872267, 0.11713715388789882, 0.09214871449342744], "n_valid_labels": 138240, "n_masked_labels": 0, "mae_median": 85.60192187346344, "n_mase_elements": 137520, "n_seasonal_error_zero": 1, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9718135129102374, "wql": 0.8832261889065163}}, {"config_id": "electricity__H__short", "leaderboard_key": "electricity/H/short", "dataset": "electricity/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.9339368071829378, "wql": 0.08451570457917906, "wsql_by_level": [0.057753048430970115, 0.08226480428322495, 0.09582090553613322, 0.10229778463115763, 0.10328533576443624, 0.10005686705048246, 0.09174950283440365, 0.07641853333832672, 0.05099455934347652], "n_valid_labels": 9216, "n_masked_labels": 0, "mae_median": 365.78789349765026, "n_mase_elements": 9216, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9021533773762123, "wql": 0.914463408155945}}, {"config_id": "electricity__H__medium", "leaderboard_key": "electricity/H/medium", "dataset": "electricity/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 1, "n_instances": 191, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.006297427269044, "wql": 0.061165138419857774, "wsql_by_level": [0.03361703495649566, 0.05166759434578359, 0.06347512617417748, 0.07096351483682163, 0.0748634270052266, 0.07546739246049308, 0.07202832763351609, 0.0630162031797374, 0.0453876251864683], "n_valid_labels": 91680, "n_masked_labels": 0, "mae_median": 119.91655007300226, "n_mase_elements": 91680, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8386311394110976, "wql": 0.5370471342452036}}, {"config_id": "electricity__H__long", "leaderboard_key": "electricity/H/long", "dataset": "electricity/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.9482095470456032, "wql": 0.05615345836757914, "wsql_by_level": [0.035456049559589815, 0.05064282126602756, 0.060462722237666244, 0.06617908206370164, 0.06854991299709427, 0.06769838405559461, 0.06329345961627485, 0.054382815434690944, 0.038715878077572256], "n_valid_labels": 138240, "n_masked_labels": 0, "mae_median": 124.21419495831209, "n_mase_elements": 137520, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 1}, "relative": {"mase": 0.828125229606739, "wql": 0.3895974292070914}}, {"config_id": "electricity__D__short", "leaderboard_key": "electricity/D/short", "dataset": "electricity/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.0208449978332912, "wql": 0.04236610716126062, "wsql_by_level": [0.022930174804668003, 0.034609920466850554, 0.04320888101367589, 0.05061157488192572, 0.054984504292154554, 0.0550782045903533, 0.05050751702191169, 0.04103818935327935, 0.028325998026526526], "n_valid_labels": 5760, "n_masked_labels": 0, "mae_median": 3155.0729112885065, "n_mase_elements": 5730, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 1}, "relative": {"mase": 0.8879976876707474, "wql": 0.49665715084116496}}, {"config_id": "electricity__W__short", "leaderboard_key": "electricity/W/short", "dataset": "electricity/W", "term": "short", "freq": "W-FRI", "prediction_length": 8, "seasonality": 1, "n_variates": 1, "n_instances": 186, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.4911280475115984, "wql": 0.056031502441841186, "wsql_by_level": [0.03403167157968172, 0.05032646338430331, 0.06381012997265191, 0.07221977643955861, 0.07228943944903228, 0.06428776091367575, 0.05186269586027058, 0.05123353902703701, 0.044222045350359424], "n_valid_labels": 1452, "n_masked_labels": 36, "mae_median": 32724.16763078674, "n_mase_elements": 1440, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 6}, "relative": {"mase": 0.9705294841674605, "wql": 0.8299011498843935}}, {"config_id": "solar__T__short", "leaderboard_key": "solar/10T/short", "dataset": "solar/10T", "term": "short", "freq": "10T", "prediction_length": 48, "seasonality": 144, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.01601852853255743, "wql": 0.4304672828217729, "wsql_by_level": [0.19313393587875957, 0.31669038670192684, 0.4073168348047967, 0.4666404347287517, 0.5035122099136743, 0.528858131399247, 0.5308552246819881, 0.5142831168260029, 0.41291527046080884], "n_valid_labels": 6576, "n_masked_labels": 0, "mae_median": 0.04024039566632442, "n_mase_elements": 6576, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7017727033189929, "wql": 0.02929915989361301}}, {"config_id": "solar__T__medium", "leaderboard_key": "solar/10T/medium", "dataset": "solar/10T", "term": "medium", "freq": "10T", "prediction_length": 480, "seasonality": 144, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.9600420031253558, "wql": 0.3500907238317365, "wsql_by_level": [0.27418397431172375, 0.40510800273791686, 0.45478022132823825, 0.4598562656660608, 0.4349718395633114, 0.3893210354750151, 0.3276210975418393, 0.24943900345006845, 0.1555350744114546], "n_valid_labels": 65760, "n_masked_labels": 0, "mae_median": 1.9883911493226405, "n_mase_elements": 65760, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6998297201573468, "wql": 0.4757784389558314}}, {"config_id": "solar__T__long", "leaderboard_key": "solar/10T/long", "dataset": "solar/10T", "term": "long", "freq": "10T", "prediction_length": 720, "seasonality": 144, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.3710659245706367, "wql": 0.4921561471624368, "wsql_by_level": [0.5921053099511725, 0.6730755278015691, 0.6700792780273112, 0.6272611645515841, 0.5619412380643437, 0.4805118303950251, 0.3848602220207613, 0.2772256579743168, 0.16234509567584657], "n_valid_labels": 98640, "n_masked_labels": 0, "mae_median": 2.8277735929062633, "n_mase_elements": 98640, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8906144584774237, "wql": 0.6661135728385024}}, {"config_id": "solar__H__short", "leaderboard_key": "solar/H/short", "dataset": "solar/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.8215647883066035, "wql": 1.2809713286445232, "wsql_by_level": [1.1562071116288766, 1.6875777465060555, 1.7867397013661925, 1.6948241337233199, 1.5158755806283277, 1.3086838994999097, 1.0709737284645895, 0.807118874193595, 0.5007411817898416], "n_valid_labels": 6576, "n_masked_labels": 0, "mae_median": 23.96474583904483, "n_mase_elements": 6576, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7739858536922466, "wql": 0.6587816242911256}}, {"config_id": "solar__H__medium", "leaderboard_key": "solar/H/medium", "dataset": "solar/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.7577705618447346, "wql": 0.19958721292674253, "wsql_by_level": [0.1185204016846511, 0.179705312059717, 0.2170112984802342, 0.23903490662722385, 0.24939234708792876, 0.24776146142371328, 0.2317259163719266, 0.1942496757572412, 0.1188835968480468], "n_valid_labels": 65760, "n_masked_labels": 0, "mae_median": 10.199804727017876, "n_mase_elements": 65760, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6376097136259046, "wql": 0.2982413140172017}}, {"config_id": "solar__H__long", "leaderboard_key": "solar/H/long", "dataset": "solar/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.7200532477625126, "wql": 0.20559683285571348, "wsql_by_level": [0.18231550942937055, 0.22492229637420466, 0.24380659902260088, 0.24805215853445903, 0.24173553692921843, 0.22780238889473872, 0.2044210061618349, 0.16758868731046145, 0.1097273130445326], "n_valid_labels": 98640, "n_masked_labels": 0, "mae_median": 10.123846055358113, "n_mase_elements": 98640, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8334464887619782, "wql": 0.27455215119878584}}, {"config_id": "solar__D__short", "leaderboard_key": "solar/D/short", "dataset": "solar/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.6828874993941112, "wql": 0.14928606155763943, "wsql_by_level": [0.10293948175520116, 0.15253657328349718, 0.1783256054978091, 0.1895798660138208, 0.19036392291864423, 0.17968131931487913, 0.1554834674117354, 0.1208024580499453, 0.07386185977322247], "n_valid_labels": 4110, "n_masked_labels": 0, "mae_median": 191.33786379960333, "n_mase_elements": 4110, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.0265669616847226, "wql": 0.3903500708379611}}, {"config_id": "solar__W__short", "leaderboard_key": "solar/W/short", "dataset": "solar/W", "term": "short", "freq": "W-FRI", "prediction_length": 8, "seasonality": 1, "n_variates": 1, "n_instances": 137, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.1796782633405722, "wql": 0.13237867192981143, "wsql_by_level": [0.09880627671933405, 0.13614151430116472, 0.15900204650471061, 0.17001123473369792, 0.17033158367737974, 0.16396449717472925, 0.1440218180265793, 0.09904185086789351, 0.050087225362813806], "n_valid_labels": 1096, "n_masked_labels": 0, "mae_median": 1265.9088820854242, "n_mase_elements": 1096, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.1358319139891182, "wql": 0.9296153808012306}}, {"config_id": "hospital__M__short", "leaderboard_key": "hospital/M/short", "dataset": "hospital", "term": "short", "freq": "M", "prediction_length": 12, "seasonality": 12, "n_variates": 1, "n_instances": 192, "domain": "Healthcare", "n_cohorts": 1, "metrics": {"mase": 0.9650611808951928, "wql": 0.06701452164733225, "wsql_by_level": [0.04391370384633518, 0.06437858547937508, 0.07569239050600829, 0.08171296943136121, 0.0819235831312105, 0.07792278242192055, 0.07243126027340525, 0.06182548285151166, 0.043329936884862516], "n_valid_labels": 2304, "n_masked_labels": 0, "mae_median": 26.339854261113537, "n_mase_elements": 2304, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.917184901657952, "wql": 0.958614463965833}}, {"config_id": "covid_deaths__D__short", "leaderboard_key": "covid_deaths/D/short", "dataset": "covid_deaths", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Healthcare", "n_cohorts": 1, "metrics": {"mase": 685.332318203542, "wql": 0.8367400585246769, "wsql_by_level": [0.18347583918359756, 0.3596452067883896, 0.5329096021613966, 0.7026816771446398, 0.8672663728531759, 1.0265614009114306, 1.17488841742336, 1.3028572800560336, 1.3803747302000688], "n_valid_labels": 5760, "n_masked_labels": 0, "mae_median": 214.7057933381154, "n_mase_elements": 2850, "n_seasonal_error_zero": 97, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.0306658614045787, "wql": 1.0057055964429988}}, {"config_id": "us_births__D__short", "leaderboard_key": "us_births/D/short", "dataset": "us_births/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 1, "domain": "Healthcare", "n_cohorts": 1, "metrics": {"mase": 0.5647386579920928, "wql": 0.028919259682802442, "wsql_by_level": [0.02051734202246418, 0.031027893371614705, 0.036048502539453756, 0.03611405511675562, 0.034044943289992816, 0.031894461658740235, 0.029141546710848253, 0.025542773595797708, 0.015941818839554693], "n_valid_labels": 30, "n_masked_labels": 0, "mae_median": 371.05016276041664, "n_mase_elements": 30, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.4820711481881469, "wql": 0.3032253073879135}}, {"config_id": "us_births__M__short", "leaderboard_key": "us_births/M/short", "dataset": "us_births/M", "term": "short", "freq": "M", "prediction_length": 12, "seasonality": 12, "n_variates": 1, "n_instances": 1, "domain": "Healthcare", "n_cohorts": 1, "metrics": {"mase": 0.5085407789942138, "wql": 0.012968075292075526, "wsql_by_level": [0.004303102041051231, 0.0077363949558552384, 0.012788252650658938, 0.015424604209921663, 0.016811657692282395, 0.017535840899075446, 0.016611887089931665, 0.014957049431829392, 0.010543888658073763], "n_valid_labels": 12, "n_masked_labels": 0, "mae_median": 5112.010416666667, "n_mase_elements": 12, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.0212446727042683, "wql": 0.8822890961122436}}, {"config_id": "us_births__W__short", "leaderboard_key": "us_births/W/short", "dataset": "us_births/W", "term": "short", "freq": "W-TUE", "prediction_length": 8, "seasonality": 1, "n_variates": 1, "n_instances": 1, "domain": "Healthcare", "n_cohorts": 1, "metrics": {"mase": 0.4881749759964642, "wql": 0.006742915263625082, "wsql_by_level": [0.006003898814607167, 0.006864239108807159, 0.005948443577625446, 0.0063774292893453745, 0.007463318545270138, 0.0075996400416965286, 0.0072948178242089904, 0.006914686976702416, 0.006219763194362515], "n_valid_labels": 8, "n_masked_labels": 0, "mae_median": 529.814453125, "n_mase_elements": 8, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9212161758313413, "wql": 0.5742444864694869}}, {"config_id": "saugeenday__D__short", "leaderboard_key": "saugeen/D/short", "dataset": "saugeenday/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.2668320637788269, "wql": 0.16900847968998908, "wsql_by_level": [0.07731043710157902, 0.09124374221006319, 0.09234677100494404, 0.11806301745523912, 0.14212591848273898, 0.19090958210984946, 0.23801582344370076, 0.2782598482649291, 0.29280117713685794], "n_valid_labels": 30, "n_masked_labels": 0, "mae_median": 1.1938577175140381, "n_mase_elements": 30, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.185951288877324, "wql": 0.10866533134256415}}, {"config_id": "saugeenday__M__short", "leaderboard_key": "saugeen/M/short", "dataset": "saugeenday/M", "term": "short", "freq": "M", "prediction_length": 12, "seasonality": 12, "n_variates": 1, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.8019083143691277, "wql": 0.3447663630082628, "wsql_by_level": [0.17685088733973128, 0.2665897273923398, 0.3216868529352762, 0.36900570307676295, 0.4005632985087462, 0.403448819158748, 0.41850731516322986, 0.4139981157307005, 0.3322465477688303], "n_valid_labels": 12, "n_masked_labels": 0, "mae_median": 14.064674973487854, "n_mase_elements": 12, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7490568384215482, "wql": 0.7867490607033338}}, {"config_id": "saugeenday__W__short", "leaderboard_key": "saugeen/W/short", "dataset": "saugeenday/W", "term": "short", "freq": "W-THU", "prediction_length": 8, "seasonality": 1, "n_variates": 1, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.4479101428518725, "wql": 0.2716841719150056, "wsql_by_level": [0.1302206753745989, 0.22571368822749546, 0.28360011107221816, 0.3030837154060274, 0.26828749390164414, 0.22140996478166136, 0.29143766285264155, 0.3385625826829112, 0.3828416529358519], "n_valid_labels": 8, "n_masked_labels": 0, "mae_median": 5.392578601837158, "n_mase_elements": 8, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.4029682529677202, "wql": 0.34371576208954147}}, {"config_id": "temperature_rain_with_missing__D__short", "leaderboard_key": "temperature_rain/D/short", "dataset": "temperature_rain_with_missing", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.9418289288006938, "wql": 0.6678012207864849, "wsql_by_level": [0.21678625563079706, 0.4055330389598721, 0.5741468141477218, 0.7166200981909755, 0.8262107881608138, 0.906820720334431, 0.9181700096954959, 0.8415931616676545, 0.6043301002906023], "n_valid_labels": 5760, "n_masked_labels": 0, "mae_median": 5.243044345335806, "n_mase_elements": 5760, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.38143077166730627, "wql": 0.35509874777654266}}, {"config_id": "kdd_cup_2018_with_missing__H__short", "leaderboard_key": "kdd_cup_2018/H/short", "dataset": "kdd_cup_2018_with_missing/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 176, "domain": "Nature", "n_cohorts": 2, "metrics": {"mase": 0.4705943860133582, "wql": 0.4157966504863415, "wsql_by_level": [0.17254159087564677, 0.28887740978273146, 0.38128217839593653, 0.4510005026827958, 0.4982290485585779, 0.5249752291595532, 0.5292355589634328, 0.5068742135827407, 0.3891541223756586], "n_valid_labels": 7981, "n_masked_labels": 467, "mae_median": 10.333274213277207, "n_mase_elements": 7981, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.5189791285857186, "wql": 0.4866925068041162}}, {"config_id": "kdd_cup_2018_with_missing__H__medium", "leaderboard_key": "kdd_cup_2018/H/medium", "dataset": "kdd_cup_2018_with_missing/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 1, "n_instances": 183, "domain": "Nature", "n_cohorts": 2, "metrics": {"mase": 0.8432648563645159, "wql": 0.45561038716194907, "wsql_by_level": [0.19433888141411107, 0.34997383353645295, 0.468540211270749, 0.5514200899126277, 0.5973268195665872, 0.600990390533035, 0.5597073850207196, 0.46791517731668153, 0.3102806958865783], "n_valid_labels": 83859, "n_masked_labels": 3981, "mae_median": 18.662953259113344, "n_mase_elements": 83859, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9205105077950781, "wql": 0.44149985180090867}}, {"config_id": "kdd_cup_2018_with_missing__H__long", "leaderboard_key": "kdd_cup_2018/H/long", "dataset": "kdd_cup_2018_with_missing/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 1, "n_instances": 182, "domain": "Nature", "n_cohorts": 2, "metrics": {"mase": 0.6980256671825639, "wql": 0.4487673088169827, "wsql_by_level": [0.17348640444749572, 0.30772369928549254, 0.41658445328133825, 0.5004838902081757, 0.5589181528747673, 0.5899371073891406, 0.5825362296732435, 0.5240547282709421, 0.3851811139222486], "n_valid_labels": 115026, "n_masked_labels": 16014, "mae_median": 17.113191825177523, "n_mase_elements": 115026, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.854371130522864, "wql": 0.36483190985630665}}, {"config_id": "kdd_cup_2018_with_missing__D__short", "leaderboard_key": "kdd_cup_2018/D/short", "dataset": "kdd_cup_2018_with_missing/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 184, "domain": "Nature", "n_cohorts": 2, "metrics": {"mase": 0.9126124710638742, "wql": 0.41400514179295, "wsql_by_level": [0.20452037508282037, 0.34441885780525205, 0.43628570291190966, 0.4949969396197756, 0.5252641092480357, 0.5255472305126704, 0.49360785896235715, 0.4155642423487188, 0.2858409596450099], "n_valid_labels": 5412, "n_masked_labels": 108, "mae_median": 15.377688205629553, "n_mase_elements": 5412, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8823531141056573, "wql": 0.4698728814533824}}, {"config_id": "restaurant__D__short", "leaderboard_key": "restaurant/D/short", "dataset": "restaurant", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 185, "domain": "Sales", "n_cohorts": 13, "skipped_series": 1, "metrics": {"mase": 0.7829474600874426, "wql": 0.293452765014078, "wsql_by_level": [0.14353622237796626, 0.23801112762248375, 0.3058506358647123, 0.35097433010561774, 0.3749722288517917, 0.3757465455619672, 0.3517836269109516, 0.2969150508493311, 0.20328511698188054], "n_valid_labels": 4965, "n_masked_labels": 585, "mae_median": 8.113220871875413, "n_mase_elements": 4965, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6841832295346499, "wql": 0.4256411108889322}}, {"config_id": "hierarchical_sales__D__short", "leaderboard_key": "hierarchical_sales/D/short", "dataset": "hierarchical_sales/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 118, "domain": "Sales", "n_cohorts": 1, "metrics": {"mase": 0.9165945404575011, "wql": 0.6230634195715564, "wsql_by_level": [0.19257177817151197, 0.3603045874468261, 0.5095166508624822, 0.6359077151337503, 0.7379809904740019, 0.8123449553136631, 0.8455490288160323, 0.8254601801752675, 0.6879348897504717], "n_valid_labels": 3540, "n_masked_labels": 0, "mae_median": 3.427442221577137, "n_mase_elements": 3540, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8600305398926182, "wql": 0.4809167937236858}}, {"config_id": "hierarchical_sales__W__short", "leaderboard_key": "hierarchical_sales/W/short", "dataset": "hierarchical_sales/W", "term": "short", "freq": "W-WED", "prediction_length": 8, "seasonality": 1, "n_variates": 1, "n_instances": 118, "domain": "Sales", "n_cohorts": 1, "metrics": {"mase": 0.8220106273494577, "wql": 0.40495970254413577, "wsql_by_level": [0.15586326408034157, 0.2598813650234217, 0.3419402614463747, 0.41102547931667366, 0.4673878267784049, 0.5103664274969811, 0.536013719436909, 0.523902537839536, 0.43825644147857956], "n_valid_labels": 944, "n_masked_labels": 0, "mae_median": 12.497673224089509, "n_mase_elements": 944, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7306805360613744, "wql": 0.5309299395404431}}, {"config_id": "LOOP_SEATTLE__T__short", "leaderboard_key": "loop_seattle/5T/short", "dataset": "LOOP_SEATTLE/5T", "term": "short", "freq": "5T", "prediction_length": 48, "seasonality": 288, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.5349187112936977, "wql": 0.04573537190151744, "wsql_by_level": [0.03428067708385898, 0.050560965715162325, 0.05771704611606272, 0.05919957489943087, 0.05683773267977635, 0.05163142966080383, 0.044323800741619825, 0.034772381380048074, 0.022294738836893993], "n_valid_labels": 9216, "n_masked_labels": 0, "mae_median": 3.5091780909957984, "n_mase_elements": 9216, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.5702956121105398, "wql": 0.5609616785436202}}, {"config_id": "LOOP_SEATTLE__T__medium", "leaderboard_key": "loop_seattle/5T/medium", "dataset": "LOOP_SEATTLE/5T", "term": "medium", "freq": "5T", "prediction_length": 480, "seasonality": 288, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.9100552906137017, "wql": 0.08722277834839087, "wsql_by_level": [0.07171478445747766, 0.09605247952509383, 0.10698190437053635, 0.10981982512303494, 0.10684941078441199, 0.09858129647547335, 0.0856824335264002, 0.067393864987149, 0.04192900588594062], "n_valid_labels": 92160, "n_masked_labels": 0, "mae_median": 5.628008592525859, "n_mase_elements": 92160, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.49074362490102813, "wql": 0.4686240915854403}}, {"config_id": "LOOP_SEATTLE__T__long", "leaderboard_key": "loop_seattle/5T/long", "dataset": "LOOP_SEATTLE/5T", "term": "long", "freq": "5T", "prediction_length": 720, "seasonality": 288, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.6500794945211592, "wql": 0.05655358138192314, "wsql_by_level": [0.04690253043030119, 0.06130389392980508, 0.06795076629385957, 0.07000752172425144, 0.06880546053447704, 0.06415634750682926, 0.05641048814910025, 0.04487950019025415, 0.028565723678430247], "n_valid_labels": 138240, "n_masked_labels": 0, "mae_median": 4.0464437110547875, "n_mase_elements": 138240, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.4918715457546411, "wql": 0.43868824252633043}}, {"config_id": "LOOP_SEATTLE__H__short", "leaderboard_key": "loop_seattle/H/short", "dataset": "LOOP_SEATTLE/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.9335724414415559, "wql": 0.06235202029034882, "wsql_by_level": [0.05540359400420743, 0.07429583746227142, 0.08062058737963897, 0.08004392991866151, 0.07490475079481466, 0.06699605380792523, 0.056826319133918245, 0.04419908553122781, 0.02787802458047405], "n_valid_labels": 9216, "n_masked_labels": 0, "mae_median": 4.250828761348708, "n_mase_elements": 9216, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.5940801903714601, "wql": 0.5336932904315588}}, {"config_id": "LOOP_SEATTLE__H__medium", "leaderboard_key": "loop_seattle/H/medium", "dataset": "LOOP_SEATTLE/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.696462120275957, "wql": 0.04875368636697769, "wsql_by_level": [0.04009743154774071, 0.050917997788528395, 0.05587980728692514, 0.057644577700848146, 0.05725514473093831, 0.054916759478981995, 0.05029918120513576, 0.042454197067577235, 0.029318080496123507], "n_valid_labels": 92160, "n_masked_labels": 0, "mae_median": 3.235563015043994, "n_mase_elements": 92160, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.513109309628044, "wql": 0.30897393470128104}}, {"config_id": "LOOP_SEATTLE__H__long", "leaderboard_key": "loop_seattle/H/long", "dataset": "LOOP_SEATTLE/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.659594595128472, "wql": 0.04652156907223157, "wsql_by_level": [0.03696938958324002, 0.04797240355180647, 0.05319179969074284, 0.055207529140060496, 0.05503048579964364, 0.052904051043625965, 0.048350700326860584, 0.04088944544614024, 0.028178317067963872], "n_valid_labels": 138240, "n_masked_labels": 0, "mae_median": 3.107244679397748, "n_mase_elements": 138240, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.3637817074585924, "wql": 0.2405754932931896}}, {"config_id": "LOOP_SEATTLE__D__short", "leaderboard_key": "loop_seattle/D/short", "dataset": "LOOP_SEATTLE/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 192, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.5699060118700859, "wql": 0.025853525061792275, "wsql_by_level": [0.01605180072598903, 0.024115159749420762, 0.028956438289505317, 0.031647710856624406, 0.032403588501368104, 0.03138535687511882, 0.028663864561458544, 0.02380367119086307, 0.015654134805782413], "n_valid_labels": 5760, "n_masked_labels": 0, "mae_median": 1.8398868117067548, "n_mase_elements": 5760, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.2419606925978111, "wql": 0.22503868921418613}}, {"config_id": "SZ_TAXI__T__short", "leaderboard_key": "sz_taxi/15T/short", "dataset": "SZ_TAXI/15T", "term": "short", "freq": "15T", "prediction_length": 48, "seasonality": 96, "n_variates": 1, "n_instances": 156, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.44001407608885196, "wql": 0.17317839503205723, "wsql_by_level": [0.0918683183386289, 0.1482533375713214, 0.18532258633115162, 0.20822598576712967, 0.21829957538935266, 0.2166084884429117, 0.20147087443913778, 0.17033557402975635, 0.11822081497912507], "n_valid_labels": 7488, "n_masked_labels": 0, "mae_median": 2.4306645335226107, "n_mase_elements": 7488, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.732549022492019, "wql": 0.6274538572147967}}, {"config_id": "SZ_TAXI__T__medium", "leaderboard_key": "sz_taxi/15T/medium", "dataset": "SZ_TAXI/15T", "term": "medium", "freq": "15T", "prediction_length": 480, "seasonality": 96, "n_variates": 1, "n_instances": 156, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.7848120300942381, "wql": 0.22272686892869617, "wsql_by_level": [0.11035496118260098, 0.180175244707686, 0.23094012357907617, 0.2651585906375767, 0.2831106844186403, 0.28394505145066806, 0.266920182701546, 0.22754385162106588, 0.1563931300594054], "n_valid_labels": 74880, "n_masked_labels": 0, "mae_median": 5.410191487493221, "n_mase_elements": 74880, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7767024784125712, "wql": 0.6707301058681476}}, {"config_id": "SZ_TAXI__H__short", "leaderboard_key": "sz_taxi/H/short", "dataset": "SZ_TAXI/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 156, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.49185003433263047, "wql": 0.15369062752044496, "wsql_by_level": [0.07554497150479685, 0.11681149879243229, 0.14493173672624501, 0.1658950321787611, 0.18193956179753445, 0.19115575853432623, 0.19085004343161233, 0.17944422336264146, 0.13664282135565506], "n_valid_labels": 7488, "n_masked_labels": 0, "mae_median": 1.9981748695999213, "n_mase_elements": 7488, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9040617541728057, "wql": 0.6892342353634504}}, {"config_id": "M_DENSE__H__short", "leaderboard_key": "m_dense/H/short", "dataset": "M_DENSE/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 1, "n_instances": 30, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.6788798307801768, "wql": 0.1072155029554015, "wsql_by_level": [0.06304705255997374, 0.09368898346820752, 0.11444276296324982, 0.1289585313492226, 0.13608976457337305, 0.13424200850645152, 0.12228386403700417, 0.1012077377524911, 0.07097882138863988], "n_valid_labels": 1440, "n_masked_labels": 0, "mae_median": 88.09738378094302, "n_mase_elements": 1440, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.89325809773895, "wql": 0.7557497116993788}}, {"config_id": "M_DENSE__H__medium", "leaderboard_key": "m_dense/H/medium", "dataset": "M_DENSE/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 1, "n_instances": 30, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.761243171153656, "wql": 0.2377963135549466, "wsql_by_level": [0.20532608577138486, 0.25786811480515437, 0.28003101675574993, 0.2845439400276828, 0.2775444865629882, 0.2610872560941965, 0.23549050353901294, 0.1977578488489696, 0.14051756958938003], "n_valid_labels": 14400, "n_masked_labels": 0, "mae_median": 138.13142140063974, "n_mase_elements": 14400, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.4805327452766241, "wql": 0.5151776256680263}}, {"config_id": "M_DENSE__H__long", "leaderboard_key": "m_dense/H/long", "dataset": "M_DENSE/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 1, "n_instances": 30, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.559679298547275, "wql": 0.10569530934174286, "wsql_by_level": [0.07337071834538977, 0.09934257262428997, 0.11506212103078202, 0.12339593305735484, 0.12586162253554598, 0.12358171780611381, 0.11619305307280318, 0.10140128698145694, 0.07304875862194925], "n_valid_labels": 21600, "n_masked_labels": 0, "mae_median": 73.45239408764574, "n_mase_elements": 21600, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.4852246411753012, "wql": 0.2689333495030699}}, {"config_id": "M_DENSE__D__short", "leaderboard_key": "m_dense/D/short", "dataset": "M_DENSE/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 1, "n_instances": 30, "domain": "Transport", "n_cohorts": 1, "metrics": {"mase": 0.5483876750056417, "wql": 0.07647292066749443, "wsql_by_level": [0.05341867331397267, 0.07508299173830851, 0.08669133459613743, 0.09177776441175675, 0.09310897920042048, 0.08912780847684652, 0.08109498905096064, 0.06919910619556133, 0.048754639023485605], "n_valid_labels": 900, "n_masked_labels": 0, "mae_median": 54.33806819703844, "n_mase_elements": 900, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.47465494664322866, "wql": 0.3740681934091836}}, {"config_id": "ett1__T__short", "leaderboard_key": "ett1/15T/short", "dataset": "ett1/15T", "term": "short", "freq": "15T", "prediction_length": 48, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.5526814562793871, "wql": 0.29843604841613736, "wsql_by_level": [0.20691749029848022, 0.3069824132012207, 0.357625133393576, 0.3775163445388652, 0.3864057890888009, 0.3789150718302819, 0.32953131404329067, 0.2347051960096339, 0.10732568334108707], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 1.0350132066800835, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.48914610225278815, "wql": 0.39342343830265486}}, {"config_id": "ett1__T__medium", "leaderboard_key": "ett1/15T/medium", "dataset": "ett1/15T", "term": "medium", "freq": "15T", "prediction_length": 480, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.2021965798071157, "wql": 0.35301164437566457, "wsql_by_level": [0.23663649787628022, 0.3728780016518156, 0.43339213234098417, 0.45640821246289887, 0.4508935997697171, 0.419267217684821, 0.36198980732512154, 0.27861382561154885, 0.16702550465779376], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 1.947610077766599, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.1364297732354351, "wql": 0.9018485537621849}}, {"config_id": "ett1__T__long", "leaderboard_key": "ett1/15T/long", "dataset": "ett1/15T", "term": "long", "freq": "15T", "prediction_length": 720, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.1857530774319667, "wql": 0.31836691457830624, "wsql_by_level": [0.2393167362106497, 0.3583668770377532, 0.40730622420542884, 0.41757846236023904, 0.399440931321071, 0.36232735301280705, 0.3067155772153581, 0.23213043201230665, 0.1421196378291424], "n_valid_labels": 5040, "n_masked_labels": 0, "mae_median": 2.062943595556158, "n_mase_elements": 5040, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.115106494776113, "wql": 0.969971104698872}}, {"config_id": "ett1__H__short", "leaderboard_key": "ett1/H/short", "dataset": "ett1/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.3969756521681276, "wql": 0.547784226092488, "wsql_by_level": [0.6309129480562058, 0.7233234785017986, 0.7433296932207936, 0.7065080183734245, 0.6364317338965346, 0.5444938305093084, 0.4403698371575645, 0.3235647200822271, 0.18112377503453564], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 10.292127795694839, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9576505831494143, "wql": 0.924903696699536}}, {"config_id": "ett1__H__medium", "leaderboard_key": "ett1/H/medium", "dataset": "ett1/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.9120439870082669, "wql": 0.2328172728406775, "wsql_by_level": [0.13561523592604321, 0.20531428280037428, 0.2505461697224516, 0.27710169647176924, 0.289364013879569, 0.28808988739470315, 0.2689686693046782, 0.22664269787575075, 0.1537128021907578], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 5.362109633286794, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7318752185840395, "wql": 0.5139836535208311}}, {"config_id": "ett1__H__long", "leaderboard_key": "ett1/H/long", "dataset": "ett1/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.0149191095031243, "wql": 0.2724525708011962, "wsql_by_level": [0.16996791715962825, 0.25857478100850056, 0.3156856238919604, 0.3463162087036214, 0.34956017842903375, 0.33023875242508477, 0.2935743938200357, 0.2359814346550274, 0.15217384711787413], "n_valid_labels": 5040, "n_masked_labels": 0, "mae_median": 6.260802358313508, "n_mase_elements": 5040, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8027460243261768, "wql": 0.5060308656392628}}, {"config_id": "ett1__D__short", "leaderboard_key": "ett1/D/short", "dataset": "ett1/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.1976404475081437, "wql": 0.25459974539317337, "wsql_by_level": [0.15601203150078552, 0.24108454771575316, 0.29721257336355317, 0.32311188528679957, 0.3288063230801001, 0.31718133145661476, 0.2788511142584925, 0.21770195081747268, 0.13143595105898845], "n_valid_labels": 210, "n_masked_labels": 0, "mae_median": 112.48274988446917, "n_mase_elements": 210, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8735438407394557, "wql": 0.5764250532376664}}, {"config_id": "ett1__W__short", "leaderboard_key": "ett1/W/short", "dataset": "ett1/W", "term": "short", "freq": "W-THU", "prediction_length": 8, "seasonality": 1, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.9975674282776272, "wql": 0.29824257931804005, "wsql_by_level": [0.1421766677834141, 0.26933999775539097, 0.3287667008214046, 0.3642887035098973, 0.3734986910331037, 0.3727228887739497, 0.3484712079034589, 0.28946701960934296, 0.19545133667239808], "n_valid_labels": 56, "n_masked_labels": 0, "mae_median": 1271.3011454854693, "n_mase_elements": 56, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9138432945570321, "wql": 1.0557308321464913}}, {"config_id": "ett2__T__short", "leaderboard_key": "ett2/15T/short", "dataset": "ett2/15T", "term": "short", "freq": "15T", "prediction_length": 48, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.5397899386368822, "wql": 0.058414618020196554, "wsql_by_level": [0.033940518844315495, 0.050988146793909644, 0.059417056843117176, 0.06893266721551414, 0.07304518847229997, 0.07157788018495834, 0.0671871254391825, 0.05919982410359633, 0.04144315428487537], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 1.0615838755454337, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.5071014012257135, "wql": 0.5060448348253209}}, {"config_id": "ett2__T__medium", "leaderboard_key": "ett2/15T/medium", "dataset": "ett2/15T", "term": "medium", "freq": "15T", "prediction_length": 480, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.8614065796982358, "wql": 0.20608910780717146, "wsql_by_level": [0.07968990759342594, 0.12333733319957815, 0.17902671796276284, 0.2375942891299248, 0.27822085980789407, 0.2923347476194478, 0.2797793254261682, 0.23510443483955226, 0.14971435468578914], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 3.8472014122874714, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8494888979663114, "wql": 0.6707721158442258}}, {"config_id": "ett2__T__long", "leaderboard_key": "ett2/15T/long", "dataset": "ett2/15T", "term": "long", "freq": "15T", "prediction_length": 720, "seasonality": 96, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.2344364244301387, "wql": 0.1440127861556565, "wsql_by_level": [0.11286240292772985, 0.15229720755890813, 0.17398000040622816, 0.18363012653296734, 0.18296628246632324, 0.16984708897381534, 0.14557005803744172, 0.11045491756558166, 0.06450699093191302], "n_valid_labels": 5040, "n_masked_labels": 0, "mae_median": 2.648470590596082, "n_mase_elements": 5040, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9005424683558261, "wql": 0.7864686274825242}}, {"config_id": "ett2__H__short", "leaderboard_key": "ett2/H/short", "dataset": "ett2/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.8617553955177528, "wql": 0.11761517254785575, "wsql_by_level": [0.06989247654540615, 0.10329216587550691, 0.12715020024876683, 0.14049864936366663, 0.14562135012330293, 0.1415270148464149, 0.13260051521626717, 0.11614534082138937, 0.08180883988998097], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 8.441254699514026, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.6943250986762217, "wql": 0.6957294118589596}}, {"config_id": "ett2__H__medium", "leaderboard_key": "ett2/H/medium", "dataset": "ett2/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.2847900281433562, "wql": 0.1476510065866977, "wsql_by_level": [0.10910900890512192, 0.15529118459641364, 0.1819653640586392, 0.1913806168208345, 0.1858115279411601, 0.1710364968619861, 0.14881233298825255, 0.11580681341690481, 0.0696457136909665], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 11.451942405441619, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 1.0022553016535802, "wql": 0.64824365036072}}, {"config_id": "ett2__H__long", "leaderboard_key": "ett2/H/long", "dataset": "ett2/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 0.8979591627120591, "wql": 0.10928966783870943, "wsql_by_level": [0.07601515889840231, 0.11175223903784692, 0.13147008165804627, 0.1382616531113939, 0.1340717527308429, 0.12559414048009354, 0.1119791473601466, 0.09135724648200182, 0.06310559078961053], "n_valid_labels": 5040, "n_masked_labels": 0, "mae_median": 8.216585392958997, "n_mase_elements": 5040, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9100354689715255, "wql": 0.44309698768119626}}, {"config_id": "ett2__D__short", "leaderboard_key": "ett2/D/short", "dataset": "ett2/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.022710476565899, "wql": 0.08571220836430982, "wsql_by_level": [0.06961399704427605, 0.09282097047628182, 0.101026802533916, 0.09767543120760304, 0.09061522495494707, 0.08568563819259305, 0.08402818907453616, 0.08253035381401871, 0.06741326798061655], "n_valid_labels": 210, "n_masked_labels": 0, "mae_median": 133.17818326609475, "n_mase_elements": 210, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9712828802468455, "wql": 0.5033638182193978}}, {"config_id": "ett2__W__short", "leaderboard_key": "ett2/W/short", "dataset": "ett2/W", "term": "short", "freq": "W-THU", "prediction_length": 8, "seasonality": 1, "n_variates": 7, "n_instances": 1, "domain": "Energy", "n_cohorts": 1, "metrics": {"mase": 1.4876685668409757, "wql": 0.11951459050115701, "wsql_by_level": [0.051666036971811755, 0.0689555716174706, 0.10047224327312931, 0.13767464749914238, 0.15745899330415508, 0.16632721002079978, 0.15866770002712827, 0.1374571839017068, 0.09695172789506916], "n_valid_labels": 56, "n_masked_labels": 0, "mae_median": 2210.6731781278336, "n_mase_elements": 56, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8226945465478942, "wql": 0.7581105816648592}}, {"config_id": "jena_weather__T__short", "leaderboard_key": "jena_weather/10T/short", "dataset": "jena_weather/10T", "term": "short", "freq": "10T", "prediction_length": 48, "seasonality": 144, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.17283917280642122, "wql": 0.011274075976301126, "wsql_by_level": [0.004190315907400383, 0.008358343309081931, 0.01212666500777335, 0.014242825750575457, 0.015028476895567503, 0.014806443430653023, 0.014161790799763702, 0.011685523897972644, 0.006866298787922164], "n_valid_labels": 1008, "n_masked_labels": 0, "mae_median": 2.3502964941370816, "n_mase_elements": 1008, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.33981830359096293, "wql": 0.08197060799265798}}, {"config_id": "jena_weather__T__medium", "leaderboard_key": "jena_weather/10T/medium", "dataset": "jena_weather/10T", "term": "medium", "freq": "10T", "prediction_length": 480, "seasonality": 144, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.9359756012619731, "wql": 0.06251301260081452, "wsql_by_level": [0.04030677468480963, 0.05710356400441254, 0.06595931213499077, 0.07091396741116544, 0.07228599892715848, 0.07163377429598924, 0.06801967892693718, 0.06419218737018752, 0.05220185565167988], "n_valid_labels": 10080, "n_masked_labels": 0, "mae_median": 12.437287454637477, "n_mase_elements": 10080, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.891443941337575, "wql": 0.301860017340692}}, {"config_id": "jena_weather__T__long", "leaderboard_key": "jena_weather/10T/long", "dataset": "jena_weather/10T", "term": "long", "freq": "10T", "prediction_length": 720, "seasonality": 144, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.9317266387722616, "wql": 0.14882085566681172, "wsql_by_level": [0.06784464623768538, 0.11331229099730114, 0.14445958315725885, 0.1656997865515866, 0.17842666197213566, 0.18220283521081568, 0.18093277352149875, 0.1703187884639328, 0.1361903348890907], "n_valid_labels": 15120, "n_masked_labels": 0, "mae_median": 30.86520005103876, "n_mase_elements": 15120, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8838609587201758, "wql": 0.5038400918455571}}, {"config_id": "jena_weather__H__short", "leaderboard_key": "jena_weather/H/short", "dataset": "jena_weather/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 0.6107823588570258, "wql": 0.07669683228192102, "wsql_by_level": [0.04666547322770843, 0.07339487497444658, 0.08650145971410184, 0.08990786506049749, 0.08958417753912905, 0.0869146391932048, 0.0816856024567423, 0.07325550107593726, 0.06236189729552142], "n_valid_labels": 1008, "n_masked_labels": 0, "mae_median": 15.185915632592884, "n_mase_elements": 1008, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8137232307811588, "wql": 0.4378086066199777}}, {"config_id": "jena_weather__H__medium", "leaderboard_key": "jena_weather/H/medium", "dataset": "jena_weather/H", "term": "medium", "freq": "H", "prediction_length": 480, "seasonality": 24, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 1.1913123647234558, "wql": 0.11209131866002037, "wsql_by_level": [0.06604408496557185, 0.1065844128505221, 0.13075097992069085, 0.14098647359860592, 0.14015487506524252, 0.1334371384086362, 0.12044367424201248, 0.0997580674535337, 0.07066216143536748], "n_valid_labels": 10080, "n_masked_labels": 0, "mae_median": 27.629648347108834, "n_mase_elements": 10080, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7852571106345393, "wql": 0.31847760283253534}}, {"config_id": "jena_weather__H__long", "leaderboard_key": "jena_weather/H/long", "dataset": "jena_weather/H", "term": "long", "freq": "H", "prediction_length": 720, "seasonality": 24, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 1.1582470478607643, "wql": 0.10991399672500349, "wsql_by_level": [0.07211148557111993, 0.10751573996782803, 0.12784974811795977, 0.13673691650509825, 0.13633691733660547, 0.1296792694492055, 0.11675839960038996, 0.09643154149308036, 0.06580595248374412], "n_valid_labels": 15120, "n_masked_labels": 0, "mae_median": 29.32110430865546, "n_mase_elements": 15120, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9783182793839802, "wql": 0.2978120885271558}}, {"config_id": "jena_weather__D__short", "leaderboard_key": "jena_weather/D/short", "dataset": "jena_weather/D", "term": "short", "freq": "D", "prediction_length": 30, "seasonality": 1, "n_variates": 21, "n_instances": 1, "domain": "Nature", "n_cohorts": 1, "metrics": {"mase": 1.169232124719657, "wql": 0.08263878579567557, "wsql_by_level": [0.05035811391017428, 0.07745369201187415, 0.093523806890676, 0.10119608368204751, 0.10393133512837573, 0.09946228434855345, 0.09043205971875563, 0.07484276620877442, 0.052548930261848786], "n_valid_labels": 630, "n_masked_labels": 0, "mae_median": 22.120076842580474, "n_mase_elements": 630, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8993452976498786, "wql": 0.4235376735067755}}, {"config_id": "bitbrains_fast_storage__T__short", "leaderboard_key": "bitbrains_fast_storage/5T/short", "dataset": "bitbrains_fast_storage/5T", "term": "short", "freq": "5T", "prediction_length": 48, "seasonality": 288, "n_variates": 2, "n_instances": 189, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.5775079655580716, "wql": 0.2003865645400581, "wsql_by_level": [0.057581083723544625, 0.0881114449259535, 0.122510531686695, 0.16534422109678518, 0.210537010260304, 0.27209070169916355, 0.3052127538046056, 0.3120231595396627, 0.2700681741238087], "n_valid_labels": 18144, "n_masked_labels": 0, "mae_median": 84.10285570596922, "n_mase_elements": 17472, "n_seasonal_error_zero": 12, "n_seasonal_error_nan": 2}, "relative": {"mase": 0.6263304129352975, "wql": 0.11344683650428948}}, {"config_id": "bitbrains_fast_storage__T__medium", "leaderboard_key": "bitbrains_fast_storage/5T/medium", "dataset": "bitbrains_fast_storage/5T", "term": "medium", "freq": "5T", "prediction_length": 480, "seasonality": 288, "n_variates": 2, "n_instances": 182, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.6901348857829284, "wql": 0.3690107213720071, "wsql_by_level": [0.2394821605659565, 0.3765867192719276, 0.4373699012404232, 0.4672045371031635, 0.4625693322492428, 0.445653120013799, 0.39670337398190186, 0.3086371862982958, 0.18689016162335328], "n_valid_labels": 174720, "n_masked_labels": 0, "mae_median": 333.437771724836, "n_mase_elements": 173760, "n_seasonal_error_zero": 2, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7580440319692938, "wql": 0.6636975592817896}}, {"config_id": "bitbrains_fast_storage__T__long", "leaderboard_key": "bitbrains_fast_storage/5T/long", "dataset": "bitbrains_fast_storage/5T", "term": "long", "freq": "5T", "prediction_length": 720, "seasonality": 288, "n_variates": 2, "n_instances": 182, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.9868312775335087, "wql": 0.5691717412593821, "wsql_by_level": [0.1828466210858052, 0.34869782511028885, 0.49381012858918694, 0.6222312402659418, 0.7322196443407388, 0.8100066639410942, 0.8320495756195957, 0.7273056661836043, 0.3733783061981832], "n_valid_labels": 259510, "n_masked_labels": 2570, "mae_median": 647.4131234153801, "n_mase_elements": 248816, "n_seasonal_error_zero": 14, "n_seasonal_error_nan": 4}, "relative": {"mase": 0.8593137135599643, "wql": 1.0890087001299449}}, {"config_id": "bitbrains_fast_storage__H__short", "leaderboard_key": "bitbrains_fast_storage/H/short", "dataset": "bitbrains_fast_storage/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 2, "n_instances": 188, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.9121125488117836, "wql": 0.3020528598958529, "wsql_by_level": [0.17952938021818973, 0.2925645070444723, 0.36247531793442833, 0.38969727421325245, 0.3817279180563985, 0.35904048291781365, 0.32029901406979105, 0.2636516852898642, 0.16949015931846617], "n_valid_labels": 18046, "n_masked_labels": 2, "mae_median": 297.34607857405393, "n_mase_elements": 17376, "n_seasonal_error_zero": 12, "n_seasonal_error_nan": 2}, "relative": {"mase": 0.7808303490333722, "wql": 0.6130798320221182}}, {"config_id": "bitbrains_rnd__T__short", "leaderboard_key": "bitbrains_rnd/5T/short", "dataset": "bitbrains_rnd/5T", "term": "short", "freq": "5T", "prediction_length": 48, "seasonality": 288, "n_variates": 2, "n_instances": 186, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.6116898085802783, "wql": 0.42191622608687807, "wsql_by_level": [0.15741022590636347, 0.2806321699485745, 0.37907485985623507, 0.45605955153627137, 0.5084182259368423, 0.5347493952683592, 0.533884997613639, 0.5094612702121236, 0.43755533850349426], "n_valid_labels": 17852, "n_masked_labels": 4, "mae_median": 77.61263406785552, "n_mase_elements": 17372, "n_seasonal_error_zero": 10, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7106670928425681, "wql": 0.3310458527503943}}, {"config_id": "bitbrains_rnd__T__medium", "leaderboard_key": "bitbrains_rnd/5T/medium", "dataset": "bitbrains_rnd/5T", "term": "medium", "freq": "5T", "prediction_length": 480, "seasonality": 288, "n_variates": 2, "n_instances": 186, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 2.5272951374448316, "wql": 0.4741736014365157, "wsql_by_level": [0.159968494166483, 0.2923112225822017, 0.40287267674048294, 0.4945387763965621, 0.5653422778782251, 0.6185353688016403, 0.6447388529399369, 0.6288295104417871, 0.4604252329813219], "n_valid_labels": 178546, "n_masked_labels": 14, "mae_median": 233.5457129488998, "n_mase_elements": 177586, "n_seasonal_error_zero": 2, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9330031433613323, "wql": 0.6121586408927034}}, {"config_id": "bitbrains_rnd__T__long", "leaderboard_key": "bitbrains_rnd/5T/long", "dataset": "bitbrains_rnd/5T", "term": "long", "freq": "5T", "prediction_length": 720, "seasonality": 288, "n_variates": 2, "n_instances": 181, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 1.1053764003353481, "wql": 0.6697040550925483, "wsql_by_level": [0.18371166619539286, 0.37607132655599246, 0.5599576240982479, 0.6861712982110791, 0.7812030446717791, 0.8598786819806716, 0.9094358238031027, 0.9090658558450779, 0.7618411744715904], "n_valid_labels": 135432, "n_masked_labels": 125208, "mae_median": 152.67101505556622, "n_mase_elements": 125728, "n_seasonal_error_zero": 4, "n_seasonal_error_nan": 22}, "relative": {"mase": 0.7757110898961324, "wql": 0.2951096369992216}}, {"config_id": "bitbrains_rnd__H__short", "leaderboard_key": "bitbrains_rnd/H/short", "dataset": "bitbrains_rnd/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 2, "n_instances": 180, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 3.0096275310538014, "wql": 0.7518463657852327, "wsql_by_level": [0.38281130738336255, 0.6003541475766203, 0.7589626924917248, 0.8618057853404499, 0.9208951307196822, 0.9411039272231803, 0.9095647235282212, 0.8086026286770345, 0.5825169491268176], "n_valid_labels": 17280, "n_masked_labels": 0, "mae_median": 286.53255175107023, "n_mase_elements": 16320, "n_seasonal_error_zero": 6, "n_seasonal_error_nan": 14}, "relative": {"mase": 0.7775211881304942, "wql": 0.7617587014570445}}, {"config_id": "bizitobs_application__S__short", "leaderboard_key": "bizitobs_application/10S/short", "dataset": "bizitobs_application", "term": "short", "freq": "10S", "prediction_length": 60, "seasonality": 360, "n_variates": 2, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.7318707225660919, "wql": 0.011281935885806905, "wsql_by_level": [0.008002952977089394, 0.012216445889839864, 0.014686335829542527, 0.015516230895705337, 0.015197434804566525, 0.013521153057479978, 0.01107071802032153, 0.007616451470211374, 0.0037097000275056217], "n_valid_labels": 120, "n_masked_labels": 0, "mae_median": 273.68488483428956, "n_mase_elements": 120, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8909428002602146, "wql": 0.7847250474451015}}, {"config_id": "bizitobs_application__S__medium", "leaderboard_key": "bizitobs_application/10S/medium", "dataset": "bizitobs_application", "term": "medium", "freq": "10S", "prediction_length": 600, "seasonality": 360, "n_variates": 2, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.6319621067448185, "wql": 0.010551142170748325, "wsql_by_level": [0.008911790600579, 0.011083299612751915, 0.011366365425819949, 0.01110912057453741, 0.011002333712473809, 0.01097793218961999, 0.011199751093972607, 0.0109601698426615, 0.008349516484318753], "n_valid_labels": 1200, "n_masked_labels": 0, "mae_median": 263.9901331138611, "n_mase_elements": 1200, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7743391009935632, "wql": 0.7965834991628736}}, {"config_id": "bizitobs_application__S__long", "leaderboard_key": "bizitobs_application/10S/long", "dataset": "bizitobs_application", "term": "long", "freq": "10S", "prediction_length": 900, "seasonality": 360, "n_variates": 2, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.5720653459306403, "wql": 0.012138446231322628, "wsql_by_level": [0.008623859466472211, 0.009611433300550209, 0.009459482680717134, 0.01004388243342679, 0.012582167540513662, 0.015076849738837201, 0.01661950834678241, 0.0158053799855722, 0.011423452589031817], "n_valid_labels": 1800, "n_masked_labels": 0, "mae_median": 299.4340139155918, "n_mase_elements": 1800, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.9567305254553605, "wql": 0.8227330180228468}}, {"config_id": "bizitobs_service__S__short", "leaderboard_key": "bizitobs_service/10S/short", "dataset": "bizitobs_service", "term": "short", "freq": "10S", "prediction_length": 60, "seasonality": 360, "n_variates": 2, "n_instances": 21, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.7324628601848132, "wql": 0.012468266168907526, "wsql_by_level": [0.008215030129070992, 0.012485755828051727, 0.014889145286160158, 0.016000871359545917, 0.016105768183720788, 0.015278630292856189, 0.013275651753476963, 0.010118624988524415, 0.005844917698760588], "n_valid_labels": 2520, "n_masked_labels": 0, "mae_median": 16.491911796350326, "n_mase_elements": 2520, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.7696556880179742, "wql": 0.503318066478902}}, {"config_id": "bizitobs_service__S__medium", "leaderboard_key": "bizitobs_service/10S/medium", "dataset": "bizitobs_service", "term": "medium", "freq": "10S", "prediction_length": 600, "seasonality": 360, "n_variates": 2, "n_instances": 21, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.7984312321992689, "wql": 0.011001039924959608, "wsql_by_level": [0.007518777611379767, 0.010577598061715378, 0.012318945521906922, 0.013262129629493939, 0.013534719675842093, 0.013194749673509063, 0.01211883979469059, 0.01007703901860633, 0.006406560337492398], "n_valid_labels": 25200, "n_masked_labels": 0, "mae_median": 17.09932730270047, "n_mase_elements": 25200, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8673632301139702, "wql": 0.45992525896546305}}, {"config_id": "bizitobs_service__S__long", "leaderboard_key": "bizitobs_service/10S/long", "dataset": "bizitobs_service", "term": "long", "freq": "10S", "prediction_length": 900, "seasonality": 360, "n_variates": 2, "n_instances": 21, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.646613369495283, "wql": 0.010402683917260002, "wsql_by_level": [0.0062267995817844955, 0.008538692518941748, 0.010108725971076577, 0.011376764214893436, 0.012436127694055487, 0.013155873427271378, 0.012787249144287667, 0.011013426596545082, 0.007980496106484125], "n_valid_labels": 37800, "n_masked_labels": 0, "mae_median": 15.606604814255048, "n_mase_elements": 37800, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8002403081371326, "wql": 0.3728878713837755}}, {"config_id": "bizitobs_l2c__T__short", "leaderboard_key": "bizitobs_l2c/5T/short", "dataset": "bizitobs_l2c/5T", "term": "short", "freq": "5T", "prediction_length": 48, "seasonality": 288, "n_variates": 7, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.28996107175004043, "wql": 0.08935709313411225, "wsql_by_level": [0.03476836707761851, 0.05700713165647231, 0.0733345462727266, 0.08690633538697647, 0.10064485729347158, 0.11181830219704957, 0.11767262198806329, 0.11786800047570861, 0.10419367585892322], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 2.548459583804721, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.3641853237606104, "wql": 0.4278913576057856}}, {"config_id": "bizitobs_l2c__T__medium", "leaderboard_key": "bizitobs_l2c/5T/medium", "dataset": "bizitobs_l2c/5T", "term": "medium", "freq": "5T", "prediction_length": 480, "seasonality": 288, "n_variates": 7, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.4321503031836867, "wql": 0.18432258806548052, "wsql_by_level": [0.09018466538428084, 0.14253605337405711, 0.18038778677145245, 0.20804248017819088, 0.22944895995378836, 0.2356383014527587, 0.22753973179059417, 0.19975734445073456, 0.1453679692334674], "n_valid_labels": 3360, "n_masked_labels": 0, "mae_median": 4.786018498880523, "n_mase_elements": 3360, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.8225710682193722, "wql": 0.7122892501188703}}, {"config_id": "bizitobs_l2c__T__long", "leaderboard_key": "bizitobs_l2c/5T/long", "dataset": "bizitobs_l2c/5T", "term": "long", "freq": "5T", "prediction_length": 720, "seasonality": 288, "n_variates": 7, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.699228756292291, "wql": 0.34073021038707835, "wsql_by_level": [0.1277722036256575, 0.22579297019476952, 0.31174281595824704, 0.37821302407612, 0.4231092894326387, 0.45462519155466463, 0.4514393600779259, 0.4146039750481884, 0.27927306351549336], "n_valid_labels": 5040, "n_masked_labels": 0, "mae_median": 6.934133305663746, "n_mase_elements": 5040, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.4479447069213554, "wql": 0.4461418940946688}}, {"config_id": "bizitobs_l2c__H__short", "leaderboard_key": "bizitobs_l2c/H/short", "dataset": "bizitobs_l2c/H", "term": "short", "freq": "H", "prediction_length": 48, "seasonality": 24, "n_variates": 7, "n_instances": 1, "domain": "Web/CloudOps", "n_cohorts": 1, "metrics": {"mase": 0.47224914020222897, "wql": 0.182787381279163, "wsql_by_level": [0.1240704270771492, 0.20018397060257917, 0.2164037952932672, 0.22330980998235528, 0.21512922606792495, 0.20148822613798775, 0.18792831045147373, 0.1614166682162592, 0.11515599768347046], "n_valid_labels": 336, "n_masked_labels": 0, "mae_median": 4.900850257703236, "n_mase_elements": 336, "n_seasonal_error_zero": 0, "n_seasonal_error_nan": 0}, "relative": {"mase": 0.3716596580112479, "wql": 0.47618212083808953}}], "cpu_seconds": 1.03408993803896, "members": ["/workspace/research/backcast3_evals/weekly_slow_ar_delta3k", "/workspace/research/backcast3_evals/patch8_ema6000", "/workspace/research/backcast3_evals/split_patch_ema12000"], "member_checkpoint_hashes": ["094c7c694406075967f392a0d9ac1146bac984a90ab468c59d660a1b92fa7ba2", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "weights": [0.3333333333333333, 0.3333333333333333, 0.3333333333333333], "selection_only": true, "cutoff": "valid_backcast3", "E102skill": 0.38962589808404846, "difference": -6.989045150118667e-05} +Main+0.000560751 and firstearlier+0.000432658; secondearlier-0.000137495 and thirdearlier-0.000069890. Mixed cutoff evidence, positive average diagnostic gain; select this one fixed candidate for full public replay and relocation/composition checks. No coefficient sweep. Publish only if fullscore exceeds E102 and all replay checks pass; do not claim held-out significance. +E107 audits passed before launch. CPU seed503:1.633014seconds; independent float64 NumPy feature reference, per-cycle-offset invariance, sampler byte identity, inherited parameters and CPU forward outputs bitwise preserved. Added49,184zero-initialized parameters,total36,849,984. Initialcheckpoint SHA470ef98d69d00b17defbf41c70a92b22574154cdb6e0317993bccf113e4af93b. GPU seed509: initial BF16 outputs bitwise identical; maxB64/C4096/H1024 paired objective0.314552695 and finite gradients; new query/head gradient norms0.00467448/0.01857908,headbias0.00118291. Peakreserved6290MiB/allocated5785.632MiB including EMA and Adam placeholders. Check wall45.549493seconds includes waiting on global evaluation lock;0optimizerupdates/no validationread. Model embeds its helper function directly, so generic standalone/ensemble publishers need no extra runtime module. Queued after E105queue12006; unchanged control stream and full-model optimizer. + +## E108 complete eligible-series corpus packing — resource preparation, no model training +Hypothesis for later data scaling: repeated training on the first approximately1B or5.35B packed points may limit fresh larger models even with fixed source balancing. Prepare every allowed series of length>=16 whose deterministic crop has a finite observation, using the already audited stratified_corpus/pack.py with a nonbinding1e12per-directory pointcap. Preserve the exact shuffled global series order, min length16, maximum deterministic crop131072, row-specific frequency, and95allowlisted directories. This extends packed_stratified_large as an exact prefix; it does not imply retaining every observation of series longer than131072. Use2CPUworkers, no GPU/model optimization. Audit every directory's exact binary/record prefix against the5.35Bpoint pack, independent Arrow replays, and bitwise original source probabilities before any training. No data downloads, no validation reads. Any fresh-model training recipe will be declared separately after current E94/E101 evidence. + +## Training exposure diagnostic for fresh capacity +Allowed-corpus/local-generator audit seed521,20480windows,3.303616CPU seconds,0optimizerupdates/no validationread. Meanfinite context1599.5786,target444.9583,total2044.537points per sampled row. Thus fresh96k/B48 presents approximately9.421Bfinite observations over4.608Mrows before sign duplication, including resampled/overlapping windows and synthetic values. Published E102ancestry contains22.848Msampled rows when taking each unique trained-run maximum; this includes subtracted-control branches and is compute invested, not an equivalent single-model trajectory. Complete per-run audit training_exposure_audit.json. Fresh146M currently has substantially less training exposure than the mature lineage; early capacity comparisons should not be interpreted as a scaling limit. Full eligible-series pack E108 is preparation for later longer training; no new training recipe selected by this audit alone. + +## E104 weekly matched-delta ensemble full public replay +- Checkpoint SHA-256: `1669bc65e42eaf879ed99fab670b8c12a950c4245c341a6f0bd8354c8494a2b8`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.381736; relative MASE 0.738984; relative WQL 0.517264. +- term skill: long=0.4005, medium=0.4074, short=0.3642. +- domain skill: Econ/Fin=0.1238, Energy=0.2398, Healthcare=0.4894, Nature=0.4421, Sales=0.3581, Transport=0.4683, Web/CloudOps=0.4962. +- frequency skill: A=0.2968, D=0.3688, H=0.3955, M=0.1458, Q=0.1868, S=0.4250, T=0.4377, W=0.2400. +- variates skill: multivariate=0.3951, univariate=0.3709. +- Outcome: Fixed equal1/3 ensemble E104weekly correction/E71patch8_6000/E93splitpatch_12000. Full skill0.381736117455058 exceeds E102full0.38116304998662165 by0.00057306746843635. RelativeMASE0.7389844981008465 and WQL0.517264204380349 both improve;97configurations/151170instances/0failures,inference358.357500shared-H100 seconds. Two of four diagnostic cutoffs improve and two slightly decline; fullscore supports selecting this candidate after independent component/composition checks. No held-out reward or significance claim. + +E105 nested corpus volume seed197 training started at 2026-10-23T05:42:47Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E99 early cooldown final36000 +- Checkpoint SHA-256: `b985ce73ed119243ef51e5f0579bc43633419ce375eb7ce2fad7d1a1103acb51`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.4186589717865 seconds. +- Overall skill 0.363307; relative MASE 0.758030; relative WQL 0.534779. +- term skill: long=0.3893, medium=0.3898, short=0.3425. +- domain skill: Econ/Fin=0.1268, Energy=0.2221, Healthcare=0.4006, Nature=0.4132, Sales=0.3453, Transport=0.4557, Web/CloudOps=0.4925. +- frequency skill: A=0.3909, D=0.3370, H=0.3814, M=0.1134, Q=0.1976, S=0.4152, T=0.4195, W=0.2100. +- variates skill: multivariate=0.3805, univariate=0.3493. +- Outcome: Final0.363306598 trails original E79at36000 0.364859034 by0.001552437. The30k gain did not persist. Declared cooldown branch complete; no schedule replacement and no standalone publication. Exact24000state restored, same seed307/B48; only learning-rate schedule differs. + +## E79 fresh146M original schedule at24000 +- Checkpoint SHA-256: `e03ce08a9c1c357bce9d0aca3871c8817627cc660d16706cd85fddba9b5fe5eb`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 34.343666791915894 seconds. +- Overall skill 0.354494; relative MASE 0.763098; relative WQL 0.546035. +- term skill: long=0.3782, medium=0.3903, short=0.3308. +- domain skill: Econ/Fin=0.1204, Energy=0.2113, Healthcare=0.3859, Nature=0.4116, Sales=0.3203, Transport=0.4432, Web/CloudOps=0.4876. +- frequency skill: A=0.3886, D=0.3283, H=0.3717, M=0.0151, Q=0.1916, S=0.4207, T=0.4085, W=0.2469. +- variates skill: multivariate=0.3720, univariate=0.3402. +- Outcome: Skill0.354493848 improves on16000 0.349499286 but trails matched37M24000 0.357901602. Continue declared schedule; await halfLR at matched checkpoints. All own random initialization, seed307/B48/LR2e-4. + +E104 final replay suite passed in438.071371wall seconds including lock waits. Relocated examples bitwise identical,finite/ordered,31.678684seconds. Public inference358.357500seconds. Independently replayed changed first member and orderedfloat32 component average match allthree complete actual configurations exactly; receipts weekly_slow_ar_composition_replay.json and weekly_slow_ensemble_composition_checks.json. Descriptor1669bc65e42eaf879ed99fab670b8c12a950c4245c341a6f0bd8354c8494a2b8,110,068,216parameters. Selected for atomic publication over E102. Descriptive comparison: {"improved_configs": 42, "dataset_cluster_delta_percentiles": {"p025": -0.00031799803137674555, "p50": 0.0005000199376024583, "p975": 0.002059979380489236}, "bootstrap_seed": 317, "bootstrap_samples": 5000}. No held-out significance claim; two earlier diagnostic cutoffs have small regressions. E101teacher stays frozen E96. + +E99cooldown24k-to36k branch completed in1603.635706shared-H100 training-loop seconds; final rejected as recorded. E95all-shard24Mcap run completed12000 in2657.504791loop seconds; final evaluation pending while E105nested-volume starts in its allocation. + +## E109 duration of the matched weekly-synthetic correction — predeclared +E104's fixed3000-step correction improves the full replay but has two small earlier-cutoff regressions. At6000, E97weekly skill0.380715730 exceeds its matched E80control0.378288765 by0.002426965. Test the next already scheduled checkpoint duration with exactly the same coefficient1 formula E83 + E97weeklyEMA6000 - E80overflowEMA6000, then the same equal1/3 ensemble with E71patch8_6000 and E93splitpatch_12000. No coefficient search, optimizer updates or change to any inference rule. Evaluate all four diagnostic cutoffs before choosing a full replay; compare directly to currently published E104. This is validation checkpoint selection along the declared training run, not independent replication. All weights and synthetic generators were trained/generated here on allowed data. + +E106 spectral synthetic residuals seed197 training started at 2026-10-23T05:45:28Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E95 all-shard fixed-volume final12000 +- Checkpoint SHA-256: `453c1e5c5ff189f961d2b4001e9e299c72e26f86d3c4afe5b5a6a46fe5acaafe`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.615615367889404 seconds. +- Overall skill 0.377983; relative MASE 0.744078; relative WQL 0.519979. +- term skill: long=0.4039, medium=0.4059, short=0.3566. +- domain skill: Econ/Fin=0.1366, Energy=0.2370, Healthcare=0.4437, Nature=0.4338, Sales=0.3305, Transport=0.4678, Web/CloudOps=0.5031. +- frequency skill: A=0.3715, D=0.3556, H=0.3975, M=0.0998, Q=0.1933, S=0.4243, T=0.4390, W=0.2113. +- variates skill: multivariate=0.3973, univariate=0.3622. +- Outcome: Final0.377983250 recovers from weak3k/6k and exceeds matched E80final0.377423946 by0.000559304, while remaining below the old-corpus best3000checkpoint0.378663825. Training2657.504791loop seconds, seed197/B64/LR2e-5. Earlier matched-final cutoffs queued to test whether the late gain persists. E105nested-volume training now active. + +## E79 fresh37M original schedule at48000 +- Checkpoint SHA-256: `855f37f248e8104578ae2b356d2b7326a73236476f888fd1468e988be4238509`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.904500484466553 seconds. +- Overall skill 0.366773; relative MASE 0.755679; relative WQL 0.530618. +- term skill: long=0.3907, medium=0.3907, short=0.3479. +- domain skill: Econ/Fin=0.1392, Energy=0.2294, Healthcare=0.4025, Nature=0.4162, Sales=0.3289, Transport=0.4575, Web/CloudOps=0.4950. +- frequency skill: A=0.3873, D=0.3499, H=0.3856, M=0.0362, Q=0.2082, S=0.4181, T=0.4257, W=0.2180. +- variates skill: multivariate=0.3836, univariate=0.3530. +- Outcome: Skill0.366772722 improves over36000 0.364859034. Original96k schedule continues after E99cooldown failed its final comparison. Seed307/B48/LR2e-4, own random initialization and slow-AR generator; no publication yet. + +## E105 output-path collision incident and correction +At05:46UTC the E105watcher reported the exact E95checkpoint hash, revealing a launcher path error: packed_stratified_large training and its watcher both pointed to completed runs/stratified_corpus instead of runs/stratified_volume. This was an implementation error, not a model result. All four mislabeled E105cached evaluations were quarantined under incidents/stratified_volume_output_collision and are invalid for selection. The new trainer was stopped; its complete model/EMA/Adam/allRNG/prefetched-batch state at1000 was saved immutably as stratified_volume_recovery001000.pt SHA f153b05103d51042525b0ba765dc0a826241791ea7611baba8cfd07a54b5bca8. Its actual1000EMA SHA dd2b7db79f33a230724fe26a33e07793547329639046e32e4a380cc8b1a23485 and raw checkpoint were moved into the corrected directory. Resume from1000 preserves the intended training trajectory apart from normal numerical restart effects; unsaved later work is discarded and counted as incident compute. Original E95EMA/raw1000 and final optimizer recovery were overwritten and are no longer replayable; original E95EMA/raw2000..12000 including all selected later checkpoints remain intact. FinalE95EMA SHA453c1e5c5ff189f961d2b4001e9e299c72e26f86d3c4afe5b5a6a46fe5acaafe was verified unchanged. E95is complete and must not be resumed. Published E104and its assets were untouched; no E105result was published. Corrected E105launcher uses runs/stratified_volume and explicit immutable resume, watcher rescoring actual1000. E107queue was stopped while waiting and will be requeued against the new E105launcherPID. A process-start guard now rejects any fresh trainer output containing EMA/raw/recovery checkpoints unless --resume is explicit; CPU fixture verifies refusal before GPU initialization and preserves the existing marker. Incident logs/receipt/checkpoints retained. + +E105 nested corpus volume seed197 training started at 2026-10-23T05:47:49Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E101 own-ensemble distillation fresh146M training started at 2026-10-23T05:50:23Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E105 incident first-phase last measured record: {"step": 1000, "loss": 0.2910519391298294, "seconds": 202.5, "lr": 1.9727406610312548e-05, "grad_norm": 0.13067036867141724, "context": 4096, "horizon": 512}. Corrected trainer13473 restored1000 exactly from immutable rescue and is progressing in runs/stratified_volume. E107requeued against corrected queue13470. New watch_evaluate.py verifies every cached/result checkpoint SHA and optionally the expected packed corpus; CPU behavioral fixture rejects wrong corpus/hash and accepts matching cached reports in3.652652seconds with no evaluator/GPU/optimizer execution (watch_evaluation_guard_checks.json). The completed sourceE95run now has no recovery.pt, preventing accidental use of the overwritten optimizer state. + +## E94 fresh146M half learning rate at16000 +- Checkpoint SHA-256: `19f9ead156ea9bc4a3edca1303bc5595057b2e1b89ff88e7bb7d9acf39618ba5`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 33.574928522109985 seconds. +- Overall skill 0.354616; relative MASE 0.765691; relative WQL 0.543981. +- term skill: long=0.3807, medium=0.3858, short=0.3318. +- domain skill: Econ/Fin=0.1226, Energy=0.2154, Healthcare=0.3836, Nature=0.4162, Sales=0.3402, Transport=0.4491, Web/CloudOps=0.4736. +- frequency skill: A=0.3784, D=0.3518, H=0.3719, M=0.0534, Q=0.1915, S=0.4189, T=0.4000, W=0.2223. +- variates skill: multivariate=0.3672, univariate=0.3444. +- Outcome: Skill0.354615664 exceeds highLR146Mat16000 0.349499286 by0.005116378, nearly matches highLRat24000 0.354493848, and trails matched37M16000 0.355318072 by0.000702409. Consistent rate advantage across4/8/16k supports LR1e-4 for a later fresh146Mdata comparison. Continue96k schedule. + +## E108 complete corpus pack audited +Complete pack contains62,399,537,510points and7,652,636series from all95allowed directories. Packer550.026052wall seconds with2CPUworkers; independent audit80.076772seconds; preparation total631.880773seconds. Exact binary and record prefix against packed_stratified_large in all95directories,260independent Arrow series replays with row-specific frequencies/crops, source probabilities bitwise equal to packed_sample. Receipts stratified_full_prepare_receipt.json and stratified_full_audit.json. No optimizer updates or validation reads. Runtime publication never depends on this training pack. + +## E110 fresh146M full eligible-series data comparison — predeclared +Hypothesis: greater allowed-series diversity improves a fresh larger model beyond the narrow original pack. E94halfLR beats E79wide at matched4k/8k/16k, so use E94's exact recipe and own random initial checkpoint SHA c9693619ca6277c26fef3b2bde37ff6796bec97b3af9f94588bbc5ddd329ec90. Same d1024/heads16/enc6/dec4/patch16/context4096/horizon1024,146,477,344parameters, seed307/B48/LR1e-4/96000steps/400warmup, paired loss,20%slow-AR synthetic, horizon RNG300310, static compilation, Adam/EMA settings. Change only packed_sample to audited packed_stratified_full; retain original source probabilities via source-weights-from packed_sample. This is a joint coverage+volume comparison against E94, not an isolation of either factor, and differing series lengths change subsequent sampling trajectories despite the same seed. No teacher or newly tested synthetic generator in this arm. Queue after E106spectral run in its released allocation; max-shape memory is covered by the unchanged E79/E94 architecture check at10,696MiB reserved. Screen4/8/16/24/48/72/96k; longer continuation decisions remain open for later evidence. Expected-output and corpus/hash guards apply. No external/pretrained assets. + +## E98 original postloss completion final12000 +- Checkpoint SHA-256: `b4b36749b469b0a5024747e6407351cc77fbfc0e77cd1776eabdc07318299f4c`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 24.10327959060669 seconds. +- Overall skill 0.376034; relative MASE 0.745577; relative WQL 0.522191. +- term skill: long=0.4024, medium=0.4041, short=0.3544. +- domain skill: Econ/Fin=0.1158, Energy=0.2406, Healthcare=0.4413, Nature=0.4287, Sales=0.3336, Transport=0.4650, Web/CloudOps=0.5007. +- frequency skill: A=0.3675, D=0.3453, H=0.3958, M=0.0708, Q=0.1957, S=0.4234, T=0.4412, W=0.2183. +- variates skill: multivariate=0.3933, univariate=0.3620. +- Outcome: Final0.376034254 is below originalE75at3000 0.378813891 and matchedE80final0.377423946. Completion3654..12000 cost1995.386513training-loop seconds, plus original799.915049seconds. Reject late completion; selected postloss contribution stays at3000. Full-state branch restored optimizer/EMA/allRNG without reset. + +## E105 corrected actual larger-volume first1000 +- Checkpoint SHA-256: `dd2b7db79f33a230724fe26a33e07793547329639046e32e4a380cc8b1a23485`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 24.012547969818115 seconds. +- Overall skill 0.377047; relative MASE 0.745081; relative WQL 0.520844. +- term skill: long=0.3978, medium=0.4060, short=0.3574. +- domain skill: Econ/Fin=0.1346, Energy=0.2367, Healthcare=0.4623, Nature=0.4324, Sales=0.3353, Transport=0.4653, Web/CloudOps=0.4978. +- frequency skill: A=0.3704, D=0.3548, H=0.3960, M=0.1135, Q=0.1955, S=0.4239, T=0.4334, W=0.2282. +- variates skill: multivariate=0.3927, univariate=0.3643. +- Outcome: Actual packed_stratified_large checkpoint SHA dd2b7db79f33a230724fe26a33e07793547329639046e32e4a380cc8b1a23485; skill0.377046610 nearly ties E95smallpack1000 0.377028371. Earlier mislabeled cached E105results were quarantined and are invalid. This correctly rescored checkpoint was moved from the incident directory and retains its original metadata/hash; continued training now uses a separate output. + +## E106 spectral synthetic residuals first1000 +- Checkpoint SHA-256: `6d81b602d598a452ab114d27433d713831611e69925cf81857839a083d14925c`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 22.007343530654907 seconds. +- Overall skill 0.377778; relative MASE 0.743525; relative WQL 0.520710. +- term skill: long=0.3998, medium=0.4063, short=0.3578. +- domain skill: Econ/Fin=0.1359, Energy=0.2365, Healthcare=0.4618, Nature=0.4329, Sales=0.3341, Transport=0.4674, Web/CloudOps=0.4992. +- frequency skill: A=0.3667, D=0.3581, H=0.3950, M=0.1087, Q=0.1987, S=0.4227, T=0.4366, W=0.2240. +- variates skill: multivariate=0.3935, univariate=0.3650. +- Outcome: Skill0.377777744 exceeds matched E80at1000 0.376804394 by0.000973350. Only half of locally generated residuals changed, original real/non-replaced streams preserved. Seed197/B64/LR2e-5, continue declared3000/6000/12000 before selection. + +## E109 fixed6000correction ensemble four-cutoff result +{"skill_score": 0.38571041915894055, "rel_mase_gmean": 0.7360297117883622, "rel_wql_gmean": 0.5126854026218823, "groups": {"term": {"short": 0.3684054892093498, "medium": 0.40861792906707406, "long": 0.40669389489538343}, "domain": {"Econ/Fin": 0.14352283454252435, "Energy": 0.24673599474557084, "Healthcare": 0.4852425866482829, "Nature": 0.44163298463938605, "Sales": 0.34379367871415345, "Transport": 0.46820747636240867, "Web/CloudOps": 0.5046932217026704}, "freq": {"A-DEC": 0.3760321167863795, "Q-DEC": 0.19766380569346853, "M": 0.12098833477007476, "W-SUN": 0.10769661791141583, "D": 0.3645387551794308, "H": 0.40107642673673183, "15T": 0.21690311587788813, "W-FRI": 0.015770663763870485, "10T": 0.6272364379377529, "W-TUE": 0.6408660517579567, "W-THU": 0.20503433411830196, "W-WED": 0.32981773944316883, "5T": 0.5197675944998887, "10S": 0.4252552385586551}}, "cpu_seconds": 1.219195496989414, "member_checkpoint_hashes": ["c8adf9cadf97dac5e120d8d4d2c8c025bffa2e8b55d8664bf900cce55d00a70b", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cutoff": "valid_screen", "E104skill": 0.3854686334562757, "difference": 0.0002417857026648651} +{"skill_score": 0.34038453448144423, "rel_mase_gmean": 0.7936376163611775, "rel_wql_gmean": 0.5482257309654212, "groups": {"term": {"short": 0.30705150791287494, "medium": 0.36037259523502396, "long": 0.40216620546988446}, "domain": {"Econ/Fin": 0.17253359368549226, "Energy": 0.23204288671949924, "Healthcare": 0.4136249395275713, "Nature": 0.3730211654221537, "Sales": 0.40518403019805194, "Transport": 0.3736095722850602, "Web/CloudOps": 0.45146748825459326}, "freq": {"A-DEC": 0.32644250202504, "Q-DEC": 0.23690729834334368, "M": 0.19096290262857263, "W-SUN": 0.05220186917057601, "D": 0.35265301620275713, "H": 0.3717913194271458, "15T": 0.22264807081310156, "W-FRI": 0.2309648955865844, "10T": 0.3251814465668018, "W-TUE": 0.5629848975400014, "W-THU": 0.2613953386383071, "W-WED": 0.3604296268765198, "5T": 0.44169178473335347, "10S": 0.3476495261147444}}, "cpu_seconds": 1.4167720968835056, "member_checkpoint_hashes": ["c8adf9cadf97dac5e120d8d4d2c8c025bffa2e8b55d8664bf900cce55d00a70b", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cutoff": "valid_backcast", "E104skill": 0.34022701617855455, "difference": 0.00015751830288968094} +{"skill_score": 0.3650268512866791, "rel_mase_gmean": 0.7650984666186498, "rel_wql_gmean": 0.5269790976955032, "groups": {"term": {"short": 0.35239958764222634, "medium": 0.3931690597943601, "long": 0.3687369083593992}, "domain": {"Econ/Fin": 0.12213255276326718, "Energy": 0.24166462607625983, "Healthcare": 0.3517132635055068, "Nature": 0.47875836217412926, "Sales": 0.5562721649607756, "Transport": 0.42517847470928805, "Web/CloudOps": 0.43741099158446717}, "freq": {"A-DEC": 0.33656065874085495, "Q-DEC": 0.15684832945264293, "M": 0.16665053208003056, "W-SUN": 0.07150895572001315, "D": 0.43035508666570155, "H": 0.39490487280100917, "15T": 0.10882809267173599, "W-FRI": 0.15456262907954288, "10T": 0.5092255418082989, "W-TUE": 0.08691901966493587, "W-THU": 0.35389841775428443, "W-WED": 0.5635809755138526, "5T": 0.4725753025882409, "10S": 0.2851839750626278}}, "cpu_seconds": 1.239942419109866, "member_checkpoint_hashes": ["c8adf9cadf97dac5e120d8d4d2c8c025bffa2e8b55d8664bf900cce55d00a70b", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cutoff": "valid_backcast2", "E104skill": 0.36494952219954613, "difference": 7.732908713298237e-05} +{"skill_score": 0.38931035191213115, "rel_mase_gmean": 0.7402180023142099, "rel_wql_gmean": 0.5038270416495189, "groups": {"term": {"short": 0.3946100958444625, "medium": 0.3680969397604268, "long": 0.39609503944824875}, "domain": {"Econ/Fin": 0.18617468677704974, "Energy": 0.31652315087317884, "Healthcare": 0.24343015434307236, "Nature": 0.5047900396770414, "Sales": 0.4000084000969678, "Transport": 0.5092713174572736, "Web/CloudOps": 0.3939880442254168}, "freq": {"A-DEC": 0.3575108227176348, "Q-DEC": 0.2547450248116794, "M": 0.148792543537967, "W-SUN": 0.17031337870235352, "D": 0.4392381685936584, "H": 0.40578214745866226, "15T": 0.2545743158438908, "W-FRI": 0.03969737538520679, "10T": 0.6065987129573612, "W-TUE": 0.2789739520044787, "W-THU": 0.3351510988039397, "W-WED": 0.3774145654877956, "5T": 0.46539939355428894, "10S": 0.2923169693971158}}, "cpu_seconds": 1.0821592810098082, "member_checkpoint_hashes": ["c8adf9cadf97dac5e120d8d4d2c8c025bffa2e8b55d8664bf900cce55d00a70b", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cutoff": "valid_backcast3", "E104skill": 0.3895560076325473, "difference": -0.00024565572041612693} +Three diagnostic gains and one decline: main+0.000241786,first+0.000157518,second+0.000077329,third-0.000245656. Small positive average; select this one fixed checkpoint-duration candidate for full public replay. No coefficient sweep or new optimizer updates. Merge2.075168CPU seconds, standalone SHA c8adf9cadf97dac5e120d8d4d2c8c025bffa2e8b55d8664bf900cce55d00a70b. + +## E109 weekly6000 matched-delta standalone valid_screen +- Checkpoint SHA-256: `c8adf9cadf97dac5e120d8d4d2c8c025bffa2e8b55d8664bf900cce55d00a70b`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.40149998664856 seconds. +- Overall skill 0.382470; relative MASE 0.738351; relative WQL 0.516480. +- term skill: long=0.4043, medium=0.4074, short=0.3640. +- domain skill: Econ/Fin=0.1333, Energy=0.2409, Healthcare=0.4856, Nature=0.4375, Sales=0.3381, Transport=0.4644, Web/CloudOps=0.5062. +- frequency skill: A=0.3761, D=0.3559, H=0.4008, M=0.1140, Q=0.2001, S=0.4253, T=0.4418, W=0.2372. +- variates skill: multivariate=0.3982, univariate=0.3696. +- Outcome: Fixed E83+E97weekly6000-E80overflow6000, coefficient1; no optimizer updates. Ensemble comparison is the selection criterion; third-earlier standalone performance declines. + +## E109 weekly6000 matched-delta standalone valid_backcast +- Checkpoint SHA-256: `c8adf9cadf97dac5e120d8d4d2c8c025bffa2e8b55d8664bf900cce55d00a70b`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 21.963260173797607 seconds. +- Overall skill 0.336472; relative MASE 0.796772; relative WQL 0.552567. +- term skill: long=0.3951, medium=0.3601, short=0.3030. +- domain skill: Econ/Fin=0.1606, Energy=0.2286, Healthcare=0.4001, Nature=0.3703, Sales=0.3955, Transport=0.3719, Web/CloudOps=0.4498. +- frequency skill: A=0.3210, D=0.3470, H=0.3693, M=0.1803, Q=0.2309, S=0.3394, T=0.3343, W=0.2926. +- variates skill: multivariate=0.3535, univariate=0.3226. +- Outcome: Fixed E83+E97weekly6000-E80overflow6000, coefficient1; no optimizer updates. Ensemble comparison is the selection criterion; third-earlier standalone performance declines. + +## E109 weekly6000 matched-delta standalone valid_backcast2 +- Checkpoint SHA-256: `c8adf9cadf97dac5e120d8d4d2c8c025bffa2e8b55d8664bf900cce55d00a70b`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 22.833601474761963 seconds. +- Overall skill 0.359364; relative MASE 0.770770; relative WQL 0.532473. +- term skill: long=0.3665, medium=0.3870, short=0.3457. +- domain skill: Econ/Fin=0.1191, Energy=0.2389, Healthcare=0.3074, Nature=0.4743, Sales=0.5518, Transport=0.4204, Web/CloudOps=0.4347. +- frequency skill: A=0.3504, D=0.4213, H=0.3925, M=0.1454, Q=0.1508, S=0.2803, T=0.3644, W=0.2553. +- variates skill: multivariate=0.3658, univariate=0.3541. +- Outcome: Fixed E83+E97weekly6000-E80overflow6000, coefficient1; no optimizer updates. Ensemble comparison is the selection criterion; third-earlier standalone performance declines. + +## E109 weekly6000 matched-delta standalone valid_backcast3 +- Checkpoint SHA-256: `c8adf9cadf97dac5e120d8d4d2c8c025bffa2e8b55d8664bf900cce55d00a70b`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 21.22951889038086 seconds. +- Overall skill 0.387648; relative MASE 0.742514; relative WQL 0.505006. +- term skill: long=0.3931, medium=0.3619, short=0.3950. +- domain skill: Econ/Fin=0.1745, Energy=0.3225, Healthcare=0.2373, Nature=0.4950, Sales=0.4012, Transport=0.5086, Web/CloudOps=0.3906. +- frequency skill: A=0.3606, D=0.4357, H=0.4053, M=0.1367, Q=0.2600, S=0.2740, T=0.4318, W=0.2506. +- variates skill: multivariate=0.3723, univariate=0.3995. +- Outcome: Fixed E83+E97weekly6000-E80overflow6000, coefficient1; no optimizer updates. Ensemble comparison is the selection criterion; third-earlier standalone performance declines. + +## E95 all-shard final earlier cutoff1 +- Checkpoint SHA-256: `453c1e5c5ff189f961d2b4001e9e299c72e26f86d3c4afe5b5a6a46fe5acaafe`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 22.185170888900757 seconds. +- Overall skill 0.337351; relative MASE 0.796681; relative WQL 0.551166. +- term skill: long=0.3975, medium=0.3600, short=0.3037. +- domain skill: Econ/Fin=0.1590, Energy=0.2333, Healthcare=0.4170, Nature=0.3635, Sales=0.3931, Transport=0.3751, Web/CloudOps=0.4471. +- frequency skill: A=0.3146, D=0.3506, H=0.3671, M=0.1813, Q=0.2349, S=0.3420, T=0.3372, W=0.2919. +- variates skill: multivariate=0.3535, univariate=0.3242. +- Outcome: Matched seed197/B64/LR2e-5 final12000 comparison. E95gains main/first/third earlier but loses0.001849350at second earlier; average four-cutoff gain is essentially zero. Do not select a standalone or transferred coverage correction; E105volume and E110freshfull data comparisons remain separate experiments. + +## E80 matched original-corpus final earlier cutoff1 +- Checkpoint SHA-256: `f11d056b95f1c5eeef174265ebc51742952600e0dae1fa52900860447d5be819`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 22.276308298110962 seconds. +- Overall skill 0.336528; relative MASE 0.797567; relative WQL 0.551922. +- term skill: long=0.3974, medium=0.3587, short=0.3027. +- domain skill: Econ/Fin=0.1549, Energy=0.2300, Healthcare=0.4194, Nature=0.3635, Sales=0.3947, Transport=0.3732, Web/CloudOps=0.4488. +- frequency skill: A=0.3168, D=0.3524, H=0.3669, M=0.1806, Q=0.2286, S=0.3418, T=0.3360, W=0.2847. +- variates skill: multivariate=0.3529, univariate=0.3232. +- Outcome: Matched seed197/B64/LR2e-5 final12000 comparison. E95gains main/first/third earlier but loses0.001849350at second earlier; average four-cutoff gain is essentially zero. Do not select a standalone or transferred coverage correction; E105volume and E110freshfull data comparisons remain separate experiments. + +## E95 all-shard final earlier cutoff2 +- Checkpoint SHA-256: `453c1e5c5ff189f961d2b4001e9e299c72e26f86d3c4afe5b5a6a46fe5acaafe`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 22.514131546020508 seconds. +- Overall skill 0.359124; relative MASE 0.770269; relative WQL 0.533219. +- term skill: long=0.3649, medium=0.3876, short=0.3456. +- domain skill: Econ/Fin=0.1057, Energy=0.2383, Healthcare=0.3457, Nature=0.4701, Sales=0.5518, Transport=0.4215, Web/CloudOps=0.4312. +- frequency skill: A=0.3487, D=0.4241, H=0.3889, M=0.1590, Q=0.1439, S=0.2824, T=0.3606, W=0.2711. +- variates skill: multivariate=0.3622, univariate=0.3566. +- Outcome: Matched seed197/B64/LR2e-5 final12000 comparison. E95gains main/first/third earlier but loses0.001849350at second earlier; average four-cutoff gain is essentially zero. Do not select a standalone or transferred coverage correction; E105volume and E110freshfull data comparisons remain separate experiments. + +## E80 matched original-corpus final earlier cutoff2 +- Checkpoint SHA-256: `f11d056b95f1c5eeef174265ebc51742952600e0dae1fa52900860447d5be819`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 22.563663959503174 seconds. +- Overall skill 0.360973; relative MASE 0.768847; relative WQL 0.531126. +- term skill: long=0.3646, medium=0.3902, short=0.3479. +- domain skill: Econ/Fin=0.1009, Energy=0.2385, Healthcare=0.3613, Nature=0.4749, Sales=0.5481, Transport=0.4204, Web/CloudOps=0.4340. +- frequency skill: A=0.3509, D=0.4270, H=0.3905, M=0.1611, Q=0.1432, S=0.2801, T=0.3626, W=0.2745. +- variates skill: multivariate=0.3648, univariate=0.3579. +- Outcome: Matched seed197/B64/LR2e-5 final12000 comparison. E95gains main/first/third earlier but loses0.001849350at second earlier; average four-cutoff gain is essentially zero. Do not select a standalone or transferred coverage correction; E105volume and E110freshfull data comparisons remain separate experiments. + +## E95 all-shard final earlier cutoff3 +- Checkpoint SHA-256: `453c1e5c5ff189f961d2b4001e9e299c72e26f86d3c4afe5b5a6a46fe5acaafe`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 22.70902395248413 seconds. +- Overall skill 0.387881; relative MASE 0.740491; relative WQL 0.506003. +- term skill: long=0.3979, medium=0.3625, short=0.3935. +- domain skill: Econ/Fin=0.1693, Energy=0.3185, Healthcare=0.2544, Nature=0.4987, Sales=0.3991, Transport=0.5048, Web/CloudOps=0.3958. +- frequency skill: A=0.3523, D=0.4336, H=0.4042, M=0.1203, Q=0.2579, S=0.2981, T=0.4301, W=0.2615. +- variates skill: multivariate=0.3768, univariate=0.3965. +- Outcome: Matched seed197/B64/LR2e-5 final12000 comparison. E95gains main/first/third earlier but loses0.001849350at second earlier; average four-cutoff gain is essentially zero. Do not select a standalone or transferred coverage correction; E105volume and E110freshfull data comparisons remain separate experiments. + +## E80 matched original-corpus final earlier cutoff3 +- Checkpoint SHA-256: `f11d056b95f1c5eeef174265ebc51742952600e0dae1fa52900860447d5be819`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 22.906182527542114 seconds. +- Overall skill 0.387481; relative MASE 0.740121; relative WQL 0.506916. +- term skill: long=0.3953, medium=0.3592, short=0.3949. +- domain skill: Econ/Fin=0.1649, Energy=0.3182, Healthcare=0.2719, Nature=0.5016, Sales=0.3989, Transport=0.5041, Web/CloudOps=0.3891. +- frequency skill: A=0.3478, D=0.4406, H=0.4026, M=0.1367, Q=0.2596, S=0.2884, T=0.4271, W=0.2609. +- variates skill: multivariate=0.3727, univariate=0.3989. +- Outcome: Matched seed197/B64/LR2e-5 final12000 comparison. E95gains main/first/third earlier but loses0.001849350at second earlier; average four-cutoff gain is essentially zero. Do not select a standalone or transferred coverage correction; E105volume and E110freshfull data comparisons remain separate experiments. + +## E111 independent-seed replication of weekly synthetic coverage — predeclared +Hypothesis: the weekly-coverage gain is a reproducible training-data effect, rather than a favorable seed197continuation. Train two new matched arms from the same ownE62initial checkpoint with seed523/B64/LR2e-5/12000steps, paired loss, packed_sample and original source weights. Control uses overflow_control; candidate uses the already checked weekly_synth generator (unchanged20%synthetic; independent Bernoulli1/11 weekly replacement, weekly seed1000526, horizon seed300526). Both consume identical original real/non-replaced streams for this new seed. The primary matched comparison is at6000;1000/3000 are learning-curve diagnostics and12000tests durability. This is a new causal replication of the generator effect, not a retraining of any supplied reference baseline. Queue control after E107 and candidate after control, using one released allocation sequentially. Every output name is distinct and guarded; expected packed corpus and checkpoint hashes are checked by watchers. Earlier cutoffs required before any transfer or averaging of seed-specific corrections. No new model-soup rule is selected yet. + +## E97 weekly synthetic coverage final12000 +- Checkpoint SHA-256: `5104b21697e423740d2fa0fb55c4010759a83ab7f376b8704b0b992f56850203`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 20.680010318756104 seconds. +- Overall skill 0.380440; relative MASE 0.741395; relative WQL 0.517747. +- term skill: long=0.4027, medium=0.4063, short=0.3614. +- domain skill: Econ/Fin=0.1282, Energy=0.2358, Healthcare=0.4938, Nature=0.4316, Sales=0.3351, Transport=0.4668, Web/CloudOps=0.5051. +- frequency skill: A=0.3616, D=0.3526, H=0.3946, M=0.1286, Q=0.1969, S=0.4251, T=0.4412, W=0.2425. +- variates skill: multivariate=0.3967, univariate=0.3672. +- Outcome: Final0.380439539 remains above matchedE80final0.377423946 by0.003015593, though slightly below its own6000 0.380715730. Complete12000 in2600.472750shared-H100 training-loop seconds. The fixed6000delta ensemble E109 is being fully replayed; E111seed523 matched replication is queued. No held-out claim. + +## E109 weekly6000 correction ensemble full public replay +- Checkpoint SHA-256: `6bb9ddf58411d410255e32206c4ef484576a3818cbc27bb574159ebe56957573`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.381981; relative MASE 0.738680; relative WQL 0.517067. +- term skill: long=0.4009, medium=0.4075, short=0.3645. +- domain skill: Econ/Fin=0.1246, Energy=0.2403, Healthcare=0.4904, Nature=0.4418, Sales=0.3580, Transport=0.4684, Web/CloudOps=0.4965. +- frequency skill: A=0.2972, D=0.3689, H=0.3957, M=0.1465, Q=0.1871, S=0.4253, T=0.4379, W=0.2406. +- variates skill: multivariate=0.3953, univariate=0.3712. +- Outcome: Full0.38198119952338705 exceeds publishedE1040.381736117455058 by0.00024508206832905, with both relativeMASE0.7386798626058647 and WQL0.5170673482219265 improved.97configs151170instances0fail,inference295.661474shared-H100 seconds. Three of four diagnostic cutoffs improve, third earlier declines0.000245656. Publish only after independent component/composition checks complete; adaptive validation result, not held-out significance. + +Recovery robustness: future trainer starts/resumes now save the already audited complete recovery state after their first completed update, in addition to every250steps. This protects progress during later static-shape compiler warmup; no objective, sampler or optimizer arithmetic changes. Already running trainers retain their loaded code. E101first50updates completed with finite loss0.744227227/gradientnorm0.361719310,teacher-valid1.0in logged batch,458.4loop seconds including compilation; remaining rare shapes may still compile. Compiler cache backup refreshed independently. + +E109 complete replay/check suite375.233383wall seconds includinglockwaits; inference295.661474seconds. Relocation bitwise/finite/ordered25.588799seconds. Independent changed-member replay and fixed orderedfloat32 composition match three complete actual configurations exactly (weekly_slow_ar6_composition_replay.json,weekly_slow6_ensemble_composition_checks.json). Descriptor6bb9ddf58411d410255e32206c4ef484576a3818cbc27bb574159ebe56957573,110068216parameters. Selected for atomic publication. Descriptive comparison {"improved_configs": 52, "dataset_cluster_delta_percentiles": {"p025": -4.58150388659706e-05, "p50": 0.00024309038144720851, "p975": 0.0005397384010364019}, "bootstrap_seed": 317, "bootstrap_samples": 5000}; no held-out significance claim. E101teacher staysE96. + +## E105 corrected larger-volume at3000 +- Checkpoint SHA-256: `df5bc1e16aa79d1074d7f2fb12f9b66ebdc8debf302fae7e7f388a89d2d2793a`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 21.78273630142212 seconds. +- Overall skill 0.376761; relative MASE 0.744501; relative WQL 0.521728. +- term skill: long=0.3980, medium=0.4051, short=0.3571. +- domain skill: Econ/Fin=0.1385, Energy=0.2347, Healthcare=0.4694, Nature=0.4324, Sales=0.3388, Transport=0.4642, Web/CloudOps=0.4967. +- frequency skill: A=0.3747, D=0.3532, H=0.3950, M=0.1208, Q=0.1966, S=0.4235, T=0.4334, W=0.2280. +- variates skill: multivariate=0.3912, univariate=0.3650. +- Outcome: Skill0.376761202 nearly ties E95smallpack3000 0.376741687 and trails E80original-pack3000 0.378663825. Corrected separate output;1001onward restored full1000state. Continue declared6000/12000, no selection. + +## E106 spectral residuals at3000 +- Checkpoint SHA-256: `a2445412f640657c3396806783fbcbbed5243b9443fe08615a45760c4becd98e`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 21.065938234329224 seconds. +- Overall skill 0.378295; relative MASE 0.743170; relative WQL 0.520091. +- term skill: long=0.4031, medium=0.4065, short=0.3573. +- domain skill: Econ/Fin=0.1451, Energy=0.2383, Healthcare=0.4329, Nature=0.4339, Sales=0.3314, Transport=0.4654, Web/CloudOps=0.5053. +- frequency skill: A=0.3698, D=0.3530, H=0.3972, M=0.1006, Q=0.2014, S=0.4236, T=0.4398, W=0.2184. +- variates skill: multivariate=0.3981, univariate=0.3621. +- Outcome: Skill0.378295411 trails matched E80at3000 0.378663825 by0.000368414. The1000gain did not persist. Continue declared6000/12000 before any earlier-cutoff selection; no transfer or publication. + +## E112 final-duration matched weekly correction — predeclared +E104at3000 and E109at6000 improved complete public replay with coefficient1 and unchanged equal-member composition. Finish the checkpoint-duration comparison at the already scheduled final12000: E83 + E97weeklyEMA12000 - E80overflowEMA12000, coefficient1. E97final0.380439539 minus E80final0.377423946 is a larger standalone matched gap than at6000, despite the candidate's own slight decline. Evaluate the fixed merged checkpoint at all four cutoffs, then the same equal1/3 ensemble with E71patch8_6000 and E93splitpatch_12000. No optimizer updates, coefficient sweep or change to any runtime rule. Compare to published E109; full public replay and checks required for publication. This completes the declared3k/6k/12k duration sequence, not a new training run or independent replication. E111seed523 pair separately tests reproducibility. + +## E113 frequency-scaled short training windows — preparation +Hypothesis: the sampler coverage audit shows many low-frequency real windows with short histories and long future labels, while low-frequency synthetic contexts are usually hundreds/thousands of steps. Change only the training-window distribution for half of rows whose existing period pair is[first<=52,second=1]. First consume the original sampler and requested-horizon augmentation completely. Using independent RNG seed1200200, choose a new forecast endpoint uniformly among finite original target positions; choose an integer horizon log-uniform from1 to min(originalH,max(8,2*period),available_span-8); retain the most recent min(originalC,max(64,32*period),available_span-newH) context positions. Require at least4finite context values. Move only existing contiguous allowed-series/local-generator observations across the new training cutoff, preserving all internal missing values and period labels; no new values, validation reads or cross-series information. Unselected rows and original/horizon RNG streams must remain bitwise unchanged. This is one joint history/horizon sampling hypothesis, not a separate causal claim about either subfactor. ComparatorE80: ownE62initial,seed197/B64/LR2e-5/12000,paired loss,original20%synthetic and source probabilities, unchanged overflow-safe model/runtime. CPU index/mask/RNG checks required before queueing after the E111pair. Screens1000/3000/6000/12000; earlier/full replay for selection. +E113 pretraining-only design revision before any optimizer step: initial CPU audit seed541/15360windows found median requested horizon2 for annual/quarterly changed rows. To avoid concentrating the new supervision on1–2step forecasts, set the log-uniform lower bound to4 whenever at least4future positions are available (otherwise the available maximum). All other rules are unchanged. No validation outcome was used for this revision. Initial audit retained as lowfreq_windows_checks_initial_horizon1.json,4.844810CPU seconds; rerun the index/RNG audit on the final sampler before queueing. + +E113 final sampler audit passes: seed541,15360paired control/candidate windows,2679eligible,1360changed,4.688498CPU seconds,0optimizerupdates/no validationread. Exact contiguous source indices verified for every changed context/target, all unselected rows and period labels unchanged, original/horizon RNG states bitwise identical, all three NumPy streams recover exactly. Model file byte-identical toE80 SHA44eeb23c037e91b8f67e432615ce46540a7ac4242919785f9c4218de23121499. Sampling diagnostics {"4": {"rows": 392, "median_context_before": 38.5, "median_context_after": 56.0, "median_target_before": 48.0, "median_target_after": 5.0}, "1": {"rows": 255, "median_context_before": 714.0, "median_context_after": 64.0, "median_target_before": 112.0, "median_target_after": 5.0}, "52": {"rows": 298, "median_context_before": 53.0, "median_context_after": 76.0, "median_target_before": 84.0, "median_target_after": 16.0}, "12": {"rows": 415, "median_context_before": 60.0, "median_context_after": 88.0, "median_target_before": 66.0, "median_target_after": 9.0}}. Queue after E111candidate14350. Final generator/rule metadata and publication provenance added; runtime remains postloss_inference. + +## E112 final-duration ensemble four-cutoff result +{"skill_score": 0.3858712532527797, "rel_mase_gmean": 0.7358504086107674, "rel_wql_gmean": 0.512541833459536, "groups": {"term": {"short": 0.36862786434327777, "medium": 0.4088431767481189, "long": 0.4066382857473849}, "domain": {"Econ/Fin": 0.1427335412380505, "Energy": 0.24665585766807274, "Healthcare": 0.4865626055775951, "Nature": 0.4421324797730376, "Sales": 0.3441164280500456, "Transport": 0.46824759257656046, "Web/CloudOps": 0.5048162617852268}, "freq": {"A-DEC": 0.3751097673324215, "Q-DEC": 0.1969044501960543, "M": 0.12093463923233339, "W-SUN": 0.1050444592094002, "D": 0.36501445271701716, "H": 0.40096290360047526, "15T": 0.21688931337366202, "W-FRI": 0.01363906764599443, "10T": 0.6277697339150299, "W-TUE": 0.6448188288204655, "W-THU": 0.20576781810192735, "W-WED": 0.33017644200384, "5T": 0.5200746054287371, "10S": 0.42522083651418774}}, "cpu_seconds": 1.3133022310212255, "member_checkpoint_hashes": ["6f1f0f6025afbe565633fee0b937a14f1efedf83ffbe7de65641c3800f60d8c7", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cutoff": "valid_screen", "E109skill": 0.38571041915894055, "difference": 0.00016083409383915725} +{"skill_score": 0.34026453805586865, "rel_mase_gmean": 0.7938743991145676, "rel_wql_gmean": 0.5482616396650213, "groups": {"term": {"short": 0.3069591344201037, "medium": 0.360270352157806, "long": 0.401968127644735}, "domain": {"Econ/Fin": 0.1719491915504786, "Energy": 0.23186920778828224, "Healthcare": 0.4136537686496582, "Nature": 0.3727904917107857, "Sales": 0.40577071577146684, "Transport": 0.3736370692721874, "Web/CloudOps": 0.4513164517386834}, "freq": {"A-DEC": 0.3259591929532375, "Q-DEC": 0.23688125417263828, "M": 0.19019710487662123, "W-SUN": 0.04859397725596748, "D": 0.35267813857571817, "H": 0.3715520522339072, "15T": 0.22235983728090003, "W-FRI": 0.23099317599917168, "10T": 0.3253705594505678, "W-TUE": 0.5636487610465628, "W-THU": 0.2596937123136588, "W-WED": 0.3622295587104454, "5T": 0.44209582636515465, "10S": 0.34758760809251354}}, "cpu_seconds": 1.2864791969768703, "member_checkpoint_hashes": ["6f1f0f6025afbe565633fee0b937a14f1efedf83ffbe7de65641c3800f60d8c7", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cutoff": "valid_backcast", "E109skill": 0.34038453448144423, "difference": -0.00011999642557558587} +{"skill_score": 0.36500280105746885, "rel_mase_gmean": 0.7650616372712448, "rel_wql_gmean": 0.5270443883489382, "groups": {"term": {"short": 0.3522992147072812, "medium": 0.39323093590574965, "long": 0.36882551999825675}, "domain": {"Econ/Fin": 0.12172400330140187, "Energy": 0.24177568201657473, "Healthcare": 0.351634580322554, "Nature": 0.47856500731963436, "Sales": 0.556767594467451, "Transport": 0.42520135798126146, "Web/CloudOps": 0.43731641066930993}, "freq": {"A-DEC": 0.3368001909919832, "Q-DEC": 0.15714702439125794, "M": 0.166107338147097, "W-SUN": 0.06814222014322535, "D": 0.4306717956748586, "H": 0.394613806291076, "15T": 0.10893648874402395, "W-FRI": 0.1553435881509515, "10T": 0.5096714148955988, "W-TUE": 0.0852329830425479, "W-THU": 0.35258387477718955, "W-WED": 0.5645835048514585, "5T": 0.4726250053861992, "10S": 0.2856493230118694}}, "cpu_seconds": 1.1841424808371812, "member_checkpoint_hashes": ["6f1f0f6025afbe565633fee0b937a14f1efedf83ffbe7de65641c3800f60d8c7", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cutoff": "valid_backcast2", "E109skill": 0.3650268512866791, "difference": -2.4050229210259566e-05} +{"skill_score": 0.38948675360484886, "rel_mase_gmean": 0.7399201304191406, "rel_wql_gmean": 0.5037387262498307, "groups": {"term": {"short": 0.3948199478576392, "medium": 0.3681915847463416, "long": 0.39625870682346687}, "domain": {"Econ/Fin": 0.1861914584696166, "Energy": 0.3162396550654769, "Healthcare": 0.2449973656886668, "Nature": 0.5053241835290441, "Sales": 0.400142202691233, "Transport": 0.5092939425383289, "Web/CloudOps": 0.39439674653047185}, "freq": {"A-DEC": 0.3579795125033336, "Q-DEC": 0.25418213861585404, "M": 0.14903096998383114, "W-SUN": 0.16834143185233952, "D": 0.44005142265195263, "H": 0.4058611111478776, "15T": 0.25413569489604193, "W-FRI": 0.03894964894687247, "10T": 0.6066278797992326, "W-TUE": 0.2775687319750957, "W-THU": 0.33593939814117346, "W-WED": 0.37754976142332153, "5T": 0.4657926027011683, "10S": 0.29225163220286654}}, "cpu_seconds": 1.1745618879795074, "member_checkpoint_hashes": ["6f1f0f6025afbe565633fee0b937a14f1efedf83ffbe7de65641c3800f60d8c7", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cutoff": "valid_backcast3", "E109skill": 0.38931035191213115, "difference": 0.00017640169271770922} +Main+0.000160834,firstearlier-0.000119996,secondearlier-0.000024050,thirdearlier+0.000176402. Mixed evidence with small positive average, select the final planned duration for one full public replay; no coefficient search or further intermediate-duration scouting. Merge1.324673CPU seconds, standaloneSHA6f1f0f6025afbe565633fee0b937a14f1efedf83ffbe7de65641c3800f60d8c7. + +## E112 weekly12000 matched-delta standalone valid_screen +- Checkpoint SHA-256: `6f1f0f6025afbe565633fee0b937a14f1efedf83ffbe7de65641c3800f60d8c7`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.014628887176514 seconds. +- Overall skill 0.382923; relative MASE 0.737814; relative WQL 0.516097. +- term skill: long=0.4041, medium=0.4080, short=0.3647. +- domain skill: Econ/Fin=0.1314, Energy=0.2405, Healthcare=0.4896, Nature=0.4389, Sales=0.3390, Transport=0.4645, Web/CloudOps=0.5065. +- frequency skill: A=0.3734, D=0.3574, H=0.4005, M=0.1143, Q=0.1979, S=0.4251, T=0.4425, W=0.2393. +- variates skill: multivariate=0.3987, univariate=0.3701. +- Outcome: Fixed E83+E97weekly12000-E80overflow12000, coefficient1; no optimizer updates. Final declared duration; equal-ensemble four-cutoff comparison recorded separately. + +## E112 weekly12000 matched-delta standalone valid_backcast +- Checkpoint SHA-256: `6f1f0f6025afbe565633fee0b937a14f1efedf83ffbe7de65641c3800f60d8c7`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 24.712749242782593 seconds. +- Overall skill 0.336057; relative MASE 0.797482; relative WQL 0.552765. +- term skill: long=0.3943, medium=0.3598, short=0.3028. +- domain skill: Econ/Fin=0.1596, Energy=0.2279, Healthcare=0.4002, Nature=0.3697, Sales=0.3973, Transport=0.3719, Web/CloudOps=0.4492. +- frequency skill: A=0.3195, D=0.3471, H=0.3685, M=0.1781, Q=0.2311, S=0.3391, T=0.3345, W=0.2912. +- variates skill: multivariate=0.3529, univariate=0.3224. +- Outcome: Fixed E83+E97weekly12000-E80overflow12000, coefficient1; no optimizer updates. Final declared duration; equal-ensemble four-cutoff comparison recorded separately. + +## E112 weekly12000 matched-delta standalone valid_backcast2 +- Checkpoint SHA-256: `6f1f0f6025afbe565633fee0b937a14f1efedf83ffbe7de65641c3800f60d8c7`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 22.29803729057312 seconds. +- Overall skill 0.359294; relative MASE 0.770653; relative WQL 0.532671. +- term skill: long=0.3666, medium=0.3870, short=0.3456. +- domain skill: Econ/Fin=0.1183, Energy=0.2393, Healthcare=0.3076, Nature=0.4737, Sales=0.5535, Transport=0.4205, Web/CloudOps=0.4340. +- frequency skill: A=0.3509, D=0.4224, H=0.3915, M=0.1439, Q=0.1518, S=0.2810, T=0.3649, W=0.2544. +- variates skill: multivariate=0.3654, univariate=0.3543. +- Outcome: Fixed E83+E97weekly12000-E80overflow12000, coefficient1; no optimizer updates. Final declared duration; equal-ensemble four-cutoff comparison recorded separately. + +## E112 weekly12000 matched-delta standalone valid_backcast3 +- Checkpoint SHA-256: `6f1f0f6025afbe565633fee0b937a14f1efedf83ffbe7de65641c3800f60d8c7`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 23.48830485343933 seconds. +- Overall skill 0.388305; relative MASE 0.741401; relative WQL 0.504680. +- term skill: long=0.3936, medium=0.3621, short=0.3959. +- domain skill: Econ/Fin=0.1754, Energy=0.3218, Healthcare=0.2432, Nature=0.4966, Sales=0.4018, Transport=0.5087, Web/CloudOps=0.3917. +- frequency skill: A=0.3624, D=0.4385, H=0.4055, M=0.1372, Q=0.2587, S=0.2738, T=0.4319, W=0.2514. +- variates skill: multivariate=0.3722, univariate=0.4007. +- Outcome: Fixed E83+E97weekly12000-E80overflow12000, coefficient1; no optimizer updates. Final declared duration; equal-ensemble four-cutoff comparison recorded separately. + +## E94 fresh146M halfLR at24000 +- Checkpoint SHA-256: `ee69006629037179a8fd6d09233755cb8efceafb0a47494abceceea3cb7fae52`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 37.77550005912781 seconds. +- Overall skill 0.355452; relative MASE 0.766772; relative WQL 0.541806. +- term skill: long=0.3783, medium=0.3844, short=0.3349. +- domain skill: Econ/Fin=0.1190, Energy=0.2184, Healthcare=0.3835, Nature=0.4109, Sales=0.3450, Transport=0.4523, Web/CloudOps=0.4748. +- frequency skill: A=0.3831, D=0.3537, H=0.3714, M=0.0510, Q=0.1900, S=0.4180, T=0.4033, W=0.2182. +- variates skill: multivariate=0.3639, univariate=0.3487. +- Outcome: Skill0.355452449 exceeds highLR146M24000 0.354493848 by0.000958601; smaller than the16k advantage. Below37M24000 0.357901602. Continue existing schedule; E110full-corpus comparison retains this rate, unchanged recipe otherwise. + +## E105 corrected larger-volume at6000 +- Checkpoint SHA-256: `ec7daab696252802849e28ee1b8348e500ebe094e8ece39a956f01daff5a6943`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.547231912612915 seconds. +- Overall skill 0.376970; relative MASE 0.744376; relative WQL 0.521465. +- term skill: long=0.3995, medium=0.4061, short=0.3565. +- domain skill: Econ/Fin=0.1376, Energy=0.2329, Healthcare=0.4645, Nature=0.4332, Sales=0.3377, Transport=0.4673, Web/CloudOps=0.4981. +- frequency skill: A=0.3771, D=0.3531, H=0.3960, M=0.1187, Q=0.1962, S=0.4239, T=0.4342, W=0.2227. +- variates skill: multivariate=0.3915, univariate=0.3652. +- Outcome: Skill0.376970385 exceeds E95smallpack6000 0.376043220 by0.000927165 but remains below original-corpus E80at6000 0.378288765. Correct output and checkpoint hash; continue12000 before selection. + +## E106 spectral residuals at6000 +- Checkpoint SHA-256: `683f3824d3c1f605d17bb08d3eef127a54c67eca3867cfbcf1158710a55c4b24`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 24.36519145965576 seconds. +- Overall skill 0.379248; relative MASE 0.742652; relative WQL 0.518861. +- term skill: long=0.4037, medium=0.4079, short=0.3582. +- domain skill: Econ/Fin=0.1453, Energy=0.2390, Healthcare=0.4421, Nature=0.4321, Sales=0.3360, Transport=0.4646, Web/CloudOps=0.5073. +- frequency skill: A=0.3711, D=0.3532, H=0.3962, M=0.1095, Q=0.1992, S=0.4251, T=0.4421, W=0.2198. +- variates skill: multivariate=0.3998, univariate=0.3624. +- Outcome: Skill0.379247830 exceeds matched E80at6000 0.378288765 by0.000959065, recovering the3k deficit. Queue matched earlier-cutoff evaluations before any fixed weight transfer or publication. Original sampler/horizon streams preserved; only the declared stochastic residual law differs. + +## E106 spectral residuals at6000 valid_backcast +- Checkpoint SHA-256: `683f3824d3c1f605d17bb08d3eef127a54c67eca3867cfbcf1158710a55c4b24`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 24.24050521850586 seconds. +- Overall skill 0.337595; relative MASE 0.795167; relative WQL 0.551809. +- term skill: long=0.3992, medium=0.3598, short=0.3034. +- domain skill: Econ/Fin=0.1714, Energy=0.2258, Healthcare=0.4113, Nature=0.3681, Sales=0.3959, Transport=0.3715, Web/CloudOps=0.4544. +- frequency skill: A=0.3144, D=0.3510, H=0.3671, M=0.1923, Q=0.2368, S=0.3431, T=0.3372, W=0.2876. +- variates skill: multivariate=0.3548, univariate=0.3236. +- Outcome: Matched seed197/B64/LR2e-5 comparison. E106 minus E80: main +0.000959065, first earlier +0.002438307, second +0.001622232, third -0.002173652. Three gains and one regression; use all four for transfer selection. + +## E106 spectral residuals at6000 valid_backcast2 +- Checkpoint SHA-256: `683f3824d3c1f605d17bb08d3eef127a54c67eca3867cfbcf1158710a55c4b24`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 23.82012963294983 seconds. +- Overall skill 0.361328; relative MASE 0.767561; relative WQL 0.531426. +- term skill: long=0.3654, medium=0.3919, short=0.3475. +- domain skill: Econ/Fin=0.1166, Energy=0.2360, Healthcare=0.3636, Nature=0.4724, Sales=0.5443, Transport=0.4198, Web/CloudOps=0.4383. +- frequency skill: A=0.3461, D=0.4280, H=0.3911, M=0.1469, Q=0.1522, S=0.2809, T=0.3651, W=0.2687. +- variates skill: multivariate=0.3660, univariate=0.3575. +- Outcome: Matched seed197/B64/LR2e-5 comparison. E106 minus E80: main +0.000959065, first earlier +0.002438307, second +0.001622232, third -0.002173652. Three gains and one regression; use all four for transfer selection. + +## E106 spectral residuals at6000 valid_backcast3 +- Checkpoint SHA-256: `683f3824d3c1f605d17bb08d3eef127a54c67eca3867cfbcf1158710a55c4b24`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 22.619502544403076 seconds. +- Overall skill 0.387494; relative MASE 0.739218; relative WQL 0.507514. +- term skill: long=0.3976, medium=0.3604, short=0.3937. +- domain skill: Econ/Fin=0.1834, Energy=0.3158, Healthcare=0.2403, Nature=0.5028, Sales=0.3975, Transport=0.5052, Web/CloudOps=0.3936. +- frequency skill: A=0.3594, D=0.4421, H=0.4034, M=0.1060, Q=0.2636, S=0.2895, T=0.4283, W=0.2584. +- variates skill: multivariate=0.3719, univariate=0.3995. +- Outcome: Matched seed197/B64/LR2e-5 comparison. E106 minus E80: main +0.000959065, first earlier +0.002438307, second +0.001622232, third -0.002173652. Three gains and one regression; use all four for transfer selection. + +## E80 matched overflow control at6000 valid_backcast +- Checkpoint SHA-256: `b19875c52ed5024383fb69ccc48cb07a5629ad8011abf134c7dcfcdc50fae2af`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 24.008483409881592 seconds. +- Overall skill 0.335156; relative MASE 0.799092; relative WQL 0.553149. +- term skill: long=0.3994, medium=0.3566, short=0.3001. +- domain skill: Econ/Fin=0.1475, Energy=0.2281, Healthcare=0.4131, Nature=0.3644, Sales=0.3963, Transport=0.3724, Web/CloudOps=0.4481. +- frequency skill: A=0.3117, D=0.3511, H=0.3667, M=0.1735, Q=0.2355, S=0.3418, T=0.3331, W=0.2854. +- variates skill: multivariate=0.3519, univariate=0.3215. +- Outcome: Matched seed197/B64/LR2e-5 comparison. E106 minus E80: main +0.000959065, first earlier +0.002438307, second +0.001622232, third -0.002173652. Three gains and one regression; use all four for transfer selection. + +## E80 matched overflow control at6000 valid_backcast2 +- Checkpoint SHA-256: `b19875c52ed5024383fb69ccc48cb07a5629ad8011abf134c7dcfcdc50fae2af`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 22.792612314224243 seconds. +- Overall skill 0.359706; relative MASE 0.769403; relative WQL 0.532850. +- term skill: long=0.3636, medium=0.3907, short=0.3458. +- domain skill: Econ/Fin=0.0946, Energy=0.2378, Healthcare=0.3660, Nature=0.4719, Sales=0.5485, Transport=0.4205, Web/CloudOps=0.4319. +- frequency skill: A=0.3470, D=0.4246, H=0.3913, M=0.1616, Q=0.1478, S=0.2802, T=0.3612, W=0.2648. +- variates skill: multivariate=0.3639, univariate=0.3563. +- Outcome: Matched seed197/B64/LR2e-5 comparison. E106 minus E80: main +0.000959065, first earlier +0.002438307, second +0.001622232, third -0.002173652. Three gains and one regression; use all four for transfer selection. + +## E80 matched overflow control at6000 valid_backcast3 +- Checkpoint SHA-256: `b19875c52ed5024383fb69ccc48cb07a5629ad8011abf134c7dcfcdc50fae2af`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 23.62287187576294 seconds. +- Overall skill 0.389668; relative MASE 0.736019; relative WQL 0.506109. +- term skill: long=0.3966, medium=0.3611, short=0.3975. +- domain skill: Econ/Fin=0.1636, Energy=0.3183, Healthcare=0.2809, Nature=0.5072, Sales=0.3984, Transport=0.5059, Web/CloudOps=0.3910. +- frequency skill: A=0.3571, D=0.4456, H=0.4044, M=0.1427, Q=0.2560, S=0.2903, T=0.4280, W=0.2623. +- variates skill: multivariate=0.3727, univariate=0.4027. +- Outcome: Matched seed197/B64/LR2e-5 comparison. E106 minus E80: main +0.000959065, first earlier +0.002438307, second +0.001622232, third -0.002173652. Three gains and one regression; use all four for transfer selection. + +## E114 spectral-prior transfer — predeclared +E1066000 improves three of four cutoffs over matched E80, with a regression on the oldest cutoff. Test two fixed coefficient-one corrections on the E109 first member. A (additive): weekly_slow_ar_delta6k + spectral_synth/ema006000 - overflow_control/ema006000. B (replacement): A + partial_targets/ema006000 - long_memory_synth_recovery/ema006000; this removes the earlier slow-AR correction, testing overlap between the two stochastic priors. Keep the weekly6000 correction fixed for both even if E112publishes. All ancestors are our own allowed-data training. No optimizer updates, new training seed, coefficient search, runtime change or per-instance routing. Evaluate both standalone at all four cutoffs and as the unchanged equal1/3 ensemble with E71patch8_6000 and E93splitpatch_12000. Select for full replay only if the complete diagnostic pattern supports it; compare to E109 and the current published model. CPU merges and all evaluation times/hashes recorded in spectral_transfer_receipt.json and reports. + +## E112 final weekly12000 ensemble full public replay — selected +- Checkpoint SHA-256: `f01498eb73e4aa0539e81c67a8a80e56af47d1437f4d65ecc882d551468241a1`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.382143; relative MASE 0.738501; relative WQL 0.516922. +- term skill: long=0.4008, medium=0.4078, short=0.3647. +- domain skill: Econ/Fin=0.1239, Energy=0.2402, Healthcare=0.4917, Nature=0.4423, Sales=0.3583, Transport=0.4684, Web/CloudOps=0.4966. +- frequency skill: A=0.2967, D=0.3694, H=0.3956, M=0.1464, Q=0.1869, S=0.4252, T=0.4382, W=0.2411. +- variates skill: multivariate=0.3955, univariate=0.3713. +- Outcome: Full skill0.382143195 exceeds E1090.381981200 by0.000161996. All97configs151170instances succeeded. Relocation deterministic and finite/ordered; independent three-configuration composition exact. Four-cutoff evidence is mixed with small positive average. Validation selection, not a held-out significance claim. + +E112 complete public suite {"package": "/workspace/research/candidate-weekly-slow12-ensemble", "status": "complete", "steps": [{"name": "relocation", "returncode": 0, "seconds": 61.15590557013638}, {"name": "full_public_replay", "returncode": 0, "seconds": 382.10087375016883}, {"name": "independent_weekly_slow_replay", "returncode": 0, "seconds": 31.673624618910253}, {"name": "composition", "returncode": 0, "seconds": 0.6345367848407477}, {"name": "descriptive_comparison", "returncode": 0, "seconds": 0.2616488521452993}], "current_step": "descriptive_comparison", "seconds": 475.838925806107, "skill": 0.3821431951028217}. Descriptive comparison {"candidate": "/workspace/research/valid-report-weekly-slow12-ensemble.json", "parent": "/workspace/research/valid-report-weekly-slow6-ensemble.json", "candidate_hash": "f01498eb73e4aa0539e81c67a8a80e56af47d1437f4d65ecc882d551468241a1", "parent_hash": "6bb9ddf58411d410255e32206c4ef484576a3818cbc27bb574159ebe56957573", "skill_difference": 0.00016199557943463727, "n_configs": 97, "n_dataset_clusters": 28, "improved_configs": 55, "bootstrap_seed": 317, "bootstrap_samples": 5000, "dataset_cluster_delta_percentiles": {"p025": -4.304766264538462e-05, "p50": 0.00016053828879819543, "p975": 0.0003767170761483723}, "note": "Descriptive resampling only. Adaptive validation selection and reused windows prevent treating this as a held-out significance test."}. Atomic publication selected. Model tensors, runtime code and equal weights are unchanged from replay. E101teacher remains frozen E96. + +E107 learned sixteen-cycle summary seed197 training started at 2026-10-23T06:21:44Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E114 spectral_add_delta6k valid_screen +- Checkpoint SHA-256: `c3dfc433d51355228fc13d04913db1a7edf83030c33283b150bdcc50f5ae6ea2`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.866043090820312 seconds. +- Overall skill 0.382009; relative MASE 0.739202; relative WQL 0.516656. +- term skill: long=0.4047, medium=0.4077, short=0.3629. +- domain skill: Econ/Fin=0.1448, Energy=0.2399, Healthcare=0.4635, Nature=0.4395, Sales=0.3355, Transport=0.4625, Web/CloudOps=0.5089. +- frequency skill: A=0.3780, D=0.3567, H=0.4013, M=0.0935, Q=0.2062, S=0.4246, T=0.4432, W=0.2297. +- variates skill: multivariate=0.3997, univariate=0.3676. +- Outcome: Fixed coefficient-one spectral transfer; additive and old-slow-AR replacement are the two predeclared ablations. No optimization. Ensemble selection recorded separately. + +## E114 spectral_add_delta6k valid_backcast +- Checkpoint SHA-256: `c3dfc433d51355228fc13d04913db1a7edf83030c33283b150bdcc50f5ae6ea2`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 23.915529251098633 seconds. +- Overall skill 0.338230; relative MASE 0.793941; relative WQL 0.551602. +- term skill: long=0.3953, medium=0.3603, short=0.3061. +- domain skill: Econ/Fin=0.1783, Energy=0.2263, Healthcare=0.4002, Nature=0.3726, Sales=0.3946, Transport=0.3707, Web/CloudOps=0.4554. +- frequency skill: A=0.3234, D=0.3463, H=0.3697, M=0.2025, Q=0.2286, S=0.3392, T=0.3373, W=0.2912. +- variates skill: multivariate=0.3554, univariate=0.3242. +- Outcome: Fixed coefficient-one spectral transfer; additive and old-slow-AR replacement are the two predeclared ablations. No optimization. Ensemble selection recorded separately. + +## E114 spectral_add_delta6k valid_backcast2 +- Checkpoint SHA-256: `c3dfc433d51355228fc13d04913db1a7edf83030c33283b150bdcc50f5ae6ea2`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 22.574910163879395 seconds. +- Overall skill 0.360737; relative MASE 0.769308; relative WQL 0.531202. +- term skill: long=0.3675, medium=0.3883, short=0.3472. +- domain skill: Econ/Fin=0.1344, Energy=0.2381, Healthcare=0.3027, Nature=0.4740, Sales=0.5467, Transport=0.4200, Web/CloudOps=0.4411. +- frequency skill: A=0.3495, D=0.4226, H=0.3924, M=0.1272, Q=0.1523, S=0.2785, T=0.3691, W=0.2610. +- variates skill: multivariate=0.3682, univariate=0.3546. +- Outcome: Fixed coefficient-one spectral transfer; additive and old-slow-AR replacement are the two predeclared ablations. No optimization. Ensemble selection recorded separately. + +## E114 spectral_add_delta6k valid_backcast3 +- Checkpoint SHA-256: `c3dfc433d51355228fc13d04913db1a7edf83030c33283b150bdcc50f5ae6ea2`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 21.270376443862915 seconds. +- Overall skill 0.385446; relative MASE 0.745841; relative WQL 0.506377. +- term skill: long=0.3926, medium=0.3611, short=0.3917. +- domain skill: Econ/Fin=0.1886, Energy=0.3194, Healthcare=0.2003, Nature=0.4920, Sales=0.4005, Transport=0.5087, Web/CloudOps=0.3919. +- frequency skill: A=0.3636, D=0.4339, H=0.4034, M=0.1065, Q=0.2631, S=0.2741, T=0.4316, W=0.2453. +- variates skill: multivariate=0.3711, univariate=0.3965. +- Outcome: Fixed coefficient-one spectral transfer; additive and old-slow-AR replacement are the two predeclared ablations. No optimization. Ensemble selection recorded separately. + +E110 fresh146M full eligible-series corpus training started at 2026-10-23T06:22:29Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E105 corrected larger-volume final12000 +- Checkpoint SHA-256: `c14daa56b23ee830ac5e0e50bcab588d8beac92ae756f038bed83431031c4b4d`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 23.560805082321167 seconds. +- Overall skill 0.377529; relative MASE 0.743201; relative WQL 0.521353. +- term skill: long=0.4045, medium=0.4073, short=0.3550. +- domain skill: Econ/Fin=0.1278, Energy=0.2347, Healthcare=0.4489, Nature=0.4326, Sales=0.3346, Transport=0.4664, Web/CloudOps=0.5052. +- frequency skill: A=0.3643, D=0.3476, H=0.3969, M=0.0868, Q=0.1944, S=0.4248, T=0.4408, W=0.2231. +- variates skill: multivariate=0.3969, univariate=0.3616. +- Outcome: Final0.377529200 trails E95nested-small0.377983250 by0.000454050 and is nearly tied with E80oldpack0.377423946. No selection from the main score; all three earlier cutoffs are running to complete the volume comparison. Continuation preserves exact1000optimizer/EMA/RNG/prefetch state; the original output collision and lost E95weights remain documented. + +E105 completed12000: corrected continuation loop2013.982814125s, process2034.180478418s. Original interrupted phase process237.888408643s, last logged step1000 at202.5loopseconds; full1000state resumed exactly. Total observed process wall2272.068887061s includes setup and incident handling inside those phases. E106 completed12000,loop2206.272277840s,process2220.040782971s. These are shared-H100 process wall times, not isolated GPU hours. Both final checkpoints now get all three earlier-cutoff diagnostics; no new training or changes to their declared recipes. E107started06:21:44trainer15845; E110started06:22:29trainer15925. + +## E115 end-to-end period-phase conditioning — predeclared preparation +E57 added sine/cosine period-relative inputs but froze the entire existing backbone; its +0.000047 main gain was offset by earlier losses and it was rejected. Test the different hypothesis that attention and projections must co-adapt. Add the same two zero-initialized per-point phase projections (context and future query, two frequency periods, sine/cosine, origin at forecast start, periods<2 zero, missing context positions zero) to the current overflow-safe E62 model. Train all parameters jointly, matching E80 seed197/B64/LR2e-5/12000/paired loss/original source probabilities, generator and requested-horizon stream exactly. No calendar dates, dataset identities or new sources. This compares phase conditioning against E80; it is not a matched causal comparison of training scope against the older E57 run, which used another parent/rate/seed. Verify initial function/inherited tensors and phase arithmetic, then max-shape finite gradients including backbone and new projections before queueing after E79fresh37M96000. Screens1000/3000/6000/12000; earlier/full replay before any selection. + +## E106 spectral residuals final12000 valid_screen +- Checkpoint SHA-256: `1c5c735147bcd1679bc761d091aaf4369c37ce4c14efd65e19b91ffd7a524756`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 21.81789803504944 seconds. +- Overall skill 0.377641; relative MASE 0.743803; relative WQL 0.520743. +- term skill: long=0.4039, medium=0.4060, short=0.3559. +- domain skill: Econ/Fin=0.1485, Energy=0.2343, Healthcare=0.4336, Nature=0.4316, Sales=0.3325, Transport=0.4654, Web/CloudOps=0.5076. +- frequency skill: A=0.3624, D=0.3521, H=0.3945, M=0.1015, Q=0.2039, S=0.4248, T=0.4419, W=0.2125. +- variates skill: multivariate=0.3976, univariate=0.3613. +- Outcome: Final main0.377641399 versus E80.377423946; earlier0.337647555/0.361626447/0.385497870 versus control0.336528337/0.360973470/0.387481485. Three small gains offset by oldest-cutoff regression; average gap about0.0000015. The6000checkpoint remains the only transfer under consideration. No final-duration transfer selected. + +## E106 spectral residuals final12000 valid_backcast +- Checkpoint SHA-256: `1c5c735147bcd1679bc761d091aaf4369c37ce4c14efd65e19b91ffd7a524756`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 20.256327152252197 seconds. +- Overall skill 0.337648; relative MASE 0.795467; relative WQL 0.551513. +- term skill: long=0.3962, medium=0.3603, short=0.3046. +- domain skill: Econ/Fin=0.1743, Energy=0.2267, Healthcare=0.4112, Nature=0.3671, Sales=0.3950, Transport=0.3721, Web/CloudOps=0.4535. +- frequency skill: A=0.3210, D=0.3506, H=0.3659, M=0.1951, Q=0.2332, S=0.3426, T=0.3392, W=0.2845. +- variates skill: multivariate=0.3547, univariate=0.3237. +- Outcome: Final main0.377641399 versus E80.377423946; earlier0.337647555/0.361626447/0.385497870 versus control0.336528337/0.360973470/0.387481485. Three small gains offset by oldest-cutoff regression; average gap about0.0000015. The6000checkpoint remains the only transfer under consideration. No final-duration transfer selected. + +## E106 spectral residuals final12000 valid_backcast2 +- Checkpoint SHA-256: `1c5c735147bcd1679bc761d091aaf4369c37ce4c14efd65e19b91ffd7a524756`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 24.78632402420044 seconds. +- Overall skill 0.361626; relative MASE 0.767884; relative WQL 0.530706. +- term skill: long=0.3650, medium=0.3904, short=0.3489. +- domain skill: Econ/Fin=0.1188, Energy=0.2375, Healthcare=0.3551, Nature=0.4741, Sales=0.5473, Transport=0.4192, Web/CloudOps=0.4377. +- frequency skill: A=0.3482, D=0.4309, H=0.3898, M=0.1385, Q=0.1489, S=0.2820, T=0.3651, W=0.2748. +- variates skill: multivariate=0.3657, univariate=0.3583. +- Outcome: Final main0.377641399 versus E80.377423946; earlier0.337647555/0.361626447/0.385497870 versus control0.336528337/0.360973470/0.387481485. Three small gains offset by oldest-cutoff regression; average gap about0.0000015. The6000checkpoint remains the only transfer under consideration. No final-duration transfer selected. + +## E106 spectral residuals final12000 valid_backcast3 +- Checkpoint SHA-256: `1c5c735147bcd1679bc761d091aaf4369c37ce4c14efd65e19b91ffd7a524756`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 22.51108193397522 seconds. +- Overall skill 0.385498; relative MASE 0.742905; relative WQL 0.508292. +- term skill: long=0.3945, medium=0.3594, short=0.3917. +- domain skill: Econ/Fin=0.1811, Energy=0.3163, Healthcare=0.2183, Nature=0.5001, Sales=0.3991, Transport=0.5041, Web/CloudOps=0.3915. +- frequency skill: A=0.3530, D=0.4381, H=0.4016, M=0.0934, Q=0.2652, S=0.2859, T=0.4287, W=0.2549. +- variates skill: multivariate=0.3723, univariate=0.3957. +- Outcome: Final main0.377641399 versus E80.377423946; earlier0.337647555/0.361626447/0.385497870 versus control0.336528337/0.360973470/0.387481485. Three small gains offset by oldest-cutoff regression; average gap about0.0000015. The6000checkpoint remains the only transfer under consideration. No final-duration transfer selected. + +## E105 corrected larger-volume final12000 valid_backcast +- Checkpoint SHA-256: `c14daa56b23ee830ac5e0e50bcab588d8beac92ae756f038bed83431031c4b4d`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 22.00239086151123 seconds. +- Overall skill 0.336714; relative MASE 0.797414; relative WQL 0.551719. +- term skill: long=0.3996, medium=0.3592, short=0.3019. +- domain skill: Econ/Fin=0.1536, Energy=0.2291, Healthcare=0.4203, Nature=0.3659, Sales=0.3940, Transport=0.3743, Web/CloudOps=0.4484. +- frequency skill: A=0.3155, D=0.3546, H=0.3681, M=0.1764, Q=0.2336, S=0.3396, T=0.3370, W=0.2766. +- variates skill: multivariate=0.3543, univariate=0.3224. +- Outcome: Compared with E95nested-small: main-0.000454050, earlier1-0.000637726, earlier2+0.000411577, earlier3+0.002468634. Mixed results, strongest gain on the oldest cutoff; no clear uniform benefit or publication selected. Original output collision remains documented; these reports use the corrected actual E105weights. + +## E105 corrected larger-volume final12000 valid_backcast2 +- Checkpoint SHA-256: `c14daa56b23ee830ac5e0e50bcab588d8beac92ae756f038bed83431031c4b4d`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 23.669189453125 seconds. +- Overall skill 0.359536; relative MASE 0.770749; relative WQL 0.532203. +- term skill: long=0.3638, medium=0.3913, short=0.3452. +- domain skill: Econ/Fin=0.1019, Energy=0.2364, Healthcare=0.3499, Nature=0.4709, Sales=0.5511, Transport=0.4222, Web/CloudOps=0.4343. +- frequency skill: A=0.3525, D=0.4266, H=0.3904, M=0.1615, Q=0.1480, S=0.2795, T=0.3626, W=0.2558. +- variates skill: multivariate=0.3641, univariate=0.3558. +- Outcome: Compared with E95nested-small: main-0.000454050, earlier1-0.000637726, earlier2+0.000411577, earlier3+0.002468634. Mixed results, strongest gain on the oldest cutoff; no clear uniform benefit or publication selected. Original output collision remains documented; these reports use the corrected actual E105weights. + +## E105 corrected larger-volume final12000 valid_backcast3 +- Checkpoint SHA-256: `c14daa56b23ee830ac5e0e50bcab588d8beac92ae756f038bed83431031c4b4d`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 24.15644383430481 seconds. +- Overall skill 0.390349; relative MASE 0.736786; relative WQL 0.504453. +- term skill: long=0.3958, medium=0.3608, short=0.3990. +- domain skill: Econ/Fin=0.1696, Energy=0.3184, Healthcare=0.2721, Nature=0.5101, Sales=0.3969, Transport=0.5048, Web/CloudOps=0.3932. +- frequency skill: A=0.3711, D=0.4486, H=0.4049, M=0.1322, Q=0.2537, S=0.2882, T=0.4301, W=0.2569. +- variates skill: multivariate=0.3757, univariate=0.4016. +- Outcome: Compared with E95nested-small: main-0.000454050, earlier1-0.000637726, earlier2+0.000411577, earlier3+0.002468634. Mixed results, strongest gain on the oldest cutoff; no clear uniform benefit or publication selected. Original output collision remains documented; these reports use the corrected actual E105weights. + +## E114 spectral_replace_delta6k valid_screen +- Checkpoint SHA-256: `b01ff54ba0bd947f4806bd08793288a8202a1c8de153db482666aee3458395ac`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 22.1757493019104 seconds. +- Overall skill 0.382039; relative MASE 0.738892; relative WQL 0.516823. +- term skill: long=0.4049, medium=0.4087, short=0.3624. +- domain skill: Econ/Fin=0.1375, Energy=0.2428, Healthcare=0.4698, Nature=0.4360, Sales=0.3332, Transport=0.4634, Web/CloudOps=0.5079. +- frequency skill: A=0.3761, D=0.3509, H=0.4018, M=0.1029, Q=0.2052, S=0.4222, T=0.4437, W=0.2355. +- variates skill: multivariate=0.4001, univariate=0.3672. +- Outcome: Fixed coefficient-one spectral transfer; additive and old-slow-AR replacement are the two predeclared ablations. No optimization. Ensemble selection recorded separately. + +## E114 spectral_replace_delta6k valid_backcast +- Checkpoint SHA-256: `b01ff54ba0bd947f4806bd08793288a8202a1c8de153db482666aee3458395ac`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 22.24388575553894 seconds. +- Overall skill 0.337298; relative MASE 0.795806; relative WQL 0.551861. +- term skill: long=0.3970, medium=0.3617, short=0.3030. +- domain skill: Econ/Fin=0.1666, Energy=0.2287, Healthcare=0.3986, Nature=0.3693, Sales=0.3952, Transport=0.3715, Web/CloudOps=0.4531. +- frequency skill: A=0.3150, D=0.3467, H=0.3702, M=0.1914, Q=0.2292, S=0.3361, T=0.3366, W=0.2879. +- variates skill: multivariate=0.3553, univariate=0.3226. +- Outcome: Fixed coefficient-one spectral transfer; additive and old-slow-AR replacement are the two predeclared ablations. No optimization. Ensemble selection recorded separately. + +## E114 spectral_replace_delta6k valid_backcast2 +- Checkpoint SHA-256: `b01ff54ba0bd947f4806bd08793288a8202a1c8de153db482666aee3458395ac`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 23.31834578514099 seconds. +- Overall skill 0.358167; relative MASE 0.771957; relative WQL 0.533643. +- term skill: long=0.3638, medium=0.3887, short=0.3438. +- domain skill: Econ/Fin=0.1247, Energy=0.2380, Healthcare=0.3032, Nature=0.4702, Sales=0.5491, Transport=0.4202, Web/CloudOps=0.4344. +- frequency skill: A=0.3507, D=0.4174, H=0.3934, M=0.1411, Q=0.1551, S=0.2738, T=0.3644, W=0.2504. +- variates skill: multivariate=0.3640, univariate=0.3534. +- Outcome: Fixed coefficient-one spectral transfer; additive and old-slow-AR replacement are the two predeclared ablations. No optimization. Ensemble selection recorded separately. + +## E114 spectral_replace_delta6k valid_backcast3 +- Checkpoint SHA-256: `b01ff54ba0bd947f4806bd08793288a8202a1c8de153db482666aee3458395ac`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 24.276151657104492 seconds. +- Overall skill 0.385845; relative MASE 0.745123; relative WQL 0.506207. +- term skill: long=0.3948, medium=0.3605, short=0.3918. +- domain skill: Econ/Fin=0.1804, Energy=0.3205, Healthcare=0.2235, Nature=0.4938, Sales=0.4003, Transport=0.5072, Web/CloudOps=0.3888. +- frequency skill: A=0.3630, D=0.4320, H=0.4048, M=0.1164, Q=0.2614, S=0.2715, T=0.4319, W=0.2461. +- variates skill: multivariate=0.3719, univariate=0.3966. +- Outcome: Fixed coefficient-one spectral transfer; additive and old-slow-AR replacement are the two predeclared ablations. No optimization. Ensemble selection recorded separately. + +E115 checks complete: {"seed": 563, "independent_phase_arithmetic": true, "phase_left_padding_invariance": true, "periods_below_two_zero": true, "initial_function_bitwise_equal": true, "inherited_weights_bitwise_equal": true, "sampler_byte_identical": true, "all_parameters_trainable": true, "added_parameters": 65536, "total_parameters": 36866336, "checkpoint_sha256": "70d0fe416fc633d9bd5d8432735ae1725cdf16bcc56824fbd2b973276d90116b", "seconds": 1.7632095960434526, "optimizer_updates": 0, "validation_data_read": false}; GPU {"seed": 569, "gpu_initial_function_bitwise_equal": true, "max_shape": [64, 4096, 1024], "loss": 0.54439777135849, "selected_gradient_norms": {"phase_context.weight": 0.014588589780032635, "phase_query.weight": 0.01659703068435192, "encoder.0.attn.q.weight": 0.002245454117655754, "head.weight": 0.029972484335303307}, "all_parameters_trainable": true, "reserved_mib": 6272.0, "allocated_mib": 5789.81689453125, "includes_ema_and_adam_placeholders": true, "seconds": 125.7952905651182, "optimizer_updates": 0, "validation_data_read": false}. GPU seconds include serialized evaluation-lock wait; no optimizer update or validation read. Zero initialization preserves inherited tensors and forecasts bitwise; both added projections and inherited attention/head receive finite nonzero gradients. Runtime model is identical to the training model. Queue after E79small96000. Publisher documentation now derives frozen-versus-joint phase training from actual lineage; no runtime changes to published packages. + +## E114 fixed spectral transfer ensemble outcomes +{"skill_score": 0.3859105542007717, "rel_mase_gmean": 0.7358684109009667, "rel_wql_gmean": 0.5124636984760504, "groups": {"term": {"short": 0.36841730807118356, "medium": 0.4090050160435663, "long": 0.40716915412299237}, "domain": {"Econ/Fin": 0.14811696868566626, "Energy": 0.24660436752069403, "Healthcare": 0.47910058788021426, "Nature": 0.44240542330694954, "Sales": 0.34307605991799384, "Transport": 0.46771149823781855, "Web/CloudOps": 0.5062219614466995}, "freq": {"A-DEC": 0.37669669863368394, "Q-DEC": 0.200340326472501, "M": 0.11908763465172645, "W-SUN": 0.12532801227165324, "D": 0.36422932549961984, "H": 0.40123365786788323, "15T": 0.21729188974855052, "W-FRI": 0.015453408823068893, "10T": 0.6278668799855711, "W-TUE": 0.6255256773761033, "W-THU": 0.2055099177488643, "W-WED": 0.3287751407658812, "5T": 0.5215363726041493, "10S": 0.42516355809197104}}, "cpu_seconds": 1.0599841580260545, "member_checkpoint_hashes": ["c3dfc433d51355228fc13d04913db1a7edf83030c33283b150bdcc50f5ae6ea2", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "candidate": "spectral_add_delta6k", "cutoff": "valid_screen", "E112skill": 0.3858712532527797, "difference": 3.930094799198258e-05} +{"skill_score": 0.3412336108260463, "rel_mase_gmean": 0.7923075693116662, "rel_wql_gmean": 0.5477331939190134, "groups": {"term": {"short": 0.3082380704419988, "medium": 0.36087755992185644, "long": 0.40256738708364537}, "domain": {"Econ/Fin": 0.17928739133939553, "Energy": 0.23149418505070973, "Healthcare": 0.4142126388904961, "Nature": 0.3739148820510916, "Sales": 0.40499124016503796, "Transport": 0.37331945935003474, "Web/CloudOps": 0.45366968215211745}, "freq": {"A-DEC": 0.32728365516656444, "Q-DEC": 0.236748044898076, "M": 0.19835812917105478, "W-SUN": 0.07360873539461676, "D": 0.35259911130364885, "H": 0.3719231643339844, "15T": 0.2213306919945408, "W-FRI": 0.2288725313306662, "10T": 0.32822175650292673, "W-TUE": 0.559366215155875, "W-THU": 0.25990001317199096, "W-WED": 0.360055735229183, "5T": 0.44455182384807246, "10S": 0.347846510903316}}, "cpu_seconds": 1.0289423430804163, "member_checkpoint_hashes": ["c3dfc433d51355228fc13d04913db1a7edf83030c33283b150bdcc50f5ae6ea2", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "candidate": "spectral_add_delta6k", "cutoff": "valid_backcast", "E112skill": 0.34026453805586865, "difference": 0.0009690727701776591} +{"skill_score": 0.36575134769765616, "rel_mase_gmean": 0.7643280805916521, "rel_wql_gmean": 0.5263071751020174, "groups": {"term": {"short": 0.35313765392056196, "medium": 0.3940145011079407, "long": 0.36928346944084967}, "domain": {"Econ/Fin": 0.1278772851976926, "Energy": 0.24145749844953146, "Healthcare": 0.35086323444911927, "Nature": 0.4791524685105649, "Sales": 0.5547328500628512, "Transport": 0.4250780374879125, "Web/CloudOps": 0.43991341613268353}, "freq": {"A-DEC": 0.33586764940966785, "Q-DEC": 0.15779445087152755, "M": 0.16375055154356122, "W-SUN": 0.08390542109684229, "D": 0.4307789359841945, "H": 0.3948583749831561, "15T": 0.10818558944800316, "W-FRI": 0.15292053290873164, "10T": 0.5107332028367493, "W-TUE": 0.09532113367661221, "W-THU": 0.35588558530569137, "W-WED": 0.5627227566205757, "5T": 0.4760121317899746, "10S": 0.2848510509521789}}, "cpu_seconds": 1.175089841010049, "member_checkpoint_hashes": ["c3dfc433d51355228fc13d04913db1a7edf83030c33283b150bdcc50f5ae6ea2", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "candidate": "spectral_add_delta6k", "cutoff": "valid_backcast2", "E112skill": 0.36500280105746885, "difference": 0.0007485466401873087} +{"skill_score": 0.388763997234149, "rel_mase_gmean": 0.7411269672326161, "rel_wql_gmean": 0.5041099131397703, "groups": {"term": {"short": 0.3936943170093701, "medium": 0.36798445243024747, "long": 0.39615921182618374}, "domain": {"Econ/Fin": 0.1909220354405753, "Energy": 0.31559006097512954, "Healthcare": 0.23199415024755954, "Nature": 0.5039982625361157, "Sales": 0.39988753803404353, "Transport": 0.5093753126309916, "Web/CloudOps": 0.3947283481141741}, "freq": {"A-DEC": 0.3583022117406983, "Q-DEC": 0.2566121509078392, "M": 0.13878112747670346, "W-SUN": 0.17907630757955872, "D": 0.4388632040643935, "H": 0.405288967030186, "15T": 0.2540225780499259, "W-FRI": 0.03649862826525585, "10T": 0.6060275093557081, "W-TUE": 0.26615750127784543, "W-THU": 0.33504744208892767, "W-WED": 0.37704039372015596, "5T": 0.46645862961129225, "10S": 0.29251927680018197}}, "cpu_seconds": 1.1375589109957218, "member_checkpoint_hashes": ["c3dfc433d51355228fc13d04913db1a7edf83030c33283b150bdcc50f5ae6ea2", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "candidate": "spectral_add_delta6k", "cutoff": "valid_backcast3", "E112skill": 0.38948675360484886, "difference": -0.0007227563706998508} +{"skill_score": 0.38538242748882945, "rel_mase_gmean": 0.736575164356215, "rel_wql_gmean": 0.5128529696893745, "groups": {"term": {"short": 0.3675950378502798, "medium": 0.4090321072718678, "long": 0.4068080010769052}, "domain": {"Econ/Fin": 0.1452107005254969, "Energy": 0.24720144190287108, "Healthcare": 0.4773960655138917, "Nature": 0.4411401520810895, "Sales": 0.3422136708191351, "Transport": 0.46776594940797556, "Web/CloudOps": 0.5053750267603281}, "freq": {"A-DEC": 0.3762239031537611, "Q-DEC": 0.19964405404447882, "M": 0.11772763314619139, "W-SUN": 0.11426532226198283, "D": 0.3618358770783556, "H": 0.4012391303794067, "15T": 0.21828910758964182, "W-FRI": 0.0158268795014036, "10T": 0.6269679416145453, "W-TUE": 0.6374273197245699, "W-THU": 0.20444633086852815, "W-WED": 0.3293023694518882, "5T": 0.520446433050282, "10S": 0.4243254373932551}}, "cpu_seconds": 1.0959253669716418, "member_checkpoint_hashes": ["b01ff54ba0bd947f4806bd08793288a8202a1c8de153db482666aee3458395ac", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "candidate": "spectral_replace_delta6k", "cutoff": "valid_screen", "E112skill": 0.3858712532527797, "difference": -0.0004888257639502624} +{"skill_score": 0.3406802195876929, "rel_mase_gmean": 0.7932581807222594, "rel_wql_gmean": 0.5479963313421329, "groups": {"term": {"short": 0.3072113460670465, "medium": 0.3609289231624365, "long": 0.4025228284048611}, "domain": {"Econ/Fin": 0.17519659434666768, "Energy": 0.23205216431370745, "Healthcare": 0.41457631581368715, "Nature": 0.37248553469222323, "Sales": 0.4051051613684693, "Transport": 0.37330292125603537, "Web/CloudOps": 0.4524628983508361}, "freq": {"A-DEC": 0.3247221726362275, "Q-DEC": 0.23679225957378447, "M": 0.19494676959754076, "W-SUN": 0.06360311378805661, "D": 0.35276837361420454, "H": 0.372002261486453, "15T": 0.22209503268624742, "W-FRI": 0.22895441819580886, "10T": 0.3247372972264523, "W-TUE": 0.5627629693024542, "W-THU": 0.2585092983543258, "W-WED": 0.35938474562086387, "5T": 0.4432621496867426, "10S": 0.34700427098942754}}, "cpu_seconds": 1.5319079000037163, "member_checkpoint_hashes": ["b01ff54ba0bd947f4806bd08793288a8202a1c8de153db482666aee3458395ac", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "candidate": "spectral_replace_delta6k", "cutoff": "valid_backcast", "E112skill": 0.34026453805586865, "difference": 0.0004156815318242524} +{"skill_score": 0.3645638328287083, "rel_mase_gmean": 0.7655529003321527, "rel_wql_gmean": 0.5274346454361977, "groups": {"term": {"short": 0.35186763351956485, "medium": 0.39321263800713, "long": 0.3678828400958726}, "domain": {"Econ/Fin": 0.12424108633012076, "Energy": 0.24135890916218927, "Healthcare": 0.35067839600874395, "Nature": 0.4774941308360753, "Sales": 0.5553672377118917, "Transport": 0.42513094655931627, "Web/CloudOps": 0.43686388883653227}, "freq": {"A-DEC": 0.336016644671164, "Q-DEC": 0.1585853880353536, "M": 0.16597963033077545, "W-SUN": 0.07588756093646032, "D": 0.42914434851192584, "H": 0.3951850713687237, "15T": 0.10848567130668929, "W-FRI": 0.15162235166311566, "10T": 0.508604696908483, "W-TUE": 0.08008393561824934, "W-THU": 0.35379846085908884, "W-WED": 0.5621221829283422, "5T": 0.4723996609971295, "10S": 0.28287996534579274}}, "cpu_seconds": 1.1693297398742288, "member_checkpoint_hashes": ["b01ff54ba0bd947f4806bd08793288a8202a1c8de153db482666aee3458395ac", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "candidate": "spectral_replace_delta6k", "cutoff": "valid_backcast2", "E112skill": 0.36500280105746885, "difference": -0.0004389682287605501} +{"skill_score": 0.3887657720103035, "rel_mase_gmean": 0.7410046782980017, "rel_wql_gmean": 0.504190179101556, "groups": {"term": {"short": 0.3936432761250075, "medium": 0.3675850585692205, "long": 0.3967135529057608}, "domain": {"Econ/Fin": 0.18838704424082175, "Energy": 0.31576821178040126, "Healthcare": 0.23963002301962777, "Nature": 0.5044876407125312, "Sales": 0.39975495300854236, "Transport": 0.5088397838295604, "Web/CloudOps": 0.393445049293746}, "freq": {"A-DEC": 0.3588124703265817, "Q-DEC": 0.2560486792582567, "M": 0.1429024757751649, "W-SUN": 0.1749136920607539, "D": 0.4382471228895556, "H": 0.4056385181220228, "15T": 0.2544805853997113, "W-FRI": 0.0366545562900642, "10T": 0.606714665207392, "W-TUE": 0.27687389203140456, "W-THU": 0.33308740205358955, "W-WED": 0.37665824463477027, "5T": 0.465156868376136, "10S": 0.29156742693850557}}, "cpu_seconds": 1.2852319721132517, "member_checkpoint_hashes": ["b01ff54ba0bd947f4806bd08793288a8202a1c8de153db482666aee3458395ac", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "candidate": "spectral_replace_delta6k", "cutoff": "valid_backcast3", "E112skill": 0.38948675360484886, "difference": -0.0007209815945453668} +Additive wins three cutoffs over replacement and ties the fourth within0.000002. Versus publishedE112, additive gains main0.000039301,firstearlier0.000969073,secondearlier0.000748547 and loses thirdearlier0.000722756. Select additive for one full public replay. Reject replacement; do not tune a coefficient. Total two-ablation suite623.425876410wallseconds includes evaluation-lock waits; zero optimizer updates. Merge CPU times1.420432522 and1.159398519seconds; candidate hashes in spectral_transfer_receipt.json. + +## E107 sixteen-cycle learned summaries at1000 +- Checkpoint SHA-256: `31a9cdfb13341bf068d62dcd67df55a48ecc8f539676fc9aa18b17a87967aaaf`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 27.538329362869263 seconds. +- Overall skill 0.378727; relative MASE 0.742222; relative WQL 0.520032. +- term skill: long=0.4007, medium=0.4068, short=0.3589. +- domain skill: Econ/Fin=0.1331, Energy=0.2370, Healthcare=0.4629, Nature=0.4319, Sales=0.3365, Transport=0.4721, Web/CloudOps=0.4995. +- frequency skill: A=0.3659, D=0.3628, H=0.3966, M=0.1077, Q=0.1987, S=0.4237, T=0.4357, W=0.2244. +- variates skill: multivariate=0.3931, univariate=0.3671. +- Outcome: First skill0.378727349 exceeds matched E80at1000 0.376804394 by0.001922954. Initial function was preserved; whole model and new query/head train jointly. Continue declared3000/6000/12000 and earlier-cutoff diagnostics before selection. + +## E79 fresh37M at72000 +- Checkpoint SHA-256: `8439114a6db9c3441824266cca82575413c81d4d06843f89c3ce365220bdd491`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.264113903045654 seconds. +- Overall skill 0.368966; relative MASE 0.753206; relative WQL 0.528678. +- term skill: long=0.3954, medium=0.3943, short=0.3484. +- domain skill: Econ/Fin=0.1436, Energy=0.2321, Healthcare=0.4098, Nature=0.4180, Sales=0.3528, Transport=0.4585, Web/CloudOps=0.4929. +- frequency skill: A=0.3884, D=0.3520, H=0.3888, M=0.0702, Q=0.2092, S=0.4184, T=0.4268, W=0.2065. +- variates skill: multivariate=0.3853, univariate=0.3556. +- Outcome: Skill0.368966239 improves over48000 0.366772722 by0.002193517. Still below the mature trained lineage. Keep the declared96000schedule; earlier cooldown lost its final matched comparison. No new learning-rate changes or model selection yet. + +Fresh capacity compute audit at 2026-10-23T06:30:58Z: capacity_learning_curves.json/csv join each measured checkpoint report to its actual training log, with no inferred missing times. Latest selected checkpoints: random_capacity_512 seed307 step72000 logged shared-H100 loop9277.7seconds; random_capacity_1024 seed307 step24000 logged shared-H100 loop6492.7seconds; random_capacity_1024_halflr seed307 step24000 logged shared-H100 loop5576.8seconds; All original96k schedules unchanged. No new optimization or inference in this audit. + +## E114 additive spectral ensemble full public replay — selected +- Checkpoint SHA-256: `9a31b69cbb9c32bdc51541d93b569334a408445233579f43935adc92072526bc`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.382197; relative MASE 0.738486; relative WQL 0.516841. +- term skill: long=0.4013, medium=0.4079, short=0.3645. +- domain skill: Econ/Fin=0.1297, Energy=0.2401, Healthcare=0.4846, Nature=0.4425, Sales=0.3573, Transport=0.4679, Web/CloudOps=0.4980. +- frequency skill: A=0.2970, D=0.3687, H=0.3959, M=0.1449, Q=0.1880, S=0.4252, T=0.4390, W=0.2388. +- variates skill: multivariate=0.3963, univariate=0.3708. +- Outcome: Full0.382197314 exceeds E1120.382143195 by0.000054118. All97configs151170instances passed. Relocation and independent fixed-average composition checks passed. Three diagnostic gains and one regression; tiny full improvement is validation selection, not held-out significance. + +E114 complete public suite {"package": "/workspace/research/candidate-spectral-add-ensemble", "status": "complete", "steps": [{"name": "relocation", "returncode": 0, "seconds": 31.251009764848277}, {"name": "full_public_replay", "returncode": 0, "seconds": 333.7630249520298}, {"name": "independent_spectral_replay", "returncode": 0, "seconds": 72.58775101904757}, {"name": "composition", "returncode": 0, "seconds": 0.2565292678773403}, {"name": "descriptive_comparison", "returncode": 0, "seconds": 0.17433986882679164}], "current_step": "descriptive_comparison", "seconds": 438.11250560800545, "skill": 0.3821973136018404}. Descriptive comparison {"candidate": "/workspace/research/valid-report-spectral-add-ensemble.json", "parent": "/workspace/research/valid-report-weekly-slow12-ensemble.json", "candidate_hash": "9a31b69cbb9c32bdc51541d93b569334a408445233579f43935adc92072526bc", "parent_hash": "f01498eb73e4aa0539e81c67a8a80e56af47d1437f4d65ecc882d551468241a1", "skill_difference": 5.4118499018707134e-05, "n_configs": 97, "n_dataset_clusters": 28, "improved_configs": 53, "bootstrap_seed": 317, "bootstrap_samples": 5000, "dataset_cluster_delta_percentiles": {"p025": -0.0012920618845766562, "p50": 6.553719107660338e-05, "p975": 0.001266637510104884}, "note": "Descriptive resampling only. Adaptive validation selection and reused windows prevent treating this as a held-out significance test."}. +Provenance repair before publication: the old hard-coded archive filename list omitted spectral.py and recovery/schedules.py. The publisher now archives every Python module in each explicitly declared trainer directory and records their hashes. Reassembled three source packages with complete archives:81/61/67modules. Every runtime-code hash and weight hash is identical to its replayed source package; no inference behavior changed and no extra forecast run was required. Candidate package in the full replay remains immutable. + +## E101 own-ensemble distillation first4000 +- Checkpoint SHA-256: `907bbfc1252d0f62e5be920598b4579ab2576009a357c20d9e0d0f3328fe41b3`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 35.88508892059326 seconds. +- Overall skill 0.347881; relative MASE 0.772644; relative WQL 0.550395. +- term skill: long=0.3742, medium=0.3899, short=0.3205. +- domain skill: Econ/Fin=0.1324, Energy=0.2134, Healthcare=0.2766, Nature=0.4049, Sales=0.3337, Transport=0.4471, Web/CloudOps=0.4785. +- frequency skill: A=0.3694, D=0.3330, H=0.3712, M=-0.0892, Q=0.1903, S=0.4170, T=0.4063, W=0.2105. +- variates skill: multivariate=0.3681, univariate=0.3314. +- Outcome: Skill0.347881090 exceeds matched E94at4000 0.336895196 by0.010985894 and slightly exceeds E94at8000 0.347153427. This is forecast validation, not the teacher-augmented training loss. Same own random146M initialization/seed307/B48/LR1e-4; only the declared frozen E96raw-neural teacher auxiliary differs. Keep the teacher/coefficient and96000schedule unchanged; next matched screen8000. + +## E107 sixteen-cycle learned summaries at3000 +- Checkpoint SHA-256: `92e575ca3cb053d9bdf75a010d83ded0025fe97c906fb9930c74dc1a28e1e892`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 27.18501567840576 seconds. +- Overall skill 0.381751; relative MASE 0.739110; relative WQL 0.517152. +- term skill: long=0.4051, medium=0.4080, short=0.3621. +- domain skill: Econ/Fin=0.1362, Energy=0.2403, Healthcare=0.4508, Nature=0.4350, Sales=0.3352, Transport=0.4748, Web/CloudOps=0.5063. +- frequency skill: A=0.3677, D=0.3668, H=0.4009, M=0.1024, Q=0.1977, S=0.4243, T=0.4398, W=0.2205. +- variates skill: multivariate=0.3984, univariate=0.3682. +- Outcome: Skill0.381750592 exceeds E80at3000 0.378663825 by0.003086767, following the1000gain. Run all three earlier cutoffs before any transfer or publication. New seasonal query/head learned jointly with the original model from the function-preserving E62 initialization; no runtime rule change. + +## E107 sixteen-cycle summaries3000 valid_backcast +- Checkpoint SHA-256: `92e575ca3cb053d9bdf75a010d83ded0025fe97c906fb9930c74dc1a28e1e892`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 26.551977157592773 seconds. +- Overall skill 0.339635; relative MASE 0.793581; relative WQL 0.549512. +- term skill: long=0.4013, medium=0.3614, short=0.3056. +- domain skill: Econ/Fin=0.1561, Energy=0.2309, Healthcare=0.3961, Nature=0.3764, Sales=0.4008, Transport=0.3807, Web/CloudOps=0.4508. +- frequency skill: A=0.3131, D=0.3627, H=0.3730, M=0.1797, Q=0.2320, S=0.3414, T=0.3350, W=0.2818. +- variates skill: multivariate=0.3548, univariate=0.3273. +- Outcome: E1073000 improves all four matched cutoffs versus E80: main0.381750592 vs0.378663825; earlier0.339634914/0.361559427/0.392953200 vs0.336119626/0.358234785/0.388791691. Strongest observed consistent feature result in this round. Continue declared6000/12000; predeclare a coefficient-one transfer to the current first ensemble member. + +## E107 sixteen-cycle summaries3000 valid_backcast2 +- Checkpoint SHA-256: `92e575ca3cb053d9bdf75a010d83ded0025fe97c906fb9930c74dc1a28e1e892`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 25.749686002731323 seconds. +- Overall skill 0.361559; relative MASE 0.768149; relative WQL 0.530634. +- term skill: long=0.3661, medium=0.3924, short=0.3475. +- domain skill: Econ/Fin=0.1055, Energy=0.2372, Healthcare=0.3468, Nature=0.4779, Sales=0.5514, Transport=0.4272, Web/CloudOps=0.4325. +- frequency skill: A=0.3541, D=0.4282, H=0.3964, M=0.1616, Q=0.1507, S=0.2837, T=0.3600, W=0.2592. +- variates skill: multivariate=0.3654, univariate=0.3584. +- Outcome: E1073000 improves all four matched cutoffs versus E80: main0.381750592 vs0.378663825; earlier0.339634914/0.361559427/0.392953200 vs0.336119626/0.358234785/0.388791691. Strongest observed consistent feature result in this round. Continue declared6000/12000; predeclare a coefficient-one transfer to the current first ensemble member. + +## E107 sixteen-cycle summaries3000 valid_backcast3 +- Checkpoint SHA-256: `92e575ca3cb053d9bdf75a010d83ded0025fe97c906fb9930c74dc1a28e1e892`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 24.80188488960266 seconds. +- Overall skill 0.392953; relative MASE 0.731991; relative WQL 0.503429. +- term skill: long=0.3993, medium=0.3624, short=0.4017. +- domain skill: Econ/Fin=0.1691, Energy=0.3244, Healthcare=0.2777, Nature=0.5077, Sales=0.4044, Transport=0.5103, Web/CloudOps=0.3919. +- frequency skill: A=0.3641, D=0.4523, H=0.4083, M=0.1380, Q=0.2600, S=0.2876, T=0.4311, W=0.2621. +- variates skill: multivariate=0.3774, univariate=0.4049. +- Outcome: E1073000 improves all four matched cutoffs versus E80: main0.381750592 vs0.378663825; earlier0.339634914/0.361559427/0.392953200 vs0.336119626/0.358234785/0.388791691. Strongest observed consistent feature result in this round. Continue declared6000/12000; predeclare a coefficient-one transfer to the current first ensemble member. + +## E116 matched long-seasonal feature transfer — predeclared +E1073000 improves all four matched cutoffs over E80 by about0.0031/0.0035/0.0033/0.0042. Test complementarity with the current E114firstmember using exactly extend_zero(spectral_add_delta6k) + E107EMA3000 - extend_zero(E80EMA3000), coefficient1. Extend the base and control with the same three zero-initialized long_query/long_head tensors; copy the candidate's new tensors and add candidate-control differences to every shared tensor. The zero-extended base must preserve forecasts bitwise before transfer. Check keys/config/shapes, finite merged weights, parent hashes and explicit arithmetic; CPU fixture seed571, no optimizer updates or validation data in conversion. Preserve all inference rules and the equal1/3 other membersE71patch8_6000/E93split_12000. Evaluate standalone and the fixed ensemble at all four cutoffs, then require complete public replay/relocation/independent composition before any publication. No coefficient or per-instance rule search. + +## E116 long-seasonal matched transfer3000 valid_screen +- Checkpoint SHA-256: `23b775110747f72747a342fb2282366c2a7d7ae74bfab2137d4c6e38df99dc0a`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 27.276195764541626 seconds. +- Overall skill 0.385452; relative MASE 0.734312; relative WQL 0.514317. +- term skill: long=0.4073, medium=0.4087, short=0.3677. +- domain skill: Econ/Fin=0.1474, Energy=0.2410, Healthcare=0.4699, Nature=0.4427, Sales=0.3383, Transport=0.4712, Web/CloudOps=0.5106. +- frequency skill: A=0.3775, D=0.3705, H=0.4046, M=0.0994, Q=0.2071, S=0.4258, T=0.4438, W=0.2263. +- variates skill: multivariate=0.4004, univariate=0.3733. +- Outcome: Fixed coefficient-one zero-extended E1073000-E80control3000 transfer onto E114firstmember; no optimizer update. Ensemble selection recorded separately. + +## E116 long-seasonal matched transfer3000 valid_backcast +- Checkpoint SHA-256: `23b775110747f72747a342fb2282366c2a7d7ae74bfab2137d4c6e38df99dc0a`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 27.110499620437622 seconds. +- Overall skill 0.342024; relative MASE 0.789652; relative WQL 0.548257. +- term skill: long=0.3991, medium=0.3634, short=0.3102. +- domain skill: Econ/Fin=0.1785, Energy=0.2289, Healthcare=0.3769, Nature=0.3859, Sales=0.4015, Transport=0.3788, Web/CloudOps=0.4575. +- frequency skill: A=0.3232, D=0.3572, H=0.3764, M=0.1959, Q=0.2304, S=0.3395, T=0.3380, W=0.2889. +- variates skill: multivariate=0.3578, univariate=0.3292. +- Outcome: Fixed coefficient-one zero-extended E1073000-E80control3000 transfer onto E114firstmember; no optimizer update. Ensemble selection recorded separately. + +## E110 fresh146M full corpus first4000 +- Checkpoint SHA-256: `687830f4718f327cbbc64dbf00233a78035447e3a3c46015bc45b9496d8bec0e`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 36.46506428718567 seconds. +- Overall skill 0.337869; relative MASE 0.781543; relative WQL 0.560964. +- term skill: long=0.3669, medium=0.3753, short=0.3113. +- domain skill: Econ/Fin=0.1151, Energy=0.2150, Healthcare=0.2791, Nature=0.4107, Sales=0.2977, Transport=0.4192, Web/CloudOps=0.4616. +- frequency skill: A=0.3312, D=0.3394, H=0.3632, M=-0.0643, Q=0.1689, S=0.4240, T=0.3860, W=0.1775. +- variates skill: multivariate=0.3630, univariate=0.3171. +- Outcome: Skill0.337869059 exceeds matched E94oldpack4000 0.336895196 by0.000973864. This changes corpus coverage and volume together with original source probabilities fixed. Small initial gain; continue scheduled8000/16000 before deciding on any interaction with distillation or more capacity. + +E116 conversion/check receipt: {"method": "matched training delta after zero extension of new seasonal query/head parameters", "formula": "extend_zero(base) + candidate - extend_zero(control)", "coefficient": 1.0, "new_parameters_from_candidate": ["long_head.bias", "long_head.weight", "long_query.weight"], "parent_hashes": {"/workspace/research/spectral_add_delta6k.pt": "c3dfc433d51355228fc13d04913db1a7edf83030c33283b150bdcc50f5ae6ea2", "/workspace/research/runs/long_seasonal/ema003000.pt": "92e575ca3cb053d9bdf75a010d83ded0025fe97c906fb9930c74dc1a28e1e892", "/workspace/research/runs/overflow_control/ema003000.pt": "2084f1888f8d9e5afe2c740769ea2b4167086cdd62dfb4014bc3a338c00d4c12"}, "base_extension_forward_bitwise_equal": true, "check_seed": 571, "seconds": 2.1952822851017118, "optimizer_updates": 0, "validation_data_read": false, "checkpoint_sha256": "23b775110747f72747a342fb2282366c2a7d7ae74bfab2137d4c6e38df99dc0a", "parameters": 36849984}. Shared forward implementations were also compared: overflow_control and E114postloss_inference differ only inside the unused training loss function; forecast class is identical. No runtime mismatch introduced by the base-extension audit. + +## E116 long-seasonal matched transfer3000 valid_backcast2 +- Checkpoint SHA-256: `23b775110747f72747a342fb2282366c2a7d7ae74bfab2137d4c6e38df99dc0a`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 25.600340604782104 seconds. +- Overall skill 0.364198; relative MASE 0.765491; relative WQL 0.528085. +- term skill: long=0.3700, medium=0.3935, short=0.3503. +- domain skill: Econ/Fin=0.1339, Energy=0.2393, Healthcare=0.3008, Nature=0.4830, Sales=0.5489, Transport=0.4261, Web/CloudOps=0.4427. +- frequency skill: A=0.3494, D=0.4268, H=0.3979, M=0.1404, Q=0.1534, S=0.2812, T=0.3700, W=0.2612. +- variates skill: multivariate=0.3706, univariate=0.3590. +- Outcome: Fixed coefficient-one zero-extended E1073000-E80control3000 transfer onto E114firstmember; no optimizer update. Ensemble selection recorded separately. + +## E116 long-seasonal matched transfer3000 valid_backcast3 +- Checkpoint SHA-256: `23b775110747f72747a342fb2282366c2a7d7ae74bfab2137d4c6e38df99dc0a`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 25.46401309967041 seconds. +- Overall skill 0.389892; relative MASE 0.740054; relative WQL 0.502979. +- term skill: long=0.3954, medium=0.3628, short=0.3977. +- domain skill: Econ/Fin=0.1867, Energy=0.3231, Healthcare=0.2223, Nature=0.4962, Sales=0.4052, Transport=0.5141, Web/CloudOps=0.3942. +- frequency skill: A=0.3640, D=0.4445, H=0.4080, M=0.1294, Q=0.2645, S=0.2754, T=0.4321, W=0.2475. +- variates skill: multivariate=0.3746, univariate=0.4017. +- Outcome: Fixed coefficient-one zero-extended E1073000-E80control3000 transfer onto E114firstmember; no optimizer update. Ensemble selection recorded separately. + +## E116 fixed three-member ensemble four-cutoff results +{"skill_score": 0.38720541337659986, "rel_mase_gmean": 0.7342507813740501, "rel_wql_gmean": 0.5114290851583633, "groups": {"term": {"short": 0.3700839213601874, "medium": 0.40957250804893053, "long": 0.40827611548402953}, "domain": {"Econ/Fin": 0.14908608660199785, "Energy": 0.24714375369431862, "Healthcare": 0.4787534904014933, "Nature": 0.4440184955426868, "Sales": 0.3442242595915186, "Transport": 0.4710390859143697, "Web/CloudOps": 0.5070560078179032}, "freq": {"A-DEC": 0.3765552064197536, "Q-DEC": 0.2007920342778422, "M": 0.11880155273345816, "W-SUN": 0.1264948417953352, "D": 0.36884318033535124, "H": 0.40281260223169946, "15T": 0.21749181645510862, "W-FRI": 0.015285001640822693, "10T": 0.6279931658141638, "W-TUE": 0.6163675116775146, "W-THU": 0.2084538535547953, "W-WED": 0.32879841207319593, "5T": 0.5222434535959196, "10S": 0.42555374873861473}}, "cpu_seconds": 1.8546344628557563, "member_checkpoint_hashes": ["23b775110747f72747a342fb2282366c2a7d7ae74bfab2137d4c6e38df99dc0a", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cutoff": "valid_screen", "E114skill": 0.3859105542007717, "difference": 0.001294859175828167} +{"skill_score": 0.3427206795875515, "rel_mase_gmean": 0.7906423475529908, "rel_wql_gmean": 0.5464115429421713, "groups": {"term": {"short": 0.3098546944929881, "medium": 0.3621091931043331, "long": 0.403988714940432}, "domain": {"Econ/Fin": 0.17965067851574157, "Energy": 0.2326316747235092, "Healthcare": 0.4068086635720405, "Nature": 0.37873253762946857, "Sales": 0.4075537380987566, "Transport": 0.37635767380141383, "Web/CloudOps": 0.45437737080841945}, "freq": {"A-DEC": 0.3272530340462253, "Q-DEC": 0.23755513606501621, "M": 0.19617972821818674, "W-SUN": 0.07381440729472832, "D": 0.35641808245133066, "H": 0.3746335453552856, "15T": 0.22156520469438523, "W-FRI": 0.2285171150198988, "10T": 0.32790408335401755, "W-TUE": 0.5487565883106209, "W-THU": 0.26369997407283086, "W-WED": 0.360495064206409, "5T": 0.44527223827225215, "10S": 0.34795150353597804}}, "cpu_seconds": 1.4879765149671584, "member_checkpoint_hashes": ["23b775110747f72747a342fb2282366c2a7d7ae74bfab2137d4c6e38df99dc0a", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cutoff": "valid_backcast", "E114skill": 0.3412336108260463, "difference": 0.0014870687615051725} +{"skill_score": 0.3671371671308241, "rel_mase_gmean": 0.7627223884596792, "rel_wql_gmean": 0.5251128999058764, "groups": {"term": {"short": 0.35442618611968046, "medium": 0.39594551851033577, "long": 0.3703088425246239}, "domain": {"Econ/Fin": 0.12773114801545526, "Energy": 0.2420703081614609, "Healthcare": 0.3503190659637698, "Nature": 0.48266906273662424, "Sales": 0.5556522652473174, "Transport": 0.42748257591759653, "Web/CloudOps": 0.4404570123243067}, "freq": {"A-DEC": 0.33580577495994546, "Q-DEC": 0.1582829183514055, "M": 0.16797269143179927, "W-SUN": 0.08432615590486037, "D": 0.43228327170696623, "H": 0.39712101579766446, "15T": 0.1083039694235629, "W-FRI": 0.15224002631060463, "10T": 0.5116096591114121, "W-TUE": 0.10029684309090381, "W-THU": 0.35590715421034425, "W-WED": 0.5629822534882516, "5T": 0.47636409225147436, "10S": 0.2857396389239164}}, "cpu_seconds": 1.1572973690927029, "member_checkpoint_hashes": ["23b775110747f72747a342fb2282366c2a7d7ae74bfab2137d4c6e38df99dc0a", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cutoff": "valid_backcast2", "E114skill": 0.36575134769765616, "difference": 0.0013858194331679563} +{"skill_score": 0.3902787157172325, "rel_mase_gmean": 0.7392609091902026, "rel_wql_gmean": 0.5028807013678822, "groups": {"term": {"short": 0.3956114073839023, "medium": 0.3687662234436596, "long": 0.3972699880915276}, "domain": {"Econ/Fin": 0.19055643421598678, "Energy": 0.3170395049778194, "Healthcare": 0.2375244592154213, "Nature": 0.5052031712338959, "Sales": 0.40168219976171715, "Transport": 0.511473215788659, "Web/CloudOps": 0.39553570955988127}, "freq": {"A-DEC": 0.35850397733087536, "Q-DEC": 0.25725670014643276, "M": 0.1465996371340087, "W-SUN": 0.1773439469690138, "D": 0.44211913796350977, "H": 0.4070414678036135, "15T": 0.2546177459094544, "W-FRI": 0.03688784934804279, "10T": 0.6055501765507136, "W-TUE": 0.27303119495126527, "W-THU": 0.33344051421477383, "W-WED": 0.37619790832892397, "5T": 0.46709627787109553, "10S": 0.2930890553634443}}, "cpu_seconds": 1.1736454339697957, "member_checkpoint_hashes": ["23b775110747f72747a342fb2282366c2a7d7ae74bfab2137d4c6e38df99dc0a", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cutoff": "valid_backcast3", "E114skill": 0.388763997234149, "difference": 0.0015147184830834881} +All four improve: main+0.001294859,earlier1+0.001487069,earlier2+0.001385819,earlier3+0.001514718. Select exactly this coefficient-one three-member package for full public replay. Added49184parameters in firstmember; no change to fixed rules or ensemble weights, no further coefficient search. + +## E107 sixteen-cycle learned summaries at6000 +- Checkpoint SHA-256: `ad45e0cfae574d3dc1be0b9720c9be0863db9ffe33891fdb22c86dfa83667253`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 28.15697693824768 seconds. +- Overall skill 0.382275; relative MASE 0.739038; relative WQL 0.516326. +- term skill: long=0.4050, medium=0.4082, short=0.3631. +- domain skill: Econ/Fin=0.1279, Energy=0.2411, Healthcare=0.4596, Nature=0.4341, Sales=0.3406, Transport=0.4765, Web/CloudOps=0.5056. +- frequency skill: A=0.3682, D=0.3698, H=0.4004, M=0.1080, Q=0.1932, S=0.4259, T=0.4395, W=0.2214. +- variates skill: multivariate=0.3987, univariate=0.3689. +- Outcome: Main0.382274667 exceeds matched E80at6000 0.378288765 by0.003985903 and E107at3000 by0.000524075. Continue the declared final12000. Earlier-cutoff checks precede any new duration transfer; E1163000transfer is in full validation. + +## Validation coverage diagnostic on E114, no candidate calibration rule +Hypothesis: check whether interval errors show a broad common scaling direction before considering a fixed calibration change. No changed model factor, optimizer update, fitting or new inference; deterministic CPU analysis of the completed public replay,1.366043157seconds,checkpoint9a31b69cbb9c32bdc51541d93b569334a408445233579f43935adc92072526bc. Strict and inclusive coverage are reported separately to account for exact-zero/discrete atoms; equal configuration weights. Strict=[0.09649615502089019, 0.17808724598272557, 0.2561047718942836, 0.3396853273325143, 0.42947219602440895, 0.5244340215216663, 0.6224077059098905, 0.7293349801457444, 0.8349448227403538]; inclusive=[0.18646994735201108, 0.26716067726233894, 0.3442348151253366, 0.4263376847833035, 0.5138603926323156, 0.6012624616842667, 0.6942390398914879, 0.7962815528178204, 0.8967020109729391]. Mean per-config distance outside the nominal quantile bracket=0.07068066327514765; term deviations={"long": 0.06334532807343082, "medium": 0.05332049010856118, "short": 0.08010985737940889}. Overall coverage brackets contain most nominal levels; upper levels show only slight aggregate undercoverage. Per-config deviations mix finite-sample noise, bias and nonstationarity. No universal interval rescaling is supported or selected. Full descriptive output spectral_add_ensemble_coverage.json; analysis code recovery/quantile_coverage.py. + +## E116 long-seasonal3000 ensemble full public replay — selected +- Checkpoint SHA-256: `d5320aa1bc1d23983eb3f438d4ab3171de0b5d8afe93846fb853acd99629d092`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.383511; relative MASE 0.736870; relative WQL 0.515774. +- term skill: long=0.4024, medium=0.4084, short=0.3662. +- domain skill: Econ/Fin=0.1307, Energy=0.2407, Healthcare=0.4843, Nature=0.4441, Sales=0.3584, Transport=0.4712, Web/CloudOps=0.4989. +- frequency skill: A=0.2969, D=0.3733, H=0.3975, M=0.1446, Q=0.1892, S=0.4256, T=0.4394, W=0.2377. +- variates skill: multivariate=0.3969, univariate=0.3726. +- Outcome: Full0.383511269 exceeds E1140.382197314 by0.001313955. All97configs151170instances passed. All four diagnostic cutoffs improve. Relocation and independent fixed-average composition checks pass. Validation selection only; no held-out reward claim. + +E116 complete public suite {"package": "/workspace/research/candidate-long-seasonal3-ensemble", "status": "complete", "steps": [{"name": "relocation", "returncode": 0, "seconds": 30.231913516065106}, {"name": "full_public_replay", "returncode": 0, "seconds": 386.0414331450593}, {"name": "independent_long_seasonal_replay", "returncode": 0, "seconds": 36.198165599955246}, {"name": "composition", "returncode": 0, "seconds": 0.30810956098139286}, {"name": "descriptive_comparison", "returncode": 0, "seconds": 0.19051235518418252}], "current_step": "descriptive_comparison", "seconds": 452.98110670782626, "skill": 0.3835112690884035}. Descriptive comparison {"candidate": "/workspace/research/valid-report-long-seasonal3-ensemble.json", "parent": "/workspace/research/valid-report-spectral-add-ensemble.json", "candidate_hash": "d5320aa1bc1d23983eb3f438d4ab3171de0b5d8afe93846fb853acd99629d092", "parent_hash": "9a31b69cbb9c32bdc51541d93b569334a408445233579f43935adc92072526bc", "skill_difference": 0.001313955486563101, "n_configs": 97, "n_dataset_clusters": 28, "improved_configs": 70, "bootstrap_seed": 317, "bootstrap_samples": 5000, "dataset_cluster_delta_percentiles": {"p025": 0.0005376346973493762, "p50": 0.0013050301765117345, "p975": 0.002204697056569243}, "note": "Descriptive resampling only. Adaptive validation selection and reused windows prevent treating this as a held-out significance test."}. Publish with identical runtime/weight hashes. Firstmember adds49184learned seasonal query/head parameters; all three members forecast every instance with fixed equal weights. E101teacher remains E96. + +## E107 sixteen-cycle summaries6000 valid_backcast +- Checkpoint SHA-256: `ad45e0cfae574d3dc1be0b9720c9be0863db9ffe33891fdb22c86dfa83667253`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 26.52558135986328 seconds. +- Overall skill 0.339853; relative MASE 0.793528; relative WQL 0.549186. +- term skill: long=0.4027, medium=0.3608, short=0.3056. +- domain skill: Econ/Fin=0.1478, Energy=0.2308, Healthcare=0.3866, Nature=0.3818, Sales=0.4043, Transport=0.3807, Web/CloudOps=0.4514. +- frequency skill: A=0.3114, D=0.3658, H=0.3746, M=0.1689, Q=0.2379, S=0.3419, T=0.3334, W=0.2824. +- variates skill: multivariate=0.3553, univariate=0.3273. +- Outcome: Allfour6000scores exceed both the matched E80control and E1073000. Main0.382274667,earlier0.339852539/0.363254728/0.394498411. Matched E80 gaps about0.003986/0.004696/0.003549/0.004831. E117 tests the fixed transfer duration, retaining E114as the unchanged zero-extended base. + +## E107 sixteen-cycle summaries6000 valid_backcast2 +- Checkpoint SHA-256: `ad45e0cfae574d3dc1be0b9720c9be0863db9ffe33891fdb22c86dfa83667253`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 25.47639751434326 seconds. +- Overall skill 0.363255; relative MASE 0.765724; relative WQL 0.529492. +- term skill: long=0.3665, medium=0.3958, short=0.3490. +- domain skill: Econ/Fin=0.0929, Energy=0.2388, Healthcare=0.3619, Nature=0.4815, Sales=0.5514, Transport=0.4275, Web/CloudOps=0.4336. +- frequency skill: A=0.3460, D=0.4300, H=0.3971, M=0.1795, Q=0.1488, S=0.2836, T=0.3617, W=0.2611. +- variates skill: multivariate=0.3659, univariate=0.3611. +- Outcome: Allfour6000scores exceed both the matched E80control and E1073000. Main0.382274667,earlier0.339852539/0.363254728/0.394498411. Matched E80 gaps about0.003986/0.004696/0.003549/0.004831. E117 tests the fixed transfer duration, retaining E114as the unchanged zero-extended base. + +## E107 sixteen-cycle summaries6000 valid_backcast3 +- Checkpoint SHA-256: `ad45e0cfae574d3dc1be0b9720c9be0863db9ffe33891fdb22c86dfa83667253`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 26.297444581985474 seconds. +- Overall skill 0.394498; relative MASE 0.730199; relative WQL 0.502099. +- term skill: long=0.3995, medium=0.3628, short=0.4041. +- domain skill: Econ/Fin=0.1617, Energy=0.3232, Healthcare=0.3074, Nature=0.5097, Sales=0.4041, Transport=0.5118, Web/CloudOps=0.3930. +- frequency skill: A=0.3574, D=0.4564, H=0.4093, M=0.1720, Q=0.2585, S=0.2910, T=0.4288, W=0.2635. +- variates skill: multivariate=0.3764, univariate=0.4084. +- Outcome: Allfour6000scores exceed both the matched E80control and E1073000. Main0.382274667,earlier0.339852539/0.363254728/0.394498411. Matched E80 gaps about0.003986/0.004696/0.003549/0.004831. E117 tests the fixed transfer duration, retaining E114as the unchanged zero-extended base. + +## E117 duration of the learned seasonal correction — predeclared +E1163000transfer improves all four diagnostic cutoffs and full replay. E1076000 now improves all four standalone cutoffs over both its3000checkpoint and matched E80control. Complete the duration comparison at6000 and the already scheduled final12000, using exactly the same zero-extended base spectral_add_delta6k (E114firstmember), matching candidate/control checkpoints at each duration, coefficient1, and E71patch8_6000/E93split_12000 as unchanged equal-weight ensemble members. Do not add the new duration on top of E116's already-added3000correction. Each merged candidate gets all four diagnostics; full public replay and checks required for publication. No coefficient or intermediate-checkpoint sweep; no optimizer updates in transfer. The12000arm waits for E107's planned completion. + +## E117 long-seasonal matched transfer6000 valid_screen +- Checkpoint SHA-256: `02ac8f37ed3a54fb12b209f6d8d9eb64e01a5cb862dc63f77ab8e3f8633a4c44`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 70.3311378955841 seconds. +- Overall skill 0.386484; relative MASE 0.733317; relative WQL 0.513287. +- term skill: long=0.4079, medium=0.4093, short=0.3690. +- domain skill: Econ/Fin=0.1470, Energy=0.2417, Healthcare=0.4724, Nature=0.4438, Sales=0.3382, Transport=0.4729, Web/CloudOps=0.5114. +- frequency skill: A=0.3771, D=0.3739, H=0.4062, M=0.0986, Q=0.2068, S=0.4262, T=0.4439, W=0.2255. +- variates skill: multivariate=0.4014, univariate=0.3743. +- Outcome: Fixed coefficient-one zero-extended E1076000-E80control6000 transfer onto E114firstmember; no optimizer update. Ensemble selection recorded separately. + +## E118 independent-seed replication of learned seasonal summaries — predeclared +E107seed197 improves all four cutoffs at3000and6000; E116transfer improves full validation by0.001313955 across70of97configurations. Replicate the feature treatment at independent seed523, reusing the already-planned E111weekly_replication_control as the exactly matched control. Candidate initializes from the same function-preserving long_seasonal_initial (ownE62 plus49184zero parameters), with original packed_sample/source probabilities/generator, seed523/B64/LR2e-5/12000/paired loss and horizon seed300526. Train all parameters. The only factor versus E111control is the same16-cycle learned summaries; no weekly replacement or other synthetic change. Primary comparison6000;1000/3000diagnostic and12000durability. Require all earlier cutoffs before any transfer/averaging decision; no new model-soup rule declared. Reuse E107's exact initialization, arithmetic and maximum-shape GPU audits because model/sampler/batch are unchanged; verify sampler byte identity and initial checkpoint hash before queueing after E113lowfreq_windows14975. This adds one candidate run, no second control or supplied-baseline retraining. + +## E117 long-seasonal matched transfer6000 valid_backcast +- Checkpoint SHA-256: `02ac8f37ed3a54fb12b209f6d8d9eb64e01a5cb862dc63f77ab8e3f8633a4c44`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 33.026755571365356 seconds. +- Overall skill 0.342409; relative MASE 0.789019; relative WQL 0.548055. +- term skill: long=0.3990, medium=0.3637, short=0.3108. +- domain skill: Econ/Fin=0.1781, Energy=0.2290, Healthcare=0.3699, Nature=0.3893, Sales=0.4030, Transport=0.3792, Web/CloudOps=0.4578. +- frequency skill: A=0.3230, D=0.3600, H=0.3772, M=0.1942, Q=0.2303, S=0.3398, T=0.3376, W=0.2870. +- variates skill: multivariate=0.3584, univariate=0.3294. +- Outcome: Fixed coefficient-one zero-extended E1076000-E80control6000 transfer onto E114firstmember; no optimizer update. Ensemble selection recorded separately. + +## E117 long-seasonal matched transfer6000 valid_backcast2 +- Checkpoint SHA-256: `02ac8f37ed3a54fb12b209f6d8d9eb64e01a5cb862dc63f77ab8e3f8633a4c44`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 26.222503900527954 seconds. +- Overall skill 0.364638; relative MASE 0.764781; relative WQL 0.527844. +- term skill: long=0.3704, medium=0.3939, short=0.3508. +- domain skill: Econ/Fin=0.1343, Energy=0.2389, Healthcare=0.2996, Nature=0.4841, Sales=0.5492, Transport=0.4268, Web/CloudOps=0.4437. +- frequency skill: A=0.3483, D=0.4277, H=0.3984, M=0.1458, Q=0.1537, S=0.2830, T=0.3697, W=0.2602. +- variates skill: multivariate=0.3707, univariate=0.3597. +- Outcome: Fixed coefficient-one zero-extended E1076000-E80control6000 transfer onto E114firstmember; no optimizer update. Ensemble selection recorded separately. + +## E117 long-seasonal matched transfer6000 valid_backcast3 +- Checkpoint SHA-256: `02ac8f37ed3a54fb12b209f6d8d9eb64e01a5cb862dc63f77ab8e3f8633a4c44`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 52.90152072906494 seconds. +- Overall skill 0.391181; relative MASE 0.738393; relative WQL 0.501983. +- term skill: long=0.3957, medium=0.3634, short=0.3996. +- domain skill: Econ/Fin=0.1862, Energy=0.3239, Healthcare=0.2347, Nature=0.4974, Sales=0.4062, Transport=0.5153, Web/CloudOps=0.3945. +- frequency skill: A=0.3626, D=0.4483, H=0.4086, M=0.1380, Q=0.2650, S=0.2751, T=0.4326, W=0.2479. +- variates skill: multivariate=0.3753, univariate=0.4034. +- Outcome: Fixed coefficient-one zero-extended E1076000-E80control6000 transfer onto E114firstmember; no optimizer update. Ensemble selection recorded separately. + +E117 duration6000 equal-ensemble diagnostics: [{"cutoff": "valid_screen", "skill_score": 0.38758775695568237, "rel_mase_gmean": 0.7338581642688206, "rel_wql_gmean": 0.5110643632400712, "groups": {"term": {"short": 0.3705854772097721, "medium": 0.4098116884577624, "long": 0.40850774015255753}, "domain": {"Econ/Fin": 0.1491110309849244, "Energy": 0.2473872111540495, "Healthcare": 0.47967500211204583, "Nature": 0.4443342058731611, "Sales": 0.34435330099487205, "Transport": 0.47178883199133137, "Web/CloudOps": 0.507316811565411}, "freq": {"A-DEC": 0.37657388175046513, "Q-DEC": 0.20077233812299533, "M": 0.11934165027075339, "W-SUN": 0.1260870289350683, "D": 0.37011118914329555, "H": 0.4033355658667086, "15T": 0.2177918137607776, "W-FRI": 0.01580119721245088, "10T": 0.6278398409268195, "W-TUE": 0.6156563794482202, "W-THU": 0.20846408250449933, "W-WED": 0.3285721069115759, "5T": 0.522168695958841, "10S": 0.4256937093047316}}, "member_checkpoint_hashes": ["02ac8f37ed3a54fb12b209f6d8d9eb64e01a5cb862dc63f77ab8e3f8633a4c44", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cpu_seconds": 1.5809676200151443, "delta_vs_E116": 0.0003823435790825114}, {"cutoff": "valid_backcast", "skill_score": 0.3429158754584547, "rel_mase_gmean": 0.7903227473802326, "rel_wql_gmean": 0.5463078826412736, "groups": {"term": {"short": 0.3101741450136747, "medium": 0.36225183532087923, "long": 0.4039504121923163}, "domain": {"Econ/Fin": 0.1796638005766118, "Energy": 0.23274562514662867, "Healthcare": 0.4050454901624251, "Nature": 0.37989567626268006, "Sales": 0.4082253173536764, "Transport": 0.3765529479337325, "Web/CloudOps": 0.45441716485204564}, "freq": {"A-DEC": 0.3272205609581892, "Q-DEC": 0.23759099706252007, "M": 0.19588675468651817, "W-SUN": 0.07375509478160447, "D": 0.35756967295528785, "H": 0.3748935561837421, "15T": 0.22174583342116727, "W-FRI": 0.2283220401322632, "10T": 0.32775359942485127, "W-TUE": 0.5476232952821192, "W-THU": 0.2634820217181426, "W-WED": 0.3605171603714096, "5T": 0.444928923907442, "10S": 0.3480376209492927}}, "member_checkpoint_hashes": ["02ac8f37ed3a54fb12b209f6d8d9eb64e01a5cb862dc63f77ab8e3f8633a4c44", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cpu_seconds": 1.486426532967016, "delta_vs_E116": 0.00019519587090321977}, {"cutoff": "valid_backcast2", "skill_score": 0.3673138699400975, "rel_mase_gmean": 0.7624413618664356, "rel_wql_gmean": 0.5250131474901527, "groups": {"term": {"short": 0.35464549923886646, "medium": 0.396044483486757, "long": 0.3704566659810776}, "domain": {"Econ/Fin": 0.1278986000738499, "Energy": 0.24201205303512197, "Healthcare": 0.35011514635967966, "Nature": 0.4829607673467684, "Sales": 0.5559108719880497, "Transport": 0.42779567927039897, "Web/CloudOps": 0.440788541797849}, "freq": {"A-DEC": 0.33548760475433637, "Q-DEC": 0.15846843703525426, "M": 0.16977470264226235, "W-SUN": 0.08500199629088767, "D": 0.4327290855838334, "H": 0.3972970456246422, "15T": 0.10794550576938078, "W-FRI": 0.15172550191595102, "10T": 0.5117883242263219, "W-TUE": 0.09682533580849628, "W-THU": 0.3563552961839991, "W-WED": 0.5628050187009171, "5T": 0.4762546590382627, "10S": 0.2862951112159169}}, "member_checkpoint_hashes": ["02ac8f37ed3a54fb12b209f6d8d9eb64e01a5cb862dc63f77ab8e3f8633a4c44", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cpu_seconds": 1.5663821888156235, "delta_vs_E116": 0.0001767028092733991}, {"cutoff": "valid_backcast3", "skill_score": 0.39076445217348055, "rel_mase_gmean": 0.7386290023225965, "rel_wql_gmean": 0.5025093132930779, "groups": {"term": {"short": 0.3962936650066763, "medium": 0.36903122355860374, "long": 0.3974199700061841}, "domain": {"Econ/Fin": 0.19052380239240974, "Energy": 0.31738542877172005, "Healthcare": 0.2410422058404026, "Nature": 0.5056637262017856, "Sales": 0.40214858215010085, "Transport": 0.5120028986153148, "Web/CloudOps": 0.39565427543069853}, "freq": {"A-DEC": 0.3580331842712011, "Q-DEC": 0.2574659133377385, "M": 0.14984257763476883, "W-SUN": 0.17713719254991567, "D": 0.44344232532232797, "H": 0.40729030186015236, "15T": 0.25503817655546823, "W-FRI": 0.03718352110646361, "10T": 0.6055530546744756, "W-TUE": 0.2759842620088724, "W-THU": 0.33285112284477014, "W-WED": 0.37606870679901383, "5T": 0.46723753191341555, "10S": 0.2931530897878887}}, "member_checkpoint_hashes": ["02ac8f37ed3a54fb12b209f6d8d9eb64e01a5cb862dc63f77ab8e3f8633a4c44", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cpu_seconds": 1.2575315169524401, "delta_vs_E116": 0.00048573645624805373}]. All four improve E116; advance to full public replay. Initial assembly helper incorrectly passed the ensemble-probe schema to the single-report recorder and failed before package creation; corrected to direct group recording. No model/runtime/publication mutation occurred. + +## E119 learned phase-specific seasonal dispersion — predeclared +E107 mean summaries improve all four cutoffs, suggesting useful information remains in per-phase repeated cycles. Hypothesis: exposing phase-specific variability helps the neural median/quantile decoder distinguish reliable and noisy seasonal positions. Add four query features: log1p(unbiased sample standard deviation) of the last4 and last16 cycle-centered matching-phase observations, for each of two frequency-derived periods. Use exactly E107 support gate (period>=2,recent>=2,total>=8); inactive features zero. Add one zero-initialized patch*4 to d projection (32768parameters); retain E107 mean query/head and train all parameters. No explicit output rescaling, direct variance head, new generator or loss. Initialize by zero-extending E107's original function-preserving initial checkpoint, not a validation-selected trained endpoint. Match E107 seed197/B64/LR2e-5/12000/paired, original packed_sample/source probabilities/generator/horizon RNG. Primary comparison6000 versus E1076000;1000/3000diagnostic,12000durability. Earlier cutoffs before transfer/publication. Queue after E115phase_joint; no coefficient sweep or transfer rule yet. CPU arithmetic/invariance and maximum-shape GPU audits precede launch. + +E119 CPU audit {"seed": 577, "independent_feature_arithmetic": true, "centered_cycle_offset_invariance": true, "old_features_bitwise_equal": true, "initial_function_bitwise_equal": true, "inherited_weights_bitwise_equal": true, "all_parameters_trainable": true, "sampler_byte_identical": true, "added_parameters": 32768, "total_parameters": 36882752, "checkpoint_sha256": "5f07cac4fe7de3e878a01cb90384e79905fdb3156122b568e82c5923526aca3c", "seconds": 1.8492389279417694, "optimizer_updates": 0, "validation_data_read": false}. Distinct from rejected E53: E53 changed a fixed seasonal-confidence denominator pooled across all phases; E119 retains that formula and trains a zero-initialized query projection of phase-specific dispersion with all weights trainable. No validation targets or optimizer updates enter this audit. + +E1108000 matched diagnostic {"experiment": "E110full-corpus8000 versus E94matched8000", "overall_delta": -0.003203082653086664, "groups": {"term": {"long": 0.0035847827270744093, "medium": 0.0029933799435938324, "short": -0.008583522930157517}, "domain": {"Econ/Fin": 0.0073067524243448645, "Energy": 0.0010232563174896736, "Healthcare": -0.10046309213785809, "Nature": -0.005525316527005608, "Sales": 0.020186513009092466, "Transport": -0.004776228457146647, "Web/CloudOps": 0.007967761013063401}, "frequency": {"A": 0.0024475638858065807, "D": -0.00816465345146733, "H": 0.003737303868274089, "M": -0.0603011923470429, "Q": 0.023677353819767433, "S": 0.0010874878225529683, "T": 3.1634525451962325e-05, "W": -0.021925362852562746}}}. Small improvements on medium/long horizons are outweighed by short-horizon Healthcare and monthly/weekly regressions; not sufficient evidence for combining this data change with distillation. Preserve original96000schedule; no training-data adaptation to these validation values. + +Context-only seasonal-support diagnostic: {"kind": "optimistic potential support before missing-value masks; not measured forecast improvement", "input_metadata_only": true, "validation_targets_read": false, "optimizer_updates": 0, "changed_configurations": 21, "changed_domains": ["Energy", "Nature", "Transport", "Web/CloudOps"], "seconds": 1.966426236089319}. At16384instead of4096,21configurations gain potential>=8cycle support before missing masks. Example: electricity15min weekly672period gains6to16availablecycles; solar10min weekly1008 gains4to16. This is potential feature availability, not forecast benefit. No training or inference rule changed. + +E111 weekly seed523 control training started at 2026-10-23T07:04:07Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E119 maximum-shape GPU audit {"seed": 587, "gpu_initial_function_bitwise_equal": true, "max_shape": [64, 4096, 1024], "loss": 0.30101367831230164, "selected_gradient_norms": {"dispersion_query.weight": 0.0080416863784194, "long_query.weight": 0.02340359427034855, "long_head.weight": 0.013128682039678097, "head.weight": 0.02928958274424076}, "all_parameters_trainable": true, "reserved_mib": 6162.0, "allocated_mib": 5787.1318359375, "includes_ema_and_adam_placeholders": true, "seconds": 351.92002349486575, "optimizer_updates": 0, "validation_data_read": false}. Reported351.920023s is total process wall including waiting for the shared evaluation lock, not isolated GPU compute. BF16 initialization is bitwise equal; all trainable gradients finite and new-projection gradient nonzero. Queue after E115final12000; no optimizer update in audit. + +E107 completed {"completed_step": 12000, "training_process_loop_seconds": 2526.470098217018}, process wall 2542.7628201858606s, final checkpoint SHA256d512cdac520239f0c10e021721424d87cee30086fa70f6cbc41f21e2e04988c3. E111control seed523 started automatically after completion, trainer19130. E117final-duration coefficient-one transfer created SHA2568a2b252b733cc79c31778ea27ba00fbe61206fef50454514b667c54a928d80a4, merge2.527997653CPU s; four-cutoff evaluation pending. + +E1018000 matched comparison {"comparison": "E101 versus E94 at8000updates", "candidate_hash": "dca6ae35fabe5a4608ef2207587fe6dfc4b66b7f07c826e640ef0d9887e1fef8", "control_hash": "650a1a4177cae63f3ceab8a2255fbd2f9d281a7e83e8d380a34bb956bd690884", "skill_delta": 0.007141103867715826, "groups": {"term": {"long": 0.00950527008347335, "medium": 0.015714162767370032, "short": 0.0025782486269768645}, "domain": {"Econ/Fin": 0.014946719158874244, "Energy": 0.011541932738351024, "Healthcare": -0.029374142922637292, "Nature": -0.0037363199637078237, "Sales": 0.020011161284304135, "Transport": 0.017766071964885777, "Web/CloudOps": 0.005429339989242221}, "frequency": {"A": 0.01843941003486016, "D": -0.004802637871195281, "H": 0.014959072868680146, "M": -0.03208366163078247, "Q": 0.04314910869141775, "S": -0.007253560764663325, "T": 0.013793862179354521, "W": -0.010157605065865938}}}. Main0.3542945304341839 versus E940.3471534265664681. Update-count advantage remains; three teacher forward passes add cost, so this is not evidence of wall-time efficiency. Preserve teacherE96/coefficient0.5/original96000schedule. + +## E120 inference ablation of learned seasonal summaries — predeclared +E1076000 improves matched E80, but both inherited weights and newly introduced feature projections changed during training. Diagnostic hypothesis: the learned sixteen-cycle query/head features themselves contribute to forecasting beyond the inherited-weight changes. Take exactly E107EMA6000 and disable both long_query and long_head by setting long_seasonal_features=False and removing only their three tensors; preserve every common tensor bitwise. Compare this fixed ablation to the original E1076000 at all four diagnostic cutoffs. No optimizer update, retraining, new generator or coefficient search. This is a diagnostic of the trained representation, not a matched-training causal estimate and not a publication candidate. Keep the current E117 publication decision independent. The result will inform whether extending only seasonal-summary history is worth a later controlled training experiment. + +## E117 seasonal6000 ensemble full public replay — selected +- Checkpoint SHA-256: `2e4fd324abe8fae2bb2b0d93c132b48bc047985da4d05171edbff36d83edb76c`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.383907; relative MASE 0.736461; relative WQL 0.515398. +- term skill: long=0.4027, medium=0.4087, short=0.3667. +- domain skill: Econ/Fin=0.1307, Energy=0.2409, Healthcare=0.4852, Nature=0.4445, Sales=0.3586, Transport=0.4720, Web/CloudOps=0.4992. +- frequency skill: A=0.2968, D=0.3745, H=0.3981, M=0.1452, Q=0.1893, S=0.4257, T=0.4394, W=0.2376. +- variates skill: multivariate=0.3972, univariate=0.3731. +- Outcome: Full skill 0.383907276221 exceeds published 0.383511269088 by 0.000396007133. All97configs151170instances pass; relocation and independent fixed-average composition checks pass. Validation selection only, not held-out reward. + +E117 complete public suite {"package": "/workspace/research/candidate-long-seasonal6-ensemble", "status": "complete", "steps": [{"name": "relocation", "returncode": 0, "seconds": 27.76716866483912}, {"name": "full_public_replay", "returncode": 0, "seconds": 364.8008179310709}, {"name": "independent_long_seasonal_replay", "returncode": 0, "seconds": 185.7471042801626}, {"name": "composition", "returncode": 0, "seconds": 0.46263073617592454}, {"name": "descriptive_comparison", "returncode": 0, "seconds": 0.17200843803584576}], "current_step": "descriptive_comparison", "seconds": 578.9992693390232, "skill": 0.38390727622107634}. Descriptive comparison {"candidate": "/workspace/research/valid-report-long-seasonal6-ensemble.json", "parent": "/workspace/research/valid-report-long-seasonal3-ensemble.json", "candidate_hash": "2e4fd324abe8fae2bb2b0d93c132b48bc047985da4d05171edbff36d83edb76c", "parent_hash": "d5320aa1bc1d23983eb3f438d4ab3171de0b5d8afe93846fb853acd99629d092", "skill_difference": 0.0003960071326728487, "n_configs": 97, "n_dataset_clusters": 28, "improved_configs": 64, "bootstrap_seed": 317, "bootstrap_samples": 5000, "dataset_cluster_delta_percentiles": {"p025": 0.00022268027543086432, "p50": 0.00038841478230000615, "p975": 0.0006178172436181516}, "note": "Descriptive resampling only. Adaptive validation selection and reused windows prevent treating this as a held-out significance test."}. Identical runtime/weight hashes verified before atomic publication. Every member forecasts every instance. E101teacher remains frozenE96. + +E117 publication bookkeeping: successful atomic swap at07:08:28UTC preceded a TypeError in the subsequent research-state update, because predeclared durations was a list. Corrected future writer to duration_results and reconciled CURRENT against the actual published manifest/report; no model, validation or runtime error, and no partial package was exposed. + +E79 matched48000 capacity comparison {"experiment": "E79 matched fresh146M versus37M at48000", "wide_skill": 0.3685434345005941, "small_skill": 0.36677272226065616, "delta": 0.001770712239937966, "candidate_hash": "227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c", "control_hash": "855f37f248e8104578ae2b356d2b7326a73236476f888fd1468e988be4238509", "groups": {"term": {"long": -0.004614403570790682, "medium": 0.0001880975934308582, "short": 0.005003156709554091}, "domain": {"Econ/Fin": -0.016997682096246525, "Energy": -0.003545869646366051, "Healthcare": 0.04853217938401477, "Nature": 0.005359137774352152, "Sales": -0.0067723756343403, "Transport": -0.0027269222078922795, "Web/CloudOps": 0.0022497021003726747}, "frequency": {"A": 0.004470802964257836, "D": 0.005424165034339068, "H": -0.003437844355180242, "M": 0.07518726555589927, "Q": -0.013178225536983335, "S": -0.003760199536136266, "T": -0.0021534007709399505, "W": 0.007093310437459088}}}. The146M branch now exceeds37M at equal updates, reversing the earlier ranking. Retain scheduled72000/96000checkpoints; no capacity extension or329Mrun declared. + +E115 joint phase conditioning seed197 training started at 2026-10-23T07:10:28Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E107 seasonal12000 valid_backcast +- Checkpoint SHA-256: `d512cdac520239f0c10e021721424d87cee30086fa70f6cbc41f21e2e04988c3`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 27.891539812088013 seconds. +- Overall skill 0.341379; relative MASE 0.792273; relative WQL 0.547515. +- term skill: long=0.4011, medium=0.3630, short=0.3083. +- domain skill: Econ/Fin=0.1541, Energy=0.2330, Healthcare=0.3908, Nature=0.3814, Sales=0.4040, Transport=0.3820, Web/CloudOps=0.4524. +- frequency skill: A=0.3164, D=0.3688, H=0.3749, M=0.1725, Q=0.2300, S=0.3427, T=0.3364, W=0.2805. +- variates skill: multivariate=0.3562, univariate=0.3294. +- Outcome: Final E107 versus matched E8012000 delta 0.004850916529; versus own6000 delta 0.001526715303. Final duration improves three cutoffs over6000 but loses the oldest; E117 predeclared transferred composition assessed separately. + +## E107 seasonal12000 valid_backcast2 +- Checkpoint SHA-256: `d512cdac520239f0c10e021721424d87cee30086fa70f6cbc41f21e2e04988c3`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 26.684894800186157 seconds. +- Overall skill 0.365060; relative MASE 0.764718; relative WQL 0.527186. +- term skill: long=0.3677, medium=0.3957, short=0.3518. +- domain skill: Econ/Fin=0.0984, Energy=0.2396, Healthcare=0.3583, Nature=0.4847, Sales=0.5527, Transport=0.4280, Web/CloudOps=0.4370. +- frequency skill: A=0.3501, D=0.4330, H=0.3965, M=0.1801, Q=0.1448, S=0.2846, T=0.3637, W=0.2713. +- variates skill: multivariate=0.3674, univariate=0.3631. +- Outcome: Final E107 versus matched E8012000 delta 0.004086370453; versus own6000 delta 0.001805111594. Final duration improves three cutoffs over6000 but loses the oldest; E117 predeclared transferred composition assessed separately. + +## E107 seasonal12000 valid_backcast3 +- Checkpoint SHA-256: `d512cdac520239f0c10e021721424d87cee30086fa70f6cbc41f21e2e04988c3`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 27.912177085876465 seconds. +- Overall skill 0.392833; relative MASE 0.733445; relative WQL 0.502630. +- term skill: long=0.3982, medium=0.3609, short=0.4024. +- domain skill: Econ/Fin=0.1609, Energy=0.3232, Healthcare=0.3044, Nature=0.5056, Sales=0.4052, Transport=0.5100, Web/CloudOps=0.3912. +- frequency skill: A=0.3472, D=0.4525, H=0.4075, M=0.1705, Q=0.2608, S=0.2906, T=0.4279, W=0.2644. +- variates skill: multivariate=0.3764, univariate=0.4055. +- Outcome: Final E107 versus matched E8012000 delta 0.005351688124; versus own6000 delta -0.001665237983. Final duration improves three cutoffs over6000 but loses the oldest; E117 predeclared transferred composition assessed separately. + +E107 complete final-duration comparison [{"cutoff": "valid_screen", "skill": 0.38231375879048757, "delta_matched": 0.004889812714840014, "delta_vs6000": 3.9091567565430196e-05}, {"cutoff": "valid_backcast", "skill": 0.34137925383664736, "delta_matched": 0.0048509165293714185, "delta_vs6000": 0.0015267153027013203}, {"cutoff": "valid_backcast2", "skill": 0.3650598400595585, "delta_matched": 0.004086370453054822, "delta_vs6000": 0.0018051115942698814}, {"cutoff": "valid_backcast3", "skill": 0.3928331731047856, "delta_matched": 0.005351688124433984, "delta_vs6000": -0.0016652379826666008}]. Final is better than matched E80 on all four cutoffs, and mixed versus own6000. No extra intermediate checkpoint search declared. + +## E117 long-seasonal matched transfer12000 valid_screen +- Checkpoint SHA-256: `8a2b252b733cc79c31778ea27ba00fbe61206fef50454514b667c54a928d80a4`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 27.930054187774658 seconds. +- Overall skill 0.386692; relative MASE 0.733194; relative WQL 0.513026. +- term skill: long=0.4082, medium=0.4096, short=0.3692. +- domain skill: Econ/Fin=0.1468, Energy=0.2415, Healthcare=0.4724, Nature=0.4442, Sales=0.3390, Transport=0.4736, Web/CloudOps=0.5117. +- frequency skill: A=0.3769, D=0.3743, H=0.4066, M=0.0984, Q=0.2059, S=0.4258, T=0.4442, W=0.2250. +- variates skill: multivariate=0.4015, univariate=0.3746. +- Outcome: Fixed coefficient-one zero-extended E10712000-E80control12000 transfer onto E114firstmember; no optimizer update. Ensemble selection recorded separately. + +## E117 long-seasonal matched transfer12000 valid_backcast +- Checkpoint SHA-256: `8a2b252b733cc79c31778ea27ba00fbe61206fef50454514b667c54a928d80a4`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 26.0443058013916 seconds. +- Overall skill 0.342530; relative MASE 0.789143; relative WQL 0.547767. +- term skill: long=0.3986, medium=0.3634, short=0.3113. +- domain skill: Econ/Fin=0.1773, Energy=0.2292, Healthcare=0.3696, Nature=0.3902, Sales=0.4038, Transport=0.3796, Web/CloudOps=0.4572. +- frequency skill: A=0.3234, D=0.3615, H=0.3769, M=0.1938, Q=0.2299, S=0.3391, T=0.3378, W=0.2870. +- variates skill: multivariate=0.3582, univariate=0.3298. +- Outcome: Fixed coefficient-one zero-extended E10712000-E80control12000 transfer onto E114firstmember; no optimizer update. Ensemble selection recorded separately. + +## E117 long-seasonal matched transfer12000 valid_backcast2 +- Checkpoint SHA-256: `8a2b252b733cc79c31778ea27ba00fbe61206fef50454514b667c54a928d80a4`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 29.031078815460205 seconds. +- Overall skill 0.365057; relative MASE 0.764511; relative WQL 0.527333. +- term skill: long=0.3707, medium=0.3938, short=0.3515. +- domain skill: Econ/Fin=0.1339, Energy=0.2390, Healthcare=0.2992, Nature=0.4848, Sales=0.5508, Transport=0.4274, Web/CloudOps=0.4443. +- frequency skill: A=0.3487, D=0.4280, H=0.3986, M=0.1466, Q=0.1539, S=0.2839, T=0.3704, W=0.2603. +- variates skill: multivariate=0.3711, univariate=0.3602. +- Outcome: Fixed coefficient-one zero-extended E10712000-E80control12000 transfer onto E114firstmember; no optimizer update. Ensemble selection recorded separately. + +## E117 long-seasonal matched transfer12000 valid_backcast3 +- Checkpoint SHA-256: `8a2b252b733cc79c31778ea27ba00fbe61206fef50454514b667c54a928d80a4`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 30.16946768760681 seconds. +- Overall skill 0.391080; relative MASE 0.738672; relative WQL 0.501959. +- term skill: long=0.3957, medium=0.3634, short=0.3994. +- domain skill: Econ/Fin=0.1854, Energy=0.3237, Healthcare=0.2319, Nature=0.4975, Sales=0.4068, Transport=0.5154, Web/CloudOps=0.3948. +- frequency skill: A=0.3628, D=0.4472, H=0.4084, M=0.1398, Q=0.2640, S=0.2757, T=0.4328, W=0.2481. +- variates skill: multivariate=0.3752, univariate=0.4033. +- Outcome: Fixed coefficient-one zero-extended E10712000-E80control12000 transfer onto E114firstmember; no optimizer update. Ensemble selection recorded separately. + +## E120 no-seasonal-feature ablation valid_screen +- Checkpoint SHA-256: `5d016bdaaae5682039289ff9d0078b8e7361a85c7d073cb3d1d172a682696635`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 25.446512699127197 seconds. +- Overall skill 0.379037; relative MASE 0.743615; relative WQL 0.518542. +- term skill: long=0.4013, medium=0.4070, short=0.3591. +- domain skill: Econ/Fin=0.1239, Energy=0.2394, Healthcare=0.4687, Nature=0.4304, Sales=0.3369, Transport=0.4663, Web/CloudOps=0.5035. +- frequency skill: A=0.3682, D=0.3569, H=0.3975, M=0.1045, Q=0.1916, S=0.4253, T=0.4375, W=0.2293. +- variates skill: multivariate=0.3973, univariate=0.3641. +- Outcome: Ablated minus original E1076000 skill -0.003237981869. Only the three newly introduced query/head tensors removed; all common weights identical. Diagnostic only; no optimizer update or publication. + +## E120 no-seasonal-feature ablation valid_backcast +- Checkpoint SHA-256: `5d016bdaaae5682039289ff9d0078b8e7361a85c7d073cb3d1d172a682696635`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 25.945672273635864 seconds. +- Overall skill 0.335291; relative MASE 0.798422; relative WQL 0.553388. +- term skill: long=0.3978, medium=0.3572, short=0.3008. +- domain skill: Econ/Fin=0.1449, Energy=0.2271, Healthcare=0.4135, Nature=0.3656, Sales=0.3969, Transport=0.3715, Web/CloudOps=0.4497. +- frequency skill: A=0.3114, D=0.3509, H=0.3670, M=0.1826, Q=0.2353, S=0.3420, T=0.3323, W=0.2844. +- variates skill: multivariate=0.3521, univariate=0.3216. +- Outcome: Ablated minus original E1076000 skill -0.004561070524. Only the three newly introduced query/head tensors removed; all common weights identical. Diagnostic only; no optimizer update or publication. + +## E120 no-seasonal-feature ablation valid_backcast2 +- Checkpoint SHA-256: `5d016bdaaae5682039289ff9d0078b8e7361a85c7d073cb3d1d172a682696635`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 26.085110902786255 seconds. +- Overall skill 0.358680; relative MASE 0.770361; relative WQL 0.533894. +- term skill: long=0.3640, medium=0.3891, short=0.3445. +- domain skill: Econ/Fin=0.0925, Energy=0.2359, Healthcare=0.3637, Nature=0.4703, Sales=0.5469, Transport=0.4203, Web/CloudOps=0.4325. +- frequency skill: A=0.3460, D=0.4234, H=0.3903, M=0.1635, Q=0.1471, S=0.2816, T=0.3596, W=0.2637. +- variates skill: multivariate=0.3624, univariate=0.3556. +- Outcome: Ablated minus original E1076000 skill -0.004574561662. Only the three newly introduced query/head tensors removed; all common weights identical. Diagnostic only; no optimizer update or publication. + +## E120 no-seasonal-feature ablation valid_backcast3 +- Checkpoint SHA-256: `5d016bdaaae5682039289ff9d0078b8e7361a85c7d073cb3d1d172a682696635`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 23.88756275177002 seconds. +- Overall skill 0.390053; relative MASE 0.735691; relative WQL 0.505695. +- term skill: long=0.3964, medium=0.3611, short=0.3982. +- domain skill: Econ/Fin=0.1627, Energy=0.3183, Healthcare=0.2887, Nature=0.5063, Sales=0.3981, Transport=0.5070, Web/CloudOps=0.3912. +- frequency skill: A=0.3574, D=0.4489, H=0.4042, M=0.1424, Q=0.2562, S=0.2901, T=0.4282, W=0.2599. +- variates skill: multivariate=0.3722, univariate=0.4037. +- Outcome: Ablated minus original E1076000 skill -0.004445083448. Only the three newly introduced query/head tensors removed; all common weights identical. Diagnostic only; no optimizer update or publication. + +E120 completed diagnostic {"experiment": "E120 fixed inference ablation", "pid": 19358, "status": "complete", "optimizer_updates": 0, "checkpoint_sha256": "5d016bdaaae5682039289ff9d0078b8e7361a85c7d073cb3d1d172a682696635", "seconds": 313.96637652395293, "comparisons": [{"cutoff": "valid_screen", "ablated_skill": 0.37903668535385004, "original_skill": 0.38227466722292214, "ablation_delta": -0.003237981869072093}, {"cutoff": "valid_backcast", "ablated_skill": 0.335291468009684, "original_skill": 0.33985253853394604, "ablation_delta": -0.004561070524262023}, {"cutoff": "valid_backcast2", "ablated_skill": 0.3586801668029278, "original_skill": 0.3632547284652886, "ablation_delta": -0.00457456166236081}, {"cutoff": "valid_backcast3", "ablated_skill": 0.3900533276391289, "original_skill": 0.3944984110874522, "ablation_delta": -0.004445083448323284}]}. Preparation {"method": "inference-only ablation: disable long seasonal query and median head", "removed_parameters": ["long_head.bias", "long_head.weight", "long_query.weight"], "parent_sha256": "ad45e0cfae574d3dc1be0b9720c9be0863db9ffe33891fdb22c86dfa83667253", "common_weights_bitwise_equal": true, "equivalent_to_zeroing_added_tensors": true, "fixture_max_normalized_quantile_change": 0.3484839200973511, "seed": 593, "optimizer_updates": 0, "validation_data_read": false, "seconds": 1.7483407920226455, "checkpoint_sha256": "5d016bdaaae5682039289ff9d0078b8e7361a85c7d073cb3d1d172a682696635", "parameters": 36800800}. No model selection or inference rule change made from this ablation. + +E117 final12000 ensemble selection decision: main0.3877185003381878(+0.000130743),earlier0.3429732095231861(+0.000057334),0.3674637814642573(+0.000149912),0.3907349048993719(-0.000029547) versus6000. Three small gains and a smaller oldest-cutoff regression justify full public replay of the predeclared endpoint. No new duration or coefficient searched. Keep published6000 unless complete full validation improves and all package checks pass. + +E117 final-duration diagnostic comparison [{"cutoff": "valid_screen", "skill_score": 0.3877185003381878, "rel_mase_gmean": 0.7337351974885521, "rel_wql_gmean": 0.5109317858967326, "groups": {"term": {"short": 0.3707558524930944, "medium": 0.4098771901633257, "long": 0.408606031650835}, "domain": {"Econ/Fin": 0.14892832484818552, "Energy": 0.2472971852687753, "Healthcare": 0.4803016863042562, "Nature": 0.44452367697019235, "Sales": 0.34469848608770726, "Transport": 0.4720713678216161, "Web/CloudOps": 0.5074289619200675}, "freq": {"A-DEC": 0.37644303940062507, "Q-DEC": 0.20040073790916524, "M": 0.11941330678885598, "W-SUN": 0.1251202483389996, "D": 0.37055191866195825, "H": 0.40349640640320394, "15T": 0.21781231621749508, "W-FRI": 0.015126576068462239, "10T": 0.6280390649679213, "W-TUE": 0.6163537412047071, "W-THU": 0.20809838353336907, "W-WED": 0.3286161379110919, "5T": 0.5222559385117231, "10S": 0.4255389538943257}}, "member_checkpoint_hashes": ["8a2b252b733cc79c31778ea27ba00fbe61206fef50454514b667c54a928d80a4", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cpu_seconds": 2.2789630780462176, "delta_vs_6000": 0.00013074338250540496}, {"cutoff": "valid_backcast", "skill_score": 0.3429732095231861, "rel_mase_gmean": 0.7903406487887271, "rel_wql_gmean": 0.546200178449458, "groups": {"term": {"short": 0.3103732976664231, "medium": 0.36211673724743143, "long": 0.40386614844229607}, "domain": {"Econ/Fin": 0.1793467759174172, "Energy": 0.23278752845843642, "Healthcare": 0.4053028690714259, "Nature": 0.38023084245127514, "Sales": 0.4085492421507243, "Transport": 0.3767345389715574, "Web/CloudOps": 0.45420439383545774}, "freq": {"A-DEC": 0.3273754770611558, "Q-DEC": 0.23747069130587617, "M": 0.1957831138190873, "W-SUN": 0.07263667297699061, "D": 0.35807825619545863, "H": 0.3747906004450807, "15T": 0.2215635320385274, "W-FRI": 0.22848872660315322, "10T": 0.32771035120558367, "W-TUE": 0.5486117454705075, "W-THU": 0.26369218944162776, "W-WED": 0.36062902681612985, "5T": 0.44514303798334387, "10S": 0.34786208551915265}}, "member_checkpoint_hashes": ["8a2b252b733cc79c31778ea27ba00fbe61206fef50454514b667c54a928d80a4", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cpu_seconds": 2.2636594069190323, "delta_vs_6000": 5.73340647314069e-05}, {"cutoff": "valid_backcast2", "skill_score": 0.3674637814642573, "rel_mase_gmean": 0.7623553176057026, "rel_wql_gmean": 0.5248236072073068, "groups": {"term": {"short": 0.35484310895705573, "medium": 0.3960867437395954, "long": 0.3705980799617601}, "domain": {"Econ/Fin": 0.1277070545929031, "Energy": 0.24205256210757975, "Healthcare": 0.3497431968929344, "Nature": 0.48319278386757325, "Sales": 0.5564586584486519, "Transport": 0.4280488353299794, "Web/CloudOps": 0.4410272745304028}, "freq": {"A-DEC": 0.3355904988679629, "Q-DEC": 0.1585150327453716, "M": 0.17016606054242045, "W-SUN": 0.08409061455177957, "D": 0.43282659921195, "H": 0.39736790791666765, "15T": 0.10774153963042221, "W-FRI": 0.15202567498019182, "10T": 0.5120408099663714, "W-TUE": 0.0966837112065353, "W-THU": 0.3563038710687719, "W-WED": 0.5630246967574166, "5T": 0.4766927315668852, "10S": 0.2867261076297586}}, "member_checkpoint_hashes": ["8a2b252b733cc79c31778ea27ba00fbe61206fef50454514b667c54a928d80a4", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cpu_seconds": 2.4177008508704603, "delta_vs_6000": 0.0001499115241597737}, {"cutoff": "valid_backcast3", "skill_score": 0.3907349048993719, "rel_mase_gmean": 0.7387169220065166, "rel_wql_gmean": 0.5024982439818847, "groups": {"term": {"short": 0.396276610094657, "medium": 0.3689977724231216, "long": 0.39735893151620383}, "domain": {"Econ/Fin": 0.19020523838220893, "Energy": 0.31728610571853166, "Healthcare": 0.2403015174198082, "Nature": 0.5057342681593209, "Sales": 0.40241599684588714, "Transport": 0.5120862680709422, "Web/CloudOps": 0.3957049292064879}, "freq": {"A-DEC": 0.35800855596973136, "Q-DEC": 0.257067773847507, "M": 0.15038777612792043, "W-SUN": 0.17671013337471464, "D": 0.4432142959019776, "H": 0.4072206064146562, "15T": 0.2549314225171735, "W-FRI": 0.037548757757445705, "10T": 0.6057445314692966, "W-TUE": 0.27568951945628684, "W-THU": 0.333108346801685, "W-WED": 0.37617633114340077, "5T": 0.467212550495147, "10S": 0.29328450918527416}}, "member_checkpoint_hashes": ["8a2b252b733cc79c31778ea27ba00fbe61206fef50454514b667c54a928d80a4", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cpu_seconds": 2.134492114884779, "delta_vs_6000": -2.954727410864333e-05}]. Advance the predeclared fixed final-duration composition to complete public replay; only an improved verified package can replace the submission. + +## E121 older history for learned seasonal summaries — predeclared +E120 removing the seasonal query/head lowers skill at all four cutoffs by0.00324/0.00456/0.00457/0.00445; a context-metadata audit identifies21configurations with additional potential8cycle support at16384instead of4096. Test longer history only for E107's learned sixteen-cycle summaries. Encoder, metadata, normalization, training loss weighting, positivity and fixed postprocessing remain at4096. Extend only originally full4096 real training contexts with up to16384 preceding observations from the same sampled series/cutoff; preserve original targets, recent contexts, intentional short-context draws, aggregation alignment, random masking draws, source probabilities and all sampler/horizon RNG states exactly. Synthetic windows keep their original generated values with missing extra prefix; no new generator or random draw. For aggregated rows, extend by whole earlier aggregation blocks ending at the same forecast cutoff. Normalize the added prefix with the recent4096 statistics, preserving recent normalized values exactly. No new parameters; initialize from E107's original zero-feature own initialization with only context metadata changed. Match E107 seed197/B64/LR2e-5/12000/paired/originalpack; exact sampler audits permit using completed E107 as control without retraining it. Primary6000,1000/3000diagnostic,12000durability; all earlier cutoffs before selection. Queue after E119 only after CPU/GPU audits. No change to shared published ensemble runtime during E117 replay; any later ensemble packaging must explicitly honor each member's fixed rule-context cap. + +E121 CPU audit {"seed": 599, "sampler_seed": 601, "initial_function_bitwise_equal": true, "initial_loss_bitwise_equal": true, "all_parameter_tensors_bitwise_equal": true, "encoder_and_rule_context": 4096, "summary_context": 16384, "sampler_rows": 5120, "extended_real_rows": 610, "extended_aggregated_rows": 74, "synthetic_rows": 1032, "extra_finite_history_observations": 4575621, "original_recent_contexts_targets_periods_bitwise_equal": true, "original_sampler_and_horizon_rng_states_equal": true, "source_probabilities_bitwise_equal": true, "extra_history_independently_verified_against_same_source_before_cutoff": true, "synthetic_extra_prefix_missing": true, "total_parameters": 36849984, "checkpoint_sha256": "e15ab884442dacf5b0d2017e515732e2569ab3c520ecf465841e5e91bcd0dd88", "seconds": 9.032198722008616, "optimizer_updates": 0, "validation_data_read": false}. + +E121 CPU audit {"seed": 197, "separate_batch_rng_seed": 197, "requested_horizon_seed": 300200, "batches": 100, "rows": 6400, "extended_rows": 824, "shape_counts": {"4096/1024": 23, "2048/1024": 25, "4096/32": 3, "512/128": 3, "4096/128": 7, "1024/128": 2, "512/1024": 7, "4096/512": 9, "1024/1024": 5, "2048/128": 4, "512/32": 2, "2048/512": 6, "2048/32": 3, "512/512": 1}, "actual_training_rng_layout": true, "recent_context_targets_periods_bitwise_equal": true, "all_three_rng_states_bitwise_equal": true, "seconds": 4.592217224882916, "optimizer_updates": 0, "validation_data_read": false}. + +E121 runtime preparation: standalone predict.py uses16384only as the learned-summary input cap; positivity and all fixed transforms explicitly receive recent4096. Shared three_patch_ensemble/runtime remains unchanged during E117replay. If E121 is selected later, its ensemble runtime must honor per-model rule_context; do not publish it through the old hard-coded per-member input/postprocessing path without modifying and validating that path. No new ensemble transfer rule declared. + +## E117 seasonal12000 ensemble full public replay — selected +- Checkpoint SHA-256: `90199d09666c1653819ef17813f69fc4014fca075f99cc3766d24f457b50ca79`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.384041; relative MASE 0.736336; relative WQL 0.515260. +- term skill: long=0.4028, medium=0.4087, short=0.3669. +- domain skill: Econ/Fin=0.1306, Energy=0.2408, Healthcare=0.4858, Nature=0.4446, Sales=0.3589, Transport=0.4723, Web/CloudOps=0.4993. +- frequency skill: A=0.2968, D=0.3749, H=0.3983, M=0.1452, Q=0.1891, S=0.4255, T=0.4395, W=0.2374. +- variates skill: multivariate=0.3973, univariate=0.3733. +- Outcome: Full skill 0.384041465826 exceeds published 0.383907276221 by 0.000134189605. All97configs151170instances pass; relocation and independent fixed-average composition checks pass. Validation selection only, not held-out reward. + +E117 complete public suite {"package": "/workspace/research/candidate-long-seasonal12-ensemble", "status": "complete", "steps": [{"name": "relocation", "returncode": 0, "seconds": 32.01111192582175}, {"name": "full_public_replay", "returncode": 0, "seconds": 385.4564341898076}, {"name": "independent_long_seasonal_replay", "returncode": 0, "seconds": 46.03750956710428}, {"name": "composition", "returncode": 0, "seconds": 0.3832244158256799}, {"name": "descriptive_comparison", "returncode": 0, "seconds": 0.31505064899101853}], "current_step": "descriptive_comparison", "seconds": 464.2120908219367, "skill": 0.3840414658263811}. Descriptive comparison {"candidate": "/workspace/research/valid-report-long-seasonal12-ensemble.json", "parent": "/workspace/research/valid-report-long-seasonal6-ensemble.json", "candidate_hash": "90199d09666c1653819ef17813f69fc4014fca075f99cc3766d24f457b50ca79", "parent_hash": "2e4fd324abe8fae2bb2b0d93c132b48bc047985da4d05171edbff36d83edb76c", "skill_difference": 0.00013418960530475754, "n_configs": 97, "n_dataset_clusters": 28, "improved_configs": 55, "bootstrap_seed": 317, "bootstrap_samples": 5000, "dataset_cluster_delta_percentiles": {"p025": 2.5936228850581572e-06, "p50": 0.000133406498457056, "p975": 0.0002505207149228361}, "note": "Descriptive resampling only. Adaptive validation selection and reused windows prevent treating this as a held-out significance test."}. Identical runtime/weight hashes verified before atomic publication. Every member forecasts every instance. E101teacher remains frozenE96. + +E121 GPU audit {"seed": 607, "gpu_initial_function_bitwise_equal": true, "gpu_initial_loss_bitwise_equal": true, "max_input_shape": [64, 16384, 1024], "encoder_context": 4096, "loss": 0.2252708375453949, "gradient_norms": {"long_query.weight": 0.005559232551604509, "long_head.weight": 0.013920275494456291, "head.weight": 0.015998471528291702}, "reserved_mib": 6302.0, "allocated_mib": 5788.6318359375, "includes_ema_and_adam_placeholders": true, "lock_wait_seconds": 247.51019481010735, "post_lock_seconds": 9.868129789829254, "seconds": 258.1824177131057, "optimizer_updates": 0, "validation_data_read": false}. Active post-lock wall9.868130s, lockwait247.510195s, no optimizer updates. Queue after E11919255; exactly matched completed E107 remains the control. + +E115early matched diagnostics:1000skill0.376851746607891 versus E800.37680439430493307;3000skill0.3785995231369078 versus E800.37866382508046315. Effects are near zero so far; retain predeclared6000primary and12000durability. E119/E121 remain queued as independent factors, not conditioned on a claimed phase benefit. + +E11016000 matched comparison {"experiment": "E110full-corpus16000 versus E94matched16000", "candidate_skill": 0.35154579999964164, "control_skill": 0.35461566373218645, "skill_delta": -0.0030698637325448086, "candidate_hash": "29daf0a92679ccac5de356e78cdbce9ad7d88fa971229948b131194277972687", "control_hash": "19f9ead156ea9bc4a3edca1303bc5595057b2e1b89ff88e7bb7d9acf39618ba5", "groups": {"term": {"long": 0.002939641461384479, "medium": 0.0044219426650220495, "short": -0.008705471161239875}, "domain": {"Econ/Fin": 0.0077186974426632915, "Energy": 0.00047905371405398967, "Healthcare": -0.08545128617031428, "Nature": -0.006472746365275395, "Sales": 0.0047153529000921734, "Transport": -0.005534397382311318, "Web/CloudOps": 0.01049812646266357}, "frequency": {"A": 0.008032668576188895, "D": -0.0168735229638608, "H": 0.004955057897488513, "M": -0.09069678098773792, "Q": -0.005391239762853384, "S": -0.000881347834741697, "T": 0.008664048847818129, "W": -0.02936746335393836}}}. Full-corpus coverage/volume change remains below the small-pack control at8000and16000; original96000schedule retained. No full-corpus+distillation factorial arm is selected from these results. + +Allowed-pack metadata/offset audit:0.520215079CPU seconds,0optimizer updates,no series values or validation labels read. Both packs retain min16/maxcrop131072, all95directories have no mixed-frequency rows, source probabilities are unchanged. Conditional real-data length-bin total-variation distance=0.008112016801623342. Largest weighted within-source length shifts: taxi_30min, borg_cluster_data_2011, favorita_sales. No packing-boundary or frequency-label explanation for E110regression was found; broader series/crop diversity and stochastic training remain unresolved. Artifact pack_composition_comparison.json. + +Research queue status at2026-10-23T07:29UTC: E119seasonal_dispersion queue19255 waits on E115phase_joint final12000; E121seasonal_history queue20306 waits on E119final12000. E121CPU/GPU audits complete. E120ablation diagnostic complete. E110full-corpus16000 remains below matched E94; no full-corpus+distillation combination launched. Current strongest replayable model remains E117final12000. Refresh packaged journal atomically with identical model/runtime assets. + +E115 predeclared6000primary: skill0.37858897993545326,matched E800.3782887645248565,delta+0.00030021541059677137,SHA25603cf2357994ad0c372408331c08129b1f915d049f924eab9fce43fbd7af532e7,eval27.917009s,logged trainingloop1196.1s. Earlier cutoffs running before any transfer decision; no combined phase/seasonal-summary architecture or transfer coefficient is declared yet. + +## E115 joint phase6000 valid_backcast +- Checkpoint SHA-256: `03cf2357994ad0c372408331c08129b1f915d049f924eab9fce43fbd7af532e7`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 25.034706830978394 seconds. +- Overall skill 0.334541; relative MASE 0.799530; relative WQL 0.553870. +- term skill: long=0.3988, medium=0.3563, short=0.2994. +- domain skill: Econ/Fin=0.1510, Energy=0.2274, Healthcare=0.4048, Nature=0.3645, Sales=0.3958, Transport=0.3718, Web/CloudOps=0.4480. +- frequency skill: A=0.3123, D=0.3497, H=0.3674, M=0.1732, Q=0.2359, S=0.3416, T=0.3315, W=0.2841. +- variates skill: multivariate=0.3514, univariate=0.3208. +- Outcome: Matched E80 delta -0.000615748726. All three earlier cutoffs regress; reject6000transfer. Finish predeclared12000durability; no combined phase/long-summary runtime or coefficient sweep. + +## E115 joint phase6000 valid_backcast2 +- Checkpoint SHA-256: `03cf2357994ad0c372408331c08129b1f915d049f924eab9fce43fbd7af532e7`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 26.29227328300476 seconds. +- Overall skill 0.359464; relative MASE 0.769678; relative WQL 0.533062. +- term skill: long=0.3641, medium=0.3901, short=0.3455. +- domain skill: Econ/Fin=0.0960, Energy=0.2364, Healthcare=0.3661, Nature=0.4716, Sales=0.5493, Transport=0.4208, Web/CloudOps=0.4321. +- frequency skill: A=0.3464, D=0.4240, H=0.3920, M=0.1619, Q=0.1475, S=0.2820, T=0.3595, W=0.2656. +- variates skill: multivariate=0.3630, univariate=0.3566. +- Outcome: Matched E80 delta -0.000241820058. All three earlier cutoffs regress; reject6000transfer. Finish predeclared12000durability; no combined phase/long-summary runtime or coefficient sweep. + +## E115 joint phase6000 valid_backcast3 +- Checkpoint SHA-256: `03cf2357994ad0c372408331c08129b1f915d049f924eab9fce43fbd7af532e7`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 24.796042680740356 seconds. +- Overall skill 0.389560; relative MASE 0.736442; relative WQL 0.505996. +- term skill: long=0.3970, medium=0.3611, short=0.3972. +- domain skill: Econ/Fin=0.1652, Energy=0.3182, Healthcare=0.2782, Nature=0.5064, Sales=0.3978, Transport=0.5062, Web/CloudOps=0.3915. +- frequency skill: A=0.3587, D=0.4447, H=0.4046, M=0.1439, Q=0.2561, S=0.2914, T=0.4277, W=0.2621. +- variates skill: multivariate=0.3724, univariate=0.4028. +- Outcome: Matched E80 delta -0.000107694093. All three earlier cutoffs regress; reject6000transfer. Finish predeclared12000durability; no combined phase/long-summary runtime or coefficient sweep. + +E1156000 selection outcome [{"cutoff": "valid_screen", "skill": 0.37858897993545326, "matched_delta": 0.00030021541059677137}, {"cutoff": "valid_backcast", "skill": 0.3345407161426459, "matched_delta": -0.0006157487262733463}, {"cutoff": "valid_backcast2", "skill": 0.3594639786785041, "matched_delta": -0.00024182005829043174}, {"cutoff": "valid_backcast3", "skill": 0.3895599872359743, "matched_delta": -0.00010769409279154374}]. Reject transfer: main gain is not robust to all three earlier cutoffs. Existing12kdurability checkpoint remains scheduled. + +## E122 original AR prior during fresh146M pretraining — predeclared +The log-uniform slow-AR prior helped a mature patch16 model, but it was not tested as the sole AR law throughout fresh large-model pretraining. E79wide now exceeds37M at48000, while its absolute skill remains below mature models; transferring a late-training prior to an entire random-init schedule is an untested assumption. Compare a fresh146M run that changes only the AR coefficient law in the original20% synthetic stream: U(0.2,0.995), replacing exp(-10**(-U(0,4))). Preserve asymptotic variance scaling, AR branch probability, all other generator components, real windows, source weights, all RNG streams, original own random initialization, seed307/B48/LR2e-4/96000/paired/static-compiled recipe. Control is the already-running E79random_capacity_1024, not a retrained supplied baseline. Reuse its exact model code, initial checkpoint and maximum-shape allocation; no architecture change. Primary48000,4k/8k/16k/24kdiagnostics,72k/96kdurability. Queue only after E79wide finishes96000, replacing an identical memory allocation. CPU audit must show that only synthetic AR rows change and all RNG states/real/non-ARrows match. No new capacity jump, full-corpus combination or teacher is included. + +E122 CPU audit {"seed": 307, "batch_rng_seed": 307, "requested_horizon_seed": 300310, "rows": 4800, "synthetic_ar_rows": 481, "changed_rows": 457, "unchanged_rows": 4343, "only_ar_formula_differs_in_sampler_code": true, "model_code_byte_identical": true, "real_and_non_ar_rows_bitwise_equal": true, "periods_and_rng_states_bitwise_equal": true, "source_probabilities_bitwise_equal": true, "initial_checkpoint_sha256": "c9693619ca6277c26fef3b2bde37ff6796bec97b3af9f94588bbc5ddd329ec90", "seconds": 6.526560466038063, "optimizer_updates": 0, "validation_data_read": false}. Only the AR coefficient expression differs in data.py; model code byte-identical to E79. Reuse the exact already-running E79B48/C4096/H1024 compiled allocation after it completes; no extra GPU-memory fixture or baseline retraining needed for a sampler-only change. + +E111 weekly seed523 candidate training started at 2026-10-23T07:42:47Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + + +### E94 matched48000 learning-rate comparison — 2026-10-23T07:46:50.490098+00:00 + +{ + "experiment": "E94 half-rate versus E79 original-rate fresh146M at48000", + "candidate_skill": 0.36570581958166615, + "control_skill": 0.3685434345005941, + "delta": -0.0028376149189279776, + "candidate_hash": "ea9055d683b93a4691e77bd64d46e301302765673055fd9b32ddb3a3e2f749df", + "control_hash": "227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c", + "groups": { + "term": { + "long": -0.006308080487552492, + "medium": 0.0023686540592120497, + "short": -0.0035639256416847287 + }, + "domain": { + "Econ/Fin": -0.0038752234446699507, + "Energy": -0.00047244108396105045, + "Healthcare": 0.0023903022656310835, + "Nature": -0.011893232420320698, + "Sales": 0.024694181264939052, + "Transport": 0.004949441498781182, + "Web/CloudOps": -0.00991799147726491 + }, + "frequency": { + "A": -0.0009237625994724663, + "D": 0.014366973944888062, + "H": -0.0027944742503555053, + "M": -0.04634901411084125, + "Q": 0.013385915439624863, + "S": 0.0019980780959804045, + "T": -0.0036583096822225825, + "W": -0.022089407739222522 + } + }, + "decision": "Early lower-rate advantage reversed; preserve both predeclared96000 schedules. Validation selection only; no new inference or training in this comparison." +} +Logged training-phase wall: E94 10829.8s, E79 11564.9s, both on the shared H100; evaluation38.238023s and37.596497s. No isolated GPU-time claim. + + +### E121 ensemble runtime preparation: first synthetic audit exposed an existing extreme-value composition difference + +At 2026-10-23T07:49:34.397201+00:00, the separate history-aware ensemble runtime matched legacy output on all fixtures and matched standalone composition for ordinary, missing, constant, long-history sign/variance-shift rows. Only deliberately scaled1e22 rows failed independent composition: E71/E93 standalone runtimes replaced nonfinite forecasts before output, while the legacy ensemble replaced nonfinites only after averaging, erasing the finite first member contribution. No validation labels were read, no optimizer steps or publication occurred. Preserved first audit code/log/outputs. The candidate runtime now applies each member's existing finite-value cleanup before averaging; rerun checks ordinary legacy equality and exact standalone composition including extremes. Current published runtime remains unchanged pending candidate full replay. + +E119 learned phase-specific dispersion seed197 training started at 2026-10-23T07:49:44Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + + +## E123 logarithmically spaced requested horizons — predeclared preparation + +2026-10-23T07:50:54.279494+00:00: The current ensemble has lower short-term validation skill than medium/long. E52 already established requested-horizon diversity, but its active prefixes are uniformly betweenH/4 andH, while half of batch horizons are1024. Hypothesis: exposing the same allowed histories/cutoffs to shorter requested horizons improves short-term forecasts without changing source mixture or model. Change only the active half of per-row horizon truncations: reuse each original integer endpoint draw as a quantile, map geometrically frommin(16,max(1,H//4)) toH, then apply the same patch16 rounding. The other half retainH. Consume identical sampler/horizon/batch RNG draws and keep all target values; only mask suffixes earlier. Match completed E80: ownE62initial22c08571978be31ba57368eb983089a40a44d56d4ae5e17da41afd2a761a258c,seed197/B64/LR2e-5/12000/paired/originalgenerator/oldpack. This differs from queuedE113, which shifts cutoffs and contexts only for low-frequency rows. Primary6000,1000/3000diagnostics,12000durability; compare all terms and all four cutoffs before any transfer. No new transfer or horizon-specific inference rule declared. Planned afterE118, no extra concurrent allocation. CPU stream/mask audit before launch; model/runtime/shapes unchanged fromE80, so no redundant GPU allocation fixture. + + +### E123 CPU stream audit and queue — 2026-10-23T07:51:41.253390+00:00 + +{ + "seed": 197, + "horizon_seed": 300200, + "batches": 100, + "rows": 6400, + "changed_masks": 2582, + "contexts_periods_and_retained_targets_bitwise_equal": true, + "sampler_and_horizon_rng_states_bitwise_equal": true, + "finite_targets_only_removed": true, + "model_code_byte_identical": true, + "source_probabilities_bitwise_equal": true, + "control_lengths": { + "mean": 510.11921875, + "median": 505.0, + "at_most32": 0.11453125, + "at_most128": 0.324375, + "above512": 0.4240625, + "empty": 28 + }, + "candidate_lengths": { + "mean": 396.1734375, + "median": 144.0, + "at_most32": 0.20390625, + "at_most128": 0.4959375, + "above512": 0.3, + "empty": 35 + }, + "initial_checkpoint_sha256": "22c08571978be31ba57368eb983089a40a44d56d4ae5e17da41afd2a761a258c", + "seconds": 6.1131663920823485, + "optimizer_updates": 0, + "validation_data_read": false +} +Queued launcher21256/watch21257 afterE118queue18381. Initial/checkpoint/model/runtime unchanged fromE80; no extra concurrent GPU allocation. Seven additional empty-target rows in6400 follow from the shorter masks; the existing finite-target loss handles them without nonfinite loss. No labels used for training or audit. + + +### E121 separate ensemble runtime audit passed — 2026-10-23T07:51:41.253390+00:00 + +{ + "seed": 613, + "generated_utc": "2026-10-23T07:50:46.528945+00:00", + "checks": [ + { + "config": "synthetic_H", + "legacy_ordinary_rows_bitwise": true, + "composition_bitwise": true, + "extreme_legacy_behavior_changed": true, + "finite": true, + "ordered": true, + "n_instances": 12 + }, + { + "config": "synthetic_15T", + "legacy_ordinary_rows_bitwise": true, + "composition_bitwise": true, + "extreme_legacy_behavior_changed": true, + "finite": true, + "ordered": true, + "n_instances": 12 + } + ], + "steps": [ + { + "label": "old_current", + "seconds": 14.261059219017625 + }, + { + "label": "new_current", + "seconds": 15.096283270977437 + }, + { + "label": "mixed", + "seconds": 15.924891367089003 + }, + { + "label": "standalone0", + "seconds": 8.318170101149008 + }, + { + "label": "standalone1", + "seconds": 7.596355753019452 + }, + { + "label": "standalone2", + "seconds": 8.01823993306607 + } + ], + "lock_wait_seconds": 0.000759027898311615, + "seconds": 70.38110470818356, + "optimizer_updates": 0, + "validation_read": false, + "runtime_sha256": "c1876617c78330ba89353f706cfacf7d3671e02a669620a48d9eb7c63e9aa7ef", + "note": "First audit exposed pre-existing final-only nonfinite cleanup: one nonfinite member erased finite member contributions. New runtime matches each standalone member cleanup before averaging. Synthetic fixture only; no forecast-score selection, no publication. Own E107 nonzero weights with E121 history limits verify the extended path." +} +The original failed extreme-value fixture and code are retained. This is infrastructure only, with no model scoring or publication; any later candidate requires full public replay and composition/relocation checks. + + +### E110 matched24000 corpus comparison — 2026-10-23T07:53:20.957033+00:00 + +{ + "experiment": "E110 full corpus versus E94 old pack at24000", + "candidate_skill": 0.35536752960369333, + "control_skill": 0.3554524492447929, + "delta": -8.491964109957895e-05, + "candidate_hash": "076fc28ac9f8ee5d8b2c9bc8336f24163a224e2dd26c11dea6320174d716acad", + "control_hash": "ee69006629037179a8fd6d09233755cb8efceafb0a47494abceceea3cb7fae52", + "groups": { + "term": { + "long": 0.0066183483633208695, + "medium": 0.005359114456888858, + "short": -0.00511225167712015 + }, + "domain": { + "Econ/Fin": 0.01560774310449653, + "Energy": 0.005550732858429663, + "Healthcare": -0.04555123338041678, + "Nature": -0.001542728980177377, + "Sales": -0.0010462981174947927, + "Transport": -0.002019735208625084, + "Web/CloudOps": 0.00285868770816311 + }, + "frequency": { + "A": 0.0014241864241971713, + "D": -0.019689610482476638, + "H": 0.006733299077081645, + "M": -0.06480975110791165, + "Q": -0.0047313751091847545, + "S": -0.00307137574664218, + "T": 0.0058982745621553034, + "W": 0.01652420279074107 + } + }, + "decision": "Earlier deficit nearly disappears; preserve predeclared96000 schedule. No new full-corpus/distillation combination yet." +} +Analysis uses already-completed validation reports, no additional inference or training. + + +### Training-window dynamics audit — 2026-10-23T07:53:20.957033+00:00 + +{ + "seed": 619, + "rows": 10240, + "batches": 160, + "groups": { + "other_frequency_real": { + "rows": 7020, + "median_finite_context": 1024.0, + "context_at_most128": 0.09373219373219373, + "context_above512": 0.6876068376068376, + "median_finite_target": 510.0, + "dynamic_rows": 6892, + "median_abs_recent_change": 0.3054065606608507, + "median_abs_future_change": 0.2920584181814329, + "recent_future_change_correlation": -0.040732554648212585 + }, + "other_frequency_synthetic": { + "rows": 1452, + "median_finite_context": 2048.0, + "context_at_most128": 0.01790633608815427, + "context_above512": 0.8271349862258953, + "median_finite_target": 512.0, + "dynamic_rows": 1449, + "median_abs_recent_change": 0.2098600382721559, + "median_abs_future_change": 0.20923267260726575, + "recent_future_change_correlation": 0.0034826008291495387 + }, + "low_frequency_synthetic": { + "rows": 612, + "median_finite_context": 2048.0, + "context_at_most128": 0.024509803921568627, + "context_above512": 0.8137254901960784, + "median_finite_target": 512.0, + "dynamic_rows": 610, + "median_abs_recent_change": 0.09875074862712509, + "median_abs_future_change": 0.10918120886961286, + "recent_future_change_correlation": 0.16770165507227477 + }, + "low_frequency_real": { + "rows": 1156, + "median_finite_context": 22.0, + "context_at_most128": 0.9160899653979239, + "context_above512": 0.025086505190311418, + "median_finite_target": 39.0, + "dynamic_rows": 757, + "median_abs_recent_change": 0.6538894101925867, + "median_abs_future_change": 0.6044534213626241, + "recent_future_change_correlation": 0.15421289193025312 + } + }, + "seconds": 4.563704397995025, + "generated_utc": "2026-10-23T07:52:57.305581+00:00", + "instrumentation_first640_rows_and_rng_bitwise": true, + "optimizer_updates": 0, + "validation_data_read": false, + "decision": "Descriptive audit only. E113 remains unchanged; no new generator selected." +} +The low-frequency context-length mismatch motivates the already queued E113. The normalized change statistic depends on context length and is descriptive, not evidence that a specific synthetic trend law is wrong. No generator modification is selected. + +## E115 joint phase final12000 backcast_evals +- Checkpoint SHA-256: `3881901e309cfe590e5a38fbf36b6d953f1e447a8c1655d30e2d0dcd53b21947`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 25.93891978263855 seconds. +- Overall skill 0.336448; relative MASE 0.797586; relative WQL 0.552043. +- term skill: long=0.3976, medium=0.3580, short=0.3028. +- domain skill: Econ/Fin=0.1584, Energy=0.2302, Healthcare=0.4175, Nature=0.3635, Sales=0.3939, Transport=0.3734, Web/CloudOps=0.4481. +- frequency skill: A=0.3169, D=0.3539, H=0.3669, M=0.1794, Q=0.2287, S=0.3432, T=0.3347, W=0.2848. +- variates skill: multivariate=0.3523, univariate=0.3236. +- Outcome: Final main gain does not extend to any of three earlier cutoffs. Reject transfer; entire scheduled12000 run completed. E119 now uses its allocation. + +## E115 joint phase final12000 backcast2_evals +- Checkpoint SHA-256: `3881901e309cfe590e5a38fbf36b6d953f1e447a8c1655d30e2d0dcd53b21947`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 25.23729419708252 seconds. +- Overall skill 0.360471; relative MASE 0.769208; relative WQL 0.531712. +- term skill: long=0.3639, medium=0.3900, short=0.3474. +- domain skill: Econ/Fin=0.1009, Energy=0.2376, Healthcare=0.3660, Nature=0.4734, Sales=0.5482, Transport=0.4209, Web/CloudOps=0.4327. +- frequency skill: A=0.3494, D=0.4273, H=0.3907, M=0.1606, Q=0.1427, S=0.2811, T=0.3608, W=0.2731. +- variates skill: multivariate=0.3634, univariate=0.3581. +- Outcome: Final main gain does not extend to any of three earlier cutoffs. Reject transfer; entire scheduled12000 run completed. E119 now uses its allocation. + +## E115 joint phase final12000 backcast3_evals +- Checkpoint SHA-256: `3881901e309cfe590e5a38fbf36b6d953f1e447a8c1655d30e2d0dcd53b21947`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 24.674077033996582 seconds. +- Overall skill 0.387451; relative MASE 0.740469; relative WQL 0.506727. +- term skill: long=0.3956, medium=0.3594, short=0.3947. +- domain skill: Econ/Fin=0.1657, Energy=0.3176, Healthcare=0.2691, Nature=0.5021, Sales=0.3988, Transport=0.5045, Web/CloudOps=0.3895. +- frequency skill: A=0.3495, D=0.4401, H=0.4024, M=0.1393, Q=0.2584, S=0.2912, T=0.4267, W=0.2614. +- variates skill: multivariate=0.3719, univariate=0.3994. +- Outcome: Final main gain does not extend to any of three earlier cutoffs. Reject transfer; entire scheduled12000 run completed. E119 now uses its allocation. + + +### E115 final durability decision — 2026-10-23T07:53:57.917713+00:00 + +{ + "experiment": "E115 final12000 durability", + "results": [ + { + "cutoff": "evals", + "candidate_skill": 0.3778925567049696, + "control_skill": 0.37742394607564755, + "delta": 0.00046861062932201936, + "candidate_hash": "3881901e309cfe590e5a38fbf36b6d953f1e447a8c1655d30e2d0dcd53b21947", + "control_hash": "f11d056b95f1c5eeef174265ebc51742952600e0dae1fa52900860447d5be819", + "groups": { + "term": { + "long": 0.0007551829471643678, + "medium": 0.0005399265973557998, + "short": 0.0003205426244053955 + }, + "domain": { + "Econ/Fin": 0.0026749976350706195, + "Energy": 0.0010280848367260065, + "Healthcare": 0.002513727759610118, + "Nature": 0.0009755955854692244, + "Sales": -0.0010722281827152402, + "Transport": 7.34692219485078e-05, + "Web/CloudOps": -0.0008110839721524599 + }, + "frequency": { + "A": 0.0019621222069610145, + "D": 0.0017268222442292647, + "H": 0.0006945679359758872, + "M": 0.0018297098176588422, + "Q": -0.0003820175145841098, + "S": 0.0005249370631543737, + "T": -0.0001720234383183472, + "W": -0.0011357933291050726 + } + } + }, + { + "cutoff": "backcast_evals", + "candidate_skill": 0.3364479011265926, + "control_skill": 0.33652833730727594, + "delta": -8.04361806833187e-05, + "candidate_hash": "3881901e309cfe590e5a38fbf36b6d953f1e447a8c1655d30e2d0dcd53b21947", + "control_hash": "f11d056b95f1c5eeef174265ebc51742952600e0dae1fa52900860447d5be819", + "groups": { + "term": { + "long": 0.00016716033873442893, + "medium": -0.0007783077314573728, + "short": 9.999343723732235e-05 + }, + "domain": { + "Econ/Fin": 0.0034523972337110465, + "Energy": 0.00019134656742725298, + "Healthcare": -0.0018918585547146316, + "Nature": 6.700484163635334e-05, + "Sales": -0.0008093804403472848, + "Transport": 0.00011479441302009175, + "Web/CloudOps": -0.0007443198776549975 + }, + "frequency": { + "A": 2.8931234940632322e-05, + "D": 0.0015561664379444284, + "H": 6.460395876151104e-05, + "M": -0.001121458080245663, + "Q": 0.00010242765184809155, + "S": 0.0013966664704375686, + "T": -0.0012845052122840706, + "W": 7.914588676039003e-05 + } + } + }, + { + "cutoff": "backcast2_evals", + "candidate_skill": 0.36047103767996824, + "control_skill": 0.36097346960650367, + "delta": -0.0005024319265354293, + "candidate_hash": "3881901e309cfe590e5a38fbf36b6d953f1e447a8c1655d30e2d0dcd53b21947", + "control_hash": "f11d056b95f1c5eeef174265ebc51742952600e0dae1fa52900860447d5be819", + "groups": { + "term": { + "long": -0.0006005654328086196, + "medium": -0.0002021528350056867, + "short": -0.0005915736701820329 + }, + "domain": { + "Econ/Fin": 6.3013984400450695e-06, + "Energy": -0.0009007624833653471, + "Healthcare": 0.0047114825921613646, + "Nature": -0.0015395945891927276, + "Sales": 0.00014432948317333327, + "Transport": 0.0005150338454551484, + "Web/CloudOps": -0.0012703692235170871 + }, + "frequency": { + "A": -0.0015608772340366395, + "D": 0.00030188862261526506, + "H": 0.0001943772823068679, + "M": -0.0005187099890650027, + "Q": -0.0005106669012917564, + "S": 0.0009339296164969646, + "T": -0.0017296888300678548, + "W": -0.00136940093009974 + } + } + }, + { + "cutoff": "backcast3_evals", + "candidate_skill": 0.387451491496983, + "control_skill": 0.3874814849803516, + "delta": -2.9993483368628837e-05, + "candidate_hash": "3881901e309cfe590e5a38fbf36b6d953f1e447a8c1655d30e2d0dcd53b21947", + "control_hash": "f11d056b95f1c5eeef174265ebc51742952600e0dae1fa52900860447d5be819", + "groups": { + "term": { + "long": 0.00030593631400455124, + "medium": 0.0002832620919390738, + "short": -0.0002578885558356392 + }, + "domain": { + "Econ/Fin": 0.0007833141379801623, + "Energy": -0.0006056144184419798, + "Healthcare": -0.0027216797213800437, + "Nature": 0.00048301125176675175, + "Sales": -8.841270514148292e-05, + "Transport": 0.0003993064983340844, + "Web/CloudOps": 0.0003902518340567207 + }, + "frequency": { + "A": 0.0016810475853026308, + "D": -0.00056261654858758, + "H": -0.00019302241203689174, + "M": 0.002605153074515587, + "Q": -0.0012757918233360366, + "S": 0.0028281089083405098, + "T": -0.000444785271267234, + "W": 0.0005135461601460944 + } + } + } + ], + "mean_diagnostic_skill_delta": -3.606274031633938e-05, + "decision": "Reject transfer; main-only gain, all three earlier diagnostics lower. E115 complete, no combined phase/seasonal model created." +} +Trainingloop2333.941144s; process2350.583369s on sharedH100. No transfer assembled or published. + + +### E111 seed523 matched3000 diagnostic + +{ + "experiment": "E111 seed523 weekly synthesis at3000", + "candidate_skill": 0.3797743795241497, + "control_skill": 0.37742318829464827, + "delta": 0.002351191229501448, + "candidate_hash": "ba3fcd7179fb75b8b62a3907ef4dff96c49145d230bf299c2fc36f362b85ebd3", + "control_hash": "feaf2ac11b13882c968b73d445e377276bb0278c9a59e1345806ac33f90e1901", + "groups": { + "term": { + "long": -0.0003734133982308263, + "medium": -0.00016266512388696253, + "short": 0.004502223173963982 + }, + "domain": { + "Econ/Fin": -0.004187422115931705, + "Energy": 0.0001287333424395687, + "Healthcare": 0.040625614337162164, + "Nature": 0.0017461734714656618, + "Sales": 0.0005922345668298856, + "Transport": 0.0003277958817268223, + "Web/CloudOps": -0.001337662723777444 + }, + "frequency": { + "A": -0.00028746342219676535, + "D": -3.56775488330463e-05, + "H": -6.780036292286518e-05, + "M": 0.02708306492322632, + "Q": 0.00040066853047870943, + "S": 3.753362014269346e-05, + "T": -0.0001576457412183485, + "W": 0.021646690122148926 + } + }, + "decision": "Positive early replication; wait primary6000 and earlier cutoffs. No new transfer/averaging rule." +} +Uses completed watcher reports only; no additional training or inference. + + +## E124 equal-seed weekly correction — predeclared conditional selection + +Hypothesis: averaging the matched weekly-synthetic training differences across seeds197 and523 reduces seed-specific noise without adding inference cost. Freeze the current E117final12000 first member as base (SHA8a2b252b733cc79c31778ea27ba00fbe61206fef50454514b667c54a928d80a4). One candidate, coefficient0.5, duration6000 only: base +0.5*((weekly523_6000-control523_6000)-(weekly197_6000-control197_6000)). Apply this to shared parameters only; the base's three added long-seasonal tensors stay bitwise unchanged. Existing spectral/slow-AR/long-seasonal corrections remain present. E71patch8_6000/E93split_12000 stay unchanged, fixed equal three-member output average, all members forecast every instance. No coefficient/duration sweep. + +Proceed only if E111primary6000 beats its seed523control on at least3 of4diagnostic cutoffs with positive mean skill difference. Then evaluate the single fixed merged checkpoint and equal ensemble at all four cutoffs; advance to full replay only for at least3of4ensemble gains and positive mean versus immutableE117final12000. Publication additionally requires full97configuration improvement, no failures, relocation/determinism and independent composition checks. No optimizer updates or validation training. The comparison of3k is already positive; primary6k and earlier candidate metrics are still unavailable at declaration. Use the unchanged published ensemble runtime for this study; the separately prepared E121runtime is a different factor. +Declared 2026-10-23T07:57:32.400427+00:00. + + +### E119 matched3000 dispersion diagnostic + +{ + "experiment": "E119 dispersion versus E107 at3000", + "candidate_skill": 0.3815441525201153, + "control_skill": 0.3817505923699258, + "delta": -0.00020643984981050245, + "candidate_hash": "a78e34a619ace1c6ba1867d98496b7537c8ce8e449444e42ce7eb9e09f8f1a54", + "control_hash": "92e575ca3cb053d9bdf75a010d83ded0025fe97c906fb9930c74dc1a28e1e892", + "groups": { + "term": { + "long": -1.2229681438435946e-05, + "medium": 7.023840094277922e-05, + "short": -0.0003995973540478204 + }, + "domain": { + "Econ/Fin": 0.00027946829089275926, + "Energy": -7.99416262584618e-05, + "Healthcare": -0.0020021058239552136, + "Nature": -0.00020712969475200627, + "Sales": -4.6786221165273645e-05, + "Transport": 0.00018673388204337726, + "Web/CloudOps": -0.0003041789689921526 + }, + "frequency": { + "A": 0.00036916672182307764, + "D": -0.0009145361219375925, + "H": -0.00031670885705470386, + "M": 0.00037779472561139116, + "Q": 0.00012017765676031189, + "S": -0.000309243994029762, + "T": 4.948408615323974e-05, + "W": 0.0003294878154047609 + } + }, + "decision": "No early gain; retain predeclared6000primary/12000durability. No transfer." +} +Comparison uses completed reports only; no additional inference or optimizer updates. + + +### Frozen-teacher compiler audit — engineering preparation, no training change + +Hypothesis: compiling the three frozen E96 teacher forwards can reduce the large per-update cost of E101. Benchmark the existing eager teacher versus torch.compile(fullgraph=True,dynamic=False) on locally generated fixture contexts/targets at training shapes, with unchanged E96 weights, sign pairing, finite masks and forecast lengths. Compare quantiles/masks and shared-H100 timing; no validation data or optimizer updates. This does not authorize silently changing the active E101 implementation. If outputs differ, any later adoption must be explicitly recorded and evaluated as a continuation variant. No compiler target or training coefficient is changed by this audit. + +## E111 primary6000 candidate valid_backcast +- Checkpoint SHA-256: `8c67d1285a467d32a4e758292bb1668dbaaa96c3fd6599a04653285db2e67792`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 24.258385181427002 seconds. +- Overall skill 0.336681; relative MASE 0.798249; relative WQL 0.551197. +- term skill: long=0.3978, medium=0.3581, short=0.3031. +- domain skill: Econ/Fin=0.1578, Energy=0.2287, Healthcare=0.4099, Nature=0.3658, Sales=0.3992, Transport=0.3748, Web/CloudOps=0.4492. +- frequency skill: A=0.3239, D=0.3524, H=0.3666, M=0.1758, Q=0.2291, S=0.3414, T=0.3354, W=0.2922. +- variates skill: multivariate=0.3524, univariate=0.3239. +- Outcome: Independent-seed matched replication; no validation training. Four-cutoff comparison determines the predeclared E124 gate. + +## E111 primary6000 control valid_backcast +- Checkpoint SHA-256: `674137ac14bce26f6983cb68123e34d01ca598bb3ad72e81cbd197d138ed6104`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 25.904212474822998 seconds. +- Overall skill 0.336863; relative MASE 0.797598; relative WQL 0.551344. +- term skill: long=0.3975, medium=0.3578, short=0.3036. +- domain skill: Econ/Fin=0.1614, Energy=0.2300, Healthcare=0.4123, Nature=0.3633, Sales=0.3981, Transport=0.3741, Web/CloudOps=0.4494. +- frequency skill: A=0.3229, D=0.3533, H=0.3666, M=0.1824, Q=0.2284, S=0.3417, T=0.3358, W=0.2875. +- variates skill: multivariate=0.3531, univariate=0.3237. +- Outcome: Independent-seed matched replication; no validation training. Four-cutoff comparison determines the predeclared E124 gate. + +## E111 primary6000 candidate valid_backcast2 +- Checkpoint SHA-256: `8c67d1285a467d32a4e758292bb1668dbaaa96c3fd6599a04653285db2e67792`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 24.067421197891235 seconds. +- Overall skill 0.358345; relative MASE 0.770722; relative WQL 0.534203. +- term skill: long=0.3618, medium=0.3869, short=0.3456. +- domain skill: Econ/Fin=0.1061, Energy=0.2376, Healthcare=0.3412, Nature=0.4706, Sales=0.5470, Transport=0.4219, Web/CloudOps=0.4299. +- frequency skill: A=0.3474, D=0.4283, H=0.3890, M=0.1688, Q=0.1508, S=0.2742, T=0.3595, W=0.2563. +- variates skill: multivariate=0.3623, univariate=0.3551. +- Outcome: Independent-seed matched replication; no validation training. Four-cutoff comparison determines the predeclared E124 gate. + +## E111 primary6000 control valid_backcast2 +- Checkpoint SHA-256: `674137ac14bce26f6983cb68123e34d01ca598bb3ad72e81cbd197d138ed6104`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 23.221482515335083 seconds. +- Overall skill 0.359281; relative MASE 0.770398; relative WQL 0.532868. +- term skill: long=0.3623, medium=0.3874, short=0.3469. +- domain skill: Econ/Fin=0.1069, Energy=0.2374, Healthcare=0.3682, Nature=0.4678, Sales=0.5477, Transport=0.4215, Web/CloudOps=0.4305. +- frequency skill: A=0.3465, D=0.4288, H=0.3891, M=0.1732, Q=0.1502, S=0.2762, T=0.3596, W=0.2634. +- variates skill: multivariate=0.3628, univariate=0.3565. +- Outcome: Independent-seed matched replication; no validation training. Four-cutoff comparison determines the predeclared E124 gate. + +## E111 primary6000 candidate valid_backcast3 +- Checkpoint SHA-256: `8c67d1285a467d32a4e758292bb1668dbaaa96c3fd6599a04653285db2e67792`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 24.324751377105713 seconds. +- Overall skill 0.389207; relative MASE 0.737424; relative WQL 0.505907. +- term skill: long=0.3942, medium=0.3592, short=0.3983. +- domain skill: Econ/Fin=0.1642, Energy=0.3173, Healthcare=0.2941, Nature=0.5034, Sales=0.3981, Transport=0.5056, Web/CloudOps=0.3912. +- frequency skill: A=0.3470, D=0.4390, H=0.4042, M=0.1470, Q=0.2543, S=0.2835, T=0.4301, W=0.2684. +- variates skill: multivariate=0.3734, univariate=0.4014. +- Outcome: Independent-seed matched replication; no validation training. Four-cutoff comparison determines the predeclared E124 gate. + +## E111 primary6000 control valid_backcast3 +- Checkpoint SHA-256: `674137ac14bce26f6983cb68123e34d01ca598bb3ad72e81cbd197d138ed6104`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 23.96277379989624 seconds. +- Overall skill 0.389075; relative MASE 0.736946; relative WQL 0.506454. +- term skill: long=0.3937, medium=0.3598, short=0.3979. +- domain skill: Econ/Fin=0.1644, Energy=0.3181, Healthcare=0.2751, Nature=0.5053, Sales=0.3977, Transport=0.5053, Web/CloudOps=0.3920. +- frequency skill: A=0.3453, D=0.4399, H=0.4047, M=0.1292, Q=0.2542, S=0.2852, T=0.4297, W=0.2702. +- variates skill: multivariate=0.3739, univariate=0.4008. +- Outcome: Independent-seed matched replication; no validation training. Four-cutoff comparison determines the predeclared E124 gate. + + +### E111 primary replication / E124 conditional gate outcome — 2026-10-23T08:04:25.847630+00:00 + +{ + "results": [ + { + "cutoff": "valid_screen", + "candidate_skill": 0.37996963634005054, + "control_skill": 0.3764059869702334, + "delta": 0.0035636493698171234, + "candidate_hash": "8c67d1285a467d32a4e758292bb1668dbaaa96c3fd6599a04653285db2e67792", + "control_hash": "674137ac14bce26f6983cb68123e34d01ca598bb3ad72e81cbd197d138ed6104" + }, + { + "cutoff": "valid_backcast", + "candidate_skill": 0.3366810094726821, + "control_skill": 0.33686271636038767, + "delta": -0.0001817068877055794, + "candidate_hash": "8c67d1285a467d32a4e758292bb1668dbaaa96c3fd6599a04653285db2e67792", + "control_hash": "674137ac14bce26f6983cb68123e34d01ca598bb3ad72e81cbd197d138ed6104" + }, + { + "cutoff": "valid_backcast2", + "candidate_skill": 0.3583446416420619, + "control_skill": 0.3592811180029256, + "delta": -0.0009364763608636917, + "candidate_hash": "8c67d1285a467d32a4e758292bb1668dbaaa96c3fd6599a04653285db2e67792", + "control_hash": "674137ac14bce26f6983cb68123e34d01ca598bb3ad72e81cbd197d138ed6104" + }, + { + "cutoff": "valid_backcast3", + "candidate_skill": 0.38920731977391243, + "control_skill": 0.38907521863271344, + "delta": 0.00013210114119899252, + "candidate_hash": "8c67d1285a467d32a4e758292bb1668dbaaa96c3fd6599a04653285db2e67792", + "control_hash": "674137ac14bce26f6983cb68123e34d01ca598bb3ad72e81cbd197d138ed6104" + } + ], + "mean_skill_delta": 0.0006443918156117112, + "decision": "E124 not run: primary E111replication has only2of4positive cutoffs, failing predeclared3of4gate despite positive mean. No merged checkpoint, no ensemble probe/full replay or publication. E11112000durability remains planned." +} +E124selection runner 326.826085990062seconds wall including waiting; only E111diagnostic inference was performed. E124model algebra, CPUforward and ensemble/full-suite code were prepared but not executed. + + +## E125 seasonal-query versus direct-median contribution — predeclared diagnostic + +2026-10-23T08:05:46.953758+00:00: E120 established that removing both learned seasonal paths hurts all four cutoffs. Resolve which path drives that effect using two fixed inference ablations of the immutable E107EMA6000(ad45e0cfae574d3dc1be0b9720c9be0863db9ffe33891fdb22c86dfa83667253): (a)zero long_query.weight only, leaving learned direct median gates; (b)zero long_head.weight and bias only, leaving decoder query features. All other weights, model graph, normalization and fixed forecast rules stay unchanged. No optimizer updates, no new training data or coefficients. CPUfixture seed647 checks unchanged tensors, identical normalization, finite ordered forecasts and nonzero functional change; then evaluate all four cutoffs. This is a mechanism diagnostic, not an automatic publication candidate or transfer. Any follow-up architecture decision must be declared separately. + +## E125 seasonal_no_query6k evals +- Checkpoint SHA-256: `3670e55131f07c6d4b31daaeb57e6678c3722d0eb11308f7cadc3b01730dc8e4`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 27.681535482406616 seconds. +- Overall skill 0.381850; relative MASE 0.739570; relative WQL 0.516664. +- term skill: long=0.4049, medium=0.4080, short=0.3624. +- domain skill: Econ/Fin=0.1268, Energy=0.2410, Healthcare=0.4571, Nature=0.4342, Sales=0.3405, Transport=0.4758, Web/CloudOps=0.5052. +- frequency skill: A=0.3682, D=0.3687, H=0.4005, M=0.1021, Q=0.1933, S=0.4260, T=0.4394, W=0.2208. +- variates skill: multivariate=0.3987, univariate=0.3681. +- Outcome: Fixed component ablation of E1076000; mechanism diagnostic only, no training or automatic publication. + +## E125 seasonal_no_query6k backcast_evals +- Checkpoint SHA-256: `3670e55131f07c6d4b31daaeb57e6678c3722d0eb11308f7cadc3b01730dc8e4`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 26.842697381973267 seconds. +- Overall skill 0.339286; relative MASE 0.794169; relative WQL 0.549686. +- term skill: long=0.4023, medium=0.3606, short=0.3049. +- domain skill: Econ/Fin=0.1476, Energy=0.2303, Healthcare=0.3882, Nature=0.3808, Sales=0.4041, Transport=0.3795, Web/CloudOps=0.4509. +- frequency skill: A=0.3114, D=0.3658, H=0.3739, M=0.1675, Q=0.2373, S=0.3420, T=0.3328, W=0.2810. +- variates skill: multivariate=0.3547, univariate=0.3267. +- Outcome: Fixed component ablation of E1076000; mechanism diagnostic only, no training or automatic publication. + +## E125 seasonal_no_query6k backcast2_evals +- Checkpoint SHA-256: `3670e55131f07c6d4b31daaeb57e6678c3722d0eb11308f7cadc3b01730dc8e4`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 27.00600552558899 seconds. +- Overall skill 0.362807; relative MASE 0.766129; relative WQL 0.529956. +- term skill: long=0.3663, medium=0.3955, short=0.3484. +- domain skill: Econ/Fin=0.0932, Energy=0.2386, Healthcare=0.3622, Nature=0.4806, Sales=0.5520, Transport=0.4264, Web/CloudOps=0.4333. +- frequency skill: A=0.3460, D=0.4301, H=0.3964, M=0.1803, Q=0.1484, S=0.2837, T=0.3610, W=0.2608. +- variates skill: multivariate=0.3655, univariate=0.3606. +- Outcome: Fixed component ablation of E1076000; mechanism diagnostic only, no training or automatic publication. + +## E125 seasonal_no_query6k backcast3_evals +- Checkpoint SHA-256: `3670e55131f07c6d4b31daaeb57e6678c3722d0eb11308f7cadc3b01730dc8e4`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 27.12690496444702 seconds. +- Overall skill 0.394311; relative MASE 0.730710; relative WQL 0.502059. +- term skill: long=0.3994, medium=0.3622, short=0.4040. +- domain skill: Econ/Fin=0.1623, Energy=0.3228, Healthcare=0.3091, Nature=0.5086, Sales=0.4035, Transport=0.5116, Web/CloudOps=0.3936. +- frequency skill: A=0.3574, D=0.4569, H=0.4096, M=0.1695, Q=0.2587, S=0.2912, T=0.4283, W=0.2619. +- variates skill: multivariate=0.3765, univariate=0.4080. +- Outcome: Fixed component ablation of E1076000; mechanism diagnostic only, no training or automatic publication. + + +## E126 bounded compiled-teacher continuation — predeclared preparation + +2026-10-23T08:12:21.857671+00:00: The synthetic compiler audit shows1.48–2.00x faster frozen E96teacher calls under sharedH100 load, with identical validity masks but non-bitwise quantiles (relative RMSdifference~0.00035–0.00047). E101distillation remains useful at16000:0.363473693 versus matchedE940.354615664. Test numerical training impact before changing the original implementation. Start from immutable complete E101step16000 recovery SHA81e71006dd9cd52612d203e96c8cc658b80118c061b0b5d8720b37da1c3e0935, preserve Adam/EMA/allRNG/prefetched batch and original96000LRschedule, seed307/B48/oldpack/slowAR/paired/studentcompiled/teacherE96coefficient0.5. Only change frozen teacher calls to torch.compile(fullgraph=True,dynamic=False). Stop at17000 (1000new updates), compare with the original E101saved17000 on all four diagnostic cutoffs. Keep the original E101running. + +Before launch, a maxB48C4096H1024 audit with the mature16000student must show finite gradients, loss agreement within0.3%, gradientcosine>.995, identical teacher validity, and reservedmemory<14GiB including Adam/EMA placeholders. A temporary seventh process is permitted only after measuring enough free memory on the same singleH100; no second GPU or additional CPU allocation. This trial makes no publication or automatic takeover. Later adoption requires explicit review of timings/numerical divergence and model forecasts; do not silently combine with teacher-coefficient annealing, teacher refresh, full corpus or another factor. The1000-update probe also warms teacher compiled shapes; report cold compile and training time honestly. + +Completed teacher compiler audit: {"status": "complete", "seed": 641, "teacher_descriptor_sha256": "1503d92ce031ec0c0e0533ece20d0516a0eceb134802d51746e24a44c4b5ee9b", "rows": [{"context": 512, "horizon": 32, "batch": 48, "compile_first_call_seconds": 78.96409600507468, "mask_bitwise_equal": true, "quantiles_bitwise_equal": false, "maximum_absolute_difference": 0.01088714599609375, "mean_absolute_difference": 0.0005115967942401767, "rms_difference": 0.0007116682245396078, "eager_quantile_rms": 1.515346646308899, "valid_rows": 47, "seconds_per_call": {"eager_first": 0.095995718089398, "compiled_first": 0.04834699417309215, "compiled_second": 0.04806781424364696, "eager_second": 0.09657300100661814}, "peak_reserved_mib": 764.0}, {"context": 2048, "horizon": 512, "batch": 48, "compile_first_call_seconds": 70.28295603999868, "mask_bitwise_equal": true, "quantiles_bitwise_equal": false, "maximum_absolute_difference": 0.03644561767578125, "mean_absolute_difference": 0.0005734049482271075, "rms_difference": 0.0012666580732911825, "eager_quantile_rms": 3.636091947555542, "valid_rows": 47, "seconds_per_call": {"eager_first": 0.24695850332500413, "compiled_first": 0.15215913150071478, "compiled_second": 0.1510773518239148, "eager_second": 0.23846306465566158}, "peak_reserved_mib": 1586.0}, {"context": 4096, "horizon": 1024, "batch": 48, "compile_first_call_seconds": 71.95634523383342, "mask_bitwise_equal": true, "quantiles_bitwise_equal": false, "maximum_absolute_difference": 0.05052947998046875, "mean_absolute_difference": 0.0005942085990682244, "rms_difference": 0.001294782035984099, "eager_quantile_rms": 3.725360870361328, "valid_rows": 47, "seconds_per_call": {"eager_first": 0.45826623084334034, "compiled_first": 0.30095767183229327, "compiled_second": 0.34795630965769914, "eager_second": 0.5011981244121367}, "peak_reserved_mib": 2738.0}], "lock_wait_seconds": 0.000400397926568985, "seconds": 271.9287391670514, "generated_utc": "2026-10-23T08:08:27.316747+00:00", "optimizer_updates": 0, "validation_data_read": false, "active_E101_modified": false, "note": "Times are wall-clock measurements under shared single-H100 load, not isolated kernel speed. No training implementation selected by this audit."} + +Immutable16000 recovery snapshot: { + "path": "/workspace/research/distill_ensemble_recovery016000.pt", + "sha256": "81e71006dd9cd52612d203e96c8cc658b80118c061b0b5d8720b37da1c3e0935", + "step": 16000, + "complete_optimizer_ema_rng_prefetched_batch": true, + "verification_and_hash_seconds": 3.710943895857781, + "utc": "2026-10-23T08:07:09.849318+00:00", + "reason": "Immutable branch point for possible later declared distillation schedule/compiler study; no variant selected or launched.", + "note": "Initial copy succeeded at16000; assertion incorrectly expected key ema rather than ema_state. Verified/reused that same immutable temporary copy, without rereading mutable live recovery. No training state modified." +} + + +### E101 matched16000 distillation diagnostic — 2026-10-23T08:13:48.893370+00:00 + +{ + "experiment": "E101 own-ensemble distillation versus E94 at16000", + "candidate_skill": 0.3634736933529894, + "control_skill": 0.35461566373218645, + "delta": 0.008858029620802954, + "candidate_hash": "7adc72c9070576fd9c3d4d0f24f0540426e65b83badbe59537ca0e58b4843d34", + "control_hash": "19f9ead156ea9bc4a3edca1303bc5595057b2e1b89ff88e7bb7d9acf39618ba5", + "groups": { + "term": { + "long": 0.005875203966622888, + "medium": 0.008206541750095275, + "short": 0.010341209368318616 + }, + "domain": { + "Econ/Fin": 0.011618545269489577, + "Energy": 0.012045294079029989, + "Healthcare": 0.03736270098484029, + "Nature": -0.007342708743686921, + "Sales": -8.327111726524894e-05, + "Transport": 0.007870063310169595, + "Web/CloudOps": 0.01106951784068222 + }, + "frequency": { + "A": 0.014232599133729873, + "D": -0.013505393467374338, + "H": 0.011650739340949401, + "M": -0.015525930901423846, + "Q": 0.016462852241035608, + "S": 0.0030705164143619568, + "T": 0.020171322356402066, + "W": 0.004779721931400305 + } + }, + "decision": "Strong update-count gain persists. OriginalE101 recipe stays fixed; separate E126 bounded compiler probe prepared, not coefficient annealing. Shared-wall efficiency requires measured comparison, not update counts alone." +} +E101loop8126.2s at16000; evaluation37.404650s under sharedH100. + + +### E125 component preparation audit + +{ + "seed": 647, + "rows": [ + { + "name": "seasonal_no_query6k", + "checkpoint_sha256": "3670e55131f07c6d4b31daaeb57e6678c3722d0eb11308f7cadc3b01730dc8e4", + "method": "fixed single-component inference ablation", + "zeroed_tensors": [ + "long_query.weight" + ], + "all_other_tensors_bitwise_unchanged": true, + "normalization_bitwise_unchanged": true, + "finite_ordered_fixture": true, + "fixture_maximum_quantile_change": 0.019054830074310303, + "check_seed": 647, + "parent_sha256": "ad45e0cfae574d3dc1be0b9720c9be0863db9ffe33891fdb22c86dfa83667253", + "optimizer_updates": 0, + "validation_data_read": false + }, + { + "name": "seasonal_no_head6k", + "checkpoint_sha256": "97318093a014742f4968ef363909b072748176288da86032153f97601960afcc", + "method": "fixed single-component inference ablation", + "zeroed_tensors": [ + "long_head.weight", + "long_head.bias" + ], + "all_other_tensors_bitwise_unchanged": true, + "normalization_bitwise_unchanged": true, + "finite_ordered_fixture": true, + "fixture_maximum_quantile_change": 0.2622612714767456, + "check_seed": 647, + "parent_sha256": "ad45e0cfae574d3dc1be0b9720c9be0863db9ffe33891fdb22c86dfa83667253", + "optimizer_updates": 0, + "validation_data_read": false + } + ], + "seconds": 2.5344709930941463, + "optimizer_updates": 0, + "validation_data_read": false +} +Controller22069 started08:06:33UTC, awaited compiler audit, now evaluates all four cutoffs for both ablations. + +## E125 seasonal_no_head6k evals +- Checkpoint SHA-256: `97318093a014742f4968ef363909b072748176288da86032153f97601960afcc`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 31.10630750656128 seconds. +- Overall skill 0.379404; relative MASE 0.743137; relative WQL 0.518263. +- term skill: long=0.4015, medium=0.4071, short=0.3597. +- domain skill: Econ/Fin=0.1249, Energy=0.2395, Healthcare=0.4706, Nature=0.4303, Sales=0.3367, Transport=0.4669, Web/CloudOps=0.5039. +- frequency skill: A=0.3682, D=0.3577, H=0.3975, M=0.1101, Q=0.1913, S=0.4253, T=0.4375, W=0.2295. +- variates skill: multivariate=0.3973, univariate=0.3648. +- Outcome: Fixed component ablation of E1076000; mechanism diagnostic only, no training or automatic publication. + +## E125 seasonal_no_head6k backcast_evals +- Checkpoint SHA-256: `97318093a014742f4968ef363909b072748176288da86032153f97601960afcc`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 26.683140993118286 seconds. +- Overall skill 0.335854; relative MASE 0.797806; relative WQL 0.552878. +- term skill: long=0.3983, medium=0.3574, short=0.3016. +- domain skill: Econ/Fin=0.1452, Energy=0.2276, Healthcare=0.4119, Nature=0.3667, Sales=0.3969, Transport=0.3728, Web/CloudOps=0.4503. +- frequency skill: A=0.3114, D=0.3508, H=0.3678, M=0.1843, Q=0.2358, S=0.3419, T=0.3329, W=0.2854. +- variates skill: multivariate=0.3526, univariate=0.3222. +- Outcome: Fixed component ablation of E1076000; mechanism diagnostic only, no training or automatic publication. + +## E125 seasonal_no_head6k backcast2_evals +- Checkpoint SHA-256: `97318093a014742f4968ef363909b072748176288da86032153f97601960afcc`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 25.467807054519653 seconds. +- Overall skill 0.359182; relative MASE 0.769824; relative WQL 0.533430. +- term skill: long=0.3643, medium=0.3894, short=0.3452. +- domain skill: Econ/Fin=0.0923, Energy=0.2361, Healthcare=0.3632, Nature=0.4715, Sales=0.5464, Transport=0.4215, Web/CloudOps=0.4328. +- frequency skill: A=0.3460, D=0.4231, H=0.3914, M=0.1626, Q=0.1474, S=0.2815, T=0.3603, W=0.2637. +- variates skill: multivariate=0.3629, univariate=0.3562. +- Outcome: Fixed component ablation of E1076000; mechanism diagnostic only, no training or automatic publication. + +## E125 seasonal_no_head6k backcast3_evals +- Checkpoint SHA-256: `97318093a014742f4968ef363909b072748176288da86032153f97601960afcc`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 27.682344436645508 seconds. +- Overall skill 0.390150; relative MASE 0.735335; relative WQL 0.505780. +- term skill: long=0.3966, medium=0.3616, short=0.3981. +- domain skill: Econ/Fin=0.1622, Energy=0.3185, Healthcare=0.2876, Nature=0.5074, Sales=0.3983, Transport=0.5072, Web/CloudOps=0.3905. +- frequency skill: A=0.3574, D=0.4483, H=0.4039, M=0.1441, Q=0.2559, S=0.2900, T=0.4285, W=0.2615. +- variates skill: multivariate=0.3721, univariate=0.4040. +- Outcome: Fixed component ablation of E1076000; mechanism diagnostic only, no training or automatic publication. + +E126 bounded compiled-teacher probe16000to17000 training started at 2026-10-23T08:15:29Z, as an authorized immediate bounded trial; required checkpoint files are present. Settings are unchanged from the declared comparison. + + +## E127 preserve each member's finite forecast fallback before averaging — declared numerical fix + +The E121 synthetic runtime audit exposed an existing composition mismatch on1e22contexts: E71/E93 standalone outputs replace nonfinite forecasts before writing, while the ensemble replaced nonfinites only after averaging, erasing the finite first-member contribution. Stage the checked history_three_patch_ensemble runtime (predict SHA c1876617c78330ba89353f706cfacf7d3671e02a669620a48d9eb7c63e9aa7ef) with exactly the published E117final/E71/E93weights. The added per-member history-cap support is inactive for these4096-context models. No model parameter, training data, source mixture or ensemble weight changes. Fixed inference seed0; synthetic fixture seed613. + +Require a fresh full public replay on97configs/151170instances with0failures, bitwise equality of every mean/quantile array to the existing E117full predictions, relocation/determinism, existing independent three-config member composition, and an independent synthetic extreme-value composition test using the actual published first member. If any ordinary/full output differs, stop and diagnose rather than automatically publish. On success the validation skill is unchanged and the numerical contract is more faithful; publish atomically and record the new runtime hash. This is not a forecast-score gain or a new trained model. + + +### E125 component diagnostic completed — 2026-10-23T08:19:13.642566+00:00 + +[ + { + "name": "seasonal_no_query6k", + "cutoff": "evals", + "skill": 0.3818501008693248, + "control_skill": 0.38227466722292214, + "delta": -0.0004245663535973332, + "checkpoint_sha256": "3670e55131f07c6d4b31daaeb57e6678c3722d0eb11308f7cadc3b01730dc8e4" + }, + { + "name": "seasonal_no_query6k", + "cutoff": "backcast_evals", + "skill": 0.33928591943676045, + "control_skill": 0.33985253853394604, + "delta": -0.0005666190971855833, + "checkpoint_sha256": "3670e55131f07c6d4b31daaeb57e6678c3722d0eb11308f7cadc3b01730dc8e4" + }, + { + "name": "seasonal_no_query6k", + "cutoff": "backcast2_evals", + "skill": 0.3628070915496776, + "control_skill": 0.3632547284652886, + "delta": -0.00044763691561100494, + "checkpoint_sha256": "3670e55131f07c6d4b31daaeb57e6678c3722d0eb11308f7cadc3b01730dc8e4" + }, + { + "name": "seasonal_no_query6k", + "cutoff": "backcast3_evals", + "skill": 0.39431067840000456, + "control_skill": 0.3944984110874522, + "delta": -0.00018773268744765037, + "checkpoint_sha256": "3670e55131f07c6d4b31daaeb57e6678c3722d0eb11308f7cadc3b01730dc8e4" + }, + { + "name": "seasonal_no_head6k", + "cutoff": "evals", + "skill": 0.37940363906366914, + "control_skill": 0.38227466722292214, + "delta": -0.0028710281592529974, + "checkpoint_sha256": "97318093a014742f4968ef363909b072748176288da86032153f97601960afcc" + }, + { + "name": "seasonal_no_head6k", + "cutoff": "backcast_evals", + "skill": 0.33585434720380203, + "control_skill": 0.33985253853394604, + "delta": -0.0039981913301440075, + "checkpoint_sha256": "97318093a014742f4968ef363909b072748176288da86032153f97601960afcc" + }, + { + "name": "seasonal_no_head6k", + "cutoff": "backcast2_evals", + "skill": 0.3591824992979731, + "control_skill": 0.3632547284652886, + "delta": -0.004072229167315533, + "checkpoint_sha256": "97318093a014742f4968ef363909b072748176288da86032153f97601960afcc" + }, + { + "name": "seasonal_no_head6k", + "cutoff": "backcast3_evals", + "skill": 0.3901496414883441, + "control_skill": 0.3944984110874522, + "delta": -0.0043487695991081265, + "checkpoint_sha256": "97318093a014742f4968ef363909b072748176288da86032153f97601960afcc" + } +] +Both ablations lose on all four cutoffs. Removing the direct median head has the larger effect. This is conditional component sensitivity, not an additive causal decomposition; retain both paths. Future direct uncertainty-output features remain a hypothesis, not a selected architecture. Total controllerwall462.65167835797183seconds includes waiting for the compiler audit. + + +### E126 combined mature-student GPU audit and bounded launch + +{ + "seed": 653, + "student_step": 16000, + "teacher_descriptor_sha256": "1503d92ce031ec0c0e0533ece20d0516a0eceb134802d51746e24a44c4b5ee9b", + "batch": 48, + "context": 4096, + "horizon": 1024, + "includes_adam_ema_placeholders": true, + "eager_teacher_loss": 0.20429196953773499, + "compiled_teacher_loss": 0.20429277420043945, + "gradient_cosine": 0.9999876529317515, + "max_gradient_difference": 1.621246337890625e-05, + "teacher_quantile_rms_difference": 0.0016051846323534846, + "teacher_masks_bitwise_equal": true, + "teacher_gradients_absent": true, + "reserved_mib": 10186.0, + "allocated_mib": 10124.892578125, + "free_mib_before_audit": 22865.6875, + "lock_wait_seconds": 5.014136218931526, + "seconds": 55.19193267985247, + "optimizer_updates": 0, + "validation_data_read": false, + "generated_utc": "2026-10-23T08:13:47.847944+00:00" +} +First launcher attempt stopped in the queue argument parser before any trainer started because wait-pid was required. Added an explicit immediate-job mode (empty dependency list) to the shared queue utility; existing queued dependencies are unchanged. Corrected launch22506/watch22507/trainer22508 started08:15:29UTC, free23388MiB. Complete16000state restored; original96k schedule, halt17000. Corrected launch explicitly carries the saved compiler cache environment. Original E101 remains unchanged. + +E113 frequency-scaled short windows seed197 training started at 2026-10-23T08:21:23Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +E126 numerical diagnostic tolerance declared before either17000validation result: absolute skill difference at most0.0005 on each of the four cutoffs. This is a review criterion, not automatic takeover or a claim of statistical equivalence. Compare matching17000weights and record compile startup separately; shared-H100 training wall is not isolated GPU time. 2026-10-23T08:22:24.705079+00:00 + +## E127 finite-member numerical correction full public replay +- Checkpoint SHA-256: `90199d09666c1653819ef17813f69fc4014fca075f99cc3766d24f457b50ca79`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.384041; relative MASE 0.736336; relative WQL 0.515260. +- term skill: long=0.4028, medium=0.4087, short=0.3669. +- domain skill: Econ/Fin=0.1306, Energy=0.2408, Healthcare=0.4858, Nature=0.4446, Sales=0.3589, Transport=0.4723, Web/CloudOps=0.4993. +- frequency skill: A=0.2968, D=0.3749, H=0.3983, M=0.1452, Q=0.1891, S=0.4255, T=0.4395, W=0.2374. +- variates skill: multivariate=0.3973, univariate=0.3733. +- Outcome: All97full mean/quantile arrays are bitwise identical to E117. Actual-member extreme synthetic composition now preserves finite first-member contribution; relocation/determinism and real composition pass. No new model training or forecast-score gain. + +E127 full validation suite: {"package": "/workspace/research/candidate-finite-member-ensemble", "status": "complete", "steps": [{"name": "relocation", "returncode": 0, "seconds": 31.570269790943712}, {"name": "full_public_replay", "returncode": 0, "seconds": 365.88558935699984}, {"name": "independent_real_composition", "returncode": 0, "seconds": 0.27913929894566536}, {"name": "full_bitwise_and_extreme_composition", "returncode": 0, "seconds": 99.88748204382136}], "current_step": "full_bitwise_and_extreme_composition", "seconds": 497.63583351206034, "skill": 0.3840414658263811, "full_forecasts_bitwise_equal": true}. RuntimepredictSHA c1876617c78330ba89353f706cfacf7d3671e02a669620a48d9eb7c63e9aa7ef. Publish same trained weights with numerical composition correction; retain immutable E96teacher. + +E119 primary6000 matched four-cutoff comparison: {"rows": [{"cutoff": "evals", "candidate_skill": 0.38225879938174245, "control_skill": 0.38227466722292214, "delta": -1.5867841179684206e-05, "candidate_hash": "6b640ad1ce200544da2d530578e59eb353f8b9dabc5cc98473403cfe7383c49f", "control_hash": "ad45e0cfae574d3dc1be0b9720c9be0863db9ffe33891fdb22c86dfa83667253", "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7400506225960969, "rel_wql_gmean": 0.47808876994740046}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7101268693563747, "rel_wql_gmean": 0.49314710783510285}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7500860933248864, "rel_wql_gmean": 0.5411083364362582}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8886871163750968, "rel_wql_gmean": 0.8551794904776345}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8972051207193078, "rel_wql_gmean": 0.6417640311927593}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.578364137997311, "rel_wql_gmean": 0.5117456137390363}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8023291284024608, "rel_wql_gmean": 0.3989034387003474}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8416251755891729, "rel_wql_gmean": 0.5159970993971862}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6323129527317001, "rel_wql_gmean": 0.4332903678255558}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5615569274522425, "rel_wql_gmean": 0.43470539309584183}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6177358739303225, "rel_wql_gmean": 0.6470843841362995}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7613833385246014, "rel_wql_gmean": 0.5227797118737059}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7261807487698988, "rel_wql_gmean": 0.4956422642796265}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9602049092528727, "rel_wql_gmean": 0.8288042520798957}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7839745097436424, "rel_wql_gmean": 0.8298460141507311}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6554424134583847, "rel_wql_gmean": 0.5033779169908231}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6921043444047297, "rel_wql_gmean": 0.45319095997947384}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9031138478320136, "rel_wql_gmean": 0.6694602750281545}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7086008455661859, "rel_wql_gmean": 0.5102395060491531}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7643044334835595, "rel_wql_gmean": 0.5212065466992852}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7402530882128023, "rel_wql_gmean": 0.47826753514082926}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.710265197438745, "rel_wql_gmean": 0.4931672821758772}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7498589240481417, "rel_wql_gmean": 0.5410407688872414}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8892029615768211, "rel_wql_gmean": 0.85541375158805}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8972340808013708, "rel_wql_gmean": 0.6419310799963354}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5749908408040473, "rel_wql_gmean": 0.507856444781463}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8028566989060131, "rel_wql_gmean": 0.39889278962700064}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8421494671087474, "rel_wql_gmean": 0.5162975438622042}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6323849322594254, "rel_wql_gmean": 0.43339253239569303}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5616650304722973, "rel_wql_gmean": 0.43523931575775593}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.61692642682572, "rel_wql_gmean": 0.6469875043190525}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7604157827225532, "rel_wql_gmean": 0.5223254859979091}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7256889701473604, "rel_wql_gmean": 0.49536285168895955}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9611837530785082, "rel_wql_gmean": 0.8278616039641923}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7839583182238047, "rel_wql_gmean": 0.830360300010519}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6548591866261223, "rel_wql_gmean": 0.5032338833413911}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6926762306120622, "rel_wql_gmean": 0.45361994505793396}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9042490502981876, "rel_wql_gmean": 0.6703742252767426}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7084778976708436, "rel_wql_gmean": 0.510408775576821}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7643134428569803, "rel_wql_gmean": 0.5210866729603522}}}, "eval_seconds": 28.624332427978516}, {"cutoff": "backcast_evals", "candidate_skill": 0.34048229409326713, "control_skill": 0.33985253853394604, "delta": 0.0006297555593210991, "candidate_hash": "6b640ad1ce200544da2d530578e59eb353f8b9dabc5cc98473403cfe7383c49f", "control_hash": "ad45e0cfae574d3dc1be0b9720c9be0863db9ffe33891fdb22c86dfa83667253", "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7699386641350829, "rel_wql_gmean": 0.4620092164574338}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7700252574476023, "rel_wql_gmean": 0.5312660160823937}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8114763680106447, "rel_wql_gmean": 0.5925124306653264}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8851214996579603, "rel_wql_gmean": 0.81706534284058}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8880075540028629, "rel_wql_gmean": 0.6669917238344288}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6607679512516224, "rel_wql_gmean": 0.5676047563389465}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9044039298942245, "rel_wql_gmean": 0.4227147422454011}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7233763880081109, "rel_wql_gmean": 0.49051933957001853}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7306764832685102, "rel_wql_gmean": 0.5237199503158482}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6585663042744694, "rel_wql_gmean": 0.453530474116577}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6519157656498028, "rel_wql_gmean": 0.7264149528026873}, "D": {"n_configs": 15, "rel_mase_gmean": 0.820638386519995, "rel_wql_gmean": 0.48899927341307703}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7669137207994428, "rel_wql_gmean": 0.5089765668356441}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8681664151706637, "rel_wql_gmean": 0.7970725004451346}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7591685936267477, "rel_wql_gmean": 0.7657209715884332}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8528003711266274, "rel_wql_gmean": 0.5088102011002493}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7701790682032242, "rel_wql_gmean": 0.57528943509888}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8741170955888644, "rel_wql_gmean": 0.5874303282064617}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7864590781265922, "rel_wql_gmean": 0.5275771051125318}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.798685143563512, "rel_wql_gmean": 0.5654498581714905}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7709573168881856, "rel_wql_gmean": 0.46268425970990196}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7695230479033899, "rel_wql_gmean": 0.5310215600398799}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8117841847086917, "rel_wql_gmean": 0.593906337357885}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8871103723322559, "rel_wql_gmean": 0.8186104803199865}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8873228160456544, "rel_wql_gmean": 0.666828211814892}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6602366692845489, "rel_wql_gmean": 0.5698594545952637}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9037307861253031, "rel_wql_gmean": 0.42282624120616724}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7231485364548405, "rel_wql_gmean": 0.49076711071441}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.731298212809883, "rel_wql_gmean": 0.524438086130783}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.660209298499444, "rel_wql_gmean": 0.45581270950466285}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6522392949080874, "rel_wql_gmean": 0.7270620636653731}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8205802765681058, "rel_wql_gmean": 0.4901220874772779}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7677299491087929, "rel_wql_gmean": 0.5094849178695509}, "M": {"n_configs": 5, "rel_mase_gmean": 0.866956136135693, "rel_wql_gmean": 0.7966508658255991}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7588717620885471, "rel_wql_gmean": 0.7653003797772433}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8525356752749418, "rel_wql_gmean": 0.5080017737889677}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7704476348183809, "rel_wql_gmean": 0.576748095637338}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8742573452440867, "rel_wql_gmean": 0.5889566774320315}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7866251148848069, "rel_wql_gmean": 0.5284419129269964}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7990675186329057, "rel_wql_gmean": 0.5662861373570198}}}, "eval_seconds": 28.22192358970642}, {"cutoff": "backcast2_evals", "candidate_skill": 0.363993152824157, "control_skill": 0.3632547284652886, "delta": 0.0007384243588683947, "candidate_hash": "6b640ad1ce200544da2d530578e59eb353f8b9dabc5cc98473403cfe7383c49f", "control_hash": "ad45e0cfae574d3dc1be0b9720c9be0863db9ffe33891fdb22c86dfa83667253", "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7965511154806201, "rel_wql_gmean": 0.5034490772862287}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7475606718658245, "rel_wql_gmean": 0.48624034441677194}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7612052477427849, "rel_wql_gmean": 0.5556449965470085}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.89958164144685, "rel_wql_gmean": 0.9115144320697872}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.896485898505093, "rel_wql_gmean": 0.6474484136174568}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6888981722703484, "rel_wql_gmean": 0.5885334564659844}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7520768524740646, "rel_wql_gmean": 0.3570202752625398}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5587359331147982, "rel_wql_gmean": 0.35793010096876227}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.660805281297565, "rel_wql_gmean": 0.49469607344952504}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6791821336817456, "rel_wql_gmean": 0.46839071952339456}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5812757221445022, "rel_wql_gmean": 0.7331639098314356}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7257815402854406, "rel_wql_gmean": 0.44620200724347436}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7487818727109079, "rel_wql_gmean": 0.48427195356442543}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8071916126513461, "rel_wql_gmean": 0.8356014190262583}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8308749825896053, "rel_wql_gmean": 0.8716517553922709}, "S": {"n_configs": 6, "rel_mase_gmean": 0.904213435588803, "rel_wql_gmean": 0.5675780199167809}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7537381736791354, "rel_wql_gmean": 0.539091137142719}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8509266671504966, "rel_wql_gmean": 0.6398335731372661}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7792766449889658, "rel_wql_gmean": 0.5144707856195212}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7538788385219328, "rel_wql_gmean": 0.5404416000493212}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7969398609040024, "rel_wql_gmean": 0.5035562825504419}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7490067352384399, "rel_wql_gmean": 0.48743000572367984}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7615427910500057, "rel_wql_gmean": 0.5565614531092009}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.901205213255903, "rel_wql_gmean": 0.9129519979778129}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.895984498209844, "rel_wql_gmean": 0.6466953024058848}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6906395512407255, "rel_wql_gmean": 0.5895403412546308}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7520688777995285, "rel_wql_gmean": 0.35747495688522557}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5597836473152902, "rel_wql_gmean": 0.3594495182358377}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6614283420298616, "rel_wql_gmean": 0.49546817917989344}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6809574130261864, "rel_wql_gmean": 0.47110941162938547}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.581464401116573, "rel_wql_gmean": 0.7355000101927864}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7270580675006559, "rel_wql_gmean": 0.44686466314745266}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7494927915333071, "rel_wql_gmean": 0.48496142310648743}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8066081312673148, "rel_wql_gmean": 0.8347163141766332}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8311725894461938, "rel_wql_gmean": 0.8717568945686304}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9046061716746755, "rel_wql_gmean": 0.5673078591497167}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7542500727562019, "rel_wql_gmean": 0.5401993598021697}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8508075542526838, "rel_wql_gmean": 0.6417280462795324}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7799074480129385, "rel_wql_gmean": 0.515543995911792}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7544561978137869, "rel_wql_gmean": 0.5410325795112644}}}, "eval_seconds": 26.783769130706787}, {"cutoff": "backcast3_evals", "candidate_skill": 0.3950124598405723, "control_skill": 0.3944984110874522, "delta": 0.000514048753120111, "candidate_hash": "6b640ad1ce200544da2d530578e59eb353f8b9dabc5cc98473403cfe7383c49f", "control_hash": "ad45e0cfae574d3dc1be0b9720c9be0863db9ffe33891fdb22c86dfa83667253", "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7599778232892921, "rel_wql_gmean": 0.47414979341796676}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7672348822762877, "rel_wql_gmean": 0.5287703093503114}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7061176910432736, "rel_wql_gmean": 0.501699365937218}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8450238929299057, "rel_wql_gmean": 0.8287968523167164}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8287237417525989, "rel_wql_gmean": 0.5534837186870216}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7575935562899834, "rel_wql_gmean": 0.6315003633340103}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7076556931072816, "rel_wql_gmean": 0.3366919094754201}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7497066029652214, "rel_wql_gmean": 0.47462593240681566}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5363319189417703, "rel_wql_gmean": 0.44423886834819754}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.71171989190133, "rel_wql_gmean": 0.5165221199292769}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5305049486199563, "rel_wql_gmean": 0.7748462903644002}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7121431317868887, "rel_wql_gmean": 0.4145144835788314}, "H": {"n_configs": 29, "rel_mase_gmean": 0.719562525136373, "rel_wql_gmean": 0.48383364301897663}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8317622022092529, "rel_wql_gmean": 0.8214020589097163}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7154303032341603, "rel_wql_gmean": 0.7695070959424496}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8351733673081517, "rel_wql_gmean": 0.5991170712501708}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7049645906490642, "rel_wql_gmean": 0.4635720688691023}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8041936712430771, "rel_wql_gmean": 0.6676297088347317}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7580934176036076, "rel_wql_gmean": 0.5121324030131259}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.708087351250063, "rel_wql_gmean": 0.49341443724470835}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7605445792601405, "rel_wql_gmean": 0.4740600920237114}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7673937404796206, "rel_wql_gmean": 0.529050128812873}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7066888727036074, "rel_wql_gmean": 0.5025271114107714}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8465750633042362, "rel_wql_gmean": 0.8301832550203931}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8280900345851895, "rel_wql_gmean": 0.5531225386420328}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7582600194472988, "rel_wql_gmean": 0.632623318642284}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7096275569559131, "rel_wql_gmean": 0.3386957610122997}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7487935010952289, "rel_wql_gmean": 0.47423739993986525}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5364607716260557, "rel_wql_gmean": 0.4442170483634485}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7128912578353812, "rel_wql_gmean": 0.5168699930573769}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5308138227989901, "rel_wql_gmean": 0.777900736251483}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7112195255614516, "rel_wql_gmean": 0.4154980506806888}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7198763379573593, "rel_wql_gmean": 0.48466211242450724}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8330944575177875, "rel_wql_gmean": 0.8230031202022723}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7156105446358054, "rel_wql_gmean": 0.7684011151446023}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8371984068688675, "rel_wql_gmean": 0.6003957122289793}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7049982843940813, "rel_wql_gmean": 0.46277982987038807}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8087944681865019, "rel_wql_gmean": 0.670755534033392}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7587335902791335, "rel_wql_gmean": 0.5125489110619184}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7084600116309258, "rel_wql_gmean": 0.494009506622114}}}, "eval_seconds": 26.883931159973145}], "positive": 3, "mean_delta": 0.00046659020753248015}. Three earlier cutoffs improve; latest cutoff near-ties. Proceed to one fixed transfer experiment. + +## E128 matched seasonal-dispersion transfer, declared 2026-10-23T08:30:05.084134+00:00 +Hypothesis: the E119 variance-query improvement complements the published learned seasonal mean correction. Fixed coefficient-one formula: extend_zero(E117final firstmember) + E119EMA6000 - extend_zero(E107EMA6000); only new dispersion_query.weight uses candidate directly. Keep E71EMA6000 and E93EMA12000, fixed ordered equal thirds for every instance. Primary duration6000; duration12000 is a predeclared durability comparison, only if its standalone matched four-cutoff delta is positive in at least3/4 and has positive mean. No coefficient sweep. Require ensemble improvements in at least3/4 cutoffs and positive mean before full public replay; publish only on improved full97 score with relocation, determinism and independent composition checks. Check seed659, no optimizer updates or new training data; parent training seed197. Retain E127 finite-member runtime. Main and earlier scores are validation diagnostics, not held-out reward. + +## E129 direct seasonal uncertainty head, declared 2026-10-23T08:31:03.466366+00:00 +Hypothesis: E125 showed the direct seasonal median path contributes more than query conditioning; a direct learned width path may similarly exploit phase-specific variance more effectively. Matched control E119. Start from its own zero-feature initialization, add one zero Linear(d,patch*2) head, train all parameters with identical seed197/B64/LR2e-5/12000/paired/oldpack/original synthetic generator and original horizon stream. For each active period (p>=2,n4>=2,n16>=8), delta=log1p(std16)-log2, otherwise0. Width multiplier=exp(clamp(sum_j(tanh(g_j)*delta_j),-log4,log4)), applied to all eight positive width increments; median path unchanged directly. This bounded positive factor preserves order; zero head preserves initialization bitwise. Added16416parameters atd512/patch16. Primary6000,1000/3000diagnostics,12000durability; require four-cutoff matched evidence before any transfer, no formula selected. CPUfixtureseed661/GPUfixtureseed673, no validation training. Queue after E121 on the same small-model allocation, not an additional concurrent trainer. + +E79 fresh capacity72000 matched width comparison: {"label": "E79 fresh capacity72000 matched width comparison", "utc": "2026-10-23T08:31:54.152494+00:00", "candidate": "random_capacity_1024_ema72000", "control": "random_capacity_512_ema72000", "rows": [{"cutoff": "evals", "candidate_skill": 0.36736566458978936, "control_skill": 0.3689662390668288, "delta": -0.0016005744770394292, "candidate_checkpoint": "baa71611dff2da76515319d144b23e31e19304772ad4401fc4a18ea03f07a499", "control_checkpoint": "8439114a6db9c3441824266cca82575413c81d4d06843f89c3ce365220bdd491", "candidate_eval_seconds": 38.030234575271606, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7596192288082486, "rel_wql_gmean": 0.4951141955204966}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7363375295734231, "rel_wql_gmean": 0.5056560133396528}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7606418888845478, "rel_wql_gmean": 0.5538790094120064}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.9033681839460348, "rel_wql_gmean": 0.8510306246351569}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9132964142466047, "rel_wql_gmean": 0.6613834360775507}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6008629515181685, "rel_wql_gmean": 0.5128134103327899}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8241897772379998, "rel_wql_gmean": 0.4190277961561824}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8456240759834974, "rel_wql_gmean": 0.5233104342109804}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6511786830134689, "rel_wql_gmean": 0.4507742495174751}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5716616669502825, "rel_wql_gmean": 0.4393165312128719}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5958283325931863, "rel_wql_gmean": 0.6144059264519328}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7777281919380308, "rel_wql_gmean": 0.5386241189298943}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7363614335969476, "rel_wql_gmean": 0.5119011863402705}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9955332689841764, "rel_wql_gmean": 0.8441275404151479}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.758645213417042, "rel_wql_gmean": 0.8163566812421911}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6688662611218593, "rel_wql_gmean": 0.5094982599379567}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7151571878390335, "rel_wql_gmean": 0.4685405119829564}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9157681504509959, "rel_wql_gmean": 0.6694775206808375}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7270035470605405, "rel_wql_gmean": 0.5268439726526699}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7782347336583278, "rel_wql_gmean": 0.5325909632877113}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7477127171883448, "rel_wql_gmean": 0.48882740108669653}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7306495550237877, "rel_wql_gmean": 0.5021287839095168}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7641343685367114, "rel_wql_gmean": 0.5555590515607122}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8717773670750196, "rel_wql_gmean": 0.8412173322578796}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9021940945935126, "rel_wql_gmean": 0.6536787310638513}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6334859224455053, "rel_wql_gmean": 0.549868320414668}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8188967077625586, "rel_wql_gmean": 0.41366299417792224}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8213689730266212, "rel_wql_gmean": 0.5099084850083979}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6500708909219332, "rel_wql_gmean": 0.45106083264865515}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5813623780087182, "rel_wql_gmean": 0.44228012583177345}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.598628298464793, "rel_wql_gmean": 0.6247848200123971}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7826762333854071, "rel_wql_gmean": 0.5364548400819831}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7353501027725676, "rel_wql_gmean": 0.5079346769936453}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9822856143120433, "rel_wql_gmean": 0.880135503372167}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7612651746529128, "rel_wql_gmean": 0.8214245943555902}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6646723400893781, "rel_wql_gmean": 0.5089169068334075}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7095018788257277, "rel_wql_gmean": 0.46315795989437103}, "W": {"n_configs": 8, "rel_mase_gmean": 0.920309627928256, "rel_wql_gmean": 0.6842471513104053}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7244533893383394, "rel_wql_gmean": 0.5215434143342278}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7769162726418792, "rel_wql_gmean": 0.5344288966305734}}}, "group_skill_delta": {"term": {"long": -0.008700510302014908, "medium": -0.004485021335244421, "short": 0.0024743264837086}, "domain": {"Econ/Fin": -0.020447941266737324, "Energy": -0.009250912004791112, "Healthcare": 0.03510302802888143, "Nature": -0.005652053507493315, "Sales": -0.018059336432825535, "Transport": -0.0002889950786101325, "Web/CloudOps": 0.005935847541222006}, "frequency": {"A": 0.006520905028241986, "D": 0.0007468270688206768, "H": -0.0028033954635036107, "M": 0.013098916095136914, "Q": 0.0038008982664397006, "S": -0.002165148240247605, "T": -0.005614643117016205, "W": 0.010550306030891465}, "variates": {"multivariate": -0.004202079812957171, "univariate": 0.0005633740723954839}}}], "mean_delta": -0.0016005744770394292, "positive_cutoffs": 0, "outcome": "Wide146M main0.367365665 trails small37M0.368966239 and its own48k; no publication. Retain original96k schedule and predeclared final endpoint."} + +E113 shorter low-frequency windows1000 diagnostic: {"label": "E113 shorter low-frequency windows1000 diagnostic", "utc": "2026-10-23T08:31:54.193313+00:00", "candidate": "lowfreq_windows_ema1000", "control": "overflow_control_ema1000", "rows": [{"cutoff": "evals", "candidate_skill": 0.3758305357946752, "control_skill": 0.37680439430493307, "delta": -0.0009738585102578856, "candidate_checkpoint": "c51d67222deadc8cfecf976a088f25ef6827dc3aa5c4300166b9c77691f4a790", "control_checkpoint": "fb64456ba0c2ebef979b8525274132618fe542f67e7193036e4a013de6629f5c", "candidate_eval_seconds": 25.86383891105652, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7476696916740688, "rel_wql_gmean": 0.48332445505372645}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7120845469848178, "rel_wql_gmean": 0.49524848737069915}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7584508635396726, "rel_wql_gmean": 0.5491110528440255}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8811467462843773, "rel_wql_gmean": 0.8498343555017993}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9019820514397988, "rel_wql_gmean": 0.6470806620758618}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5815059473667801, "rel_wql_gmean": 0.5236532312845102}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8132112237916583, "rel_wql_gmean": 0.4003876735372719}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8491948108207495, "rel_wql_gmean": 0.522553119214883}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6437619246945891, "rel_wql_gmean": 0.44182702692804765}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5680496436874133, "rel_wql_gmean": 0.44315944166758076}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6181702887464274, "rel_wql_gmean": 0.6428211885395657}, "D": {"n_configs": 15, "rel_mase_gmean": 0.775382385015581, "rel_wql_gmean": 0.5381442776598314}, "H": {"n_configs": 31, "rel_mase_gmean": 0.733049566384431, "rel_wql_gmean": 0.5000120743901492}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9788847533271087, "rel_wql_gmean": 0.8373503963086395}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7791907444316182, "rel_wql_gmean": 0.8262408383947131}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6583317867171721, "rel_wql_gmean": 0.505377904469957}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6966646523006679, "rel_wql_gmean": 0.45839507431764615}, "W": {"n_configs": 8, "rel_mase_gmean": 0.903496904137189, "rel_wql_gmean": 0.67048369687104}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.715270494684413, "rel_wql_gmean": 0.5161414769252024}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7711288204924687, "rel_wql_gmean": 0.5273322512747626}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7475949248841576, "rel_wql_gmean": 0.48313009060709816}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7121646285296794, "rel_wql_gmean": 0.49507829874922954}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7565109440013578, "rel_wql_gmean": 0.5476487193118825}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8836242320820453, "rel_wql_gmean": 0.852790735489267}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9015830729546991, "rel_wql_gmean": 0.6466569995775542}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5682109895409901, "rel_wql_gmean": 0.50913591597259}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8118689127220183, "rel_wql_gmean": 0.4001636631853673}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8482726060427207, "rel_wql_gmean": 0.5217876667686607}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.643592872708551, "rel_wql_gmean": 0.4417185877096313}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5682037417522958, "rel_wql_gmean": 0.443077587356112}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6211129140655237, "rel_wql_gmean": 0.6476852381416378}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7731968641003847, "rel_wql_gmean": 0.5364961216672471}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7326719219666206, "rel_wql_gmean": 0.4996436801378994}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9679265081606557, "rel_wql_gmean": 0.825526925103439}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7785677705735384, "rel_wql_gmean": 0.8263634046573236}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6589846090055789, "rel_wql_gmean": 0.5055237904571999}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6968498829283847, "rel_wql_gmean": 0.45851341856614997}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8985566548600665, "rel_wql_gmean": 0.6671788546802966}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7151909536351672, "rel_wql_gmean": 0.5159951052379306}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7691918342794635, "rel_wql_gmean": 0.5258681687194484}}}, "group_skill_delta": {"term": {"long": -0.00015093475640626242, "medium": -6.865930295374412e-05, "short": -0.001684626978899928}, "domain": {"Econ/Fin": 0.0027216616996312837, "Energy": -0.0004190682125532197, "Healthcare": -0.01395893874619547, "Nature": -0.0006306454184297206, "Sales": -0.0008496159775570611, "Transport": -0.00013547259975099646, "Web/CloudOps": 2.170436372661566e-05}, "frequency": {"A": 0.003884682295869024, "D": -0.0018995551640285102, "H": -0.00037897852469348514, "M": -0.011460399143613631, "Q": -0.00026133085398794, "S": 0.00036920690243569254, "T": 0.00014807337877076332, "W": -0.004046103336208362}, "variates": {"multivariate": -0.00011994069529930318, "univariate": -0.0016861314715301834}}}], "mean_delta": -0.0009738585102578856, "positive_cutoffs": 0, "outcome": "Early diagnostic only; retain declared6000 primary and12000 durability."} + +E129 initialization/CPU audit: {"seed": 661, "initial_function_bitwise_equal": true, "inherited_features_and_weights_bitwise_equal": true, "independent_width_arithmetic": true, "bounded_multiplier": [0.25, 4.0], "unchanged_median_for_fixed_hidden": true, "finite_ordered": true, "sampler_byte_identical": true, "all_parameters_trainable": true, "added_parameters": 16416, "total_parameters": 36899168, "checkpoint_sha256": "94ba155b90c6b510bccf92358cc225afe8f317285a19637ab5ca68072bbb83d1", "seconds": 1.7288333191536367, "optimizer_updates": 0, "validation_data_read": false}. Maximum-shape GPU audit: {"seed": 673, "gpu_initial_function_bitwise_equal": true, "gpu_initial_loss_bitwise_equal": true, "max_shape": [64, 4096, 1024], "loss": 0.3557884097099304, "selected_gradient_norms": {"width_head.weight": 0.0037436725106090307, "width_head.bias": 0.000249308388447389, "dispersion_query.weight": 0.001482732011936605, "long_head.weight": 0.01620558276772499, "head.weight": 0.024969521909952164}, "all_parameters_trainable": true, "reserved_mib": 6428.0, "allocated_mib": 5787.44677734375, "free_before_mib": 11792.125, "includes_ema_and_adam_placeholders": true, "lock_wait_seconds": 38.27195146121085, "seconds": 50.22554790391587, "optimizer_updates": 0, "validation_data_read": false}. Queue24583 waits for E12120306; no extra concurrent training allocation. Publisher now documents the learned bounded width head. + +E128 primary merge receipt: { + "method": "matched training delta after zero extension of new seasonal dispersion query parameters", + "formula": "extend_zero(base) + candidate - extend_zero(control)", + "coefficient": 1.0, + "new_parameters_from_candidate": [ + "dispersion_query.weight" + ], + "parent_hashes": { + "/workspace/research/long_seasonal_transfer12k.pt": "8a2b252b733cc79c31778ea27ba00fbe61206fef50454514b667c54a928d80a4", + "/workspace/research/runs/seasonal_dispersion/ema006000.pt": "6b640ad1ce200544da2d530578e59eb353f8b9dabc5cc98473403cfe7383c49f", + "/workspace/research/runs/long_seasonal/ema006000.pt": "ad45e0cfae574d3dc1be0b9720c9be0863db9ffe33891fdb22c86dfa83667253" + }, + "base_extension_forward_bitwise_equal": true, + "check_seed": 659, + "seconds": 2.03242999012582, + "optimizer_updates": 0, + "validation_data_read": false, + "checkpoint_sha256": "993f03042c049bd7e6de5ba5631caa855723eab1a5d8f7e487e7721bca5deb26", + "parameters": 36882752 +}. Four-cutoff evaluation running; no publication. + +E121 older history only for learned seasonal summaries seed197 training started at 2026-10-23T08:33:35Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E128 primary dispersion transfer6000 valid_screen +- Checkpoint SHA-256: `993f03042c049bd7e6de5ba5631caa855723eab1a5d8f7e487e7721bca5deb26`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 28.288978338241577 seconds. +- Overall skill 0.386450; relative MASE 0.733378; relative WQL 0.513300. +- term skill: long=0.4083, medium=0.4093, short=0.3688. +- domain skill: Econ/Fin=0.1468, Energy=0.2418, Healthcare=0.4703, Nature=0.4437, Sales=0.3392, Transport=0.4738, Web/CloudOps=0.5111. +- frequency skill: A=0.3770, D=0.3737, H=0.4062, M=0.0981, Q=0.2061, S=0.4253, T=0.4442, W=0.2254. +- variates skill: multivariate=0.4010, univariate=0.3746. +- Outcome: Fixed zero-extended E117first + E1196000 - E1076000; no optimizer updates. Equal ensemble selected separately. + +## E128 primary dispersion transfer6000 valid_backcast +- Checkpoint SHA-256: `993f03042c049bd7e6de5ba5631caa855723eab1a5d8f7e487e7721bca5deb26`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 26.401955604553223 seconds. +- Overall skill 0.343151; relative MASE 0.788790; relative WQL 0.546978. +- term skill: long=0.3990, medium=0.3631, short=0.3124. +- domain skill: Econ/Fin=0.1780, Energy=0.2290, Healthcare=0.3703, Nature=0.3907, Sales=0.4041, Transport=0.3805, Web/CloudOps=0.4586. +- frequency skill: A=0.3239, D=0.3622, H=0.3775, M=0.1942, Q=0.2296, S=0.3388, T=0.3385, W=0.2880. +- variates skill: multivariate=0.3586, univariate=0.3306. +- Outcome: Fixed zero-extended E117first + E1196000 - E1076000; no optimizer updates. Equal ensemble selected separately. + +## E128 primary dispersion transfer6000 valid_backcast2 +- Checkpoint SHA-256: `993f03042c049bd7e6de5ba5631caa855723eab1a5d8f7e487e7721bca5deb26`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 26.512702226638794 seconds. +- Overall skill 0.365859; relative MASE 0.763853; relative WQL 0.526456. +- term skill: long=0.3708, medium=0.3948, short=0.3525. +- domain skill: Econ/Fin=0.1343, Energy=0.2387, Healthcare=0.2990, Nature=0.4858, Sales=0.5513, Transport=0.4280, Web/CloudOps=0.4468. +- frequency skill: A=0.3497, D=0.4278, H=0.3995, M=0.1471, Q=0.1537, S=0.2838, T=0.3716, W=0.2622. +- variates skill: multivariate=0.3721, univariate=0.3608. +- Outcome: Fixed zero-extended E117first + E1196000 - E1076000; no optimizer updates. Equal ensemble selected separately. + +## E128 primary dispersion transfer6000 valid_backcast3 +- Checkpoint SHA-256: `993f03042c049bd7e6de5ba5631caa855723eab1a5d8f7e487e7721bca5deb26`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 28.568291425704956 seconds. +- Overall skill 0.391471; relative MASE 0.738149; relative WQL 0.501669. +- term skill: long=0.3959, medium=0.3634, short=0.4000. +- domain skill: Econ/Fin=0.1857, Energy=0.3233, Healthcare=0.2336, Nature=0.4990, Sales=0.4064, Transport=0.5155, Web/CloudOps=0.3955. +- frequency skill: A=0.3650, D=0.4475, H=0.4088, M=0.1384, Q=0.2638, S=0.2780, T=0.4325, W=0.2508. +- variates skill: multivariate=0.3755, univariate=0.4037. +- Outcome: Fixed zero-extended E117first + E1196000 - E1076000; no optimizer updates. Equal ensemble selected separately. + +E128 primary6000 fixed equal-ensemble diagnostics: {"pid": 24358, "status": "complete; review gate before full replay", "steps": [{"label": "standalone four cutoffs", "returncode": 0, "seconds": 221.39954217500053}, {"label": "record valid_screen", "returncode": 0, "seconds": 0.03905554208904505}, {"label": "ensemble valid_screen", "returncode": 0, "seconds": 1.7885562051087618}, {"label": "record valid_backcast", "returncode": 0, "seconds": 0.04613363998942077}, {"label": "ensemble valid_backcast", "returncode": 0, "seconds": 1.7479637148790061}, {"label": "record valid_backcast2", "returncode": 0, "seconds": 0.03942001913674176}, {"label": "ensemble valid_backcast2", "returncode": 0, "seconds": 1.7197186860721558}, {"label": "record valid_backcast3", "returncode": 0, "seconds": 0.03546834201551974}, {"label": "ensemble valid_backcast3", "returncode": 0, "seconds": 1.706985381897539}], "started_utc": "2026-10-23T08:30:28.293934+00:00", "seconds": 228.63339753285982, "results": [{"cutoff": "valid_screen", "skill": 0.3876423359084613, "control_skill": 0.3877185003381878, "delta": -7.616442972646631e-05, "groups": {"term": {"short": 0.3706423870097789, "medium": 0.40976716485729514, "long": 0.4086557681538596}, "domain": {"Econ/Fin": 0.14906237351000928, "Energy": 0.24738905555743995, "Healthcare": 0.4791388969316559, "Nature": 0.4443686917605315, "Sales": 0.3447262790585014, "Transport": 0.4721227859861077, "Web/CloudOps": 0.5073504404679972}, "freq": {"A-DEC": 0.37647878173928195, "Q-DEC": 0.20042557356367063, "M": 0.1189364431714729, "W-SUN": 0.12637957687199874, "D": 0.3702481661005801, "H": 0.403349929380743, "15T": 0.21784830817653156, "W-FRI": 0.01471989794806583, "10T": 0.6278900860567873, "W-TUE": 0.6155125042124696, "W-THU": 0.20881506767137004, "W-WED": 0.3285469750480611, "5T": 0.5225769045144781, "10S": 0.4253617269575647}}, "member_checkpoint_hashes": ["993f03042c049bd7e6de5ba5631caa855723eab1a5d8f7e487e7721bca5deb26", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cpu_seconds": 1.5842623638454825}, {"cutoff": "valid_backcast", "skill": 0.3432013271964417, "control_skill": 0.3429732095231861, "delta": 0.00022811767325559007, "groups": {"term": {"short": 0.31073387060164415, "medium": 0.3620628668665026, "long": 0.40405611346025505}, "domain": {"Econ/Fin": 0.17968585844509732, "Energy": 0.23273909578366903, "Healthcare": 0.40568257537880603, "Nature": 0.3803328927840719, "Sales": 0.4086149319113288, "Transport": 0.3770597519911787, "Web/CloudOps": 0.45473049598819626}, "freq": {"A-DEC": 0.3275713462020676, "Q-DEC": 0.23739027910769073, "M": 0.19574299017287022, "W-SUN": 0.07397560715040685, "D": 0.35831503292212774, "H": 0.37501512739666754, "15T": 0.2216121299762639, "W-FRI": 0.2284655950056934, "10T": 0.3272629996788452, "W-TUE": 0.5494608085561956, "W-THU": 0.263852769783948, "W-WED": 0.3607879467228401, "5T": 0.4459667035567545, "10S": 0.34767984343027925}}, "member_checkpoint_hashes": ["993f03042c049bd7e6de5ba5631caa855723eab1a5d8f7e487e7721bca5deb26", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cpu_seconds": 1.5281247009988874}, {"cutoff": "valid_backcast2", "skill": 0.3677073754611293, "control_skill": 0.3674637814642573, "delta": 0.00024359399687201577, "groups": {"term": {"short": 0.3550754328094514, "medium": 0.39653927711067827, "long": 0.37063173335447785}, "domain": {"Econ/Fin": 0.12803071938780664, "Energy": 0.24193803385919588, "Healthcare": 0.3493837546154861, "Nature": 0.4834259255629234, "Sales": 0.5565808270502648, "Transport": 0.4282339085354576, "Web/CloudOps": 0.4418930899993909}, "freq": {"A-DEC": 0.33601449447863596, "Q-DEC": 0.1584608454143962, "M": 0.17018350277659877, "W-SUN": 0.08517635455660122, "D": 0.43266687070978993, "H": 0.3976889350202797, "15T": 0.10761587986155563, "W-FRI": 0.15220755311382572, "10T": 0.5120125447976647, "W-TUE": 0.09639129778711786, "W-THU": 0.35710660219593915, "W-WED": 0.5632462034802572, "5T": 0.477596257783802, "10S": 0.286655372051118}}, "member_checkpoint_hashes": ["993f03042c049bd7e6de5ba5631caa855723eab1a5d8f7e487e7721bca5deb26", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cpu_seconds": 1.570545946015045}, {"cutoff": "valid_backcast3", "skill": 0.3908039139644831, "control_skill": 0.3907349048993719, "delta": 6.900906511120297e-05, "groups": {"term": {"short": 0.396384608836137, "medium": 0.36898160880763275, "long": 0.3974028861047404}, "domain": {"Econ/Fin": 0.19037938198384174, "Energy": 0.3171391114512614, "Healthcare": 0.24031991333738278, "Nature": 0.5062131856742668, "Sales": 0.4022669958061532, "Transport": 0.5121071712995844, "Web/CloudOps": 0.3957592747320986}, "freq": {"A-DEC": 0.35875772722129007, "Q-DEC": 0.25705448484714655, "M": 0.14981550609481042, "W-SUN": 0.17752544894384303, "D": 0.44329034770347153, "H": 0.4072363705194667, "15T": 0.25497834281865817, "W-FRI": 0.03726145753696919, "10T": 0.6056597097039726, "W-TUE": 0.2758258081083025, "W-THU": 0.33505679968046076, "W-WED": 0.3759736817716426, "5T": 0.4669889752425598, "10S": 0.2939738197189754}}, "member_checkpoint_hashes": ["993f03042c049bd7e6de5ba5631caa855723eab1a5d8f7e487e7721bca5deb26", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cpu_seconds": 1.457663832930848}], "positive_cutoffs": 3, "mean_delta": 0.00011613907637808563, "selection_gate_passed": true}. No publication yet. + +E113 shorter low-frequency windows3000 diagnostic: {"label": "E113 shorter low-frequency windows3000 diagnostic", "utc": "2026-10-23T08:35:11.851754+00:00", "candidate": "lowfreq_windows_ema3000", "control": "overflow_control_ema3000", "rows": [{"cutoff": "evals", "candidate_skill": 0.3776574984788966, "control_skill": 0.37866382508046315, "delta": -0.0010063266015665207, "candidate_checkpoint": "959a677cbd33d2d64bad236fb249895e9c3f6e34f48885fac4f545282fa9fd09", "control_checkpoint": "2084f1888f8d9e5afe2c740769ea2b4167086cdd62dfb4014bc3a338c00d4c12", "candidate_eval_seconds": 24.51565384864807, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7451218625482054, "rel_wql_gmean": 0.4809596828119359}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.711351800336926, "rel_wql_gmean": 0.495079186867095}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7570785534009797, "rel_wql_gmean": 0.5464658580413575}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8817171083012888, "rel_wql_gmean": 0.8508619719806925}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9007550043958699, "rel_wql_gmean": 0.6455026968039306}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5865091484539705, "rel_wql_gmean": 0.521860625658197}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8108198685722532, "rel_wql_gmean": 0.3989956949190282}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8569380284582788, "rel_wql_gmean": 0.52336231069808}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6445588627176548, "rel_wql_gmean": 0.44213570216420356}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5622075107700881, "rel_wql_gmean": 0.4376069902777912}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6146587844971091, "rel_wql_gmean": 0.6434926649836787}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7774028542287973, "rel_wql_gmean": 0.5367206013548418}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7301987942753132, "rel_wql_gmean": 0.49786948216978816}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9825361125273154, "rel_wql_gmean": 0.843890448437557}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7840439342906915, "rel_wql_gmean": 0.8283104400124692}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6584863106408512, "rel_wql_gmean": 0.5060624950687049}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6936356874055993, "rel_wql_gmean": 0.45476141585564783}, "W": {"n_configs": 8, "rel_mase_gmean": 0.903387224991496, "rel_wql_gmean": 0.6692509608863554}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7111451661730048, "rel_wql_gmean": 0.5122727594544467}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7719262320902942, "rel_wql_gmean": 0.5268222689333825}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7439855686659663, "rel_wql_gmean": 0.4800673380532462}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.710969314529407, "rel_wql_gmean": 0.4947258837580571}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7552601359377148, "rel_wql_gmean": 0.5456283669131529}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8797820000958861, "rel_wql_gmean": 0.851465626766978}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8986925381034403, "rel_wql_gmean": 0.6442585108586064}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5798649151393334, "rel_wql_gmean": 0.5145973168091904}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8106570659226684, "rel_wql_gmean": 0.39879082771082475}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8534880943118137, "rel_wql_gmean": 0.5217738153838526}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6447411683656122, "rel_wql_gmean": 0.442132284996167}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5617243007193845, "rel_wql_gmean": 0.4378082514816697}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6174355033007595, "rel_wql_gmean": 0.6464320790726874}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7765018646063141, "rel_wql_gmean": 0.5360963442907659}, "H": {"n_configs": 31, "rel_mase_gmean": 0.729523943107356, "rel_wql_gmean": 0.4974199163124135}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9688155615793533, "rel_wql_gmean": 0.8282121039558453}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7789548898684013, "rel_wql_gmean": 0.8281810669626073}, "S": {"n_configs": 6, "rel_mase_gmean": 0.657424827907701, "rel_wql_gmean": 0.5057742486433215}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6929995095863842, "rel_wql_gmean": 0.45475081881278595}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9011291244909845, "rel_wql_gmean": 0.6693011160359584}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.710039655336745, "rel_wql_gmean": 0.511942587644631}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7703738146766376, "rel_wql_gmean": 0.5257441499310483}}}, "group_skill_delta": {"term": {"long": -0.0010118106313061759, "medium": -0.00037129576378203133, "short": -0.0012653961738797737}, "domain": {"Econ/Fin": -0.0006441364096760882, "Energy": -0.0016078574902267384, "Healthcare": -0.006984185169627399, "Nature": -0.00020313198054944248, "Sales": -0.002364454118613857, "Transport": 7.342614009608894e-05, "Web/CloudOps": -9.920427523435471e-05}, "frequency": {"A": 0.0028569523115398177, "D": -0.0007499672727220297, "H": -0.0005508457283032175, "M": -0.014818971593210772, "Q": -0.0026823567864709963, "S": -0.000629756848426255, "T": -0.0002641576452013794, "W": -0.0009432955023421785}, "variates": {"multivariate": -0.0006637132182860661, "univariate": -0.0012937612212758909}}}], "mean_delta": -0.0010063266015665207, "positive_cutoffs": 0, "outcome": "Main diagnostic trails control; preserve declared6000 primary and12000 durability before transfer decisions."} + +E119 full12000 training completed: {"launcher_pid": 19255, "label": "E119 learned phase-specific dispersion seed197", "command": ["python3", "/workspace/research/recovery/train.py", "--code-dir", "/workspace/research/seasonal_dispersion", "--packed", "/workspace/research/packed_sample", "--source-weights-from", "/workspace/research/packed_sample", "--out", "/workspace/research/runs/seasonal_dispersion", "--initialize-from", "/workspace/research/seasonal_dispersion_initial.pt", "--steps", "12000", "--batch", "64", "--lr", ".00002", "--seed", "197", "--loss-mode", "paired", "--stop-file", "/workspace/research/seasonal_dispersion.stop"], "status": "complete", "queued_utc": "2026-10-23T07:05:49Z", "wait_pids": [16340], "required_checkpoints": ["/workspace/research/runs/phase_joint/ema012000.pt"], "started_utc": "2026-10-23T07:49:44Z", "training_pid": 21134, "returncode": 0, "training_process_seconds": 2628.503051322885, "completed_utc": "2026-10-23T08:33:32Z"}. Training loop2611.556469116s. E121 older-summary-history trainer24729 started08:33:35. + +E128 selection clarification before12000 ensemble results: if primary6000 earns publication, durability12000 must additionally pass the same3of4/mean-positive ensemble gate versus that newly published6000 candidate, then improve its full score. This strengthens the original current-package comparison; no coefficient/duration sweep or automatic promotion. + +## E130 fixed fourth fresh-capacity member, declared 2026-10-23T08:36:18.970909+00:00 +Hypothesis: a separately initialized146M model may contribute error diversity despite its weaker standalone score. Primary checkpoint E79EMA48000 (chosen because it is the strongest observed E79wide main checkpoint through72000, not a blind checkpoint choice), seed307, SHA227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c. Add it after E117finalfirst/E71EMA6000/E93EMA12000, ordered equal quarters for every instance. No new optimization, no additional data or fitted weights. One checkpoint and one weighting; no smaller-weight fallback if rejected. Evaluate all four cutoffs, require3of4positive and positive mean versus frozen E127triple before full replay. Any later publication must also improve the then-current full package and pass all runtime checks. If E128 earns publication first, require the same four-cutoff gate versus E128 as well. No four-member runtime or package is built until this diagnostic gate passes. + +E126 mandatory17000stop reached. Measured compute/timing: {"utc": "2026-10-23T08:41:07.993229+00:00", "checkpoint_sha256": "d8be56a82c73a0426710742a1468df3b3d8abdaad541da4716e58cc607ee6e18", "training_seed": 307, "optimizer_updates": 1000, "starting_step": 16000, "ending_step": 17000, "original_lr_schedule_steps": 96000, "compiled_training_process_seconds": 1500.9277165979147, "compiled_training_loop_seconds": 1456.545469535049, "original_16000to17000_logged_seconds": 494.5000000000009, "warm_intervals": [{"start": 16150, "end": 17000, "original_seconds": 419.90000000000146, "compiled_seconds": 398.70000000000005, "ratio_original_over_compiled": 1.0531728116378265}, {"start": 16500, "end": 17000, "original_seconds": 246.8000000000011, "compiled_seconds": 239.10000000000014, "ratio_original_over_compiled": 1.0322040987034753}, {"start": 16600, "end": 17000, "original_seconds": 192.90000000000146, "compiled_seconds": 187.0, "ratio_original_over_compiled": 1.0315508021390452}], "matched_logged_context_horizon_all": true, "notes": "Descriptive wall time on the same shared H100 at different times. Cold teacher compilation dominates the bounded probe. Warm intervals were inspected after training and are not an isolated randomized speed comparison. No adoption selected."}. Four-cutoff forecast comparison still pending; originalE101 unchanged. + +E111 final12000 durability: {"results": [{"cutoff": "evals", "delta": 0.003587592890627267, "candidate_skill": 0.3800888522094774, "control_skill": 0.37650125931885015, "candidate_hash": "c46f6b8de8c5b982dd84a7f3fd9a6b00069a30a6e32a01dcf92be9f88cbc09e1", "control_hash": "dc03098da92746d3974cdb5fd3df955a8b52e689260f1fdcd0dd7b63a91fe17e", "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7420863095161662, "rel_wql_gmean": 0.4796187815866674}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7116412034410219, "rel_wql_gmean": 0.49528650860865264}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7527363095622707, "rel_wql_gmean": 0.5433350136140453}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8790538298381169, "rel_wql_gmean": 0.8493909121009501}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8986566430347296, "rel_wql_gmean": 0.6478984415102629}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5436082622122895, "rel_wql_gmean": 0.47053438052057645}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8074003235650732, "rel_wql_gmean": 0.3956944467918077}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8619475981084186, "rel_wql_gmean": 0.5243392090163763}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.64503441597973, "rel_wql_gmean": 0.4423940661886322}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5652530534645915, "rel_wql_gmean": 0.4409464449528074}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6132163642365149, "rel_wql_gmean": 0.6428800537051756}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7764965485362435, "rel_wql_gmean": 0.5324708908166516}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7308417435943411, "rel_wql_gmean": 0.49923313835796534}, "M": {"n_configs": 5, "rel_mase_gmean": 0.967522466514349, "rel_wql_gmean": 0.8114676956097769}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7775771629460055, "rel_wql_gmean": 0.8236357235772779}, "S": {"n_configs": 6, "rel_mase_gmean": 0.656831019191695, "rel_wql_gmean": 0.5049323926291561}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6930497075219463, "rel_wql_gmean": 0.45524457524339834}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8728333303302914, "rel_wql_gmean": 0.6570375765808066}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7116420639622261, "rel_wql_gmean": 0.5135253249448213}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7658948464355622, "rel_wql_gmean": 0.5222485058749349}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7423258223657083, "rel_wql_gmean": 0.4798378587550141}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7111249588305558, "rel_wql_gmean": 0.49538817078279485}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7597756683365868, "rel_wql_gmean": 0.549315763341069}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8762263674617405, "rel_wql_gmean": 0.8476913606765002}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8987732108050124, "rel_wql_gmean": 0.6471334751576476}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5948687348643393, "rel_wql_gmean": 0.5267177864306672}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8128769118735754, "rel_wql_gmean": 0.39851840033548724}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8620781263218368, "rel_wql_gmean": 0.5254552749363837}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6453101528855447, "rel_wql_gmean": 0.44256597733622044}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5641150034309002, "rel_wql_gmean": 0.4405242882875604}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6139497813449873, "rel_wql_gmean": 0.6412697752176224}, "D": {"n_configs": 15, "rel_mase_gmean": 0.777666349767693, "rel_wql_gmean": 0.5322826373815059}, "H": {"n_configs": 31, "rel_mase_gmean": 0.731819244718065, "rel_wql_gmean": 0.49938279418453085}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9893475338694124, "rel_wql_gmean": 0.8514023810064989}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.776277696224593, "rel_wql_gmean": 0.8210565395309606}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6563690273254504, "rel_wql_gmean": 0.5051017721981628}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6923405331571078, "rel_wql_gmean": 0.45563442430764384}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9133906475951029, "rel_wql_gmean": 0.6864010897148384}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.711455836842964, "rel_wql_gmean": 0.5141081604537986}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7732304940182492, "rel_wql_gmean": 0.527763230728218}}}}, {"cutoff": "backcast_evals", "delta": 0.0004508448857069025, "candidate_skill": 0.336345579192986, "control_skill": 0.3358947343072791, "candidate_hash": "c46f6b8de8c5b982dd84a7f3fd9a6b00069a30a6e32a01dcf92be9f88cbc09e1", "control_hash": "dc03098da92746d3974cdb5fd3df955a8b52e689260f1fdcd0dd7b63a91fe17e", "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7790082348464891, "rel_wql_gmean": 0.46724350861272756}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7718183487423279, "rel_wql_gmean": 0.5356800256251391}, "short": {"n_configs": 55, "rel_mase_gmean": 0.816336701870689, "rel_wql_gmean": 0.5944491791142082}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8743383140618501, "rel_wql_gmean": 0.8115482467920418}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8920437370389201, "rel_wql_gmean": 0.6724620601614585}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6301153831047638, "rel_wql_gmean": 0.5294064719097866}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9307099115890012, "rel_wql_gmean": 0.432536994417533}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7319943560337289, "rel_wql_gmean": 0.4973602526744777}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7353956379093834, "rel_wql_gmean": 0.5282732499238657}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6656881759377258, "rel_wql_gmean": 0.457805473374876}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6323421916529682, "rel_wql_gmean": 0.7125195453373806}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8401032185045045, "rel_wql_gmean": 0.49851787812941284}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7775737921507982, "rel_wql_gmean": 0.5163053172440278}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8516771960093356, "rel_wql_gmean": 0.783458858837305}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7618635177885088, "rel_wql_gmean": 0.7720349555311086}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8556890869149036, "rel_wql_gmean": 0.5079322155705273}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7690547081596393, "rel_wql_gmean": 0.5772974049850865}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8730255449024142, "rel_wql_gmean": 0.5772780775321152}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7930419762532899, "rel_wql_gmean": 0.5320842088499841}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.802611050809754, "rel_wql_gmean": 0.5678006458585831}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7790696804591536, "rel_wql_gmean": 0.4675903653980333}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7721877709531506, "rel_wql_gmean": 0.5359033743134146}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8157056524541806, "rel_wql_gmean": 0.595945142576227}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8702083459344165, "rel_wql_gmean": 0.8095153005807372}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8915064371785775, "rel_wql_gmean": 0.6716980091534934}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6240249575542719, "rel_wql_gmean": 0.5402160092228716}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.935694134093894, "rel_wql_gmean": 0.4349550600914482}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7315038063745323, "rel_wql_gmean": 0.4978004030239261}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.735787693330345, "rel_wql_gmean": 0.5289930405755158}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6650226795797447, "rel_wql_gmean": 0.45792804555178057}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6325356225251678, "rel_wql_gmean": 0.7103481618244573}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8394331932394111, "rel_wql_gmean": 0.4979820769791658}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7778562933336808, "rel_wql_gmean": 0.5158436068239591}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8454913331318379, "rel_wql_gmean": 0.7816333262802584}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7629077893451893, "rel_wql_gmean": 0.7702380946329767}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8544025093684732, "rel_wql_gmean": 0.5071247498858551}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7689059517346652, "rel_wql_gmean": 0.5775992603673705}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8751544074195073, "rel_wql_gmean": 0.5931769268978029}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7925885195053555, "rel_wql_gmean": 0.5316423918477458}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.8025184091177678, "rel_wql_gmean": 0.5698895064907624}}}}, {"cutoff": "backcast2_evals", "delta": -0.0007155214872180959, "candidate_skill": 0.35914339229401815, "control_skill": 0.35985891378123624, "candidate_hash": "c46f6b8de8c5b982dd84a7f3fd9a6b00069a30a6e32a01dcf92be9f88cbc09e1", "control_hash": "dc03098da92746d3974cdb5fd3df955a8b52e689260f1fdcd0dd7b63a91fe17e", "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.8010608604787697, "rel_wql_gmean": 0.5058931136928574}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7593876131764554, "rel_wql_gmean": 0.4948685068508969}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7643174405738108, "rel_wql_gmean": 0.558838905261755}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8846166393794367, "rel_wql_gmean": 0.904866247671209}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.896187080303528, "rel_wql_gmean": 0.6499935195279622}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7139840974588996, "rel_wql_gmean": 0.6116436338534792}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7657342318523654, "rel_wql_gmean": 0.361608668035801}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5606805688947998, "rel_wql_gmean": 0.35877163547993823}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.667921477355026, "rel_wql_gmean": 0.5007724463114519}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6849034545205599, "rel_wql_gmean": 0.4715364832655338}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5794085942750264, "rel_wql_gmean": 0.7248287635585933}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7271527605082205, "rel_wql_gmean": 0.44732850647022265}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7593044766868842, "rel_wql_gmean": 0.49204023937378794}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8223581497485334, "rel_wql_gmean": 0.8435364949877239}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8276797813426849, "rel_wql_gmean": 0.8661650537920869}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9128999508202321, "rel_wql_gmean": 0.5692073285523297}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7569688546219754, "rel_wql_gmean": 0.5419343145885958}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8468387112040634, "rel_wql_gmean": 0.6451222771608602}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7847680751759654, "rel_wql_gmean": 0.5180062411558469}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7591497051395932, "rel_wql_gmean": 0.5454875359701682}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.8013559838363913, "rel_wql_gmean": 0.5054128770623004}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.75788321794871, "rel_wql_gmean": 0.49421017421244823}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7639898471755044, "rel_wql_gmean": 0.5577406704739787}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.884582495524887, "rel_wql_gmean": 0.9052218281574911}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8962501330896433, "rel_wql_gmean": 0.6495487799423033}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6926973403721509, "rel_wql_gmean": 0.5937869785059188}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7713675171303247, "rel_wql_gmean": 0.3616973051331611}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5592522419628495, "rel_wql_gmean": 0.35866016979444243}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6679748662601066, "rel_wql_gmean": 0.501187884126286}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6844749650355838, "rel_wql_gmean": 0.4715640721636921}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5794331362019375, "rel_wql_gmean": 0.7249032130584426}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7274908943977823, "rel_wql_gmean": 0.447185381910289}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7592674956924574, "rel_wql_gmean": 0.4915230345874937}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8160225626258149, "rel_wql_gmean": 0.8474243321015386}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8281711532324068, "rel_wql_gmean": 0.8673446644194264}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9115517503849181, "rel_wql_gmean": 0.567299277514214}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7565118858787296, "rel_wql_gmean": 0.5413823048088119}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8461374522214398, "rel_wql_gmean": 0.6382218477885009}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7845688942217784, "rel_wql_gmean": 0.5172999150208025}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7584619130014335, "rel_wql_gmean": 0.5444927422951403}}}}, {"cutoff": "backcast3_evals", "delta": -0.00011104319600929724, "candidate_skill": 0.3884454882609417, "control_skill": 0.388556531456951, "candidate_hash": "c46f6b8de8c5b982dd84a7f3fd9a6b00069a30a6e32a01dcf92be9f88cbc09e1", "control_hash": "dc03098da92746d3974cdb5fd3df955a8b52e689260f1fdcd0dd7b63a91fe17e", "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7655089106919575, "rel_wql_gmean": 0.4786526643377788}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.766305114235611, "rel_wql_gmean": 0.5303297894176286}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7198899194684742, "rel_wql_gmean": 0.5074270380794397}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8394575658871352, "rel_wql_gmean": 0.8384753446031146}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8342818127663953, "rel_wql_gmean": 0.5572462200193641}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7900967331436005, "rel_wql_gmean": 0.6443370142052202}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7313879255209577, "rel_wql_gmean": 0.3437346202758351}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7563791395727647, "rel_wql_gmean": 0.47876029420052607}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5443222149905831, "rel_wql_gmean": 0.4499472259048489}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7134583555712409, "rel_wql_gmean": 0.515064113428559}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5338688370505897, "rel_wql_gmean": 0.8430211928146529}, "D": {"n_configs": 15, "rel_mase_gmean": 0.737630218832089, "rel_wql_gmean": 0.42824059419177646}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7264195474702443, "rel_wql_gmean": 0.4878160147056754}, "M": {"n_configs": 4, "rel_mase_gmean": 0.864952094007602, "rel_wql_gmean": 0.8584711086039413}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7157085259644085, "rel_wql_gmean": 0.7721868892500026}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8425150884547248, "rel_wql_gmean": 0.6004486447299989}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7034729492461643, "rel_wql_gmean": 0.4619193762410968}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8245319242102328, "rel_wql_gmean": 0.6635526495874977}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7611464183431048, "rel_wql_gmean": 0.5124011254553782}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7217227861672926, "rel_wql_gmean": 0.5013530673411241}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7663754402347989, "rel_wql_gmean": 0.4788938791084861}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7658739230595875, "rel_wql_gmean": 0.529347553216718}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7178692269632083, "rel_wql_gmean": 0.5086998134122838}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8358354885094386, "rel_wql_gmean": 0.8418146966445984}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8338897723615496, "rel_wql_gmean": 0.5562121498093919}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.8060949747388733, "rel_wql_gmean": 0.6796354438827096}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7222059595204405, "rel_wql_gmean": 0.3416807049403571}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7557238523302612, "rel_wql_gmean": 0.47948838435897584}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5443370693639568, "rel_wql_gmean": 0.4497401377123374}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7130988319811894, "rel_wql_gmean": 0.5141627844030099}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5331048942504498, "rel_wql_gmean": 0.8394069703462528}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7335602695405524, "rel_wql_gmean": 0.42553600401076375}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7260346680667362, "rel_wql_gmean": 0.4869693265129284}, "M": {"n_configs": 4, "rel_mase_gmean": 0.881837749964207, "rel_wql_gmean": 0.8756527000622875}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7161603254136085, "rel_wql_gmean": 0.7742932145513032}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8420519451582145, "rel_wql_gmean": 0.5981276922561349}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7039614590005732, "rel_wql_gmean": 0.46207823333750453}, "W": {"n_configs": 8, "rel_mase_gmean": 0.810577145353702, "rel_wql_gmean": 0.6793951900954402}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7616930972618384, "rel_wql_gmean": 0.5118981392017699}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7193535077794512, "rel_wql_gmean": 0.5027824181292397}}}}], "positive": 2, "mean_delta": 0.0008029682732766941, "seconds": 841.7242407109588}. E124 primary6000 gate remains failed; no new averaging rule. + +E119 dispersion12000 durability: {"label": "E119 dispersion12000 durability", "utc": "2026-10-23T08:44:56.875956+00:00", "candidate": "seasonal_dispersion_ema12000", "control": "long_seasonal_ema12000", "rows": [{"cutoff": "evals", "candidate_skill": 0.3820478868373609, "control_skill": 0.38231375879048757, "delta": -0.0002658719531266618, "candidate_checkpoint": "b0204fa8dd3371d9160fc00545d6b065ccb23bb18e345b3b63cd39c024c9acf5", "control_checkpoint": "d512cdac520239f0c10e021721424d87cee30086fa70f6cbc41f21e2e04988c3", "candidate_eval_seconds": 29.899949550628662, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7389032030803768, "rel_wql_gmean": 0.4775255930846139}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7110090800376195, "rel_wql_gmean": 0.49416801903946805}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7504609946788687, "rel_wql_gmean": 0.5413698790489025}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8804929993505196, "rel_wql_gmean": 0.8550445515045846}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9011157762761242, "rel_wql_gmean": 0.6441525168035792}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5841227032423717, "rel_wql_gmean": 0.5152693556823793}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8018394415733434, "rel_wql_gmean": 0.39970868464473397}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8494409474640868, "rel_wql_gmean": 0.5191016450797338}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.631290389229455, "rel_wql_gmean": 0.4311304324404592}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5583176379809373, "rel_wql_gmean": 0.4328344133541464}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6260908412504385, "rel_wql_gmean": 0.6531805976165398}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7625008852504683, "rel_wql_gmean": 0.5256123818684614}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7269253228245665, "rel_wql_gmean": 0.4957875948564009}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9683877465170895, "rel_wql_gmean": 0.8250296285399715}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7794669965817581, "rel_wql_gmean": 0.8259636078611131}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6552664068279662, "rel_wql_gmean": 0.5032424048533084}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6897053807375739, "rel_wql_gmean": 0.45130068257990086}, "W": {"n_configs": 8, "rel_mase_gmean": 0.905700561781496, "rel_wql_gmean": 0.6779024808640658}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7086017938396406, "rel_wql_gmean": 0.5106302124003929}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7646004882955708, "rel_wql_gmean": 0.5213256741612632}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7385624256035537, "rel_wql_gmean": 0.4774480306015298}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7112970077840257, "rel_wql_gmean": 0.49399950873586423}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7495810559140079, "rel_wql_gmean": 0.5412990087697497}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8812498422781989, "rel_wql_gmean": 0.8555240839274089}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9003124134337842, "rel_wql_gmean": 0.6439831822912251}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5795579602545416, "rel_wql_gmean": 0.5129229324649281}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8014187192027531, "rel_wql_gmean": 0.39917690533601163}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8487678656214006, "rel_wql_gmean": 0.5191938831467846}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6315950761584922, "rel_wql_gmean": 0.4315386790157564}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5583373635107705, "rel_wql_gmean": 0.433162583197897}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6267725580318051, "rel_wql_gmean": 0.6538606856911642}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7599509242283058, "rel_wql_gmean": 0.524915385039173}, "H": {"n_configs": 31, "rel_mase_gmean": 0.726196004396462, "rel_wql_gmean": 0.4955559356320016}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9682906777404066, "rel_wql_gmean": 0.8249007339255652}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7794132143007206, "rel_wql_gmean": 0.826151122683708}, "S": {"n_configs": 6, "rel_mase_gmean": 0.654344138587591, "rel_wql_gmean": 0.5028751847848326}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6900127153197991, "rel_wql_gmean": 0.4513560570693673}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9068583895899763, "rel_wql_gmean": 0.679330225432368}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7082895004717786, "rel_wql_gmean": 0.5105014816296383}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7639387308045943, "rel_wql_gmean": 0.5212587544154408}}}, "group_skill_delta": {"term": {"long": -0.00018522402741716348, "medium": 1.8914618052701115e-05, "short": -0.0004154919647112454}, "domain": {"Econ/Fin": 0.0006162111295645589, "Energy": -0.00043979271309579904, "Healthcare": -0.0033935121173114258, "Nature": -0.000525162940354984, "Sales": -0.00020416825007274486, "Transport": 0.00037288575793670287, "Web/CloudOps": 0.00019501006473421345}, "frequency": {"A": 0.000681072211661804, "D": -0.0014786322963041831, "H": -0.00044143106525906806, "M": -0.00011462083986268912, "Q": 6.33898442757852e-05, "S": -0.0006136656077435632, "T": 0.00015852378646019627, "W": 0.0013259232474338578}, "variates": {"multivariate": -0.00020837712618171356, "univariate": -0.00031378055112707415}}}, {"cutoff": "backcast_evals", "candidate_skill": 0.3418892780195716, "control_skill": 0.34137925383664736, "delta": 0.0005100241829242291, "candidate_checkpoint": "b0204fa8dd3371d9160fc00545d6b065ccb23bb18e345b3b63cd39c024c9acf5", "control_checkpoint": "d512cdac520239f0c10e021721424d87cee30086fa70f6cbc41f21e2e04988c3", "candidate_eval_seconds": 30.358814477920532, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7739203449970765, "rel_wql_gmean": 0.4624749910039315}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7670191905850069, "rel_wql_gmean": 0.5295139958967662}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8087785498550463, "rel_wql_gmean": 0.590263798231263}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8743674629847383, "rel_wql_gmean": 0.8161720641051514}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8853621974210792, "rel_wql_gmean": 0.665058032816427}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6579970194342092, "rel_wql_gmean": 0.5646715267254061}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9052563953011699, "rel_wql_gmean": 0.42318224850833497}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7239801636643148, "rel_wql_gmean": 0.4912094503535297}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7292932013886385, "rel_wql_gmean": 0.5220064683319335}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6600102642208264, "rel_wql_gmean": 0.4511555367132821}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6444326514379081, "rel_wql_gmean": 0.7248601482512232}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8172654104294157, "rel_wql_gmean": 0.48783020134756094}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7679461029022491, "rel_wql_gmean": 0.5077426505293602}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8645966624230256, "rel_wql_gmean": 0.7911152729414949}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7629806732535767, "rel_wql_gmean": 0.7768213615208555}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8530821682550342, "rel_wql_gmean": 0.5073353488371999}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7676622656760491, "rel_wql_gmean": 0.5719661183084246}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8726377917578133, "rel_wql_gmean": 0.592614882559852}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7867641705481724, "rel_wql_gmean": 0.5262034616384936}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.796120821098744, "rel_wql_gmean": 0.5639311517534341}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7748213703894843, "rel_wql_gmean": 0.4628541503223905}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7664514736085948, "rel_wql_gmean": 0.5293825048686492}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8092133321048779, "rel_wql_gmean": 0.5913363636847011}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8757735001155781, "rel_wql_gmean": 0.8170938641172787}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.884884194524689, "rel_wql_gmean": 0.6647829318344969}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6563469207069739, "rel_wql_gmean": 0.5654393474023085}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9047462993987708, "rel_wql_gmean": 0.4229856130109878}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7234827485870052, "rel_wql_gmean": 0.49101355399514096}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7302388544768311, "rel_wql_gmean": 0.5230662990235599}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6616757881069665, "rel_wql_gmean": 0.45318260421936735}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6445112721993314, "rel_wql_gmean": 0.7250031265258748}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8169867958549157, "rel_wql_gmean": 0.48765941110091987}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7687868921949567, "rel_wql_gmean": 0.5082857531718749}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8647112860240415, "rel_wql_gmean": 0.791872490233388}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7635201146060429, "rel_wql_gmean": 0.7764383165590925}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8527947748812648, "rel_wql_gmean": 0.5066866363631385}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7680903138861567, "rel_wql_gmean": 0.5733326508067024}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8719229424762637, "rel_wql_gmean": 0.5937682323059945}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7868235601514957, "rel_wql_gmean": 0.526807616706907}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7966399243027747, "rel_wql_gmean": 0.5645842503200074}}}, "group_skill_delta": {"term": {"long": 0.0005934931901844243, "medium": -0.0003149982153517472, "short": 0.0008133233930377459}, "domain": {"Econ/Fin": 0.0011562449907654981, "Energy": -0.00036585013989731685, "Healthcare": -0.0003510209847806811, "Nature": -0.000318180378963584, "Sales": -0.0003237792289906283, "Transport": 0.001026338694583906, "Web/CloudOps": 0.0019141307469233704}, "frequency": {"A": 0.00010909732126695992, "D": -0.00021815837056016196, "H": 0.0006757934500155605, "M": 0.0004505535215830747, "Q": 8.220887196608295e-05, "S": -0.0005314889100238585, "T": 0.000976034382170754, "W": 0.0004045469138087565}, "variates": {"multivariate": 0.00039356425175118837, "univariate": 0.0006064203174075411}}}, {"cutoff": "backcast2_evals", "candidate_skill": 0.3655776712597705, "control_skill": 0.3650598400595585, "delta": 0.0005178312002119823, "candidate_checkpoint": "b0204fa8dd3371d9160fc00545d6b065ccb23bb18e345b3b63cd39c024c9acf5", "control_checkpoint": "d512cdac520239f0c10e021721424d87cee30086fa70f6cbc41f21e2e04988c3", "candidate_eval_seconds": 29.32106637954712, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7957101938303016, "rel_wql_gmean": 0.5022344522726042}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7493165290449147, "rel_wql_gmean": 0.48589148044854996}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7592133707158151, "rel_wql_gmean": 0.5526106392402376}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8916706823244112, "rel_wql_gmean": 0.9093796505356709}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8960744934624816, "rel_wql_gmean": 0.6460246578073142}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6984033526422165, "rel_wql_gmean": 0.5933308036019226}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7465754066379666, "rel_wql_gmean": 0.35465776917776354}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.559290997380798, "rel_wql_gmean": 0.3564560443374385}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6603838561435512, "rel_wql_gmean": 0.4940639621155883}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6792879027084646, "rel_wql_gmean": 0.46390410322974923}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5823310864214802, "rel_wql_gmean": 0.724835278367236}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7222253162661183, "rel_wql_gmean": 0.4441238921359276}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7510745160444832, "rel_wql_gmean": 0.48421048476502265}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8049624975185914, "rel_wql_gmean": 0.8337942280653755}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8327902926785946, "rel_wql_gmean": 0.8787396634191282}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9029763402504646, "rel_wql_gmean": 0.5665644057202113}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7538170530124115, "rel_wql_gmean": 0.5356891156947962}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8384463511921755, "rel_wql_gmean": 0.6337414984658606}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7796481341539873, "rel_wql_gmean": 0.5122582767435926}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.751963109653387, "rel_wql_gmean": 0.5386190816130975}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.796127056742376, "rel_wql_gmean": 0.5022139410634582}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7505942901123125, "rel_wql_gmean": 0.4865575819153698}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7594504520679526, "rel_wql_gmean": 0.5532537195147663}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8929618274343588, "rel_wql_gmean": 0.9103813793769899}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8959209226146972, "rel_wql_gmean": 0.6453740580861129}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6961784435164479, "rel_wql_gmean": 0.5915734081229318}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7476406868387996, "rel_wql_gmean": 0.35522212901676864}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5597759096460994, "rel_wql_gmean": 0.35738676117830037}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6611597485381723, "rel_wql_gmean": 0.4949322755161753}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6805375314732472, "rel_wql_gmean": 0.4657391485089796}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.582687321216151, "rel_wql_gmean": 0.7249374834569997}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7228644523548966, "rel_wql_gmean": 0.4448013254664766}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7512801448992653, "rel_wql_gmean": 0.48470980713170986}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8061257673025353, "rel_wql_gmean": 0.8338421947073288}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8329742195879615, "rel_wql_gmean": 0.8780190666063756}, "S": {"n_configs": 6, "rel_mase_gmean": 0.903952356548986, "rel_wql_gmean": 0.5661338988037351}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7547233557063331, "rel_wql_gmean": 0.536425314767226}, "W": {"n_configs": 8, "rel_mase_gmean": 0.83773127724725, "rel_wql_gmean": 0.6339155481728359}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.780210137456359, "rel_wql_gmean": 0.5128749991570595}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7524307203251008, "rel_wql_gmean": 0.5390362822620333}}}, "group_skill_delta": {"term": {"long": 0.00015265790254148648, "medium": 0.0009280507553094397, "short": 0.0004779586831510363}, "domain": {"Econ/Fin": 0.0011479018275053487, "Energy": -0.0004483809788876636, "Healthcare": -0.001978698982208482, "Nature": 0.0007765227244096451, "Sales": 0.0007763039411929351, "Transport": 0.0008374732354174963, "Web/CloudOps": 0.0016263021837661373}, "frequency": {"A": 0.00024450622227922825, "D": 0.0006825072861625925, "H": 0.0003934483458349902, "M": 0.0006153275895631749, "Q": -0.00025640136438909167, "S": 0.00011450777265553658, "T": 0.0008186590134711125, "W": -0.00021085977279267087}, "variates": {"multivariate": 0.00060817659956236, "univariate": 0.00044435063951930864}}}, {"cutoff": "backcast3_evals", "candidate_skill": 0.39329641531340254, "control_skill": 0.3928331731047856, "delta": 0.0004632422086169319, "candidate_checkpoint": "b0204fa8dd3371d9160fc00545d6b065ccb23bb18e345b3b63cd39c024c9acf5", "control_checkpoint": "d512cdac520239f0c10e021721424d87cee30086fa70f6cbc41f21e2e04988c3", "candidate_eval_seconds": 26.51674461364746, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7620982278020191, "rel_wql_gmean": 0.47426314781212775}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7694130571916938, "rel_wql_gmean": 0.5293555168619524}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7102997952164497, "rel_wql_gmean": 0.5023655717094271}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8390596184536422, "rel_wql_gmean": 0.8364410318397068}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8301807382152379, "rel_wql_gmean": 0.552148460325587}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7582486561812802, "rel_wql_gmean": 0.6324647241609418}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7235102474851808, "rel_wql_gmean": 0.33685653081795286}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7486059713981105, "rel_wql_gmean": 0.47352466437330154}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5373740999001123, "rel_wql_gmean": 0.4458528549155647}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7139121494179991, "rel_wql_gmean": 0.5182975401922782}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5305412273194996, "rel_wql_gmean": 0.8003515074386365}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7189848782726174, "rel_wql_gmean": 0.4168506671427805}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7218929902246265, "rel_wql_gmean": 0.48494043868982045}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8339835183539945, "rel_wql_gmean": 0.8257482517849524}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7130270287878929, "rel_wql_gmean": 0.7661662375161}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8378690834528353, "rel_wql_gmean": 0.5986481829064408}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7071701445283383, "rel_wql_gmean": 0.4630581494762598}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8116701266923606, "rel_wql_gmean": 0.6622668197361823}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7597234443787527, "rel_wql_gmean": 0.5110609184057446}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7127385729927525, "rel_wql_gmean": 0.49516529836403683}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7631434004686845, "rel_wql_gmean": 0.4745780224475118}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7702543592823002, "rel_wql_gmean": 0.5302072122994279}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7102740757127205, "rel_wql_gmean": 0.5028426749263977}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8404794249042948, "rel_wql_gmean": 0.8377611830280824}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8299149339539488, "rel_wql_gmean": 0.5519405024214632}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7621826867136657, "rel_wql_gmean": 0.6349175346276966}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7231739407449111, "rel_wql_gmean": 0.3380432271049275}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7474335142271239, "rel_wql_gmean": 0.4733071421517686}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5378627602598968, "rel_wql_gmean": 0.4463114549472672}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7146709097664398, "rel_wql_gmean": 0.5186863440823273}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5306073447296601, "rel_wql_gmean": 0.8030982774337949}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7175124768607152, "rel_wql_gmean": 0.41780178227764675}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7223996277645064, "rel_wql_gmean": 0.4859456509788173}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8339193215840682, "rel_wql_gmean": 0.8250296214792107}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7133214644953572, "rel_wql_gmean": 0.7659591311067668}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8388577706002066, "rel_wql_gmean": 0.5998597273487538}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7077596915926687, "rel_wql_gmean": 0.46245587762920626}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8141976774865708, "rel_wql_gmean": 0.6645660569936594}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7600456915083991, "rel_wql_gmean": 0.511644654751976}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7131300545794724, "rel_wql_gmean": 0.49563420928448887}}}, "group_skill_delta": {"term": {"long": 0.0006117877094232727, "medium": 0.0008622961767622561, "short": 0.00027276941172516}, "domain": {"Econ/Fin": 0.0013699012635308705, "Energy": -0.00023588449424616353, "Healthcare": 0.003139154413493772, "Nature": 0.0007538624280253869, "Sales": -0.0006030840572849305, "Transport": 0.00047428946123651006, "Web/CloudOps": 0.0005514018196188797}, "frequency": {"A": 0.001157893796062348, "D": 6.270950468445502e-05, "H": 0.0008207092403196281, "M": -0.00039310727445363014, "Q": 5.266435663608959e-05, "S": 0.0011344504917797371, "T": -0.00013393555935359291, "W": 0.0024142457340984302}, "variates": {"multivariate": 0.00048796919081894874, "univariate": 0.00044442732081340086}}}], "mean_delta": 0.00030630640965662037, "positive_cutoffs": 3, "outcome": "Predeclared E12812000 transfer requires at least3of4 positive and positive mean; no coefficient selection."} + +## E128 primary6000 dispersion ensemble full public replay — not selected +- Checkpoint SHA-256: `a388035c9461a7bdb079a931484d9c505428ea0086e2f5456313d995872a584e`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.383964; relative MASE 0.736451; relative WQL 0.515310. +- term skill: long=0.4028, medium=0.4086, short=0.3668. +- domain skill: Econ/Fin=0.1308, Energy=0.2409, Healthcare=0.4847, Nature=0.4445, Sales=0.3589, Transport=0.4723, Web/CloudOps=0.4992. +- frequency skill: A=0.2968, D=0.3746, H=0.3981, M=0.1447, Q=0.1890, S=0.4254, T=0.4397, W=0.2375. +- variates skill: multivariate=0.3972, univariate=0.3732. +- Outcome: Full skill0.383963658607839 is below E1270.3840414658263811 by0.0000778072185421. All97configs151170instances succeed; inference377.680531184s. Three-of-four diagnostic gains did not transfer to improved full validation. Keep E127 published; no coefficient sweep. Independent composition suite is finishing. + +## E131 fresh146M with learned long-seasonal summaries, declared 2026-10-23T08:48:34.312475+00:00 +Hypothesis: the robust E107/E120/E125 evidence for direct seasonal summaries can address the fresh146M plateau without another capacity increase. Control E79wide originalLR. Start from its own untrained random initialization c9693619ca6277c26fef3b2bde37ff6796bec97b3af9f94588bbc5ddd329ec90 and add exactly E107 zero long_query/long_head parameters (98336 atd1024/patch16). Existing weights and initial forecasts must match bitwise. Same seed307/B48distinct96signed/LR2e-4/96000/400warmup/cosinefloor0.2/paired/staticcompiledloss/oldpack/sourceweights/20%slowAR and horizon300310. All parameters train. Primary48000,4000/8000/16000/24000diagnostics,72000/96000durability; primary and final require4cutoffs before transfer or ensemble decisions. No transfer formula selected. CPUfixture677/GPUfixture683; allowed training data only. Queue after E94halfLR final96000 frees its allocation; require completedE79wide96000 control. No additional concurrent trainer and no pretrained weights. + +E130 fixed fourth fresh-capacity member diagnostics: {"pid": 24896, "status": "complete; review gate", "steps": [{"label": "fresh146M48000 earlier cutoffs", "seconds": 801.8997166370973}, {"label": "fixed equal quarters valid_screen", "seconds": 2.2401710469275713}, {"label": "fixed equal quarters valid_backcast", "seconds": 2.280684475088492}, {"label": "fixed equal quarters valid_backcast2", "seconds": 2.503589668078348}, {"label": "fixed equal quarters valid_backcast3", "seconds": 1.973427789984271}], "started_utc": "2026-10-23T08:36:19.032374+00:00", "seconds": 811.2990581667982, "results": [{"cutoff": "valid_screen", "skill": 0.3878507268780589, "control_skill": 0.3877185003381878, "delta": 0.00013222653987110533, "groups": {"term": {"short": 0.3715987371883521, "medium": 0.4102540213663538, "long": 0.4067391588891215}, "domain": {"Econ/Fin": 0.1489434280268307, "Energy": 0.24776307784165708, "Healthcare": 0.4797658368125918, "Nature": 0.4432112385396936, "Sales": 0.34253568790603184, "Transport": 0.4728212016626797, "Web/CloudOps": 0.5082519165180346}, "freq": {"A-DEC": 0.38359463669798244, "Q-DEC": 0.20462915621155287, "M": 0.12236644601227109, "W-SUN": 0.09441595412894432, "D": 0.37245225750954924, "H": 0.40230869575473505, "15T": 0.21611411756632326, "W-FRI": 0.018963917247772133, "10T": 0.6269659382966359, "W-TUE": 0.6129270175490279, "W-THU": 0.226657792022391, "W-WED": 0.3223843548790608, "5T": 0.5238648554081364, "10S": 0.4236329368087466}}, "member_checkpoint_hashes": ["8a2b252b733cc79c31778ea27ba00fbe61206fef50454514b667c54a928d80a4", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c"], "cpu_seconds": 2.065567785874009}, {"cutoff": "valid_backcast", "skill": 0.34441110518308204, "control_skill": 0.3429732095231861, "delta": 0.001437895659895938, "groups": {"term": {"short": 0.31207922757792406, "medium": 0.36328071712981613, "long": 0.40494216606009625}, "domain": {"Econ/Fin": 0.18128449966132598, "Energy": 0.2353103687221182, "Healthcare": 0.4025407461850268, "Nature": 0.3790544216342604, "Sales": 0.40723401747223886, "Transport": 0.3760760439577333, "Web/CloudOps": 0.4588042844416619}, "freq": {"A-DEC": 0.3352639380629199, "Q-DEC": 0.23254852316486108, "M": 0.19688259960835408, "W-SUN": 0.055031869484658325, "D": 0.36179297351401374, "H": 0.3749856405146871, "15T": 0.22389670167242903, "W-FRI": 0.23918097287302442, "10T": 0.3333771556820778, "W-TUE": 0.5274661574021489, "W-THU": 0.2692923481092909, "W-WED": 0.3578389948455023, "5T": 0.4461528818794869, "10S": 0.34927794955924096}}, "member_checkpoint_hashes": ["8a2b252b733cc79c31778ea27ba00fbe61206fef50454514b667c54a928d80a4", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c"], "cpu_seconds": 2.097238216083497}, {"cutoff": "valid_backcast2", "skill": 0.3685168155758046, "control_skill": 0.3674637814642573, "delta": 0.0010530341115473352, "groups": {"term": {"short": 0.3556161382479862, "medium": 0.3973117710813864, "long": 0.37222700110278417}, "domain": {"Econ/Fin": 0.1278105572382463, "Energy": 0.23987340597263695, "Healthcare": 0.36790127898546965, "Nature": 0.48227924309884174, "Sales": 0.5594797440115518, "Transport": 0.42629751766299717, "Web/CloudOps": 0.44556758902381643}, "freq": {"A-DEC": 0.3385306293437419, "Q-DEC": 0.15198048444107892, "M": 0.1698592409978169, "W-SUN": 0.07808183431207394, "D": 0.43567816912377244, "H": 0.3995244931978722, "15T": 0.10576200082748655, "W-FRI": 0.15725296166613179, "10T": 0.5103532273533584, "W-TUE": 0.17179354019954174, "W-THU": 0.3330508401365113, "W-WED": 0.5583853279496267, "5T": 0.4773643023111328, "10S": 0.2905566372491195}}, "member_checkpoint_hashes": ["8a2b252b733cc79c31778ea27ba00fbe61206fef50454514b667c54a928d80a4", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c"], "cpu_seconds": 2.3007850870490074}, {"cutoff": "valid_backcast3", "skill": 0.3912834616582097, "control_skill": 0.3907349048993719, "delta": 0.0005485567588378037, "groups": {"term": {"short": 0.3962793017121322, "medium": 0.3721673520503136, "long": 0.3968136230237693}, "domain": {"Econ/Fin": 0.18895322636819234, "Energy": 0.3197131861773106, "Healthcare": 0.23539860466957807, "Nature": 0.5079580913352499, "Sales": 0.3989970371269539, "Transport": 0.5091360867168643, "Web/CloudOps": 0.3972175212799016}, "freq": {"A-DEC": 0.35355855949676074, "Q-DEC": 0.26171742025055167, "M": 0.1494414083112504, "W-SUN": 0.1701606617044591, "D": 0.4409486975966336, "H": 0.407339108595274, "15T": 0.2629345850074465, "W-FRI": 0.04507153357762772, "10T": 0.6019138427315083, "W-TUE": 0.2793354887817199, "W-THU": 0.3516119599992523, "W-WED": 0.3654380765447295, "5T": 0.46940708121690167, "10S": 0.2877855071020504}}, "member_checkpoint_hashes": ["8a2b252b733cc79c31778ea27ba00fbe61206fef50454514b667c54a928d80a4", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c"], "cpu_seconds": 1.7579908831976354}], "positive_cutoffs": 4, "mean_delta": 0.0007929282675380456, "selection_gate_passed": true}. No runtime/package constructed, no weight sweep. + +E1286000 complete replayability suite: {"package": "/workspace/research/candidate-dispersion6-ensemble", "status": "complete", "steps": [{"name": "relocation", "returncode": 0, "seconds": 84.77749159513041}, {"name": "full_public_replay", "returncode": 0, "seconds": 436.0959661989473}, {"name": "independent_dispersion_replay", "returncode": 0, "seconds": 184.11096227006055}, {"name": "composition", "returncode": 0, "seconds": 0.16595014580525458}, {"name": "descriptive_comparison", "returncode": 0, "seconds": 0.1356765329837799}], "current_step": "descriptive_comparison", "seconds": 705.2942320329603, "skill": 0.383963658607839}. All package checks passed, but full score remains below E127; do not publish. Descriptive comparison {"candidate": "/workspace/research/valid-report-dispersion6-ensemble.json", "parent": "/workspace/research/valid-report-finite-member-ensemble.json", "candidate_hash": "a388035c9461a7bdb079a931484d9c505428ea0086e2f5456313d995872a584e", "parent_hash": "90199d09666c1653819ef17813f69fc4014fca075f99cc3766d24f457b50ca79", "skill_difference": -7.780721854211414e-05, "n_configs": 97, "n_dataset_clusters": 28, "improved_configs": 47, "bootstrap_seed": 317, "bootstrap_samples": 5000, "dataset_cluster_delta_percentiles": {"p025": -0.00024062329890107149, "p50": -7.43316017622897e-05, "p975": 6.257681725268526e-05}, "note": "Descriptive resampling only. Adaptive validation selection and reused windows prevent treating this as a held-out significance test."}. + +E131 CPU initialization checks: {"fixture_seed": 677, "training_seed": 307, "initial_forward_and_loss_bitwise_equal": true, "inherited_weights_bitwise_equal": true, "sampler_byte_identical": true, "model_code_byte_identical_to_E107": true, "all_parameters_trainable": true, "added_parameters": 98336, "parameters": 146575680, "checkpoint_sha256": "f7e35a6341ffc6c1ce53cfd8934256dde937171f5002f1fc34b1fd169f1a15d6", "seconds": 8.978978032013401, "optimizer_updates": 0, "validation_data_read": false}. GPU maximum/compiled audit pending. Pending E129 and E131 trainer metadata now explicitly records requested-horizon seed and normalization fallback; E131 also records slow-AR law. E129 has not started training, so no past checkpoint metadata or arithmetic changed. + +## E126 compiled candidate evals +- Checkpoint SHA-256: `d8be56a82c73a0426710742a1468df3b3d8abdaad541da4716e58cc607ee6e18`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 36.09797239303589 seconds. +- Overall skill 0.364306; relative MASE 0.760934; relative WQL 0.531067. +- term skill: long=0.3859, medium=0.3952, short=0.3435. +- domain skill: Econ/Fin=0.1306, Energy=0.2277, Healthcare=0.4224, Nature=0.4112, Sales=0.3396, Transport=0.4561, Web/CloudOps=0.4871. +- frequency skill: A=0.3907, D=0.3389, H=0.3847, M=0.0270, Q=0.2057, S=0.4209, T=0.4222, W=0.2298. +- variates skill: multivariate=0.3789, univariate=0.3524. +- Outcome: Bounded1000-update teacher compiler numerical comparison from identical full16000state; original schedule and all other factors unchanged. No automatic takeover or publication. + +## E126 original control evals +- Checkpoint SHA-256: `0699dba2a0b78d61ec78a7f4d8855eb887e0e5844009c85b73c2280bdeda201d`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 39.142066955566406 seconds. +- Overall skill 0.364321; relative MASE 0.759462; relative WQL 0.532071. +- term skill: long=0.3871, medium=0.3956, short=0.3429. +- domain skill: Econ/Fin=0.1313, Energy=0.2286, Healthcare=0.4285, Nature=0.4088, Sales=0.3419, Transport=0.4555, Web/CloudOps=0.4863. +- frequency skill: A=0.3912, D=0.3367, H=0.3857, M=0.0483, Q=0.2050, S=0.4208, T=0.4213, W=0.2241. +- variates skill: multivariate=0.3798, univariate=0.3517. +- Outcome: Bounded1000-update teacher compiler numerical comparison from identical full16000state; original schedule and all other factors unchanged. No automatic takeover or publication. + +## E126 compiled candidate backcast_evals +- Checkpoint SHA-256: `d8be56a82c73a0426710742a1468df3b3d8abdaad541da4716e58cc607ee6e18`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 36.27298712730408 seconds. +- Overall skill 0.331744; relative MASE 0.800194; relative WQL 0.558073. +- term skill: long=0.4018, medium=0.3533, short=0.2941. +- domain skill: Econ/Fin=0.1556, Energy=0.2263, Healthcare=0.3584, Nature=0.3628, Sales=0.4053, Transport=0.3596, Web/CloudOps=0.4547. +- frequency skill: A=0.3343, D=0.3419, H=0.3664, M=0.1982, Q=0.2234, S=0.3430, T=0.3284, W=0.2638. +- variates skill: multivariate=0.3545, univariate=0.3130. +- Outcome: Bounded1000-update teacher compiler numerical comparison from identical full16000state; original schedule and all other factors unchanged. No automatic takeover or publication. + +## E126 original control backcast_evals +- Checkpoint SHA-256: `0699dba2a0b78d61ec78a7f4d8855eb887e0e5844009c85b73c2280bdeda201d`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 36.57498288154602 seconds. +- Overall skill 0.332181; relative MASE 0.799229; relative WQL 0.558016. +- term skill: long=0.4034, medium=0.3538, short=0.2940. +- domain skill: Econ/Fin=0.1540, Energy=0.2252, Healthcare=0.3557, Nature=0.3694, Sales=0.4058, Transport=0.3593, Web/CloudOps=0.4544. +- frequency skill: A=0.3315, D=0.3453, H=0.3660, M=0.2015, Q=0.2195, S=0.3408, T=0.3291, W=0.2623. +- variates skill: multivariate=0.3535, univariate=0.3147. +- Outcome: Bounded1000-update teacher compiler numerical comparison from identical full16000state; original schedule and all other factors unchanged. No automatic takeover or publication. + +## E126 compiled candidate backcast2_evals +- Checkpoint SHA-256: `d8be56a82c73a0426710742a1468df3b3d8abdaad541da4716e58cc607ee6e18`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 36.39142870903015 seconds. +- Overall skill 0.357844; relative MASE 0.770908; relative WQL 0.534907. +- term skill: long=0.3688, medium=0.3877, short=0.3419. +- domain skill: Econ/Fin=0.0992, Energy=0.2353, Healthcare=0.3101, Nature=0.4711, Sales=0.5544, Transport=0.4164, Web/CloudOps=0.4409. +- frequency skill: A=0.3243, D=0.4196, H=0.3963, M=0.1582, Q=0.1367, S=0.2899, T=0.3536, W=0.2590. +- variates skill: multivariate=0.3696, univariate=0.3482. +- Outcome: Bounded1000-update teacher compiler numerical comparison from identical full16000state; original schedule and all other factors unchanged. No automatic takeover or publication. + +## E126 original control backcast2_evals +- Checkpoint SHA-256: `0699dba2a0b78d61ec78a7f4d8855eb887e0e5844009c85b73c2280bdeda201d`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 39.81012320518494 seconds. +- Overall skill 0.359808; relative MASE 0.767154; relative WQL 0.534241. +- term skill: long=0.3687, medium=0.3897, short=0.3446. +- domain skill: Econ/Fin=0.1002, Energy=0.2345, Healthcare=0.3380, Nature=0.4734, Sales=0.5563, Transport=0.4167, Web/CloudOps=0.4416. +- frequency skill: A=0.3233, D=0.4245, H=0.3964, M=0.1619, Q=0.1366, S=0.2886, T=0.3543, W=0.2699. +- variates skill: multivariate=0.3701, univariate=0.3513. +- Outcome: Bounded1000-update teacher compiler numerical comparison from identical full16000state; original schedule and all other factors unchanged. No automatic takeover or publication. + +## E126 compiled candidate backcast3_evals +- Checkpoint SHA-256: `d8be56a82c73a0426710742a1468df3b3d8abdaad541da4716e58cc607ee6e18`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 36.27197313308716 seconds. +- Overall skill 0.379547; relative MASE 0.749469; relative WQL 0.513646. +- term skill: long=0.3893, medium=0.3660, short=0.3811. +- domain skill: Econ/Fin=0.1606, Energy=0.3132, Healthcare=0.1758, Nature=0.5022, Sales=0.3883, Transport=0.4989, Web/CloudOps=0.3846. +- frequency skill: A=0.3186, D=0.4271, H=0.3989, M=0.1041, Q=0.2597, S=0.2577, T=0.4316, W=0.2193. +- variates skill: multivariate=0.3648, univariate=0.3909. +- Outcome: Bounded1000-update teacher compiler numerical comparison from identical full16000state; original schedule and all other factors unchanged. No automatic takeover or publication. + +## E126 original control backcast3_evals +- Checkpoint SHA-256: `0699dba2a0b78d61ec78a7f4d8855eb887e0e5844009c85b73c2280bdeda201d`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 35.707090616226196 seconds. +- Overall skill 0.377589; relative MASE 0.751555; relative WQL 0.515459. +- term skill: long=0.3887, medium=0.3647, short=0.3784. +- domain skill: Econ/Fin=0.1619, Energy=0.3136, Healthcare=0.1792, Nature=0.4931, Sales=0.3888, Transport=0.4990, Web/CloudOps=0.3821. +- frequency skill: A=0.3235, D=0.4228, H=0.3981, M=0.0995, Q=0.2578, S=0.2577, T=0.4299, W=0.2151. +- variates skill: multivariate=0.3640, univariate=0.3881. +- Outcome: Bounded1000-update teacher compiler numerical comparison from identical full16000state; original schedule and all other factors unchanged. No automatic takeover or publication. + +E131 maximum GPU/compiled audit: {"fixture_seed": 683, "training_seed": 307, "gpu_initial_forward_and_loss_bitwise_equal": true, "all_parameters_trainable": true, "maximum_shape_memory": {"batch": 48, "signed_rows": 96, "context": 4096, "horizon": 1024, "loss": 0.5064497590065002, "peak_allocated_mib": 10163.2412109375, "peak_reserved_mib": 10602.0, "free_before_mib": 22465.6875, "includes_adam_and_ema_placeholders": true, "selected_gradient_norms": {"long_query.weight": 0.0, "long_head.weight": 0.022453932091593742, "long_head.bias": 0.0007150184828788042, "head.weight": 0.21377567946910858}}, "eager_loss": 0.2832183539867401, "compiled_loss": 0.2832183241844177, "gradient_cosine": 0.999991608022376, "max_gradient_difference": 6.103515625e-05, "compile_comparison_seconds": 70.16511336597614, "lock_wait_seconds": 88.56701109395362, "seconds": 173.39559380686842, "optimizer_updates": 0, "validation_data_read": false}. New-query gradient is exactly0 at initial random zero output heads, as expected; direct long_head and original head gradients are nonzero. Queue25692 waits for E94halfLR and E79wide final96000; watcher/controller {"queue_pid": 25692, "watch_pid": 25693, "comparison_pid": 25694}. No additional concurrent allocation. + +E130 prepared public package descriptorfa97880dd132b1cdff459be4798f8f360d7df59b13e78026a9d74a95d63df0db, 256594744parameters; member weights["8a2b252b733cc79c31778ea27ba00fbe61206fef50454514b667c54a928d80a4", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c"]. Separate four_member_ensemble runtime keeps per-member finite cleanup/rule caps and ordered equal quarters. New146M member packaged directly with only its actual seed307 own-model lineage and generator declarations, without inherited mature-model seed labels. Synthetic composition, relocation, full replay and independent real composition suite active. + +E113 6000 four-cutoff comparison: {"label": "E113 6000 four-cutoff comparison", "utc": "2026-10-23T08:53:56.106260+00:00", "candidate": "lowfreq_windows_ema6000", "control": "overflow_control_ema6000", "rows": [{"cutoff": "evals", "candidate_skill": 0.37689889834307033, "control_skill": 0.3782887645248565, "delta": -0.001389866181786159, "candidate_checkpoint": "6022f0a4bfa1062ad14abf079449bbc0aea2c8378c4e8c24a5a88d6c7eed568f", "control_checkpoint": "b19875c52ed5024383fb69ccc48cb07a5629ad8011abf134c7dcfcdc50fae2af", "candidate_eval_seconds": 24.637309312820435, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7461642946563414, "rel_wql_gmean": 0.48185140448625774}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7114818476673104, "rel_wql_gmean": 0.4937134846824009}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7587744836539531, "rel_wql_gmean": 0.5474521404602561}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8833786145123239, "rel_wql_gmean": 0.8531518487365242}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9008291449851727, "rel_wql_gmean": 0.6443880390924023}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5841826675598496, "rel_wql_gmean": 0.5185655742165746}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8182743754041456, "rel_wql_gmean": 0.40277193564568253}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8481685562000009, "rel_wql_gmean": 0.5201665790427301}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6442200391898962, "rel_wql_gmean": 0.44227361720756947}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5642905007500406, "rel_wql_gmean": 0.43825160894025916}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6091689454127692, "rel_wql_gmean": 0.638276521684612}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7785626516441129, "rel_wql_gmean": 0.5355665107799793}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7314284480466448, "rel_wql_gmean": 0.4981263653987478}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9986128574835264, "rel_wql_gmean": 0.8624410357490886}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7903739563981046, "rel_wql_gmean": 0.8299815110338646}, "S": {"n_configs": 6, "rel_mase_gmean": 0.656301620925384, "rel_wql_gmean": 0.5047620788741458}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6945298685094353, "rel_wql_gmean": 0.4553332014533837}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9014486439579953, "rel_wql_gmean": 0.6668717099327689}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7126021042582767, "rel_wql_gmean": 0.5125054838159262}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.772902623640725, "rel_wql_gmean": 0.5274131827426548}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7451158192819246, "rel_wql_gmean": 0.4809631678035488}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7120497644863014, "rel_wql_gmean": 0.4940812105058145}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7560063232433744, "rel_wql_gmean": 0.5455016162773587}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.891060652656678, "rel_wql_gmean": 0.8581226203181075}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8989380404519756, "rel_wql_gmean": 0.6435803440684917}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5710382040222995, "rel_wql_gmean": 0.5034944242351712}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8133075715765863, "rel_wql_gmean": 0.4004091491239218}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8446340518950459, "rel_wql_gmean": 0.5179589899563962}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6447526741433901, "rel_wql_gmean": 0.4427981539703199}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5645988459931921, "rel_wql_gmean": 0.4387078987240053}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6165351258073414, "rel_wql_gmean": 0.6464531739881929}, "D": {"n_configs": 15, "rel_mase_gmean": 0.777944381816132, "rel_wql_gmean": 0.5346411774818413}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7317515640788856, "rel_wql_gmean": 0.49890798111520296}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9655032792454371, "rel_wql_gmean": 0.8262938781338912}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7858131466267005, "rel_wql_gmean": 0.8312500357519329}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6555214893191091, "rel_wql_gmean": 0.504479335142133}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6939507700541674, "rel_wql_gmean": 0.45508640655176025}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8990798911693764, "rel_wql_gmean": 0.664987514515424}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7111159189621905, "rel_wql_gmean": 0.5120760043186128}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7711295953953445, "rel_wql_gmean": 0.5256252376142441}}}, "group_skill_delta": {"term": {"long": -0.0009739529555055082, "medium": 0.0004572613129861791, "short": -0.0023238162415889496}, "domain": {"Econ/Fin": 0.0063028758916267025, "Energy": -0.001277279116533303, "Healthcare": -0.01419331378718447, "Nature": -0.003426212345731483, "Sales": -0.002793454166251652, "Transport": 0.0005371855991479491, "Web/CloudOps": 0.00039473405139495155}, "frequency": {"A": 0.007764034867115299, "D": -0.0008143027489134758, "H": 0.0006067942733988252, "M": -0.03484210742464455, "Q": -0.0017233061297405872, "S": -0.0005033122269536561, "T": -0.000386852040670127, "W": -0.002114020721949994}, "variates": {"multivariate": -0.0008835170618891608, "univariate": -0.0018146214185645881}}}, {"cutoff": "backcast_evals", "candidate_skill": 0.3343961576413551, "control_skill": 0.33515646486891926, "delta": -0.0007603072275641498, "candidate_checkpoint": "6022f0a4bfa1062ad14abf079449bbc0aea2c8378c4e8c24a5a88d6c7eed568f", "control_checkpoint": "b19875c52ed5024383fb69ccc48cb07a5629ad8011abf134c7dcfcdc50fae2af", "candidate_eval_seconds": 23.87971806526184, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7775995665582034, "rel_wql_gmean": 0.4660524143600413}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7742979584754606, "rel_wql_gmean": 0.5343745587246692}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8201142133986199, "rel_wql_gmean": 0.598685800269491}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8832386329140982, "rel_wql_gmean": 0.8125278417445753}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8897858431693706, "rel_wql_gmean": 0.6676356286156242}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6492080161186249, "rel_wql_gmean": 0.5505110265373835}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9342301107590483, "rel_wql_gmean": 0.4342352628337986}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7396632725324492, "rel_wql_gmean": 0.5033836939140032}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7390030781599123, "rel_wql_gmean": 0.5323292524398107}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6651103369438204, "rel_wql_gmean": 0.4599139822296968}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6614347761202842, "rel_wql_gmean": 0.7332772756783581}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8395380907736223, "rel_wql_gmean": 0.49858292016697153}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7782944268201338, "rel_wql_gmean": 0.5161951267114039}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8850314011347771, "rel_wql_gmean": 0.8093835670278922}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7641972179731484, "rel_wql_gmean": 0.7595910327353056}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8520874716612998, "rel_wql_gmean": 0.5072036983501343}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7698429755624734, "rel_wql_gmean": 0.5785867598697058}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8751127568750565, "rel_wql_gmean": 0.5813954254548376}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.790903324120952, "rel_wql_gmean": 0.531769678844664}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.8085692176449468, "rel_wql_gmean": 0.571082070761698}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7750842285105053, "rel_wql_gmean": 0.46538535076726445}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7739741905332832, "rel_wql_gmean": 0.534827984372569}, "short": {"n_configs": 55, "rel_mase_gmean": 0.818371751293216, "rel_wql_gmean": 0.5985153782895438}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.887916619787545, "rel_wql_gmean": 0.8185770809200361}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8901417181128463, "rel_wql_gmean": 0.6693878286037928}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6334453098405051, "rel_wql_gmean": 0.5437528735999733}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9321426691826549, "rel_wql_gmean": 0.43340604882484346}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7321691335963859, "rel_wql_gmean": 0.4977340558431129}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7394280206962279, "rel_wql_gmean": 0.5327250385233748}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6634585442750054, "rel_wql_gmean": 0.4591816165371809}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6523615189029875, "rel_wql_gmean": 0.7262242686636398}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8405439241384891, "rel_wql_gmean": 0.5009731755165275}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7770655988729349, "rel_wql_gmean": 0.5160636056826207}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8620023507565068, "rel_wql_gmean": 0.7924280387937057}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7600409188395882, "rel_wql_gmean": 0.7689369191610511}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8521465319527592, "rel_wql_gmean": 0.5084037872669025}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7696065791080199, "rel_wql_gmean": 0.577900906515431}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8747966347792652, "rel_wql_gmean": 0.5837934687567188}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7902103277834961, "rel_wql_gmean": 0.5315871703126607}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.8062350844786952, "rel_wql_gmean": 0.5709428531788484}}}, "group_skill_delta": {"term": {"long": -0.0014047237485829145, "medium": 0.00013828872268262238, "short": -0.0008444102595704939}, "domain": {"Econ/Fin": 0.005396410804951124, "Energy": 0.001165065198261761, "Healthcare": -0.010938049139590511, "Nature": -0.0013197186448916653, "Sales": -0.006515463640201058, "Transport": 0.00041349253828093513, "Web/CloudOps": -0.0011271926475546756}, "frequency": {"A": -0.008127431914985217, "D": 0.0019373580889670006, "H": -0.0005812622851624205, "M": -0.019879317803983554, "Q": 0.002585334672893569, "S": 0.000800090015471544, "T": -0.0004980990138920838, "W": 0.001340411461665303}, "variates": {"multivariate": -0.00039543175315481793, "univariate": -0.0010642347373726047}}}, {"cutoff": "backcast2_evals", "candidate_skill": 0.3599979390330963, "control_skill": 0.35970579873679454, "delta": 0.0002921402963017572, "candidate_checkpoint": "6022f0a4bfa1062ad14abf079449bbc0aea2c8378c4e8c24a5a88d6c7eed568f", "control_checkpoint": "b19875c52ed5024383fb69ccc48cb07a5629ad8011abf134c7dcfcdc50fae2af", "candidate_eval_seconds": 23.407413244247437, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.8008593621710156, "rel_wql_gmean": 0.5057430926868616}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.757468445904617, "rel_wql_gmean": 0.49256746030833815}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7633722415209746, "rel_wql_gmean": 0.558605012241182}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8946216965321081, "rel_wql_gmean": 0.9088687371623195}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8965201542322633, "rel_wql_gmean": 0.6464378810161919}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6785194902800584, "rel_wql_gmean": 0.5849201303195053}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7655843123264524, "rel_wql_gmean": 0.36490172511656266}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5678061820242641, "rel_wql_gmean": 0.3644855914883543}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6685465658076019, "rel_wql_gmean": 0.5017399429608845}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6849965213617552, "rel_wql_gmean": 0.4724282525707762}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5825163531960122, "rel_wql_gmean": 0.7346377536602618}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7324508940634272, "rel_wql_gmean": 0.45212722264136573}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7556124624084898, "rel_wql_gmean": 0.4899134119816834}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8103905761748015, "rel_wql_gmean": 0.8492327228669642}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8353441047809755, "rel_wql_gmean": 0.8671883110574543}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9088419438141119, "rel_wql_gmean": 0.5678755021819691}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7573691463179116, "rel_wql_gmean": 0.5419241988811554}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8434646356234143, "rel_wql_gmean": 0.6305198670040683}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7829043173773316, "rel_wql_gmean": 0.5178062400149124}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7587866385127666, "rel_wql_gmean": 0.5443359350107977}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.8007838015734439, "rel_wql_gmean": 0.5057608145580296}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7549215312107497, "rel_wql_gmean": 0.49176726739734045}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7642838919526312, "rel_wql_gmean": 0.5599238938428742}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8997976584221669, "rel_wql_gmean": 0.9109410837720314}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8969828992939779, "rel_wql_gmean": 0.6477417063864679}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6849313799294706, "rel_wql_gmean": 0.586932347321718}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7624727427382104, "rel_wql_gmean": 0.3657161858629389}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5639287429478652, "rel_wql_gmean": 0.36145769293128766}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6689876132941273, "rel_wql_gmean": 0.5020608717418806}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6837785683593893, "rel_wql_gmean": 0.4719606763184108}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5811330636284028, "rel_wql_gmean": 0.7336592636608978}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7329769702098001, "rel_wql_gmean": 0.45167764562697754}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7553820928392463, "rel_wql_gmean": 0.4904273479694985}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8254186064766647, "rel_wql_gmean": 0.8515799856418855}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8324909356393811, "rel_wql_gmean": 0.8724694350490023}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9100541095744552, "rel_wql_gmean": 0.5693729069160721}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7550799772409099, "rel_wql_gmean": 0.540387432745741}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8437173750489751, "rel_wql_gmean": 0.6406981711171287}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7818465318697899, "rel_wql_gmean": 0.5175870710427966}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7594977958239505, "rel_wql_gmean": 0.545505930798867}}}, "group_skill_delta": {"term": {"long": -1.8873745696090793e-05, "medium": -0.0015232986214765987, "short": 0.0011607039431776878}, "domain": {"Econ/Fin": 0.0036351470036239952, "Energy": 0.0009639811195998327, "Healthcare": 0.004057414263133219, "Nature": -0.0004868526346849533, "Sales": -0.0034430301775181804, "Transport": 0.00037626934528212086, "Web/CloudOps": -0.0007872938922964812}, "frequency": {"A": -0.0012124673197710933, "D": -7.965945370269623e-05, "H": 0.0002262434472751762, "M": 0.008812908587369161, "Q": 0.0011285045089141077, "S": 0.0014261024011577028, "T": -0.0018765679611807418, "W": 0.005972689804801923}, "variates": {"multivariate": -0.0005649429922075511, "univariate": 0.0009917364796149242}}}, {"cutoff": "backcast3_evals", "candidate_skill": 0.38993403866336573, "control_skill": 0.38966768132876584, "delta": 0.0002663573345998982, "candidate_checkpoint": "6022f0a4bfa1062ad14abf079449bbc0aea2c8378c4e8c24a5a88d6c7eed568f", "control_checkpoint": "b19875c52ed5024383fb69ccc48cb07a5629ad8011abf134c7dcfcdc50fae2af", "candidate_eval_seconds": 23.662298679351807, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7653115593218499, "rel_wql_gmean": 0.47599461710723834}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7715691889827463, "rel_wql_gmean": 0.5313719143376657}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7126844177529106, "rel_wql_gmean": 0.5076569047682628}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8352132728850933, "rel_wql_gmean": 0.8170711397518996}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8348557462103663, "rel_wql_gmean": 0.5561697329589659}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7733153411204075, "rel_wql_gmean": 0.6546403085337337}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7140141482679682, "rel_wql_gmean": 0.34196831793742916}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7565061085453817, "rel_wql_gmean": 0.48058309322338083}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5437907447481647, "rel_wql_gmean": 0.449614701170043}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7165702979219388, "rel_wql_gmean": 0.5200051777411084}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5261551139322042, "rel_wql_gmean": 0.7330240240629913}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7252372471132796, "rel_wql_gmean": 0.4239024663817478}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7268124573646887, "rel_wql_gmean": 0.4893130921486449}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8545447134934323, "rel_wql_gmean": 0.8493178662981181}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7127776195257158, "rel_wql_gmean": 0.7718161257451915}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8395472897334526, "rel_wql_gmean": 0.5993236231307666}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7069092537460439, "rel_wql_gmean": 0.4641162361923377}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8015863686794376, "rel_wql_gmean": 0.6701047974351558}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7632290984309094, "rel_wql_gmean": 0.515189244156747}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7144971245676118, "rel_wql_gmean": 0.49880868819086793}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7650747158835133, "rel_wql_gmean": 0.4758888221311058}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7703157746376595, "rel_wql_gmean": 0.5298503011269557}, "short": {"n_configs": 54, "rel_mase_gmean": 0.713915671760059, "rel_wql_gmean": 0.5084844315057424}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8452403065316382, "rel_wql_gmean": 0.8277399249864468}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8346950467324626, "rel_wql_gmean": 0.5567599695672222}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7876375654704325, "rel_wql_gmean": 0.6565412569519505}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.710238739553539, "rel_wql_gmean": 0.34191077293082645}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7563686587019305, "rel_wql_gmean": 0.4784563222634317}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5433317817040721, "rel_wql_gmean": 0.4493168613990946}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7161526533494015, "rel_wql_gmean": 0.5178489398382691}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5311143622209655, "rel_wql_gmean": 0.7781586196577971}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7234708846594775, "rel_wql_gmean": 0.42486757337507386}, "H": {"n_configs": 29, "rel_mase_gmean": 0.725973846929309, "rel_wql_gmean": 0.48863382838793346}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8623268790180476, "rel_wql_gmean": 0.8523275939235515}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7182632014266673, "rel_wql_gmean": 0.7707135583961491}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8408993113146807, "rel_wql_gmean": 0.5989715147638536}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7064723895859075, "rel_wql_gmean": 0.463139705670842}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8096257056910313, "rel_wql_gmean": 0.6721758032092567}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7638007775200529, "rel_wql_gmean": 0.5152023145873739}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7148285566222029, "rel_wql_gmean": 0.49905178580637044}}}, "group_skill_delta": {"term": {"long": -0.00016046718080775513, "medium": -0.0014369850536211093, "short": 0.001009829034523957}, "domain": {"Econ/Fin": 0.010351943848399103, "Energy": 0.00029585934007825276, "Healthcare": 0.00760033702944507, "Nature": -0.0013495907178020516, "Sales": -0.0013903114325046761, "Transport": -0.0003724434991111414, "Web/CloudOps": -0.0014444489650127235}, "frequency": {"A": 0.02184240353004696, "D": -4.55761836851698e-05, "H": -0.0007579762655841593, "M": 0.005385376877326431, "Q": 0.0023166477508324013, "S": 0.00036236562580005405, "T": -0.0007797412974028806, "W": 0.004803408269482556}, "variates": {"multivariate": 0.00024275664332440439, "univariate": 0.0002839356919598357}}}], "mean_delta": -0.00039791894461216337, "positive_cutoffs": 2, "outcome": "Declared primary6000/durability12000 diagnostic. No transfer formula or automatic publication is selected by this controller."} + +## E128 durability dispersion transfer12000 valid_screen +- Checkpoint SHA-256: `807ab7579fc823c783e57a0cd9758125c02b67b383e6d13364f0d34ee63ee4c9`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 28.033636569976807 seconds. +- Overall skill 0.386522; relative MASE 0.733364; relative WQL 0.513191. +- term skill: long=0.4078, medium=0.4094, short=0.3691. +- domain skill: Econ/Fin=0.1471, Energy=0.2419, Healthcare=0.4732, Nature=0.4432, Sales=0.3390, Transport=0.4742, Web/CloudOps=0.5107. +- frequency skill: A=0.3779, D=0.3743, H=0.4062, M=0.0993, Q=0.2064, S=0.4247, T=0.4441, W=0.2254. +- variates skill: multivariate=0.4008, univariate=0.3749. +- Outcome: Fixed zero-extended E117first + E11912000 - E10712000; no optimizer updates. Equal ensemble selected separately. + +## E128 durability dispersion transfer12000 valid_backcast +- Checkpoint SHA-256: `807ab7579fc823c783e57a0cd9758125c02b67b383e6d13364f0d34ee63ee4c9`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 26.6574444770813 seconds. +- Overall skill 0.343249; relative MASE 0.788490; relative WQL 0.547022. +- term skill: long=0.3992, medium=0.3634, short=0.3124. +- domain skill: Econ/Fin=0.1782, Energy=0.2295, Healthcare=0.3698, Nature=0.3898, Sales=0.4038, Transport=0.3810, Web/CloudOps=0.4588. +- frequency skill: A=0.3236, D=0.3617, H=0.3779, M=0.1942, Q=0.2298, S=0.3387, T=0.3387, W=0.2875. +- variates skill: multivariate=0.3588, univariate=0.3306. +- Outcome: Fixed zero-extended E117first + E11912000 - E10712000; no optimizer updates. Equal ensemble selected separately. + +## E128 durability dispersion transfer12000 valid_backcast2 +- Checkpoint SHA-256: `807ab7579fc823c783e57a0cd9758125c02b67b383e6d13364f0d34ee63ee4c9`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 25.614221811294556 seconds. +- Overall skill 0.365699; relative MASE 0.763918; relative WQL 0.526676. +- term skill: long=0.3705, medium=0.3949, short=0.3522. +- domain skill: Econ/Fin=0.1341, Energy=0.2390, Healthcare=0.2968, Nature=0.4855, Sales=0.5515, Transport=0.4283, Web/CloudOps=0.4462. +- frequency skill: A=0.3489, D=0.4280, H=0.3996, M=0.1482, Q=0.1531, S=0.2824, T=0.3716, W=0.2600. +- variates skill: multivariate=0.3719, univariate=0.3607. +- Outcome: Fixed zero-extended E117first + E11912000 - E10712000; no optimizer updates. Equal ensemble selected separately. + +## E128 durability dispersion transfer12000 valid_backcast3 +- Checkpoint SHA-256: `807ab7579fc823c783e57a0cd9758125c02b67b383e6d13364f0d34ee63ee4c9`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 25.73096227645874 seconds. +- Overall skill 0.391781; relative MASE 0.737942; relative WQL 0.501300. +- term skill: long=0.3966, medium=0.3639, short=0.4001. +- domain skill: Econ/Fin=0.1860, Energy=0.3235, Healthcare=0.2382, Nature=0.4989, Sales=0.4063, Transport=0.5159, Web/CloudOps=0.3954. +- frequency skill: A=0.3641, D=0.4486, H=0.4092, M=0.1381, Q=0.2641, S=0.2774, T=0.4329, W=0.2497. +- variates skill: multivariate=0.3758, univariate=0.4041. +- Outcome: Fixed zero-extended E117first + E11912000 - E10712000; no optimizer updates. Equal ensemble selected separately. + +E128 durability12000 fixed equal-ensemble diagnostics: {"pid": 25137, "status": "complete; review gate before full replay", "steps": [{"label": "standalone four cutoffs", "returncode": 0, "seconds": 611.6175360109191}, {"label": "record valid_screen", "returncode": 0, "seconds": 0.03854229603894055}, {"label": "ensemble valid_screen", "returncode": 0, "seconds": 2.4362374609336257}, {"label": "record valid_backcast", "returncode": 0, "seconds": 0.03839866095222533}, {"label": "ensemble valid_backcast", "returncode": 0, "seconds": 2.195331864990294}, {"label": "record valid_backcast2", "returncode": 0, "seconds": 0.053376773139461875}, {"label": "ensemble valid_backcast2", "returncode": 0, "seconds": 2.065167659893632}, {"label": "record valid_backcast3", "returncode": 0, "seconds": 0.044758826959878206}, {"label": "ensemble valid_backcast3", "returncode": 0, "seconds": 1.7165518840774894}], "started_utc": "2026-10-23T08:45:01.960793+00:00", "seconds": 620.504908550065, "results": [{"cutoff": "valid_screen", "skill": 0.387631434012613, "control_skill": 0.3877185003381878, "delta": -8.706632557475835e-05, "groups": {"term": {"short": 0.37068194474462157, "medium": 0.4097796176395536, "long": 0.40849729366372367}, "domain": {"Econ/Fin": 0.14906153028819058, "Energy": 0.24740579222476355, "Healthcare": 0.4796934504715721, "Nature": 0.44410850413953806, "Sales": 0.3446703538346755, "Transport": 0.4722712030334615, "Web/CloudOps": 0.5072367984448052}, "freq": {"A-DEC": 0.37673348328274414, "Q-DEC": 0.20049341302210122, "M": 0.11935346179130535, "W-SUN": 0.12581403312344364, "D": 0.3701949353166585, "H": 0.40333433785598394, "15T": 0.2179069338160644, "W-FRI": 0.014432437224305206, "10T": 0.6277687306843087, "W-TUE": 0.6171748330046889, "W-THU": 0.2082801402344301, "W-WED": 0.328702914013944, "5T": 0.5225236050449166, "10S": 0.4252257258157742}}, "member_checkpoint_hashes": ["807ab7579fc823c783e57a0cd9758125c02b67b383e6d13364f0d34ee63ee4c9", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cpu_seconds": 2.199216665001586}, {"cutoff": "valid_backcast", "skill": 0.34321236138030986, "control_skill": 0.3429732095231861, "delta": 0.00023915185712375386, "groups": {"term": {"short": 0.31071983654199253, "medium": 0.3621282754770089, "long": 0.4040730316333201}, "domain": {"Econ/Fin": 0.17961750811991928, "Energy": 0.23286215379520836, "Healthcare": 0.40563890895352117, "Nature": 0.3800791233546058, "Sales": 0.40853347688296815, "Transport": 0.3771851486377281, "Web/CloudOps": 0.4547587636856828}, "freq": {"A-DEC": 0.32749370401535927, "Q-DEC": 0.23741514828197818, "M": 0.19585493095249495, "W-SUN": 0.07316053633867003, "D": 0.35815449501673347, "H": 0.3751489668493323, "15T": 0.22170922698884998, "W-FRI": 0.2287214171356433, "10T": 0.32681881547325076, "W-TUE": 0.5493191419071376, "W-THU": 0.2637606809467842, "W-WED": 0.36054426279868534, "5T": 0.4460139993900665, "10S": 0.3477728598170654}}, "member_checkpoint_hashes": ["807ab7579fc823c783e57a0cd9758125c02b67b383e6d13364f0d34ee63ee4c9", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cpu_seconds": 1.956491030054167}, {"cutoff": "valid_backcast2", "skill": 0.3676028026728825, "control_skill": 0.3674637814642573, "delta": 0.00013902120862518963, "groups": {"term": {"short": 0.3549456260609696, "medium": 0.39649710524299164, "long": 0.3705253993820533}, "domain": {"Econ/Fin": 0.12780519012554215, "Energy": 0.24201604645162877, "Healthcare": 0.3486275063249036, "Nature": 0.48331614416756874, "Sales": 0.5566475041330979, "Transport": 0.42832467643451233, "Web/CloudOps": 0.4415709197426039}, "freq": {"A-DEC": 0.3357231130775328, "Q-DEC": 0.15829172951663628, "M": 0.17048883573879448, "W-SUN": 0.08504117481065188, "D": 0.43269402341806407, "H": 0.39766899225608077, "15T": 0.10795846596782255, "W-FRI": 0.15201232164010592, "10T": 0.5119145223555399, "W-TUE": 0.09108782450582265, "W-THU": 0.3566400804239148, "W-WED": 0.5633665322888896, "5T": 0.4772805736081409, "10S": 0.2862378937571334}}, "member_checkpoint_hashes": ["807ab7579fc823c783e57a0cd9758125c02b67b383e6d13364f0d34ee63ee4c9", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cpu_seconds": 1.8519201409071684}, {"cutoff": "valid_backcast3", "skill": 0.3908557586831448, "control_skill": 0.3907349048993719, "delta": 0.00012085378377291178, "groups": {"term": {"short": 0.3963510949367022, "medium": 0.36911963139497816, "long": 0.3976102068749139}, "domain": {"Econ/Fin": 0.19051417812242089, "Energy": 0.31718667596118966, "Healthcare": 0.2415112051403444, "Nature": 0.506115793531148, "Sales": 0.4022035041012628, "Transport": 0.5122293135267391, "Web/CloudOps": 0.3956455185229273}, "freq": {"A-DEC": 0.3585566380206566, "Q-DEC": 0.25722061236867333, "M": 0.14972205914197367, "W-SUN": 0.17775151306254877, "D": 0.4434997099668646, "H": 0.40733288525473155, "15T": 0.2554130986399531, "W-FRI": 0.03689607565197617, "10T": 0.6055719949289415, "W-TUE": 0.27616117961258635, "W-THU": 0.3340485207038867, "W-WED": 0.3759002450046014, "5T": 0.46697145262020834, "10S": 0.29374694337261253}}, "member_checkpoint_hashes": ["807ab7579fc823c783e57a0cd9758125c02b67b383e6d13364f0d34ee63ee4c9", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe"], "cpu_seconds": 1.4953445647843182}], "positive_cutoffs": 3, "mean_delta": 0.00010299013098677423, "selection_gate_passed": true}. No publication yet. + +E126 final decision 2026-10-23T08:55:33.634889+00:00: reject teacher compiler takeover. Four-cutoff skill differences [-1.5293212246692e-05, -0.0004372110796623252, -0.0019640869934627325, 0.001958147733838289], maximum absolute0.001964086993 exceeds predeclared0.0005 diagnostic tolerance; late shared-device timing gain only3to5percent, cold process1500.927716598s. Keep original E101 teacher execution/coefficient/package and96k schedule unchanged. Bounded probe stays stopped17000; no further training on this branch. The tolerance is an engineering diagnostic, not a significance or equivalence test. + +E113 primary6000 selection: two cutoffs improve, two regress, mean delta-0.000397918945 versus E80. Do not transfer primary; complete declared12000 durability. All group metrics are in lowfreq_windows6k_four_cutoff_comparison.json and the matched journal entry. + +E118 independent-seed long-seasonal replication seed523 training started at 2026-10-23T09:03:52Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E130 fixed fourth fresh146M48000 member — full replay selected +- Checkpoint SHA-256: `fa97880dd132b1cdff459be4798f8f360d7df59b13e78026a9d74a95d63df0db`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.384150; relative MASE 0.735921; relative WQL 0.515370. +- term skill: long=0.4008, medium=0.4088, short=0.3679. +- domain skill: Econ/Fin=0.1298, Energy=0.2412, Healthcare=0.4860, Nature=0.4432, Sales=0.3560, Transport=0.4730, Web/CloudOps=0.5004. +- frequency skill: A=0.3027, D=0.3766, H=0.3971, M=0.1475, Q=0.1890, S=0.4236, T=0.4396, W=0.2403. +- variates skill: multivariate=0.3963, univariate=0.3743. +- Outcome: Fixed equal quarters improve full skill from 0.384041465826 to 0.384149718182; all97configs151170instances pass. Inference 481.492s on shared H100. Relocation and actual-member real/extreme synthetic composition are bitwise exact. Validation selection only, not held-out reward. + +E130 complete suite {"package": "/workspace/research/candidate-fresh-capacity4-ensemble", "status": "complete", "steps": [{"name": "synthetic_four_member_composition", "returncode": 0, "seconds": 140.04258152702823}, {"name": "relocation", "returncode": 0, "seconds": 67.24213584186509}, {"name": "full_public_replay", "returncode": 0, "seconds": 484.4881066719536}, {"name": "independent_fresh146m_replay", "returncode": 0, "seconds": 99.68134234496392}, {"name": "composition", "returncode": 0, "seconds": 0.18438137485645711}, {"name": "descriptive_comparison", "returncode": 0, "seconds": 0.18302110210061073}], "current_step": "descriptive_comparison", "seconds": 791.8420735518448, "skill": 0.38414971818207}. Synthetic actual-four-member runtime checks {"checkpoint_sha256": "fa97880dd132b1cdff459be4798f8f360d7df59b13e78026a9d74a95d63df0db", "runtime_code_sha256": {"seasonal.py": "b946e63048196ab5ea8b249137d48c80d8510943caccd0f180e4fb86d9b24b37", "ts_io.py": "1064d1a95a59e7edd6ed33e9a6d58c83c17fa3886acb1fb54e3652d9326ee436", "model.py": "c27748fa4b1186b513f76eca26052753b8dcd1794994e5989addaf371ca70f2e", "predict.py": "15b86dbaa19128df1105b6dd4243f2aa1321aff3fc45685a0a9811d8862d7add", "infer.sh": "5fe66b4fe9a4787285d830cfd96975701e97286a75ba7c3687bd8891475edf68", "continuity.py": "dbb08d2229ad80ad00f638b0b9f2f6ca13c663e0fd6730058e5fee8ff54545d5", "zero_mass.py": "f079d509009bcda409b80eb64467c869b838cfbab11b2bd4c660c2875b6642fe", "model1.py": "c27748fa4b1186b513f76eca26052753b8dcd1794994e5989addaf371ca70f2e", "model3.py": "44eeb23c037e91b8f67e432615ce46540a7ac4242919785f9c4218de23121499", "model0.py": "3eaa4aed0a1c62b80d94be6c3084b10a594e9fce17444eac17ca3f1b0b5c549e", "model2.py": "89bb87b2501b117ac02daf001a68f389ec488931ce18905445d15874760685be"}, "member_hashes": ["8a2b252b733cc79c31778ea27ba00fbe61206fef50454514b667c54a928d80a4", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c"], "checks": [{"config_id": "synthetic_H", "instances": 12, "bitwise_fixed_average": true, "finite": true, "ordered": true}, {"config_id": "synthetic_15T", "instances": 12, "bitwise_fixed_average": true, "finite": true, "ordered": true}], "steps": [{"name": "standalone0", "seconds": 7.54584995820187}, {"name": "standalone1", "seconds": 7.568851496092975}, {"name": "standalone2", "seconds": 7.905901189893484}, {"name": "standalone3", "seconds": 8.563424529973418}, {"name": "ensemble", "seconds": 20.146188400918618}], "lock_wait_seconds": 88.12057089991868, "seconds": 139.89567038416862, "optimizer_updates": 0, "validation_data_read": false}. Descriptive comparison {"candidate": "/workspace/research/valid-report-fresh-capacity4-ensemble.json", "parent": "/workspace/research/valid-report-finite-member-ensemble.json", "candidate_hash": "fa97880dd132b1cdff459be4798f8f360d7df59b13e78026a9d74a95d63df0db", "parent_hash": "90199d09666c1653819ef17813f69fc4014fca075f99cc3766d24f457b50ca79", "skill_difference": 0.00010825235568889813, "n_configs": 97, "n_dataset_clusters": 28, "improved_configs": 41, "bootstrap_seed": 317, "bootstrap_samples": 5000, "dataset_cluster_delta_percentiles": {"p025": -0.00215013782076347, "p50": 0.00017516257300170812, "p975": 0.0022812793702812035}, "note": "Descriptive resampling only. Adaptive validation selection and reused windows prevent treating this as a held-out significance test."}. Every member forecasts every instance. Four cutoffs improve; latest-cutoff long-term group regresses while aggregate improves, as detailed in group metrics. E101teacher remains immutableE96. + +## E132 final-duration fresh fourth member, declared 2026-10-23T09:06:54.075039+00:00 +Hypothesis: since E130 showed error diversity from the separately initialized146M model, its scheduled96000 endpoint may improve the same ensemble beyond48000. Replace only E79wideEMA48000 with its scheduledEMA96000; freeze E117finalfirst/E71EMA6000/E93EMA12000 and ordered equal quarters. Control E130published. The96000main result is not yet available; no additional training or altered schedule. Training seed307, no new generator/data. Evaluate all4cutoffs regardless of standalone ranking, require3of4positive and positive mean versusE130 before one full public replay. Publication also requires better full score and checks versus the then-current package. No intermediate checkpoint or weight sweep. + +## E133 conditional equal-seed seasonal correction, declared 2026-10-23T09:08:19.714091+00:00 +Hypothesis: if the large E107 seasonal-summary effect replicates with seed523, averaging matched corrections across seeds may improve robustness. This is separate from rejected E124weekly replication. Require BOTH E1186000 and E11812000 to improve their matched E111control at at least3of4cutoffs with positive mean. Only then construct one duration12000 checkpoint: E117final firstmember +0.5*((E118EMA12000-zero_extend(E111controlEMA12000))-(E107EMA12000-zero_extend(E80EMA12000))). Control tensors for long_query/long_head are exactlyzero. Other parameters use the literal float32 formula in that order. Keep E71EMA6000, E93EMA12000 and E79wideEMA48000 fixed; equal ordered quarters, every member forecasts every instance. Require3of4positive ensemble comparisons and positive mean against E130 before full replay; publication must improve the then-current package and pass runtime checks. No6000merged alternative, coefficient sweep, new optimizer updates or data. Training seeds197/523; merge fixtureseed691. E1186000/12000results are not yet available. + +## E134 fixed visible-window curriculum from random146M, declared 2026-10-23T09:14:07.033062+00:00 +Hypothesis: the fresh large-model plateau partly reflects optimization on long contexts/futures from the first update; the mature smaller lineage began with shorter windows. Match E79wide own random initialization c969..., model/data/sampler/sourceweights/seed307/B48/LR2e-4/96k/paired/staticcompile/slowAR/horizon300310/400warmup/cosinefloor0.2. Always sample and prefetch the ORIGINAL full windows with identical RNG consumption. Only the arrays supplied to the loss are cropped: steps1..16000 take lastC/4 context and firstmax(16,H/4) target;16001..32000 take lastC/2 and firstmax(16,H/2);32001..96000 use original arrays unchanged. Context lengths are already divisible by16; every target view is at least16. Crop after consuming the prefetched full batch; recovery stores the unmodified next full batch and uses the resumed global step, with no extra counter/RNG. Source windows, values and late-stage stream are identical to control; visible observation exposure/compute differ and will be measured. No teacher, new data, new model parameters or inference changes. Primary96000;16/32/48/72kdiagnostics,48/96four-cutoff comparisons. Queue after E110full-corpus96000 frees its allocation; require E79wide96000. CPUfixture701/GPUfixture709; no validation training. No schedule alternatives or transfer formula selected. + +E121 6000 four-cutoff comparison: {"label": "E121 6000 four-cutoff comparison", "utc": "2026-10-23T09:15:40.991339+00:00", "candidate": "seasonal_history_ema6000", "control": "long_seasonal_ema6000", "rows": [{"cutoff": "evals", "candidate_skill": 0.3817685810005982, "control_skill": 0.38227466722292214, "delta": -0.0005060862223239537, "candidate_checkpoint": "3cb20017da82189fb26998bf3129d05dd234da77d0ab9368c6a4124ae732aa19", "control_checkpoint": "ad45e0cfae574d3dc1be0b9720c9be0863db9ffe33891fdb22c86dfa83667253", "candidate_eval_seconds": 28.41759157180786, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7427798851547502, "rel_wql_gmean": 0.480705859626928}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7084344807368257, "rel_wql_gmean": 0.49372688802898496}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7498345696608782, "rel_wql_gmean": 0.5411656310255009}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8896377050023038, "rel_wql_gmean": 0.8552925713089266}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.895357514468135, "rel_wql_gmean": 0.6408807905896997}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5733389714741494, "rel_wql_gmean": 0.5060436634788081}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8080292177977787, "rel_wql_gmean": 0.4045547054558028}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8418605092641899, "rel_wql_gmean": 0.5165249207431287}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6322814717091779, "rel_wql_gmean": 0.4335633189446315}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5617078170865537, "rel_wql_gmean": 0.43513795058882027}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6180475502592851, "rel_wql_gmean": 0.6469105480568086}, "D": {"n_configs": 15, "rel_mase_gmean": 0.761525834042119, "rel_wql_gmean": 0.5233823774456857}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7257276749680774, "rel_wql_gmean": 0.4955113716516702}, "M": {"n_configs": 5, "rel_mase_gmean": 0.96171751117691, "rel_wql_gmean": 0.825323398780684}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7837107393854835, "rel_wql_gmean": 0.8294027653998538}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6557024709255037, "rel_wql_gmean": 0.5035040985336133}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6924773974760391, "rel_wql_gmean": 0.4554542637411677}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9029678802897229, "rel_wql_gmean": 0.6700409831152518}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7076350430583279, "rel_wql_gmean": 0.5112125809875208}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7652589747638697, "rel_wql_gmean": 0.5218170330181122}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7402530882128023, "rel_wql_gmean": 0.47826753514082926}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.710265197438745, "rel_wql_gmean": 0.4931672821758772}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7498589240481417, "rel_wql_gmean": 0.5410407688872414}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8892029615768211, "rel_wql_gmean": 0.85541375158805}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8972340808013708, "rel_wql_gmean": 0.6419310799963354}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5749908408040473, "rel_wql_gmean": 0.507856444781463}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8028566989060131, "rel_wql_gmean": 0.39889278962700064}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8421494671087474, "rel_wql_gmean": 0.5162975438622042}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6323849322594254, "rel_wql_gmean": 0.43339253239569303}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5616650304722973, "rel_wql_gmean": 0.43523931575775593}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.61692642682572, "rel_wql_gmean": 0.6469875043190525}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7604157827225532, "rel_wql_gmean": 0.5223254859979091}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7256889701473604, "rel_wql_gmean": 0.49536285168895955}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9611837530785082, "rel_wql_gmean": 0.8278616039641923}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7839583182238047, "rel_wql_gmean": 0.830360300010519}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6548591866261223, "rel_wql_gmean": 0.5032338833413911}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6926762306120622, "rel_wql_gmean": 0.45361994505793396}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9042490502981876, "rel_wql_gmean": 0.6703742252767426}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7084778976708436, "rel_wql_gmean": 0.510408775576821}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7643134428569803, "rel_wql_gmean": 0.5210866729603522}}}, "group_skill_delta": {"term": {"long": -0.002532060784248502, "medium": 0.00042797467703548087, "short": -6.314887195391083e-05}, "domain": {"Econ/Fin": -0.00015138315423446347, "Energy": 0.0014145142145586265, "Healthcare": 0.001740694873992532, "Nature": -0.005835053257686629, "Sales": -3.202213103759011e-05, "Transport": -6.03059738222278e-05, "Web/CloudOps": 3.874853309143722e-05}, "frequency": {"A": -0.0005361871700487741, "D": -0.0010975856346864266, "H": -0.00010586555565805789, "M": 0.001121264812261047, "Q": 0.0005926688622668319, "S": -0.0005237026654796306, "T": -0.0010515852766496137, "W": 0.0007451559700757393}, "variates": {"multivariate": -0.00011523142389402441, "univariate": -0.0008326282824794307}}}, {"cutoff": "backcast_evals", "candidate_skill": 0.33912289475474133, "control_skill": 0.33985253853394604, "delta": -0.0007296437792047028, "candidate_checkpoint": "3cb20017da82189fb26998bf3129d05dd234da77d0ab9368c6a4124ae732aa19", "control_checkpoint": "ad45e0cfae574d3dc1be0b9720c9be0863db9ffe33891fdb22c86dfa83667253", "candidate_eval_seconds": 26.878792762756348, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7728257813585451, "rel_wql_gmean": 0.46365009493968484}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.772531268061481, "rel_wql_gmean": 0.5334193080441814}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8115184725478469, "rel_wql_gmean": 0.5934869054858658}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8872184796760154, "rel_wql_gmean": 0.8189571764223659}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8902641387047134, "rel_wql_gmean": 0.6683874476778133}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6553467971812239, "rel_wql_gmean": 0.5630063802600014}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9078550108140394, "rel_wql_gmean": 0.42651926289073533}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7235876519583068, "rel_wql_gmean": 0.49094696232585944}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7308468542805812, "rel_wql_gmean": 0.5241777411802061}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6596758960877025, "rel_wql_gmean": 0.4548633021165895}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6527571895914689, "rel_wql_gmean": 0.7274449406751847}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8193135662265635, "rel_wql_gmean": 0.48925352239569936}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7680610934536195, "rel_wql_gmean": 0.5095505605841489}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8632302635972422, "rel_wql_gmean": 0.793324903777062}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.759054098050758, "rel_wql_gmean": 0.7650315602550626}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8527185742320086, "rel_wql_gmean": 0.5080107692241524}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7741241839133908, "rel_wql_gmean": 0.5797029962339847}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8743623442598972, "rel_wql_gmean": 0.5881829676916759}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7888054781606405, "rel_wql_gmean": 0.5300217806239235}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7990044640102301, "rel_wql_gmean": 0.5659839855913402}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7709573168881856, "rel_wql_gmean": 0.46268425970990196}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7695230479033899, "rel_wql_gmean": 0.5310215600398799}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8117841847086917, "rel_wql_gmean": 0.593906337357885}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8871103723322559, "rel_wql_gmean": 0.8186104803199865}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8873228160456544, "rel_wql_gmean": 0.666828211814892}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6602366692845489, "rel_wql_gmean": 0.5698594545952637}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9037307861253031, "rel_wql_gmean": 0.42282624120616724}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7231485364548405, "rel_wql_gmean": 0.49076711071441}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.731298212809883, "rel_wql_gmean": 0.524438086130783}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.660209298499444, "rel_wql_gmean": 0.45581270950466285}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6522392949080874, "rel_wql_gmean": 0.7270620636653731}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8205802765681058, "rel_wql_gmean": 0.4901220874772779}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7677299491087929, "rel_wql_gmean": 0.5094849178695509}, "M": {"n_configs": 5, "rel_mase_gmean": 0.866956136135693, "rel_wql_gmean": 0.7966508658255991}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7588717620885471, "rel_wql_gmean": 0.7653003797772433}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8525356752749418, "rel_wql_gmean": 0.5080017737889677}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7704476348183809, "rel_wql_gmean": 0.576748095637338}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8742573452440867, "rel_wql_gmean": 0.5889566774320315}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7866251148848069, "rel_wql_gmean": 0.5284419129269964}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7990675186329057, "rel_wql_gmean": 0.5662861373570198}}}, "group_skill_delta": {"term": {"long": -0.0013471006318773737, "medium": -0.002692643882579615, "short": 0.0003588339125799589}, "domain": {"Econ/Fin": -0.00023237022477551328, "Energy": -0.0021741394391942004, "Healthcare": 0.005961352706041478, "Nature": -0.00410871115202549, "Sales": -0.00029002747632578263, "Transport": 0.00034483077718761024, "Web/CloudOps": 0.0007930233944140053}, "frequency": {"A": -0.00045471138398522903, "D": 0.001051416743781508, "H": -0.00017516302613507229, "M": 0.003520613866928146, "Q": 4.2324053939557515e-05, "S": -7.64157602757276e-05, "T": -0.003298103744347136, "W": 0.00042842546426002936}, "variates": {"multivariate": -0.0018573110988627795, "univariate": 0.00020601865196767655}}}, {"cutoff": "backcast2_evals", "candidate_skill": 0.36358865228053294, "control_skill": 0.3632547284652886, "delta": 0.00033392381524433024, "candidate_checkpoint": "3cb20017da82189fb26998bf3129d05dd234da77d0ab9368c6a4124ae732aa19", "control_checkpoint": "ad45e0cfae574d3dc1be0b9720c9be0863db9ffe33891fdb22c86dfa83667253", "candidate_eval_seconds": 26.447428464889526, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7981674673117668, "rel_wql_gmean": 0.5037198890475599}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7485564608929789, "rel_wql_gmean": 0.4872443448578284}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7605749721099586, "rel_wql_gmean": 0.5561005678114734}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.9012432894666216, "rel_wql_gmean": 0.9133250331264785}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8955290993684741, "rel_wql_gmean": 0.6456845098639605}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.68834226003216, "rel_wql_gmean": 0.587560892369158}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7517123268743677, "rel_wql_gmean": 0.35767937883776635}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5590784858082458, "rel_wql_gmean": 0.3587059819115234}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.661270100189415, "rel_wql_gmean": 0.4954121381098209}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6807734131389922, "rel_wql_gmean": 0.47153303556511655}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5811664431757904, "rel_wql_gmean": 0.7340303494907408}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7265793197580274, "rel_wql_gmean": 0.44685988489833073}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7497858345559077, "rel_wql_gmean": 0.4853698547245932}, "M": {"n_configs": 4, "rel_mase_gmean": 0.806269134356841, "rel_wql_gmean": 0.8350607256368663}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8308757198490314, "rel_wql_gmean": 0.8712492300309953}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9039420206407819, "rel_wql_gmean": 0.5681368601304205}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7536021868478092, "rel_wql_gmean": 0.539188527045008}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8484687753941433, "rel_wql_gmean": 0.6397120932683703}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7800850700685547, "rel_wql_gmean": 0.5156199448205283}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7535627280812299, "rel_wql_gmean": 0.540484014120907}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7969398609040024, "rel_wql_gmean": 0.5035562825504419}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7490067352384399, "rel_wql_gmean": 0.48743000572367984}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7615427910500057, "rel_wql_gmean": 0.5565614531092009}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.901205213255903, "rel_wql_gmean": 0.9129519979778129}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.895984498209844, "rel_wql_gmean": 0.6466953024058848}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6906395512407255, "rel_wql_gmean": 0.5895403412546308}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7520688777995285, "rel_wql_gmean": 0.35747495688522557}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5597836473152902, "rel_wql_gmean": 0.3594495182358377}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6614283420298616, "rel_wql_gmean": 0.49546817917989344}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6809574130261864, "rel_wql_gmean": 0.47110941162938547}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.581464401116573, "rel_wql_gmean": 0.7355000101927864}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7270580675006559, "rel_wql_gmean": 0.44686466314745266}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7494927915333071, "rel_wql_gmean": 0.48496142310648743}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8066081312673148, "rel_wql_gmean": 0.8347163141766332}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8311725894461938, "rel_wql_gmean": 0.8717568945686304}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9046061716746755, "rel_wql_gmean": 0.5673078591497167}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7542500727562019, "rel_wql_gmean": 0.5401993598021697}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8508075542526838, "rel_wql_gmean": 0.6417280462795324}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7799074480129385, "rel_wql_gmean": 0.515543995911792}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7544561978137869, "rel_wql_gmean": 0.5410325795112644}}}, "group_skill_delta": {"term": {"long": -0.0005907042774746518, "medium": 0.0002966963030172076, "short": 0.0006832633080461337}, "domain": {"Econ/Fin": -0.00020446031172693946, "Energy": 0.0007884369461303997, "Healthcare": 0.002132479897341555, "Nature": -2.527257837747765e-05, "Sales": 0.0007465102497628551, "Transport": 0.00010085521449310075, "Web/CloudOps": -0.00017803428874874072}, "frequency": {"A": 0.0008211018269171921, "D": 0.00019074101714411373, "H": -0.0003717207154720903, "M": 3.2161259752028215e-06, "Q": 0.000399874199206951, "S": -0.0002600064126898616, "T": 0.0008714456112038915, "W": 0.0021762270368650416}, "variates": {"multivariate": -0.0001189131193314319, "univariate": 0.0007022040691128106}}}, {"cutoff": "backcast3_evals", "candidate_skill": 0.3934578569511348, "control_skill": 0.3944984110874522, "delta": -0.0010405541363174287, "candidate_checkpoint": "3cb20017da82189fb26998bf3129d05dd234da77d0ab9368c6a4124ae732aa19", "control_checkpoint": "ad45e0cfae574d3dc1be0b9720c9be0863db9ffe33891fdb22c86dfa83667253", "candidate_eval_seconds": 27.41648244857788, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7594561001782314, "rel_wql_gmean": 0.4737184271983587}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7682977755304782, "rel_wql_gmean": 0.5287322161645208}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7100558613494089, "rel_wql_gmean": 0.5033847627353878}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8468336491686697, "rel_wql_gmean": 0.8310933073493634}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8294514136875593, "rel_wql_gmean": 0.5540513041276857}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7579878989002233, "rel_wql_gmean": 0.6326067826474694}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7205409255753118, "rel_wql_gmean": 0.3399910269432183}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7485532530602245, "rel_wql_gmean": 0.47457533210182223}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5361847137429396, "rel_wql_gmean": 0.4437075679776232}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7120854385439547, "rel_wql_gmean": 0.5158059292331992}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5304697563143794, "rel_wql_gmean": 0.7752426708905806}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7146835753639871, "rel_wql_gmean": 0.41634829359997066}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7203164997501174, "rel_wql_gmean": 0.4850409029750608}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8357771139675717, "rel_wql_gmean": 0.8246176988609867}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7156714101453964, "rel_wql_gmean": 0.7691108243638547}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8390913570159775, "rel_wql_gmean": 0.5997256377275969}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7076104872268122, "rel_wql_gmean": 0.4632639230975061}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8117616992736113, "rel_wql_gmean": 0.669422238054874}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7610171310319315, "rel_wql_gmean": 0.5130192428089074}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7102305602408325, "rel_wql_gmean": 0.4942827676127439}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7605445792601405, "rel_wql_gmean": 0.4740600920237114}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7673937404796206, "rel_wql_gmean": 0.529050128812873}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7066888727036074, "rel_wql_gmean": 0.5025271114107714}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8465750633042362, "rel_wql_gmean": 0.8301832550203931}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8280900345851895, "rel_wql_gmean": 0.5531225386420328}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7582600194472988, "rel_wql_gmean": 0.632623318642284}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7096275569559131, "rel_wql_gmean": 0.3386957610122997}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7487935010952289, "rel_wql_gmean": 0.47423739993986525}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5364607716260557, "rel_wql_gmean": 0.4442170483634485}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7128912578353812, "rel_wql_gmean": 0.5168699930573769}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5308138227989901, "rel_wql_gmean": 0.777900736251483}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7112195255614516, "rel_wql_gmean": 0.4154980506806888}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7198763379573593, "rel_wql_gmean": 0.48466211242450724}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8330944575177875, "rel_wql_gmean": 0.8230031202022723}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7156105446358054, "rel_wql_gmean": 0.7684011151446023}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8371984068688675, "rel_wql_gmean": 0.6003957122289793}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7049982843940813, "rel_wql_gmean": 0.46277982987038807}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8087944681865019, "rel_wql_gmean": 0.670755534033392}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7587335902791335, "rel_wql_gmean": 0.5125489110619184}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7084600116309258, "rel_wql_gmean": 0.494009506622114}}}, "group_skill_delta": {"term": {"long": 0.0006460966472733309, "medium": -0.00018361926021825958, "short": -0.001927470971271883}, "domain": {"Econ/Fin": -0.0005874660244457042, "Energy": -0.001124519020313297, "Healthcare": 0.00013333959833061737, "Nature": -0.0046991283229330105, "Sales": -0.00011663889507040892, "Transport": 0.00040556957003623495, "Web/CloudOps": 0.0009679639911654991}, "frequency": {"A": 0.0013067300587633612, "D": -0.001879503011299244, "H": -0.00041140195025446413, "M": -0.002145239792246678, "Q": -0.00037391829688726563, "S": -0.0004048794176386705, "T": -0.0013564505376502112, "W": -0.0006161092898175902}, "variates": {"multivariate": -0.0012242112961807772, "univariate": -0.0009025849209826076}}}], "mean_delta": -0.00048559008065043874, "positive_cutoffs": 1, "outcome": "Declared primary6000/durability12000 diagnostic. No transfer formula or automatic publication is selected by this controller."} + +E113 12000 four-cutoff comparison: {"label": "E113 12000 four-cutoff comparison", "utc": "2026-10-23T09:16:05.247965+00:00", "candidate": "lowfreq_windows_ema12000", "control": "overflow_control_ema12000", "rows": [{"cutoff": "evals", "candidate_skill": 0.37612597264381065, "control_skill": 0.37742394607564755, "delta": -0.0012979734318369074, "candidate_checkpoint": "f1deb47b05e0dddb2c882081f6371d4a6c27e5b644446ab2d3848ec6af789fd8", "control_checkpoint": "f11d056b95f1c5eeef174265ebc51742952600e0dae1fa52900860447d5be819", "candidate_eval_seconds": 26.301554441452026, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7428750481395252, "rel_wql_gmean": 0.48016983627031584}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7127112192835677, "rel_wql_gmean": 0.4949026837866265}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7603970824570427, "rel_wql_gmean": 0.5494707164558967}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.875268873201828, "rel_wql_gmean": 0.8498150921824715}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9036593124586589, "rel_wql_gmean": 0.6467905478260898}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6052873364782312, "rel_wql_gmean": 0.5414215680589309}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.815640742417676, "rel_wql_gmean": 0.40268822274396987}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8512935457482944, "rel_wql_gmean": 0.5215554524467921}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6433122083917602, "rel_wql_gmean": 0.4409592133931682}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.561287339032233, "rel_wql_gmean": 0.4361835097680848}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6179411870544589, "rel_wql_gmean": 0.6399891109014733}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7831724170774825, "rel_wql_gmean": 0.540315009074117}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7318131632477781, "rel_wql_gmean": 0.4988457212439089}, "M": {"n_configs": 5, "rel_mase_gmean": 1.0047585042900982, "rel_wql_gmean": 0.8706326095203928}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7805733535967154, "rel_wql_gmean": 0.8250655576550436}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6571644444228559, "rel_wql_gmean": 0.505149270853412}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6913428051659812, "rel_wql_gmean": 0.4528083731363489}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9075217757391797, "rel_wql_gmean": 0.6770004974092982}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7115452181133927, "rel_wql_gmean": 0.5121480648642073}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.774690793461382, "rel_wql_gmean": 0.529463618559688}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7430904415695668, "rel_wql_gmean": 0.4803877697002309}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7132918126148858, "rel_wql_gmean": 0.4952594111267713}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7578628359813909, "rel_wql_gmean": 0.5467970503421377}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8820089901245588, "rel_wql_gmean": 0.8576370610661226}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9027748652932497, "rel_wql_gmean": 0.6461208417787276}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5860981811462721, "rel_wql_gmean": 0.5145960110698827}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8131107048238599, "rel_wql_gmean": 0.4016810458988802}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8527673973406287, "rel_wql_gmean": 0.5213825017868637}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6445705043805339, "rel_wql_gmean": 0.44151518253827515}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5611845549171244, "rel_wql_gmean": 0.43637179177338026}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6256068773709946, "rel_wql_gmean": 0.6531531717628165}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7810498071209858, "rel_wql_gmean": 0.5387984968910804}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7331074392934215, "rel_wql_gmean": 0.4999416190250625}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9734095428884114, "rel_wql_gmean": 0.8253812557813238}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7799909436165716, "rel_wql_gmean": 0.8257926959351992}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6551233447531275, "rel_wql_gmean": 0.5045264853695348}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6915094659095177, "rel_wql_gmean": 0.4527256621835321}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9056914149873438, "rel_wql_gmean": 0.6760727114446506}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7112247286748321, "rel_wql_gmean": 0.5124312426851864}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7726699203226439, "rel_wql_gmean": 0.5268484105597512}}}, "group_skill_delta": {"term": {"long": 0.0002221187528791413, "medium": 0.00045594863503239935, "short": -0.002649952409713663}, "domain": {"Econ/Fin": 0.007289576188591607, "Energy": -0.0007699283605113738, "Healthcare": -0.023279857421110384, "Nature": -0.0016055885990393648, "Sales": 0.00046597836642936485, "Transport": 0.0008566146628592453, "Web/CloudOps": 6.146400777895522e-05}, "frequency": {"A": 0.010363128568481095, "D": -0.001794422091243364, "H": 0.0011979571373912368, "M": -0.038949553951107885, "Q": 5.3975537878336866e-05, "S": -0.001250183721272613, "T": 1.6326670695732126e-05, "W": -0.0013275837486963482}, "variates": {"multivariate": 3.0864644344652525e-05, "univariate": -0.002417469515829218}}}, {"cutoff": "backcast_evals", "candidate_skill": 0.33579550286796345, "control_skill": 0.33652833730727594, "delta": -0.0007328344393124908, "candidate_checkpoint": "f1deb47b05e0dddb2c882081f6371d4a6c27e5b644446ab2d3848ec6af789fd8", "control_checkpoint": "f11d056b95f1c5eeef174265ebc51742952600e0dae1fa52900860447d5be819", "candidate_eval_seconds": 24.571640253067017, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7803948816231011, "rel_wql_gmean": 0.46634628063194994}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7721443465770145, "rel_wql_gmean": 0.5333256397131038}, "short": {"n_configs": 55, "rel_mase_gmean": 0.818084006971346, "rel_wql_gmean": 0.5958535740460764}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8733759474418339, "rel_wql_gmean": 0.8101520925772994}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8894109276420028, "rel_wql_gmean": 0.6655257213921841}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6443191277932857, "rel_wql_gmean": 0.5479573261147775}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.932543526482483, "rel_wql_gmean": 0.4335336786360575}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7395515969863701, "rel_wql_gmean": 0.5020700192608043}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.738632812164996, "rel_wql_gmean": 0.5313271060591571}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6662561746592346, "rel_wql_gmean": 0.4579920263084524}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6495654332529827, "rel_wql_gmean": 0.7215130510295488}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8408695902816747, "rel_wql_gmean": 0.4998461278118158}, "H": {"n_configs": 31, "rel_mase_gmean": 0.779153419992908, "rel_wql_gmean": 0.5151894170517185}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8696112901101338, "rel_wql_gmean": 0.7935497130187744}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7643180657351112, "rel_wql_gmean": 0.7677018658143707}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8546801602658521, "rel_wql_gmean": 0.5077714328047184}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7674756974800262, "rel_wql_gmean": 0.5752947630033991}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8753943753746083, "rel_wql_gmean": 0.5815750560859467}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7918944760132761, "rel_wql_gmean": 0.530286919061923}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.805978313209396, "rel_wql_gmean": 0.5693000613346351}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7791999311006992, "rel_wql_gmean": 0.4659792452594256}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7710406727836745, "rel_wql_gmean": 0.5333113680139498}, "short": {"n_configs": 55, "rel_mase_gmean": 0.815154118317558, "rel_wql_gmean": 0.596530868139981}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8754973298713973, "rel_wql_gmean": 0.8157069069366086}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8880158890798259, "rel_wql_gmean": 0.6677066701972586}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6235821127455097, "rel_wql_gmean": 0.5405407165775942}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.933606860676274, "rel_wql_gmean": 0.4340037728321772}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7343890716300152, "rel_wql_gmean": 0.49893240567123487}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7389889324657989, "rel_wql_gmean": 0.5315819911881067}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6643730331767335, "rel_wql_gmean": 0.45729311789913757}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6445434372547929, "rel_wql_gmean": 0.724090215239997}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8386815774822007, "rel_wql_gmean": 0.5001256118650457}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7779220228454703, "rel_wql_gmean": 0.5152698021677109}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8546325349093246, "rel_wql_gmean": 0.7856916887479788}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7640852146217055, "rel_wql_gmean": 0.7788691447566721}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8532609264720655, "rel_wql_gmean": 0.507658310446713}, "T": {"n_configs": 30, "rel_mase_gmean": 0.767260085607915, "rel_wql_gmean": 0.5746866456036881}, "W": {"n_configs": 8, "rel_mase_gmean": 0.869060480798712, "rel_wql_gmean": 0.5886681671106037}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7899223594259315, "rel_wql_gmean": 0.5301365087279752}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.803707925134896, "rel_wql_gmean": 0.5699074661266276}}}, "group_skill_delta": {"term": {"long": -0.0006993089450074708, "medium": -0.0004673690690001342, "short": -0.0008553765432549598}, "domain": {"Econ/Fin": 0.0039032717811751105, "Energy": 0.0006549890412820281, "Healthcare": -0.013609396239477767, "Nature": 0.000707236127975186, "Sales": -0.0040308781459954535, "Transport": 0.00030128116973815455, "Web/CloudOps": -0.0012022606957043935}, "frequency": {"A": -0.001434717299257704, "D": -0.0006630405817877882, "H": -0.00045146770322546104, "M": -0.011272996130293977, "Q": 0.005433668241791478, "S": -0.0006205126914519132, "T": -0.00044457937675745907, "W": 0.0017362517802820276}, "variates": {"multivariate": -0.0008992058863770414, "univariate": -0.0005939863785452415}}}, {"cutoff": "backcast2_evals", "candidate_skill": 0.3613039819273488, "control_skill": 0.36097346960650367, "delta": 0.00033051232084513327, "candidate_checkpoint": "f1deb47b05e0dddb2c882081f6371d4a6c27e5b644446ab2d3848ec6af789fd8", "control_checkpoint": "f11d056b95f1c5eeef174265ebc51742952600e0dae1fa52900860447d5be819", "candidate_eval_seconds": 23.942510843276978, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7994303588783945, "rel_wql_gmean": 0.5047936125361201}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7585582411691183, "rel_wql_gmean": 0.49213715811809716}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7622597177019128, "rel_wql_gmean": 0.5560507373315131}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8875630930903033, "rel_wql_gmean": 0.9051744171487927}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8956406224545252, "rel_wql_gmean": 0.64475627013019}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6949245357597195, "rel_wql_gmean": 0.593849204088152}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.760265038018502, "rel_wql_gmean": 0.36277685228818896}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5633883229845202, "rel_wql_gmean": 0.3604893186868895}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6693022978773041, "rel_wql_gmean": 0.5018725026594515}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6846068927297053, "rel_wql_gmean": 0.4686509170371502}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5840536091295983, "rel_wql_gmean": 0.721808761634876}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7301854258339627, "rel_wql_gmean": 0.4494742691816404}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7575233002412155, "rel_wql_gmean": 0.4905599328117248}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8169560864594648, "rel_wql_gmean": 0.8551457988530617}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8356711218221335, "rel_wql_gmean": 0.8696006131540667}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9100735740026191, "rel_wql_gmean": 0.5682478578118126}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7564710377088042, "rel_wql_gmean": 0.5386795987319778}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8308220008623086, "rel_wql_gmean": 0.6230353765403394}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7827378337570088, "rel_wql_gmean": 0.5158567345122158}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7577139368382865, "rel_wql_gmean": 0.5428398324072662}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7998283729290717, "rel_wql_gmean": 0.5048537403572065}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7567348346553658, "rel_wql_gmean": 0.49139307103243485}, "short": {"n_configs": 54, "rel_mase_gmean": 0.762930601340605, "rel_wql_gmean": 0.5572913926751922}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8902018742574637, "rel_wql_gmean": 0.9080828126396094}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8967112467195689, "rel_wql_gmean": 0.6466666398782791}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6908821587788814, "rel_wql_gmean": 0.5905411593557701}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7593906111647103, "rel_wql_gmean": 0.3630649835252516}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5660049516474805, "rel_wql_gmean": 0.36083556795060334}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6692141236302525, "rel_wql_gmean": 0.5019337855870213}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6840578993103755, "rel_wql_gmean": 0.46836362238870816}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5819380993584167, "rel_wql_gmean": 0.723948814143525}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7300802327867975, "rel_wql_gmean": 0.44973000047782175}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7573152418388004, "rel_wql_gmean": 0.4905218098483386}, "M": {"n_configs": 4, "rel_mase_gmean": 0.825511662103245, "rel_wql_gmean": 0.8525433006612966}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8348196873036913, "rel_wql_gmean": 0.8792738256086735}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9101844597610753, "rel_wql_gmean": 0.5693250695338232}, "T": {"n_configs": 29, "rel_mase_gmean": 0.75556464168385, "rel_wql_gmean": 0.5377684583538125}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8322603650379057, "rel_wql_gmean": 0.6324937767638193}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.782445957809565, "rel_wql_gmean": 0.5156982204614814}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7580358480370438, "rel_wql_gmean": 0.543923941651618}}}, "group_skill_delta": {"term": {"long": 0.00019595986944986876, "medium": -0.0011963062249945589, "short": 0.0010126495337633434}, "domain": {"Econ/Fin": 0.0027723913674168044, "Energy": 0.0015796820841680326, "Healthcare": -0.0036576861574247888, "Nature": -9.370861462276725e-05, "Sales": 0.0012622036778165424, "Transport": -2.795885354567318e-06, "Web/CloudOps": -0.00040073261232353996}, "frequency": {"A": -0.00021690098198479113, "D": 0.00012167144878916236, "H": -0.00010740488144889149, "M": 0.0030857545471283387, "Q": 0.004291405638661705, "S": 0.0007251447805141087, "T": -0.0009223202400732156, "W": 0.006067822151289648}, "variates": {"multivariate": -0.0002161043626571768, "univariate": 0.0007764498089196659}}}, {"cutoff": "backcast3_evals", "candidate_skill": 0.38719770172424695, "control_skill": 0.3874814849803516, "delta": -0.0002837832561046749, "candidate_checkpoint": "f1deb47b05e0dddb2c882081f6371d4a6c27e5b644446ab2d3848ec6af789fd8", "control_checkpoint": "f11d056b95f1c5eeef174265ebc51742952600e0dae1fa52900860447d5be819", "candidate_eval_seconds": 24.347827434539795, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7684886444337029, "rel_wql_gmean": 0.47700055161764726}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7719012970032346, "rel_wql_gmean": 0.5309111874339674}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7205395887196173, "rel_wql_gmean": 0.5088842083422412}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8312087228420175, "rel_wql_gmean": 0.8186588543234923}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8351368839049325, "rel_wql_gmean": 0.5545932357253937}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.8175567972220871, "rel_wql_gmean": 0.6760837299667757}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7299909306564671, "rel_wql_gmean": 0.3420605153189345}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7548733967003611, "rel_wql_gmean": 0.47934273977909336}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5451842768000186, "rel_wql_gmean": 0.4515764701679637}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7188771721303677, "rel_wql_gmean": 0.5204081485529428}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5241640857947558, "rel_wql_gmean": 0.7291166786507837}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7350980533969118, "rel_wql_gmean": 0.4276860378056021}, "H": {"n_configs": 29, "rel_mase_gmean": 0.728816078273106, "rel_wql_gmean": 0.49012599470467744}, "M": {"n_configs": 4, "rel_mase_gmean": 0.884158227262403, "rel_wql_gmean": 0.8735522520241081}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7090887722467131, "rel_wql_gmean": 0.7680357872508405}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8460699141449298, "rel_wql_gmean": 0.5998981264388689}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7086527442094294, "rel_wql_gmean": 0.4630233384268165}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8169291712293834, "rel_wql_gmean": 0.6644383983004994}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7633479802491316, "rel_wql_gmean": 0.5131305442375695}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7238025548687982, "rel_wql_gmean": 0.501861868079696}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7675699458528298, "rel_wql_gmean": 0.476452132158557}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.773141221801274, "rel_wql_gmean": 0.5311688105422268}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7189800356855841, "rel_wql_gmean": 0.5092012481102669}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8366494448197422, "rel_wql_gmean": 0.8335501433013701}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8362673307045482, "rel_wql_gmean": 0.5558565966414833}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7992789325648234, "rel_wql_gmean": 0.663313586611861}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7270958326307262, "rel_wql_gmean": 0.3416485868534862}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7558002187371488, "rel_wql_gmean": 0.47806361106286926}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5447632408986202, "rel_wql_gmean": 0.45146185813227047}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7184671561660497, "rel_wql_gmean": 0.5194115372422989}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5301621193542202, "rel_wql_gmean": 0.8023624756576537}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7320022964105988, "rel_wql_gmean": 0.42747341049868826}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7284419538124913, "rel_wql_gmean": 0.48986156448616525}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8692971155035826, "rel_wql_gmean": 0.8573561489309673}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7145578258684864, "rel_wql_gmean": 0.7671041544075885}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8434376506034783, "rel_wql_gmean": 0.6004240857745707}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7091796225957213, "rel_wql_gmean": 0.4627952794263764}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8186104789687557, "rel_wql_gmean": 0.6672650133055504}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7652944038188929, "rel_wql_gmean": 0.5141740641844628}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7208570784782143, "rel_wql_gmean": 0.5012656144320912}}}, "group_skill_delta": {"term": {"long": -0.0007099465499640356, "medium": 0.0006693751847272056, "short": -0.00046727777101984724}, "domain": {"Econ/Fin": 0.010188433449565881, "Energy": 0.001235688152959713, "Healthcare": -0.015333237527605181, "Nature": -0.0012922529180409148, "Sales": -0.00043446352071674355, "Transport": -0.0002545772391819856, "Web/CloudOps": -0.0007602336179508562}, "frequency": {"A": 0.03400882289466778, "D": -0.0013210139532306986, "H": -0.00031462845811736084, "M": -0.01553325343887657, "Q": 0.0023910101617380386, "S": -0.0007973503823683892, "T": 7.176516391471655e-05, "W": 0.002324819735960215}, "variates": {"multivariate": 0.0014342827367879174, "univariate": -0.0015849874659156216}}}], "mean_delta": -0.000496019701602235, "positive_cutoffs": 1, "outcome": "Declared primary6000/durability12000 diagnostic. No transfer formula or automatic publication is selected by this controller."} + +## E128 twelve-thousand-step dispersion transfer full replay, rejected +- Checkpoint SHA-256: `e473ba2608f2cc15100e181259634d9f553dcc311dedee8b0f896b133703a17b`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.383953; relative MASE 0.736493; relative WQL 0.515300. +- term skill: long=0.4027, medium=0.4086, short=0.3668. +- domain skill: Econ/Fin=0.1306, Energy=0.2409, Healthcare=0.4852, Nature=0.4442, Sales=0.3589, Transport=0.4725, Web/CloudOps=0.4991. +- frequency skill: A=0.2970, D=0.3746, H=0.3981, M=0.1452, Q=0.1890, S=0.4252, T=0.4396, W=0.2376. +- variates skill: multivariate=0.3971, univariate=0.3733. +- Outcome: Full skill0.38395261653633084 below E1270.3840414658263811 and current E1300.38414971818207. All97 configurations/151170instances finite; inference358.537563328s; complete relocation/independent-composition suite1004.778254749s passed. No publication or coefficient sweep. + +E101 own-ensemble distillation 24000 matched duration: {"label": "E101 own-ensemble distillation 24000 matched duration", "utc": "2026-10-23T09:19:15.570271+00:00", "candidate": "distill_ensemble_ema24000", "control": "random_capacity_1024_halflr_ema24000", "rows": [{"cutoff": "evals", "candidate_skill": 0.36786899672815143, "control_skill": 0.3554524492447929, "delta": 0.01241654748335852, "candidate_checkpoint": "ad5c0444cb3da069662fa016561f8cf246470d52b5149d5e5ecff4f4635ac6fd", "control_checkpoint": "ee69006629037179a8fd6d09233755cb8efceafb0a47494abceceea3cb7fae52", "candidate_eval_seconds": 36.978116512298584, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7613534532855317, "rel_wql_gmean": 0.4933355126988402}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7218139585351127, "rel_wql_gmean": 0.4992284050428652}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7672268173513697, "rel_wql_gmean": 0.5547476172046656}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8932646398208068, "rel_wql_gmean": 0.8458136656436929}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9078583500592542, "rel_wql_gmean": 0.6488988402003546}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6171945120239629, "rel_wql_gmean": 0.5508778445646585}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8172291112406892, "rel_wql_gmean": 0.40581862290030846}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8418608823902648, "rel_wql_gmean": 0.5159447884287781}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6528920710132115, "rel_wql_gmean": 0.45070297408715015}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5812822617907885, "rel_wql_gmean": 0.4520217678361691}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5927671163749784, "rel_wql_gmean": 0.6245031317118163}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7851739820802963, "rel_wql_gmean": 0.5406958904898744}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7405818217057821, "rel_wql_gmean": 0.5060231638513055}, "M": {"n_configs": 5, "rel_mase_gmean": 1.0030369609877634, "rel_wql_gmean": 0.8643308347760176}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7675602608974536, "rel_wql_gmean": 0.8301407913586738}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6599527631730835, "rel_wql_gmean": 0.5067737473086187}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7092137567823373, "rel_wql_gmean": 0.46706903964030133}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9238536075967602, "rel_wql_gmean": 0.670954136490052}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7261235492551099, "rel_wql_gmean": 0.5251452485440882}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.780482086012812, "rel_wql_gmean": 0.5314168783649992}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7672963823883818, "rel_wql_gmean": 0.5037463097000351}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7411598138375365, "rel_wql_gmean": 0.5112523421889252}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7765805771888272, "rel_wql_gmean": 0.5695687308167366}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8947865329147192, "rel_wql_gmean": 0.8675019552981618}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9189851213071903, "rel_wql_gmean": 0.6647129956643829}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.66522448244886, "rel_wql_gmean": 0.5713422747891131}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8229663797697023, "rel_wql_gmean": 0.42175005100395146}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.836731066077329, "rel_wql_gmean": 0.5127605811341385}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6568620754928051, "rel_wql_gmean": 0.45664954453268697}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5941838738109626, "rel_wql_gmean": 0.4642586168661542}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6090797274199198, "rel_wql_gmean": 0.6248561761913869}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7816538456892409, "rel_wql_gmean": 0.5343645406533337}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7518484970509849, "rel_wql_gmean": 0.5255707125287721}, "M": {"n_configs": 5, "rel_mase_gmean": 1.015039576827218, "rel_wql_gmean": 0.8873267820580395}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7756154804231246, "rel_wql_gmean": 0.8458050910642245}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6668506293769108, "rel_wql_gmean": 0.507924296219694}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7306344744783564, "rel_wql_gmean": 0.48726927054167557}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9160794156665825, "rel_wql_gmean": 0.6672608817274759}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.742970470874668, "rel_wql_gmean": 0.5446766637662609}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7862695054442648, "rel_wql_gmean": 0.539530442255707}}}, "group_skill_delta": {"term": {"long": 0.00884517749183844, "medium": 0.01527290829046124, "short": 0.0126749508916848}, "domain": {"Econ/Fin": 0.011823213626144025, "Energy": 0.014042335073513823, "Healthcare": 0.0334047345528341, "Nature": 0.01325231705496166, "Sales": -0.004041666279614886, "Transport": 0.005224438942843523, "Web/CloudOps": 0.012625350236096566}, "frequency": {"A": 0.008489284622378968, "D": -0.005279668651802849, "H": 0.016439670250736338, "M": 0.017932703667306926, "Q": 0.011712835768662666, "S": 0.0036739608508072896, "T": 0.02112575984504239, "W": -0.005480325776542672}, "variates": {"multivariate": 0.01863219594085297, "univariate": 0.007299234511382369}}}], "mean_delta": 0.01241654748335852, "positive_cutoffs": 1, "outcome": "Positive matched main diagnostic; preserve immutable E96 teacher, coefficient0.5 and original96000 schedule. Main validation only; no package selection yet."} + +E94 halfLR 72000 matched duration: {"label": "E94 halfLR 72000 matched duration", "utc": "2026-10-23T09:19:15.611756+00:00", "candidate": "random_capacity_1024_halflr_ema72000", "control": "random_capacity_1024_ema72000", "rows": [{"cutoff": "evals", "candidate_skill": 0.36653362293692227, "control_skill": 0.36736566458978936, "delta": -0.0008320416528670993, "candidate_checkpoint": "1f20fbc689daeb4c9761714dbe10f442ab41488d027207e7899a0cd3de1add3c", "control_checkpoint": "baa71611dff2da76515319d144b23e31e19304772ad4401fc4a18ea03f07a499", "candidate_eval_seconds": 37.33427858352661, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7680606899024435, "rel_wql_gmean": 0.4988503915569091}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7332786035110377, "rel_wql_gmean": 0.5041170760030442}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7585705226561933, "rel_wql_gmean": 0.5555576562163199}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8890425784326859, "rel_wql_gmean": 0.8521745095508803}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9159891215471997, "rel_wql_gmean": 0.6608606448062099}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5774882181873465, "rel_wql_gmean": 0.4922066250724507}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8219319248209576, "rel_wql_gmean": 0.4164103507345064}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8152705090073499, "rel_wql_gmean": 0.5099477192627261}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6500269528069342, "rel_wql_gmean": 0.4497591516823354}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5834637275048629, "rel_wql_gmean": 0.4552808833310693}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5922899838046344, "rel_wql_gmean": 0.6089813388580939}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7654652588047858, "rel_wql_gmean": 0.5272959028606339}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7427422246535798, "rel_wql_gmean": 0.5161376804225851}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9636735950001094, "rel_wql_gmean": 0.8438060966501667}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7597462095052908, "rel_wql_gmean": 0.8168824191722339}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6643227595707758, "rel_wql_gmean": 0.5113951504875184}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7203630323482785, "rel_wql_gmean": 0.47429870706475213}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9107516280265588, "rel_wql_gmean": 0.6648932917668241}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.731662111685473, "rel_wql_gmean": 0.531806127274585}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7742101724432567, "rel_wql_gmean": 0.5311843649137367}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7596192288082486, "rel_wql_gmean": 0.4951141955204966}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7363375295734231, "rel_wql_gmean": 0.5056560133396528}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7606418888845478, "rel_wql_gmean": 0.5538790094120064}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.9033681839460348, "rel_wql_gmean": 0.8510306246351569}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9132964142466047, "rel_wql_gmean": 0.6613834360775507}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6008629515181685, "rel_wql_gmean": 0.5128134103327899}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8241897772379998, "rel_wql_gmean": 0.4190277961561824}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8456240759834974, "rel_wql_gmean": 0.5233104342109804}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6511786830134689, "rel_wql_gmean": 0.4507742495174751}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5716616669502825, "rel_wql_gmean": 0.4393165312128719}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5958283325931863, "rel_wql_gmean": 0.6144059264519328}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7777281919380308, "rel_wql_gmean": 0.5386241189298943}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7363614335969476, "rel_wql_gmean": 0.5119011863402705}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9955332689841764, "rel_wql_gmean": 0.8441275404151479}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.758645213417042, "rel_wql_gmean": 0.8163566812421911}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6688662611218593, "rel_wql_gmean": 0.5094982599379567}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7151571878390335, "rel_wql_gmean": 0.4685405119829564}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9157681504509959, "rel_wql_gmean": 0.6694775206808375}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7270035470605405, "rel_wql_gmean": 0.5268439726526699}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7782347336583278, "rel_wql_gmean": 0.5325909632877113}}}, "group_skill_delta": {"term": {"long": -0.005720486590518714, "medium": 0.0021960790531426744, "short": -9.711935889122891e-05}, "domain": {"Econ/Fin": 0.00639561796267607, "Energy": -0.000837198123813554, "Healthcare": 0.021950168491802202, "Nature": 0.002641304295429303, "Sales": 0.02044153041057939, "Transport": 0.0010891685181155797, "Web/CloudOps": -0.01426351698227335}, "frequency": {"A": 0.0044681538800170895, "D": 0.011911071514982718, "H": -0.005200610093547331, "M": 0.014959576574749334, "Q": -0.0008243959861216066, "S": 0.0009041042351182194, "T": -0.005662050596863866, "W": 0.0048255724159554925}, "variates": {"multivariate": -0.004896700591577097, "univariate": 0.002515350672037786}}}], "mean_delta": -0.0008320416528670993, "positive_cutoffs": 0, "outcome": "Half learning rate remains below original at72000; continue declared96000 schedules. Main validation only."} + +E129 direct learned seasonal uncertainty head seed197 training started at 2026-10-23T09:19:29Z, after the declared dependency processes exited; required checkpoint files are present. Settings are unchanged from the declared comparison. + +2026-10-23T09:19:50.754277+00:00: E12812 full replay rejected at0.38395261653633084; all checks passed, suite1004.778254749s. E113 final12k1of4positive/mean-0.000496019702 after primary2of4/mean-0.000397918945: no transfer. E121primary6k1of4/mean-0.000485590081: no primary transfer, scheduled12k still finishing. E10124k0.367868996728, matched E94+0.012416547483; E94halfLR72k0.366533622937, matched E79-0.000832041653. Original schedules and immutable teacher preserved. E132controller26132 and E133controller26167 wait for declared endpoints. + +2026-10-23T09:20:48.920259+00:00: E134 visibility curriculum audit and queue. CPU seed701 plus actualstream307,6144rows,4.915062141837552s: full source windows, masks, periods and RNG bitwise matched; resumed boundary views exact; original prefetched batch unmodified. Early/middle/full finite target means135.0555/251.7554/415.6190; empty target rows47/44/37 of6144 are preserved rather than resampled. GPU seed709,B48signed96,C128,H16,gradient cosine0.9999875115719722,eager/compiled loss0.4359123110771179/0.43591222167015076,peak reserved3644MiB with Adam/EMA placeholders,compile51.421730180s,total73.688431652s,0optimizer updates/no validation. Queue{"queue_pid": 26704, "watch_pid": 26705, "comparison_pid": 26706} waits E110full13879 and E79wide5650 final96000. Reuses own scratch initialc9693619...,146477344params; sampler/model byte-identical to E79. Training-only deterministic views archived; publisher records schedule and sources. No extra concurrent allocation. Primary96k,16/32/48/72diagnostics,48/96four-cutoff comparisons. + +## E135: own-ensemble distilled fourth member, predeclared48k/96k +2026-10-23T09:22:02.738349+00:00: E101distillation gains0.012416547 versus matchedE94 at24k. Hypothesis: at48k its improved learned forecasts can replace fresh E79wide48k in the fixed four-member package, despite potentially reduced member diversity. Training is unchanged; immutableE96teacher/coefficient0.5/seed307/B48/LR1e-4/96k/oldpack remain. Primary48k,final96kdurability, no earlier checkpoint alternatives or weight sweep. Every instance gets E117final/E71/E93/student with ordered equal quarters. Scientific standalone control is E94 at the same duration; package comparator is E130frozenquad48 and then-current publication. Require3of4 positive diagnostic cutoffs and positive mean before a full public replay; publication also requires better full aggregate and complete relocation/composition checks. No new training, no runtime modification or model constructed now. + +E121 12000 four-cutoff comparison: {"label": "E121 12000 four-cutoff comparison", "utc": "2026-10-23T09:22:44.476099+00:00", "candidate": "seasonal_history_ema12000", "control": "long_seasonal_ema12000", "rows": [{"cutoff": "evals", "candidate_skill": 0.3813059147504362, "control_skill": 0.38231375879048757, "delta": -0.0010078440400513866, "candidate_checkpoint": "50257b1c120f798238c78920e28863d3b0f6a7bdb45e93c6ec82ad3ee6c92127", "control_checkpoint": "d512cdac520239f0c10e021721424d87cee30086fa70f6cbc41f21e2e04988c3", "candidate_eval_seconds": 27.915850400924683, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7410925529327445, "rel_wql_gmean": 0.4801896489521486}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7101927496760675, "rel_wql_gmean": 0.4951777893325377}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7505336641958719, "rel_wql_gmean": 0.5416629459896614}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8808621122321908, "rel_wql_gmean": 0.8553613464740869}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8986528839717891, "rel_wql_gmean": 0.6427356452925028}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5866079781217807, "rel_wql_gmean": 0.515878502724205}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8088402776655573, "rel_wql_gmean": 0.4071886269488133}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.849054821935193, "rel_wql_gmean": 0.5194197842337527}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6312577037012914, "rel_wql_gmean": 0.43131584054457206}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5577419814097542, "rel_wql_gmean": 0.4320730752302784}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6267917500028767, "rel_wql_gmean": 0.6531109131553342}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7645604573802218, "rel_wql_gmean": 0.5268011431202}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7264806634838061, "rel_wql_gmean": 0.4958712859698789}, "M": {"n_configs": 5, "rel_mase_gmean": 0.968665847380227, "rel_wql_gmean": 0.8244191704080674}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7789616355653816, "rel_wql_gmean": 0.8261807474647432}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6540890253739396, "rel_wql_gmean": 0.5027568624383535}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6901059067030996, "rel_wql_gmean": 0.4533119317454891}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9072082556593281, "rel_wql_gmean": 0.6801331584162394}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7073920580377491, "rel_wql_gmean": 0.51149932132313}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7662561432987753, "rel_wql_gmean": 0.5224500380303261}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7385624256035537, "rel_wql_gmean": 0.4774480306015298}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7112970077840257, "rel_wql_gmean": 0.49399950873586423}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7495810559140079, "rel_wql_gmean": 0.5412990087697497}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8812498422781989, "rel_wql_gmean": 0.8555240839274089}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9003124134337842, "rel_wql_gmean": 0.6439831822912251}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5795579602545416, "rel_wql_gmean": 0.5129229324649281}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8014187192027531, "rel_wql_gmean": 0.39917690533601163}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8487678656214006, "rel_wql_gmean": 0.5191938831467846}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6315950761584922, "rel_wql_gmean": 0.4315386790157564}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5583373635107705, "rel_wql_gmean": 0.433162583197897}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6267725580318051, "rel_wql_gmean": 0.6538606856911642}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7599509242283058, "rel_wql_gmean": 0.524915385039173}, "H": {"n_configs": 31, "rel_mase_gmean": 0.726196004396462, "rel_wql_gmean": 0.4955559356320016}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9682906777404066, "rel_wql_gmean": 0.8249007339255652}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7794132143007206, "rel_wql_gmean": 0.826151122683708}, "S": {"n_configs": 6, "rel_mase_gmean": 0.654344138587591, "rel_wql_gmean": 0.5028751847848326}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6900127153197991, "rel_wql_gmean": 0.4513560570693673}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9068583895899763, "rel_wql_gmean": 0.679330225432368}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7082895004717786, "rel_wql_gmean": 0.5105014816296383}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7639387308045943, "rel_wql_gmean": 0.5212587544154408}}}, "group_skill_delta": {"term": {"long": -0.002721680002506388, "medium": -0.0002456613235772842, "short": -0.0006188626122706209}, "domain": {"Econ/Fin": 0.00027360420030342336, "Energy": 0.0014393074330932842, "Healthcare": -0.0048842555794103015, "Nature": -0.008286759016696288, "Sales": -0.0002566324573352041, "Transport": 0.00027422820848521656, "Web/CloudOps": 0.0008808120760050997}, "frequency": {"A": 0.00035734856289149075, "D": -0.003049503732827308, "H": -0.00030844311715227946, "M": 8.783697678704794e-05, "Q": 0.00021811127813176068, "S": 0.0001793098017012218, "T": -0.0012456082559563209, "W": -0.0006151947572433647}, "variates": {"multivariate": -0.0002059442254825905, "univariate": -0.001678172759489227}}}, {"cutoff": "backcast_evals", "candidate_skill": 0.3401379378099838, "control_skill": 0.34137925383664736, "delta": -0.0012413160266635526, "candidate_checkpoint": "50257b1c120f798238c78920e28863d3b0f6a7bdb45e93c6ec82ad3ee6c92127", "control_checkpoint": "d512cdac520239f0c10e021721424d87cee30086fa70f6cbc41f21e2e04988c3", "candidate_eval_seconds": 27.87614369392395, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7771656159812894, "rel_wql_gmean": 0.4641464670148968}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7698937625348257, "rel_wql_gmean": 0.5323994679990453}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8092395007488731, "rel_wql_gmean": 0.5916383173869478}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8758967019430145, "rel_wql_gmean": 0.8175201210563051}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8887780515899812, "rel_wql_gmean": 0.6669633025938924}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6516566774021227, "rel_wql_gmean": 0.5621621277653412}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9098315297713278, "rel_wql_gmean": 0.4282329830782216}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7242751469093448, "rel_wql_gmean": 0.4914362361956457}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7294937757164066, "rel_wql_gmean": 0.5226388793304544}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6610373665420268, "rel_wql_gmean": 0.4520737202274516}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6450259219422076, "rel_wql_gmean": 0.7246543179459486}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8154620853085416, "rel_wql_gmean": 0.4875051030541513}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7695450570086102, "rel_wql_gmean": 0.5086618227538536}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8612498214867264, "rel_wql_gmean": 0.7897578092562838}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7636484321563957, "rel_wql_gmean": 0.7759964686434834}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8532172145869841, "rel_wql_gmean": 0.5069283220084164}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7723414529338847, "rel_wql_gmean": 0.5772230378425738}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8727212488016272, "rel_wql_gmean": 0.5935061529318592}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7894050496926538, "rel_wql_gmean": 0.5288493492410338}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7969125267227771, "rel_wql_gmean": 0.5649988183615692}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7748213703894843, "rel_wql_gmean": 0.4628541503223905}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7664514736085948, "rel_wql_gmean": 0.5293825048686492}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8092133321048779, "rel_wql_gmean": 0.5913363636847011}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8757735001155781, "rel_wql_gmean": 0.8170938641172787}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.884884194524689, "rel_wql_gmean": 0.6647829318344969}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6563469207069739, "rel_wql_gmean": 0.5654393474023085}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9047462993987708, "rel_wql_gmean": 0.4229856130109878}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7234827485870052, "rel_wql_gmean": 0.49101355399514096}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7302388544768311, "rel_wql_gmean": 0.5230662990235599}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6616757881069665, "rel_wql_gmean": 0.45318260421936735}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6445112721993314, "rel_wql_gmean": 0.7250031265258748}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8169867958549157, "rel_wql_gmean": 0.48765941110091987}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7687868921949567, "rel_wql_gmean": 0.5082857531718749}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8647112860240415, "rel_wql_gmean": 0.791872490233388}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7635201146060429, "rel_wql_gmean": 0.7764383165590925}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8527947748812648, "rel_wql_gmean": 0.5066866363631385}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7680903138861567, "rel_wql_gmean": 0.5733326508067024}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8719229424762637, "rel_wql_gmean": 0.5937682323059945}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7868235601514957, "rel_wql_gmean": 0.526807616706907}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7966399243027747, "rel_wql_gmean": 0.5645842503200074}}}, "group_skill_delta": {"term": {"long": -0.0017419473591165913, "medium": -0.0032453793718589807, "short": -0.00018777903028932563}, "domain": {"Econ/Fin": -0.0002801347714285196, "Energy": -0.002945168474385973, "Healthcare": 0.003942230030211102, "Nature": -0.005572174510065753, "Sales": -0.0005829307118394578, "Transport": 0.0005678089506152562, "Web/CloudOps": 0.0009342750841641045}, "frequency": {"A": -0.00010834267668324848, "D": 0.0006890438264665066, "H": -0.0005394850743444257, "M": 0.0027613188292558988, "Q": 0.00015443145557325622, "S": -0.00031958416153032854, "T": -0.004087760269423257, "W": -0.00017042960462587686}, "variates": {"multivariate": -0.002303744423308829, "univariate": -0.00036095711864858604}}}, {"cutoff": "backcast2_evals", "candidate_skill": 0.3654133862544089, "control_skill": 0.3650598400595585, "delta": 0.00035354619485039596, "candidate_checkpoint": "50257b1c120f798238c78920e28863d3b0f6a7bdb45e93c6ec82ad3ee6c92127", "control_checkpoint": "d512cdac520239f0c10e021721424d87cee30086fa70f6cbc41f21e2e04988c3", "candidate_eval_seconds": 26.02571415901184, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7969750155198805, "rel_wql_gmean": 0.5028425279468076}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7492595071225789, "rel_wql_gmean": 0.4860453063987902}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7585898653940325, "rel_wql_gmean": 0.5529671447280511}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8920282114966711, "rel_wql_gmean": 0.9102576242228817}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8946937985565026, "rel_wql_gmean": 0.6440394379668555}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6960280602101083, "rel_wql_gmean": 0.5918741667610459}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.746361340602626, "rel_wql_gmean": 0.35544722112159405}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.559900576571219, "rel_wql_gmean": 0.3577501073171789}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6607078653451939, "rel_wql_gmean": 0.4947136802285743}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6808038031281058, "rel_wql_gmean": 0.4665197604063334}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5821645808281362, "rel_wql_gmean": 0.7242787508575116}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7230443595750785, "rel_wql_gmean": 0.4451633730220444}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7516553034125851, "rel_wql_gmean": 0.48524511968300693}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8043893552116212, "rel_wql_gmean": 0.8333371327593128}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.833633527580419, "rel_wql_gmean": 0.878413080084567}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9029399326436061, "rel_wql_gmean": 0.5667697960827279}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7528268453636292, "rel_wql_gmean": 0.5352915340790136}, "W": {"n_configs": 8, "rel_mase_gmean": 0.83682418441124, "rel_wql_gmean": 0.6327957387084753}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.779687197088358, "rel_wql_gmean": 0.5128211016965539}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7517044391242127, "rel_wql_gmean": 0.538809108170691}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.796127056742376, "rel_wql_gmean": 0.5022139410634582}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7505942901123125, "rel_wql_gmean": 0.4865575819153698}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7594504520679526, "rel_wql_gmean": 0.5532537195147663}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8929618274343588, "rel_wql_gmean": 0.9103813793769899}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8959209226146972, "rel_wql_gmean": 0.6453740580861129}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6961784435164479, "rel_wql_gmean": 0.5915734081229318}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7476406868387996, "rel_wql_gmean": 0.35522212901676864}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5597759096460994, "rel_wql_gmean": 0.35738676117830037}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6611597485381723, "rel_wql_gmean": 0.4949322755161753}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6805375314732472, "rel_wql_gmean": 0.4657391485089796}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.582687321216151, "rel_wql_gmean": 0.7249374834569997}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7228644523548966, "rel_wql_gmean": 0.4448013254664766}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7512801448992653, "rel_wql_gmean": 0.48470980713170986}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8061257673025353, "rel_wql_gmean": 0.8338421947073288}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8329742195879615, "rel_wql_gmean": 0.8780190666063756}, "S": {"n_configs": 6, "rel_mase_gmean": 0.903952356548986, "rel_wql_gmean": 0.5661338988037351}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7547233557063331, "rel_wql_gmean": 0.536425314767226}, "W": {"n_configs": 8, "rel_mase_gmean": 0.83773127724725, "rel_wql_gmean": 0.6339155481728359}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.780210137456359, "rel_wql_gmean": 0.5128749991570595}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7524307203251008, "rel_wql_gmean": 0.5390362822620333}}}, "group_skill_delta": {"term": {"long": -0.0007324544050971715, "medium": 0.0008555081358375682, "short": 0.0005351722743626164}, "domain": {"Econ/Fin": 0.0005327151568488286, "Energy": 0.00130703949975719, "Healthcare": -9.377891999895471e-05, "Nature": 0.00027799860786281716, "Sales": -0.0002771384946731459, "Transport": 0.00032181580708878776, "Web/CloudOps": -0.0005818248027860129}, "frequency": {"A": 0.0005868221601658119, "D": -0.00030131064454019807, "H": -0.0004838666325538421, "M": 0.001131549891915773, "Q": -0.0005303241709088136, "S": -7.056133095595385e-07, "T": 0.0014718692998841876, "W": 0.0010382287478243324}, "variates": {"multivariate": 0.00024525683429399425, "univariate": 0.00044158599169175083}}}, {"cutoff": "backcast3_evals", "candidate_skill": 0.391803142720465, "control_skill": 0.3928331731047856, "delta": -0.0010300303843205905, "candidate_checkpoint": "50257b1c120f798238c78920e28863d3b0f6a7bdb45e93c6ec82ad3ee6c92127", "control_checkpoint": "d512cdac520239f0c10e021721424d87cee30086fa70f6cbc41f21e2e04988c3", "candidate_eval_seconds": 27.31839394569397, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7624346703659255, "rel_wql_gmean": 0.4743580833851574}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7702307781273624, "rel_wql_gmean": 0.5292770399476574}, "short": {"n_configs": 54, "rel_mase_gmean": 0.713144124249704, "rel_wql_gmean": 0.504332011833272}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8405708171366003, "rel_wql_gmean": 0.838069378872038}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8318396604722257, "rel_wql_gmean": 0.553433996992084}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7566464181949424, "rel_wql_gmean": 0.6344870408459748}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7319190534029946, "rel_wql_gmean": 0.3400004103072392}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7475116719207561, "rel_wql_gmean": 0.4734936758666793}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.53750914128304, "rel_wql_gmean": 0.4457451914431652}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7142643694503665, "rel_wql_gmean": 0.517548965180728}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5302117589970107, "rel_wql_gmean": 0.8007710428899867}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7180517709674819, "rel_wql_gmean": 0.4178382031926381}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7228091606224635, "rel_wql_gmean": 0.4862435953137423}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8359939305521914, "rel_wql_gmean": 0.8275991910591551}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7127980309953568, "rel_wql_gmean": 0.7659555307794623}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8420996207058596, "rel_wql_gmean": 0.6005482331608448}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7105038030240836, "rel_wql_gmean": 0.4635245614583766}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8170490407004515, "rel_wql_gmean": 0.6656752726023953}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7628515792966292, "rel_wql_gmean": 0.5124410538658243}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7137943050574351, "rel_wql_gmean": 0.49613017247229274}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7631434004686845, "rel_wql_gmean": 0.4745780224475118}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7702543592823002, "rel_wql_gmean": 0.5302072122994279}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7102740757127205, "rel_wql_gmean": 0.5028426749263977}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8404794249042948, "rel_wql_gmean": 0.8377611830280824}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8299149339539488, "rel_wql_gmean": 0.5519405024214632}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7621826867136657, "rel_wql_gmean": 0.6349175346276966}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7231739407449111, "rel_wql_gmean": 0.3380432271049275}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7474335142271239, "rel_wql_gmean": 0.4733071421517686}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5378627602598968, "rel_wql_gmean": 0.4463114549472672}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7146709097664398, "rel_wql_gmean": 0.5186863440823273}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5306073447296601, "rel_wql_gmean": 0.8030982774337949}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7175124768607152, "rel_wql_gmean": 0.41780178227764675}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7223996277645064, "rel_wql_gmean": 0.4859456509788173}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8339193215840682, "rel_wql_gmean": 0.8250296214792107}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7133214644953572, "rel_wql_gmean": 0.7659591311067668}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8388577706002066, "rel_wql_gmean": 0.5998597273487538}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7077596915926687, "rel_wql_gmean": 0.46245587762920626}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8141976774865708, "rel_wql_gmean": 0.6645660569936594}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7600456915083991, "rel_wql_gmean": 0.511644654751976}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7131300545794724, "rel_wql_gmean": 0.49563420928448887}}}, "group_skill_delta": {"term": {"long": 0.0004189156912476344, "medium": 0.0005705870804755264, "short": -0.0020923781938803065}, "domain": {"Econ/Fin": -0.0001999628363876793, "Energy": -0.0017004855606553848, "Healthcare": 0.002766103506972928, "Nature": -0.0044183974353669275, "Sales": -0.00014829528630255773, "Transport": 0.0004719007179080359, "Web/CloudOps": 0.0008409088440183288}, "frequency": {"A": 0.0011895443852505405, "D": -0.00022959662975885475, "H": -0.0003495788044701742, "M": -0.0023234081767862236, "Q": 0.00027298758276950164, "S": -0.0017771470506958709, "T": -0.0017699468197419632, "W": -0.001901601654469287}, "variates": {"multivariate": -0.0016360525211348564, "univariate": -0.0005743401329708631}}}], "mean_delta": -0.0007314110640462834, "positive_cutoffs": 1, "outcome": "Declared primary6000/durability12000 diagnostic. No transfer formula or automatic publication is selected by this controller."} + +## E136: direct bounded local-trend head +2026-10-23T09:22:46.982190+00:00: Hypothesis: direct learned forecast gates on fixed short-window trend increments can improve short/low-frequency extrapolation. E35query-only local-trend features failed earlier cutoffs; this is a distinct output-path addition motivated by E125seasonal direct-head sensitivity, not a claim that E35 worked or a direct head-versus-query comparison. Start exactly E107zero-extended E62 initial470ef98d..., retain its long-seasonal query/head, add only zero Linear512→32 with bias (16416parameters). For each k=4,16, take means of lastk and previousk normalized observations, require>=max(2,k/2) finite in each; slope=(recent-older)/k; delta(t)=3*tanh(slope*(t+k/2)/3), t starts0. Invalid support gives0. Add sum(tanh(learned_gate)*delta) to median/all nine quantiles, bounded by6context-standard-deviation units; no query addition, width change or frequency selector. All parameters train. Same seed197/B64/LR2e-5/12kpaired/oldpack/originalgenerator/horizon300200 as E107; code/sampler and inherited tensors preserved. Primary6k,1/3diagnostic,12durability; allfourcutoffs comparedtoE107 at6/12. CPUfixture719/GPU727. Queue after E129width final12k only after audits. No new concurrent trainer; no transfer coefficient or ensemble selected. No validation training. + +E110 full allowed corpus 48000 matched comparison: {"label": "E110 full allowed corpus 48000 matched comparison", "utc": "2026-10-23T09:23:20.926275+00:00", "candidate": "random_capacity_full_ema48000", "control": "random_capacity_1024_halflr_ema48000", "rows": [{"cutoff": "evals", "candidate_skill": 0.36449796840324333, "control_skill": 0.36570581958166615, "delta": -0.001207851178422814, "candidate_checkpoint": "926f61e5d5f8ffebc8a5d73285832ebedc28aca794b0b06b55fc3c48a07330d1", "control_checkpoint": "ea9055d683b93a4691e77bd64d46e301302765673055fd9b32ddb3a3e2f749df", "candidate_eval_seconds": 36.223931074142456, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7548553746218293, "rel_wql_gmean": 0.4912987773239935}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7352999993476327, "rel_wql_gmean": 0.504363562451463}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7710300090434509, "rel_wql_gmean": 0.559031484306989}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8770103389279252, "rel_wql_gmean": 0.8491199347133979}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9116653965880178, "rel_wql_gmean": 0.6580222595386767}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.658803814018058, "rel_wql_gmean": 0.5396972664532947}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8280404956337558, "rel_wql_gmean": 0.41423369227737183}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8220888925613495, "rel_wql_gmean": 0.5100769909819354}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6548033152870734, "rel_wql_gmean": 0.45244139184364884}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5808419471264448, "rel_wql_gmean": 0.4489494375356866}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5935959285501078, "rel_wql_gmean": 0.6250048870270299}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7751260416854967, "rel_wql_gmean": 0.5273604629524228}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7390325632700983, "rel_wql_gmean": 0.5118806853040565}, "M": {"n_configs": 5, "rel_mase_gmean": 1.1155244631113046, "rel_wql_gmean": 0.9182662011196825}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7722896053051759, "rel_wql_gmean": 0.8394501877623775}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6682567022663544, "rel_wql_gmean": 0.5122682378733995}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7187462560447286, "rel_wql_gmean": 0.4734288271006955}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8925511740053919, "rel_wql_gmean": 0.6530704845861032}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7303154554027623, "rel_wql_gmean": 0.5275234582063876}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7838594930079051, "rel_wql_gmean": 0.5349400339090976}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7662260094156811, "rel_wql_gmean": 0.5020347958679111}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7301951069360759, "rel_wql_gmean": 0.504117847493669}, "short": {"n_configs": 55, "rel_mase_gmean": 0.760169630057802, "rel_wql_gmean": 0.5569997956352839}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.9028304922158942, "rel_wql_gmean": 0.8610209443587438}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9109454293905939, "rel_wql_gmean": 0.6586383074299472}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5906912914017803, "rel_wql_gmean": 0.5056722543269967}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8235409860259677, "rel_wql_gmean": 0.4231966180830639}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.827511700634232, "rel_wql_gmean": 0.5156149712576104}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6493612164587901, "rel_wql_gmean": 0.44948344031797927}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.579824052847299, "rel_wql_gmean": 0.45322822077685615}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.602630505709834, "rel_wql_gmean": 0.6156602399781036}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7586530974855328, "rel_wql_gmean": 0.5235946298319726}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7435902027632983, "rel_wql_gmean": 0.5180310279395838}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9983606322195729, "rel_wql_gmean": 0.8755961609165552}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.763496329349679, "rel_wql_gmean": 0.8207236971111334}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6652066754808894, "rel_wql_gmean": 0.512126307398621}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7125876645731054, "rel_wql_gmean": 0.4722827561143623}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9331507389139616, "rel_wql_gmean": 0.6806266270092172}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7296537216262745, "rel_wql_gmean": 0.5340631203218278}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7755777292850502, "rel_wql_gmean": 0.5321111949818653}}}, "group_skill_delta": {"term": {"long": 0.011237044940272, "medium": -0.002265482424887666, "short": -0.0058258391281375}, "domain": {"Econ/Fin": 0.018725456927130568, "Energy": 5.6439664597340844e-05, "Healthcare": -0.04975294984969725, "Nature": 0.00469166361832507, "Sales": 0.00564960889904409, "Transport": -0.004041300246997448, "Web/CloudOps": 0.001977896791272138}, "frequency": {"A": 1.254752371049328e-05, "D": -0.00909265869243725, "H": 0.005588956120089361, "M": -0.07713535452581188, "Q": -0.013576920435537154, "S": -0.001417613835157483, "T": -0.003207973776989448, "W": 0.033470593806027016}, "variates": {"multivariate": 0.0035524775192712355, "univariate": -0.005135222886763047}}}], "mean_delta": -0.001207851178422814, "positive_cutoffs": 0, "outcome": "At48k the full-corpus arm remains below the matched original-pack model. Continue declared72k/96k schedule; no source-mixture or teacher change."} + +2026-10-23T09:26:09.408870+00:00: E136CPU/GPU audits complete; queued{"queue_pid": 26926, "watch_pid": 26927, "comparison_pid": 26928} after E12924583final12000. InitialSHA87158329c5c8bfc69025843fa82c14482931b67d7e6c6b728aa461d45ef56bd4,36866400params. CPU2.943994993s, all original forecasts/loss bitwise; independent trend float64 maxerror4.44e-16 and float32 maxerror2.01856e-6. Initial1e-6 absolute float32 audit tolerance was too tight due mean-rounding amplified by forecast lead; failures retained as direct_trend_head_checks_failure1/2.log, tolerance amendedto1e-5 plus independent float64<1e-12. Model arithmetic unchanged by audit amendment. GPU727maximumB64C4096H1024 finiteallgradients/nonzeronewheadgrads, original BF16forecast/lossbitwise,6294MiBreserved/5785.947allocated includingAdam/EMAplaceholders,12.204455994s,0optimizerupdates/no validation. E121final complete12k main0.381305914750, fourcutoffs1positive/mean-0.000731411064; no transfer. E11048k0.364497968403, matched E94-0.001207851178; original96kschedule kept. + +E130 validation-only error diagnostics: coverage1.232385601s and median-error structure1.231693947s, same published descriptorfa97880d..., no new inference/updates/fitting. Lower-bound absolute per-window mean-error fraction of medianMAE averages0.56189long/0.55437medium/0.68098short; annual0.92223 and quarterly0.86332, but these are descriptive Jensen bounds, not recoverable improvements. Last-quarter normalizedMAE ratios1.09692long/1.09527medium/1.19979short. Atom-aware strict/inclusive quantile coverage retained; mixed signed bias by domain argues against a global offset. Files fresh_capacity4_ensemble_coverage.json and fresh_capacity4_median_error_structure.json contain all configuration groups. + +## E137: fresh depth/width allocation at nearly fixed146M parameter count +2026-10-23T09:26:40.530388+00:00: Hypothesis: the fresh E79wide model may use its parameter budget better with more sequential layers and narrower hidden states. E22mature identity-grafted depth failed and is not resumed; this is a new fresh initialization with different depth/width allocation. One fixed configuration d768/12heads/11encoder/7decoder versus E79d1024/16heads/6encoder/4decoder, same64head dimension and patch16. Meta-device count146328864 versus146477344, difference-0.101367percent. No actual weights created in the count probe. Initialize locally with seed307 and the same zero-output seasonal-mixture/interval biases; require identical initial forecasts/loss. Same sampler/sourceweights/packed_sample/slowAR20percent/horizon300310, seed307/B48/LR2e-4/96k/paired/staticcompile/400warmupcosfloor0.2. Compare equal updates and record walltime; compute is not exactly matched despite nearly fixed parameters. Primary48k,4/8/16/24diagnostics,72/96durability;48/96all4cutoffs versusE79. CPUfixture733/GPU739; queue after E122originalAR96000, also require E79wide96000, replacing one allocation. No long-seasonal features/teacher/curriculum/newdata. No additional configuration or LR sweep, no transfer/ensemble selected. Audit before queue. + +## E118 seasonal replication seed523 scheduled1000 diagnostic +- Checkpoint SHA-256: `6a98b9da2fe0328e79dc5918ac7a3633ca68848f124de9211021c00cb223b971`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 26.95650577545166 seconds. +- Overall skill 0.378318; relative MASE 0.742595; relative WQL 0.520457. +- term skill: long=0.4020, medium=0.4076, short=0.3573. +- domain skill: Econ/Fin=0.1385, Energy=0.2383, Healthcare=0.4379, Nature=0.4331, Sales=0.3369, Transport=0.4715, Web/CloudOps=0.5009. +- frequency skill: A=0.3664, D=0.3564, H=0.3977, M=0.1105, Q=0.1974, S=0.4226, T=0.4371, W=0.2196. +- variates skill: multivariate=0.3951, univariate=0.3646. +- Outcome: Early diagnostic only; primary6000 and final12000 four-cutoff replication gates remain unchanged. + +## E118 seasonal replication seed523 scheduled3000 diagnostic +- Checkpoint SHA-256: `5bf12017a324cbc63b04b472e9a4a16e6f31de1f91075e5dbdaa9b5877f0e778`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 27.29305911064148 seconds. +- Overall skill 0.380865; relative MASE 0.739639; relative WQL 0.518264. +- term skill: long=0.4047, medium=0.4074, short=0.3609. +- domain skill: Econ/Fin=0.1410, Energy=0.2368, Healthcare=0.4548, Nature=0.4339, Sales=0.3391, Transport=0.4753, Web/CloudOps=0.5046. +- frequency skill: A=0.3691, D=0.3683, H=0.3972, M=0.1066, Q=0.1997, S=0.4244, T=0.4398, W=0.2187. +- variates skill: multivariate=0.3956, univariate=0.3689. +- Outcome: Early diagnostic only; primary6000 and final12000 four-cutoff replication gates remain unchanged. + +## E129 direct uncertainty head scheduled1000 diagnostic +- Checkpoint SHA-256: `f35c7a8244c69445476be414b9945a8182382c20eba1704e3439e64c2b7b2835`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 28.25899314880371 seconds. +- Overall skill 0.378918; relative MASE 0.742329; relative WQL 0.519639. +- term skill: long=0.4009, medium=0.4070, short=0.3591. +- domain skill: Econ/Fin=0.1331, Energy=0.2373, Healthcare=0.4623, Nature=0.4321, Sales=0.3365, Transport=0.4726, Web/CloudOps=0.4996. +- frequency skill: A=0.3655, D=0.3628, H=0.3970, M=0.1081, Q=0.1988, S=0.4236, T=0.4359, W=0.2240. +- variates skill: multivariate=0.3932, univariate=0.3673. +- Outcome: Early diagnostic only; compare6000/12000 against E119 across all four cutoffs before considering any transfer. + +E121 final compute:12000updates, training loop2735.054694893s/process2752.4546950480435s on sharedH100, completed2026-10-23T09:19:28Z. E129width trainer26493 started09:19:29. E136queued after its scheduled completion. + +E118 6000 four-cutoff comparison: {"label": "E118 6000 four-cutoff comparison", "utc": "2026-10-23T09:27:51.420228+00:00", "candidate": "long_seasonal_replication_ema6000", "control": "weekly_replication_control_ema6000", "rows": [{"cutoff": "evals", "candidate_skill": 0.38139534722395463, "control_skill": 0.3764059869702334, "delta": 0.004989360253721209, "candidate_checkpoint": "a35444a7dd833f0988143c8b6f304dee50256258d32528f097dfd83e78aebd29", "control_checkpoint": "674137ac14bce26f6983cb68123e34d01ca598bb3ad72e81cbd197d138ed6104", "candidate_eval_seconds": 27.10453462600708, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7384436160182325, "rel_wql_gmean": 0.47633347487090744}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7083770552963923, "rel_wql_gmean": 0.4942262244660524}, "short": {"n_configs": 55, "rel_mase_gmean": 0.751548854583905, "rel_wql_gmean": 0.543994941613593}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8746099669867802, "rel_wql_gmean": 0.8444329440894982}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8974004296196013, "rel_wql_gmean": 0.6447860628281569}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5916091617456333, "rel_wql_gmean": 0.5181079300960174}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8010054886688159, "rel_wql_gmean": 0.39794714882168664}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8452719229795517, "rel_wql_gmean": 0.5198290418551154}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6348508365518176, "rel_wql_gmean": 0.43540848427535833}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.559670606308481, "rel_wql_gmean": 0.4359745561616292}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6166679480695255, "rel_wql_gmean": 0.6474656804701975}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7642165704351264, "rel_wql_gmean": 0.526273641696534}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7252102222235688, "rel_wql_gmean": 0.49585443092368514}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9617184700594594, "rel_wql_gmean": 0.8119569708130686}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7728364193780128, "rel_wql_gmean": 0.8232647673811775}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6562575033932274, "rel_wql_gmean": 0.5039290527300556}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6916904149917935, "rel_wql_gmean": 0.45467693411097854}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9047060491506385, "rel_wql_gmean": 0.6824196495981721}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7081151587667208, "rel_wql_gmean": 0.511629619486321}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7648591098010137, "rel_wql_gmean": 0.5226011134261795}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7423520793155982, "rel_wql_gmean": 0.4787760930516074}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7108957302184202, "rel_wql_gmean": 0.49544398256669214}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7601781653409367, "rel_wql_gmean": 0.5498223036137193}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8774576028138481, "rel_wql_gmean": 0.8475316890174351}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8988661021414461, "rel_wql_gmean": 0.6463834516983328}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6006104281692445, "rel_wql_gmean": 0.524233793726234}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8134935230540142, "rel_wql_gmean": 0.3997489668388505}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8499103394938109, "rel_wql_gmean": 0.5219975994261501}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6467190684113404, "rel_wql_gmean": 0.44452081778083646}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5634416431639562, "rel_wql_gmean": 0.4401382781033821}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6161471234928296, "rel_wql_gmean": 0.6463468715167274}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7848816529444701, "rel_wql_gmean": 0.5402760226239798}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7309935655071853, "rel_wql_gmean": 0.4990723913425074}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9727178622288029, "rel_wql_gmean": 0.816056242029619}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7737575967731107, "rel_wql_gmean": 0.823275820013628}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6574784363502988, "rel_wql_gmean": 0.5055662052073743}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6939173128959706, "rel_wql_gmean": 0.45688555231972555}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9049382682975748, "rel_wql_gmean": 0.6792210269186987}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7113196954989369, "rel_wql_gmean": 0.5136253484474166}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7736792477740673, "rel_wql_gmean": 0.5282222076131846}}}, "group_skill_delta": {"term": {"long": 0.0030901879764350104, "medium": 0.001780762492295751, "short": 0.007095493847238954}, "domain": {"Econ/Fin": 0.002975834665022492, "Energy": 0.001563367974052876, "Healthcare": 0.007483990472556434, "Nature": 0.005670688999450224, "Sales": 0.0032012415147016915, "Transport": 0.010415631896715682, "Web/CloudOps": 0.004022455454145979}, "frequency": {"A": -0.000812835465225703, "D": 0.01701113810261179, "H": 0.004336748931600631, "M": 0.007279563828444857, "Q": 0.00048059417615298194, "S": 0.0014689462587585966, "T": 0.002264615663313485, "W": -0.001743018809113317}, "variates": {"multivariate": 0.002535860099677434, "univariate": 0.007045445011520823}}}, {"cutoff": "backcast_evals", "candidate_skill": 0.34148204276995875, "control_skill": 0.33686271636038767, "delta": 0.004619326409571078, "candidate_checkpoint": "a35444a7dd833f0988143c8b6f304dee50256258d32528f097dfd83e78aebd29", "control_checkpoint": "674137ac14bce26f6983cb68123e34d01ca598bb3ad72e81cbd197d138ed6104", "candidate_eval_seconds": 28.566162824630737, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7723731416377819, "rel_wql_gmean": 0.4632107172403023}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7671954794368977, "rel_wql_gmean": 0.5312350959721146}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8100582121563055, "rel_wql_gmean": 0.5899282692731751}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8687261450618122, "rel_wql_gmean": 0.8082961609981344}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8862173381254191, "rel_wql_gmean": 0.6651047976556796}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6594478212047317, "rel_wql_gmean": 0.5645231469319925}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9089209431299469, "rel_wql_gmean": 0.42467952077275695}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7202692807552361, "rel_wql_gmean": 0.48857346078291813}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7288704777178566, "rel_wql_gmean": 0.5222328100597717}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.660516684610902, "rel_wql_gmean": 0.45317990809147163}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6362857693297146, "rel_wql_gmean": 0.718919629290515}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8204727582247486, "rel_wql_gmean": 0.4872381268444442}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7682037082264834, "rel_wql_gmean": 0.509028795109172}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8593317016465691, "rel_wql_gmean": 0.7884922974968397}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7645940654788865, "rel_wql_gmean": 0.7749566350269932}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8543887576787607, "rel_wql_gmean": 0.5062235051582774}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7674906725326316, "rel_wql_gmean": 0.5744892709241222}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8747433682691604, "rel_wql_gmean": 0.5866006957943835}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7868501358031069, "rel_wql_gmean": 0.5272439568809584}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7967853619832356, "rel_wql_gmean": 0.5637777828583188}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7777899366370885, "rel_wql_gmean": 0.4666461848610854}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7712195810305081, "rel_wql_gmean": 0.5347223528001698}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8157014297594425, "rel_wql_gmean": 0.594505327140644}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8704620954888443, "rel_wql_gmean": 0.8078922620241903}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8882606931279534, "rel_wql_gmean": 0.6674012951208939}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6364743665086174, "rel_wql_gmean": 0.5427490496574564}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9333553941257822, "rel_wql_gmean": 0.4343023693769805}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7303166317693277, "rel_wql_gmean": 0.49604922755902825}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7376993677473777, "rel_wql_gmean": 0.5310447538293593}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6636991675282037, "rel_wql_gmean": 0.45680163980850563}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6375256983912256, "rel_wql_gmean": 0.7191000346681787}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8393218475657132, "rel_wql_gmean": 0.49833264680985245}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7774058842744058, "rel_wql_gmean": 0.5160577664144067}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8537317706164532, "rel_wql_gmean": 0.7830802392519056}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7650278022696294, "rel_wql_gmean": 0.7781637321579334}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8543705568836895, "rel_wql_gmean": 0.5071897079925518}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7667703361558642, "rel_wql_gmean": 0.5753639235453477}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8733321780511988, "rel_wql_gmean": 0.5813284323450881}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7895839523280466, "rel_wql_gmean": 0.5300271513025459}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.804038086370608, "rel_wql_gmean": 0.5689301788513232}}}, "group_skill_delta": {"term": {"long": 0.004315516056029756, "medium": 0.0037695303820619586, "short": 0.005089574480807935}, "domain": {"Econ/Fin": 0.0006272266200113563, "Energy": 0.0022104097565962544, "Healthcare": -0.02239582227301684, "Nature": 0.015388601229029852, "Sales": 0.008675833927555998, "Transport": 0.008940101196063144, "Web/CloudOps": 0.0035035732825486887}, "frequency": {"A": 0.000743610213548962, "D": 0.0144611767663968, "H": 0.008062565927424048, "M": -0.00550706000216461, "Q": 0.0018099001576229456, "S": 0.0006203064827527971, "T": 0.00019336535816938394, "W": -0.0038018199916598494}, "variates": {"multivariate": 0.0028186782603143445, "univariate": 0.006113023550257446}}}, {"cutoff": "backcast2_evals", "candidate_skill": 0.36289765736601953, "control_skill": 0.3592811180029256, "delta": 0.003616539363093918, "candidate_checkpoint": "a35444a7dd833f0988143c8b6f304dee50256258d32528f097dfd83e78aebd29", "control_checkpoint": "674137ac14bce26f6983cb68123e34d01ca598bb3ad72e81cbd197d138ed6104", "candidate_eval_seconds": 26.93511390686035, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7999866836284341, "rel_wql_gmean": 0.5044200017652598}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7520950988995759, "rel_wql_gmean": 0.4892760629450976}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7606253653722089, "rel_wql_gmean": 0.5555279454828711}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8847569248764997, "rel_wql_gmean": 0.9060830962565252}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8956024100790815, "rel_wql_gmean": 0.6478655810625242}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6848951113243488, "rel_wql_gmean": 0.5869340140781533}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7651445328371117, "rel_wql_gmean": 0.35779612742646116}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5582720391157578, "rel_wql_gmean": 0.3624482499639085}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6601423012893489, "rel_wql_gmean": 0.4941046094070358}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6822688880912414, "rel_wql_gmean": 0.4716397362737}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5866730147839814, "rel_wql_gmean": 0.7282696655733021}, "D": {"n_configs": 15, "rel_mase_gmean": 0.721606653160396, "rel_wql_gmean": 0.4455719223490989}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7519224499351271, "rel_wql_gmean": 0.4855739028067261}, "M": {"n_configs": 4, "rel_mase_gmean": 0.7958937219145119, "rel_wql_gmean": 0.8278786577082036}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8278284107651726, "rel_wql_gmean": 0.8711003564900259}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9117298850572676, "rel_wql_gmean": 0.5695589028063504}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7565476756893262, "rel_wql_gmean": 0.5408653745166001}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8532517838495485, "rel_wql_gmean": 0.6418251083691219}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7815086652482058, "rel_wql_gmean": 0.5151119296416654}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7545676092741181, "rel_wql_gmean": 0.5415196313785547}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.8031247991695346, "rel_wql_gmean": 0.5063441900141398}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.759271017733826, "rel_wql_gmean": 0.4942837438875637}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7635103127299346, "rel_wql_gmean": 0.558620350413778}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8829799182441074, "rel_wql_gmean": 0.9033007915779863}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8960811237328992, "rel_wql_gmean": 0.6490530518856117}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6827692086021916, "rel_wql_gmean": 0.5845693923485398}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7754223586659996, "rel_wql_gmean": 0.3653264852073133}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5625647121458199, "rel_wql_gmean": 0.3636579561955935}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6680514846601735, "rel_wql_gmean": 0.5009103935786285}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6858285407478295, "rel_wql_gmean": 0.47293341913074566}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5860387955461611, "rel_wql_gmean": 0.7286211532403828}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7269196928525937, "rel_wql_gmean": 0.44880565875856504}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7584729987738923, "rel_wql_gmean": 0.4920220941901859}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8121441530839135, "rel_wql_gmean": 0.8417102651757645}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8287813793543607, "rel_wql_gmean": 0.8713871032122515}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9172508855779987, "rel_wql_gmean": 0.5711595531807128}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7574199269295314, "rel_wql_gmean": 0.5414015001184371}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8487218235695173, "rel_wql_gmean": 0.6393469997194787}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7842051278389427, "rel_wql_gmean": 0.5178220809914736}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7594234945005031, "rel_wql_gmean": 0.5453398108764536}}}, "group_skill_delta": {"term": {"long": 0.002457539093086325, "medium": 0.005998211480277904, "short": 0.0030417477421523786}, "domain": {"Econ/Fin": -0.002273957709553409, "Energy": 0.0009015022908251957, "Healthcare": -0.0022612411372170405, "Nature": 0.009016440918215407, "Sales": 0.0024790220967471632, "Transport": 0.007354386508216848, "Web/CloudOps": 0.0022573579863649496}, "frequency": {"A": -0.00019577464888176355, "D": 0.00414510007665303, "H": 0.006642513192105515, "M": 0.01506639415788269, "Q": 0.000628474278988711, "S": 0.0031934833206613833, "T": 0.0006857901330149518, "W": -0.0033932466881767542}, "variates": {"multivariate": 0.0027634126167848105, "univariate": 0.0043115265641551215}}}, {"cutoff": "backcast3_evals", "candidate_skill": 0.3942150741055669, "control_skill": 0.38907521863271344, "delta": 0.00513985547285345, "candidate_checkpoint": "a35444a7dd833f0988143c8b6f304dee50256258d32528f097dfd83e78aebd29", "control_checkpoint": "674137ac14bce26f6983cb68123e34d01ca598bb3ad72e81cbd197d138ed6104", "candidate_eval_seconds": 27.25320529937744, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7629635636061852, "rel_wql_gmean": 0.47738458152400776}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.766392308286767, "rel_wql_gmean": 0.5313314815939195}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7071218260479499, "rel_wql_gmean": 0.5006775766138106}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8381102666984516, "rel_wql_gmean": 0.8394034451197796}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8289543246911923, "rel_wql_gmean": 0.5533980426446239}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7646070931321529, "rel_wql_gmean": 0.6340273684119219}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7124818665930959, "rel_wql_gmean": 0.3362710472055882}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.749228232992685, "rel_wql_gmean": 0.4762895479100841}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5376228806838672, "rel_wql_gmean": 0.4444847778365197}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7113197969938141, "rel_wql_gmean": 0.5172381497265214}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5285683023786453, "rel_wql_gmean": 0.8081021206308033}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7180947935486091, "rel_wql_gmean": 0.4166198174883141}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7187802155486654, "rel_wql_gmean": 0.48447543037731317}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8446392308099292, "rel_wql_gmean": 0.8352147404850153}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7170557043368275, "rel_wql_gmean": 0.7716033464240198}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8418253577208561, "rel_wql_gmean": 0.6034466207614427}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7040554267349227, "rel_wql_gmean": 0.4621152504325736}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8007557024739949, "rel_wql_gmean": 0.6624691609661729}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7573616152833316, "rel_wql_gmean": 0.5115793885293797}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7103904231097383, "rel_wql_gmean": 0.49493523556054253}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7671142731116414, "rel_wql_gmean": 0.47916971922185897}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7691789126794641, "rel_wql_gmean": 0.5327740132487557}, "short": {"n_configs": 54, "rel_mase_gmean": 0.715186469179385, "rel_wql_gmean": 0.5068184655107872}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8354342596603832, "rel_wql_gmean": 0.8357377255274399}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8342617788501976, "rel_wql_gmean": 0.5573075943847307}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7972742291272131, "rel_wql_gmean": 0.6590388193539706}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7177945317735281, "rel_wql_gmean": 0.3409481388214971}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7564395059888536, "rel_wql_gmean": 0.4796335352468516}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5443616570651463, "rel_wql_gmean": 0.4495153491412182}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7144590925124263, "rel_wql_gmean": 0.5173883213055337}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5289225996632382, "rel_wql_gmean": 0.8103046826779774}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7349960465094477, "rel_wql_gmean": 0.4267705081645206}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7251125032253354, "rel_wql_gmean": 0.4886750306028493}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8759774015027841, "rel_wql_gmean": 0.8655991309312683}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.719352309068614, "rel_wql_gmean": 0.7733057960523231}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8471349906333493, "rel_wql_gmean": 0.6030978365582621}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7042550964089376, "rel_wql_gmean": 0.46188222870125517}, "W": {"n_configs": 8, "rel_mase_gmean": 0.799674894951322, "rel_wql_gmean": 0.6659800353030906}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7624402331967736, "rel_wql_gmean": 0.5141833494144036}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.717447678119841, "rel_wql_gmean": 0.5004410335678261}}}, "group_skill_delta": {"term": {"long": 0.0027698008657701667, "medium": 0.0020262913449556885, "short": 0.0070419325939486965}, "domain": {"Econ/Fin": -0.0031706278671020938, "Energy": 0.004560668439750781, "Healthcare": 0.028605969372706652, "Nature": 0.0052263731253747725, "Sales": 0.00497135350332778, "Transport": 0.005829861229354971, "Web/CloudOps": 0.0014252569820584204}, "frequency": {"A": 0.0011093614220064607, "D": 0.013099980427090374, "H": 0.0051570149204880344, "M": 0.030859037748264706, "Q": 0.002011671661662273, "S": 0.002037535338632379, "T": -6.297375685770934e-05, "W": 0.0014344297457079547}, "variates": {"multivariate": 0.003670950319457855, "univariate": 0.006243315369551361}}}], "mean_delta": 0.004591270374809914, "positive_cutoffs": 4, "outcome": "Declared primary6000/durability12000 diagnostic. No transfer formula or automatic publication is selected by this controller."} + +2026-10-23T09:29:59.791282+00:00: E118 seed523 long-seasonal primary6000 passes allfour matched cutoffs. CandidateSHAa35444a7dd833f0988143c8b6f304dee50256258d32528f097dfd83e78aebd29; main0.381395347224, deltas[0.004989360253721209, 0.004619326409571078, 0.003616539363093918, 0.00513985547285345], mean0.004591270374809914. E133conditional averaged correction still waits for mandatory final12000 replication gate; no averaged checkpoint created. This replicates the feature benefit across data/initial optimizer streamseed, not a held-out test claim. + +2026-10-23T09:31:30.337349+00:00: E137fresh depth allocation audited/queued{"queue_pid": 27276, "watch_pid": 27277, "comparison_pid": 27278} after E122queue20741 and E79queue5650 final96000. InitialSHA3991760771cd77bea0eb79a13091eeff912853dce8afa77ea272cf14840dd234;146328864params. CPU733initialforecast/lossbitwise,9.490635959s. GPU739maximumB48signed96C4096H1024 withAdam/EMA placeholders peak13370MiBreserved/12748.821allocated; finitegrads; compiledcomparison85.653620400s,total119.975613646 incl17.560618830lockwait. Initialzerohead compilegradientcos0.999966065. Additional temporary randomheadstd0.001 fixture ensures nonzero trunkgradients: allcos0.999967261,enc0.999929597,dec0.999963870; losses0.617865443/0.617864728;114.944255652s incl58.508098071lockwait,compiledcomparison10.392613893s. No optimizerupdates, initialcheckpointhashunchanged, no validation. This second audit addresses zerohead suppressing trunkgradient checks; no new model weights saved. Only queueafteraudits. + +2026-10-23T09:32:37.930781+00:00: E110additional diagnostic scope, selected after viewing48kmain: full-corpus model loses aggregate0.001207851 toE94 but gains long-term0.011237045 and loses monthly0.077135355. Evaluate matched48k and final96k across allfour cutoffs to distinguish stable corpus tradeoffs from cutoff variation. This diagnostic expansion is post-main, not a predeclared48k selection claim. No training change, source mixture adjustment, checkpoint sweep or package automatically selected. ReuseE94cached earlier outputs where available; immutable ownweights only. + +E110 post-main diagnostic expansion 48000 four-cutoff comparison: {"label": "E110 post-main diagnostic expansion 48000 four-cutoff comparison", "utc": "2026-10-23T09:36:31.329060+00:00", "candidate": "random_capacity_full_ema48000", "control": "random_capacity_1024_halflr_ema48000", "rows": [{"cutoff": "evals", "candidate_skill": 0.36449796840324333, "control_skill": 0.36570581958166615, "delta": -0.001207851178422814, "candidate_checkpoint": "926f61e5d5f8ffebc8a5d73285832ebedc28aca794b0b06b55fc3c48a07330d1", "control_checkpoint": "ea9055d683b93a4691e77bd64d46e301302765673055fd9b32ddb3a3e2f749df", "candidate_eval_seconds": 36.223931074142456, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7548553746218293, "rel_wql_gmean": 0.4912987773239935}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7352999993476327, "rel_wql_gmean": 0.504363562451463}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7710300090434509, "rel_wql_gmean": 0.559031484306989}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8770103389279252, "rel_wql_gmean": 0.8491199347133979}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9116653965880178, "rel_wql_gmean": 0.6580222595386767}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.658803814018058, "rel_wql_gmean": 0.5396972664532947}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8280404956337558, "rel_wql_gmean": 0.41423369227737183}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8220888925613495, "rel_wql_gmean": 0.5100769909819354}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6548033152870734, "rel_wql_gmean": 0.45244139184364884}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5808419471264448, "rel_wql_gmean": 0.4489494375356866}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5935959285501078, "rel_wql_gmean": 0.6250048870270299}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7751260416854967, "rel_wql_gmean": 0.5273604629524228}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7390325632700983, "rel_wql_gmean": 0.5118806853040565}, "M": {"n_configs": 5, "rel_mase_gmean": 1.1155244631113046, "rel_wql_gmean": 0.9182662011196825}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7722896053051759, "rel_wql_gmean": 0.8394501877623775}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6682567022663544, "rel_wql_gmean": 0.5122682378733995}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7187462560447286, "rel_wql_gmean": 0.4734288271006955}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8925511740053919, "rel_wql_gmean": 0.6530704845861032}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7303154554027623, "rel_wql_gmean": 0.5275234582063876}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7838594930079051, "rel_wql_gmean": 0.5349400339090976}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7662260094156811, "rel_wql_gmean": 0.5020347958679111}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7301951069360759, "rel_wql_gmean": 0.504117847493669}, "short": {"n_configs": 55, "rel_mase_gmean": 0.760169630057802, "rel_wql_gmean": 0.5569997956352839}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.9028304922158942, "rel_wql_gmean": 0.8610209443587438}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9109454293905939, "rel_wql_gmean": 0.6586383074299472}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5906912914017803, "rel_wql_gmean": 0.5056722543269967}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8235409860259677, "rel_wql_gmean": 0.4231966180830639}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.827511700634232, "rel_wql_gmean": 0.5156149712576104}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6493612164587901, "rel_wql_gmean": 0.44948344031797927}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.579824052847299, "rel_wql_gmean": 0.45322822077685615}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.602630505709834, "rel_wql_gmean": 0.6156602399781036}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7586530974855328, "rel_wql_gmean": 0.5235946298319726}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7435902027632983, "rel_wql_gmean": 0.5180310279395838}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9983606322195729, "rel_wql_gmean": 0.8755961609165552}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.763496329349679, "rel_wql_gmean": 0.8207236971111334}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6652066754808894, "rel_wql_gmean": 0.512126307398621}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7125876645731054, "rel_wql_gmean": 0.4722827561143623}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9331507389139616, "rel_wql_gmean": 0.6806266270092172}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7296537216262745, "rel_wql_gmean": 0.5340631203218278}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7755777292850502, "rel_wql_gmean": 0.5321111949818653}}}, "group_skill_delta": {"term": {"long": 0.011237044940272, "medium": -0.002265482424887666, "short": -0.0058258391281375}, "domain": {"Econ/Fin": 0.018725456927130568, "Energy": 5.6439664597340844e-05, "Healthcare": -0.04975294984969725, "Nature": 0.00469166361832507, "Sales": 0.00564960889904409, "Transport": -0.004041300246997448, "Web/CloudOps": 0.001977896791272138}, "frequency": {"A": 1.254752371049328e-05, "D": -0.00909265869243725, "H": 0.005588956120089361, "M": -0.07713535452581188, "Q": -0.013576920435537154, "S": -0.001417613835157483, "T": -0.003207973776989448, "W": 0.033470593806027016}, "variates": {"multivariate": 0.0035524775192712355, "univariate": -0.005135222886763047}}}, {"cutoff": "backcast_evals", "candidate_skill": 0.32483431257437134, "control_skill": 0.32329458248322396, "delta": 0.0015397300911473843, "candidate_checkpoint": "926f61e5d5f8ffebc8a5d73285832ebedc28aca794b0b06b55fc3c48a07330d1", "control_checkpoint": "ea9055d683b93a4691e77bd64d46e301302765673055fd9b32ddb3a3e2f749df", "candidate_eval_seconds": 37.370967864990234, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7654522360772724, "rel_wql_gmean": 0.4739857610043799}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7867501619830646, "rel_wql_gmean": 0.5436192356255614}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8240571444210427, "rel_wql_gmean": 0.6184264040299636}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8639539622248714, "rel_wql_gmean": 0.8077871872785065}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9041494468294087, "rel_wql_gmean": 0.6855724661240925}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6468533122764599, "rel_wql_gmean": 0.6390448822740527}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9466626972097033, "rel_wql_gmean": 0.45416249215052845}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7353522875674792, "rel_wql_gmean": 0.4922750422813006}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7530847552239457, "rel_wql_gmean": 0.5485269329258957}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6470143656636279, "rel_wql_gmean": 0.45777216999767684}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6301789053201171, "rel_wql_gmean": 0.7072875410242052}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8569709936678673, "rel_wql_gmean": 0.5107766353475411}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7776932406597239, "rel_wql_gmean": 0.5255214537984231}, "M": {"n_configs": 5, "rel_mase_gmean": 0.828753170565434, "rel_wql_gmean": 0.8256815940835853}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7777781646771526, "rel_wql_gmean": 0.8096050460973127}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8492147241676051, "rel_wql_gmean": 0.5041032269855099}, "T": {"n_configs": 30, "rel_mase_gmean": 0.771644671629282, "rel_wql_gmean": 0.6023767893982968}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9077905653975566, "rel_wql_gmean": 0.6022541394206802}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7857285418936958, "rel_wql_gmean": 0.5439370802027981}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.816853590659461, "rel_wql_gmean": 0.5874520532329847}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7676319992042302, "rel_wql_gmean": 0.4738931093823552}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.787981557621373, "rel_wql_gmean": 0.5488845569014533}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8304815248390428, "rel_wql_gmean": 0.6153299503263564}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8906919158031346, "rel_wql_gmean": 0.815058802212814}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9005203573711559, "rel_wql_gmean": 0.6814633675169673}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7168698781265309, "rel_wql_gmean": 0.6527559620133767}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9455002182033782, "rel_wql_gmean": 0.44783907054964206}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7375375880624656, "rel_wql_gmean": 0.4978899167263304}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7505377233731647, "rel_wql_gmean": 0.5469001658409332}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6473059048841175, "rel_wql_gmean": 0.4615460245475256}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6273515476886314, "rel_wql_gmean": 0.6832562579463534}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8500120259463356, "rel_wql_gmean": 0.5045889398131562}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7816347293880959, "rel_wql_gmean": 0.5261467639454889}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8772312560549567, "rel_wql_gmean": 0.8138123688025778}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7744440021373574, "rel_wql_gmean": 0.804919618727554}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8557516272626141, "rel_wql_gmean": 0.5060034785474197}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7662604444194188, "rel_wql_gmean": 0.60071289848602}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9512219248961163, "rel_wql_gmean": 0.6207020251452393}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7837447698899662, "rel_wql_gmean": 0.5425796960618176}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.8264145670475672, "rel_wql_gmean": 0.5877750107029568}}}, "group_skill_delta": {"term": {"long": 0.00079806873263355, "medium": 0.003673565150066782, "short": 0.0009809105784932548}, "domain": {"Econ/Fin": 0.016637880110681125, "Energy": -0.003939895894583545, "Healthcare": 0.04112495194742127, "Nature": -0.004980620952493187, "Sales": 0.004319949784559629, "Transport": -0.002039949363321747, "Web/CloudOps": 0.0023617989214012036}, "frequency": {"A": -0.012913446943112916, "D": -0.006695022913743465, "H": 0.0019991675569802636, "M": 0.0177110499245412, "Q": -0.0039972765419649114, "S": 0.0037501519615081857, "T": -0.0033217139813680463, "W": 0.0289858310621407}, "variates": {"multivariate": -0.0016409852092843513, "univariate": 0.0042337303842436835}}}, {"cutoff": "backcast2_evals", "candidate_skill": 0.3481901439490471, "control_skill": 0.35160470672553856, "delta": -0.0034145627764914366, "candidate_checkpoint": "926f61e5d5f8ffebc8a5d73285832ebedc28aca794b0b06b55fc3c48a07330d1", "control_checkpoint": "ea9055d683b93a4691e77bd64d46e301302765673055fd9b32ddb3a3e2f749df", "candidate_eval_seconds": 35.28667855262756, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7990300880291034, "rel_wql_gmean": 0.50765363537008}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.744574887966418, "rel_wql_gmean": 0.50334233259885}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7819983276666631, "rel_wql_gmean": 0.5798223726752166}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8768293179548019, "rel_wql_gmean": 0.9158306468778579}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9295273892322586, "rel_wql_gmean": 0.6735326890959324}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7222869316179024, "rel_wql_gmean": 0.6164591919160695}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7694576594146011, "rel_wql_gmean": 0.3773009717463544}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5598534258115146, "rel_wql_gmean": 0.352085661402508}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6818685674797765, "rel_wql_gmean": 0.5151817143609804}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6581089009032559, "rel_wql_gmean": 0.4761564052938094}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5771925651869363, "rel_wql_gmean": 0.7935816629616937}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7495293126195988, "rel_wql_gmean": 0.45822217057688214}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7522622180422243, "rel_wql_gmean": 0.4941355673044773}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8471130563718524, "rel_wql_gmean": 0.9071946478247568}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8552359852719164, "rel_wql_gmean": 0.893580181435204}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8914539098869745, "rel_wql_gmean": 0.5530844827396918}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7606045053944909, "rel_wql_gmean": 0.5707137907747936}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8962955229539523, "rel_wql_gmean": 0.6601060960884977}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.779868735152078, "rel_wql_gmean": 0.5297416714631878}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7744270493248896, "rel_wql_gmean": 0.5611510773352295}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.799198836651633, "rel_wql_gmean": 0.5083793454350191}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7463335479874204, "rel_wql_gmean": 0.5011338817462773}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7779454425187887, "rel_wql_gmean": 0.5724055090698651}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.9059392281424482, "rel_wql_gmean": 0.9170498199136256}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9229906908943148, "rel_wql_gmean": 0.6675019661295902}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.734841894341525, "rel_wql_gmean": 0.6116742850572091}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7734543581486872, "rel_wql_gmean": 0.3773819109757366}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5580152105870264, "rel_wql_gmean": 0.346242621272549}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6771185063355508, "rel_wql_gmean": 0.5120273822152274}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6493930915123108, "rel_wql_gmean": 0.4684840829186049}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5757754789323676, "rel_wql_gmean": 0.7506073236864369}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7462412953404897, "rel_wql_gmean": 0.45707742537926555}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7525910334040907, "rel_wql_gmean": 0.49461197896011505}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8578606875633755, "rel_wql_gmean": 0.8985069372104241}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8435114806004179, "rel_wql_gmean": 0.8878177378147762}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9018326086779128, "rel_wql_gmean": 0.5655384541730528}, "T": {"n_configs": 29, "rel_mase_gmean": 0.752029730550723, "rel_wql_gmean": 0.5571977017323565}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9020241622665878, "rel_wql_gmean": 0.6527459993278196}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7720463809279969, "rel_wql_gmean": 0.5224474418278602}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.777356955621124, "rel_wql_gmean": 0.5592327522251774}}}, "group_skill_delta": {"term": {"long": 0.0005223651392513018, "medium": -0.0006235174065178928, "short": -0.00605656169922919}, "domain": {"Econ/Fin": 0.015359767017832149, "Energy": -0.006324840796059439, "Healthcare": 0.003157231118886328, "Nature": 0.001455466939288108, "Sales": -0.004422828276974045, "Transport": -0.0038789385565224377, "Web/CloudOps": -0.008217364695281892}, "frequency": {"A": -0.019388528138355676, "D": -0.002017730886388791, "H": 0.0004271365170432917, "M": 0.0013093377028335906, "Q": -0.008816772643752135, "S": 0.011982848344314734, "T": -0.011528478497626393, "W": -0.0018597105024089622}, "variates": {"multivariate": -0.007649796389442853, "univariate": 0.00011595775125206043}}}, {"cutoff": "backcast3_evals", "candidate_skill": 0.3700641589266448, "control_skill": 0.370990275990027, "delta": -0.0009261170633821925, "candidate_checkpoint": "926f61e5d5f8ffebc8a5d73285832ebedc28aca794b0b06b55fc3c48a07330d1", "control_checkpoint": "ea9055d683b93a4691e77bd64d46e301302765673055fd9b32ddb3a3e2f749df", "candidate_eval_seconds": 36.01489305496216, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7714307837039419, "rel_wql_gmean": 0.4862353117336101}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7638821347775882, "rel_wql_gmean": 0.5307592580855973}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7505608979781686, "rel_wql_gmean": 0.5349992288028624}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8341454143816802, "rel_wql_gmean": 0.8338715773308747}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8515634140277826, "rel_wql_gmean": 0.569558846056249}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 1.0036883931983478, "rel_wql_gmean": 0.7939359543280723}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7284353100394492, "rel_wql_gmean": 0.3541163927462603}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7596670123428141, "rel_wql_gmean": 0.48310093816362193}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5606603701520327, "rel_wql_gmean": 0.4662600653320203}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7196411952930366, "rel_wql_gmean": 0.5292738980605055}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5409193903073758, "rel_wql_gmean": 0.7917996023000913}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7959225789371909, "rel_wql_gmean": 0.45488532912713076}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7327074432980089, "rel_wql_gmean": 0.4985937197066213}, "M": {"n_configs": 4, "rel_mase_gmean": 1.014151462247973, "rel_wql_gmean": 0.9863094244425376}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7189041697429438, "rel_wql_gmean": 0.7579482002697641}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8426818571883371, "rel_wql_gmean": 0.6178592102432287}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7104899807629945, "rel_wql_gmean": 0.47423851084596597}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8247509389073472, "rel_wql_gmean": 0.6824107191878224}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7843110069902741, "rel_wql_gmean": 0.532604424215474}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7372506716076969, "rel_wql_gmean": 0.5168855843039583}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7752169604856247, "rel_wql_gmean": 0.4888518915184839}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7650403788019358, "rel_wql_gmean": 0.5308175670777368}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7467627077568808, "rel_wql_gmean": 0.5327531090955401}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8620913672622541, "rel_wql_gmean": 0.8547318170618328}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8441748859081236, "rel_wql_gmean": 0.5646289945902436}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.9376598848526552, "rel_wql_gmean": 0.7818664221169428}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7456434741968527, "rel_wql_gmean": 0.3539286239241533}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7618130413241728, "rel_wql_gmean": 0.48417506611634803}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5607487049943833, "rel_wql_gmean": 0.46645306914905216}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.716046053229904, "rel_wql_gmean": 0.5316021041051098}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5347671576614936, "rel_wql_gmean": 0.8122502371876661}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8007894976355243, "rel_wql_gmean": 0.45286612793735087}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7340762162135239, "rel_wql_gmean": 0.500516438169534}, "M": {"n_configs": 4, "rel_mase_gmean": 0.9220553371250699, "rel_wql_gmean": 0.9123288561939542}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7146849143809129, "rel_wql_gmean": 0.7593485849767106}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8558536051666373, "rel_wql_gmean": 0.6309694826905562}, "T": {"n_configs": 29, "rel_mase_gmean": 0.711372174563038, "rel_wql_gmean": 0.4773308031413116}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8219606642085736, "rel_wql_gmean": 0.6657419281727769}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7816389778004437, "rel_wql_gmean": 0.5342976538479055}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7370987880405361, "rel_wql_gmean": 0.5143752681169628}}}, "group_skill_delta": {"term": {"long": 0.0031508306340294334, "medium": 0.0005175502310403868, "short": -0.0029336236856895015}, "domain": {"Econ/Fin": 0.024395220415046714, "Energy": -0.00603526299653101, "Healthcare": -0.036445501021621585, "Nature": 0.005827774867388058, "Sales": 0.0015291263619008344, "Transport": 0.0001460946109080874, "Web/CloudOps": -0.00019099449491710718}, "frequency": {"A": 0.00461739459561572, "D": 0.0004958286645164733, "H": 0.0017296683701544247, "M": -0.08295436023909741, "Q": -0.0014897437080618747, "S": 0.01329196518146214, "T": 0.0022508390441152715, "W": -0.010473632248902076}, "variates": {"multivariate": -7.708756783786352e-05, "univariate": -0.0015642852251873673}}}], "mean_delta": -0.0010022002317872647, "positive_cutoffs": 1, "outcome": "Declared comparison checkpoints 48000,96000. No transfer formula or automatic publication is selected by this controller."} + +## E138: learned bounded ensemble gate on frozen E130 members +2026-10-23T09:37:40.524485+00:00: Hypothesis: context statistics and expert disagreement can predict which own-trained member is more reliable, improving on fixed equal quarters. Freeze exactly E130descriptorfa97880dd132b1cdff459be4798f8f360d7df59b13e78026a9d74a95d63df0db and all four expert tensors. Every expert forecasts every instance. Train only a fresh gate MLP29→64→64→4, twoGELUactivations, zero final layer,6340parameters; fixed positive per-lead weights0.125+0.5*softmax(logits), so each lies[0.125,0.625] and sums1. All nine quantiles share each lead's weights. No weight/coefficient sweep or expert updates. Gate features29: log finitecount/8; two log periods/8; log requestedH/8; leadfraction and log lead/8; finitecount/observed-span (exclude left padding); three log normalized mean-absolute differences at lag1/period1/period2 with E47support/default rules; three absolute adjacent-mean differences at widths4/16/128 requiring>=max(2,k/2)finite inbothmeans; perexpert absolute normalized median difference from equal-expert median (4), log1p normalized80percent width(4), absolute median difference from lastfinitecontextvalue(4), and from last32mean(4). Bounded feature transforms, recent4096canonical normalization; no dataset/domain identity feature, no other instance. Exact existing NumPy seasonal/continuity/zero-mass/finite transforms for expert outputs in both training and inference; training per-row available horizons use existing decoder masks. Gate FP32 and frozen expert BF16 with TF32disabled, as package runtime. Initial gate must reproduce equal quarters on real/synthetic fixtures; preserve ordered quantiles and deterministic relocation. +Training planned after E123log_horizon final12000, replacing one allocation: original E80sampler/packed_sample/sourceweights, seed751/B64/LR1e-3/12000, existing400warmup/cosfloor0.2, fusedAdamW(.9,.95),wd0.05,clip1,EMAexistingformula. Supervised targets only allowed corpus/own generator; no distillation labels or validation training. Same weighted quantile-plus-median loss and context seasonal scale; no extra entropy penalty. Primary6000,1000/3000diagnostics,12000durability; all4cutoffs versus frozenE130 at6/12, and then-current publication before any selection. Save complete optimizer/EMA/RNG/prefetched batches; experts never registered in optimizer/EMA. CPUfixture757/GPU761. Implement and audit before queue. Runtime and publication need a separate package that includes the frozen experts, gate and provenance; current submission remains unchanged. No candidate/training launched yet. + +2026-10-23T09:40:45.598974+00:00: E138implementation detail fixed before audits/training: normalized median-distance and adjacent-mean features clip30; width feature log1p(clamp(normalizedwidth,0,60)); lag-difference statistics log1p(clamp(absdiff,0,10)), default1 whenfewer8pairs; allfeaturevalues nan_to_num andclip[0,30]. Canonical recent4096 normalization pads left to16, with original E79normalizer onordinaryvalues; extreme-invalidmu/scale usefinite0/1 fallback. Finite fraction denominator is observed span fromfirstfinite toforecastcutoff, excluding batch-left-padding. Combination uses ordered FP32positive-weight accumulation, thenfinitecleanup andcummaxalongquantiles forroundoff; same operation training/inference. Expert helper uses exact frozen package NumPytransforms, not a differentiable approximation. Core files prepared; no initialgateweights/audit/training yet. + +E129 6000 four-cutoff comparison: {"label": "E129 6000 four-cutoff comparison", "utc": "2026-10-23T09:43:02.720550+00:00", "candidate": "seasonal_width_ema6000", "control": "seasonal_dispersion_ema6000", "rows": [{"cutoff": "evals", "candidate_skill": 0.3831603776984651, "control_skill": 0.38225879938174245, "delta": 0.0009015783167226621, "candidate_checkpoint": "4565c9b6447aab0d457738b65543c5cbee2a90f79e4a87dd9afa7f567aaf685a", "control_checkpoint": "6b640ad1ce200544da2d530578e59eb353f8b9dabc5cc98473403cfe7383c49f", "candidate_eval_seconds": 28.452057600021362, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7401317804403728, "rel_wql_gmean": 0.4766136103886538}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7099436471829155, "rel_wql_gmean": 0.49190059521229146}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7499662116453987, "rel_wql_gmean": 0.5396013043488593}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8875791722920614, "rel_wql_gmean": 0.8559903021736716}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8975039761261759, "rel_wql_gmean": 0.6401064409980725}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5785767170315638, "rel_wql_gmean": 0.5100206072446433}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8021508818788523, "rel_wql_gmean": 0.3970075037303459}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8427232478989891, "rel_wql_gmean": 0.516173636798094}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6323989932515749, "rel_wql_gmean": 0.43099113410972134}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5609720769542301, "rel_wql_gmean": 0.4341063609833436}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6181463973582709, "rel_wql_gmean": 0.6507339136112732}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7607294744792854, "rel_wql_gmean": 0.5213621876812429}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7261758240903428, "rel_wql_gmean": 0.4928362425659036}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9610257004140478, "rel_wql_gmean": 0.8222510272919312}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.783320722154848, "rel_wql_gmean": 0.829193391980513}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6555292549472804, "rel_wql_gmean": 0.5033031593079214}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6919888167355419, "rel_wql_gmean": 0.4527208999963679}, "W": {"n_configs": 8, "rel_mase_gmean": 0.903260761731007, "rel_wql_gmean": 0.670479427208697}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7082974659593699, "rel_wql_gmean": 0.5088761663351993}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7643965343949494, "rel_wql_gmean": 0.5196992592514946}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7400506225960969, "rel_wql_gmean": 0.47808876994740046}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7101268693563747, "rel_wql_gmean": 0.49314710783510285}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7500860933248864, "rel_wql_gmean": 0.5411083364362582}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8886871163750968, "rel_wql_gmean": 0.8551794904776345}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8972051207193078, "rel_wql_gmean": 0.6417640311927593}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.578364137997311, "rel_wql_gmean": 0.5117456137390363}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8023291284024608, "rel_wql_gmean": 0.3989034387003474}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8416251755891729, "rel_wql_gmean": 0.5159970993971862}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6323129527317001, "rel_wql_gmean": 0.4332903678255558}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5615569274522425, "rel_wql_gmean": 0.43470539309584183}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6177358739303225, "rel_wql_gmean": 0.6470843841362995}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7613833385246014, "rel_wql_gmean": 0.5227797118737059}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7261807487698988, "rel_wql_gmean": 0.4956422642796265}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9602049092528727, "rel_wql_gmean": 0.8288042520798957}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7839745097436424, "rel_wql_gmean": 0.8298460141507311}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6554424134583847, "rel_wql_gmean": 0.5033779169908231}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6921043444047297, "rel_wql_gmean": 0.45319095997947384}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9031138478320136, "rel_wql_gmean": 0.6694602750281545}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7086008455661859, "rel_wql_gmean": 0.5102395060491531}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7643044334835595, "rel_wql_gmean": 0.5212065466992852}}}, "group_skill_delta": {"term": {"long": 0.0008858124146893243, "medium": 0.0008246293831415397, "short": 0.0009386285567822839}, "domain": {"Econ/Fin": 0.00013068122954484895, "Energy": 0.0008543822424174063, "Healthcare": 0.0008178971143827374, "Nature": 0.001408719730444874, "Sales": -0.0005425522983093511, "Transport": 0.0013550988926180896, "Web/CloudOps": 0.0005977160740209264}, "frequency": {"A": -0.0019910343743771985, "D": 0.0011265229391850262, "H": 0.0017026795855628052, "M": 0.0031541100335809036, "Q": 0.0006534857098969837, "S": 4.606356713177107e-06, "T": 0.0003372434812615177, "W": -0.000654923649645367}, "variates": {"multivariate": 0.0009324167005572148, "univariate": 0.000875317916272933}}}, {"cutoff": "backcast_evals", "candidate_skill": 0.3412465968938221, "control_skill": 0.34048229409326713, "delta": 0.0007643028005549501, "candidate_checkpoint": "4565c9b6447aab0d457738b65543c5cbee2a90f79e4a87dd9afa7f567aaf685a", "control_checkpoint": "6b640ad1ce200544da2d530578e59eb353f8b9dabc5cc98473403cfe7383c49f", "candidate_eval_seconds": 28.581611156463623, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7703378422663418, "rel_wql_gmean": 0.46078608846829733}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7698204801258983, "rel_wql_gmean": 0.5298063248192315}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8116946984363662, "rel_wql_gmean": 0.591096395267947}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8840896172674156, "rel_wql_gmean": 0.8166116323804048}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8877976324574343, "rel_wql_gmean": 0.6655471766191752}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6603789214388155, "rel_wql_gmean": 0.566295641779891}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9061232280904533, "rel_wql_gmean": 0.4211354757782516}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7234756545220536, "rel_wql_gmean": 0.4901133073734373}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7310010585990251, "rel_wql_gmean": 0.5212183995094899}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6586290512783582, "rel_wql_gmean": 0.452861684924056}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.65209515758716, "rel_wql_gmean": 0.7285952892015877}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8208196574267836, "rel_wql_gmean": 0.48847822436902455}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7664815515194227, "rel_wql_gmean": 0.5059676547535986}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8689281957906105, "rel_wql_gmean": 0.794920967030779}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7592445698251972, "rel_wql_gmean": 0.7638082257229809}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8532703653418005, "rel_wql_gmean": 0.5072000942524026}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7706738261523969, "rel_wql_gmean": 0.5752670274035184}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8748739987149731, "rel_wql_gmean": 0.5865464292807087}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7867476548525202, "rel_wql_gmean": 0.5267846995784454}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7987490424547307, "rel_wql_gmean": 0.5635638286829712}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7699386641350829, "rel_wql_gmean": 0.4620092164574338}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7700252574476023, "rel_wql_gmean": 0.5312660160823937}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8114763680106447, "rel_wql_gmean": 0.5925124306653264}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8851214996579603, "rel_wql_gmean": 0.81706534284058}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8880075540028629, "rel_wql_gmean": 0.6669917238344288}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6607679512516224, "rel_wql_gmean": 0.5676047563389465}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9044039298942245, "rel_wql_gmean": 0.4227147422454011}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7233763880081109, "rel_wql_gmean": 0.49051933957001853}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7306764832685102, "rel_wql_gmean": 0.5237199503158482}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6585663042744694, "rel_wql_gmean": 0.453530474116577}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6519157656498028, "rel_wql_gmean": 0.7264149528026873}, "D": {"n_configs": 15, "rel_mase_gmean": 0.820638386519995, "rel_wql_gmean": 0.48899927341307703}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7669137207994428, "rel_wql_gmean": 0.5089765668356441}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8681664151706637, "rel_wql_gmean": 0.7970725004451346}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7591685936267477, "rel_wql_gmean": 0.7657209715884332}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8528003711266274, "rel_wql_gmean": 0.5088102011002493}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7701790682032242, "rel_wql_gmean": 0.57528943509888}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8741170955888644, "rel_wql_gmean": 0.5874303282064617}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7864590781265922, "rel_wql_gmean": 0.5275771051125318}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.798685143563512, "rel_wql_gmean": 0.5654498581714905}}}, "group_skill_delta": {"term": {"long": 0.0006356256917187109, "medium": 0.0009642128129954131, "short": 0.0007359098911582374}, "domain": {"Econ/Fin": 0.00073186311553608, "Energy": 0.0009247175050326462, "Healthcare": 0.0008867426062801886, "Nature": 0.0005697499193413336, "Sales": 0.00020573643967503052, "Transport": 0.001342097068590009, "Web/CloudOps": 0.000377087225496342}, "frequency": {"A": -0.0011267980889990703, "D": 0.0002676642157174447, "H": 0.0020250082092524435, "M": 0.0007590877118247574, "Q": 0.0009147646145672983, "S": 0.0008618680731700135, "T": -0.00020079915287640748, "W": 0.0002293716185552963}, "variates": {"multivariate": 0.0003658441739100571, "univariate": 0.0010948501022474133}}}, {"cutoff": "backcast2_evals", "candidate_skill": 0.3644066589741426, "control_skill": 0.363993152824157, "delta": 0.00041350614998558743, "candidate_checkpoint": "4565c9b6447aab0d457738b65543c5cbee2a90f79e4a87dd9afa7f567aaf685a", "control_checkpoint": "6b640ad1ce200544da2d530578e59eb353f8b9dabc5cc98473403cfe7383c49f", "candidate_eval_seconds": 26.675612211227417, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7961637137411435, "rel_wql_gmean": 0.5007940348863654}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7484221381570295, "rel_wql_gmean": 0.485156960968829}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7617928321348254, "rel_wql_gmean": 0.5553202191044332}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8983375494012568, "rel_wql_gmean": 0.9111196456378068}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8970999925485309, "rel_wql_gmean": 0.6465759688739209}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6900039445090415, "rel_wql_gmean": 0.5873506576265198}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.753971127095037, "rel_wql_gmean": 0.35660829387334064}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.559306557818693, "rel_wql_gmean": 0.35840925915226857}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6609125705540779, "rel_wql_gmean": 0.4922875880959694}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6788931301438412, "rel_wql_gmean": 0.46737025685144046}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5819217025358413, "rel_wql_gmean": 0.7362151675065224}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7263619812328097, "rel_wql_gmean": 0.44648252900082386}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7489365313492822, "rel_wql_gmean": 0.4825391145611769}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8068542040559062, "rel_wql_gmean": 0.8311865589547313}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8304298982253768, "rel_wql_gmean": 0.8709755134471618}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9042383200336376, "rel_wql_gmean": 0.5635594174773026}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7542243885634808, "rel_wql_gmean": 0.5386059549725625}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8531264230830305, "rel_wql_gmean": 0.6402967795704403}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7793372878914676, "rel_wql_gmean": 0.5133124388244873}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7546525685383496, "rel_wql_gmean": 0.5395671141334875}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7965511154806201, "rel_wql_gmean": 0.5034490772862287}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7475606718658245, "rel_wql_gmean": 0.48624034441677194}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7612052477427849, "rel_wql_gmean": 0.5556449965470085}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.89958164144685, "rel_wql_gmean": 0.9115144320697872}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.896485898505093, "rel_wql_gmean": 0.6474484136174568}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6888981722703484, "rel_wql_gmean": 0.5885334564659844}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7520768524740646, "rel_wql_gmean": 0.3570202752625398}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5587359331147982, "rel_wql_gmean": 0.35793010096876227}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.660805281297565, "rel_wql_gmean": 0.49469607344952504}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6791821336817456, "rel_wql_gmean": 0.46839071952339456}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5812757221445022, "rel_wql_gmean": 0.7331639098314356}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7257815402854406, "rel_wql_gmean": 0.44620200724347436}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7487818727109079, "rel_wql_gmean": 0.48427195356442543}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8071916126513461, "rel_wql_gmean": 0.8356014190262583}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8308749825896053, "rel_wql_gmean": 0.8716517553922709}, "S": {"n_configs": 6, "rel_mase_gmean": 0.904213435588803, "rel_wql_gmean": 0.5675780199167809}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7537381736791354, "rel_wql_gmean": 0.539091137142719}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8509266671504966, "rel_wql_gmean": 0.6398335731372661}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7792766449889658, "rel_wql_gmean": 0.5144707856195212}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7538788385219328, "rel_wql_gmean": 0.5404416000493212}}}, "group_skill_delta": {"term": {"long": 0.0018256362898133593, "medium": 0.00032513775489051433, "short": -6.0791157643347304e-05}, "domain": {"Econ/Fin": 0.0008223572185477313, "Energy": 0.0002527633729961787, "Healthcare": 0.0001298555167734694, "Nature": -0.00035272546643028146, "Sales": -0.0005276844252504187, "Transport": 0.001347213227943067, "Web/CloudOps": 0.0007346247241569737}, "frequency": {"A": -0.0017204222675391012, "D": -0.00040644018907909363, "H": 0.0010162523283209213, "M": 0.002343664706180748, "Q": 0.0005580611792563861, "S": 0.0025307903614832927, "T": 8.14415756567044e-05, "W": -0.0012205150129873665}, "variates": {"multivariate": 0.0006886035795363732, "univariate": 0.00018941944022621282}}}, {"cutoff": "backcast3_evals", "candidate_skill": 0.3961657067203871, "control_skill": 0.3950124598405723, "delta": 0.0011532468798147733, "candidate_checkpoint": "4565c9b6447aab0d457738b65543c5cbee2a90f79e4a87dd9afa7f567aaf685a", "control_checkpoint": "6b640ad1ce200544da2d530578e59eb353f8b9dabc5cc98473403cfe7383c49f", "candidate_eval_seconds": 26.97839665412903, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7600822781889456, "rel_wql_gmean": 0.47156145703998736}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7672561850318086, "rel_wql_gmean": 0.5262698059262596}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7060643596741657, "rel_wql_gmean": 0.5002597010370469}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8435836894499562, "rel_wql_gmean": 0.8286522484966601}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8286134000476382, "rel_wql_gmean": 0.552199267649125}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7590223214303585, "rel_wql_gmean": 0.6285189373705079}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7073540721342023, "rel_wql_gmean": 0.3344540092898926}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.749361533677848, "rel_wql_gmean": 0.4742470990102958}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5361846691866137, "rel_wql_gmean": 0.44176777190687744}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7123442250159027, "rel_wql_gmean": 0.5143913685997483}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5305604036884269, "rel_wql_gmean": 0.779803421151957}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7107983893316233, "rel_wql_gmean": 0.4137604149503069}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7200755579098317, "rel_wql_gmean": 0.4812770795680051}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8335078176436748, "rel_wql_gmean": 0.8183553058482521}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.715305611813047, "rel_wql_gmean": 0.768650862326446}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8362260390859402, "rel_wql_gmean": 0.5930371374430102}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7050883321055527, "rel_wql_gmean": 0.4629634772372099}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8027681335712222, "rel_wql_gmean": 0.6622988737579344}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7582430169224578, "rel_wql_gmean": 0.5101819672871283}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7079647802504616, "rel_wql_gmean": 0.4915435820229081}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7599778232892921, "rel_wql_gmean": 0.47414979341796676}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7672348822762877, "rel_wql_gmean": 0.5287703093503114}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7061176910432736, "rel_wql_gmean": 0.501699365937218}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8450238929299057, "rel_wql_gmean": 0.8287968523167164}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8287237417525989, "rel_wql_gmean": 0.5534837186870216}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7575935562899834, "rel_wql_gmean": 0.6315003633340103}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7076556931072816, "rel_wql_gmean": 0.3366919094754201}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7497066029652214, "rel_wql_gmean": 0.47462593240681566}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5363319189417703, "rel_wql_gmean": 0.44423886834819754}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.71171989190133, "rel_wql_gmean": 0.5165221199292769}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5305049486199563, "rel_wql_gmean": 0.7748462903644002}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7121431317868887, "rel_wql_gmean": 0.4145144835788314}, "H": {"n_configs": 29, "rel_mase_gmean": 0.719562525136373, "rel_wql_gmean": 0.48383364301897663}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8317622022092529, "rel_wql_gmean": 0.8214020589097163}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7154303032341603, "rel_wql_gmean": 0.7695070959424496}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8351733673081517, "rel_wql_gmean": 0.5991170712501708}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7049645906490642, "rel_wql_gmean": 0.4635720688691023}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8041936712430771, "rel_wql_gmean": 0.6676297088347317}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7580934176036076, "rel_wql_gmean": 0.5121324030131259}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.708087351250063, "rel_wql_gmean": 0.49341443724470835}}}, "group_skill_delta": {"term": {"long": 0.0015995540392709229, "medium": 0.0014989739965263205, "short": 0.0008770395154084065}, "domain": {"Econ/Fin": 0.0007864054919420882, "Energy": 0.0008313438803890794, "Healthcare": 0.0009843228945447535, "Nature": 0.0017285978088057985, "Sales": 0.0003753492055548202, "Transport": 0.0014263063002810106, "Web/CloudOps": 0.0009865481512651986}, "frequency": {"A": -0.00208121262018246, "D": 0.0010071651112283364, "H": 0.0013511956487944898, "M": 0.0006690864341446501, "Q": 0.0004775407083540406, "S": 0.0031550000420319524, "T": 0.0003252367850553606, "W": 0.0035783370798538883}, "variates": {"multivariate": 0.0011262840063563928, "univariate": 0.001172720569471708}}}], "mean_delta": 0.0008081585367694932, "positive_cutoffs": 4, "outcome": "Declared primary6000/durability12000 diagnostic. No transfer formula or automatic publication is selected by this controller."} + +## E139: transfer the matched direct-width-head learning difference +2026-10-23T09:45:05.586904+00:00: E129primary6000 improves allfour matched E119cutoffs, deltas+0.000901578317/+0.000764302801/+0.000413506150/+0.001153246880,mean+0.000808158537. Fixed candidate first member=zero_extend(E117final first)+E129n-zero_extend(E119n), coefficient1, n6000primary and12000predeclared durability. E117 is extended with zero dispersion_query and width_head; E119 is extended only with zero width_head. Thus this transfers the matched width treatment, NOT the rejected E128dispersion correction; dispersion_query receives only its E129-minus-E119 difference. Othermembers frozen E71/E93/E79wide48000, equal quarters, everymemberforecastsallinstances. Match allfour diagnostics against E130; require3positive/meanpositive beforefull replay and improved full score plusallpackagechecks beforepublication. If12k E129matched replication comparison passes3of4/meanpositive, constructone12kdurability candidate; no coefficient/schedule sweep. Mergefixture769,0optimizerupdates; model/sourcecode seasonal_width. Declared before transfer diagnostics and before E12912k results. No publication yet. + +E123 logarithmic requested horizons seed197 training started at 2026-10-23T09:46:52Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +## E139 width-treatment transfer6000 valid_screen +- Checkpoint SHA-256: `82d50d0b2f7abfb963562f5f7966644b05612a49725f066392c022ccd6ba18ca`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 29.684224367141724 seconds. +- Overall skill 0.387281; relative MASE 0.733506; relative WQL 0.511821. +- term skill: long=0.4089, medium=0.4104, short=0.3696. +- domain skill: Econ/Fin=0.1462, Energy=0.2423, Healthcare=0.4723, Nature=0.4455, Sales=0.3387, Transport=0.4749, Web/CloudOps=0.5115. +- frequency skill: A=0.3746, D=0.3745, H=0.4081, M=0.1014, Q=0.2067, S=0.4255, T=0.4442, W=0.2252. +- variates skill: multivariate=0.4019, univariate=0.3754. +- Outcome: Fixed zero-extended E117first + E129 - zero-extended E119, coefficient1. No E128dispersion correction; no optimizer update. Equal-quarter ensemble selected separately. + +## E139 width-treatment transfer6000 valid_backcast +- Checkpoint SHA-256: `82d50d0b2f7abfb963562f5f7966644b05612a49725f066392c022ccd6ba18ca`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 24.04444932937622 seconds. +- Overall skill 0.343524; relative MASE 0.788892; relative WQL 0.546286. +- term skill: long=0.3997, medium=0.3643, short=0.3123. +- domain skill: Econ/Fin=0.1778, Energy=0.2298, Healthcare=0.3716, Nature=0.3921, Sales=0.4041, Transport=0.3809, Web/CloudOps=0.4578. +- frequency skill: A=0.3222, D=0.3623, H=0.3789, M=0.1952, Q=0.2314, S=0.3395, T=0.3376, W=0.2891. +- variates skill: multivariate=0.3587, univariate=0.3312. +- Outcome: Fixed zero-extended E117first + E129 - zero-extended E119, coefficient1. No E128dispersion correction; no optimizer update. Equal-quarter ensemble selected separately. + +## E139 width-treatment transfer6000 valid_backcast2 +- Checkpoint SHA-256: `82d50d0b2f7abfb963562f5f7966644b05612a49725f066392c022ccd6ba18ca`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 28.53399968147278 seconds. +- Overall skill 0.365608; relative MASE 0.764906; relative WQL 0.526148. +- term skill: long=0.3726, medium=0.3943, short=0.3516. +- domain skill: Econ/Fin=0.1343, Energy=0.2391, Healthcare=0.3004, Nature=0.4850, Sales=0.5506, Transport=0.4291, Web/CloudOps=0.4448. +- frequency skill: A=0.3474, D=0.4277, H=0.4001, M=0.1476, Q=0.1544, S=0.2867, T=0.3700, W=0.2611. +- variates skill: multivariate=0.3717, univariate=0.3607. +- Outcome: Fixed zero-extended E117first + E129 - zero-extended E119, coefficient1. No E128dispersion correction; no optimizer update. Equal-quarter ensemble selected separately. + +## E139 width-treatment transfer6000 valid_backcast3 +- Checkpoint SHA-256: `82d50d0b2f7abfb963562f5f7966644b05612a49725f066392c022ccd6ba18ca`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 27.095674514770508 seconds. +- Overall skill 0.392582; relative MASE 0.738306; relative WQL 0.499735. +- term skill: long=0.3971, medium=0.3650, short=0.4009. +- domain skill: Econ/Fin=0.1858, Energy=0.3244, Healthcare=0.2332, Nature=0.5013, Sales=0.4069, Transport=0.5171, Web/CloudOps=0.3956. +- frequency skill: A=0.3609, D=0.4501, H=0.4099, M=0.1413, Q=0.2642, S=0.2792, T=0.4330, W=0.2513. +- variates skill: multivariate=0.3762, univariate=0.4052. +- Outcome: Fixed zero-extended E117first + E129 - zero-extended E119, coefficient1. No E128dispersion correction; no optimizer update. Equal-quarter ensemble selected separately. + +E139 fixed width-treatment equal-quarter ensemble diagnostics: {"duration": 6, "rows": [{"cutoff": "valid_screen", "skill": 0.3880317541577587, "control_skill": 0.3878507268780589, "delta": 0.00018102727969981913, "groups": {"term": {"short": 0.37174692534094356, "medium": 0.4104634567232286, "long": 0.40697243288781937}, "domain": {"Econ/Fin": 0.14882625072549704, "Energy": 0.24798215465423723, "Healthcare": 0.4800533641456496, "Nature": 0.4434996766578704, "Sales": 0.34247960895884155, "Transport": 0.47319081725353807, "Web/CloudOps": 0.5082390957555601}, "freq": {"A-DEC": 0.3831377797724955, "Q-DEC": 0.20484619744979937, "M": 0.12322323211250241, "W-SUN": 0.09482411725596462, "D": 0.3725900248579562, "H": 0.4026924018136455, "15T": 0.21607087174951745, "W-FRI": 0.019077364661426954, "10T": 0.6269864195810371, "W-TUE": 0.6126385479039982, "W-THU": 0.2269308168035562, "W-WED": 0.3226025717551765, "5T": 0.5238937427115736, "10S": 0.4235713253665808}}, "member_checkpoint_hashes": ["82d50d0b2f7abfb963562f5f7966644b05612a49725f066392c022ccd6ba18ca", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c"], "cpu_seconds": 2.101605588104576}, {"cutoff": "valid_backcast", "skill": 0.344700271930117, "control_skill": 0.34441110518308204, "delta": 0.0002891667470349413, "groups": {"term": {"short": 0.3123733008633256, "medium": 0.36351525826300657, "long": 0.40526909392977606}, "domain": {"Econ/Fin": 0.181371267409558, "Energy": 0.2355355115933655, "Healthcare": 0.4030193353550149, "Nature": 0.3795061657337149, "Sales": 0.407313911098664, "Transport": 0.3765089548038, "Web/CloudOps": 0.458989917661899}, "freq": {"A-DEC": 0.3349878164520893, "Q-DEC": 0.23292707808388236, "M": 0.197277759105973, "W-SUN": 0.05555987771454296, "D": 0.3621218591136165, "H": 0.3755645150692771, "15T": 0.22371892670670057, "W-FRI": 0.23921873033237973, "10T": 0.33344297150578384, "W-TUE": 0.5282042216778233, "W-THU": 0.2698543998117874, "W-WED": 0.3579008773064647, "5T": 0.4461284480238702, "10S": 0.3494794048194889}}, "member_checkpoint_hashes": ["82d50d0b2f7abfb963562f5f7966644b05612a49725f066392c022ccd6ba18ca", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c"], "cpu_seconds": 2.001161159016192}, {"cutoff": "valid_backcast2", "skill": 0.36868215125404136, "control_skill": 0.3685168155758046, "delta": 0.00016533567823673323, "groups": {"term": {"short": 0.3556510051989389, "medium": 0.3974721406909896, "long": 0.37275885646173146}, "domain": {"Econ/Fin": 0.1278350538167331, "Energy": 0.23989795894300459, "Healthcare": 0.36838771510735646, "Nature": 0.48237820683547394, "Sales": 0.5594074671789011, "Transport": 0.4268006508532327, "Web/CloudOps": 0.445710680939873}, "freq": {"A-DEC": 0.33817984357736863, "Q-DEC": 0.15210503488267746, "M": 0.17014378963809718, "W-SUN": 0.07856710253311194, "D": 0.4355973489550169, "H": 0.39996514193799704, "15T": 0.10556312446452143, "W-FRI": 0.15709622875745466, "10T": 0.5102288772231318, "W-TUE": 0.17252394296174955, "W-THU": 0.33373945734680255, "W-WED": 0.5583406030346321, "5T": 0.47724901525129293, "10S": 0.2913050773916448}}, "member_checkpoint_hashes": ["82d50d0b2f7abfb963562f5f7966644b05612a49725f066392c022ccd6ba18ca", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c"], "cpu_seconds": 2.130388882011175}, {"cutoff": "valid_backcast3", "skill": 0.39170266078452043, "control_skill": 0.3912834616582097, "delta": 0.00041919912631072087, "groups": {"term": {"short": 0.39670715103336707, "medium": 0.37262791492099, "long": 0.3971661588967441}, "domain": {"Econ/Fin": 0.18899820568391779, "Energy": 0.31993369866181876, "Healthcare": 0.23581997212058814, "Nature": 0.5089980057615181, "Sales": 0.3990322628469123, "Transport": 0.5095836076719016, "Web/CloudOps": 0.3974158416525724}, "freq": {"A-DEC": 0.35311095791291525, "Q-DEC": 0.2617586514931013, "M": 0.14978985778396314, "W-SUN": 0.17046968017254482, "D": 0.4417285783653847, "H": 0.4077405117239663, "15T": 0.26309995341217174, "W-FRI": 0.04575059601407794, "10T": 0.6023021299968281, "W-TUE": 0.28116664140750425, "W-THU": 0.3527749294198317, "W-WED": 0.3653636163804277, "5T": 0.4692890959676005, "10S": 0.28864130736535976}}, "member_checkpoint_hashes": ["82d50d0b2f7abfb963562f5f7966644b05612a49725f066392c022ccd6ba18ca", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c"], "cpu_seconds": 2.0130097379442304}], "positive_cutoffs": 4, "mean_delta": 0.0002636822078205536, "selection_gate_passed": true}. Full replay/runtime checks and comparison to current publication required before any promotion. + +E118 12000 four-cutoff comparison: {"label": "E118 12000 four-cutoff comparison", "utc": "2026-10-23T09:50:18.814803+00:00", "candidate": "long_seasonal_replication_ema12000", "control": "weekly_replication_control_ema12000", "rows": [{"cutoff": "evals", "candidate_skill": 0.38143987517227207, "control_skill": 0.37650125931885015, "delta": 0.004938615853421924, "candidate_checkpoint": "db021fe2a29e80abf906556b2e3627f61128cedc984c852d63ca9bc7d8af4c42", "control_checkpoint": "dc03098da92746d3974cdb5fd3df955a8b52e689260f1fdcd0dd7b63a91fe17e", "candidate_eval_seconds": 28.141856908798218, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7387209289896919, "rel_wql_gmean": 0.4774699824212779}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7091967584947031, "rel_wql_gmean": 0.4940210001993474}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7510955101931623, "rel_wql_gmean": 0.543458407121595}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8758458401723871, "rel_wql_gmean": 0.845741731640819}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8971412759810176, "rel_wql_gmean": 0.645625775233746}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5890257461069864, "rel_wql_gmean": 0.5230728329155893}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8000033466582953, "rel_wql_gmean": 0.39604235705150814}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8575403415794559, "rel_wql_gmean": 0.5227534654265664}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.632302339335103, "rel_wql_gmean": 0.4326881039752555}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5608783032250865, "rel_wql_gmean": 0.4366719960689385}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6142099083816193, "rel_wql_gmean": 0.6417141201697275}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7560740428216003, "rel_wql_gmean": 0.5191076131947409}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7249774072939693, "rel_wql_gmean": 0.4950309821495769}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9868972926114846, "rel_wql_gmean": 0.8492660442835309}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7750580859699931, "rel_wql_gmean": 0.8210487526626195}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6555272835229642, "rel_wql_gmean": 0.5036801719831989}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6911027159279228, "rel_wql_gmean": 0.4542264629034677}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9130790737285582, "rel_wql_gmean": 0.6878939835146572}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7084528048450579, "rel_wql_gmean": 0.5121287241091885}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.764554441506531, "rel_wql_gmean": 0.5220703038894595}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7423258223657083, "rel_wql_gmean": 0.4798378587550141}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7111249588305558, "rel_wql_gmean": 0.49538817078279485}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7597756683365868, "rel_wql_gmean": 0.549315763341069}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8762263674617405, "rel_wql_gmean": 0.8476913606765002}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8987732108050124, "rel_wql_gmean": 0.6471334751576476}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5948687348643393, "rel_wql_gmean": 0.5267177864306672}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8128769118735754, "rel_wql_gmean": 0.39851840033548724}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8620781263218368, "rel_wql_gmean": 0.5254552749363837}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6453101528855447, "rel_wql_gmean": 0.44256597733622044}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5641150034309002, "rel_wql_gmean": 0.4405242882875604}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6139497813449873, "rel_wql_gmean": 0.6412697752176224}, "D": {"n_configs": 15, "rel_mase_gmean": 0.777666349767693, "rel_wql_gmean": 0.5322826373815059}, "H": {"n_configs": 31, "rel_mase_gmean": 0.731819244718065, "rel_wql_gmean": 0.49938279418453085}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9893475338694124, "rel_wql_gmean": 0.8514023810064989}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.776277696224593, "rel_wql_gmean": 0.8210565395309606}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6563690273254504, "rel_wql_gmean": 0.5051017721981628}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6923405331571078, "rel_wql_gmean": 0.45563442430764384}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9133906475951029, "rel_wql_gmean": 0.6864010897148384}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.711455836842964, "rel_wql_gmean": 0.5141081604537986}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7732304940182492, "rel_wql_gmean": 0.527763230728218}}}, "group_skill_delta": {"term": {"long": 0.002921727836160626, "medium": 0.0016236948456626044, "short": 0.007134702454007158}, "domain": {"Econ/Fin": 0.0011786012776597854, "Energy": 0.0015808147151352703, "Healthcare": 0.004686444258784839, "Nature": 0.006281730298146715, "Sales": 0.0035017027828952996, "Transport": 0.011350354056935519, "Web/CloudOps": 0.0036103480659039344}, "frequency": {"A": -0.0003503085363084635, "D": 0.01689509763954522, "H": 0.005459993728574308, "M": 0.0022879607474108887, "Q": 0.0006311758982900928, "S": 0.0011796467091428342, "T": 0.0013699871107134554, "W": -0.0007253944057105111}, "variates": {"multivariate": 0.0024406822113531845, "univariate": 0.0070293334740128}}}, {"cutoff": "backcast_evals", "candidate_skill": 0.34061463661902625, "control_skill": 0.3358947343072791, "delta": 0.004719902311747126, "candidate_checkpoint": "db021fe2a29e80abf906556b2e3627f61128cedc984c852d63ca9bc7d8af4c42", "control_checkpoint": "dc03098da92746d3974cdb5fd3df955a8b52e689260f1fdcd0dd7b63a91fe17e", "candidate_eval_seconds": 27.59094738960266, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7750268330437599, "rel_wql_gmean": 0.4644560374641174}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7679120729474597, "rel_wql_gmean": 0.532394538078516}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8092756122575947, "rel_wql_gmean": 0.5911601826351884}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8702947344890727, "rel_wql_gmean": 0.8118690049288639}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8884350933535451, "rel_wql_gmean": 0.6689071279929406}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6515290315444144, "rel_wql_gmean": 0.563052922379826}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.907676767267535, "rel_wql_gmean": 0.42467410221988056}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.720975234361949, "rel_wql_gmean": 0.4895136768781546}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7270314164655985, "rel_wql_gmean": 0.5204684797693607}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6625872075319881, "rel_wql_gmean": 0.45463965086023306}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.632069475406581, "rel_wql_gmean": 0.7112871545588219}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8195362583004446, "rel_wql_gmean": 0.4869333945501284}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7688964365638882, "rel_wql_gmean": 0.5089763528043773}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8498680901287304, "rel_wql_gmean": 0.7847522400534784}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7621120511536175, "rel_wql_gmean": 0.7673010164835131}, "S": {"n_configs": 6, "rel_mase_gmean": 0.85496425984934, "rel_wql_gmean": 0.5068421260836785}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7701880585359794, "rel_wql_gmean": 0.5769571066612549}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8729561696964779, "rel_wql_gmean": 0.5968019939540741}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7899758227963615, "rel_wql_gmean": 0.529207227131104}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7948399949221965, "rel_wql_gmean": 0.5643740247582992}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7790696804591536, "rel_wql_gmean": 0.4675903653980333}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7721877709531506, "rel_wql_gmean": 0.5359033743134146}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8157056524541806, "rel_wql_gmean": 0.595945142576227}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8702083459344165, "rel_wql_gmean": 0.8095153005807372}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8915064371785775, "rel_wql_gmean": 0.6716980091534934}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6240249575542719, "rel_wql_gmean": 0.5402160092228716}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.935694134093894, "rel_wql_gmean": 0.4349550600914482}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7315038063745323, "rel_wql_gmean": 0.4978004030239261}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.735787693330345, "rel_wql_gmean": 0.5289930405755158}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6650226795797447, "rel_wql_gmean": 0.45792804555178057}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6325356225251678, "rel_wql_gmean": 0.7103481618244573}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8394331932394111, "rel_wql_gmean": 0.4979820769791658}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7778562933336808, "rel_wql_gmean": 0.5158436068239591}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8454913331318379, "rel_wql_gmean": 0.7816333262802584}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7629077893451893, "rel_wql_gmean": 0.7702380946329767}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8544025093684732, "rel_wql_gmean": 0.5071247498858551}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7689059517346652, "rel_wql_gmean": 0.5775992603673705}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8751544074195073, "rel_wql_gmean": 0.5931769268978029}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7925885195053555, "rel_wql_gmean": 0.5316423918477458}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.8025184091177678, "rel_wql_gmean": 0.5698895064907624}}}, "group_skill_delta": {"term": {"long": 0.0035890893532852797, "medium": 0.003887027467982529, "short": 0.005547081250184327}, "domain": {"Econ/Fin": -0.0012610064603308935, "Energy": 0.0029406593819746307, "Healthcare": -0.02506731684725938, "Nature": 0.01709394079797677, "Sales": 0.009365737541987995, "Transport": 0.008740482680035688, "Web/CloudOps": 0.002992758665532058}, "frequency": {"A": -0.00019568717236961852, "D": 0.014835117409109921, "H": 0.007864892077899865, "M": -0.0037258810104657814, "Q": 0.0018620474427203382, "S": -3.284729439079204e-05, "T": -0.00018451554590293018, "W": -0.0012900170359010366}, "variates": {"multivariate": 0.0025567012317949667, "univariate": 0.006507807373265728}}}, {"cutoff": "backcast2_evals", "candidate_skill": 0.3634886085731699, "control_skill": 0.35985891378123624, "delta": 0.0036296947919336464, "candidate_checkpoint": "db021fe2a29e80abf906556b2e3627f61128cedc984c852d63ca9bc7d8af4c42", "control_checkpoint": "dc03098da92746d3974cdb5fd3df955a8b52e689260f1fdcd0dd7b63a91fe17e", "candidate_eval_seconds": 28.65201234817505, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7979339375294328, "rel_wql_gmean": 0.5031687023634543}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7517105222461405, "rel_wql_gmean": 0.4892541087028114}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7609992194334069, "rel_wql_gmean": 0.5545688770684942}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8873807551276736, "rel_wql_gmean": 0.9093265549869165}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8956398235921643, "rel_wql_gmean": 0.6483653832582555}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6952661999275426, "rel_wql_gmean": 0.5936962934257054}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.761731002314024, "rel_wql_gmean": 0.35442280401471654}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5539411001711044, "rel_wql_gmean": 0.35520389573354616}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.659555354887592, "rel_wql_gmean": 0.49395721637685036}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6813938014578171, "rel_wql_gmean": 0.47069748314484394}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5794197948834124, "rel_wql_gmean": 0.7245475951431574}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7206962810623505, "rel_wql_gmean": 0.44288001392257026}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7532809555218374, "rel_wql_gmean": 0.48608171516723486}, "M": {"n_configs": 4, "rel_mase_gmean": 0.7940742107722347, "rel_wql_gmean": 0.8263573179324762}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8266970748771869, "rel_wql_gmean": 0.8663850701039977}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9067302485516102, "rel_wql_gmean": 0.5663452379244183}, "T": {"n_configs": 29, "rel_mase_gmean": 0.755670252212079, "rel_wql_gmean": 0.5405076823867628}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8555340530410969, "rel_wql_gmean": 0.6409546763971603}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7822914405953071, "rel_wql_gmean": 0.5150446640209236}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7534790730878452, "rel_wql_gmean": 0.5401056636501812}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.8013559838363913, "rel_wql_gmean": 0.5054128770623004}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.75788321794871, "rel_wql_gmean": 0.49421017421244823}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7639898471755044, "rel_wql_gmean": 0.5577406704739787}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.884582495524887, "rel_wql_gmean": 0.9052218281574911}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8962501330896433, "rel_wql_gmean": 0.6495487799423033}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6926973403721509, "rel_wql_gmean": 0.5937869785059188}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7713675171303247, "rel_wql_gmean": 0.3616973051331611}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5592522419628495, "rel_wql_gmean": 0.35866016979444243}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6679748662601066, "rel_wql_gmean": 0.501187884126286}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6844749650355838, "rel_wql_gmean": 0.4715640721636921}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5794331362019375, "rel_wql_gmean": 0.7249032130584426}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7274908943977823, "rel_wql_gmean": 0.447185381910289}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7592674956924574, "rel_wql_gmean": 0.4915230345874937}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8160225626258149, "rel_wql_gmean": 0.8474243321015386}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8281711532324068, "rel_wql_gmean": 0.8673446644194264}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9115517503849181, "rel_wql_gmean": 0.567299277514214}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7565118858787296, "rel_wql_gmean": 0.5413823048088119}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8461374522214398, "rel_wql_gmean": 0.6382218477885009}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7845688942217784, "rel_wql_gmean": 0.5172999150208025}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7584619130014335, "rel_wql_gmean": 0.5444927422951403}}}, "group_skill_delta": {"term": {"long": 0.0027717516851422097, "medium": 0.005561254867336496, "short": 0.0031339914168337923}, "domain": {"Econ/Fin": -0.0034439799050458575, "Energy": 0.0009549465604122842, "Healthcare": -0.0011390306533090033, "Nature": 0.00861494586213929, "Sales": 0.0042845945669905405, "Transport": 0.007820517934064686, "Web/CloudOps": 0.0018012534719821227}, "frequency": {"A": 0.00016644892837114345, "D": 0.005409262153120986, "H": 0.0057905615066219385, "M": 0.021520279148344645, "Q": 0.001223154328716336, "S": 0.002507660417394919, "T": 0.0008729573481850439, "W": -0.00564950788779961}, "variates": {"multivariate": 0.0023135175521127316, "univariate": 0.0047000259684004675}}}, {"cutoff": "backcast3_evals", "candidate_skill": 0.3943023790374164, "control_skill": 0.388556531456951, "delta": 0.005745847580465369, "candidate_checkpoint": "db021fe2a29e80abf906556b2e3627f61128cedc984c852d63ca9bc7d8af4c42", "control_checkpoint": "dc03098da92746d3974cdb5fd3df955a8b52e689260f1fdcd0dd7b63a91fe17e", "candidate_eval_seconds": 27.054030179977417, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7614581674687556, "rel_wql_gmean": 0.47713168997385613}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.763155807467953, "rel_wql_gmean": 0.527881218926757}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7080535789039192, "rel_wql_gmean": 0.502206170658625}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8399782271529793, "rel_wql_gmean": 0.8468463431331842}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8280279149960056, "rel_wql_gmean": 0.5521607358800456}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7634445488727849, "rel_wql_gmean": 0.6498400190900193}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7147165005724686, "rel_wql_gmean": 0.3370924827377741}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7472792918336342, "rel_wql_gmean": 0.4748198841860076}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5368064984461026, "rel_wql_gmean": 0.4441624330587873}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7097838608816313, "rel_wql_gmean": 0.514446028980707}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5330343006916491, "rel_wql_gmean": 0.8373654758558289}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7156020798224476, "rel_wql_gmean": 0.4146576329269315}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7194889038392792, "rel_wql_gmean": 0.4825765897020932}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8488669982115364, "rel_wql_gmean": 0.8419122250539668}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.712681896042176, "rel_wql_gmean": 0.7723553807508527}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8377146489365882, "rel_wql_gmean": 0.5993714084744902}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7028536424030993, "rel_wql_gmean": 0.4624405725314098}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8036808005194592, "rel_wql_gmean": 0.6759113276790494}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7563804722547655, "rel_wql_gmean": 0.5094859554824934}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7104189888412888, "rel_wql_gmean": 0.49676960319334235}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7663754402347989, "rel_wql_gmean": 0.4788938791084861}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7658739230595875, "rel_wql_gmean": 0.529347553216718}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7178692269632083, "rel_wql_gmean": 0.5086998134122838}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8358354885094386, "rel_wql_gmean": 0.8418146966445984}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8338897723615496, "rel_wql_gmean": 0.5562121498093919}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.8060949747388733, "rel_wql_gmean": 0.6796354438827096}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7222059595204405, "rel_wql_gmean": 0.3416807049403571}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7557238523302612, "rel_wql_gmean": 0.47948838435897584}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5443370693639568, "rel_wql_gmean": 0.4497401377123374}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7130988319811894, "rel_wql_gmean": 0.5141627844030099}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5331048942504498, "rel_wql_gmean": 0.8394069703462528}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7335602695405524, "rel_wql_gmean": 0.42553600401076375}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7260346680667362, "rel_wql_gmean": 0.4869693265129284}, "M": {"n_configs": 4, "rel_mase_gmean": 0.881837749964207, "rel_wql_gmean": 0.8756527000622875}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7161603254136085, "rel_wql_gmean": 0.7742932145513032}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8420519451582145, "rel_wql_gmean": 0.5981276922561349}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7039614590005732, "rel_wql_gmean": 0.46207823333750453}, "W": {"n_configs": 8, "rel_mase_gmean": 0.810577145353702, "rel_wql_gmean": 0.6793951900954402}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7616930972618384, "rel_wql_gmean": 0.5118981392017699}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7193535077794512, "rel_wql_gmean": 0.5027824181292397}}}, "group_skill_delta": {"term": {"long": 0.0030587204091698794, "medium": 0.0020118051577781015, "short": 0.007988467440151692}, "domain": {"Econ/Fin": -0.004585528987425813, "Energy": 0.004874050603654867, "Healthcare": 0.035813776933601216, "Nature": 0.005911615406058501, "Sales": 0.006293859142192937, "Transport": 0.0064908035304042655, "Web/CloudOps": 0.0012426906558737905}, "frequency": {"A": 0.0008581975930802566, "D": 0.013980334142363549, "H": 0.005362258994278446, "M": 0.03335732356890664, "Q": 0.0027407788769321373, "S": 0.0010945510822769622, "T": 0.0002255482293131994, "W": 0.00506059561025618}, "variates": {"multivariate": 0.0036492394557235963, "univariate": 0.007330830293845181}}}], "mean_delta": 0.004758515134392016, "positive_cutoffs": 4, "outcome": "Declared primary6000/durability12000 diagnostic. No transfer formula or automatic publication is selected by this controller."} + +## E133 equal-seed seasonal correction12000 valid_screen +- Checkpoint SHA-256: `7536ba6a485c65a3c5ff64791aedb2ae97ce1a3f011b010152ab8d396d67b5f1`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 27.239246129989624 seconds. +- Overall skill 0.386677; relative MASE 0.733124; relative WQL 0.513099. +- term skill: long=0.4077, medium=0.4094, short=0.3694. +- domain skill: Econ/Fin=0.1473, Energy=0.2415, Healthcare=0.4717, Nature=0.4443, Sales=0.3394, Transport=0.4736, Web/CloudOps=0.5116. +- frequency skill: A=0.3770, D=0.3747, H=0.4065, M=0.0987, Q=0.2065, S=0.4256, T=0.4440, W=0.2250. +- variates skill: multivariate=0.4014, univariate=0.3747. +- Outcome: Conditional fixed coefficient0.5 mean of197/523 matched seasonal corrections; no optimizer update. Fixed equal-quarter ensemble selected separately. + +## E133 equal-seed seasonal correction12000 valid_backcast +- Checkpoint SHA-256: `7536ba6a485c65a3c5ff64791aedb2ae97ce1a3f011b010152ab8d396d67b5f1`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 28.115806102752686 seconds. +- Overall skill 0.342371; relative MASE 0.789258; relative WQL 0.547952. +- term skill: long=0.3985, medium=0.3632, short=0.3112. +- domain skill: Econ/Fin=0.1773, Energy=0.2289, Healthcare=0.3694, Nature=0.3897, Sales=0.4041, Transport=0.3794, Web/CloudOps=0.4573. +- frequency skill: A=0.3233, D=0.3608, H=0.3768, M=0.1928, Q=0.2304, S=0.3391, T=0.3376, W=0.2878. +- variates skill: multivariate=0.3581, univariate=0.3296. +- Outcome: Conditional fixed coefficient0.5 mean of197/523 matched seasonal corrections; no optimizer update. Fixed equal-quarter ensemble selected separately. + +## E133 equal-seed seasonal correction12000 valid_backcast2 +- Checkpoint SHA-256: `7536ba6a485c65a3c5ff64791aedb2ae97ce1a3f011b010152ab8d396d67b5f1`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 26.665321111679077 seconds. +- Overall skill 0.364812; relative MASE 0.764623; relative WQL 0.527663. +- term skill: long=0.3704, medium=0.3935, short=0.3513. +- domain skill: Econ/Fin=0.1335, Energy=0.2389, Healthcare=0.2996, Nature=0.4845, Sales=0.5511, Transport=0.4273, Web/CloudOps=0.4436. +- frequency skill: A=0.3490, D=0.4281, H=0.3981, M=0.1474, Q=0.1534, S=0.2827, T=0.3700, W=0.2610. +- variates skill: multivariate=0.3706, univariate=0.3601. +- Outcome: Conditional fixed coefficient0.5 mean of197/523 matched seasonal corrections; no optimizer update. Fixed equal-quarter ensemble selected separately. + +## E133 equal-seed seasonal correction12000 valid_backcast3 +- Checkpoint SHA-256: `7536ba6a485c65a3c5ff64791aedb2ae97ce1a3f011b010152ab8d396d67b5f1`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 28.653014183044434 seconds. +- Overall skill 0.391369; relative MASE 0.738034; relative WQL 0.501918. +- term skill: long=0.3956, medium=0.3633, short=0.4000. +- domain skill: Econ/Fin=0.1856, Energy=0.3240, Healthcare=0.2323, Nature=0.4987, Sales=0.4068, Transport=0.5156, Web/CloudOps=0.3942. +- frequency skill: A=0.3628, D=0.4482, H=0.4085, M=0.1414, Q=0.2652, S=0.2758, T=0.4325, W=0.2498. +- variates skill: multivariate=0.3752, univariate=0.4038. +- Outcome: Conditional fixed coefficient0.5 mean of197/523 matched seasonal corrections; no optimizer update. Fixed equal-quarter ensemble selected separately. + +E133 fixed equal-seed ensemble diagnostics: {"pid": 26167, "status": "complete; review before full replay", "gates": [{"step": 6000, "passed": true, "positive_cutoffs": 4, "mean_delta": 0.004591270374809914}, {"step": 12000, "passed": true, "positive_cutoffs": 4, "mean_delta": 0.004758515134392016}], "steps": [{"label": "literal equal-seed correction", "returncode": 0, "seconds": 5.973382799187675}, {"label": "averaged first member four cutoffs", "returncode": 0, "seconds": 222.38261847989634}, {"label": "record first member valid_screen", "returncode": 0, "seconds": 0.053908178117126226}, {"label": "fixed equal quarters valid_screen", "returncode": 0, "seconds": 2.1986292800866067}, {"label": "record first member valid_backcast", "returncode": 0, "seconds": 0.03650985099375248}, {"label": "fixed equal quarters valid_backcast", "returncode": 0, "seconds": 2.4613293861038983}, {"label": "record first member valid_backcast2", "returncode": 0, "seconds": 0.046597677981480956}, {"label": "fixed equal quarters valid_backcast2", "returncode": 0, "seconds": 2.7123846088070422}, {"label": "record first member valid_backcast3", "returncode": 0, "seconds": 0.035643117036670446}, {"label": "fixed equal quarters valid_backcast3", "returncode": 0, "seconds": 2.093629617942497}], "started_utc": "2026-10-23T09:09:36.735017+00:00", "seconds": 2682.319190497976, "results": [{"cutoff": "valid_screen", "skill": 0.38785477359333786, "control_skill": 0.3878507268780589, "delta": 4.046715278982482e-06, "groups": {"term": {"short": 0.3716688240670073, "medium": 0.4102061312283073, "long": 0.40663213236586226}, "domain": {"Econ/Fin": 0.14910671083514682, "Energy": 0.24779407759100036, "Healthcare": 0.4796362241251608, "Nature": 0.4432257200931151, "Sales": 0.34263328492967204, "Transport": 0.47281367736453117, "Web/CloudOps": 0.5082186463976825}, "freq": {"A-DEC": 0.38361040506867294, "Q-DEC": 0.2047727574845134, "M": 0.12235083900991339, "W-SUN": 0.09504638639083018, "D": 0.3726119388862481, "H": 0.40231866250150483, "15T": 0.2160294681894075, "W-FRI": 0.019025160984217138, "10T": 0.6268611393112872, "W-TUE": 0.6127482002482068, "W-THU": 0.22649492107079372, "W-WED": 0.322412323258104, "5T": 0.5238514547309681, "10S": 0.42360793679136877}}, "member_checkpoint_hashes": ["7536ba6a485c65a3c5ff64791aedb2ae97ce1a3f011b010152ab8d396d67b5f1", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c"], "cpu_seconds": 2.025519290007651}, {"cutoff": "valid_backcast", "skill": 0.3443769768533582, "control_skill": 0.34441110518308204, "delta": -3.4128329723825956e-05, "groups": {"term": {"short": 0.3120715038835057, "medium": 0.36323690871433056, "long": 0.40485751694448247}, "domain": {"Econ/Fin": 0.18132606483484726, "Energy": 0.2352649367029942, "Healthcare": 0.40246542897179693, "Nature": 0.37896904212325055, "Sales": 0.40730909035583496, "Transport": 0.3760850708501421, "Web/CloudOps": 0.45876412740906936}, "freq": {"A-DEC": 0.33522309274397843, "Q-DEC": 0.2326549879741392, "M": 0.19676557042031928, "W-SUN": 0.055587438311497706, "D": 0.36169717439461113, "H": 0.37498125694225815, "15T": 0.22378951311057127, "W-FRI": 0.23940264536567812, "10T": 0.33326681335631403, "W-TUE": 0.5281002284753433, "W-THU": 0.2692759146010608, "W-WED": 0.3578859908552052, "5T": 0.446077101202502, "10S": 0.3492609613018596}}, "member_checkpoint_hashes": ["7536ba6a485c65a3c5ff64791aedb2ae97ce1a3f011b010152ab8d396d67b5f1", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c"], "cpu_seconds": 2.254887686111033}, {"cutoff": "valid_backcast2", "skill": 0.36841439344351123, "control_skill": 0.3685168155758046, "delta": -0.00010242213229338937, "groups": {"term": {"short": 0.35552365985295686, "medium": 0.3971638855088674, "long": 0.37214956870206606}, "domain": {"Econ/Fin": 0.1277548758760082, "Energy": 0.2398498072114984, "Healthcare": 0.36787885831191636, "Nature": 0.4821151755691415, "Sales": 0.5595396999848431, "Transport": 0.4262953026044375, "Web/CloudOps": 0.44529635994193606}, "freq": {"A-DEC": 0.3386271977921971, "Q-DEC": 0.1518556119745832, "M": 0.1700427088684615, "W-SUN": 0.07891128103101364, "D": 0.43569590527514224, "H": 0.3994239112440673, "15T": 0.1057285187519148, "W-FRI": 0.15752145079538982, "10T": 0.5102086564402654, "W-TUE": 0.1723122815774616, "W-THU": 0.3323162174688119, "W-WED": 0.5583938634798413, "5T": 0.4771079073110027, "10S": 0.29027439342671546}}, "member_checkpoint_hashes": ["7536ba6a485c65a3c5ff64791aedb2ae97ce1a3f011b010152ab8d396d67b5f1", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c"], "cpu_seconds": 2.4400427860673517}, {"cutoff": "valid_backcast3", "skill": 0.3913542571468349, "control_skill": 0.3912834616582097, "delta": 7.079548862520824e-05, "groups": {"term": {"short": 0.3964180019964655, "medium": 0.3721100151164026, "long": 0.39682110562604944}, "domain": {"Econ/Fin": 0.18900810965416615, "Energy": 0.3197848021845332, "Healthcare": 0.23556871517140554, "Nature": 0.5082105126117362, "Sales": 0.39899103549503967, "Transport": 0.509194768973212, "Web/CloudOps": 0.3971032627533564}, "freq": {"A-DEC": 0.3535777547272728, "Q-DEC": 0.2620099084176857, "M": 0.14996383163337845, "W-SUN": 0.1706123710194779, "D": 0.44116674873533124, "H": 0.40736720014009664, "15T": 0.26291011118119134, "W-FRI": 0.045188100099548656, "10T": 0.6020458063592252, "W-TUE": 0.2794904572630179, "W-THU": 0.35227177770877793, "W-WED": 0.3653817058269325, "5T": 0.46918117859237574, "10S": 0.28781180529292705}}, "member_checkpoint_hashes": ["7536ba6a485c65a3c5ff64791aedb2ae97ce1a3f011b010152ab8d396d67b5f1", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c"], "cpu_seconds": 1.9175813610199839}], "positive_cutoffs": 2, "mean_delta": -1.542706452825615e-05, "selection_gate_passed": false}. No automatic publication. + +2026-10-23T09:56:25.284546+00:00: E133 conditional seasonal seed average rejected at diagnostics: source replication E118 passed both6k and12k (4of4each, mean+0.004591270375/+0.004758515134), but literal averaged correction7536ba6a485c65a3c5ff64791aedb2ae97ce1a3f011b010152ab8d396d67b5f1 gives ensemble deltas+0.000004046715/-0.000034128330/-0.000102422132/+0.000070795489 versus frozenE130, only2of4positive, mean-0.0000154270645283. No full replay/publication or coefficient alternatives. CPU merge3.657563774s, nooptimizerupdates; selection controller2682.319190498s includes dependency waiting, first-member4cutoffs222.382618480s. Replication source finalSHA db021fe2a29e80abf906556b2e3627f61128cedc984c852d63ca9bc7d8af4c42, main0.38143987517227207, trainingloop2564.504476471s. E123log_horizon started after its completion. + +2026-10-23T09:56:25.284546+00:00: E138 engineering implementation, no selection training queued yet. Initial6340gateSHA9d1401cd4d5b5f1c3ddd25a4a74e15e5db7ef708116cdf5c4fa7e90580b58da1. Independent scalar CPUaudit caught float32 subtraction cancellation in normalized expert disagreement (0.000256836414337 at constant-context fixture); fixed feature computation tofloat64 thenfloat32 MLP. Model arithmetic changed before anytraining; original failed logs retained, audit tolerance unchanged. Final scalar error6.556510925292969e-7, padding0, rowpermutation and initial equal-quarters bitwise, CPU0.107544080s. GPUaudit first failed missing frequency export (fixed), then mismatched auditbatch12 against cachedbatch4 (corrected fixtureto4; no modelchange/tolerance relaxation). SuccessfulGPU761: allfour expert outputs and zerohead ensemble bitwise match E130 on both syntheticconfigs including1e22contexts; B64C4096H1024, finite nonzero gradients through everygate layer with temporaryhead, no expert gradients,2048.220214844MiBallocated/2472MiBreserved includinggateAdam/EMAplaceholders,27.484272173s including4.875554147lockwait,0optimizerupdates. Optional --gate-package trainer branch implemented; gateonlyoptimizer/EMA, frozenexpert hashes preserved, complete recovery unchanged. Private portable initialpackage descriptor8c299fa9fe2a63d1e1d90154b662479487ac8ed69968c048a718f930749a1c6b includes immutableE130experts. Continuous/interrupted recoveryrehearsal andpublicruntime/relocationchecks nowrunning beforequeue. + +2026-10-23T09:56:25.284546+00:00: E139 primary width-treatment firstmemberSHA82d50d0b2f7abfb963562f5f7966644b05612a49725f066392c022ccd6ba18ca,36899168params; CPUmergefixture769,2.319647101s, nooptimizerupdates. Equal-quarter diagnostic deltas+0.000181027280/+0.000289166747/+0.000165335678/+0.000419199126, all4positive, mean+0.000263682208. Fullsuite active at width6_ensemble_validation_receipt.json; synthetic standalonecomposition and relocation alreadypass. Fullreplay andindependentrealcomposition remain mandatory; no publicationyet. + +2026-10-23T09:58:45.421335+00:00: E118final process elapsed2575.852544286987s; completed09:46:48UTC, source loop2564.5044764708728s. Replication source source benefit remains replicated; E133mean correction separately rejected. E138 feature/rule review confirmed fixed seasonal, continuity and zero-mass transforms are prefix-local in forecast lead; training supplies each row's finite requested horizon to expert decoder and gate, preserving prior mask handling. No new experiments or training modifications from this review. + +E122 fresh146M original AR prior seed307 training started at 2026-10-23T09:59:37Z, after the preceding trainer exited with its final checkpoint. Settings are unchanged from the declared comparison. + +2026-10-23T10:00:33.031842+00:00: E79fresh146M originalLR completed its declared96000updates, checkpointSHAd7cfcd72c3cb84aa69e447b76c4c3ab98c21b7c600a463f0b805f4b4300baf33, trainingprocess22140.291222665925s, final log {"completed_step": 96000, "training_process_loop_seconds": 22110.386884229025}. E122originalAR started under its existing queue after completion; no new concurrent allocation. E132final fourthmember comparison awaits main thenearlier diagnostics; no endpoint selected from unseen results. Energy per-config full E130 diagnostics show largest negative skills ETT2/T/short(-0.3974313), electricity/H/short(-0.0809033), electricity/W/short(-0.0504676), ETT1/T/medium(-0.0323996), ETT2/D/short(-0.0167731). These heterogeneous failures do not establish a broad building-source deficiency; no source reweight selected. E136direct-trend remains the declared next controlled architecture study. + +2026-10-23T10:02:42.915649+00:00: E139primary6000 full public replay positive, pending remaining mandatory checks: skill0.3843356309048914 versusE130 0.38414971818207, delta0.00018591272282142413; relativeMASE0.7359642442141643, relativeWQL0.5150285742183113; all97configs151170instances,0failures, inference469.96330363093875s onsharedH100. Descriptordfc20235aeb4b9fc799001d69f5be390d9892448dbbf51fc2abb8ca0be453bf7. Allthree termgroups improve; medianMASE worsens slightly while WQL improves. Independent firstmember realcomposition still running/queued, so not published yet. No held-out reward claim. + +E136 direct bounded local-trend head seed197 training started at 2026-10-23T10:02:48Z, after the declared dependency processes exited; required checkpoint files are present. Settings are unchanged from the declared comparison. + +2026-10-23T10:04:10.104732+00:00: E138full recovery rehearsal passed exact equality for model, optimizer, EMA, complete NumPy/Torch/CUDA RNG states and prefetched batch after6updates versus interruptionafter3/restoredto6. Seed751,B4engineering fixture, original12000LRschedule;12total fixture updates across duplicate trajectories, no validation data and no selection weights. Six gate optimizer tensors only,6340params; experts excluded. Threeprocesses26.724943044/23.340486976/25.177071764s, total495.167764166s including419.907799349s evaluationlockwait. InitialSHA9d1401cd... unchanged. Publicruntime/relocation check stillrequired beforequeue. E129width completed12000 at2026-10-23T10:02:44Z, process2594.787767793052s, {"completed_step": 12000, "training_process_loop_seconds": 2581.1645341650583}, finalSHA8a8c75cafcc7b42266aaab7d8458cb383b65313ce6da8c396e76760f7ab6e33c. E136directtrend started in same allocation; E13912kdurability waits declared source gate before merge. + +## E140: bounded runtime loader study +2026-10-23T10:05:33.226872+00:00: Hypothesis: portable inference startup can avoid initializing dense weights that are immediately overwritten. Changed factor only construction/loading: create model on meta device, load own saved tensors with assign=True, then move toCUDA; preserve all saved tensor values/strides and nonparameter attributes. No model/data/training/forecast-rule changes or optimizerupdates. CPUfixture787 compares each of E139primary four members against the original loader, including exact parameters/strides and absence of buffers; measure constructor/load elapsed. This engineering probe was described before running its CPU test; no runtime file has been modified. Only pursue a separate portable candidate if CPU savings justify actual GPU/cohort checks. Runtime adoption requires exact synthetic/real/full public forecast identity and relocation, plus measured startup improvement; descriptor/weights stay fixed and runtime hashes change. E138training/immutableexpert loader remains unchanged during its pending audits. + +## E139 direct-width treatment6000 equal-quarter full replay selected +- Checkpoint SHA-256: `dfc20235aeb4b9fc799001d69f5be390d9892448dbbf51fc2abb8ca0be453bf7`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.384336; relative MASE 0.735964; relative WQL 0.515029. +- term skill: long=0.4011, medium=0.4090, short=0.3680. +- domain skill: Econ/Fin=0.1298, Energy=0.2414, Healthcare=0.4863, Nature=0.4435, Sales=0.3559, Transport=0.4733, Web/CloudOps=0.5003. +- frequency skill: A=0.3025, D=0.3768, H=0.3975, M=0.1484, Q=0.1892, S=0.4236, T=0.4396, W=0.2404. +- variates skill: multivariate=0.3965, univariate=0.3745. +- Outcome: Matched width-treatment correction at 6000 steps improves full skill from 0.384149718182 to 0.384335630905. All97configs151170instances pass. Inference 469.963s on shared H100. Relocation and actual-member real/extreme synthetic composition are bitwise exact. Validation selection only, not held-out reward. + +E139 complete suite {"package": "/workspace/research/candidate-width6-ensemble", "status": "complete", "steps": [{"name": "synthetic_composition", "returncode": 0, "seconds": 32.99152904795483}, {"name": "relocation", "returncode": 0, "seconds": 68.7697308328934}, {"name": "full_public_replay", "returncode": 0, "seconds": 503.14482915005647}, {"name": "independent_first_member", "returncode": 0, "seconds": 196.6843510561157}, {"name": "composition", "returncode": 0, "seconds": 0.22877190494909883}, {"name": "descriptive_comparison", "returncode": 0, "seconds": 0.1512721918988973}], "current_step": "descriptive_comparison", "seconds": 801.9830046950374, "skill": 0.3843356309048914}. Synthetic checks {"duration": 6, "descriptor_sha256": "dfc20235aeb4b9fc799001d69f5be390d9892448dbbf51fc2abb8ca0be453bf7", "members": ["82d50d0b2f7abfb963562f5f7966644b05612a49725f066392c022ccd6ba18ca", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c"], "checks": [{"config_id": "synthetic_H", "instances": 12, "bitwise_composition": true, "finite_ordered": true}, {"config_id": "synthetic_15T", "instances": 12, "bitwise_composition": true, "finite_ordered": true}], "unchanged_member_references_reused": "/workspace/research/fresh_capacity4_fixture", "input_files_bitwise_identical": true, "seconds": 32.86732584401034}. Descriptive comparison {"candidate": "/workspace/research/valid-report-width6-ensemble.json", "parent": "/workspace/research/valid-report-fresh-capacity4-ensemble.json", "candidate_hash": "dfc20235aeb4b9fc799001d69f5be390d9892448dbbf51fc2abb8ca0be453bf7", "parent_hash": "fa97880dd132b1cdff459be4798f8f360d7df59b13e78026a9d74a95d63df0db", "skill_difference": 0.00018591272282142413, "n_configs": 97, "n_dataset_clusters": 28, "improved_configs": 59, "bootstrap_seed": 317, "bootstrap_samples": 5000, "dataset_cluster_delta_percentiles": {"p025": 5.3236006803086824e-05, "p50": 0.00018019965585558406, "p975": 0.000338037622301765}, "note": "Descriptive resampling only. Adaptive validation selection and reused windows prevent treating this as a held-out significance test."}. Current-publication diagnostic deltas [0.00018102727969981913, 0.0002891667470349413, 0.00016533567823673323, 0.00041919912631072087]. Every member forecasts every instance. E101teacher and E138experts remain their immutable declared snapshots. + +2026-10-23T10:07:06.353692+00:00: E140CPUfixture787 passed exact saved values/strides for all four members and no buffers; constructor+load sums1.7415185519494116s original versus0.0662954212166369s meta, total3.905531459953636s,0optimizerupdates. Proceed to one separate loader-only candidate, ABBAAB isolated GPUprocess timing (three repeats each), same synthetic fixtures/batch4. Before seeing GPU results, require median load reduction at least0.25s AND5percent plus exact forecasts before anyfull public replay; record shared-device timing uncertainty. No training loader or existing runtime modified. + +2026-10-23T10:07:38.902305+00:00: E138all engineering checks passed and queued{"queue_pid": 28517, "watch_pid": 28518, "comparison_pid": 28519} after E123log_horizon queue21256/final12000, replacing one allocation. Private initialpackage8c299fa9... actualsynthetic two configs/batch4 and three realconfigs/batch128 reproduce E130bitwise; real inputs only, no validation labels orupdates. Public synthetic21.942501016s/real24.590036898s; relocation43.007742864s, fullruntimeaudit640.823434885s includes evaluationlockwait. CPU/GPU/recovery checks and frozen initial/expert hashes are enforced by launcher. Plannedseed751/B64/LR1e-3/12koriginalsampler,6kprimary/12kdurability,1/3diag unchanged. Expert snapshot remains immutableE130 despite new E139publishedmodel; no test-time fitting. Sources and exact generator archived by separate gatepublisher. + +## E141: matched146M patch-resolution continuation +2026-10-23T10:09:20.174946+00:00: Hypothesis: the patch8 improvement seen in mature37M E71 can transfer to fresh146M, whose final E79wide96000 main0.371180826606 exceeds own48000 and matched37Mfinal. This is a new continuation comparison, not fresh-architecture equivalence or a source-weight change. Both arms start from own E79wide EMA96000 SHA d7cfcd72c3cb84aa69e447b76c4c3ab98c21b7c600a463f0b805f4b4300baf33; control keeps patch16, candidate applies the fixed existing E71conversion: sum corresponding halves of embedding/query/recency input weights, retain first8 of16 output rows, preserve all backbone tensors and physical position units. Conversion is NOT function-preserving; no coefficient choices. Same random_capacity model/data code (including overflow fallback and20percent slowAR), oldpacked_sample/sourceweights, seed809/B32/LR2e-5/12000/paired/staticcompiledloss/400warmup/cosfloor0.2; reset Adam/EMA schedules identically, requestedhorizonseed300812. Controlthen candidate sequentially replace E136directtrend after its final12000, no extra concurrent allocation. Primary6000,1000/3000diagnostics,12000durability; matched6/12allfourcutoffs, positive mean and>=3of4 before any later ensemble proposal/full replay. No ensemble formula or sweep selected now. CPUfixture811 independent conversion arithmetic/inherited tensor/config/finiteordered forward checks; GPUfixture821 maximumB32signed64,C4096,H1024 includingAdam/EMA placeholders and eager/compiledloss-gradient comparison. Queue only after audits and memory headroom confirmation. No validation training; no supplied baseline retraining. + +2026-10-23T10:10:57.554558+00:00: E140ABBAAB GPUprocess audit passed: allsix synthetic outputs bitwiseequal, finiteordered. Median load15.83080534520559s original versus8.647635334869847s meta, saving7.183170010335743s (0.4537463416231815relative), predeclared>=0.25s/5percent gatepassed. Total182.9963137828745s includeslockwait83.4526801398024s. Shared-device timing, no idle-verifier speed claim. Separate candidate-width6-meta-loader now enters full97publicreplay, exact forecastarray comparison andrelocation before any adoption; no trainingloader changed. E141CPUconversion fixture811 passed,146206864params,initialSHA3fef8f613e5fad3633e4fafe697453e2fe3691678fa581c8a2fea3e6da3de2c1,5.976632893s,0updates; maximumGPUaudit821queuedunder evaluationlock. + +E132 fixed fourth-member96000 durability diagnostics: {"pid": 26132, "status": "complete; review gate", "steps": [{"label": "fresh146M96000 earlier cutoffs", "seconds": 423.53272597002797}, {"label": "fixed equal quarters valid_screen", "seconds": 2.2404548309277743}, {"label": "fixed equal quarters valid_backcast", "seconds": 2.999124326976016}, {"label": "fixed equal quarters valid_backcast2", "seconds": 2.5167792509309947}, {"label": "fixed equal quarters valid_backcast3", "seconds": 1.6545759898144752}], "started_utc": "2026-10-23T09:06:54.167150+00:00", "seconds": 3932.743177816039, "results": [{"cutoff": "valid_screen", "skill": 0.3879917387071412, "control_skill": 0.3878507268780589, "delta": 0.000141011829082327, "groups": {"term": {"short": 0.3720792785727258, "medium": 0.41069529613285427, "long": 0.40573692158328545}, "domain": {"Econ/Fin": 0.14912424149140913, "Energy": 0.2472009579845904, "Healthcare": 0.49398090397936345, "Nature": 0.4410833912066744, "Sales": 0.34459481519961455, "Transport": 0.4723428197004681, "Web/CloudOps": 0.5073838557087357}, "freq": {"A-DEC": 0.3841737407457373, "Q-DEC": 0.2060401345601105, "M": 0.12526071807642203, "W-SUN": 0.089538132740977, "D": 0.3718749043263354, "H": 0.40319630992500677, "15T": 0.21786386051711848, "W-FRI": 0.020439090559231654, "10T": 0.6250252751000003, "W-TUE": 0.6420547528849962, "W-THU": 0.2178823087924573, "W-WED": 0.32696192850760064, "5T": 0.5207951537698052, "10S": 0.423966557020225}}, "member_checkpoint_hashes": ["8a2b252b733cc79c31778ea27ba00fbe61206fef50454514b667c54a928d80a4", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "d7cfcd72c3cb84aa69e447b76c4c3ab98c21b7c600a463f0b805f4b4300baf33"], "cpu_seconds": 2.0663202931173146}, {"cutoff": "valid_backcast", "skill": 0.34527215391567845, "control_skill": 0.34441110518308204, "delta": 0.0008610487325964034, "groups": {"term": {"short": 0.3126884325864907, "medium": 0.3637688978553446, "long": 0.4067147191362456}, "domain": {"Econ/Fin": 0.18044693535148892, "Energy": 0.2346014580725676, "Healthcare": 0.40656080024519137, "Nature": 0.38070856949276444, "Sales": 0.4074086766757222, "Transport": 0.377223390101862, "Web/CloudOps": 0.46044469275016797}, "freq": {"A-DEC": 0.33204316302436765, "Q-DEC": 0.23677528035988427, "M": 0.18718300392526344, "W-SUN": 0.0459689931600773, "D": 0.36367425225660344, "H": 0.37572279841566447, "15T": 0.2232591251920133, "W-FRI": 0.24169192652833082, "10T": 0.33505387846121126, "W-TUE": 0.5507201309892467, "W-THU": 0.2670975311600482, "W-WED": 0.3624139496117442, "5T": 0.4485217500942056, "10S": 0.3496660874149985}}, "member_checkpoint_hashes": ["8a2b252b733cc79c31778ea27ba00fbe61206fef50454514b667c54a928d80a4", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "d7cfcd72c3cb84aa69e447b76c4c3ab98c21b7c600a463f0b805f4b4300baf33"], "cpu_seconds": 2.82790120691061}, {"cutoff": "valid_backcast2", "skill": 0.3693722441131262, "control_skill": 0.3685168155758046, "delta": 0.0008554285373215675, "groups": {"term": {"short": 0.3561034685363469, "medium": 0.3986579369207216, "long": 0.37353436597025813}, "domain": {"Econ/Fin": 0.12736988675734873, "Energy": 0.24060967952411283, "Healthcare": 0.361205844869546, "Nature": 0.48217194835329746, "Sales": 0.5592933136533227, "Transport": 0.42733602595255205, "Web/CloudOps": 0.4493810855468827}, "freq": {"A-DEC": 0.33839273225074207, "Q-DEC": 0.1555223115262534, "M": 0.16902905410628355, "W-SUN": 0.07216335576924882, "D": 0.43526279365396536, "H": 0.40005187132697984, "15T": 0.10638589959756006, "W-FRI": 0.14483234056274708, "10T": 0.5091239135399137, "W-TUE": 0.15194949116265377, "W-THU": 0.3407213866845825, "W-WED": 0.5605028503844405, "5T": 0.483629147626099, "10S": 0.28991830224876325}}, "member_checkpoint_hashes": ["8a2b252b733cc79c31778ea27ba00fbe61206fef50454514b667c54a928d80a4", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "d7cfcd72c3cb84aa69e447b76c4c3ab98c21b7c600a463f0b805f4b4300baf33"], "cpu_seconds": 2.3098160580266267}, {"cutoff": "valid_backcast3", "skill": 0.3917440412921396, "control_skill": 0.3912834616582097, "delta": 0.00046057963392986956, "groups": {"term": {"short": 0.39609380043847486, "medium": 0.3726609326428316, "long": 0.3990714746962174}, "domain": {"Econ/Fin": 0.19146841603554976, "Energy": 0.3169493285921843, "Healthcare": 0.23363305321771521, "Nature": 0.5079864794927875, "Sales": 0.402341900108644, "Transport": 0.5097972319661975, "Web/CloudOps": 0.4024376021492734}, "freq": {"A-DEC": 0.36339584495699273, "Q-DEC": 0.26360078602725334, "M": 0.14532839562199418, "W-SUN": 0.17018654203393757, "D": 0.4395955029815283, "H": 0.40764297620236134, "15T": 0.25800645318468773, "W-FRI": 0.043820152478523, "10T": 0.6034667895013048, "W-TUE": 0.28576803587190736, "W-THU": 0.34695837014955566, "W-WED": 0.3741862411400826, "5T": 0.4737863955972218, "10S": 0.2930816557144478}}, "member_checkpoint_hashes": ["8a2b252b733cc79c31778ea27ba00fbe61206fef50454514b667c54a928d80a4", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "d7cfcd72c3cb84aa69e447b76c4c3ab98c21b7c600a463f0b805f4b4300baf33"], "cpu_seconds": 1.4660730550531298}], "positive_cutoffs": 4, "mean_delta": 0.0005795171832325419, "selection_gate_passed": true}. No runtime/package constructed, no weight sweep. + +## E142: fixed two-factor composition of width treatment and final fresh member +2026-10-23T10:13:32.739522+00:00: E132final96000 fourthmember passes4of4 versus frozenE130, mean+0.000579517183; versus currentE139width6000 it passes3of4, mean+0.000315834975. E139width6000 alreadypassed4of4/fullreplay. Hypothesis: these changes to separate members remain useful together. One fixed equal-quarter combination uses E1396000first SHA82d50d0b..., E71patch8/E93split unchanged, and E79fresh146M96000 SHAd7cfcd72.... No training, weight/epoch/coefficient sweep, or substitution of E13912000. This completes a fixed2x2 comparison against E130(E117first/fresh48), E139(widthfirst/fresh48), and E132(E117first/fresh96). Evaluate allfour cached diagnostic cutoffs; require>=3positive andmeanpositive versus BOTH isolated E139andE132 before joint fullreplay. E132isolated fullreplay remains eligible and will also be measured, rather than inferring its fullscore from diagnostics. Everymember forecasts everyinstance; best complete fullvalidated candidate selected. Assemble candidates after E140loader decision to keep runtime lineage consistent; sourceindividual member replay/relocation/extreme composition remain required. No model constructed or joint diagnostic measured before this declaration. + +2026-10-23T10:13:39.741097+00:00: E142 fixed width6000/fresh96000 quartet diagnostics {"status": "complete; review before package/fullreplay", "results": [{"cutoff": "valid_screen", "skill": 0.3881718681051801, "width_control_skill": 0.3880317541577587, "fresh_control_skill": 0.3879917387071412, "delta_width": 0.00014011394742141636, "delta_fresh": 0.00018012939803890848, "groups": {"term": {"short": 0.3722239066082397, "medium": 0.41091591005070605, "long": 0.4059638616914294}, "domain": {"Econ/Fin": 0.14901755367760694, "Energy": 0.24741422430120008, "Healthcare": 0.4943318904343714, "Nature": 0.44134594243138947, "Sales": 0.3445241159318412, "Transport": 0.47269779445274607, "Web/CloudOps": 0.507385308125947}, "freq": {"A-DEC": 0.38370002946456816, "Q-DEC": 0.20626693520370054, "M": 0.12614029249200875, "W-SUN": 0.08996291768496012, "D": 0.37201944875933657, "H": 0.4035710103676592, "15T": 0.21784009071870558, "W-FRI": 0.02046942787274386, "10T": 0.6250497434629132, "W-TUE": 0.6417672377765984, "W-THU": 0.2180478165537424, "W-WED": 0.32714945388803274, "5T": 0.5208370369159045, "10S": 0.4239060992367861}}, "member_checkpoint_hashes": ["82d50d0b2f7abfb963562f5f7966644b05612a49725f066392c022ccd6ba18ca", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "d7cfcd72c3cb84aa69e447b76c4c3ab98c21b7c600a463f0b805f4b4300baf33"], "cpu_seconds": 1.9977810359559953}, {"cutoff": "valid_backcast", "skill": 0.3455586213321383, "width_control_skill": 0.344700271930117, "fresh_control_skill": 0.34527215391567845, "delta_width": 0.0008583494020213411, "delta_fresh": 0.00028646741645987905, "groups": {"term": {"short": 0.31298317888014404, "medium": 0.36399688922917317, "long": 0.4070347944383135}, "domain": {"Econ/Fin": 0.18055394020674953, "Energy": 0.2348134086852961, "Healthcare": 0.4070841731588888, "Nature": 0.38116047615930115, "Sales": 0.4074762260349628, "Transport": 0.37765229926233534, "Web/CloudOps": 0.4606241441368746}, "freq": {"A-DEC": 0.3317879932584423, "Q-DEC": 0.2371616106420198, "M": 0.18757363725282472, "W-SUN": 0.046528360729501284, "D": 0.3640158957717563, "H": 0.37629546776645173, "15T": 0.22308590849540832, "W-FRI": 0.24172781290644818, "10T": 0.33510910697177476, "W-TUE": 0.5514604320698773, "W-THU": 0.2676131040680497, "W-WED": 0.3624466093693053, "5T": 0.44848635160409267, "10S": 0.3498688987777634}}, "member_checkpoint_hashes": ["82d50d0b2f7abfb963562f5f7966644b05612a49725f066392c022ccd6ba18ca", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "d7cfcd72c3cb84aa69e447b76c4c3ab98c21b7c600a463f0b805f4b4300baf33"], "cpu_seconds": 1.2962471970822662}, {"cutoff": "valid_backcast2", "skill": 0.3695446326773957, "width_control_skill": 0.36868215125404136, "fresh_control_skill": 0.3693722441131262, "delta_width": 0.0008624814233543221, "delta_fresh": 0.0001723885642694878, "groups": {"term": {"short": 0.3561553236693098, "medium": 0.39881193758154254, "long": 0.37406076222597684}, "domain": {"Econ/Fin": 0.12739021872720024, "Energy": 0.24065421574153212, "Healthcare": 0.36170573519895977, "Nature": 0.4822797751725245, "Sales": 0.559215597626701, "Transport": 0.4278274284034268, "Web/CloudOps": 0.44953046241749317}, "freq": {"A-DEC": 0.33803240362938913, "Q-DEC": 0.1556366215688766, "M": 0.16938575239717812, "W-SUN": 0.07265591665507165, "D": 0.4351869375859423, "H": 0.4005074918768775, "15T": 0.106183720406681, "W-FRI": 0.14466976658042907, "10T": 0.5090032236270038, "W-TUE": 0.15262124206805772, "W-THU": 0.3413719074247239, "W-WED": 0.5604533363402475, "5T": 0.4835166085060454, "10S": 0.2906753670786497}}, "member_checkpoint_hashes": ["82d50d0b2f7abfb963562f5f7966644b05612a49725f066392c022ccd6ba18ca", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "d7cfcd72c3cb84aa69e447b76c4c3ab98c21b7c600a463f0b805f4b4300baf33"], "cpu_seconds": 1.5180778538342565}, {"cutoff": "valid_backcast3", "skill": 0.3921644754508403, "width_control_skill": 0.39170266078452043, "fresh_control_skill": 0.3917440412921396, "delta_width": 0.000461814666319893, "delta_fresh": 0.0004204341587007443, "groups": {"term": {"short": 0.396523119774537, "medium": 0.3731115929789489, "long": 0.39943603289581653}, "domain": {"Econ/Fin": 0.1915138068470047, "Energy": 0.31716941229808127, "Healthcare": 0.23407160495463708, "Nature": 0.5090366665812751, "Sales": 0.40236628008580433, "Transport": 0.5102391473978511, "Web/CloudOps": 0.4026365427407549}, "freq": {"A-DEC": 0.36291095579230737, "Q-DEC": 0.2636137569190712, "M": 0.1456802398010142, "W-SUN": 0.17057037719788581, "D": 0.44035582757394454, "H": 0.4080361547461918, "15T": 0.2581899488833542, "W-FRI": 0.044476826738058306, "10T": 0.6038475830013132, "W-TUE": 0.28764820094432986, "W-THU": 0.34829791806939636, "W-WED": 0.37407395307293756, "5T": 0.4736677362009297, "10S": 0.293970489003357}}, "member_checkpoint_hashes": ["82d50d0b2f7abfb963562f5f7966644b05612a49725f066392c022ccd6ba18ca", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "d7cfcd72c3cb84aa69e447b76c4c3ab98c21b7c600a463f0b805f4b4300baf33"], "cpu_seconds": 1.375803180038929}], "seconds": 6.957909902790561, "optimizer_updates": 0, "new_neural_inference": false, "positive_cutoffs_vs_width": 4, "mean_delta_vs_width": 0.0005806898597792431, "positive_cutoffs_vs_fresh": 4, "mean_delta_vs_fresh": 0.0002648548843672549, "selection_gate_passed": true}. No package/fullscore inferred. + +2026-10-23T10:17:26.773523+00:00: E142fixed width6000/fresh96000 joint quartet passed allfour versus BOTH isolated parents; mean+0.0005806898597792431versusE139 and+0.0002648548843672549versusE132, CPUdiagnostic total6.957909902790561s,0optimizerupdates/no newneuralinference. Individual fresh96000 portable package assembled with actual random_capacity/recovery provenance andseed307; first/fourth models unchanged. Separate E132andE142 fullsuite assemblers, extremeactual-member tests and guardedpromoters prepared, explicitly waiting E140loaderdecision. No fullscore inferred fromcached diagnostics. + +E129 12000 four-cutoff comparison: {"label": "E129 12000 four-cutoff comparison", "utc": "2026-10-23T10:21:49.863964+00:00", "candidate": "seasonal_width_ema12000", "control": "seasonal_dispersion_ema12000", "rows": [{"cutoff": "evals", "candidate_skill": 0.3829575592439247, "control_skill": 0.3820478868373609, "delta": 0.0009096724065638107, "candidate_checkpoint": "8a8c75cafcc7b42266aaab7d8458cb383b65313ce6da8c396e76760f7ab6e33c", "control_checkpoint": "b0204fa8dd3371d9160fc00545d6b065ccb23bb18e345b3b63cd39c024c9acf5", "candidate_eval_seconds": 28.068697452545166, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7385649404930517, "rel_wql_gmean": 0.4756621939681783}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7107455375873698, "rel_wql_gmean": 0.4927860639379416}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7504165521104995, "rel_wql_gmean": 0.5401485601257813}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8800466291473449, "rel_wql_gmean": 0.8559796352527203}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9009572046437253, "rel_wql_gmean": 0.6425888264141222}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5853876912825183, "rel_wql_gmean": 0.5139823506378491}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8016996186602896, "rel_wql_gmean": 0.3975658345447008}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.849913221695885, "rel_wql_gmean": 0.5190371903971364}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.631497689549554, "rel_wql_gmean": 0.42906996252022056}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5575551391566088, "rel_wql_gmean": 0.4322196856913945}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6270302637021805, "rel_wql_gmean": 0.6576369760217897}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7618012319908849, "rel_wql_gmean": 0.5242249531312764}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7269862252820123, "rel_wql_gmean": 0.4928489449999714}, "M": {"n_configs": 5, "rel_mase_gmean": 0.969136840910731, "rel_wql_gmean": 0.8195237194400399}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7793562279359187, "rel_wql_gmean": 0.8252555262342453}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6553789645227944, "rel_wql_gmean": 0.5029910279440831}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6890059169894194, "rel_wql_gmean": 0.4509720506518005}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9073663673513933, "rel_wql_gmean": 0.6788515847406241}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7084149227770673, "rel_wql_gmean": 0.5093822506937259}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7644685786621924, "rel_wql_gmean": 0.5197841025612521}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7389032030803768, "rel_wql_gmean": 0.4775255930846139}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7110090800376195, "rel_wql_gmean": 0.49416801903946805}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7504609946788687, "rel_wql_gmean": 0.5413698790489025}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8804929993505196, "rel_wql_gmean": 0.8550445515045846}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9011157762761242, "rel_wql_gmean": 0.6441525168035792}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5841227032423717, "rel_wql_gmean": 0.5152693556823793}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8018394415733434, "rel_wql_gmean": 0.39970868464473397}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8494409474640868, "rel_wql_gmean": 0.5191016450797338}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.631290389229455, "rel_wql_gmean": 0.4311304324404592}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5583176379809373, "rel_wql_gmean": 0.4328344133541464}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6260908412504385, "rel_wql_gmean": 0.6531805976165398}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7625008852504683, "rel_wql_gmean": 0.5256123818684614}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7269253228245665, "rel_wql_gmean": 0.4957875948564009}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9683877465170895, "rel_wql_gmean": 0.8250296285399715}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7794669965817581, "rel_wql_gmean": 0.8259636078611131}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6552664068279662, "rel_wql_gmean": 0.5032424048533084}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6897053807375739, "rel_wql_gmean": 0.45130068257990086}, "W": {"n_configs": 8, "rel_mase_gmean": 0.905700561781496, "rel_wql_gmean": 0.6779024808640658}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7086017938396406, "rel_wql_gmean": 0.5106302124003929}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7646004882955708, "rel_wql_gmean": 0.5213256741612632}}}, "group_skill_delta": {"term": {"long": 0.0012958159854333795, "medium": 0.0009391194298035144, "short": 0.0007382372618780497}, "domain": {"Econ/Fin": -0.00025423459827855766, "Energy": 0.0009922518606708675, "Healthcare": 9.259276220807688e-05, "Nature": 0.001568786649017384, "Sales": -0.00014333288016576962, "Transport": 0.001162704359493505, "Web/CloudOps": 0.0006847693133080757}, "frequency": {"A": -0.002659004953787125, "D": 0.0011262227370676392, "H": 0.0017567307722733405, "M": 0.0026430592017883114, "Q": 0.0004009949390402223, "S": 9.413413181458274e-05, "T": 0.00048604006480834627, "W": -0.0012690867740849932}, "variates": {"multivariate": 0.0008147283313804099, "univariate": 0.0009885351758065486}}}, {"cutoff": "backcast_evals", "candidate_skill": 0.3431168619446856, "control_skill": 0.3418892780195716, "delta": 0.0012275839251140175, "candidate_checkpoint": "8a8c75cafcc7b42266aaab7d8458cb383b65313ce6da8c396e76760f7ab6e33c", "control_checkpoint": "b0204fa8dd3371d9160fc00545d6b065ccb23bb18e345b3b63cd39c024c9acf5", "candidate_eval_seconds": 30.285208225250244, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7745057244270586, "rel_wql_gmean": 0.4610623789807178}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7665690652589143, "rel_wql_gmean": 0.5279020197374018}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8083500304036458, "rel_wql_gmean": 0.5880320847674819}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8740565311993375, "rel_wql_gmean": 0.8161501061138186}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8851277957413036, "rel_wql_gmean": 0.663500317271362}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6564992222020608, "rel_wql_gmean": 0.5610268727362654}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9052725130401621, "rel_wql_gmean": 0.42064687636935943}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7234850340183689, "rel_wql_gmean": 0.4902139246519234}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7295967780250021, "rel_wql_gmean": 0.5192824882712911}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6597671087705073, "rel_wql_gmean": 0.4499772865410385}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6450988450119612, "rel_wql_gmean": 0.7273632457830282}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8161733161037954, "rel_wql_gmean": 0.48593241643205115}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7673497923812557, "rel_wql_gmean": 0.5044190694880905}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8646560836167352, "rel_wql_gmean": 0.7880636497101029}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7636349765137933, "rel_wql_gmean": 0.7750360952163152}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8536272713735963, "rel_wql_gmean": 0.5057173155199778}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7681040784528608, "rel_wql_gmean": 0.571716423971766}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8721157485861396, "rel_wql_gmean": 0.5908313512751125}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7867150109766055, "rel_wql_gmean": 0.5248858000904015}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7957831126082807, "rel_wql_gmean": 0.5615468096200318}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7739203449970765, "rel_wql_gmean": 0.4624749910039315}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7670191905850069, "rel_wql_gmean": 0.5295139958967662}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8087785498550463, "rel_wql_gmean": 0.590263798231263}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8743674629847383, "rel_wql_gmean": 0.8161720641051514}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8853621974210792, "rel_wql_gmean": 0.665058032816427}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6579970194342092, "rel_wql_gmean": 0.5646715267254061}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9052563953011699, "rel_wql_gmean": 0.42318224850833497}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7239801636643148, "rel_wql_gmean": 0.4912094503535297}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7292932013886385, "rel_wql_gmean": 0.5220064683319335}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6600102642208264, "rel_wql_gmean": 0.4511555367132821}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6444326514379081, "rel_wql_gmean": 0.7248601482512232}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8172654104294157, "rel_wql_gmean": 0.48783020134756094}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7679461029022491, "rel_wql_gmean": 0.5077426505293602}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8645966624230256, "rel_wql_gmean": 0.7911152729414949}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7629806732535767, "rel_wql_gmean": 0.7768213615208555}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8530821682550342, "rel_wql_gmean": 0.5073353488371999}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7676622656760491, "rel_wql_gmean": 0.5719661183084246}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8726377917578133, "rel_wql_gmean": 0.592614882559852}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7867641705481724, "rel_wql_gmean": 0.5262034616384936}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.796120821098744, "rel_wql_gmean": 0.5639311517534341}}}, "group_skill_delta": {"term": {"long": 0.000688515410056656, "medium": 0.0011575283708018524, "short": 0.0014901274049188284}, "domain": {"Econ/Fin": 0.00016157821866547017, "Energy": 0.001000639067056941, "Healthcare": 0.002662258471812229, "Nature": 0.0018513947268330444, "Sales": 0.0008083539927374872, "Transport": 0.0014838928425447984, "Web/CloudOps": 0.0008134184492297747}, "frequency": {"A": -0.0015328471871469684, "D": 0.001650576543081539, "H": 0.0022887572023322367, "M": 0.001568276135474278, "Q": 0.0005554987964708769, "S": 0.0008400942689315016, "T": -4.595981691291051e-05, "W": 0.001297761302015643}, "variates": {"multivariate": 0.0008261815125067962, "univariate": 0.0015598232252683752}}}, {"cutoff": "backcast2_evals", "candidate_skill": 0.3663919854474046, "control_skill": 0.3655776712597705, "delta": 0.0008143141876341131, "candidate_checkpoint": "8a8c75cafcc7b42266aaab7d8458cb383b65313ce6da8c396e76760f7ab6e33c", "control_checkpoint": "b0204fa8dd3371d9160fc00545d6b065ccb23bb18e345b3b63cd39c024c9acf5", "candidate_eval_seconds": 27.486289501190186, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7953088149544144, "rel_wql_gmean": 0.4996096755729934}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7501176533122372, "rel_wql_gmean": 0.48427190952960675}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7590530702515095, "rel_wql_gmean": 0.5518616304717976}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8910028080228956, "rel_wql_gmean": 0.9090153927611655}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8964822493584549, "rel_wql_gmean": 0.6447823823916282}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6953195456910837, "rel_wql_gmean": 0.5923021345498765}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7473941447355391, "rel_wql_gmean": 0.35390534573607574}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5595224030106167, "rel_wql_gmean": 0.3565088201659599}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.660344029767428, "rel_wql_gmean": 0.4913050749063584}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6791691134724667, "rel_wql_gmean": 0.4624309685221128}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5829035875821179, "rel_wql_gmean": 0.7264587858196953}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7216162729509035, "rel_wql_gmean": 0.44462343258893994}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7508365315254176, "rel_wql_gmean": 0.4820459652982594}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8052269997952568, "rel_wql_gmean": 0.8287383490710489}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8327743553255724, "rel_wql_gmean": 0.8786257366461278}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9032744407555202, "rel_wql_gmean": 0.5624345613415964}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7545362929281816, "rel_wql_gmean": 0.5349308021919511}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8375766867886104, "rel_wql_gmean": 0.6323036672851485}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7798045061832288, "rel_wql_gmean": 0.51071682393504}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7518622900860272, "rel_wql_gmean": 0.5374153787920412}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7957101938303016, "rel_wql_gmean": 0.5022344522726042}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7493165290449147, "rel_wql_gmean": 0.48589148044854996}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7592133707158151, "rel_wql_gmean": 0.5526106392402376}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8916706823244112, "rel_wql_gmean": 0.9093796505356709}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8960744934624816, "rel_wql_gmean": 0.6460246578073142}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6984033526422165, "rel_wql_gmean": 0.5933308036019226}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7465754066379666, "rel_wql_gmean": 0.35465776917776354}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.559290997380798, "rel_wql_gmean": 0.3564560443374385}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6603838561435512, "rel_wql_gmean": 0.4940639621155883}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6792879027084646, "rel_wql_gmean": 0.46390410322974923}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5823310864214802, "rel_wql_gmean": 0.724835278367236}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7222253162661183, "rel_wql_gmean": 0.4441238921359276}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7510745160444832, "rel_wql_gmean": 0.48421048476502265}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8049624975185914, "rel_wql_gmean": 0.8337942280653755}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8327902926785946, "rel_wql_gmean": 0.8787396634191282}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9029763402504646, "rel_wql_gmean": 0.5665644057202113}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7538170530124115, "rel_wql_gmean": 0.5356891156947962}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8384463511921755, "rel_wql_gmean": 0.6337414984658606}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7796481341539873, "rel_wql_gmean": 0.5122582767435926}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.751963109653387, "rel_wql_gmean": 0.5386190816130975}}}, "group_skill_delta": {"term": {"long": 0.001813118688511195, "medium": 0.0006845240091615246, "short": 0.0005074509350241341}, "domain": {"Econ/Fin": 0.000517597400399139, "Energy": 0.0005589634714825431, "Healthcare": 0.001979792391606394, "Nature": 0.0002643534765498501, "Sales": -0.000125419204547228, "Transport": 0.0016142247413176714, "Web/CloudOps": 0.000941019076211469}, "frequency": {"A": -0.0010468271888456337, "D": -7.943744429916855e-05, "H": 0.0014447400321124793, "M": 0.002353445997096415, "Q": 6.364094872535198e-05, "S": 0.002494001407656099, "T": 0.00014706447971268855, "W": 0.001205092832584187}, "variates": {"multivariate": 0.0008882738557498548, "univariate": 0.000754141278159759}}}, {"cutoff": "backcast3_evals", "candidate_skill": 0.3944189531149003, "control_skill": 0.39329641531340254, "delta": 0.001122537801497736, "candidate_checkpoint": "8a8c75cafcc7b42266aaab7d8458cb383b65313ce6da8c396e76760f7ab6e33c", "control_checkpoint": "b0204fa8dd3371d9160fc00545d6b065ccb23bb18e345b3b63cd39c024c9acf5", "candidate_eval_seconds": 27.040369987487793, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7630985149735119, "rel_wql_gmean": 0.4725350133645792}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7698085741486138, "rel_wql_gmean": 0.5266243847552178}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7100434697374792, "rel_wql_gmean": 0.5006255974715387}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8383038632943011, "rel_wql_gmean": 0.8366308222162657}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8304111480226263, "rel_wql_gmean": 0.5510795950987446}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.760949862401154, "rel_wql_gmean": 0.6279690725140006}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7225753971084021, "rel_wql_gmean": 0.33438863534632185}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7484633257701082, "rel_wql_gmean": 0.47323557058437254}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5375796962872197, "rel_wql_gmean": 0.4438006197615724}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7142718339727447, "rel_wql_gmean": 0.5157945523195053}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5305194688789922, "rel_wql_gmean": 0.8023461655970939}, "D": {"n_configs": 15, "rel_mase_gmean": 0.71716815730984, "rel_wql_gmean": 0.41586511311811736}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7227420871078212, "rel_wql_gmean": 0.48256288452203877}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8329719738100956, "rel_wql_gmean": 0.8192530074442765}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7126783859560478, "rel_wql_gmean": 0.7670686175278189}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8390982398856982, "rel_wql_gmean": 0.5925052399969987}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7076040794946262, "rel_wql_gmean": 0.4625005200024812}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8115046791616632, "rel_wql_gmean": 0.6575335232234539}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7600950572390911, "rel_wql_gmean": 0.5091802342917834}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7126790884433649, "rel_wql_gmean": 0.4931789790094018}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7620982278020191, "rel_wql_gmean": 0.47426314781212775}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7694130571916938, "rel_wql_gmean": 0.5293555168619524}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7102997952164497, "rel_wql_gmean": 0.5023655717094271}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8390596184536422, "rel_wql_gmean": 0.8364410318397068}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8301807382152379, "rel_wql_gmean": 0.552148460325587}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7582486561812802, "rel_wql_gmean": 0.6324647241609418}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7235102474851808, "rel_wql_gmean": 0.33685653081795286}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7486059713981105, "rel_wql_gmean": 0.47352466437330154}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5373740999001123, "rel_wql_gmean": 0.4458528549155647}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7139121494179991, "rel_wql_gmean": 0.5182975401922782}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5305412273194996, "rel_wql_gmean": 0.8003515074386365}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7189848782726174, "rel_wql_gmean": 0.4168506671427805}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7218929902246265, "rel_wql_gmean": 0.48494043868982045}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8339835183539945, "rel_wql_gmean": 0.8257482517849524}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7130270287878929, "rel_wql_gmean": 0.7661662375161}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8378690834528353, "rel_wql_gmean": 0.5986481829064408}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7071701445283383, "rel_wql_gmean": 0.4630581494762598}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8116701266923606, "rel_wql_gmean": 0.6622668197361823}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7597234443787527, "rel_wql_gmean": 0.5110609184057446}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7127385729927525, "rel_wql_gmean": 0.49516529836403683}}}, "group_skill_delta": {"term": {"long": 0.0007026268936359825, "medium": 0.0014848786465334607, "short": 0.0011429872371131466}, "domain": {"Econ/Fin": 0.00028237705186429096, "Energy": 0.0005617783994764647, "Healthcare": 0.0012375905460411118, "Nature": 0.0021296078883320524, "Sales": 0.0002384836357876008, "Transport": 0.001034410096170113, "Web/CloudOps": 0.0013177282123868483}, "frequency": {"A": -0.0007981187712625681, "D": 0.001338827871026238, "H": 0.001105189791952066, "M": 0.003771657692377972, "Q": -0.0002543051765319104, "S": 0.003126441306062322, "T": 0.0001692224676280718, "W": 0.002699192407964013}, "variates": {"multivariate": 0.0009954700011264306, "univariate": 0.0012174798532288422}}}], "mean_delta": 0.0010185270802024193, "positive_cutoffs": 4, "outcome": "Declared primary6000/durability12000 diagnostic. No transfer formula or automatic publication is selected by this controller."} + +2026-10-23T10:22:49.515280+00:00: E141maximumGPUaudit821 passed: B32signed64/C4096/H1024, peak13306MiBreserved/12671.094238281allocated includingAdam/EMAplaceholders, freebefore23499.6875MiB, allgradientsfinite. Eager/compiledloss0.349611848593/0.349606692791, gradientcos0.999655369179 (>predeclared0.999), maxgradientdifference0.000694274902344, compilecomparison52.566907400s, total621.825011299s including557.020459669lockwait,0updates/no validation, initial/source hashesunchanged. Queued[{"name": "capacity_patch8_control", "queue_pid": 29105, "watch_pid": 29106}, {"name": "capacity_patch8_candidate", "queue_pid": 29107, "watch_pid": 29108}, {"comparison_pid": 29109}] sequentially: control waitsE13626926final12000; patch8candidate waitscontrolfinal12000. Actualsharedcode random_capacity, seed809/B32/LR2e-5/12kpairedcompiled, oldpack/slowAR/horizon300812, no newconcurrentallocation. E129final12000 matched width effect passed4of4, mean0.0010185270802024193; E139predeclared12ktransfer controller proceeds. E140fullscore exactlymatchesE1390.3843356309048914,0fail, inference478.566845837s; relocation andall97arrayidentity finalcheckpending. Cachebackup10:22:14 copied826files34431587bytes in37.224307003s. + +## E140 loader-only full replay, same E139model — selected +- Checkpoint SHA-256: `dfc20235aeb4b9fc799001d69f5be390d9892448dbbf51fc2abb8ca0be453bf7`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.384336; relative MASE 0.735964; relative WQL 0.515029. +- term skill: long=0.4011, medium=0.4090, short=0.3680. +- domain skill: Econ/Fin=0.1298, Energy=0.2414, Healthcare=0.4863, Nature=0.4435, Sales=0.3559, Transport=0.4733, Web/CloudOps=0.5003. +- frequency skill: A=0.3025, D=0.3768, H=0.3975, M=0.1484, Q=0.1892, S=0.4236, T=0.4396, W=0.2404. +- variates skill: multivariate=0.3965, univariate=0.3745. +- Outcome: Runtime-only meta-device construction preserves all97configurations/151170instances bitwise and complete scored metrics. No parameter, forecast arithmetic or training change. Shared-H100 median model load15.830805345s to8.647635335s acrossABBAAB six processes; relocation bitwise. Gate E138training/experts remain unchanged. + +2026-10-23T10:24:27.185694+00:00: E140 runtime adoption. Runtime-only meta-device construction preserves all97configurations/151170instances bitwise and complete scored metrics. No parameter, forecast arithmetic or training change. Shared-H100 median model load15.830805345s to8.647635335s acrossABBAAB six processes; relocation bitwise. Gate E138training/experts remain unchanged. Fullsuite {"status": "complete", "steps": [{"name": "full_public_replay", "returncode": 0, "seconds": 560.3487957720645}, {"name": "relocation", "returncode": 0, "seconds": 204.34823257708922}], "current_step": "relocation", "seconds": 765.6101541731041, "skill": 0.3843356309048914, "all97_bitwise_equal": true, "descriptor_sha256": "dfc20235aeb4b9fc799001d69f5be390d9892448dbbf51fc2abb8ca0be453bf7"}. Timing {"fixture": "unchanged E130 synthetic fixture, extreme/short/missing/constant histories; batch4", "order": "ABBAAB", "measurements": [{"order": 0, "loader": "original", "process_seconds": 20.24588763108477, "import_seconds": 1.4443256838712841, "load_seconds": 15.852897667093202, "forecast_seconds": 2.1752711760345846, "python_body_seconds": 19.472512820968404, "synthetic_forecasts_bitwise_equal": true}, {"order": 1, "loader": "meta", "process_seconds": 13.65355687099509, "import_seconds": 1.548527258913964, "load_seconds": 9.021844693925232, "forecast_seconds": 2.333743426948786, "python_body_seconds": 12.904134886106476, "synthetic_forecasts_bitwise_equal": true}, {"order": 2, "loader": "meta", "process_seconds": 12.357821244047955, "import_seconds": 1.4167155490722507, "load_seconds": 8.278879324207082, "forecast_seconds": 2.01220401795581, "python_body_seconds": 11.707830937113613, "synthetic_forecasts_bitwise_equal": true}, {"order": 3, "loader": "original", "process_seconds": 19.96071141399443, "import_seconds": 1.514954593963921, "load_seconds": 15.629903526045382, "forecast_seconds": 2.1864277741406113, "python_body_seconds": 19.331303440965712, "synthetic_forecasts_bitwise_equal": true}, {"order": 4, "loader": "original", "process_seconds": 20.090617951005697, "import_seconds": 1.3624230169225484, "load_seconds": 15.83080534520559, "forecast_seconds": 2.1589162528980523, "python_body_seconds": 19.352180532878265, "synthetic_forecasts_bitwise_equal": true}, {"order": 5, "loader": "meta", "process_seconds": 13.16387436306104, "import_seconds": 1.5226807829458266, "load_seconds": 8.647635334869847, "forecast_seconds": 2.1828685391228646, "python_body_seconds": 12.353214598959312, "synthetic_forecasts_bitwise_equal": true}], "original_load_median_seconds": 15.83080534520559, "meta_load_median_seconds": 8.647635334869847, "load_seconds_saved": 7.183170010335743, "relative_load_reduction": 0.4537463416231815, "all_predictions_bitwise_equal": true, "full_replay_gate_passed": true, "lock_wait_seconds": 83.4526801398024, "seconds": 182.9963137828745, "optimizer_updates": 0, "validation_data_read": false, "runtime_published": false}. All model/source hashes retained; runtime predict hash 4de2b53c821ad17baf1b78341dc4fb0bc170faab2493a4a64e0ec63c1e459c5c. + +E123 6000 four-cutoff comparison: {"label": "E123 6000 four-cutoff comparison", "utc": "2026-10-23T10:24:35.220389+00:00", "candidate": "log_horizon_ema6000", "control": "overflow_control_ema6000", "rows": [{"cutoff": "evals", "candidate_skill": 0.37865532008536973, "control_skill": 0.3782887645248565, "delta": 0.00036655556051323757, "candidate_checkpoint": "93e04b5c87662d05dfac2501f3d338fe6635300763ba7d66ed99ec753b000b54", "control_checkpoint": "b19875c52ed5024383fb69ccc48cb07a5629ad8011abf134c7dcfcdc50fae2af", "candidate_eval_seconds": 25.514965057373047, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7462064122793782, "rel_wql_gmean": 0.4817524267954395}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7121443784430227, "rel_wql_gmean": 0.49387218509984704}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7553622741098462, "rel_wql_gmean": 0.5442475085950527}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8866145181132203, "rel_wql_gmean": 0.8542324051707179}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8982853999565202, "rel_wql_gmean": 0.6438231700329504}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5653862223410185, "rel_wql_gmean": 0.4962622080758084}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8157537033224999, "rel_wql_gmean": 0.39922883495294803}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8466047087571053, "rel_wql_gmean": 0.5197982234309718}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6438808411251333, "rel_wql_gmean": 0.4424786699975036}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5661691110447804, "rel_wql_gmean": 0.4393097303977116}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6158224993578367, "rel_wql_gmean": 0.6419430340937796}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7721125920488169, "rel_wql_gmean": 0.5325599077168136}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7322206942759663, "rel_wql_gmean": 0.49840524191518587}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9806447422858212, "rel_wql_gmean": 0.8291341847839103}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7872225408587343, "rel_wql_gmean": 0.8305665588898373}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6576880286758843, "rel_wql_gmean": 0.50582210837238}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6933712031833571, "rel_wql_gmean": 0.454206485450446}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8998061918261053, "rel_wql_gmean": 0.6667766940735769}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7117852314964168, "rel_wql_gmean": 0.5118139617090144}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7703613664450539, "rel_wql_gmean": 0.5248564981862198}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7451158192819246, "rel_wql_gmean": 0.4809631678035488}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7120497644863014, "rel_wql_gmean": 0.4940812105058145}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7560063232433744, "rel_wql_gmean": 0.5455016162773587}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.891060652656678, "rel_wql_gmean": 0.8581226203181075}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8989380404519756, "rel_wql_gmean": 0.6435803440684917}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5710382040222995, "rel_wql_gmean": 0.5034944242351712}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8133075715765863, "rel_wql_gmean": 0.4004091491239218}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8446340518950459, "rel_wql_gmean": 0.5179589899563962}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6447526741433901, "rel_wql_gmean": 0.4427981539703199}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5645988459931921, "rel_wql_gmean": 0.4387078987240053}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6165351258073414, "rel_wql_gmean": 0.6464531739881929}, "D": {"n_configs": 15, "rel_mase_gmean": 0.777944381816132, "rel_wql_gmean": 0.5346411774818413}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7317515640788856, "rel_wql_gmean": 0.49890798111520296}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9655032792454371, "rel_wql_gmean": 0.8262938781338912}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7858131466267005, "rel_wql_gmean": 0.8312500357519329}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6555214893191091, "rel_wql_gmean": 0.504479335142133}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6939507700541674, "rel_wql_gmean": 0.45508640655176025}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8990798911693764, "rel_wql_gmean": 0.664987514515424}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7111159189621905, "rel_wql_gmean": 0.5120760043186128}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7711295953953445, "rel_wql_gmean": 0.5256252376142441}}}, "group_skill_delta": {"term": {"long": -0.0009292866400005817, "medium": 8.608201648374614e-05, "short": 0.001011902873017334}, "domain": {"Econ/Fin": 0.004163701849280277, "Energy": 0.0001327324287423437, "Healthcare": 0.0065059814819156125, "Nature": -1.4551210729463193e-05, "Sales": -0.0019458206083642349, "Transport": 0.0005540362326413861, "Web/CloudOps": -0.0010333352414531038}, "frequency": {"A": 0.002569809970611181, "D": 0.003673625478569753, "H": 0.0001109500640047445, "M": -0.0085222577976527, "Q": -0.00039182591339348427, "S": -0.0017156017197644813, "T": 0.0007780433766471084, "W": -0.001352172614520919}, "variates": {"multivariate": -0.00012942702152285435, "univariate": 0.0007827047080517513}}}, {"cutoff": "backcast_evals", "candidate_skill": 0.3355749732404827, "control_skill": 0.33515646486891926, "delta": 0.0004185083715634308, "candidate_checkpoint": "93e04b5c87662d05dfac2501f3d338fe6635300763ba7d66ed99ec753b000b54", "control_checkpoint": "b19875c52ed5024383fb69ccc48cb07a5629ad8011abf134c7dcfcdc50fae2af", "candidate_eval_seconds": 25.02743911743164, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7745769572441988, "rel_wql_gmean": 0.46493400574379684}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7751495127352199, "rel_wql_gmean": 0.5332025260186516}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8173284976358717, "rel_wql_gmean": 0.5986697059120546}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8823174592655021, "rel_wql_gmean": 0.8140986667594712}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8888687691141154, "rel_wql_gmean": 0.6687728487218596}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6292078899714746, "rel_wql_gmean": 0.5404132417192778}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9361702976595294, "rel_wql_gmean": 0.43476436500743626}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7331386222696689, "rel_wql_gmean": 0.4985191261071979}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7392860085399551, "rel_wql_gmean": 0.532495053175624}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6633982972820373, "rel_wql_gmean": 0.4586366826408607}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.65213406143564, "rel_wql_gmean": 0.7240462300238811}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8394329557085416, "rel_wql_gmean": 0.5006199813037504}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7767400572890936, "rel_wql_gmean": 0.5159920514316604}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8694179661107201, "rel_wql_gmean": 0.8006468014326326}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7601338042952481, "rel_wql_gmean": 0.7677264103120457}, "S": {"n_configs": 6, "rel_mase_gmean": 0.85406082311329, "rel_wql_gmean": 0.5085109918154127}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7681372055210357, "rel_wql_gmean": 0.576462101174773}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8728363344447978, "rel_wql_gmean": 0.5817005287102098}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7895875858567248, "rel_wql_gmean": 0.5309359385983964}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.8059642824146065, "rel_wql_gmean": 0.5707588405936942}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7750842285105053, "rel_wql_gmean": 0.46538535076726445}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7739741905332832, "rel_wql_gmean": 0.534827984372569}, "short": {"n_configs": 55, "rel_mase_gmean": 0.818371751293216, "rel_wql_gmean": 0.5985153782895438}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.887916619787545, "rel_wql_gmean": 0.8185770809200361}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8901417181128463, "rel_wql_gmean": 0.6693878286037928}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6334453098405051, "rel_wql_gmean": 0.5437528735999733}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9321426691826549, "rel_wql_gmean": 0.43340604882484346}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7321691335963859, "rel_wql_gmean": 0.4977340558431129}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7394280206962279, "rel_wql_gmean": 0.5327250385233748}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6634585442750054, "rel_wql_gmean": 0.4591816165371809}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6523615189029875, "rel_wql_gmean": 0.7262242686636398}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8405439241384891, "rel_wql_gmean": 0.5009731755165275}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7770655988729349, "rel_wql_gmean": 0.5160636056826207}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8620023507565068, "rel_wql_gmean": 0.7924280387937057}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7600409188395882, "rel_wql_gmean": 0.7689369191610511}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8521465319527592, "rel_wql_gmean": 0.5084037872669025}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7696065791080199, "rel_wql_gmean": 0.577900906515431}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8747966347792652, "rel_wql_gmean": 0.5837934687567188}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7902103277834961, "rel_wql_gmean": 0.5315871703126607}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.8062350844786952, "rel_wql_gmean": 0.5709428531788484}}}, "group_skill_delta": {"term": {"long": 0.00048778063938359484, "medium": 0.0004908568774791844, "short": 0.0003560652924083918}, "domain": {"Econ/Fin": 0.005020238482787098, "Energy": 0.0009065493098369126, "Healthcare": 0.003765290994097392, "Nature": -0.002369074951698802, "Sales": -0.0008757551686336962, "Transport": 0.00019575153275108725, "Web/CloudOps": 0.0003526564281545186}, "frequency": {"A": 0.001152753642942761, "D": 0.0006576219064280409, "H": 0.00017655561039986445, "M": -0.007840692723027232, "Q": 0.0005553045660217082, "S": -0.0008083634787563465, "T": 0.0014668633412805443, "W": 0.002081864480944051}, "variates": {"multivariate": 0.000652398893651096, "univariate": 0.00022327616229211866}}}, {"cutoff": "backcast2_evals", "candidate_skill": 0.3602013522615043, "control_skill": 0.35970579873679454, "delta": 0.0004955535247097576, "candidate_checkpoint": "93e04b5c87662d05dfac2501f3d338fe6635300763ba7d66ed99ec753b000b54", "control_checkpoint": "b19875c52ed5024383fb69ccc48cb07a5629ad8011abf134c7dcfcdc50fae2af", "candidate_eval_seconds": 23.198112964630127, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.8007882701401953, "rel_wql_gmean": 0.5047283084069593}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7557560073891201, "rel_wql_gmean": 0.4916203116994603}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7630878462331969, "rel_wql_gmean": 0.5595177016373934}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8944037265353993, "rel_wql_gmean": 0.9103819438899337}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8966901108295002, "rel_wql_gmean": 0.6460978068690744}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.688975950767024, "rel_wql_gmean": 0.592555229178715}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7610450511402209, "rel_wql_gmean": 0.36488567517584497}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.562690295341662, "rel_wql_gmean": 0.3611688235519399}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.668656336123287, "rel_wql_gmean": 0.5017149578822506}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6836872181760263, "rel_wql_gmean": 0.47194042832761307}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5812476180954884, "rel_wql_gmean": 0.7344030570354311}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7298461049411038, "rel_wql_gmean": 0.4501889971326194}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7556004160164702, "rel_wql_gmean": 0.49005904403471334}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8207563558352381, "rel_wql_gmean": 0.8461681486884118}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8332490430298408, "rel_wql_gmean": 0.8745223235906323}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9104095668288751, "rel_wql_gmean": 0.5690729222581083}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7550352242447472, "rel_wql_gmean": 0.5407368948130437}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8453218961356106, "rel_wql_gmean": 0.6402431587905859}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7819390810291392, "rel_wql_gmean": 0.5177722839678629}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7585309693695085, "rel_wql_gmean": 0.5444650192108228}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.8007838015734439, "rel_wql_gmean": 0.5057608145580296}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7549215312107497, "rel_wql_gmean": 0.49176726739734045}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7642838919526312, "rel_wql_gmean": 0.5599238938428742}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8997976584221669, "rel_wql_gmean": 0.9109410837720314}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8969828992939779, "rel_wql_gmean": 0.6477417063864679}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6849313799294706, "rel_wql_gmean": 0.586932347321718}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7624727427382104, "rel_wql_gmean": 0.3657161858629389}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5639287429478652, "rel_wql_gmean": 0.36145769293128766}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6689876132941273, "rel_wql_gmean": 0.5020608717418806}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6837785683593893, "rel_wql_gmean": 0.4719606763184108}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5811330636284028, "rel_wql_gmean": 0.7336592636608978}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7329769702098001, "rel_wql_gmean": 0.45167764562697754}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7553820928392463, "rel_wql_gmean": 0.4904273479694985}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8254186064766647, "rel_wql_gmean": 0.8515799856418855}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8324909356393811, "rel_wql_gmean": 0.8724694350490023}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9100541095744552, "rel_wql_gmean": 0.5693729069160721}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7550799772409099, "rel_wql_gmean": 0.540387432745741}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8437173750489751, "rel_wql_gmean": 0.6406981711171287}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7818465318697899, "rel_wql_gmean": 0.5175870710427966}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7594977958239505, "rel_wql_gmean": 0.545505930798867}}}, "group_skill_delta": {"term": {"long": 0.0006481605837891369, "medium": -0.0002455649395277648, "short": 0.0007492039088975444}, "domain": {"Econ/Fin": 0.0029947568262879143, "Energy": 0.0010921150561006288, "Healthcare": -0.004908064064340523, "Nature": 0.0010939856920688662, "Sales": 0.0006762696777590227, "Transport": 0.0003431454765271402, "Web/CloudOps": 5.013321128011228e-05}, "frequency": {"A": -0.00039529044588337836, "D": 0.002177116752944852, "H": 0.00014066995196726495, "M": 0.005031861953157191, "Q": -0.0013904788500725962, "S": 4.9124966616798105e-05, "T": -0.00018757494776133754, "W": -0.00043740566160055394}, "variates": {"multivariate": -0.00015146401492227568, "univariate": 0.0010238338735453212}}}, {"cutoff": "backcast3_evals", "candidate_skill": 0.38907558897446926, "control_skill": 0.38966768132876584, "delta": -0.0005920923542965806, "candidate_checkpoint": "93e04b5c87662d05dfac2501f3d338fe6635300763ba7d66ed99ec753b000b54", "control_checkpoint": "b19875c52ed5024383fb69ccc48cb07a5629ad8011abf134c7dcfcdc50fae2af", "candidate_eval_seconds": 23.680344820022583, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7664246505375552, "rel_wql_gmean": 0.47534894929206173}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7709957271601952, "rel_wql_gmean": 0.5294283944280077}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7149741232259509, "rel_wql_gmean": 0.5093015850008509}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8424499300311005, "rel_wql_gmean": 0.8303231924998296}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8374647244682922, "rel_wql_gmean": 0.5575694446439766}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7857226277604137, "rel_wql_gmean": 0.6537514857046645}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7124684885559982, "rel_wql_gmean": 0.3430594466733129}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7566325282058416, "rel_wql_gmean": 0.4795753787008562}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5435574634738487, "rel_wql_gmean": 0.44919808683312046}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7162827342267492, "rel_wql_gmean": 0.5164612267993445}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.531608948400588, "rel_wql_gmean": 0.7861714391766957}, "D": {"n_configs": 15, "rel_mase_gmean": 0.725097373265854, "rel_wql_gmean": 0.42550690476480174}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7273265837892093, "rel_wql_gmean": 0.48888496583136964}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8647563430569731, "rel_wql_gmean": 0.8541402251007794}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7205367518569639, "rel_wql_gmean": 0.7742457404206831}, "S": {"n_configs": 6, "rel_mase_gmean": 0.84233390958665, "rel_wql_gmean": 0.6016125828203523}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7064579182180134, "rel_wql_gmean": 0.46230456148625915}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8114993968088045, "rel_wql_gmean": 0.6733854704706034}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7662618656430447, "rel_wql_gmean": 0.5154197000500024}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7148181916718245, "rel_wql_gmean": 0.49935817984419606}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7650747158835133, "rel_wql_gmean": 0.4758888221311058}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7703157746376595, "rel_wql_gmean": 0.5298503011269557}, "short": {"n_configs": 54, "rel_mase_gmean": 0.713915671760059, "rel_wql_gmean": 0.5084844315057424}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8452403065316382, "rel_wql_gmean": 0.8277399249864468}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8346950467324626, "rel_wql_gmean": 0.5567599695672222}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7876375654704325, "rel_wql_gmean": 0.6565412569519505}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.710238739553539, "rel_wql_gmean": 0.34191077293082645}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7563686587019305, "rel_wql_gmean": 0.4784563222634317}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5433317817040721, "rel_wql_gmean": 0.4493168613990946}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7161526533494015, "rel_wql_gmean": 0.5178489398382691}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5311143622209655, "rel_wql_gmean": 0.7781586196577971}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7234708846594775, "rel_wql_gmean": 0.42486757337507386}, "H": {"n_configs": 29, "rel_mase_gmean": 0.725973846929309, "rel_wql_gmean": 0.48863382838793346}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8623268790180476, "rel_wql_gmean": 0.8523275939235515}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7182632014266673, "rel_wql_gmean": 0.7707135583961491}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8408993113146807, "rel_wql_gmean": 0.5989715147638536}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7064723895859075, "rel_wql_gmean": 0.463139705670842}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8096257056910313, "rel_wql_gmean": 0.6721758032092567}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7638007775200529, "rel_wql_gmean": 0.5152023145873739}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7148285566222029, "rel_wql_gmean": 0.49905178580637044}}}, "group_skill_delta": {"term": {"long": -0.00018943603376742058, "medium": -2.7379716044273472e-05, "short": -0.0009307633618287348}, "domain": {"Econ/Fin": 7.976553499244865e-05, "Energy": -0.00162629021511429, "Healthcare": 0.0024022762439499523, "Nature": -0.0016013077695871125, "Sales": -0.0008081416482458303, "Transport": -3.728085080112464e-05, "Web/CloudOps": 0.0007612806484328383}, "frequency": {"A": -0.0036022247600432378, "D": -0.0010403139190640065, "H": -0.0007078203907763259, "M": -0.002119234073469034, "Q": -0.0028823008291861685, "S": -0.0021693930154538243, "T": 0.0005218167541891638, "W": -0.0015174000286153344}, "variates": {"multivariate": -0.0011423683985309907, "univariate": -0.00017898927207837811}}}], "mean_delta": 0.00017213127562246133, "positive_cutoffs": 3, "outcome": "Declared primary6000/durability12000 diagnostic. No transfer formula or automatic publication is selected by this controller."} + +## E143: low-frequency synthetic generation-origin window study +2026-10-23T10:27:02.767973+00:00: E113short low-frequency windows failed primary/final; E123log horizons primary passes3of4 overall but monthlyregresses3of4. Hypothesis: E113selected synthetic shortviews are often late crops of long damped-trend/zero-initialized-AR paths, hiding early dynamics. Change only the origin of selected low-frequency SYNTHETIC views: retain exactly E113selected rows, context/horizon lengths, sign, period, masks and all three RNG streams; for a successfully shortened selected synthetic row, use the first nc+nh finite observations of that same already-generated raw path, split at nc. No regeneration, new random draws, changed source probabilities or real-row changes. Original synthetic paths start at generator time0; keep real and unselected rows bitwise equal toE113. This changes process age, including its noise/seasonal path slice, not window-length distributions. Architecture remains exactE80/E113model; initialize same ownE62 22c08571...,seed197/B64/LR2e-5/12kpaired/oldpack/originalAR/horizon300200/lowfreq1200200. Primary6k,1/3diagnostics,12durability; allfour matchedagainstE113, also report originalE80 reference before any later transfer proposal. No transfer/ensemble formula selected. Queue only after audits, following E138gate12000 in its allocation. CPUfixture829 compares candidate, unchangedE113 and rawOriginalSampler over matched batches: masks/counts/periods, all RNGs, exact prefix content, unchanged real/unselected rows, measured age distribution andchanged-row fraction. GPUfixture839 checks maximumB64C4096H1024 gradients and modelinitiality,0updates. No validation training; no extra concurrent trainer. + +E138 bounded learned gate with frozen E130 experts seed751 training started at 2026-10-23T10:27:05Z, after the declared dependency processes exited; required checkpoint files are present. Settings are unchanged from the declared comparison. + +## E139 width-treatment transfer12000 valid_screen +- Checkpoint SHA-256: `0b11b7351a4a92d1d18c71a4159ec445be3a94ace8c7a9fa0edafad87d14e960`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 28.310531616210938 seconds. +- Overall skill 0.387520; relative MASE 0.733331; relative WQL 0.511544. +- term skill: long=0.4091, medium=0.4104, short=0.3700. +- domain skill: Econ/Fin=0.1459, Energy=0.2422, Healthcare=0.4758, Nature=0.4455, Sales=0.3392, Transport=0.4746, Web/CloudOps=0.5119. +- frequency skill: A=0.3742, D=0.3751, H=0.4081, M=0.1041, Q=0.2058, S=0.4261, T=0.4443, W=0.2245. +- variates skill: multivariate=0.4021, univariate=0.3757. +- Outcome: Fixed zero-extended E117first + E129 - zero-extended E119, coefficient1. No E128dispersion correction; no optimizer update. Equal-quarter ensemble selected separately. + +## E139 width-treatment transfer12000 valid_backcast +- Checkpoint SHA-256: `0b11b7351a4a92d1d18c71a4159ec445be3a94ace8c7a9fa0edafad87d14e960`. +- Evaluation: 97 configurations, 9330 instances, 0 failed configurations; 27.502727031707764 seconds. +- Overall skill 0.343890; relative MASE 0.788701; relative WQL 0.545809. +- term skill: long=0.4003, medium=0.3644, short=0.3127. +- domain skill: Econ/Fin=0.1771, Energy=0.2297, Healthcare=0.3741, Nature=0.3925, Sales=0.4042, Transport=0.3810, Web/CloudOps=0.4586. +- frequency skill: A=0.3220, D=0.3633, H=0.3791, M=0.1943, Q=0.2316, S=0.3397, T=0.3382, W=0.2887. +- variates skill: multivariate=0.3594, univariate=0.3313. +- Outcome: Fixed zero-extended E117first + E129 - zero-extended E119, coefficient1. No E128dispersion correction; no optimizer update. Equal-quarter ensemble selected separately. + +## E139 width-treatment transfer12000 valid_backcast2 +- Checkpoint SHA-256: `0b11b7351a4a92d1d18c71a4159ec445be3a94ace8c7a9fa0edafad87d14e960`. +- Evaluation: 94 configurations, 8934 instances, 0 failed configurations; 24.989196062088013 seconds. +- Overall skill 0.366048; relative MASE 0.764590; relative WQL 0.525635. +- term skill: long=0.3729, medium=0.3948, short=0.3520. +- domain skill: Econ/Fin=0.1344, Energy=0.2395, Healthcare=0.3026, Nature=0.4850, Sales=0.5507, Transport=0.4293, Web/CloudOps=0.4457. +- frequency skill: A=0.3479, D=0.4284, H=0.4004, M=0.1462, Q=0.1543, S=0.2879, T=0.3704, W=0.2617. +- variates skill: multivariate=0.3723, univariate=0.3610. +- Outcome: Fixed zero-extended E117first + E129 - zero-extended E119, coefficient1. No E128dispersion correction; no optimizer update. Equal-quarter ensemble selected separately. + +## E139 width-treatment transfer12000 valid_backcast3 +- Checkpoint SHA-256: `0b11b7351a4a92d1d18c71a4159ec445be3a94ace8c7a9fa0edafad87d14e960`. +- Evaluation: 93 configurations, 8812 instances, 0 failed configurations; 26.174396991729736 seconds. +- Overall skill 0.392430; relative MASE 0.738716; relative WQL 0.499707. +- term skill: long=0.3967, medium=0.3652, short=0.4007. +- domain skill: Econ/Fin=0.1856, Energy=0.3243, Healthcare=0.2332, Nature=0.5002, Sales=0.4071, Transport=0.5169, Web/CloudOps=0.3961. +- frequency skill: A=0.3623, D=0.4497, H=0.4099, M=0.1429, Q=0.2639, S=0.2800, T=0.4328, W=0.2495. +- variates skill: multivariate=0.3764, univariate=0.4048. +- Outcome: Fixed zero-extended E117first + E129 - zero-extended E119, coefficient1. No E128dispersion correction; no optimizer update. Equal-quarter ensemble selected separately. + +E139 fixed width-treatment equal-quarter ensemble diagnostics: {"duration": 12, "rows": [{"cutoff": "valid_screen", "skill": 0.3880940716647685, "control_skill": 0.3878507268780589, "delta": 0.00024334478670962056, "groups": {"term": {"short": 0.3718361126433063, "medium": 0.41047787687286896, "long": 0.4070163737461161}, "domain": {"Econ/Fin": 0.1488229748585247, "Energy": 0.247964055732541, "Healthcare": 0.4809027473693035, "Nature": 0.44352650768790447, "Sales": 0.34256789285366673, "Transport": 0.47310196832544604, "Web/CloudOps": 0.5083316851449597}, "freq": {"A-DEC": 0.3830952988223687, "Q-DEC": 0.20467537519703682, "M": 0.12390254877378837, "W-SUN": 0.09450096808121189, "D": 0.37275151579100685, "H": 0.4027073080058312, "15T": 0.21611553985351117, "W-FRI": 0.018967985259529585, "10T": 0.6269959285933837, "W-TUE": 0.6124123403873277, "W-THU": 0.2268102199847829, "W-WED": 0.3225344724675915, "5T": 0.5239433705854297, "10S": 0.4236958122200234}}, "member_checkpoint_hashes": ["0b11b7351a4a92d1d18c71a4159ec445be3a94ace8c7a9fa0edafad87d14e960", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c"], "cpu_seconds": 1.6809547890443355}, {"cutoff": "valid_backcast", "skill": 0.3448104609077517, "control_skill": 0.34441110518308204, "delta": 0.00039935572466964775, "groups": {"term": {"short": 0.31245915335733965, "medium": 0.36362389340881796, "long": 0.4054350296920991}, "domain": {"Econ/Fin": 0.18126455901870764, "Energy": 0.23553281949198923, "Healthcare": 0.40340386557544006, "Nature": 0.3796461943741479, "Sales": 0.40735666854345987, "Transport": 0.3765206196971741, "Web/CloudOps": 0.45926117581551074}, "freq": {"A-DEC": 0.33497124765846853, "Q-DEC": 0.2330478195417287, "M": 0.1971724324218872, "W-SUN": 0.054978160901529294, "D": 0.3623003627918472, "H": 0.37563617715620035, "15T": 0.2237740903317258, "W-FRI": 0.23889383471934988, "10T": 0.33382559175453563, "W-TUE": 0.5282101735908391, "W-THU": 0.2699481170031097, "W-WED": 0.3579223791574039, "5T": 0.44639393817344386, "10S": 0.3494866279841966}}, "member_checkpoint_hashes": ["0b11b7351a4a92d1d18c71a4159ec445be3a94ace8c7a9fa0edafad87d14e960", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c"], "cpu_seconds": 1.3834715059492737}, {"cutoff": "valid_backcast2", "skill": 0.36880549401636464, "control_skill": 0.3685168155758046, "delta": 0.00028867844056001957, "groups": {"term": {"short": 0.3557792125839013, "medium": 0.3976234159515164, "long": 0.37283637415331294}, "domain": {"Econ/Fin": 0.1279512813804744, "Energy": 0.24000021529474358, "Healthcare": 0.36887674104298807, "Nature": 0.4823897557215715, "Sales": 0.5594334224806643, "Transport": 0.42685460130823527, "Web/CloudOps": 0.4459311887907168}, "freq": {"A-DEC": 0.338334357927663, "Q-DEC": 0.15206458144058743, "M": 0.1698603515590016, "W-SUN": 0.07845860079783107, "D": 0.4357602074273158, "H": 0.40005281620046274, "15T": 0.10570069438527652, "W-FRI": 0.15750144786315068, "10T": 0.5103185468905502, "W-TUE": 0.17377501969975284, "W-THU": 0.33380296904542994, "W-WED": 0.5582895692455323, "5T": 0.4774074622724199, "10S": 0.2915269307225671}}, "member_checkpoint_hashes": ["0b11b7351a4a92d1d18c71a4159ec445be3a94ace8c7a9fa0edafad87d14e960", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c"], "cpu_seconds": 1.9184009530581534}, {"cutoff": "valid_backcast3", "skill": 0.3916700540609932, "control_skill": 0.3912834616582097, "delta": 0.00038659240278349216, "groups": {"term": {"short": 0.39665594368150614, "medium": 0.3726936875567748, "long": 0.3970868799589885}, "domain": {"Econ/Fin": 0.18900504765867832, "Energy": 0.31991046115705724, "Healthcare": 0.23584447967070232, "Nature": 0.5087575358785668, "Sales": 0.3990721070656553, "Transport": 0.5095530506864195, "Web/CloudOps": 0.39754690098606627}, "freq": {"A-DEC": 0.35351115435794767, "Q-DEC": 0.2617314512834785, "M": 0.15027823393361794, "W-SUN": 0.1701517578741646, "D": 0.4415953734285615, "H": 0.40774874323266697, "15T": 0.2630174882655655, "W-FRI": 0.04539106764289902, "10T": 0.6020760681644033, "W-TUE": 0.28156959554735794, "W-THU": 0.35210625055136835, "W-WED": 0.36540966729932056, "5T": 0.4693489584952465, "10S": 0.2889018833518858}}, "member_checkpoint_hashes": ["0b11b7351a4a92d1d18c71a4159ec445be3a94ace8c7a9fa0edafad87d14e960", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c"], "cpu_seconds": 1.126626624027267}], "positive_cutoffs": 4, "mean_delta": 0.000329492838680695, "selection_gate_passed": true}. Full replay/runtime checks and comparison to current publication required before any promotion. + +2026-10-23T10:31:23.864747+00:00: E140runtime published10:24:27.185694UTC with all97forecasts/151170instances bitwiseunchanged; same descriptor dfc20235..., predictSHA4de2b53c821ad17baf1b78341dc4fb0bc170faab2493a4a64e0ec63c1e459c5c. Fullsuite765.610154173s, fullinference478.566845837s, relocation24.125692660s; score0.3843356309048914. Shared four_member_ensemble/runtime/predict.py nowuses auditedmeta construction; E138training/experts loader unchanged. E132andE142fullpipeline active; E13912transfer0b11b7351a4a92d1d18c71a4159ec445be3a94ace8c7a9fa0edafad87d14e960 passed4of4vsE130,3of4vscurrentwidth6; fullsuite queued, no publication. E142latest longterm diagnostic regresses0.001008571versusE139width6 despitepositiveaggregate; earlier longgroups improve. All tradeoffs remain inreports. + +2026-10-23T10:31:23.864747+00:00: E123log_horizon completed2026-10-23T10:27:03Z, process2411.322815848049s, {"completed_step": 12000, "training_process_loop_seconds": 2398.8343433369882}. Primary6k3of4positive/mean+0.000172131276; monthlynegative3of4 andlatestlongnegative0.000929287. No transferselected yet; awaitscheduledfinaldurability. E138gate started10:27 afterE123; only6340paramsoptimized withfixedE130experts. E143synthetic-origin CPUaudit8192rows acrossseeds197/829:251originresetrows/235actuallychanged, fraction0.0286865234; all7941otherrowsbitwiseequal; masks/counts/periods/allRNGstreams exact. Oldage mean2442.697211/median2269/max4984→0; meancontext/horizon197.4741/7.54183 unchanged. Originalsynthetic flags independentlychecked againstrecordedgeneratorcalls. CPU9.716736370s,0updates/no validation. Samplerrecovery audit andGPU839 maxshape pending; NOTQUEUED. Shared trainer/publisher metadata-only support added for newlowfreq_age codepath; all existing paths unchanged. + +E131 fresh146M learned seasonal summaries seed307 training started at 2026-10-23T10:36:09Z, after the declared dependency processes exited; required checkpoint files are present. Settings are unchanged from the declared comparison. + +## E132 final146M fourth replacement full replay — not selected +- Checkpoint SHA-256: `2eb9f5a1c466d0b134bd6e1654084872257eb5250debdf70bb5ff91b4f992788`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.384297; relative MASE 0.736378; relative WQL 0.514803. +- term skill: long=0.4000, medium=0.4094, short=0.3682. +- domain skill: Econ/Fin=0.1297, Energy=0.2406, Healthcare=0.4991, Nature=0.4411, Sales=0.3580, Transport=0.4725, Web/CloudOps=0.4997. +- frequency skill: A=0.3046, D=0.3758, H=0.3980, M=0.1500, Q=0.1918, S=0.4240, T=0.4382, W=0.2445. +- variates skill: multivariate=0.3962, univariate=0.3747. +- Outcome: All 97 configurations and 151170 instances passed, but full skill 0.384297081868 is below current E139 0.384335630905 by 0.000038549037. Diagnostic improvement did not carry to the full validation panel. Runtime relocation and independent composition passed. Keep current package; fixed E142 combination is evaluated separately. + +2026-10-23T10:37:49.051282+00:00: E132 final fresh146M replacement complete, rejected against current E139. {"candidate": "/workspace/research/valid-report-fresh-capacity96-ensemble.json", "parent": "/workspace/research/valid-report-width6-ensemble.json", "candidate_hash": "2eb9f5a1c466d0b134bd6e1654084872257eb5250debdf70bb5ff91b4f992788", "parent_hash": "dfc20235aeb4b9fc799001d69f5be390d9892448dbbf51fc2abb8ca0be453bf7", "skill_difference": -3.8549037296498057e-05, "n_configs": 97, "n_dataset_clusters": 28, "improved_configs": 58, "bootstrap_seed": 317, "bootstrap_samples": 5000, "dataset_cluster_delta_percentiles": {"p025": -0.0017987775569960063, "p50": -6.69091715608805e-05, "p975": 0.00186898954741802}, "note": "Descriptive resampling only. Adaptive validation selection and reused windows prevent treating this as a held-out significance test."}. Fullsuite {"package": "/workspace/research/candidate-fresh-capacity96-ensemble", "status": "complete", "steps": [{"name": "synthetic_composition", "returncode": 0, "seconds": 36.56581411208026}, {"name": "relocation", "returncode": 0, "seconds": 79.25890716700815}, {"name": "full_public_replay", "returncode": 0, "seconds": 517.8466667379253}, {"name": "independent_fresh_member", "returncode": 0, "seconds": 116.02587331691757}, {"name": "composition", "returncode": 0, "seconds": 0.2465963999275118}, {"name": "descriptive_comparison", "returncode": 0, "seconds": 0.14853956899605691}], "current_step": "descriptive_comparison", "seconds": 750.1023201830685, "skill": 0.3842970818675949}. E142 fixed joint remains separately in full validation; no new coefficient search. + +2026-10-23T10:37:49.051282+00:00: E143 process-age study queued after E138 final12000. CPU 8192 rows and exact sampler recovery passed; GPU {"fixture_seed": 839, "training_seed": 197, "initial_checkpoint_sha256": "22c08571978be31ba57368eb983089a40a44d56d4ae5e17da41afd2a761a258c", "parameters": 36800800, "batch": 64, "signed_rows": 128, "context": 4096, "horizon": 1024, "changed_origin_rows": 5, "loss": 0.27946507930755615, "all_gradients_finite": true, "initial_parameters_bitwise_unchanged": true, "model_source_byte_identical": true, "peak_allocated_mib": 5783.81689453125, "peak_reserved_mib": 6266.0, "includes_adam_and_ema_placeholders": true, "lock_wait_seconds": 398.92589370394126, "seconds": 408.2387276128866, "optimizer_updates": 0, "validation_data_read": false}. Recovery {"seed": 197, "changed_origin_rows": 1, "rng_names": ["rng", "horizon_rng", "lowfreq_rng"], "arrays_and_age_metadata_bitwise_equal": true, "rng_end_states_bitwise_equal": true, "additional_persistent_sampler_state_required": false, "seconds": 3.593586537055671, "optimizer_updates": 0, "validation_data_read": false}. Seed197/B64/LR2e-5/original12k schedule, same E113 initial22c085... and architecture. No validation used for training. Queue29836/watch29837/matched29838/reference29839; persistent session61462. E94 final96000 completed10:36:05, process21577.931560865s/loop21549.731918170s; E131 started10:36:09 on freed allocation, final E94 evaluation pending. + +E136 6000 four-cutoff comparison: {"label": "E136 6000 four-cutoff comparison", "utc": "2026-10-23T10:38:33.022534+00:00", "candidate": "direct_trend_head_ema6000", "control": "long_seasonal_ema6000", "rows": [{"cutoff": "evals", "candidate_skill": 0.38278101206010395, "control_skill": 0.38227466722292214, "delta": 0.0005063448371818158, "candidate_checkpoint": "fb0c9d03d2553d9f54c2e10a65c0d4be1a24378569a8a23260bae026fab464b7", "control_checkpoint": "ad45e0cfae574d3dc1be0b9720c9be0863db9ffe33891fdb22c86dfa83667253", "candidate_eval_seconds": 28.18398880958557, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7405286822510679, "rel_wql_gmean": 0.47815289625292473}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7098466409104937, "rel_wql_gmean": 0.49273280479882475}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7487902344550451, "rel_wql_gmean": 0.5405241839882021}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8885757607542428, "rel_wql_gmean": 0.8560105262486205}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.896865896857373, "rel_wql_gmean": 0.6417519337394582}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.57210565628962, "rel_wql_gmean": 0.5054745063696781}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8025539119446234, "rel_wql_gmean": 0.3983162431465755}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8419405550999579, "rel_wql_gmean": 0.5158994080757854}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6321298413405132, "rel_wql_gmean": 0.4333564919287113}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5608853879574, "rel_wql_gmean": 0.4347651717202102}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6176051344653356, "rel_wql_gmean": 0.6475870918735755}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7576437755821, "rel_wql_gmean": 0.5207339801102654}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7253222127375288, "rel_wql_gmean": 0.4952653450154947}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9618996553464796, "rel_wql_gmean": 0.8274106367297241}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.783576833064113, "rel_wql_gmean": 0.8303585401738374}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6546604495433772, "rel_wql_gmean": 0.5030010524751672}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6923259345252674, "rel_wql_gmean": 0.453162524716402}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9042614158747945, "rel_wql_gmean": 0.6712662529903971}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7081206446758993, "rel_wql_gmean": 0.510165348306591}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.763446087094821, "rel_wql_gmean": 0.5205507164597446}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7402530882128023, "rel_wql_gmean": 0.47826753514082926}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.710265197438745, "rel_wql_gmean": 0.4931672821758772}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7498589240481417, "rel_wql_gmean": 0.5410407688872414}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8892029615768211, "rel_wql_gmean": 0.85541375158805}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8972340808013708, "rel_wql_gmean": 0.6419310799963354}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5749908408040473, "rel_wql_gmean": 0.507856444781463}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8028566989060131, "rel_wql_gmean": 0.39889278962700064}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8421494671087474, "rel_wql_gmean": 0.5162975438622042}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6323849322594254, "rel_wql_gmean": 0.43339253239569303}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5616650304722973, "rel_wql_gmean": 0.43523931575775593}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.61692642682572, "rel_wql_gmean": 0.6469875043190525}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7604157827225532, "rel_wql_gmean": 0.5223254859979091}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7256889701473604, "rel_wql_gmean": 0.49536285168895955}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9611837530785082, "rel_wql_gmean": 0.8278616039641923}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7839583182238047, "rel_wql_gmean": 0.830360300010519}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6548591866261223, "rel_wql_gmean": 0.5032338833413911}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6926762306120622, "rel_wql_gmean": 0.45361994505793396}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9042490502981876, "rel_wql_gmean": 0.6703742252767426}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7084778976708436, "rel_wql_gmean": 0.510408775576821}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7643134428569803, "rel_wql_gmean": 0.5210866729603522}}}, "group_skill_delta": {"term": {"long": -3.942169230186643e-05, "medium": 0.0004350976169777976, "short": 0.0007579826976086279}, "domain": {"Econ/Fin": 3.5755094018874445e-06, "Energy": 0.0002616127753619635, "Healthcare": 0.0026230145681945816, "Nature": 0.0005157671103503958, "Sales": 0.0003360515357794247, "Transport": 0.00012736240319888292, "Web/CloudOps": 0.0006124724786850666}, "frequency": {"A": -0.0006402672463406978, "D": 0.0021088726475737563, "H": 0.0002105240154501864, "M": -8.905187245267232e-05, "Q": 0.00019718505693444577, "S": 0.0002199106508103954, "T": 0.0004243767697019729, "W": -0.0005231595721540971}, "variates": {"multivariate": 0.00029501300004453057, "univariate": 0.0006826352314314166}}}, {"cutoff": "backcast_evals", "candidate_skill": 0.3399392598514368, "control_skill": 0.33985253853394604, "delta": 8.672131749076772e-05, "candidate_checkpoint": "fb0c9d03d2553d9f54c2e10a65c0d4be1a24378569a8a23260bae026fab464b7", "control_checkpoint": "ad45e0cfae574d3dc1be0b9720c9be0863db9ffe33891fdb22c86dfa83667253", "candidate_eval_seconds": 24.414610862731934, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7705725087665215, "rel_wql_gmean": 0.4621323657198457}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7699864132626696, "rel_wql_gmean": 0.531299586091609}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8116529583093353, "rel_wql_gmean": 0.5938558007894768}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8852120534888323, "rel_wql_gmean": 0.8179516953350823}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8881095280422702, "rel_wql_gmean": 0.6675561545238007}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6580415161881298, "rel_wql_gmean": 0.564896835359652}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9038834058367392, "rel_wql_gmean": 0.42320740090810766}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7231596070270924, "rel_wql_gmean": 0.4907680414811137}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7315609837678774, "rel_wql_gmean": 0.5246357368970765}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6597614339199229, "rel_wql_gmean": 0.45525974150901544}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6526982782357469, "rel_wql_gmean": 0.72710882538183}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8204841591524809, "rel_wql_gmean": 0.49031488068233403}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7680756629108945, "rel_wql_gmean": 0.5095079711748094}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8659777218856922, "rel_wql_gmean": 0.7943155389689884}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7585491760671974, "rel_wql_gmean": 0.765760286050908}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8516691477137177, "rel_wql_gmean": 0.5079001683100706}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7703244418979465, "rel_wql_gmean": 0.576672470030371}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8739659055281842, "rel_wql_gmean": 0.588448462245451}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7867842370919595, "rel_wql_gmean": 0.5283992813114003}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7988391952411996, "rel_wql_gmean": 0.5661258905214072}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7709573168881856, "rel_wql_gmean": 0.46268425970990196}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7695230479033899, "rel_wql_gmean": 0.5310215600398799}, "short": {"n_configs": 55, "rel_mase_gmean": 0.8117841847086917, "rel_wql_gmean": 0.593906337357885}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8871103723322559, "rel_wql_gmean": 0.8186104803199865}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8873228160456544, "rel_wql_gmean": 0.666828211814892}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6602366692845489, "rel_wql_gmean": 0.5698594545952637}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9037307861253031, "rel_wql_gmean": 0.42282624120616724}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7231485364548405, "rel_wql_gmean": 0.49076711071441}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.731298212809883, "rel_wql_gmean": 0.524438086130783}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.660209298499444, "rel_wql_gmean": 0.45581270950466285}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6522392949080874, "rel_wql_gmean": 0.7270620636653731}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8205802765681058, "rel_wql_gmean": 0.4901220874772779}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7677299491087929, "rel_wql_gmean": 0.5094849178695509}, "M": {"n_configs": 5, "rel_mase_gmean": 0.866956136135693, "rel_wql_gmean": 0.7966508658255991}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7588717620885471, "rel_wql_gmean": 0.7653003797772433}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8525356752749418, "rel_wql_gmean": 0.5080017737889677}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7704476348183809, "rel_wql_gmean": 0.576748095637338}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8742573452440867, "rel_wql_gmean": 0.5889566774320315}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7866251148848069, "rel_wql_gmean": 0.5284419129269964}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7990675186329057, "rel_wql_gmean": 0.5662861373570198}}}, "group_skill_delta": {"term": {"long": 0.0005052929362022729, "medium": -0.0003598028091076344, "short": 8.5663898322208e-05}, "domain": {"Econ/Fin": 0.0012548650508612536, "Energy": -0.0007608507030723022, "Healthcare": 0.00369276147948161, "Nature": -0.00033077723112895363, "Sales": -5.124898123098909e-06, "Transport": -0.00022796147639292386, "Web/CloudOps": 0.0005188361746384373}, "frequency": {"A": -0.0002644075864525197, "D": -8.756725251712894e-05, "H": -0.00015495144855648402, "M": 0.0016873881454321227, "Q": -6.691025747362911e-05, "S": 0.0004003158159068265, "T": 9.699755570025115e-05, "W": 0.000429224002579609}, "variates": {"multivariate": -3.919693704634852e-05, "univariate": 0.00019128241480970143}}}, {"cutoff": "backcast2_evals", "candidate_skill": 0.3635071134421861, "control_skill": 0.3632547284652886, "delta": 0.0002523849768975017, "candidate_checkpoint": "fb0c9d03d2553d9f54c2e10a65c0d4be1a24378569a8a23260bae026fab464b7", "control_checkpoint": "ad45e0cfae574d3dc1be0b9720c9be0863db9ffe33891fdb22c86dfa83667253", "candidate_eval_seconds": 22.41284680366516, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7973772793326314, "rel_wql_gmean": 0.5037189478219941}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7485376388838235, "rel_wql_gmean": 0.48680155274209747}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7610807175701954, "rel_wql_gmean": 0.5563752445115923}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8996158731383675, "rel_wql_gmean": 0.9116420916332623}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8962524458427852, "rel_wql_gmean": 0.6464102529829555}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6872014872642489, "rel_wql_gmean": 0.5865718984372488}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7518101897278355, "rel_wql_gmean": 0.3576488780801564}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5588437740278263, "rel_wql_gmean": 0.35899558344269233}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6612290535533276, "rel_wql_gmean": 0.49535731677355166}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6811326945933035, "rel_wql_gmean": 0.4713218043163969}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5813257471420832, "rel_wql_gmean": 0.734511024100186}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7257266308153661, "rel_wql_gmean": 0.4460523209351161}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7493794064285709, "rel_wql_gmean": 0.48516857506793976}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8063276169089454, "rel_wql_gmean": 0.8347500777879019}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8311639250882232, "rel_wql_gmean": 0.8721716257665935}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9053873824094095, "rel_wql_gmean": 0.5683322217782376}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7540266178705187, "rel_wql_gmean": 0.539645876861533}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8509757393381764, "rel_wql_gmean": 0.641332466692172}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7796156512365023, "rel_wql_gmean": 0.5154498684396187}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7541691448892139, "rel_wql_gmean": 0.5407064215413834}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7969398609040024, "rel_wql_gmean": 0.5035562825504419}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7490067352384399, "rel_wql_gmean": 0.48743000572367984}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7615427910500057, "rel_wql_gmean": 0.5565614531092009}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.901205213255903, "rel_wql_gmean": 0.9129519979778129}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.895984498209844, "rel_wql_gmean": 0.6466953024058848}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6906395512407255, "rel_wql_gmean": 0.5895403412546308}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7520688777995285, "rel_wql_gmean": 0.35747495688522557}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5597836473152902, "rel_wql_gmean": 0.3594495182358377}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6614283420298616, "rel_wql_gmean": 0.49546817917989344}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6809574130261864, "rel_wql_gmean": 0.47110941162938547}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.581464401116573, "rel_wql_gmean": 0.7355000101927864}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7270580675006559, "rel_wql_gmean": 0.44686466314745266}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7494927915333071, "rel_wql_gmean": 0.48496142310648743}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8066081312673148, "rel_wql_gmean": 0.8347163141766332}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8311725894461938, "rel_wql_gmean": 0.8717568945686304}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9046061716746755, "rel_wql_gmean": 0.5673078591497167}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7542500727562019, "rel_wql_gmean": 0.5401993598021697}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8508075542526838, "rel_wql_gmean": 0.6417280462795324}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7799074480129385, "rel_wql_gmean": 0.515543995911792}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7544561978137869, "rel_wql_gmean": 0.5410325795112644}}}, "group_skill_delta": {"term": {"long": -0.00027616578195999164, "medium": 0.0005787635663814239, "short": 0.00030642478942743967}, "domain": {"Econ/Fin": 0.001450570590594169, "Energy": 5.399266426475702e-05, "Healthcare": 0.003194687746846725, "Nature": -3.6913794267290356e-05, "Sales": 0.000659821867964816, "Transport": 0.00015028778397652154, "Web/CloudOps": -0.00020056975214766126}, "frequency": {"A": 0.0005177445511324041, "D": 0.001039998472721737, "H": -8.313396708403697e-05, "M": 0.00012610037771676463, "Q": -0.00019801933347218803, "S": -0.0009560090538031085, "T": 0.0004216015774434201, "W": 0.00015477100861938098}, "variates": {"multivariate": 0.00017651018018660647, "univariate": 0.0003141225409207804}}}, {"cutoff": "backcast3_evals", "candidate_skill": 0.3946227627370048, "control_skill": 0.3944984110874522, "delta": 0.00012435164955260092, "candidate_checkpoint": "fb0c9d03d2553d9f54c2e10a65c0d4be1a24378569a8a23260bae026fab464b7", "control_checkpoint": "ad45e0cfae574d3dc1be0b9720c9be0863db9ffe33891fdb22c86dfa83667253", "candidate_eval_seconds": 22.89396333694458, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7609710129937077, "rel_wql_gmean": 0.47452032168526925}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7671868609483425, "rel_wql_gmean": 0.5288868190399633}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7066550913964824, "rel_wql_gmean": 0.5020328201892167}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8451773564948453, "rel_wql_gmean": 0.8285360253400409}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8275746225105758, "rel_wql_gmean": 0.5522426955814441}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7605857710135878, "rel_wql_gmean": 0.6333264544496813}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7095711608282879, "rel_wql_gmean": 0.3379649711309126}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7488922216540858, "rel_wql_gmean": 0.4746936254424748}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5368027387347879, "rel_wql_gmean": 0.4443200501794385}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7132508250826864, "rel_wql_gmean": 0.5180974455268395}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5305628732469561, "rel_wql_gmean": 0.7746522329493969}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7102298594723973, "rel_wql_gmean": 0.41399076524676937}, "H": {"n_configs": 29, "rel_mase_gmean": 0.720402730927092, "rel_wql_gmean": 0.48476404391708994}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8338038100088271, "rel_wql_gmean": 0.8240255377858996}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7158950947379155, "rel_wql_gmean": 0.7686280513395629}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8366064210816937, "rel_wql_gmean": 0.6016287090516826}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7048485153248912, "rel_wql_gmean": 0.4628073674178053}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8097496183003908, "rel_wql_gmean": 0.6701206987456023}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7582010812745099, "rel_wql_gmean": 0.5126030278976069}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7088887852816957, "rel_wql_gmean": 0.49358021133065977}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7605445792601405, "rel_wql_gmean": 0.4740600920237114}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7673937404796206, "rel_wql_gmean": 0.529050128812873}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7066888727036074, "rel_wql_gmean": 0.5025271114107714}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8465750633042362, "rel_wql_gmean": 0.8301832550203931}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8280900345851895, "rel_wql_gmean": 0.5531225386420328}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7582600194472988, "rel_wql_gmean": 0.632623318642284}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7096275569559131, "rel_wql_gmean": 0.3386957610122997}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7487935010952289, "rel_wql_gmean": 0.47423739993986525}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5364607716260557, "rel_wql_gmean": 0.4442170483634485}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7128912578353812, "rel_wql_gmean": 0.5168699930573769}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5308138227989901, "rel_wql_gmean": 0.777900736251483}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7112195255614516, "rel_wql_gmean": 0.4154980506806888}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7198763379573593, "rel_wql_gmean": 0.48466211242450724}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8330944575177875, "rel_wql_gmean": 0.8230031202022723}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7156105446358054, "rel_wql_gmean": 0.7684011151446023}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8371984068688675, "rel_wql_gmean": 0.6003957122289793}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7049982843940813, "rel_wql_gmean": 0.46277982987038807}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8087944681865019, "rel_wql_gmean": 0.670755534033392}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7587335902791335, "rel_wql_gmean": 0.5125489110619184}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7084600116309258, "rel_wql_gmean": 0.494009506622114}}}, "group_skill_delta": {"term": {"long": -0.0004597905397619728, "medium": 0.00018422987265309665, "short": 0.00030738935638796594}, "domain": {"Econ/Fin": 0.0015237723652161694, "Energy": 0.0007489717871447255, "Healthcare": -0.00144674446587445, "Nature": 0.000548645028838668, "Sales": -0.0003258680649546042, "Transport": -0.0002121764956774519, "Web/CloudOps": -0.000873586992585218}, "frequency": {"A": 0.001494721860401227, "D": 0.00136457137212187, "H": -0.00027805241520506563, "M": -0.0008668391590758162, "Q": -0.0002569295404494243, "S": -0.00047665778926297975, "T": 4.368260905673882e-05, "W": -8.594630509117795e-05}, "variates": {"multivariate": 0.00018596595228337343, "univariate": 7.81871842889803e-05}}}], "mean_delta": 0.00024245069528067154, "positive_cutoffs": 4, "outcome": "Declared comparison checkpoints 6000,12000. No transfer formula or automatic publication is selected by this controller."} + +## E144 matched direct-trend correction on the published width first member — declared 2026-10-23T10:38:59.356642+00:00 +Hypothesis: the E136 direct local-trend head provides a complementary improvement to E139 seasonal-width treatment. E136 primary6000 now beats matched E107 at all four cutoffs (mean 0.00024245069528067154); this transfer declaration follows those source results, before constructing/evaluating any merged candidate. Freeze base E139seasonal_width_transfer6k SHA82d50d0b2f7abfb963562f5f7966644b05612a49725f066392c022ccd6ba18ca. Fixed formula: zero_extend(base)+zero_extend(E136_duration)-zero_extend(E107_duration), coefficient1; new trend head receives E136 values, base dispersion/width paths remain bitwise unchanged. No further training, no coefficient sweep. Add direct-trend path to width model with zero-extension forward equivalence checked for both parents. Primary6000; conditional12000 durability constructed only if matched E136/E107 final passes >=3of4 and positive mean. Both ensemble probes use the same frozen E139 quartet: new first/E71patch8/E93split/E79wide48000, equal quarters, compare to E139width6 on all four panels. Require >=3of4 and positive mean before any full replay; full replay and comparison to current publication plus relocation/composition checks before selection. No E142/fresh96 or width12 substitution. Sources/seeds remain their recorded scratch parents: E136/E107 seed197/B64/LR2e-5/12k, no optimizer updates in this experiment. CPU fixture seed853. Validation only for selection. + +2026-10-23T10:39:48.392903+00:00: E144 primary merge CPU passed. {"method": "matched direct-trend treatment added to frozen E139width6", "formula": "zero_extend(E139width6)+zero_extend(E136)-zero_extend(E107)", "coefficient": 1.0, "parent_hashes": {"/workspace/research/seasonal_width_transfer6k.pt": "82d50d0b2f7abfb963562f5f7966644b05612a49725f066392c022ccd6ba18ca", "/workspace/research/runs/direct_trend_head/ema006000.pt": "fb0c9d03d2553d9f54c2e10a65c0d4be1a24378569a8a23260bae026fab464b7", "/workspace/research/runs/long_seasonal/ema006000.pt": "ad45e0cfae574d3dc1be0b9720c9be0863db9ffe33891fdb22c86dfa83667253"}, "new_parameters": ["trend_head.bias", "trend_head.weight"], "unchanged_base_paths": ["dispersion_query.weight", "width_head.bias", "width_head.weight"], "base_only_parameters_bitwise_unchanged": true, "zero_extension_fixtures": [{"context": 16, "horizon": 6, "base_bitwise_equal": true, "candidate_bitwise_equal": true}, {"context": 31, "horizon": 29, "base_bitwise_equal": true, "candidate_bitwise_equal": true}, {"context": 128, "horizon": 128, "base_bitwise_equal": true, "candidate_bitwise_equal": true}, {"context": 512, "horizon": 300, "base_bitwise_equal": true, "candidate_bitwise_equal": true}], "finite_ordered_fixture": true, "check_seed": 853, "optimizer_updates": 0, "validation_data_read": false, "seconds": 3.217405413975939, "checkpoint_sha256": "9ba4af36e21a47aa761adac79fd6de599de475dde35083e7f8e6f16df77a07ff", "parameters": 36915584}. All4cutoff first-member and fixedquarter probes now active; final waits its separate source gate. No fullsuite or publication selected. + +## E145 full-corpus simulated-building allocation — declared 2026-10-23T10:41:45.560832+00:00 +Hypothesis: fixed per-directory weighting underuses the diversity of buildings_900k (about1.875percent of real-row draws despite15.7Bpoints), limiting transfer to some energy series. This is exploratory; heterogeneous Energy failures do not establish that buildings are their cause. Test exactly one mixture change against E110: multiply the unnormalized buildings_900k weight by4, renormalize all95 probabilities. Keep original20percent synthetic share, conditional weights of all other sources in the same ratios, full packed_stratified_full corpus, E110ownc969freshinitial/seed307/B48/LR1e-4/96000/static-compiled paired loss/slowAR/horizon300310. No source added, no new generator or validation-driven training samples. Different source draws also change later sampler trajectories; this is a matched recipe, not a claim of identical windows. Primary48000,4/8/16/24learning diagnostics,72/96durability; compare48/96 across allfour cutoffs againstE110. Require>=3positive andmeanpositive plusfull validation/current-best checks before selection. No mixture coefficient sweep, no distillation or architectural factor combined. Queue after E131final96000, replacing its allocation, only after CPU probability/stream/recovery audits; model/runtime/maximum shapes identical to E110 so reuse prior GPU allocation audit. This deliberately retains E110lowerLR to isolate mixture despite E94inferior final main. No new independent trainer slot. + +2026-10-23T10:42:23.193026+00:00: E145 full-corpus source allocation audit passed {"fixture_seed": 857, "training_seed": 307, "initial_checkpoint_sha256": "c9693619ca6277c26fef3b2bde37ff6796bec97b3af9f94588bbc5ddd329ec90", "model_source_byte_identical": true, "all95_full_corpus_directories_present": true, "source_probability_formula_verified": true, "unchanged_other_source_probability_ratios": true, "old_building_probability_conditional_real": 0.018752266675677916, "new_building_probability_conditional_real": 0.07101404383933141, "unnormalized_building_weight_multiplier": 4.0, "synthetic_fraction": 0.2, "restored_probability_rows_bitwise_equal": 1024, "synthetic_rows_bitwise_equal": 256, "corresponding_rng_streams_bitwise_equal": true, "sampler_recovery_bitwise_equal": true, "additional_persistent_sampler_state_required": false, "source_draws": 200000, "maximum_sampling_zscore": 2.4399169706579604, "seconds": 4.10820398805663, "optimizer_updates": 0, "validation_data_read": false}. Queued {"queue_pid": 30898, "watch_pid": 30899, "comparison_pid": 30900} afterE131final96000, replacing thatallocation. Newbuildingprobability7.101404percent conditionalreal versus1.875227percent; allothersratiosunchanged,20percentownsyntheticunchanged. Reusebyteidentical146Mmodel/compiledmaxshapes; no redundantGPUaudit. Sharedtrainer/publisher modifications are metadata-only for thisnew codepath. + +## E94 fresh146M halfLR final96000 +- Checkpoint SHA-256: `3ecb2892396bc62c203e0d72ce266d2c6df978c24e68cf87cd6dc0ec34db5d30`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 30.012848377227783 seconds. +- Overall skill 0.368620; relative MASE 0.751743; relative WQL 0.530288. +- term skill: long=0.3835, medium=0.3897, short=0.3545. +- domain skill: Econ/Fin=0.1382, Energy=0.2181, Healthcare=0.4969, Nature=0.4180, Sales=0.3477, Transport=0.4597, Web/CloudOps=0.4867. +- frequency skill: A=0.3961, D=0.3653, H=0.3830, M=0.1145, Q=0.2113, S=0.4148, T=0.4172, W=0.2262. +- variates skill: multivariate=0.3769, univariate=0.3619. +- Outcome: Declared96k schedule completed. Seed307/B48/LR1e-4; loop21549.731918170s/process21577.931560865s on shared H100. Main0.368620401816 trails matched E79originalLR final0.371180826606. No extension or publication; E131 takes released allocation. + +## E122 original AR fresh146M early8000 +- Checkpoint SHA-256: `3815be6275dbd603cc84c52fd4123d93049838c9ddebc474e7238d4fc73fe38d`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 31.772407054901123 seconds. +- Overall skill 0.337168; relative MASE 0.783591; relative WQL 0.560683. +- term skill: long=0.3644, medium=0.3800, short=0.3091. +- domain skill: Econ/Fin=0.1166, Energy=0.2035, Healthcare=0.2278, Nature=0.4136, Sales=0.3185, Transport=0.4316, Web/CloudOps=0.4664. +- frequency skill: A=0.3649, D=0.3230, H=0.3597, M=-0.0185, Q=0.1862, S=0.4188, T=0.3897, W=0.1790. +- variates skill: multivariate=0.3568, univariate=0.3211. +- Outcome: Early learning diagnostic only; primary48000/final96000 unchanged. Same ownc969init/seed307/B48/LR2e-4 asE79; only original AR coefficient law differs. + +## E138 bounded learned gate early1000 +- Checkpoint SHA-256: `633ae8ba586c610bc328df8d2641a1c47546856fa302f9d6374e517a2dd7d2f6`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 92.65112614980899 seconds. +- Overall skill 0.388769; relative MASE 0.732345; relative WQL 0.510147. +- term skill: long=0.4085, medium=0.4111, short=0.3722. +- domain skill: Econ/Fin=0.1505, Energy=0.2480, Healthcare=0.4796, Nature=0.4449, Sales=0.3432, Transport=0.4743, Web/CloudOps=0.5091. +- frequency skill: A=0.3803, D=0.3731, H=0.4043, M=0.1196, Q=0.2039, S=0.4248, T=0.4474, W=0.2434. +- variates skill: multivariate=0.4022, univariate=0.3779. +- Outcome: Diagnostic only; declared primary6000/final12000 unchanged. Own gate seed751/B64/LR1e-3; all four E130 experts frozen and every member forecasts every instance. Main gain versus fixed equal-quarter control is not yet a four-cutoff or full-validation selection. + +## E123 log requested horizon final12000 main +- Checkpoint SHA-256: `5fda67cc9f9137162d71f0fba5507a849dd19a23f2ac77cf0ffc08fb1b53aa06`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 24.62970805168152 seconds. +- Overall skill 0.377701; relative MASE 0.744479; relative WQL 0.520170. +- term skill: long=0.4025, medium=0.4065, short=0.3564. +- domain skill: Econ/Fin=0.1304, Energy=0.2371, Healthcare=0.4530, Nature=0.4303, Sales=0.3343, Transport=0.4662, Web/CloudOps=0.5037. +- frequency skill: A=0.3651, D=0.3530, H=0.3955, M=0.0923, Q=0.1965, S=0.4247, T=0.4405, W=0.2192. +- variates skill: multivariate=0.3966, univariate=0.3622. +- Outcome: Completed original12k schedule, seed197/B64/LR2e-5; loop2398.834343337s/process2411.322815848s. Primary6k3of4 small meanpositive with monthly regressions; final earlier cutoffs pending. No transfer or publication selected. + +E141 matched146M capacity_patch8_control seed809 training started at 2026-10-23T10:45:42Z, after the declared dependency processes exited; required checkpoint files are present. Settings are unchanged from the declared comparison. + +2026-10-23T10:46:25.714004+00:00: E138 conditional fullsuite tooling prepared: ensemble_gate/validate.py --step6000|12000, check_learned_runtime.py, promote.py. No execution or new model-selection decision before declared source/current-cutoff gates. Learned runtime check reconstructs final forecasts via independent ordered NumPyFP32 weighting of four cached actual standalone experts on2extremesynthetic and3realconfigs; gateweights are computed on matching contexts/batches, bounded positive weights and sums checked. Relocation and fullpublicreplay remain mandatory. E136 completed10:45:38, process2570.288663981s; E141matched146Mcontrol started10:45:42 after it. No schedule changes. + +E123 12000 four-cutoff comparison: {"label": "E123 12000 four-cutoff comparison", "utc": "2026-10-23T10:48:46.660817+00:00", "candidate": "log_horizon_ema12000", "control": "overflow_control_ema12000", "rows": [{"cutoff": "evals", "candidate_skill": 0.37770146684887507, "control_skill": 0.37742394607564755, "delta": 0.0002775207732275131, "candidate_checkpoint": "5fda67cc9f9137162d71f0fba5507a849dd19a23f2ac77cf0ffc08fb1b53aa06", "control_checkpoint": "f11d056b95f1c5eeef174265ebc51742952600e0dae1fa52900860447d5be819", "candidate_eval_seconds": 24.62970805168152, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7430244452363175, "rel_wql_gmean": 0.4804276434758998}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.71174036218895, "rel_wql_gmean": 0.49498041435724505}, "short": {"n_configs": 55, "rel_mase_gmean": 0.757938731122603, "rel_wql_gmean": 0.5464559229342405}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8823340676061324, "rel_wql_gmean": 0.8570935896860983}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9010399263979435, "rel_wql_gmean": 0.6458671428713116}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5871495040245798, "rel_wql_gmean": 0.5095924394827762}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8116493904861689, "rel_wql_gmean": 0.39992570204571326}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8514443092466814, "rel_wql_gmean": 0.5205516445093903}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.644241067703261, "rel_wql_gmean": 0.4422575250312542}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5625657110738383, "rel_wql_gmean": 0.4378510875844917}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6219123128672049, "rel_wql_gmean": 0.6481432034462807}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7800627693155953, "rel_wql_gmean": 0.5365845741616493}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7321846779907237, "rel_wql_gmean": 0.49908772182893135}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9862393811466624, "rel_wql_gmean": 0.8354474711123536}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.780436277156429, "rel_wql_gmean": 0.8272006430543747}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6555124581113588, "rel_wql_gmean": 0.5049553035175368}, "T": {"n_configs": 30, "rel_mase_gmean": 0.690853971937905, "rel_wql_gmean": 0.4531219975212009}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9035088801916387, "rel_wql_gmean": 0.6747538235234236}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7106567590422463, "rel_wql_gmean": 0.5122945948988381}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7725593099787635, "rel_wql_gmean": 0.5265270775754183}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7430904415695668, "rel_wql_gmean": 0.4803877697002309}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7132918126148858, "rel_wql_gmean": 0.4952594111267713}, "short": {"n_configs": 55, "rel_mase_gmean": 0.7578628359813909, "rel_wql_gmean": 0.5467970503421377}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8820089901245588, "rel_wql_gmean": 0.8576370610661226}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.9027748652932497, "rel_wql_gmean": 0.6461208417787276}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.5860981811462721, "rel_wql_gmean": 0.5145960110698827}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.8131107048238599, "rel_wql_gmean": 0.4016810458988802}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.8527673973406287, "rel_wql_gmean": 0.5213825017868637}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.6445705043805339, "rel_wql_gmean": 0.44151518253827515}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.5611845549171244, "rel_wql_gmean": 0.43637179177338026}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6256068773709946, "rel_wql_gmean": 0.6531531717628165}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7810498071209858, "rel_wql_gmean": 0.5387984968910804}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7331074392934215, "rel_wql_gmean": 0.4999416190250625}, "M": {"n_configs": 5, "rel_mase_gmean": 0.9734095428884114, "rel_wql_gmean": 0.8253812557813238}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7799909436165716, "rel_wql_gmean": 0.8257926959351992}, "S": {"n_configs": 6, "rel_mase_gmean": 0.6551233447531275, "rel_wql_gmean": 0.5045264853695348}, "T": {"n_configs": 30, "rel_mase_gmean": 0.6915094659095177, "rel_wql_gmean": 0.4527256621835321}, "W": {"n_configs": 8, "rel_mase_gmean": 0.9056914149873438, "rel_wql_gmean": 0.6760727114446506}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7112247286748321, "rel_wql_gmean": 0.5124312426851864}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.7726699203226439, "rel_wql_gmean": 0.5268484105597512}}}, "group_skill_delta": {"term": {"long": 1.737862102779708e-06, "medium": 0.0008139892845643315, "short": 0.00016861148852720387}, "domain": {"Econ/Fin": 0.00011540154237155154, "Energy": 0.0008840385657633565, "Healthcare": 0.002186531351884402, "Nature": 0.0017627442471298549, "Sales": 0.0010485676697693513, "Transport": -0.0003118268093273979, "Web/CloudOps": -0.0014476889577813012}, "frequency": {"A": 0.004339356025017782, "D": 0.0017433384745902947, "H": 0.0008980352491121391, "M": -0.011372780858895815, "Q": -0.0009131547366021397, "S": -0.00041505395795748967, "T": 2.0508174443434335e-05, "W": 0.0017061180453331604}, "variates": {"multivariate": 0.00032156569378061217, "univariate": 0.00024025695121132618}}}, {"cutoff": "backcast_evals", "candidate_skill": 0.33609075986901504, "control_skill": 0.33652833730727594, "delta": -0.00043757743826089435, "candidate_checkpoint": "5fda67cc9f9137162d71f0fba5507a849dd19a23f2ac77cf0ffc08fb1b53aa06", "control_checkpoint": "f11d056b95f1c5eeef174265ebc51742952600e0dae1fa52900860447d5be819", "candidate_eval_seconds": 21.9350163936615, "candidate_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7785447720267828, "rel_wql_gmean": 0.4657874464088371}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7734665098073651, "rel_wql_gmean": 0.5332387222365707}, "short": {"n_configs": 55, "rel_mase_gmean": 0.816756365672336, "rel_wql_gmean": 0.596347706388073}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8768134564715492, "rel_wql_gmean": 0.8144616655109266}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.888724148439279, "rel_wql_gmean": 0.6676454013434238}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6285788689574936, "rel_wql_gmean": 0.5393854602556625}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.9354286323517153, "rel_wql_gmean": 0.43435095449094624}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7341893356620086, "rel_wql_gmean": 0.4989399025969444}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7395007482752665, "rel_wql_gmean": 0.5324398626390493}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6658140666785062, "rel_wql_gmean": 0.45633750729670014}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6447025208793009, "rel_wql_gmean": 0.7245343688761016}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8375503925738963, "rel_wql_gmean": 0.49800756145685254}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7782935764273052, "rel_wql_gmean": 0.5159434696680196}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8656695594005757, "rel_wql_gmean": 0.798854700405089}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7637583233559485, "rel_wql_gmean": 0.7788722891347628}, "S": {"n_configs": 6, "rel_mase_gmean": 0.853720622206964, "rel_wql_gmean": 0.5075649441247883}, "T": {"n_configs": 30, "rel_mase_gmean": 0.7675667510073444, "rel_wql_gmean": 0.5728832242520099}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8780742540501284, "rel_wql_gmean": 0.5891440904684123}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7917511388970789, "rel_wql_gmean": 0.5293877638004925}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.8045547413174213, "rel_wql_gmean": 0.5702492835633451}}}, "control_groups": {"term": {"long": {"n_configs": 21, "rel_mase_gmean": 0.7791999311006992, "rel_wql_gmean": 0.4659792452594256}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7710406727836745, "rel_wql_gmean": 0.5333113680139498}, "short": {"n_configs": 55, "rel_mase_gmean": 0.815154118317558, "rel_wql_gmean": 0.596530868139981}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8754973298713973, "rel_wql_gmean": 0.8157069069366086}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8880158890798259, "rel_wql_gmean": 0.6677066701972586}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6235821127455097, "rel_wql_gmean": 0.5405407165775942}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.933606860676274, "rel_wql_gmean": 0.4340037728321772}, "Sales": {"n_configs": 4, "rel_mase_gmean": 0.7343890716300152, "rel_wql_gmean": 0.49893240567123487}, "Transport": {"n_configs": 15, "rel_mase_gmean": 0.7389889324657989, "rel_wql_gmean": 0.5315819911881067}, "Web/CloudOps": {"n_configs": 20, "rel_mase_gmean": 0.6643730331767335, "rel_wql_gmean": 0.45729311789913757}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.6445434372547929, "rel_wql_gmean": 0.724090215239997}, "D": {"n_configs": 15, "rel_mase_gmean": 0.8386815774822007, "rel_wql_gmean": 0.5001256118650457}, "H": {"n_configs": 31, "rel_mase_gmean": 0.7779220228454703, "rel_wql_gmean": 0.5152698021677109}, "M": {"n_configs": 5, "rel_mase_gmean": 0.8546325349093246, "rel_wql_gmean": 0.7856916887479788}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7640852146217055, "rel_wql_gmean": 0.7788691447566721}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8532609264720655, "rel_wql_gmean": 0.507658310446713}, "T": {"n_configs": 30, "rel_mase_gmean": 0.767260085607915, "rel_wql_gmean": 0.5746866456036881}, "W": {"n_configs": 8, "rel_mase_gmean": 0.869060480798712, "rel_wql_gmean": 0.5886681671106037}}, "variates": {"multivariate": {"n_configs": 43, "rel_mase_gmean": 0.7899223594259315, "rel_wql_gmean": 0.5301365087279752}, "univariate": {"n_configs": 54, "rel_mase_gmean": 0.803707925134896, "rel_wql_gmean": 0.5699074661266276}}}, "group_skill_delta": {"term": {"long": 0.0003773475858419584, "medium": -0.0009642127701032788, "short": -0.000577819225801357}, "domain": {"Econ/Fin": 1.0810300718033794e-05, "Energy": -0.0002716704814049731, "Healthcare": -0.0016982166569302626, "Nature": -0.0008755498303312237, "Sales": 7.777445298340346e-05, "Transport": -0.0007227171755528339, "Web/CloudOps": -2.060559190064648e-05}, "frequency": {"A": -0.00029381955198770626, "D": 0.0018088416982298128, "H": -0.0005650139512766161, "M": -0.012153947375495688, "Q": 0.00016348006592725728, "S": -0.00011672517385918901, "T": 0.0009102304335345535, "W": -0.003990257668077146}, "variates": {"multivariate": -0.0002909795496927048, "univariate": -0.0005594861576786458}}}, {"cutoff": "backcast2_evals", "candidate_skill": 0.36108142717175196, "control_skill": 0.36097346960650367, "delta": 0.00010795756524828448, "candidate_checkpoint": "5fda67cc9f9137162d71f0fba5507a849dd19a23f2ac77cf0ffc08fb1b53aa06", "control_checkpoint": "f11d056b95f1c5eeef174265ebc51742952600e0dae1fa52900860447d5be819", "candidate_eval_seconds": 19.892305374145508, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.8009815555520872, "rel_wql_gmean": 0.5046134378337488}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.75698667845559, "rel_wql_gmean": 0.49095768770975096}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7631238679759405, "rel_wql_gmean": 0.5567535297857584}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8902935244761259, "rel_wql_gmean": 0.9080923278279727}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8968061575878896, "rel_wql_gmean": 0.6453570394834077}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6970428140387566, "rel_wql_gmean": 0.5923745553958999}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7590508653126349, "rel_wql_gmean": 0.36304847204288593}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5633835612811539, "rel_wql_gmean": 0.35909097774105536}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6692248387559221, "rel_wql_gmean": 0.5016431346111367}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6847805713278117, "rel_wql_gmean": 0.46818708063028336}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5821245874208091, "rel_wql_gmean": 0.7238655281316777}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7282140220073303, "rel_wql_gmean": 0.44789671623988037}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7586659795269258, "rel_wql_gmean": 0.4905975420589593}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8232431117752952, "rel_wql_gmean": 0.8474006394647826}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8370376096002096, "rel_wql_gmean": 0.8801666359749881}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9080675028852087, "rel_wql_gmean": 0.566712842833545}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7549914153310119, "rel_wql_gmean": 0.5375088149965954}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8403080980330329, "rel_wql_gmean": 0.6358021659851508}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.7828852853986968, "rel_wql_gmean": 0.5157179265762837}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7583925590823491, "rel_wql_gmean": 0.5430730741712229}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7998283729290717, "rel_wql_gmean": 0.5048537403572065}, "medium": {"n_configs": 21, "rel_mase_gmean": 0.7567348346553658, "rel_wql_gmean": 0.49139307103243485}, "short": {"n_configs": 54, "rel_mase_gmean": 0.762930601340605, "rel_wql_gmean": 0.5572913926751922}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8902018742574637, "rel_wql_gmean": 0.9080828126396094}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8967112467195689, "rel_wql_gmean": 0.6466666398782791}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.6908821587788814, "rel_wql_gmean": 0.5905411593557701}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7593906111647103, "rel_wql_gmean": 0.3630649835252516}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.5660049516474805, "rel_wql_gmean": 0.36083556795060334}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.6692141236302525, "rel_wql_gmean": 0.5019337855870213}, "Web/CloudOps": {"n_configs": 19, "rel_mase_gmean": 0.6840578993103755, "rel_wql_gmean": 0.46836362238870816}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5819380993584167, "rel_wql_gmean": 0.723948814143525}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7300802327867975, "rel_wql_gmean": 0.44973000047782175}, "H": {"n_configs": 30, "rel_mase_gmean": 0.7573152418388004, "rel_wql_gmean": 0.4905218098483386}, "M": {"n_configs": 4, "rel_mase_gmean": 0.825511662103245, "rel_wql_gmean": 0.8525433006612966}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.8348196873036913, "rel_wql_gmean": 0.8792738256086735}, "S": {"n_configs": 6, "rel_mase_gmean": 0.9101844597610753, "rel_wql_gmean": 0.5693250695338232}, "T": {"n_configs": 29, "rel_mase_gmean": 0.75556464168385, "rel_wql_gmean": 0.5377684583538125}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8322603650379057, "rel_wql_gmean": 0.6324937767638193}}, "variates": {"multivariate": {"n_configs": 42, "rel_mase_gmean": 0.782445957809565, "rel_wql_gmean": 0.5156982204614814}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7580358480370438, "rel_wql_gmean": 0.543923941651618}}}, "group_skill_delta": {"term": {"long": -0.00030656767636227933, "medium": 0.00016878817692900228, "short": 0.00023219242937411178}, "domain": {"Econ/Fin": -5.099261123819865e-05, "Energy": 0.000731205062193041, "Healthcare": -0.003836711542665072, "Nature": 0.0001294086971220798, "Sales": 0.0021390128262059327, "Transport": 0.0001631893108370308, "Web/CloudOps": -0.0001921671210102227}, "frequency": {"A": -6.664949609802573e-05, "D": 0.0019004300054085155, "H": -0.0005903884028901629, "M": 0.003684070228858638, "Q": -0.001572790498920229, "S": 0.002489050934521231, "T": 0.0003956881480250418, "W": -0.005403612296292382}, "variates": {"multivariate": -0.0001904468936753112, "univariate": 0.00035148707140120194}}}, {"cutoff": "backcast3_evals", "candidate_skill": 0.3879695802213703, "control_skill": 0.3874814849803516, "delta": 0.0004880952410186712, "candidate_checkpoint": "5fda67cc9f9137162d71f0fba5507a849dd19a23f2ac77cf0ffc08fb1b53aa06", "control_checkpoint": "f11d056b95f1c5eeef174265ebc51742952600e0dae1fa52900860447d5be819", "candidate_eval_seconds": 21.754170417785645, "candidate_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7687576677775961, "rel_wql_gmean": 0.47774845999101007}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.7732607529440361, "rel_wql_gmean": 0.5293233964962137}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7180829820488366, "rel_wql_gmean": 0.5083029443188236}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.840040724605278, "rel_wql_gmean": 0.8348572982143874}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8382331924493931, "rel_wql_gmean": 0.5564791784906772}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7855109548347359, "rel_wql_gmean": 0.6577089616453796}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7269180591584729, "rel_wql_gmean": 0.3421065748252322}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7558544135573962, "rel_wql_gmean": 0.47834840809100926}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5440266530970755, "rel_wql_gmean": 0.45035047585160304}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7174667429232385, "rel_wql_gmean": 0.5164335073741424}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5310133623717334, "rel_wql_gmean": 0.8051799975194188}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7289940390372263, "rel_wql_gmean": 0.42624437615872407}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7292754131368961, "rel_wql_gmean": 0.48947204636467473}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8595852985152433, "rel_wql_gmean": 0.8501043336186115}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7156228614316994, "rel_wql_gmean": 0.769323590017532}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8416160280848813, "rel_wql_gmean": 0.5995783592338273}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7092297798835664, "rel_wql_gmean": 0.4616069674517463}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8233752918367729, "rel_wql_gmean": 0.6725847992409608}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7664927142367004, "rel_wql_gmean": 0.5134493103639047}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7194846623891107, "rel_wql_gmean": 0.5007309271044714}}}, "control_groups": {"term": {"long": {"n_configs": 19, "rel_mase_gmean": 0.7675699458528298, "rel_wql_gmean": 0.476452132158557}, "medium": {"n_configs": 20, "rel_mase_gmean": 0.773141221801274, "rel_wql_gmean": 0.5311688105422268}, "short": {"n_configs": 54, "rel_mase_gmean": 0.7189800356855841, "rel_wql_gmean": 0.5092012481102669}}, "domain": {"Econ/Fin": {"n_configs": 6, "rel_mase_gmean": 0.8366494448197422, "rel_wql_gmean": 0.8335501433013701}, "Energy": {"n_configs": 32, "rel_mase_gmean": 0.8362673307045482, "rel_wql_gmean": 0.5558565966414833}, "Healthcare": {"n_configs": 5, "rel_mase_gmean": 0.7992789325648234, "rel_wql_gmean": 0.663313586611861}, "Nature": {"n_configs": 15, "rel_mase_gmean": 0.7270958326307262, "rel_wql_gmean": 0.3416485868534862}, "Sales": {"n_configs": 3, "rel_mase_gmean": 0.7558002187371488, "rel_wql_gmean": 0.47806361106286926}, "Transport": {"n_configs": 14, "rel_mase_gmean": 0.5447632408986202, "rel_wql_gmean": 0.45146185813227047}, "Web/CloudOps": {"n_configs": 18, "rel_mase_gmean": 0.7184671561660497, "rel_wql_gmean": 0.5194115372422989}}, "frequency": {"A": {"n_configs": 1, "rel_mase_gmean": 0.5301621193542202, "rel_wql_gmean": 0.8023624756576537}, "D": {"n_configs": 15, "rel_mase_gmean": 0.7320022964105988, "rel_wql_gmean": 0.42747341049868826}, "H": {"n_configs": 29, "rel_mase_gmean": 0.7284419538124913, "rel_wql_gmean": 0.48986156448616525}, "M": {"n_configs": 4, "rel_mase_gmean": 0.8692971155035826, "rel_wql_gmean": 0.8573561489309673}, "Q": {"n_configs": 1, "rel_mase_gmean": 0.7145578258684864, "rel_wql_gmean": 0.7671041544075885}, "S": {"n_configs": 6, "rel_mase_gmean": 0.8434376506034783, "rel_wql_gmean": 0.6004240857745707}, "T": {"n_configs": 29, "rel_mase_gmean": 0.7091796225957213, "rel_wql_gmean": 0.4627952794263764}, "W": {"n_configs": 8, "rel_mase_gmean": 0.8186104789687557, "rel_wql_gmean": 0.6672650133055504}}, "variates": {"multivariate": {"n_configs": 41, "rel_mase_gmean": 0.7652944038188929, "rel_wql_gmean": 0.5141740641844628}, "univariate": {"n_configs": 52, "rel_mase_gmean": 0.7208570784782143, "rel_wql_gmean": 0.5012656144320912}}}, "group_skill_delta": {"term": {"long": -0.0012904633289524403, "medium": 0.0010647283136636654, "short": 0.0009111954474430028}, "domain": {"Econ/Fin": -0.002346644763757122, "Energy": -0.0011830578548855941, "Healthcare": 0.009354439317742047, "Nature": -0.0002729779172935265, "Sales": -0.00020057697608455438, "Transport": 0.0009457687699090944, "Web/CloudOps": 0.002177994622508672}, "frequency": {"A": -0.0016684445871615328, "D": 0.001953686501656615, "H": -0.00010396030723058836, "M": 0.0084743150621307, "Q": -0.0016226046240747083, "S": 0.0012697116624826865, "T": 0.0007157424949919555, "W": -0.005096647356290673}, "variates": {"multivariate": -4.83182755077749e-05, "univariate": 0.0008928733582169723}}}], "mean_delta": 0.00010899903530839361, "positive_cutoffs": 3, "outcome": "Declared primary6000/durability12000 diagnostic. No transfer formula or automatic publication is selected by this controller."} + +## E146 independent-seed replication of the direct-trend head — declared 2026-10-23T10:50:18.939746+00:00 +E136 primary6000 improved all four matched panels with mean+0.000242450695, mainly short-term gains and mixed long-term changes. Test whether this architecture effect repeats with independent seed523, reusing the already-completed E118long-seasonal seed523 control (no control retraining). Candidate uses exactly E136direct_trend_head code and own zero-extended initial87158329c5c8bfc69025843fa82c14482931b67d7e6c6b728aa461d45ef56bd4; seed523/B64/LR2e-5/12000/paired/originalAR/oldpack, requested-horizon RNG300526. All other settings match E118. Primary6000,1000/3000learningdiagnostics,12000durability; allfourcutoffs at6/12. No new correction average or ensemble formula is selected. Queue after E143final12000 in the same allocation. Reuse E136exact architecture/initial-function/loss/gradient/memory audits; source sampler is byte-identical to E118. Only independent seed and output identity change from E136. No new training sources or generators; validation is never training. + +2026-10-23T10:50:39.592468+00:00: E146 queued32647/watch32648/matched32649 afterE14329836final12000, persistent session45629. Same audited E136code/initial, E118seed523matchedcontrol reused; no newGPUallocation. E123final allfour diagnostics3positive/mean+0.000108999035, monthlydeltas−0.011372781/−0.012153947/+0.003684070/+0.008474315; longdeltas+0.000001738/+0.000377348/−0.000306568/−0.001290463. No transferselected. E13912full.384393497061 abovecurrent.384335630905; independentcompositionpending. Allthree termgroups improve, EnergyandTransportslightlydecline. E131first50updates include678.1s coldcompilation,100updates777.3s; firststeprecovery saved10:37:24. No stall/restart. + +E13912 durability versus currently published E1396: {"candidate": "/workspace/research/valid-report-width12-ensemble.json", "parent": "/workspace/research/valid-report-width6-ensemble.json", "candidate_hash": "9048d5792bd22df21846386abd745e4aacd41d92eb35ba4183274a1799443e20", "parent_hash": "dfc20235aeb4b9fc799001d69f5be390d9892448dbbf51fc2abb8ca0be453bf7", "skill_difference": 5.786615561642616e-05, "n_configs": 97, "n_dataset_clusters": 28, "improved_configs": 50, "bootstrap_seed": 317, "bootstrap_samples": 5000, "dataset_cluster_delta_percentiles": {"p025": -1.2850248546755758e-05, "p50": 5.484836126623538e-05, "p975": 0.0001611356463262853}, "note": "Descriptive resampling only. Adaptive validation selection and reused windows prevent treating this as a held-out significance test."}. Full term gains long+0.000050819687/medium+0.000013234524/short+0.000078879171; Energy−0.000021019095,Transport−0.000088978265. Both relative metrics improve. Adaptive validation comparison, not held-out significance. + +## E139 direct-width treatment12000 equal-quarter full replay selected +- Checkpoint SHA-256: `9048d5792bd22df21846386abd745e4aacd41d92eb35ba4183274a1799443e20`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.384393; relative MASE 0.735909; relative WQL 0.514970. +- term skill: long=0.4011, medium=0.4090, short=0.3681. +- domain skill: Econ/Fin=0.1299, Energy=0.2413, Healthcare=0.4870, Nature=0.4435, Sales=0.3560, Transport=0.4732, Web/CloudOps=0.5004. +- frequency skill: A=0.3025, D=0.3769, H=0.3975, M=0.1490, Q=0.1893, S=0.4237, T=0.4396, W=0.2403. +- variates skill: multivariate=0.3965, univariate=0.3746. +- Outcome: Matched width-treatment correction at 12000 steps improves full skill from 0.384335630905 to 0.384393497061. All97configs151170instances pass. Inference 390.180s on shared H100. Relocation and actual-member real/extreme synthetic composition are bitwise exact. Validation selection only, not held-out reward. + +E139 complete suite {"package": "/workspace/research/candidate-width12-ensemble", "status": "complete", "steps": [{"name": "synthetic_composition", "returncode": 0, "seconds": 414.75948875397444}, {"name": "relocation", "returncode": 0, "seconds": 233.04726853198372}, {"name": "full_public_replay", "returncode": 0, "seconds": 451.77311267494224}, {"name": "independent_first_member", "returncode": 0, "seconds": 124.7392677241005}, {"name": "composition", "returncode": 0, "seconds": 0.27263093483634293}, {"name": "descriptive_comparison", "returncode": 0, "seconds": 0.18503591907210648}], "current_step": "descriptive_comparison", "seconds": 1224.7863074848428, "skill": 0.38439349706050785}. Synthetic checks {"duration": 12, "descriptor_sha256": "9048d5792bd22df21846386abd745e4aacd41d92eb35ba4183274a1799443e20", "members": ["0b11b7351a4a92d1d18c71a4159ec445be3a94ace8c7a9fa0edafad87d14e960", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "227ea80abf17fc81ae191f94e91f6dd7adbc0d837235750b5f5e9cef3dd5472c"], "checks": [{"config_id": "synthetic_H", "instances": 12, "bitwise_composition": true, "finite_ordered": true}, {"config_id": "synthetic_15T", "instances": 12, "bitwise_composition": true, "finite_ordered": true}], "unchanged_member_references_reused": "/workspace/research/fresh_capacity4_fixture", "input_files_bitwise_identical": true, "seconds": 414.61180081614293}. Descriptive comparison {"candidate": "/workspace/research/valid-report-width12-ensemble.json", "parent": "/workspace/research/valid-report-fresh-capacity4-ensemble.json", "candidate_hash": "9048d5792bd22df21846386abd745e4aacd41d92eb35ba4183274a1799443e20", "parent_hash": "fa97880dd132b1cdff459be4798f8f360d7df59b13e78026a9d74a95d63df0db", "skill_difference": 0.0002437788784378503, "n_configs": 97, "n_dataset_clusters": 28, "improved_configs": 55, "bootstrap_seed": 317, "bootstrap_samples": 5000, "dataset_cluster_delta_percentiles": {"p025": 0.00010064760811145934, "p50": 0.00023652036685539723, "p975": 0.0004220867463148285}, "note": "Descriptive resampling only. Adaptive validation selection and reused windows prevent treating this as a held-out significance test."}. Current-publication diagnostic deltas [6.231750700980143e-05, 0.00011018897763470648, 0.00012334276232328634, -3.260672352722871e-05]. Every member forecasts every instance. E101teacher and E138experts remain their immutable declared snapshots. + +## E147 complete the fresh146M corpus-by-learning-rate comparison — declared 2026-10-23T10:52:42.366573+00:00 +E110full-corpus72k main0.368203045574 now exceeds matched E94old-corpus halfLR72k0.366533622937, reversing its48k deficit. E79old-corpus originalLR final0.371180826606 exceeds E94halfLR final0.368620401816. Hypothesis: larger corpus coverage changes the useful learning-rate regime, and E110may also benefit from the original2e-4 peak. Add the missing full-corpus/highLR cell: identical E110random_capacity code/ownc969freshinitial/seed307/B48/96k/paired/staticcompile/slowAR/horizon300310/fullpacked_stratified_full/original packed_sample source probabilities, changing only LR1e-4to2e-4. This completes four cells with E79old-high,E94old-low,E110full-low. Source/shape/window/RNG laws are identical to E110; no data change or additional generator. Primary48k,4/8/16/24diagnostics,72/96durability; allfourcutoffs48/96 againstE110, with existingE79/E94 reports used for descriptive interaction analysis. No higherLR sweep or automatic extension. Queue after E141patch8 candidate final12000, replacing that allocation; reuse identical model/sampler/GPU audits. No additional concurrent trainer. Final full validation and current-publication checks remain required before selection. + +## E110 full-corpus146M learning diagnostic72000 +- Checkpoint SHA-256: `9905ad079d2a5d0590708039830e22f4d6fa74912810b8eb6d928e91dcda883d`. +- Evaluation: 97 configurations, 9473 instances, 0 failed configurations; 28.039432287216187 seconds. +- Overall skill 0.368203; relative MASE 0.756794; relative WQL 0.527445. +- term skill: long=0.3878, medium=0.3938, short=0.3504. +- domain skill: Econ/Fin=0.1411, Energy=0.2334, Healthcare=0.4159, Nature=0.4163, Sales=0.3433, Transport=0.4594, Web/CloudOps=0.4897. +- frequency skill: A=0.4005, D=0.3570, H=0.3882, M=0.0195, Q=0.2086, S=0.4137, T=0.4226, W=0.2367. +- variates skill: multivariate=0.3827, univariate=0.3564. +- Outcome: Main0.368203045574 exceeds matched E94halfLR0.366533622937 by0.001669422638, reversing48k deficit. Original seed307/B48/LR1e-4/96k schedule unchanged; final96k four-cutoff comparison pending. Recorded72000 training step: [{"step": 72000, "loss": 0.33998720556497575, "seconds": 15811.1, "lr": 3.17157287525381e-05, "grad_norm": 0.10857579112052917, "context": 2048, "horizon": 1024}] + +2026-10-23T10:53:27.068533+00:00: E13912 published10:50:59, fullskill0.38439349706050785, descriptor9048d5792bd22df21846386abd745e4aacd41d92eb35ba4183274a1799443e20; meta loader retained. Suite1224.786307485s, actualfullinference390.179507027s. E147 queued33025/watch33026/matched33027 afterE141candidate29107final12000; persistent48765. Only LR value and output/stopfile identities differ fromE110command. E142stillfullreplay; E144primaryearliercutoffs pending. + +E142 full comparison to current E13912: {"candidate": "/workspace/research/valid-report-width6-fresh96-ensemble.json", "parent": "/workspace/research/valid-report-width12-ensemble.json", "candidate_hash": "49440d1daee26c41a9bbb1f1580bbb35317a35553a58dafbd778cecd027c05fe", "parent_hash": "9048d5792bd22df21846386abd745e4aacd41d92eb35ba4183274a1799443e20", "skill_difference": 8.871195194093406e-05, "n_configs": 97, "n_dataset_clusters": 28, "improved_configs": 58, "bootstrap_seed": 317, "bootstrap_samples": 5000, "dataset_cluster_delta_percentiles": {"p025": -0.001613355806511571, "p50": 6.775720109708505e-05, "p975": 0.0019363009444379672}, "note": "Descriptive resampling only. Adaptive validation selection and reused windows prevent treating this as a held-out significance test."}. Group skill differences {"term": {"long": -0.0009279178231075269, "medium": 0.0005735524763520461, "short": 0.0002997885484163909}, "domain": {"Econ/Fin": -0.00015088664572748822, "Energy": -0.0005078681590492407, "Healthcare": 0.012435113021739164, "Nature": -0.0021745525299137203, "Sales": 0.0020021432451777788, "Transport": -0.000371935301136217, "Web/CloudOps": -0.0007407729720235734}, "frequency": {"A": 0.001840451213197536, "D": -0.000886131628639375, "H": 0.0008664188718713328, "M": 0.0018450121584902002, "Q": 0.0027381957217106345, "S": 0.00021028701676273354, "T": -0.001380162056435874, "W": 0.0043002785147818745}, "variates": {"multivariate": -0.00023108088179579767, "univariate": 0.0003524789140099127}}. MASE worsens from0.7359092460760267to0.7364206184269699 while WQL improves from0.5149702473261757to0.5144643448895588. Declared2x2 log-error interaction 1.2040144307112755e-06, additive-log-error predicted skill 0.38448295010430533, observed 0.3844822090124488. This is descriptive validation selection; no additional blend coefficient chosen. + +## E142 final fresh146M quartet full replay — selected +- Checkpoint SHA-256: `49440d1daee26c41a9bbb1f1580bbb35317a35553a58dafbd778cecd027c05fe`. +- Evaluation: 97 configurations, 151170 instances, 0 failed configurations; not separately timed seconds. +- Overall skill 0.384482; relative MASE 0.736421; relative WQL 0.514464. +- term skill: long=0.4002, medium=0.4096, short=0.3684. +- domain skill: Econ/Fin=0.1297, Energy=0.2408, Healthcare=0.4995, Nature=0.4414, Sales=0.3580, Transport=0.4729, Web/CloudOps=0.4997. +- frequency skill: A=0.3043, D=0.3760, H=0.3984, M=0.1508, Q=0.1920, S=0.4239, T=0.4382, W=0.2446. +- variates skill: multivariate=0.3963, univariate=0.3749. +- Outcome: Fixed quartet improves full skill from 0.384393497061 to 0.384482209012. All97configs151170instances pass; inference 422.063s on shared H100. Relocation and real/extreme synthetic standalone composition are bitwise exact. Validation selection only, not held-out reward. + +E142 fullsuite {"package": "/workspace/research/candidate-width6-fresh96-ensemble", "status": "complete", "steps": [{"name": "synthetic_composition", "returncode": 0, "seconds": 199.80909308814444}, {"name": "relocation", "returncode": 0, "seconds": 461.85226410697214}, {"name": "full_public_replay", "returncode": 0, "seconds": 528.3381450260058}, {"name": "composition", "returncode": 0, "seconds": 0.30109393992461264}, {"name": "descriptive_comparison", "returncode": 0, "seconds": 0.2489329711534083}], "current_step": "descriptive_comparison", "seconds": 1190.5941559779458, "skill": 0.3844822090124488}. Synthetic {"kind": "joint", "descriptor_sha256": "49440d1daee26c41a9bbb1f1580bbb35317a35553a58dafbd778cecd027c05fe", "members": ["82d50d0b2f7abfb963562f5f7966644b05612a49725f066392c022ccd6ba18ca", "308389b7217c080af9eb185559d4ee3cafa0f3e0f8c4dd8f5526b68198c89988", "1a2fb20a9fb5cae6526f2e36ea47559626bece78fd9c284899836505030ae9fe", "d7cfcd72c3cb84aa69e447b76c4c3ab98c21b7c600a463f0b805f4b4300baf33"], "checks": [{"config_id": "synthetic_H", "instances": 12, "bitwise_composition": true, "finite_ordered": true}, {"config_id": "synthetic_15T", "instances": 12, "bitwise_composition": true, "finite_ordered": true}], "references": ["/workspace/research/width6_fixture/standalone0", "/workspace/research/fresh_capacity4_fixture/standalone1", "/workspace/research/fresh_capacity4_fixture/standalone2", "/workspace/research/fresh_capacity96_fixture/standalone3"], "fresh_member_cached": true, "seconds": 199.67343028006144}. Descriptive comparison {"candidate": "/workspace/research/valid-report-width6-fresh96-ensemble.json", "parent": "/workspace/research/valid-report-width6-ensemble.json", "candidate_hash": "49440d1daee26c41a9bbb1f1580bbb35317a35553a58dafbd778cecd027c05fe", "parent_hash": "dfc20235aeb4b9fc799001d69f5be390d9892448dbbf51fc2abb8ca0be453bf7", "skill_difference": 0.00014657810755736023, "n_configs": 97, "n_dataset_clusters": 28, "improved_configs": 60, "bootstrap_seed": 317, "bootstrap_samples": 5000, "dataset_cluster_delta_percentiles": {"p025": -0.0015682766075555549, "p50": 0.00011755044460248776, "p975": 0.0020397091338542946}, "note": "Descriptive resampling only. Adaptive validation selection and reused windows prevent treating this as a held-out significance test."}. Current-publication diagnostic deltas [7.779644041161493e-05, 0.0007481604243866347, 0.0007391386610310358, 0.0004944213898471217]. All members forecast every instance. E101teacher/E138experts remain their immutable snapshots. diff --git a/shared/package-files/2c/2cdb3226e270731e2b119108a9002329270de68bfb237fcb5ca71eec53c460f8/ibm3161 b/shared/package-files/2c/2cdb3226e270731e2b119108a9002329270de68bfb237fcb5ca71eec53c460f8/ibm3161 new file mode 100644 index 0000000000000000000000000000000000000000..dad679d25c87441556402d9d75aae7ed19602945 Binary files /dev/null and b/shared/package-files/2c/2cdb3226e270731e2b119108a9002329270de68bfb237fcb5ca71eec53c460f8/ibm3161 differ diff --git a/shared/package-files/2c/2cde822b93ca16ae535c954b7dfe658b4ad10df2a193628d1b358f1765e8b198/license.terms b/shared/package-files/2c/2cde822b93ca16ae535c954b7dfe658b4ad10df2a193628d1b358f1765e8b198/license.terms new file mode 100644 index 0000000000000000000000000000000000000000..01264352c87ca7e34771bd1ee18bed5201ef139f --- /dev/null +++ b/shared/package-files/2c/2cde822b93ca16ae535c954b7dfe658b4ad10df2a193628d1b358f1765e8b198/license.terms @@ -0,0 +1,40 @@ +This software is copyrighted by the Regents of the University of +California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState +Corporation, Apple Inc. and other parties. The following terms apply to +all files associated with the software unless explicitly disclaimed in +individual files. + +The authors hereby grant permission to use, copy, modify, distribute, +and license this software and its documentation for any purpose, provided +that existing copyright notices are retained in all copies and that this +notice is included verbatim in any distributions. No written agreement, +license, or royalty fee is required for any of the authorized uses. +Modifications to this software may be copyrighted by their authors +and need not follow the licensing terms described here, provided that +the new terms are clearly indicated on the first page of each file where +they apply. + +IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY +FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY +DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE +IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE +NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR +MODIFICATIONS. + +GOVERNMENT USE: If you are acquiring this software on behalf of the +U.S. government, the Government shall have only "Restricted Rights" +in the software and related documentation as defined in the Federal +Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you +are acquiring the software on behalf of the Department of Defense, the +software shall be classified as "Commercial Computer Software" and the +Government shall have only "Restricted Rights" as defined in Clause +252.227-7013 (b) (3) of DFARs. Notwithstanding the foregoing, the +authors grant the U.S. Government and others acting in its behalf +permission to use and distribute the software in accordance with the +terms specified in this license. diff --git a/shared/package-files/2c/2ce91ed1767d5c99f35f6302f672f7bbe2696e675d05fa72d1443f77efcdbcdf/fields.pyi b/shared/package-files/2c/2ce91ed1767d5c99f35f6302f672f7bbe2696e675d05fa72d1443f77efcdbcdf/fields.pyi new file mode 100644 index 0000000000000000000000000000000000000000..c6cfd44e9f6ab76ee4bc3be7c765569991514d18 --- /dev/null +++ b/shared/package-files/2c/2ce91ed1767d5c99f35f6302f672f7bbe2696e675d05fa72d1443f77efcdbcdf/fields.pyi @@ -0,0 +1,62 @@ +import numpy as np + +from pandas._typing import npt + +def build_field_sarray( + dtindex: npt.NDArray[np.int64], # const int64_t[:] + reso: int, # NPY_DATETIMEUNIT +) -> np.ndarray: ... +def month_position_check(fields, weekdays) -> str | None: ... +def get_date_name_field( + dtindex: npt.NDArray[np.int64], # const int64_t[:] + field: str, + locale: str | None = ..., + reso: int = ..., # NPY_DATETIMEUNIT +) -> npt.NDArray[np.object_]: ... +def get_start_end_field( + dtindex: npt.NDArray[np.int64], + field: str, + freqstr: str | None = ..., + month_kw: int = ..., + reso: int = ..., # NPY_DATETIMEUNIT +) -> npt.NDArray[np.bool_]: ... +def get_date_field( + dtindex: npt.NDArray[np.int64], # const int64_t[:] + field: str, + reso: int = ..., # NPY_DATETIMEUNIT +) -> npt.NDArray[np.int32]: ... +def get_timedelta_field( + tdindex: npt.NDArray[np.int64], # const int64_t[:] + field: str, + reso: int = ..., # NPY_DATETIMEUNIT +) -> npt.NDArray[np.int32]: ... +def get_timedelta_days( + tdindex: npt.NDArray[np.int64], # const int64_t[:] + reso: int = ..., # NPY_DATETIMEUNIT +) -> npt.NDArray[np.int64]: ... +def isleapyear_arr( + years: np.ndarray, +) -> npt.NDArray[np.bool_]: ... +def build_isocalendar_sarray( + dtindex: npt.NDArray[np.int64], # const int64_t[:] + reso: int, # NPY_DATETIMEUNIT +) -> np.ndarray: ... +def _get_locale_names(name_type: str, locale: str | None = ...): ... + +class RoundTo: + @property + def MINUS_INFTY(self) -> int: ... + @property + def PLUS_INFTY(self) -> int: ... + @property + def NEAREST_HALF_EVEN(self) -> int: ... + @property + def NEAREST_HALF_PLUS_INFTY(self) -> int: ... + @property + def NEAREST_HALF_MINUS_INFTY(self) -> int: ... + +def round_nsint64( + values: npt.NDArray[np.int64], + mode: RoundTo, + nanos: int, +) -> npt.NDArray[np.int64]: ... diff --git a/shared/package-files/2c/2cead72e02340a3425743a36ce1399606619ea0e1efdc24e081fe917d68c4564/windows.py b/shared/package-files/2c/2cead72e02340a3425743a36ce1399606619ea0e1efdc24e081fe917d68c4564/windows.py new file mode 100644 index 0000000000000000000000000000000000000000..d5c27b341403fa03283562373b2a0b05daba075e --- /dev/null +++ b/shared/package-files/2c/2cead72e02340a3425743a36ce1399606619ea0e1efdc24e081fe917d68c4564/windows.py @@ -0,0 +1,184 @@ +from __future__ import annotations + +import ctypes +import os +import sys +from functools import lru_cache +from typing import Callable + +from .api import PlatformDirsABC + + +class Windows(PlatformDirsABC): + """`MSDN on where to store app data files + `_. + Makes use of the + `appname `, + `appauthor `, + `version `, + `roaming `, + `opinion `.""" + + @property + def user_data_dir(self) -> str: + """ + :return: data directory tied to the user, e.g. + ``%USERPROFILE%\\AppData\\Local\\$appauthor\\$appname`` (not roaming) or + ``%USERPROFILE%\\AppData\\Roaming\\$appauthor\\$appname`` (roaming) + """ + const = "CSIDL_APPDATA" if self.roaming else "CSIDL_LOCAL_APPDATA" + path = os.path.normpath(get_win_folder(const)) + return self._append_parts(path) + + def _append_parts(self, path: str, *, opinion_value: str | None = None) -> str: + params = [] + if self.appname: + if self.appauthor is not False: + author = self.appauthor or self.appname + params.append(author) + params.append(self.appname) + if opinion_value is not None and self.opinion: + params.append(opinion_value) + if self.version: + params.append(self.version) + return os.path.join(path, *params) + + @property + def site_data_dir(self) -> str: + """:return: data directory shared by users, e.g. ``C:\\ProgramData\\$appauthor\\$appname``""" + path = os.path.normpath(get_win_folder("CSIDL_COMMON_APPDATA")) + return self._append_parts(path) + + @property + def user_config_dir(self) -> str: + """:return: config directory tied to the user, same as `user_data_dir`""" + return self.user_data_dir + + @property + def site_config_dir(self) -> str: + """:return: config directory shared by the users, same as `site_data_dir`""" + return self.site_data_dir + + @property + def user_cache_dir(self) -> str: + """ + :return: cache directory tied to the user (if opinionated with ``Cache`` folder within ``$appname``) e.g. + ``%USERPROFILE%\\AppData\\Local\\$appauthor\\$appname\\Cache\\$version`` + """ + path = os.path.normpath(get_win_folder("CSIDL_LOCAL_APPDATA")) + return self._append_parts(path, opinion_value="Cache") + + @property + def user_state_dir(self) -> str: + """:return: state directory tied to the user, same as `user_data_dir`""" + return self.user_data_dir + + @property + def user_log_dir(self) -> str: + """ + :return: log directory tied to the user, same as `user_data_dir` if not opinionated else ``Logs`` in it + """ + path = self.user_data_dir + if self.opinion: + path = os.path.join(path, "Logs") + return path + + @property + def user_documents_dir(self) -> str: + """ + :return: documents directory tied to the user e.g. ``%USERPROFILE%\\Documents`` + """ + return os.path.normpath(get_win_folder("CSIDL_PERSONAL")) + + @property + def user_runtime_dir(self) -> str: + """ + :return: runtime directory tied to the user, e.g. + ``%USERPROFILE%\\AppData\\Local\\Temp\\$appauthor\\$appname`` + """ + path = os.path.normpath(os.path.join(get_win_folder("CSIDL_LOCAL_APPDATA"), "Temp")) + return self._append_parts(path) + + +def get_win_folder_from_env_vars(csidl_name: str) -> str: + """Get folder from environment variables.""" + if csidl_name == "CSIDL_PERSONAL": # does not have an environment name + return os.path.join(os.path.normpath(os.environ["USERPROFILE"]), "Documents") + + env_var_name = { + "CSIDL_APPDATA": "APPDATA", + "CSIDL_COMMON_APPDATA": "ALLUSERSPROFILE", + "CSIDL_LOCAL_APPDATA": "LOCALAPPDATA", + }.get(csidl_name) + if env_var_name is None: + raise ValueError(f"Unknown CSIDL name: {csidl_name}") + result = os.environ.get(env_var_name) + if result is None: + raise ValueError(f"Unset environment variable: {env_var_name}") + return result + + +def get_win_folder_from_registry(csidl_name: str) -> str: + """Get folder from the registry. + + This is a fallback technique at best. I'm not sure if using the + registry for this guarantees us the correct answer for all CSIDL_* + names. + """ + shell_folder_name = { + "CSIDL_APPDATA": "AppData", + "CSIDL_COMMON_APPDATA": "Common AppData", + "CSIDL_LOCAL_APPDATA": "Local AppData", + "CSIDL_PERSONAL": "Personal", + }.get(csidl_name) + if shell_folder_name is None: + raise ValueError(f"Unknown CSIDL name: {csidl_name}") + if sys.platform != "win32": # only needed for mypy type checker to know that this code runs only on Windows + raise NotImplementedError + import winreg + + key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders") + directory, _ = winreg.QueryValueEx(key, shell_folder_name) + return str(directory) + + +def get_win_folder_via_ctypes(csidl_name: str) -> str: + """Get folder with ctypes.""" + csidl_const = { + "CSIDL_APPDATA": 26, + "CSIDL_COMMON_APPDATA": 35, + "CSIDL_LOCAL_APPDATA": 28, + "CSIDL_PERSONAL": 5, + }.get(csidl_name) + if csidl_const is None: + raise ValueError(f"Unknown CSIDL name: {csidl_name}") + + buf = ctypes.create_unicode_buffer(1024) + windll = getattr(ctypes, "windll") # noqa: B009 # using getattr to avoid false positive with mypy type checker + windll.shell32.SHGetFolderPathW(None, csidl_const, None, 0, buf) + + # Downgrade to short path name if it has highbit chars. + if any(ord(c) > 255 for c in buf): + buf2 = ctypes.create_unicode_buffer(1024) + if windll.kernel32.GetShortPathNameW(buf.value, buf2, 1024): + buf = buf2 + + return buf.value + + +def _pick_get_win_folder() -> Callable[[str], str]: + if hasattr(ctypes, "windll"): + return get_win_folder_via_ctypes + try: + import winreg # noqa: F401 + except ImportError: + return get_win_folder_from_env_vars + else: + return get_win_folder_from_registry + + +get_win_folder = lru_cache(maxsize=None)(_pick_get_win_folder()) + +__all__ = [ + "Windows", +] diff --git a/shared/package-files/38/3800036ff8d6526ca42a93135838023b3e4ba2d5c68dbbb32203bff66545e2ac/Utils.h b/shared/package-files/38/3800036ff8d6526ca42a93135838023b3e4ba2d5c68dbbb32203bff66545e2ac/Utils.h new file mode 100644 index 0000000000000000000000000000000000000000..64c13c68aa21ae60e524a3310cc6ef148ede4e81 --- /dev/null +++ b/shared/package-files/38/3800036ff8d6526ca42a93135838023b3e4ba2d5c68dbbb32203bff66545e2ac/Utils.h @@ -0,0 +1,21 @@ +#pragma once + +#include +#include +#include +#include + +namespace at { namespace native { + +// cuDNN has a buggy check for tensor being contiguous (that is, it does +// not ignore stride for dimension that is equal to 0). This function +// makes tensors which have zero stride contiguous, by setting the +// strides to 1 as cuDNN likes. +inline Tensor contiguousIfZeroInStrides(const Tensor& t) { + for (auto s : t.strides()) { + if (s == 0) return t.contiguous(); + } + return t; +} + +}} diff --git a/shared/package-files/38/380546734ef2289d9dd8802f485f78cfc7f52878054bd94c782ec7a160a7f15d/triads.py b/shared/package-files/38/380546734ef2289d9dd8802f485f78cfc7f52878054bd94c782ec7a160a7f15d/triads.py new file mode 100644 index 0000000000000000000000000000000000000000..7557d42e852e4b31241372fb3b8cab3bfc08f8e8 --- /dev/null +++ b/shared/package-files/38/380546734ef2289d9dd8802f485f78cfc7f52878054bd94c782ec7a160a7f15d/triads.py @@ -0,0 +1,75 @@ +# See https://github.com/networkx/networkx/pull/1474 +# Copyright 2011 Reya Group +# Copyright 2011 Alex Levenson +# Copyright 2011 Diederik van Liere +"""Functions that generate the triad graphs, that is, the possible +digraphs on three nodes. + +""" +from networkx.classes import DiGraph + +__all__ = ["triad_graph"] + +#: Dictionary mapping triad name to list of directed edges in the +#: digraph representation of that triad (with nodes 'a', 'b', and 'c'). +TRIAD_EDGES = { + "003": [], + "012": ["ab"], + "102": ["ab", "ba"], + "021D": ["ba", "bc"], + "021U": ["ab", "cb"], + "021C": ["ab", "bc"], + "111D": ["ac", "ca", "bc"], + "111U": ["ac", "ca", "cb"], + "030T": ["ab", "cb", "ac"], + "030C": ["ba", "cb", "ac"], + "201": ["ab", "ba", "ac", "ca"], + "120D": ["bc", "ba", "ac", "ca"], + "120U": ["ab", "cb", "ac", "ca"], + "120C": ["ab", "bc", "ac", "ca"], + "210": ["ab", "bc", "cb", "ac", "ca"], + "300": ["ab", "ba", "bc", "cb", "ac", "ca"], +} + + +def triad_graph(triad_name): + """Returns the triad graph with the given name. + + Each string in the following tuple is a valid triad name:: + + ('003', '012', '102', '021D', '021U', '021C', '111D', '111U', + '030T', '030C', '201', '120D', '120U', '120C', '210', '300') + + Each triad name corresponds to one of the possible valid digraph on + three nodes. + + Parameters + ---------- + triad_name : string + The name of a triad, as described above. + + Returns + ------- + :class:`~networkx.DiGraph` + The digraph on three nodes with the given name. The nodes of the + graph are the single-character strings 'a', 'b', and 'c'. + + Raises + ------ + ValueError + If `triad_name` is not the name of a triad. + + See also + -------- + triadic_census + + """ + if triad_name not in TRIAD_EDGES: + raise ValueError( + f'unknown triad name "{triad_name}"; use one of the triad names' + " in the TRIAD_NAMES constant" + ) + G = DiGraph() + G.add_nodes_from("abc") + G.add_edges_from(TRIAD_EDGES[triad_name]) + return G diff --git a/shared/package-files/38/38077b5ccfdebd227f190d5f82f3e2e331b24d0f0077c2787dd3cdd4a5f516fb/_fake_quantize_learnable_per_tensor_affine_backward_native.h b/shared/package-files/38/38077b5ccfdebd227f190d5f82f3e2e331b24d0f0077c2787dd3cdd4a5f516fb/_fake_quantize_learnable_per_tensor_affine_backward_native.h new file mode 100644 index 0000000000000000000000000000000000000000..6325ee0bc6fb94d7f358ee089e686995e31f754f --- /dev/null +++ b/shared/package-files/38/38077b5ccfdebd227f190d5f82f3e2e331b24d0f0077c2787dd3cdd4a5f516fb/_fake_quantize_learnable_per_tensor_affine_backward_native.h @@ -0,0 +1,21 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API ::std::tuple _fake_quantize_learnable_per_tensor_affine_backward(const at::Tensor & grad, const at::Tensor & self, const at::Tensor & scale, const at::Tensor & zero_point, int64_t quant_min, int64_t quant_max, double grad_factor=1.0); +} // namespace native +} // namespace at diff --git a/shared/package-files/38/38089d2e09e752f626fa4b5f715b20305a66b8e3348a9424bb88f209a3a85ffd/slow_conv_dilated3d.h b/shared/package-files/38/38089d2e09e752f626fa4b5f715b20305a66b8e3348a9424bb88f209a3a85ffd/slow_conv_dilated3d.h new file mode 100644 index 0000000000000000000000000000000000000000..32b92cffce41f763c6e72576f3635cd6a1322fc3 --- /dev/null +++ b/shared/package-files/38/38089d2e09e752f626fa4b5f715b20305a66b8e3348a9424bb88f209a3a85ffd/slow_conv_dilated3d.h @@ -0,0 +1,91 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::slow_conv_dilated3d(Tensor self, Tensor weight, SymInt[3] kernel_size, Tensor? bias=None, SymInt[3] stride=1, SymInt[3] padding=0, SymInt[3] dilation=1) -> Tensor +inline at::Tensor slow_conv_dilated3d(const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional & bias={}, at::IntArrayRef stride=1, at::IntArrayRef padding=0, at::IntArrayRef dilation=1) { + return at::_ops::slow_conv_dilated3d::call(self, weight, c10::fromIntArrayRefSlow(kernel_size), bias, c10::fromIntArrayRefSlow(stride), c10::fromIntArrayRefSlow(padding), c10::fromIntArrayRefSlow(dilation)); +} +namespace symint { + template ::value>> + at::Tensor slow_conv_dilated3d(const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional & bias={}, at::IntArrayRef stride=1, at::IntArrayRef padding=0, at::IntArrayRef dilation=1) { + return at::_ops::slow_conv_dilated3d::call(self, weight, c10::fromIntArrayRefSlow(kernel_size), bias, c10::fromIntArrayRefSlow(stride), c10::fromIntArrayRefSlow(padding), c10::fromIntArrayRefSlow(dilation)); + } +} + +// aten::slow_conv_dilated3d(Tensor self, Tensor weight, SymInt[3] kernel_size, Tensor? bias=None, SymInt[3] stride=1, SymInt[3] padding=0, SymInt[3] dilation=1) -> Tensor +inline at::Tensor slow_conv_dilated3d_symint(const at::Tensor & self, const at::Tensor & weight, c10::SymIntArrayRef kernel_size, const c10::optional & bias={}, c10::SymIntArrayRef stride=c10::SymInt(1), c10::SymIntArrayRef padding=c10::SymInt(0), c10::SymIntArrayRef dilation=c10::SymInt(1)) { + return at::_ops::slow_conv_dilated3d::call(self, weight, kernel_size, bias, stride, padding, dilation); +} +namespace symint { + template ::value>> + at::Tensor slow_conv_dilated3d(const at::Tensor & self, const at::Tensor & weight, c10::SymIntArrayRef kernel_size, const c10::optional & bias={}, c10::SymIntArrayRef stride=c10::SymInt(1), c10::SymIntArrayRef padding=c10::SymInt(0), c10::SymIntArrayRef dilation=c10::SymInt(1)) { + return at::_ops::slow_conv_dilated3d::call(self, weight, kernel_size, bias, stride, padding, dilation); + } +} + +// aten::slow_conv_dilated3d.out(Tensor self, Tensor weight, SymInt[3] kernel_size, Tensor? bias=None, SymInt[3] stride=1, SymInt[3] padding=0, SymInt[3] dilation=1, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & slow_conv_dilated3d_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional & bias={}, at::IntArrayRef stride=1, at::IntArrayRef padding=0, at::IntArrayRef dilation=1) { + return at::_ops::slow_conv_dilated3d_out::call(self, weight, c10::fromIntArrayRefSlow(kernel_size), bias, c10::fromIntArrayRefSlow(stride), c10::fromIntArrayRefSlow(padding), c10::fromIntArrayRefSlow(dilation), out); +} +namespace symint { + template ::value>> + at::Tensor & slow_conv_dilated3d_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional & bias={}, at::IntArrayRef stride=1, at::IntArrayRef padding=0, at::IntArrayRef dilation=1) { + return at::_ops::slow_conv_dilated3d_out::call(self, weight, c10::fromIntArrayRefSlow(kernel_size), bias, c10::fromIntArrayRefSlow(stride), c10::fromIntArrayRefSlow(padding), c10::fromIntArrayRefSlow(dilation), out); + } +} + +// aten::slow_conv_dilated3d.out(Tensor self, Tensor weight, SymInt[3] kernel_size, Tensor? bias=None, SymInt[3] stride=1, SymInt[3] padding=0, SymInt[3] dilation=1, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & slow_conv_dilated3d_outf(const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional & bias, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, at::Tensor & out) { + return at::_ops::slow_conv_dilated3d_out::call(self, weight, c10::fromIntArrayRefSlow(kernel_size), bias, c10::fromIntArrayRefSlow(stride), c10::fromIntArrayRefSlow(padding), c10::fromIntArrayRefSlow(dilation), out); +} +namespace symint { + template ::value>> + at::Tensor & slow_conv_dilated3d_outf(const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional & bias, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, at::Tensor & out) { + return at::_ops::slow_conv_dilated3d_out::call(self, weight, c10::fromIntArrayRefSlow(kernel_size), bias, c10::fromIntArrayRefSlow(stride), c10::fromIntArrayRefSlow(padding), c10::fromIntArrayRefSlow(dilation), out); + } +} + +// aten::slow_conv_dilated3d.out(Tensor self, Tensor weight, SymInt[3] kernel_size, Tensor? bias=None, SymInt[3] stride=1, SymInt[3] padding=0, SymInt[3] dilation=1, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & slow_conv_dilated3d_symint_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & weight, c10::SymIntArrayRef kernel_size, const c10::optional & bias={}, c10::SymIntArrayRef stride=c10::SymInt(1), c10::SymIntArrayRef padding=c10::SymInt(0), c10::SymIntArrayRef dilation=c10::SymInt(1)) { + return at::_ops::slow_conv_dilated3d_out::call(self, weight, kernel_size, bias, stride, padding, dilation, out); +} +namespace symint { + template ::value>> + at::Tensor & slow_conv_dilated3d_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & weight, c10::SymIntArrayRef kernel_size, const c10::optional & bias={}, c10::SymIntArrayRef stride=c10::SymInt(1), c10::SymIntArrayRef padding=c10::SymInt(0), c10::SymIntArrayRef dilation=c10::SymInt(1)) { + return at::_ops::slow_conv_dilated3d_out::call(self, weight, kernel_size, bias, stride, padding, dilation, out); + } +} + +// aten::slow_conv_dilated3d.out(Tensor self, Tensor weight, SymInt[3] kernel_size, Tensor? bias=None, SymInt[3] stride=1, SymInt[3] padding=0, SymInt[3] dilation=1, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & slow_conv_dilated3d_symint_outf(const at::Tensor & self, const at::Tensor & weight, c10::SymIntArrayRef kernel_size, const c10::optional & bias, c10::SymIntArrayRef stride, c10::SymIntArrayRef padding, c10::SymIntArrayRef dilation, at::Tensor & out) { + return at::_ops::slow_conv_dilated3d_out::call(self, weight, kernel_size, bias, stride, padding, dilation, out); +} +namespace symint { + template ::value>> + at::Tensor & slow_conv_dilated3d_outf(const at::Tensor & self, const at::Tensor & weight, c10::SymIntArrayRef kernel_size, const c10::optional & bias, c10::SymIntArrayRef stride, c10::SymIntArrayRef padding, c10::SymIntArrayRef dilation, at::Tensor & out) { + return at::_ops::slow_conv_dilated3d_out::call(self, weight, kernel_size, bias, stride, padding, dilation, out); + } +} + +} diff --git a/shared/package-files/38/382274ae920e75950f134eb88420248ba084ee64ee25964b0637fe9be9750877/guru-24 b/shared/package-files/38/382274ae920e75950f134eb88420248ba084ee64ee25964b0637fe9be9750877/guru-24 new file mode 100644 index 0000000000000000000000000000000000000000..d714b0bf0ec17e9e4608745596ac01937463bff2 Binary files /dev/null and b/shared/package-files/38/382274ae920e75950f134eb88420248ba084ee64ee25964b0637fe9be9750877/guru-24 differ diff --git a/shared/package-files/38/38235d1e8b7ff1e3f687dc0bc0ed38f30a33eda4bca6a428f26708ba3a2dd007/numpy_T_compositeimplicitautograd_dispatch.h b/shared/package-files/38/38235d1e8b7ff1e3f687dc0bc0ed38f30a33eda4bca6a428f26708ba3a2dd007/numpy_T_compositeimplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..ecdab2f78fe364c989d3ddeebb57af2503af655c --- /dev/null +++ b/shared/package-files/38/38235d1e8b7ff1e3f687dc0bc0ed38f30a33eda4bca6a428f26708ba3a2dd007/numpy_T_compositeimplicitautograd_dispatch.h @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeimplicitautograd { + +TORCH_API at::Tensor numpy_T(const at::Tensor & self); + +} // namespace compositeimplicitautograd +} // namespace at diff --git a/shared/package-files/38/38353c57ca0c09fbf5642b9b35b5deeb5321d01ea1e59ef23b019b85d6d4d5cf/darwin-144x48 b/shared/package-files/38/38353c57ca0c09fbf5642b9b35b5deeb5321d01ea1e59ef23b019b85d6d4d5cf/darwin-144x48 new file mode 100644 index 0000000000000000000000000000000000000000..4791612a7af142694b2f19a392f1a7700319f54e Binary files /dev/null and b/shared/package-files/38/38353c57ca0c09fbf5642b9b35b5deeb5321d01ea1e59ef23b019b85d6d4d5cf/darwin-144x48 differ diff --git a/shared/package-files/38/38353c57ca0c09fbf5642b9b35b5deeb5321d01ea1e59ef23b019b85d6d4d5cf/xnuppc-144x48 b/shared/package-files/38/38353c57ca0c09fbf5642b9b35b5deeb5321d01ea1e59ef23b019b85d6d4d5cf/xnuppc-144x48 new file mode 100644 index 0000000000000000000000000000000000000000..4791612a7af142694b2f19a392f1a7700319f54e Binary files /dev/null and b/shared/package-files/38/38353c57ca0c09fbf5642b9b35b5deeb5321d01ea1e59ef23b019b85d6d4d5cf/xnuppc-144x48 differ diff --git a/shared/package-files/38/38397b241c6d3dfc5a1f6a7f5018142cf536ec18d80340d010145617ee0ca120/results_macro_ols_robust.py b/shared/package-files/38/38397b241c6d3dfc5a1f6a7f5018142cf536ec18d80340d010145617ee0ca120/results_macro_ols_robust.py new file mode 100644 index 0000000000000000000000000000000000000000..875b02e614ffe9627518c9393ce8cac25c437482 --- /dev/null +++ b/shared/package-files/38/38397b241c6d3dfc5a1f6a7f5018142cf536ec18d80340d010145617ee0ca120/results_macro_ols_robust.py @@ -0,0 +1,448 @@ +""" +autogenerated and edited by hand +""" + +import numpy as np + +from statsmodels.tools.testing import ParamsTableTestBunch + +est = dict( + N=202, + df_m=2, + df_r=199, + F=92.94502024547633, + r2=.6769775594319385, + rmse=10.7037959322668, + mss=47782.65712176046, + rss=22799.67822456265, + r2_a=.6737311027428123, + ll=-763.9752181602238, + ll_0=-878.1085999159409, + rank=3, + cmdline="regress g_realinv g_realgdp L.realint, vce(robust)", + title="Linear regression", + marginsok="XB default", + vce="robust", + depvar="g_realinv", + cmd="regress", + properties="b V", + predict="regres_p", + model="ols", + estat_cmd="regress_estat", + vcetype="Robust", +) + +params_table = np.array([ + 4.3742216647032, .32355452428856, 13.519272136038, 5.703151404e-30, + 3.7361862031101, 5.0122571262963, 199, 1.9719565442518, + 0, -.61399696947899, .32772840315987, -1.8734933059173, + .06246625509181, -1.2602631388273, .0322691998693, 199, + 1.9719565442518, 0, -9.4816727746549, 1.3690593206013, + -6.9256843965613, 5.860240898e-11, -12.181398261383, -6.7819472879264, + 199, 1.9719565442518, 0]).reshape(3, 9) + +params_table_colnames = "b se t pvalue ll ul df crit eform".split() + +params_table_rownames = "g_realgdp L.realint _cons".split() + +cov = np.array([ + .1046875301876, -.00084230205782, -.34205013876828, -.00084230205782, + .10740590623772, -.14114426417778, -.34205013876828, -.14114426417778, + 1.8743234233252]).reshape(3, 3) + +cov_colnames = "g_realgdp L.realint _cons".split() + +cov_rownames = "g_realgdp L.realint _cons".split() + + +results_hc0 = ParamsTableTestBunch( + params_table=params_table, + params_table_colnames=params_table_colnames, + params_table_rownames=params_table_rownames, + cov=cov, + cov_colnames=cov_colnames, + cov_rownames=cov_rownames, + **est +) + +# -------------------------------------------------------------- + +est = dict( + df_m=2, + df_r=199, + F=89.45120275471848, + N=202, + lag=4, + rank=3, + title="Regression with Newey-West standard errors", + cmd="newey", + cmdline="newey g_realinv g_realgdp L.realint, lag(4)", + estat_cmd="newey_estat", + predict="newey_p", + vcetype="Newey-West", + depvar="g_realinv", + properties="b V", +) + +params_table = np.array([ + 4.3742216647032, .33125644884286, 13.204940401864, 5.282334606e-29, + 3.7209983425819, 5.0274449868245, 199, 1.9719565442518, + 0, -.61399696947899, .29582347593197, -2.0755518727668, + .03922090940364, -1.1973480087863, -.03064593017165, 199, + 1.9719565442518, 0, -9.4816727746549, 1.1859338087713, + -7.9951112823729, 1.036821797e-13, -11.820282709911, -7.1430628393989, + 199, 1.9719565442518, 0]).reshape(3, 9) + +params_table_colnames = "b se t pvalue ll ul df crit eform".split() + +params_table_rownames = "g_realgdp L.realint _cons".split() + +cov = np.array([ + .10973083489998, .0003953117603, -.31803287070833, .0003953117603, + .08751152891247, -.06062111121649, -.31803287070833, -.06062111121649, + 1.4064389987868]).reshape(3, 3) + +cov_colnames = "g_realgdp L.realint _cons".split() + +cov_rownames = "g_realgdp L.realint _cons".split() + +results_newey4 = ParamsTableTestBunch( + params_table=params_table, + params_table_colnames=params_table_colnames, + params_table_rownames=params_table_rownames, + cov=cov, + cov_colnames=cov_colnames, + cov_rownames=cov_rownames, + **est +) + + +est = dict( + N=202, + inexog_ct=2, + exexog_ct=0, + endog_ct=0, + partial_ct=0, + bw=5, + df_r=199, + df_m=2, + sdofminus=0, + dofminus=0, + r2=.6769775594319388, + rmse=10.7037959322668, + rss=22799.67822456265, + mss=47782.65712176055, + r2_a=.6737311027428126, + F=89.45120275471867, + Fp=1.93466284646e-28, + Fdf1=2, + Fdf2=199, + yy=72725.68049533673, + partialcons=0, + cons=1, + jdf=0, + j=0, + ll=-763.9752181602239, + rankV=3, + rankS=3, + rankxx=3, + rankzz=3, + r2c=.6769775594319388, + r2u=.6864975608440735, + yyc=70582.33534632321, + hacsubtitleV="Statistics robust to heteroskedasticity and autocorrelation", + hacsubtitleB="Estimates efficient for homoskedasticity only", + title="OLS estimation", + predict="ivreg2_p", + version="02.2.08", + cmdline="ivreg2 g_realinv g_realgdp L.realint, robust bw(5) small", + cmd="ivreg2", + model="ols", + depvar="g_realinv", + vcetype="Robust", + partialsmall="small", + small="small", + tvar="qu", + kernel="Bartlett", + inexog="g_realgdp L.realint", + insts="g_realgdp L.realint", + properties="b V", +) + +params_table = np.array([ + 4.3742216647032, .33125644884286, 13.204940401864, 5.282334606e-29, + 3.7209983425819, 5.0274449868245, 199, 1.9719565442518, + 0, -.61399696947899, .29582347593197, -2.0755518727668, + .03922090940364, -1.1973480087863, -.03064593017165, 199, + 1.9719565442518, 0, -9.4816727746549, 1.1859338087713, + -7.9951112823729, 1.036821797e-13, -11.820282709911, -7.1430628393989, + 199, 1.9719565442518, 0]).reshape(3, 9) + +params_table_colnames = "b se t pvalue ll ul df crit eform".split() + +params_table_rownames = "g_realgdp L.realint _cons".split() + +cov = np.array([ + .10973083489998, .0003953117603, -.31803287070833, .0003953117603, + .08751152891247, -.06062111121649, -.31803287070833, -.06062111121649, + 1.4064389987868]).reshape(3, 3) + +cov_colnames = "g_realgdp L.realint _cons".split() + +cov_rownames = "g_realgdp L.realint _cons".split() + +results_ivhac4_small = ParamsTableTestBunch( + params_table=params_table, + params_table_colnames=params_table_colnames, + params_table_rownames=params_table_rownames, + cov=cov, + cov_colnames=cov_colnames, + cov_rownames=cov_rownames, + **est +) + +est = dict( + N=202, + inexog_ct=2, + exexog_ct=0, + endog_ct=0, + partial_ct=0, + bw=5, + df_m=2, + sdofminus=0, + dofminus=0, + r2=.6769775594319388, + rmse=10.6240149746225, + rss=22799.67822456265, + mss=47782.65712176055, + r2_a=.6737311027428126, + F=89.45120275471867, + Fp=1.93466284646e-28, + Fdf1=2, + Fdf2=199, + yy=72725.68049533673, + yyc=70582.33534632321, + partialcons=0, + cons=1, + jdf=0, + j=0, + ll=-763.9752181602239, + rankV=3, + rankS=3, + rankxx=3, + rankzz=3, + r2c=.6769775594319388, + r2u=.6864975608440735, + hacsubtitleV="Statistics robust to heteroskedasticity and autocorrelation", + hacsubtitleB="Estimates efficient for homoskedasticity only", + title="OLS estimation", + predict="ivreg2_p", + version="02.2.08", + cmdline="ivreg2 g_realinv g_realgdp L.realint, robust bw(5)", + cmd="ivreg2", + model="ols", + depvar="g_realinv", + vcetype="Robust", + partialsmall="small", + tvar="qu", + kernel="Bartlett", + inexog="g_realgdp L.realint", + insts="g_realgdp L.realint", + properties="b V", +) + +params_table = np.array([ + 4.3742216647032, .32878742225811, 13.304102798888, 2.191074740e-40, + 3.7298101585076, 5.0186331708989, np.nan, 1.9599639845401, + 0, -.61399696947899, .29361854972141, -2.0911382133777, + .03651567605333, -1.1894787521258, -.03851518683214, np.nan, + 1.9599639845401, 0, -9.4816727746549, 1.1770944273439, + -8.055150508231, 7.938107001e-16, -11.788735458652, -7.1746100906581, + np.nan, 1.9599639845401, 0]).reshape(3, 9) + +params_table_colnames = "b se z pvalue ll ul df crit eform".split() + +params_table_rownames = "g_realgdp L.realint _cons".split() + +cov = np.array([ + .10810116903513, .00038944079356, -.31330961025227, .00038944079356, + .0862118527405, -.05972079768357, -.31330961025227, -.05972079768357, + 1.385551290884]).reshape(3, 3) + +cov_colnames = "g_realgdp L.realint _cons".split() + +cov_rownames = "g_realgdp L.realint _cons".split() + +results_ivhac4_large = ParamsTableTestBunch( + params_table=params_table, + params_table_colnames=params_table_colnames, + params_table_rownames=params_table_rownames, + cov=cov, + cov_colnames=cov_colnames, + cov_rownames=cov_rownames, + **est +) + +# -------------------------------------------------------------- + +est = dict( + N=202, + inexog_ct=2, + exexog_ct=0, + endog_ct=0, + partial_ct=0, + df_r=199, + df_m=2, + sdofminus=0, + dofminus=0, + r2=.6769775594319388, + rmse=10.7037959322668, + rss=22799.67822456265, + mss=47782.65712176055, + r2_a=.6737311027428126, + F=92.94502024547634, + Fp=3.12523087723e-29, + Fdf1=2, + Fdf2=199, + yy=72725.68049533673, + yyc=70582.33534632321, + partialcons=0, + cons=1, + jdf=0, + j=0, + ll=-763.9752181602239, + rankV=3, + rankS=3, + rankxx=3, + rankzz=3, + r2c=.6769775594319388, + r2u=.6864975608440735, + hacsubtitleV="Statistics robust to heteroskedasticity", + hacsubtitleB="Estimates efficient for homoskedasticity only", + title="OLS estimation", + predict="ivreg2_p", + version="02.2.08", + cmdline="ivreg2 g_realinv g_realgdp L.realint, robust small", + cmd="ivreg2", + model="ols", + depvar="g_realinv", + vcetype="Robust", + partialsmall="small", + small="small", + inexog="g_realgdp L.realint", + insts="g_realgdp L.realint", + properties="b V", +) + +params_table = np.array([ + 4.3742216647032, .32355452428856, 13.519272136038, 5.703151404e-30, + 3.7361862031101, 5.0122571262963, 199, 1.9719565442518, + 0, -.61399696947899, .32772840315987, -1.8734933059173, + .06246625509181, -1.2602631388273, .0322691998693, 199, + 1.9719565442518, 0, -9.4816727746549, 1.3690593206013, + -6.9256843965613, 5.860240898e-11, -12.181398261383, -6.7819472879264, + 199, 1.9719565442518, 0]).reshape(3, 9) + +params_table_colnames = "b se t pvalue ll ul df crit eform".split() + +params_table_rownames = "g_realgdp L.realint _cons".split() + +cov = np.array([ + .1046875301876, -.00084230205782, -.34205013876828, -.00084230205782, + .10740590623772, -.14114426417778, -.34205013876828, -.14114426417778, + 1.8743234233252]).reshape(3, 3) + +cov_colnames = "g_realgdp L.realint _cons".split() + +cov_rownames = "g_realgdp L.realint _cons".split() + +results_ivhc0_small = ParamsTableTestBunch( + params_table=params_table, + params_table_colnames=params_table_colnames, + params_table_rownames=params_table_rownames, + cov=cov, + cov_colnames=cov_colnames, + cov_rownames=cov_rownames, + **est +) + +# -------------------------------------------------------------- + +est = dict( + N=202, + inexog_ct=2, + exexog_ct=0, + endog_ct=0, + partial_ct=0, + df_m=2, + sdofminus=0, + dofminus=0, + r2=.6769775594319388, + rmse=10.6240149746225, + rss=22799.67822456265, + mss=47782.65712176055, + r2_a=.6737311027428126, + F=92.94502024547633, + Fp=3.12523087723e-29, + Fdf1=2, + Fdf2=199, + yy=72725.68049533673, + yyc=70582.33534632321, + r2u=.6864975608440735, + partialcons=0, + cons=1, + jdf=0, + j=0, + ll=-763.9752181602239, + rankV=3, + rankS=3, + rankxx=3, + rankzz=3, + r2c=.6769775594319388, + hacsubtitleV="Statistics robust to heteroskedasticity", + hacsubtitleB="Estimates efficient for homoskedasticity only", + title="OLS estimation", + predict="ivreg2_p", + version="02.2.08", + cmdline="ivreg2 g_realinv g_realgdp L.realint, robust", + cmd="ivreg2", + model="ols", + depvar="g_realinv", + vcetype="Robust", + partialsmall="small", + inexog="g_realgdp L.realint", + insts="g_realgdp L.realint", + properties="b V", +) + +params_table = np.array([ + 4.3742216647032, .32114290415293, 13.620795004769, 3.012701837e-42, + 3.7447931386729, 5.0036501907336, np.nan, 1.9599639845401, + 0, -.61399696947899, .32528567293437, -1.8875622892954, + .05908473670106, -1.2515451731172, .02355123415926, np.nan, + 1.9599639845401, 0, -9.4816727746549, 1.3588550094989, + -6.9776927695558, 3.000669464e-12, -12.144979653484, -6.8183658958253, + np.nan, 1.9599639845401, 0]).reshape(3, 9) + +params_table_colnames = "b se z pvalue ll ul df crit eform".split() + +params_table_rownames = "g_realgdp L.realint _cons".split() + +cov = np.array([ + .10313276488778, -.00082979262132, -.33697018621231, -.00082979262132, + .10581076901637, -.13904806223455, -.33697018621231, -.13904806223455, + 1.8464869368401]).reshape(3, 3) + +cov_colnames = "g_realgdp L.realint _cons".split() + +cov_rownames = "g_realgdp L.realint _cons".split() + +results_ivhc0_large = ParamsTableTestBunch( + params_table=params_table, + params_table_colnames=params_table_colnames, + params_table_rownames=params_table_rownames, + cov=cov, + cov_colnames=cov_colnames, + cov_rownames=cov_rownames, + **est +) diff --git a/shared/package-files/38/3846697587874000c1258a8cc3c240c8de2cc3e8ec27a973547ea6f820a82bc8/polyfuncs.py b/shared/package-files/38/3846697587874000c1258a8cc3c240c8de2cc3e8ec27a973547ea6f820a82bc8/polyfuncs.py new file mode 100644 index 0000000000000000000000000000000000000000..b412123f7383c68177a88df8817e921d96f6d5af --- /dev/null +++ b/shared/package-files/38/3846697587874000c1258a8cc3c240c8de2cc3e8ec27a973547ea6f820a82bc8/polyfuncs.py @@ -0,0 +1,321 @@ +"""High-level polynomials manipulation functions. """ + + +from sympy.core import S, Basic, symbols, Dummy +from sympy.polys.polyerrors import ( + PolificationFailed, ComputationFailed, + MultivariatePolynomialError, OptionError) +from sympy.polys.polyoptions import allowed_flags, build_options +from sympy.polys.polytools import poly_from_expr, Poly +from sympy.polys.specialpolys import ( + symmetric_poly, interpolating_poly) +from sympy.polys.rings import sring +from sympy.utilities import numbered_symbols, take, public + +@public +def symmetrize(F, *gens, **args): + r""" + Rewrite a polynomial in terms of elementary symmetric polynomials. + + A symmetric polynomial is a multivariate polynomial that remains invariant + under any variable permutation, i.e., if `f = f(x_1, x_2, \dots, x_n)`, + then `f = f(x_{i_1}, x_{i_2}, \dots, x_{i_n})`, where + `(i_1, i_2, \dots, i_n)` is a permutation of `(1, 2, \dots, n)` (an + element of the group `S_n`). + + Returns a tuple of symmetric polynomials ``(f1, f2, ..., fn)`` such that + ``f = f1 + f2 + ... + fn``. + + Examples + ======== + + >>> from sympy.polys.polyfuncs import symmetrize + >>> from sympy.abc import x, y + + >>> symmetrize(x**2 + y**2) + (-2*x*y + (x + y)**2, 0) + + >>> symmetrize(x**2 + y**2, formal=True) + (s1**2 - 2*s2, 0, [(s1, x + y), (s2, x*y)]) + + >>> symmetrize(x**2 - y**2) + (-2*x*y + (x + y)**2, -2*y**2) + + >>> symmetrize(x**2 - y**2, formal=True) + (s1**2 - 2*s2, -2*y**2, [(s1, x + y), (s2, x*y)]) + + """ + allowed_flags(args, ['formal', 'symbols']) + + iterable = True + + if not hasattr(F, '__iter__'): + iterable = False + F = [F] + + R, F = sring(F, *gens, **args) + gens = R.symbols + + opt = build_options(gens, args) + symbols = opt.symbols + symbols = [next(symbols) for i in range(len(gens))] + + result = [] + + for f in F: + p, r, m = f.symmetrize() + result.append((p.as_expr(*symbols), r.as_expr(*gens))) + + polys = [(s, g.as_expr()) for s, (_, g) in zip(symbols, m)] + + if not opt.formal: + for i, (sym, non_sym) in enumerate(result): + result[i] = (sym.subs(polys), non_sym) + + if not iterable: + result, = result + + if not opt.formal: + return result + else: + if iterable: + return result, polys + else: + return result + (polys,) + + +@public +def horner(f, *gens, **args): + """ + Rewrite a polynomial in Horner form. + + Among other applications, evaluation of a polynomial at a point is optimal + when it is applied using the Horner scheme ([1]). + + Examples + ======== + + >>> from sympy.polys.polyfuncs import horner + >>> from sympy.abc import x, y, a, b, c, d, e + + >>> horner(9*x**4 + 8*x**3 + 7*x**2 + 6*x + 5) + x*(x*(x*(9*x + 8) + 7) + 6) + 5 + + >>> horner(a*x**4 + b*x**3 + c*x**2 + d*x + e) + e + x*(d + x*(c + x*(a*x + b))) + + >>> f = 4*x**2*y**2 + 2*x**2*y + 2*x*y**2 + x*y + + >>> horner(f, wrt=x) + x*(x*y*(4*y + 2) + y*(2*y + 1)) + + >>> horner(f, wrt=y) + y*(x*y*(4*x + 2) + x*(2*x + 1)) + + References + ========== + [1] - https://en.wikipedia.org/wiki/Horner_scheme + + """ + allowed_flags(args, []) + + try: + F, opt = poly_from_expr(f, *gens, **args) + except PolificationFailed as exc: + return exc.expr + + form, gen = S.Zero, F.gen + + if F.is_univariate: + for coeff in F.all_coeffs(): + form = form*gen + coeff + else: + F, gens = Poly(F, gen), gens[1:] + + for coeff in F.all_coeffs(): + form = form*gen + horner(coeff, *gens, **args) + + return form + + +@public +def interpolate(data, x): + """ + Construct an interpolating polynomial for the data points + evaluated at point x (which can be symbolic or numeric). + + Examples + ======== + + >>> from sympy.polys.polyfuncs import interpolate + >>> from sympy.abc import a, b, x + + A list is interpreted as though it were paired with a range starting + from 1: + + >>> interpolate([1, 4, 9, 16], x) + x**2 + + This can be made explicit by giving a list of coordinates: + + >>> interpolate([(1, 1), (2, 4), (3, 9)], x) + x**2 + + The (x, y) coordinates can also be given as keys and values of a + dictionary (and the points need not be equispaced): + + >>> interpolate([(-1, 2), (1, 2), (2, 5)], x) + x**2 + 1 + >>> interpolate({-1: 2, 1: 2, 2: 5}, x) + x**2 + 1 + + If the interpolation is going to be used only once then the + value of interest can be passed instead of passing a symbol: + + >>> interpolate([1, 4, 9], 5) + 25 + + Symbolic coordinates are also supported: + + >>> [(i,interpolate((a, b), i)) for i in range(1, 4)] + [(1, a), (2, b), (3, -a + 2*b)] + """ + n = len(data) + + if isinstance(data, dict): + if x in data: + return S(data[x]) + X, Y = list(zip(*data.items())) + else: + if isinstance(data[0], tuple): + X, Y = list(zip(*data)) + if x in X: + return S(Y[X.index(x)]) + else: + if x in range(1, n + 1): + return S(data[x - 1]) + Y = list(data) + X = list(range(1, n + 1)) + + try: + return interpolating_poly(n, x, X, Y).expand() + except ValueError: + d = Dummy() + return interpolating_poly(n, d, X, Y).expand().subs(d, x) + + +@public +def rational_interpolate(data, degnum, X=symbols('x')): + """ + Returns a rational interpolation, where the data points are element of + any integral domain. + + The first argument contains the data (as a list of coordinates). The + ``degnum`` argument is the degree in the numerator of the rational + function. Setting it too high will decrease the maximal degree in the + denominator for the same amount of data. + + Examples + ======== + + >>> from sympy.polys.polyfuncs import rational_interpolate + + >>> data = [(1, -210), (2, -35), (3, 105), (4, 231), (5, 350), (6, 465)] + >>> rational_interpolate(data, 2) + (105*x**2 - 525)/(x + 1) + + Values do not need to be integers: + + >>> from sympy import sympify + >>> x = [1, 2, 3, 4, 5, 6] + >>> y = sympify("[-1, 0, 2, 22/5, 7, 68/7]") + >>> rational_interpolate(zip(x, y), 2) + (3*x**2 - 7*x + 2)/(x + 1) + + The symbol for the variable can be changed if needed: + >>> from sympy import symbols + >>> z = symbols('z') + >>> rational_interpolate(data, 2, X=z) + (105*z**2 - 525)/(z + 1) + + References + ========== + + .. [1] Algorithm is adapted from: + http://axiom-wiki.newsynthesis.org/RationalInterpolation + + """ + from sympy.matrices.dense import ones + + xdata, ydata = list(zip(*data)) + + k = len(xdata) - degnum - 1 + if k < 0: + raise OptionError("Too few values for the required degree.") + c = ones(degnum + k + 1, degnum + k + 2) + for j in range(max(degnum, k)): + for i in range(degnum + k + 1): + c[i, j + 1] = c[i, j]*xdata[i] + for j in range(k + 1): + for i in range(degnum + k + 1): + c[i, degnum + k + 1 - j] = -c[i, k - j]*ydata[i] + r = c.nullspace()[0] + return (sum(r[i] * X**i for i in range(degnum + 1)) + / sum(r[i + degnum + 1] * X**i for i in range(k + 1))) + + +@public +def viete(f, roots=None, *gens, **args): + """ + Generate Viete's formulas for ``f``. + + Examples + ======== + + >>> from sympy.polys.polyfuncs import viete + >>> from sympy import symbols + + >>> x, a, b, c, r1, r2 = symbols('x,a:c,r1:3') + + >>> viete(a*x**2 + b*x + c, [r1, r2], x) + [(r1 + r2, -b/a), (r1*r2, c/a)] + + """ + allowed_flags(args, []) + + if isinstance(roots, Basic): + gens, roots = (roots,) + gens, None + + try: + f, opt = poly_from_expr(f, *gens, **args) + except PolificationFailed as exc: + raise ComputationFailed('viete', 1, exc) + + if f.is_multivariate: + raise MultivariatePolynomialError( + "multivariate polynomials are not allowed") + + n = f.degree() + + if n < 1: + raise ValueError( + "Cannot derive Viete's formulas for a constant polynomial") + + if roots is None: + roots = numbered_symbols('r', start=1) + + roots = take(roots, n) + + if n != len(roots): + raise ValueError("required %s roots, got %s" % (n, len(roots))) + + lc, coeffs = f.LC(), f.all_coeffs() + result, sign = [], -1 + + for i, coeff in enumerate(coeffs[1:]): + poly = symmetric_poly(i + 1, roots) + coeff = sign*(coeff/lc) + result.append((poly, coeff)) + sign = -sign + + return result diff --git a/shared/package-files/38/38526dfca9ccc27efd87690cacb45e68427845b3c897228f86401869274b6f3d/ntconsole-100-nti b/shared/package-files/38/38526dfca9ccc27efd87690cacb45e68427845b3c897228f86401869274b6f3d/ntconsole-100-nti new file mode 100644 index 0000000000000000000000000000000000000000..eeb8897f87bcbdb16d2bb42ea9d0ab78a9dbad74 Binary files /dev/null and b/shared/package-files/38/38526dfca9ccc27efd87690cacb45e68427845b3c897228f86401869274b6f3d/ntconsole-100-nti differ diff --git a/shared/package-files/38/38526dfca9ccc27efd87690cacb45e68427845b3c897228f86401869274b6f3d/opennt-100-nti b/shared/package-files/38/38526dfca9ccc27efd87690cacb45e68427845b3c897228f86401869274b6f3d/opennt-100-nti new file mode 100644 index 0000000000000000000000000000000000000000..eeb8897f87bcbdb16d2bb42ea9d0ab78a9dbad74 Binary files /dev/null and b/shared/package-files/38/38526dfca9ccc27efd87690cacb45e68427845b3c897228f86401869274b6f3d/opennt-100-nti differ diff --git a/shared/package-files/38/3854a4df3a576edd2b3931c212e756df47309fdd2eaa10084a177ae67f166b63/manager.py b/shared/package-files/38/3854a4df3a576edd2b3931c212e756df47309fdd2eaa10084a177ae67f166b63/manager.py new file mode 100644 index 0000000000000000000000000000000000000000..95ec9e328000e7a31b7ae102d373a15e35bc81b2 --- /dev/null +++ b/shared/package-files/38/3854a4df3a576edd2b3931c212e756df47309fdd2eaa10084a177ae67f166b63/manager.py @@ -0,0 +1,68 @@ +import weakref +from collections import ChainMap + +from numba.core import types + + +class DataModelManager(object): + """Manages mapping of FE types to their corresponding data model + """ + + def __init__(self, handlers=None): + """ + Parameters + ----------- + handlers: Mapping[Type, DataModel] or None + Optionally provide the initial handlers mapping. + """ + # { numba type class -> model factory } + self._handlers = handlers or {} + # { numba type instance -> model instance } + self._cache = weakref.WeakKeyDictionary() + + def register(self, fetypecls, handler): + """Register the datamodel factory corresponding to a frontend-type class + """ + assert issubclass(fetypecls, types.Type) + self._handlers[fetypecls] = handler + + def lookup(self, fetype): + """Returns the corresponding datamodel given the frontend-type instance + """ + try: + return self._cache[fetype] + except KeyError: + pass + handler = self._handlers[type(fetype)] + model = self._cache[fetype] = handler(self, fetype) + return model + + def __getitem__(self, fetype): + """Shorthand for lookup() + """ + return self.lookup(fetype) + + def copy(self): + """ + Make a copy of the manager. + Use this to inherit from the default data model and specialize it + for custom target. + """ + return DataModelManager(self._handlers.copy()) + + def chain(self, other_manager): + """Create a new DataModelManager by chaining the handlers mapping of + `other_manager` with a fresh handlers mapping. + + Any existing and new handlers inserted to `other_manager` will be + visible to the new manager. Any handlers inserted to the new manager + can override existing handlers in `other_manager` without actually + mutating `other_manager`. + + Parameters + ---------- + other_manager: DataModelManager + """ + chained = ChainMap(self._handlers, other_manager._handlers) + return DataModelManager(chained) + diff --git a/shared/package-files/38/38554c10ce1e613d84cf46deba1114093488a5c165756c6c576b84a1364850d2/Tunis b/shared/package-files/38/38554c10ce1e613d84cf46deba1114093488a5c165756c6c576b84a1364850d2/Tunis new file mode 100644 index 0000000000000000000000000000000000000000..427fa563033fdd8533ae56337fa20befe9719b42 Binary files /dev/null and b/shared/package-files/38/38554c10ce1e613d84cf46deba1114093488a5c165756c6c576b84a1364850d2/Tunis differ diff --git a/shared/package-files/38/385c1d18000b888165cfc91276e33e552d8cdc3a6cd05ce5fb5a72596dd5ca1c/schema_check.py b/shared/package-files/38/385c1d18000b888165cfc91276e33e552d8cdc3a6cd05ce5fb5a72596dd5ca1c/schema_check.py new file mode 100644 index 0000000000000000000000000000000000000000..cde4cf1ada271ca19800f2480a9f8c203286a340 --- /dev/null +++ b/shared/package-files/38/385c1d18000b888165cfc91276e33e552d8cdc3a6cd05ce5fb5a72596dd5ca1c/schema_check.py @@ -0,0 +1,285 @@ +import dataclasses +import hashlib +import re +import typing +from enum import IntEnum +from typing import Any, Dict, Optional, Union + +from torch._export.serde import schema +from torch._export.serde.union import _Union + + +class SchemaUpdateError(Exception): + pass + + +def _check(x, msg): + if not x: + raise SchemaUpdateError(msg) + + +def _staged_schema(): + ret: Dict[str, Any] = {} + defs = {} + + def _handle_aggregate(ty): + def dump_type(t): + if isinstance(t, type): + return t.__name__ + elif isinstance(t, str): + assert t in defs + return t + elif o := typing.get_origin(t): + # Lemme know if there's a better way to do this. + if o == list: + head = "List" + elif o == dict: + head = "Dict" + elif o == tuple: + if typing.get_args(t) == (): + return "Tuple[()]" + head = "Tuple" + elif o == Union: + args = typing.get_args(t) + assert len(args) == 2 and args[1] == type(None) + return f"Optional[{dump_type(args[0])}]" + else: + raise AssertionError(f"Type {t} is not supported in export schema.") + return ( + f"{head}[{', '.join([dump_type(x) for x in typing.get_args(t)])}]" + ) + elif t == (): + return "()" + else: + raise AssertionError(f"Type {t} is not supported in export schema.") + + def dump_field(f): + t = dump_type(f.type) + ret = {"type": t} + + value = dataclasses.MISSING + if f.default is not dataclasses.MISSING: + value = f.default + elif f.default_factory is not dataclasses.MISSING: + value = f.default_factory() + + if t.startswith("Optional[") and value is not None: + raise AssertionError( + f"Optional field {ty.__name__}.{f.name} must have default value to be None." + ) + + if value is not dataclasses.MISSING: + default = str(value) + ret["default"] = default + return ret + + return {f.name: dump_field(f) for f in dataclasses.fields(ty)} + + def _handle_int_enum(name, ty): + ret[name] = {"kind": "enum", "fields": {x.name: x.value for x in ty}} + + def _handle_struct(name, ty): + ret[name] = {"kind": "struct", "fields": _handle_aggregate(ty)} + + def _handle_union(name, ty): + ret[name] = {"kind": "union", "fields": _handle_aggregate(ty)} + + for name in dir(schema): + if name.startswith("_"): + continue + + value = getattr(schema, name) + + if hasattr(value, "__module__") and value.__module__ != schema.__name__: + continue + + defs[name] = value + + for name, value in defs.items(): + if isinstance(value, type): + if issubclass(value, IntEnum): + _handle_int_enum(name, value) + elif dataclasses.is_dataclass(value): + if issubclass(value, _Union): + _handle_union(name, value) + else: + _handle_struct(name, value) + else: + raise AssertionError(f"Unknown schema type {name}: {value}") + elif isinstance(value, (int, tuple)): + assert name in ("SCHEMA_VERSION", "TREESPEC_VERSION") + else: + raise AssertionError(f"Unknown variable {name}: {value}") + + ret["SCHEMA_VERSION"] = list(defs["SCHEMA_VERSION"]) + assert all(x > 0 for x in ret["SCHEMA_VERSION"]) + ret["TREESPEC_VERSION"] = defs["TREESPEC_VERSION"] + assert ret["TREESPEC_VERSION"] > 0 + return ret + + +def _diff_schema(dst, src): + additions = {key: src[key] for key in src.keys() - dst.keys()} + subtractions = {key: dst[key] for key in dst.keys() - src.keys()} + + common_keys = src.keys() & dst.keys() + + versions = {"SCHEMA_VERSION", "TREESPEC_VERSION"} + common_keys -= versions + + for key in common_keys: + src_kind = src[key]["kind"] + src_fields = src[key]["fields"] + dst_kind = dst[key]["kind"] + dst_fields = dst[key]["fields"] + _check( + src_kind == dst_kind, + f"Type {key} changed kind from {dst_kind} to {src_kind}", + ) + assert isinstance(src_fields, dict) and isinstance(dst_fields, dict) + added_fields = { + key: src_fields[key] for key in src_fields.keys() - dst_fields.keys() + } + subtracted_fields = { + key: dst_fields[key] for key in dst_fields.keys() - src_fields.keys() + } + common_fields = src_fields.keys() & dst_fields.keys() + + for field in common_fields: + src_field = src_fields[field] + dst_field = dst_fields[field] + if src_kind == "struct": + _check( + src_field["type"] == dst_field["type"], + f"Type of the field {key}.{field} changed from {dst_field['type']} to {src_field['type']}", + ) + if "default" in src_field and "default" not in dst_field: + added_fields[field] = {} + added_fields[field]["default"] = src_field["default"] + if "default" not in src_field and "default" in dst_field: + subtracted_fields[field] = {} + subtracted_fields[field]["default"] = dst_field["default"] + elif src_kind == "enum": + _check( + src_field == dst_field, + f"Value of the enum field {key}.{field} changed from {dst_field} to {src_field}", + ) + elif src_kind == "union": + _check( + src_field["type"] == dst_field["type"], + f"Type of the field {key}.{field} changed from {dst_field['type']} to {src_field['type']}", + ) + else: + raise AssertionError(f"Unknown kind {src_kind}: {key}") + if len(added_fields) > 0: + assert key not in additions + additions[key] = {} + additions[key]["fields"] = added_fields + if len(subtracted_fields) > 0: + assert key not in subtractions + subtractions[key] = {} + subtractions[key]["fields"] = subtracted_fields + + return additions, subtractions + + +def _hash_schema(s): + return hashlib.sha256(repr(s).encode("utf-8")).hexdigest() + + +@dataclasses.dataclass +class _Commit: + result: Dict[str, Any] + checksum_result: str + path: str + additions: Dict[str, Any] + subtractions: Dict[str, Any] + base: Dict[str, Any] + checksum_base: Optional[str] + + +def update_schema(): + import importlib.resources + + if importlib.resources.is_resource(__package__, "schema.yaml"): + content = importlib.resources.read_text(__package__, "schema.yaml") + match = re.search("checksum<<([A-Fa-f0-9]{64})>>", content) + _check(match is not None, "checksum not found in schema.yaml") + assert match is not None + checksum_base = match.group(1) + from yaml import load, Loader + + dst = load(content, Loader=Loader) + assert isinstance(dst, dict) + else: + checksum_base = None + dst = {"SCHEMA_VERSION": None, "TREESPEC_VERSION": None} + + src = _staged_schema() + additions, subtractions = _diff_schema(dst, src) + return _Commit( + result=src, + checksum_result=_hash_schema(src), + path=__package__.replace(".", "/") + "/schema.yaml", + additions=additions, + subtractions=subtractions, + base=dst, + checksum_base=checksum_base, + ) + + +def check(commit: _Commit, force_unsafe: bool = False): + next_version = None + reason = "" + # Step 1: Detect major schema updates. + if len(commit.additions) > 0: + for k, v in commit.additions.items(): + if k not in commit.base: + continue + kind = commit.result[k]["kind"] + fields = v["fields"] + for f, d in fields.items(): + if "default" not in d and kind == "struct": + reason += ( + f"Field {k}.{f} is added to schema.py without a default value as an incomparible change " + + "which requires major version bump.\n" + ) + next_version = [commit.base["SCHEMA_VERSION"][0] + 1, 1] + + if len(commit.subtractions) > 0: + for k, v in commit.subtractions.items(): + if k not in commit.result: + continue + for f in v["fields"]: + reason = f"Field {k}.{f} is removed from schema.py as an incompatible change which requires major version bump.\n" + next_version = [commit.base["SCHEMA_VERSION"][0] + 1, 1] + + if force_unsafe: + reason += "--force-unsafe is used." + next_version = commit.result["SCHEMA_VERSION"] + else: + # Step 2: Detect minor schema updates. + if next_version is None and len(commit.additions) > 0: + for k, v in commit.additions.items(): + for f in v["fields"]: + reason += ( + f"Field {k}.{f} is added to schema.py as an compatible change " + + "which still requires minor version bump.\n" + ) + next_version = [ + commit.base["SCHEMA_VERSION"][0], + commit.base["SCHEMA_VERSION"][1] + 1, + ] + if next_version is None and len(commit.subtractions) > 0: + for k, v in commit.subtractions.items(): + for f in v["fields"]: + reason += ( + f"Field {k}.{f} is removed from schema.py as an compatible change " + + "which still requires minor version bump.\n" + ) + next_version = [ + commit.base["SCHEMA_VERSION"][0], + commit.base["SCHEMA_VERSION"][1] + 1, + ] + + return next_version, reason diff --git a/shared/package-files/38/387d083b8392a798121535d5459923f33bf289d6e0b5aa0b27691998e3763f11/meson.build b/shared/package-files/38/387d083b8392a798121535d5459923f33bf289d6e0b5aa0b27691998e3763f11/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..f0f9894cc6f59a9500a1598c9c9a94d5d6f58429 --- /dev/null +++ b/shared/package-files/38/387d083b8392a798121535d5459923f33bf289d6e0b5aa0b27691998e3763f11/meson.build @@ -0,0 +1,49 @@ +# Metrics is cimported from other subpackages so this is needed for the cimport +# to work +metrics_cython_tree = [ + fs.copyfile('__init__.py') +] +# Some metrics code cimports code from utils, we may as well copy all the necessary files +metrics_cython_tree += utils_cython_tree + +_dist_metrics_pxd = custom_target( + '_dist_metrics_pxd', + output: '_dist_metrics.pxd', + input: '_dist_metrics.pxd.tp', + command: [tempita, '@INPUT@', '-o', '@OUTDIR@'], + # Need to install the generated pxd because it is needed in other subpackages + # Cython code, e.g. sklearn.cluster + install_dir: sklearn_dir / 'metrics', + install: true, +) +metrics_cython_tree += [_dist_metrics_pxd] + +_dist_metrics_pyx = custom_target( + '_dist_metrics_pyx', + output: '_dist_metrics.pyx', + input: '_dist_metrics.pyx.tp', + command: [tempita, '@INPUT@', '-o', '@OUTDIR@'], + # TODO in principle this should go in py.exension_module below. This is + # temporary work-around for dependency issue with .pyx.tp files. For more + # details, see https://github.com/mesonbuild/meson/issues/13212 + depends: metrics_cython_tree, +) + +_dist_metrics = py.extension_module( + '_dist_metrics', + cython_gen.process(_dist_metrics_pyx), + dependencies: [np_dep], + subdir: 'sklearn/metrics', + install: true +) + +py.extension_module( + '_pairwise_fast', + [cython_gen.process('_pairwise_fast.pyx'), metrics_cython_tree], + dependencies: [openmp_dep], + subdir: 'sklearn/metrics', + install: true +) + +subdir('_pairwise_distances_reduction') +subdir('cluster') diff --git a/shared/package-files/38/3884249f17202b6d6cffcde53072fa03e2bd71637f0d159e303eaef5255ef858/netbsd6 b/shared/package-files/38/3884249f17202b6d6cffcde53072fa03e2bd71637f0d159e303eaef5255ef858/netbsd6 new file mode 100644 index 0000000000000000000000000000000000000000..3f253d342395ff8f61413c1f58b1b437fc7ba466 Binary files /dev/null and b/shared/package-files/38/3884249f17202b6d6cffcde53072fa03e2bd71637f0d159e303eaef5255ef858/netbsd6 differ diff --git a/shared/package-files/38/388e8e8c2d06f8f5bdd04f5a609ddb75a34aa8f8527238428c1f01ad191d2312/poisson_resid.csv b/shared/package-files/38/388e8e8c2d06f8f5bdd04f5a609ddb75a34aa8f8527238428c1f01ad191d2312/poisson_resid.csv new file mode 100644 index 0000000000000000000000000000000000000000..509456bfb83486e6563792f7b47dc0f4a06ab159 --- /dev/null +++ b/shared/package-files/38/388e8e8c2d06f8f5bdd04f5a609ddb75a34aa8f8527238428c1f01ad191d2312/poisson_resid.csv @@ -0,0 +1 @@ + -2.48, -0.48, -2.48, -2.48, -2.48, -2.51, -2.51, -1.51, -2.51, -2.51, -2.51, -1.51, -2.51, -2.51, -2.51, 3.52, -0.48, -2.48, -2.48, -2.48, -2.07, -3.07, -3.07, -3.07, -3.07, -2.93, -3.93, -2.93, -1.93, 0.07, -3.48, -3.48, -3.48, -3.48, -3.48, -1.82, -1.82, -1.82, -3.82, -3.82, -3.82, -1.85, -2.85, -2.85, -3.82, -3.82, -3.82, -2.82, -3.82, 3.18, -1.33, -2.33, -0.33, 5.99, -1.01, -0.01, -1.71, -1.71, -2.71, 1.20, 2.20, 11.20, 0.59, 0.59, 2.59, -1.59, -2.59, 2.41, -2.59, -1.59, -1.63, -1.63, 0.37, -0.63, -1.63, -3.17, -4.17, 0.83, -3.17, -4.17, 2.41, 0.41, -2.59, -2.59, -2.59, 1.41, -2.59, -1.59, -2.59, -1.59, -3.56, -3.56, -4.56, 12.10, 3.10, -0.90, 2.12, 2.12, 1.12, 17.69, 11.69, 16.69, 16.69, 13.69, 3.41, 4.41, 2.41, 11.41, 6.41, 4.41, 1.41, 5.41, -4.17, -4.17, -5.17, -1.64, -1.64, -2.64, -0.56, 2.44, 10.44, -0.00, -1.00, -1.00, -1.48, 0.52, -0.48, -0.09, -0.09, -1.09, -0.17, -2.17, 0.83, 16.75, 11.75, 7.75, 63.43, 52.43, 57.43, -3.28, -2.28, -3.28, 7.79, 5.79, 1.79, -0.21, 4.79, 2.83, -0.17, 0.83, -0.17, -1.17, 2.36, 6.36, 8.36, 31.87, 5.87, 2.87, 2.87, 10.87, 2.52, 1.52, -0.48, -2.48, -2.48, -1.51, -0.51, -1.51, 2.49, 0.49, 0.49, 0.49, 0.49, -1.51, -0.51, 0.49, -0.51, -1.51, -1.51, -1.51, -0.51, 0.49, -2.51, -1.51, -1.51, 10.55, 10.55, 11.55, -3.13, -3.13, -0.13, -0.01, 1.99, 0.99, 3.70, 0.70, 0.70, 4.99, 0.99, 4.99, 3.11, 3.11, -0.89, 0.79, -3.21, 0.79, 3.84, -0.16, 2.84, 2.08, 14.08, -4.92, 7.59, 2.59, -1.41, -3.89, -3.89, -2.89, 5.11, -1.89, -1.89, -0.89, -0.89, -1.89, 1.47, 0.47, 0.47, 1.47, -0.53, -1.56, -0.56, -2.56, -2.56, -2.56, -0.53, -1.53, -1.53, -0.53, -0.53, 1.44, 2.44, 1.44, 1.44, 2.44, 0.50, 1.50, -1.50, 0.50, 0.50, -1.89, -2.89, -0.89, 0.11, -2.89, 0.18, 0.18, 0.18, 0.18, -0.82, 1.19, 0.19, 7.19, 2.19, 8.19, 2.10, 0.10, -0.90, -2.90, 2.10, 3.64, -2.36, -1.36, -2.36, 1.64, -0.56, -2.56, 0.44, 0.44, -1.56, 1.44, -2.56, -1.56, -2.56, -1.56, 7.65, 3.65, -3.35, -1.56, -0.56, 1.44, -2.56, -2.56, -1.56, -2.56, -2.56, -2.56, 1.19, 7.19, -1.81, -1.94, -0.94, -1.94, -0.94, -0.94, -1.94, -0.82, -1.82, -1.82, -1.84, -1.84, 0.16, 1.24, 0.24, -0.76, -0.76, 0.24, -3.59, -3.59, -3.59, -0.59, -3.59, 3.67, -1.33, -2.33, 2.67, -1.33, 8.26, 41.26, 4.26, -1.42, -1.42, 0.58, -3.25, -0.25, -2.25, -0.23, -2.23, -5.23, -1.40, -1.40, -1.40, -0.18, -1.18, -1.18, 1.44, -0.56, -1.56, 0.52, 14.52, 18.52, -2.70, -2.70, -4.70, 4.82, -4.18, -4.18, -3.18, -4.18, -1.21, -3.21, -3.21, -0.21, -3.21, -2.21, -3.21, -3.21, -1.21, -3.21, -3.21, 3.79, 1.79, -3.21, -2.21, -1.17, -3.17, -3.17, -2.17, -3.17, -1.21, -1.21, -3.21, -3.21, -3.21, -3.17, -2.17, -3.17, 2.83, -3.17, -0.17, 0.83, 1.83, -3.39, -3.39, -3.39, 4.55, 4.55, 5.55, -0.73, 2.27, 6.27, 45.27, 5.27, 3.18, 6.18, 12.18, 2.49, 7.49, 1.49, 4.49, 3.49, 0.49, -1.29, -1.29, -1.29, -0.58, -1.58, -1.58, 18.52, 13.52, 6.52, 3.52, 8.52, 35.78, 18.78, 4.78, 4.78, 18.78, 0.50, -2.50, 0.50, -1.56, -1.56, -2.56, -0.56, -1.56, 0.44, -2.90, -2.90, 4.10, -1.50, -1.50, -0.50, -2.42, -2.42, -0.42, -3.69, -3.69, -3.69, -0.09, -0.09, 2.97, -0.03, 4.97, 5.97, 4.97, 2.91, 6.91, 4.91, 0.91, 1.91, 0.26, 0.26, -1.74, -2.74, 0.26, 1.58, -1.42, -1.42, 0.58, -0.42, -2.48, -3.48, -2.48, -0.48, -2.48, -2.71, -3.71, -1.71, -4.71, -3.71, -3.31, -3.31, -3.31, -3.31, -3.31, -2.56, -1.56, 0.44, -1.56, 1.44, -1.56, -1.56, -2.56, -2.56, -1.56, -2.56, -1.56, -1.56, 0.44, -1.56, -3.35, -0.35, -2.35, -3.35, -3.35, -3.35, 0.65, -1.35, -1.35, -3.35, -0.38, -1.38, -1.38, -2.38, 2.62, -1.38, 3.59, -1.41, 0.59, 1.67, -0.33, -1.33, -2.71, -1.71, -1.71, -1.33, -2.33, -1.33, 0.79, -3.21, -1.21, -1.33, 5.67, 0.67, 1.29, -2.71, -1.71, -1.16, -2.16, -0.16, 4.84, 2.84, -0.47, -0.47, -0.47, 3.53, -0.47, 6.36, 3.36, 4.36, 0.36, -0.64, 6.36, 11.36, 12.36, -0.64, 2.36, -2.21, 1.79, -2.21, 1.79, 10.79, -1.21, -0.21, -2.21, -3.21, 9.79, -3.00, 5.00, -3.00, -2.00, -2.00, -2.00, 1.00, -2.00, -2.00, 2.00, -3.95, -3.95, -3.95, -1.95, -1.95, 2.08, 0.08, 1.08, -2.92, -1.92, 0.08, 0.08, -2.92, -2.92, -1.92, 6.08, 3.08, 1.08, 0.08, 0.08, -2.17, -2.17, -2.17, 0.83, 0.83, 0.83, -3.17, 0.83, -0.17, -0.17, 1.83, 0.83, -3.17, -1.17, 0.83, 0.44, 3.44, 1.44, -0.56, 4.44, 3.44, -1.56, -2.56, -0.56, -2.56, -2.56, 2.44, 0.44, -2.56, -1.56, 5.44, 4.44, -1.56, 0.44, -0.56, -1.56, 1.44, -1.56, 2.47, -1.53, -0.53, 10.30, 9.30, 10.30, -0.59, -1.59, -2.59, 2.41, 0.41, -1.59, -0.59, -1.59, -1.59, -1.59, 2.41, -2.59, 0.41, 3.41, 0.41, 2.41, 3.41, -2.59, -2.87, 1.13, -2.87, -1.56, -0.56, -0.56, 0.44, -1.56, -1.56, -0.56, -1.56, -0.56, -1.56, 0.11, 0.11, 0.11, -2.89, -0.89, -0.89, 8.11, 10.11, 1.11, 6.11, -0.16, -0.16, -0.16, -1.16, -1.16, -0.89, -1.89, -2.89, 1.11, -2.89, 16.49, -0.51, 1.49, 12.52, 7.52, 4.52, 0.45, -2.55, -2.55, -1.55, -2.55, 0.50, -2.50, -4.50, -1.50, -0.50, -1.96, -0.96, 1.04, -2.13, -3.13, 0.87, 0.95, -1.05, 2.95, -2.13, -1.13, 1.87, -1.59, -1.40, 0.41, -0.59, 0.65, 0.65, 3.65, -1.63, -1.63, -0.63, 3.87, 1.87, -2.13, 0.12, 1.12, 12.12, -1.86, -1.86, -0.86, 0.14, 0.14, -0.89, -2.89, -2.89, 4.11, 0.11, 0.50, 0.50, 0.50, -2.50, -2.50, -2.51, -0.51, 1.49, -2.48, -1.48, -1.48, -4.04, -4.04, -4.04, -0.48, -1.48, -0.48, -2.56, -1.56, -1.86, -1.86, 1.14, 0.14, -1.86, -1.86, -2.56, -2.56, -2.30, 2.70, -1.03, 2.97, -3.03, -3.07, -3.07, -1.07, 30.99, 15.99, 11.99, 4.99, 11.99, 18.94, 5.94, 9.94, 4.94, 1.94, -1.53, -1.53, -1.53, -2.53, -2.53, -2.53, -2.53, -2.53, 0.47, -2.53, -2.53, -2.53, -0.53, -1.53, -1.53, -2.53, -2.53, -2.53, 1.47, -0.53, 5.47, 7.47, 2.47, 2.47, -0.56, -1.56, -0.56, 2.47, 4.47, 7.47, -1.97, -1.97, 0.03, -1.97, -1.97, -0.46, 0.54, -1.46, -1.46, 1.54, 12.54, 6.54, 7.54, -0.46, 1.54, 1.54, -0.46, -2.46, 0.54, -2.46, 2.39, -1.61, 1.39, 1.64, -5.36, 0.64, -3.21, -3.21, -2.21, -2.21, -2.21, -3.13, -3.13, -3.13, -3.13, -3.13, -2.17, -1.17, -1.17, -1.17, -1.17, -3.21, -3.21, -1.21, -2.21, -3.21, 4.29, -0.71, -0.71, -1.71, 1.29, -4.98, -4.98, -1.98, -2.98, -3.98, -2.47, 0.53, 2.53, -2.33, -1.33, -0.33, -1.33, -2.33, 2.67, -2.33, 2.67, -2.33, -2.33, 3.41, -2.59, -2.59, -0.59, 0.41, -0.16, -2.16, -1.16, -1.16, -2.16, 4.64, -2.36, 1.64, -0.36, 3.64, -3.06, -3.06, -3.06, -3.06, -2.06, 0.24, -2.76, -2.76, -4.76, -3.76, -2.71, -1.71, -0.71, 0.29, 0.29, -2.71, -0.71, -2.71, -1.71, -1.71, 0.29, 0.29, -2.71, -1.71, -1.71, -0.71, -0.71, -2.71, -1.71, 2.29, -1.56, -1.56, -1.56, -0.82, -1.82, -1.82, 1.51, -2.49, -2.49, -2.49, -2.49, -1.25, -2.25, -3.25, -1.48, -1.48, -2.48, -1.48, -2.48, -2.48, 0.52, 5.52, -2.48, -0.25, 8.75, 14.75, 5.55, 1.55, 10.55, -0.51, -2.51, -1.51, -0.45, -0.45, 1.55, 3.55, -2.45, 5.55, -2.12, -2.12, 4.88, -3.51, -3.51, -2.51, 7.49, -1.51, 1.44, -0.56, 0.44, -0.56, -0.56, -3.91, -4.91, -3.91, -2.91, -2.91, -1.86, -1.86, -1.86, -1.86, -1.86, 3.01, 2.01, 8.01, 1.06, 6.06, 1.06, -0.99, 3.01, -3.99, -1.59, -2.59, 0.41, -2.94, -2.94, -1.94, -2.40, -2.40, -0.40, 5.50, 5.50, 5.50, 3.14, 0.14, 1.14, 2.64, 0.64, 1.64, -2.56, -2.56, -2.56, -2.56, -2.56, -2.56, 4.05, 6.05, 2.05, -3.00, -3.00, -3.00, -3.37, -4.37, -4.37, -2.51, -2.51, -2.51, -1.51, -1.51, -2.51, 2.14, 4.14, 2.14, 1.14, 6.14, 3.50, -0.50, 0.50, 3.50, -2.50, 1.14, -0.86, 0.14, 4.14, 9.14, -0.63, -0.63, -0.63, -0.63, -1.63, 1.82, 0.82, -0.18, -1.18, -2.18, 5.41, 1.41, -0.59, 0.41, 3.41, 0.06, 0.06, -0.94, -1.94, 1.06, -0.59, -2.59, -0.59, -2.59, -2.59, -1.63, 0.37, -1.63, 1.37, -0.63, 0.06, -2.94, -2.94, 0.06, -1.94, -0.56, -2.56, -1.56, 1.44, -2.56, -0.18, 0.82, -0.18, 2.82, 2.82, 3.41, -1.59, -1.59, -2.59, -0.59, -2.93, -1.93, -1.93, 0.07, 2.07, -1.35, -1.35, -1.35, -0.35, -1.35, -0.61, 2.39, 4.39, 4.39, 1.39, -1.61, 5.62, 3.62, 10.62, 8.39, 13.39, 12.39, 0.89, -0.11, -0.11, -2.52, -3.52, -3.52, 0.97, -3.03, -0.03, 15.87, -0.13, 6.87, 3.36, 5.36, 2.36, 1.87, 6.87, -2.13, 3.32, 1.32, 4.32, 12.41, 13.41, 0.41, -1.56, -0.56, 0.44, -0.56, 6.44, -0.56, -1.56, -2.56, -0.56, -0.56, -2.65, -2.65, -2.65, -1.65, -2.65, 0.44, -2.56, -2.56, -2.56, -2.56, 0.19, 4.19, 11.19, 2.47, 1.47, -1.53, 1.47, 0.47, -2.59, -0.59, 2.41, -2.59, -2.59, -0.88, -0.88, -0.88, -1.88, -0.88, -1.59, 0.41, 0.41, -0.59, -0.59, -3.48, 0.52, -2.48, -3.48, -3.48, -2.07, -2.07, -0.07, 1.93, -2.07, -2.23, -2.23, -1.23, -0.23, 9.47, 2.47, -1.53, -2.53, -2.53, -2.53, -1.21, 6.79, 1.79, -0.21, -0.21, -3.21, -1.21, -2.21, -3.21, -2.21, 11.89, 4.89, 2.89, 0.89, -4.11, 3.30, 0.30, -0.70, -2.70, -0.70, 8.47, 3.47, 3.47, -0.53, 4.47, -2.59, -2.59, -2.59, 10.07, -0.93, 2.97, -1.03, -2.03, -2.00, 0.00, -1.00, 5.41, 11.41, 3.41, -2.62, -2.62, -0.62, -2.62, 2.38, 0.02, -3.98, 5.02, -1.98, 3.02, 6.45, 0.45, 4.45, 1.45, 2.45, 6.41, -1.59, 3.84, -0.16, -0.48, 7.52, -1.48, 0.52, -0.48, 0.52, 0.49, -0.51, -1.51, 2.52, 4.52, 7.52, 2.52, 3.52, -1.48, -0.56, -2.56, -1.56, 6.95, 11.95, -5.05, 0.16, -1.84, -0.84, -1.48, -0.48, 0.52, -2.48, -1.48, -2.81, -2.81, -2.81, -2.81, -2.81, -1.48, -2.48, -1.48, -2.48, -1.48, -0.42, -2.42, -1.42, -1.42, -1.42, 1.91, 0.91, -1.09, -1.09, -2.09, -1.58, -1.58, 1.42, 0.42, -0.58, -1.50, -1.50, -0.50, -2.50, -0.50, -2.51, -1.51, -2.51, -1.51, -2.51, -0.09, 3.91, -2.09, -1.09, -1.09, 7.65, 4.65, 2.65, -0.28, -1.28, -0.28, 7.47, 4.47, 2.47, 2.47, 2.47, 0.47, 2.36, 1.36, -1.64, -0.64, -0.64, -0.41, -0.41, -1.41, -1.41, -1.41, -1.94, -0.94, 6.06, 1.06, 0.06, 4.80, 2.80, 1.80, -0.20, 1.80, -1.03, 3.97, -0.03, 1.97, -2.03, 4.89, 0.89, 2.89, 0.89, -0.11, 0.89, -0.11, -1.11, -0.11, -0.11, -2.07, -3.07, 0.93, -0.07, -3.07, -0.07, -1.07, -2.07, -1.07, -1.07, -2.59, -0.59, -1.59, 1.41, -0.59, 0.41, 6.26, 8.26, -1.74, 4.44, 28.44, -1.56, 1.01, -0.99, 2.01, 0.01, -2.99, -0.36, 5.64, -2.36, 0.64, -2.36, -1.50, 0.50, -2.50, -0.50, -1.50, -0.99, 1.01, 3.01, -0.99, -3.99, -2.99, 1.01, 3.01, 0.01, -1.99, -1.12, -0.12, -7.12, -5.12, -6.12, 9.03, 22.03, 5.03, 10.03, 11.03, -1.82, -1.82, -1.82, -1.82, -1.82, -2.48, -2.48, -2.48, -2.51, -2.51, -2.51, -2.48, -2.48, -2.48, 0.52, -3.48, -0.48, -2.48, -2.48, -2.48, -2.48, -2.48, -2.48, -1.51, -2.51, -2.51, 0.41, 1.41, -3.59, -3.59, -0.59, 1.70, -2.30, -2.30, -2.30, -0.30, -2.17, -2.17, 0.83, -1.17, -1.17, 7.47, -2.53, -0.53, -0.53, 3.47, -0.53, -2.53, -2.53, -1.53, -2.53, -0.40, -3.40, -0.40, -2.40, -1.40, -2.47, -2.47, -2.47, -1.47, -2.47, 1.50, -0.50, -1.50, -0.50, -1.50, -1.71, 1.29, -2.71, -5.83, -6.83, -2.83, 4.42, 1.42, -2.30, -1.30, 0.70, -2.30, -0.30, -0.67, -2.67, -2.67, -2.67, -1.67, -2.67, -1.67, 5.33, -1.67, 0.33, 1.69, 7.69, 5.69, 0.69, -0.31, 4.83, -3.17, -3.17, -2.59, -2.59, -2.59, -2.59, -2.59, -2.59, -2.18, -2.18, -3.39, -3.39, -1.13, 1.87, 1.87, 1.87, 1.87, -2.56, -1.56, -1.56, -1.56, -2.56, -2.56, 3.44, 2.44, 0.44, -1.56, -1.59, -0.59, -1.59, -1.59, -1.59, -1.56, -1.56, -1.56, -0.56, -1.56, -3.35, -4.35, -3.35, -3.35, -2.35, -1.56, 1.44, -1.56, 0.44, 3.44, -0.50, -0.50, -1.50, -2.50, 1.50, -1.35, 5.65, 0.65, -2.35, -1.35, 5.26, 2.26, -1.74, 1.26, -1.74, -0.56, -0.56, -1.56, 0.44, -0.56, 4.50, 10.50, 1.50, -1.16, -1.16, 4.84, -0.56, -1.56, -2.56, -2.56, -1.56, -2.56, -0.41, -3.41, -5.41, -2.41, -1.41, -2.57, -3.57, -3.57, -3.57, -3.57, 5.93, 6.93, 4.93, 2.93, 4.93, -1.61, 1.39, -1.61, 0.39, 0.39, -1.56, -2.56, -0.56, -1.56, -1.56, 0.64, -2.36, 1.64, 0.64, -0.36, -1.13, -2.13, -2.13, -1.84, -1.84, -0.84, 0.41, 0.41, 4.41, -2.32, -3.32, -1.32, -5.85, -3.85, 0.15, -1.53, -2.53, 4.47, -1.31, -1.31, -2.31, -0.16, -0.16, -2.16, -1.16, -1.16, -0.56, -2.56, -2.56, -0.56, -1.56, 13.44, 13.44, 4.44, -2.56, -2.56, 1.10, -2.90, 0.10, -1.90, -0.90, -3.58, -3.58, 25.42, -5.45, -5.45, 6.55, 0.88, -2.12, 4.88, -0.12, -1.12, 2.18, -1.82, -1.82, -1.82, -0.82, -0.82, 1.18, -0.82, -1.82, 0.18, -1.77, 0.23, -2.77, 0.23, 2.23, -0.29, 5.71, -0.29, 1.71, 1.71, 5.00, -0.00, 13.00, 15.00, 5.00, -1.51, -1.51, -0.51, -2.51, -1.51, -0.51, -1.51, -1.51, 4.49, -0.51, 1.52, -2.48, 7.52, 4.52, 5.52, 0.23, -3.77, -1.77, -2.77, 0.23, 0.87, 1.87, 0.87, 0.87, 2.87, -1.71, -1.71, -0.71, 3.29, 1.29, 1.36, -1.64, 0.36, -0.64, 1.36, 2.79, -0.21, 4.79, 1.79, -0.21, 12.29, 1.29, 2.29, -0.71, -2.71, -0.33, 9.67, 6.67, 1.67, -0.33, -0.84, 1.16, 0.16, 1.16, -0.84, 0.16, 1.16, 2.16, 1.16, 2.16, -2.84, -2.84, -3.84, -3.84, -2.84, 5.16, 0.16, -1.84, -1.84, 0.16, 1.10, 2.10, 3.10, 7.65, 9.65, 5.65, -0.80, 4.20, -1.80, 4.20, 3.20, 18.27, -1.73, -3.73, -1.73, -3.73, 5.01, 4.01, -1.99, -2.95, 4.05, 3.05, -2.95, -2.95, -2.95, -0.61, 0.39, 0.39, -1.56, -1.56, -0.56, -1.36, 1.64, 0.64, -1.61, -0.61, -1.61, -2.53, -2.53, 2.16, 0.16, -1.59, -0.59, -0.59, -0.59, -1.59, -0.51, -0.51, -1.51, -0.51, -2.51, -0.82, -1.82, -0.82, -1.82, -1.82, -0.48, 3.52, 0.52, -0.48, -2.48, -2.45, 1.55, 0.55, -1.45, -2.45, 12.44, 1.44, 3.44, 4.68, -5.32, -0.32, 4.44, 3.44, 2.44, -1.94, 5.06, 0.06, 0.20, 0.20, 2.20, -1.85, -2.85, 1.15, 1.15, 1.15, -0.85, -1.63, -1.63, -1.63, -1.63, -1.63, 5.41, 0.41, -0.59, 1.41, -1.59, 7.41, 3.41, -0.59, -1.59, -0.59, 2.06, -2.94, 0.06, -2.94, -2.94, -3.71, 0.29, -3.71, -3.71, -1.71, 2.21, -0.79, -1.79, -0.79, 5.21, -1.51, -2.51, -2.51, -2.51, -2.51, 2.20, 0.20, -2.80, 6.20, 6.20, -2.11, -2.11, 2.89, -0.11, -2.11, -2.11, -2.11, -2.11, -0.11, 0.89, -0.45, -2.45, -2.45, -2.45, 0.55, -2.51, -2.51, -0.51, 3.49, -1.51, -1.11, -2.11, -2.11, -1.11, -1.11, -2.82, 33.18, 17.18, 2.29, -3.71, -2.71, -2.71, -2.71, 1.67, 0.67, -1.33, 0.67, 2.67, 2.67, -2.33, -1.33, -1.33, -2.33, 2.38, -3.71, -3.71, -3.71, -0.71, 2.29, -2.71, -3.71, -2.71, -1.71, -0.71, -1.71, -1.71, -2.71, 0.29, -2.71, -2.62, -2.62, 0.38, -1.62, 1.38, 10.03, 0.03, 7.03, 9.03, 8.03, 21.80, 9.80, 15.80, 16.80, 15.80, -0.96, 17.04, -5.96, -5.32, -5.32, -5.32, 2.95, -2.05, -3.05, -3.09, -3.09, -3.09, -0.09, -0.09, -0.09, -1.09, -2.09, -2.09, -5.78, -1.78, -3.78, 2.22, -2.78, 3.91, 5.91, -2.09, 0.91, -2.09, -2.33, -1.33, -2.33, -1.33, -2.33, 9.81, -3.19, 3.81, 8.81, 11.81, -3.84, -3.84, -2.84, 0.16, -0.84, -0.45, 0.55, 8.55, 0.55, -2.45, 1.55, 5.55, -1.45, -1.45, -2.45, -1.45, -0.50, -1.50, -1.50, -1.21, -3.21, -3.21, -1.71, 0.67, -2.33, -0.33, -0.33, -0.33, 1.87, 3.87, -0.13, -2.13, 10.87, -3.21, -1.21, -0.21, 2.79, -1.21, -2.21, 1.79, -0.21, 0.79, -0.21, -1.89, -1.89, 1.11, 3.11, 0.11, -3.21, -1.21, 4.79, -0.21, 1.79, -2.21, -0.21, -2.21, -2.21, 2.79, -2.13, -0.21, 1.79, -3.21, 6.79, 47.79, 0.49, 1.49, -2.51, 3.49, 20.49, 19.71, 8.71, 13.71, 7.71, 9.71, -0.42, -0.42, -1.42, 2.58, -0.42, -0.51, -0.51, -0.51, -0.51, 2.49, 2.18, 1.18, 3.18, -3.35, -3.35, 1.65, -2.35, 1.65, -1.94, 2.06, -2.94, -2.94, -2.94, -2.59, -0.59, -1.59, 0.41, -0.59, -1.18, 1.82, -1.18, 2.82, -0.18, -2.56, -1.56, -2.56, -2.56, -1.56, 2.44, 0.44, 2.44, 0.44, -0.56, 0.44, -1.56, 2.44, -0.56, 30.44, 0.44, 2.44, -0.56, 5.44, 7.44, 1.44, 2.44, 2.44, 2.44, 1.44, -2.56, -0.56, -2.56, -2.56, 1.44, -2.56, -2.56, -1.56, -1.56, -1.56, -2.56, -2.56, -2.56, -1.56, -2.56, 0.44, -2.56, -1.56, -2.56, -1.56, -2.56, -2.37, -2.37, -2.37, -2.37, -2.37, -2.37, -2.37, -2.37, -2.37, -1.49, -1.49, -1.49, -2.37, -2.37, -2.37, -2.68, -4.68, -1.84, 1.16, -1.84, -1.84, 3.16, -0.21, -1.21, -3.21, -3.21, -3.21, 1.79, -2.21, -3.21, -1.21, -2.21, -3.21, -2.21, -1.63, -1.63, -0.63, -2.59, -2.59, -1.59, -1.88, -1.88, -1.88, -2.59, -1.59, -1.59, -2.21, 0.79, -1.21, -1.21, -0.21, 0.67, -0.33, -1.33, 0.67, -0.33, 6.99, 14.99, 28.99, 10.99, 3.99, 4.79, -1.21, -2.21, 0.79, -1.21, 11.87, 24.87, 6.87, 16.87, 12.87, 3.92, -0.08, 0.92, -1.08, -2.08, -1.08, -1.56, -2.56, -0.56, -2.56, -2.56, -2.56, -2.56, -1.56, -1.56, -2.56, -0.56, -2.56, 1.44, -1.56, -1.56, 1.47, -1.53, -1.53, -1.53, -1.53, -2.72, -1.72, 1.28, 4.33, -0.67, 0.33, 1.28, 7.28, 3.28, -2.72, -3.72, -1.72, 2.28, 1.28, 8.28, 0.31, -1.69, -1.69, -2.69, 2.31, -3.71, -1.71, -0.71, -3.71, -3.71, -2.13, -3.13, -3.13, -3.13, -3.13, 1.25, -1.75, -0.75, -2.75, -3.75, 3.26, 3.26, 5.26, 2.64, 1.64, -0.36, 0.56, 0.56, -1.44, -8.77, -9.77, -6.77, -2.50, -2.50, -0.50, -1.50, -1.50, -2.56, -2.56, -0.56, -2.56, -0.56, 0.44, -0.56, 0.44, -0.56, -1.56, -2.16, -1.16, -2.16, -1.16, -0.16, 32.14, 22.14, 26.14, 20.14, 22.14, -2.11, -3.11, -3.11, -1.11, -2.11, -3.11, -1.11, -1.11, -1.11, -0.11, -3.11, -3.11, -3.11, -3.11, 4.89, -2.82, 0.18, -0.82, -2.82, 1.18, -6.60, -6.60, -6.60, -2.65, -0.65, 1.35, 1.35, 2.35, -3.25, -3.25, -2.25, -2.25, -2.25, -1.48, -1.48, 0.52, -2.48, 0.52, -0.48, -1.48, 0.52, -0.48, -0.48, -1.89, -3.89, -3.89, -1.89, 22.11, -3.80, -2.51, -1.51, -2.51, 4.49, 3.49, 5.49, -1.51, 0.49, -1.51, -0.51, 3.49, -2.51, -0.33, 1.67, 7.67, -2.21, 3.79, 3.79, 2.87, 0.87, -1.13, -0.89, -2.89, 0.11, 16.42, 19.42, 12.42, 8.42, 12.42, 8.19, 5.19, 13.19, 0.19, 1.19, -2.37, 0.63, -2.37, -1.37, -2.37, 2.13, 1.13, 10.13, -1.87, 1.13, 1.13, -2.92, 3.08, 3.08, 0.54, 5.54, 5.54, -0.87, 2.13, -1.87, 0.37, 2.37, 0.37, 0.37, 1.37, 2.37, -0.90, 2.10, 2.10, -1.35, 1.65, -1.35, 7.52, -1.48, 10.52, 2.52, 4.52, 1.52, 5.19, 0.19, 2.19, 11.75, 0.75, 5.75, 19.52, 20.52, 10.52, -2.47, -2.47, -1.47, -1.47, -2.47, -2.47, -2.47, -2.47, -2.47, -2.47, -2.44, -2.44, -2.44, -2.44, -2.44, -2.47, -1.47, -2.47, -2.47, -2.47, -1.44, -2.44, -0.44, -2.44, -2.44, -1.47, -2.47, -1.47, 0.53, -2.47, -1.15, -3.15, -3.15, -0.15, -1.15, 2.83, 2.83, 2.83, 4.83, 2.83, 1.55, 1.55, 0.55, 3.55, 0.55, -0.17, 1.83, 0.83, -0.17, -2.17, -1.67, 3.33, -2.67, -2.67, -1.67, -2.59, -2.59, -0.59, -1.59, 0.41, 1.41, 3.41, -1.59, 2.41, 5.41, -0.59, 6.41, 7.41, -2.59, -0.59, 2.41, 5.41, 5.41, -2.48, -2.48, -1.48, -1.48, -2.48, -2.80, -2.80, -2.80, -2.80, -2.80, -1.86, -1.86, -1.86, 0.14, 0.14, 1.44, 0.44, -0.56, -1.56, 3.44, -1.16, -0.16, -1.16, -1.16, -1.16, -0.56, 3.44, 1.44, -1.56, -0.56, 0.61, 7.61, 13.61, 7.89, 23.89, 31.89, 1.44, 1.44, 1.44, 7.47, 1.47, 6.47, 8.44, 15.44, -0.56, -0.56, -2.56, 1.92, -1.08, -0.08, 1.92, -2.08, -1.08, -1.80, -1.80, -2.80, -2.92, 1.08, 6.08, -0.92, -2.92, -0.40, -0.40, 3.60, -1.40, -3.40, 12.47, 2.47, 13.47, 5.47, 3.47, -1.59, -0.59, -1.59, 2.41, 0.41, 2.41, -0.59, -1.59, 0.41, -1.63, -1.63, -1.63, -1.40, -2.40, -3.40, 1.41, -1.59, 2.41, 0.82, -0.18, -0.18, -0.25, -0.25, 1.75, 7.75, -1.25, 4.58, 3.58, -0.42, -0.42, -2.42, 1.54, 4.54, 2.54, 5.54, 0.54, -5.10, -6.10, -6.10, -6.10, -6.10, -1.39, -1.39, -2.39, -1.39, -2.39, -5.11, -4.11, -3.11, -4.11, -4.11, -0.16, -1.16, 6.44, -5.33, -3.33, 6.54, 5.54, 3.41, 7.41, 7.41, -3.58, -3.58, -3.58, -1.33, -2.33, 1.67, -1.88, -1.88, 0.12, -0.88, -0.88, -2.59, -2.59, -2.59, 3.49, 1.49, -2.51, -1.51, -0.51, -1.51, 2.49, 1.49, 2.49, -1.51, 3.52, -2.48, 5.49, -1.51, -0.51, 1.49, -2.51, 2.49, 10.49, -0.51, -1.51, -0.51, -2.07, -2.03, -3.03, -3.03, 0.83, 4.83, 0.83, -2.17, -1.17, 1.83, -1.17, 2.83, -1.17, 3.83, 0.85, 0.85, 2.85, 0.85, 4.85, -1.59, -0.59, -0.59, -2.59, -0.59, 0.81, 3.81, -2.19, 7.84, -4.16, -3.16, -3.21, -5.21, 0.79, 1.26, -0.74, 0.26, -0.74, 8.26, 2.43, 0.43, 3.43, 2.89, -2.11, -1.11, 6.82, 5.82, 1.82, 0.82, -1.18, 2.84, -1.16, 1.84, 2.84, -2.59, -2.59, -2.59, -1.59, -0.59, -2.56, -2.56, -2.56, -2.56, -2.56, -1.21, 0.79, 0.79, 27.83, 13.83, 5.83, -0.51, 0.49, -1.51, -1.51, -2.51, -2.12, -2.12, -2.12, -2.12, -2.12, -1.82, -0.82, -0.82, -0.82, 0.18, -2.59, -1.59, 3.41, 4.60, 2.60, 4.60, 0.41, -0.59, -2.59, -0.40, -1.40, -3.40, -0.21, 1.79, 19.79, 0.79, -0.21, -1.21, -2.21, -2.21, -1.21, 1.79, -2.21, 0.79, 7.14, -0.86, 2.14, 2.14, -1.86, -3.86, -2.86, 1.14, 2.14, -3.86, -2.86, -2.86, -1.86, 7.14, 1.14, 1.52, -0.48, 0.52, 0.52, -0.48, 0.49, 2.49, -0.51, -1.51, -1.51, -0.51, -0.51, -0.51, -2.60, -2.60, -2.60, -0.59, 0.41, 0.41, -0.59, 1.41, -2.43, 3.57, 3.57, -0.19, -2.19, -1.19, -0.72, -0.72, 0.28, 5.60, 0.60, 17.60, 4.95, -1.05, 2.95, 12.87, -0.13, -1.13, 1.87, -0.13, -0.13, -2.13, -2.13, -0.13, 2.87, -2.56, -2.56, -2.56, -2.56, -2.56, -1.92, -2.92, -2.92, -0.92, -2.92, 1.61, -1.39, 2.61, 3.61, -2.39, -2.92, -3.92, -0.92, 2.08, -2.92, -1.31, -1.31, 1.69, -0.31, -1.31, -1.51, 0.49, -1.51, -0.51, -1.51, -0.51, -2.51, 0.49, -2.51, 19.52, 16.52, 11.52, -1.22, -1.22, -0.22, -1.22, -1.22, -0.94, -1.94, -1.94, -1.94, -1.94, -0.55, -2.55, -2.55, -2.55, -1.55, -1.22, -1.22, -1.22, -1.22, -1.22, -0.94, -1.94, -1.94, -1.94, -1.94, 2.45, -2.55, -2.55, -2.55, -2.55, -0.94, -1.94, -1.94, -1.94, -1.94, -0.84, 0.16, -2.84, -0.84, 5.16, 0.20, 7.20, 3.20, 2.20, 0.20, -1.84, -3.84, 0.16, 3.16, 7.16, 0.16, 1.16, 3.16, 0.16, 1.16, -3.84, 4.16, 0.16, -2.84, 0.16, -2.83, 7.17, -2.83, -2.26, -2.26, -0.26, -2.89, -1.89, -2.89, -2.56, -2.56, -2.56, -2.36, -2.39, -2.62, -2.62, -2.62, -1.13, -2.13, -2.13, -3.39, -3.39, -3.21, -3.21, 2.41, 0.41, 3.41, 3.41, 4.41, -0.59, 2.41, 1.41, 0.41, -1.59, 2.41, 1.41, 5.41, 3.41, 0.41, 5.41, 8.41, 9.41, 6.41, 5.41, -1.75, -1.75, 0.25, 0.25, 3.25, 16.37, -0.31, -2.31, -2.08, 1.92, -1.08, -0.08, 0.92, 5.92, 2.92, 1.92, -2.08, -0.08, 0.53, -1.47, -1.47, -2.47, -2.47, -2.47, -1.47, -1.47, -0.47, -2.47, 0.53, -0.47, -1.47, 1.53, -1.47, -3.89, -2.89, -2.89, -3.89, -1.89, -1.86, -1.86, -1.86, -1.86, -0.86, -1.97, -1.97, -1.97, -2.97, 0.03, -0.97, -1.97, -2.97, -1.97, 1.03, -1.88, -1.88, 3.12, 1.41, -0.59, -1.59, -0.59, -1.59, -0.59, -2.40, -1.40, -2.40, -0.53, -1.53, -1.53, 3.41, -1.59, -1.59, 1.41, -1.59, -1.59, -1.50, -1.50, -0.50, -2.94, -2.94, -1.94, 1.10, 0.10, -0.90, -0.89, 2.11, -0.89, 0.11, 2.11, 0.20, 6.20, -0.80, 3.20, 1.20, 1.11, -0.89, 1.11, -1.89, 0.11, 1.17, 4.17, 3.17, 9.17, -1.83, 6.02, -1.98, -5.98, -1.60, 3.40, 4.40, -1.60, 0.40, -0.60, 1.53, 3.53, -0.47, -0.76, -2.76, -1.76, 2.16, -3.84, -2.84, -0.84, -1.84, -2.86, 1.14, 0.14, 0.14, -0.86, -0.41, 6.59, 2.59, -1.41, 0.59, -1.50, -0.50, -1.50, -1.50, 0.50, 2.43, 1.43, 0.43, -0.57, 2.43, -0.11, 0.89, 3.89, -2.11, -0.11, -0.81, 0.19, -1.81, -2.81, -2.81, 1.19, -0.81, -1.81, -0.81, 4.57, -1.43, -0.43, -1.43, 1.57, -0.43, 0.57, -2.43, 1.57, -1.43, 0.44, -1.56, 1.44, 1.44, -2.56, -1.40, -3.40, -2.40, -3.40, 0.60, -0.56, -2.56, -0.56, -1.56, -1.56, 15.41, 7.41, 4.41, -2.59, -0.59, -1.56, -0.56, 1.47, -1.53, -2.56, -2.56, -2.56, -1.56, 1.44, -2.56, -2.53, -0.53, -2.77, -1.77, 1.23, -0.77, -3.77, 0.13, -0.87, -3.87, -2.87, -1.87, 16.18, 5.18, 22.18, 24.18, 29.18, 9.74, 7.74, 8.74, 3.74, 12.74, 2.74, -0.26, 2.74, 3.74, 2.74, -1.87, -3.87, -3.87, -0.87, -0.87, -0.56, -1.56, -2.56, -0.56, 0.44, 1.44, -1.56, -1.56, -1.56, -0.55, 3.45, -1.55, -2.20, 4.80, 3.80, -1.56, -2.56, -2.56, 34.44, 3.44, 8.44, 2.64, 4.64, 1.64, 1.44, -2.56, -1.56, -2.59, -2.59, 3.41, -1.88, 1.12, 0.12, -2.61, 2.82, 0.82, -2.18, -2.64, 0.36, -2.64, -3.64, -2.64, 0.29, -0.71, 0.29, -1.71, 0.29, 3.29, 4.29, 5.29, -0.71, -0.71, -1.64, -3.64, -3.64, -1.64, -3.64, -0.85, 32.28, 5.28, 0.28, 3.28, 1.28, 22.87, -4.13, -4.13, -2.53, 6.47, 8.47, -1.86, -1.86, -1.86, -1.86, -1.86, -0.90, 0.10, -1.90, -1.90, -1.90, -0.86, 0.14, -0.86, -2.56, -1.56, -0.56, -1.56, -2.56, -2.50, -1.50, -2.50, -2.50, -2.50, -1.16, -1.16, -0.16, -1.16, -2.16, -1.11, -2.11, -2.11, 8.59, 3.59, 6.59, -2.25, 0.75, -2.25, -1.25, -0.25, -1.12, -4.12, -3.12, 6.88, -0.12, -1.56, -2.56, -1.56, -0.56, -0.56, 0.44, 5.68, 3.68, 1.68, -2.56, -2.56, -1.56, -0.56, -1.56, 1.44, 0.44, -0.56, 3.44, -0.56, -1.56, -0.56, 0.47, -0.53, 0.47, 2.47, 5.47, 0.47, 0.39, 1.39, 2.39, -1.61, -0.61, -0.16, -1.16, -2.16, -1.16, -2.16, -1.16, -1.16, -0.16, -2.16, 1.84, -1.16, -2.16, -0.16, 1.84, -2.16, 1.39, -1.61, 0.39, -1.61, -0.61, -2.44, -2.44, -2.44, -2.44, -1.44, -2.44, 0.50, -1.50, -1.50, -1.50, -1.50, -1.50, -0.18, -1.18, -0.18, 2.41, 19.41, 38.41, 0.12, 20.12, 63.12, -3.22, -1.22, -3.22, -2.32, -1.32, -3.32, 0.13, -3.87, -0.87, -2.71, -1.71, -2.71, 0.29, -1.71, 30.34, 18.34, 27.34, 0.34, 3.34, -2.20, -0.20, -2.20, 5.80, 7.80, 24.38, 5.38, -2.62, 5.38, 20.38, 1.63, 0.63, 1.63, 6.63, 5.63, 0.34, 0.34, 1.34, 0.34, 6.34, 12.34, 4.34, 3.34, 1.34, 3.34, 0.34, -2.66, 0.34, 0.34, -1.66, 0.29, 7.29, 9.29, 2.29, 5.29, 1.79, -1.21, 5.79, 1.83, -1.17, 8.83, -0.21, 4.79, 14.79, -2.21, -2.21, 0.79, 2.83, 1.83, 2.83, -0.13, -2.13, 1.87, -2.13, -2.13, -2.47, -2.47, -2.47, -2.47, -1.47, -1.51, -2.51, -0.51, -0.51, -1.51, 4.28, -2.72, -4.72, -3.72, -5.72, 1.43, -1.57, -1.57, -1.57, 1.43, -0.51, -2.51, -0.51, -1.51, -2.51, 3.49, -2.51, -1.51, 1.49, -1.51, 8.47, 4.47, 6.47, 3.47, 1.47, 5.13, 3.13, 3.13, 3.13, 9.13, 0.47, 4.47, 10.47, 7.47, -0.53, -1.85, -1.85, 0.15, -0.85, 0.15, 3.35, -3.65, -4.65, -2.80, -2.80, -2.80, -2.80, -2.80, -1.13, -2.13, -2.13, 1.87, 6.69, 18.69, 4.69, 18.69, 14.69, 5.18, 5.18, 0.18, -1.82, 1.18, -1.82, 4.43, 3.43, 5.43, -0.83, 5.17, 0.17, 0.50, 1.50, -0.50, 1.53, -0.47, -1.47, 0.53, -1.47, -0.87, -0.87, -1.87, -1.87, -0.87, -2.88, -1.88, -2.88, -5.66, -1.66, 0.34, -2.53, -2.53, -1.53, -2.53, -2.53, 0.47, -1.53, -0.53, -2.53, -0.53, -0.59, 2.41, -1.59, -1.59, -1.59, -1.16, -1.16, -0.16, 2.10, 0.10, -0.90, 2.10, 1.10, 0.44, -0.56, 3.44, 1.44, 0.44, 1.47, 0.47, -2.53, -2.53, 0.47, 1.44, -0.56, 3.44, -2.56, 2.44, 0.50, -2.50, -1.50, -0.50, -2.50, 3.50, -2.50, 0.50, -1.50, -2.50, -0.51, 1.49, -1.51, -2.51, -2.51, -1.51, -2.51, -2.51, -2.51, 4.49, 1.49, -2.51, -2.56, -2.56, -1.56, -4.32, -6.32, -6.32, 1.91, -1.09, -1.09, 0.58, 0.58, -1.42, -3.94, -3.94, -0.94, 2.06, 1.06, -2.94, -2.94, 0.06, -3.94, -2.94, 1.68, 4.68, -2.32, -2.32, -3.32, -2.94, -2.94, -1.94, -2.94, -3.94, 1.53, 1.53, 6.53, 1.53, 4.53, -2.44, -0.44, -2.44, 1.56, -2.44, -3.94, -2.94, -2.94, -3.94, -3.94, -6.65, -2.65, -3.65, -1.70, 3.30, -4.70, -3.96, -4.96, -6.96, -1.21, 5.79, -1.21, -2.21, 0.79, -3.87, -3.87, -3.87, -3.87, -2.87, 9.36, 9.36, 4.36, 13.50, 2.50, 4.50, 34.03, 9.03, 11.03, 32.36, 43.36, 28.36, 9.60, -1.67, -0.67, -2.67, -2.31, -3.31, -3.31, -2.31, -2.31, -0.31, -1.97, -1.97, -0.97, -1.92, 0.08, -0.92, -1.97, -1.97, -1.97, 0.34, -1.66, -1.66, -2.49, -2.49, -2.49, -2.36, 10.64, 3.64, -1.36, 1.64, -8.97, -4.97, -1.97, -2.55, -2.55, -2.55, -1.94, -1.94, -1.94, 6.10, 12.10, 16.10, -0.90, 0.10, 3.97, 6.97, 3.97, 2.97, 6.97, -0.67, -1.67, -0.67, -1.67, -0.67, -0.25, -0.25, 2.75, 1.75, 5.75, 7.83, -1.17, -0.17, -0.17, -1.17, 0.83, 0.83, -0.17, 0.83, 8.18, 9.18, -2.82, 6.91, 0.91, -0.09, -2.19, -2.19, -2.19, 0.81, -2.19, 3.81, 5.81, 14.81, -2.18, -0.18, -1.18, -0.18, 0.82, -1.63, -1.63, -1.63, -0.63, -1.63, -3.39, -3.39, -3.39, -5.16, -5.16, -5.16, -3.39, -3.39, -3.39, -1.78, 3.22, -0.78, 5.77, -0.23, -0.23, 1.78, -1.22, -0.22, -2.01, 1.99, -2.01, -0.87, -1.87, 0.13, -0.87, 1.13, 0.13, 2.93, 4.93, 4.93, -2.53, -1.53, -2.53, -2.53, -1.53, 4.87, 7.87, 1.87, -2.13, -1.13, 6.99, -1.01, -0.01, 1.99, -2.01, -1.01, -2.01, -2.01, -2.01, -2.01, 6.02, 3.02, -1.98, -1.98, -1.98, 0.99, -1.01, -2.01, -2.01, -2.01, 6.50, 1.50, 5.50, -2.39, -0.39, 0.61, -3.17, -3.17, 3.83, -0.07, 2.93, -0.07, -1.98, 7.02, -1.98, 1.79, 8.79, 40.79, 52.79, 34.79, 7.29, 1.29, 1.29, -1.71, 0.29, -3.71, 1.29, -3.71, 3.29, 3.29, 5.29, -0.71, 3.29, 0.29, -0.82, 3.18, 1.18, 0.88, 2.88, -1.12, -0.23, 0.77, -1.23, -1.23, 1.67, 2.67, 0.67, 5.99, 7.99, 4.99, 3.03, 0.03, 1.03, 2.82, 0.82, -0.18, 10.50, 13.50, 4.50, 1.47, 0.47, -2.53, -1.92, -1.92, -1.92, -0.92, -0.92, -1.97, -1.97, -0.97, -1.97, -1.97, -1.66, -1.66, 5.34, -0.66, 1.34, 2.44, 5.44, 3.44, 8.44, 2.44, -1.56, -1.56, -1.56, 3.44, 0.44, 3.44, 1.44, -0.56, 0.44, 7.44, 27.44, 15.44, 15.44, 14.44, 11.44, 13.89, 17.89, 23.89, 21.89, 19.89, -2.56, -2.56, 0.44, -2.56, -0.56, -1.56, -2.56, 0.44, -2.56, -0.56, -0.56, 3.44, 1.44, 0.44, 4.44, -0.56, 1.44, 2.44, 1.44, -0.56, 0.65, 2.65, -1.35, -2.35, 2.65, 2.44, -0.56, 0.44, 1.44, -1.56, -2.43, -2.43, -2.43, -2.43, -1.43, -2.43, -2.43, -2.43, -2.43, -2.43, -2.43, -1.43, -1.12, -2.12, -2.12, -2.51, -2.51, -2.51, -2.12, -2.12, -2.12, -2.51, -2.51, -2.51, -1.86, -1.86, -1.86, -1.81, 2.19, -2.81, -2.81, 3.19, -0.25, 1.75, -2.25, 0.75, -2.25, -2.48, -1.48, -2.48, -2.48, 0.52, -2.48, -1.48, -2.48, -1.48, -2.48, 7.41, 0.41, -1.59, -2.59, 3.41, 0.41, 0.41, -1.59, 5.41, 5.41, -0.59, 6.41, -0.21, 4.79, -3.21, -2.21, -1.21, 4.79, -2.21, -3.21, -1.21, -2.21, -1.67, -2.67, -2.67, -2.15, -2.15, -3.15, -1.56, -0.56, -0.56, 0.44, 3.44, -1.56, -2.56, 0.44, 3.44, -0.56, -2.56, -0.56, -1.56, -0.56, -0.56, 3.04, -2.96, 1.04, -0.96, -1.96, 3.22, 2.22, -3.78, -3.78, 6.22, 4.04, 1.04, 4.04, 7.04, -4.96, 12.87, 1.87, -0.13, -0.50, -1.50, -1.50, 5.01, 0.01, 2.01, -0.99, 0.01, 0.91, 0.91, 4.91, 0.91, 0.91, 3.79, 5.79, 8.79, 0.79, 5.79, -2.07, -3.07, -1.07, -1.07, -2.07, 0.93, 0.26, -0.74, 1.26, -0.70, 2.30, 1.30, 1.44, -1.56, -2.56, 1.20, 7.20, 37.20, -1.80, -0.80, -0.80, 3.25, 6.25, 6.25, 2.96, 1.96, 6.96, 1.52, 4.52, 3.52, -1.47, -1.47, 0.53, -0.56, 1.44, -2.56, -0.56, -1.56, -1.56, 0.13, 3.13, 10.13, -1.61, -1.61, -1.61, -1.96, -0.96, -1.96, 0.04, -1.96, -2.87, -2.87, -2.87, 3.13, -0.87, -2.59, -2.59, -2.59, -1.59, -2.59, -1.05, -2.05, -0.05, -2.87, -3.87, -1.87, -2.43, -2.43, -0.43, -2.20, -2.20, -2.20, -2.20, -1.64, -1.64, -1.64, -1.64, -1.64, -4.25, -4.25, -4.25, -4.25, -4.25, -1.43, -1.43, -1.43, -1.43, -1.43, -2.45, -2.45, -2.48, 4.10, 2.10, 1.10, -1.94, -1.94, 11.06, -1.88, 0.12, -0.88, 0.93, -1.07, 0.93, 0.78, -0.22, -3.22, 4.07, 5.07, 6.07, 5.07, 4.07, -2.17, -2.17, 1.83, 1.27, -0.73, -1.73, -2.08, -1.08, -2.08, -2.08, -2.08, -3.45, -3.45, -3.45, 2.55, -3.45, -1.56, 0.44, 1.44, -1.56, 0.44, -2.73, -2.73, 0.44, -2.56, -2.56, 4.79, 5.79, -0.21, -1.21, 2.79, -0.56, 1.44, 0.44, -1.56, -2.56, -2.29, -3.29, -0.29, 5.71, -2.29, -2.40, -2.40, -2.40, 13.47, 3.47, 6.47, 0.41, -0.59, -1.59, -1.59, -1.59, 5.03, 19.03, 37.03, 16.03, 17.03, -2.59, -2.59, -1.59, 1.41, -2.59, 10.98, 2.98, 0.98, -4.02, 1.98, 4.98, 10.47, 4.47, 2.47, 5.47, 3.01, -0.99, -1.99, 0.01, -2.24, -1.24, 10.32, 3.32, 0.32, -2.68, 1.39, 9.03, -1.97, -2.97, -3.24, -3.24, 7.41, 2.41, -0.59, -0.59, 5.39, 1.39, 1.48, -0.52, 2.03, -0.97, -1.97, 1.03, 5.76, 3.76, 6.39, 19.39, 2.39, -0.61, 5.39, -1.61, -1.74, -0.74, 3.76, -2.24, -0.24, -1.24, 0.48, -1.52, -0.52, 3.48, 9.76, 1.41, 2.39, 2.39, -1.61, 0.47, -2.53, -2.53, 2.09, -2.91, -1.91, 2.76, 0.76, 3.76, 4.42, -0.58, 0.42, 4.41, 1.47, -1.53, -2.53, 8.39, 7.14, -1.31, -2.31, -2.31, 15.47, 2.47, -0.53, 8.76, 4.76, 4.86, 11.76, 2.76, 3.42, 3.42, 0.03, -0.97, 4.76, 2.76, 16.19, 10.19, -0.53, -2.53, -1.99, 3.01, 3.76, 3.27, -0.53, 3.76, 1.06, -2.44, 0.01, 1.39, 4.00, 10.55, -0.52, -1.52, -2.52, -1.98, -1.98, 1.02, 1.02, -1.98, -1.23, 0.77, -2.23, -2.23, -2.23, -2.39, -3.39, -1.39, -4.10, -3.10, -0.10, 0.64, -1.36, -0.36, -1.99, -1.99, 7.01, 16.64, 3.64, 4.64, -2.36, 2.64, 3.64, 0.47, 1.47, -1.53, -1.24, -3.24, -1.24, -3.24, -1.24, -1.06, -2.06, -2.06, -1.06, 0.94, -1.51, 0.49, -2.51, 3.45, -1.55, -2.55, -1.54, -1.54, -1.54, -3.02, -3.02, -4.02, -0.51, -0.51, 1.49, 10.82, 6.82, 18.82, -0.80, -0.80, -1.80, 1.73, 0.73, -1.27, -0.78, 1.22, -1.78, 0.49, -1.51, -1.51, 1.13, 5.13, 11.13, -0.00, -1.00, -1.00, -0.00, 4.00, -0.32, -2.32, -1.32, -0.20, 5.80, -0.20, -5.19, -2.19, 0.81, 0.68, 3.68, -1.32, -2.32, -0.32, 0.68, -2.30, -1.30, 0.70, 5.70, 0.70, -1.30, 0.70, -0.30, -1.30, -0.30, -0.73, -0.73, -1.73, -0.73, -0.73, 1.70, -0.30, 0.70, -1.30, 1.70, -0.73, -0.73, -1.73, -0.73, -0.73, 0.57, -0.43, -1.43, -1.56, -1.56, -2.56, 6.39, 0.39, -1.61, 7.63, -3.37, 0.63, -1.38, -2.38, -0.93, -1.93, 0.26, -4.74, 6.18, 0.18, -1.82, -2.01, -2.01, -2.01, -1.55, -2.55, 0.45, -3.01, -2.01, -2.01, -2.06, -0.06, -2.06, 1.20, -1.80, -1.80, -1.28, 0.72, -2.28, 0.33, -1.67, -1.67, 3.37, 3.37, 3.37, 7.37, 2.37, -0.43, -0.43, 1.57, -1.43, 1.57, -1.73, -0.73, 4.27, 2.27, 4.27, 6.23, 0.23, 1.23, 1.23, 2.23, -0.57, -0.57, -2.57, -2.57, -1.57, -0.26, -1.26, -1.26, 3.99, 4.99, 5.99, -0.01, 0.99, -0.01, 4.99, 0.99, 0.99, -2.55, -2.55, -2.55, -2.67, 8.33, 10.33, -2.78, -2.78, -3.78, -0.93, -0.93, -2.93, 0.99, 0.99, 1.99, -1.55, -2.55, -2.55, -1.26, -1.26, 0.74, -0.01, -0.01, 1.99, 1.68, -2.32, -2.32, -2.32, 2.68, 0.04, 1.04, -0.96, 0.04, -1.96, 5.11, 0.11, -1.89, -1.89, 0.11, 2.45, 3.45, 2.45, 2.43, 23.43, 11.43, -1.01, -2.01, 1.99, -1.66, 6.34, 2.34, -0.91, 3.09, -0.91, -2.09, 1.91, 1.91, 5.34, 4.34, 0.34, -1.57, 1.43, -1.57, -1.57, -1.57, -2.82, -0.82, -2.82, 1.18, -1.82, -1.28, -1.28, -1.28, 1.94, -0.06, -2.06, -1.36, -1.36, -2.36, -2.36, -2.36, 0.64, 3.01, -1.99, -0.99, -1.77, 4.23, -1.77, -3.14, -4.14, 14.86, 25.86, 13.86, -2.01, -2.01, -2.01, -2.01, 23.32, 15.32, -2.68, -4.68, -4.68, 1.14, -1.86, 0.14, -2.86, -0.86, -2.01, 3.99, -3.01, -2.01, -2.01, -3.01, -3.01, -2.01, -1.01, 9.23, 5.23, 5.23, 0.76, -1.24, 5.76, 1.94, -0.06, -0.06, -0.06, 2.94, -0.68, -2.68, -3.68, -0.40, -1.40, -1.40, -2.92, -2.92, -0.92, -2.43, -1.43, -1.43, -1.43, 2.57, -0.43, -2.23, -1.23, -1.23, -2.56, -0.56, -0.56, 0.40, 0.40, 0.40, -1.73, -1.73, 1.27, 3.27, 8.27, 2.27, 0.27, -0.73, 0.27, 7.46, 5.46, 1.46, -1.73, -1.73, -2.73, -2.04, -2.04, 0.96, -5.90, -5.90, -0.90, 28.74, 30.74, 8.74, 0.74, 8.74, 0.74, -2.57, -0.57, -1.57, 0.49, -2.51, 0.49, 4.09, -2.91, 3.09, -3.53, -0.53, 7.47, -1.29, -3.29, -3.29, -1.25, -1.25, 0.75, -2.43, 0.57, -2.43, -1.82, -1.82, -1.82, -1.82, -1.82, -0.82, -2.43, -1.43, 0.57, -2.43, -0.43, -1.43, 0.42, 6.42, 0.42, -0.37, -2.37, -2.37, -2.37, -1.37, -2.37, -2.37, -2.37, -2.37, -1.37, -0.57, -1.57, -1.57, 3.43, 0.43, 10.72, -0.28, 2.72, -1.28, -1.28, 0.72, 1.46, 10.46, 9.46, 5.46, 9.46, 2.48, 3.48, 12.48, 6.48, 12.48, -1.36, 0.64, -1.36, -2.36, -0.36, -2.36, -1.58, -1.58, -1.58, 2.43, -3.57, -2.57, 2.74, 1.74, 1.74, -0.85, -0.85, -1.85, -2.49, -2.49, -0.49, -0.49, -2.49, 0.37, -0.63, 3.37, 1.74, 2.74, 1.74, 7.96, -2.04, -2.04, -1.56, 0.44, 9.44, 8.44, 0.44, -0.78, -1.78, -0.78, -1.78, 0.22, -3.48, -6.48, -5.48, 0.52, -4.48, -0.23, 8.77, 0.77, 7.77, 5.77, 3.78, -1.22, 1.78, 3.78, 5.78, -3.54, -3.54, -2.54, 1.34, -1.66, 0.34, 1.64, -2.36, -2.36, -2.50, -2.50, -2.50, -3.50, -3.50, -3.50, -2.50, -1.50, -1.90, -0.90, -1.90, -1.03, -0.03, -0.03, -0.90, 0.10, 0.10, -1.90, -0.90, -1.90, -0.78, -1.78, -0.78, 2.37, -0.63, 1.37, 3.44, -2.56, 2.44, 32.40, 22.40, 34.65, 20.65, 12.65, -2.38, -2.38, -2.38, -2.31, -1.31, -2.31, -2.81, -1.81, -1.81, -1.96, -1.96, -1.96, -0.28, 3.72, -2.28, 1.72, -1.28, -1.32, -1.32, -1.32, -1.97, 0.03, -0.97, -0.97, 0.03, -1.97, 7.69, 0.69, -0.76, -2.76, 0.08, 2.08, 0.08, -0.03, -1.03, 0.97, 8.60, 3.60, -0.40, 0.57, -2.43, -2.43, -2.43, -2.43, 7.97, -2.03, -3.03, -3.03, -3.03, -1.43, -2.43, -2.43, -2.43, -2.43, 20.56, 7.56, 0.56, 2.13, 0.13, -0.87, 4.60, 5.60, 0.60, -2.09, -1.09, -3.09, -0.28, -2.28, -1.28, -3.01, -3.01, -0.01, -0.01, -0.01, -2.01, -2.26, -1.26, -2.26, -2.62, -1.67, -1.67, 1.33, -2.33, -1.33, -2.33, -0.97, -0.97, -0.97, -2.33, -0.33, -0.33, -2.79, -2.79, -2.79, -2.33, -1.33, -2.33, -1.01, 5.99, 10.99, 6.18, 3.18, -1.82, -1.26, 4.74, 5.74, -1.13, -1.13, -0.13, -0.88, -1.88, -1.88, 1.99, -1.01, -1.01, 2.45, 1.45, -2.55, 0.78, -2.22, -2.22, 4.09, -1.91, -2.91, -1.01, -1.01, -2.01, 2.00, 2.00, -5.00, -1.01, -1.01, -2.01, 11.91, 5.91, -1.09, 1.91, -1.09, 2.17, -0.83, 2.17, 3.17, 1.17, -1.33, -2.33, -2.33, -0.33, -2.33, -0.14, -2.14, -1.14, -0.14, -0.14, -2.33, -2.33, -2.33, -1.33, -1.33, 4.23, -0.77, -1.77, -0.75, -1.75, -0.75, -0.31, 0.69, -2.31, -1.77, -1.77, 3.23, 1.99, 2.99, -0.01, -1.01, -1.01, -2.01, 4.78, 1.78, -0.22, 0.37, -5.63, -5.63, -4.63, -5.63, 2.20, -1.80, 0.20, 1.20, 9.20, -0.63, -0.63, -1.63, -0.63, -0.63, 0.57, -1.43, -1.43, -1.43, -2.43, 0.57, -2.43, -1.43, -1.43, 0.57, -2.26, -0.26, -2.26, -0.83, -1.83, -0.83, -1.83, -1.83, -0.81, 5.19, -0.81, -1.81, -0.81, 2.62, 1.62, 0.62, -0.38, 0.62, 5.62, 9.46, 3.46, 0.46, -1.01, -0.01, -2.01, 3.62, 4.62, 0.62, -1.14, -2.14, 1.86, 0.57, -2.43, 8.57, 1.44, -0.56, -0.56, 1.37, 1.37, 2.37, 7.63, 7.63, 7.63, -0.55, -2.55, -2.55, -0.61, -0.61, -2.61, -3.01, -3.01, -0.01, -1.55, -2.55, 0.45, -0.24, -2.24, -2.24, -1.36, -1.36, 1.64, -0.36, -1.36, -0.36, 3.79, -0.21, 1.79, 0.64, -1.36, 0.64, 3.23, 12.23, 6.23, -0.16, -0.16, -2.16, -0.70, -1.70, 9.30, 0.30, 1.30, -0.88, 4.12, 2.12, 2.12, 3.12, -1.99, 2.01, 7.01, 0.42, -1.58, -1.58, -1.69, 10.31, -1.69, -3.70, -0.70, -0.70, -1.54, -2.06, -2.51, 0.49, 0.49, -0.76, -0.76, -1.76, -4.02, -4.02, -4.02, -4.02, -4.02, 8.45, 13.45, 13.45, 3.45, 8.45, -1.43, -2.43, -0.43, 5.94, 0.94, -1.06, 0.32, 2.32, 1.32, -2.43, -1.43, -1.43, -4.75, 1.25, -2.75, -4.75, -4.75, -2.19, -0.19, -1.19, -1.19, 0.81, 2.55, -2.45, -3.45, -4.45, -4.45, -0.37, 0.63, -1.37, 3.63, -0.37, -1.37, -1.37, -2.37, -2.37, -0.37, -1.82, 0.18, -1.82, -2.65, -2.65, -2.65, -2.25, -2.25, -2.25, -2.03, -2.03, 0.97, -2.03, 0.97, -0.03, 0.57, 0.57, -1.43, 3.25, 2.25, 1.25, -1.61, 5.99, 5.99, 2.99, -3.88, 0.12, 7.12, -4.62, -5.62, -1.62, 2.22, 4.22, 2.22, 2.43, 3.43, 1.43, 6.43, 6.43, -2.38, -2.38, -2.38, -1.38, -0.38, -1.26, -2.26, -1.26, 1.74, 1.74, -2.86, -1.86, -2.86, -2.86, 2.14, 3.14, 14.14, 4.14, 3.14, 4.14, -2.05, -2.05, -2.05, -0.05, -2.05, -1.92, 1.08, -1.92, -1.92, -0.92, -1.92, -1.92, -1.92, 0.08, -1.92, -1.05, -2.05, -2.05, -2.05, -2.05, -0.51, -1.51, 1.49, 0.49, -2.51, -0.26, 0.74, -1.26, -1.26, -0.26, -2.18, -2.18, -2.18, -2.18, 2.82, -0.77, 2.23, 0.23, -0.77, 1.23, -0.75, -1.75, -0.75, -0.79, 2.21, 5.21, 14.25, 1.25, 4.25, 9.76, 3.76, 0.76, 3.99, 1.99, 0.99, 0.49, -0.51, -2.51, 4.99, 5.99, 3.99, 4.39, 7.39, 3.39, 0.39, 1.39, 10.39, -1.61, 1.39, 5.45, 1.45, 0.45, -2.55, 0.45, 1.99, 3.99, -0.01, -1.01, 0.99, 2.03, 3.03, 8.03, 2.03, 6.03, -1.03, -0.03, -2.03, 1.17, -1.83, 1.17, -2.83, -1.83, -2.83, 0.01, 0.01, 12.01, 1.17, -2.83, 0.17, -2.83, -1.83, 0.17, 0.57, -2.43, -2.43, -2.43, -1.43, -2.43, -5.40, -3.40, -2.40, 0.92, 4.92, -1.08, -1.59, -0.59, -1.59, -1.59, -0.59, -1.38, -2.38, -1.38, -1.38, -2.38, -0.38, 0.62, -2.38, -1.38, 1.62, -2.38, -1.38, -2.38, -2.38, -2.38, 3.04, -0.96, -1.96, 1.04, 5.04, 1.82, -1.18, -3.18, 1.82, -1.18, 5.01, -1.99, -1.99, -1.36, -1.36, -2.36, -0.77, -1.77, -1.77, 0.25, 1.25, -1.99, -1.99, 0.01, -1.77, -1.77, -1.77, 1.08, 1.08, -2.92, -0.38, -1.38, -1.38, 10.49, 4.49, 2.49, 1.65, -0.35, -2.35, -0.76, 4.24, 0.24, -1.98, 0.02, -1.98, -1.35, -1.35, -0.35, -1.25, -0.25, -1.25, -0.04, -3.04, -2.04, 4.10, -0.90, -1.90, 0.75, -1.25, -1.25, 1.10, -2.90, 1.10, 3.88, -3.12, -2.12, 6.33, 3.33, 3.33, -0.24, -2.24, 0.76, -3.81, -3.81, -2.81, -1.83, 0.17, 0.17, -3.83, -0.83, -2.83, -1.83, 0.17, -2.83, -2.32, -2.32, -3.32, 8.14, 6.14, 3.14, 3.36, 5.36, 5.36, 3.55, -1.45, 1.55, -0.45, -1.45, -0.45, 0.14, 1.14, 0.14, -0.49, 1.51, 2.51, 0.74, 2.74, -1.26, 3.74, 20.74, -2.01, -1.01, 5.99, 2.99, -0.01, -3.01, -2.01, -0.01, 2.99, 7.99, 6.93, -2.07, -0.07, 8.93, 13.93, 1.14, -0.86, -1.86, 1.87, 0.87, 1.87, 0.43, -1.57, 1.43, -1.82, -1.82, -0.82, 4.66, -0.34, 1.66, 0.03, 1.03, -1.97, 6.82, 3.82, 2.82, 8.00, 10.00, 4.00, 2.64, -1.36, 3.64, -1.88, 0.12, -1.88, -3.02, 3.98, -2.02, -2.83, 1.17, 0.17, -2.34, -1.34, -1.34, -2.34, -1.34, 10.66, -2.34, -1.34, -2.34, -2.34, -1.73, -1.73, -1.73, -1.73, -1.73, -2.22, -2.22, -2.22, -2.22, -2.22, -2.34, -2.34, -0.34, -2.34, -1.34, -1.37, -1.37, -1.37, -1.37, 0.63, -2.37, 5.63, -2.37, -1.37, 1.63, 1.22, -2.78, -5.78, -5.78, -0.78, -3.54, 1.46, 0.46, 2.46, 0.46, 5.64, -3.36, -3.36, -2.36, -0.36, 1.73, -3.27, 2.73, -0.14, 2.86, -0.14, 1.64, -1.36, -0.36, -2.01, -1.01, -2.01, -2.01, -2.01, -1.36, -2.49, -1.99, -2.56, -1.56, -1.56, -1.80, -0.80, 3.20, 9.40, 59.40, 71.40, -1.82, 1.18, -0.36, -1.36, 0.64, 8.99, 13.99, 23.99, 5.10, 1.10, 2.10, -0.90, 0.10, 1.10, 0.10, -0.90, 0.10, 2.10, -1.81, -0.81, -1.81, -1.81, 0.19, 0.96, 1.96, 3.96, -1.04, -0.04, 2.29, 2.29, 0.29, -2.01, 8.99, 16.99, 16.99, -2.01, 5.74, 1.74, -2.26, 0.74, -2.26, -0.81, -0.81, -1.81, 1.59, -0.41, 2.59, 0.59, -1.41, -1.41, -1.41, -0.41, 0.59, -3.00, -3.00, -1.00, 6.66, 0.66, -3.34, -0.06, 3.94, 0.94, -3.08, -3.08, -3.08, -2.56, -0.56, -2.56, -1.72, -1.72, -1.72, 0.28, -1.72, 1.28, -2.56, -2.56, -2.56, -3.02, -3.02, -2.02, -1.51, 1.49, 1.49, -7.42, -8.42, -5.42, 2.99, -0.01, -0.01, 0.62, -2.38, -0.38, -0.01, -1.01, 0.99, 2.71, -3.29, -2.29, 0.46, -1.54, -0.54, -2.17, -3.17, -2.17, 42.99, 34.99, -0.01, -0.98, -1.98, -1.98, 0.31, -1.69, 0.31, 2.03, 5.03, 5.03, -0.75, -1.75, -1.75, -2.49, -2.49, -2.49, -0.32, 1.68, 0.68, -0.48, -1.48, -1.48, 0.45, -0.55, -1.55, 0.26, -2.74, -1.74, -1.74, 1.26, -1.74, -2.55, -1.55, -2.55, -1.55, -0.55, 1.45, -0.01, -0.01, -2.01, -0.01, 3.99, -2.01, 1.32, -4.68, -3.68, -1.56, 6.44, 1.44, -2.21, 0.79, 1.79, -2.21, -2.21, -3.33, -3.33, -3.33, -3.33, -3.33, 0.23, -3.77, 0.23, 2.18, 2.18, -0.82, -1.06, -1.06, -1.06, 1.08, 5.08, 5.08, -2.43, -2.43, -2.43, -1.80, 19.20, 4.20, 1.57, 0.57, 2.57, -2.43, -1.43, -2.43, -1.80, -1.80, -1.80, -1.56, -1.56, -1.56, 1.91, 1.91, 0.91, 0.44, 9.44, 1.44, -1.67, -1.67, -1.67, 1.64, -0.36, -2.36, -0.51, 30.49, 14.49, -4.43, -3.43, -1.43, 3.30, -2.70, -1.70, -3.86, -2.86, -2.86, 4.29, 1.29, -0.71, -4.33, -3.33, -1.33, 6.07, 8.07, 10.07, -1.90, 1.10, 0.10, 6.10, 4.10, 5.10, 8.47, -0.53, 4.47, 4.10, 1.10, 4.10, 0.01, 11.01, -1.99, 7.48, 1.48, 0.48, -2.36, -1.36, -1.36, -1.07, -2.07, -2.07, -0.55, -2.55, 4.45, 3.00, -1.00, -0.00, 2.00, -2.00, 2.03, -0.97, 4.03, 2.03, 3.03, 7.69, 4.69, 4.69, 0.44, -2.56, -1.56, 0.57, 0.57, -1.43, -3.18, -3.18, -3.18, -3.18, -3.18, 12.97, 12.97, 5.97, 0.20, 0.70, -4.30, -4.30, -4.84, -4.84, -4.84, -2.59, -2.59, -2.59, -4.14, -4.14, -4.14, 6.09, 9.09, 7.09, -1.31, 2.69, -1.43, 0.57, -3.01, -2.01, -1.01, -4.17, -3.17, -2.17, -2.18, -3.18, -3.18, -5.08, 0.92, -3.08, 9.83, 3.83, -1.17, -0.01, -2.01, -2.01, 0.76, 0.76, 3.76, 0.57, 0.57, -2.43, 3.57, 4.57, 1.57, 0.12, -2.88, 0.12, -1.43, 1.57, -1.43, 0.57, 2.57, 0.57, 4.37, -1.63, -1.63, 1.99, 4.99, 3.99, 0.49, -2.51, 0.49, -1.51, -0.51, -1.51, 4.95, -1.05, -0.05, 7.01, -0.99, 10.01, 0.53, -1.47, -0.47, -2.12, -1.12, -1.12, 6.43, 3.43, -1.57, -0.60, 2.40, 2.40, -0.96, -0.96, -0.96, -0.96, -1.96, 16.63, -1.54, 10.55, 21.55, 35.55, -1.23, -0.23, -2.23, 4.36, 4.36, -2.64, -2.64, -4.64, -1.89, -1.89, -1.89, -0.82, -2.82, -2.82, 5.49, -2.51, -2.51, -2.36, -2.36, -2.36, -2.24, -2.24, -2.24, 8.90, 2.90, 10.90, -0.94, -0.55, -0.55, -2.55, -2.71, -0.71, -1.71, -0.67, 3.33, -1.67, -2.01, -1.01, -5.01, -2.68, -4.68, -0.68, -1.26, -0.26, -2.26, 4.99, -1.01, 0.99, -2.42, 6.58, 3.58, 13.03, 2.03, -0.97, 3.74, 3.74, 4.74, -1.01, -2.01, -1.01, -1.80, 8.20, 2.20, -1.80, 2.20, -1.98, -2.98, 2.02, -0.98, 1.02, 21.73, 13.73, 6.73, 1.73, 1.73, -1.80, -0.80, -1.80, -1.80, -1.80, 6.08, 5.08, -2.92, -0.76, 0.24, -1.76, -0.67, -1.67, 0.33, -2.36, -2.36, -2.36, -1.21, -2.21, 13.79, -2.36, -2.36, -2.36, -0.38, -1.38, 1.15, -3.22, -3.22, -1.22, -2.01, -2.01, -2.01, -0.38, -0.38, 2.62, -1.26, -0.23, 3.77, -0.35, 0.65, -2.35, 0.03, -2.97, -0.97, -1.94, -1.94, -4.94, -0.77, -2.77, -3.77, -1.63, -2.63, -1.63, -0.05, -1.05, 4.95, -3.34, -2.34, -3.34, 3.30, 7.30, 0.30, 2.45, 3.45, 10.45, -1.41, -1.41, -1.41, 0.60, 0.60, -1.40, -1.88, -0.88, -0.88, -2.83, -5.32, -5.32, -5.32, -0.38, -1.38, -1.38, -3.55, -2.55, -2.55, -1.38, 0.62, -1.38, -3.14, -6.14, -5.14, -3.82, -2.82, -3.82, -1.32, 0.68, -1.32, 4.67, 8.67, -1.33, 2.51, 7.51, 3.51, 20.73, 35.73, 8.73, 6.03, 4.03, 0.03, -0.01, -1.63, 0.32, -0.43, -0.43, 8.57, 9.57, 2.57, -1.99, 1.01, 2.01, 26.01, 6.75, -1.25, 9.75, 0.75, 0.75, -0.33, -1.33, -2.33, -0.18, -1.18, -2.18, -1.87, -0.87, -1.87, -1.67, -1.67, -1.67, -2.10, 0.90, -2.10, -1.56, 0.44, -1.56, 0.40, -1.60, -2.60, 3.62, 1.62, 13.62, -3.83, -3.83, 0.17, -1.82, -1.82, 0.18, -0.17, -0.17, 7.83, 3.83, 47.83, 0.99, -3.01, 7.99, 1.99, -3.01, -0.01, 2.99, 7.99, 4.99, 4.99, -1.86, -2.86, -2.86, -2.86, 3.14, 6.43, 10.43, 8.43, 8.43, 6.43, -2.72, -2.72, -1.72, -0.06, -0.06, -1.06, -1.42, -0.42, -0.42, -1.23, -5.23, -3.23, -1.81, -1.81, 2.19, 1.62, -1.38, -0.38, -1.51, 1.49, -2.51, 6.65, -1.26, -2.26, -2.26, -0.38, 1.49, -2.51, -0.51, -0.38, -0.38, -2.38, -2.18, -0.18, -1.18, 0.82, 4.82, -1.36, -1.36, -2.36, 1.64, 3.64, -1.92, 5.08, 2.08, 1.08, -0.92, 14.49, 27.49, -1.51, 1.02, -0.98, -1.98, -2.77, -2.77, -2.77, 4.48, -0.52, 7.48, -1.18, -1.18, 2.82, -1.24, -1.24, -1.24, -0.24, 3.99, -0.01, -0.01, 2.03, -1.97, -0.97, -1.26, -2.26, 0.74, -0.97, -1.97, -0.97, 0.03, -2.97, -1.97, -0.97, -0.97, 1.01, 0.01, 0.01, -3.01, -1.01, -2.01, -2.97, -0.97, 2.03, 3.43, 0.43, -0.57, -2.03, -2.03, -1.03, -1.38, -2.38, 1.62, -0.38, -1.38, -1.57, -0.57, -1.57, -0.57, -0.57, -1.23, 6.77, -2.23, -1.23, -0.23, -0.38, 0.62, -0.38, 0.62, -0.38, 1.74, -2.26, -0.26, -0.26, -2.26, 27.55, 10.57, -1.60, 0.40, -2.60, 6.60, 32.60, 27.60, 2.60, -0.40, -1.40, -2.88, -1.88, -2.88, 1.74, 0.74, 0.74, 0.45, 1.45, -1.55, -1.64, -0.64, -2.64, -1.42, -6.42, -7.42, -0.33, -0.33, 1.67, -0.53, -2.53, -2.53, 2.51, 8.51, -1.49, -2.36, -0.36, 3.64, 0.69, -2.31, 1.69, 4.69, 2.69, 0.08, -1.92, 0.08, -0.92, 0.08, -2.01, -2.01, -2.01, 0.75, -0.25, 2.75, 0.94, -1.06, 0.94, -0.60, -0.60, 0.40, 0.40, -2.60, -2.60, -2.06, -2.06, -1.06, 2.35, 4.35, 0.35, 1.21, -1.79, -2.79, 3.52, -0.48, 0.52, 0.11, -0.89, 4.11, -3.94, 0.06, -3.94, -2.09, 0.91, 2.91, 35.74, 23.74, 29.74, -1.56, 4.44, 6.44, -2.01, -0.01, -1.01, -0.01, 0.99, 1.03, -0.97, 5.03, 1.03, 1.03, -1.01, -3.01, -2.01, 2.99, -1.01, 2.18, 2.18, 1.18, -0.82, 2.18, -0.01, 2.99, 0.99, 2.99, 0.99, -0.64, -3.64, -2.64, 0.19, -1.81, -1.81, 14.40, 32.40, 20.40, 1.69, -1.31, -2.31, -1.70, -2.70, -2.70, -1.43, -2.43, -1.43, -3.44, 3.56, -2.44, 0.56, -2.44, 1.64, 8.64, -1.36, -1.36, -1.36, 4.18, 9.18, 4.18, 1.18, -2.82, 6.57, 8.57, 2.57, 0.57, -2.43, 2.64, 1.64, -2.36, 6.51, 0.51, 1.51, 4.64, 0.64, -0.36, 6.64, -1.36, -2.36, 1.01, -2.99, 16.01, 1.00, -1.00, -3.00, -2.01, -3.01, -3.01, -2.01, -1.01, -3.01, -3.01, -2.01, -2.01, -3.56, -2.56, -2.56, 5.55, 1.55, -3.45, -0.21, -2.21, -0.21, -0.77, -1.77, -0.77, -1.36, -2.36, -0.36, -0.57, -3.57, 1.43, 12.21, 25.21, 20.21, -1.72, -1.72, 4.28, 9.13, 0.13, 7.13, -3.66, -4.66, -4.66, 3.03, -2.97, -2.97, -2.01, -3.01, 0.32, 1.32, 0.32, -2.97, -0.97, -2.97, -2.86, -0.86, -1.86, 0.49, -1.51, 0.49, -1.01, -0.01, -3.01, 0.03, 0.03, -0.97, -1.76, -2.76, -1.76, -1.54, -2.54, -2.54, 35.64, 34.64, 13.64, -1.36, -2.36, -1.36, -0.36, -2.36, -1.36, -1.77, -0.77, -0.77, 1.10, 1.10, -2.37, -1.05, 2.10, -2.01, -0.01, 1.99, -0.01, 0.99, 3.00, 3.00, 16.00, -3.00, 6.98, -4.02, -2.02, 2.98, -1.02, -1.82, -0.82, -0.82, 0.18, 2.18, 1.43, -0.57, -1.57, -1.49, -2.49, -1.49, -0.77, -1.77, -1.77, 2.67, -2.33, -0.33, -1.33, -2.33, -2.33, 5.99, 2.99, 5.99, 3.66, 2.66, -0.34, -4.02, -0.02, -4.02, -3.01, -3.01, -3.01, -2.01, -3.01, -3.01, -2.01, -2.01, -0.01, -2.51, -1.51, -1.51, -2.97, 0.03, -2.97, 0.44, -1.56, -0.56, -1.80, -1.80, -1.80, 0.51, -0.49, -1.49, 0.51, 4.51, 2.51, -0.73, 2.27, -0.73, 0.74, -0.26, 0.74, -0.38, 0.62, 1.62, -1.01, 0.99, -2.01, -1.38, -1.38, 0.62, -2.55, -0.82, -1.82, -1.82, 2.33, -0.67, -1.67, -1.67, 6.84, 1.84, -1.16, -0.16, 0.84, 6.89, -1.11, -0.11, -2.11, 3.89, 6.29, -1.71, -2.71, 1.55, -3.45, -3.45, -2.45, -2.45, -2.51, -1.51, 5.49, 1.04, -1.96, 0.04, -3.75, 1.25, -0.75, -1.52, 3.48, 3.48, -1.39, -2.39, -3.39, 4.99, -4.01, -5.01, -3.08, -4.08, 0.92, -1.43, -1.43, -1.43, -1.91, -1.91, 2.09, -0.81, -0.81, 3.19, 4.09, 1.09, 0.09, -1.81, -0.81, 0.19, -1.81, -0.81, -1.81, 1.72, -0.28, 7.72, 0.72, -1.28, -1.82, -0.82, -0.82, 9.63, 0.63, 6.63, 3.45, -1.55, -2.55, -2.39, -1.39, -2.39, -3.62, -2.62, -3.62, -2.39, -2.39, -2.39, 16.86, 14.86, 12.86, -2.01, -1.01, 1.99, -0.01, 3.99, 0.70, 1.70, 2.70, 11.70, 2.70, -3.22, -3.22, -3.22, -2.22, -2.22, -2.86, -8.73, -6.73, -6.73, -1.61, -1.61, -1.61, 3.73, 12.73, -2.27, -5.27, -4.27, 6.03, 0.03, -0.51, -2.51, -1.51, 1.49, -0.51, 0.70, -1.30, -3.30, -3.30, -3.30, -3.93, -2.93, -1.93, -3.93, -2.93, -2.01, -2.01, -2.01, -1.01, -2.01, -2.01, -2.01, -3.01, -2.01, -2.86, -2.86, -2.86, -3.61, -3.61, -2.61, -3.61, -1.61, 5.70, 7.70, 2.70, 6.70, 1.70, 5.96, 2.96, 0.96, 5.03, 2.03, 5.03, -0.41, -1.41, -2.41, -1.25, -0.25, -1.25, -1.25, -0.25, 0.23, -0.77, -1.77, -1.77, -1.77, -0.57, -0.57, -1.57, 0.43, -0.57, 6.14, 0.14, 2.14, 4.14, 1.14, -1.25, -0.25, -0.25, -1.25, -0.25, 2.40, 2.40, 2.40, 7.48, -2.52, -2.52, -1.90, -2.90, -1.90, -1.24, -2.24, -0.24, 2.00, -2.00, -1.00, -1.00, 3.00, -1.88, -0.88, -1.88, -1.88, -1.88, 8.62, 15.62, -1.38, 5.62, -2.38, -2.38, -2.38, -1.40, -2.40, -2.40, -1.40, -2.40, -2.40, 0.12, -2.88, -2.88, -2.28, -2.28, -2.28, -0.40, -2.40, -2.40, -1.59, -2.59, -0.59, 6.36, 2.36, 2.36, 5.54, 4.54, 7.54, 8.54, 7.54, 4.54, -0.73, -0.73, -1.73, -1.31, -2.31, -2.31, -3.12, -3.12, -3.12, -0.73, -1.73, -2.31, -2.31, -2.31, -2.19, -2.19, -2.19, -3.27, -5.27, -5.27, -3.27, -0.27, 1.18, -0.82, -2.82, 0.18, 1.18, -0.91, -3.91, -2.91, -2.66, -3.66, -3.66, 4.39, 0.39, -3.61, 0.57, 12.49, -0.51, 14.49, -3.66, 0.34, -0.77, -0.77, -1.77, -1.99, 3.01, -0.99, -3.45, -0.45, -3.45, 2.72, -0.28, -0.28, 5.72, -0.28, 1.72, 1.93, -3.07, 0.93, 8.72, 2.72, 8.72, -2.06, -2.06, -2.06, -0.82, -1.82, -2.82, 4.24, 3.24, -2.76, 0.24, -3.76, -3.76, -2.97, -2.97, -1.97, -0.23, -2.23, 0.77, -1.23, -2.23, -1.57, 3.43, -1.57, -0.57, -1.57, -1.75, -5.75, -4.75, -3.69, -3.69, -3.69, -3.69, -3.69, -3.69, -0.79, 0.21, -3.79, 1.95, 1.95, -3.05, -0.74, -0.74, -0.74, 4.26, 2.26, -1.74, -0.74, -2.74, -2.74, -2.74, -2.10, 1.90, 4.90, 0.34, -2.66, -1.66, 7.34, -0.66, -0.66, 3.25, -0.75, -2.75, 4.87, 0.87, -1.13, 6.48, 6.48, 0.48, -0.61, -3.61, -1.61, -3.61, -3.61, -5.27, -4.27, -5.27, 1.73, -2.27, -1.78, -3.78, -0.78, -1.78, 2.22, -2.78, -3.78, -2.78, -3.78, -2.78, 5.94, 7.94, 10.94, 11.67, 5.67, 14.67, -1.79, 2.21, -0.79, -1.75, 1.25, 1.25, -1.51, -2.51, -2.51, -2.51, -2.51, -1.80, 1.20, -0.80, -0.44, 1.56, 3.56, 3.77, 1.77, -1.23, 5.87, -1.13, -3.13, 6.22, 8.22, 0.54, -1.46, -2.46, -0.01, 1.99, -1.01, -0.86, 6.14, 0.14, -2.26, -2.26, -2.26, -3.01, 0.99, 0.99, 8.99, 8.99, 2.99, -1.77, -1.77, -0.77, -1.77, -1.77, -1.78, -1.78, -1.78, -1.78, -1.78, -2.96, 2.04, -0.96, -2.96, -0.96, 0.48, -2.52, -2.52, -1.52, -2.52, 2.23, -1.77, 2.23, 42.23, 55.23, 2.64, 8.64, 0.64, -0.24, -1.24, 8.76, 1.21, 2.21, 3.21, -0.79, 0.21, 0.21, -1.24, -2.24, -2.24, -2.29, -2.29, -2.29, 0.83, -2.17, -2.17, -0.53, 0.47, -0.53, -1.29, -1.29, -2.29, -1.23, -2.23, -2.23, -2.23, -2.23, -0.51, -0.51, -0.82, -2.82, -1.82, -5.66, -2.66, -2.66, 0.57, 30.57, 0.57, 3.57, 2.57, 1.18, -0.82, -0.82, -0.82, -0.82, -0.62, -0.62, -1.62, -1.62, -0.62, -0.97, -1.97, 1.03, -1.55, 3.45, 0.45, -2.01, -3.01, -3.01, 3.99, -3.01, -2.01, -0.54, 2.46, -2.54, -1.54, 2.46, -2.01, -2.01, -2.01, 2.99, 2.99, -2.38, -0.38, -0.38, -1.38, 0.62, -2.38, -0.38, -2.38, -2.38, -1.38, 5.62, 3.62, -0.38, -0.38, 4.62, -1.03, -2.03, -2.03, -1.28, 16.72, -1.28, 9.77, 6.77, 5.77, 1.18, 4.18, 4.18, 4.62, -2.38, 3.62, 3.62, -0.38, -0.38, -0.01, -0.01, 0.99, 0.84, 0.84, -0.16, 0.02, 3.02, -0.98, -0.69, -0.69, -0.69, -1.99, -1.99, -1.99, -1.99, -1.99, -2.53, -1.53, -2.53, -2.53, 1.47, -2.23, -2.23, -2.23, -2.23, -2.23, -2.73, -2.73, -2.73, 0.74, -2.23, -2.39, -2.85, -2.85, -2.85, 11.19, -2.81, 1.19, -1.81, -1.81, 17.83, 9.83, 16.83, 3.83, -0.17, -0.78, -1.78, -1.78, -1.78, -1.78, 0.65, -0.35, -2.35, -0.35, 12.65, -1.18, -3.18, -3.18, -2.18, -2.18, -2.97, -2.97, -1.97, 0.03, -1.97, -2.22, 1.78, -1.22, 5.93, -1.07, 0.93, -1.81, 0.19, -1.81, 3.00, 51.00, -1.00, -0.30, 10.12, -1.88, -3.88, -0.36, 1.64, -1.36, -0.36, -1.36, -1.36, -1.36, -1.36, -0.36, 2.64, 3.76, 6.76, 2.76, 0.76, 3.76, -1.77, -1.77, -1.77, 4.23, 1.23, -1.38, -1.38, -1.38, -0.38, -0.38, -2.01, -1.01, -2.01, -2.01, -2.01, -1.26, -0.26, 1.74, -1.26, -1.26, -0.38, -1.38, -2.38, -0.38, -1.38, -1.38, 0.62, -0.38, 0.62, -1.38, -0.76, -1.76, -3.76, -2.18, -3.18, -0.18, -2.14, -3.14, -2.14, 4.21, 4.21, 0.21, 11.48, 4.48, 0.48, 0.99, 2.99, -2.01, -1.01, -1.01, -0.85, 0.15, 2.15, 0.99, -0.01, 0.99, 0.62, -2.38, -1.38, -0.38, -1.38, -0.38, -2.83, -2.52, -1.63, -1.63, 0.37, 2.57, 0.57, 5.57, 5.36, 2.36, 3.36, -1.63, -1.63, 1.37, 0.40, -2.60, -3.60, -0.31, 1.69, -2.31, -0.04, -1.04, -2.04, -1.34, -2.34, -2.34, -1.65, -0.65, -0.65, -0.92, -2.92, -0.92, -0.36, -0.36, 2.64, -1.96, -2.96, 2.04, -3.23, -3.23, 1.03, 2.03, -1.97, 1.28, -2.72, 0.28, -1.79, 0.21, 1.21, -0.56, 1.44, -2.56, -2.26, -2.26, -1.26, 1.02, 4.02, 7.02, -2.28, -1.28, -2.28, 2.74, 1.74, 1.74, -2.01, 5.27, 8.27, 6.27, 0.69, 7.69, 5.69, -2.05, -1.05, -2.05, -1.58, -0.58, -1.58, -1.58, -0.58, -1.57, -0.57, -3.57, -1.57, -1.57, -2.26, -0.26, -0.26, -2.26, -1.26, -1.02, 6.98, 8.98, 1.41, -0.59, 3.41, 0.41, -0.59, 11.01, 0.01, -0.99, 5.01, -1.99, 0.01, 4.21, 4.21, 0.21, 9.18, -1.82, 5.45, 3.45, 10.45, 3.30, 0.30, -2.70, -0.69, -1.69, -1.69, -3.34, -3.34, -0.34, -0.28, 0.72, 3.72, -1.43, -1.43, -0.43, -1.43, -0.43, -0.43, -0.92, -2.92, -1.92, 0.57, -1.43, -0.43, -6.55, -3.55, -6.55, -5.55, -7.55, -0.51, -1.51, -0.51, -2.51, -2.51, -1.51, 6.00, 5.00, 7.00, -2.28, -1.28, -2.28, -3.63, -0.63, -2.63, -1.71, -2.71, 0.29, -0.71, -1.71, -2.71, -1.71, -2.71, -2.71, 2.47, 3.47, 2.47, 0.18, 13.18, -0.82, -0.97, -2.97, -2.97, -2.51, -2.51, 0.49, -1.86, -2.86, -2.86, -3.01, -3.01, -2.01, -1.60, 0.40, -2.43, -2.43, -1.82, 0.18, -1.82, 1.18, -0.82, -1.06, -0.06, -2.06, -1.06, 0.94, 0.18, 2.18, 2.18, -1.82, 0.18, 9.68, 0.68, -1.32, -1.32, 1.68, 1.48, -1.52, -0.52, 0.48, -2.52, -1.01, -2.01, -2.01, 5.18, 2.18, 1.18, 3.74, 1.74, 1.74, -2.55, -0.55, -1.55, -1.01, -2.01, -2.01, -1.95, -0.84, 2.16, 3.16, 4.53, 2.53, -2.47, 2.35, -1.65, -2.65, 1.48, -0.52, 1.48, 1.30, -2.70, -1.70, -2.55, 2.45, 20.45, -0.37, -1.37, 2.63, -2.00, -2.00, 1.00, -2.37, -0.37, -1.37, 0.78, 0.78, -0.22, -3.79, -4.79, -4.79, -1.38, -2.38, -3.38, -1.44, -0.44, -1.44, 0.46, -2.54, -1.48, -1.48, -1.48, -1.48, -1.48, -5.42, -3.42, -5.42, -5.42, -4.42, 1.76, -2.24, -3.24, -3.24, -1.24, -2.82, -1.82, -0.82, -1.82, -2.82, 3.83, 4.83, 4.83, 6.83, 1.83, -2.77, -0.72, -0.72, 2.28, 1.28, -1.72, -0.26, -2.26, -1.26, 0.48, 5.48, 0.48, 7.48, -1.52, 0.52, -1.48, -1.48, -1.48, 12.53, 7.53, 21.53, 4.79, 1.79, 3.79, 0.79, 0.79, 2.79, 1.79, 6.79, 1.79, 2.79, 0.01, 4.01, 1.01, 1.01, 5.01, 0.23, 11.23, 8.23, 4.23, 12.23, 2.09, 9.09, 18.09, -3.49, -2.49, -2.49, -2.45, -1.45, 2.55, 1.27, -1.73, 0.27, -1.88, -1.88, -0.88, 0.12, -0.88, 0.92, 2.92, 1.92, -2.08, -1.08, -1.88, 9.73, 3.73, -4.27, -3.95, -3.95, -2.95, -3.02, 2.98, -3.02, -2.26, -1.26, -1.26, 0.45, -2.55, -0.55, 2.01, 0.01, 1.01, 16.40, 36.40, 20.40, -2.87, -2.87, -2.87, -1.36, -2.36, -1.36, -1.58, -1.58, -0.58, -2.36, -2.36, 1.64, -0.77, -1.77, -1.77, -1.88, -0.88, -0.88, -1.88, -1.88, -1.67, 0.33, 5.33, 1.33, -1.67, -2.67, 2.33, 5.33, -0.67, -1.67, 6.14, 10.14, 11.14, -1.56, -1.85, -0.85, 8.15, 2.15, 2.15, -1.29, -4.29, 3.71, 2.71, -1.97, -2.97, -1.97, 2.03, -1.97, 13.39, 8.39, 17.39, 17.39, 8.39, -0.22, 4.78, 1.78, 2.45, 4.45, 5.45, -1.55, -0.55, -0.55, -3.22, -0.22, -0.22, -2.18, -3.18, -3.18, -0.18, -3.18, -1.59, 3.36, 1.36, 6.36, -2.22, 0.78, -1.22, -4.25, 1.75, -0.25, -0.43, 0.57, -0.43, -3.18, -1.18, -2.18, -3.18, -2.18, -0.78, -0.49, -2.49, 1.51, -1.99, -1.99, -0.99, 2.67, -2.33, -1.33, -1.99, -1.99, -4.66, -6.66, -6.66, -2.65, -3.65, -3.65, -1.23, -1.23, -2.23, -2.38, -2.38, -1.38, -2.38, -2.38, -2.38, -0.78, -1.78, -0.78, -2.26, -0.26, -1.26, 0.46, -2.54, -2.54, 0.99, -1.01, -2.01, 0.41, -1.59, -1.59, 0.15, -1.85, -1.85, -2.38, -2.38, -2.38, -1.77, -1.77, -1.77, -1.57, -2.23, -2.93, -2.80, -0.80, -1.80, -1.42, -1.42, -1.42, -3.18, -3.18, -3.18, -2.79, -2.79, -2.79, -1.63, 5.37, 0.37, 1.36, -1.64, -2.64, -0.68, 3.32, -1.68, 4.86, -1.14, -1.14, 2.31, -0.69, -1.69, -3.28, 0.72, 5.72, -2.26, -1.26, -2.26, 9.68, 5.68, 3.68, 0.68, 0.68, -2.38, 1.62, -2.38, 2.57, 0.57, 6.57, -1.96, -2.96, -2.96, -2.02, -2.02, -2.02, 0.82, 0.82, -2.18, -3.03, 1.97, 0.97, -0.40, -1.40, 2.15, 1.15, 0.15, 0.99, -2.01, -3.01, -0.19, -2.19, -3.19, 3.30, -1.70, 2.30, 2.10, -1.90, 6.10, 4.31, 2.31, -2.69, -0.69, -1.69, 1.01, 0.01, -3.18, -0.18, -2.18, 0.57, -1.43, -1.43, -0.43, -0.43, 0.25, 0.25, 1.25, 4.49, 5.49, 4.49, 4.49, 13.49, -2.26, -1.26, 0.74, 2.74, 0.74, -4.17, -1.49, 1.51, 2.51, 5.13, 24.13, 9.13, -0.43, -2.43, -1.43, -0.43, -0.43, 0.18, 3.18, -0.82, -1.82, -1.82, -2.06, -0.06, -0.06, -2.06, -2.06, -1.43, -2.43, -1.43, -0.43, -0.43, -2.03, -1.03, -3.03, -2.03, 0.62, -2.21, -1.73, -1.73, -0.73, 6.27, 0.27, 11.46, 0.46, -2.54, 2.01, -1.99, 3.01, 0.56, 2.56, -2.44, 2.42, 1.42, -1.58, 0.42, -1.58, -1.01, 0.99, 0.99, 1.17, 2.17, -1.83, -1.83, -1.83, 1.17, -1.83, 0.17, -2.83, 3.17, 1.37, -0.63, 2.37, -1.63, -1.63, -0.43, 0.57, -1.43, -2.43, -1.43, 17.08, 7.08, 20.08, 9.08, 6.08, 3.97, 2.97, -0.03, 2.14, 7.14, 3.14, 6.47, 4.47, 3.47, -0.61, -2.61, -2.61, -1.38, -1.82, -1.82, -1.82, -0.67, -1.67, -1.67, -1.98, -1.98, -1.98, -1.50, -0.50, -0.50, -2.60, -1.60, -1.60, 7.14, -0.86, 1.14, -1.86, 1.14, -2.41, 0.59, -1.41, 8.56, 7.56, 4.56, 0.56, -2.44, -0.37, -1.37, 4.97, 1.97, 4.63, -0.37, 0.61, -1.39, 1.55, 2.55, -0.46, -1.46, 4.45, -2.55, -1.55, -1.55, -2.55, -1.03, 1.97, -1.03, 0.97, -0.03, -2.03, 12.61, 9.61, 5.61, 1.61, 6.27, 2.27, 7.34, 2.34, 0.34, -0.66, 4.55, 1.55, 4.23, -0.77, 3.23, -0.77, -1.77, -0.99, -0.99, -1.99, 0.01, -1.03, -2.03, 2.09, -0.91, 0.63, -2.37, 1.61, 1.61, 6.61, 5.61, 8.32, 4.32, -0.45, -1.45, 2.55, -0.45, -2.45, 10.97, 8.97, 2.64, 3.64, -0.36, 0.26, -0.74, 1.01, 0.01, 1.01, 0.74, 2.74, -2.39, -2.39, -2.39, -2.39, 0.66, -0.33, -0.33, -0.33, 6.97, -1.03, 4.63, -1.37, 9.56, -1.37, 2.55, 9.61, 3.86, -3.03, 0.63, -1.99, 3.61, -1.39, -1.39, 0.97, 3.28, 6.28, 2.28, -2.37, 3.63, 6.63, -0.66, 2.34, -0.66, -2.03, 3.97, -1.03, 3.64, -0.36, 5.61, 3.61, 7.97, -1.03, -0.39, -0.39, 9.63, 5.63, 0.63, 5.61, 3.97, 3.34, 3.97, -1.03, -0.03, -0.82, 1.18, -0.82, -1.63, 0.37, 7.37, -0.28, 2.72, -1.28, -1.78, -2.78, -1.78, -1.60, 1.40, 1.40, 1.73, 3.73, -1.27, 2.39, -1.61, -0.61, -2.27, -3.27, 32.73, -2.25, -0.25, -2.25, 1.26, 2.26, 8.26, -0.59, -1.59, -1.59, -1.23, -2.23, -1.23, 1.75, -0.25, -1.25, -0.03, -1.03, -1.03, -2.23, -1.23, -1.23, -1.78, -1.78, 3.22, -2.23, -2.23, -2.23, -1.03, -1.03, -0.03, -1.03, -0.03, -1.03, -2.03, -1.03, -2.03, -1.03, -1.10, -2.10, -3.10, 1.90, 0.90, -2.45, -0.45, 1.55, -1.45, 0.55, -2.45, -2.45, 1.55, -1.45, -2.45, -4.15, -3.15, -4.15, -3.15, -3.15, -0.76, 3.24, -2.76, -1.76, -1.76, -1.26, 1.74, 2.74, 0.32, -1.68, 0.32, -1.83, -0.83, -2.83, -1.83, -1.83, -2.83, -0.59, 1.41, 0.41, -2.60, -2.60, -2.60, 2.77, 1.77, 3.77, -1.58, -1.58, 0.42, -1.58, -1.58, -0.78, 0.22, 2.22, -0.78, 2.22, 0.74, 6.74, -0.26, -0.26, 1.74, 4.77, 2.77, 8.77, -0.23, -0.23, 3.17, 31.17, -2.02, -0.02, 0.98, 0.29, 18.29, 30.29, -0.86, 1.14, 0.14, 1.40, 1.40, 0.40, -2.03, -2.03, -1.03, -0.83, -1.83, 0.17, -1.83, -0.83, 1.85, -1.15, -1.15, -3.15, -1.15, -0.49, -2.49, 0.51, -1.49, 6.51, -2.15, -1.15, 5.85, -0.15, 4.85, 9.43, 4.43, 0.43, -1.49, 0.51, -0.49, 0.41, -0.59, -0.59, 49.46, 15.46, -0.54, -0.26, 0.74, -2.26, -5.77, -4.77, -5.77, -5.77, -3.77, -2.69, -3.69, -0.69, 3.31, -1.69, -3.57, -2.57, -3.57, -3.57, -3.57, -3.57, -2.57, -1.57, -3.57, -3.57, -2.57, -2.57, -3.57, -2.57, -3.57, -0.57, -2.57, -0.57, -2.57, -0.57, -1.57, -0.57, -3.57, -3.57, -1.57, 1.80, 0.80, -1.20, 0.24, -1.76, -1.76, -1.57, -0.57, 2.43, -1.50, 1.50, 5.50, 3.54, -0.46, 0.54, -2.12, -3.12, -2.12, -0.21, -1.21, -2.21, -2.21, -1.21, -2.21, -1.14, -3.14, -0.14, 1.03, 0.03, -1.97, -0.05, -2.05, -1.05, -1.05, -1.05, -1.05, 0.69, 1.69, 1.69, 0.72, -2.28, -1.28, -0.28, 0.72, -1.28, -0.28, -1.28, -1.28, -0.78, 1.22, -0.78, -0.55, 1.45, 0.45, 2.50, 1.50, -0.50, -1.51, -1.51, -2.51, -1.20, -1.20, -2.20, -2.20, -1.20, -2.20, 3.49, -2.51, -1.51, -3.02, -3.02, -2.02, 3.61, -2.39, 0.61, -2.55, -2.55, -2.55, -3.70, -4.70, -3.70, 0.21, 4.21, -0.79, -2.69, -0.69, -2.69, -1.80, -0.80, -2.80, 7.31, 16.31, -4.19, -0.19, 0.81, -2.36, -1.36, 11.64, -1.59, -1.59, 0.41, -1.64, -3.64, -2.64, -0.83, 1.17, 0.17, 0.76, 3.76, -3.24, 3.68, -0.32, 0.68, -0.61, -1.61, -1.61, 4.75, -1.25, 4.75, 0.72, -1.28, -2.28, -1.68, -0.68, -2.68, -0.12, 1.88, -1.12, -2.64, -2.64, -2.64, -2.64, -2.64, -2.64, 6.36, -1.64, -2.64, -2.64, 0.67, -2.33, 2.67, 1.67, 1.67, 0.33, 0.33, -1.67, 0.33, -0.67, 1.33, 0.33, 1.33, -1.67, -1.67, 7.20, 2.20, 0.20, -1.28, -1.28, 0.72, -1.03, -1.03, -2.03, -1.57, -1.57, -0.57, -1.03, -2.03, -1.03, -0.64, -3.64, -1.64, -3.49, -3.49, -3.49, -4.30, -7.30, -3.30, -0.49, -3.49, -1.49, -3.50, -6.50, -3.50, 2.73, 2.73, 4.73, 2.73, 7.73, 2.17, -2.83, 2.04, -3.66, -1.66, -0.02, -0.02, 1.98, -1.02, 6.98, -3.66, -2.66, -3.66, -2.21, -2.21, -0.21, -2.21, -2.21, -2.21, -2.21, -2.21, -1.79, -2.79, 7.21, -2.05, -1.05, -0.82, -0.82, -0.50, 5.50, 1.50, -0.50, -1.50, -1.50, -1.50, -2.50, -2.50, -1.50, 0.20, 3.20, 3.20, 0.20, -1.80, 0.51, -1.49, -2.49, -1.49, -2.49, -0.15, 2.85, 3.85, -3.15, -3.15, 0.20, -2.80, -2.80, -0.80, -1.80, 2.12, -1.88, 1.12, 6.16, -0.84, 0.16, -1.55, -2.55, -3.55, -1.55, -0.55, 0.45, 0.42, 0.42, -1.58, -1.31, -0.31, -1.31, -1.21, 1.79, -1.21, -3.18, -4.18, -2.18, 7.79, 2.79, 8.79, 7.79, 4.79, 1.79, -0.58, 2.42, 1.42, -1.25, -0.25, -1.25, -0.01, 0.99, 2.99, 2.51, -1.49, -2.49, 1.65, -0.35, -0.35, -1.76, -0.76, -1.76, -1.35, -1.35, -1.35, -1.78, -1.78, -0.78, -1.35, -1.35, 0.65, -3.21, -2.21, -1.21, 3.02, -1.98, -0.98, 0.99, -2.01, -2.01, -1.23, -0.23, -0.23, 1.77, -0.23, 0.77, 3.99, -0.01, -2.01, 0.23, -1.77, -1.77, -2.24, -2.24, -2.24, 4.42, -0.58, 0.42, -0.75, -1.75, -0.75, -1.58, -0.58, -1.58, 0.86, 1.86, -0.14, 0.37, -1.63, 4.37, -2.28, -2.28, -2.28, -0.28, -2.28, -0.28, -0.60, -0.60, -0.60, 1.09, -0.91, -1.91, -2.22, 0.78, -2.22, -2.84, -0.84, -0.84, -1.22, -0.22, -1.22, -1.78, 0.22, -1.78, -7.04, -7.04, -7.04, 3.74, 3.74, 7.74, -2.61, -1.61, -2.61, 3.91, 2.91, -0.09, -1.74, -1.74, 0.26, 3.74, 0.74, -1.26, -0.87, 4.13, 9.13, 8.30, -6.70, -6.70, -0.38, 3.62, -1.38, -1.38, 2.62, 4.80, 1.80, -0.20, -0.20, 0.80, 1.22, 0.22, -1.78, -0.78, 1.22, 1.19, 2.19, 1.19, 7.88, 3.88, 1.88, -2.23, -0.23, -1.23, -2.23, -2.23, -0.23, -2.25, -1.25, -0.25, -2.23, -1.23, -2.23, 1.72, 0.72, -0.28, -2.28, -0.28, 1.18, 0.18, -1.82, 0.18, -1.82, 1.72, 3.72, 0.72, -2.28, -0.28, 0.95, -1.05, -1.05, -1.05, -1.05, 4.79, -1.21, -1.21, 0.23, -0.77, -0.77, -0.24, -1.24, -2.24, 0.18, 2.18, 0.18, -1.83, -0.83, 1.17, 7.02, 2.02, -0.79, 1.21, 0.21, 7.21, 4.21, -0.79, 0.21, -0.79, -1.79, -0.79, 3.21, 35.21, -1.79, -0.79, -1.79, 1.30, -0.70, -1.70, 5.74, -0.26, 0.74, -2.79, 0.17, -1.79, 2.21, -1.79, 0.58, 1.58, 0.58, -0.62, -0.62, 0.38, -1.24, -1.24, -2.24, -2.52, -2.52, -1.52, 3.22, -0.78, 1.22, -2.07, -2.07, -1.07, -5.26, -6.26, -9.26, 1.39, 5.39, 4.39, -0.61, 1.39, 2.19, 3.19, 3.19, 1.19, -1.81, 0.23, 0.23, 7.23, 1.23, 6.23, -1.21, -2.21, -2.21, -1.21, -1.21, -1.77, -1.77, -1.77, 5.23, 0.23, -2.21, -1.21, -0.21, -2.21, -1.21, 0.92, -1.08, -0.08, 14.92, 7.92, 5.92, 0.75, -0.25, -0.25, 4.72, 4.72, 17.72, -2.14, -3.14, -3.14, -1.59, -1.59, -0.59, -1.59, -1.59, -1.60, -2.60, -1.60, -2.60, 0.40, -3.57, -2.57, -3.57, 3.17, -0.83, -1.83, -0.24, -0.24, -0.24, 2.79, 0.79, -0.21, -0.99, -0.99, -0.99, 9.39, 4.39, 8.39, 5.39, 3.39, -0.82, -0.82, -0.82, -1.82, -1.82, -2.28, -0.28, -0.28, 3.72, 2.72, -1.03, 0.97, 1.97, -0.03, 5.97, 4.12, 4.12, 2.12, 3.12, 6.12, 0.95, 1.95, -0.05, -0.05, 6.95, -0.85, 0.15, -1.85, 0.43, 1.43, 1.43, -2.20, -0.20, -2.20, 3.82, -1.18, 41.82, -1.56, -0.56, -1.56, -0.21, -0.21, 1.79, -2.29, -1.29, -1.29, 3.52, 2.52, 6.52, -3.48, -1.48, -1.48, -2.48, -0.48, -1.48, -3.14, -2.14, -2.14, -1.22, 0.78, -4.22, 0.79, -1.21, 1.79, -0.56, -0.56, -1.56, -4.67, -4.67, -3.67, -3.67, -3.67, -0.04, -1.04, -1.04, -2.21, -2.21, -0.21, -2.21, -1.21, -2.21, -2.87, -2.87, 2.13, 1.25, -1.75, -0.75, 5.49, 0.49, -2.51, 0.55, -0.45, -2.45, 1.74, 10.74, -0.26, -0.27, 0.73, -4.27, -1.79, -0.79, 2.21, -2.67, -3.67, 0.33, -0.09, -2.09, -0.09, -0.52, -1.52, -2.52, -0.75, -0.75, 1.25, -0.68, -2.68, 6.32, -1.91, -1.91, -2.91, -0.28, 1.72, 2.72, -2.28, -1.28, -2.28, -2.03, -2.03, -2.03, -2.28, -1.28, -2.28, -0.28, -1.28, 3.72, 0.23, 1.23, -1.77, -2.52, -1.52, -1.52, -3.99, -2.99, -3.99, -2.27, -2.27, -2.27, -0.59, 2.41, -1.59, -1.59, 6.41, -0.59, -2.63, -1.63, -2.63, -3.64, -2.64, -0.64, -2.77, 1.23, -0.77, -2.63, -1.63, 0.37, 0.17, -2.83, -2.83, -1.55, 0.45, 2.45, -5.00, -4.00, -3.00, -1.79, 0.21, -2.79, -0.83, -2.83, -2.83, -0.98, 1.02, -0.98, 14.45, 13.45, 7.45, -2.26, -0.26, -0.26, -1.59, -0.59, 1.41, 7.67, 3.79, -2.21, -0.21, 1.79, -0.21, -0.21, -1.21, -0.21, -1.21, -1.21, -0.58, 5.42, 2.42, 1.42, 1.42, 5.01, 2.01, 3.01, 4.01, 1.01, 3.27, -1.73, 0.27, -1.85, -2.85, -2.85, -2.01, -2.01, -2.01, -1.23, -2.23, -2.23, -0.20, -2.20, -1.20, -3.00, -0.00, -2.00, -0.23, -1.23, -2.23, -1.20, -2.20, -0.20, -0.25, -2.25, 1.75, 1.97, -1.03, -1.03, 1.72, -2.28, -0.28, -1.25, -1.25, 0.75, -1.25, -0.25, -0.25, -2.05, -2.05, -2.05, -0.95, -0.95, 6.05, 6.05, 4.05, -1.74, -2.74, 0.26, -2.74, -2.74, 5.05, -1.95, -0.95, -1.95, -1.95, -1.95, 1.05, -2.95, -1.95, -0.95, -0.91, -2.91, -1.91, -1.91, -1.91, -2.10, -3.10, -0.10, 4.90, -0.10, -2.45, -1.45, -0.45, -0.45, -0.45, 4.17, 1.17, -2.83, -1.83, -1.83, -4.91, -4.91, -5.91, -4.91, -4.91, 5.17, -1.83, -2.83, -2.83, -1.83, 0.49, 0.49, -2.51, -1.51, -0.51, -2.02, -1.02, -0.02, -3.63, 5.37, -1.63, 7.20, -0.80, 0.20, -1.80, -1.80, -1.80, 5.17, -1.83, -1.83, 0.23, -0.77, -1.77, -0.21, -2.21, -1.21, -1.21, -2.21, -0.21, -1.82, -1.61, -0.61, -1.61, -0.00, -1.00, -0.00, -1.00, -1.00, 0.24, -1.76, -0.76, -0.76, -0.76, -0.78, -1.78, -1.78, -1.78, -1.78, 0.23, -1.77, -2.77, -1.77, -2.77, 0.88, 2.88, 3.88, -2.12, 0.88, -0.82, -1.82, -1.82, -1.82, -1.82, -1.82, -1.82, -0.82, -0.82, 10.36, -1.64, 2.36, -1.82, -0.82, -1.82, -1.54, -1.54, -1.54, -2.53, -3.53, -3.53, 4.48, 11.48, 20.48, 11.48, 13.48, 17.82, 3.82, 1.82, 11.82, 1.82, 1.19, 1.19, 0.19, 2.73, 0.73, -1.27, -1.27, -1.27, -1.27, -0.78, -1.78, -1.78, 1.82, -2.18, 2.82, -0.23, -1.23, -2.23, -2.23, -0.23, 1.41, 1.41, -0.59, 0.41, 1.41, 2.77, -0.23, -2.23, -0.23, -2.23, -1.01, -1.01, -0.01, -1.01, -1.01, -1.51, 0.49, -1.51, -2.51, -2.51, 0.02, 1.02, -1.98, -1.98, 3.02, 1.25, -0.75, -0.75, -1.77, -1.77, 3.23, -1.65, -0.65, -1.65, -1.55, -0.66, -3.66, -1.66, -1.49, -2.49, -1.49, -0.95, 1.05, 8.05, 8.72, -0.28, 0.72, -1.03, -1.03, 0.97, -1.25, -1.25, 0.75, 0.75, 2.75, 2.75, -3.44, 0.56, 0.56, 0.56, 3.56, -0.82, -1.82, -0.82, 0.18, -1.82, -0.05, -2.05, -0.05, -0.05, -2.05, -1.28, -2.28, -1.28, -1.28, -0.28, 0.72, 4.72, 5.72, 4.72, 9.72, -1.82, -2.82, -2.82, 0.18, -1.82, -1.39, -1.39, 0.61, -1.39, 3.61, -0.05, -1.05, -0.05, 1.95, 1.95, 3.00, 7.00, 2.00, 9.26, -2.74, -2.74, 0.37, 0.37, 3.37, 0.37, -0.63, 7.69, -1.31, 12.69, 8.69, 4.69, 1.72, -1.28, -2.28, -0.28, -0.28, 4.72, 0.72, -1.28, 4.72, 0.72, -14.93, -17.93, -15.93, 0.43, -2.57, -2.57, 0.04, -0.96, -2.96, -3.72, -3.72, 0.28, -1.48, -1.48, 1.52, -1.97, 0.42, -1.58, -1.58, -2.21, -2.21, -2.21, -1.58, -1.58, -1.58, -2.23, -2.23, -1.23, -1.23, -2.23, -1.23, -1.57, -1.57, -1.57, -1.23, -0.23, -1.23, -1.23, -2.23, -2.23, -0.23, -0.23, -1.23, -1.26, -2.26, 1.74, 1.22, 1.22, -0.78, -0.23, -2.23, -0.23, 3.39, -0.61, -0.61, -1.61, 0.39, 3.77, 3.77, -1.23, -0.23, 0.77, 0.17, 0.17, 10.17, 1.17, 3.17, -2.83, -0.83, 3.17, 5.17, 11.17, -0.83, -1.83, 6.17, 5.17, 3.17, 0.13, -1.87, -0.87, -1.87, 0.13, -1.75, -1.75, 2.25, -1.75, -1.75, -1.77, 0.23, -0.77, -0.77, -1.77, -1.34, -1.34, 0.66, -1.34, 0.66, 3.46, -1.54, 1.46, 2.46, 1.46, -1.41, -1.41, -1.41, -1.41, -0.41, 8.23, 9.23, 4.23, 0.23, 0.23, -1.59, 0.41, -1.59, 0.41, -1.59, -0.78, -1.78, -1.78, -0.80, -1.80, -1.80, 0.22, -1.78, -1.78, -0.61, -1.61, -1.61, 1.70, -2.30, -0.30, 0.03, -2.97, -0.97, -0.97, -2.97, -2.97, -1.48, -3.48, -0.48, -2.55, 7.45, 8.45, -0.18, 0.82, 0.82, -1.26, -2.26, 2.74, -1.23, -1.23, -2.23, 3.40, 1.40, -0.60, 6.20, -1.80, 7.20, -0.01, 3.99, -0.01, 3.42, 10.42, 0.42, -1.77, -1.77, -0.77, -1.77, 0.23, -1.77, -1.77, -0.31, 0.69, 4.69, -2.05, -0.05, -3.05, -2.31, 0.69, 3.69, -1.83, -2.83, -1.83, -2.83, -0.83, -2.83, -2.83, -2.83, -1.83, 0.17, -1.86, 3.14, 1.14, 4.14, 2.14, 4.21, 3.21, 28.21, -2.79, -1.79, -1.77, 0.23, -1.77, -2.21, -1.21, -2.21, -1.58, -1.58, -1.58, -0.18, 2.82, 1.82, -0.86, -1.86, -0.86, -0.70, -0.70, 5.30, -2.38, -1.38, -1.38, -1.38, -0.38, -2.38, -3.38, -2.38, -3.38, -1.38, -3.42, -2.42, -3.42, -3.42, -1.42, 1.95, -2.05, -0.05, 3.95, -2.05, 0.29, -2.71, -1.71, 0.29, -2.71, -2.25, 2.75, -0.25, -2.25, 1.75, -0.25, -2.25, -1.25, -2.25, -2.25, -2.25, -2.25, -1.25, -2.25, -1.25, 4.20, -1.80, -0.80, 4.20, -0.80, -0.80, -1.80, -0.80, 0.20, 0.20, 0.40, 4.40, 4.40, 4.40, -0.60, -2.85, -2.21, -4.21, -4.21, -2.01, 0.99, -2.01, -2.20, -2.20, -0.20, -2.23, 1.77, -1.23, -1.78, 3.22, -0.78, -2.23, 0.77, -2.23, -0.76, 0.24, -1.76, -0.76, -2.76, -1.76, -1.28, 1.72, -1.28, 0.72, -2.28, -4.81, 0.19, -4.81, 0.19, -3.81, -2.28, 1.72, -2.28, -2.28, -2.28, -1.03, -0.03, -2.03, -2.03, -2.03, -2.07, -0.78, 8.22, 0.22, 2.22, -1.78, -1.78, -0.77, -1.77, 1.23, -2.24, -2.24, -2.24, 0.21, -2.79, -1.79, 0.44, -0.56, -0.56, -1.03, -1.03, -2.03, -1.81, 2.19, -0.81, 5.77, 1.77, 0.77, -2.23, -0.23, -2.23, -1.01, 4.99, -2.01, 3.77, 2.77, -2.23, 1.75, -0.25, 5.75, -1.25, -2.25, -0.80, -1.80, 3.20, -1.80, -1.80, -1.23, -1.23, 2.77, 0.77, -0.23, -0.57, -2.57, -1.57, -1.57, -2.57, 0.75, -2.25, 0.75, -2.25, -2.25, 2.90, -2.10, -3.10, -3.25, -2.25, 0.75, -2.83, -2.83, -2.83, -4.56, -4.56, -4.56, -2.83, -2.83, -2.83, 0.17, -2.83, -2.83, -1.61, -3.61, -3.61, -1.28, -0.28, -1.28, 0.69, 0.69, 0.69, -1.00, -2.00, -2.00, -2.25, -1.25, -2.25, 3.42, -1.58, -2.58, -2.61, -3.61, -2.61, -2.65, 1.35, -2.65, -2.61, -3.61, 1.39, 3.57, 0.57, 2.57, 3.29, 10.29, 2.29, -0.18, -2.18, -2.18, -1.21, -2.21, -0.21, -0.10, 3.90, -0.10, -1.18, -1.18, -2.18, -2.18, -1.18, -2.18, 0.25, 2.25, -0.75, -1.97, 16.03, 9.03, -1.18, -2.18, 5.82, 8.57, 2.57, 3.57, 11.57, 7.57, -1.28, 0.72, -2.28, -1.28, -1.28, -3.41, -4.41, -4.41, -1.56, -1.56, -1.56, -2.79, -1.79, -2.79, 2.35, -0.65, -1.65, -1.34, -1.34, -2.34, 2.82, -2.18, -2.18, -3.03, -3.03, -1.03, -0.63, -0.63, 4.37, 2.44, -1.56, -1.56, -0.99, -2.99, -0.99, -0.82, 1.18, 1.95, -1.05, -2.05, 0.72, -1.28, 1.72, -1.28, -0.28, -0.28, -2.28, -1.28, -2.28, -1.31, 1.69, -1.31, -2.53, -1.53, -1.53, -1.66, -0.66, -1.66, -2.99, 0.01, 0.01, -3.54, -2.54, -3.54, 14.78, 63.78, 9.78, -0.49, -2.49, -0.49, -1.07, 3.93, -0.07, -1.21, -1.21, -2.21, -2.93, -4.93, -4.93, 1.90, -1.10, -1.24, -0.24, 0.76, -0.58, -0.58, -1.58, -0.57, -2.57, 2.43, -1.75, -3.75, -0.75, -2.57, -2.57, -1.57, -1.82, -1.82, -1.82, -0.82, -0.82, 0.18, 0.11, -1.89, -1.89, -1.23, 3.36, 1.36, 9.36, 2.77, 1.77, -1.23, -1.44, -3.44, -2.44, -2.34, 0.66, -0.34, -2.29, -2.29, -1.29, -2.21, -1.21, -1.21, -1.21, 0.79, -2.21, -1.13, -1.13, -2.13, -0.86, -2.86, -2.86, -1.86, -2.86, 6.46, 4.46, 2.46, -0.10, -1.10, -0.10, -0.13, 30.87, 42.87, 1.75, -0.25, -3.25, 11.19, 1.19, -1.81, 1.49, -0.51, -1.51, 3.92, -0.08, 0.92, 0.17, 2.17, 3.17, 0.17, 2.17, 3.17, 7.77, -2.23, -1.23, 2.98, 2.98, -0.02, 6.98, 5.98, 3.01, 10.01, 0.01, 5.01, 3.01, 2.21, -0.79, -1.18, -0.18, -1.18, -0.18, 0.82, 1.25, 5.72, 6.72, -1.28, -0.61, -0.61, -1.61, 6.72, 1.72, -1.28, -1.05, -2.05, -1.05, 1.28, 0.28, -3.72, 4.74, 2.74, -1.26, -2.23, -2.23, -2.23, -0.76, -1.76, -1.76, -3.67, -3.67, -4.67, -2.23, -2.23, -2.23, -0.21, -1.21, 1.79, -0.18, 0.82, 0.82, 0.79, -1.21, -0.21, -0.99, 2.01, 1.01, -1.90, -0.90, -1.90, -1.58, -1.58, 2.42, 0.66, 7.66, 5.66, 2.20, -0.80, -0.80, -3.05, -2.05, 18.95, -2.38, -1.38, 2.62, -1.78, -1.78, 3.22, 3.77, -0.23, 3.77, 4.72, 0.72, 2.72, 1.18, 3.18, 0.18, 2.72, 2.72, 0.72, 0.69, -2.31, -0.31, -0.21, -1.21, -0.21, 1.82, 10.82, -2.18, 5.97, 5.97, 10.97, -4.64, -5.64, -8.64, 2.01, -1.99, -0.99, 1.72, 6.72, -0.28, 2.40, 3.40, 1.40, -1.80, -0.80, -0.80, -1.99, -3.06, -2.05, -2.18, -2.18, 3.79, 4.79, -1.21, 0.79, 0.79, 2.79, -0.18, -0.18, -2.18, -1.18, -0.18, -1.18, 4.51, 1.51, -2.49, -1.36, -0.36, 0.64, 7.45, 0.45, 3.45, 1.05, 0.05, -2.95, 2.05, -0.95, 0.05, -0.95, -1.95, -0.95, -1.95, 0.05, -2.95, -1.95, -0.95, 1.96, 1.96, -0.04, -3.04, 3.96, 3.44, -0.56, 1.44, 2.44, 5.44, 2.05, -0.95, 4.05, 3.05, 3.05, 3.75, 2.75, 5.75, 1.75, -0.25, 12.64, -1.36, 8.64, 1.64, 10.64, 0.76, 0.76, -1.24, 0.76, 1.76, -2.28, -0.28, -1.28, -1.28, -1.28, 0.79, 3.79, -1.21, 0.44, -0.56, -1.56, -5.85, -5.85, -5.85, -0.63, 5.37, -1.18, -0.18, -1.18, -1.75, -1.75, -1.75, -1.63, -2.63, -2.63, 5.79, -2.21, -1.21, -1.82, 2.18, 0.18, 1.18, 1.18, -3.51, -3.51, -3.51, -2.51, 1.49, -1.53, -0.53, 2.47, -2.23, -2.23, -2.23, 10.12, 9.12, 3.12, 0.47, 7.47, 7.47, -1.80, -0.80, -1.80, -2.28, -1.28, -0.28, -1.82, -1.82, -1.82, -0.28, -2.28, -1.28, -0.05, -1.05, 2.95, -0.82, -1.82, -1.82, -2.05, -2.05, -2.05, -1.32, -1.49, -1.49, -2.49, -1.97, -1.97, -0.97, -2.29, -2.29, -2.29, -1.77, -1.77, -0.77, -0.77, -1.77, -2.52, -2.52, -2.52, -2.49, -1.49, -1.49, -0.79, -0.79, 1.21, 5.17, 6.17, 1.17, -1.61, -2.61, -2.61, -1.22, -0.22, 1.78, -1.60, -2.60, -3.60, -2.83, -0.83, -2.18, -1.18, 2.99, -1.01, 6.99, 1.99, 0.99, -0.23, -2.23, 2.77, -0.23, -2.23, 0.22, 1.22, 1.22, -0.78, -0.78, -1.90, -2.90, -2.90, -2.90, -0.90, -1.24, -2.24, 1.76, 1.79, -0.21, 0.79, -0.58, 2.42, -0.58, -0.21, 0.79, 1.79, -1.23, -2.23, -2.23, -0.78, -0.78, -0.78, -2.01, -2.01, -2.01, -2.16, -3.16, 0.84, 0.17, -1.83, -1.83, -1.01, -1.01, -2.01, -1.26, -0.26, -0.26, -2.83, -2.83, -2.83, -1.83, -2.83, -3.60, -1.60, -2.60, 2.39, 3.39, 0.39, 2.70, 12.70, -1.30, 1.10, 1.10, 1.10, 5.75, 6.75, 0.75, 0.75, 1.75, -2.31, -3.31, -1.31, -3.31, -2.31, 1.17, -0.83, 1.17, -1.83, -0.83, 2.76, -2.24, -0.24, -2.26, -1.01, 0.99, -2.01, -1.25, -2.25, -2.25, -1.96, -0.96, -1.96, -0.55, 6.79, 8.79, 14.79, -2.21, -2.21, -1.21, -1.77, -1.59, -1.59, -1.59, -1.59, -0.59, -1.01, -1.01, -2.01, -2.01, -2.01, -1.99, -1.99, 5.01, 0.74, -1.26, -1.26, 4.99, 0.99, 3.99, -1.01, -0.01, -0.01, 0.53, -2.47, -1.47, -1.47, 2.78, -1.22, 4.77, -1.23, 9.36, 10.36, 2.15, -0.23, 0.77, -0.23, 1.77, -1.27, 4.77, 3.77, 6.70, 2.70, -1.28, 0.51, 1.51, 2.51, 5.70, 2.70, 2.70, 3.54, 8.40, 4.62, 1.77, 3.75, 4.75, 9.75, 6.75, 0.75, 1.75, 2.70, 5.86, -1.24, -2.24, 0.70, 2.70, 2.55, 3.60, 14.75, 1.02, -1.98, -1.98, -0.92, -2.92, -2.92, -2.20, -2.20, -1.20, -1.57, -1.57, 6.43, -2.20, -2.20, -2.20, -0.05, 0.95, -2.05, 1.72, 3.72, 0.72, -0.25, -1.25, 0.75, -2.59, -0.59, -2.59, 1.17, -2.83, -2.83, 0.78, -3.22, -2.22, -1.82, -0.82, -1.82, -0.83, -1.83, 1.17, 1.35, 0.35, -0.65, -2.41, -2.41, -3.41, 1.30, -0.70, -1.70, -1.61, -1.61, -1.61, 4.02, 0.02, 5.02, 5.21, 1.21, 1.21, -0.83, -0.83, -0.83, -0.83, 0.17, -2.61, -2.61, -1.61, 4.39, 0.39, -2.25, -2.25, -2.25, 2.02, -1.98, -1.98, -1.22, -1.22, -1.22, 2.49, -2.51, -2.51, -2.79, 0.21, -1.79, -0.23, -2.23, 2.77, -1.23, 1.77, 0.77, 1.42, -2.58, -2.58, 0.42, -1.58, -3.78, -2.78, -3.78, 3.22, 0.22, 3.36, 1.36, -3.64, -3.64, -2.64, -1.41, -1.41, -1.41, 1.59, 3.59, 6.64, -0.36, 6.64, 4.64, 3.64, 2.36, 5.36, 2.36, 6.36, 1.36, 0.03, -1.97, -1.97, 0.01, -0.99, -1.99, 1.23, -1.77, -0.77, 1.47, -0.53, -2.53, 5.82, -0.18, -0.18, 0.72, 4.72, 1.72, -2.28, -2.28, -2.28, 0.72, -2.28, -1.28, -1.28, -0.62, -1.62, -1.62, -0.62, -1.62, -1.82, 0.18, -1.82, -0.82, -0.82, -1.28, 0.72, -2.28, -1.28, -1.28, -2.28, 1.72, -1.28, -1.28, -1.28, -1.98, -0.98, 0.02, 0.02, -1.98, -1.97, 0.03, -1.97, -2.85, -1.85, -2.85, -1.60, -1.60, -1.60, -3.32, 0.68, -2.32, -1.46, -0.46, -2.46, 0.51, -2.49, -0.49, -1.14, -2.14, -0.14, -2.21, -1.21, -1.21, -0.21, -2.21, -2.21, -0.21, -0.21, -2.21, 0.01, -1.99, 2.01, 1.01, 0.01, -0.77, 0.23, -0.77, 0.23, -0.77, -1.31, 3.69, -1.31, -1.60, 0.40, -1.60, -0.67, -0.67, -2.67, -0.42, -2.42, -1.42, 1.58, -3.42, -3.42, 0.08, -0.92, 2.08, -0.55, -1.55, -0.55, -2.73, -2.73, -4.73, -4.73, -4.73, -0.17, 1.83, 2.83, -1.17, 4.83, -0.03, -3.03, 5.97, -0.53, -2.53, -1.53, 9.47, 0.47, 1.47, 1.25, 1.25, -1.75, -1.75, -0.75, 2.79, 2.79, -2.21, 0.79, 2.79, 2.01, 3.01, -1.23, -2.23, -1.23, 2.77, 1.18, 2.18, 2.18, -1.14, -6.14, -3.45, -2.45, -2.45, 0.55, -2.45, -2.45, -1.93, -2.93, 0.07, -7.32, -7.32, -4.32, -2.45, -2.45, 0.55, 1.24, -2.76, -1.76, -0.79, -1.79, -0.79, 2.21, -1.79, -0.79, -2.79, -1.79, -0.79, -0.79, -5.10, -3.10, -9.10, -10.10, -8.10, 5.99, 4.99, 5.99, 3.99, 3.99, -1.59, -1.59, -1.59, -1.59, 0.41, -0.78, -1.78, -0.78, -1.78, -1.78, -1.78, -0.78, -1.78, -2.22, -2.22, -2.22, -2.22, -1.22, -1.22, 1.78, 0.78, 1.78, 6.00, -0.00, -2.00, -2.50, -0.50, -0.50, -2.80, -2.80, -2.80, -1.50, 0.50, -1.50, -2.54, -1.54, -2.54, -3.60, -1.60, -3.60, -2.30, -3.30, -1.30, 0.64, 2.64, 4.64, 1.79, -2.21, 1.79, 3.51, 0.51, 6.51, 4.66, 9.66, 8.66, 7.82, 1.82, 3.82, 2.17, -1.83, 2.17, -3.61, -1.61, -3.61, 0.18, -2.82, -1.82, -1.82, -1.82, -0.82, -0.82, -0.82, -0.28, -2.28, -2.28, -0.28, -2.28, -0.89, 0.11, -1.89, 0.49, -0.51, 0.49, -0.82, -0.82, -0.82, -0.24, -1.24, -2.24, -0.28, 0.72, -2.28, -1.50, -0.50, -3.50, 0.54, -2.46, -0.46, 3.50, 14.50, 5.50, 2.02, 29.02, 11.02, -2.60, -0.60, -0.60, 1.72, -0.28, -1.28, 9.18, 1.18, -1.82, 1.72, -0.28, -0.28, -2.23, -2.23, 0.22, 0.22, -1.78, -3.66, -3.66, -4.66, -1.23, -2.23, -2.23, -0.23, -2.23, -0.23, -2.18, -1.18, -0.18, -2.21, -2.21, 8.79, -1.99, -1.99, -1.99, 2.17, -1.83, 0.17, -1.83, 0.17, 0.74, -1.26, 1.74, 0.74, -1.26, 1.72, -0.28, 0.72, -0.28, -1.28, -1.28, -0.28, 0.72, -1.28, -2.28, -2.28, -2.28, -0.82, -1.82, -1.82, -2.62, -1.62, 4.38, -1.84, -1.84, -1.84, 5.72, -0.28, -1.28, -2.41, -3.41, -1.41, 2.40, -2.60, -0.60, -1.28, -2.28, -0.28, -0.54, 0.46, -1.54, -2.74, -2.74, 4.26, 6.26, -0.74, -1.16, -3.16, -3.16, -1.16, -3.16, 0.84, -3.16, -3.16, -4.37, -3.37, 6.63, -3.16, -3.16, -2.16, -2.01, -2.01, -2.01, -1.25, -1.25, -0.25, -1.25, -2.25, 25.75, -2.01, -1.01, -2.01, -0.25, 0.75, -1.25, -2.24, 0.76, 1.76, -1.24, 0.76, 3.21, 1.21, 1.21, 1.21, 1.21, -1.99, -1.99, -0.99, -0.99, -0.99, -1.21, -2.21, -2.21, -2.21, 2.79, -0.82, 0.18, 3.18, 3.17, 0.17, -2.83, 0.01, -1.99, -1.99, -1.55, 1.45, 0.45, -0.79, -2.79, -2.79, -1.79, 3.21, 8.49, 7.49, 7.49, 2.49, 1.49, -2.55, -0.55, -1.55, -0.55, -2.55, -0.23, -0.23, 0.77, -2.23, 3.77, 0.21, 0.21, 7.21, 3.21, 7.21, -1.18, 1.82, -2.18, 3.79, -1.21, -1.21, 2.23, 2.23, -0.77, -0.77, 0.23, 5.23, -4.45, -4.45, -4.45, -2.45, -0.45, -2.82, -3.82, -2.82, -2.82, -2.82, 4.82, 2.82, 13.82, -2.25, 1.75, 0.75, 5.05, 1.05, 1.05, -1.25, 0.75, -1.25, -0.25, -2.25, -2.25, -1.26, 0.74, -2.26, -1.30, -2.30, -0.30, 2.38, 2.38, 0.38, -1.00, 5.00, 4.00, -2.26, -1.26, 0.74, -2.53, -2.53, 1.47, -1.21, -0.21, -1.21, -1.21, -0.21, 0.29, -1.71, -3.71, -0.71, -2.71, -1.24, 3.76, 2.76, -1.24, 0.76, 0.79, 1.79, 0.79, 5.79, 0.79, -4.51, -4.51, -3.51, -0.26, 0.74, -2.26, 7.17, 6.17, 2.17, 1.14, -1.86, -2.86, 1.24, 0.24, 3.24, 3.24, 2.24, -0.76, -2.76, 2.24, 0.24, 4.24, 0.77, -0.23, -2.23, -1.78, -1.78, -1.78, 4.46, 0.46, -1.54, 1.77, -1.23, -2.23, -0.78, 0.22, 1.22, -1.23, -2.23, -2.23, -1.78, -0.78, 0.22, -1.23, -0.23, -0.23, -2.21, -1.21, 0.79, -0.21, -1.21, -2.21, 2.71, -0.29, 0.71, -0.99, -0.99, 1.01, 2.23, -1.77, -0.77, -1.26, -1.26, -2.26, 0.17, -1.83, -1.83, -1.22, -2.22, -0.22, -1.01, -1.01, 0.99, -0.83, -1.83, -0.83, -1.29, 0.71, 3.71, 1.67, -0.33, -1.33, -0.01, -0.01, 4.99, -2.01, -2.01, -2.01, -2.01, -2.01, 0.77, -0.23, -2.23, -1.23, -2.23, -2.23, -0.23, -1.23, 0.77, -2.23, -2.23, 4.77, -2.23, -0.23, -2.23, -1.23, -2.23, -2.23, -1.23, -2.23, -0.97, -3.97, -3.97, 12.52, 36.52, 15.52, 1.53, -0.47, -5.47, -0.77, -1.77, 5.23, 1.01, -0.99, -0.99, -1.10, -3.10, -2.10, -2.47, -2.47, -1.47, 0.22, -1.78, -2.78, -1.47, -2.47, -0.47, -2.43, -1.43, -2.43, -1.43, -0.43, -0.21, -1.21, -2.21, -1.99, -1.99, -0.99, -0.79, -2.79, -2.79, -1.99, -1.99, -1.99, -1.82, -1.82, -0.82, -0.79, -2.79, -1.79, -1.79, -2.79, -0.79, -1.51, -2.51, 0.49, 0.76, -2.24, 1.76, 10.03, 3.03, -2.01, -0.23, -1.23, -0.23, -2.54, -2.58, 5.42, 13.42, 13.42, 1.42, -1.90, -0.90, -2.90, -1.90, -1.90, -3.36, -2.36, -2.36, -3.36, -2.36, 1.82, 0.82, -2.18, 1.82, -2.18, 0.79, -0.21, 1.79, -2.21, -0.21, 0.82, -1.18, -0.18, -1.18, -2.18, 10.72, 3.72, -4.28, -5.28, -1.06, -1.06, 3.94, 1.94, -1.06, 0.06, -0.94, -0.94, -0.94, -2.94, -2.94, 0.65, -1.35, 0.65, 2.42, -1.58, -1.58, -0.77, 0.23, 0.23, -1.58, -1.58, -1.58, 2.20, -1.80, 2.20, -3.24, 0.76, 0.76, -1.55, -2.55, -1.55, 0.99, -1.01, -2.01, -1.79, -1.79, -0.79, 0.21, 0.21, -0.79, 0.79, -2.21, 1.79, -1.75, -1.75, 0.25, 2.37, 3.37, 0.37, -0.21, 1.79, 4.79, 3.25, 4.25, 2.25, 1.66, 2.66, 0.66, 2.79, -1.21, 2.79, -2.95, 4.05, -0.95, 1.04, -1.96, -1.96, -1.02, -2.02, 1.98, -0.02, -0.02, -0.02, -1.72, -0.72, -1.72, -1.40, -1.40, -1.40, -2.68, -0.68, -1.68, -3.40, -3.40, -1.40, -1.38, -2.38, -3.38, -1.28, -2.28, -0.28, 4.75, 0.75, -1.25, 1.72, -0.28, -2.28, -2.31, -2.31, -2.31, -2.23, -2.23, -2.23, -4.21, -4.21, -4.21, -1.34, -1.34, -1.34, -2.23, -2.23, -1.23, -0.23, -2.23, -2.23, -0.51, 0.49, -1.51, 2.49, 1.49, -2.18, -2.18, -2.18, -1.18, -1.18, 2.17, -0.83, -0.83, 1.17, -2.83, 1.21, -0.79, -0.79, -0.79, -1.79, -2.28, 6.72, -1.28, -1.27, -0.27, 3.73, -1.28, -1.28, -1.28, -1.28, 2.72, 3.64, -1.36, -3.36, 8.64, 7.64, -0.91, 6.09, -1.91, -1.28, -2.28, -1.28, -0.28, 2.72, 4.72, 1.72, -1.28, -2.28, -0.28, -1.28, -2.28, -1.28, 0.72, -2.28, -2.28, -1.28, 0.72, -1.28, -2.26, 0.74, -2.26, 1.69, 2.69, 0.69, 2.77, 2.77, -1.23, -0.23, -2.23, 1.77, -2.21, -0.21, 2.79, 3.48, 2.48, -2.52, 3.79, 0.79, -1.21, -1.25, -1.25, -2.25, -1.25, -1.25, -0.25, -0.25, -1.25, 5.75, 1.75, -1.31, -0.31, 4.69, -1.31, -0.31, -0.63, 1.37, 1.37, -1.63, 0.37, -1.79, 3.21, -1.79, 1.01, 2.01, 1.01, 0.72, -0.28, 0.72, -0.28, 1.72, 5.72, -1.13, -1.13, 2.87, 2.40, -0.60, 0.40, -2.12, -5.12, -8.12, -5.12, -3.12, -0.19, 0.81, -3.19, -2.19, -2.19, -2.19, -3.19, -3.19, -2.19, -2.19, -1.27, -1.27, 3.17, -1.83, -1.83, -2.83, 1.17, -3.94, -3.94, -0.94, -1.94, -4.94, -1.51, -1.51, -0.51, -1.82, 2.18, 2.18, 0.21, -0.79, -2.79, -1.41, -1.41, -2.41, -0.41, -0.41, -0.41, 1.27, -2.73, 4.27, 0.27, -1.73, -0.73, 0.82, 2.82, 5.82, -1.83, -0.83, -2.83, 1.26, 4.26, 2.26, -2.25, 1.75, 1.75, -1.20, 0.80, -0.20, -0.71, 4.29, 0.29, 3.17, 3.17, 1.17, -2.70, -2.70, -2.70, 4.17, 5.17, 2.17, 1.17, 4.17, -0.83, -3.32, 0.68, 23.68, -0.25, 1.75, -0.25, 0.75, 6.75, -0.25, 1.75, -0.25, -1.25, -1.25, -2.36, -1.36, 2.64, -2.36, 1.64, -1.60, -1.60, -1.60, -1.60, -1.60, 11.01, 0.01, 4.01, -5.07, -0.07, -5.07, 2.37, 0.37, -0.63, -3.09, -3.09, -3.09, 0.26, -1.74, 6.26, -1.90, -3.90, -2.90, -3.43, -3.43, -2.43, -1.09, -2.09, -3.09, -0.28, -1.28, -1.28, -3.68, -0.68, -3.68, 0.09, -0.91, -0.91, -1.21, -1.21, -1.21, 1.79, -0.21, -1.21, 0.43, -2.57, -2.57, -1.21, -1.21, -0.21, -2.14, -1.14, 4.86, -0.77, -0.77, -0.77, -2.21, -2.21, -1.21, -1.21, -2.21, -1.27, -0.27, -1.27, -3.27, -3.27, -2.21, -1.21, -2.21, -2.21, -2.21, -3.97, -3.97, -3.97, -1.97, -3.97, -3.06, -1.06, -3.06, -0.06, -2.06, 0.01, -1.99, 0.01, 3.01, 1.01, -1.22, -2.22, -3.22, 0.78, -0.22, 14.49, 9.49, -0.51, 3.49, 1.49, 0.01, -0.99, -1.99, -0.99, -1.99, -0.21, -2.21, -2.21, -0.21, -2.21, -1.77, -1.77, -1.77, -1.77, -1.77, -0.77, -0.77, -1.77, 1.23, -1.77, 1.61, 2.61, 1.61, -2.57, 0.43, -1.57, 1.43, -0.57, 0.75, -1.25, 3.75, 0.75, 1.75, 3.75, 0.75, 0.75, 3.75, -1.25, 0.20, 3.20, 0.20, 3.20, 1.20, 0.12, -0.88, -0.88, -2.28, -1.28, -1.28, -0.03, -2.03, -1.03, 0.73, 0.73, 2.73, -0.20, -1.20, -0.20, -1.76, -1.76, -0.76, -2.23, 3.77, -0.23, 7.85, -0.15, -3.15, 0.89, -3.11, -1.11, 5.32, -0.68, -3.68, 1.78, -1.22, -2.22, -0.83, -1.83, -1.83, 4.45, 1.45, 1.45, 10.45, 0.45, -1.55, 3.45, -2.55, 1.45, -0.83, -0.83, 1.17, 2.17, 3.17, -1.83, 0.24, -0.76, -1.76, -0.76, -0.76, -0.81, -0.81, -1.81, -1.81, -1.81, 0.77, -0.23, 0.77, 1.77, -0.23, -2.08, -2.08, -1.08, -0.63, 0.37, -2.63, 1.41, -0.78, -1.01, -1.01, 5.99, -0.51, -0.51, -1.51, -1.79, -0.79, 1.21, -1.91, -2.91, 1.09, 1.77, -1.23, 5.77, -2.01, -4.01, 2.02, 1.02, -2.26, -1.26, -2.26, -2.26, -2.26, 0.01, 3.01, 3.01, -0.21, -0.21, 0.79, -1.21, -1.21, 0.79, -1.21, -0.21, 0.79, -1.99, -0.99, -1.99, -1.35, -1.35, -2.35, -1.76, -1.76, -0.76, -2.20, -2.20, -2.20, 0.22, -1.78, -1.78, 2.20, 1.20, 2.20, 4.20, -0.80, 3.40, -2.60, -1.60, -2.60, 1.40, 2.66, 7.66, 6.66, -1.71, -2.71, -0.71, -2.71, -2.71, -2.71, 2.29, 1.29, -1.05, -3.05, -3.39, -3.39, -2.39, -0.30, 7.70, -1.30, 0.44, -2.56, 4.73, 0.73, 0.73, -0.75, 2.25, -0.75, -0.58, -1.58, -2.58, -1.56, -3.56, -2.56, -0.13, 1.87, -3.13, 0.26, -0.74, 2.26, -0.74, -1.74, -0.74, -0.74, -0.74, 0.26, -0.74, 12.11, 13.11, 14.11, 39.11, 5.43, 2.43, -1.57, 3.43, 2.43, 0.26, -0.74, 0.26, -0.74, 3.26, -0.40, 0.60, 0.60, -1.40, -0.40, -3.52, 0.48, -3.52, 0.48, -2.52, 0.48, -0.52, -1.52, -0.52, -3.52, -2.52, 4.48, -1.52, -3.52, 0.48, -1.75, 3.25, -1.75, -2.75, -0.75, -0.16, -4.16, -3.16, -3.16, 1.84, -1.06, 2.94, -0.06, -1.06, -1.06, -3.87, -3.87, 0.13, -3.87, -2.87, 20.51, 2.51, 1.51, 1.51, 3.51, -3.15, -3.15, -3.15, -2.15, -3.15, -0.49, -2.49, 1.51, -1.49, -2.49, 1.65, -1.35, -2.35, -3.35, -2.35, -1.77, -1.77, -0.77, -1.28, 0.72, -1.28, -2.03, -1.03, -2.03, -2.01, -1.01, -2.01, -2.23, -1.23, -2.23, -1.26, -1.26, -1.26, 3.77, -1.23, -2.23, 0.02, -1.98, -1.98, -0.98, -1.98, 0.49, -1.51, -0.51, -0.51, -0.51, -1.43, -2.43, -2.43, -1.06, -1.06, -1.06, 18.38, 21.38, 26.38, -1.43, -3.43, 0.57, 0.99, -2.01, -1.01, -1.81, -0.81, 0.19, 0.20, 0.20, -0.80, -2.25, -2.25, -0.25, 3.15, 1.15, 1.15, -1.89, -0.89, 4.74, -0.26, -0.26, -2.26, -1.26, -1.85, 2.15, -0.85, -0.61, 1.39, 2.39, 6.39, 4.39, -1.80, -1.80, -1.80, -0.80, -1.80, -0.25, -0.25, -1.25, 0.75, -1.25, -1.83, -2.83, -2.83, 4.79, -2.21, 0.79, 1.03, -3.97, -3.97, -2.97, -3.97, 3.70, -2.30, 0.70, -2.54, -2.54, -2.54, -1.23, 2.77, -2.23, 0.79, -0.21, -1.21, -2.24, 1.76, -2.24, -0.21, -1.21, -1.21, -0.77, 3.23, -1.77, -2.51, -2.51, -2.51, -2.35, -2.35, -1.35, -1.01, -1.01, 0.99, -2.85, -2.85, -2.85, -1.23, -1.23, -1.23, -2.23, 21.77, 30.77, -2.83, -2.83, -1.83, -1.83, -1.83, 6.17, -1.83, -2.83, -1.83, -2.83, -0.83, -2.83, -2.83, -1.83, 2.17, 9.74, 0.74, 10.74, 2.74, 2.74, -2.22, -1.22, 7.78, 1.78, -0.22, -2.83, -2.83, -1.83, -1.83, -2.83, -1.57, -1.57, 2.43, -1.86, -1.86, -2.86, 4.65, 1.65, -1.35, -0.84, -0.84, 0.16, -1.73, -2.73, 2.27, 5.58, -2.42, -1.42, -2.48, -4.48, -1.48, -2.89, -2.89, -1.89, -2.42, -3.42, -0.42, -0.22, -1.22, 3.78, -1.78, -1.78, -1.78, -1.58, -1.58, 0.42, -2.22, -2.22, -1.22, 1.66, 0.66, 3.66, -0.57, -0.57, -2.57, 1.20, 5.20, 8.20, 16.56, 11.56, -2.44, 5.18, 3.18, -0.82, -2.28, 9.72, 0.72, -1.59, -0.59, 2.41, -2.51, -2.51, 1.49, 3.89, -1.11, 1.89, 1.09, 3.09, 0.09, 4.09, -1.91, -0.91, 5.09, -0.91, -2.91, -0.91, -0.91, 0.09, 0.12, -0.88, -0.88, -0.88, 3.12, -0.21, -1.21, 0.79, -2.21, -1.21, -1.20, -0.20, -1.20, -1.20, -2.81, 0.19, -0.81, -0.81, -2.23, -2.23, -2.23, 1.72, -0.28, -0.28, -1.28, -1.28, -1.28, -2.05, -2.05, -1.05, -4.45, -3.45, -0.45, -2.48, -3.48, -2.48, -2.48, -1.48, -2.48, -3.14, -3.14, -3.14, 49.79, 2.79, -1.21, 5.34, -0.66, 4.34, -1.99, -0.99, -0.99, -0.18, -1.18, 2.82, 14.79, 8.79, 41.79, -0.97, 4.03, 0.03, 2.26, 0.26, -0.75, -0.75, -1.75, -0.75, -1.97, 8.03, -1.97, -1.97, -1.97, -1.49, -2.49, -2.49, 0.51, -2.49, 2.03, 1.03, -0.97, -0.97, -0.97, -1.75, -0.75, 0.25, 2.25, -0.75, -0.01, 1.99, 0.99, 0.99, -0.01, 3.79, 6.79, -1.21, -2.21, 0.79, -0.31, 3.69, -0.31, -0.31, -2.31, 6.43, 2.43, 0.43, 17.43, 6.43, 3.22, 3.22, 3.22, 10.22, 0.22, 3.77, -0.23, 3.77, -2.23, 4.77, -1.82, 1.18, -0.82, -0.98, 0.02, -0.98, -0.28, -0.28, -1.28, 4.98, 6.98, 1.98, 0.17, -0.83, -0.83, -1.86, -0.86, 0.14, 1.17, 0.17, -0.83, -0.20, -2.20, -2.20, -1.76, -1.76, -1.76, -1.98, -1.98, -1.98, 0.49, -2.51, -2.51, -1.57, -1.57, -1.57, -0.78, -0.78, 1.22, 3.22, 3.22, 0.22, 0.73, 1.73, -0.27, -0.43, -1.43, 1.57, -1.63, -1.63, 1.37, -2.03, -0.03, -2.03, -0.28, 0.72, -0.28, -1.77, -1.77, -0.77, -0.25, -1.25, -1.25, 5.39, -0.61, -1.61, 5.20, 1.20, -0.80, -3.10, -4.10, -3.10, 4.92, -0.08, 2.92, -0.28, -1.28, 0.72, -1.25, -2.25, -2.25, -1.99, -2.99, -2.99, -2.23, -2.23, -0.23, -1.80, -0.80, 0.20, 1.99, 2.99, -1.01, 16.78, 18.78, 10.78, -0.26, -0.26, -0.26, -1.59, -1.59, -1.59, -0.81, -2.81, 1.19, -2.81, 2.19, -1.64, -2.64, -1.64, -2.64, 4.36, -1.20, 0.80, 1.80, 1.80, -1.20, -0.95, 2.05, 0.05, -1.95, -2.95, 0.39, -0.61, -0.61, -0.61, 0.39, -0.91, -1.91, -2.91, -1.91, -1.91, -0.28, -1.28, -0.28, -0.28, -0.28, -1.58, -0.58, -0.58, -0.30, -2.30, -2.30, -2.30, -0.30, -0.30, -1.64, 0.36, 0.36, -3.99, -5.99, -4.99, 0.37, -5.63, -3.63, -2.33, -2.33, -0.33, -2.23, -0.23, -1.23, -1.78, -0.78, 0.22, -1.23, 6.77, 6.77, -1.92, -2.92, -0.92, 2.68, -0.32, -3.32, 0.66, 2.66, -1.34, 1.66, 0.66, -1.96, -0.96, -2.96, -1.96, -2.96, -1.21, -1.21, -1.21, -2.21, -2.21, 15.21, 10.21, 1.21, -1.79, -0.79, -0.21, -2.21, -1.21, 4.79, -1.21, -0.21, -2.21, -1.21, -2.21, -1.21, -4.43, -3.43, -6.43, -6.43, -5.43, 5.79, 0.79, 1.79, -1.21, -2.21, -1.21, -0.36, -0.36, -0.36, 3.76, -0.24, 0.76, -0.80, -0.80, -0.80, 0.44, 0.44, 11.44, -1.80, -0.80, -1.80, 4.39, -0.61, 2.39, -1.80, -1.80, -1.80, -1.03, -2.03, -2.03, 0.17, 0.17, 3.17, 0.17, 0.17, 0.17, -0.26, -1.26, 1.74, -0.01, 2.99, 1.99, -0.83, -1.83, -2.83, -2.26, -2.26, -1.26, -1.55, -1.55, -2.55, -1.82, -0.82, 3.18, -0.03, 1.97, -1.03, -3.42, 0.58, 35.58, 67.58, 68.58, -3.74, -3.74, 3.26, 20.26, 7.26, -1.28, 2.72, -2.28, 1.75, -2.25, 1.75, -2.25, -0.25, -2.25, -1.03, 0.97, -0.03, -0.25, -1.25, 2.75, -1.18, -3.18, -0.18, -3.18, 1.82, 0.95, 7.95, -2.05, 13.85, -4.15, -4.15, -1.83, -1.83, -0.83, -0.83, 0.17, -1.18, -2.18, -0.18, -3.18, -1.18, -2.51, -2.51, -2.51, -2.51, -1.51, 2.35, -1.65, -1.65, -1.65, -1.65, -0.97, -0.97, 0.03, -1.21, -1.21, 0.79, 1.47, 3.47, -2.53, -0.18, -0.18, -1.18, -2.25, -2.25, -1.25, 2.12, -1.88, -2.88, -1.80, -0.80, -1.80, -1.21, -1.21, 4.79, -1.03, -2.03, -2.03, 0.37, -2.63, -2.63, -1.63, -0.63, -0.25, -2.25, -0.25, 10.75, 1.75, -1.57, -2.57, -1.57, 2.43, 0.43, -1.25, -1.25, 0.75, -1.25, 0.75, -1.49, -2.49, -0.49, 1.01, -1.99, -1.99, -0.21, -1.21, -2.21, 4.03, 1.03, -1.97, -2.26, -2.26, -0.26, 0.52, -3.48, -3.48, -1.84, -3.84, -3.84, 4.08, 6.08, 3.08, 5.08, 5.08, -3.63, 2.37, -0.63, -0.63, 0.37, 1.03, 0.03, 4.03, 0.23, -0.77, 2.23, 0.82, -1.18, -0.18, 0.25, 5.25, 4.25, 3.18, 7.18, 9.18, 1.75, 0.75, 4.75, 0.97, 1.97, 14.97, -1.25, -1.25, 2.75, 3.12, -0.88, 3.12, -1.25, -0.25, -1.25, 0.78, -2.22, -1.22, 2.84, -1.16, -2.16, 1.59, 0.59, -0.41, -2.41, -1.41, 10.11, 9.11, 0.11, -2.89, -2.89, -1.03, -0.03, -2.03, -2.03, -1.03, -1.59, -1.59, -1.59, -1.59, -1.59, -1.59, -2.23, -2.23, -2.23, -2.23, -2.23, -1.23, -2.23, -2.23, -1.23, 1.16, -1.84, 0.26, 0.26, 0.26, -0.21, -1.21, -1.21, -0.51, -0.51, -1.51, -1.21, -2.21, -2.21, 1.25, -0.75, -1.75, 4.03, -1.97, -0.97, 2.47, -2.53, -2.53, 1.54, -2.46, 1.54, -2.83, -2.83, -2.83, -2.83, -2.83, -0.83, -1.01, -2.01, -0.01, 0.99, -2.01, 2.99, -2.51, 1.49, 2.49, -3.13, -3.13, -3.13, -2.51, -1.51, -3.95, -1.95, -0.95, -3.52, -1.52, -3.52, -3.52, -3.52, -3.52, -2.52, -3.52, -2.52, -2.17, -3.17, -3.17, 0.74, -2.26, 1.77, -1.23, -1.23, 1.22, -1.78, -0.78, 22.77, 7.77, -2.23, -0.59, -1.59, -0.59, 1.41, 0.41, -1.59, -2.81, -1.81, -3.81, 0.61, 3.61, 0.61, 2.72, 14.72, 1.72, -2.71, -2.71, -1.71, -1.28, -0.28, -0.28, 0.03, 5.03, -2.97, 1.22, 1.22, 6.65, -0.35, -2.35, -0.85, -1.85, -1.85, -2.23, -2.23, -2.23, 0.46, -0.54, -1.54, 0.41, -1.59, -1.59, -0.28, 0.72, 2.72, -1.03, -0.03, -0.03, 1.23, 4.23, 0.23, -0.03, -1.03, 0.97, -1.03, 0.97, 1.14, -1.86, -1.86, 1.14, -2.86, -2.83, 1.17, 0.17, -2.83, -1.83, -1.79, 0.21, 2.21, -2.79, -2.79, 0.21, 0.21, -0.79, -1.79, -1.79, 1.96, -2.04, -2.04, -2.97, -1.97, -2.97, -2.21, -0.21, -2.21, -2.02, -3.02, -5.02, -2.55, -2.55, -1.55, -2.55, -2.55, -2.55, -1.55, -2.55, -0.55, -2.55, -2.55, -2.55, -0.55, -2.55, -3.55, -2.48, -1.48, -3.48, -3.48, -3.48, -3.54, 1.46, 0.46, 0.46, -3.54, -0.99, -0.99, -1.99, 1.01, -1.99, 0.01, 1.47, 0.47, -1.53, 15.76, 3.76, 1.76, -2.31, -2.31, -2.31, -1.44, 1.56, -0.44, -1.58, -1.58, -1.58, -1.24, -2.24, -1.24, 5.01, 2.01, 0.01, -0.35, -2.35, 5.65, 1.65, 0.65, 0.25, 2.25, 8.25, 7.79, 9.79, 3.79, 5.48, -1.52, 4.48, 0.79, 5.79, 4.79, -2.33, 0.67, 3.67, 2.67, -2.33, 1.67, 10.42, 3.42, 3.42, -0.33, -0.33, -0.33, -1.60, -2.60, -0.60, 1.76, 5.76, 3.76, -2.23, -1.23, -2.23, 0.77, -0.23, 0.77, -1.23, 5.77, 2.77, 2.43, -0.57, 1.43, -0.51, -1.51, 0.49, -0.51, 1.49, 5.22, -0.78, 0.22, 2.22, 3.22, -0.20, 2.80, -2.20, -1.20, -0.20, -1.28, 0.72, -3.28, 2.41, -1.59, -0.59, 1.22, 0.22, 0.22, -1.83, -1.83, 0.17, -1.83, -0.83, -2.83, -1.83, -1.83, 1.17, 2.17, -3.22, -2.22, -3.22, -2.22, -1.22, 3.66, -2.34, -2.34, -1.34, -1.34, 3.38, 6.38, 4.38, -0.28, 7.72, 1.72, 3.18, 0.18, 0.18, -3.20, 2.80, -1.20, -1.95, 2.05, -0.95, 11.36, -1.64, 1.36, 0.70, -0.30, 0.70, -2.34, 3.66, 2.66, -1.22, 1.16, 2.16, -0.84, -0.82, -2.82, -2.82, -1.99, -1.99, -1.99, -0.82, -2.82, -1.82, 23.72, 11.72, 8.72, -2.28, 0.72, -0.28, -1.28, -0.28, -0.28, 0.09, 0.09, 1.09, -1.31, -1.31, -2.31, -0.28, 0.72, -1.28, -0.20, -0.20, -1.20, 1.02, 0.02, -0.98, -1.76, 1.24, 3.24, -2.68, -2.68, -1.23, -2.23, -2.47, -1.47, -0.29, -1.29, -3.29, 1.01, -1.99, -0.99, 0.78, -1.22, -2.22, 1.32, 3.32, -2.68, 5.45, -0.55, -0.55, 1.17, -1.83, -1.83, -0.26, 5.74, -2.26, -0.26, -1.26, -2.02, -1.02, 5.98, 4.98, 0.98, 6.17, 7.17, 6.17, 3.17, 0.17, 7.34, 7.34, 10.34, 5.34, 7.34, -2.01, -2.01, -1.26, -2.26, -2.26, -1.96, -1.96, -0.96, -2.21, 0.79, -1.21, -2.21, -2.21, 1.79, 0.49, -2.51, 1.49, -1.21, -2.21, -2.21, 0.65, 4.65, 6.65, 7.20, -1.80, -0.80, -1.80, 0.20, -1.03, -2.03, 1.97, -0.03, 3.97, 4.72, 4.72, 1.72, 0.72, 4.72, 4.75, 5.75, 2.75, 4.75, 4.75, -3.10, -0.10, 1.90, 5.90, 0.90, -0.80, -0.80, 5.20, 14.20, -0.80, -1.61, -0.86, -0.86, 0.14, -1.86, 3.14, -1.66, -1.66, -1.66, -1.66, -0.66, 4.23, 1.23, 3.23, 4.23, 0.23, -1.26, -2.26, -2.26, -2.26, -1.26, -2.26, -1.92, 2.08, -2.92, 3.35, -1.65, 2.35, -6.45, -8.45, -0.23, 0.77, 0.77, 3.61, -0.39, 3.61, -1.28, -0.28, 0.72, -0.28, -2.28, 1.31, -0.69, -1.69, -1.69, -1.69, 0.72, 3.72, 4.72, 0.72, 11.72, -1.28, -1.28, -0.28, -0.28, -0.28, -0.76, -1.76, 0.24, -3.56, -3.56, -3.56, -2.51, -2.51, -2.51, 1.24, -1.76, 2.24, -1.98, -1.98, -1.98, -1.78, -1.78, 1.22, -2.96, 2.04, 5.04, -1.63, -1.63, -1.63, -0.03, 11.97, 3.97, -0.03, 4.97, -1.72, -1.72, -1.72, 4.31, 7.31, 7.31, 0.02, 8.02, 5.02, -1.54, -2.54, -1.54, -0.54, -2.54, -0.23, -0.23, -1.23, 1.77, -1.23, -0.51, 7.49, 9.49, 8.49, 1.49, 3.58, -0.42, -3.42, 2.72, 4.72, 2.72, -0.28, -1.28, -1.24, -2.24, -1.24, -2.24, -0.24, 3.75, 0.75, -0.25, 0.75, -0.25, -1.52, -0.52, -1.52, 2.77, 1.77, -1.23, -0.23, -0.23, -2.87, -2.87, -1.87, 1.13, 1.25, -1.75, 0.14, 2.14, 2.14, -2.72, -1.72, -4.72, -0.23, 0.77, -1.23, 0.77, 4.77, -2.95, 4.15, 1.15, 4.15, -0.85, 9.46, 0.46, -2.54, 1.46, 1.46, 9.73, 1.73, 3.15, 4.15, -0.30, -0.30, 2.70, -0.30, 1.15, 0.15, 15.77, 10.77, 6.15, 7.15, 4.15, 4.15, 2.15, 1.15, -0.85, 1.15, 3.75, -0.25, 0.57, 0.77, 0.15, 2.15, 0.77, -0.23, -1.23, 17.15, 3.75, -1.85, 8.76, 5.02, -0.23, 0.77, -1.23, 4.77, -0.23, -1.23, -2.24, 5.15, 0.70, 4.70, 4.70, -0.30, 1.76, -2.24, 3.77, -0.23, 4.78, 3.15, 5.09, 4.09, 6.09, -0.55, -1.55, -0.55, 0.12, 1.12, 1.12, -3.04, -1.04, -1.04, -2.01, -2.01, -2.01, -1.85, 0.15, -2.85, -2.85, -0.85, -1.63, -1.63, -1.63, -1.63, -1.63, -1.07, -3.07, -4.07, -1.26, -2.26, -1.26, 0.74, -0.26, -4.09, -4.09, -4.09, -5.09, 0.91, -5.29, -3.29, -4.29, -0.29, 0.71, 6.77, 2.77, -2.23, -0.23, 5.77, -2.10, 1.90, 0.90, -0.26, 0.74, -2.26, 2.74, -1.26, -1.26, -1.48, -1.48, 0.52, -1.63, 0.37, -1.63, -8.29, -8.29, -8.29, -6.29, -8.29, -2.55, -2.55, -2.55, -2.55, -2.55, -2.88, -1.88, -0.88, -2.88, -2.88, -1.94, -2.94, 4.06, 0.06, -0.94, 1.58, -1.42, -2.31, -1.31, -0.31, -2.31, 3.17, -2.83, -1.80, -1.80, -1.80, -1.41, -1.41, -1.41, -1.59, 11.01, -0.99, 0.01, -0.99, 3.01, -0.26, -0.26, 2.74, -1.26, -0.26, 1.86, -0.14, 0.86, 2.86, -0.14, -2.12, -2.12, -2.12, -2.28, -2.28, -2.28, -2.99, 0.01, -2.99, -2.99, -0.99, -1.87, 0.13, -1.87, 2.13, -1.87, -2.23, -2.23, -2.23, -1.23, -2.23, 1.79, -0.21, 2.79, -2.85, -1.85, -1.85, -1.85, -2.85, -2.23, -2.23, -2.23, 3.77, -2.23, -2.85, -2.85, -2.85, 0.15, -2.85, -4.82, -2.82, 3.18, 7.18, 11.18, -2.88, -2.88, 0.12, 0.12, -1.88, -2.82, -0.82, -1.82, 0.18, 4.18, -3.18, -3.18, -3.18, -3.18, -3.18, -2.79, -2.79, -1.79, -1.79, -2.79, -2.46, -2.46, -2.46, -2.46, -2.46, -3.56, -3.56, -3.56, -3.56, -3.56, -2.52, -3.52, -3.52, -3.52, -3.52, -3.52, -3.52, -3.52, -3.52, -3.52, 1.82, -0.18, -0.18, 1.48, -1.52, 1.48, 2.22, 4.22, 1.22, -1.78, -1.78, 7.45, 11.45, 2.45, -1.55, -1.55, 9.45, 13.45, 6.45, 9.45, 7.45, 2.22, 4.22, 2.22, 1.22, 0.22, 4.51, 6.51, 8.51, -0.75, 0.25, -1.75, -1.75, -1.75, -1.75, -2.47, -2.47, -2.47, -1.84, -0.84, -1.84, -1.94, -1.94, -1.94, -2.47, -2.47, -2.47, -1.58, -1.58, -1.58, -1.77, -1.77, -1.77, -2.35, -2.35, -1.35, -2.35, -1.58, -1.58, -1.58, -1.99, -1.99, -1.99, -1.87, -1.87, -1.87, -2.26, -2.26, -2.26, -1.77, -1.77, -1.77, 2.77, -2.23, 1.77, -1.31, -1.31, -2.31, 2.69, 5.69, 2.42, 1.42, 1.42, 3.42, 1.42, 0.19, -1.81, -1.81, -1.81, -1.81, 1.97, 5.97, -0.03, 0.97, 0.97, -0.80, -1.80, -0.80, 3.20, 3.20, -1.37, -0.37, -2.37, -3.04, -3.04, -3.04, -1.25, 0.75, -1.25, 2.98, -1.02, -2.02, 7.79, 10.79, 10.79, -3.58, -3.58, -2.58, -0.55, -1.55, -0.55, 9.40, -0.60, 5.40, 1.12, 1.12, 5.12, -3.44, -2.44, -3.44, -1.60, -2.60, -2.60, 2.74, -0.26, 2.17, -1.83, 0.01, -1.99, -1.27, -2.95, -2.95, -2.25, -2.25, -2.95, -1.28, -2.28, -2.28, -2.88, 1.12, -2.88, 0.18, -0.82, -1.82, -1.28, -2.28, -2.28, -2.28, -2.28, 3.72, -1.59, -0.59, 1.41, -1.98, -1.98, -0.98, -2.28, -2.28, -2.28, -0.76, -1.76, -1.76, -1.76, -1.76, -0.59, -1.59, -1.59, -0.78, -1.78, 0.22, -1.78, -1.78, 1.84, -2.16, -3.16, 2.84, 10.84, -0.69, -1.69, 1.31, -2.60, -2.60, -2.60, -3.33, -3.33, -3.33, -2.86, -0.86, 1.14, -2.88, -1.88, -2.88, -2.85, -1.85, -2.85, -3.04, -3.04, -3.04, -3.58, -3.58, -3.58, -3.93, -3.93, -3.93, -3.58, 0.42, -3.58, -3.79, -3.79, -3.79, -2.22, -2.22, -2.22, -2.34, -2.34, -2.34, -2.36, -2.36, -2.36, -2.85, -2.85, -2.85, -2.88, -2.88, 0.12, -2.55, -2.55, -1.55, -2.51, -2.51, -2.51, -2.85, -2.85, -1.85, -1.99, -1.99, -2.85, -2.85, -2.85, 9.16, 7.16, 7.16, 3.29, -2.71, 2.29, -3.62, -2.62, -2.62, 0.38, -1.62, 1.38, 4.38, -0.62, -1.62, -1.62, -1.62, -1.62, -1.62, -1.62, -2.46, -2.46, -2.46, -2.46, -2.46, -2.17, -2.17, -2.17, -2.17, -2.17, -2.30, -2.30, -2.30, -0.30, -2.30, -2.30, -2.30, -2.30, -2.30, -2.30, -1.92, -1.92, -1.92, -1.92, -0.92, -1.72, -0.72, -1.72, -1.72, -1.72, -1.80, -1.80, -1.80, -1.80, -1.80, -2.47, -1.47, 1.53, -3.16, -3.16, -2.16, -3.62, -2.62, 0.38, -3.80, -2.80, -2.80, -2.55, -1.55, -2.55, 1.13, -0.87, 0.13, -4.55, -4.55, -4.55, -0.55, -3.55, -1.78, 2.22, 11.22, -1.57, -1.57, -1.57, -2.60, -0.60, -1.60, -3.27, -3.27, -3.27, -3.27, -2.27, -1.91, -1.91, -2.91, -2.91, -0.91, -1.55, -2.55, -1.55, -0.26, -2.26, -2.26, -2.86, -2.86, -2.86, -2.25, -2.25, -1.25, -1.76, -1.76, 0.24, -2.25, -0.25, -1.25, 0.75, -2.25, -1.25, -2.25, -2.25, -2.25, -2.25, -2.25, -1.25, -2.92, -2.92, -0.92, -2.25, -2.25, -2.25, 0.72, 3.72, -2.28, -1.28, -2.28, 2.44, -1.56, 1.44, 2.44, -2.56, -3.52, -3.52, -3.52, -1.41, -1.41, -1.41, -0.99, -0.99, -1.99, -1.59, -1.59, -1.59, -1.59, -1.59, -3.14, -4.14, -4.14, -4.14, -4.14, -1.80, -1.80, -1.80, -1.80, -1.80, -1.82, -1.82, -1.82, -1.82, -1.82, -3.61, -0.61, -2.61, -1.49, -0.49, -1.49, -2.98, 0.02, -2.98, -0.98, -1.98, -0.98, -1.98, -1.98, -2.39, -1.39, -2.39, -5.68, -7.68, -6.68, -2.26, -2.26, -2.26, 1.15, 0.15, 2.15, 4.52, -1.48, 0.52, -2.17, -2.17, -3.17, -0.67, -0.90, -0.90, 3.10, 2.74, 0.74, 1.74, -2.07, 0.93, -2.07, 1.76, -2.24, -0.24, -1.26, -0.26, -1.26, 4.23, 1.23, 6.23, -20.49, -28.49, -22.49, -10.49, -8.49, -2.75, -3.75, -2.75, -3.75, -1.89, -3.89, -3.89, 0.11, 3.11, -2.81, -2.81, -2.81, -2.81, -1.81, -3.05, -3.05, -3.05, -0.22, -0.22, -1.22, -1.22, -1.22, -3.07, -1.07, -3.07, -3.07, 0.18, -1.82, 2.18, -0.33, -0.33, 9.67, -1.82, -1.82, 0.18, -0.09, 0.91, -2.09, -3.09, -3.09, -3.47, -0.47, -3.47, -3.47, -3.47, -1.55, 0.45, -0.55, 1.45, -3.55, -2.57, 1.43, -3.57, -0.82, -0.82, 1.18, -3.02, -3.02, -3.02, -1.02, -0.02, -0.02, -0.02, -2.02, -2.93, 1.07, -1.93, -1.93, 0.07, -2.51, 0.49, -1.51, -1.99, -1.99, -1.99, -1.61, -3.61, -3.61, -0.13, -2.13, 1.87, -2.49, 1.51, -2.49, -2.23, -2.23, -2.23, -2.23, -2.23, -2.23, -1.23, -2.23, -2.23, -2.32, -2.32, -2.32, -2.23, -2.23, -2.23, -3.66, -3.66, -3.66, -0.26, -2.26, 0.74, -1.04, -2.04, -0.04, -1.60, -1.60, 2.40, -0.60, 1.40, -2.33, 0.67, 1.67, -0.33, -1.33, -2.33, -2.33, -1.82, -0.82, -2.33, -0.33, -1.33, -2.33, -0.33, -1.33, 0.67, -2.33, -2.33, -2.33, -2.33, -2.33, -3.04, -2.04, -2.04, -1.04, 0.69, -0.31, -1.31, -2.31, 1.29, -1.71, 0.29, -1.71, -2.71, -1.71, 3.22, -1.78, -1.78, 3.22, -1.78, -1.78, 5.78, -1.22, 1.78, -0.05, -1.05, -2.05, 1.37, -0.63, -1.63, -1.82, -1.82, -1.82, -2.66, -2.66, -2.66, -1.82, -0.82, -0.82, 0.98, -3.02, -4.02, -0.85, 0.15, -1.85, 1.78, -2.22, 9.78, -2.17, -1.17, -3.17, -2.17, 0.83, -1.77, -1.77, -1.77, -1.77, -1.77, -1.77, -1.77, -1.77, -1.77, -1.78, -1.78, -1.78, -1.39, -1.39, -1.39, -2.01, -2.01, -0.01, 3.98, -3.02, -1.02, 12.33, 15.33, 10.33, 13.33, 3.33, 1.53, 6.53, 0.53, -0.47, -2.47, 4.01, -1.99, -2.99, -1.99, 2.01, 14.46, 16.46, 14.46, 20.46, 22.46, 5.69, -1.31, 1.69, 1.60, 1.60, -0.40, 0.41, -1.59, -0.59, 2.60, 1.60, 0.60, -0.60, -2.60, 1.40, 3.40, 0.40, -2.51, 2.49, -2.51, 0.49, 7.49, 1.00, 5.00, 14.00, 6.00, 9.00, -1.56, -2.56, -2.56, -2.56, 1.44, -0.31, -2.31, 5.69, -1.25, -4.25, -3.25, -4.25, -3.25, -2.46, -2.46, -2.46, -1.46, -2.46, -3.22, -2.22, -3.22, -3.22, -3.22, -2.03, -2.03, -2.03, -2.03, -2.03, -2.03, -2.03, -1.03, -2.03, -2.03, -2.22, -2.22, -2.22, -2.40, -2.40, -2.40, -2.06, 0.94, 0.94, -3.63, -3.63, -2.63, -1.68, -1.68, -0.68, -4.03, -2.03, -3.03, -4.03, -4.03, -2.24, -2.24, -2.24, -2.24, -0.24, 1.74, -1.26, -2.26, -1.26, -2.26, -2.24, -1.24, -2.24, -0.50, 1.50, -1.50, -1.57, -1.57, -1.24, -2.24, -2.24, -2.24, -2.24, -2.24, -2.57, -1.57, -1.57, 5.70, 13.70, 2.70, -1.61, -1.61, -1.61, -1.43, 1.57, -0.43, -1.48, -3.48, -2.48, -1.43, -0.43, 1.57, -3.85, -4.85, -0.44, 1.56, 0.63, -1.37, 0.63, -0.37, 0.63, -0.33, -1.33, 1.67, 0.67, 7.67, -1.30, -1.30, -1.30, -0.30, -0.30, 8.20, -1.80, -1.80, 1.20, 1.20, -2.23, -2.23, -2.23, -1.75, -1.75, -1.75, -2.36, -2.36, -2.36, -2.27, -2.27, -2.27, -2.27, -1.27, -2.27, -2.27, -2.27, -2.27, -1.27, -3.60, -3.60, -1.60, -2.60, -1.60, -2.27, -2.27, -2.27, -2.27, -2.27, -1.68, -1.68, -0.68, -2.31, -1.31, -0.31, -0.82, -1.82, -1.82, -1.95, -1.95, -0.95, 1.39, -1.61, -0.61, 0.76, -2.24, -1.24, 0.18, -1.82, -1.82, 1.97, 0.97, 2.97, 1.24, -1.76, -1.76, -0.27, -0.27, 1.73, -1.63, -1.63, -1.63, -2.40, -2.40, -2.40, -2.42, -2.42, -2.42, -2.03, -2.03, -1.03, -0.58, -1.58, 2.90, 8.90, -1.10, -0.10, -2.10, 2.42, -1.58, -1.58, -1.49, -0.49, -2.49, -2.49, -2.49, -2.86, -2.86, -2.86, -2.26, -2.26, -2.26, -2.26, -2.26, 2.74, -2.55, -2.55, -2.55, -3.22, -3.22, -3.22, -2.68, -2.68, -2.68, -1.80, -1.80, -1.80, -1.80, -0.80, -1.82, -1.82, -1.82, -1.82, -1.82, -1.82, -1.82, -1.82, -1.82, -1.82, -1.56, -1.56, -1.56, -3.66, -3.66, -3.66, -2.23, -2.23, -2.23, -1.97, -2.23, -2.23, -2.23, -1.75, -1.75, -1.75, -2.23, -1.23, -2.23, -1.75, -3.02, -3.02, -3.02, -3.02, -3.02, -2.30, -2.30, -2.30, -2.30, -2.30, -2.30, -2.30, -2.30, -2.30, -2.30, -1.90, -1.90, -0.90, -0.90, -1.90, -4.30, -4.30, -4.30, -2.86, 0.14, -0.86, -5.43, -5.43, -5.43, -1.65, -1.65, -1.65, 0.35, 5.35, -2.01, -2.01, -2.01, -1.01, -1.01, -1.26, -1.26, 1.74, 1.74, 0.74, -0.80, -1.80, 1.20, -0.80, 0.20, -3.69, -0.69, 3.31, -1.25, -2.25, -0.25, 0.49, 1.49, 0.49, -2.53, -0.53, 0.47, 1.47, 2.47, 4.47, 2.62, 1.62, 1.62, 1.62, 2.62, -2.38, -2.38, -2.38, -2.38, -1.38, 5.82, 1.82, 0.82, -1.59, 1.41, 0.41, -1.78, -0.78, -1.78, -0.30, 5.70, -0.30, -2.43, -3.43, -1.43, 0.48, -0.52, 1.48, -2.42, -2.42, 0.58, -2.88, -2.88, -1.88, 2.45, 1.45, 4.45, -2.56, -2.56, 4.44, -2.60, -2.60, -2.60, -1.82, -1.82, -1.82, -2.86, -0.86, 9.14, 8.35, -1.65, 1.35, -2.93, 4.07, 0.07, -1.42, -1.42, 0.58, -2.25, -2.25, -0.25, -2.25, -2.25, -3.39, -1.39, 0.61, 8.61, 1.61, -1.68, -1.68, -1.68, -1.68, -2.25, -2.25, -1.25, -2.25, -0.25, -1.76, -1.76, -0.76, -0.76, -1.76, -2.25, -2.25, -2.25, 3.75, 0.75, 4.55, 5.55, 7.55, 15.73, 10.73, 8.73, 2.86, 0.86, 1.86, -2.46, 1.54, 0.54, -1.24, -2.24, -2.24, -0.19, 1.81, -1.19, 2.76, 3.76, -2.24, -2.59, -0.59, -3.59, -1.87, 2.13, -1.87, -2.82, -1.82, -2.82, -1.99, -1.99, 8.01, 0.67, -1.33, -2.33, 0.67, -2.33, -2.31, -2.31, -1.31, -2.31, -2.31, -1.05, -2.05, -2.05, -2.05, -1.05, 0.23, -1.77, -1.77, -2.23, -2.23, -2.23, -2.62, -0.62, -2.62, -3.73, -3.73, -3.34, -3.34, -0.04, 1.44, 0.44, 0.44, -0.03, -1.03, -1.03, -0.04, -1.04, -0.04, -1.61, -1.61, -1.61, -2.30, -2.30, -2.30, 5.20, 0.20, -1.80, -2.95, 6.05, -2.95, -2.95, -1.95, -1.95, -2.54, -2.54, 3.46, 7.74, -3.26, 4.74, 6.12, 8.12, 6.12, 5.18, 1.18, 7.18, -1.67, -1.67, -0.67, 0.23, 3.23, 7.23, 1.46, 0.46, -1.54, -2.54, -4.54, 2.47, -1.53, -2.53, -0.53, -0.53, -1.62, -3.62, 1.38, -2.62, -1.62, 0.42, 0.42, -1.58, -1.58, -1.58, -2.31, 6.97, -2.98, -0.98, -4.05, -6.05, -5.05, -1.83, -1.83, -0.83, -1.83, -1.83, -1.93, -1.93, -1.93, -1.93, -0.93, -1.85, 0.15, 0.15, -2.23, 0.77, 0.77, -2.00, -2.00, 2.00, -2.25, -1.25, -1.25, -3.39, -2.39, 1.61, -2.28, -0.28, -2.28, -1.51, -2.51, -2.51, -2.51, -2.51, -2.23, -2.23, -2.23, -2.23, -2.23, -0.85, -2.85, -2.85, -2.85, -2.85, -2.85, -1.85, -2.85, -2.85, -1.85, -2.02, -1.02, 2.98, -2.01, 0.99, 0.99, -2.28, -2.28, -1.59, -1.59, -2.96, -1.96, -2.64, -2.64, -5.32, -5.32, -3.57, -1.57, -3.57, -1.78, -1.78, -1.78, -2.53, -2.53, -2.53, -7.20, -4.20, -4.20, -9.20, -9.20, -2.42, -1.42, -3.42, -2.42, -3.42, -2.39, -2.39, -2.39, -2.39, -3.39, -4.16, -4.16, 21.84, -1.54, -2.54, -2.54, -2.28, -1.28, 0.72, -2.07, -1.07, -2.07, -1.84, -0.84, -1.84, -2.44, -2.44, -2.44, -2.44, -2.44, -2.44, -2.10, -2.10, -1.10, 3.90, 0.90, -2.23, -2.23, -2.23, -2.23, -2.23, -0.97, 0.03, -1.97, 1.03, 0.03, -2.23, -2.23, -0.23, -1.23, -2.23, -1.83, -1.83, -1.83, -1.98, -1.98, -1.98, -2.37, 1.63, -2.37, 2.41, 0.41, 0.41, -1.13, -3.13, -1.13, -1.78, -1.78, -0.78, -2.52, -1.52, -1.52, -3.04, -3.04, -3.04, -2.30, -1.30, -3.30, -4.46, -4.46, -2.46, -3.82, -3.82, -3.82, -4.30, -4.30, -4.30, -2.69, -2.69, -2.69, -1.80, -0.80, -1.80, -0.08, -2.08, -1.08, -0.82, 1.18, 3.18, -2.05, -1.05, -1.05, -0.42, -2.42, -1.42, -2.33, -2.33, -0.33, -2.88, -3.13, -3.13, -3.13, -3.13, -2.13, -0.84, -1.84, -1.84, -1.84, -1.84, -1.97, -1.97, -1.97, -1.97, -1.97, -0.84, -1.84, -0.84, -1.84, -1.84, -0.84, -1.84, -1.84, -1.84, -1.84, -1.84, -1.84, -1.84, -1.84, -1.84, 0.16, -1.84, -1.84, -1.84, -1.84, -0.84, -1.84, -0.84, -1.84, -1.84, -1.84, -0.84, -0.84, -1.84, -1.84, 5.21, 2.21, 0.21, -0.11, 2.89, 3.89, -7.20, -4.20, -3.20, -2.96, -2.96, -1.96, -1.96, -1.96, -1.82, -2.82, -1.82, -5.00, -2.00, 1.00, -2.88, -2.88, -2.88, -2.26, -2.26, -2.26, -2.88, -2.88, -0.88, -3.13, -2.13, -2.13, -1.52, -0.52, 1.48, -4.90, -3.90, -3.90, -2.15, -2.15, -1.15, -2.52, -3.52, -3.52, -0.20, 0.80, 4.80, -3.52, -3.52, -3.52, -2.26, -2.26, -2.26, -1.14, -1.14, -1.14, 1.64, -2.36, 7.64, -2.26, -2.26, -2.26, -2.03, -2.03, -2.03, -1.80, -1.80, -1.80, -3.19, -3.19, -3.19, -2.30, -2.30, -2.30, 1.25, 2.25, 0.25, -1.98, -1.98, -1.98, 1.83, -1.17, -2.17, -1.56, -1.56, -1.56, 9.79, -0.21, -2.21, -2.23, -1.23, -1.23, -2.01, -1.01, -2.01, -1.90, -1.90, -0.90, -1.92, -1.92, -1.92, -5.13, -5.13, -6.13, -2.95, -2.95, -2.95, 2.75, -2.25, 1.75, 7.87, 5.87, 15.87, 26.87, 23.87, 5.22, 6.22, 3.22, -0.78, -2.78, -2.13, -2.13, -1.13, -2.13, 4.87, 2.45, -2.55, 4.45, 5.45, 3.45, -2.01, -3.01, -1.54, 0.46, -1.54, 3.46, -1.54, -2.12, -2.12, -3.12, -0.12, -2.12, -3.60, 2.40, -3.60, -3.60, -0.60, -1.76, -1.76, -1.76, -2.82, -2.82, -2.82, -0.82, -2.82, -2.82, -2.88, -2.88, -2.88, -3.11, 0.89, -1.11, -0.66, -1.66, -3.66, -1.56, -0.77, -1.77, 2.23, -1.77, -2.77, -2.26, -2.26, -2.26, -2.78, -0.78, -1.78, -1.26, -2.26, -2.26, -1.97, -1.97, -1.97, -2.26, -2.26, -2.26, -2.26, -1.26, 1.74, 3.02, 1.02, 1.02, -2.08, -1.08, -3.08, 0.22, -2.78, -1.78, -2.44, -1.44, -2.44, -2.23, -2.26, -2.23, -2.26, -1.33, 3.67, -0.33, 0.67, -0.33, -1.33, -1.33, -1.33, 0.67, -0.33, -2.33, -1.33, 2.67, 0.67, -1.33, 0.20, 0.20, 3.20, 5.20, 0.20, 1.76, 0.76, -2.24, -0.24, -2.24, -0.76, -1.76, -0.76, -2.25, -2.25, -1.25, -1.76, -1.76, 2.25, -0.75, 1.25, -0.75, 1.25, -0.21, -1.21, -1.21, 1.79, -1.21, -0.76, -2.76, -3.76, 1.31, -2.69, -0.69, -2.69, -1.69, -1.69, -2.43, -2.43, -2.43, -3.68, -3.68, -3.68, -3.84, -3.84, -2.73, -2.73, -0.73, -1.80, -1.80, -1.80, -2.34, -1.34, 1.66, -3.01, -3.01, 1.99, -2.28, -2.28, -0.28, -0.98, -1.98, -1.98, -2.25, -2.25, -1.25, -1.25, 0.75, -2.23, -1.23, -2.23, 0.77, 1.77, 4.80, 0.80, -3.20, -3.60, -3.60, -3.60, 3.07, 9.07, 1.07, -0.97, -1.97, -1.97, -1.23, -1.23, -2.23, 4.53, -2.47, 1.53, -0.85, -2.85, 0.15, -1.31, -1.31, -1.31, -1.71, -1.71, -1.71, 5.06, 0.06, 2.06, 0.55, 7.55, 13.55, -3.88, -2.88, -2.88, 1.69, -0.31, 2.69, -2.07, -4.07, -2.07, -2.30, -2.30, -2.30, -0.80, 2.20, 6.20, -0.03, 1.97, 2.97, -2.30, -1.30, 0.70, -2.30, -2.30, -2.30, -0.58, -1.58, -1.58, -2.49, 0.51, -2.49, -1.26, -1.26, -2.26, 0.40, -2.60, -0.60, -2.60, 0.40, 0.67, -0.33, -1.33, 0.67, -1.33, 0.67, -1.33, -2.33, -2.33, -0.33, 0.18, 0.18, -0.82, -1.82, -1.82, -2.88, -2.88, -2.88, -3.40, -3.40, -3.40, -2.88, -2.88, -2.88, 3.79, -2.21, -2.21, -0.23, -2.23, -2.23, -1.23, -2.23, -2.23, 8.11, 3.11, -1.89, 0.85, -1.15, -2.15, -1.53, -2.53, -1.53, -12.96, -9.96, -2.96, -2.32, 6.68, 8.68, -2.46, -2.46, -0.46, -3.41, -4.41, -0.41, -1.24, 0.76, -0.24, 7.74, -2.26, 0.74, -5.22, -5.22, -2.22, 4.78, 16.78, -0.49, 2.51, 3.51, -1.58, -1.58, -1.58, -1.58, 2.01, 1.01, 2.01, -1.58, -1.58, -1.58, 2.42, -0.58, -1.58, 1.36, -1.64, -1.64, -0.36, -0.36, -0.36, -1.34, -2.34, -2.34, -2.36, -0.36, -2.36, -2.01, 1.99, -1.01, 1.97, -3.03, 0.97, -1.05, -0.05, -0.05, -2.33, -2.33, -1.33, -2.24, -2.24, -2.24, -0.02, -1.02, -1.02, -1.38, -4.38, -0.38, -1.33, -0.33, 0.67, -5.49, -4.49, -4.49, 3.67, -1.33, -0.33, 1.58, -1.42, -1.42, 0.58, -2.42, 5.06, -3.94, -1.94, 0.06, 3.06, 6.27, -1.73, -0.73, -2.73, 0.27, -2.33, -1.33, -1.33, -0.05, -0.05, -1.05, -2.05, -1.05, -0.05, -2.31, -3.31, -4.31, -2.55, -1.55, -2.55, -1.01, -0.01, -0.01, -2.26, -2.26, -2.26, -0.22, 0.78, -3.22, -1.80, -1.80, -0.80, -1.61, 5.39, -0.61, -5.37, -5.37, -4.37, -2.33, -2.33, -2.33, -2.31, -2.31, -2.31, -0.57, -1.57, 0.43, -1.80, 0.20, 2.20, -1.80, -1.80, -1.80, -3.32, -1.32, -3.32, -0.95, -0.95, 0.05, -0.82, -1.82, 0.18, -1.99, -1.99, -1.99, 4.57, -3.43, -4.43, -1.43, -3.43, -2.43, 1.31, -0.69, -1.69, -3.43, 3.57, -0.43, -3.24, -3.24, -3.24, -3.56, -3.56, -1.56, -2.12, -2.12, -2.12, -1.85, 0.15, -2.85, -1.59, -1.59, -1.59, -2.00, 0.00, 0.00, 0.00, -3.00, 0.00, 0.00, 2.00, -1.00, 1.00, -1.00, -3.00, 1.00, -2.00, -2.00, 10.33, 8.33, 6.33, 1.33, -0.67, 2.66, 14.66, 7.66, 3.66, 0.66, -2.86, 4.14, 2.14, -0.86, -1.86, -1.46, -1.46, -1.46, -2.25, -2.25, -3.25, -2.25, -3.25, -0.88, -2.88, -2.88, -2.88, 0.12, -1.82, -1.82, -1.82, -0.77, -1.77, -0.77, -0.82, 2.18, -0.82, -2.32, -2.32, -2.32, -0.88, -0.88, -1.88, -1.26, -2.26, -2.26, -1.88, -2.88, -1.88, -0.88, -0.88, -0.88, -2.02, -1.02, 2.98, 0.67, 7.67, 1.67, 7.67, -0.33, -0.33, -2.05, 0.95, 1.95, -1.28, 1.72, -2.28, -3.64, -3.64, -2.64, -1.30, -0.30, -2.30, -0.57, 2.43, -1.57, -2.02, -3.02, -3.02, -2.60, 3.40, 3.40, -2.80, -0.80, 3.20, -2.80, 4.20, 1.20, -2.18, -1.18, 1.82, -2.77, 3.23, 5.23, -1.60, -0.60, -0.60, 3.18, 3.18, -2.82, -2.88, -1.88, 0.12, -2.20, -0.54, -1.54, -1.26, -1.26, -2.26, -3.61, -1.61, -2.61, 6.31, 3.31, -2.69, -2.69, 2.18, -1.82, -1.82, -2.27, -2.27, -2.27, 1.12, -2.88, -2.88, 0.38, 2.38, 5.38, 8.65, -2.35, -1.35, -2.35, -1.39, -2.39, -2.39, 2.72, 9.72, 0.72, 7.27, 8.27, 1.27, 0.27, 25.00, 8.00, 2.00, -2.00, -2.42, -1.42, -2.42, -2.42, 2.63, -2.37, -1.37, -2.37, 2.74, 0.74, 1.74, -1.89, -1.89, -1.89, 0.11, 12.74, -0.26, -2.26, 4.33, 7.33, 5.33, -0.28, -2.28, -1.28, -2.54, -2.54, -2.54, -2.88, -1.88, -1.88, -3.00, 3.00, -3.00, -2.28, -2.28, -2.28, 3.75, -2.25, 0.75, -2.63, -1.63, -2.63, -2.55, 5.45, 2.45, -3.00, -3.00, -3.00, -2.27, -0.27, -2.27, 1.69, -1.31, -0.33, 2.67, 1.67, -2.50, -2.50, -2.50, 5.61, 1.61, -0.39, 7.65, 0.65, 0.65, -2.01, -2.01, -1.86, -0.86, -0.86, -1.82, -1.82, 0.18, 1.83, -1.17, 1.83, 5.12, 4.12, 5.12, 8.65, 6.65, -0.35, -3.52, -3.52, -1.64, -2.64, -2.64, -2.96, -2.96, -2.96, 0.81, -0.19, -0.19, -2.26, 0.00, -2.00, -2.59, -2.59, -2.59, -2.00, -3.00, 11.63, 5.63, -0.37, -2.37, -2.37, -2.37, -2.37, 3.64, -1.36, 13.29, 8.29, -1.42, -2.42, -2.42, -2.42, 8.65, 7.65, 3.65, 9.18, 4.18, -0.37, 4.65, -0.62, -2.35, -2.35, -2.40, -2.40, 0.11, -2.37, 3.58, -2.37, -1.37, -1.89, 2.00, 3.63, 2.00, 3.00, 15.00, 2.00, 5.00, 7.27, 1.33, 4.11, -2.37, 7.29, 7.65, -2.42, -2.25, -2.25, -2.25, -2.01, -0.01, -0.01, -2.38, -2.38, -1.38, -0.76, -0.76, -0.76, -0.39, 0.61, -2.39, 1.89, 2.89, -1.11, -2.47, -3.47, -1.47, -0.47, -2.47, -2.46, -2.46, -0.46, 2.54, -1.46, 12.59, -1.41, 3.59, -1.41, -2.41, -2.07, 5.93, -2.07, -3.07, -3.07, -1.56, 1.44, -0.56, -1.56, -1.56, -1.30, -2.30, -2.30, -2.30, -2.30, 0.18, 0.18, -1.82, 0.18, 0.18, -1.56, -2.56, 0.44, -0.56, -1.56, -2.33, -2.33, -2.33, -2.33, -2.33, -2.33, -2.33, -2.33, -2.33, -2.33, -2.33, -2.33, -1.33, -1.33, 0.15, -2.96, -0.50, -1.50, -1.50, 6.50, 0.50, -0.34, -2.34, -0.34, -2.34, 0.66, 3.67, 9.67, 3.67, 13.67, 6.67, -1.98, -1.98, -2.98, -2.98, -2.98, -1.11, -2.11, -2.11, -7.48, -5.48, -5.48, 1.18, 0.18, -2.82, -4.02, -3.02, -3.02, -1.29, -3.29, -3.29, -3.29, -3.29, -2.92, -2.92, -3.48, -2.48, -1.48, -3.75, -1.75, -1.75, -2.81, -0.81, 0.19, 0.19, -1.81, 0.74, 10.74, 9.74, 3.74, -2.26, -1.56, -1.56, -0.56, -2.49, -1.49, -1.49, -0.55, -0.55, 2.45, 0.45, 2.45, -1.88, -2.88, -2.88, -2.88, -1.88, -2.26, -2.26, -1.26, -2.26, -2.26, -2.88, -2.88, -1.88, 1.57, 1.57, -3.43, -2.01, -1.01, -2.01, -0.54, 0.46, -2.54, 0.40, -2.60, -0.60, -3.83, -1.83, -2.83, 1.41, 5.41, -1.59, -0.78, -1.78, 0.22, 1.22, 1.22, -1.75, -1.75, -0.75, 1.90, 13.90, 0.90, -1.55, -1.55, 1.45, -1.33, -0.33, 0.67, -7.04, -7.04, -7.04, -7.04, -7.04, -2.90, -2.90, -2.90, -2.90, -2.90, -1.77, -0.77, -1.77, -2.52, -1.52, -2.52, -2.26, -2.26, -2.26, -1.77, -0.77, -1.77, -2.23, -1.23, -2.23, -1.80, 4.20, -0.80, -0.28, 1.72, 1.72, -2.33, -1.33, -0.33, -2.24, -2.24, -1.24, -0.97, -1.97, -1.97, -1.23, -2.23, -1.23, -1.99, -1.99, 1.01, -2.12, -1.12, -2.12, -1.59, -1.59, -1.59, -1.41, 1.59, 0.59, -1.87, -1.87, -1.87, -2.24, 0.76, -2.24, -2.33, -2.33, -2.33, -2.28, -2.28, -2.28, -2.10, -0.10, -2.10, -2.38, -2.38, -2.38, -3.13, -3.13, -3.13, -2.38, -2.38, -2.38, -2.36, -0.36, -2.36, -2.45, -2.45, -2.45, -1.65, -1.65, -1.65, -4.31, -0.31, -5.31, -1.45, -3.45, -5.45, -2.45, -2.45, -2.45, -2.26, -2.26, -2.26, -2.26, -2.26, -0.75, 1.25, -1.75, 0.25, -1.75, -1.75, -1.75, -1.75, -1.75, -1.75, -2.26, -2.26, -1.26, -2.26, -2.26, -2.26, -2.26, -2.26, -2.26, -2.26, -1.77, -1.77, -1.77, -1.77, -1.77, -6.61, -6.61, -5.61, -1.41, -1.41, -1.41, -1.59, -0.59, -1.59, 3.02, -1.98, -1.98, -1.80, -0.80, -1.80, 35.70, 7.70, 4.70, 4.70, -1.30, -0.07, -3.07, -3.07, -0.07, 2.93, -0.50, -1.50, -2.50, -2.50, -3.50, -1.12, -3.12, -3.12, -3.12, -2.12, -3.53, -3.53, -2.53, -3.53, -1.53, -3.42, 0.58, -3.42, -3.42, -2.42, -5.32, -0.32, -4.32, -4.32, -4.32, -1.12, -1.12, 1.88, -1.12, 0.88, -0.17, -1.17, -2.17, -2.39, -0.39, 0.61, -1.39, -2.39, -0.39, -0.43, -2.43, -1.43, 7.20, 3.20, 2.20, -2.05, -2.05, -2.05, -2.10, -1.10, -0.10, 1.97, -2.03, -1.03, -2.82, -2.82, -1.82, -1.57, -1.57, -1.57, -2.38, -2.38, -2.38, -1.80, -1.80, -1.80, 0.24, -1.95, -0.25, 0.08, -1.52, -1.52, -1.52, -1.58, -1.58, -1.58, -2.21, -2.21, -2.21, -0.97, -1.97, -1.97, -2.26, -2.26, -2.26, -2.26, -2.26, -2.26, -1.58, -1.58, -1.58, -1.58, -1.58, -1.58, 1.37, 3.37, -1.63, -2.33, -2.33, 0.67, -1.33, -2.33, -2.03, -2.03, -1.03, -2.03, -2.03, -1.63, -1.63, -1.63, -1.63, -1.63, -0.18, -2.18, -3.18, -2.00, -3.00, -1.00, -2.01, -1.01, -1.01, -0.23, -1.23, -1.23, 0.77, -0.23, -0.23, -1.56, 0.44, -1.56, 0.79, 13.79, 9.79, 2.97, -1.03, -1.03, -2.88, -2.88, -2.88, -3.24, -2.24, -0.24, 7.06, 7.06, 5.06, 3.06, -1.94, -1.50, -2.29, -2.29, -2.29, -2.29, 0.71, -2.29, -2.15, -2.15, -2.14, 25.86, -3.14, -2.72, -2.72, -2.72, -3.03, 2.97, -2.15, -2.15, -2.15, -0.83, -2.83, 5.17, -1.54, 3.46, -0.54, 8.78, 4.78, 4.78, 5.12, 1.12, -0.88, 4.39, -0.61, -0.61, 0.12, 3.12, -0.88, -2.25, 3.75, -2.25, -2.25, -2.25, -2.25, -0.25, -0.25, 1.75, 0.24, -1.76, -1.76, -1.57, -1.57, -1.57, -2.25, 0.75, -0.25, -0.41, -1.41, -0.41, -5.26, -4.26, 0.74, -5.26, -4.26, -1.67, -1.67, -1.67, -1.67, -1.67, -1.87, -1.87, -1.87, -1.87, -1.87, -1.36, -0.36, -1.36, -0.36, -0.36, -2.38, -1.38, -2.38, -2.38, -2.38, -0.33, -2.33, -2.33, 0.67, 0.67, -2.33, -2.36, 0.64, 0.64, -1.15, -4.15, -4.15, -1.51, -1.51, -1.51, -1.70, -0.70, -0.70, -0.80, -1.80, -1.80, -1.76, -1.76, -1.76, -2.28, -2.28, -2.28, -4.67, -3.67, -4.67, -1.76, -1.76, -1.76, -2.28, -2.28, -2.28, -2.26, -2.26, -1.26, -1.21, -2.21, -1.21, -2.52, -1.52, -2.52, -3.56, -3.56, -0.56, -3.39, -2.39, 5.61, 1.70, 3.70, -0.30, -0.37, -1.37, -3.37, -1.06, -3.06, -1.06, -1.80, 2.20, 0.20, 3.60, 1.60, 0.60, -2.51, -2.51, -1.51, -1.51, 0.49, -2.85, -2.85, -2.85, 0.15, -1.85, -0.51, -2.85, -2.85, -2.85, -2.85, -0.85, -2.23, -2.23, 0.77, -1.23, -2.23, -3.18, 0.82, 6.82, 6.82, 5.82, 3.43, -1.57, -2.57, -2.57, 2.43, -2.85, -2.85, -2.85, -1.85, 0.15, 1.82, 2.82, -0.18, -1.88, 1.12, -2.88, -1.57, -3.57, -2.57, 0.39, -0.61, 0.39, 3.25, 0.25, 0.25, -2.23, -1.23, -2.23, -1.97, -1.97, -1.97, 10.93, 1.93, 1.93, 6.93, 3.93, -0.88, -2.88, 1.12, -2.88, -1.88, 1.12, -0.88, 1.12, -1.88, -0.88, 4.99, -1.01, -0.01, 1.99, 7.99, 0.59, -0.41, -0.41, -1.41, 1.59, 2.20, -1.80, -1.80, -1.80, -0.80, 0.20, -1.80, -1.80, -0.80, -1.80, -1.80, -1.80, -1.80, 0.20, -0.80, -1.80, -0.80, -1.80, -1.80, -1.80, -1.80, -1.80, -1.80, -1.80, -1.80, -5.39, -2.39, 19.61, -4.39, -1.62, 0.73, 0.73, -1.27, -1.95, 0.05, 1.05, -0.71, -1.71, -2.71, -2.43, -0.43, 1.57, 6.38, -5.62, -3.62, -5.62, 5.38, 2.31, -0.69, 0.31, -2.69, 0.31, 0.09, -0.91, -0.91, -2.91, -0.91, -2.91, -2.91, -2.91, -2.91, 0.09, 0.29, -0.71, -1.71, -3.71, -1.71, -0.14, -3.14, 5.86, -1.14, 3.86, -2.25, 7.75, -1.25, -2.25, 1.75, 1.75, -1.39, 4.61, 3.61, -1.82, -0.82, -1.82, -1.75, -1.75, -1.75, -1.58, -1.58, -1.58, -1.56, -1.56, -1.56, -1.43, -1.43, -1.43, -3.00, -1.00, 0.00, -3.00, -3.00, -3.00, -2.29, -2.29, -1.29, -2.45, -2.45, -2.45, -2.10, -2.10, -2.10, -8.43, -7.43, -0.43, -1.78, -2.78, -2.78, -2.78, -2.78, -0.76, 1.24, -0.76, -0.76, 0.24, 7.32, 3.32, 0.32, -2.41, -3.41, -3.41, -1.41, -3.41, -3.41, -3.61, -3.61, -0.61, -2.17, -2.17, -2.17, -1.15, -1.15, -2.15, -1.17, -2.17, -2.17, -1.92, -1.92, -0.92, 1.51, -0.49, 0.51, 0.01, 1.01, 4.01, -2.26, 0.74, -0.26, -2.23, -2.23, -2.23, -2.23, -1.23, -3.97, -3.97, -3.97, -3.97, -3.97, -2.23, -2.23, -2.23, -2.23, -2.23, -3.97, -3.97, -3.97, -3.97, -3.97, -2.03, -3.03, 4.97, -3.40, 1.60, -2.40, -2.43, -2.43, -3.43, -0.43, -2.43, -3.43, -0.97, -1.97, 1.03, -2.26, -2.26, 0.74, -2.06, -2.06, -0.06, -2.23, 4.77, -0.23, 2.62, 6.42, 1.44, -1.63, -1.77, -1.62, -1.66, -1.66, -1.66, -1.66, -1.66, -1.37, -1.37, -0.37, 2.63, -1.37, -0.37, -2.37, -2.37, -0.37, -2.37, -1.88, -2.88, -2.88, 9.43, 6.43, -2.57, -2.30, -0.30, -0.30, -0.30, -0.30, -2.30, -1.79, 2.21, -2.79, 1.21, -1.79, -0.26, 0.74, -1.26, 2.74, -1.26, -0.77, 1.23, 11.23, 0.23, -0.77, -1.28, -1.28, -4.28, -1.65, -1.65, -2.65, -3.94, -4.94, -3.94, -1.25, -2.25, -0.25, 0.69, -1.31, 0.69, 0.71, -2.29, 0.71, 4.69, 0.69, 0.69, -7.65, -11.65, -2.83, -2.83, -2.83, 0.76, -1.24, 0.76, 6.77, 10.77, 1.77, -2.69, -1.69, 1.31, -2.69, -2.04, -2.04, -0.04, -0.04, -1.04, 6.00, 16.00, 14.00, -1.04, 1.96, -1.04, 0.96, -1.04, -2.69, 0.31, 0.31, 1.31, 4.25, 0.25, -3.75, -2.15, -2.15, -2.15, -2.15, -2.15, -2.15, 1.32, -1.68, -1.68, -2.09, -2.09, -0.09, -1.15, -1.15, -2.15, 0.39, -1.61, 0.39, -0.61, 0.39, -1.37, 4.63, -1.37, -5.14, -3.14, -3.14, -2.29, 1.71, 1.71, -2.44, -2.44, 0.30, 4.30, -1.70, -1.49, -2.49, -2.49, -0.70, -2.70, -2.70, -0.59, -4.59, -3.59, -0.79, -1.79, -1.79, -2.85, -1.85, -2.85, -1.82, -2.82, -2.82, 0.15, -2.85, -1.85, -2.39, -2.39, 0.61, -1.85, -0.85, -1.85, -2.85, -2.85, -1.85, -2.23, -1.23, -2.23, -1.88, 1.12, -2.88, -0.88, -2.88, -1.80, 7.20, -1.80, -0.80, -0.80, -1.24, -2.24, -2.24, -1.24, -2.24, -2.24, 3.96, -2.04, -3.04, -2.41, -2.41, -2.41, -1.61, -0.61, -1.67, -1.67, -0.67, -1.67, -1.67, -2.30, -2.30, -2.30, -2.30, -2.30, -2.30, -2.30, -1.30, -2.30, -2.30, -2.30, -2.30, -2.30, -2.30, -2.30, -2.30, -2.30, -2.30, -2.30, -2.30, -2.53, -2.53, -1.53, -2.53, -2.53, -2.43, -0.43, -2.43, -2.43, -0.43, -2.47, -1.47, -2.47, -3.38, -3.38, -3.38, -1.72, -1.72, -1.72, -2.47, -2.47, -2.47, -2.18, -1.18, -2.18, -5.32, -4.32, -5.32, -1.32, -3.32, -2.28, -1.28, -2.28, -1.28, -1.28, -2.64, -2.64, -2.64, -1.64, -2.64, -1.28, -0.28, 1.72, -1.28, -0.28, -2.28, -2.28, -2.28, -2.28, -0.28, -1.30, -1.30, -0.30, 2.70, -0.30, -0.57, -2.57, -2.57, -1.57, -1.57, 0.97, -0.03, -2.03, 0.97, -0.03, -2.32, -1.32, -2.32, 0.79, -2.21, -2.21, 17.71, -2.29, -0.29, -2.66, -3.66, -3.66, 1.15, 5.15, -1.85, -0.85, 2.15, -1.88, -2.88, -2.88, 0.12, -0.88, 0.49, -1.51, 0.49, -2.51, -1.51, 3.83, -2.17, 1.83, 0.83, -0.17, -1.88, -1.88, -2.88, -2.88, -0.88, 3.75, 7.75, 16.75, 13.75, 0.95, 4.95, 0.95, 12.95, 11.95, -3.93, -2.93, -3.93, -0.93, 1.07, 2.07, 2.40, -0.60, 0.40, 1.95, -1.05, -1.05, 2.49, -2.51, -0.51, 0.39, -0.61, -1.61, 0.57, -3.43, -1.43, 3.11, 3.11, 2.11, -5.91, -5.91, -2.91, -3.63, 4.37, 3.37, -0.56, -1.56, -2.56, -2.30, -2.30, -2.30, 2.20, 0.20, 2.20, -3.07, -0.07, -1.07, -2.40, 4.60, 1.60, -1.85, -2.85, -1.85, -0.85, -2.85, -4.50, 9.50, -3.50, -4.50, -3.50, -4.72, -3.72, -4.72, -4.72, -4.72, 0.93, 16.93, 7.93, 0.39, -1.61, -1.61, -0.31, 1.69, -1.31, -6.34, -3.34, -6.34, -2.07, -3.07, -2.07, -0.34, -2.34, -3.34, -0.55, -0.55, 0.45, 0.61, 5.61, -0.39, -2.43, -1.43, -0.43, -1.69, -1.69, -1.69, -1.69, 1.31, -0.69, 1.79, -1.21, 3.79, -1.58, -1.58, -0.58, -2.33, -2.33, -2.33, -2.33, -2.33, -2.30, -2.30, -2.30, -1.30, -0.30, -0.33, -0.33, -2.33, 2.67, 0.67, 2.68, 1.68, 0.68, -0.14, -2.14, -2.14, -1.99, -1.99, 2.01, -0.32, 1.68, -2.32, -2.23, -2.23, -2.23, -5.91, -3.91, -7.91, -0.52, -2.52, -2.52, -1.52, -0.52, -0.52, -0.26, -2.26, -1.26, -1.26, -0.26, -0.26, -1.26, -2.26, -2.26, -1.61, -1.61, -1.61, -1.76, -1.76, -1.76, -2.25, -2.25, -2.25, -2.25, -2.25, -2.25, -2.51, -2.51, -2.51, -2.25, -2.25, -2.25, -2.25, -2.25, -2.25, -0.38, -2.38, -2.38, -2.40, -2.40, -2.40, -2.27, -2.27, -2.27, -1.88, 12.12, 7.12, -1.88, 0.12, 10.77, 15.77, 13.77, -0.51, -0.51, 4.49, -2.23, -2.23, -0.23, -2.23, -1.23, -1.80, 1.20, 0.20, -1.80, 1.20, -3.94, -1.94, -4.00, -5.00, -5.00, -5.00, -4.00, 1.49, -0.51, 1.49, -2.30, -2.30, -2.30, -2.46, -2.46, -2.46, -2.17, -2.17, -2.17, -1.74, -0.74, 1.26, -1.39, -0.39, -1.39, -3.91, 3.09, -0.91, -2.28, 1.72, 2.72, -2.34, -2.34, -1.34, -0.99, 0.01, -1.99, 3.01, -1.99, -1.99, 0.51, 14.51, 2.51, 0.14, 0.14, 1.14, 0.45, -2.55, 4.45, 4.12, 9.12, 4.12, -1.82, -1.82, -1.82, -1.34, -1.34, -1.34, -1.80, -1.80, -1.80, -2.01, -2.01, -2.01, -1.43, -1.43, -1.43, 6.76, 2.76, 4.76, 21.61, 25.61, -2.25, -2.25, -2.25, -2.45, -0.45, -1.45, -5.19, -5.19, -5.19, -3.84, -2.84, -3.84, -3.73, -3.73, -0.56, 0.44, -0.56, 5.44, 0.44, 0.70, 2.70, 0.70, 4.70, 1.70, 13.70, 2.70, 5.70, 3.70, 4.70, -0.63, -1.63, -1.63, -0.63, 0.37, -2.33, -2.33, -2.33, -2.56, -1.56, -1.56, -2.30, -2.30, -2.30, 1.23, -1.77, -3.77, 2.67, -2.33, 1.67, -3.07, -2.07, -1.07, -2.44, -0.44, -1.44, -3.44, -3.44, -2.44, -2.25, -4.25, -4.25, -3.44, -2.44, -3.44, -4.79, -4.79, -5.79, -2.23, -2.23, -1.23, -2.24, -2.24, -1.24, -2.23, -2.23, -0.23, -1.21, -2.21, -2.21, 1.98, 3.98, 9.98, -2.13, -2.13, -2.13, -1.50, -1.50, -1.50, -2.14, -2.14, -2.14, -1.50, -1.50, -1.50, -2.17, -2.17, -2.17, -4.52, -2.52, -3.52, -2.36, -2.36, -1.36, -3.36, -3.36, -3.36, -3.75, -2.75, -2.75, -3.36, -3.36, -3.36, -3.36, -0.36, -3.36, -1.75, -0.75, 0.25, -2.36, -2.36, -2.36, -3.36, -2.36, -3.36, -1.63, -1.63, -2.63, -1.37, -2.37, -2.37, -0.59, -0.59, 0.41, -2.28, -2.28, -2.28, 0.75, -2.25, -2.25, 1.99, -1.01, 0.99, -0.03, 1.97, 5.97, 0.97, 2.97, -1.97, -0.97, -1.97, 0.03, -1.97, -2.23, -2.23, -2.23, -2.23, -2.23, -1.56, -1.56, -1.56, -1.56, -1.56, -1.99, -0.99, -0.99, 7.19, 7.19, 2.19, 1.19, -0.81, -2.01, -2.01, -2.01, -1.01, -2.01, -1.59, -1.59, -1.59, -0.59, -1.59, -2.53, -0.53, -1.53, -1.53, -2.53, -2.90, 1.10, 4.10, -0.36, 0.64, -1.36, -2.23, -1.23, -0.23, -2.51, -0.51, -2.51, -1.17, -2.17, -3.17, -3.64, -1.64, -3.64, -2.58, -2.58, 0.42, -3.10, -3.10, -3.10, -2.10, -2.10, -2.10, -1.45, -1.45, -2.45, -1.78, -2.78, -2.78, -1.70, -1.70, -2.46, -2.46, -2.46, -0.33, -2.33, -2.33, -2.30, -2.30, -0.30, 0.57, 1.57, 9.57, -2.30, -2.30, -1.30, -2.30, -0.30, 0.70, -2.46, -2.46, -1.46, -2.46, -2.46, -2.46, -2.30, -0.30, -2.30, 1.01, 0.01, 0.01, -2.46, -1.46, -2.46, 7.68, 0.68, 2.68, -2.49, -0.49, -2.49, -2.12, -3.12, 6.88, -2.44, -0.44, 0.56, -4.32, -4.32, -3.32, 3.68, 8.68, -3.32, -1.18, -1.18, -0.18, -2.46, -2.46, -2.46, -1.46, 1.54, -0.82, -1.82, -1.82, -0.82, 0.18, -0.31, -2.31, -1.31, 0.69, 5.69, -3.17, -2.17, -1.17, -2.14, 18.86, -2.14, 1.03, -0.97, -1.97, -0.23, 0.77, -2.23, -2.26, -0.26, -1.26, -1.53, -4.53, -0.53, -1.37, 1.63, -2.37, -2.26, -2.26, -2.26, -0.87, -1.87, -1.87, -2.26, -2.26, -2.26, 2.21, -2.79, 0.21, -1.38, -2.38, -2.38, -2.26, -2.26, -2.26, -1.82, -1.82, -0.82, 0.18, -1.82, -0.61, 1.39, 1.39, 3.39, -0.61, -1.33, -2.33, -1.33, -1.33, -1.33, -2.33, -1.33, -0.33, 0.67, -0.33, -1.57, -0.57, -1.57, -1.76, -1.76, -1.76, -2.25, -2.25, -2.25, -0.98, -1.98, -1.98, -2.23, -2.23, -2.23, -2.25, -2.25, -2.25, -2.25, -2.25, -2.25, -1.98, -1.98, -1.98, -1.24, -2.24, -1.24, -2.25, -2.25, -2.25, -1.79, -1.79, -1.79, -2.01, -2.01, -2.01, -2.28, -2.28, -2.28, 0.72, -2.28, -2.28, 2.72, -2.28, -2.28, -2.24, -3.24, -2.24, -1.28, -2.28, -1.28, -0.85, -2.85, 4.15, -0.78, -1.78, -1.78, 2.24, 1.24, 1.24, -2.01, -2.01, -1.01, -2.51, -2.51, -2.51, -2.01, -2.01, -2.01, -0.85, -2.85, -2.85, -3.70, -3.70, -3.70, -1.68, -1.68, -2.68, -3.28, -3.28, -3.28, -5.44, -1.44, -5.44, -2.33, -2.33, -2.33, -0.90, -1.90, -2.90, 2.10, 1.10, -0.24, 4.76, -1.24, 1.51, 2.51, 0.51, 0.51, -2.49, -1.15, 0.85, -1.15, -1.15, -1.15, -2.15, -2.15, 1.85, 2.85, 2.08, -1.92, 1.08, 10.15, 4.15, 0.15, -1.23, -1.23, -2.23, 3.18, 6.18, 1.18, 17.15, 4.15, 1.15, -0.64, -2.64, -2.64, -0.56, -0.56, -1.56, -2.33, -1.33, 6.67, -2.18, -2.18, -2.18, 0.28, -1.72, 0.28, -2.72, -0.72, -1.01, -1.01, -0.01, 0.24, -0.76, 4.24, -1.63, -0.63, -1.63, 0.67, -1.33, -1.33, -1.33, 0.67, -0.33, -1.03, -2.03, -2.03, 0.93, -5.07, -3.07, 3.84, -1.16, 5.84, 1.27, -2.73, 5.27, 9.03, 1.03, 0.03, 0.79, -1.21, 1.79, 14.77, 7.77, 8.77, -1.99, -0.99, -1.99, -1.80, -1.80, 1.20, -2.33, -0.33, -1.33, -2.05, -1.05, -2.05, -2.85, 0.15, -2.85, -1.55, -2.55, -0.55, 1.77, -2.23, -2.23, -2.24, 5.76, 0.76, 3.76, 6.76, 1.21, 1.21, 3.21, 8.21, 5.21, -4.36, -3.00, 3.28, -1.90, 1.10, 0.10, -2.52, 0.48, -2.52, -2.52, -2.52, -2.52, -2.39, -2.39, -1.39, -2.39, -2.39, -2.39, -0.50, 5.50, 0.50, -2.35, -2.35, -2.35, -2.26, -2.26, -2.26, -3.02, -3.02, -3.02, -2.39, -1.30, -0.30, 0.70, 0.70, -2.30, -1.17, -2.17, -2.17, -3.17, 2.83, -2.41, -2.71, -1.71, -2.71, -3.45, -3.45, -3.45, -3.45, -2.45, -3.45, -2.38, -1.38, -2.38, -3.80, -2.80, -3.80, -2.33, -2.33, -0.33, 3.44, 0.44, -1.56, -1.33, -2.33, -1.33, 2.97, -0.03, 0.97, 0.95, -2.05, 3.95, 0.34, -0.66, -2.63, 2.37, 4.37, -2.91, -2.91, -2.91, -2.23, -3.23, -3.23, 7.20, 16.20, 11.20, -1.98, -1.98, -1.98, -3.28, 4.72, -3.28, -2.12, -2.12, -2.12, -2.91, -2.91, -2.91, -2.70, -1.70, -0.70, -0.85, -0.85, 4.15, 2.55, -2.45, -1.45, 1.97, -0.03, -1.03, 1.62, 0.62, -3.38, 0.07, -0.93, -1.93, -1.27, -2.27, -2.27, -2.27, -2.27, -3.99, -3.99, -3.99, -3.99, -3.99, -1.41, -1.41, -1.41, -2.41, -2.41, 1.59, 0.59, 0.59, 1.59, 0.59, -3.40, -2.40, -4.40, -5.43, 3.57, 7.57, -1.86, -1.86, -1.77, -1.77, -1.77, -0.77, -1.77, -2.25, -2.25, -1.34, -1.34, -1.34, -1.34, -1.34, 4.63, 1.63, -1.37, 1.51, -1.49, -1.49, 4.63, -2.37, -2.37, -1.49, -0.49, -1.49, -5.17, 18.83, 3.83, 4.55, 10.55, 1.55, 19.52, 33.52, 16.52, -1.41, -1.41, -1.41, -1.34, -1.41, -1.41, 2.59, -1.42, -1.42, -1.42, -3.24, -2.24, -3.24, -2.88, -2.88, -2.88, -2.23, -2.23, -2.24, -1.24, 0.23, -1.77, 0.97, -3.03, -2.68, -1.68, -0.68, -2.71, 1.29, 1.29, -1.78, -1.78, -1.78, -2.27, -2.27, -2.27, 3.99, -1.01, -0.01, -2.43, -2.43, -2.43, -2.27, -2.27, -1.78, -1.78, -1.78, -1.33, -2.33, -2.33, -2.33, 1.67, -1.33, -3.37, 4.63, 0.63, 2.12, 1.12, 1.12, 3.44, 2.44, -0.56, -1.56, -0.56, 8.23, -1.77, -1.77, -0.77, -1.77, 2.69, 1.69, 3.69, 6.16, 4.16, 6.16, -0.97, -1.97, -1.97, -1.97, -1.97, 3.51, -2.49, -2.49, -2.49, -2.49, -0.14, -2.14, -1.14, -3.14, -2.14, -0.26, -2.26, -1.26, -2.26, -2.26, -2.22, -4.22, -0.22, -1.99, -1.99, -1.99, -1.23, -1.23, -2.23, 4.45, 2.45, 7.45, -1.85, 1.15, -2.85, -2.23, -1.23, -1.23, -3.88, -3.88, -3.88, 5.12, -0.88, 1.51, -3.49, -3.49, 10.51, 3.51, -3.20, -8.20, -6.20, -1.55, -3.55, -3.55, 0.49, -2.51, -3.51, -2.52, -1.52, -0.52, 0.40, -4.60, -4.60, -3.18, -0.18, 1.18, 12.18, -2.58, -2.58, -1.58, -2.21, -2.21, -2.21, -1.18, -2.18, -2.18, -2.40, -0.40, -3.40, -2.40, -3.40, -2.61, -3.61, -1.61, -2.61, -2.61, 7.18, 1.18, -2.82, 1.18, 3.18, 10.38, 0.38, -2.62, -1.45, 3.55, 3.55, -1.75, -1.75, -1.75, -1.32, -2.32, -2.32, 1.44, -0.56, 0.44, -4.10, -3.10, -3.10, -1.63, -1.63, 2.37, -1.05, -0.05, 2.95, -0.10, -2.10, -2.10, -3.10, -0.56, -2.56, -0.56, -1.56, -2.56, -3.56, -0.56, -1.56, -2.56, -2.01, -2.01, -2.01, -1.80, -1.80, -1.80, -2.26, -2.26, -1.26, 3.34, -1.26, -2.26, -1.26, -1.58, -0.58, -1.58, -0.99, 0.01, 0.01, -1.21, 4.79, -2.21, -0.61, -0.61, -1.61, 16.75, 20.75, 13.75, -1.81, -1.81, -1.81, 6.69, 1.69, 2.69, -3.49, -2.49, -2.49, -3.22, -3.22, -3.22, -3.22, -3.22, -2.30, -2.30, -2.30, -2.30, -2.30, -3.22, -3.22, -3.22, -3.22, -3.22, -0.83, -2.83, -2.83, -2.83, -2.83, 1.76, -2.24, -3.24, -3.24, -2.24, -3.05, -3.05, -3.05, -3.05, -3.05, -1.29, -1.29, -1.29, -2.42, -2.42, -2.42, -0.80, 0.20, 0.20, -1.42, -2.42, -2.42, -4.83, -4.83, -4.83, -2.05, -2.05, -2.05, 1.45, -0.55, 3.45, 5.12, 0.12, 0.12, 0.14, 2.14, 8.14, 2.12, 7.12, 2.12, -2.39, -2.39, -0.39, -1.23, 0.77, -0.23, -1.88, 1.12, -1.88, 0.15, 0.15, -2.85, -0.02, 3.98, 0.98, -1.80, -0.80, -1.80, -1.80, -1.80, -1.02, -2.02, -2.02, -1.02, 0.98, -0.72, 3.28, 3.28, -1.72, 5.28, 2.28, 2.52, 1.52, 0.52, 20.56, 8.56, 5.56, -0.43, -2.43, -0.43, -2.43, -2.43, -2.30, -1.30, -2.30, -2.30, -2.30, -1.33, -2.33, -2.33, -2.33, -2.33, 3.95, 5.95, 2.95, 6.95, 0.95, -1.33, -1.33, -2.33, -2.33, -2.33, -2.01, -2.01, -2.01, 9.41, -1.59, -1.59, -0.55, -3.55, -1.55, -2.28, -2.28, -2.28, -1.78, -1.78, -1.78, -2.28, -2.28, -2.28, -1.78, -1.78, -1.78, -2.05, -2.05, -2.05, -2.60, -2.60, 4.40, -1.82, -1.82, -2.33, -2.33, -2.33, -1.82, -1.82, 1.18, -0.82, -1.82, -2.33, -2.33, -2.33, -2.33, -2.33, -1.33, 4.18, 1.18, 4.18, -2.90, -2.90, 1.10, -1.82, -0.82, 1.18, -2.02, -3.02, 3.98, 3.48, 4.48, 4.48, 0.40, 0.40, 4.40, -0.01, -0.01, -4.01, -3.29, -1.29, -3.29, -3.81, -3.81, -0.81, -1.72, 5.28, 1.28, -1.07, -3.07, -3.07, -3.61, -3.61, -1.61, -1.61, -1.61, -3.61, -2.25, -2.25, -2.25, -1.25, -1.25, -2.25, -3.69, -1.69, -3.69, -1.37, -1.78, -2.37, -2.51, -1.60, -1.62, -1.62, 1.38, -1.66, -1.66, -0.66, 13.77, 15.77, 16.77, -1.66, -0.66, 3.34, 0.34, 2.34, -0.66, -4.48, -2.48, -3.48, -2.12, -2.12, -2.44, -4.44, -4.44, -3.17, 1.83, -3.17, 3.67, 1.67, 5.67, 3.67, 8.67, 3.70, 6.70, 6.70, 0.70, 0.70, -1.88, -2.88, -1.88, 0.12, -2.88, -0.64, -1.64, -0.64, 0.36, -2.64, -4.83, -2.83, -2.83, -3.83, 0.18, -1.82, -1.82, -1.82, -1.82, -0.60, -2.60, -1.60, -1.60, -0.60, -2.05, -2.05, -2.05, -2.05, -2.05, 1.41, 1.41, -0.59, 4.41, 4.41, -1.59, -1.59, -1.59, -1.59, -0.59, -0.50, -0.50, -0.50, -1.50, 0.50, 3.34, 0.34, -0.66, -2.66, -2.66, -1.40, -3.40, -3.40, -1.02, -3.02, -2.02, -2.02, -1.02, -1.02, -0.86, -2.86, -2.86, -3.86, -3.86, -3.86, -1.26, -0.26, -1.26, -0.26, 0.74, 1.23, -0.77, -0.77, 1.23, -0.77, 0.23, -1.77, 0.23, -0.77, 0.23, -0.83, -2.83, -1.83, -0.83, -0.83, -2.36, -2.36, 0.64, -0.59, -0.59, 2.41, 5.29, -1.71, -1.71, 1.61, -1.39, -1.39, -1.59, -1.59, -1.59, 2.03, 6.03, -1.97, -1.97, -1.97, 0.37, -4.63, -4.63, -4.63, -4.63, -2.53, -3.53, -3.53, -1.53, -3.53, -1.31, 0.69, 1.69, 1.79, -1.21, 0.79, 11.15, 11.15, 15.15, 12.39, -0.61, -1.61, -1.82, -1.82, 1.18, 1.68, -1.32, 3.68, -0.61, 0.39, 1.39, 1.61, 1.61, -2.39, -1.00, -3.00, 0.00, -2.55, -0.55, -2.55, -1.01, -2.01, -2.01, 12.04, 5.04, 6.04, -2.74, -1.74, 1.26, 1.39, 0.39, 0.39, -2.88, 0.12, -1.88, -0.97, -2.97, -1.97, 1.12, 0.12, -1.88, -2.18, -0.18, 0.82, 0.30, -3.70, -1.70, -1.04, -2.04, -1.04, -3.74, 0.26, -0.74, -3.30, 5.70, 4.70, -2.82, 3.18, 0.18, -1.85, -2.85, -0.85, -2.26, -2.26, 1.42, 2.42, 0.42, -1.99, -1.99, -1.99, -1.99, -1.99, -1.99, -1.99, -3.74, -3.74, -3.74, -3.74, -3.74, -3.74, -2.23, -2.23, -0.23, 1.18, -2.82, -2.82, 2.18, 1.18, 0.18, -1.99, -1.99, -1.99, -3.46, 11.54, 11.54, 12.54, 6.54, -1.85, -2.85, -0.85, -2.85, -1.85, -3.44, -2.44, 4.56, -3.44, -3.44, -3.44, -0.44, 3.56, 1.56, 0.56, -3.44, 1.56, -3.44, -1.44, -2.44, -1.69, -1.69, -2.69, -0.69, -0.69, -2.44, -3.44, -3.44, -3.44, -2.44, -3.44, -3.44, -3.44, -0.44, -2.44, -2.23, 1.77, -2.23, -0.75, 1.25, 2.25, 4.25, 3.25, 0.25, -3.03, -0.03, 1.97, -5.44, -5.44, -1.44, -1.44, 0.56, -0.44, -1.58, -1.58, -1.58, -1.58, -1.58, -1.58, -1.58, -1.58, -1.58, -1.58, -2.94, -2.94, -2.94, -2.94, -2.94, -2.26, -2.26, -2.26, -2.26, -2.26, -2.90, -2.90, -2.90, -1.90, 1.10, -2.42, -2.42, -2.42, -1.63, -1.63, -3.63, -1.00, -2.00, -3.00, -3.00, -3.00, -3.00, -3.00, -3.00, -3.00, -2.85, -2.85, -2.85, -2.85, -1.85, -2.85, -1.85, -1.85, -1.85, -2.85, -2.74, -1.74, -2.74, 0.77, -0.23, 4.77, 8.12, 4.12, -2.88, -0.88, 0.12, 1.74, 2.74, 1.74, 3.74, -2.26, -1.63, -1.63, -1.63, -1.63, -1.63, -1.29, -1.29, -1.29, -1.29, -1.29, -1.84, -1.84, 0.16, -1.84, -1.84, -2.70, -2.70, -2.70, -0.33, -2.33, -2.33, -2.33, -1.33, 1.74, 4.74, 10.74, 4.74, 6.74, -2.05, -3.05, -3.05, -3.05, -3.05, -3.46, -0.46, -3.46, 2.14, 5.14, 9.14, -2.26, -1.26, -2.26, -3.40, -3.40, -3.40, -2.71, -2.71, -1.71, -1.30, -2.30, -2.30, -2.79, -3.79, -7.79, -3.33, -2.33, -2.33, -0.33, -1.33, 0.67, -1.76, -1.76, 0.24, 0.66, 0.66, -1.34, 0.00, -3.00, -3.00, -0.60, -2.60, -2.60, -1.33, -0.33, -2.33, 1.37, -1.63, 4.37, 1.32, -0.68, -1.68, -2.31, -1.31, -2.31, -2.35, -2.35, -1.35, -0.05, -2.05, -1.05, -1.82, -0.82, -1.82, -2.30, -2.30, -1.30, -1.35, -0.35, -0.35, -2.35, -1.35, 3.65, -1.52, -1.52, -1.52, -2.33, -2.33, -2.33, -2.33, -2.33, -1.26, -2.26, -2.26, -2.26, -2.26, -2.94, -2.94, -2.94, -2.94, 1.06, -1.82, -1.82, -0.82, -1.82, -1.82, -1.82, 0.70, -0.30, -0.30, -1.30, -0.30, -2.26, -2.26, -2.26, -2.26, -2.26, 2.33, -1.67, -1.67, -1.67, -0.67, -3.71, -3.71, -3.71, -3.71, -3.71, -5.24, -5.24, -5.24, -1.24, 3.76, -2.26, -2.26, -2.26, -2.22, -2.22, 9.78, -2.01, -2.01, -0.01, 0.12, 6.12, 3.12, 0.12, 1.12, 1.12, -2.88, 2.12, -2.33, -1.33, -2.33, -1.99, -1.99, -1.99, -1.99, -1.99, 4.53, -1.47, -1.47, -1.47, -2.17, -2.17, -2.17, -2.00, 1.00, -1.00, 1.78, -0.22, 0.78, -2.39, -2.39, -2.39, -2.39, -0.17, -2.17, -2.17, 0.12, -1.88, -2.88, -2.37, -2.37, -2.37, 4.00, 0.00, 2.00, 1.00, 1.46, 4.46, -2.54, 9.74, 0.74, -2.26, -2.26, -2.26, -2.26, 0.65, -1.35, -2.35, 2.53, -0.47, -1.47, 2.53, -0.26, -2.26, -0.26, 5.65, -0.35, 2.65, -1.35, -0.98, 3.02, 0.02, -1.71, -1.71, 0.29, -1.71, 1.29, -3.71, -0.71, -2.71, 11.64, 1.64, -1.36, -1.92, -1.92, -1.92, -2.35, -1.35, -2.35, -2.36, -2.36, -2.36, -2.36, -2.36, -2.36, -2.36, -2.36, -2.36, -2.36, -2.36, -2.36, 0.67, 0.67, -1.33, -3.00, -3.00, -3.00, 1.74, -0.26, 1.74, 17.66, 18.66, 25.66, -3.56, 4.44, 4.44, -1.96, -1.96, -2.96, -4.18, 1.82, 0.82, -1.62, -1.62, -1.62, -2.88, -2.88, -2.88, 0.00, -3.00, -3.00, -1.40, -3.40, -2.40, -2.54, -2.54, -0.54, -1.01, -2.01, -2.01, -1.54, -1.54, -0.54, -5.28, -5.28, -5.28, -2.35, -2.35, -2.35, -1.26, -2.26, -1.26, -1.30, -2.30, -0.30, -3.46, -2.46, -1.46, -0.26, -1.26, -2.26, -2.39, -2.39, -2.39, 10.12, 8.12, 9.12, 7.63, 7.63, 3.63, -2.71, -3.71, -1.71, 8.67, 4.67, 1.67, 2.12, -0.88, -0.88, -0.83, -2.83, -2.83, 5.04, 2.04, 0.04, -1.78, -1.78, 0.22, -2.28, -2.28, -2.28, -2.32, -0.32, -2.32, -0.58, 2.42, 1.42, 5.67, 4.67, -2.33, -1.29, 1.71, -1.50, -2.50, -3.50, -1.78, -1.78, 0.22, -2.37, -2.37, -2.37, -2.28, -2.28, -1.28, 2.37, -0.63, -1.63, -2.28, -2.28, -1.28, 1.40, -3.60, 2.40, 5.67, 1.67, -0.33, -0.23, -2.23, -2.23, 8.39, 5.39, -2.61, 17.66, 12.66, 9.66, -2.37, -2.37, -2.37, -1.37, -2.37, -2.37, 22.65, 13.65, 0.00, 5.00, -2.36, -2.36, -1.87, -1.87, 3.00, -2.35, -2.35, -2.37, -0.37, -2.37, 6.00, 0.00, -1.00, -2.00, -3.00, -3.00, -3.00, -3.00, -0.35, -1.35, 11.63, 11.63, 11.63, -1.26, -1.26, -2.26, -2.35, -1.35, 2.68, -2.32, 5.53, 1.53, 12.00, 3.00, -1.92, -1.92, 13.63, -2.37, 0.65, -2.35, -2.35, 6.64, -2.36, -0.35, -2.35, 8.38, -1.62, -2.26, -2.26, 4.26, 6.26, 3.39, 3.29, -2.71, -2.58, 18.58, -2.36, -0.54, 2.58, 5.58, 5.65, 8.00, -3.59, 3.00, 17.00, -0.44, -1.44, 1.11, -2.35, 2.58, -2.42, -1.36, -2.42, -1.63, -3.63, 5.56, 5.58, 3.58 diff --git a/shared/package-files/38/3893331f00aeb23d056bea8847de1b3554ae2094dc2f9ca8b9a801eb2465f1ae/pylowering.py b/shared/package-files/38/3893331f00aeb23d056bea8847de1b3554ae2094dc2f9ca8b9a801eb2465f1ae/pylowering.py new file mode 100644 index 0000000000000000000000000000000000000000..ca09fe3701041a74e5d9d716372ccba70b2a9330 --- /dev/null +++ b/shared/package-files/38/3893331f00aeb23d056bea8847de1b3554ae2094dc2f9ca8b9a801eb2465f1ae/pylowering.py @@ -0,0 +1,672 @@ +""" +Lowering implementation for object mode. +""" + + +import builtins +import operator +import inspect +from functools import cached_property + +import llvmlite.ir + +from numba.core import types, utils, ir, generators, cgutils +from numba.core.errors import (ForbiddenConstruct, LoweringError, + NumbaNotImplementedError) +from numba.core.lowering import BaseLower + + +# Issue #475: locals() is unsupported as calling it naively would give +# out wrong results. +_unsupported_builtins = set([locals]) + + +class _Undefined: + """ + A sentinel value for undefined variable created by Expr.undef. + """ + def __repr__(self): + return "" + + +_UNDEFINED = _Undefined() + + +# Map operators to methods on the PythonAPI class +PYTHON_BINOPMAP = { + operator.add: ("number_add", False), + operator.sub: ("number_subtract", False), + operator.mul: ("number_multiply", False), + operator.truediv: ("number_truedivide", False), + operator.floordiv: ("number_floordivide", False), + operator.mod: ("number_remainder", False), + operator.pow: ("number_power", False), + operator.lshift: ("number_lshift", False), + operator.rshift: ("number_rshift", False), + operator.and_: ("number_and", False), + operator.or_: ("number_or", False), + operator.xor: ("number_xor", False), + # inplace operators + operator.iadd: ("number_add", True), + operator.isub: ("number_subtract", True), + operator.imul: ("number_multiply", True), + operator.itruediv: ("number_truedivide", True), + operator.ifloordiv: ("number_floordivide", True), + operator.imod: ("number_remainder", True), + operator.ipow: ("number_power", True), + operator.ilshift: ("number_lshift", True), + operator.irshift: ("number_rshift", True), + operator.iand: ("number_and", True), + operator.ior: ("number_or", True), + operator.ixor: ("number_xor", True), +} + +PYTHON_BINOPMAP[operator.matmul] = ("number_matrix_multiply", False) +PYTHON_BINOPMAP[operator.imatmul] = ("number_matrix_multiply", True) + +PYTHON_COMPAREOPMAP = { + operator.eq: '==', + operator.ne: '!=', + operator.lt: '<', + operator.le: '<=', + operator.gt: '>', + operator.ge: '>=', + operator.is_: 'is', + operator.is_not: 'is not', + operator.contains: 'in' +} + +class PyLower(BaseLower): + + GeneratorLower = generators.PyGeneratorLower + + def init(self): + # Strings to be frozen into the Environment object + self._frozen_strings = set() + + self._live_vars = set() + + def pre_lower(self): + super(PyLower, self).pre_lower() + self.init_pyapi() + + def post_lower(self): + pass + + def pre_block(self, block): + self.init_vars(block) + + def lower_inst(self, inst): + if isinstance(inst, ir.Assign): + value = self.lower_assign(inst) + self.storevar(value, inst.target.name) + + elif isinstance(inst, ir.SetItem): + target = self.loadvar(inst.target.name) + index = self.loadvar(inst.index.name) + value = self.loadvar(inst.value.name) + ok = self.pyapi.object_setitem(target, index, value) + self.check_int_status(ok) + + elif isinstance(inst, ir.DelItem): + target = self.loadvar(inst.target.name) + index = self.loadvar(inst.index.name) + ok = self.pyapi.object_delitem(target, index) + self.check_int_status(ok) + + elif isinstance(inst, ir.SetAttr): + target = self.loadvar(inst.target.name) + value = self.loadvar(inst.value.name) + ok = self.pyapi.object_setattr(target, + self._freeze_string(inst.attr), + value) + self.check_int_status(ok) + + elif isinstance(inst, ir.DelAttr): + target = self.loadvar(inst.target.name) + ok = self.pyapi.object_delattr(target, + self._freeze_string(inst.attr)) + self.check_int_status(ok) + + elif isinstance(inst, ir.StoreMap): + dct = self.loadvar(inst.dct.name) + key = self.loadvar(inst.key.name) + value = self.loadvar(inst.value.name) + ok = self.pyapi.dict_setitem(dct, key, value) + self.check_int_status(ok) + + elif isinstance(inst, ir.Return): + retval = self.loadvar(inst.value.name) + if self.generator_info: + # StopIteration + # We own a reference to the "return value", but we + # don't return it. + self.pyapi.decref(retval) + self.genlower.return_from_generator(self) + return + # No need to incref() as the reference is already owned. + self.call_conv.return_value(self.builder, retval) + + elif isinstance(inst, ir.Branch): + cond = self.loadvar(inst.cond.name) + if cond.type == llvmlite.ir.IntType(1): + istrue = cond + else: + istrue = self.pyapi.object_istrue(cond) + zero = llvmlite.ir.Constant(istrue.type, None) + pred = self.builder.icmp_unsigned('!=', istrue, zero) + tr = self.blkmap[inst.truebr] + fl = self.blkmap[inst.falsebr] + self.builder.cbranch(pred, tr, fl) + + elif isinstance(inst, ir.Jump): + target = self.blkmap[inst.target] + self.builder.branch(target) + + elif isinstance(inst, ir.Del): + self.delvar(inst.value) + + elif isinstance(inst, ir.PopBlock): + pass # this is just a marker + + elif isinstance(inst, ir.Raise): + if inst.exception is not None: + exc = self.loadvar(inst.exception.name) + # A reference will be stolen by raise_object() and another + # by return_exception_raised(). + self.incref(exc) + else: + exc = None + self.pyapi.raise_object(exc) + self.return_exception_raised() + + else: + msg = f"{type(inst)}, {inst}" + raise NumbaNotImplementedError(msg) + + @cached_property + def _omitted_typobj(self): + """Return a `OmittedArg` type instance as a LLVM value suitable for + testing at runtime. + """ + from numba.core.dispatcher import OmittedArg + return self.pyapi.unserialize( + self.pyapi.serialize_object(OmittedArg)) + + def lower_assign(self, inst): + """ + The returned object must have a new reference + """ + value = inst.value + if isinstance(value, (ir.Const, ir.FreeVar)): + return self.lower_const(value.value) + elif isinstance(value, ir.Var): + val = self.loadvar(value.name) + self.incref(val) + return val + elif isinstance(value, ir.Expr): + return self.lower_expr(value) + elif isinstance(value, ir.Global): + return self.lower_global(value.name, value.value) + elif isinstance(value, ir.Yield): + return self.lower_yield(value) + elif isinstance(value, ir.Arg): + param = self.func_ir.func_id.pysig.parameters.get(value.name) + + obj = self.fnargs[value.index] + slot = cgutils.alloca_once_value(self.builder, obj) + # Don't check for OmittedArg unless the argument has a default + if param is not None and param.default is inspect.Parameter.empty: + self.incref(obj) + self.builder.store(obj, slot) + else: + # When an argument is omitted, the dispatcher hands it as + # _OmittedArg() + typobj = self.pyapi.get_type(obj) + is_omitted = self.builder.icmp_unsigned('==', typobj, + self._omitted_typobj) + with self.builder.if_else(is_omitted, likely=False) as (omitted, present): + with present: + self.incref(obj) + self.builder.store(obj, slot) + with omitted: + # The argument is omitted => get the default value + obj = self.pyapi.object_getattr_string(obj, 'value') + self.builder.store(obj, slot) + + return self.builder.load(slot) + else: + raise NotImplementedError(type(value), value) + + def lower_yield(self, inst): + yp = self.generator_info.yield_points[inst.index] + assert yp.inst is inst + self.genlower.init_generator_state(self) + + # Save live vars in state + # We also need to save live vars that are del'ed afterwards. + y = generators.LowerYield(self, yp, yp.live_vars | yp.weak_live_vars) + y.lower_yield_suspend() + # Yield to caller + val = self.loadvar(inst.value.name) + # Let caller own the reference + self.pyapi.incref(val) + self.call_conv.return_value(self.builder, val) + + # Resumption point + y.lower_yield_resume() + # None is returned by the yield expression + return self.pyapi.make_none() + + def lower_binop(self, expr, op, inplace=False): + lhs = self.loadvar(expr.lhs.name) + rhs = self.loadvar(expr.rhs.name) + assert not isinstance(op, str) + if op in PYTHON_BINOPMAP: + fname, inplace = PYTHON_BINOPMAP[op] + fn = getattr(self.pyapi, fname) + res = fn(lhs, rhs, inplace=inplace) + else: + # Assumed to be rich comparison + fn = PYTHON_COMPAREOPMAP.get(expr.fn, expr.fn) + if fn == 'in': # 'in' and operator.contains have args reversed + lhs, rhs = rhs, lhs + res = self.pyapi.object_richcompare(lhs, rhs, fn) + self.check_error(res) + return res + + def lower_expr(self, expr): + if expr.op == 'binop': + return self.lower_binop(expr, expr.fn, inplace=False) + elif expr.op == 'inplace_binop': + return self.lower_binop(expr, expr.fn, inplace=True) + elif expr.op == 'unary': + value = self.loadvar(expr.value.name) + if expr.fn == operator.neg: + res = self.pyapi.number_negative(value) + elif expr.fn == operator.pos: + res = self.pyapi.number_positive(value) + elif expr.fn == operator.not_: + res = self.pyapi.object_not(value) + self.check_int_status(res) + res = self.pyapi.bool_from_bool(res) + elif expr.fn == operator.invert: + res = self.pyapi.number_invert(value) + else: + raise NotImplementedError(expr) + self.check_error(res) + return res + elif expr.op == 'call': + argvals = [self.loadvar(a.name) for a in expr.args] + fn = self.loadvar(expr.func.name) + args = self.pyapi.tuple_pack(argvals) + if expr.vararg: + # Expand *args + varargs = self.pyapi.sequence_tuple( + self.loadvar(expr.vararg.name)) + new_args = self.pyapi.sequence_concat(args, varargs) + self.decref(varargs) + self.decref(args) + args = new_args + if not expr.kws: + # No named arguments + ret = self.pyapi.call(fn, args, None) + else: + # Named arguments + keyvalues = [(k, self.loadvar(v.name)) for k, v in expr.kws] + kws = self.pyapi.dict_pack(keyvalues) + ret = self.pyapi.call(fn, args, kws) + self.decref(kws) + self.decref(args) + self.check_error(ret) + return ret + elif expr.op == 'getattr': + obj = self.loadvar(expr.value.name) + res = self.pyapi.object_getattr(obj, self._freeze_string(expr.attr)) + self.check_error(res) + return res + elif expr.op == 'build_tuple': + items = [self.loadvar(it.name) for it in expr.items] + res = self.pyapi.tuple_pack(items) + self.check_error(res) + return res + elif expr.op == 'build_list': + items = [self.loadvar(it.name) for it in expr.items] + res = self.pyapi.list_pack(items) + self.check_error(res) + return res + elif expr.op == 'build_map': + res = self.pyapi.dict_new(expr.size) + self.check_error(res) + for k, v in expr.items: + key = self.loadvar(k.name) + value = self.loadvar(v.name) + ok = self.pyapi.dict_setitem(res, key, value) + self.check_int_status(ok) + return res + elif expr.op == 'build_set': + items = [self.loadvar(it.name) for it in expr.items] + res = self.pyapi.set_new() + self.check_error(res) + for it in items: + ok = self.pyapi.set_add(res, it) + self.check_int_status(ok) + return res + elif expr.op == 'getiter': + obj = self.loadvar(expr.value.name) + res = self.pyapi.object_getiter(obj) + self.check_error(res) + return res + elif expr.op == 'iternext': + iterobj = self.loadvar(expr.value.name) + item = self.pyapi.iter_next(iterobj) + is_valid = cgutils.is_not_null(self.builder, item) + pair = self.pyapi.tuple_new(2) + with self.builder.if_else(is_valid) as (then, otherwise): + with then: + self.pyapi.tuple_setitem(pair, 0, item) + with otherwise: + self.check_occurred() + # Make the tuple valid by inserting None as dummy + # iteration "result" (it will be ignored). + self.pyapi.tuple_setitem(pair, 0, self.pyapi.make_none()) + self.pyapi.tuple_setitem(pair, 1, self.pyapi.bool_from_bool(is_valid)) + return pair + elif expr.op == 'pair_first': + pair = self.loadvar(expr.value.name) + first = self.pyapi.tuple_getitem(pair, 0) + self.incref(first) + return first + elif expr.op == 'pair_second': + pair = self.loadvar(expr.value.name) + second = self.pyapi.tuple_getitem(pair, 1) + self.incref(second) + return second + elif expr.op == 'exhaust_iter': + iterobj = self.loadvar(expr.value.name) + tup = self.pyapi.sequence_tuple(iterobj) + self.check_error(tup) + # Check tuple size is as expected + tup_size = self.pyapi.tuple_size(tup) + expected_size = self.context.get_constant(types.intp, expr.count) + has_wrong_size = self.builder.icmp_unsigned('!=', + tup_size, expected_size) + with cgutils.if_unlikely(self.builder, has_wrong_size): + self.return_exception(ValueError) + return tup + elif expr.op == 'getitem': + value = self.loadvar(expr.value.name) + index = self.loadvar(expr.index.name) + res = self.pyapi.object_getitem(value, index) + self.check_error(res) + return res + elif expr.op == 'static_getitem': + value = self.loadvar(expr.value.name) + index = self.context.get_constant(types.intp, expr.index) + indexobj = self.pyapi.long_from_ssize_t(index) + self.check_error(indexobj) + res = self.pyapi.object_getitem(value, indexobj) + self.decref(indexobj) + self.check_error(res) + return res + elif expr.op == 'getslice': + target = self.loadvar(expr.target.name) + start = self.loadvar(expr.start.name) + stop = self.loadvar(expr.stop.name) + + slicefn = self.get_builtin_obj("slice") + sliceobj = self.pyapi.call_function_objargs(slicefn, (start, stop)) + self.decref(slicefn) + self.check_error(sliceobj) + + res = self.pyapi.object_getitem(target, sliceobj) + self.check_error(res) + + return res + + elif expr.op == 'cast': + val = self.loadvar(expr.value.name) + self.incref(val) + return val + elif expr.op == 'phi': + raise LoweringError("PHI not stripped") + + elif expr.op == 'null': + # Make null value + return cgutils.get_null_value(self.pyapi.pyobj) + + elif expr.op == 'undef': + # Use a sentinel value for undefined variable + return self.lower_const(_UNDEFINED) + + else: + raise NotImplementedError(expr) + + def lower_const(self, const): + # All constants are frozen inside the environment + index = self.env_manager.add_const(const) + ret = self.env_manager.read_const(index) + self.check_error(ret) + self.incref(ret) + return ret + + def lower_global(self, name, value): + """ + 1) Check global scope dictionary. + 2) Check __builtins__. + 2a) is it a dictionary (for non __main__ module) + 2b) is it a module (for __main__ module) + """ + moddict = self.get_module_dict() + obj = self.pyapi.dict_getitem(moddict, self._freeze_string(name)) + self.incref(obj) # obj is borrowed + + try: + if value in _unsupported_builtins: + raise ForbiddenConstruct("builtins %s() is not supported" + % name, loc=self.loc) + except TypeError: + # `value` is unhashable, ignore + pass + + if hasattr(builtins, name): + obj_is_null = self.is_null(obj) + bbelse = self.builder.basic_block + + with self.builder.if_then(obj_is_null): + mod = self.pyapi.dict_getitem(moddict, + self._freeze_string("__builtins__")) + builtin = self.builtin_lookup(mod, name) + bbif = self.builder.basic_block + + retval = self.builder.phi(self.pyapi.pyobj) + retval.add_incoming(obj, bbelse) + retval.add_incoming(builtin, bbif) + + else: + retval = obj + with cgutils.if_unlikely(self.builder, self.is_null(retval)): + self.pyapi.raise_missing_global_error(name) + self.return_exception_raised() + + return retval + + # ------------------------------------------------------------------------- + + def get_module_dict(self): + return self.env_body.globals + + def get_builtin_obj(self, name): + # XXX The builtins dict could be bound into the environment + moddict = self.get_module_dict() + mod = self.pyapi.dict_getitem(moddict, + self._freeze_string("__builtins__")) + return self.builtin_lookup(mod, name) + + def builtin_lookup(self, mod, name): + """ + Args + ---- + mod: + The __builtins__ dictionary or module, as looked up in + a module's globals. + name: str + The object to lookup + """ + fromdict = self.pyapi.dict_getitem(mod, self._freeze_string(name)) + self.incref(fromdict) # fromdict is borrowed + bbifdict = self.builder.basic_block + + with cgutils.if_unlikely(self.builder, self.is_null(fromdict)): + # This happen if we are using the __main__ module + frommod = self.pyapi.object_getattr(mod, self._freeze_string(name)) + + with cgutils.if_unlikely(self.builder, self.is_null(frommod)): + self.pyapi.raise_missing_global_error(name) + self.return_exception_raised() + + bbifmod = self.builder.basic_block + + builtin = self.builder.phi(self.pyapi.pyobj) + builtin.add_incoming(fromdict, bbifdict) + builtin.add_incoming(frommod, bbifmod) + + return builtin + + def check_occurred(self): + """ + Return if an exception occurred. + """ + err_occurred = cgutils.is_not_null(self.builder, + self.pyapi.err_occurred()) + + with cgutils.if_unlikely(self.builder, err_occurred): + self.return_exception_raised() + + def check_error(self, obj): + """ + Return if *obj* is NULL. + """ + with cgutils.if_unlikely(self.builder, self.is_null(obj)): + self.return_exception_raised() + + return obj + + def check_int_status(self, num, ok_value=0): + """ + Raise an exception if *num* is smaller than *ok_value*. + """ + ok = llvmlite.ir.Constant(num.type, ok_value) + pred = self.builder.icmp_signed('<', num, ok) + with cgutils.if_unlikely(self.builder, pred): + self.return_exception_raised() + + def is_null(self, obj): + return cgutils.is_null(self.builder, obj) + + def return_exception_raised(self): + """ + Return with the currently raised exception. + """ + self.cleanup_vars() + self.call_conv.return_exc(self.builder) + + def init_vars(self, block): + """ + Initialize live variables for *block*. + """ + self._live_vars = set(self.func_ir.get_block_entry_vars(block)) + + def _getvar(self, name, ltype=None): + if name not in self.varmap: + self.varmap[name] = self.alloca(name, ltype=ltype) + return self.varmap[name] + + def loadvar(self, name): + """ + Load the llvm value of the variable named *name*. + """ + # If this raises then the live variables analysis is wrong + assert name in self._live_vars, name + ptr = self.varmap[name] + val = self.builder.load(ptr) + with cgutils.if_unlikely(self.builder, self.is_null(val)): + self.pyapi.raise_missing_name_error(name) + self.return_exception_raised() + return val + + def delvar(self, name): + """ + Delete the variable slot with the given name. This will decref + the corresponding Python object. + """ + # If this raises then the live variables analysis is wrong + self._live_vars.remove(name) + ptr = self._getvar(name) # initializes `name` if not already + self.decref(self.builder.load(ptr)) + # This is a safety guard against double decref's, but really + # the IR should be correct and have only one Del per variable + # and code path. + self.builder.store(cgutils.get_null_value(ptr.type.pointee), ptr) + + def storevar(self, value, name, clobber=False): + """ + Stores a llvm value and allocate stack slot if necessary. + The llvm value can be of arbitrary type. + """ + is_redefine = name in self._live_vars and not clobber + ptr = self._getvar(name, ltype=value.type) + if is_redefine: + old = self.builder.load(ptr) + else: + self._live_vars.add(name) + assert value.type == ptr.type.pointee, (str(value.type), + str(ptr.type.pointee)) + self.builder.store(value, ptr) + # Safe to call decref even on non python object + if is_redefine: + self.decref(old) + + def cleanup_vars(self): + """ + Cleanup live variables. + """ + for name in self._live_vars: + ptr = self._getvar(name) + self.decref(self.builder.load(ptr)) + + def alloca(self, name, ltype=None): + """ + Allocate a stack slot and initialize it to NULL. + The default is to allocate a pyobject pointer. + Use ``ltype`` to override. + """ + if ltype is None: + ltype = self.context.get_value_type(types.pyobject) + with self.builder.goto_block(self.entry_block): + ptr = self.builder.alloca(ltype, name=name) + self.builder.store(cgutils.get_null_value(ltype), ptr) + return ptr + + def _alloca_var(self, name, fetype): + # This is here for API compatibility with lowering.py::Lower. + # NOTE: fetype is unused + return self.alloca(name) + + def incref(self, value): + self.pyapi.incref(value) + + def decref(self, value): + """ + This is allow to be called on non pyobject pointer, in which case + no code is inserted. + """ + lpyobj = self.context.get_value_type(types.pyobject) + if value.type == lpyobj: + self.pyapi.decref(value) + + def _freeze_string(self, string): + """ + Freeze a Python string object into the code. + """ + return self.lower_const(string) diff --git a/shared/package-files/38/389c55520d8d6b0590e260a06f1d6b21ba27491f330c5c468548cc34b8fe333e/max_pool3d_with_indices_cuda_dispatch.h b/shared/package-files/38/389c55520d8d6b0590e260a06f1d6b21ba27491f330c5c468548cc34b8fe333e/max_pool3d_with_indices_cuda_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..597459df1e8d0099a79baaab8e3bb01040d3ef34 --- /dev/null +++ b/shared/package-files/38/389c55520d8d6b0590e260a06f1d6b21ba27491f330c5c468548cc34b8fe333e/max_pool3d_with_indices_cuda_dispatch.h @@ -0,0 +1,25 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API ::std::tuple max_pool3d_with_indices(const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride={}, at::IntArrayRef padding=0, at::IntArrayRef dilation=1, bool ceil_mode=false); +TORCH_API ::std::tuple max_pool3d_with_indices_out(at::Tensor & out, at::Tensor & indices, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride={}, at::IntArrayRef padding=0, at::IntArrayRef dilation=1, bool ceil_mode=false); +TORCH_API ::std::tuple max_pool3d_with_indices_outf(const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, bool ceil_mode, at::Tensor & out, at::Tensor & indices); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/38/38a9d6102cfbda8b5ba70e94652cd92191c95c25c66fd22c3e2148fa5df03836/vector.h b/shared/package-files/38/38a9d6102cfbda8b5ba70e94652cd92191c95c25c66fd22c3e2148fa5df03836/vector.h new file mode 100644 index 0000000000000000000000000000000000000000..809497b9aedb2fa4cc383f3f313a5c37ebdc2486 --- /dev/null +++ b/shared/package-files/38/38a9d6102cfbda8b5ba70e94652cd92191c95c25c66fd22c3e2148fa5df03836/vector.h @@ -0,0 +1,171 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include +#include +#include + +#include "arrow/result.h" +#include "arrow/util/algorithm.h" +#include "arrow/util/functional.h" +#include "arrow/util/logging.h" + +namespace arrow { +namespace internal { + +template +std::vector DeleteVectorElement(const std::vector& values, size_t index) { + ARROW_DCHECK(!values.empty()); + ARROW_DCHECK_LT(index, values.size()); + std::vector out; + out.reserve(values.size() - 1); + for (size_t i = 0; i < index; ++i) { + out.push_back(values[i]); + } + for (size_t i = index + 1; i < values.size(); ++i) { + out.push_back(values[i]); + } + return out; +} + +template +std::vector AddVectorElement(const std::vector& values, size_t index, + T new_element) { + ARROW_DCHECK_LE(index, values.size()); + std::vector out; + out.reserve(values.size() + 1); + for (size_t i = 0; i < index; ++i) { + out.push_back(values[i]); + } + out.emplace_back(std::move(new_element)); + for (size_t i = index; i < values.size(); ++i) { + out.push_back(values[i]); + } + return out; +} + +template +std::vector ReplaceVectorElement(const std::vector& values, size_t index, + T new_element) { + ARROW_DCHECK_LE(index, values.size()); + std::vector out; + out.reserve(values.size()); + for (size_t i = 0; i < index; ++i) { + out.push_back(values[i]); + } + out.emplace_back(std::move(new_element)); + for (size_t i = index + 1; i < values.size(); ++i) { + out.push_back(values[i]); + } + return out; +} + +template +std::vector FilterVector(std::vector values, Predicate&& predicate) { + auto new_end = std::remove_if(values.begin(), values.end(), + [&](const T& value) { return !predicate(value); }); + values.erase(new_end, values.end()); + return values; +} + +template ()(std::declval()))> +std::vector MapVector(Fn&& map, const std::vector& source) { + std::vector out; + out.reserve(source.size()); + std::transform(source.begin(), source.end(), std::back_inserter(out), + std::forward(map)); + return out; +} + +template ()(std::declval()))> +std::vector MapVector(Fn&& map, std::vector&& source) { + std::vector out; + out.reserve(source.size()); + std::transform(std::make_move_iterator(source.begin()), + std::make_move_iterator(source.end()), std::back_inserter(out), + std::forward(map)); + return out; +} + +/// \brief Like MapVector, but where the function can fail. +template , + typename To = typename internal::call_traits::return_type::ValueType> +Result> MaybeMapVector(Fn&& map, const std::vector& source) { + std::vector out; + out.reserve(source.size()); + ARROW_RETURN_NOT_OK(MaybeTransform(source.begin(), source.end(), + std::back_inserter(out), std::forward(map))); + return out; +} + +template , + typename To = typename internal::call_traits::return_type::ValueType> +Result> MaybeMapVector(Fn&& map, std::vector&& source) { + std::vector out; + out.reserve(source.size()); + ARROW_RETURN_NOT_OK(MaybeTransform(std::make_move_iterator(source.begin()), + std::make_move_iterator(source.end()), + std::back_inserter(out), std::forward(map))); + return std::move(out); +} + +template +std::vector FlattenVectors(const std::vector>& vecs) { + std::size_t sum = 0; + for (const auto& vec : vecs) { + sum += vec.size(); + } + std::vector out; + out.reserve(sum); + for (const auto& vec : vecs) { + out.insert(out.end(), vec.begin(), vec.end()); + } + return out; +} + +template +Result> UnwrapOrRaise(std::vector>&& results) { + std::vector out; + out.reserve(results.size()); + for (auto&& result : results) { + if (!result.ok()) { + return result.status(); + } + out.push_back(result.MoveValueUnsafe()); + } + return out; +} + +template +Result> UnwrapOrRaise(const std::vector>& results) { + std::vector out; + out.reserve(results.size()); + for (const auto& result : results) { + if (!result.ok()) { + return result.status(); + } + out.push_back(result.ValueUnsafe()); + } + return out; +} + +} // namespace internal +} // namespace arrow diff --git a/shared/package-files/38/38aa49c24ff213764c7b1b78f51f90c2d4ee75969765b993b296aad5930ca405/coreerrors.py b/shared/package-files/38/38aa49c24ff213764c7b1b78f51f90c2d4ee75969765b993b296aad5930ca405/coreerrors.py new file mode 100644 index 0000000000000000000000000000000000000000..e1af0729533a7ce2ae2a4564d225a03eaed6e333 --- /dev/null +++ b/shared/package-files/38/38aa49c24ff213764c7b1b78f51f90c2d4ee75969765b993b296aad5930ca405/coreerrors.py @@ -0,0 +1,9 @@ +"""Definitions of common exceptions for :mod:`sympy.core` module. """ + + +class BaseCoreError(Exception): + """Base class for core related exceptions. """ + + +class NonCommutativeExpression(BaseCoreError): + """Raised when expression didn't have commutative property. """ diff --git a/shared/package-files/38/38b1724d5ed3c0ae44d538404d6f41f097c789b20d37045b2df44273b93ef0e7/gt_ops.h b/shared/package-files/38/38b1724d5ed3c0ae44d538404d6f41f097c789b20d37045b2df44273b93ef0e7/gt_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..101fbe9bb323615ed66a54d997308b43ea65e5f3 --- /dev/null +++ b/shared/package-files/38/38b1724d5ed3c0ae44d538404d6f41f097c789b20d37045b2df44273b93ef0e7/gt_ops.h @@ -0,0 +1,83 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API gt_Scalar_out { + using schema = at::Tensor & (const at::Tensor &, const at::Scalar &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::gt") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Scalar_out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "gt.Scalar_out(Tensor self, Scalar other, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, const at::Scalar & other, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Scalar & other, at::Tensor & out); +}; + +struct TORCH_API gt_Scalar { + using schema = at::Tensor (const at::Tensor &, const at::Scalar &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::gt") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Scalar") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "gt.Scalar(Tensor self, Scalar other) -> Tensor") + static at::Tensor call(const at::Tensor & self, const at::Scalar & other); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Scalar & other); +}; + +struct TORCH_API gt_Tensor_out { + using schema = at::Tensor & (const at::Tensor &, const at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::gt") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Tensor_out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "gt.Tensor_out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, const at::Tensor & other, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & other, at::Tensor & out); +}; + +struct TORCH_API gt_Tensor { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::gt") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Tensor") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "gt.Tensor(Tensor self, Tensor other) -> Tensor") + static at::Tensor call(const at::Tensor & self, const at::Tensor & other); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & other); +}; + +struct TORCH_API gt__Scalar { + using schema = at::Tensor & (at::Tensor &, const at::Scalar &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::gt_") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Scalar") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "gt_.Scalar(Tensor(a!) self, Scalar other) -> Tensor(a!)") + static at::Tensor & call(at::Tensor & self, const at::Scalar & other); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, at::Tensor & self, const at::Scalar & other); +}; + +struct TORCH_API gt__Tensor { + using schema = at::Tensor & (at::Tensor &, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::gt_") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Tensor") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "gt_.Tensor(Tensor(a!) self, Tensor other) -> Tensor(a!)") + static at::Tensor & call(at::Tensor & self, const at::Tensor & other); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, at::Tensor & self, const at::Tensor & other); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/38/38cccc482152a20a522217fe89908ac250670b2c7dabc6546b948e01de3e2b06/slogdet.h b/shared/package-files/38/38cccc482152a20a522217fe89908ac250670b2c7dabc6546b948e01de3e2b06/slogdet.h new file mode 100644 index 0000000000000000000000000000000000000000..daabfb8d2c75f52b71b175344830f54d15f21c3c --- /dev/null +++ b/shared/package-files/38/38cccc482152a20a522217fe89908ac250670b2c7dabc6546b948e01de3e2b06/slogdet.h @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::slogdet(Tensor self) -> (Tensor sign, Tensor logabsdet) +inline ::std::tuple slogdet(const at::Tensor & self) { + return at::_ops::slogdet::call(self); +} + +// aten::slogdet.out(Tensor self, *, Tensor(a!) sign, Tensor(b!) logabsdet) -> (Tensor(a!) sign, Tensor(b!) logabsdet) +inline ::std::tuple slogdet_out(at::Tensor & sign, at::Tensor & logabsdet, const at::Tensor & self) { + return at::_ops::slogdet_out::call(self, sign, logabsdet); +} +// aten::slogdet.out(Tensor self, *, Tensor(a!) sign, Tensor(b!) logabsdet) -> (Tensor(a!) sign, Tensor(b!) logabsdet) +inline ::std::tuple slogdet_outf(const at::Tensor & self, at::Tensor & sign, at::Tensor & logabsdet) { + return at::_ops::slogdet_out::call(self, sign, logabsdet); +} + +} diff --git a/shared/package-files/38/38d655c5069bf1dfb53f953cb01f1ae62bfa2105f77ee06516983f347915e35f/asgd.py b/shared/package-files/38/38d655c5069bf1dfb53f953cb01f1ae62bfa2105f77ee06516983f347915e35f/asgd.py new file mode 100644 index 0000000000000000000000000000000000000000..247c8388e93a780b9f4e26839ad22475f307b042 --- /dev/null +++ b/shared/package-files/38/38d655c5069bf1dfb53f953cb01f1ae62bfa2105f77ee06516983f347915e35f/asgd.py @@ -0,0 +1,396 @@ +import torch +from torch import Tensor + +from .optimizer import (Optimizer, _use_grad_for_differentiable, _get_value, _default_to_fused_or_foreach, + _get_scalar_dtype, _view_as_real, _differentiable_doc, _foreach_doc, _maximize_doc, + _capturable_doc) +from typing import List, Optional + +__all__ = ["ASGD", "asgd"] + +def _to_tensor(x, device=None): + if not isinstance(x, torch.Tensor): + return torch.tensor(x, device=device) + + return x + +class ASGD(Optimizer): + def __init__( + self, + params, + lr=1e-2, + lambd=1e-4, + alpha=0.75, + t0=1e6, + weight_decay=0, + foreach: Optional[bool] = None, + maximize: bool = False, + differentiable: bool = False, + capturable: bool = False, + ): + if not 0.0 <= lr: + raise ValueError(f"Invalid learning rate: {lr}") + if not 0.0 <= weight_decay: + raise ValueError(f"Invalid weight_decay value: {weight_decay}") + + defaults = dict( + lr=lr, + lambd=lambd, + alpha=alpha, + t0=t0, + weight_decay=weight_decay, + foreach=foreach, + maximize=maximize, + differentiable=differentiable, + capturable=capturable, + ) + super().__init__(params, defaults) + + def __setstate__(self, state): + super().__setstate__(state) + for group in self.param_groups: + group.setdefault("foreach", None) + group.setdefault("maximize", False) + group.setdefault("differentiable", False) + group.setdefault("capturable", False) + for p in group["params"]: + p_state = self.state.get(p, []) + if len(p_state) != 0: + if not torch.is_tensor(p_state['step']): + step_val = float(p_state["step"]) + p_state["step"] = torch.tensor(step_val, dtype=_get_scalar_dtype(), device=p.device) + if not torch.is_tensor(p_state["eta"]): + p_state["eta"] = torch.tensor(p_state["eta"], dtype=_get_scalar_dtype(), device=p.device) + if not torch.is_tensor(p_state["mu"]): + p_state["mu"] = torch.tensor(p_state["mu"], dtype=_get_scalar_dtype(), device=p.device) + + + def _init_group(self, group, params_with_grad, grads, mus, axs, etas, state_steps): + has_complex = False + for p in group["params"]: + if p.grad is not None: + has_complex |= torch.is_complex(p) + params_with_grad.append(p) + if p.grad.is_sparse: + raise RuntimeError("ASGD does not support sparse gradients") + grads.append(p.grad) + + state = self.state[p] + # State initialization + if len(state) == 0: + state["step"] = torch.zeros((), device=p.device, dtype=_get_scalar_dtype()) + state["eta"] = torch.tensor(group["lr"], device=p.device, dtype=_get_scalar_dtype()) + state["mu"] = torch.ones((), device=p.device, dtype=_get_scalar_dtype()) + state["ax"] = torch.zeros_like( + p, memory_format=torch.preserve_format + ) + + mus.append(state["mu"]) + axs.append(state["ax"]) + etas.append(state["eta"]) + state_steps.append(state["step"]) + return has_complex + + @_use_grad_for_differentiable + def step(self, closure=None): + """Perform a single optimization step. + + Args: + closure (Callable, optional): A closure that reevaluates the model + and returns the loss. + """ + self._cuda_graph_capture_health_check() + + loss = None + if closure is not None: + with torch.enable_grad(): + loss = closure() + + for group in self.param_groups: + params_with_grad = [] + grads = [] + mus = [] + axs = [] + etas = [] + state_steps = [] + + has_complex = self._init_group(group, params_with_grad, grads, mus, axs, etas, state_steps) + + asgd( + params_with_grad, + grads, + axs, + mus, + etas, + state_steps, + lambd=group["lambd"], + lr=group["lr"], + t0=group["t0"], + alpha=group["alpha"], + weight_decay=group["weight_decay"], + foreach=group["foreach"], + maximize=group["maximize"], + differentiable=group["differentiable"], + capturable=group["capturable"], + has_complex=has_complex, + ) + + return loss + + +ASGD.__doc__ = fr"""Implements Averaged Stochastic Gradient Descent. + + It has been proposed in `Acceleration of stochastic approximation by + averaging`_. + + Args: + params (iterable): iterable of parameters to optimize or dicts defining + parameter groups + lr (float, optional): learning rate (default: 1e-2) + lambd (float, optional): decay term (default: 1e-4) + alpha (float, optional): power for eta update (default: 0.75) + t0 (float, optional): point at which to start averaging (default: 1e6) + weight_decay (float, optional): weight decay (L2 penalty) (default: 0) + {_foreach_doc} + {_maximize_doc} + {_differentiable_doc} + {_capturable_doc} + + .. _Acceleration of stochastic approximation by averaging: + https://dl.acm.org/citation.cfm?id=131098 + + """ + + +def asgd( + params: List[Tensor], + grads: List[Tensor], + axs: List[Tensor], + mus: List[Tensor], + etas: List[Tensor], + state_steps: List[Tensor], + # kwonly args with defaults are not supported by functions compiled with torchscript issue #70627 + # setting this as kwarg for now as functional API is compiled by torch/distributed/optim + foreach: Optional[bool] = None, + maximize: bool = False, + differentiable: bool = False, + capturable: bool = False, + has_complex: bool = False, + *, + lambd: float, + lr: float, + t0: float, + alpha: float, + weight_decay: float, +): + r"""Functional API that performs asgd algorithm computation. + + See :class:`~torch.optim.ASGD` for details. + """ + if foreach is None: + _, foreach = _default_to_fused_or_foreach(params, differentiable, use_fused=False) + + if foreach and torch.jit.is_scripting(): + raise RuntimeError("torch.jit.script not supported with foreach optimizers") + + if foreach and not torch.jit.is_scripting(): + func = _multi_tensor_asgd + else: + func = _single_tensor_asgd + + func( + params, + grads, + axs, + mus, + etas, + state_steps, + lambd=lambd, + lr=lr, + t0=t0, + alpha=alpha, + weight_decay=weight_decay, + maximize=maximize, + differentiable=differentiable, + capturable=capturable, + has_complex=has_complex, + ) + + +def _single_tensor_asgd( + params: List[Tensor], + grads: List[Tensor], + axs: List[Tensor], + mus: List[Tensor], + etas: List[Tensor], + state_steps: List[Tensor], + *, + lambd: float, + lr: float, + t0: float, + alpha: float, + weight_decay: float, + maximize: bool, + differentiable: bool, + capturable: bool, + has_complex: bool, +): + for i, param in enumerate(params): + grad = grads[i] + grad = grad if not maximize else -grad + mu = mus[i] + ax = axs[i] + eta = etas[i] + step_t = state_steps[i] + + # If compiling, the compiler will handle cudagraph checks, see note [torch.compile x capturable] + if not torch._utils.is_compiling() and capturable: + assert (param.is_cuda and mu.is_cuda and eta.is_cuda and step_t.is_cuda) or ( + param.is_xla and mu.is_xla and eta.is_xla and step_t.is_xla + ), "If capturable=True, params, mus, etas, and state_steps must be CUDA or XLA tensors." + + if torch.is_complex(param): + grad = torch.view_as_real(grad) + param = torch.view_as_real(param) + ax = torch.view_as_real(ax) + + # update step + step_t += 1 + + if weight_decay != 0: + grad = grad.add(param, alpha=weight_decay) + + if capturable: + param.mul_(1 - lambd * eta) + param.addcmul_(grad, eta, value=-1) # update parameter + else: + eta_value = _get_value(eta) + param.mul_(1 - lambd * eta_value) # decay term + param.add_(grad, alpha=-eta_value) # update parameter + + # averaging + if capturable or mu.item() != 1: + ax.add_(param.sub(ax).mul_(mu)) + else: + ax.copy_(param) + + if capturable: + eta.copy_(lr / ((1 + lambd * lr * step_t) ** alpha)) + mu.copy_(1 / torch.maximum(step_t - t0, torch.ones_like(step_t))) + else: + step = _get_value(step_t) + new_eta = _to_tensor(lr / ((1 + lambd * lr * step) ** alpha)) + eta.copy_(new_eta) + new_mu = _to_tensor(1 / max(1, step - t0)) + mu.copy_(new_mu) + + +def _multi_tensor_asgd( + params: List[Tensor], + grads: List[Tensor], + axs: List[Tensor], + mus: List[Tensor], + etas: List[Tensor], + state_steps: List[Tensor], + *, + lambd: float, + lr: float, + t0: float, + alpha: float, + weight_decay: float, + maximize: bool, + differentiable: bool, + capturable: bool, + has_complex: bool, +): + if len(params) == 0: + return + + assert not differentiable, "_foreach ops don't support autograd" + + # If compiling, the compiler will handle cudagraph checks, see note [torch.compile x capturable] + if not torch._utils.is_compiling() and capturable: + assert all(p.is_cuda and mu.is_cuda and eta.is_cuda and step.is_cuda + for p, mu, eta, step in zip(params, mus, etas, state_steps)), \ + "If capturable=True, params, mus, etas, and state_steps must be CUDA tensors." + + grouped_tensors = Optimizer._group_tensors_by_device_and_dtype([params, grads, axs, mus, etas, state_steps]) + for ((device, _), ((grouped_params, grouped_grads, grouped_axs, grouped_mus, + grouped_etas, grouped_state_steps), _)) in grouped_tensors.items(): + if has_complex: + _view_as_real(grouped_params, grouped_grads, grouped_axs) + + if maximize: + grouped_grads = torch._foreach_neg(grouped_grads) + + # Update steps + # If steps are on CPU, foreach will fall back to the slow path, which is a for-loop calling t.add(1) over + # and over. 1 will then be wrapped into a Tensor over and over again, which is slower than if we just + # wrapped it once now. The alpha is required to assure we go to the right overload. + if grouped_state_steps[0].is_cpu: + torch._foreach_add_(grouped_state_steps, torch.tensor(1.0, device='cpu'), alpha=1.0) + else: + torch._foreach_add_(grouped_state_steps, 1) + + # intermediate = grad + param * lambd + if weight_decay != 0: + if maximize: + torch._foreach_add_(grouped_grads, grouped_params, alpha=weight_decay) + intermediate = grouped_grads + else: + intermediate = torch._foreach_add(grouped_grads, grouped_params, alpha=weight_decay) + + torch._foreach_add_(intermediate, grouped_params, alpha=lambd) + else: + intermediate = torch._foreach_add(grouped_grads, grouped_params, alpha=lambd) + + # update param + # param * (1 - lambd * eta) - eta * grad + # => param - param * lambd * eta - eta * grad + # => param - eta * intermediate + torch._foreach_addcmul_(grouped_params, intermediate, grouped_etas, value=-1) + del intermediate + + # update grouped_axs + # averaging: ax = ax + mu * (param - ax) + # Note (mlazos): We can't use lerp here since it requires weight to be float64 + # and our grouping code requires dtypes to match for all tensors in a group (and it should, since + # we use the mus in other places) + # all dtypes need to match, so we could introduce a cast in a loop + # but since this only adds one additional kernel launch, this looks like the cleaner + # and faster solution + intermediate = torch._foreach_sub(grouped_params, grouped_axs) + torch._foreach_addcmul_(grouped_axs, intermediate, grouped_mus) + del intermediate + + if capturable: + # update grouped_mus + new_mus = torch._foreach_sub(grouped_state_steps, t0) + torch._foreach_maximum_(new_mus, 1.0) + torch._foreach_reciprocal_(new_mus) + torch._foreach_copy_(grouped_mus, new_mus) + del new_mus + + # update eta = lr / (1 + lambd * lr * step^alpha) + new_etas = torch._foreach_pow(grouped_state_steps, alpha) + torch._foreach_mul_(new_etas, lambd) + torch._foreach_mul_(new_etas, lr) + torch._foreach_add_(new_etas, 1) + torch._foreach_reciprocal_(new_etas) + torch._foreach_mul_(new_etas, lr) + torch._foreach_copy_(grouped_etas, new_etas) + else: + step = grouped_state_steps[0].item() + new_etas = [] + new_mus = [] + + for i in range(len(grouped_mus)): + new_eta = _to_tensor( + lr / (1 + lambd * lr * step ** alpha), device=device + ) + new_etas.append(new_eta) + new_mu = _to_tensor(1 / max(1, step - t0), device=device) + new_mus.append(new_mu) + + torch._foreach_copy_(grouped_etas, new_etas) + torch._foreach_copy_(grouped_mus, new_mus) diff --git a/shared/package-files/38/38db742543d5d5eb5908ef434cbbabd61f385e68076582bf93bdea9a9e244608/test_backports.py b/shared/package-files/38/38db742543d5d5eb5908ef434cbbabd61f385e68076582bf93bdea9a9e244608/test_backports.py new file mode 100644 index 0000000000000000000000000000000000000000..1099bf55e3523ee729ba39e650bb4ac040dd239b --- /dev/null +++ b/shared/package-files/38/38db742543d5d5eb5908ef434cbbabd61f385e68076582bf93bdea9a9e244608/test_backports.py @@ -0,0 +1,35 @@ +import mmap + +from joblib import Parallel, delayed +from joblib.backports import concurrency_safe_rename, make_memmap +from joblib.test.common import with_numpy +from joblib.testing import parametrize + + +@with_numpy +def test_memmap(tmpdir): + fname = tmpdir.join("test.mmap").strpath + size = 5 * mmap.ALLOCATIONGRANULARITY + offset = mmap.ALLOCATIONGRANULARITY + 1 + memmap_obj = make_memmap(fname, shape=size, mode="w+", offset=offset) + assert memmap_obj.offset == offset + + +@parametrize("dst_content", [None, "dst content"]) +@parametrize("backend", [None, "threading"]) +def test_concurrency_safe_rename(tmpdir, dst_content, backend): + src_paths = [tmpdir.join("src_%d" % i) for i in range(4)] + for src_path in src_paths: + src_path.write("src content") + dst_path = tmpdir.join("dst") + if dst_content is not None: + dst_path.write(dst_content) + + Parallel(n_jobs=4, backend=backend)( + delayed(concurrency_safe_rename)(src_path.strpath, dst_path.strpath) + for src_path in src_paths + ) + assert dst_path.exists() + assert dst_path.read() == "src content" + for src_path in src_paths: + assert not src_path.exists() diff --git a/shared/package-files/38/38df2dff44ee2d67689ae7704d19df44996c8fc7e691013f0b0f777de2e96957/minimum_meta_dispatch.h b/shared/package-files/38/38df2dff44ee2d67689ae7704d19df44996c8fc7e691013f0b0f777de2e96957/minimum_meta_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..bd91134d5d49a9cb0707aea4c47b86ea3d32cc37 --- /dev/null +++ b/shared/package-files/38/38df2dff44ee2d67689ae7704d19df44996c8fc7e691013f0b0f777de2e96957/minimum_meta_dispatch.h @@ -0,0 +1,25 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace meta { + +TORCH_API at::Tensor minimum(const at::Tensor & self, const at::Tensor & other); +TORCH_API at::Tensor & minimum_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other); +TORCH_API at::Tensor & minimum_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out); + +} // namespace meta +} // namespace at diff --git a/shared/package-files/38/38ec172b9d8ddaddf990c08c974078cc12be77ce4f72a186fe73806e1b04003f/testtools.pyi b/shared/package-files/38/38ec172b9d8ddaddf990c08c974078cc12be77ce4f72a186fe73806e1b04003f/testtools.pyi new file mode 100644 index 0000000000000000000000000000000000000000..da0f92d155655b6378b1612eb366b3cfcea74046 --- /dev/null +++ b/shared/package-files/38/38ec172b9d8ddaddf990c08c974078cc12be77ce4f72a186fe73806e1b04003f/testtools.pyi @@ -0,0 +1,8 @@ +from werkzeug.wrappers import Response + +class ContentAccessors: + def xml(self): ... + def lxml(self): ... + def json(self): ... + +class TestResponse(Response, ContentAccessors): ... diff --git a/shared/package-files/38/38ec66aebf74f8f986684886484a21f0b501306e6b19cb0a367d7c488234e7c6/dropout.py b/shared/package-files/38/38ec66aebf74f8f986684886484a21f0b501306e6b19cb0a367d7c488234e7c6/dropout.py new file mode 100644 index 0000000000000000000000000000000000000000..64110ab53bed9a7620804a7732caebf36c84d2ca --- /dev/null +++ b/shared/package-files/38/38ec66aebf74f8f986684886484a21f0b501306e6b19cb0a367d7c488234e7c6/dropout.py @@ -0,0 +1,27 @@ +import torch + +__all__ = ['Dropout'] + +class Dropout(torch.nn.Dropout): + r"""This is the quantized equivalent of :class:`~torch.nn.Dropout`. + And this is a placeholder to enable models where fp32 tensors + had dropout to work with quantized tensors in train and eval mode. + + Args: + p: probability of an element to be zeroed + inplace: can optionally do the operation in-place. Default: ``False`` + """ + + def forward(self, input): + return input + + def _get_name(self): + return 'QuantizedDropout' + + @classmethod + def from_float(cls, mod): + return cls(mod.p, mod.inplace) + + @classmethod + def from_reference(cls, mod, scale, zero_point): + return cls(mod.p, mod.inplace) diff --git a/shared/package-files/38/38f460596ebfb64046aab3d9a65935bd4c76a470118fb7d10a088dc0ecdc53ea/fix_dict.py b/shared/package-files/38/38f460596ebfb64046aab3d9a65935bd4c76a470118fb7d10a088dc0ecdc53ea/fix_dict.py new file mode 100644 index 0000000000000000000000000000000000000000..d3655c9f1b2d9bf82d8ce3a2140cfeff9ba97323 --- /dev/null +++ b/shared/package-files/38/38f460596ebfb64046aab3d9a65935bd4c76a470118fb7d10a088dc0ecdc53ea/fix_dict.py @@ -0,0 +1,106 @@ +# Copyright 2007 Google, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Fixer for dict methods. + +d.keys() -> list(d.keys()) +d.items() -> list(d.items()) +d.values() -> list(d.values()) + +d.iterkeys() -> iter(d.keys()) +d.iteritems() -> iter(d.items()) +d.itervalues() -> iter(d.values()) + +d.viewkeys() -> d.keys() +d.viewitems() -> d.items() +d.viewvalues() -> d.values() + +Except in certain very specific contexts: the iter() can be dropped +when the context is list(), sorted(), iter() or for...in; the list() +can be dropped when the context is list() or sorted() (but not iter() +or for...in!). Special contexts that apply to both: list(), sorted(), tuple() +set(), any(), all(), sum(). + +Note: iter(d.keys()) could be written as iter(d) but since the +original d.iterkeys() was also redundant we don't fix this. And there +are (rare) contexts where it makes a difference (e.g. when passing it +as an argument to a function that introspects the argument). +""" + +# Local imports +from .. import pytree +from .. import patcomp +from .. import fixer_base +from ..fixer_util import Name, Call, Dot +from .. import fixer_util + + +iter_exempt = fixer_util.consuming_calls | {"iter"} + + +class FixDict(fixer_base.BaseFix): + BM_compatible = True + + PATTERN = """ + power< head=any+ + trailer< '.' method=('keys'|'items'|'values'| + 'iterkeys'|'iteritems'|'itervalues'| + 'viewkeys'|'viewitems'|'viewvalues') > + parens=trailer< '(' ')' > + tail=any* + > + """ + + def transform(self, node, results): + head = results["head"] + method = results["method"][0] # Extract node for method name + tail = results["tail"] + syms = self.syms + method_name = method.value + isiter = method_name.startswith("iter") + isview = method_name.startswith("view") + if isiter or isview: + method_name = method_name[4:] + assert method_name in ("keys", "items", "values"), repr(method) + head = [n.clone() for n in head] + tail = [n.clone() for n in tail] + special = not tail and self.in_special_context(node, isiter) + args = head + [pytree.Node(syms.trailer, + [Dot(), + Name(method_name, + prefix=method.prefix)]), + results["parens"].clone()] + new = pytree.Node(syms.power, args) + if not (special or isview): + new.prefix = "" + new = Call(Name("iter" if isiter else "list"), [new]) + if tail: + new = pytree.Node(syms.power, [new] + tail) + new.prefix = node.prefix + return new + + P1 = "power< func=NAME trailer< '(' node=any ')' > any* >" + p1 = patcomp.compile_pattern(P1) + + P2 = """for_stmt< 'for' any 'in' node=any ':' any* > + | comp_for< 'for' any 'in' node=any any* > + """ + p2 = patcomp.compile_pattern(P2) + + def in_special_context(self, node, isiter): + if node.parent is None: + return False + results = {} + if (node.parent.parent is not None and + self.p1.match(node.parent.parent, results) and + results["node"] is node): + if isiter: + # iter(d.iterkeys()) -> iter(d.keys()), etc. + return results["func"].value in iter_exempt + else: + # list(d.keys()) -> list(d.keys()), etc. + return results["func"].value in fixer_util.consuming_calls + if not isiter: + return False + # for ... in d.iterkeys() -> for ... in d.keys(), etc. + return self.p2.match(node.parent, results) and results["node"] is node diff --git a/shared/package-files/38/38f782e0fd19766d5f699885c282b764bc80f7a28bdd30a66b184c117939beed/test_interactivshell.py b/shared/package-files/38/38f782e0fd19766d5f699885c282b764bc80f7a28bdd30a66b184c117939beed/test_interactivshell.py new file mode 100644 index 0000000000000000000000000000000000000000..ae7da217f1dffde0133685ea50baeda1b7091c92 --- /dev/null +++ b/shared/package-files/38/38f782e0fd19766d5f699885c282b764bc80f7a28bdd30a66b184c117939beed/test_interactivshell.py @@ -0,0 +1,255 @@ +# -*- coding: utf-8 -*- +"""Tests for the TerminalInteractiveShell and related pieces.""" +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +import sys +import unittest +import os + +from prompt_toolkit.auto_suggest import AutoSuggestFromHistory + + +from IPython.testing import tools as tt + +from IPython.terminal.ptutils import _elide, _adjust_completion_text_based_on_context +from IPython.terminal.shortcuts.auto_suggest import NavigableAutoSuggestFromHistory + + +class TestAutoSuggest(unittest.TestCase): + def test_changing_provider(self): + ip = get_ipython() + ip.autosuggestions_provider = None + self.assertEqual(ip.auto_suggest, None) + ip.autosuggestions_provider = "AutoSuggestFromHistory" + self.assertIsInstance(ip.auto_suggest, AutoSuggestFromHistory) + ip.autosuggestions_provider = "NavigableAutoSuggestFromHistory" + self.assertIsInstance(ip.auto_suggest, NavigableAutoSuggestFromHistory) + + +class TestElide(unittest.TestCase): + def test_elide(self): + _elide("concatenate((a1, a2, ...), axis", "") # do not raise + _elide("concatenate((a1, a2, ..), . axis", "") # do not raise + self.assertEqual( + _elide("aaaa.bbbb.ccccc.dddddd.eeeee.fffff.gggggg.hhhhhh", ""), + "aaaa.b…g.hhhhhh", + ) + + test_string = os.sep.join(["", 10 * "a", 10 * "b", 10 * "c", ""]) + expect_string = ( + os.sep + "a" + "\N{HORIZONTAL ELLIPSIS}" + "b" + os.sep + 10 * "c" + ) + self.assertEqual(_elide(test_string, ""), expect_string) + + def test_elide_typed_normal(self): + self.assertEqual( + _elide( + "the quick brown fox jumped over the lazy dog", + "the quick brown fox", + min_elide=10, + ), + "the…fox jumped over the lazy dog", + ) + + def test_elide_typed_short_match(self): + """ + if the match is too short we don't elide. + avoid the "the...the" + """ + self.assertEqual( + _elide("the quick brown fox jumped over the lazy dog", "the", min_elide=10), + "the quick brown fox jumped over the lazy dog", + ) + + def test_elide_typed_no_match(self): + """ + if the match is too short we don't elide. + avoid the "the...the" + """ + # here we typed red instead of brown + self.assertEqual( + _elide( + "the quick brown fox jumped over the lazy dog", + "the quick red fox", + min_elide=10, + ), + "the quick brown fox jumped over the lazy dog", + ) + + +class TestContextAwareCompletion(unittest.TestCase): + def test_adjust_completion_text_based_on_context(self): + # Adjusted case + self.assertEqual( + _adjust_completion_text_based_on_context("arg1=", "func1(a=)", 7), "arg1" + ) + + # Untouched cases + self.assertEqual( + _adjust_completion_text_based_on_context("arg1=", "func1(a)", 7), "arg1=" + ) + self.assertEqual( + _adjust_completion_text_based_on_context("arg1=", "func1(a", 7), "arg1=" + ) + self.assertEqual( + _adjust_completion_text_based_on_context("%magic", "func1(a=)", 7), "%magic" + ) + self.assertEqual( + _adjust_completion_text_based_on_context("func2", "func1(a=)", 7), "func2" + ) + + +# Decorator for interaction loop tests ----------------------------------------- + + +class mock_input_helper(object): + """Machinery for tests of the main interact loop. + + Used by the mock_input decorator. + """ + def __init__(self, testgen): + self.testgen = testgen + self.exception = None + self.ip = get_ipython() + + def __enter__(self): + self.orig_prompt_for_code = self.ip.prompt_for_code + self.ip.prompt_for_code = self.fake_input + return self + + def __exit__(self, etype, value, tb): + self.ip.prompt_for_code = self.orig_prompt_for_code + + def fake_input(self): + try: + return next(self.testgen) + except StopIteration: + self.ip.keep_running = False + return u'' + except: + self.exception = sys.exc_info() + self.ip.keep_running = False + return u'' + +def mock_input(testfunc): + """Decorator for tests of the main interact loop. + + Write the test as a generator, yield-ing the input strings, which IPython + will see as if they were typed in at the prompt. + """ + def test_method(self): + testgen = testfunc(self) + with mock_input_helper(testgen) as mih: + mih.ip.interact() + + if mih.exception is not None: + # Re-raise captured exception + etype, value, tb = mih.exception + import traceback + traceback.print_tb(tb, file=sys.stdout) + del tb # Avoid reference loop + raise value + + return test_method + +# Test classes ----------------------------------------------------------------- + +class InteractiveShellTestCase(unittest.TestCase): + def rl_hist_entries(self, rl, n): + """Get last n readline history entries as a list""" + return [rl.get_history_item(rl.get_current_history_length() - x) + for x in range(n - 1, -1, -1)] + + @mock_input + def test_inputtransformer_syntaxerror(self): + ip = get_ipython() + ip.input_transformers_post.append(syntax_error_transformer) + + try: + #raise Exception + with tt.AssertPrints('4', suppress=False): + yield u'print(2*2)' + + with tt.AssertPrints('SyntaxError: input contains', suppress=False): + yield u'print(2345) # syntaxerror' + + with tt.AssertPrints('16', suppress=False): + yield u'print(4*4)' + + finally: + ip.input_transformers_post.remove(syntax_error_transformer) + + def test_repl_not_plain_text(self): + ip = get_ipython() + formatter = ip.display_formatter + assert formatter.active_types == ['text/plain'] + + # terminal may have arbitrary mimetype handler to open external viewer + # or inline images. + assert formatter.ipython_display_formatter.enabled + + class Test(object): + def __repr__(self): + return "" % id(self) + + def _repr_html_(self): + return '' + + # verify that HTML repr isn't computed + obj = Test() + data, _ = formatter.format(obj) + self.assertEqual(data, {'text/plain': repr(obj)}) + + class Test2(Test): + def _ipython_display_(self): + from IPython.display import display, HTML + + display(HTML("")) + + # verify that mimehandlers are called + called = False + + def handler(data, metadata): + print("Handler called") + nonlocal called + called = True + + ip.display_formatter.active_types.append("text/html") + ip.display_formatter.formatters["text/html"].enabled = True + ip.mime_renderers["text/html"] = handler + try: + obj = Test() + display(obj) + finally: + ip.display_formatter.formatters["text/html"].enabled = False + del ip.mime_renderers["text/html"] + + assert called == True + + +def syntax_error_transformer(lines): + """Transformer that throws SyntaxError if 'syntaxerror' is in the code.""" + for line in lines: + pos = line.find('syntaxerror') + if pos >= 0: + e = SyntaxError('input contains "syntaxerror"') + e.text = line + e.offset = pos + 1 + raise e + return lines + + +class TerminalMagicsTestCase(unittest.TestCase): + def test_paste_magics_blankline(self): + """Test that code with a blank line doesn't get split (gh-3246).""" + ip = get_ipython() + s = ('def pasted_func(a):\n' + ' b = a+1\n' + '\n' + ' return b') + + tm = ip.magics_manager.registry['TerminalMagics'] + tm.store_or_execute(s, name=None) + + self.assertEqual(ip.user_ns['pasted_func'](54), 55) diff --git a/shared/package-files/38/38fa2dc88ab22039f15fba5f163d7f25dd2201a8cb82c72364db4490058dbcd0/is_distributed_compositeimplicitautograd_dispatch.h b/shared/package-files/38/38fa2dc88ab22039f15fba5f163d7f25dd2201a8cb82c72364db4490058dbcd0/is_distributed_compositeimplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..36819d9c3ec11f5cde2da7c112da46b92fdfd0a6 --- /dev/null +++ b/shared/package-files/38/38fa2dc88ab22039f15fba5f163d7f25dd2201a8cb82c72364db4490058dbcd0/is_distributed_compositeimplicitautograd_dispatch.h @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeimplicitautograd { + +TORCH_API bool is_distributed(const at::Tensor & self); + +} // namespace compositeimplicitautograd +} // namespace at diff --git a/shared/package-files/38/38fc69d82c478b5629fddd43f09c56e147aaf5f0bbd6d7a040569a7e1e7c1865/fancy_getopt.py b/shared/package-files/38/38fc69d82c478b5629fddd43f09c56e147aaf5f0bbd6d7a040569a7e1e7c1865/fancy_getopt.py new file mode 100644 index 0000000000000000000000000000000000000000..7d170dd27731a5c0d3065e017a061b8c3607e982 --- /dev/null +++ b/shared/package-files/38/38fc69d82c478b5629fddd43f09c56e147aaf5f0bbd6d7a040569a7e1e7c1865/fancy_getopt.py @@ -0,0 +1,457 @@ +"""distutils.fancy_getopt + +Wrapper around the standard getopt module that provides the following +additional features: + * short and long options are tied together + * options have help strings, so fancy_getopt could potentially + create a complete usage summary + * options set attributes of a passed-in object +""" + +import sys, string, re +import getopt +from distutils.errors import * + +# Much like command_re in distutils.core, this is close to but not quite +# the same as a Python NAME -- except, in the spirit of most GNU +# utilities, we use '-' in place of '_'. (The spirit of LISP lives on!) +# The similarities to NAME are again not a coincidence... +longopt_pat = r'[a-zA-Z](?:[a-zA-Z0-9-]*)' +longopt_re = re.compile(r'^%s$' % longopt_pat) + +# For recognizing "negative alias" options, eg. "quiet=!verbose" +neg_alias_re = re.compile("^(%s)=!(%s)$" % (longopt_pat, longopt_pat)) + +# This is used to translate long options to legitimate Python identifiers +# (for use as attributes of some object). +longopt_xlate = str.maketrans('-', '_') + +class FancyGetopt: + """Wrapper around the standard 'getopt()' module that provides some + handy extra functionality: + * short and long options are tied together + * options have help strings, and help text can be assembled + from them + * options set attributes of a passed-in object + * boolean options can have "negative aliases" -- eg. if + --quiet is the "negative alias" of --verbose, then "--quiet" + on the command line sets 'verbose' to false + """ + + def __init__(self, option_table=None): + # The option table is (currently) a list of tuples. The + # tuples may have 3 or four values: + # (long_option, short_option, help_string [, repeatable]) + # if an option takes an argument, its long_option should have '=' + # appended; short_option should just be a single character, no ':' + # in any case. If a long_option doesn't have a corresponding + # short_option, short_option should be None. All option tuples + # must have long options. + self.option_table = option_table + + # 'option_index' maps long option names to entries in the option + # table (ie. those 3-tuples). + self.option_index = {} + if self.option_table: + self._build_index() + + # 'alias' records (duh) alias options; {'foo': 'bar'} means + # --foo is an alias for --bar + self.alias = {} + + # 'negative_alias' keeps track of options that are the boolean + # opposite of some other option + self.negative_alias = {} + + # These keep track of the information in the option table. We + # don't actually populate these structures until we're ready to + # parse the command-line, since the 'option_table' passed in here + # isn't necessarily the final word. + self.short_opts = [] + self.long_opts = [] + self.short2long = {} + self.attr_name = {} + self.takes_arg = {} + + # And 'option_order' is filled up in 'getopt()'; it records the + # original order of options (and their values) on the command-line, + # but expands short options, converts aliases, etc. + self.option_order = [] + + def _build_index(self): + self.option_index.clear() + for option in self.option_table: + self.option_index[option[0]] = option + + def set_option_table(self, option_table): + self.option_table = option_table + self._build_index() + + def add_option(self, long_option, short_option=None, help_string=None): + if long_option in self.option_index: + raise DistutilsGetoptError( + "option conflict: already an option '%s'" % long_option) + else: + option = (long_option, short_option, help_string) + self.option_table.append(option) + self.option_index[long_option] = option + + def has_option(self, long_option): + """Return true if the option table for this parser has an + option with long name 'long_option'.""" + return long_option in self.option_index + + def get_attr_name(self, long_option): + """Translate long option name 'long_option' to the form it + has as an attribute of some object: ie., translate hyphens + to underscores.""" + return long_option.translate(longopt_xlate) + + def _check_alias_dict(self, aliases, what): + assert isinstance(aliases, dict) + for (alias, opt) in aliases.items(): + if alias not in self.option_index: + raise DistutilsGetoptError(("invalid %s '%s': " + "option '%s' not defined") % (what, alias, alias)) + if opt not in self.option_index: + raise DistutilsGetoptError(("invalid %s '%s': " + "aliased option '%s' not defined") % (what, alias, opt)) + + def set_aliases(self, alias): + """Set the aliases for this option parser.""" + self._check_alias_dict(alias, "alias") + self.alias = alias + + def set_negative_aliases(self, negative_alias): + """Set the negative aliases for this option parser. + 'negative_alias' should be a dictionary mapping option names to + option names, both the key and value must already be defined + in the option table.""" + self._check_alias_dict(negative_alias, "negative alias") + self.negative_alias = negative_alias + + def _grok_option_table(self): + """Populate the various data structures that keep tabs on the + option table. Called by 'getopt()' before it can do anything + worthwhile. + """ + self.long_opts = [] + self.short_opts = [] + self.short2long.clear() + self.repeat = {} + + for option in self.option_table: + if len(option) == 3: + long, short, help = option + repeat = 0 + elif len(option) == 4: + long, short, help, repeat = option + else: + # the option table is part of the code, so simply + # assert that it is correct + raise ValueError("invalid option tuple: %r" % (option,)) + + # Type- and value-check the option names + if not isinstance(long, str) or len(long) < 2: + raise DistutilsGetoptError(("invalid long option '%s': " + "must be a string of length >= 2") % long) + + if (not ((short is None) or + (isinstance(short, str) and len(short) == 1))): + raise DistutilsGetoptError("invalid short option '%s': " + "must a single character or None" % short) + + self.repeat[long] = repeat + self.long_opts.append(long) + + if long[-1] == '=': # option takes an argument? + if short: short = short + ':' + long = long[0:-1] + self.takes_arg[long] = 1 + else: + # Is option is a "negative alias" for some other option (eg. + # "quiet" == "!verbose")? + alias_to = self.negative_alias.get(long) + if alias_to is not None: + if self.takes_arg[alias_to]: + raise DistutilsGetoptError( + "invalid negative alias '%s': " + "aliased option '%s' takes a value" + % (long, alias_to)) + + self.long_opts[-1] = long # XXX redundant?! + self.takes_arg[long] = 0 + + # If this is an alias option, make sure its "takes arg" flag is + # the same as the option it's aliased to. + alias_to = self.alias.get(long) + if alias_to is not None: + if self.takes_arg[long] != self.takes_arg[alias_to]: + raise DistutilsGetoptError( + "invalid alias '%s': inconsistent with " + "aliased option '%s' (one of them takes a value, " + "the other doesn't" + % (long, alias_to)) + + # Now enforce some bondage on the long option name, so we can + # later translate it to an attribute name on some object. Have + # to do this a bit late to make sure we've removed any trailing + # '='. + if not longopt_re.match(long): + raise DistutilsGetoptError( + "invalid long option name '%s' " + "(must be letters, numbers, hyphens only" % long) + + self.attr_name[long] = self.get_attr_name(long) + if short: + self.short_opts.append(short) + self.short2long[short[0]] = long + + def getopt(self, args=None, object=None): + """Parse command-line options in args. Store as attributes on object. + + If 'args' is None or not supplied, uses 'sys.argv[1:]'. If + 'object' is None or not supplied, creates a new OptionDummy + object, stores option values there, and returns a tuple (args, + object). If 'object' is supplied, it is modified in place and + 'getopt()' just returns 'args'; in both cases, the returned + 'args' is a modified copy of the passed-in 'args' list, which + is left untouched. + """ + if args is None: + args = sys.argv[1:] + if object is None: + object = OptionDummy() + created_object = True + else: + created_object = False + + self._grok_option_table() + + short_opts = ' '.join(self.short_opts) + try: + opts, args = getopt.getopt(args, short_opts, self.long_opts) + except getopt.error as msg: + raise DistutilsArgError(msg) + + for opt, val in opts: + if len(opt) == 2 and opt[0] == '-': # it's a short option + opt = self.short2long[opt[1]] + else: + assert len(opt) > 2 and opt[:2] == '--' + opt = opt[2:] + + alias = self.alias.get(opt) + if alias: + opt = alias + + if not self.takes_arg[opt]: # boolean option? + assert val == '', "boolean option can't have value" + alias = self.negative_alias.get(opt) + if alias: + opt = alias + val = 0 + else: + val = 1 + + attr = self.attr_name[opt] + # The only repeating option at the moment is 'verbose'. + # It has a negative option -q quiet, which should set verbose = 0. + if val and self.repeat.get(attr) is not None: + val = getattr(object, attr, 0) + 1 + setattr(object, attr, val) + self.option_order.append((opt, val)) + + # for opts + if created_object: + return args, object + else: + return args + + def get_option_order(self): + """Returns the list of (option, value) tuples processed by the + previous run of 'getopt()'. Raises RuntimeError if + 'getopt()' hasn't been called yet. + """ + if self.option_order is None: + raise RuntimeError("'getopt()' hasn't been called yet") + else: + return self.option_order + + def generate_help(self, header=None): + """Generate help text (a list of strings, one per suggested line of + output) from the option table for this FancyGetopt object. + """ + # Blithely assume the option table is good: probably wouldn't call + # 'generate_help()' unless you've already called 'getopt()'. + + # First pass: determine maximum length of long option names + max_opt = 0 + for option in self.option_table: + long = option[0] + short = option[1] + l = len(long) + if long[-1] == '=': + l = l - 1 + if short is not None: + l = l + 5 # " (-x)" where short == 'x' + if l > max_opt: + max_opt = l + + opt_width = max_opt + 2 + 2 + 2 # room for indent + dashes + gutter + + # Typical help block looks like this: + # --foo controls foonabulation + # Help block for longest option looks like this: + # --flimflam set the flim-flam level + # and with wrapped text: + # --flimflam set the flim-flam level (must be between + # 0 and 100, except on Tuesdays) + # Options with short names will have the short name shown (but + # it doesn't contribute to max_opt): + # --foo (-f) controls foonabulation + # If adding the short option would make the left column too wide, + # we push the explanation off to the next line + # --flimflam (-l) + # set the flim-flam level + # Important parameters: + # - 2 spaces before option block start lines + # - 2 dashes for each long option name + # - min. 2 spaces between option and explanation (gutter) + # - 5 characters (incl. space) for short option name + + # Now generate lines of help text. (If 80 columns were good enough + # for Jesus, then 78 columns are good enough for me!) + line_width = 78 + text_width = line_width - opt_width + big_indent = ' ' * opt_width + if header: + lines = [header] + else: + lines = ['Option summary:'] + + for option in self.option_table: + long, short, help = option[:3] + text = wrap_text(help, text_width) + if long[-1] == '=': + long = long[0:-1] + + # Case 1: no short option at all (makes life easy) + if short is None: + if text: + lines.append(" --%-*s %s" % (max_opt, long, text[0])) + else: + lines.append(" --%-*s " % (max_opt, long)) + + # Case 2: we have a short option, so we have to include it + # just after the long option + else: + opt_names = "%s (-%s)" % (long, short) + if text: + lines.append(" --%-*s %s" % + (max_opt, opt_names, text[0])) + else: + lines.append(" --%-*s" % opt_names) + + for l in text[1:]: + lines.append(big_indent + l) + return lines + + def print_help(self, header=None, file=None): + if file is None: + file = sys.stdout + for line in self.generate_help(header): + file.write(line + "\n") + + +def fancy_getopt(options, negative_opt, object, args): + parser = FancyGetopt(options) + parser.set_negative_aliases(negative_opt) + return parser.getopt(args, object) + + +WS_TRANS = {ord(_wschar) : ' ' for _wschar in string.whitespace} + +def wrap_text(text, width): + """wrap_text(text : string, width : int) -> [string] + + Split 'text' into multiple lines of no more than 'width' characters + each, and return the list of strings that results. + """ + if text is None: + return [] + if len(text) <= width: + return [text] + + text = text.expandtabs() + text = text.translate(WS_TRANS) + chunks = re.split(r'( +|-+)', text) + chunks = [ch for ch in chunks if ch] # ' - ' results in empty strings + lines = [] + + while chunks: + cur_line = [] # list of chunks (to-be-joined) + cur_len = 0 # length of current line + + while chunks: + l = len(chunks[0]) + if cur_len + l <= width: # can squeeze (at least) this chunk in + cur_line.append(chunks[0]) + del chunks[0] + cur_len = cur_len + l + else: # this line is full + # drop last chunk if all space + if cur_line and cur_line[-1][0] == ' ': + del cur_line[-1] + break + + if chunks: # any chunks left to process? + # if the current line is still empty, then we had a single + # chunk that's too big too fit on a line -- so we break + # down and break it up at the line width + if cur_len == 0: + cur_line.append(chunks[0][0:width]) + chunks[0] = chunks[0][width:] + + # all-whitespace chunks at the end of a line can be discarded + # (and we know from the re.split above that if a chunk has + # *any* whitespace, it is *all* whitespace) + if chunks[0][0] == ' ': + del chunks[0] + + # and store this line in the list-of-all-lines -- as a single + # string, of course! + lines.append(''.join(cur_line)) + + return lines + + +def translate_longopt(opt): + """Convert a long option name to a valid Python identifier by + changing "-" to "_". + """ + return opt.translate(longopt_xlate) + + +class OptionDummy: + """Dummy class just used as a place to hold command-line option + values as instance attributes.""" + + def __init__(self, options=[]): + """Create a new OptionDummy instance. The attributes listed in + 'options' will be initialized to None.""" + for opt in options: + setattr(self, opt, None) + + +if __name__ == "__main__": + text = """\ +Tra-la-la, supercalifragilisticexpialidocious. +How *do* you spell that odd word, anyways? +(Someone ask Mary -- she'll know [or she'll +say, "How should I know?"].)""" + + for w in (10, 20, 30, 40): + print("width: %d" % w) + print("\n".join(wrap_text(text, w))) + print() diff --git a/shared/package-files/4a/4a0032e52d130484a70b2a69e11fce23e8cf510f7deeab6c2ce49d5e8f25e5b3/cancel.h b/shared/package-files/4a/4a0032e52d130484a70b2a69e11fce23e8cf510f7deeab6c2ce49d5e8f25e5b3/cancel.h new file mode 100644 index 0000000000000000000000000000000000000000..863b2c4e8ca902b24d1c3d6fb26cbe46ad434cfd --- /dev/null +++ b/shared/package-files/4a/4a0032e52d130484a70b2a69e11fce23e8cf510f7deeab6c2ce49d5e8f25e5b3/cancel.h @@ -0,0 +1,118 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include +#include +#include +#include + +#include "arrow/status.h" +#include "arrow/type_fwd.h" +#include "arrow/util/macros.h" +#include "arrow/util/visibility.h" + +namespace arrow { + +class StopToken; + +struct StopSourceImpl; + +/// EXPERIMENTAL +class ARROW_EXPORT StopSource { + public: + StopSource(); + ~StopSource(); + + // Consumer API (the side that stops) + void RequestStop(); + void RequestStop(Status error); + // Async-signal-safe. TODO Deprecate this? + void RequestStopFromSignal(int signum); + + StopToken token(); + + // For internal use only + void Reset(); + + protected: + std::shared_ptr impl_; +}; + +/// EXPERIMENTAL +class ARROW_EXPORT StopToken { + public: + // Public for Cython + StopToken() = default; + + explicit StopToken(std::shared_ptr impl) : impl_(std::move(impl)) {} + + // A trivial token that never propagates any stop request + static StopToken Unstoppable() { return StopToken(); } + + /// \brief Check if the stop source has been cancelled. + /// + /// Producers should call this method, whenever convenient, to check and + /// see if they should stop producing early (i.e. have been cancelled). + /// Failure to call this method often enough will lead to an unresponsive + /// cancellation. + /// + /// This is part of the producer API (the side that gets asked to stop) + /// This method is thread-safe + /// + /// \return An OK status if the stop source has not been cancelled or a + /// cancel error if the source has been cancelled. + Status Poll() const; + bool IsStopRequested() const; + + protected: + std::shared_ptr impl_; +}; + +/// EXPERIMENTAL: Set a global StopSource that can receive signals +/// +/// The only allowed order of calls is the following: +/// - SetSignalStopSource() +/// - any number of pairs of (RegisterCancellingSignalHandler, +/// UnregisterCancellingSignalHandler) calls +/// - ResetSignalStopSource() +/// +/// Beware that these settings are process-wide. Typically, only one +/// thread should call these APIs, even in a multithreaded setting. +ARROW_EXPORT +Result SetSignalStopSource(); + +/// EXPERIMENTAL: Reset the global signal-receiving StopSource +/// +/// This will invalidate the pointer returned by SetSignalStopSource. +ARROW_EXPORT +void ResetSignalStopSource(); + +/// EXPERIMENTAL: Register signal handler triggering the signal-receiving StopSource +/// +/// Note that those handlers are automatically un-registered in a fork()ed process, +/// therefore the child process will need to call RegisterCancellingSignalHandler() +/// if desired. +ARROW_EXPORT +Status RegisterCancellingSignalHandler(const std::vector& signals); + +/// EXPERIMENTAL: Unregister signal handler set up by RegisterCancellingSignalHandler +ARROW_EXPORT +void UnregisterCancellingSignalHandler(); + +} // namespace arrow diff --git a/shared/package-files/4a/4a077c666eec2d2642d71a7edf955eda011781a6413efd2cd58a543796723379/TgaImagePlugin.py b/shared/package-files/4a/4a077c666eec2d2642d71a7edf955eda011781a6413efd2cd58a543796723379/TgaImagePlugin.py new file mode 100644 index 0000000000000000000000000000000000000000..65c7484f756a1b4286fa1599de9fa41b53b8c862 --- /dev/null +++ b/shared/package-files/4a/4a077c666eec2d2642d71a7edf955eda011781a6413efd2cd58a543796723379/TgaImagePlugin.py @@ -0,0 +1,255 @@ +# +# The Python Imaging Library. +# $Id$ +# +# TGA file handling +# +# History: +# 95-09-01 fl created (reads 24-bit files only) +# 97-01-04 fl support more TGA versions, including compressed images +# 98-07-04 fl fixed orientation and alpha layer bugs +# 98-09-11 fl fixed orientation for runlength decoder +# +# Copyright (c) Secret Labs AB 1997-98. +# Copyright (c) Fredrik Lundh 1995-97. +# +# See the README file for information on usage and redistribution. +# +from __future__ import annotations + +import warnings + +from . import Image, ImageFile, ImagePalette +from ._binary import i16le as i16 +from ._binary import o8 +from ._binary import o16le as o16 + +# +# -------------------------------------------------------------------- +# Read RGA file + + +MODES = { + # map imagetype/depth to rawmode + (1, 8): "P", + (3, 1): "1", + (3, 8): "L", + (3, 16): "LA", + (2, 16): "BGR;5", + (2, 24): "BGR", + (2, 32): "BGRA", +} + + +## +# Image plugin for Targa files. + + +class TgaImageFile(ImageFile.ImageFile): + format = "TGA" + format_description = "Targa" + + def _open(self): + # process header + s = self.fp.read(18) + + id_len = s[0] + + colormaptype = s[1] + imagetype = s[2] + + depth = s[16] + + flags = s[17] + + self._size = i16(s, 12), i16(s, 14) + + # validate header fields + if ( + colormaptype not in (0, 1) + or self.size[0] <= 0 + or self.size[1] <= 0 + or depth not in (1, 8, 16, 24, 32) + ): + msg = "not a TGA file" + raise SyntaxError(msg) + + # image mode + if imagetype in (3, 11): + self._mode = "L" + if depth == 1: + self._mode = "1" # ??? + elif depth == 16: + self._mode = "LA" + elif imagetype in (1, 9): + self._mode = "P" + elif imagetype in (2, 10): + self._mode = "RGB" + if depth == 32: + self._mode = "RGBA" + else: + msg = "unknown TGA mode" + raise SyntaxError(msg) + + # orientation + orientation = flags & 0x30 + self._flip_horizontally = orientation in [0x10, 0x30] + if orientation in [0x20, 0x30]: + orientation = 1 + elif orientation in [0, 0x10]: + orientation = -1 + else: + msg = "unknown TGA orientation" + raise SyntaxError(msg) + + self.info["orientation"] = orientation + + if imagetype & 8: + self.info["compression"] = "tga_rle" + + if id_len: + self.info["id_section"] = self.fp.read(id_len) + + if colormaptype: + # read palette + start, size, mapdepth = i16(s, 3), i16(s, 5), s[7] + if mapdepth == 16: + self.palette = ImagePalette.raw( + "BGR;15", b"\0" * 2 * start + self.fp.read(2 * size) + ) + elif mapdepth == 24: + self.palette = ImagePalette.raw( + "BGR", b"\0" * 3 * start + self.fp.read(3 * size) + ) + elif mapdepth == 32: + self.palette = ImagePalette.raw( + "BGRA", b"\0" * 4 * start + self.fp.read(4 * size) + ) + + # setup tile descriptor + try: + rawmode = MODES[(imagetype & 7, depth)] + if imagetype & 8: + # compressed + self.tile = [ + ( + "tga_rle", + (0, 0) + self.size, + self.fp.tell(), + (rawmode, orientation, depth), + ) + ] + else: + self.tile = [ + ( + "raw", + (0, 0) + self.size, + self.fp.tell(), + (rawmode, 0, orientation), + ) + ] + except KeyError: + pass # cannot decode + + def load_end(self): + if self._flip_horizontally: + self.im = self.im.transpose(Image.Transpose.FLIP_LEFT_RIGHT) + + +# +# -------------------------------------------------------------------- +# Write TGA file + + +SAVE = { + "1": ("1", 1, 0, 3), + "L": ("L", 8, 0, 3), + "LA": ("LA", 16, 0, 3), + "P": ("P", 8, 1, 1), + "RGB": ("BGR", 24, 0, 2), + "RGBA": ("BGRA", 32, 0, 2), +} + + +def _save(im, fp, filename): + try: + rawmode, bits, colormaptype, imagetype = SAVE[im.mode] + except KeyError as e: + msg = f"cannot write mode {im.mode} as TGA" + raise OSError(msg) from e + + if "rle" in im.encoderinfo: + rle = im.encoderinfo["rle"] + else: + compression = im.encoderinfo.get("compression", im.info.get("compression")) + rle = compression == "tga_rle" + if rle: + imagetype += 8 + + id_section = im.encoderinfo.get("id_section", im.info.get("id_section", "")) + id_len = len(id_section) + if id_len > 255: + id_len = 255 + id_section = id_section[:255] + warnings.warn("id_section has been trimmed to 255 characters") + + if colormaptype: + palette = im.im.getpalette("RGB", "BGR") + colormaplength, colormapentry = len(palette) // 3, 24 + else: + colormaplength, colormapentry = 0, 0 + + if im.mode in ("LA", "RGBA"): + flags = 8 + else: + flags = 0 + + orientation = im.encoderinfo.get("orientation", im.info.get("orientation", -1)) + if orientation > 0: + flags = flags | 0x20 + + fp.write( + o8(id_len) + + o8(colormaptype) + + o8(imagetype) + + o16(0) # colormapfirst + + o16(colormaplength) + + o8(colormapentry) + + o16(0) + + o16(0) + + o16(im.size[0]) + + o16(im.size[1]) + + o8(bits) + + o8(flags) + ) + + if id_section: + fp.write(id_section) + + if colormaptype: + fp.write(palette) + + if rle: + ImageFile._save( + im, fp, [("tga_rle", (0, 0) + im.size, 0, (rawmode, orientation))] + ) + else: + ImageFile._save( + im, fp, [("raw", (0, 0) + im.size, 0, (rawmode, 0, orientation))] + ) + + # write targa version 2 footer + fp.write(b"\000" * 8 + b"TRUEVISION-XFILE." + b"\000") + + +# +# -------------------------------------------------------------------- +# Registry + + +Image.register_open(TgaImageFile.format, TgaImageFile) +Image.register_save(TgaImageFile.format, _save) + +Image.register_extensions(TgaImageFile.format, [".tga", ".icb", ".vda", ".vst"]) + +Image.register_mime(TgaImageFile.format, "image/x-tga") diff --git a/shared/package-files/4a/4a087a2edb32c1ba41390e2f0f344577aff3775e4e7695eabe128e3348396058/native_layer_norm.h b/shared/package-files/4a/4a087a2edb32c1ba41390e2f0f344577aff3775e4e7695eabe128e3348396058/native_layer_norm.h new file mode 100644 index 0000000000000000000000000000000000000000..336eb8bf21d61b6999cb5b52ddbcc9b597945211 --- /dev/null +++ b/shared/package-files/4a/4a087a2edb32c1ba41390e2f0f344577aff3775e4e7695eabe128e3348396058/native_layer_norm.h @@ -0,0 +1,91 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::native_layer_norm(Tensor input, SymInt[] normalized_shape, Tensor? weight, Tensor? bias, float eps) -> (Tensor, Tensor, Tensor) +inline ::std::tuple native_layer_norm(const at::Tensor & input, at::IntArrayRef normalized_shape, const c10::optional & weight, const c10::optional & bias, double eps) { + return at::_ops::native_layer_norm::call(input, c10::fromIntArrayRefSlow(normalized_shape), weight, bias, eps); +} +namespace symint { + template ::value>> + ::std::tuple native_layer_norm(const at::Tensor & input, at::IntArrayRef normalized_shape, const c10::optional & weight, const c10::optional & bias, double eps) { + return at::_ops::native_layer_norm::call(input, c10::fromIntArrayRefSlow(normalized_shape), weight, bias, eps); + } +} + +// aten::native_layer_norm(Tensor input, SymInt[] normalized_shape, Tensor? weight, Tensor? bias, float eps) -> (Tensor, Tensor, Tensor) +inline ::std::tuple native_layer_norm_symint(const at::Tensor & input, c10::SymIntArrayRef normalized_shape, const c10::optional & weight, const c10::optional & bias, double eps) { + return at::_ops::native_layer_norm::call(input, normalized_shape, weight, bias, eps); +} +namespace symint { + template ::value>> + ::std::tuple native_layer_norm(const at::Tensor & input, c10::SymIntArrayRef normalized_shape, const c10::optional & weight, const c10::optional & bias, double eps) { + return at::_ops::native_layer_norm::call(input, normalized_shape, weight, bias, eps); + } +} + +// aten::native_layer_norm.out(Tensor input, SymInt[] normalized_shape, Tensor? weight, Tensor? bias, float eps, *, Tensor(a!) out0, Tensor(b!) out1, Tensor(c!) out2) -> (Tensor(a!), Tensor(b!), Tensor(c!)) +inline ::std::tuple native_layer_norm_out(at::Tensor & out0, at::Tensor & out1, at::Tensor & out2, const at::Tensor & input, at::IntArrayRef normalized_shape, const c10::optional & weight, const c10::optional & bias, double eps) { + return at::_ops::native_layer_norm_out::call(input, c10::fromIntArrayRefSlow(normalized_shape), weight, bias, eps, out0, out1, out2); +} +namespace symint { + template ::value>> + ::std::tuple native_layer_norm_out(at::Tensor & out0, at::Tensor & out1, at::Tensor & out2, const at::Tensor & input, at::IntArrayRef normalized_shape, const c10::optional & weight, const c10::optional & bias, double eps) { + return at::_ops::native_layer_norm_out::call(input, c10::fromIntArrayRefSlow(normalized_shape), weight, bias, eps, out0, out1, out2); + } +} + +// aten::native_layer_norm.out(Tensor input, SymInt[] normalized_shape, Tensor? weight, Tensor? bias, float eps, *, Tensor(a!) out0, Tensor(b!) out1, Tensor(c!) out2) -> (Tensor(a!), Tensor(b!), Tensor(c!)) +inline ::std::tuple native_layer_norm_outf(const at::Tensor & input, at::IntArrayRef normalized_shape, const c10::optional & weight, const c10::optional & bias, double eps, at::Tensor & out0, at::Tensor & out1, at::Tensor & out2) { + return at::_ops::native_layer_norm_out::call(input, c10::fromIntArrayRefSlow(normalized_shape), weight, bias, eps, out0, out1, out2); +} +namespace symint { + template ::value>> + ::std::tuple native_layer_norm_outf(const at::Tensor & input, at::IntArrayRef normalized_shape, const c10::optional & weight, const c10::optional & bias, double eps, at::Tensor & out0, at::Tensor & out1, at::Tensor & out2) { + return at::_ops::native_layer_norm_out::call(input, c10::fromIntArrayRefSlow(normalized_shape), weight, bias, eps, out0, out1, out2); + } +} + +// aten::native_layer_norm.out(Tensor input, SymInt[] normalized_shape, Tensor? weight, Tensor? bias, float eps, *, Tensor(a!) out0, Tensor(b!) out1, Tensor(c!) out2) -> (Tensor(a!), Tensor(b!), Tensor(c!)) +inline ::std::tuple native_layer_norm_symint_out(at::Tensor & out0, at::Tensor & out1, at::Tensor & out2, const at::Tensor & input, c10::SymIntArrayRef normalized_shape, const c10::optional & weight, const c10::optional & bias, double eps) { + return at::_ops::native_layer_norm_out::call(input, normalized_shape, weight, bias, eps, out0, out1, out2); +} +namespace symint { + template ::value>> + ::std::tuple native_layer_norm_out(at::Tensor & out0, at::Tensor & out1, at::Tensor & out2, const at::Tensor & input, c10::SymIntArrayRef normalized_shape, const c10::optional & weight, const c10::optional & bias, double eps) { + return at::_ops::native_layer_norm_out::call(input, normalized_shape, weight, bias, eps, out0, out1, out2); + } +} + +// aten::native_layer_norm.out(Tensor input, SymInt[] normalized_shape, Tensor? weight, Tensor? bias, float eps, *, Tensor(a!) out0, Tensor(b!) out1, Tensor(c!) out2) -> (Tensor(a!), Tensor(b!), Tensor(c!)) +inline ::std::tuple native_layer_norm_symint_outf(const at::Tensor & input, c10::SymIntArrayRef normalized_shape, const c10::optional & weight, const c10::optional & bias, double eps, at::Tensor & out0, at::Tensor & out1, at::Tensor & out2) { + return at::_ops::native_layer_norm_out::call(input, normalized_shape, weight, bias, eps, out0, out1, out2); +} +namespace symint { + template ::value>> + ::std::tuple native_layer_norm_outf(const at::Tensor & input, c10::SymIntArrayRef normalized_shape, const c10::optional & weight, const c10::optional & bias, double eps, at::Tensor & out0, at::Tensor & out1, at::Tensor & out2) { + return at::_ops::native_layer_norm_out::call(input, normalized_shape, weight, bias, eps, out0, out1, out2); + } +} + +} diff --git a/shared/package-files/4a/4a0a015815c9383869ea088263a6f88e8352a05f133d05bf601f7e8ec9a49be9/_arraystruct.h b/shared/package-files/4a/4a0a015815c9383869ea088263a6f88e8352a05f133d05bf601f7e8ec9a49be9/_arraystruct.h new file mode 100644 index 0000000000000000000000000000000000000000..dcb866e2baca2602d112202e70d2e318b38e5f98 --- /dev/null +++ b/shared/package-files/4a/4a0a015815c9383869ea088263a6f88e8352a05f133d05bf601f7e8ec9a49be9/_arraystruct.h @@ -0,0 +1,21 @@ +#ifndef NUMBA_ARYSTRUCT_H_ +#define NUMBA_ARYSTRUCT_H_ +/* + * Fill in the *arystruct* with information from the Numpy array *obj*. + * *arystruct*'s layout is defined in numba.targets.arrayobj (look + * for the ArrayTemplate class). + */ + +typedef struct { + void *meminfo; /* see _nrt_python.c and nrt.h in numba/core/runtime */ + PyObject *parent; + npy_intp nitems; + npy_intp itemsize; + void *data; + + npy_intp shape_and_strides[]; +} arystruct_t; + + +#endif /* NUMBA_ARYSTRUCT_H_ */ + diff --git a/shared/package-files/4a/4a0b889244402c6dd4f50f265166a415edcf98f1e0db4e9b8eb47917648a2e78/docstring.py b/shared/package-files/4a/4a0b889244402c6dd4f50f265166a415edcf98f1e0db4e9b8eb47917648a2e78/docstring.py new file mode 100644 index 0000000000000000000000000000000000000000..99f0b8b5c1d36ca0fa5642f4a020739069d56f02 --- /dev/null +++ b/shared/package-files/4a/4a0b889244402c6dd4f50f265166a415edcf98f1e0db4e9b8eb47917648a2e78/docstring.py @@ -0,0 +1,778 @@ +"""Substantially copied from NumpyDoc 1.0pre""" + +from collections.abc import Mapping +import copy +import inspect +import re +import textwrap +from typing import NamedTuple + +from statsmodels.tools.sm_exceptions import ParseError + + +def dedent_lines(lines): + """ + Deindent a list of lines maximally + + Parameters + ---------- + lines : list of str + The lines to dedent. + + Returns + ------- + list of str + The dedented lines. + """ + return textwrap.dedent("\n".join(lines)).split("\n") + + +def strip_blank_lines(line): + """ + Remove leading and trailing blank lines from a list of lines + + Parameters + ---------- + line : list of str + The lines to strip. Modified and returned in place. + + Returns + ------- + list of str + The lines with leading and trailing blank lines removed. + """ + while line and not line[0].strip(): + del line[0] + while line and not line[-1].strip(): + del line[-1] + return line + + +class Reader: + """A line-based string reader""" + + def __init__(self, data): + """ + Parameters + ---------- + data : str or list of str + String with lines separated by '\\n', or a list of lines. + """ + if isinstance(data, list): + self._str = data + else: + self._str = data.split("\n") # store string as list of lines + + self.reset() + + def __getitem__(self, n): + return self._str[n] + + def reset(self): + self._line_num = 0 # current line nr + + def read(self): + if not self.eof(): + out = self[self._line_num] + self._line_num += 1 + return out + else: + return "" + + def seek_next_non_empty_line(self): + for line in self[self._line_num :]: + if line.strip(): + break + self._line_num += 1 + + def eof(self): + return self._line_num >= len(self._str) + + def read_to_condition(self, condition_func): + start = self._line_num + for line in self[start:]: + if condition_func(line): + return self[start : self._line_num] + self._line_num += 1 + if self.eof(): + return self[start : self._line_num + 1] + return [] + + def read_to_next_empty_line(self): + self.seek_next_non_empty_line() + + def is_empty(line): + return not line.strip() + + return self.read_to_condition(is_empty) + + def read_to_next_unindented_line(self): + def is_unindented(line): + return line.strip() and (len(line.lstrip()) == len(line)) + + return self.read_to_condition(is_unindented) + + def peek(self, n=0): + if self._line_num + n < len(self._str): + return self[self._line_num + n] + else: + return "" + + def is_empty(self): + return not "".join(self._str).strip() + + +class Parameter(NamedTuple): + """ + A single parameter, return value, or attribute entry + + Attributes + ---------- + name : str + The name of the parameter. + type : str + The type description of the parameter, as written in the docstring. + desc : list of str + The description lines for the parameter. + """ + + name: str + type: type + desc: list[str] + + +class NumpyDocString(Mapping): + """ + Parses a numpydoc string to an abstract representation + + Instances define a mapping from section title to structured data. + + Parameters + ---------- + docstring : str + The numpydoc-formatted docstring to parse. + """ + + def __init__(self, docstring): + orig_docstring = docstring + docstring = textwrap.dedent(docstring).split("\n") + + self._doc = Reader(docstring) + + self._parsed_data = { + "Signature": "", + "Summary": [""], + "Extended Summary": [], + "Parameters": [], + "Returns": [], + "Yields": [], + "Receives": [], + "Raises": [], + "Warns": [], + "Other Parameters": [], + "Attributes": [], + "Methods": [], + "See Also": [], + "Notes": [], + "Warnings": [], + "References": "", + "Examples": "", + "index": {}, + } + + try: + self._parse() + except ParseError as e: + e.docstring = orig_docstring + raise + + def __getitem__(self, key): + return self._parsed_data[key] + + def __setitem__(self, key, val): + if key not in self._parsed_data: + self._error_location(f"Unknown section {key}") + else: + self._parsed_data[key] = val + + def __iter__(self): + return iter(self._parsed_data) + + def __len__(self): + return len(self._parsed_data) + + def _is_at_section(self): + self._doc.seek_next_non_empty_line() + + if self._doc.eof(): + return False + + l1 = self._doc.peek().strip() # e.g., Parameters + + if l1.startswith(".. index::"): + return True + + l2 = self._doc.peek(1).strip() # ---------- or ========== + return l2.startswith(("-" * len(l1), "=" * len(l1))) + + def _strip(self, doc): + i = 0 + j = 0 + for line in doc: + if line.strip(): + break + + for line in doc[::-1]: + if line.strip(): + break + + return doc[i : len(doc) - j] + + def _read_to_next_section(self): + section = self._doc.read_to_next_empty_line() + + while not self._is_at_section() and not self._doc.eof(): + if not self._doc.peek(-1).strip(): # previous line was empty + section += [""] + + section += self._doc.read_to_next_empty_line() + + return section + + def _read_sections(self): + while not self._doc.eof(): + data = self._read_to_next_section() + name = data[0].strip() + + if name.startswith(".."): # index section + yield name, data[1:] + elif len(data) < 2: + yield StopIteration + else: + yield name, self._strip(data[2:]) + + def _parse_param_list(self, content, single_element_is_type=False): + r = Reader(content) + params = [] + while not r.eof(): + header = r.read().strip() + if " : " in header: + arg_name, arg_type = header.split(" : ")[:2] + elif single_element_is_type: + arg_name, arg_type = "", header + else: + arg_name, arg_type = header, "" + + desc = r.read_to_next_unindented_line() + desc = dedent_lines(desc) + desc = strip_blank_lines(desc) + + params.append(Parameter(arg_name, arg_type, desc)) + + return params + + # See also supports the following formats. + # + # + # SPACE* COLON SPACE+ SPACE* + # ( COMMA SPACE+ )+ (COMMA | PERIOD)? SPACE* + # ( COMMA SPACE+ )* SPACE* COLON SPACE+ SPACE* + + # is one of + # + # COLON COLON BACKTICK BACKTICK + # where + # is a legal function name, and + # is any nonempty sequence of word characters. + # Examples: func_f1 :meth:`func_h1` :obj:`~baz.obj_r` :class:`class_j` + # is a string describing the function. + + _role = r":(?P\w+):" + _funcbacktick = r"`(?P(?:~\w+\.)?[a-zA-Z0-9_\.-]+)`" + _funcplain = r"(?P[a-zA-Z0-9_\.-]+)" + _funcname = r"(" + _role + _funcbacktick + r"|" + _funcplain + r")" + _funcnamenext = _funcname.replace("role", "rolenext") + _funcnamenext = _funcnamenext.replace("name", "namenext") + _description = r"(?P\s*:(\s+(?P\S+.*))?)?\s*$" + _func_rgx = re.compile(r"^\s*" + _funcname + r"\s*") + _line_rgx = re.compile( + r"^\s*" + r"(?P" + + _funcname # group for all function names + + r"(?P([,]\s+" + + _funcnamenext + + r")*)" + + r")" # end of "allfuncs" + + + # Some function lists have a trailing comma (or period) + r"(?P[,\.])?" + _description + ) + + # Empty elements are replaced with '..' + + empty_description = ".." + + def _parse_see_also(self, content): + """ + func_name : Descriptive text + continued text + another_func_name : Descriptive text + func_name1, func_name2, :meth:`func_name`, func_name3 + """ + items = [] + + def parse_item_name(text): + """Match ':role:`name`' or 'name'""" + m = self._func_rgx.match(text) + if not m: + raise ParseError(f"{text} is not a item name") + role = m.group("role") + name = m.group("name") if role else m.group("name2") + return name, role, m.end() + + rest = [] + for line in content: + if not line.strip(): + continue + + line_match = self._line_rgx.match(line) + description = None + if line_match: + description = line_match.group("desc") + if line_match.group("trailing") and description: + self._error_location( + "Unexpected comma or period after function list at " + "index {:d} of line " + '"{}"'.format(line_match.end("trailing"), line) + ) + if not description and line.startswith(" "): + rest.append(line.strip()) + elif line_match: + funcs = [] + text = line_match.group("allfuncs") + while True: + if not text.strip(): + break + name, role, match_end = parse_item_name(text) + funcs.append((name, role)) + text = text[match_end:].strip() + if text and text[0] == ",": + text = text[1:].strip() + rest = [description] if description else [] + items.append((funcs, rest)) + else: + raise ParseError(f"{line} is not a item name") + return items + + def _parse_index(self, section, content): + """ + .. index: default + :refguide: something, else, and more + """ + + def strip_each_in(lst): + return [s.strip() for s in lst] + + out = {} + section = section.split("::") + if len(section) > 1: + out["default"] = strip_each_in(section[1].split(","))[0] + for line in content: + line_parts = line.split(":") + if len(line_parts) > 2: + out[line_parts[1]] = strip_each_in(line_parts[2].split(",")) + return out + + def _parse_summary(self): + """Grab signature (if given) and summary""" + if self._is_at_section(): + return + + # If several signatures present, take the last one + while True: + summary = self._doc.read_to_next_empty_line() + summary_str = " ".join([s.strip() for s in summary]).strip() + compiled = re.compile(r"^([\w., ]+=)?\s*[\w\.]+\(.*\)$") + if compiled.match(summary_str): + self["Signature"] = summary_str + if not self._is_at_section(): + continue + break + + if summary is not None: + self["Summary"] = summary + + if not self._is_at_section(): + self["Extended Summary"] = self._read_to_next_section() + + def _parse(self): + self._doc.reset() + self._parse_summary() + + sections = list(self._read_sections()) + section_names = {section for section, content in sections} + + has_returns = "Returns" in section_names + has_yields = "Yields" in section_names + # We could do more tests, but we are not. Arbitrarily. + if has_returns and has_yields: + msg = "Docstring contains both a Returns and Yields section." + raise ValueError(msg) + if not has_yields and "Receives" in section_names: + msg = "Docstring contains a Receives section but not Yields." + raise ValueError(msg) + + for section, content in sections: + section_name = section + if not section_name.startswith(".."): + section_name = " ".join(s.capitalize() for s in section_name.split(" ")) + if self.get(section_name): + self._error_location(f"The section {section_name} appears twice") + + if section_name in ( + "Parameters", + "Other Parameters", + "Attributes", + "Methods", + ): + self[section_name] = self._parse_param_list(content) + elif section_name in ( + "Returns", + "Yields", + "Raises", + "Warns", + "Receives", + ): + self[section_name] = self._parse_param_list( + content, single_element_is_type=True + ) + elif section_name.startswith(".. index::"): + self["index"] = self._parse_index(section_name, content) + elif section_name == "See Also": + self["See Also"] = self._parse_see_also(content) + else: + self[section_name] = content + + def _error_location(self, msg): + if hasattr(self, "_obj"): + # we know where the docs came from: + try: + filename = inspect.getsourcefile(self._obj) + except TypeError: + filename = None + msg = msg + (f" in the docstring of {self._obj} in {filename}.") + + raise ValueError(msg) + + # string conversion routines + + def _str_header(self, name, symbol="-"): + return [name, len(name) * symbol] + + def _str_indent(self, doc, indent=4): + out = [] + for line in doc: + out += [" " * indent + line] + return out + + def _str_signature(self): + if self["Signature"]: + return [self["Signature"].replace("*", r"\*"), ""] + else: + return [""] + + def _str_summary(self): + if self["Summary"]: + return self["Summary"] + [""] + else: + return [] + + def _str_extended_summary(self): + if self["Extended Summary"]: + return self["Extended Summary"] + [""] + else: + return [] + + def _str_param_list(self, name): + out = [] + if self[name]: + out += self._str_header(name) + for param in self[name]: + parts = [] + if param.name: + parts.append(param.name) + if param.type: + parts.append(param.type) + out += [" : ".join(parts)] + if param.desc and "".join(param.desc).strip(): + out += self._str_indent(param.desc) + out += [""] + return out + + def _str_section(self, name): + out = [] + if self[name]: + out += self._str_header(name) + out += self[name] + out += [""] + return out + + def _str_see_also(self, func_role): + if not self["See Also"]: + return [] + out = [] + out += self._str_header("See Also") + last_had_desc = True + for funcs, desc in self["See Also"]: + assert isinstance(funcs, list) + links = [] + for func, role in funcs: + if role: + link = f":{role}:`{func}`" + elif func_role: + link = f":{func_role}:`{func}`" + else: + link = f"{func}" + links.append(link) + link = ", ".join(links) + out += [link] + if desc: + out += self._str_indent([" ".join(desc)]) + last_had_desc = True + else: + last_had_desc = False + out += self._str_indent([self.empty_description]) + + if last_had_desc: + out += [""] + return out + + def _str_index(self): + idx = self["index"] + out = [] + output_index = False + default_index = idx.get("default", "") + if default_index: + output_index = True + out += [f".. index:: {default_index}"] + for section, references in idx.items(): + if section == "default": + continue + output_index = True + out += [" :{}: {}".format(section, ", ".join(references))] + if output_index: + return out + else: + return "" + + def __str__(self, func_role=""): + out = [] + out += self._str_signature() + out += self._str_summary() + out += self._str_extended_summary() + for param_list in ( + "Parameters", + "Returns", + "Yields", + "Receives", + "Other Parameters", + "Raises", + "Warns", + ): + out += self._str_param_list(param_list) + out += self._str_section("Warnings") + out += self._str_see_also(func_role) + for s in ("Notes", "References", "Examples"): + out += self._str_section(s) + for param_list in ("Attributes", "Methods"): + out += self._str_param_list(param_list) + out += self._str_index() + return "\n".join(out) + + +class Docstring: + """ + Docstring modification + + Parameters + ---------- + docstring : str + The docstring to modify. + """ + + def __init__(self, docstring): + self._ds = None + self._docstring = docstring + if docstring is None or not docstring.strip(): + self._docstring = None + return + self._ds = NumpyDocString(docstring) + + def remove_parameters(self, parameters): + """ + Remove parameters from the Parameters section of the docstring + + Parameters + ---------- + parameters : str or list of str + The names of the parameters to remove. + """ + if self._docstring is None: + # Protection against -oo execution + return + if isinstance(parameters, str): + parameters = [parameters] + repl = [ + param for param in self._ds["Parameters"] if param.name not in parameters + ] + if len(repl) + len(parameters) != len(self._ds["Parameters"]): + raise ValueError("One or more parameters were not found.") + self._ds["Parameters"] = repl + + def insert_parameters(self, after, parameters): + """ + Insert parameters into the Parameters section of the docstring + + Parameters + ---------- + after : None or str + If None, insert the parameters before the first parameter in the + docstring. Otherwise, the name of the existing parameter after + which the new parameters are inserted. + parameters : Parameter, list[Parameter] + A Parameter or a list of Parameters. + """ + if self._docstring is None: + # Protection against -oo execution + return + if isinstance(parameters, Parameter): + parameters = [parameters] + if after is None: + self._ds["Parameters"] = parameters + self._ds["Parameters"] + else: + loc = -1 + for i, param in enumerate(self._ds["Parameters"]): + if param.name == after: + loc = i + 1 + break + if loc < 0: + raise ValueError + params = self._ds["Parameters"][:loc] + parameters + params += self._ds["Parameters"][loc:] + self._ds["Parameters"] = params + + def replace_block(self, block_name, block): + """ + Replace a block of the docstring with a new block + + Parameters + ---------- + block_name : str + Name of the block to replace, e.g., 'Summary'. + block : object + The replacement block. The structure of the replacement block must + match how the block is stored by NumpyDocString. + """ + if self._docstring is None: + # Protection against -oo execution + return + block_name = " ".join(word.capitalize() for word in block_name.split(" ")) + if block_name not in self._ds: + raise ValueError(f"{block_name} is not a block in the docstring") + if not isinstance(block, list) and isinstance(self._ds[block_name], list): + block = [block] + self._ds[block_name] = block + + def extract_parameters(self, parameters, indent=0): + """ + Extract a subset of parameters into a standalone docstring + + Parameters + ---------- + parameters : str or list of str + The names of the parameters to extract. + indent : int, optional + Number of spaces to indent every line of the output. Default is + 0, which does not indent the output. + + Returns + ------- + str + A docstring fragment containing only the requested parameters. + """ + if self._docstring is None: + # Protection against -oo execution + return None + if isinstance(parameters, str): + parameters = [parameters] + ds_params = {param.name: param for param in self._ds["Parameters"]} + missing = set(parameters).difference(ds_params.keys()) + if missing: + raise ValueError( + "{} were not found in the docstring".format(",".join(missing)) + ) + final = [ds_params[param] for param in parameters] + ds = copy.deepcopy(self._ds) + for key in ds: + if key != "Parameters": + ds[key] = [] if key != "index" else {} + else: + ds[key] = final + out = str(ds).strip() + if indent: + out = textwrap.indent(out, " " * indent) + + out = "\n".join(out.split("\n")[2:]) + return out + + def __str__(self): + return str(self._ds) + + +def remove_parameters(docstring, parameters): + """ + Remove parameters from a numpydoc docstring + + Parameters + ---------- + docstring : str + The docstring to modify. + parameters : str or list of str + The names of the parameters to remove. + + Returns + ------- + str + The modified docstring. + """ + if docstring is None: + return None + ds = Docstring(docstring) + ds.remove_parameters(parameters) + return str(ds) + + +def indent(text, prefix, predicate=None): + """ + Non-protected indent + + Parameters + ---------- + text : None or str + If None, function always returns "" + prefix : str + Prefix to add to the start of each line + predicate : callable, optional + If provided, 'prefix' will only be added to the lines + where 'predicate(line)' is True. If 'predicate' is not provided, + it will default to adding 'prefix' to all non-empty lines that do not + consist solely of whitespace characters. + + Returns + ------- + str + The indented text, or an empty string if `text` is None. + """ + if text is None: + return "" + return textwrap.indent(text, prefix, predicate=predicate) diff --git a/shared/package-files/4a/4a118085fcad8bd48d00fe843b6f846a871cf4b66fb58e52e6241b661da66a18/cumprod_backward.h b/shared/package-files/4a/4a118085fcad8bd48d00fe843b6f846a871cf4b66fb58e52e6241b661da66a18/cumprod_backward.h new file mode 100644 index 0000000000000000000000000000000000000000..283d3bcaddc2d3c96216c02da2cb1d1d9af07caf --- /dev/null +++ b/shared/package-files/4a/4a118085fcad8bd48d00fe843b6f846a871cf4b66fb58e52e6241b661da66a18/cumprod_backward.h @@ -0,0 +1,30 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::cumprod_backward(Tensor grad, Tensor input, int dim, Tensor output) -> Tensor +inline at::Tensor cumprod_backward(const at::Tensor & grad, const at::Tensor & input, int64_t dim, const at::Tensor & output) { + return at::_ops::cumprod_backward::call(grad, input, dim, output); +} + +} diff --git a/shared/package-files/4a/4a11b7d98f0edb61759a2914bd6f87294bb8050d9fbdc96d53a8d3f93265f8ae/_test_autograd_multiple_dispatch_view_compositeexplicitautograd_dispatch.h b/shared/package-files/4a/4a11b7d98f0edb61759a2914bd6f87294bb8050d9fbdc96d53a8d3f93265f8ae/_test_autograd_multiple_dispatch_view_compositeexplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..a2179510d67f25003a2ea5b243fdfdefa9efa18c --- /dev/null +++ b/shared/package-files/4a/4a11b7d98f0edb61759a2914bd6f87294bb8050d9fbdc96d53a8d3f93265f8ae/_test_autograd_multiple_dispatch_view_compositeexplicitautograd_dispatch.h @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API at::Tensor _test_autograd_multiple_dispatch_view(const at::Tensor & self); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/4a/4a11f14c57407cf3eae8abfaa9689b5350ba9e4ba59c15fe864220049566d52f/cub.h b/shared/package-files/4a/4a11f14c57407cf3eae8abfaa9689b5350ba9e4ba59c15fe864220049566d52f/cub.h new file mode 100644 index 0000000000000000000000000000000000000000..dcd7cd66505e0f77ca0a6455a0125ed8b2b7b8d5 --- /dev/null +++ b/shared/package-files/4a/4a11f14c57407cf3eae8abfaa9689b5350ba9e4ba59c15fe864220049566d52f/cub.h @@ -0,0 +1,87 @@ +#pragma once +#include +#include +#include + +// NOTE: These templates are intentionally not defined in this header, +// which aviods re-compiling them for each translation unit. If you get +// a link error, you need to add an explicit instantiation for your +// types in cub.cu + +namespace at::cuda::cub { + +inline int get_num_bits(uint64_t max_key) { + int num_bits = 1; + while (max_key > 1) { + max_key >>= 1; + num_bits++; + } + return num_bits; +} + +namespace detail { + +// radix_sort_pairs doesn't interact with value_t other than to copy +// the data, so we can save template instantiations by reinterpreting +// it as an opaque type. +template struct alignas(N) OpaqueType { char data[N]; }; + +template +void radix_sort_pairs_impl( + const key_t *keys_in, key_t *keys_out, + const OpaqueType *values_in, OpaqueType *values_out, + int64_t n, bool descending, int64_t begin_bit, int64_t end_bit); + +} // namespace detail + +template +void radix_sort_pairs( + const key_t *keys_in, key_t *keys_out, + const value_t *values_in, value_t *values_out, + int64_t n, bool descending=false, int64_t begin_bit=0, int64_t end_bit=sizeof(key_t)*8) { + static_assert(std::is_trivially_copyable::value || + AT_ROCM_ENABLED(), // ROCm incorrectly fails this check for vector types + "radix_sort_pairs value type must be trivially copyable"); + // Make value type opaque, so all inputs of a certain size use the same template instantiation + using opaque_t = detail::OpaqueType; + static_assert(sizeof(value_t) <= 8 && (sizeof(value_t) & (sizeof(value_t) - 1)) == 0, + "This size of value_t is not instantiated. Please instantiate it in cub.cu" + " and modify this check."); + static_assert(sizeof(value_t) == alignof(value_t), "Expected value_t to be size-aligned"); + detail::radix_sort_pairs_impl( + keys_in, keys_out, + reinterpret_cast(values_in), + reinterpret_cast(values_out), + n, descending, begin_bit, end_bit); +} + +template +void radix_sort_keys( + const key_t *keys_in, key_t *keys_out, + int64_t n, bool descending=false, int64_t begin_bit=0, int64_t end_bit=sizeof(key_t)*8); + +// NOTE: Intermediate sums will be truncated to input_t precision +template +void inclusive_sum_truncating(const input_t *input, output_t *output, int64_t n); + +template +void inclusive_sum(const scalar_t *input, scalar_t *output, int64_t n) { + return inclusive_sum_truncating(input, output, n); +} + +// NOTE: Sums are done is common_type +template +void exclusive_sum_in_common_type(const input_t *input, output_t *output, int64_t n); + +template +void exclusive_sum(const scalar_t *input, scalar_t *output, int64_t n) { + return exclusive_sum_in_common_type(input, output, n); +} + +void mask_exclusive_sum(const uint8_t *mask, int64_t *output_idx, int64_t n); +inline void mask_exclusive_sum(const bool *mask, int64_t *output_idx, int64_t n) { + return mask_exclusive_sum( + reinterpret_cast(mask), output_idx, n); +} + +} // namespace at::cuda::cub diff --git a/shared/package-files/4a/4a121744db6995211f64d8b9543603df28badf4e5e473e1399c844384bdc89cc/source.py b/shared/package-files/4a/4a121744db6995211f64d8b9543603df28badf4e5e473e1399c844384bdc89cc/source.py new file mode 100644 index 0000000000000000000000000000000000000000..71692b4aaad07df70b63d7e1eaa86c402ad03c4f --- /dev/null +++ b/shared/package-files/4a/4a121744db6995211f64d8b9543603df28badf4e5e473e1399c844384bdc89cc/source.py @@ -0,0 +1,40 @@ +""" +This module adds several functions for interactive source code inspection. +""" + + +def get_class(lookup_view): + """ + Convert a string version of a class name to the object. + + For example, get_class('sympy.core.Basic') will return + class Basic located in module sympy.core + """ + if isinstance(lookup_view, str): + mod_name, func_name = get_mod_func(lookup_view) + if func_name != '': + lookup_view = getattr( + __import__(mod_name, {}, {}, ['*']), func_name) + if not callable(lookup_view): + raise AttributeError( + "'%s.%s' is not a callable." % (mod_name, func_name)) + return lookup_view + + +def get_mod_func(callback): + """ + splits the string path to a class into a string path to the module + and the name of the class. + + Examples + ======== + + >>> from sympy.utilities.source import get_mod_func + >>> get_mod_func('sympy.core.basic.Basic') + ('sympy.core.basic', 'Basic') + + """ + dot = callback.rfind('.') + if dot == -1: + return callback, '' + return callback[:dot], callback[dot + 1:] diff --git a/shared/package-files/4a/4a13ad6b5f3173e8c59529e79478725ac0ee98bc9046bf756220b58ff80bf52c/test_evalf.py b/shared/package-files/4a/4a13ad6b5f3173e8c59529e79478725ac0ee98bc9046bf756220b58ff80bf52c/test_evalf.py new file mode 100644 index 0000000000000000000000000000000000000000..c218914b45805a1a2fdc6f2bbb17c8eb3f16e066 --- /dev/null +++ b/shared/package-files/4a/4a13ad6b5f3173e8c59529e79478725ac0ee98bc9046bf756220b58ff80bf52c/test_evalf.py @@ -0,0 +1,732 @@ +import math + +from sympy.concrete.products import (Product, product) +from sympy.concrete.summations import Sum +from sympy.core.add import Add +from sympy.core.evalf import N +from sympy.core.function import (Function, nfloat) +from sympy.core.mul import Mul +from sympy.core import (GoldenRatio) +from sympy.core.numbers import (AlgebraicNumber, E, Float, I, Rational, + oo, zoo, nan, pi) +from sympy.core.power import Pow +from sympy.core.relational import Eq +from sympy.core.singleton import S +from sympy.core.symbol import Symbol +from sympy.core.sympify import sympify +from sympy.functions.combinatorial.factorials import factorial +from sympy.functions.combinatorial.numbers import fibonacci +from sympy.functions.elementary.complexes import (Abs, re, im) +from sympy.functions.elementary.exponential import (exp, log) +from sympy.functions.elementary.hyperbolic import (acosh, cosh) +from sympy.functions.elementary.integers import (ceiling, floor) +from sympy.functions.elementary.miscellaneous import (Max, sqrt) +from sympy.functions.elementary.trigonometric import (acos, atan, cos, sin, tan) +from sympy.integrals.integrals import (Integral, integrate) +from sympy.polys.polytools import factor +from sympy.polys.rootoftools import CRootOf +from sympy.polys.specialpolys import cyclotomic_poly +from sympy.printing import srepr +from sympy.printing.str import sstr +from sympy.simplify.simplify import simplify +from sympy.core.numbers import comp +from sympy.core.evalf import (complex_accuracy, PrecisionExhausted, + scaled_zero, get_integer_part, as_mpmath, evalf, _evalf_with_bounded_error) +from mpmath import inf, ninf, make_mpc +from mpmath.libmp.libmpf import from_float, fzero +from sympy.core.expr import unchanged +from sympy.testing.pytest import raises, XFAIL +from sympy.abc import n, x, y + + +def NS(e, n=15, **options): + return sstr(sympify(e).evalf(n, **options), full_prec=True) + + +def test_evalf_helpers(): + from mpmath.libmp import finf + assert complex_accuracy((from_float(2.0), None, 35, None)) == 35 + assert complex_accuracy((from_float(2.0), from_float(10.0), 35, 100)) == 37 + assert complex_accuracy( + (from_float(2.0), from_float(1000.0), 35, 100)) == 43 + assert complex_accuracy((from_float(2.0), from_float(10.0), 100, 35)) == 35 + assert complex_accuracy( + (from_float(2.0), from_float(1000.0), 100, 35)) == 35 + assert complex_accuracy(finf) == math.inf + assert complex_accuracy(zoo) == math.inf + raises(ValueError, lambda: get_integer_part(zoo, 1, {})) + + +def test_evalf_basic(): + assert NS('pi', 15) == '3.14159265358979' + assert NS('2/3', 10) == '0.6666666667' + assert NS('355/113-pi', 6) == '2.66764e-7' + assert NS('16*atan(1/5)-4*atan(1/239)', 15) == '3.14159265358979' + + +def test_cancellation(): + assert NS(Add(pi, Rational(1, 10**1000), -pi, evaluate=False), 15, + maxn=1200) == '1.00000000000000e-1000' + + +def test_evalf_powers(): + assert NS('pi**(10**20)', 10) == '1.339148777e+49714987269413385435' + assert NS(pi**(10**100), 10) == ('4.946362032e+4971498726941338543512682882' + '9089887365167832438044244613405349992494711208' + '95526746555473864642912223') + assert NS('2**(1/10**50)', 15) == '1.00000000000000' + assert NS('2**(1/10**50)-1', 15) == '6.93147180559945e-51' + +# Evaluation of Rump's ill-conditioned polynomial + + +def test_evalf_rump(): + a = 1335*y**6/4 + x**2*(11*x**2*y**2 - y**6 - 121*y**4 - 2) + 11*y**8/2 + x/(2*y) + assert NS(a, 15, subs={x: 77617, y: 33096}) == '-0.827396059946821' + + +def test_evalf_complex(): + assert NS('2*sqrt(pi)*I', 10) == '3.544907702*I' + assert NS('3+3*I', 15) == '3.00000000000000 + 3.00000000000000*I' + assert NS('E+pi*I', 15) == '2.71828182845905 + 3.14159265358979*I' + assert NS('pi * (3+4*I)', 15) == '9.42477796076938 + 12.5663706143592*I' + assert NS('I*(2+I)', 15) == '-1.00000000000000 + 2.00000000000000*I' + + +@XFAIL +def test_evalf_complex_bug(): + assert NS('(pi+E*I)*(E+pi*I)', 15) in ('0.e-15 + 17.25866050002*I', + '0.e-17 + 17.25866050002*I', '-0.e-17 + 17.25866050002*I') + + +def test_evalf_complex_powers(): + assert NS('(E+pi*I)**100000000000000000') == \ + '-3.58896782867793e+61850354284995199 + 4.58581754997159e+61850354284995199*I' + # XXX: rewrite if a+a*I simplification introduced in SymPy + #assert NS('(pi + pi*I)**2') in ('0.e-15 + 19.7392088021787*I', '0.e-16 + 19.7392088021787*I') + assert NS('(pi + pi*I)**2', chop=True) == '19.7392088021787*I' + assert NS( + '(pi + 1/10**8 + pi*I)**2') == '6.2831853e-8 + 19.7392088650106*I' + assert NS('(pi + 1/10**12 + pi*I)**2') == '6.283e-12 + 19.7392088021850*I' + assert NS('(pi + pi*I)**4', chop=True) == '-389.636364136010' + assert NS( + '(pi + 1/10**8 + pi*I)**4') == '-389.636366616512 + 2.4805021e-6*I' + assert NS('(pi + 1/10**12 + pi*I)**4') == '-389.636364136258 + 2.481e-10*I' + assert NS( + '(10000*pi + 10000*pi*I)**4', chop=True) == '-3.89636364136010e+18' + + +@XFAIL +def test_evalf_complex_powers_bug(): + assert NS('(pi + pi*I)**4') == '-389.63636413601 + 0.e-14*I' + + +def test_evalf_exponentiation(): + assert NS(sqrt(-pi)) == '1.77245385090552*I' + assert NS(Pow(pi*I, Rational( + 1, 2), evaluate=False)) == '1.25331413731550 + 1.25331413731550*I' + assert NS(pi**I) == '0.413292116101594 + 0.910598499212615*I' + assert NS(pi**(E + I/3)) == '20.8438653991931 + 8.36343473930031*I' + assert NS((pi + I/3)**(E + I/3)) == '17.2442906093590 + 13.6839376767037*I' + assert NS(exp(pi)) == '23.1406926327793' + assert NS(exp(pi + E*I)) == '-21.0981542849657 + 9.50576358282422*I' + assert NS(pi**pi) == '36.4621596072079' + assert NS((-pi)**pi) == '-32.9138577418939 - 15.6897116534332*I' + assert NS((-pi)**(-pi)) == '-0.0247567717232697 + 0.0118013091280262*I' + +# An example from Smith, "Multiple Precision Complex Arithmetic and Functions" + + +def test_evalf_complex_cancellation(): + A = Rational('63287/100000') + B = Rational('52498/100000') + C = Rational('69301/100000') + D = Rational('83542/100000') + F = Rational('2231321613/2500000000') + # XXX: the number of returned mantissa digits in the real part could + # change with the implementation. What matters is that the returned digits are + # correct; those that are showing now are correct. + # >>> ((A+B*I)*(C+D*I)).expand() + # 64471/10000000000 + 2231321613*I/2500000000 + # >>> 2231321613*4 + # 8925286452L + assert NS((A + B*I)*(C + D*I), 6) == '6.44710e-6 + 0.892529*I' + assert NS((A + B*I)*(C + D*I), 10) == '6.447100000e-6 + 0.8925286452*I' + assert NS((A + B*I)*( + C + D*I) - F*I, 5) in ('6.4471e-6 + 0.e-14*I', '6.4471e-6 - 0.e-14*I') + + +def test_evalf_logs(): + assert NS("log(3+pi*I)", 15) == '1.46877619736226 + 0.808448792630022*I' + assert NS("log(pi*I)", 15) == '1.14472988584940 + 1.57079632679490*I' + assert NS('log(-1 + 0.00001)', 2) == '-1.0e-5 + 3.1*I' + assert NS('log(100, 10, evaluate=False)', 15) == '2.00000000000000' + assert NS('-2*I*log(-(-1)**(S(1)/9))', 15) == '-5.58505360638185' + + +def test_evalf_trig(): + assert NS('sin(1)', 15) == '0.841470984807897' + assert NS('cos(1)', 15) == '0.540302305868140' + assert NS('sin(10**-6)', 15) == '9.99999999999833e-7' + assert NS('cos(10**-6)', 15) == '0.999999999999500' + assert NS('sin(E*10**100)', 15) == '0.409160531722613' + # Some input near roots + assert NS(sin(exp(pi*sqrt(163))*pi), 15) == '-2.35596641936785e-12' + assert NS(sin(pi*10**100 + Rational(7, 10**5), evaluate=False), 15, maxn=120) == \ + '6.99999999428333e-5' + assert NS(sin(Rational(7, 10**5), evaluate=False), 15) == \ + '6.99999999428333e-5' + +# Check detection of various false identities + + +def test_evalf_near_integers(): + # Binet's formula + f = lambda n: ((1 + sqrt(5))**n)/(2**n * sqrt(5)) + assert NS(f(5000) - fibonacci(5000), 10, maxn=1500) == '5.156009964e-1046' + # Some near-integer identities from + # http://mathworld.wolfram.com/AlmostInteger.html + assert NS('sin(2017*2**(1/5))', 15) == '-1.00000000000000' + assert NS('sin(2017*2**(1/5))', 20) == '-0.99999999999999997857' + assert NS('1+sin(2017*2**(1/5))', 15) == '2.14322287389390e-17' + assert NS('45 - 613*E/37 + 35/991', 15) == '6.03764498766326e-11' + + +def test_evalf_ramanujan(): + assert NS(exp(pi*sqrt(163)) - 640320**3 - 744, 10) == '-7.499274028e-13' + # A related identity + A = 262537412640768744*exp(-pi*sqrt(163)) + B = 196884*exp(-2*pi*sqrt(163)) + C = 103378831900730205293632*exp(-3*pi*sqrt(163)) + assert NS(1 - A - B + C, 10) == '1.613679005e-59' + +# Input that for various reasons have failed at some point + + +def test_evalf_bugs(): + assert NS(sin(1) + exp(-10**10), 10) == NS(sin(1), 10) + assert NS(exp(10**10) + sin(1), 10) == NS(exp(10**10), 10) + assert NS('expand_log(log(1+1/10**50))', 20) == '1.0000000000000000000e-50' + assert NS('log(10**100,10)', 10) == '100.0000000' + assert NS('log(2)', 10) == '0.6931471806' + assert NS( + '(sin(x)-x)/x**3', 15, subs={x: '1/10**50'}) == '-0.166666666666667' + assert NS(sin(1) + Rational( + 1, 10**100)*I, 15) == '0.841470984807897 + 1.00000000000000e-100*I' + assert x.evalf() == x + assert NS((1 + I)**2*I, 6) == '-2.00000' + d = {n: ( + -1)**Rational(6, 7), y: (-1)**Rational(4, 7), x: (-1)**Rational(2, 7)} + assert NS((x*(1 + y*(1 + n))).subs(d).evalf(), 6) == '0.346011 + 0.433884*I' + assert NS(((-I - sqrt(2)*I)**2).evalf()) == '-5.82842712474619' + assert NS((1 + I)**2*I, 15) == '-2.00000000000000' + # issue 4758 (1/2): + assert NS(pi.evalf(69) - pi) == '-4.43863937855894e-71' + # issue 4758 (2/2): With the bug present, this still only fails if the + # terms are in the order given here. This is not generally the case, + # because the order depends on the hashes of the terms. + assert NS(20 - 5008329267844*n**25 - 477638700*n**37 - 19*n, + subs={n: .01}) == '19.8100000000000' + assert NS(((x - 1)*(1 - x)**1000).n() + ) == '(1.00000000000000 - x)**1000*(x - 1.00000000000000)' + assert NS((-x).n()) == '-x' + assert NS((-2*x).n()) == '-2.00000000000000*x' + assert NS((-2*x*y).n()) == '-2.00000000000000*x*y' + assert cos(x).n(subs={x: 1+I}) == cos(x).subs(x, 1+I).n() + # issue 6660. Also NaN != mpmath.nan + # In this order: + # 0*nan, 0/nan, 0*inf, 0/inf + # 0+nan, 0-nan, 0+inf, 0-inf + # >>> n = Some Number + # n*nan, n/nan, n*inf, n/inf + # n+nan, n-nan, n+inf, n-inf + assert (0*E**(oo)).n() is S.NaN + assert (0/E**(oo)).n() is S.Zero + + assert (0+E**(oo)).n() is S.Infinity + assert (0-E**(oo)).n() is S.NegativeInfinity + + assert (5*E**(oo)).n() is S.Infinity + assert (5/E**(oo)).n() is S.Zero + + assert (5+E**(oo)).n() is S.Infinity + assert (5-E**(oo)).n() is S.NegativeInfinity + + #issue 7416 + assert as_mpmath(0.0, 10, {'chop': True}) == 0 + + #issue 5412 + assert ((oo*I).n() == S.Infinity*I) + assert ((oo+oo*I).n() == S.Infinity + S.Infinity*I) + + #issue 11518 + assert NS(2*x**2.5, 5) == '2.0000*x**2.5000' + + #issue 13076 + assert NS(Mul(Max(0, y), x, evaluate=False).evalf()) == 'x*Max(0, y)' + + #issue 18516 + assert NS(log(S(3273390607896141870013189696827599152216642046043064789483291368096133796404674554883270092325904157150886684127560071009217256545885393053328527589376)/36360291795869936842385267079543319118023385026001623040346035832580600191583895484198508262979388783308179702534403855752855931517013066142992430916562025780021771247847643450125342836565813209972590371590152578728008385990139795377610001).evalf(15, chop=True)) == '-oo' + + +def test_evalf_integer_parts(): + a = floor(log(8)/log(2) - exp(-1000), evaluate=False) + b = floor(log(8)/log(2), evaluate=False) + assert a.evalf() == 3.0 + assert b.evalf() == 3.0 + # equals, as a fallback, can still fail but it might succeed as here + assert ceiling(10*(sin(1)**2 + cos(1)**2)) == 10 + + assert int(floor(factorial(50)/E, evaluate=False).evalf(70)) == \ + int(11188719610782480504630258070757734324011354208865721592720336800) + assert int(ceiling(factorial(50)/E, evaluate=False).evalf(70)) == \ + int(11188719610782480504630258070757734324011354208865721592720336801) + assert int(floor(GoldenRatio**999 / sqrt(5) + S.Half) + .evalf(1000)) == fibonacci(999) + assert int(floor(GoldenRatio**1000 / sqrt(5) + S.Half) + .evalf(1000)) == fibonacci(1000) + + assert ceiling(x).evalf(subs={x: 3}) == 3.0 + assert ceiling(x).evalf(subs={x: 3*I}) == 3.0*I + assert ceiling(x).evalf(subs={x: 2 + 3*I}) == 2.0 + 3.0*I + assert ceiling(x).evalf(subs={x: 3.}) == 3.0 + assert ceiling(x).evalf(subs={x: 3.*I}) == 3.0*I + assert ceiling(x).evalf(subs={x: 2. + 3*I}) == 2.0 + 3.0*I + + assert float((floor(1.5, evaluate=False)+1/9).evalf()) == 1 + 1/9 + assert float((floor(0.5, evaluate=False)+20).evalf()) == 20 + + # issue 19991 + n = 1169809367327212570704813632106852886389036911 + r = 744723773141314414542111064094745678855643068 + + assert floor(n / (pi / 2)) == r + assert floor(80782 * sqrt(2)) == 114242 + + # issue 20076 + assert 260515 - floor(260515/pi + 1/2) * pi == atan(tan(260515)) + + +def test_evalf_trig_zero_detection(): + a = sin(160*pi, evaluate=False) + t = a.evalf(maxn=100) + assert abs(t) < 1e-100 + assert t._prec < 2 + assert a.evalf(chop=True) == 0 + raises(PrecisionExhausted, lambda: a.evalf(strict=True)) + + +def test_evalf_sum(): + assert Sum(n,(n,1,2)).evalf() == 3. + assert Sum(n,(n,1,2)).doit().evalf() == 3. + # the next test should return instantly + assert Sum(1/n,(n,1,2)).evalf() == 1.5 + + # issue 8219 + assert Sum(E/factorial(n), (n, 0, oo)).evalf() == (E*E).evalf() + # issue 8254 + assert Sum(2**n*n/factorial(n), (n, 0, oo)).evalf() == (2*E*E).evalf() + # issue 8411 + s = Sum(1/x**2, (x, 100, oo)) + assert s.n() == s.doit().n() + + +def test_evalf_divergent_series(): + raises(ValueError, lambda: Sum(1/n, (n, 1, oo)).evalf()) + raises(ValueError, lambda: Sum(n/(n**2 + 1), (n, 1, oo)).evalf()) + raises(ValueError, lambda: Sum((-1)**n, (n, 1, oo)).evalf()) + raises(ValueError, lambda: Sum((-1)**n, (n, 1, oo)).evalf()) + raises(ValueError, lambda: Sum(n**2, (n, 1, oo)).evalf()) + raises(ValueError, lambda: Sum(2**n, (n, 1, oo)).evalf()) + raises(ValueError, lambda: Sum((-2)**n, (n, 1, oo)).evalf()) + raises(ValueError, lambda: Sum((2*n + 3)/(3*n**2 + 4), (n, 0, oo)).evalf()) + raises(ValueError, lambda: Sum((0.5*n**3)/(n**4 + 1), (n, 0, oo)).evalf()) + + +def test_evalf_product(): + assert Product(n, (n, 1, 10)).evalf() == 3628800. + assert comp(Product(1 - S.Half**2/n**2, (n, 1, oo)).n(5), 0.63662) + assert Product(n, (n, -1, 3)).evalf() == 0 + + +def test_evalf_py_methods(): + assert abs(float(pi + 1) - 4.1415926535897932) < 1e-10 + assert abs(complex(pi + 1) - 4.1415926535897932) < 1e-10 + assert abs( + complex(pi + E*I) - (3.1415926535897931 + 2.7182818284590451j)) < 1e-10 + raises(TypeError, lambda: float(pi + x)) + + +def test_evalf_power_subs_bugs(): + assert (x**2).evalf(subs={x: 0}) == 0 + assert sqrt(x).evalf(subs={x: 0}) == 0 + assert (x**Rational(2, 3)).evalf(subs={x: 0}) == 0 + assert (x**x).evalf(subs={x: 0}) == 1.0 + assert (3**x).evalf(subs={x: 0}) == 1.0 + assert exp(x).evalf(subs={x: 0}) == 1.0 + assert ((2 + I)**x).evalf(subs={x: 0}) == 1.0 + assert (0**x).evalf(subs={x: 0}) == 1.0 + + +def test_evalf_arguments(): + raises(TypeError, lambda: pi.evalf(method="garbage")) + + +def test_implemented_function_evalf(): + from sympy.utilities.lambdify import implemented_function + f = Function('f') + f = implemented_function(f, lambda x: x + 1) + assert str(f(x)) == "f(x)" + assert str(f(2)) == "f(2)" + assert f(2).evalf() == 3.0 + assert f(x).evalf() == f(x) + f = implemented_function(Function('sin'), lambda x: x + 1) + assert f(2).evalf() != sin(2) + del f._imp_ # XXX: due to caching _imp_ would influence all other tests + + +def test_evaluate_false(): + for no in [0, False]: + assert Add(3, 2, evaluate=no).is_Add + assert Mul(3, 2, evaluate=no).is_Mul + assert Pow(3, 2, evaluate=no).is_Pow + assert Pow(y, 2, evaluate=True) - Pow(y, 2, evaluate=True) == 0 + + +def test_evalf_relational(): + assert Eq(x/5, y/10).evalf() == Eq(0.2*x, 0.1*y) + # if this first assertion fails it should be replaced with + # one that doesn't + assert unchanged(Eq, (3 - I)**2/2 + I, 0) + assert Eq((3 - I)**2/2 + I, 0).n() is S.false + assert nfloat(Eq((3 - I)**2 + I, 0)) == S.false + + +def test_issue_5486(): + assert not cos(sqrt(0.5 + I)).n().is_Function + + +def test_issue_5486_bug(): + from sympy.core.expr import Expr + from sympy.core.numbers import I + assert abs(Expr._from_mpmath(I._to_mpmath(15), 15) - I) < 1.0e-15 + + +def test_bugs(): + from sympy.functions.elementary.complexes import (polar_lift, re) + + assert abs(re((1 + I)**2)) < 1e-15 + + # anything that evalf's to 0 will do in place of polar_lift + assert abs(polar_lift(0)).n() == 0 + + +def test_subs(): + assert NS('besseli(-x, y) - besseli(x, y)', subs={x: 3.5, y: 20.0}) == \ + '-4.92535585957223e-10' + assert NS('Piecewise((x, x>0)) + Piecewise((1-x, x>0))', subs={x: 0.1}) == \ + '1.00000000000000' + raises(TypeError, lambda: x.evalf(subs=(x, 1))) + + +def test_issue_4956_5204(): + # issue 4956 + v = S('''(-27*12**(1/3)*sqrt(31)*I + + 27*2**(2/3)*3**(1/3)*sqrt(31)*I)/(-2511*2**(2/3)*3**(1/3) + + (29*18**(1/3) + 9*2**(1/3)*3**(2/3)*sqrt(31)*I + + 87*2**(1/3)*3**(1/6)*I)**2)''') + assert NS(v, 1) == '0.e-118 - 0.e-118*I' + + # issue 5204 + v = S('''-(357587765856 + 18873261792*249**(1/2) + 56619785376*I*83**(1/2) + + 108755765856*I*3**(1/2) + 41281887168*6**(1/3)*(1422 + + 54*249**(1/2))**(1/3) - 1239810624*6**(1/3)*249**(1/2)*(1422 + + 54*249**(1/2))**(1/3) - 3110400000*I*6**(1/3)*83**(1/2)*(1422 + + 54*249**(1/2))**(1/3) + 13478400000*I*3**(1/2)*6**(1/3)*(1422 + + 54*249**(1/2))**(1/3) + 1274950152*6**(2/3)*(1422 + + 54*249**(1/2))**(2/3) + 32347944*6**(2/3)*249**(1/2)*(1422 + + 54*249**(1/2))**(2/3) - 1758790152*I*3**(1/2)*6**(2/3)*(1422 + + 54*249**(1/2))**(2/3) - 304403832*I*6**(2/3)*83**(1/2)*(1422 + + 4*249**(1/2))**(2/3))/(175732658352 + (1106028 + 25596*249**(1/2) + + 76788*I*83**(1/2))**2)''') + assert NS(v, 5) == '0.077284 + 1.1104*I' + assert NS(v, 1) == '0.08 + 1.*I' + + +def test_old_docstring(): + a = (E + pi*I)*(E - pi*I) + assert NS(a) == '17.2586605000200' + assert a.n() == 17.25866050002001 + + +def test_issue_4806(): + assert integrate(atan(x)**2, (x, -1, 1)).evalf().round(1) == Float(0.5, 1) + assert atan(0, evaluate=False).n() == 0 + + +def test_evalf_mul(): + # SymPy should not try to expand this; it should be handled term-wise + # in evalf through mpmath + assert NS(product(1 + sqrt(n)*I, (n, 1, 500)), 1) == '5.e+567 + 2.e+568*I' + + +def test_scaled_zero(): + a, b = (([0], 1, 100, 1), -1) + assert scaled_zero(100) == (a, b) + assert scaled_zero(a) == (0, 1, 100, 1) + a, b = (([1], 1, 100, 1), -1) + assert scaled_zero(100, -1) == (a, b) + assert scaled_zero(a) == (1, 1, 100, 1) + raises(ValueError, lambda: scaled_zero(scaled_zero(100))) + raises(ValueError, lambda: scaled_zero(100, 2)) + raises(ValueError, lambda: scaled_zero(100, 0)) + raises(ValueError, lambda: scaled_zero((1, 5, 1, 3))) + + +def test_chop_value(): + for i in range(-27, 28): + assert (Pow(10, i)*2).n(chop=10**i) and not (Pow(10, i)).n(chop=10**i) + + +def test_infinities(): + assert oo.evalf(chop=True) == inf + assert (-oo).evalf(chop=True) == ninf + + +def test_to_mpmath(): + assert sqrt(3)._to_mpmath(20)._mpf_ == (0, int(908093), -19, 20) + assert S(3.2)._to_mpmath(20)._mpf_ == (0, int(838861), -18, 20) + + +def test_issue_6632_evalf(): + add = (-100000*sqrt(2500000001) + 5000000001) + assert add.n() == 9.999999998e-11 + assert (add*add).n() == 9.999999996e-21 + + +def test_issue_4945(): + from sympy.abc import H + assert (H/0).evalf(subs={H:1}) == zoo + + +def test_evalf_integral(): + # test that workprec has to increase in order to get a result other than 0 + eps = Rational(1, 1000000) + assert Integral(sin(x), (x, -pi, pi + eps)).n(2)._prec == 10 + + +def test_issue_8821_highprec_from_str(): + s = str(pi.evalf(128)) + p = N(s) + assert Abs(sin(p)) < 1e-15 + p = N(s, 64) + assert Abs(sin(p)) < 1e-64 + + +def test_issue_8853(): + p = Symbol('x', even=True, positive=True) + assert floor(-p - S.Half).is_even == False + assert floor(-p + S.Half).is_even == True + assert ceiling(p - S.Half).is_even == True + assert ceiling(p + S.Half).is_even == False + + assert get_integer_part(S.Half, -1, {}, True) == (0, 0) + assert get_integer_part(S.Half, 1, {}, True) == (1, 0) + assert get_integer_part(Rational(-1, 2), -1, {}, True) == (-1, 0) + assert get_integer_part(Rational(-1, 2), 1, {}, True) == (0, 0) + + +def test_issue_17681(): + class identity_func(Function): + + def _eval_evalf(self, *args, **kwargs): + return self.args[0].evalf(*args, **kwargs) + + assert floor(identity_func(S(0))) == 0 + assert get_integer_part(S(0), 1, {}, True) == (0, 0) + + +def test_issue_9326(): + from sympy.core.symbol import Dummy + d1 = Dummy('d') + d2 = Dummy('d') + e = d1 + d2 + assert e.evalf(subs = {d1: 1, d2: 2}) == 3.0 + + +def test_issue_10323(): + assert ceiling(sqrt(2**30 + 1)) == 2**15 + 1 + + +def test_AssocOp_Function(): + # the first arg of Min is not comparable in the imaginary part + raises(ValueError, lambda: S(''' + Min(-sqrt(3)*cos(pi/18)/6 + re(1/((-1/2 - sqrt(3)*I/2)*(1/6 + + sqrt(3)*I/18)**(1/3)))/3 + sin(pi/18)/2 + 2 + I*(-cos(pi/18)/2 - + sqrt(3)*sin(pi/18)/6 + im(1/((-1/2 - sqrt(3)*I/2)*(1/6 + + sqrt(3)*I/18)**(1/3)))/3), re(1/((-1/2 + sqrt(3)*I/2)*(1/6 + + sqrt(3)*I/18)**(1/3)))/3 - sqrt(3)*cos(pi/18)/6 - sin(pi/18)/2 + 2 + + I*(im(1/((-1/2 + sqrt(3)*I/2)*(1/6 + sqrt(3)*I/18)**(1/3)))/3 - + sqrt(3)*sin(pi/18)/6 + cos(pi/18)/2))''')) + # if that is changed so a non-comparable number remains as + # an arg, then the Min/Max instantiation needs to be changed + # to watch out for non-comparable args when making simplifications + # and the following test should be added instead (with e being + # the sympified expression above): + # raises(ValueError, lambda: e._eval_evalf(2)) + + +def test_issue_10395(): + eq = x*Max(0, y) + assert nfloat(eq) == eq + eq = x*Max(y, -1.1) + assert nfloat(eq) == eq + assert Max(y, 4).n() == Max(4.0, y) + + +def test_issue_13098(): + assert floor(log(S('9.'+'9'*20), 10)) == 0 + assert ceiling(log(S('9.'+'9'*20), 10)) == 1 + assert floor(log(20 - S('9.'+'9'*20), 10)) == 1 + assert ceiling(log(20 - S('9.'+'9'*20), 10)) == 2 + + +def test_issue_14601(): + e = 5*x*y/2 - y*(35*(x**3)/2 - 15*x/2) + subst = {x:0.0, y:0.0} + e2 = e.evalf(subs=subst) + assert float(e2) == 0.0 + assert float((x + x*(x**2 + x)).evalf(subs={x: 0.0})) == 0.0 + + +def test_issue_11151(): + z = S.Zero + e = Sum(z, (x, 1, 2)) + assert e != z # it shouldn't evaluate + # when it does evaluate, this is what it should give + assert evalf(e, 15, {}) == \ + evalf(z, 15, {}) == (None, None, 15, None) + # so this shouldn't fail + assert (e/2).n() == 0 + # this was where the issue appeared + expr0 = Sum(x**2 + x, (x, 1, 2)) + expr1 = Sum(0, (x, 1, 2)) + expr2 = expr1/expr0 + assert simplify(factor(expr2) - expr2) == 0 + + +def test_issue_13425(): + assert N('2**.5', 30) == N('sqrt(2)', 30) + assert N('x - x', 30) == 0 + assert abs((N('pi*.1', 22)*10 - pi).n()) < 1e-22 + + +def test_issue_17421(): + assert N(acos(-I + acosh(cosh(cosh(1) + I)))) == 1.0*I + + +def test_issue_20291(): + from sympy.sets import EmptySet, Reals + from sympy.sets.sets import (Complement, FiniteSet, Intersection) + a = Symbol('a') + b = Symbol('b') + A = FiniteSet(a, b) + assert A.evalf(subs={a: 1, b: 2}) == FiniteSet(1.0, 2.0) + B = FiniteSet(a-b, 1) + assert B.evalf(subs={a: 1, b: 2}) == FiniteSet(-1.0, 1.0) + + sol = Complement(Intersection(FiniteSet(-b/2 - sqrt(b**2-4*pi)/2), Reals), FiniteSet(0)) + assert sol.evalf(subs={b: 1}) == EmptySet + + +def test_evalf_with_zoo(): + assert (1/x).evalf(subs={x: 0}) == zoo # issue 8242 + assert (-1/x).evalf(subs={x: 0}) == zoo # PR 16150 + assert (0 ** x).evalf(subs={x: -1}) == zoo # PR 16150 + assert (0 ** x).evalf(subs={x: -1 + I}) == nan + assert Mul(2, Pow(0, -1, evaluate=False), evaluate=False).evalf() == zoo # issue 21147 + assert Mul(x, 1/x, evaluate=False).evalf(subs={x: 0}) == Mul(x, 1/x, evaluate=False).subs(x, 0) == nan + assert Mul(1/x, 1/x, evaluate=False).evalf(subs={x: 0}) == zoo + assert Mul(1/x, Abs(1/x), evaluate=False).evalf(subs={x: 0}) == zoo + assert Abs(zoo, evaluate=False).evalf() == oo + assert re(zoo, evaluate=False).evalf() == nan + assert im(zoo, evaluate=False).evalf() == nan + assert Add(zoo, zoo, evaluate=False).evalf() == nan + assert Add(oo, zoo, evaluate=False).evalf() == nan + assert Pow(zoo, -1, evaluate=False).evalf() == 0 + assert Pow(zoo, Rational(-1, 3), evaluate=False).evalf() == 0 + assert Pow(zoo, Rational(1, 3), evaluate=False).evalf() == zoo + assert Pow(zoo, S.Half, evaluate=False).evalf() == zoo + assert Pow(zoo, 2, evaluate=False).evalf() == zoo + assert Pow(0, zoo, evaluate=False).evalf() == nan + assert log(zoo, evaluate=False).evalf() == zoo + assert zoo.evalf(chop=True) == zoo + assert x.evalf(subs={x: zoo}) == zoo + + +def test_evalf_with_bounded_error(): + cases = [ + # zero + (Rational(0), None, 1), + # zero im part + (pi, None, 10), + # zero real part + (pi*I, None, 10), + # re and im nonzero + (2-3*I, None, 5), + # similar tests again, but using eps instead of m + (Rational(0), Rational(1, 2), None), + (pi, Rational(1, 1000), None), + (pi * I, Rational(1, 1000), None), + (2 - 3 * I, Rational(1, 1000), None), + # very large eps + (2 - 3 * I, Rational(1000), None), + # case where x already small, hence some cancellation in p = m + n - 1 + (Rational(1234, 10**8), Rational(1, 10**12), None), + ] + for x0, eps, m in cases: + a, b, _, _ = evalf(x0, 53, {}) + c, d, _, _ = _evalf_with_bounded_error(x0, eps, m) + if eps is None: + eps = 2**(-m) + z = make_mpc((a or fzero, b or fzero)) + w = make_mpc((c or fzero, d or fzero)) + assert abs(w - z) < eps + + # eps must be positive + raises(ValueError, lambda: _evalf_with_bounded_error(pi, Rational(0))) + raises(ValueError, lambda: _evalf_with_bounded_error(pi, -pi)) + raises(ValueError, lambda: _evalf_with_bounded_error(pi, I)) + + +def test_issue_22849(): + a = -8 + 3 * sqrt(3) + x = AlgebraicNumber(a) + assert evalf(a, 1, {}) == evalf(x, 1, {}) + + +def test_evalf_real_alg_num(): + # This test demonstrates why the entry for `AlgebraicNumber` in + # `sympy.core.evalf._create_evalf_table()` has to use `x.to_root()`, + # instead of `x.as_expr()`. If the latter is used, then `z` will be + # a complex number with `0.e-20` for imaginary part, even though `a5` + # is a real number. + zeta = Symbol('zeta') + a5 = AlgebraicNumber(CRootOf(cyclotomic_poly(5), -1), [-1, -1, 0, 0], alias=zeta) + z = a5.evalf() + assert isinstance(z, Float) + assert not hasattr(z, '_mpc_') + assert hasattr(z, '_mpf_') + + +def test_issue_20733(): + expr = 1/((x - 9)*(x - 8)*(x - 7)*(x - 4)**2*(x - 3)**3*(x - 2)) + assert str(expr.evalf(1, subs={x:1})) == '-4.e-5' + assert str(expr.evalf(2, subs={x:1})) == '-4.1e-5' + assert str(expr.evalf(11, subs={x:1})) == '-4.1335978836e-5' + assert str(expr.evalf(20, subs={x:1})) == '-0.000041335978835978835979' + + expr = Mul(*((x - i) for i in range(2, 1000))) + assert srepr(expr.evalf(2, subs={x: 1})) == "Float('4.0271e+2561', precision=10)" + assert srepr(expr.evalf(10, subs={x: 1})) == "Float('4.02790050126e+2561', precision=37)" + assert srepr(expr.evalf(53, subs={x: 1})) == "Float('4.0279005012722099453824067459760158730668154575647110393e+2561', precision=179)" diff --git a/shared/package-files/4a/4a1914542c9d6e302a7bd6cfec1d3c14c64be2637bf9a37d1a2b2232581a82a9/conv_depthwise3d_ops.h b/shared/package-files/4a/4a1914542c9d6e302a7bd6cfec1d3c14c64be2637bf9a37d1a2b2232581a82a9/conv_depthwise3d_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..2c4d95d5c66a927b15b790db57abe89e3d3536b7 --- /dev/null +++ b/shared/package-files/4a/4a1914542c9d6e302a7bd6cfec1d3c14c64be2637bf9a37d1a2b2232581a82a9/conv_depthwise3d_ops.h @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API conv_depthwise3d { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &, c10::SymIntArrayRef, const c10::optional &, c10::SymIntArrayRef, c10::SymIntArrayRef, c10::SymIntArrayRef); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::conv_depthwise3d") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "conv_depthwise3d(Tensor self, Tensor weight, SymInt[3] kernel_size, Tensor? bias, SymInt[3] stride, SymInt[3] padding, SymInt[3] dilation) -> Tensor") + static at::Tensor call(const at::Tensor & self, const at::Tensor & weight, c10::SymIntArrayRef kernel_size, const c10::optional & bias, c10::SymIntArrayRef stride, c10::SymIntArrayRef padding, c10::SymIntArrayRef dilation); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & weight, c10::SymIntArrayRef kernel_size, const c10::optional & bias, c10::SymIntArrayRef stride, c10::SymIntArrayRef padding, c10::SymIntArrayRef dilation); +}; + +struct TORCH_API conv_depthwise3d_out { + using schema = at::Tensor & (const at::Tensor &, const at::Tensor &, c10::SymIntArrayRef, const c10::optional &, c10::SymIntArrayRef, c10::SymIntArrayRef, c10::SymIntArrayRef, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::conv_depthwise3d") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "conv_depthwise3d.out(Tensor self, Tensor weight, SymInt[3] kernel_size, Tensor? bias, SymInt[3] stride, SymInt[3] padding, SymInt[3] dilation, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, const at::Tensor & weight, c10::SymIntArrayRef kernel_size, const c10::optional & bias, c10::SymIntArrayRef stride, c10::SymIntArrayRef padding, c10::SymIntArrayRef dilation, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & weight, c10::SymIntArrayRef kernel_size, const c10::optional & bias, c10::SymIntArrayRef stride, c10::SymIntArrayRef padding, c10::SymIntArrayRef dilation, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/4a/4a1992c07a321535a002308e4123e2b15f0355d658fcfcb5fabaa9c856e8cf59/appleII b/shared/package-files/4a/4a1992c07a321535a002308e4123e2b15f0355d658fcfcb5fabaa9c856e8cf59/appleII new file mode 100644 index 0000000000000000000000000000000000000000..9b78ce295b1468ad61f54930e4da7a0b224458f8 Binary files /dev/null and b/shared/package-files/4a/4a1992c07a321535a002308e4123e2b15f0355d658fcfcb5fabaa9c856e8cf59/appleII differ diff --git a/shared/package-files/4a/4a2174b7402b3a41a65ae6222ba1a39926909e9b7eefcfd000e2657ba4638679/to_sparse_bsc_ops.h b/shared/package-files/4a/4a2174b7402b3a41a65ae6222ba1a39926909e9b7eefcfd000e2657ba4638679/to_sparse_bsc_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..82bad716832635cab9d008b96434276be305a0aa --- /dev/null +++ b/shared/package-files/4a/4a2174b7402b3a41a65ae6222ba1a39926909e9b7eefcfd000e2657ba4638679/to_sparse_bsc_ops.h @@ -0,0 +1,28 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API to_sparse_bsc { + using schema = at::Tensor (const at::Tensor &, at::IntArrayRef, c10::optional); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::to_sparse_bsc") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "to_sparse_bsc(Tensor self, int[2] blocksize, int? dense_dim=None) -> Tensor") + static at::Tensor call(const at::Tensor & self, at::IntArrayRef blocksize, c10::optional dense_dim); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, at::IntArrayRef blocksize, c10::optional dense_dim); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/4a/4a23e09a2153c625b9c89fc555fdfb67d1901a8e86c7f7c9dd15ccce1b2b9f8d/problem.py b/shared/package-files/4a/4a23e09a2153c625b9c89fc555fdfb67d1901a8e86c7f7c9dd15ccce1b2b9f8d/problem.py new file mode 100644 index 0000000000000000000000000000000000000000..2dbebce3a48067e97da2b75bd2cdd609e01029b2 --- /dev/null +++ b/shared/package-files/4a/4a23e09a2153c625b9c89fc555fdfb67d1901a8e86c7f7c9dd15ccce1b2b9f8d/problem.py @@ -0,0 +1,1296 @@ +from contextlib import suppress +from inspect import signature +import copy + +import numpy as np +from scipy.optimize import ( + Bounds, + LinearConstraint, + NonlinearConstraint, + OptimizeResult, +) +from scipy.optimize._constraints import PreparedConstraint + + +from .settings import PRINT_OPTIONS, BARRIER +from .utils import CallbackSuccess, get_arrays_tol +from .utils import exact_1d_array + + +class ObjectiveFunction: + """ + Real-valued objective function. + """ + + def __init__(self, fun, verbose, debug, *args): + """ + Initialize the objective function. + + Parameters + ---------- + fun : {callable, None} + Function to evaluate, or None. + + ``fun(x, *args) -> float`` + + where ``x`` is an array with shape (n,) and `args` is a tuple. + verbose : bool + Whether to print the function evaluations. + debug : bool + Whether to make debugging tests during the execution. + *args : tuple + Additional arguments to be passed to the function. + """ + if debug: + assert fun is None or callable(fun) + assert isinstance(verbose, bool) + assert isinstance(debug, bool) + + self._fun = fun + self._verbose = verbose + self._args = args + self._n_eval = 0 + + def __call__(self, x): + """ + Evaluate the objective function. + + Parameters + ---------- + x : array_like, shape (n,) + Point at which the objective function is evaluated. + + Returns + ------- + float + Function value at `x`. + """ + x = np.array(x, dtype=float) + if self._fun is None: + f = 0.0 + else: + f = float(np.squeeze(self._fun(x, *self._args))) + self._n_eval += 1 + if self._verbose: + with np.printoptions(**PRINT_OPTIONS): + print(f"{self.name}({x}) = {f}") + return f + + @property + def n_eval(self): + """ + Number of function evaluations. + + Returns + ------- + int + Number of function evaluations. + """ + return self._n_eval + + @property + def name(self): + """ + Name of the objective function. + + Returns + ------- + str + Name of the objective function. + """ + name = "" + if self._fun is not None: + try: + name = self._fun.__name__ + except AttributeError: + name = "fun" + return name + + +class BoundConstraints: + """ + Bound constraints ``xl <= x <= xu``. + """ + + def __init__(self, bounds): + """ + Initialize the bound constraints. + + Parameters + ---------- + bounds : scipy.optimize.Bounds + Bound constraints. + """ + self._xl = np.array(bounds.lb, float) + self._xu = np.array(bounds.ub, float) + + # Remove the ill-defined bounds. + self.xl[np.isnan(self.xl)] = -np.inf + self.xu[np.isnan(self.xu)] = np.inf + + self.is_feasible = ( + np.all(self.xl <= self.xu) + and np.all(self.xl < np.inf) + and np.all(self.xu > -np.inf) + ) + self.m = np.count_nonzero(self.xl > -np.inf) + np.count_nonzero( + self.xu < np.inf + ) + self.pcs = PreparedConstraint(bounds, np.ones(bounds.lb.size)) + + @property + def xl(self): + """ + Lower bound. + + Returns + ------- + `numpy.ndarray`, shape (n,) + Lower bound. + """ + return self._xl + + @property + def xu(self): + """ + Upper bound. + + Returns + ------- + `numpy.ndarray`, shape (n,) + Upper bound. + """ + return self._xu + + def maxcv(self, x): + """ + Evaluate the maximum constraint violation. + + Parameters + ---------- + x : array_like, shape (n,) + Point at which the maximum constraint violation is evaluated. + + Returns + ------- + float + Maximum constraint violation at `x`. + """ + x = np.asarray(x, dtype=float) + return self.violation(x) + + def violation(self, x): + # shortcut for no bounds + if self.is_feasible: + return np.array([0]) + else: + return self.pcs.violation(x) + + def project(self, x): + """ + Project a point onto the feasible set. + + Parameters + ---------- + x : array_like, shape (n,) + Point to be projected. + + Returns + ------- + `numpy.ndarray`, shape (n,) + Projection of `x` onto the feasible set. + """ + return np.clip(x, self.xl, self.xu) if self.is_feasible else x + + +class LinearConstraints: + """ + Linear constraints ``a_ub @ x <= b_ub`` and ``a_eq @ x == b_eq``. + """ + + def __init__(self, constraints, n, debug): + """ + Initialize the linear constraints. + + Parameters + ---------- + constraints : list of LinearConstraint + Linear constraints. + n : int + Number of variables. + debug : bool + Whether to make debugging tests during the execution. + """ + if debug: + assert isinstance(constraints, list) + for constraint in constraints: + assert isinstance(constraint, LinearConstraint) + assert isinstance(debug, bool) + + self._a_ub = np.empty((0, n)) + self._b_ub = np.empty(0) + self._a_eq = np.empty((0, n)) + self._b_eq = np.empty(0) + for constraint in constraints: + is_equality = np.abs( + constraint.ub - constraint.lb + ) <= get_arrays_tol(constraint.lb, constraint.ub) + if np.any(is_equality): + self._a_eq = np.vstack((self.a_eq, constraint.A[is_equality])) + self._b_eq = np.concatenate( + ( + self.b_eq, + 0.5 + * ( + constraint.lb[is_equality] + + constraint.ub[is_equality] + ), + ) + ) + if not np.all(is_equality): + self._a_ub = np.vstack( + ( + self.a_ub, + constraint.A[~is_equality], + -constraint.A[~is_equality], + ) + ) + self._b_ub = np.concatenate( + ( + self.b_ub, + constraint.ub[~is_equality], + -constraint.lb[~is_equality], + ) + ) + + # Remove the ill-defined constraints. + self.a_ub[np.isnan(self.a_ub)] = 0.0 + self.a_eq[np.isnan(self.a_eq)] = 0.0 + undef_ub = np.isnan(self.b_ub) | np.isinf(self.b_ub) + undef_eq = np.isnan(self.b_eq) + self._a_ub = self.a_ub[~undef_ub, :] + self._b_ub = self.b_ub[~undef_ub] + self._a_eq = self.a_eq[~undef_eq, :] + self._b_eq = self.b_eq[~undef_eq] + self.pcs = [ + PreparedConstraint(c, np.ones(n)) for c in constraints if c.A.size + ] + + @property + def a_ub(self): + """ + Left-hand side matrix of the linear inequality constraints. + + Returns + ------- + `numpy.ndarray`, shape (m, n) + Left-hand side matrix of the linear inequality constraints. + """ + return self._a_ub + + @property + def b_ub(self): + """ + Right-hand side vector of the linear inequality constraints. + + Returns + ------- + `numpy.ndarray`, shape (m, n) + Right-hand side vector of the linear inequality constraints. + """ + return self._b_ub + + @property + def a_eq(self): + """ + Left-hand side matrix of the linear equality constraints. + + Returns + ------- + `numpy.ndarray`, shape (m, n) + Left-hand side matrix of the linear equality constraints. + """ + return self._a_eq + + @property + def b_eq(self): + """ + Right-hand side vector of the linear equality constraints. + + Returns + ------- + `numpy.ndarray`, shape (m, n) + Right-hand side vector of the linear equality constraints. + """ + return self._b_eq + + @property + def m_ub(self): + """ + Number of linear inequality constraints. + + Returns + ------- + int + Number of linear inequality constraints. + """ + return self.b_ub.size + + @property + def m_eq(self): + """ + Number of linear equality constraints. + + Returns + ------- + int + Number of linear equality constraints. + """ + return self.b_eq.size + + def maxcv(self, x): + """ + Evaluate the maximum constraint violation. + + Parameters + ---------- + x : array_like, shape (n,) + Point at which the maximum constraint violation is evaluated. + + Returns + ------- + float + Maximum constraint violation at `x`. + """ + return np.max(self.violation(x), initial=0.0) + + def violation(self, x): + if len(self.pcs): + return np.concatenate([pc.violation(x) for pc in self.pcs]) + return np.array([]) + + +class NonlinearConstraints: + """ + Nonlinear constraints ``c_ub(x) <= 0`` and ``c_eq(x) == b_eq``. + """ + + def __init__(self, constraints, verbose, debug): + """ + Initialize the nonlinear constraints. + + Parameters + ---------- + constraints : list + Nonlinear constraints. + verbose : bool + Whether to print the function evaluations. + debug : bool + Whether to make debugging tests during the execution. + """ + if debug: + assert isinstance(constraints, list) + for constraint in constraints: + assert isinstance(constraint, NonlinearConstraint) + assert isinstance(verbose, bool) + assert isinstance(debug, bool) + + self._constraints = constraints + self.pcs = [] + self._verbose = verbose + + # map of indexes for equality and inequality constraints + self._map_ub = None + self._map_eq = None + self._m_ub = self._m_eq = None + + def __call__(self, x): + """ + Calculates the residual (slack) for the constraints. + + Parameters + ---------- + x : array_like, shape (n,) + Point at which the constraints are evaluated. + + Returns + ------- + `numpy.ndarray`, shape (m_nonlinear_ub,) + Nonlinear inequality constraint slack values. + `numpy.ndarray`, shape (m_nonlinear_eq,) + Nonlinear equality constraint slack values. + """ + if not len(self._constraints): + self._m_eq = self._m_ub = 0 + return np.array([]), np.array([]) + + x = np.array(x, dtype=float) + # first time around the constraints haven't been prepared + if not len(self.pcs): + self._map_ub = [] + self._map_eq = [] + self._m_eq = 0 + self._m_ub = 0 + + for constraint in self._constraints: + if not callable(constraint.jac): + # having a callable constraint function prevents + # constraint.fun from being evaluated when preparing + # constraint + c = copy.copy(constraint) + c.jac = lambda x0: x0 + c.hess = lambda x0, v: 0.0 + pc = PreparedConstraint(c, x) + else: + pc = PreparedConstraint(constraint, x) + # we're going to be using the same x value again immediately + # after this initialisation + pc.fun.f_updated = True + + self.pcs.append(pc) + idx = np.arange(pc.fun.m) + + # figure out equality and inequality maps + lb, ub = pc.bounds[0], pc.bounds[1] + arr_tol = get_arrays_tol(lb, ub) + is_equality = np.abs(ub - lb) <= arr_tol + self._map_eq.append(idx[is_equality]) + self._map_ub.append(idx[~is_equality]) + + # these values will be corrected to their proper values later + self._m_eq += np.count_nonzero(is_equality) + self._m_ub += np.count_nonzero(~is_equality) + + c_ub = [] + c_eq = [] + for i, pc in enumerate(self.pcs): + val = pc.fun.fun(x) + if self._verbose: + with np.printoptions(**PRINT_OPTIONS): + with suppress(AttributeError): + fun_name = self._constraints[i].fun.__name__ + print(f"{fun_name}({x}) = {val}") + + # separate violations into c_eq and c_ub + eq_idx = self._map_eq[i] + ub_idx = self._map_ub[i] + + ub_val = val[ub_idx] + if len(ub_idx): + xl = pc.bounds[0][ub_idx] + xu = pc.bounds[1][ub_idx] + + # calculate slack within lower bound + finite_xl = xl > -np.inf + _v = xl[finite_xl] - ub_val[finite_xl] + c_ub.append(_v) + + # calculate slack within lower bound + finite_xu = xu < np.inf + _v = ub_val[finite_xu] - xu[finite_xu] + c_ub.append(_v) + + # equality constraints taken from midpoint between lb and ub + eq_val = val[eq_idx] + if len(eq_idx): + midpoint = 0.5 * (pc.bounds[1][eq_idx] + pc.bounds[0][eq_idx]) + eq_val -= midpoint + c_eq.append(eq_val) + + if self._m_eq: + c_eq = np.concatenate(c_eq) + else: + c_eq = np.array([]) + + if self._m_ub: + c_ub = np.concatenate(c_ub) + else: + c_ub = np.array([]) + + self._m_ub = c_ub.size + self._m_eq = c_eq.size + + return c_ub, c_eq + + @property + def m_ub(self): + """ + Number of nonlinear inequality constraints. + + Returns + ------- + int + Number of nonlinear inequality constraints. + + Raises + ------ + ValueError + If the number of nonlinear inequality constraints is unknown. + """ + if self._m_ub is None: + raise ValueError( + "The number of nonlinear inequality constraints is unknown." + ) + else: + return self._m_ub + + @property + def m_eq(self): + """ + Number of nonlinear equality constraints. + + Returns + ------- + int + Number of nonlinear equality constraints. + + Raises + ------ + ValueError + If the number of nonlinear equality constraints is unknown. + """ + if self._m_eq is None: + raise ValueError( + "The number of nonlinear equality constraints is unknown." + ) + else: + return self._m_eq + + @property + def n_eval(self): + """ + Number of function evaluations. + + Returns + ------- + int + Number of function evaluations. + """ + if len(self.pcs): + return self.pcs[0].fun.nfev + else: + return 0 + + def maxcv(self, x, cub_val=None, ceq_val=None): + """ + Evaluate the maximum constraint violation. + + Parameters + ---------- + x : array_like, shape (n,) + Point at which the maximum constraint violation is evaluated. + cub_val : array_like, shape (m_nonlinear_ub,), optional + Values of the nonlinear inequality constraints. If not provided, + the nonlinear inequality constraints are evaluated at `x`. + ceq_val : array_like, shape (m_nonlinear_eq,), optional + Values of the nonlinear equality constraints. If not provided, + the nonlinear equality constraints are evaluated at `x`. + + Returns + ------- + float + Maximum constraint violation at `x`. + """ + return np.max( + self.violation(x, cub_val=cub_val, ceq_val=ceq_val), initial=0.0 + ) + + def violation(self, x, cub_val=None, ceq_val=None): + return np.concatenate([pc.violation(x) for pc in self.pcs]) + + +class Problem: + """ + Optimization problem. + """ + + def __init__( + self, + obj, + x0, + bounds, + linear, + nonlinear, + callback, + feasibility_tol, + scale, + store_history, + history_size, + filter_size, + debug, + ): + """ + Initialize the nonlinear problem. + + The problem is preprocessed to remove all the variables that are fixed + by the bound constraints. + + Parameters + ---------- + obj : ObjectiveFunction + Objective function. + x0 : array_like, shape (n,) + Initial guess. + bounds : BoundConstraints + Bound constraints. + linear : LinearConstraints + Linear constraints. + nonlinear : NonlinearConstraints + Nonlinear constraints. + callback : {callable, None} + Callback function. + feasibility_tol : float + Tolerance on the constraint violation. + scale : bool + Whether to scale the problem according to the bounds. + store_history : bool + Whether to store the function evaluations. + history_size : int + Maximum number of function evaluations to store. + filter_size : int + Maximum number of points in the filter. + debug : bool + Whether to make debugging tests during the execution. + """ + if debug: + assert isinstance(obj, ObjectiveFunction) + assert isinstance(bounds, BoundConstraints) + assert isinstance(linear, LinearConstraints) + assert isinstance(nonlinear, NonlinearConstraints) + assert isinstance(feasibility_tol, float) + assert isinstance(scale, bool) + assert isinstance(store_history, bool) + assert isinstance(history_size, int) + if store_history: + assert history_size > 0 + assert isinstance(filter_size, int) + assert filter_size > 0 + assert isinstance(debug, bool) + + self._obj = obj + self._linear = linear + self._nonlinear = nonlinear + if callback is not None: + if not callable(callback): + raise TypeError("The callback must be a callable function.") + self._callback = callback + + # Check the consistency of the problem. + x0 = exact_1d_array(x0, "The initial guess must be a vector.") + n = x0.size + if bounds.xl.size != n: + raise ValueError(f"The bounds must have {n} elements.") + if linear.a_ub.shape[1] != n: + raise ValueError( + f"The left-hand side matrices of the linear constraints must " + f"have {n} columns." + ) + + # Check which variables are fixed. + tol = get_arrays_tol(bounds.xl, bounds.xu) + self._fixed_idx = (bounds.xl <= bounds.xu) & ( + np.abs(bounds.xl - bounds.xu) < tol + ) + self._fixed_val = 0.5 * ( + bounds.xl[self._fixed_idx] + bounds.xu[self._fixed_idx] + ) + self._fixed_val = np.clip( + self._fixed_val, + bounds.xl[self._fixed_idx], + bounds.xu[self._fixed_idx], + ) + + # Set the bound constraints. + self._orig_bounds = bounds + self._bounds = BoundConstraints( + Bounds(bounds.xl[~self._fixed_idx], bounds.xu[~self._fixed_idx]) + ) + + # Set the initial guess. + self._x0 = self._bounds.project(x0[~self._fixed_idx]) + + # Set the linear constraints. + b_eq = linear.b_eq - linear.a_eq[:, self._fixed_idx] @ self._fixed_val + self._linear = LinearConstraints( + [ + LinearConstraint( + linear.a_ub[:, ~self._fixed_idx], + -np.inf, + linear.b_ub + - linear.a_ub[:, self._fixed_idx] @ self._fixed_val, + ), + LinearConstraint(linear.a_eq[:, ~self._fixed_idx], b_eq, b_eq), + ], + self.n, + debug, + ) + + # Scale the problem if necessary. + scale = ( + scale + and self._bounds.is_feasible + and np.all(np.isfinite(self._bounds.xl)) + and np.all(np.isfinite(self._bounds.xu)) + ) + if scale: + self._scaling_factor = 0.5 * (self._bounds.xu - self._bounds.xl) + self._scaling_shift = 0.5 * (self._bounds.xu + self._bounds.xl) + self._bounds = BoundConstraints( + Bounds(-np.ones(self.n), np.ones(self.n)) + ) + b_eq = self._linear.b_eq - self._linear.a_eq @ self._scaling_shift + self._linear = LinearConstraints( + [ + LinearConstraint( + self._linear.a_ub @ np.diag(self._scaling_factor), + -np.inf, + self._linear.b_ub + - self._linear.a_ub @ self._scaling_shift, + ), + LinearConstraint( + self._linear.a_eq @ np.diag(self._scaling_factor), + b_eq, + b_eq, + ), + ], + self.n, + debug, + ) + self._x0 = (self._x0 - self._scaling_shift) / self._scaling_factor + else: + self._scaling_factor = np.ones(self.n) + self._scaling_shift = np.zeros(self.n) + + # Set the initial filter. + self._feasibility_tol = feasibility_tol + self._filter_size = filter_size + self._fun_filter = [] + self._maxcv_filter = [] + self._x_filter = [] + + # Set the initial history. + self._store_history = store_history + self._history_size = history_size + self._fun_history = [] + self._maxcv_history = [] + self._x_history = [] + + def __call__(self, x, penalty=0.0): + """ + Evaluate the objective and nonlinear constraint functions. + + Parameters + ---------- + x : array_like, shape (n,) + Point at which the functions are evaluated. + penalty : float, optional + Penalty parameter used to select the point in the filter to forward + to the callback function. + + Returns + ------- + float + Objective function value. + `numpy.ndarray`, shape (m_nonlinear_ub,) + Nonlinear inequality constraint function values. + `numpy.ndarray`, shape (m_nonlinear_eq,) + Nonlinear equality constraint function values. + + Raises + ------ + `cobyqa.utils.CallbackSuccess` + If the callback function raises a ``StopIteration``. + """ + # Evaluate the objective and nonlinear constraint functions. + x = np.asarray(x, dtype=float) + x_full = self.build_x(x) + fun_val = self._obj(x_full) + cub_val, ceq_val = self._nonlinear(x_full) + maxcv_val = self.maxcv(x, cub_val, ceq_val) + if self._store_history: + self._fun_history.append(fun_val) + self._maxcv_history.append(maxcv_val) + self._x_history.append(x) + if len(self._fun_history) > self._history_size: + self._fun_history.pop(0) + self._maxcv_history.pop(0) + self._x_history.pop(0) + + # Add the point to the filter if it is not dominated by any point. + if np.isnan(fun_val) and np.isnan(maxcv_val): + include_point = len(self._fun_filter) == 0 + elif np.isnan(fun_val): + include_point = all( + np.isnan(fun_filter) + and maxcv_val < maxcv_filter + or np.isnan(maxcv_filter) + for fun_filter, maxcv_filter in zip( + self._fun_filter, + self._maxcv_filter, + ) + ) + elif np.isnan(maxcv_val): + include_point = all( + np.isnan(maxcv_filter) + and fun_val < fun_filter + or np.isnan(fun_filter) + for fun_filter, maxcv_filter in zip( + self._fun_filter, + self._maxcv_filter, + ) + ) + else: + include_point = all( + fun_val < fun_filter or maxcv_val < maxcv_filter + for fun_filter, maxcv_filter in zip( + self._fun_filter, + self._maxcv_filter, + ) + ) + if include_point: + self._fun_filter.append(fun_val) + self._maxcv_filter.append(maxcv_val) + self._x_filter.append(x) + + # Remove the points in the filter that are dominated by the new + # point. We must iterate in reverse order to avoid problems when + # removing elements from the list. + for k in range(len(self._fun_filter) - 2, -1, -1): + if np.isnan(fun_val): + remove_point = np.isnan(self._fun_filter[k]) + elif np.isnan(maxcv_val): + remove_point = np.isnan(self._maxcv_filter[k]) + else: + remove_point = ( + np.isnan(self._fun_filter[k]) + or np.isnan(self._maxcv_filter[k]) + or fun_val <= self._fun_filter[k] + and maxcv_val <= self._maxcv_filter[k] + ) + if remove_point: + self._fun_filter.pop(k) + self._maxcv_filter.pop(k) + self._x_filter.pop(k) + + # Keep only the most recent points in the filter. + if len(self._fun_filter) > self._filter_size: + self._fun_filter.pop(0) + self._maxcv_filter.pop(0) + self._x_filter.pop(0) + + # Evaluate the callback function after updating the filter to ensure + # that the current point can be returned by the method. + if self._callback is not None: + sig = signature(self._callback) + try: + x_best, fun_best, _ = self.best_eval(penalty) + x_best = self.build_x(x_best) + if set(sig.parameters) == {"intermediate_result"}: + intermediate_result = OptimizeResult( + x=x_best, + fun=fun_best, + # maxcv=maxcv_best, + ) + self._callback(intermediate_result=intermediate_result) + else: + self._callback(x_best) + except StopIteration as exc: + raise CallbackSuccess from exc + + # Apply the extreme barriers and return. + if np.isnan(fun_val): + fun_val = BARRIER + cub_val[np.isnan(cub_val)] = BARRIER + ceq_val[np.isnan(ceq_val)] = BARRIER + fun_val = max(min(fun_val, BARRIER), -BARRIER) + cub_val = np.maximum(np.minimum(cub_val, BARRIER), -BARRIER) + ceq_val = np.maximum(np.minimum(ceq_val, BARRIER), -BARRIER) + return fun_val, cub_val, ceq_val + + @property + def n(self): + """ + Number of variables. + + Returns + ------- + int + Number of variables. + """ + return self.x0.size + + @property + def n_orig(self): + """ + Number of variables in the original problem (with fixed variables). + + Returns + ------- + int + Number of variables in the original problem (with fixed variables). + """ + return self._fixed_idx.size + + @property + def x0(self): + """ + Initial guess. + + Returns + ------- + `numpy.ndarray`, shape (n,) + Initial guess. + """ + return self._x0 + + @property + def n_eval(self): + """ + Number of function evaluations. + + Returns + ------- + int + Number of function evaluations. + """ + return self._obj.n_eval + + @property + def fun_name(self): + """ + Name of the objective function. + + Returns + ------- + str + Name of the objective function. + """ + return self._obj.name + + @property + def bounds(self): + """ + Bound constraints. + + Returns + ------- + BoundConstraints + Bound constraints. + """ + return self._bounds + + @property + def linear(self): + """ + Linear constraints. + + Returns + ------- + LinearConstraints + Linear constraints. + """ + return self._linear + + @property + def m_bounds(self): + """ + Number of bound constraints. + + Returns + ------- + int + Number of bound constraints. + """ + return self.bounds.m + + @property + def m_linear_ub(self): + """ + Number of linear inequality constraints. + + Returns + ------- + int + Number of linear inequality constraints. + """ + return self.linear.m_ub + + @property + def m_linear_eq(self): + """ + Number of linear equality constraints. + + Returns + ------- + int + Number of linear equality constraints. + """ + return self.linear.m_eq + + @property + def m_nonlinear_ub(self): + """ + Number of nonlinear inequality constraints. + + Returns + ------- + int + Number of nonlinear inequality constraints. + + Raises + ------ + ValueError + If the number of nonlinear inequality constraints is not known. + """ + return self._nonlinear.m_ub + + @property + def m_nonlinear_eq(self): + """ + Number of nonlinear equality constraints. + + Returns + ------- + int + Number of nonlinear equality constraints. + + Raises + ------ + ValueError + If the number of nonlinear equality constraints is not known. + """ + return self._nonlinear.m_eq + + @property + def fun_history(self): + """ + History of objective function evaluations. + + Returns + ------- + `numpy.ndarray`, shape (n_eval,) + History of objective function evaluations. + """ + return np.array(self._fun_history, dtype=float) + + @property + def maxcv_history(self): + """ + History of maximum constraint violations. + + Returns + ------- + `numpy.ndarray`, shape (n_eval,) + History of maximum constraint violations. + """ + return np.array(self._maxcv_history, dtype=float) + + @property + def type(self): + """ + Type of the problem. + + The problem can be either 'unconstrained', 'bound-constrained', + 'linearly constrained', or 'nonlinearly constrained'. + + Returns + ------- + str + Type of the problem. + """ + try: + if self.m_nonlinear_ub > 0 or self.m_nonlinear_eq > 0: + return "nonlinearly constrained" + elif self.m_linear_ub > 0 or self.m_linear_eq > 0: + return "linearly constrained" + elif self.m_bounds > 0: + return "bound-constrained" + else: + return "unconstrained" + except ValueError: + # The number of nonlinear constraints is not known. It may be zero + # if the user provided a nonlinear inequality and/or equality + # constraint function that returns an empty array. However, as this + # is not known before the first call to the function, we assume + # that the problem is nonlinearly constrained. + return "nonlinearly constrained" + + @property + def is_feasibility(self): + """ + Whether the problem is a feasibility problem. + + Returns + ------- + bool + Whether the problem is a feasibility problem. + """ + return self.fun_name == "" + + def build_x(self, x): + """ + Build the full vector of variables from the reduced vector. + + Parameters + ---------- + x : array_like, shape (n,) + Reduced vector of variables. + + Returns + ------- + `numpy.ndarray`, shape (n_orig,) + Full vector of variables. + """ + x_full = np.empty(self.n_orig) + x_full[self._fixed_idx] = self._fixed_val + x_full[~self._fixed_idx] = (x * self._scaling_factor + + self._scaling_shift) + return self._orig_bounds.project(x_full) + + def maxcv(self, x, cub_val=None, ceq_val=None): + """ + Evaluate the maximum constraint violation. + + Parameters + ---------- + x : array_like, shape (n,) + Point at which the maximum constraint violation is evaluated. + cub_val : array_like, shape (m_nonlinear_ub,), optional + Values of the nonlinear inequality constraints. If not provided, + the nonlinear inequality constraints are evaluated at `x`. + ceq_val : array_like, shape (m_nonlinear_eq,), optional + Values of the nonlinear equality constraints. If not provided, + the nonlinear equality constraints are evaluated at `x`. + + Returns + ------- + float + Maximum constraint violation at `x`. + """ + violation = self.violation(x, cub_val=cub_val, ceq_val=ceq_val) + if np.count_nonzero(violation): + return np.max(violation, initial=0.0) + else: + return 0.0 + + def violation(self, x, cub_val=None, ceq_val=None): + violation = [] + if not self.bounds.is_feasible: + b = self.bounds.violation(x) + violation.append(b) + + if len(self.linear.pcs): + lc = self.linear.violation(x) + violation.append(lc) + if len(self._nonlinear.pcs): + nlc = self._nonlinear.violation(x, cub_val, ceq_val) + violation.append(nlc) + + if len(violation): + return np.concatenate(violation) + + def best_eval(self, penalty): + """ + Return the best point in the filter and the corresponding objective and + nonlinear constraint function evaluations. + + Parameters + ---------- + penalty : float + Penalty parameter + + Returns + ------- + `numpy.ndarray`, shape (n,) + Best point. + float + Corresponding objective function value. + float + Corresponding maximum constraint violation. + """ + # If the filter is empty, i.e., if no function evaluation has been + # performed, we evaluate the objective and nonlinear constraint + # functions at the initial guess. + if len(self._fun_filter) == 0: + self(self.x0) + + # Find the best point in the filter. + fun_filter = np.array(self._fun_filter) + maxcv_filter = np.array(self._maxcv_filter) + x_filter = np.array(self._x_filter) + finite_idx = np.isfinite(maxcv_filter) + if np.any(finite_idx): + # At least one point has a finite maximum constraint violation. + feasible_idx = maxcv_filter <= self._feasibility_tol + if np.any(feasible_idx) and not np.all( + np.isnan(fun_filter[feasible_idx]) + ): + # At least one point is feasible and has a well-defined + # objective function value. We select the point with the least + # objective function value. If there is a tie, we select the + # point with the least maximum constraint violation. If there + # is still a tie, we select the most recent point. + fun_min_idx = feasible_idx & ( + fun_filter <= np.nanmin(fun_filter[feasible_idx]) + ) + if np.count_nonzero(fun_min_idx) > 1: + fun_min_idx &= maxcv_filter <= np.min( + maxcv_filter[fun_min_idx] + ) + i = np.flatnonzero(fun_min_idx)[-1] + elif np.any(feasible_idx): + # At least one point is feasible but no feasible point has a + # well-defined objective function value. We select the most + # recent feasible point. + i = np.flatnonzero(feasible_idx)[-1] + else: + # No point is feasible. We first compute the merit function + # value for each point. + merit_filter = np.full_like(fun_filter, np.nan) + merit_filter[finite_idx] = ( + fun_filter[finite_idx] + penalty * maxcv_filter[finite_idx] + ) + if np.all(np.isnan(merit_filter)): + # No point has a well-defined merit function value. In + # other words, among the points with a well-defined maximum + # constraint violation, none has a well-defined objective + # function value. We select the point with the least + # maximum constraint violation. If there is a tie, we + # select the most recent point. + min_maxcv_idx = maxcv_filter <= np.nanmin(maxcv_filter) + i = np.flatnonzero(min_maxcv_idx)[-1] + else: + # At least one point has a well-defined merit function + # value. We select the point with the least merit function + # value. If there is a tie, we select the point with the + # least maximum constraint violation. If there is still a + # tie, we select the point with the least objective + # function value. If there is still a tie, we select the + # most recent point. + merit_min_idx = merit_filter <= np.nanmin(merit_filter) + if np.count_nonzero(merit_min_idx) > 1: + merit_min_idx &= maxcv_filter <= np.min( + maxcv_filter[merit_min_idx] + ) + + if np.count_nonzero(merit_min_idx) > 1: + merit_min_idx &= fun_filter <= np.min( + fun_filter[merit_min_idx] + ) + i = np.flatnonzero(merit_min_idx)[-1] + elif not np.all(np.isnan(fun_filter)): + # No maximum constraint violation is well-defined but at least one + # point has a well-defined objective function value. We select the + # point with the least objective function value. If there is a tie, + # we select the most recent point. + fun_min_idx = fun_filter <= np.nanmin(fun_filter) + i = np.flatnonzero(fun_min_idx)[-1] + else: + # No point has a well-defined maximum constraint violation or + # objective function value. We select the most recent point. + i = len(fun_filter) - 1 + return ( + self.bounds.project(x_filter[i, :]), + fun_filter[i], + maxcv_filter[i], + ) diff --git a/shared/package-files/4a/4a2790f07e66bc56562734d87fe46e5da34d9221c9995b190b049e6974e49888/_amp_foreach_non_finite_check_and_unscale_ops.h b/shared/package-files/4a/4a2790f07e66bc56562734d87fe46e5da34d9221c9995b190b049e6974e49888/_amp_foreach_non_finite_check_and_unscale_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..0488c513cf4710cfca1774a132ce4e496289ed4f --- /dev/null +++ b/shared/package-files/4a/4a2790f07e66bc56562734d87fe46e5da34d9221c9995b190b049e6974e49888/_amp_foreach_non_finite_check_and_unscale_ops.h @@ -0,0 +1,50 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API _amp_foreach_non_finite_check_and_unscale_ { + using schema = void (at::TensorList, at::Tensor &, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_amp_foreach_non_finite_check_and_unscale_") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_amp_foreach_non_finite_check_and_unscale_(Tensor(a!)[] self, Tensor(b!) found_inf, Tensor inv_scale) -> ()") + static void call(at::TensorList self, at::Tensor & found_inf, const at::Tensor & inv_scale); + static void redispatch(c10::DispatchKeySet dispatchKeySet, at::TensorList self, at::Tensor & found_inf, const at::Tensor & inv_scale); +}; + +struct TORCH_API _amp_foreach_non_finite_check_and_unscale_out { + using schema = void (at::TensorList, at::Tensor &, const at::Tensor &, at::TensorList); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_amp_foreach_non_finite_check_and_unscale") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_amp_foreach_non_finite_check_and_unscale.out(Tensor[] self, Tensor(b!) found_inf, Tensor inv_scale, *, Tensor(a!)[] out) -> ()") + static void call(at::TensorList self, at::Tensor & found_inf, const at::Tensor & inv_scale, at::TensorList out); + static void redispatch(c10::DispatchKeySet dispatchKeySet, at::TensorList self, at::Tensor & found_inf, const at::Tensor & inv_scale, at::TensorList out); +}; + +struct TORCH_API _amp_foreach_non_finite_check_and_unscale { + using schema = ::std::tuple<::std::vector,at::Tensor> (at::TensorList, const at::Tensor &, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_amp_foreach_non_finite_check_and_unscale") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_amp_foreach_non_finite_check_and_unscale(Tensor[] self, Tensor found_inf, Tensor inv_scale) -> (Tensor[] self_out, Tensor found_inf_out)") + static ::std::tuple<::std::vector,at::Tensor> call(at::TensorList self, const at::Tensor & found_inf, const at::Tensor & inv_scale); + static ::std::tuple<::std::vector,at::Tensor> redispatch(c10::DispatchKeySet dispatchKeySet, at::TensorList self, const at::Tensor & found_inf, const at::Tensor & inv_scale); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/4a/4a2854cf8d691d10774362e261892e83a2e03012a1e9557cf4c3a92f19d741da/_dtype.py b/shared/package-files/4a/4a2854cf8d691d10774362e261892e83a2e03012a1e9557cf4c3a92f19d741da/_dtype.py new file mode 100644 index 0000000000000000000000000000000000000000..ff50f5199a5c8c4d5b5b01c9335eeb6b1d06d6b2 --- /dev/null +++ b/shared/package-files/4a/4a2854cf8d691d10774362e261892e83a2e03012a1e9557cf4c3a92f19d741da/_dtype.py @@ -0,0 +1,369 @@ +""" +A place for code to be called from the implementation of np.dtype + +String handling is much easier to do correctly in python. +""" +import numpy as np + + +_kind_to_stem = { + 'u': 'uint', + 'i': 'int', + 'c': 'complex', + 'f': 'float', + 'b': 'bool', + 'V': 'void', + 'O': 'object', + 'M': 'datetime', + 'm': 'timedelta', + 'S': 'bytes', + 'U': 'str', +} + + +def _kind_name(dtype): + try: + return _kind_to_stem[dtype.kind] + except KeyError as e: + raise RuntimeError( + "internal dtype error, unknown kind {!r}" + .format(dtype.kind) + ) from None + + +def __str__(dtype): + if dtype.fields is not None: + return _struct_str(dtype, include_align=True) + elif dtype.subdtype: + return _subarray_str(dtype) + elif issubclass(dtype.type, np.flexible) or not dtype.isnative: + return dtype.str + else: + return dtype.name + + +def __repr__(dtype): + arg_str = _construction_repr(dtype, include_align=False) + if dtype.isalignedstruct: + arg_str = arg_str + ", align=True" + return "dtype({})".format(arg_str) + + +def _unpack_field(dtype, offset, title=None): + """ + Helper function to normalize the items in dtype.fields. + + Call as: + + dtype, offset, title = _unpack_field(*dtype.fields[name]) + """ + return dtype, offset, title + + +def _isunsized(dtype): + # PyDataType_ISUNSIZED + return dtype.itemsize == 0 + + +def _construction_repr(dtype, include_align=False, short=False): + """ + Creates a string repr of the dtype, excluding the 'dtype()' part + surrounding the object. This object may be a string, a list, or + a dict depending on the nature of the dtype. This + is the object passed as the first parameter to the dtype + constructor, and if no additional constructor parameters are + given, will reproduce the exact memory layout. + + Parameters + ---------- + short : bool + If true, this creates a shorter repr using 'kind' and 'itemsize', instead + of the longer type name. + + include_align : bool + If true, this includes the 'align=True' parameter + inside the struct dtype construction dict when needed. Use this flag + if you want a proper repr string without the 'dtype()' part around it. + + If false, this does not preserve the + 'align=True' parameter or sticky NPY_ALIGNED_STRUCT flag for + struct arrays like the regular repr does, because the 'align' + flag is not part of first dtype constructor parameter. This + mode is intended for a full 'repr', where the 'align=True' is + provided as the second parameter. + """ + if dtype.fields is not None: + return _struct_str(dtype, include_align=include_align) + elif dtype.subdtype: + return _subarray_str(dtype) + else: + return _scalar_str(dtype, short=short) + + +def _scalar_str(dtype, short): + byteorder = _byte_order_str(dtype) + + if dtype.type == np.bool_: + if short: + return "'?'" + else: + return "'bool'" + + elif dtype.type == np.object_: + # The object reference may be different sizes on different + # platforms, so it should never include the itemsize here. + return "'O'" + + elif dtype.type == np.bytes_: + if _isunsized(dtype): + return "'S'" + else: + return "'S%d'" % dtype.itemsize + + elif dtype.type == np.str_: + if _isunsized(dtype): + return "'%sU'" % byteorder + else: + return "'%sU%d'" % (byteorder, dtype.itemsize / 4) + + # unlike the other types, subclasses of void are preserved - but + # historically the repr does not actually reveal the subclass + elif issubclass(dtype.type, np.void): + if _isunsized(dtype): + return "'V'" + else: + return "'V%d'" % dtype.itemsize + + elif dtype.type == np.datetime64: + return "'%sM8%s'" % (byteorder, _datetime_metadata_str(dtype)) + + elif dtype.type == np.timedelta64: + return "'%sm8%s'" % (byteorder, _datetime_metadata_str(dtype)) + + elif np.issubdtype(dtype, np.number): + # Short repr with endianness, like '' """ + # hack to obtain the native and swapped byte order characters + swapped = np.dtype(int).newbyteorder('S') + native = swapped.newbyteorder('S') + + byteorder = dtype.byteorder + if byteorder == '=': + return native.byteorder + if byteorder == 'S': + # TODO: this path can never be reached + return swapped.byteorder + elif byteorder == '|': + return '' + else: + return byteorder + + +def _datetime_metadata_str(dtype): + # TODO: this duplicates the C metastr_to_unicode functionality + unit, count = np.datetime_data(dtype) + if unit == 'generic': + return '' + elif count == 1: + return '[{}]'.format(unit) + else: + return '[{}{}]'.format(count, unit) + + +def _struct_dict_str(dtype, includealignedflag): + # unpack the fields dictionary into ls + names = dtype.names + fld_dtypes = [] + offsets = [] + titles = [] + for name in names: + fld_dtype, offset, title = _unpack_field(*dtype.fields[name]) + fld_dtypes.append(fld_dtype) + offsets.append(offset) + titles.append(title) + + # Build up a string to make the dictionary + + if np.core.arrayprint._get_legacy_print_mode() <= 121: + colon = ":" + fieldsep = "," + else: + colon = ": " + fieldsep = ", " + + # First, the names + ret = "{'names'%s[" % colon + ret += fieldsep.join(repr(name) for name in names) + + # Second, the formats + ret += "], 'formats'%s[" % colon + ret += fieldsep.join( + _construction_repr(fld_dtype, short=True) for fld_dtype in fld_dtypes) + + # Third, the offsets + ret += "], 'offsets'%s[" % colon + ret += fieldsep.join("%d" % offset for offset in offsets) + + # Fourth, the titles + if any(title is not None for title in titles): + ret += "], 'titles'%s[" % colon + ret += fieldsep.join(repr(title) for title in titles) + + # Fifth, the itemsize + ret += "], 'itemsize'%s%d" % (colon, dtype.itemsize) + + if (includealignedflag and dtype.isalignedstruct): + # Finally, the aligned flag + ret += ", 'aligned'%sTrue}" % colon + else: + ret += "}" + + return ret + + +def _aligned_offset(offset, alignment): + # round up offset: + return - (-offset // alignment) * alignment + + +def _is_packed(dtype): + """ + Checks whether the structured data type in 'dtype' + has a simple layout, where all the fields are in order, + and follow each other with no alignment padding. + + When this returns true, the dtype can be reconstructed + from a list of the field names and dtypes with no additional + dtype parameters. + + Duplicates the C `is_dtype_struct_simple_unaligned_layout` function. + """ + align = dtype.isalignedstruct + max_alignment = 1 + total_offset = 0 + for name in dtype.names: + fld_dtype, fld_offset, title = _unpack_field(*dtype.fields[name]) + + if align: + total_offset = _aligned_offset(total_offset, fld_dtype.alignment) + max_alignment = max(max_alignment, fld_dtype.alignment) + + if fld_offset != total_offset: + return False + total_offset += fld_dtype.itemsize + + if align: + total_offset = _aligned_offset(total_offset, max_alignment) + + if total_offset != dtype.itemsize: + return False + return True + + +def _struct_list_str(dtype): + items = [] + for name in dtype.names: + fld_dtype, fld_offset, title = _unpack_field(*dtype.fields[name]) + + item = "(" + if title is not None: + item += "({!r}, {!r}), ".format(title, name) + else: + item += "{!r}, ".format(name) + # Special case subarray handling here + if fld_dtype.subdtype is not None: + base, shape = fld_dtype.subdtype + item += "{}, {}".format( + _construction_repr(base, short=True), + shape + ) + else: + item += _construction_repr(fld_dtype, short=True) + + item += ")" + items.append(item) + + return "[" + ", ".join(items) + "]" + + +def _struct_str(dtype, include_align): + # The list str representation can't include the 'align=' flag, + # so if it is requested and the struct has the aligned flag set, + # we must use the dict str instead. + if not (include_align and dtype.isalignedstruct) and _is_packed(dtype): + sub = _struct_list_str(dtype) + + else: + sub = _struct_dict_str(dtype, include_align) + + # If the data type isn't the default, void, show it + if dtype.type != np.void: + return "({t.__module__}.{t.__name__}, {f})".format(t=dtype.type, f=sub) + else: + return sub + + +def _subarray_str(dtype): + base, shape = dtype.subdtype + return "({}, {})".format( + _construction_repr(base, short=True), + shape + ) + + +def _name_includes_bit_suffix(dtype): + if dtype.type == np.object_: + # pointer size varies by system, best to omit it + return False + elif dtype.type == np.bool_: + # implied + return False + elif dtype.type is None: + return True + elif np.issubdtype(dtype, np.flexible) and _isunsized(dtype): + # unspecified + return False + else: + return True + + +def _name_get(dtype): + # provides dtype.name.__get__, documented as returning a "bit name" + + if dtype.isbuiltin == 2: + # user dtypes don't promise to do anything special + return dtype.type.__name__ + + if dtype.kind == '\x00': + name = type(dtype).__name__ + elif issubclass(dtype.type, np.void): + # historically, void subclasses preserve their name, eg `record64` + name = dtype.type.__name__ + else: + name = _kind_name(dtype) + + # append bit counts + if _name_includes_bit_suffix(dtype): + name += "{}".format(dtype.itemsize * 8) + + # append metadata to datetimes + if dtype.type in (np.datetime64, np.timedelta64): + name += _datetime_metadata_str(dtype) + + return name diff --git a/shared/package-files/4a/4a2b0658fd0cd83a9305e623c606a8b1e2ad563421a6f128a6089da7fbb4046f/__init__.pyi b/shared/package-files/4a/4a2b0658fd0cd83a9305e623c606a8b1e2ad563421a6f128a6089da7fbb4046f/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..71d290b2cc1c336802e6370194afe5da0870997f --- /dev/null +++ b/shared/package-files/4a/4a2b0658fd0cd83a9305e623c606a8b1e2ad563421a6f128a6089da7fbb4046f/__init__.pyi @@ -0,0 +1,25 @@ +# Stubs for django.conf.urls (Python 3.5) +from typing import Any, Callable, Dict, List, Optional, overload, Tuple, Union + +from django.http.response import HttpResponse, HttpResponseBase + +from django.urls import URLResolver, URLPattern + +handler400: Union[str, Callable[..., HttpResponse]] = ... +handler403: Union[str, Callable[..., HttpResponse]] = ... +handler404: Union[str, Callable[..., HttpResponse]] = ... +handler500: Union[str, Callable[..., HttpResponse]] = ... + +IncludedURLConf = Tuple[List[URLResolver], Optional[str], Optional[str]] + +def include(arg: Any, namespace: str = ..., app_name: str = ...) -> IncludedURLConf: ... +@overload +def url( + regex: str, view: Callable[..., HttpResponseBase], kwargs: Dict[str, Any] = ..., name: str = ... +) -> URLPattern: ... +@overload +def url(regex: str, view: IncludedURLConf, kwargs: Dict[str, Any] = ..., name: str = ...) -> URLResolver: ... +@overload +def url( + regex: str, view: List[Union[URLResolver, str]], kwargs: Dict[str, Any] = ..., name: str = ... +) -> URLResolver: ... diff --git a/shared/package-files/4a/4a2bc7d3a658adb23024b4d08f7652854e055dfb7bc36cb56b6b9813d20b20ca/optimize.py b/shared/package-files/4a/4a2bc7d3a658adb23024b4d08f7652854e055dfb7bc36cb56b6b9813d20b20ca/optimize.py new file mode 100644 index 0000000000000000000000000000000000000000..4db770e5f6e921906c916f2650003d92f5507791 --- /dev/null +++ b/shared/package-files/4a/4a2bc7d3a658adb23024b4d08f7652854e055dfb7bc36cb56b6b9813d20b20ca/optimize.py @@ -0,0 +1,40 @@ +# This file is not meant for public use and will be removed in SciPy v2.0.0. +# Use the `scipy.optimize` namespace for importing the functions +# included below. + +from scipy._lib.deprecation import _sub_module_deprecation + + +__all__ = [ # noqa: F822 + 'OptimizeResult', + 'OptimizeWarning', + 'approx_fprime', + 'bracket', + 'brent', + 'brute', + 'check_grad', + 'fmin', + 'fmin_bfgs', + 'fmin_cg', + 'fmin_ncg', + 'fmin_powell', + 'fminbound', + 'golden', + 'line_search', + 'rosen', + 'rosen_der', + 'rosen_hess', + 'rosen_hess_prod', + 'show_options', + 'zeros', +] + + +def __dir__(): + return __all__ + + +def __getattr__(name): + return _sub_module_deprecation(sub_package="optimize", module="optimize", + private_modules=["_optimize"], all=__all__, + attribute=name) diff --git a/shared/package-files/4a/4a2cb2451313d6d2172b1c27ec85ead12688ad8b770c4bc105ef13bcdc5aeb8e/test_backend_registry.py b/shared/package-files/4a/4a2cb2451313d6d2172b1c27ec85ead12688ad8b770c4bc105ef13bcdc5aeb8e/test_backend_registry.py new file mode 100644 index 0000000000000000000000000000000000000000..80c2ce4fc51a6869315a84a91fcced18a7a0443f --- /dev/null +++ b/shared/package-files/4a/4a2cb2451313d6d2172b1c27ec85ead12688ad8b770c4bc105ef13bcdc5aeb8e/test_backend_registry.py @@ -0,0 +1,180 @@ +from collections.abc import Sequence +from typing import Any + +import pytest + +import matplotlib as mpl +from matplotlib.backends import BackendFilter, backend_registry + + +@pytest.fixture +def clear_backend_registry(): + # Fixture that clears the singleton backend_registry before and after use + # so that the test state remains isolated. + backend_registry._clear() + yield + backend_registry._clear() + + +def has_duplicates(seq: Sequence[Any]) -> bool: + return len(seq) > len(set(seq)) + + +@pytest.mark.parametrize( + 'framework,expected', + [ + ('qt', 'qtagg'), + ('gtk3', 'gtk3agg'), + ('gtk4', 'gtk4agg'), + ('wx', 'wxagg'), + ('tk', 'tkagg'), + ('macosx', 'macosx'), + ('headless', 'agg'), + ('does not exist', None), + ] +) +def test_backend_for_gui_framework(framework, expected): + assert backend_registry.backend_for_gui_framework(framework) == expected + + +def test_list_builtin(): + backends = backend_registry.list_builtin() + assert not has_duplicates(backends) + # Compare using sets as order is not important + assert {*backends} == { + 'gtk3agg', 'gtk3cairo', 'gtk4agg', 'gtk4cairo', 'macosx', 'nbagg', 'notebook', + 'qtagg', 'qtcairo', 'qt5agg', 'qt5cairo', 'tkagg', + 'tkcairo', 'webagg', 'wx', 'wxagg', 'wxcairo', 'agg', 'cairo', 'pdf', 'pgf', + 'ps', 'svg', 'template', + } + + +@pytest.mark.parametrize( + 'filter,expected', + [ + (BackendFilter.INTERACTIVE, + ['gtk3agg', 'gtk3cairo', 'gtk4agg', 'gtk4cairo', 'macosx', 'nbagg', 'notebook', + 'qtagg', 'qtcairo', 'qt5agg', 'qt5cairo', 'tkagg', + 'tkcairo', 'webagg', 'wx', 'wxagg', 'wxcairo']), + (BackendFilter.NON_INTERACTIVE, + ['agg', 'cairo', 'pdf', 'pgf', 'ps', 'svg', 'template']), + ] +) +def test_list_builtin_with_filter(filter, expected): + backends = backend_registry.list_builtin(filter) + assert not has_duplicates(backends) + # Compare using sets as order is not important + assert {*backends} == {*expected} + + +def test_list_gui_frameworks(): + frameworks = backend_registry.list_gui_frameworks() + assert not has_duplicates(frameworks) + # Compare using sets as order is not important + assert {*frameworks} == { + "gtk3", "gtk4", "macosx", "qt", "qt5", "qt6", "tk", "wx", + } + + +@pytest.mark.parametrize("backend, is_valid", [ + ("agg", True), + ("QtAgg", True), + ("module://anything", True), + ("made-up-name", False), +]) +def test_is_valid_backend(backend, is_valid): + assert backend_registry.is_valid_backend(backend) == is_valid + + +@pytest.mark.parametrize("backend, normalized", [ + ("agg", "matplotlib.backends.backend_agg"), + ("QtAgg", "matplotlib.backends.backend_qtagg"), + ("module://Anything", "Anything"), +]) +def test_backend_normalization(backend, normalized): + assert backend_registry._backend_module_name(backend) == normalized + + +def test_deprecated_rcsetup_attributes(): + match = "was deprecated in Matplotlib 3.9" + with pytest.warns(mpl.MatplotlibDeprecationWarning, match=match): + mpl.rcsetup.interactive_bk + with pytest.warns(mpl.MatplotlibDeprecationWarning, match=match): + mpl.rcsetup.non_interactive_bk + with pytest.warns(mpl.MatplotlibDeprecationWarning, match=match): + mpl.rcsetup.all_backends + + +def test_entry_points_inline(): + pytest.importorskip('matplotlib_inline') + backends = backend_registry.list_all() + assert 'inline' in backends + + +def test_entry_points_ipympl(): + pytest.importorskip('ipympl') + backends = backend_registry.list_all() + assert 'ipympl' in backends + assert 'widget' in backends + + +def test_entry_point_name_shadows_builtin(clear_backend_registry): + with pytest.raises(RuntimeError): + backend_registry._validate_and_store_entry_points( + [('qtagg', 'module1')]) + + +def test_entry_point_name_duplicate(clear_backend_registry): + with pytest.raises(RuntimeError): + backend_registry._validate_and_store_entry_points( + [('some_name', 'module1'), ('some_name', 'module2')]) + + +def test_entry_point_identical(clear_backend_registry): + # Issue https://github.com/matplotlib/matplotlib/issues/28367 + # Multiple entry points with the same name and value (value is the module) + # are acceptable. + n = len(backend_registry._name_to_module) + backend_registry._validate_and_store_entry_points( + [('some_name', 'some.module'), ('some_name', 'some.module')]) + assert len(backend_registry._name_to_module) == n+1 + assert backend_registry._name_to_module['some_name'] == 'module://some.module' + + +def test_entry_point_name_is_module(clear_backend_registry): + with pytest.raises(RuntimeError): + backend_registry._validate_and_store_entry_points( + [('module://backend.something', 'module1')]) + + +@pytest.mark.parametrize('backend', [ + 'agg', + 'module://matplotlib.backends.backend_agg', +]) +def test_load_entry_points_only_if_needed(clear_backend_registry, backend): + assert not backend_registry._loaded_entry_points + check = backend_registry.resolve_backend(backend) + assert check == (backend, None) + assert not backend_registry._loaded_entry_points + backend_registry.list_all() # Force load of entry points + assert backend_registry._loaded_entry_points + + +@pytest.mark.parametrize( + 'gui_or_backend, expected_backend, expected_gui', + [ + ('agg', 'agg', None), + ('qt', 'qtagg', 'qt'), + ('TkCairo', 'tkcairo', 'tk'), + ] +) +def test_resolve_gui_or_backend(gui_or_backend, expected_backend, expected_gui): + backend, gui = backend_registry.resolve_gui_or_backend(gui_or_backend) + assert backend == expected_backend + assert gui == expected_gui + + +def test_resolve_gui_or_backend_invalid(): + match = "is not a recognised GUI loop or backend name" + with pytest.raises(RuntimeError, match=match): + backend_registry.resolve_gui_or_backend('no-such-name') diff --git a/shared/package-files/4a/4a2e4a57cd4ef88572e37caeceffad9df9b90439d48cb96971827a3f19ea5e69/log_native.h b/shared/package-files/4a/4a2e4a57cd4ef88572e37caeceffad9df9b90439d48cb96971827a3f19ea5e69/log_native.h new file mode 100644 index 0000000000000000000000000000000000000000..ea94823534933d2dca7960dbe943b644ea5fb2a3 --- /dev/null +++ b/shared/package-files/4a/4a2e4a57cd4ef88572e37caeceffad9df9b90439d48cb96971827a3f19ea5e69/log_native.h @@ -0,0 +1,23 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace native { +struct TORCH_API structured_log_out : public at::meta::structured_log { +void impl(const at::Tensor & self, const at::Tensor & out); +}; +} // namespace native +} // namespace at diff --git a/shared/package-files/4a/4a311567bb9d126c0cdc92d04e3c2b408a75957561d33fe82a7db9447f4c7eb8/macrodata_jmulti_ncs_granger_causality_realcons_realgdp.txt b/shared/package-files/4a/4a311567bb9d126c0cdc92d04e3c2b408a75957561d33fe82a7db9447f4c7eb8/macrodata_jmulti_ncs_granger_causality_realcons_realgdp.txt new file mode 100644 index 0000000000000000000000000000000000000000..1f774cad062f7549b5335c2ac9af540ddcfc37a7 --- /dev/null +++ b/shared/package-files/4a/4a311567bb9d126c0cdc92d04e3c2b408a75957561d33fe82a7db9447f4c7eb8/macrodata_jmulti_ncs_granger_causality_realcons_realgdp.txt @@ -0,0 +1,13 @@ +*** Sat, 3 Sep 2016 22:16:49 *** +TEST FOR GRANGER-CAUSALITY: +H0: "realcons, realgdp" do not Granger-cause "realinv" + +Test statistic l = 16.6367 +pval-F( l; 8, 552) = 0.0000 + +TEST FOR INSTANTANEOUS CAUSALITY: +H0: No instantaneous causality between "realcons, realgdp" and "realinv" + +Test statistic: c = 79.2548 +pval-Chi( c; 2) = 0.0000 + diff --git a/shared/package-files/4a/4a315b7988d9839ab543132a58de99c8d358d6597b99e47f92fec3550bf49df2/native_group_norm_backward_ops.h b/shared/package-files/4a/4a315b7988d9839ab543132a58de99c8d358d6597b99e47f92fec3550bf49df2/native_group_norm_backward_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..6c4bcbfd01b2811506e09a67d88b4be4cd84313a --- /dev/null +++ b/shared/package-files/4a/4a315b7988d9839ab543132a58de99c8d358d6597b99e47f92fec3550bf49df2/native_group_norm_backward_ops.h @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API native_group_norm_backward { + using schema = ::std::tuple (const at::Tensor &, const at::Tensor &, const at::Tensor &, const at::Tensor &, const c10::optional &, c10::SymInt, c10::SymInt, c10::SymInt, int64_t, ::std::array); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::native_group_norm_backward") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "native_group_norm_backward(Tensor grad_out, Tensor input, Tensor mean, Tensor rstd, Tensor? weight, SymInt N, SymInt C, SymInt HxW, int group, bool[3] output_mask) -> (Tensor, Tensor, Tensor)") + static ::std::tuple call(const at::Tensor & grad_out, const at::Tensor & input, const at::Tensor & mean, const at::Tensor & rstd, const c10::optional & weight, c10::SymInt N, c10::SymInt C, c10::SymInt HxW, int64_t group, ::std::array output_mask); + static ::std::tuple redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & grad_out, const at::Tensor & input, const at::Tensor & mean, const at::Tensor & rstd, const c10::optional & weight, c10::SymInt N, c10::SymInt C, c10::SymInt HxW, int64_t group, ::std::array output_mask); +}; + +struct TORCH_API native_group_norm_backward_out { + using schema = ::std::tuple (const at::Tensor &, const at::Tensor &, const at::Tensor &, const at::Tensor &, const c10::optional &, c10::SymInt, c10::SymInt, c10::SymInt, int64_t, ::std::array, at::Tensor &, at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::native_group_norm_backward") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "native_group_norm_backward.out(Tensor grad_out, Tensor input, Tensor mean, Tensor rstd, Tensor? weight, SymInt N, SymInt C, SymInt HxW, int group, bool[3] output_mask, *, Tensor(a!) out0, Tensor(b!) out1, Tensor(c!) out2) -> (Tensor(a!), Tensor(b!), Tensor(c!))") + static ::std::tuple call(const at::Tensor & grad_out, const at::Tensor & input, const at::Tensor & mean, const at::Tensor & rstd, const c10::optional & weight, c10::SymInt N, c10::SymInt C, c10::SymInt HxW, int64_t group, ::std::array output_mask, at::Tensor & out0, at::Tensor & out1, at::Tensor & out2); + static ::std::tuple redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & grad_out, const at::Tensor & input, const at::Tensor & mean, const at::Tensor & rstd, const c10::optional & weight, c10::SymInt N, c10::SymInt C, c10::SymInt HxW, int64_t group, ::std::array output_mask, at::Tensor & out0, at::Tensor & out1, at::Tensor & out2); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/4a/4a323ae52d6656fb6500b07c09d02ff9fcf8fda21c31d838807108d5ae2f7dca/dataframes.py b/shared/package-files/4a/4a323ae52d6656fb6500b07c09d02ff9fcf8fda21c31d838807108d5ae2f7dca/dataframes.py new file mode 100644 index 0000000000000000000000000000000000000000..69a14e06fcbf7db40fe415fc70cf9c28cec3fc73 --- /dev/null +++ b/shared/package-files/4a/4a323ae52d6656fb6500b07c09d02ff9fcf8fda21c31d838807108d5ae2f7dca/dataframes.py @@ -0,0 +1,433 @@ +from typing import Any, Dict, List, Optional + +from torch.utils.data.datapipes._decorator import functional_datapipe +from torch.utils.data.datapipes.datapipe import DFIterDataPipe, IterDataPipe + +from torch.utils.data.datapipes.dataframe.structures import DataChunkDF + +# TODO(VitalyFedyunin): Add error when two different traces get combined + +__all__ = [ + "Capture", + "CaptureA", + "CaptureAdd", + "CaptureCall", + "CaptureControl", + "CaptureDataFrame", + "CaptureDataFrameWithDataPipeOps", + "CaptureF", + "CaptureGetAttr", + "CaptureGetItem", + "CaptureInitial", + "CaptureLikeMock", + "CaptureMul", + "CaptureSetItem", + "CaptureSub", + "CaptureVariable", + "CaptureVariableAssign", + "DataFrameTracer", + "DataFrameTracedOps", + "disable_capture", + "get_val", +] + + +def disable_capture(): + CaptureControl.disabled = True + + +class CaptureControl: + disabled = False + + +class DataFrameTracedOps(DFIterDataPipe): + def __init__(self, source_datapipe, output_var): + self.source_datapipe = source_datapipe + self.output_var = output_var + + def __iter__(self): + for item in self.source_datapipe: + yield self.output_var.apply_ops(item) + + +# TODO(VitalyFedyunin): Extract this list from the DFIterDataPipe registred functions +DATAPIPES_OPS = ['_dataframes_as_tuples', 'groupby', '_dataframes_filter', 'map', 'to_datapipe', + 'shuffle', 'concat', 'batch', '_dataframes_per_row', '_dataframes_concat', '_dataframes_shuffle'] + +UNIMPLEMENTED_ATTR = ['__deepcopy__', '__setstate__', 'is_shardable', 'apply_sharding'] + + +class Capture: + # TODO: All operations are shared across entire InitialCapture, need to figure out what if we join two captures + + def __init__(self, schema_df=None): + self.ctx = {'operations': [], 'variables': [], 'schema_df': schema_df} + + def __str__(self): + return self._ops_str() + + def _ops_str(self): + res = "" + for op in self.ctx['operations']: + if len(res) > 0: + res += "\n" + res += str(op) + return res + + def __getstate__(self): + # TODO(VitalyFedyunin): Currently can't pickle (why?) + self.ctx['schema_df'] = None + for var in self.ctx['variables']: + var.calculated_value = None + state = {} + for item in self.__dict__: + state[item] = getattr(self, item) + return state + + def __setstate__(self, state): + for k, v in state.items(): + setattr(self, k, v) + + def __getattr__(self, attrname): + if attrname == 'kwarg' or attrname == 'kwargs': + raise Exception('no kwargs!') + if attrname in ['__deepcopy__']: + raise AttributeError() + result = CaptureGetAttr(self, attrname, ctx=self.ctx) + return result + + def __getitem__(self, key): + return CaptureGetItem(self, key, ctx=self.ctx) + + def __setitem__(self, key, value): + self.ctx['operations'].append( + CaptureSetItem(self, key, value, ctx=self.ctx)) + + def __add__(self, add_val): + res = CaptureAdd(self, add_val, ctx=self.ctx) + var = CaptureVariable(res, ctx=self.ctx) + self.ctx['operations'].append( + CaptureVariableAssign(variable=var, value=res, ctx=self.ctx)) + return var + + def __sub__(self, add_val): + res = CaptureSub(self, add_val, ctx=self.ctx) + var = CaptureVariable(res, ctx=self.ctx) + self.ctx['operations'].append( + CaptureVariableAssign(variable=var, value=res, ctx=self.ctx)) + return var + + def __mul__(self, add_val): + res = CaptureMul(self, add_val, ctx=self.ctx) + var = CaptureVariable(res, ctx=self.ctx) + t = CaptureVariableAssign(variable=var, value=res, ctx=self.ctx) + self.ctx['operations'].append(t) + return var + + def _is_context_empty(self): + return len(self.ctx['operations']) == 0 and len(self.ctx['variables']) == 0 + + def apply_ops_2(self, dataframe): + # TODO(VitalyFedyunin): Make this calculation thread safe (as currently it updates pointer) + self.ctx['variables'][0].calculated_value = dataframe + for op in self.ctx['operations']: + op.execute() + + @property + def columns(self): + self.apply_ops_2(self.ctx['schema_df']) + value = self.execute() + return value.columns + + # TODO(VitalyFedyunin): Add tests + # TODO(VitalyFedyunin): Need to join context if one of them are empty because we used capture + + def __call__(self, *args, **kwargs): + # TODO: Check if args or kwargs have more than one different context + if self._is_context_empty(): + # TODO: Allow CaptureA to take context from mock + for arg in args: + if isinstance(arg, Capture) and not arg._is_context_empty(): + self.ctx = arg.ctx + break + if self._is_context_empty(): + for k, v in kwargs.items(): + if isinstance(k, Capture) and not k._is_context_empty(): + self.ctx = k.ctx + break + if isinstance(v, Capture) and not v._is_context_empty(): + self.ctx = v.ctx + break + + res = CaptureCall(self, ctx=self.ctx, args=args, kwargs=kwargs) + var = CaptureVariable(None, ctx=self.ctx) + t = CaptureVariableAssign(ctx=self.ctx, variable=var, value=res) + self.ctx['operations'].append(t) + return var + + +class CaptureF(Capture): + def __init__(self, ctx=None, **kwargs): + if ctx is None: + self.ctx = {'operations': [], 'variables': []} + else: + self.ctx = ctx + self.kwargs = kwargs + + +class CaptureA(CaptureF): + def __str__(self): + return f"{self.kwargs['name']}" + + def execute(self): + value = self.kwargs['real_attribute'] + return value + + +class CaptureLikeMock: + def __init__(self, name): + import unittest.mock as mock + # TODO(VitalyFedyunin): Do not use provate function here, copy own implementation instead. + get_target, attribute = mock._get_target(name) # type: ignore[attr-defined] + self.get_target = get_target + self.attribute = attribute + self.name = name + + def __enter__(self): + self.save = getattr(self.get_target(), self.attribute) + capt = CaptureA(name=self.name, real_attribute=self.save) + setattr(self.get_target(), self.attribute, capt) + + def __exit__(self, *exc_info): + setattr(self.get_target(), self.attribute, self.save) + + +class CaptureCall(Capture): + + def __init__(self, callable, ctx=None, **kwargs): + if ctx is None: + self.ctx = {'operations': [], 'variables': []} + else: + self.ctx = ctx + self.kwargs = kwargs + self.callable = callable + + def __str__(self): + return "{callable}({args},{kwargs})".format(callable=self.callable, **self.kwargs) + + def execute(self): + + # TODO: VitalyFedyunin execute kwargs and maybe nested structures + executed_args = [] + for arg in self.kwargs['args']: + if isinstance(arg, Capture): + executed_args.append(arg.execute()) + else: + executed_args.append(arg) + left = get_val(self.callable) + return left(*executed_args, **self.kwargs['kwargs']) + + +class CaptureVariableAssign(CaptureF): + def __str__(self): + variable = self.kwargs['variable'] + value = self.kwargs['value'] + return f"{variable} = {value}" + + def execute(self): + self.kwargs['variable'].calculated_value = self.kwargs['value'].execute() + + +class CaptureVariable(Capture): + # TODO(VitalyFedyunin): This should be atomic and thread safe + names_idx = 0 + + def __init__(self, value, ctx): + if CaptureControl.disabled: + raise Exception('Attempting to create capture variable with capture off') + self.ctx = ctx + self.value = value + self.name = f'var_{CaptureVariable.names_idx}' + CaptureVariable.names_idx += 1 + self.ctx['variables'].append(self) + + def __str__(self): + return self.name + + def execute(self): + return self.calculated_value + + def apply_ops(self, dataframe): + # TODO(VitalyFedyunin): Make this calculation thread safe (as currently it updates pointer) + self.ctx['variables'][0].calculated_value = dataframe + for op in self.ctx['operations']: + op.execute() + return self.calculated_value + + +class CaptureGetItem(Capture): + def __init__(self, left, key, ctx): + self.ctx = ctx + self.left = left + self.key = key + + def __str__(self): + return f"{self.left}[{get_val(self.key)}]" + + def execute(self): + left = self.left.execute() + return left[self.key] + + +class CaptureSetItem(Capture): + def __init__(self, left, key, value, ctx): + self.ctx = ctx + self.left = left + self.key = key + self.value = value + + def __str__(self): + return f"{self.left}[{get_val(self.key)}] = {self.value}" + + def execute(self): + left = self.left.execute() + value = self.value.execute() + left[self.key] = value + + +class CaptureAdd(Capture): + def __init__(self, left, right, ctx): + self.ctx = ctx + self.left = left + self.right = right + + def __str__(self): + return f"{self.left} + {self.right}" + + def execute(self): + return get_val(self.left) + get_val(self.right) + + +class CaptureMul(Capture): + def __init__(self, left, right, ctx): + self.ctx = ctx + self.left = left + self.right = right + + def __str__(self): + return f"{self.left} * {self.right}" + + def execute(self): + return get_val(self.left) * get_val(self.right) + + +class CaptureSub(Capture): + def __init__(self, left, right, ctx): + self.ctx = ctx + self.left = left + self.right = right + + def __str__(self): + return f"{self.left} - {self.right}" + + def execute(self): + return get_val(self.left) - get_val(self.right) + + +class CaptureGetAttr(Capture): + def __init__(self, src, name, ctx): + self.ctx = ctx + self.src = src + self.name = name + + def __str__(self): + return f"{self.src}.{self.name}" + + def execute(self): + val = get_val(self.src) + return getattr(val, self.name) + + +def get_val(capture): + if isinstance(capture, Capture): + return capture.execute() + elif isinstance(capture, str): + return f'"{capture}"' + else: + return capture + + +class CaptureInitial(CaptureVariable): + def __init__(self, schema_df=None): + new_ctx: Dict[str, List[Any]] = {'operations': [], 'variables': [], 'schema_df': schema_df} + super().__init__(None, new_ctx) + self.name = f'input_{self.name}' + + +class CaptureDataFrame(CaptureInitial): + pass + + +class CaptureDataFrameWithDataPipeOps(CaptureDataFrame): + def as_datapipe(self): + return DataFrameTracedOps( + self.ctx['variables'][0].source_datapipe, self) + + def raw_iterator(self): + return self.as_datapipe().__iter__() + + def __iter__(self): + return iter(self._dataframes_as_tuples()) + + def batch(self, batch_size=10, drop_last: bool = False, wrapper_class=DataChunkDF): + dp = self._dataframes_per_row()._dataframes_concat(batch_size) + dp = dp.as_datapipe().batch(1, drop_last=drop_last, wrapper_class=wrapper_class) + dp._dp_contains_dataframe = True + return dp + + def groupby(self, + group_key_fn, + *, + buffer_size=10000, + group_size=None, + guaranteed_group_size=None, + drop_remaining=False): + dp = self._dataframes_per_row() + dp = dp.as_datapipe().groupby(group_key_fn, buffer_size=buffer_size, group_size=group_size, + guaranteed_group_size=guaranteed_group_size, drop_remaining=drop_remaining) + return dp + + def shuffle(self, *args, **kwargs): + return self._dataframes_shuffle(*args, **kwargs) + + def filter(self, *args, **kwargs): + return self._dataframes_filter(*args, **kwargs) + + def collate(self, *args, **kwargs): + raise Exception("Can't collate unbatched DataFrames stream") + + def __getattr__(self, attrname): # ? + if attrname in UNIMPLEMENTED_ATTR: + raise AttributeError('Attempting to get ', attrname) + if attrname in DATAPIPES_OPS: + return (self.as_datapipe()).__getattr__(attrname) + return super().__getattr__(attrname) + + +@functional_datapipe('trace_as_dataframe') +class DataFrameTracer(CaptureDataFrameWithDataPipeOps, IterDataPipe): # type: ignore[misc] + source_datapipe: Optional[Any] = None + + # TODO(VitalyFedyunin): Must implement all special functions of datapipes + + def set_shuffle_settings(self, *args, **kwargs): + pass + + def is_shardable(self): + return False + + def __init__(self, source_datapipe, schema_df=None): + self.source_datapipe = source_datapipe + if schema_df is None: + schema_df = next(iter(self.source_datapipe)) + super().__init__(schema_df=schema_df) diff --git a/shared/package-files/4a/4a35ca2563627d34d6402f4d95c58d99d864967d11104a44bda63a9d5cba9f8c/rnc.py b/shared/package-files/4a/4a35ca2563627d34d6402f4d95c58d99d864967d11104a44bda63a9d5cba9f8c/rnc.py new file mode 100644 index 0000000000000000000000000000000000000000..d71717538c017cc90fa2fb5fcf592e7d475f0848 --- /dev/null +++ b/shared/package-files/4a/4a35ca2563627d34d6402f4d95c58d99d864967d11104a44bda63a9d5cba9f8c/rnc.py @@ -0,0 +1,67 @@ +""" + pygments.lexers.rnc + ~~~~~~~~~~~~~~~~~~~ + + Lexer for Relax-NG Compact syntax + + :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Punctuation + +__all__ = ['RNCCompactLexer'] + + +class RNCCompactLexer(RegexLexer): + """ + For RelaxNG-compact syntax. + + .. versionadded:: 2.2 + """ + + name = 'Relax-NG Compact' + url = 'http://relaxng.org' + aliases = ['rng-compact', 'rnc'] + filenames = ['*.rnc'] + + tokens = { + 'root': [ + (r'namespace\b', Keyword.Namespace), + (r'(?:default|datatypes)\b', Keyword.Declaration), + (r'##.*$', Comment.Preproc), + (r'#.*$', Comment.Single), + (r'"[^"]*"', String.Double), + # TODO single quoted strings and escape sequences outside of + # double-quoted strings + (r'(?:element|attribute|mixed)\b', Keyword.Declaration, 'variable'), + (r'(text\b|xsd:[^ ]+)', Keyword.Type, 'maybe_xsdattributes'), + (r'[,?&*=|~]|>>', Operator), + (r'[(){}]', Punctuation), + (r'.', Text), + ], + + # a variable has been declared using `element` or `attribute` + 'variable': [ + (r'[^{]+', Name.Variable), + (r'\{', Punctuation, '#pop'), + ], + + # after an xsd: declaration there may be attributes + 'maybe_xsdattributes': [ + (r'\{', Punctuation, 'xsdattributes'), + (r'\}', Punctuation, '#pop'), + (r'.', Text), + ], + + # attributes take the form { key1 = value1 key2 = value2 ... } + 'xsdattributes': [ + (r'[^ =}]', Name.Attribute), + (r'=', Operator), + (r'"[^"]*"', String.Double), + (r'\}', Punctuation, '#pop'), + (r'.', Text), + ], + } diff --git a/shared/package-files/4a/4a389c8c0a6d7191b0b97fa26ff2eaecf94638da2dbe8d97278a77240f623552/test_utils.py b/shared/package-files/4a/4a389c8c0a6d7191b0b97fa26ff2eaecf94638da2dbe8d97278a77240f623552/test_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..6c93883a081d3614a604aeadc8a4b617181de669 --- /dev/null +++ b/shared/package-files/4a/4a389c8c0a6d7191b0b97fa26ff2eaecf94638da2dbe8d97278a77240f623552/test_utils.py @@ -0,0 +1,202 @@ +from sympy.core.numbers import comp, Rational +from sympy.physics.optics.utils import (refraction_angle, fresnel_coefficients, + deviation, brewster_angle, critical_angle, lens_makers_formula, + mirror_formula, lens_formula, hyperfocal_distance, + transverse_magnification) +from sympy.physics.optics.medium import Medium +from sympy.physics.units import e0 + +from sympy.core.numbers import oo +from sympy.core.symbol import symbols +from sympy.functions.elementary.miscellaneous import sqrt +from sympy.matrices.dense import Matrix +from sympy.geometry.point import Point3D +from sympy.geometry.line import Ray3D +from sympy.geometry.plane import Plane + +from sympy.testing.pytest import raises + + +ae = lambda a, b, n: comp(a, b, 10**-n) + + +def test_refraction_angle(): + n1, n2 = symbols('n1, n2') + m1 = Medium('m1') + m2 = Medium('m2') + r1 = Ray3D(Point3D(-1, -1, 1), Point3D(0, 0, 0)) + i = Matrix([1, 1, 1]) + n = Matrix([0, 0, 1]) + normal_ray = Ray3D(Point3D(0, 0, 0), Point3D(0, 0, 1)) + P = Plane(Point3D(0, 0, 0), normal_vector=[0, 0, 1]) + assert refraction_angle(r1, 1, 1, n) == Matrix([ + [ 1], + [ 1], + [-1]]) + assert refraction_angle([1, 1, 1], 1, 1, n) == Matrix([ + [ 1], + [ 1], + [-1]]) + assert refraction_angle((1, 1, 1), 1, 1, n) == Matrix([ + [ 1], + [ 1], + [-1]]) + assert refraction_angle(i, 1, 1, [0, 0, 1]) == Matrix([ + [ 1], + [ 1], + [-1]]) + assert refraction_angle(i, 1, 1, (0, 0, 1)) == Matrix([ + [ 1], + [ 1], + [-1]]) + assert refraction_angle(i, 1, 1, normal_ray) == Matrix([ + [ 1], + [ 1], + [-1]]) + assert refraction_angle(i, 1, 1, plane=P) == Matrix([ + [ 1], + [ 1], + [-1]]) + assert refraction_angle(r1, 1, 1, plane=P) == \ + Ray3D(Point3D(0, 0, 0), Point3D(1, 1, -1)) + assert refraction_angle(r1, m1, 1.33, plane=P) == \ + Ray3D(Point3D(0, 0, 0), Point3D(Rational(100, 133), Rational(100, 133), -789378201649271*sqrt(3)/1000000000000000)) + assert refraction_angle(r1, 1, m2, plane=P) == \ + Ray3D(Point3D(0, 0, 0), Point3D(1, 1, -1)) + assert refraction_angle(r1, n1, n2, plane=P) == \ + Ray3D(Point3D(0, 0, 0), Point3D(n1/n2, n1/n2, -sqrt(3)*sqrt(-2*n1**2/(3*n2**2) + 1))) + assert refraction_angle(r1, 1.33, 1, plane=P) == 0 # TIR + assert refraction_angle(r1, 1, 1, normal_ray) == \ + Ray3D(Point3D(0, 0, 0), direction_ratio=[1, 1, -1]) + assert ae(refraction_angle(0.5, 1, 2), 0.24207, 5) + assert ae(refraction_angle(0.5, 2, 1), 1.28293, 5) + raises(ValueError, lambda: refraction_angle(r1, m1, m2, normal_ray, P)) + raises(TypeError, lambda: refraction_angle(m1, m1, m2)) # can add other values for arg[0] + raises(TypeError, lambda: refraction_angle(r1, m1, m2, None, i)) + raises(TypeError, lambda: refraction_angle(r1, m1, m2, m2)) + + +def test_fresnel_coefficients(): + assert all(ae(i, j, 5) for i, j in zip( + fresnel_coefficients(0.5, 1, 1.33), + [0.11163, -0.17138, 0.83581, 0.82862])) + assert all(ae(i, j, 5) for i, j in zip( + fresnel_coefficients(0.5, 1.33, 1), + [-0.07726, 0.20482, 1.22724, 1.20482])) + m1 = Medium('m1') + m2 = Medium('m2', n=2) + assert all(ae(i, j, 5) for i, j in zip( + fresnel_coefficients(0.3, m1, m2), + [0.31784, -0.34865, 0.65892, 0.65135])) + ans = [[-0.23563, -0.97184], [0.81648, -0.57738]] + got = fresnel_coefficients(0.6, m2, m1) + for i, j in zip(got, ans): + for a, b in zip(i.as_real_imag(), j): + assert ae(a, b, 5) + + +def test_deviation(): + n1, n2 = symbols('n1, n2') + r1 = Ray3D(Point3D(-1, -1, 1), Point3D(0, 0, 0)) + n = Matrix([0, 0, 1]) + i = Matrix([-1, -1, -1]) + normal_ray = Ray3D(Point3D(0, 0, 0), Point3D(0, 0, 1)) + P = Plane(Point3D(0, 0, 0), normal_vector=[0, 0, 1]) + assert deviation(r1, 1, 1, normal=n) == 0 + assert deviation(r1, 1, 1, plane=P) == 0 + assert deviation(r1, 1, 1.1, plane=P).evalf(3) + 0.119 < 1e-3 + assert deviation(i, 1, 1.1, normal=normal_ray).evalf(3) + 0.119 < 1e-3 + assert deviation(r1, 1.33, 1, plane=P) is None # TIR + assert deviation(r1, 1, 1, normal=[0, 0, 1]) == 0 + assert deviation([-1, -1, -1], 1, 1, normal=[0, 0, 1]) == 0 + assert ae(deviation(0.5, 1, 2), -0.25793, 5) + assert ae(deviation(0.5, 2, 1), 0.78293, 5) + + +def test_brewster_angle(): + m1 = Medium('m1', n=1) + m2 = Medium('m2', n=1.33) + assert ae(brewster_angle(m1, m2), 0.93, 2) + m1 = Medium('m1', permittivity=e0, n=1) + m2 = Medium('m2', permittivity=e0, n=1.33) + assert ae(brewster_angle(m1, m2), 0.93, 2) + assert ae(brewster_angle(1, 1.33), 0.93, 2) + + +def test_critical_angle(): + m1 = Medium('m1', n=1) + m2 = Medium('m2', n=1.33) + assert ae(critical_angle(m2, m1), 0.85, 2) + + +def test_lens_makers_formula(): + n1, n2 = symbols('n1, n2') + m1 = Medium('m1', permittivity=e0, n=1) + m2 = Medium('m2', permittivity=e0, n=1.33) + assert lens_makers_formula(n1, n2, 10, -10) == 5.0*n2/(n1 - n2) + assert ae(lens_makers_formula(m1, m2, 10, -10), -20.15, 2) + assert ae(lens_makers_formula(1.33, 1, 10, -10), 15.15, 2) + + +def test_mirror_formula(): + u, v, f = symbols('u, v, f') + assert mirror_formula(focal_length=f, u=u) == f*u/(-f + u) + assert mirror_formula(focal_length=f, v=v) == f*v/(-f + v) + assert mirror_formula(u=u, v=v) == u*v/(u + v) + assert mirror_formula(u=oo, v=v) == v + assert mirror_formula(u=oo, v=oo) is oo + assert mirror_formula(focal_length=oo, u=u) == -u + assert mirror_formula(u=u, v=oo) == u + assert mirror_formula(focal_length=oo, v=oo) is oo + assert mirror_formula(focal_length=f, v=oo) == f + assert mirror_formula(focal_length=oo, v=v) == -v + assert mirror_formula(focal_length=oo, u=oo) is oo + assert mirror_formula(focal_length=f, u=oo) == f + assert mirror_formula(focal_length=oo, u=u) == -u + raises(ValueError, lambda: mirror_formula(focal_length=f, u=u, v=v)) + + +def test_lens_formula(): + u, v, f = symbols('u, v, f') + assert lens_formula(focal_length=f, u=u) == f*u/(f + u) + assert lens_formula(focal_length=f, v=v) == f*v/(f - v) + assert lens_formula(u=u, v=v) == u*v/(u - v) + assert lens_formula(u=oo, v=v) == v + assert lens_formula(u=oo, v=oo) is oo + assert lens_formula(focal_length=oo, u=u) == u + assert lens_formula(u=u, v=oo) == -u + assert lens_formula(focal_length=oo, v=oo) is -oo + assert lens_formula(focal_length=oo, v=v) == v + assert lens_formula(focal_length=f, v=oo) == -f + assert lens_formula(focal_length=oo, u=oo) is oo + assert lens_formula(focal_length=oo, u=u) == u + assert lens_formula(focal_length=f, u=oo) == f + raises(ValueError, lambda: lens_formula(focal_length=f, u=u, v=v)) + + +def test_hyperfocal_distance(): + f, N, c = symbols('f, N, c') + assert hyperfocal_distance(f=f, N=N, c=c) == f**2/(N*c) + assert ae(hyperfocal_distance(f=0.5, N=8, c=0.0033), 9.47, 2) + + +def test_transverse_magnification(): + si, so = symbols('si, so') + assert transverse_magnification(si, so) == -si/so + assert transverse_magnification(30, 15) == -2 + + +def test_lens_makers_formula_thick_lens(): + n1, n2 = symbols('n1, n2') + m1 = Medium('m1', permittivity=e0, n=1) + m2 = Medium('m2', permittivity=e0, n=1.33) + assert ae(lens_makers_formula(m1, m2, 10, -10, d=1), -19.82, 2) + assert lens_makers_formula(n1, n2, 1, -1, d=0.1) == n2/((2.0 - (0.1*n1 - 0.1*n2)/n1)*(n1 - n2)) + + +def test_lens_makers_formula_plano_lens(): + n1, n2 = symbols('n1, n2') + m1 = Medium('m1', permittivity=e0, n=1) + m2 = Medium('m2', permittivity=e0, n=1.33) + assert ae(lens_makers_formula(m1, m2, 10, oo), -40.30, 2) + assert lens_makers_formula(n1, n2, 10, oo) == 10.0*n2/(n1 - n2) diff --git a/shared/package-files/4a/4a3face161ba0a4c3178bbd0a00b45646e85c9427e1c34f1c58971d0e60c7461/tvi910+ b/shared/package-files/4a/4a3face161ba0a4c3178bbd0a00b45646e85c9427e1c34f1c58971d0e60c7461/tvi910+ new file mode 100644 index 0000000000000000000000000000000000000000..b93521db496c9398261e15484cdb9bc2034b533e Binary files /dev/null and b/shared/package-files/4a/4a3face161ba0a4c3178bbd0a00b45646e85c9427e1c34f1c58971d0e60c7461/tvi910+ differ diff --git a/shared/package-files/4a/4a4171a2e92929cfce8f02a8287466f15c0c6a9842314796049da0fe85b3dc3d/selectors.py b/shared/package-files/4a/4a4171a2e92929cfce8f02a8287466f15c0c6a9842314796049da0fe85b3dc3d/selectors.py new file mode 100644 index 0000000000000000000000000000000000000000..95b51d53868b7c3680d6511f9106e94dd47302a8 --- /dev/null +++ b/shared/package-files/4a/4a4171a2e92929cfce8f02a8287466f15c0c6a9842314796049da0fe85b3dc3d/selectors.py @@ -0,0 +1,32 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING + +from narwhals._compliant import CompliantSelector, LazySelectorNamespace +from narwhals._ibis.expr import IbisExpr + +if TYPE_CHECKING: + import ibis.expr.types as ir # noqa: F401 + + from narwhals._ibis.dataframe import IbisLazyFrame # noqa: F401 + from narwhals._ibis.expr import IbisWindowFunction + + +class IbisSelectorNamespace(LazySelectorNamespace["IbisLazyFrame", "ir.Value"]): + @property + def _selector(self) -> type[IbisSelector]: + return IbisSelector + + +class IbisSelector( # type: ignore[misc] + CompliantSelector["IbisLazyFrame", "ir.Value"], IbisExpr +): + _window_function: IbisWindowFunction | None = None + + def _to_expr(self) -> IbisExpr: + return IbisExpr( + self._call, + evaluate_output_names=self._evaluate_output_names, + alias_output_names=self._alias_output_names, + version=self._version, + ) diff --git a/shared/package-files/4a/4a425893e7131c2f2832f654efd4835d5eb5219d746081db05886b1c1e3bc8cf/parallel.py b/shared/package-files/4a/4a425893e7131c2f2832f654efd4835d5eb5219d746081db05886b1c1e3bc8cf/parallel.py new file mode 100644 index 0000000000000000000000000000000000000000..452bd3446fb2d590e7a0b7f812f3454f5ee909a0 --- /dev/null +++ b/shared/package-files/4a/4a425893e7131c2f2832f654efd4835d5eb5219d746081db05886b1c1e3bc8cf/parallel.py @@ -0,0 +1,2075 @@ +""" +Helpers for embarrassingly parallel code. +""" +# Author: Gael Varoquaux < gael dot varoquaux at normalesup dot org > +# Copyright: 2010, Gael Varoquaux +# License: BSD 3 clause + +from __future__ import division + +import collections +import functools +import itertools +import os +import queue +import sys +import threading +import time +import warnings +import weakref +from contextlib import nullcontext +from math import floor, log10, sqrt +from multiprocessing import TimeoutError +from numbers import Integral +from uuid import uuid4 + +from ._multiprocessing_helpers import mp + +# Make sure that those two classes are part of the public joblib.parallel API +# so that 3rd party backend implementers can import them from here. +from ._parallel_backends import ( + AutoBatchingMixin, # noqa + FallbackToBackend, + LokyBackend, + MultiprocessingBackend, + ParallelBackendBase, # noqa + SequentialBackend, + ThreadingBackend, +) +from ._utils import _Sentinel, eval_expr +from .disk import memstr_to_bytes +from .logger import Logger, short_format_time + +BACKENDS = { + "threading": ThreadingBackend, + "sequential": SequentialBackend, +} +# name of the backend used by default by Parallel outside of any context +# managed by ``parallel_config`` or ``parallel_backend``. + +# threading is the only backend that is always everywhere +DEFAULT_BACKEND = "threading" +DEFAULT_THREAD_BACKEND = "threading" +DEFAULT_PROCESS_BACKEND = "threading" + +MAYBE_AVAILABLE_BACKENDS = {"multiprocessing", "loky"} + +# if multiprocessing is available, so is loky, we set it as the default +# backend +if mp is not None: + BACKENDS["multiprocessing"] = MultiprocessingBackend + from .externals import loky + + BACKENDS["loky"] = LokyBackend + DEFAULT_BACKEND = "loky" + DEFAULT_PROCESS_BACKEND = "loky" + +# Thread local value that can be overridden by the ``parallel_config`` context +# manager +_backend = threading.local() + + +def _register_dask(): + """Register Dask Backend if called with parallel_config(backend="dask")""" + try: + from ._dask import DaskDistributedBackend + + register_parallel_backend("dask", DaskDistributedBackend) + except ImportError as e: + msg = ( + "To use the dask.distributed backend you must install both " + "the `dask` and distributed modules.\n\n" + "See https://dask.pydata.org/en/latest/install.html for more " + "information." + ) + raise ImportError(msg) from e + + +EXTERNAL_BACKENDS = { + "dask": _register_dask, +} + + +# Sentinels for the default values of the Parallel constructor and +# the parallel_config and parallel_backend context managers +default_parallel_config = { + "backend": _Sentinel(default_value=None), + "n_jobs": _Sentinel(default_value=None), + "verbose": _Sentinel(default_value=0), + "temp_folder": _Sentinel(default_value=None), + "max_nbytes": _Sentinel(default_value="1M"), + "mmap_mode": _Sentinel(default_value="r"), + "prefer": _Sentinel(default_value=None), + "require": _Sentinel(default_value=None), +} + + +VALID_BACKEND_HINTS = ("processes", "threads", None) +VALID_BACKEND_CONSTRAINTS = ("sharedmem", None) + + +def _get_config_param(param, context_config, key): + """Return the value of a parallel config parameter + + Explicitly setting it in Parallel has priority over setting in a + parallel_(config/backend) context manager. + """ + if param is not default_parallel_config[key]: + # param is explicitly set, return it + return param + + if context_config[key] is not default_parallel_config[key]: + # there's a context manager and the key is set, return it + return context_config[key] + + # Otherwise, we are in the default_parallel_config, + # return the default value + return param.default_value + + +def get_active_backend( + prefer=default_parallel_config["prefer"], + require=default_parallel_config["require"], + verbose=default_parallel_config["verbose"], +): + """Return the active default backend""" + backend, config = _get_active_backend(prefer, require, verbose) + n_jobs = _get_config_param(default_parallel_config["n_jobs"], config, "n_jobs") + return backend, n_jobs + + +def _get_active_backend( + prefer=default_parallel_config["prefer"], + require=default_parallel_config["require"], + verbose=default_parallel_config["verbose"], +): + """Return the active default backend""" + + backend_config = getattr(_backend, "config", default_parallel_config) + + backend = _get_config_param( + default_parallel_config["backend"], backend_config, "backend" + ) + + prefer = _get_config_param(prefer, backend_config, "prefer") + require = _get_config_param(require, backend_config, "require") + verbose = _get_config_param(verbose, backend_config, "verbose") + + if prefer not in VALID_BACKEND_HINTS: + raise ValueError( + f"prefer={prefer} is not a valid backend hint, " + f"expected one of {VALID_BACKEND_HINTS}" + ) + if require not in VALID_BACKEND_CONSTRAINTS: + raise ValueError( + f"require={require} is not a valid backend constraint, " + f"expected one of {VALID_BACKEND_CONSTRAINTS}" + ) + if prefer == "processes" and require == "sharedmem": + raise ValueError( + "prefer == 'processes' and require == 'sharedmem' are inconsistent settings" + ) + + explicit_backend = True + if backend is None: + # We are either outside of the scope of any parallel_(config/backend) + # context manager or the context manager did not set a backend. + # create the default backend instance now. + backend = BACKENDS[DEFAULT_BACKEND](nesting_level=0) + explicit_backend = False + + # Try to use the backend set by the user with the context manager. + + nesting_level = backend.nesting_level + uses_threads = getattr(backend, "uses_threads", False) + supports_sharedmem = getattr(backend, "supports_sharedmem", False) + # Force to use thread-based backend if the provided backend does not + # match the shared memory constraint or if the backend is not explicitly + # given and threads are preferred. + force_threads = (require == "sharedmem" and not supports_sharedmem) or ( + not explicit_backend and prefer == "threads" and not uses_threads + ) + force_processes = not explicit_backend and prefer == "processes" and uses_threads + + if force_threads: + # This backend does not match the shared memory constraint: + # fallback to the default thead-based backend. + sharedmem_backend = BACKENDS[DEFAULT_THREAD_BACKEND]( + nesting_level=nesting_level + ) + # Warn the user if we forced the backend to thread-based, while the + # user explicitly specified a non-thread-based backend. + if verbose >= 10 and explicit_backend: + print( + f"Using {sharedmem_backend.__class__.__name__} as " + f"joblib backend instead of {backend.__class__.__name__} " + "as the latter does not provide shared memory semantics." + ) + # Force to n_jobs=1 by default + thread_config = backend_config.copy() + thread_config["n_jobs"] = 1 + return sharedmem_backend, thread_config + + if force_processes: + # This backend does not match the prefer="processes" constraint: + # fallback to the default process-based backend. + process_backend = BACKENDS[DEFAULT_PROCESS_BACKEND](nesting_level=nesting_level) + + return process_backend, backend_config.copy() + + return backend, backend_config + + +class parallel_config: + """Set the default backend or configuration for :class:`~joblib.Parallel`. + + This is an alternative to directly passing keyword arguments to the + :class:`~joblib.Parallel` class constructor. It is particularly useful when + calling into library code that uses joblib internally but does not expose + the various parallel configuration arguments in its own API. + + Parameters + ---------- + backend: str or ParallelBackendBase instance, default=None + If ``backend`` is a string it must match a previously registered + implementation using the :func:`~register_parallel_backend` function. + + By default the following backends are available: + + - 'loky': single-host, process-based parallelism (used by default), + - 'threading': single-host, thread-based parallelism, + - 'multiprocessing': legacy single-host, process-based parallelism. + + 'loky' is recommended to run functions that manipulate Python objects. + 'threading' is a low-overhead alternative that is most efficient for + functions that release the Global Interpreter Lock: e.g. I/O-bound + code or CPU-bound code in a few calls to native code that explicitly + releases the GIL. Note that on some rare systems (such as pyodide), + multiprocessing and loky may not be available, in which case joblib + defaults to threading. + + In addition, if the ``dask`` and ``distributed`` Python packages are + installed, it is possible to use the 'dask' backend for better + scheduling of nested parallel calls without over-subscription and + potentially distribute parallel calls over a networked cluster of + several hosts. + + It is also possible to use the distributed 'ray' backend for + distributing the workload to a cluster of nodes. See more details + in the Examples section below. + + Alternatively the backend can be passed directly as an instance. + + n_jobs: int, default=None + The maximum number of concurrently running jobs, such as the number + of Python worker processes when ``backend="loky"`` or the size of the + thread-pool when ``backend="threading"``. + This argument is converted to an integer, rounded below for float. + If -1 is given, `joblib` tries to use all CPUs. The number of CPUs + ``n_cpus`` is obtained with :func:`~cpu_count`. + For n_jobs below -1, (n_cpus + 1 + n_jobs) are used. For instance, + using ``n_jobs=-2`` will result in all CPUs but one being used. + This argument can also go above ``n_cpus``, which will cause + oversubscription. In some cases, slight oversubscription can be + beneficial, e.g., for tasks with large I/O operations. + If 1 is given, no parallel computing code is used at all, and the + behavior amounts to a simple python `for` loop. This mode is not + compatible with `timeout`. + None is a marker for 'unset' that will be interpreted as n_jobs=1 + unless the call is performed under a :func:`~parallel_config` + context manager that sets another value for ``n_jobs``. + If n_jobs = 0 then a ValueError is raised. + + verbose: int, default=0 + The verbosity level: if non zero, progress messages are + printed. Above 50, the output is sent to stdout. + The frequency of the messages increases with the verbosity level. + If it more than 10, all iterations are reported. + + temp_folder: str or None, default=None + Folder to be used by the pool for memmapping large arrays + for sharing memory with worker processes. If None, this will try in + order: + + - a folder pointed by the ``JOBLIB_TEMP_FOLDER`` environment + variable, + - ``/dev/shm`` if the folder exists and is writable: this is a + RAM disk filesystem available by default on modern Linux + distributions, + - the default system temporary folder that can be + overridden with ``TMP``, ``TMPDIR`` or ``TEMP`` environment + variables, typically ``/tmp`` under Unix operating systems. + + max_nbytes: int, str, or None, optional, default='1M' + Threshold on the size of arrays passed to the workers that + triggers automated memory mapping in temp_folder. Can be an int + in Bytes, or a human-readable string, e.g., '1M' for 1 megabyte. + Use None to disable memmapping of large arrays. + + mmap_mode: {None, 'r+', 'r', 'w+', 'c'}, default='r' + Memmapping mode for numpy arrays passed to workers. None will + disable memmapping, other modes defined in the numpy.memmap doc: + https://numpy.org/doc/stable/reference/generated/numpy.memmap.html + Also, see 'max_nbytes' parameter documentation for more details. + + prefer: str in {'processes', 'threads'} or None, default=None + Soft hint to choose the default backend. + The default process-based backend is 'loky' and the default + thread-based backend is 'threading'. Ignored if the ``backend`` + parameter is specified. + + require: 'sharedmem' or None, default=None + Hard constraint to select the backend. If set to 'sharedmem', + the selected backend will be single-host and thread-based. + + inner_max_num_threads: int, default=None + If not None, overwrites the limit set on the number of threads + usable in some third-party library threadpools like OpenBLAS, + MKL or OpenMP. This is only used with the ``loky`` backend. + + backend_params: dict + Additional parameters to pass to the backend constructor when + backend is a string. + + Notes + ----- + Joblib tries to limit the oversubscription by limiting the number of + threads usable in some third-party library threadpools like OpenBLAS, MKL + or OpenMP. The default limit in each worker is set to + ``max(cpu_count() // effective_n_jobs, 1)`` but this limit can be + overwritten with the ``inner_max_num_threads`` argument which will be used + to set this limit in the child processes. + + .. versionadded:: 1.3 + + Examples + -------- + >>> from operator import neg + >>> with parallel_config(backend='threading'): + ... print(Parallel()(delayed(neg)(i + 1) for i in range(5))) + ... + [-1, -2, -3, -4, -5] + + To use the 'ray' joblib backend add the following lines: + + >>> from ray.util.joblib import register_ray # doctest: +SKIP + >>> register_ray() # doctest: +SKIP + >>> with parallel_config(backend="ray"): # doctest: +SKIP + ... print(Parallel()(delayed(neg)(i + 1) for i in range(5))) + [-1, -2, -3, -4, -5] + + """ + + def __init__( + self, + backend=default_parallel_config["backend"], + *, + n_jobs=default_parallel_config["n_jobs"], + verbose=default_parallel_config["verbose"], + temp_folder=default_parallel_config["temp_folder"], + max_nbytes=default_parallel_config["max_nbytes"], + mmap_mode=default_parallel_config["mmap_mode"], + prefer=default_parallel_config["prefer"], + require=default_parallel_config["require"], + inner_max_num_threads=None, + **backend_params, + ): + # Save the parallel info and set the active parallel config + self.old_parallel_config = getattr(_backend, "config", default_parallel_config) + + backend = self._check_backend(backend, inner_max_num_threads, **backend_params) + + new_config = { + "n_jobs": n_jobs, + "verbose": verbose, + "temp_folder": temp_folder, + "max_nbytes": max_nbytes, + "mmap_mode": mmap_mode, + "prefer": prefer, + "require": require, + "backend": backend, + } + self.parallel_config = self.old_parallel_config.copy() + self.parallel_config.update( + {k: v for k, v in new_config.items() if not isinstance(v, _Sentinel)} + ) + + setattr(_backend, "config", self.parallel_config) + + def _check_backend(self, backend, inner_max_num_threads, **backend_params): + if backend is default_parallel_config["backend"]: + if inner_max_num_threads is not None or len(backend_params) > 0: + raise ValueError( + "inner_max_num_threads and other constructor " + "parameters backend_params are only supported " + "when backend is not None." + ) + return backend + + if isinstance(backend, str): + # Handle non-registered or missing backends + if backend not in BACKENDS: + if backend in EXTERNAL_BACKENDS: + register = EXTERNAL_BACKENDS[backend] + register() + elif backend in MAYBE_AVAILABLE_BACKENDS: + warnings.warn( + f"joblib backend '{backend}' is not available on " + f"your system, falling back to {DEFAULT_BACKEND}.", + UserWarning, + stacklevel=2, + ) + BACKENDS[backend] = BACKENDS[DEFAULT_BACKEND] + else: + raise ValueError( + f"Invalid backend: {backend}, expected one of " + f"{sorted(BACKENDS.keys())}" + ) + + backend = BACKENDS[backend](**backend_params) + else: + if len(backend_params) > 0: + raise ValueError( + "Constructor parameters backend_params are only " + "supported when backend is a string." + ) + + if inner_max_num_threads is not None: + msg = ( + f"{backend.__class__.__name__} does not accept setting the " + "inner_max_num_threads argument." + ) + assert backend.supports_inner_max_num_threads, msg + backend.inner_max_num_threads = inner_max_num_threads + + # If the nesting_level of the backend is not set previously, use the + # nesting level from the previous active_backend to set it + if backend.nesting_level is None: + parent_backend = self.old_parallel_config["backend"] + if parent_backend is default_parallel_config["backend"]: + nesting_level = 0 + else: + nesting_level = parent_backend.nesting_level + backend.nesting_level = nesting_level + + return backend + + def __enter__(self): + return self.parallel_config + + def __exit__(self, type, value, traceback): + self.unregister() + + def unregister(self): + setattr(_backend, "config", self.old_parallel_config) + + +class parallel_backend(parallel_config): + """Change the default backend used by Parallel inside a with block. + + .. warning:: + It is advised to use the :class:`~joblib.parallel_config` context + manager instead, which allows more fine-grained control over the + backend configuration. + + If ``backend`` is a string it must match a previously registered + implementation using the :func:`~register_parallel_backend` function. + + By default the following backends are available: + + - 'loky': single-host, process-based parallelism (used by default), + - 'threading': single-host, thread-based parallelism, + - 'multiprocessing': legacy single-host, process-based parallelism. + + 'loky' is recommended to run functions that manipulate Python objects. + 'threading' is a low-overhead alternative that is most efficient for + functions that release the Global Interpreter Lock: e.g. I/O-bound code or + CPU-bound code in a few calls to native code that explicitly releases the + GIL. Note that on some rare systems (such as Pyodide), + multiprocessing and loky may not be available, in which case joblib + defaults to threading. + + You can also use the `Dask `_ joblib + backend to distribute work across machines. This works well with + scikit-learn estimators with the ``n_jobs`` parameter, for example:: + + >>> import joblib # doctest: +SKIP + >>> from sklearn.model_selection import GridSearchCV # doctest: +SKIP + >>> from dask.distributed import Client, LocalCluster # doctest: +SKIP + + >>> # create a local Dask cluster + >>> cluster = LocalCluster() # doctest: +SKIP + >>> client = Client(cluster) # doctest: +SKIP + >>> grid_search = GridSearchCV(estimator, param_grid, n_jobs=-1) + ... # doctest: +SKIP + >>> with joblib.parallel_backend("dask", scatter=[X, y]): # doctest: +SKIP + ... grid_search.fit(X, y) + + It is also possible to use the distributed 'ray' backend for distributing + the workload to a cluster of nodes. To use the 'ray' joblib backend add + the following lines:: + + >>> from ray.util.joblib import register_ray # doctest: +SKIP + >>> register_ray() # doctest: +SKIP + >>> with parallel_backend("ray"): # doctest: +SKIP + ... print(Parallel()(delayed(neg)(i + 1) for i in range(5))) + [-1, -2, -3, -4, -5] + + Alternatively the backend can be passed directly as an instance. + + By default all available workers will be used (``n_jobs=-1``) unless the + caller passes an explicit value for the ``n_jobs`` parameter. + + This is an alternative to passing a ``backend='backend_name'`` argument to + the :class:`~Parallel` class constructor. It is particularly useful when + calling into library code that uses joblib internally but does not expose + the backend argument in its own API. + + >>> from operator import neg + >>> with parallel_backend('threading'): + ... print(Parallel()(delayed(neg)(i + 1) for i in range(5))) + ... + [-1, -2, -3, -4, -5] + + Joblib also tries to limit the oversubscription by limiting the number of + threads usable in some third-party library threadpools like OpenBLAS, MKL + or OpenMP. The default limit in each worker is set to + ``max(cpu_count() // effective_n_jobs, 1)`` but this limit can be + overwritten with the ``inner_max_num_threads`` argument which will be used + to set this limit in the child processes. + + .. versionadded:: 0.10 + + See Also + -------- + joblib.parallel_config: context manager to change the backend configuration. + """ + + def __init__( + self, backend, n_jobs=-1, inner_max_num_threads=None, **backend_params + ): + super().__init__( + backend=backend, + n_jobs=n_jobs, + inner_max_num_threads=inner_max_num_threads, + **backend_params, + ) + + if self.old_parallel_config is None: + self.old_backend_and_jobs = None + else: + self.old_backend_and_jobs = ( + self.old_parallel_config["backend"], + self.old_parallel_config["n_jobs"], + ) + self.new_backend_and_jobs = ( + self.parallel_config["backend"], + self.parallel_config["n_jobs"], + ) + + def __enter__(self): + return self.new_backend_and_jobs + + +# Under Linux or OS X the default start method of multiprocessing +# can cause third party libraries to crash. Under Python 3.4+ it is possible +# to set an environment variable to switch the default start method from +# 'fork' to 'forkserver' or 'spawn' to avoid this issue albeit at the cost +# of causing semantic changes and some additional pool instantiation overhead. +DEFAULT_MP_CONTEXT = None +if hasattr(mp, "get_context"): + method = os.environ.get("JOBLIB_START_METHOD", "").strip() or None + if method is not None: + DEFAULT_MP_CONTEXT = mp.get_context(method=method) + + +class BatchedCalls(object): + """Wrap a sequence of (func, args, kwargs) tuples as a single callable""" + + def __init__( + self, iterator_slice, backend_and_jobs, reducer_callback=None, pickle_cache=None + ): + self.items = list(iterator_slice) + self._size = len(self.items) + self._reducer_callback = reducer_callback + if isinstance(backend_and_jobs, tuple): + self._backend, self._n_jobs = backend_and_jobs + else: + # this is for backward compatibility purposes. Before 0.12.6, + # nested backends were returned without n_jobs indications. + self._backend, self._n_jobs = backend_and_jobs, None + self._pickle_cache = pickle_cache if pickle_cache is not None else {} + + def __call__(self): + # Set the default nested backend to self._backend but do not set the + # change the default number of processes to -1 + with parallel_config(backend=self._backend, n_jobs=self._n_jobs): + return [func(*args, **kwargs) for func, args, kwargs in self.items] + + def __reduce__(self): + if self._reducer_callback is not None: + self._reducer_callback() + # no need to pickle the callback. + return ( + BatchedCalls, + (self.items, (self._backend, self._n_jobs), None, self._pickle_cache), + ) + + def __len__(self): + return self._size + + +# Possible exit status for a task +TASK_DONE = "Done" +TASK_ERROR = "Error" +TASK_PENDING = "Pending" + + +############################################################################### +# CPU count that works also when multiprocessing has been disabled via +# the JOBLIB_MULTIPROCESSING environment variable +def cpu_count(only_physical_cores=False): + """Return the number of CPUs. + + This delegates to loky.cpu_count that takes into account additional + constraints such as Linux CFS scheduler quotas (typically set by container + runtimes such as docker) and CPU affinity (for instance using the taskset + command on Linux). + + Parameters + ---------- + only_physical_cores : boolean, default=False + If True, does not take hyperthreading / SMT logical cores into account. + + """ + if mp is None: + return 1 + + return loky.cpu_count(only_physical_cores=only_physical_cores) + + +############################################################################### +# For verbosity + + +def _verbosity_filter(index, verbose): + """Returns False for indices increasingly apart, the distance + depending on the value of verbose. + + We use a lag increasing as the square of index + """ + if not verbose: + return True + elif verbose > 10: + return False + if index == 0: + return False + verbose = 0.5 * (11 - verbose) ** 2 + scale = sqrt(index / verbose) + next_scale = sqrt((index + 1) / verbose) + return int(next_scale) == int(scale) + + +############################################################################### +def delayed(function): + """Decorator used to capture the arguments of a function.""" + + def delayed_function(*args, **kwargs): + return function, args, kwargs + + try: + delayed_function = functools.wraps(function)(delayed_function) + except AttributeError: + " functools.wraps fails on some callable objects " + return delayed_function + + +############################################################################### +class BatchCompletionCallBack(object): + """Callback to keep track of completed results and schedule the next tasks. + + This callable is executed by the parent process whenever a worker process + has completed a batch of tasks. + + It is used for progress reporting, to update estimate of the batch + processing duration and to schedule the next batch of tasks to be + processed. + + It is assumed that this callback will always be triggered by the backend + right after the end of a task, in case of success as well as in case of + failure. + """ + + ########################################################################## + # METHODS CALLED BY THE MAIN THREAD # + ########################################################################## + def __init__(self, dispatch_timestamp, batch_size, parallel): + self.dispatch_timestamp = dispatch_timestamp + self.batch_size = batch_size + self.parallel = parallel + self.parallel_call_id = parallel._call_id + self._completion_timeout_counter = None + + # Internals to keep track of the status and outcome of the task. + + # Used to hold a reference to the future-like object returned by the + # backend after launching this task + # This will be set later when calling `register_job`, as it is only + # created once the task has been submitted. + self.job = None + + if not parallel._backend.supports_retrieve_callback: + # The status is only used for asynchronous result retrieval in the + # callback. + self.status = None + else: + # The initial status for the job is TASK_PENDING. + # Once it is done, it will be either TASK_DONE, or TASK_ERROR. + self.status = TASK_PENDING + + def register_job(self, job): + """Register the object returned by `submit`.""" + self.job = job + + def get_result(self, timeout): + """Returns the raw result of the task that was submitted. + + If the task raised an exception rather than returning, this same + exception will be raised instead. + + If the backend supports the retrieval callback, it is assumed that this + method is only called after the result has been registered. It is + ensured by checking that `self.status(timeout)` does not return + TASK_PENDING. In this case, `get_result` directly returns the + registered result (or raise the registered exception). + + For other backends, there are no such assumptions, but `get_result` + still needs to synchronously retrieve the result before it can + return it or raise. It will block at most `self.timeout` seconds + waiting for retrieval to complete, after that it raises a TimeoutError. + """ + + backend = self.parallel._backend + + if backend.supports_retrieve_callback: + # We assume that the result has already been retrieved by the + # callback thread, and is stored internally. It's just waiting to + # be returned. + return self._return_or_raise() + + # For other backends, the main thread needs to run the retrieval step. + try: + result = backend.retrieve_result(self.job, timeout=timeout) + outcome = dict(result=result, status=TASK_DONE) + except BaseException as e: + outcome = dict(result=e, status=TASK_ERROR) + self._register_outcome(outcome) + + return self._return_or_raise() + + def _return_or_raise(self): + try: + if self.status == TASK_ERROR: + raise self._result + return self._result + finally: + del self._result + + def get_status(self, timeout): + """Get the status of the task. + + This function also checks if the timeout has been reached and register + the TimeoutError outcome when it is the case. + """ + if timeout is None or self.status != TASK_PENDING: + return self.status + + # The computation are running and the status is pending. + # Check that we did not wait for this jobs more than `timeout`. + now = time.time() + if self._completion_timeout_counter is None: + self._completion_timeout_counter = now + + if (now - self._completion_timeout_counter) > timeout: + outcome = dict(result=TimeoutError(), status=TASK_ERROR) + self._register_outcome(outcome) + + return self.status + + ########################################################################## + # METHODS CALLED BY CALLBACK THREADS # + ########################################################################## + def __call__(self, *args, **kwargs): + """Function called by the callback thread after a job is completed.""" + + # If the backend doesn't support callback retrievals, the next batch of + # tasks is dispatched regardless. The result will be retrieved by the + # main thread when calling `get_result`. + if not self.parallel._backend.supports_retrieve_callback: + self._dispatch_new() + return + + # If the backend supports retrieving the result in the callback, it + # registers the task outcome (TASK_ERROR or TASK_DONE), and schedules + # the next batch if needed. + with self.parallel._lock: + # Edge case where while the task was processing, the `parallel` + # instance has been reset and a new call has been issued, but the + # worker managed to complete the task and trigger this callback + # call just before being aborted by the reset. + if self.parallel._call_id != self.parallel_call_id: + return + + # When aborting, stop as fast as possible and do not retrieve the + # result as it won't be returned by the Parallel call. + if self.parallel._aborting: + return + + # Retrieves the result of the task in the main process and dispatch + # a new batch if needed. + job_succeeded = self._retrieve_result(*args, **kwargs) + + if job_succeeded: + self._dispatch_new() + + def _dispatch_new(self): + """Schedule the next batch of tasks to be processed.""" + + # This steps ensure that auto-batching works as expected. + this_batch_duration = time.time() - self.dispatch_timestamp + self.parallel._backend.batch_completed(self.batch_size, this_batch_duration) + + # Schedule the next batch of tasks. + with self.parallel._lock: + self.parallel.n_completed_tasks += self.batch_size + self.parallel.print_progress() + if self.parallel._original_iterator is not None: + self.parallel.dispatch_next() + + def _retrieve_result(self, out): + """Fetch and register the outcome of a task. + + Return True if the task succeeded, False otherwise. + This function is only called by backends that support retrieving + the task result in the callback thread. + """ + try: + result = self.parallel._backend.retrieve_result_callback(out) + outcome = dict(status=TASK_DONE, result=result) + except BaseException as e: + # Avoid keeping references to parallel in the error. + e.__traceback__ = None + outcome = dict(result=e, status=TASK_ERROR) + + self._register_outcome(outcome) + return outcome["status"] != TASK_ERROR + + ########################################################################## + # This method can be called either in the main thread # + # or in the callback thread. # + ########################################################################## + def _register_outcome(self, outcome): + """Register the outcome of a task. + + This method can be called only once, future calls will be ignored. + """ + # Covers the edge case where the main thread tries to register a + # `TimeoutError` while the callback thread tries to register a result + # at the same time. + with self.parallel._lock: + if self.status not in (TASK_PENDING, None): + return + self.status = outcome["status"] + + self._result = outcome["result"] + + # Once the result and the status are extracted, the last reference to + # the job can be deleted. + self.job = None + + # As soon as an error as been spotted, early stopping flags are sent to + # the `parallel` instance. + if self.status == TASK_ERROR: + self.parallel._exception = True + self.parallel._aborting = True + + if self.parallel.return_ordered: + return + + with self.parallel._lock: + # For `return_as=generator_unordered`, append the job to the queue + # in the order of completion instead of submission. + self.parallel._jobs.append(self) + + +############################################################################### +def register_parallel_backend(name, factory, make_default=False): + """Register a new Parallel backend factory. + + The new backend can then be selected by passing its name as the backend + argument to the :class:`~Parallel` class. Moreover, the default backend can + be overwritten globally by setting make_default=True. + + The factory can be any callable that takes no argument and return an + instance of ``ParallelBackendBase``. + + Warning: this function is experimental and subject to change in a future + version of joblib. + + .. versionadded:: 0.10 + """ + BACKENDS[name] = factory + if make_default: + global DEFAULT_BACKEND + DEFAULT_BACKEND = name + + +def effective_n_jobs(n_jobs=-1): + """Determine the number of jobs that can actually run in parallel + + n_jobs is the number of workers requested by the callers. Passing n_jobs=-1 + means requesting all available workers for instance matching the number of + CPU cores on the worker host(s). + + This method should return a guesstimate of the number of workers that can + actually perform work concurrently with the currently enabled default + backend. The primary use case is to make it possible for the caller to know + in how many chunks to slice the work. + + In general working on larger data chunks is more efficient (less scheduling + overhead and better use of CPU cache prefetching heuristics) as long as all + the workers have enough work to do. + + Warning: this function is experimental and subject to change in a future + version of joblib. + + .. versionadded:: 0.10 + """ + if n_jobs == 1: + return 1 + + backend, backend_n_jobs = get_active_backend() + if n_jobs is None: + n_jobs = backend_n_jobs + return backend.effective_n_jobs(n_jobs=n_jobs) + + +############################################################################### +class Parallel(Logger): + """Helper class for readable parallel mapping. + + Read more in the :ref:`User Guide `. + + Parameters + ---------- + n_jobs: int, default=None + The maximum number of concurrently running jobs, such as the number + of Python worker processes when ``backend="loky"`` or the size of + the thread-pool when ``backend="threading"``. + This argument is converted to an integer, rounded below for float. + If -1 is given, `joblib` tries to use all CPUs. The number of CPUs + ``n_cpus`` is obtained with :func:`~cpu_count`. + For n_jobs below -1, (n_cpus + 1 + n_jobs) are used. For instance, + using ``n_jobs=-2`` will result in all CPUs but one being used. + This argument can also go above ``n_cpus``, which will cause + oversubscription. In some cases, slight oversubscription can be + beneficial, e.g., for tasks with large I/O operations. + If 1 is given, no parallel computing code is used at all, and the + behavior amounts to a simple python `for` loop. This mode is not + compatible with ``timeout``. + None is a marker for 'unset' that will be interpreted as n_jobs=1 + unless the call is performed under a :func:`~parallel_config` + context manager that sets another value for ``n_jobs``. + If n_jobs = 0 then a ValueError is raised. + backend: str, ParallelBackendBase instance or None, default='loky' + Specify the parallelization backend implementation. + Supported backends are: + + - "loky" used by default, can induce some + communication and memory overhead when exchanging input and + output data with the worker Python processes. On some rare + systems (such as Pyiodide), the loky backend may not be + available. + - "multiprocessing" previous process-based backend based on + `multiprocessing.Pool`. Less robust than `loky`. + - "threading" is a very low-overhead backend but it suffers + from the Python Global Interpreter Lock if the called function + relies a lot on Python objects. "threading" is mostly useful + when the execution bottleneck is a compiled extension that + explicitly releases the GIL (for instance a Cython loop wrapped + in a "with nogil" block or an expensive call to a library such + as NumPy). + - finally, you can register backends by calling + :func:`~register_parallel_backend`. This will allow you to + implement a backend of your liking. + + It is not recommended to hard-code the backend name in a call to + :class:`~Parallel` in a library. Instead it is recommended to set + soft hints (prefer) or hard constraints (require) so as to make it + possible for library users to change the backend from the outside + using the :func:`~parallel_config` context manager. + return_as: str in {'list', 'generator', 'generator_unordered'}, default='list' + If 'list', calls to this instance will return a list, only when + all results have been processed and retrieved. + If 'generator', it will return a generator that yields the results + as soon as they are available, in the order the tasks have been + submitted with. + If 'generator_unordered', the generator will immediately yield + available results independently of the submission order. The output + order is not deterministic in this case because it depends on the + concurrency of the workers. + prefer: str in {'processes', 'threads'} or None, default=None + Soft hint to choose the default backend if no specific backend + was selected with the :func:`~parallel_config` context manager. + The default process-based backend is 'loky' and the default + thread-based backend is 'threading'. Ignored if the ``backend`` + parameter is specified. + require: 'sharedmem' or None, default=None + Hard constraint to select the backend. If set to 'sharedmem', + the selected backend will be single-host and thread-based even + if the user asked for a non-thread based backend with + :func:`~joblib.parallel_config`. + verbose: int, default=0 + The verbosity level: if non zero, progress messages are + printed. Above 50, the output is sent to stdout. + The frequency of the messages increases with the verbosity level. + If it more than 10, all iterations are reported. + timeout: float or None, default=None + Timeout limit for each task to complete. If any task takes longer + a TimeOutError will be raised. Only applied when n_jobs != 1 + pre_dispatch: {'all', integer, or expression, as in '3*n_jobs'}, default='2*n_jobs' + The number of batches (of tasks) to be pre-dispatched. + Default is '2*n_jobs'. When batch_size="auto" this is reasonable + default and the workers should never starve. Note that only basic + arithmetic are allowed here and no modules can be used in this + expression. + batch_size: int or 'auto', default='auto' + The number of atomic tasks to dispatch at once to each + worker. When individual evaluations are very fast, dispatching + calls to workers can be slower than sequential computation because + of the overhead. Batching fast computations together can mitigate + this. + The ``'auto'`` strategy keeps track of the time it takes for a + batch to complete, and dynamically adjusts the batch size to keep + the time on the order of half a second, using a heuristic. The + initial batch size is 1. + ``batch_size="auto"`` with ``backend="threading"`` will dispatch + batches of a single task at a time as the threading backend has + very little overhead and using larger batch size has not proved to + bring any gain in that case. + temp_folder: str or None, default=None + Folder to be used by the pool for memmapping large arrays + for sharing memory with worker processes. If None, this will try in + order: + + - a folder pointed by the JOBLIB_TEMP_FOLDER environment + variable, + - /dev/shm if the folder exists and is writable: this is a + RAM disk filesystem available by default on modern Linux + distributions, + - the default system temporary folder that can be + overridden with TMP, TMPDIR or TEMP environment + variables, typically /tmp under Unix operating systems. + + Only active when ``backend="loky"`` or ``"multiprocessing"``. + max_nbytes int, str, or None, optional, default='1M' + Threshold on the size of arrays passed to the workers that + triggers automated memory mapping in temp_folder. Can be an int + in Bytes, or a human-readable string, e.g., '1M' for 1 megabyte. + Use None to disable memmapping of large arrays. + Only active when ``backend="loky"`` or ``"multiprocessing"``. + mmap_mode: {None, 'r+', 'r', 'w+', 'c'}, default='r' + Memmapping mode for numpy arrays passed to workers. None will + disable memmapping, other modes defined in the numpy.memmap doc: + https://numpy.org/doc/stable/reference/generated/numpy.memmap.html + Also, see 'max_nbytes' parameter documentation for more details. + backend_kwargs: dict, optional + Additional parameters to pass to the backend `configure` method. + + Notes + ----- + + This object uses workers to compute in parallel the application of a + function to many different arguments. The main functionality it brings + in addition to using the raw multiprocessing or concurrent.futures API + are (see examples for details): + + * More readable code, in particular since it avoids + constructing list of arguments. + + * Easier debugging: + - informative tracebacks even when the error happens on + the client side + - using 'n_jobs=1' enables to turn off parallel computing + for debugging without changing the codepath + - early capture of pickling errors + + * An optional progress meter. + + * Interruption of multiprocesses jobs with 'Ctrl-C' + + * Flexible pickling control for the communication to and from + the worker processes. + + * Ability to use shared memory efficiently with worker + processes for large numpy-based datastructures. + + Note that the intended usage is to run one call at a time. Multiple + calls to the same Parallel object will result in a ``RuntimeError`` + + Examples + -------- + + A simple example: + + >>> from math import sqrt + >>> from joblib import Parallel, delayed + >>> Parallel(n_jobs=1)(delayed(sqrt)(i**2) for i in range(10)) + [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0] + + Reshaping the output when the function has several return + values: + + >>> from math import modf + >>> from joblib import Parallel, delayed + >>> r = Parallel(n_jobs=1)(delayed(modf)(i/2.) for i in range(10)) + >>> res, i = zip(*r) + >>> res + (0.0, 0.5, 0.0, 0.5, 0.0, 0.5, 0.0, 0.5, 0.0, 0.5) + >>> i + (0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0) + + The progress meter: the higher the value of `verbose`, the more + messages: + + >>> from time import sleep + >>> from joblib import Parallel, delayed + >>> r = Parallel(n_jobs=2, verbose=10)( + ... delayed(sleep)(.2) for _ in range(10)) #doctest: +SKIP + [Parallel(n_jobs=2)]: Done 1 tasks | elapsed: 0.6s + [Parallel(n_jobs=2)]: Done 4 tasks | elapsed: 0.8s + [Parallel(n_jobs=2)]: Done 10 out of 10 | elapsed: 1.4s finished + + Traceback example, note how the line of the error is indicated + as well as the values of the parameter passed to the function that + triggered the exception, even though the traceback happens in the + child process: + + >>> from heapq import nlargest + >>> from joblib import Parallel, delayed + >>> Parallel(n_jobs=2)( + ... delayed(nlargest)(2, n) for n in (range(4), 'abcde', 3)) + ... # doctest: +SKIP + ----------------------------------------------------------------------- + Sub-process traceback: + ----------------------------------------------------------------------- + TypeError Mon Nov 12 11:37:46 2012 + PID: 12934 Python 2.7.3: /usr/bin/python + ........................................................................ + /usr/lib/python2.7/heapq.pyc in nlargest(n=2, iterable=3, key=None) + 419 if n >= size: + 420 return sorted(iterable, key=key, reverse=True)[:n] + 421 + 422 # When key is none, use simpler decoration + 423 if key is None: + --> 424 it = izip(iterable, count(0,-1)) # decorate + 425 result = _nlargest(n, it) + 426 return map(itemgetter(0), result) # undecorate + 427 + 428 # General case, slowest method + TypeError: izip argument #1 must support iteration + _______________________________________________________________________ + + + Using pre_dispatch in a producer/consumer situation, where the + data is generated on the fly. Note how the producer is first + called 3 times before the parallel loop is initiated, and then + called to generate new data on the fly: + + >>> from math import sqrt + >>> from joblib import Parallel, delayed + >>> def producer(): + ... for i in range(6): + ... print('Produced %s' % i) + ... yield i + >>> out = Parallel(n_jobs=2, verbose=100, pre_dispatch='1.5*n_jobs')( + ... delayed(sqrt)(i) for i in producer()) #doctest: +SKIP + Produced 0 + Produced 1 + Produced 2 + [Parallel(n_jobs=2)]: Done 1 jobs | elapsed: 0.0s + Produced 3 + [Parallel(n_jobs=2)]: Done 2 jobs | elapsed: 0.0s + Produced 4 + [Parallel(n_jobs=2)]: Done 3 jobs | elapsed: 0.0s + Produced 5 + [Parallel(n_jobs=2)]: Done 4 jobs | elapsed: 0.0s + [Parallel(n_jobs=2)]: Done 6 out of 6 | elapsed: 0.0s remaining: 0.0s + [Parallel(n_jobs=2)]: Done 6 out of 6 | elapsed: 0.0s finished + + """ # noqa: E501 + + def __init__( + self, + n_jobs=default_parallel_config["n_jobs"], + backend=default_parallel_config["backend"], + return_as="list", + verbose=default_parallel_config["verbose"], + timeout=None, + pre_dispatch="2 * n_jobs", + batch_size="auto", + temp_folder=default_parallel_config["temp_folder"], + max_nbytes=default_parallel_config["max_nbytes"], + mmap_mode=default_parallel_config["mmap_mode"], + prefer=default_parallel_config["prefer"], + require=default_parallel_config["require"], + **backend_kwargs, + ): + # Initiate parent Logger class state + super().__init__() + + # Interpret n_jobs=None as 'unset' + if n_jobs is None: + n_jobs = default_parallel_config["n_jobs"] + + active_backend, context_config = _get_active_backend( + prefer=prefer, require=require, verbose=verbose + ) + + nesting_level = active_backend.nesting_level + + self.verbose = _get_config_param(verbose, context_config, "verbose") + self.timeout = timeout + self.pre_dispatch = pre_dispatch + + if return_as not in {"list", "generator", "generator_unordered"}: + raise ValueError( + 'Expected `return_as` parameter to be a string equal to "list"' + f',"generator" or "generator_unordered", but got {return_as} ' + "instead." + ) + self.return_as = return_as + self.return_generator = return_as != "list" + self.return_ordered = return_as != "generator_unordered" + + # Check if we are under a parallel_config or parallel_backend + # context manager and use the config from the context manager + # for arguments that are not explicitly set. + self._backend_kwargs = { + **backend_kwargs, + **{ + k: _get_config_param(param, context_config, k) + for param, k in [ + (max_nbytes, "max_nbytes"), + (temp_folder, "temp_folder"), + (mmap_mode, "mmap_mode"), + (prefer, "prefer"), + (require, "require"), + (verbose, "verbose"), + ] + }, + } + + if isinstance(self._backend_kwargs["max_nbytes"], str): + self._backend_kwargs["max_nbytes"] = memstr_to_bytes( + self._backend_kwargs["max_nbytes"] + ) + self._backend_kwargs["verbose"] = max(0, self._backend_kwargs["verbose"] - 50) + + if DEFAULT_MP_CONTEXT is not None: + self._backend_kwargs["context"] = DEFAULT_MP_CONTEXT + elif hasattr(mp, "get_context"): + self._backend_kwargs["context"] = mp.get_context() + + if backend is default_parallel_config["backend"] or backend is None: + backend = active_backend + + elif isinstance(backend, ParallelBackendBase): + # Use provided backend as is, with the current nesting_level if it + # is not set yet. + if backend.nesting_level is None: + backend.nesting_level = nesting_level + + elif hasattr(backend, "Pool") and hasattr(backend, "Lock"): + # Make it possible to pass a custom multiprocessing context as + # backend to change the start method to forkserver or spawn or + # preload modules on the forkserver helper process. + self._backend_kwargs["context"] = backend + backend = MultiprocessingBackend(nesting_level=nesting_level) + + elif backend not in BACKENDS and backend in MAYBE_AVAILABLE_BACKENDS: + warnings.warn( + f"joblib backend '{backend}' is not available on " + f"your system, falling back to {DEFAULT_BACKEND}.", + UserWarning, + stacklevel=2, + ) + BACKENDS[backend] = BACKENDS[DEFAULT_BACKEND] + backend = BACKENDS[DEFAULT_BACKEND](nesting_level=nesting_level) + + else: + try: + backend_factory = BACKENDS[backend] + except KeyError as e: + raise ValueError( + "Invalid backend: %s, expected one of %r" + % (backend, sorted(BACKENDS.keys())) + ) from e + backend = backend_factory(nesting_level=nesting_level) + + n_jobs = _get_config_param(n_jobs, context_config, "n_jobs") + if n_jobs is None: + # No specific context override and no specific value request: + # default to the default of the backend. + n_jobs = backend.default_n_jobs + try: + n_jobs = int(n_jobs) + except ValueError: + raise ValueError("n_jobs could not be converted to int") + self.n_jobs = n_jobs + + if require == "sharedmem" and not getattr(backend, "supports_sharedmem", False): + raise ValueError("Backend %s does not support shared memory" % backend) + + if batch_size == "auto" or isinstance(batch_size, Integral) and batch_size > 0: + self.batch_size = batch_size + else: + raise ValueError( + "batch_size must be 'auto' or a positive integer, got: %r" % batch_size + ) + + if not isinstance(backend, SequentialBackend): + if self.return_generator and not backend.supports_return_generator: + raise ValueError( + "Backend {} does not support return_as={}".format( + backend, return_as + ) + ) + # This lock is used to coordinate the main thread of this process + # with the async callback thread of our the pool. + self._lock = threading.RLock() + self._jobs = collections.deque() + self._jobs_set = set() + self._pending_outputs = list() + self._ready_batches = queue.Queue() + self._reducer_callback = None + + # Internal variables + self._backend = backend + self._running = False + self._managed_backend = False + self._id = uuid4().hex + self._call_ref = None + + def __enter__(self): + self._managed_backend = True + self._calling = False + self._initialize_backend() + return self + + def __exit__(self, exc_type, exc_value, traceback): + self._managed_backend = False + if self.return_generator and self._calling: + self._abort() + self._terminate_and_reset() + + def _initialize_backend(self): + """Build a process or thread pool and return the number of workers""" + try: + n_jobs = self._backend.configure( + n_jobs=self.n_jobs, parallel=self, **self._backend_kwargs + ) + if self.timeout is not None and not self._backend.supports_timeout: + warnings.warn( + "The backend class {!r} does not support timeout. " + "You have set 'timeout={}' in Parallel but " + "the 'timeout' parameter will not be used.".format( + self._backend.__class__.__name__, self.timeout + ) + ) + + except FallbackToBackend as e: + # Recursively initialize the backend in case of requested fallback. + self._backend = e.backend + n_jobs = self._initialize_backend() + + return n_jobs + + def _effective_n_jobs(self): + if self._backend: + return self._backend.effective_n_jobs(self.n_jobs) + return 1 + + def _terminate_and_reset(self): + if hasattr(self._backend, "stop_call") and self._calling: + self._backend.stop_call() + self._calling = False + if not self._managed_backend: + self._backend.terminate() + + def _dispatch(self, batch): + """Queue the batch for computing, with or without multiprocessing + + WARNING: this method is not thread-safe: it should be only called + indirectly via dispatch_one_batch. + + """ + # If job.get() catches an exception, it closes the queue: + if self._aborting: + return + + batch_size = len(batch) + + self.n_dispatched_tasks += batch_size + self.n_dispatched_batches += 1 + + dispatch_timestamp = time.time() + + batch_tracker = BatchCompletionCallBack(dispatch_timestamp, batch_size, self) + + self._register_new_job(batch_tracker) + + # If return_ordered is False, the batch_tracker is not stored in the + # jobs queue at the time of submission. Instead, it will be appended to + # the queue by itself as soon as the callback is triggered to be able + # to return the results in the order of completion. + + job = self._backend.submit(batch, callback=batch_tracker) + batch_tracker.register_job(job) + + def _register_new_job(self, batch_tracker): + if self.return_ordered: + self._jobs.append(batch_tracker) + else: + self._jobs_set.add(batch_tracker) + + def dispatch_next(self): + """Dispatch more data for parallel processing + + This method is meant to be called concurrently by the multiprocessing + callback. We rely on the thread-safety of dispatch_one_batch to protect + against concurrent consumption of the unprotected iterator. + """ + if not self.dispatch_one_batch(self._original_iterator): + self._iterating = False + self._original_iterator = None + + def dispatch_one_batch(self, iterator): + """Prefetch the tasks for the next batch and dispatch them. + + The effective size of the batch is computed here. + If there are no more jobs to dispatch, return False, else return True. + + The iterator consumption and dispatching is protected by the same + lock so calling this function should be thread safe. + + """ + + if self._aborting: + return False + + batch_size = self._get_batch_size() + + with self._lock: + # to ensure an even distribution of the workload between workers, + # we look ahead in the original iterators more than batch_size + # tasks - However, we keep consuming only one batch at each + # dispatch_one_batch call. The extra tasks are stored in a local + # queue, _ready_batches, that is looked-up prior to re-consuming + # tasks from the origal iterator. + try: + tasks = self._ready_batches.get(block=False) + except queue.Empty: + # slice the iterator n_jobs * batchsize items at a time. If the + # slice returns less than that, then the current batchsize puts + # too much weight on a subset of workers, while other may end + # up starving. So in this case, re-scale the batch size + # accordingly to distribute evenly the last items between all + # workers. + n_jobs = self._cached_effective_n_jobs + big_batch_size = batch_size * n_jobs + + try: + islice = list(itertools.islice(iterator, big_batch_size)) + except Exception as e: + # Handle the fact that the generator of task raised an + # exception. As this part of the code can be executed in + # a thread internal to the backend, register a task with + # an error that will be raised in the user's thread. + if isinstance(e.__context__, queue.Empty): + # Suppress the cause of the exception if it is + # queue.Empty to avoid cluttered traceback. Only do it + # if the __context__ is really empty to avoid messing + # with causes of the original error. + e.__cause__ = None + batch_tracker = BatchCompletionCallBack(0, batch_size, self) + self._register_new_job(batch_tracker) + batch_tracker._register_outcome(dict(result=e, status=TASK_ERROR)) + return True + + if len(islice) == 0: + return False + elif ( + iterator is self._original_iterator and len(islice) < big_batch_size + ): + # We reached the end of the original iterator (unless + # iterator is the ``pre_dispatch``-long initial slice of + # the original iterator) -- decrease the batch size to + # account for potential variance in the batches running + # time. + final_batch_size = max(1, len(islice) // (10 * n_jobs)) + else: + final_batch_size = max(1, len(islice) // n_jobs) + + # enqueue n_jobs batches in a local queue + for i in range(0, len(islice), final_batch_size): + tasks = BatchedCalls( + islice[i : i + final_batch_size], + self._backend.get_nested_backend(), + self._reducer_callback, + self._pickle_cache, + ) + self._ready_batches.put(tasks) + + # finally, get one task. + tasks = self._ready_batches.get(block=False) + if len(tasks) == 0: + # No more tasks available in the iterator: tell caller to stop. + return False + else: + self._dispatch(tasks) + return True + + def _get_batch_size(self): + """Returns the effective batch size for dispatch""" + if self.batch_size == "auto": + return self._backend.compute_batch_size() + else: + # Fixed batch size strategy + return self.batch_size + + def _print(self, msg): + """Display the message on stout or stderr depending on verbosity""" + # XXX: Not using the logger framework: need to + # learn to use logger better. + if not self.verbose: + return + if self.verbose < 50: + writer = sys.stderr.write + else: + writer = sys.stdout.write + writer(f"[{self}]: {msg}\n") + + def _is_completed(self): + """Check if all tasks have been completed""" + return self.n_completed_tasks == self.n_dispatched_tasks and not ( + self._iterating or self._aborting + ) + + def print_progress(self): + """Display the process of the parallel execution only a fraction + of time, controlled by self.verbose. + """ + + if not self.verbose: + return + + if self.n_tasks is not None and self.n_tasks > 0: + width = floor(log10(self.n_tasks)) + 1 + else: + width = 3 + elapsed_time = time.time() - self._start_time + + if self._is_completed(): + # Make sure that we get a last message telling us we are done + self._print( + f"Done {self.n_completed_tasks:{width}d} out of " + f"{self.n_completed_tasks:{width}d} | elapsed: " + f"{short_format_time(elapsed_time)} finished" + ) + return + + # Original job iterator becomes None once it has been fully + # consumed: at this point we know the total number of jobs and we are + # able to display an estimation of the remaining time based on already + # completed jobs. Otherwise, we simply display the number of completed + # tasks. + elif self._original_iterator is not None: + if _verbosity_filter(self.n_dispatched_batches, self.verbose): + return + fmt_time = f"| elapsed: {short_format_time(elapsed_time)}" + index = self.n_completed_tasks + if self.n_tasks is not None: + self._print( + f"Done {index:{width}d} out of {self.n_tasks:{width}d} {fmt_time}" + ) + else: + pad = " " * (len("out of ") + width - len("tasks")) + self._print(f"Done {index:{width}d} tasks {pad}{fmt_time}") + else: + index = self.n_completed_tasks + # We are finished dispatching + total_tasks = self.n_dispatched_tasks + # We always display the first loop + if index != 0: + # Display depending on the number of remaining items + # A message as soon as we finish dispatching, cursor is 0 + cursor = total_tasks - index + 1 - self._pre_dispatch_amount + frequency = (total_tasks // self.verbose) + 1 + is_last_item = index + 1 == total_tasks + if is_last_item or cursor % frequency: + return + remaining_time = (elapsed_time / max(index, 1)) * ( + self.n_dispatched_tasks - index + ) + # only display status if remaining time is greater or equal to 0 + self._print( + f"Done {index:{width}d} out of {total_tasks:{width}d} " + f"| elapsed: {short_format_time(elapsed_time)} remaining: " + f"{short_format_time(remaining_time)}" + ) + + def _abort(self): + # Stop dispatching new jobs in the async callback thread + self._aborting = True + + # If the backend allows it, cancel or kill remaining running + # tasks without waiting for the results as we will raise + # the exception we got back to the caller instead of returning + # any result. + backend = self._backend + if not self._aborted and hasattr(backend, "abort_everything"): + # If the backend is managed externally we need to make sure + # to leave it in a working state to allow for future jobs + # scheduling. + ensure_ready = self._managed_backend + backend.abort_everything(ensure_ready=ensure_ready) + self._aborted = True + + def _start(self, iterator, pre_dispatch): + # Only set self._iterating to True if at least a batch + # was dispatched. In particular this covers the edge + # case of Parallel used with an exhausted iterator. If + # self._original_iterator is None, then this means either + # that pre_dispatch == "all", n_jobs == 1 or that the first batch + # was very quick and its callback already dispatched all the + # remaining jobs. + self._iterating = False + if self.dispatch_one_batch(iterator): + self._iterating = self._original_iterator is not None + + while self.dispatch_one_batch(iterator): + pass + + if pre_dispatch == "all": + # The iterable was consumed all at once by the above for loop. + # No need to wait for async callbacks to trigger to + # consumption. + self._iterating = False + + def _get_outputs(self, iterator, pre_dispatch): + """Iterator returning the tasks' output as soon as they are ready.""" + dispatch_thread_id = threading.get_ident() + detach_generator_exit = False + try: + self._start(iterator, pre_dispatch) + # first yield returns None, for internal use only. This ensures + # that we enter the try/except block and start dispatching the + # tasks. + yield + + with self._backend.retrieval_context(): + yield from self._retrieve() + + except GeneratorExit: + # The generator has been garbage collected before being fully + # consumed. This aborts the remaining tasks if possible and warn + # the user if necessary. + self._exception = True + + # In some interpreters such as PyPy, GeneratorExit can be raised in + # a different thread than the one used to start the dispatch of the + # parallel tasks. This can lead to hang when a thread attempts to + # join itself. As workaround, we detach the execution of the + # aborting code to a dedicated thread. We then need to make sure + # the rest of the function does not call `_terminate_and_reset` + # in finally. + if dispatch_thread_id != threading.get_ident(): + warnings.warn( + "A generator produced by joblib.Parallel has been " + "gc'ed in an unexpected thread. This behavior should " + "not cause major -issues but to make sure, please " + "report this warning and your use case at " + "https://github.com/joblib/joblib/issues so it can " + "be investigated." + ) + + detach_generator_exit = True + _parallel = self + + class _GeneratorExitThread(threading.Thread): + def run(self): + _parallel._abort() + if _parallel.return_generator: + _parallel._warn_exit_early() + _parallel._terminate_and_reset() + + _GeneratorExitThread(name="GeneratorExitThread").start() + return + + # Otherwise, we are in the thread that started the dispatch: we can + # safely abort the execution and warn the user. + self._abort() + if self.return_generator: + self._warn_exit_early() + + raise + + # Note: we catch any BaseException instead of just Exception instances + # to also include KeyboardInterrupt + except BaseException: + self._exception = True + self._abort() + raise + finally: + # Store the unconsumed tasks and terminate the workers if necessary + _remaining_outputs = [] if self._exception else self._jobs + self._jobs = collections.deque() + self._jobs_set = set() + self._running = False + if not detach_generator_exit: + self._terminate_and_reset() + + while len(_remaining_outputs) > 0: + batched_results = _remaining_outputs.popleft() + batched_results = batched_results.get_result(self.timeout) + for result in batched_results: + yield result + + def _wait_retrieval(self): + """Return True if we need to continue retrieving some tasks.""" + + # If the input load is still being iterated over, it means that tasks + # are still on the dispatch waitlist and their results will need to + # be retrieved later on. + if self._iterating: + return True + + # If some of the dispatched tasks are still being processed by the + # workers, wait for the compute to finish before starting retrieval + if self.n_completed_tasks < self.n_dispatched_tasks: + return True + + # For backends that does not support retrieving asynchronously the + # result to the main process, all results must be carefully retrieved + # in the _retrieve loop in the main thread while the backend is alive. + # For other backends, the actual retrieval is done asynchronously in + # the callback thread, and we can terminate the backend before the + # `self._jobs` result list has been emptied. The remaining results + # will be collected in the `finally` step of the generator. + if not self._backend.supports_retrieve_callback: + if len(self._jobs) > 0: + return True + + return False + + def _retrieve(self): + timeout_control_job = None + while self._wait_retrieval(): + # If the callback thread of a worker has signaled that its task + # triggered an exception, or if the retrieval loop has raised an + # exception (e.g. `GeneratorExit`), exit the loop and surface the + # worker traceback. + if self._aborting: + self._raise_error_fast() + break + + nb_jobs = len(self._jobs) + # Now wait for a job to be ready for retrieval. + if self.return_ordered: + # Case ordered: wait for completion (or error) of the next job + # that have been dispatched and not retrieved yet. If no job + # have been dispatched yet, wait for dispatch. + # We assume that the time to wait for the next job to be + # dispatched is always low, so that the timeout + # control only have to be done on the amount of time the next + # dispatched job is pending. + if (nb_jobs == 0) or ( + self._jobs[0].get_status(timeout=self.timeout) == TASK_PENDING + ): + time.sleep(0.01) + continue + + elif nb_jobs == 0: + # Case unordered: jobs are added to the list of jobs to + # retrieve `self._jobs` only once completed or in error, which + # is too late to enable timeout control in the same way than in + # the previous case. + # Instead, if no job is ready to be retrieved yet, we + # arbitrarily pick a dispatched job, and the timeout control is + # done such that an error is raised if this control job + # timeouts before any other dispatched job has completed and + # been added to `self._jobs` to be retrieved. + if timeout_control_job is None: + timeout_control_job = next(iter(self._jobs_set), None) + + # NB: it can be None if no job has been dispatched yet. + if timeout_control_job is not None: + timeout_control_job.get_status(timeout=self.timeout) + + time.sleep(0.01) + continue + + elif timeout_control_job is not None: + # Case unordered, when `nb_jobs > 0`: + # It means that a job is ready to be retrieved, so no timeout + # will occur during this iteration. + # Before proceeding to retrieval of the next ready job, reset + # the timeout control state to prepare the next iteration. + timeout_control_job._completion_timeout_counter = None + timeout_control_job = None + + # We need to be careful: the job list can be filling up as + # we empty it and Python list are not thread-safe by + # default hence the use of the lock + with self._lock: + batched_results = self._jobs.popleft() + if not self.return_ordered: + self._jobs_set.remove(batched_results) + + # Flatten the batched results to output one output at a time + batched_results = batched_results.get_result(self.timeout) + for result in batched_results: + self._nb_consumed += 1 + yield result + + def _raise_error_fast(self): + """If we are aborting, raise if a job caused an error.""" + + # Find the first job whose status is TASK_ERROR if it exists. + with self._lock: + error_job = next( + (job for job in self._jobs if job.status == TASK_ERROR), None + ) + + # If this error job exists, immediately raise the error by + # calling get_result. This job might not exists if abort has been + # called directly or if the generator is gc'ed. + if error_job is not None: + error_job.get_result(self.timeout) + + def _warn_exit_early(self): + """Warn the user if the generator is gc'ed before being consumned.""" + ready_outputs = self.n_completed_tasks - self._nb_consumed + is_completed = self._is_completed() + msg = "" + if ready_outputs: + msg += ( + f"{ready_outputs} tasks have been successfully executed but not used." + ) + if not is_completed: + msg += " Additionally, " + + if not is_completed: + msg += ( + f"{self.n_dispatched_tasks - self.n_completed_tasks} tasks " + "which were still being processed by the workers have been " + "cancelled." + ) + + if msg: + msg += ( + " You could benefit from adjusting the input task " + "iterator to limit unnecessary computation time." + ) + + warnings.warn(msg) + + def _get_sequential_output(self, iterable): + """Separate loop for sequential output. + + This simplifies the traceback in case of errors and reduces the + overhead of calling sequential tasks with `joblib`. + """ + try: + self._iterating = True + self._original_iterator = iterable + batch_size = self._get_batch_size() + + if batch_size != 1: + it = iter(iterable) + iterable_batched = iter( + lambda: tuple(itertools.islice(it, batch_size)), () + ) + iterable = (task for batch in iterable_batched for task in batch) + + # first yield returns None, for internal use only. This ensures + # that we enter the try/except block and setup the generator. + yield None + + # Sequentially call the tasks and yield the results. + for func, args, kwargs in iterable: + self.n_dispatched_batches += 1 + self.n_dispatched_tasks += 1 + res = func(*args, **kwargs) + self.n_completed_tasks += 1 + self.print_progress() + yield res + self._nb_consumed += 1 + except BaseException: + self._exception = True + self._aborting = True + self._aborted = True + raise + finally: + self._running = False + self._iterating = False + self._original_iterator = None + self.print_progress() + + def _reset_run_tracking(self): + """Reset the counters and flags used to track the execution.""" + + # Makes sur the parallel instance was not previously running in a + # thread-safe way. + with getattr(self, "_lock", nullcontext()): + if self._running: + msg = "This Parallel instance is already running !" + if self.return_generator is True: + msg += ( + " Before submitting new tasks, you must wait for the " + "completion of all the previous tasks, or clean all " + "references to the output generator." + ) + raise RuntimeError(msg) + self._running = True + + # Counter to keep track of the task dispatched and completed. + self.n_dispatched_batches = 0 + self.n_dispatched_tasks = 0 + self.n_completed_tasks = 0 + + # Following count is incremented by one each time the user iterates + # on the output generator, it is used to prepare an informative + # warning message in case the generator is deleted before all the + # dispatched tasks have been consumed. + self._nb_consumed = 0 + + # Following flags are used to synchronize the threads in case one of + # the tasks error-out to ensure that all workers abort fast and that + # the backend terminates properly. + + # Set to True as soon as a worker signals that a task errors-out + self._exception = False + # Set to True in case of early termination following an incident + self._aborting = False + # Set to True after abortion is complete + self._aborted = False + + def __call__(self, iterable): + """Main function to dispatch parallel tasks.""" + + self._reset_run_tracking() + self.n_tasks = len(iterable) if hasattr(iterable, "__len__") else None + self._start_time = time.time() + + if not self._managed_backend: + n_jobs = self._initialize_backend() + else: + n_jobs = self._effective_n_jobs() + + if n_jobs == 1: + # If n_jobs==1, run the computation sequentially and return + # immediately to avoid overheads. + output = self._get_sequential_output(iterable) + next(output) + return output if self.return_generator else list(output) + + # Let's create an ID that uniquely identifies the current call. If the + # call is interrupted early and that the same instance is immediately + # reused, this id will be used to prevent workers that were + # concurrently finalizing a task from the previous call to run the + # callback. + with self._lock: + self._call_id = uuid4().hex + + # self._effective_n_jobs should be called in the Parallel.__call__ + # thread only -- store its value in an attribute for further queries. + self._cached_effective_n_jobs = n_jobs + + if isinstance(self._backend, LokyBackend): + # For the loky backend, we add a callback executed when reducing + # BatchCalls, that makes the loky executor use a temporary folder + # specific to this Parallel object when pickling temporary memmaps. + # This callback is necessary to ensure that several Parallel + # objects using the same reusable executor don't use the same + # temporary resources. + + def _batched_calls_reducer_callback(): + # Relevant implementation detail: the following lines, called + # when reducing BatchedCalls, are called in a thread-safe + # situation, meaning that the context of the temporary folder + # manager will not be changed in between the callback execution + # and the end of the BatchedCalls pickling. The reason is that + # pickling (the only place where set_current_context is used) + # is done from a single thread (the queue_feeder_thread). + self._backend._workers._temp_folder_manager.set_current_context( # noqa + self._id + ) + + self._reducer_callback = _batched_calls_reducer_callback + + # self._effective_n_jobs should be called in the Parallel.__call__ + # thread only -- store its value in an attribute for further queries. + self._cached_effective_n_jobs = n_jobs + + backend_name = self._backend.__class__.__name__ + if n_jobs == 0: + raise RuntimeError("%s has no active worker." % backend_name) + + self._print(f"Using backend {backend_name} with {n_jobs} concurrent workers.") + if hasattr(self._backend, "start_call"): + self._backend.start_call() + + # Following flag prevents double calls to `backend.stop_call`. + self._calling = True + + iterator = iter(iterable) + pre_dispatch = self.pre_dispatch + + if pre_dispatch == "all": + # prevent further dispatch via multiprocessing callback thread + self._original_iterator = None + self._pre_dispatch_amount = 0 + else: + self._original_iterator = iterator + if hasattr(pre_dispatch, "endswith"): + pre_dispatch = eval_expr(pre_dispatch.replace("n_jobs", str(n_jobs))) + self._pre_dispatch_amount = pre_dispatch = int(pre_dispatch) + + # The main thread will consume the first pre_dispatch items and + # the remaining items will later be lazily dispatched by async + # callbacks upon task completions. + + # TODO: this iterator should be batch_size * n_jobs + iterator = itertools.islice(iterator, self._pre_dispatch_amount) + + # Use a caching dict for callables that are pickled with cloudpickle to + # improve performances. This cache is used only in the case of + # functions that are defined in the __main__ module, functions that + # are defined locally (inside another function) and lambda expressions. + self._pickle_cache = dict() + + output = self._get_outputs(iterator, pre_dispatch) + self._call_ref = weakref.ref(output) + + # The first item from the output is blank, but it makes the interpreter + # progress until it enters the Try/Except block of the generator and + # reaches the first `yield` statement. This starts the asynchronous + # dispatch of the tasks to the workers. + next(output) + + return output if self.return_generator else list(output) + + def __repr__(self): + return "%s(n_jobs=%s)" % (self.__class__.__name__, self.n_jobs) diff --git a/shared/package-files/4a/4a436da47d917ed2fa2eac24541ad47e7b0f6ef4257b094b37ec599664eb90d8/libgmpxx.so b/shared/package-files/4a/4a436da47d917ed2fa2eac24541ad47e7b0f6ef4257b094b37ec599664eb90d8/libgmpxx.so new file mode 100644 index 0000000000000000000000000000000000000000..a819d12f9119245f2a8d89e73ea210a15be63a18 Binary files /dev/null and b/shared/package-files/4a/4a436da47d917ed2fa2eac24541ad47e7b0f6ef4257b094b37ec599664eb90d8/libgmpxx.so differ diff --git a/shared/package-files/4a/4a436da47d917ed2fa2eac24541ad47e7b0f6ef4257b094b37ec599664eb90d8/libgmpxx.so.4 b/shared/package-files/4a/4a436da47d917ed2fa2eac24541ad47e7b0f6ef4257b094b37ec599664eb90d8/libgmpxx.so.4 new file mode 100644 index 0000000000000000000000000000000000000000..a819d12f9119245f2a8d89e73ea210a15be63a18 Binary files /dev/null and b/shared/package-files/4a/4a436da47d917ed2fa2eac24541ad47e7b0f6ef4257b094b37ec599664eb90d8/libgmpxx.so.4 differ diff --git a/shared/package-files/4a/4a436da47d917ed2fa2eac24541ad47e7b0f6ef4257b094b37ec599664eb90d8/libgmpxx.so.4.6.1 b/shared/package-files/4a/4a436da47d917ed2fa2eac24541ad47e7b0f6ef4257b094b37ec599664eb90d8/libgmpxx.so.4.6.1 new file mode 100644 index 0000000000000000000000000000000000000000..a819d12f9119245f2a8d89e73ea210a15be63a18 Binary files /dev/null and b/shared/package-files/4a/4a436da47d917ed2fa2eac24541ad47e7b0f6ef4257b094b37ec599664eb90d8/libgmpxx.so.4.6.1 differ diff --git a/shared/package-files/4a/4a43c72b61dd6d8374d935501143a05b7893762118ec7044e038a3a5d900ce69/ed448.pyi b/shared/package-files/4a/4a43c72b61dd6d8374d935501143a05b7893762118ec7044e038a3a5d900ce69/ed448.pyi new file mode 100644 index 0000000000000000000000000000000000000000..7a06520380a08886f281a5115ca07bb34004eca1 --- /dev/null +++ b/shared/package-files/4a/4a43c72b61dd6d8374d935501143a05b7893762118ec7044e038a3a5d900ce69/ed448.pyi @@ -0,0 +1,12 @@ +# This file is dual licensed under the terms of the Apache License, Version +# 2.0, and the BSD License. See the LICENSE file in the root of this repository +# for complete details. + +from cryptography.hazmat.primitives.asymmetric import ed448 + +class Ed448PrivateKey: ... +class Ed448PublicKey: ... + +def generate_key() -> ed448.Ed448PrivateKey: ... +def from_private_bytes(data: bytes) -> ed448.Ed448PrivateKey: ... +def from_public_bytes(data: bytes) -> ed448.Ed448PublicKey: ... diff --git a/shared/package-files/4a/4a46d8962cbdb1e3f59e407855da55898e770ea2e1124cc84a54e5450aea4047/choicetree.py b/shared/package-files/4a/4a46d8962cbdb1e3f59e407855da55898e770ea2e1124cc84a54e5450aea4047/choicetree.py new file mode 100644 index 0000000000000000000000000000000000000000..c5de31ab3a95f326851807b9a5d67e4856b0ad5c --- /dev/null +++ b/shared/package-files/4a/4a46d8962cbdb1e3f59e407855da55898e770ea2e1124cc84a54e5450aea4047/choicetree.py @@ -0,0 +1,160 @@ +# This file is part of Hypothesis, which may be found at +# https://github.com/HypothesisWorks/hypothesis/ +# +# Copyright the Hypothesis Authors. +# Individual contributors are listed in AUTHORS.rst and the git log. +# +# This Source Code Form is subject to the terms of the Mozilla Public License, +# v. 2.0. If a copy of the MPL was not distributed with this file, You can +# obtain one at https://mozilla.org/MPL/2.0/. + +from collections import defaultdict +from random import Random +from typing import Callable, Dict, Iterable, List, Optional, Sequence + +from hypothesis.internal.conjecture.junkdrawer import LazySequenceCopy, pop_random + + +def prefix_selection_order( + prefix: Sequence[int], +) -> Callable[[int, int], Iterable[int]]: + """Select choices starting from ``prefix```, + preferring to move left then wrapping around + to the right.""" + + def selection_order(depth: int, n: int) -> Iterable[int]: + if depth < len(prefix): + i = prefix[depth] + if i >= n: + i = n - 1 + yield from range(i, -1, -1) + yield from range(n - 1, i, -1) + else: + yield from range(n - 1, -1, -1) + + return selection_order + + +def random_selection_order(random: Random) -> Callable[[int, int], Iterable[int]]: + """Select choices uniformly at random.""" + + def selection_order(depth: int, n: int) -> Iterable[int]: + pending = LazySequenceCopy(range(n)) + while pending: + yield pop_random(random, pending) + + return selection_order + + +class Chooser: + """A source of nondeterminism for use in shrink passes.""" + + def __init__( + self, + tree: "ChoiceTree", + selection_order: Callable[[int, int], Iterable[int]], + ): + self.__selection_order = selection_order + self.__node_trail = [tree.root] + self.__choices: "List[int]" = [] + self.__finished = False + + def choose( + self, + values: Sequence[int], + condition: Callable[[int], bool] = lambda x: True, + ) -> int: + """Return some element of values satisfying the condition + that will not lead to an exhausted branch, or raise DeadBranch + if no such element exist". + """ + assert not self.__finished + node = self.__node_trail[-1] + if node.live_child_count is None: + node.live_child_count = len(values) + node.n = len(values) + + assert node.live_child_count > 0 or len(values) == 0 + + for i in self.__selection_order(len(self.__choices), len(values)): + if node.live_child_count == 0: + break + if not node.children[i].exhausted: + v = values[i] + if condition(v): + self.__choices.append(i) + self.__node_trail.append(node.children[i]) + return v + else: + node.children[i] = DeadNode + node.live_child_count -= 1 + assert node.live_child_count == 0 + raise DeadBranch + + def finish(self) -> Sequence[int]: + """Record the decisions made in the underlying tree and return + a prefix that can be used for the next Chooser to be used.""" + self.__finished = True + assert len(self.__node_trail) == len(self.__choices) + 1 + + result = tuple(self.__choices) + + self.__node_trail[-1].live_child_count = 0 + while len(self.__node_trail) > 1 and self.__node_trail[-1].exhausted: + self.__node_trail.pop() + assert len(self.__node_trail) == len(self.__choices) + i = self.__choices.pop() + target = self.__node_trail[-1] + target.children[i] = DeadNode + assert target.live_child_count is not None + target.live_child_count -= 1 + + return result + + +class ChoiceTree: + """Records sequences of choices made during shrinking so that we + can track what parts of a pass has run. Used to create Chooser + objects that are the main interface that a pass uses to make + decisions about what to do. + """ + + def __init__(self) -> None: + self.root = TreeNode() + + @property + def exhausted(self) -> bool: + return self.root.exhausted + + def step( + self, + selection_order: Callable[[int, int], Iterable[int]], + f: Callable[[Chooser], None], + ) -> Sequence[int]: + assert not self.exhausted + + chooser = Chooser(self, selection_order) + try: + f(chooser) + except DeadBranch: + pass + return chooser.finish() + + +class TreeNode: + def __init__(self) -> None: + self.children: Dict[int, TreeNode] = defaultdict(TreeNode) + self.live_child_count: "Optional[int]" = None + self.n: "Optional[int]" = None + + @property + def exhausted(self) -> bool: + return self.live_child_count == 0 + + +DeadNode = TreeNode() +DeadNode.live_child_count = 0 + + +class DeadBranch(Exception): + pass diff --git a/shared/package-files/4a/4a483ae1c4dc738a6c8b73feb49074e1835da02ab5aa686f2675029906fa364d/LICENSE b/shared/package-files/4a/4a483ae1c4dc738a6c8b73feb49074e1835da02ab5aa686f2675029906fa364d/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..754db5afcb8260c5539b1e0ede3990b8ddbc3e29 --- /dev/null +++ b/shared/package-files/4a/4a483ae1c4dc738a6c8b73feb49074e1835da02ab5aa686f2675029906fa364d/LICENSE @@ -0,0 +1,20 @@ +ISC LICENSE + + This license is approved by the OSI and FSF as GPL-compatible. + http://opensource.org/licenses/isc-license.txt + + Copyright (c) 2013-2014, Pexpect development team + Copyright (c) 2012, Noah Spurrier + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/shared/package-files/4a/4a4844615c82fc75070ba297ee7e0cffa728c9132d101dfc40cc8e608017e989/__init__.py b/shared/package-files/4a/4a4844615c82fc75070ba297ee7e0cffa728c9132d101dfc40cc8e608017e989/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5ebf5957b46598f5d6a922edcf1c0bc162af4bab --- /dev/null +++ b/shared/package-files/4a/4a4844615c82fc75070ba297ee7e0cffa728c9132d101dfc40cc8e608017e989/__init__.py @@ -0,0 +1,566 @@ +""" +Utilities for determining application-specific dirs. See for details and +usage. +""" +from __future__ import annotations + +import os +import sys +from typing import TYPE_CHECKING + +from .api import PlatformDirsABC +from .version import __version__ +from .version import __version_tuple__ as __version_info__ + +if TYPE_CHECKING: + from pathlib import Path + + if sys.version_info >= (3, 8): # pragma: no cover (py38+) + from typing import Literal + else: # pragma: no cover (py38+) + from pip._vendor.typing_extensions import Literal + + +def _set_platform_dir_class() -> type[PlatformDirsABC]: + if sys.platform == "win32": + from pip._vendor.platformdirs.windows import Windows as Result + elif sys.platform == "darwin": + from pip._vendor.platformdirs.macos import MacOS as Result + else: + from pip._vendor.platformdirs.unix import Unix as Result + + if os.getenv("ANDROID_DATA") == "/data" and os.getenv("ANDROID_ROOT") == "/system": + if os.getenv("SHELL") or os.getenv("PREFIX"): + return Result + + from pip._vendor.platformdirs.android import _android_folder + + if _android_folder() is not None: + from pip._vendor.platformdirs.android import Android + + return Android # return to avoid redefinition of result + + return Result + + +PlatformDirs = _set_platform_dir_class() #: Currently active platform +AppDirs = PlatformDirs #: Backwards compatibility with appdirs + + +def user_data_dir( + appname: str | None = None, + appauthor: str | None | Literal[False] = None, + version: str | None = None, + roaming: bool = False, # noqa: FBT001, FBT002 + ensure_exists: bool = False, # noqa: FBT001, FBT002 +) -> str: + """ + :param appname: See `appname `. + :param appauthor: See `appauthor `. + :param version: See `version `. + :param roaming: See `roaming `. + :param ensure_exists: See `ensure_exists `. + :returns: data directory tied to the user + """ + return PlatformDirs( + appname=appname, + appauthor=appauthor, + version=version, + roaming=roaming, + ensure_exists=ensure_exists, + ).user_data_dir + + +def site_data_dir( + appname: str | None = None, + appauthor: str | None | Literal[False] = None, + version: str | None = None, + multipath: bool = False, # noqa: FBT001, FBT002 + ensure_exists: bool = False, # noqa: FBT001, FBT002 +) -> str: + """ + :param appname: See `appname `. + :param appauthor: See `appauthor `. + :param version: See `version `. + :param multipath: See `roaming `. + :param ensure_exists: See `ensure_exists `. + :returns: data directory shared by users + """ + return PlatformDirs( + appname=appname, + appauthor=appauthor, + version=version, + multipath=multipath, + ensure_exists=ensure_exists, + ).site_data_dir + + +def user_config_dir( + appname: str | None = None, + appauthor: str | None | Literal[False] = None, + version: str | None = None, + roaming: bool = False, # noqa: FBT001, FBT002 + ensure_exists: bool = False, # noqa: FBT001, FBT002 +) -> str: + """ + :param appname: See `appname `. + :param appauthor: See `appauthor `. + :param version: See `version `. + :param roaming: See `roaming `. + :param ensure_exists: See `ensure_exists `. + :returns: config directory tied to the user + """ + return PlatformDirs( + appname=appname, + appauthor=appauthor, + version=version, + roaming=roaming, + ensure_exists=ensure_exists, + ).user_config_dir + + +def site_config_dir( + appname: str | None = None, + appauthor: str | None | Literal[False] = None, + version: str | None = None, + multipath: bool = False, # noqa: FBT001, FBT002 + ensure_exists: bool = False, # noqa: FBT001, FBT002 +) -> str: + """ + :param appname: See `appname `. + :param appauthor: See `appauthor `. + :param version: See `version `. + :param multipath: See `roaming `. + :param ensure_exists: See `ensure_exists `. + :returns: config directory shared by the users + """ + return PlatformDirs( + appname=appname, + appauthor=appauthor, + version=version, + multipath=multipath, + ensure_exists=ensure_exists, + ).site_config_dir + + +def user_cache_dir( + appname: str | None = None, + appauthor: str | None | Literal[False] = None, + version: str | None = None, + opinion: bool = True, # noqa: FBT001, FBT002 + ensure_exists: bool = False, # noqa: FBT001, FBT002 +) -> str: + """ + :param appname: See `appname `. + :param appauthor: See `appauthor `. + :param version: See `version `. + :param opinion: See `roaming `. + :param ensure_exists: See `ensure_exists `. + :returns: cache directory tied to the user + """ + return PlatformDirs( + appname=appname, + appauthor=appauthor, + version=version, + opinion=opinion, + ensure_exists=ensure_exists, + ).user_cache_dir + + +def site_cache_dir( + appname: str | None = None, + appauthor: str | None | Literal[False] = None, + version: str | None = None, + opinion: bool = True, # noqa: FBT001, FBT002 + ensure_exists: bool = False, # noqa: FBT001, FBT002 +) -> str: + """ + :param appname: See `appname `. + :param appauthor: See `appauthor `. + :param version: See `version `. + :param opinion: See `opinion `. + :param ensure_exists: See `ensure_exists `. + :returns: cache directory tied to the user + """ + return PlatformDirs( + appname=appname, + appauthor=appauthor, + version=version, + opinion=opinion, + ensure_exists=ensure_exists, + ).site_cache_dir + + +def user_state_dir( + appname: str | None = None, + appauthor: str | None | Literal[False] = None, + version: str | None = None, + roaming: bool = False, # noqa: FBT001, FBT002 + ensure_exists: bool = False, # noqa: FBT001, FBT002 +) -> str: + """ + :param appname: See `appname `. + :param appauthor: See `appauthor `. + :param version: See `version `. + :param roaming: See `roaming `. + :param ensure_exists: See `ensure_exists `. + :returns: state directory tied to the user + """ + return PlatformDirs( + appname=appname, + appauthor=appauthor, + version=version, + roaming=roaming, + ensure_exists=ensure_exists, + ).user_state_dir + + +def user_log_dir( + appname: str | None = None, + appauthor: str | None | Literal[False] = None, + version: str | None = None, + opinion: bool = True, # noqa: FBT001, FBT002 + ensure_exists: bool = False, # noqa: FBT001, FBT002 +) -> str: + """ + :param appname: See `appname `. + :param appauthor: See `appauthor `. + :param version: See `version `. + :param opinion: See `roaming `. + :param ensure_exists: See `ensure_exists `. + :returns: log directory tied to the user + """ + return PlatformDirs( + appname=appname, + appauthor=appauthor, + version=version, + opinion=opinion, + ensure_exists=ensure_exists, + ).user_log_dir + + +def user_documents_dir() -> str: + """:returns: documents directory tied to the user""" + return PlatformDirs().user_documents_dir + + +def user_downloads_dir() -> str: + """:returns: downloads directory tied to the user""" + return PlatformDirs().user_downloads_dir + + +def user_pictures_dir() -> str: + """:returns: pictures directory tied to the user""" + return PlatformDirs().user_pictures_dir + + +def user_videos_dir() -> str: + """:returns: videos directory tied to the user""" + return PlatformDirs().user_videos_dir + + +def user_music_dir() -> str: + """:returns: music directory tied to the user""" + return PlatformDirs().user_music_dir + + +def user_runtime_dir( + appname: str | None = None, + appauthor: str | None | Literal[False] = None, + version: str | None = None, + opinion: bool = True, # noqa: FBT001, FBT002 + ensure_exists: bool = False, # noqa: FBT001, FBT002 +) -> str: + """ + :param appname: See `appname `. + :param appauthor: See `appauthor `. + :param version: See `version `. + :param opinion: See `opinion `. + :param ensure_exists: See `ensure_exists `. + :returns: runtime directory tied to the user + """ + return PlatformDirs( + appname=appname, + appauthor=appauthor, + version=version, + opinion=opinion, + ensure_exists=ensure_exists, + ).user_runtime_dir + + +def user_data_path( + appname: str | None = None, + appauthor: str | None | Literal[False] = None, + version: str | None = None, + roaming: bool = False, # noqa: FBT001, FBT002 + ensure_exists: bool = False, # noqa: FBT001, FBT002 +) -> Path: + """ + :param appname: See `appname `. + :param appauthor: See `appauthor `. + :param version: See `version `. + :param roaming: See `roaming `. + :param ensure_exists: See `ensure_exists `. + :returns: data path tied to the user + """ + return PlatformDirs( + appname=appname, + appauthor=appauthor, + version=version, + roaming=roaming, + ensure_exists=ensure_exists, + ).user_data_path + + +def site_data_path( + appname: str | None = None, + appauthor: str | None | Literal[False] = None, + version: str | None = None, + multipath: bool = False, # noqa: FBT001, FBT002 + ensure_exists: bool = False, # noqa: FBT001, FBT002 +) -> Path: + """ + :param appname: See `appname `. + :param appauthor: See `appauthor `. + :param version: See `version `. + :param multipath: See `multipath `. + :param ensure_exists: See `ensure_exists `. + :returns: data path shared by users + """ + return PlatformDirs( + appname=appname, + appauthor=appauthor, + version=version, + multipath=multipath, + ensure_exists=ensure_exists, + ).site_data_path + + +def user_config_path( + appname: str | None = None, + appauthor: str | None | Literal[False] = None, + version: str | None = None, + roaming: bool = False, # noqa: FBT001, FBT002 + ensure_exists: bool = False, # noqa: FBT001, FBT002 +) -> Path: + """ + :param appname: See `appname `. + :param appauthor: See `appauthor `. + :param version: See `version `. + :param roaming: See `roaming `. + :param ensure_exists: See `ensure_exists `. + :returns: config path tied to the user + """ + return PlatformDirs( + appname=appname, + appauthor=appauthor, + version=version, + roaming=roaming, + ensure_exists=ensure_exists, + ).user_config_path + + +def site_config_path( + appname: str | None = None, + appauthor: str | None | Literal[False] = None, + version: str | None = None, + multipath: bool = False, # noqa: FBT001, FBT002 + ensure_exists: bool = False, # noqa: FBT001, FBT002 +) -> Path: + """ + :param appname: See `appname `. + :param appauthor: See `appauthor `. + :param version: See `version `. + :param multipath: See `roaming `. + :param ensure_exists: See `ensure_exists `. + :returns: config path shared by the users + """ + return PlatformDirs( + appname=appname, + appauthor=appauthor, + version=version, + multipath=multipath, + ensure_exists=ensure_exists, + ).site_config_path + + +def site_cache_path( + appname: str | None = None, + appauthor: str | None | Literal[False] = None, + version: str | None = None, + opinion: bool = True, # noqa: FBT001, FBT002 + ensure_exists: bool = False, # noqa: FBT001, FBT002 +) -> Path: + """ + :param appname: See `appname `. + :param appauthor: See `appauthor `. + :param version: See `version `. + :param opinion: See `opinion `. + :param ensure_exists: See `ensure_exists `. + :returns: cache directory tied to the user + """ + return PlatformDirs( + appname=appname, + appauthor=appauthor, + version=version, + opinion=opinion, + ensure_exists=ensure_exists, + ).site_cache_path + + +def user_cache_path( + appname: str | None = None, + appauthor: str | None | Literal[False] = None, + version: str | None = None, + opinion: bool = True, # noqa: FBT001, FBT002 + ensure_exists: bool = False, # noqa: FBT001, FBT002 +) -> Path: + """ + :param appname: See `appname `. + :param appauthor: See `appauthor `. + :param version: See `version `. + :param opinion: See `roaming `. + :param ensure_exists: See `ensure_exists `. + :returns: cache path tied to the user + """ + return PlatformDirs( + appname=appname, + appauthor=appauthor, + version=version, + opinion=opinion, + ensure_exists=ensure_exists, + ).user_cache_path + + +def user_state_path( + appname: str | None = None, + appauthor: str | None | Literal[False] = None, + version: str | None = None, + roaming: bool = False, # noqa: FBT001, FBT002 + ensure_exists: bool = False, # noqa: FBT001, FBT002 +) -> Path: + """ + :param appname: See `appname `. + :param appauthor: See `appauthor `. + :param version: See `version `. + :param roaming: See `roaming `. + :param ensure_exists: See `ensure_exists `. + :returns: state path tied to the user + """ + return PlatformDirs( + appname=appname, + appauthor=appauthor, + version=version, + roaming=roaming, + ensure_exists=ensure_exists, + ).user_state_path + + +def user_log_path( + appname: str | None = None, + appauthor: str | None | Literal[False] = None, + version: str | None = None, + opinion: bool = True, # noqa: FBT001, FBT002 + ensure_exists: bool = False, # noqa: FBT001, FBT002 +) -> Path: + """ + :param appname: See `appname `. + :param appauthor: See `appauthor `. + :param version: See `version `. + :param opinion: See `roaming `. + :param ensure_exists: See `ensure_exists `. + :returns: log path tied to the user + """ + return PlatformDirs( + appname=appname, + appauthor=appauthor, + version=version, + opinion=opinion, + ensure_exists=ensure_exists, + ).user_log_path + + +def user_documents_path() -> Path: + """:returns: documents path tied to the user""" + return PlatformDirs().user_documents_path + + +def user_downloads_path() -> Path: + """:returns: downloads path tied to the user""" + return PlatformDirs().user_downloads_path + + +def user_pictures_path() -> Path: + """:returns: pictures path tied to the user""" + return PlatformDirs().user_pictures_path + + +def user_videos_path() -> Path: + """:returns: videos path tied to the user""" + return PlatformDirs().user_videos_path + + +def user_music_path() -> Path: + """:returns: music path tied to the user""" + return PlatformDirs().user_music_path + + +def user_runtime_path( + appname: str | None = None, + appauthor: str | None | Literal[False] = None, + version: str | None = None, + opinion: bool = True, # noqa: FBT001, FBT002 + ensure_exists: bool = False, # noqa: FBT001, FBT002 +) -> Path: + """ + :param appname: See `appname `. + :param appauthor: See `appauthor `. + :param version: See `version `. + :param opinion: See `opinion `. + :param ensure_exists: See `ensure_exists `. + :returns: runtime path tied to the user + """ + return PlatformDirs( + appname=appname, + appauthor=appauthor, + version=version, + opinion=opinion, + ensure_exists=ensure_exists, + ).user_runtime_path + + +__all__ = [ + "__version__", + "__version_info__", + "PlatformDirs", + "AppDirs", + "PlatformDirsABC", + "user_data_dir", + "user_config_dir", + "user_cache_dir", + "user_state_dir", + "user_log_dir", + "user_documents_dir", + "user_downloads_dir", + "user_pictures_dir", + "user_videos_dir", + "user_music_dir", + "user_runtime_dir", + "site_data_dir", + "site_config_dir", + "site_cache_dir", + "user_data_path", + "user_config_path", + "user_cache_path", + "user_state_path", + "user_log_path", + "user_documents_path", + "user_downloads_path", + "user_pictures_path", + "user_videos_path", + "user_music_path", + "user_runtime_path", + "site_data_path", + "site_config_path", + "site_cache_path", +] diff --git a/shared/package-files/4a/4a4ac672ebdf8b6ec16f751e53f1c7b425381eb3d2652cf5033879a784ea67af/normalforms.py b/shared/package-files/4a/4a4ac672ebdf8b6ec16f751e53f1c7b425381eb3d2652cf5033879a784ea67af/normalforms.py new file mode 100644 index 0000000000000000000000000000000000000000..af1e4d9513fe13e0fb11e66e54ba1e0b2193d63c --- /dev/null +++ b/shared/package-files/4a/4a4ac672ebdf8b6ec16f751e53f1c7b425381eb3d2652cf5033879a784ea67af/normalforms.py @@ -0,0 +1,406 @@ +'''Functions returning normal forms of matrices''' + +from collections import defaultdict + +from .domainmatrix import DomainMatrix +from .exceptions import DMDomainError, DMShapeError +from sympy.ntheory.modular import symmetric_residue +from sympy.polys.domains import QQ, ZZ + + +# TODO (future work): +# There are faster algorithms for Smith and Hermite normal forms, which +# we should implement. See e.g. the Kannan-Bachem algorithm: +# + + +def smith_normal_form(m): + ''' + Return the Smith Normal Form of a matrix `m` over the ring `domain`. + This will only work if the ring is a principal ideal domain. + + Examples + ======== + + >>> from sympy import ZZ + >>> from sympy.polys.matrices import DomainMatrix + >>> from sympy.polys.matrices.normalforms import smith_normal_form + >>> m = DomainMatrix([[ZZ(12), ZZ(6), ZZ(4)], + ... [ZZ(3), ZZ(9), ZZ(6)], + ... [ZZ(2), ZZ(16), ZZ(14)]], (3, 3), ZZ) + >>> print(smith_normal_form(m).to_Matrix()) + Matrix([[1, 0, 0], [0, 10, 0], [0, 0, -30]]) + + ''' + invs = invariant_factors(m) + smf = DomainMatrix.diag(invs, m.domain, m.shape) + return smf + + +def add_columns(m, i, j, a, b, c, d): + # replace m[:, i] by a*m[:, i] + b*m[:, j] + # and m[:, j] by c*m[:, i] + d*m[:, j] + for k in range(len(m)): + e = m[k][i] + m[k][i] = a*e + b*m[k][j] + m[k][j] = c*e + d*m[k][j] + + +def invariant_factors(m): + ''' + Return the tuple of abelian invariants for a matrix `m` + (as in the Smith-Normal form) + + References + ========== + + [1] https://en.wikipedia.org/wiki/Smith_normal_form#Algorithm + [2] https://web.archive.org/web/20200331143852/https://sierra.nmsu.edu/morandi/notes/SmithNormalForm.pdf + + ''' + domain = m.domain + if not domain.is_PID: + msg = "The matrix entries must be over a principal ideal domain" + raise ValueError(msg) + + if 0 in m.shape: + return () + + rows, cols = shape = m.shape + m = list(m.to_dense().rep) + + def add_rows(m, i, j, a, b, c, d): + # replace m[i, :] by a*m[i, :] + b*m[j, :] + # and m[j, :] by c*m[i, :] + d*m[j, :] + for k in range(cols): + e = m[i][k] + m[i][k] = a*e + b*m[j][k] + m[j][k] = c*e + d*m[j][k] + + def clear_column(m): + # make m[1:, 0] zero by row and column operations + if m[0][0] == 0: + return m # pragma: nocover + pivot = m[0][0] + for j in range(1, rows): + if m[j][0] == 0: + continue + d, r = domain.div(m[j][0], pivot) + if r == 0: + add_rows(m, 0, j, 1, 0, -d, 1) + else: + a, b, g = domain.gcdex(pivot, m[j][0]) + d_0 = domain.div(m[j][0], g)[0] + d_j = domain.div(pivot, g)[0] + add_rows(m, 0, j, a, b, d_0, -d_j) + pivot = g + return m + + def clear_row(m): + # make m[0, 1:] zero by row and column operations + if m[0][0] == 0: + return m # pragma: nocover + pivot = m[0][0] + for j in range(1, cols): + if m[0][j] == 0: + continue + d, r = domain.div(m[0][j], pivot) + if r == 0: + add_columns(m, 0, j, 1, 0, -d, 1) + else: + a, b, g = domain.gcdex(pivot, m[0][j]) + d_0 = domain.div(m[0][j], g)[0] + d_j = domain.div(pivot, g)[0] + add_columns(m, 0, j, a, b, d_0, -d_j) + pivot = g + return m + + # permute the rows and columns until m[0,0] is non-zero if possible + ind = [i for i in range(rows) if m[i][0] != 0] + if ind and ind[0] != 0: + m[0], m[ind[0]] = m[ind[0]], m[0] + else: + ind = [j for j in range(cols) if m[0][j] != 0] + if ind and ind[0] != 0: + for row in m: + row[0], row[ind[0]] = row[ind[0]], row[0] + + # make the first row and column except m[0,0] zero + while (any(m[0][i] != 0 for i in range(1,cols)) or + any(m[i][0] != 0 for i in range(1,rows))): + m = clear_column(m) + m = clear_row(m) + + if 1 in shape: + invs = () + else: + lower_right = DomainMatrix([r[1:] for r in m[1:]], (rows-1, cols-1), domain) + invs = invariant_factors(lower_right) + + if m[0][0]: + result = [m[0][0]] + result.extend(invs) + # in case m[0] doesn't divide the invariants of the rest of the matrix + for i in range(len(result)-1): + if result[i] and domain.div(result[i+1], result[i])[1] != 0: + g = domain.gcd(result[i+1], result[i]) + result[i+1] = domain.div(result[i], g)[0]*result[i+1] + result[i] = g + else: + break + else: + result = invs + (m[0][0],) + return tuple(result) + + +def _gcdex(a, b): + r""" + This supports the functions that compute Hermite Normal Form. + + Explanation + =========== + + Let x, y be the coefficients returned by the extended Euclidean + Algorithm, so that x*a + y*b = g. In the algorithms for computing HNF, + it is critical that x, y not only satisfy the condition of being small + in magnitude -- namely that |x| <= |b|/g, |y| <- |a|/g -- but also that + y == 0 when a | b. + + """ + x, y, g = ZZ.gcdex(a, b) + if a != 0 and b % a == 0: + y = 0 + x = -1 if a < 0 else 1 + return x, y, g + + +def _hermite_normal_form(A): + r""" + Compute the Hermite Normal Form of DomainMatrix *A* over :ref:`ZZ`. + + Parameters + ========== + + A : :py:class:`~.DomainMatrix` over domain :ref:`ZZ`. + + Returns + ======= + + :py:class:`~.DomainMatrix` + The HNF of matrix *A*. + + Raises + ====== + + DMDomainError + If the domain of the matrix is not :ref:`ZZ`. + + References + ========== + + .. [1] Cohen, H. *A Course in Computational Algebraic Number Theory.* + (See Algorithm 2.4.5.) + + """ + if not A.domain.is_ZZ: + raise DMDomainError('Matrix must be over domain ZZ.') + # We work one row at a time, starting from the bottom row, and working our + # way up. + m, n = A.shape + A = A.to_dense().rep.copy() + # Our goal is to put pivot entries in the rightmost columns. + # Invariant: Before processing each row, k should be the index of the + # leftmost column in which we have so far put a pivot. + k = n + for i in range(m - 1, -1, -1): + if k == 0: + # This case can arise when n < m and we've already found n pivots. + # We don't need to consider any more rows, because this is already + # the maximum possible number of pivots. + break + k -= 1 + # k now points to the column in which we want to put a pivot. + # We want zeros in all entries to the left of the pivot column. + for j in range(k - 1, -1, -1): + if A[i][j] != 0: + # Replace cols j, k by lin combs of these cols such that, in row i, + # col j has 0, while col k has the gcd of their row i entries. Note + # that this ensures a nonzero entry in col k. + u, v, d = _gcdex(A[i][k], A[i][j]) + r, s = A[i][k] // d, A[i][j] // d + add_columns(A, k, j, u, v, -s, r) + b = A[i][k] + # Do not want the pivot entry to be negative. + if b < 0: + add_columns(A, k, k, -1, 0, -1, 0) + b = -b + # The pivot entry will be 0 iff the row was 0 from the pivot col all the + # way to the left. In this case, we are still working on the same pivot + # col for the next row. Therefore: + if b == 0: + k += 1 + # If the pivot entry is nonzero, then we want to reduce all entries to its + # right in the sense of the division algorithm, i.e. make them all remainders + # w.r.t. the pivot as divisor. + else: + for j in range(k + 1, n): + q = A[i][j] // b + add_columns(A, j, k, 1, -q, 0, 1) + # Finally, the HNF consists of those columns of A in which we succeeded in making + # a nonzero pivot. + return DomainMatrix.from_rep(A)[:, k:] + + +def _hermite_normal_form_modulo_D(A, D): + r""" + Perform the mod *D* Hermite Normal Form reduction algorithm on + :py:class:`~.DomainMatrix` *A*. + + Explanation + =========== + + If *A* is an $m \times n$ matrix of rank $m$, having Hermite Normal Form + $W$, and if *D* is any positive integer known in advance to be a multiple + of $\det(W)$, then the HNF of *A* can be computed by an algorithm that + works mod *D* in order to prevent coefficient explosion. + + Parameters + ========== + + A : :py:class:`~.DomainMatrix` over :ref:`ZZ` + $m \times n$ matrix, having rank $m$. + D : :ref:`ZZ` + Positive integer, known to be a multiple of the determinant of the + HNF of *A*. + + Returns + ======= + + :py:class:`~.DomainMatrix` + The HNF of matrix *A*. + + Raises + ====== + + DMDomainError + If the domain of the matrix is not :ref:`ZZ`, or + if *D* is given but is not in :ref:`ZZ`. + + DMShapeError + If the matrix has more rows than columns. + + References + ========== + + .. [1] Cohen, H. *A Course in Computational Algebraic Number Theory.* + (See Algorithm 2.4.8.) + + """ + if not A.domain.is_ZZ: + raise DMDomainError('Matrix must be over domain ZZ.') + if not ZZ.of_type(D) or D < 1: + raise DMDomainError('Modulus D must be positive element of domain ZZ.') + + def add_columns_mod_R(m, R, i, j, a, b, c, d): + # replace m[:, i] by (a*m[:, i] + b*m[:, j]) % R + # and m[:, j] by (c*m[:, i] + d*m[:, j]) % R + for k in range(len(m)): + e = m[k][i] + m[k][i] = symmetric_residue((a * e + b * m[k][j]) % R, R) + m[k][j] = symmetric_residue((c * e + d * m[k][j]) % R, R) + + W = defaultdict(dict) + + m, n = A.shape + if n < m: + raise DMShapeError('Matrix must have at least as many columns as rows.') + A = A.to_dense().rep.copy() + k = n + R = D + for i in range(m - 1, -1, -1): + k -= 1 + for j in range(k - 1, -1, -1): + if A[i][j] != 0: + u, v, d = _gcdex(A[i][k], A[i][j]) + r, s = A[i][k] // d, A[i][j] // d + add_columns_mod_R(A, R, k, j, u, v, -s, r) + b = A[i][k] + if b == 0: + A[i][k] = b = R + u, v, d = _gcdex(b, R) + for ii in range(m): + W[ii][i] = u*A[ii][k] % R + if W[i][i] == 0: + W[i][i] = R + for j in range(i + 1, m): + q = W[i][j] // W[i][i] + add_columns(W, j, i, 1, -q, 0, 1) + R //= d + return DomainMatrix(W, (m, m), ZZ).to_dense() + + +def hermite_normal_form(A, *, D=None, check_rank=False): + r""" + Compute the Hermite Normal Form of :py:class:`~.DomainMatrix` *A* over + :ref:`ZZ`. + + Examples + ======== + + >>> from sympy import ZZ + >>> from sympy.polys.matrices import DomainMatrix + >>> from sympy.polys.matrices.normalforms import hermite_normal_form + >>> m = DomainMatrix([[ZZ(12), ZZ(6), ZZ(4)], + ... [ZZ(3), ZZ(9), ZZ(6)], + ... [ZZ(2), ZZ(16), ZZ(14)]], (3, 3), ZZ) + >>> print(hermite_normal_form(m).to_Matrix()) + Matrix([[10, 0, 2], [0, 15, 3], [0, 0, 2]]) + + Parameters + ========== + + A : $m \times n$ ``DomainMatrix`` over :ref:`ZZ`. + + D : :ref:`ZZ`, optional + Let $W$ be the HNF of *A*. If known in advance, a positive integer *D* + being any multiple of $\det(W)$ may be provided. In this case, if *A* + also has rank $m$, then we may use an alternative algorithm that works + mod *D* in order to prevent coefficient explosion. + + check_rank : boolean, optional (default=False) + The basic assumption is that, if you pass a value for *D*, then + you already believe that *A* has rank $m$, so we do not waste time + checking it for you. If you do want this to be checked (and the + ordinary, non-modulo *D* algorithm to be used if the check fails), then + set *check_rank* to ``True``. + + Returns + ======= + + :py:class:`~.DomainMatrix` + The HNF of matrix *A*. + + Raises + ====== + + DMDomainError + If the domain of the matrix is not :ref:`ZZ`, or + if *D* is given but is not in :ref:`ZZ`. + + DMShapeError + If the mod *D* algorithm is used but the matrix has more rows than + columns. + + References + ========== + + .. [1] Cohen, H. *A Course in Computational Algebraic Number Theory.* + (See Algorithms 2.4.5 and 2.4.8.) + + """ + if not A.domain.is_ZZ: + raise DMDomainError('Matrix must be over domain ZZ.') + if D is not None and (not check_rank or A.convert_to(QQ).rank() == A.shape[0]): + return _hermite_normal_form_modulo_D(A, D) + else: + return _hermite_normal_form(A) diff --git a/shared/package-files/4a/4a4b351e17525f1e4d355c9eac2db0a1d4c28e46b6155d2194ae069872c00b33/vt520 b/shared/package-files/4a/4a4b351e17525f1e4d355c9eac2db0a1d4c28e46b6155d2194ae069872c00b33/vt520 new file mode 100644 index 0000000000000000000000000000000000000000..7f1874009e527679957d322ce1ea5322be9ee542 Binary files /dev/null and b/shared/package-files/4a/4a4b351e17525f1e4d355c9eac2db0a1d4c28e46b6155d2194ae069872c00b33/vt520 differ diff --git a/shared/package-files/4a/4a4ce3162a47d5af011cce19ebf76779786e7adcca736d3164af6257ba24f72c/linspace_compositeexplicitautograd_dispatch.h b/shared/package-files/4a/4a4ce3162a47d5af011cce19ebf76779786e7adcca736d3164af6257ba24f72c/linspace_compositeexplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..3e195d51c1ac19158937d596b05d1ded566e51a2 --- /dev/null +++ b/shared/package-files/4a/4a4ce3162a47d5af011cce19ebf76779786e7adcca736d3164af6257ba24f72c/linspace_compositeexplicitautograd_dispatch.h @@ -0,0 +1,36 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API at::Tensor linspace(const at::Scalar & start, const at::Scalar & end, int64_t steps, at::TensorOptions options={}); +TORCH_API at::Tensor linspace(const at::Scalar & start, const at::Scalar & end, int64_t steps, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); +TORCH_API at::Tensor linspace(const at::Tensor & start, const at::Tensor & end, int64_t steps, at::TensorOptions options={}); +TORCH_API at::Tensor linspace(const at::Tensor & start, const at::Tensor & end, int64_t steps, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); +TORCH_API at::Tensor & linspace_out(at::Tensor & out, const at::Tensor & start, const at::Tensor & end, int64_t steps); +TORCH_API at::Tensor & linspace_outf(const at::Tensor & start, const at::Tensor & end, int64_t steps, at::Tensor & out); +TORCH_API at::Tensor linspace(const at::Tensor & start, const at::Scalar & end, int64_t steps, at::TensorOptions options={}); +TORCH_API at::Tensor linspace(const at::Tensor & start, const at::Scalar & end, int64_t steps, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); +TORCH_API at::Tensor & linspace_out(at::Tensor & out, const at::Tensor & start, const at::Scalar & end, int64_t steps); +TORCH_API at::Tensor & linspace_outf(const at::Tensor & start, const at::Scalar & end, int64_t steps, at::Tensor & out); +TORCH_API at::Tensor linspace(const at::Scalar & start, const at::Tensor & end, int64_t steps, at::TensorOptions options={}); +TORCH_API at::Tensor linspace(const at::Scalar & start, const at::Tensor & end, int64_t steps, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); +TORCH_API at::Tensor & linspace_out(at::Tensor & out, const at::Scalar & start, const at::Tensor & end, int64_t steps); +TORCH_API at::Tensor & linspace_outf(const at::Scalar & start, const at::Tensor & end, int64_t steps, at::Tensor & out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/4a/4a4f589eef47dac65238f0cc7ded6c90b0edb2fb6511ba1f75b60fe0577be11c/BinaryOps.h b/shared/package-files/4a/4a4f589eef47dac65238f0cc7ded6c90b0edb2fb6511ba1f75b60fe0577be11c/BinaryOps.h new file mode 100644 index 0000000000000000000000000000000000000000..cf86a13c139a1f429ecb2cc4918c04df9e4b3246 --- /dev/null +++ b/shared/package-files/4a/4a4f589eef47dac65238f0cc7ded6c90b0edb2fb6511ba1f75b60fe0577be11c/BinaryOps.h @@ -0,0 +1,8 @@ +#include + +namespace at { +namespace native { +TORCH_API Tensor +quantized_add(Tensor qa, Tensor qb, double scale, int64_t zero_point); +} +} // namespace at diff --git a/shared/package-files/4a/4a4fdef87d7ccbdedd6757600a3331afd6f2c0052c78b05ba2eecfc25590d7a9/test_rbfinterp.py b/shared/package-files/4a/4a4fdef87d7ccbdedd6757600a3331afd6f2c0052c78b05ba2eecfc25590d7a9/test_rbfinterp.py new file mode 100644 index 0000000000000000000000000000000000000000..3d2759fdee41fa64c09bb00979f10b70e49a2855 --- /dev/null +++ b/shared/package-files/4a/4a4fdef87d7ccbdedd6757600a3331afd6f2c0052c78b05ba2eecfc25590d7a9/test_rbfinterp.py @@ -0,0 +1,534 @@ +import pickle +import pytest +import numpy as np +from numpy.linalg import LinAlgError +from scipy._lib._array_api import xp_assert_close +from scipy.stats.qmc import Halton +from scipy.spatial import cKDTree # type: ignore[attr-defined] +from scipy.interpolate._rbfinterp import ( + _AVAILABLE, _SCALE_INVARIANT, _NAME_TO_MIN_DEGREE, _monomial_powers, + RBFInterpolator + ) +from scipy.interpolate import _rbfinterp_pythran +from scipy._lib._testutils import _run_concurrent_barrier + + +def _vandermonde(x, degree): + # Returns a matrix of monomials that span polynomials with the specified + # degree evaluated at x. + powers = _monomial_powers(x.shape[1], degree) + return _rbfinterp_pythran._polynomial_matrix(x, powers) + + +def _1d_test_function(x): + # Test function used in Wahba's "Spline Models for Observational Data". + # domain ~= (0, 3), range ~= (-1.0, 0.2) + x = x[:, 0] + y = 4.26*(np.exp(-x) - 4*np.exp(-2*x) + 3*np.exp(-3*x)) + return y + + +def _2d_test_function(x): + # Franke's test function. + # domain ~= (0, 1) X (0, 1), range ~= (0.0, 1.2) + x1, x2 = x[:, 0], x[:, 1] + term1 = 0.75 * np.exp(-(9*x1-2)**2/4 - (9*x2-2)**2/4) + term2 = 0.75 * np.exp(-(9*x1+1)**2/49 - (9*x2+1)/10) + term3 = 0.5 * np.exp(-(9*x1-7)**2/4 - (9*x2-3)**2/4) + term4 = -0.2 * np.exp(-(9*x1-4)**2 - (9*x2-7)**2) + y = term1 + term2 + term3 + term4 + return y + + +def _is_conditionally_positive_definite(kernel, m): + # Tests whether the kernel is conditionally positive definite of order m. + # See chapter 7 of Fasshauer's "Meshfree Approximation Methods with + # MATLAB". + nx = 10 + ntests = 100 + for ndim in [1, 2, 3, 4, 5]: + # Generate sample points with a Halton sequence to avoid samples that + # are too close to each other, which can make the matrix singular. + seq = Halton(ndim, scramble=False, seed=np.random.RandomState()) + for _ in range(ntests): + x = 2*seq.random(nx) - 1 + A = _rbfinterp_pythran._kernel_matrix(x, kernel) + P = _vandermonde(x, m - 1) + Q, R = np.linalg.qr(P, mode='complete') + # Q2 forms a basis spanning the space where P.T.dot(x) = 0. Project + # A onto this space, and then see if it is positive definite using + # the Cholesky decomposition. If not, then the kernel is not c.p.d. + # of order m. + Q2 = Q[:, P.shape[1]:] + B = Q2.T.dot(A).dot(Q2) + try: + np.linalg.cholesky(B) + except np.linalg.LinAlgError: + return False + + return True + + +# Sorting the parametrize arguments is necessary to avoid a parallelization +# issue described here: https://github.com/pytest-dev/pytest-xdist/issues/432. +@pytest.mark.parametrize('kernel', sorted(_AVAILABLE)) +def test_conditionally_positive_definite(kernel): + # Test if each kernel in _AVAILABLE is conditionally positive definite of + # order m, where m comes from _NAME_TO_MIN_DEGREE. This is a necessary + # condition for the smoothed RBF interpolant to be well-posed in general. + m = _NAME_TO_MIN_DEGREE.get(kernel, -1) + 1 + assert _is_conditionally_positive_definite(kernel, m) + + +class _TestRBFInterpolator: + @pytest.mark.parametrize('kernel', sorted(_SCALE_INVARIANT)) + def test_scale_invariance_1d(self, kernel): + # Verify that the functions in _SCALE_INVARIANT are insensitive to the + # shape parameter (when smoothing == 0) in 1d. + seq = Halton(1, scramble=False, seed=np.random.RandomState()) + x = 3*seq.random(50) + y = _1d_test_function(x) + xitp = 3*seq.random(50) + yitp1 = self.build(x, y, epsilon=1.0, kernel=kernel)(xitp) + yitp2 = self.build(x, y, epsilon=2.0, kernel=kernel)(xitp) + xp_assert_close(yitp1, yitp2, atol=1e-8) + + @pytest.mark.parametrize('kernel', sorted(_SCALE_INVARIANT)) + def test_scale_invariance_2d(self, kernel): + # Verify that the functions in _SCALE_INVARIANT are insensitive to the + # shape parameter (when smoothing == 0) in 2d. + seq = Halton(2, scramble=False, seed=np.random.RandomState()) + x = seq.random(100) + y = _2d_test_function(x) + xitp = seq.random(100) + yitp1 = self.build(x, y, epsilon=1.0, kernel=kernel)(xitp) + yitp2 = self.build(x, y, epsilon=2.0, kernel=kernel)(xitp) + xp_assert_close(yitp1, yitp2, atol=1e-8) + + @pytest.mark.parametrize('kernel', sorted(_AVAILABLE)) + def test_extreme_domains(self, kernel): + # Make sure the interpolant remains numerically stable for very + # large/small domains. + seq = Halton(2, scramble=False, seed=np.random.RandomState()) + scale = 1e50 + shift = 1e55 + + x = seq.random(100) + y = _2d_test_function(x) + xitp = seq.random(100) + + if kernel in _SCALE_INVARIANT: + yitp1 = self.build(x, y, kernel=kernel)(xitp) + yitp2 = self.build( + x*scale + shift, y, + kernel=kernel + )(xitp*scale + shift) + else: + yitp1 = self.build(x, y, epsilon=5.0, kernel=kernel)(xitp) + yitp2 = self.build( + x*scale + shift, y, + epsilon=5.0/scale, + kernel=kernel + )(xitp*scale + shift) + + xp_assert_close(yitp1, yitp2, atol=1e-8) + + def test_polynomial_reproduction(self): + # If the observed data comes from a polynomial, then the interpolant + # should be able to reproduce the polynomial exactly, provided that + # `degree` is sufficiently high. + rng = np.random.RandomState(0) + seq = Halton(2, scramble=False, seed=rng) + degree = 3 + + x = seq.random(50) + xitp = seq.random(50) + + P = _vandermonde(x, degree) + Pitp = _vandermonde(xitp, degree) + + poly_coeffs = rng.normal(0.0, 1.0, P.shape[1]) + + y = P.dot(poly_coeffs) + yitp1 = Pitp.dot(poly_coeffs) + yitp2 = self.build(x, y, degree=degree)(xitp) + + xp_assert_close(yitp1, yitp2, atol=1e-8) + + @pytest.mark.slow + def test_chunking(self, monkeypatch): + # If the observed data comes from a polynomial, then the interpolant + # should be able to reproduce the polynomial exactly, provided that + # `degree` is sufficiently high. + rng = np.random.RandomState(0) + seq = Halton(2, scramble=False, seed=rng) + degree = 3 + + largeN = 1000 + 33 + # this is large to check that chunking of the RBFInterpolator is tested + x = seq.random(50) + xitp = seq.random(largeN) + + P = _vandermonde(x, degree) + Pitp = _vandermonde(xitp, degree) + + poly_coeffs = rng.normal(0.0, 1.0, P.shape[1]) + + y = P.dot(poly_coeffs) + yitp1 = Pitp.dot(poly_coeffs) + interp = self.build(x, y, degree=degree) + ce_real = interp._chunk_evaluator + + def _chunk_evaluator(*args, **kwargs): + kwargs.update(memory_budget=100) + return ce_real(*args, **kwargs) + + monkeypatch.setattr(interp, '_chunk_evaluator', _chunk_evaluator) + yitp2 = interp(xitp) + xp_assert_close(yitp1, yitp2, atol=1e-8) + + def test_vector_data(self): + # Make sure interpolating a vector field is the same as interpolating + # each component separately. + seq = Halton(2, scramble=False, seed=np.random.RandomState()) + + x = seq.random(100) + xitp = seq.random(100) + + y = np.array([_2d_test_function(x), + _2d_test_function(x[:, ::-1])]).T + + yitp1 = self.build(x, y)(xitp) + yitp2 = self.build(x, y[:, 0])(xitp) + yitp3 = self.build(x, y[:, 1])(xitp) + + xp_assert_close(yitp1[:, 0], yitp2) + xp_assert_close(yitp1[:, 1], yitp3) + + def test_complex_data(self): + # Interpolating complex input should be the same as interpolating the + # real and complex components. + seq = Halton(2, scramble=False, seed=np.random.RandomState()) + + x = seq.random(100) + xitp = seq.random(100) + + y = _2d_test_function(x) + 1j*_2d_test_function(x[:, ::-1]) + + yitp1 = self.build(x, y)(xitp) + yitp2 = self.build(x, y.real)(xitp) + yitp3 = self.build(x, y.imag)(xitp) + + xp_assert_close(yitp1.real, yitp2) + xp_assert_close(yitp1.imag, yitp3) + + @pytest.mark.parametrize('kernel', sorted(_AVAILABLE)) + def test_interpolation_misfit_1d(self, kernel): + # Make sure that each kernel, with its default `degree` and an + # appropriate `epsilon`, does a good job at interpolation in 1d. + seq = Halton(1, scramble=False, seed=np.random.RandomState()) + + x = 3*seq.random(50) + xitp = 3*seq.random(50) + + y = _1d_test_function(x) + ytrue = _1d_test_function(xitp) + yitp = self.build(x, y, epsilon=5.0, kernel=kernel)(xitp) + + mse = np.mean((yitp - ytrue)**2) + assert mse < 1.0e-4 + + @pytest.mark.parametrize('kernel', sorted(_AVAILABLE)) + def test_interpolation_misfit_2d(self, kernel): + # Make sure that each kernel, with its default `degree` and an + # appropriate `epsilon`, does a good job at interpolation in 2d. + seq = Halton(2, scramble=False, seed=np.random.RandomState()) + + x = seq.random(100) + xitp = seq.random(100) + + y = _2d_test_function(x) + ytrue = _2d_test_function(xitp) + yitp = self.build(x, y, epsilon=5.0, kernel=kernel)(xitp) + + mse = np.mean((yitp - ytrue)**2) + assert mse < 2.0e-4 + + @pytest.mark.parametrize('kernel', sorted(_AVAILABLE)) + def test_smoothing_misfit(self, kernel): + # Make sure we can find a smoothing parameter for each kernel that + # removes a sufficient amount of noise. + rng = np.random.RandomState(0) + seq = Halton(1, scramble=False, seed=rng) + + noise = 0.2 + rmse_tol = 0.1 + smoothing_range = 10**np.linspace(-4, 1, 20) + + x = 3*seq.random(100) + y = _1d_test_function(x) + rng.normal(0.0, noise, (100,)) + ytrue = _1d_test_function(x) + rmse_within_tol = False + for smoothing in smoothing_range: + ysmooth = self.build( + x, y, + epsilon=1.0, + smoothing=smoothing, + kernel=kernel)(x) + rmse = np.sqrt(np.mean((ysmooth - ytrue)**2)) + if rmse < rmse_tol: + rmse_within_tol = True + break + + assert rmse_within_tol + + def test_array_smoothing(self): + # Test using an array for `smoothing` to give less weight to a known + # outlier. + rng = np.random.RandomState(0) + seq = Halton(1, scramble=False, seed=rng) + degree = 2 + + x = seq.random(50) + P = _vandermonde(x, degree) + poly_coeffs = rng.normal(0.0, 1.0, P.shape[1]) + y = P.dot(poly_coeffs) + y_with_outlier = np.copy(y) + y_with_outlier[10] += 1.0 + smoothing = np.zeros((50,)) + smoothing[10] = 1000.0 + yitp = self.build(x, y_with_outlier, smoothing=smoothing)(x) + # Should be able to reproduce the uncorrupted data almost exactly. + xp_assert_close(yitp, y, atol=1e-4) + + def test_inconsistent_x_dimensions_error(self): + # ValueError should be raised if the observation points and evaluation + # points have a different number of dimensions. + y = Halton(2, scramble=False, seed=np.random.RandomState()).random(10) + d = _2d_test_function(y) + x = Halton(1, scramble=False, seed=np.random.RandomState()).random(10) + match = 'Expected the second axis of `x`' + with pytest.raises(ValueError, match=match): + self.build(y, d)(x) + + def test_inconsistent_d_length_error(self): + y = np.linspace(0, 1, 5)[:, None] + d = np.zeros(1) + match = 'Expected the first axis of `d`' + with pytest.raises(ValueError, match=match): + self.build(y, d) + + def test_y_not_2d_error(self): + y = np.linspace(0, 1, 5) + d = np.zeros(5) + match = '`y` must be a 2-dimensional array.' + with pytest.raises(ValueError, match=match): + self.build(y, d) + + def test_inconsistent_smoothing_length_error(self): + y = np.linspace(0, 1, 5)[:, None] + d = np.zeros(5) + smoothing = np.ones(1) + match = 'Expected `smoothing` to be' + with pytest.raises(ValueError, match=match): + self.build(y, d, smoothing=smoothing) + + def test_invalid_kernel_name_error(self): + y = np.linspace(0, 1, 5)[:, None] + d = np.zeros(5) + match = '`kernel` must be one of' + with pytest.raises(ValueError, match=match): + self.build(y, d, kernel='test') + + def test_epsilon_not_specified_error(self): + y = np.linspace(0, 1, 5)[:, None] + d = np.zeros(5) + for kernel in _AVAILABLE: + if kernel in _SCALE_INVARIANT: + continue + + match = '`epsilon` must be specified' + with pytest.raises(ValueError, match=match): + self.build(y, d, kernel=kernel) + + def test_x_not_2d_error(self): + y = np.linspace(0, 1, 5)[:, None] + x = np.linspace(0, 1, 5) + d = np.zeros(5) + match = '`x` must be a 2-dimensional array.' + with pytest.raises(ValueError, match=match): + self.build(y, d)(x) + + def test_not_enough_observations_error(self): + y = np.linspace(0, 1, 1)[:, None] + d = np.zeros(1) + match = 'At least 2 data points are required' + with pytest.raises(ValueError, match=match): + self.build(y, d, kernel='thin_plate_spline') + + @pytest.mark.thread_unsafe + def test_degree_warning(self): + y = np.linspace(0, 1, 5)[:, None] + d = np.zeros(5) + for kernel, deg in _NAME_TO_MIN_DEGREE.items(): + # Only test for kernels that its minimum degree is not 0. + if deg >= 1: + match = f'`degree` should not be below {deg}' + with pytest.warns(Warning, match=match): + self.build(y, d, epsilon=1.0, kernel=kernel, degree=deg-1) + + def test_minus_one_degree(self): + # Make sure a degree of -1 is accepted without any warning. + y = np.linspace(0, 1, 5)[:, None] + d = np.zeros(5) + for kernel, _ in _NAME_TO_MIN_DEGREE.items(): + self.build(y, d, epsilon=1.0, kernel=kernel, degree=-1) + + def test_rank_error(self): + # An error should be raised when `kernel` is "thin_plate_spline" and + # observations are 2-D and collinear. + y = np.array([[2.0, 0.0], [1.0, 0.0], [0.0, 0.0]]) + d = np.array([0.0, 0.0, 0.0]) + match = 'does not have full column rank' + with pytest.raises(LinAlgError, match=match): + self.build(y, d, kernel='thin_plate_spline')(y) + + def test_single_point(self): + # Make sure interpolation still works with only one point (in 1, 2, and + # 3 dimensions). + for dim in [1, 2, 3]: + y = np.zeros((1, dim)) + d = np.ones((1,)) + f = self.build(y, d, kernel='linear')(y) + xp_assert_close(d, f) + + def test_pickleable(self): + # Make sure we can pickle and unpickle the interpolant without any + # changes in the behavior. + seq = Halton(1, scramble=False, seed=np.random.RandomState(2305982309)) + + x = 3*seq.random(50) + xitp = 3*seq.random(50) + + y = _1d_test_function(x) + + interp = self.build(x, y) + + yitp1 = interp(xitp) + yitp2 = pickle.loads(pickle.dumps(interp))(xitp) + + xp_assert_close(yitp1, yitp2, atol=1e-16) + + +class TestRBFInterpolatorNeighborsNone(_TestRBFInterpolator): + def build(self, *args, **kwargs): + return RBFInterpolator(*args, **kwargs) + + def test_smoothing_limit_1d(self): + # For large smoothing parameters, the interpolant should approach a + # least squares fit of a polynomial with the specified degree. + seq = Halton(1, scramble=False, seed=np.random.RandomState()) + + degree = 3 + smoothing = 1e8 + + x = 3*seq.random(50) + xitp = 3*seq.random(50) + + y = _1d_test_function(x) + + yitp1 = self.build( + x, y, + degree=degree, + smoothing=smoothing + )(xitp) + + P = _vandermonde(x, degree) + Pitp = _vandermonde(xitp, degree) + yitp2 = Pitp.dot(np.linalg.lstsq(P, y, rcond=None)[0]) + + xp_assert_close(yitp1, yitp2, atol=1e-8) + + def test_smoothing_limit_2d(self): + # For large smoothing parameters, the interpolant should approach a + # least squares fit of a polynomial with the specified degree. + seq = Halton(2, scramble=False, seed=np.random.RandomState()) + + degree = 3 + smoothing = 1e8 + + x = seq.random(100) + xitp = seq.random(100) + + y = _2d_test_function(x) + + yitp1 = self.build( + x, y, + degree=degree, + smoothing=smoothing + )(xitp) + + P = _vandermonde(x, degree) + Pitp = _vandermonde(xitp, degree) + yitp2 = Pitp.dot(np.linalg.lstsq(P, y, rcond=None)[0]) + + xp_assert_close(yitp1, yitp2, atol=1e-8) + + +class TestRBFInterpolatorNeighbors20(_TestRBFInterpolator): + # RBFInterpolator using 20 nearest neighbors. + def build(self, *args, **kwargs): + return RBFInterpolator(*args, **kwargs, neighbors=20) + + def test_equivalent_to_rbf_interpolator(self): + seq = Halton(2, scramble=False, seed=np.random.RandomState()) + + x = seq.random(100) + xitp = seq.random(100) + + y = _2d_test_function(x) + + yitp1 = self.build(x, y)(xitp) + + yitp2 = [] + tree = cKDTree(x) + for xi in xitp: + _, nbr = tree.query(xi, 20) + yitp2.append(RBFInterpolator(x[nbr], y[nbr])(xi[None])[0]) + + xp_assert_close(yitp1, yitp2, atol=1e-8) + + def test_concurrency(self): + # Check that no segfaults appear with concurrent access to + # RbfInterpolator + seq = Halton(2, scramble=False, seed=np.random.RandomState(0)) + x = seq.random(100) + xitp = seq.random(100) + + y = _2d_test_function(x) + + interp = self.build(x, y) + + def worker_fn(_, interp, xp): + interp(xp) + + _run_concurrent_barrier(10, worker_fn, interp, xitp) + + +class TestRBFInterpolatorNeighborsInf(TestRBFInterpolatorNeighborsNone): + # RBFInterpolator using neighbors=np.inf. This should give exactly the same + # results as neighbors=None, but it will be slower. + def build(self, *args, **kwargs): + return RBFInterpolator(*args, **kwargs, neighbors=np.inf) + + def test_equivalent_to_rbf_interpolator(self): + seq = Halton(1, scramble=False, seed=np.random.RandomState()) + + x = 3*seq.random(50) + xitp = 3*seq.random(50) + + y = _1d_test_function(x) + yitp1 = self.build(x, y)(xitp) + yitp2 = RBFInterpolator(x, y)(xitp) + + xp_assert_close(yitp1, yitp2, atol=1e-8) diff --git a/shared/package-files/4a/4a4fe07ecc2658a6f7cdaeb0ad4fe622b455065ebdaa3cc0bbd96dce76c308ab/_basic.py b/shared/package-files/4a/4a4fe07ecc2658a6f7cdaeb0ad4fe622b455065ebdaa3cc0bbd96dce76c308ab/_basic.py new file mode 100644 index 0000000000000000000000000000000000000000..59c85ae4b364464a66489ef221f7f7ac45624694 --- /dev/null +++ b/shared/package-files/4a/4a4fe07ecc2658a6f7cdaeb0ad4fe622b455065ebdaa3cc0bbd96dce76c308ab/_basic.py @@ -0,0 +1,428 @@ +""" +Discrete Fourier Transforms - _basic.py +""" +# Created by Pearu Peterson, August,September 2002 +__all__ = ['fft','ifft','fftn','ifftn','rfft','irfft', + 'fft2','ifft2'] + +from scipy.fft import _pocketfft +from ._helper import _good_shape + + +def fft(x, n=None, axis=-1, overwrite_x=False): + """ + Return discrete Fourier transform of real or complex sequence. + + The returned complex array contains ``y(0), y(1),..., y(n-1)``, where + + ``y(j) = (x * exp(-2*pi*sqrt(-1)*j*np.arange(n)/n)).sum()``. + + Parameters + ---------- + x : array_like + Array to Fourier transform. + n : int, optional + Length of the Fourier transform. If ``n < x.shape[axis]``, `x` is + truncated. If ``n > x.shape[axis]``, `x` is zero-padded. The + default results in ``n = x.shape[axis]``. + axis : int, optional + Axis along which the fft's are computed; the default is over the + last axis (i.e., ``axis=-1``). + overwrite_x : bool, optional + If True, the contents of `x` can be destroyed; the default is False. + + Returns + ------- + z : complex ndarray + with the elements:: + + [y(0),y(1),..,y(n/2),y(1-n/2),...,y(-1)] if n is even + [y(0),y(1),..,y((n-1)/2),y(-(n-1)/2),...,y(-1)] if n is odd + + where:: + + y(j) = sum[k=0..n-1] x[k] * exp(-sqrt(-1)*j*k* 2*pi/n), j = 0..n-1 + + See Also + -------- + ifft : Inverse FFT + rfft : FFT of a real sequence + + Notes + ----- + The packing of the result is "standard": If ``A = fft(a, n)``, then + ``A[0]`` contains the zero-frequency term, ``A[1:n/2]`` contains the + positive-frequency terms, and ``A[n/2:]`` contains the negative-frequency + terms, in order of decreasingly negative frequency. So ,for an 8-point + transform, the frequencies of the result are [0, 1, 2, 3, -4, -3, -2, -1]. + To rearrange the fft output so that the zero-frequency component is + centered, like [-4, -3, -2, -1, 0, 1, 2, 3], use `fftshift`. + + Both single and double precision routines are implemented. Half precision + inputs will be converted to single precision. Non-floating-point inputs + will be converted to double precision. Long-double precision inputs are + not supported. + + This function is most efficient when `n` is a power of two, and least + efficient when `n` is prime. + + Note that if ``x`` is real-valued, then ``A[j] == A[n-j].conjugate()``. + If ``x`` is real-valued and ``n`` is even, then ``A[n/2]`` is real. + + If the data type of `x` is real, a "real FFT" algorithm is automatically + used, which roughly halves the computation time. To increase efficiency + a little further, use `rfft`, which does the same calculation, but only + outputs half of the symmetrical spectrum. If the data is both real and + symmetrical, the `dct` can again double the efficiency by generating + half of the spectrum from half of the signal. + + Examples + -------- + >>> import numpy as np + >>> from scipy.fftpack import fft, ifft + >>> x = np.arange(5) + >>> np.allclose(fft(ifft(x)), x, atol=1e-15) # within numerical accuracy. + True + + """ + return _pocketfft.fft(x, n, axis, None, overwrite_x) + + +def ifft(x, n=None, axis=-1, overwrite_x=False): + """ + Return discrete inverse Fourier transform of real or complex sequence. + + The returned complex array contains ``y(0), y(1),..., y(n-1)``, where + + ``y(j) = (x * exp(2*pi*sqrt(-1)*j*np.arange(n)/n)).mean()``. + + Parameters + ---------- + x : array_like + Transformed data to invert. + n : int, optional + Length of the inverse Fourier transform. If ``n < x.shape[axis]``, + `x` is truncated. If ``n > x.shape[axis]``, `x` is zero-padded. + The default results in ``n = x.shape[axis]``. + axis : int, optional + Axis along which the ifft's are computed; the default is over the + last axis (i.e., ``axis=-1``). + overwrite_x : bool, optional + If True, the contents of `x` can be destroyed; the default is False. + + Returns + ------- + ifft : ndarray of floats + The inverse discrete Fourier transform. + + See Also + -------- + fft : Forward FFT + + Notes + ----- + Both single and double precision routines are implemented. Half precision + inputs will be converted to single precision. Non-floating-point inputs + will be converted to double precision. Long-double precision inputs are + not supported. + + This function is most efficient when `n` is a power of two, and least + efficient when `n` is prime. + + If the data type of `x` is real, a "real IFFT" algorithm is automatically + used, which roughly halves the computation time. + + Examples + -------- + >>> from scipy.fftpack import fft, ifft + >>> import numpy as np + >>> x = np.arange(5) + >>> np.allclose(ifft(fft(x)), x, atol=1e-15) # within numerical accuracy. + True + + """ + return _pocketfft.ifft(x, n, axis, None, overwrite_x) + + +def rfft(x, n=None, axis=-1, overwrite_x=False): + """ + Discrete Fourier transform of a real sequence. + + Parameters + ---------- + x : array_like, real-valued + The data to transform. + n : int, optional + Defines the length of the Fourier transform. If `n` is not specified + (the default) then ``n = x.shape[axis]``. If ``n < x.shape[axis]``, + `x` is truncated, if ``n > x.shape[axis]``, `x` is zero-padded. + axis : int, optional + The axis along which the transform is applied. The default is the + last axis. + overwrite_x : bool, optional + If set to true, the contents of `x` can be overwritten. Default is + False. + + Returns + ------- + z : real ndarray + The returned real array contains:: + + [y(0),Re(y(1)),Im(y(1)),...,Re(y(n/2))] if n is even + [y(0),Re(y(1)),Im(y(1)),...,Re(y(n/2)),Im(y(n/2))] if n is odd + + where:: + + y(j) = sum[k=0..n-1] x[k] * exp(-sqrt(-1)*j*k*2*pi/n) + j = 0..n-1 + + See Also + -------- + fft, irfft, scipy.fft.rfft + + Notes + ----- + Within numerical accuracy, ``y == rfft(irfft(y))``. + + Both single and double precision routines are implemented. Half precision + inputs will be converted to single precision. Non-floating-point inputs + will be converted to double precision. Long-double precision inputs are + not supported. + + To get an output with a complex datatype, consider using the newer + function `scipy.fft.rfft`. + + Examples + -------- + >>> from scipy.fftpack import fft, rfft + >>> a = [9, -9, 1, 3] + >>> fft(a) + array([ 4. +0.j, 8.+12.j, 16. +0.j, 8.-12.j]) + >>> rfft(a) + array([ 4., 8., 12., 16.]) + + """ + return _pocketfft.rfft_fftpack(x, n, axis, None, overwrite_x) + + +def irfft(x, n=None, axis=-1, overwrite_x=False): + """ + Return inverse discrete Fourier transform of real sequence x. + + The contents of `x` are interpreted as the output of the `rfft` + function. + + Parameters + ---------- + x : array_like + Transformed data to invert. + n : int, optional + Length of the inverse Fourier transform. + If n < x.shape[axis], x is truncated. + If n > x.shape[axis], x is zero-padded. + The default results in n = x.shape[axis]. + axis : int, optional + Axis along which the ifft's are computed; the default is over + the last axis (i.e., axis=-1). + overwrite_x : bool, optional + If True, the contents of `x` can be destroyed; the default is False. + + Returns + ------- + irfft : ndarray of floats + The inverse discrete Fourier transform. + + See Also + -------- + rfft, ifft, scipy.fft.irfft + + Notes + ----- + The returned real array contains:: + + [y(0),y(1),...,y(n-1)] + + where for n is even:: + + y(j) = 1/n (sum[k=1..n/2-1] (x[2*k-1]+sqrt(-1)*x[2*k]) + * exp(sqrt(-1)*j*k* 2*pi/n) + + c.c. + x[0] + (-1)**(j) x[n-1]) + + and for n is odd:: + + y(j) = 1/n (sum[k=1..(n-1)/2] (x[2*k-1]+sqrt(-1)*x[2*k]) + * exp(sqrt(-1)*j*k* 2*pi/n) + + c.c. + x[0]) + + c.c. denotes complex conjugate of preceding expression. + + For details on input parameters, see `rfft`. + + To process (conjugate-symmetric) frequency-domain data with a complex + datatype, consider using the newer function `scipy.fft.irfft`. + + Examples + -------- + >>> from scipy.fftpack import rfft, irfft + >>> a = [1.0, 2.0, 3.0, 4.0, 5.0] + >>> irfft(a) + array([ 2.6 , -3.16405192, 1.24398433, -1.14955713, 1.46962473]) + >>> irfft(rfft(a)) + array([1., 2., 3., 4., 5.]) + + """ + return _pocketfft.irfft_fftpack(x, n, axis, None, overwrite_x) + + +def fftn(x, shape=None, axes=None, overwrite_x=False): + """ + Return multidimensional discrete Fourier transform. + + The returned array contains:: + + y[j_1,..,j_d] = sum[k_1=0..n_1-1, ..., k_d=0..n_d-1] + x[k_1,..,k_d] * prod[i=1..d] exp(-sqrt(-1)*2*pi/n_i * j_i * k_i) + + where d = len(x.shape) and n = x.shape. + + Parameters + ---------- + x : array_like + The (N-D) array to transform. + shape : int or array_like of ints or None, optional + The shape of the result. If both `shape` and `axes` (see below) are + None, `shape` is ``x.shape``; if `shape` is None but `axes` is + not None, then `shape` is ``numpy.take(x.shape, axes, axis=0)``. + If ``shape[i] > x.shape[i]``, the ith dimension is padded with zeros. + If ``shape[i] < x.shape[i]``, the ith dimension is truncated to + length ``shape[i]``. + If any element of `shape` is -1, the size of the corresponding + dimension of `x` is used. + axes : int or array_like of ints or None, optional + The axes of `x` (`y` if `shape` is not None) along which the + transform is applied. + The default is over all axes. + overwrite_x : bool, optional + If True, the contents of `x` can be destroyed. Default is False. + + Returns + ------- + y : complex-valued N-D NumPy array + The (N-D) DFT of the input array. + + See Also + -------- + ifftn + + Notes + ----- + If ``x`` is real-valued, then + ``y[..., j_i, ...] == y[..., n_i-j_i, ...].conjugate()``. + + Both single and double precision routines are implemented. Half precision + inputs will be converted to single precision. Non-floating-point inputs + will be converted to double precision. Long-double precision inputs are + not supported. + + Examples + -------- + >>> import numpy as np + >>> from scipy.fftpack import fftn, ifftn + >>> y = (-np.arange(16), 8 - np.arange(16), np.arange(16)) + >>> np.allclose(y, fftn(ifftn(y))) + True + + """ + shape = _good_shape(x, shape, axes) + return _pocketfft.fftn(x, shape, axes, None, overwrite_x) + + +def ifftn(x, shape=None, axes=None, overwrite_x=False): + """ + Return inverse multidimensional discrete Fourier transform. + + The sequence can be of an arbitrary type. + + The returned array contains:: + + y[j_1,..,j_d] = 1/p * sum[k_1=0..n_1-1, ..., k_d=0..n_d-1] + x[k_1,..,k_d] * prod[i=1..d] exp(sqrt(-1)*2*pi/n_i * j_i * k_i) + + where ``d = len(x.shape)``, ``n = x.shape``, and ``p = prod[i=1..d] n_i``. + + For description of parameters see `fftn`. + + See Also + -------- + fftn : for detailed information. + + Examples + -------- + >>> from scipy.fftpack import fftn, ifftn + >>> import numpy as np + >>> y = (-np.arange(16), 8 - np.arange(16), np.arange(16)) + >>> np.allclose(y, ifftn(fftn(y))) + True + + """ + shape = _good_shape(x, shape, axes) + return _pocketfft.ifftn(x, shape, axes, None, overwrite_x) + + +def fft2(x, shape=None, axes=(-2,-1), overwrite_x=False): + """ + 2-D discrete Fourier transform. + + Return the 2-D discrete Fourier transform of the 2-D argument + `x`. + + See Also + -------- + fftn : for detailed information. + + Examples + -------- + >>> import numpy as np + >>> from scipy.fftpack import fft2, ifft2 + >>> y = np.mgrid[:5, :5][0] + >>> y + array([[0, 0, 0, 0, 0], + [1, 1, 1, 1, 1], + [2, 2, 2, 2, 2], + [3, 3, 3, 3, 3], + [4, 4, 4, 4, 4]]) + >>> np.allclose(y, ifft2(fft2(y))) + True + """ + return fftn(x,shape,axes,overwrite_x) + + +def ifft2(x, shape=None, axes=(-2,-1), overwrite_x=False): + """ + 2-D discrete inverse Fourier transform of real or complex sequence. + + Return inverse 2-D discrete Fourier transform of + arbitrary type sequence x. + + See `ifft` for more information. + + See Also + -------- + fft2, ifft + + Examples + -------- + >>> import numpy as np + >>> from scipy.fftpack import fft2, ifft2 + >>> y = np.mgrid[:5, :5][0] + >>> y + array([[0, 0, 0, 0, 0], + [1, 1, 1, 1, 1], + [2, 2, 2, 2, 2], + [3, 3, 3, 3, 3], + [4, 4, 4, 4, 4]]) + >>> np.allclose(y, fft2(ifft2(y))) + True + + """ + return ifftn(x,shape,axes,overwrite_x) diff --git a/shared/package-files/4a/4a50e58ba018efb7fa9f2f87ee8cbdf0e9108ecaf0f83fecba912e12b2156241/exceptions.py b/shared/package-files/4a/4a50e58ba018efb7fa9f2f87ee8cbdf0e9108ecaf0f83fecba912e12b2156241/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..bd9efed202ab1cdf57a9e99cb4e094ef6f38d0c0 --- /dev/null +++ b/shared/package-files/4a/4a50e58ba018efb7fa9f2f87ee8cbdf0e9108ecaf0f83fecba912e12b2156241/exceptions.py @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: MIT + +from attr.exceptions import * # noqa diff --git a/shared/package-files/4a/4a53554b97daffc202a2f9109acd8f3aa6f59d80e5591173dd34627561e84183/__init__.py b/shared/package-files/4a/4a53554b97daffc202a2f9109acd8f3aa6f59d80e5591173dd34627561e84183/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fdd16eec5aca342c4eab9e3910daac074225d6dc --- /dev/null +++ b/shared/package-files/4a/4a53554b97daffc202a2f9109acd8f3aa6f59d80e5591173dd34627561e84183/__init__.py @@ -0,0 +1,21 @@ +from torch._C import _set_backcompat_broadcast_warn +from torch._C import _get_backcompat_broadcast_warn +from torch._C import _set_backcompat_keepdim_warn +from torch._C import _get_backcompat_keepdim_warn + + +class Warning: + def __init__(self, setter, getter): + self.setter = setter + self.getter = getter + + def set_enabled(self, value): + self.setter(value) + + def get_enabled(self): + return self.getter() + + enabled = property(get_enabled, set_enabled) + +broadcast_warning = Warning(_set_backcompat_broadcast_warn, _get_backcompat_broadcast_warn) +keepdim_warning = Warning(_set_backcompat_keepdim_warn, _get_backcompat_keepdim_warn) diff --git a/shared/package-files/4a/4a54190cf117e55cebc99938f461b1d22517b5d9b08ab9383e66875280115818/mse_loss_backward_ops.h b/shared/package-files/4a/4a54190cf117e55cebc99938f461b1d22517b5d9b08ab9383e66875280115818/mse_loss_backward_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..347339bafe236dee5498c571a46a1e64f3bb766b --- /dev/null +++ b/shared/package-files/4a/4a54190cf117e55cebc99938f461b1d22517b5d9b08ab9383e66875280115818/mse_loss_backward_ops.h @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API mse_loss_backward_grad_input { + using schema = at::Tensor & (const at::Tensor &, const at::Tensor &, const at::Tensor &, int64_t, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::mse_loss_backward") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "grad_input") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "mse_loss_backward.grad_input(Tensor grad_output, Tensor self, Tensor target, int reduction, *, Tensor(a!) grad_input) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, int64_t reduction, at::Tensor & grad_input); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, int64_t reduction, at::Tensor & grad_input); +}; + +struct TORCH_API mse_loss_backward { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &, const at::Tensor &, int64_t); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::mse_loss_backward") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "mse_loss_backward(Tensor grad_output, Tensor self, Tensor target, int reduction) -> Tensor") + static at::Tensor call(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, int64_t reduction); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, int64_t reduction); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/4a/4a541b0ae3284c87071839bd345290bba9e1662533d5553768d06d2b3e4d17bc/METADATA b/shared/package-files/4a/4a541b0ae3284c87071839bd345290bba9e1662533d5553768d06d2b3e4d17bc/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..02622121614d34eeed9182a84371f5bba8d26261 --- /dev/null +++ b/shared/package-files/4a/4a541b0ae3284c87071839bd345290bba9e1662533d5553768d06d2b3e4d17bc/METADATA @@ -0,0 +1,121 @@ +Metadata-Version: 2.1 +Name: conda_index +Version: 0.4.0 +Summary: conda index. Create repodata.json for collections of conda packages. +Author-email: "Anaconda, Inc. & Contributors" +Requires-Python: >=3.7 +Description-Content-Type: text/markdown +Requires-Dist: click >=8 +Requires-Dist: conda >=4.14.0 +Requires-Dist: conda-package-streaming >=0.7.0 +Requires-Dist: filelock +Requires-Dist: jinja2 +Requires-Dist: more-itertools +Requires-Dist: ruamel.yaml +Requires-Dist: furo ; extra == "docs" +Requires-Dist: sphinx ; extra == "docs" +Requires-Dist: sphinx-click ; extra == "docs" +Requires-Dist: myst-parser ; extra == "docs" +Requires-Dist: mdit-py-plugins>=0.3.0 ; extra == "docs" +Requires-Dist: conda-build >=3.21.0 ; extra == "test" +Requires-Dist: conda-package-handling >=1.9.0 ; extra == "test" +Requires-Dist: coverage[toml] ; extra == "test" +Requires-Dist: pytest >=7 ; extra == "test" +Requires-Dist: pytest-cov ; extra == "test" +Requires-Dist: pytest-mock ; extra == "test" +Project-URL: Home, https://github.com/conda/conda-index +Provides-Extra: docs +Provides-Extra: test + +# conda-index + +conda index, formerly part of conda-build. Create `repodata.json` for +collections of conda packages. + +The `conda_index` command operates on a channel directory. A channel directory +contains a `noarch` subdirectory at a minimum and will almost always contain +other subdirectories named for conda's supported platforms `linux-64`, `win-64`, +`osx-64`, etc. A channel directory cannot have the same name as a supported +platform. Place packages into the same platform subdirectory each archive was +built for. Conda-index extracts metadata from these packages to generate +`index.html`, `repodata.json` etc. with summaries of the packages' metadata. +Then conda uses the metadata to solve dependencies before doing an install. + +By default, the metadata is output to the same directory tree as the channel +directory, but it can be output to a separate tree with the `--output ` +parameter. The metadata cache is always placed with the packages, in `.cache` +folders under each platform subdirectory. + +After conda-index has finished, its output can be used as a channel `conda +install -c file:///path/to/output ...` or it would typically be placed on a web +server. + +## Run normally + +```sh +python -m conda_index +``` + +Note `conda index` (instead of `python -m conda_index`) may find legacy +`conda-build index`. + +## Run for debugging + +```sh +python -m conda_index --verbose --threads=1 +``` + +## Contributing + +```sh +conda create -n conda-index "python >=3.9" conda conda-build "pip >=22" + +git clone https://github.com/conda/conda-index.git +pip install -e conda-index[test] + +cd conda-index +pytest +``` + +## Summary of changes from the previous `conda-build index` version + +* Approximately 2.2x faster conda package extraction, by extracting just the + metadata to streams instead of extracting packages to a temporary directory; + closes the package early if all metadata has been found. + +* No longer read existing `repodata.json`. Always load from cache. + +* Uses a sqlite metadata cache that is orders of magnitude faster than the old + many-tiny-files cache. + +* The first time `conda index` runs, it will convert the existing file-based + `.cache` to a sqlite3 database `.cache/cache.db`. This takes about ten minutes + per subdir for conda-forge. (If this is interrupted, delete `cache.db` to + start over, or packages will be re-extracted into the cache.) `sqlite3` must + be compiled with the JSON1 extension. JSON1 is built into SQLite by default as + of SQLite version 3.38.0 (2022-02-22). + +* Each subdir `osx-64`, `linux-64` etc. has its own `cache.db`; conda-forge’s + 1.2T osx-64 subdir has a single 2.4GB `cache.db`. Storing the cache in fewer + files saves time since there is a per-file wait to open each of the + many tiny `.json` files in old-style `.cache/`. + +* `cache.db` is highly compressible, like the text metadata. 2.4G → zstd → 88M + +* No longer cache `paths.json` (only used to create `post_install.json` and not + referenced later in the indexing process). Saves 90% disk space in `.cache`. + +* Updated Python and dependency requirements. + +* Mercilessly cull less-used features. + +* Format with `black` + +## Parallelism + +This version of conda-index continues indexing packages from other subdirs while +the main thread is writing a repodata.json. + +All `current_repodata.json` are generated in parallel. This may use a lot of ram +if `repodata.json` has tens of thousands of entries. + diff --git a/shared/package-files/4a/4a5db6e1708d2bf971f8dea4f617974bf836fdbc26a82249c8a0efee913f1d0c/test_datetimeindex.py b/shared/package-files/4a/4a5db6e1708d2bf971f8dea4f617974bf836fdbc26a82249c8a0efee913f1d0c/test_datetimeindex.py new file mode 100644 index 0000000000000000000000000000000000000000..b023297c9549d88f6e1c493e50f148a74f26cea6 --- /dev/null +++ b/shared/package-files/4a/4a5db6e1708d2bf971f8dea4f617974bf836fdbc26a82249c8a0efee913f1d0c/test_datetimeindex.py @@ -0,0 +1,69 @@ +import pytest + +from pandas import ( + DatetimeIndex, + Series, + Timestamp, + date_range, +) +import pandas._testing as tm + +pytestmark = pytest.mark.filterwarnings( + "ignore:Setting a value on a view:FutureWarning" +) + + +@pytest.mark.parametrize( + "cons", + [ + lambda x: DatetimeIndex(x), + lambda x: DatetimeIndex(DatetimeIndex(x)), + ], +) +def test_datetimeindex(using_copy_on_write, cons): + dt = date_range("2019-12-31", periods=3, freq="D") + ser = Series(dt) + idx = cons(ser) + expected = idx.copy(deep=True) + ser.iloc[0] = Timestamp("2020-12-31") + if using_copy_on_write: + tm.assert_index_equal(idx, expected) + + +def test_datetimeindex_tz_convert(using_copy_on_write): + dt = date_range("2019-12-31", periods=3, freq="D", tz="Europe/Berlin") + ser = Series(dt) + idx = DatetimeIndex(ser).tz_convert("US/Eastern") + expected = idx.copy(deep=True) + ser.iloc[0] = Timestamp("2020-12-31", tz="Europe/Berlin") + if using_copy_on_write: + tm.assert_index_equal(idx, expected) + + +def test_datetimeindex_tz_localize(using_copy_on_write): + dt = date_range("2019-12-31", periods=3, freq="D") + ser = Series(dt) + idx = DatetimeIndex(ser).tz_localize("Europe/Berlin") + expected = idx.copy(deep=True) + ser.iloc[0] = Timestamp("2020-12-31") + if using_copy_on_write: + tm.assert_index_equal(idx, expected) + + +def test_datetimeindex_isocalendar(using_copy_on_write): + dt = date_range("2019-12-31", periods=3, freq="D") + ser = Series(dt) + df = DatetimeIndex(ser).isocalendar() + expected = df.index.copy(deep=True) + ser.iloc[0] = Timestamp("2020-12-31") + if using_copy_on_write: + tm.assert_index_equal(df.index, expected) + + +def test_index_values(using_copy_on_write): + idx = date_range("2019-12-31", periods=3, freq="D") + result = idx.values + if using_copy_on_write: + assert result.flags.writeable is False + else: + assert result.flags.writeable is True diff --git a/shared/package-files/4a/4a5eb5814fa9e00852fd5bb87d49366a20210787ae39a7a8292b1bcedda17e8b/helpers.py b/shared/package-files/4a/4a5eb5814fa9e00852fd5bb87d49366a20210787ae39a7a8292b1bcedda17e8b/helpers.py new file mode 100644 index 0000000000000000000000000000000000000000..5d0b2861434f203f448cebcf90675080c23779a8 --- /dev/null +++ b/shared/package-files/4a/4a5eb5814fa9e00852fd5bb87d49366a20210787ae39a7a8292b1bcedda17e8b/helpers.py @@ -0,0 +1,858 @@ +# Copyright (C) 2012 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +"""Helpers for the tests.""" + +import json +import os +import re +import sys +from contextlib import contextmanager +from functools import lru_cache +from os.path import abspath, dirname, join +from pathlib import Path +from tempfile import gettempdir, mkdtemp +from unittest.mock import patch +from uuid import uuid4 + +import pytest + +from conda.auxlib.compat import shlex_split_unicode +from conda.deprecations import deprecated +from conda_env.cli import main as conda_env_cli + +from .. import cli +from ..base.context import conda_tests_ctxt_mgmt_def_pol, context, reset_context +from ..common.compat import encode_arguments +from ..common.io import argv +from ..common.io import captured as common_io_captured +from ..common.io import env_var +from ..core.prefix_data import PrefixData +from ..core.subdir_data import SubdirData, make_feature_record +from ..gateways.disk.delete import rm_rf +from ..gateways.disk.read import lexists +from ..gateways.logging import initialize_logging +from ..history import History +from ..models.channel import Channel +from ..models.records import PackageRecord, PrefixRecord +from ..resolve import Resolve + +# The default value will only work if we have installed conda in development mode! +TEST_DATA_DIR = os.environ.get( + "CONDA_TEST_DATA_DIR", abspath(join(dirname(__file__), "..", "..", "tests", "data")) +) +CHANNEL_DIR = abspath(join(TEST_DATA_DIR, "conda_format_repo")) +EXPORTED_CHANNELS_DIR = mkdtemp(suffix="-test-conda-channels") + + +expected_error_prefix = "Using Anaconda Cloud api site https://api.anaconda.org" + + +def strip_expected(stderr): + if expected_error_prefix and stderr.startswith(expected_error_prefix): + stderr = stderr[len(expected_error_prefix) :].lstrip() # noqa + return stderr + + +def raises(exception, func, string=None): + try: + a = func() + except exception as e: + if string: + assert string in e.args[0] + print(e) + return True + raise Exception("did not raise, gave %s" % a) + + +@contextmanager +def captured(disallow_stderr=True): + # same as common.io.captured but raises Exception if unexpected output was written to stderr + try: + with common_io_captured() as c: + yield c + finally: + c.stderr = strip_expected(c.stderr) + if disallow_stderr and c.stderr: + raise Exception("Got stderr output: %s" % c.stderr) + + +def capture_json_with_argv( + command, disallow_stderr=True, ignore_stderr=False, **kwargs +): + stdout, stderr, exit_code = run_inprocess_conda_command(command, disallow_stderr) + if kwargs.get("relaxed"): + match = re.match(r"\A.*?({.*})", stdout, re.DOTALL) + if match: + stdout = match.groups()[0] + elif stderr and not ignore_stderr: + # TODO should be exception + return stderr + try: + return json.loads(stdout.strip()) + except ValueError: + raise + + +@contextmanager +def set_active_prefix(prefix: str) -> None: + old_prefix = os.environ["CONDA_PREFIX"] + + try: + os.environ["CONDA_PREFIX"] = prefix + yield + finally: + os.environ["CONDA_PREFIX"] = old_prefix + + +def assert_equals(a, b, output=""): + output = f"{a.lower()!r} != {b.lower()!r}" + "\n\n" + output + assert a.lower() == b.lower(), output + + +def assert_not_in(a, b, output=""): + assert a.lower() not in b.lower(), "{} {!r} should not be found in {!r}".format( + output, + a.lower(), + b.lower(), + ) + + +def assert_in(a, b, output=""): + assert a.lower() in b.lower(), "{} {!r} cannot be found in {!r}".format( + output, a.lower(), b.lower() + ) + + +@deprecated("23.9", "24.3", addendum="Use `conda.testing.conda_cli` instead.") +def run_inprocess_conda_command(command, disallow_stderr: bool = True): + # anything that uses this function is an integration test + reset_context(()) + + # determine whether this is a conda_env command and assign appropriate main function + if command.startswith("conda env"): + command = command.replace("env", "") # Remove 'env' because of command parser + main_func = conda_env_cli.main + else: + main_func = cli.main + + # May want to do this to command: + with argv(encode_arguments(shlex_split_unicode(command))), captured( + disallow_stderr + ) as c: + initialize_logging() + try: + exit_code = main_func() + except SystemExit: + pass + print(c.stderr, file=sys.stderr) + print(c.stdout) + return c.stdout, c.stderr, exit_code + + +def add_subdir(dist_string): + channel_str, package_str = dist_string.split("::") + channel_str = channel_str + "/" + context.subdir + return "::".join([channel_str, package_str]) + + +def add_subdir_to_iter(iterable): + if isinstance(iterable, dict): + return {add_subdir(k): v for k, v in iterable.items()} + elif isinstance(iterable, list): + return list(map(add_subdir, iterable)) + elif isinstance(iterable, set): + return set(map(add_subdir, iterable)) + elif isinstance(iterable, tuple): + return tuple(map(add_subdir, iterable)) + else: + raise Exception("Unable to add subdir to object of unknown type.") + + +@contextmanager +def tempdir(): + tempdirdir = gettempdir() + dirname = str(uuid4())[:8] + prefix = join(tempdirdir, dirname) + try: + os.makedirs(prefix) + yield prefix + finally: + if lexists(prefix): + rm_rf(prefix) + + +def supplement_index_with_repodata(index, repodata, channel, priority): + repodata_info = repodata["info"] + arch = repodata_info.get("arch") + platform = repodata_info.get("platform") + subdir = repodata_info.get("subdir") + if not subdir: + subdir = "{}-{}".format(repodata_info["platform"], repodata_info["arch"]) + auth = channel.auth + for fn, info in repodata["packages"].items(): + rec = PackageRecord.from_objects( + info, + fn=fn, + arch=arch, + platform=platform, + channel=channel, + subdir=subdir, + # schannel=schannel, + priority=priority, + # url=join_url(channel_url, fn), + auth=auth, + ) + index[rec] = rec + + +def add_feature_records_legacy(index): + all_features = set() + for rec in index.values(): + if rec.track_features: + all_features.update(rec.track_features) + + for feature_name in all_features: + rec = make_feature_record(feature_name) + index[rec] = rec + + +def _export_subdir_data_to_repodata(subdir_data, index): + """ + This function is only temporary and meant to patch wrong / undesirable + testing behaviour. It should end up being replaced with the new class-based, + backend-agnostic solver tests. + """ + state = subdir_data._internal_state + packages = {} + for pkg in index: + data = pkg.dump() + if pkg.timestamp: + data["timestamp"] = pkg.timestamp + if "features" in data: + # Features are deprecated, so they are not implemented + # in modern solvers like mamba. Mamba does implement + # track_features minimization, so we are exposing the + # features as track_features, which seems to make the + # tests pass + data["track_features"] = data["features"] + del data["features"] + packages[pkg.fn] = data + return { + "_cache_control": state["_cache_control"], + "_etag": state["_etag"], + "_mod": state["_mod"], + "_url": state["_url"], + "_add_pip": state["_add_pip"], + "info": { + "subdir": context.subdir, + }, + "packages": packages, + } + + +def _sync_channel_to_disk(channel, subdir_data, index): + """ + This function is only temporary and meant to patch wrong / undesirable + testing behaviour. It should end up being replaced with the new class-based, + backend-agnostic solver tests. + """ + base = Path(EXPORTED_CHANNELS_DIR) / channel.name + subdir = base / channel.platform + subdir.mkdir(parents=True, exist_ok=True) + with open(subdir / "repodata.json", "w") as f: + json.dump(_export_subdir_data_to_repodata(subdir_data, index), f, indent=2) + f.flush() + os.fsync(f.fileno()) + + noarch = base / "noarch" + noarch.mkdir(parents=True, exist_ok=True) + with open(noarch / "repodata.json", "w") as f: + json.dump({}, f) + f.flush() + os.fsync(f.fileno()) + + +def _alias_canonical_channel_name_cache_to_file_prefixed(name, subdir_data=None): + """ + This function is only temporary and meant to patch wrong / undesirable + testing behaviour. It should end up being replaced with the new class-based, + backend-agnostic solver tests. + """ + # export repodata state to disk for other solvers to test + if subdir_data is None: + cache_key = Channel(name).url(with_credentials=True), "repodata.json" + subdir_data = SubdirData._cache_.get(cache_key) + if subdir_data: + local_proxy_channel = Channel(f"{EXPORTED_CHANNELS_DIR}/{name}") + SubdirData._cache_[ + (local_proxy_channel.url(with_credentials=True), "repodata.json") + ] = subdir_data + + +def _patch_for_local_exports(name, subdir_data, channel, index): + """ + This function is only temporary and meant to patch wrong / undesirable + testing behaviour. It should end up being replaced with the new class-based, + backend-agnostic solver tests. + """ + _alias_canonical_channel_name_cache_to_file_prefixed(name, subdir_data) + + # we need to override the modification time here so the + # cache hits this subdir_data object from the local copy too + # - without this, the legacy solver will use the local dump too + # and there's no need for that extra work + # (check conda.core.subdir_data.SubdirDataType.__call__ for + # details) + _sync_channel_to_disk(channel, subdir_data, index) + subdir_data._mtime = float("inf") + + +# this fixture appears to introduce a test-order dependency if cached +def get_index_r_1(subdir=context.subdir): + with open(join(TEST_DATA_DIR, "index.json")) as fi: + packages = json.load(fi) + repodata = { + "info": { + "subdir": subdir, + "arch": context.arch_name, + "platform": context.platform, + }, + "packages": packages, + } + + channel = Channel("https://conda.anaconda.org/channel-1/%s" % subdir) + sd = SubdirData(channel) + with env_var( + "CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY", + "false", + stack_callback=conda_tests_ctxt_mgmt_def_pol, + ): + sd._process_raw_repodata_str(json.dumps(repodata)) + sd._loaded = True + SubdirData._cache_[channel.url(with_credentials=True)] = sd + + index = {prec: prec for prec in sd.iter_records()} + add_feature_records_legacy(index) + r = Resolve(index, channels=(channel,)) + + _patch_for_local_exports("channel-1", sd, channel, index) + return index, r + + +@lru_cache(maxsize=None) +def get_index_r_2(subdir=context.subdir): + with open(join(TEST_DATA_DIR, "index2.json")) as fi: + packages = json.load(fi) + repodata = { + "info": { + "subdir": subdir, + "arch": context.arch_name, + "platform": context.platform, + }, + "packages": packages, + } + + channel = Channel("https://conda.anaconda.org/channel-2/%s" % subdir) + sd = SubdirData(channel) + with env_var( + "CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY", + "false", + stack_callback=conda_tests_ctxt_mgmt_def_pol, + ): + sd._process_raw_repodata_str(json.dumps(repodata)) + sd._loaded = True + SubdirData._cache_[channel.url(with_credentials=True)] = sd + + index = {prec: prec for prec in sd.iter_records()} + r = Resolve(index, channels=(channel,)) + + _patch_for_local_exports("channel-2", sd, channel, index) + return index, r + + +@lru_cache(maxsize=None) +def get_index_r_4(subdir=context.subdir): + with open(join(TEST_DATA_DIR, "index4.json")) as fi: + packages = json.load(fi) + repodata = { + "info": { + "subdir": subdir, + "arch": context.arch_name, + "platform": context.platform, + }, + "packages": packages, + } + + channel = Channel("https://conda.anaconda.org/channel-4/%s" % subdir) + sd = SubdirData(channel) + with env_var( + "CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY", + "false", + stack_callback=conda_tests_ctxt_mgmt_def_pol, + ): + sd._process_raw_repodata_str(json.dumps(repodata)) + sd._loaded = True + SubdirData._cache_[channel.url(with_credentials=True)] = sd + + index = {prec: prec for prec in sd.iter_records()} + r = Resolve(index, channels=(channel,)) + + _patch_for_local_exports("channel-4", sd, channel, index) + return index, r + + +@lru_cache(maxsize=None) +def get_index_r_5(subdir=context.subdir): + with open(join(TEST_DATA_DIR, "index5.json")) as fi: + packages = json.load(fi) + repodata = { + "info": { + "subdir": subdir, + "arch": context.arch_name, + "platform": context.platform, + }, + "packages": packages, + } + + channel = Channel("https://conda.anaconda.org/channel-5/%s" % subdir) + sd = SubdirData(channel) + with env_var( + "CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY", + "true", + stack_callback=conda_tests_ctxt_mgmt_def_pol, + ): + sd._process_raw_repodata_str(json.dumps(repodata)) + sd._loaded = True + SubdirData._cache_[channel.url(with_credentials=True)] = sd + + index = {prec: prec for prec in sd.iter_records()} + r = Resolve(index, channels=(channel,)) + + _patch_for_local_exports("channel-5", sd, channel, index) + return index, r + + +@lru_cache(maxsize=None) +def get_index_must_unfreeze(subdir=context.subdir): + repodata = { + "info": { + "subdir": subdir, + "arch": context.arch_name, + "platform": context.platform, + }, + "packages": { + "foobar-1.0-0.tar.bz2": { + "build": "0", + "build_number": 0, + "depends": ["libbar 2.0.*", "libfoo 1.0.*"], + "md5": "11ec1194bcc56b9a53c127142a272772", + "name": "foobar", + "timestamp": 1562861325613, + "version": "1.0", + }, + "foobar-2.0-0.tar.bz2": { + "build": "0", + "build_number": 0, + "depends": ["libbar 2.0.*", "libfoo 2.0.*"], + "md5": "f8eb5a7fa1ff6dead4e360631a6cd048", + "name": "foobar", + "version": "2.0", + }, + "libbar-1.0-0.tar.bz2": { + "build": "0", + "build_number": 0, + "depends": [], + "md5": "f51f4d48a541b7105b5e343704114f0f", + "name": "libbar", + "timestamp": 1562858881022, + "version": "1.0", + }, + "libbar-2.0-0.tar.bz2": { + "build": "0", + "build_number": 0, + "depends": [], + "md5": "27f4e717ed263f909074f64d9cbf935d", + "name": "libbar", + "timestamp": 1562858881748, + "version": "2.0", + }, + "libfoo-1.0-0.tar.bz2": { + "build": "0", + "build_number": 0, + "depends": [], + "md5": "ad7c088566ffe2389958daedf8ff312c", + "name": "libfoo", + "timestamp": 1562858763881, + "version": "1.0", + }, + "libfoo-2.0-0.tar.bz2": { + "build": "0", + "build_number": 0, + "depends": [], + "md5": "daf7af7086d8f22be49ae11bdc41f332", + "name": "libfoo", + "timestamp": 1562858836924, + "version": "2.0", + }, + "qux-1.0-0.tar.bz2": { + "build": "0", + "build_number": 0, + "depends": ["libbar 2.0.*", "libfoo 1.0.*"], + "md5": "18604cbe4f789fe853232eef4babd4f9", + "name": "qux", + "timestamp": 1562861393808, + "version": "1.0", + }, + "qux-2.0-0.tar.bz2": { + "build": "0", + "build_number": 0, + "depends": ["libbar 1.0.*", "libfoo 2.0.*"], + "md5": "892aa4b9ec64b67045a46866ef1ea488", + "name": "qux", + "timestamp": 1562861394828, + "version": "2.0", + }, + }, + } + channel = Channel("https://conda.anaconda.org/channel-freeze/%s" % subdir) + sd = SubdirData(channel) + with env_var( + "CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY", + "false", + stack_callback=conda_tests_ctxt_mgmt_def_pol, + ): + sd._process_raw_repodata_str(json.dumps(repodata)) + sd._loaded = True + SubdirData._cache_[channel.url(with_credentials=True)] = sd + + index = {prec: prec for prec in sd.iter_records()} + r = Resolve(index, channels=(channel,)) + + _patch_for_local_exports("channel-freeze", sd, channel, index) + return index, r + + +# Do not memoize this get_index to allow different CUDA versions to be detected +def get_index_cuda(subdir=context.subdir): + with open(join(TEST_DATA_DIR, "index.json")) as fi: + packages = json.load(fi) + repodata = { + "info": { + "subdir": subdir, + "arch": context.arch_name, + "platform": context.platform, + }, + "packages": packages, + } + + channel = Channel("https://conda.anaconda.org/channel-1/%s" % subdir) + sd = SubdirData(channel) + with env_var("CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY", "false", reset_context): + sd._process_raw_repodata_str(json.dumps(repodata)) + sd._loaded = True + SubdirData._cache_[channel.url(with_credentials=True)] = sd + + index = {prec: prec for prec in sd.iter_records()} + + add_feature_records_legacy(index) + r = Resolve(index, channels=(channel,)) + + _patch_for_local_exports("channel-1", sd, channel, index) + return index, r + + +def record( + name="a", + version="1.0", + depends=None, + build="0", + build_number=0, + timestamp=0, + channel=None, + **kwargs, +): + return PackageRecord( + name=name, + version=version, + depends=depends or [], + build=build, + build_number=build_number, + timestamp=timestamp, + channel=channel, + **kwargs, + ) + + +@contextmanager +def get_solver( + tmpdir, specs_to_add=(), specs_to_remove=(), prefix_records=(), history_specs=() +): + tmpdir = tmpdir.strpath + pd = PrefixData(tmpdir) + pd._PrefixData__prefix_records = { + rec.name: PrefixRecord.from_objects(rec) for rec in prefix_records + } + spec_map = {spec.name: spec for spec in history_specs} + get_index_r_1(context.subdir) + _alias_canonical_channel_name_cache_to_file_prefixed("channel-1") + with patch.object(History, "get_requested_specs_map", return_value=spec_map): + with env_var( + "CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY", + "false", + stack_callback=conda_tests_ctxt_mgmt_def_pol, + ): + # We need CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY=false here again (it's also in + # get_index_r_*) to cover solver logics that need to load from disk instead of + # hitting the SubdirData cache + solver = context.plugin_manager.get_cached_solver_backend()( + tmpdir, + (Channel(f"{EXPORTED_CHANNELS_DIR}/channel-1"),), + (context.subdir,), + specs_to_add=specs_to_add, + specs_to_remove=specs_to_remove, + ) + yield solver + + +@contextmanager +def get_solver_2( + tmpdir, specs_to_add=(), specs_to_remove=(), prefix_records=(), history_specs=() +): + tmpdir = tmpdir.strpath + pd = PrefixData(tmpdir) + pd._PrefixData__prefix_records = { + rec.name: PrefixRecord.from_objects(rec) for rec in prefix_records + } + spec_map = {spec.name: spec for spec in history_specs} + get_index_r_2(context.subdir) + _alias_canonical_channel_name_cache_to_file_prefixed("channel-2") + with patch.object(History, "get_requested_specs_map", return_value=spec_map): + with env_var( + "CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY", + "false", + stack_callback=conda_tests_ctxt_mgmt_def_pol, + ): + # We need CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY=false here again (it's also in + # get_index_r_*) to cover solver logics that need to load from disk instead of + # hitting the SubdirData cache + solver = context.plugin_manager.get_cached_solver_backend()( + tmpdir, + (Channel(f"{EXPORTED_CHANNELS_DIR}/channel-2"),), + (context.subdir,), + specs_to_add=specs_to_add, + specs_to_remove=specs_to_remove, + ) + yield solver + + +@contextmanager +def get_solver_4( + tmpdir, specs_to_add=(), specs_to_remove=(), prefix_records=(), history_specs=() +): + tmpdir = tmpdir.strpath + pd = PrefixData(tmpdir) + pd._PrefixData__prefix_records = { + rec.name: PrefixRecord.from_objects(rec) for rec in prefix_records + } + spec_map = {spec.name: spec for spec in history_specs} + get_index_r_4(context.subdir) + _alias_canonical_channel_name_cache_to_file_prefixed("channel-4") + with patch.object(History, "get_requested_specs_map", return_value=spec_map): + with env_var( + "CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY", + "false", + stack_callback=conda_tests_ctxt_mgmt_def_pol, + ): + # We need CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY=false here again (it's also in + # get_index_r_*) to cover solver logics that need to load from disk instead of + # hitting the SubdirData cache + solver = context.plugin_manager.get_cached_solver_backend()( + tmpdir, + (Channel(f"{EXPORTED_CHANNELS_DIR}/channel-4"),), + (context.subdir,), + specs_to_add=specs_to_add, + specs_to_remove=specs_to_remove, + ) + yield solver + + +@contextmanager +def get_solver_5( + tmpdir, specs_to_add=(), specs_to_remove=(), prefix_records=(), history_specs=() +): + tmpdir = tmpdir.strpath + pd = PrefixData(tmpdir) + pd._PrefixData__prefix_records = { + rec.name: PrefixRecord.from_objects(rec) for rec in prefix_records + } + spec_map = {spec.name: spec for spec in history_specs} + get_index_r_5(context.subdir) + _alias_canonical_channel_name_cache_to_file_prefixed("channel-5") + with patch.object(History, "get_requested_specs_map", return_value=spec_map): + with env_var( + "CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY", + "false", + stack_callback=conda_tests_ctxt_mgmt_def_pol, + ): + # We need CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY=false here again (it's also in + # get_index_r_*) to cover solver logics that need to load from disk instead of + # hitting the SubdirData cache + solver = context.plugin_manager.get_cached_solver_backend()( + tmpdir, + (Channel(f"{EXPORTED_CHANNELS_DIR}/channel-5"),), + (context.subdir,), + specs_to_add=specs_to_add, + specs_to_remove=specs_to_remove, + ) + yield solver + + +@contextmanager +def get_solver_aggregate_1( + tmpdir, specs_to_add=(), specs_to_remove=(), prefix_records=(), history_specs=() +): + tmpdir = tmpdir.strpath + pd = PrefixData(tmpdir) + pd._PrefixData__prefix_records = { + rec.name: PrefixRecord.from_objects(rec) for rec in prefix_records + } + spec_map = {spec.name: spec for spec in history_specs} + get_index_r_2(context.subdir) + get_index_r_4(context.subdir) + _alias_canonical_channel_name_cache_to_file_prefixed("channel-2") + _alias_canonical_channel_name_cache_to_file_prefixed("channel-4") + with patch.object(History, "get_requested_specs_map", return_value=spec_map): + with env_var( + "CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY", + "false", + stack_callback=conda_tests_ctxt_mgmt_def_pol, + ): + # We need CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY=false here again (it's also in + # get_index_r_*) to cover solver logics that need to load from disk instead of + # hitting the SubdirData cache + solver = context.plugin_manager.get_cached_solver_backend()( + tmpdir, + ( + Channel(f"{EXPORTED_CHANNELS_DIR}/channel-2"), + Channel(f"{EXPORTED_CHANNELS_DIR}/channel-4"), + ), + (context.subdir,), + specs_to_add=specs_to_add, + specs_to_remove=specs_to_remove, + ) + yield solver + + +@contextmanager +def get_solver_aggregate_2( + tmpdir, specs_to_add=(), specs_to_remove=(), prefix_records=(), history_specs=() +): + tmpdir = tmpdir.strpath + pd = PrefixData(tmpdir) + pd._PrefixData__prefix_records = { + rec.name: PrefixRecord.from_objects(rec) for rec in prefix_records + } + spec_map = {spec.name: spec for spec in history_specs} + get_index_r_2(context.subdir) + get_index_r_4(context.subdir) + _alias_canonical_channel_name_cache_to_file_prefixed("channel-4") + _alias_canonical_channel_name_cache_to_file_prefixed("channel-2") + with patch.object(History, "get_requested_specs_map", return_value=spec_map): + with env_var( + "CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY", + "false", + stack_callback=conda_tests_ctxt_mgmt_def_pol, + ): + # We need CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY=false here again (it's also in + # get_index_r_*) to cover solver logics that need to load from disk instead of + # hitting the SubdirData cache + solver = context.plugin_manager.get_cached_solver_backend()( + tmpdir, + ( + Channel(f"{EXPORTED_CHANNELS_DIR}/channel-4"), + Channel(f"{EXPORTED_CHANNELS_DIR}/channel-2"), + ), + (context.subdir,), + specs_to_add=specs_to_add, + specs_to_remove=specs_to_remove, + ) + yield solver + + +@contextmanager +def get_solver_must_unfreeze( + tmpdir, specs_to_add=(), specs_to_remove=(), prefix_records=(), history_specs=() +): + tmpdir = tmpdir.strpath + pd = PrefixData(tmpdir) + pd._PrefixData__prefix_records = { + rec.name: PrefixRecord.from_objects(rec) for rec in prefix_records + } + spec_map = {spec.name: spec for spec in history_specs} + get_index_must_unfreeze(context.subdir) + _alias_canonical_channel_name_cache_to_file_prefixed("channel-freeze") + with patch.object(History, "get_requested_specs_map", return_value=spec_map): + with env_var( + "CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY", + "false", + stack_callback=conda_tests_ctxt_mgmt_def_pol, + ): + # We need CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY=false here again (it's also in + # get_index_r_*) to cover solver logics that need to load from disk instead of + # hitting the SubdirData cache + solver = context.plugin_manager.get_cached_solver_backend()( + tmpdir, + (Channel(f"{EXPORTED_CHANNELS_DIR}/channel-freeze"),), + (context.subdir,), + specs_to_add=specs_to_add, + specs_to_remove=specs_to_remove, + ) + yield solver + + +@contextmanager +def get_solver_cuda( + tmpdir, specs_to_add=(), specs_to_remove=(), prefix_records=(), history_specs=() +): + tmpdir = tmpdir.strpath + pd = PrefixData(tmpdir) + pd._PrefixData__prefix_records = { + rec.name: PrefixRecord.from_objects(rec) for rec in prefix_records + } + spec_map = {spec.name: spec for spec in history_specs} + get_index_cuda(context.subdir) + _alias_canonical_channel_name_cache_to_file_prefixed("channel-1") + with patch.object(History, "get_requested_specs_map", return_value=spec_map): + with env_var( + "CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY", + "false", + stack_callback=conda_tests_ctxt_mgmt_def_pol, + ): + # We need CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY=false here again (it's also in + # get_index_r_*) to cover solver logics that need to load from disk instead of + # hitting the SubdirData cache + solver = context.plugin_manager.get_cached_solver_backend()( + tmpdir, + (Channel(f"{EXPORTED_CHANNELS_DIR}/channel-1"),), + (context.subdir,), + specs_to_add=specs_to_add, + specs_to_remove=specs_to_remove, + ) + yield solver + + +def convert_to_dist_str(solution): + dist_str = [] + for prec in solution: + # This is needed to remove the local path prefix in the + # dist_str() calls, otherwise we cannot compare them + canonical_name = prec.channel._Channel__canonical_name + prec.channel._Channel__canonical_name = prec.channel.name + dist_str.append(prec.dist_str()) + prec.channel._Channel__canonical_name = canonical_name + return tuple(dist_str) + + +@pytest.fixture() +def solver_class(): + return context.plugin_manager.get_cached_solver_backend() diff --git a/shared/package-files/4a/4a60d57b83fd153ff41b173bc690ca416ab22d2d35c985c53bc8b7c2d98d24db/logging.py b/shared/package-files/4a/4a60d57b83fd153ff41b173bc690ca416ab22d2d35c985c53bc8b7c2d98d24db/logging.py new file mode 100644 index 0000000000000000000000000000000000000000..c43bdf70131e55955705811fa2c8467d649a1fcd --- /dev/null +++ b/shared/package-files/4a/4a60d57b83fd153ff41b173bc690ca416ab22d2d35c985c53bc8b7c2d98d24db/logging.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python3 + +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + +import inspect +import logging +import os +import warnings +from typing import Optional + + +def get_logger(name: Optional[str] = None): + """ + Util function to set up a simple logger that writes + into stderr. The loglevel is fetched from the LOGLEVEL + env. variable or INFO as default. The function will use the + module name of the caller if no name is provided. + + Args: + name: Name of the logger. If no name provided, the name will + be derived from the call stack. + """ + + # Derive the name of the caller, if none provided + # Use depth=2 since this function takes up one level in the call stack + return _setup_logger(name or _derive_module_name(depth=2)) + + +def _setup_logger(name: Optional[str] = None): + log = logging.getLogger(name) + log.setLevel(os.environ.get("LOGLEVEL", "INFO")) + return log + + +def _derive_module_name(depth: int = 1) -> Optional[str]: + """ + Derives the name of the caller module from the stack frames. + + Args: + depth: The position of the frame in the stack. + """ + try: + stack = inspect.stack() + assert depth < len(stack) + # FrameInfo is just a named tuple: (frame, filename, lineno, function, code_context, index) + frame_info = stack[depth] + filename = frame_info[1] + + module = inspect.getmodule(frame_info[0]) + if module: + module_name = module.__name__ + else: + # inspect.getmodule(frame_info[0]) does NOT work (returns None) in + # binaries built with @mode/opt + # return the filename (minus the .py extension) as modulename + module_name = os.path.splitext(os.path.basename(filename))[0] + return module_name + except Exception as e: + warnings.warn( + f"Error deriving logger module name, using . Exception: {e}", + RuntimeWarning, + ) + return None diff --git a/shared/package-files/4a/4a61d2df57b2614ed5519955b8feb5dc72a0a5dedb10d9d0180a6f5ff8362dfc/_fs.pxd b/shared/package-files/4a/4a61d2df57b2614ed5519955b8feb5dc72a0a5dedb10d9d0180a6f5ff8362dfc/_fs.pxd new file mode 100644 index 0000000000000000000000000000000000000000..0df75530bbd6ec3552131e11acc5b0406627fe65 --- /dev/null +++ b/shared/package-files/4a/4a61d2df57b2614ed5519955b8feb5dc72a0a5dedb10d9d0180a6f5ff8362dfc/_fs.pxd @@ -0,0 +1,91 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# cython: language_level = 3 + +from pyarrow.includes.common cimport * +from pyarrow.includes.libarrow_fs cimport * +from pyarrow.lib import _detect_compression, frombytes, tobytes +from pyarrow.lib cimport * + + +cpdef enum FileType: + NotFound = CFileType_NotFound + Unknown = CFileType_Unknown + File = CFileType_File + Directory = CFileType_Directory + + +cdef class FileInfo(_Weakrefable): + cdef: + CFileInfo info + + @staticmethod + cdef wrap(CFileInfo info) + + cdef inline CFileInfo unwrap(self) nogil + + @staticmethod + cdef CFileInfo unwrap_safe(obj) + + +cdef class FileSelector(_Weakrefable): + cdef: + CFileSelector selector + + @staticmethod + cdef FileSelector wrap(CFileSelector selector) + + cdef inline CFileSelector unwrap(self) nogil + + +cdef class FileSystem(_Weakrefable): + cdef: + shared_ptr[CFileSystem] wrapped + CFileSystem* fs + + cdef init(self, const shared_ptr[CFileSystem]& wrapped) + + @staticmethod + cdef wrap(const shared_ptr[CFileSystem]& sp) + + cdef inline shared_ptr[CFileSystem] unwrap(self) nogil + + +cdef class LocalFileSystem(FileSystem): + cdef init(self, const shared_ptr[CFileSystem]& wrapped) + + +cdef class SubTreeFileSystem(FileSystem): + cdef: + CSubTreeFileSystem* subtreefs + + cdef init(self, const shared_ptr[CFileSystem]& wrapped) + + +cdef class _MockFileSystem(FileSystem): + cdef: + CMockFileSystem* mockfs + + cdef init(self, const shared_ptr[CFileSystem]& wrapped) + + +cdef class PyFileSystem(FileSystem): + cdef: + CPyFileSystem* pyfs + + cdef init(self, const shared_ptr[CFileSystem]& wrapped) diff --git a/shared/package-files/4a/4a622bd0e58280c511de3f678156e3309856394ad4d798d07ff8f3dab530eebe/concurrency.h b/shared/package-files/4a/4a622bd0e58280c511de3f678156e3309856394ad4d798d07ff8f3dab530eebe/concurrency.h new file mode 100644 index 0000000000000000000000000000000000000000..35c2aac6a7e155dd6ef8be35bfbbc7cc8edd4f2f --- /dev/null +++ b/shared/package-files/4a/4a622bd0e58280c511de3f678156e3309856394ad4d798d07ff8f3dab530eebe/concurrency.h @@ -0,0 +1,263 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include + +#include "arrow/io/interfaces.h" +#include "arrow/result.h" +#include "arrow/status.h" +#include "arrow/util/checked_cast.h" +#include "arrow/util/macros.h" +#include "arrow/util/visibility.h" + +namespace arrow { +namespace io { +namespace internal { + +template +class SharedLockGuard { + public: + explicit SharedLockGuard(LockType* lock) : lock_(lock) { lock_->LockShared(); } + + ~SharedLockGuard() { lock_->UnlockShared(); } + + protected: + LockType* lock_; +}; + +template +class ExclusiveLockGuard { + public: + explicit ExclusiveLockGuard(LockType* lock) : lock_(lock) { lock_->LockExclusive(); } + + ~ExclusiveLockGuard() { lock_->UnlockExclusive(); } + + protected: + LockType* lock_; +}; + +// Debug concurrency checker that marks "shared" and "exclusive" code sections, +// aborting if the concurrency rules get violated. Does nothing in release mode. +// Note that we intentionally use the same class declaration in debug and +// release builds in order to avoid runtime failures when e.g. loading a +// release-built DLL with a debug-built application, or the reverse. + +class ARROW_EXPORT SharedExclusiveChecker { + public: + SharedExclusiveChecker(); + void LockShared(); + void UnlockShared(); + void LockExclusive(); + void UnlockExclusive(); + + SharedLockGuard shared_guard() { + return SharedLockGuard(this); + } + + ExclusiveLockGuard exclusive_guard() { + return ExclusiveLockGuard(this); + } + + protected: + struct Impl; + std::shared_ptr impl_; +}; + +// Concurrency wrappers for IO classes that check the correctness of +// concurrent calls to various methods. It is not necessary to wrap all +// IO classes with these, only a few core classes that get used in tests. +// +// We're not using virtual inheritance here as virtual bases have poorly +// understood semantic overhead which we'd be passing on to implementers +// and users of these interfaces. Instead, we just duplicate the method +// wrappers between those two classes. + +template +class InputStreamConcurrencyWrapper : public InputStream { + public: + Status Close() final { + auto guard = lock_.exclusive_guard(); + return derived()->DoClose(); + } + + Status Abort() final { + auto guard = lock_.exclusive_guard(); + return derived()->DoAbort(); + } + + Result Tell() const final { + auto guard = lock_.exclusive_guard(); + return derived()->DoTell(); + } + + Result Read(int64_t nbytes, void* out) final { + auto guard = lock_.exclusive_guard(); + return derived()->DoRead(nbytes, out); + } + + Result> Read(int64_t nbytes) final { + auto guard = lock_.exclusive_guard(); + return derived()->DoRead(nbytes); + } + + Result Peek(int64_t nbytes) final { + auto guard = lock_.exclusive_guard(); + return derived()->DoPeek(nbytes); + } + + /* + Methods to implement in derived class: + + Status DoClose(); + Result DoTell() const; + Result DoRead(int64_t nbytes, void* out); + Result> DoRead(int64_t nbytes); + + And optionally: + + Status DoAbort() override; + Result DoPeek(int64_t nbytes) override; + + These methods should be protected in the derived class and + InputStreamConcurrencyWrapper declared as a friend with + + friend InputStreamConcurrencyWrapper; + */ + + protected: + // Default implementations. They are virtual because the derived class may + // have derived classes itself. + virtual Status DoAbort() { return derived()->DoClose(); } + + virtual Result DoPeek(int64_t ARROW_ARG_UNUSED(nbytes)) { + return Status::NotImplemented("Peek not implemented"); + } + + Derived* derived() { return ::arrow::internal::checked_cast(this); } + + const Derived* derived() const { + return ::arrow::internal::checked_cast(this); + } + + mutable SharedExclusiveChecker lock_; +}; + +template +class RandomAccessFileConcurrencyWrapper : public RandomAccessFile { + public: + Status Close() final { + auto guard = lock_.exclusive_guard(); + return derived()->DoClose(); + } + + Status Abort() final { + auto guard = lock_.exclusive_guard(); + return derived()->DoAbort(); + } + + Result Tell() const final { + auto guard = lock_.exclusive_guard(); + return derived()->DoTell(); + } + + Result Read(int64_t nbytes, void* out) final { + auto guard = lock_.exclusive_guard(); + return derived()->DoRead(nbytes, out); + } + + Result> Read(int64_t nbytes) final { + auto guard = lock_.exclusive_guard(); + return derived()->DoRead(nbytes); + } + + Result Peek(int64_t nbytes) final { + auto guard = lock_.exclusive_guard(); + return derived()->DoPeek(nbytes); + } + + Status Seek(int64_t position) final { + auto guard = lock_.exclusive_guard(); + return derived()->DoSeek(position); + } + + Result GetSize() final { + auto guard = lock_.shared_guard(); + return derived()->DoGetSize(); + } + + // NOTE: ReadAt doesn't use stream pointer, but it is allowed to update it + // (it's the case on Windows when using ReadFileEx). + // So any method that relies on the current position (even if it doesn't + // update it, such as Peek) cannot run in parallel with ReadAt and has + // to use the exclusive_guard. + + Result ReadAt(int64_t position, int64_t nbytes, void* out) final { + auto guard = lock_.shared_guard(); + return derived()->DoReadAt(position, nbytes, out); + } + + Result> ReadAt(int64_t position, int64_t nbytes) final { + auto guard = lock_.shared_guard(); + return derived()->DoReadAt(position, nbytes); + } + + /* + Methods to implement in derived class: + + Status DoClose(); + Result DoTell() const; + Result DoRead(int64_t nbytes, void* out); + Result> DoRead(int64_t nbytes); + Status DoSeek(int64_t position); + Result DoGetSize() + Result DoReadAt(int64_t position, int64_t nbytes, void* out); + Result> DoReadAt(int64_t position, int64_t nbytes); + + And optionally: + + Status DoAbort() override; + Result DoPeek(int64_t nbytes) override; + + These methods should be protected in the derived class and + RandomAccessFileConcurrencyWrapper declared as a friend with + + friend RandomAccessFileConcurrencyWrapper; + */ + + protected: + // Default implementations. They are virtual because the derived class may + // have derived classes itself. + virtual Status DoAbort() { return derived()->DoClose(); } + + virtual Result DoPeek(int64_t ARROW_ARG_UNUSED(nbytes)) { + return Status::NotImplemented("Peek not implemented"); + } + + Derived* derived() { return ::arrow::internal::checked_cast(this); } + + const Derived* derived() const { + return ::arrow::internal::checked_cast(this); + } + + mutable SharedExclusiveChecker lock_; +}; + +} // namespace internal +} // namespace io +} // namespace arrow diff --git a/shared/package-files/4a/4a62593d7ac5fa5217a718ae5454cd7cb62bada4cb2a57d625ff6c49bb8be724/cudnn_grid_sampler_backward_native.h b/shared/package-files/4a/4a62593d7ac5fa5217a718ae5454cd7cb62bada4cb2a57d625ff6c49bb8be724/cudnn_grid_sampler_backward_native.h new file mode 100644 index 0000000000000000000000000000000000000000..468b3b495b6eff709e5c6e439491a355a3acbf67 --- /dev/null +++ b/shared/package-files/4a/4a62593d7ac5fa5217a718ae5454cd7cb62bada4cb2a57d625ff6c49bb8be724/cudnn_grid_sampler_backward_native.h @@ -0,0 +1,22 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API ::std::tuple cudnn_grid_sampler_backward_out(const at::Tensor & self, const at::Tensor & grid, const at::Tensor & grad_output, at::Tensor & out0, at::Tensor & out1); +TORCH_API ::std::tuple cudnn_grid_sampler_backward(const at::Tensor & self, const at::Tensor & grid, const at::Tensor & grad_output); +} // namespace native +} // namespace at diff --git a/shared/package-files/4a/4a6461cfb27f9b04f4a2986c559c5681f9bd7d8991affe1c45a5e9449662c42e/test_short_time_fft.py b/shared/package-files/4a/4a6461cfb27f9b04f4a2986c559c5681f9bd7d8991affe1c45a5e9449662c42e/test_short_time_fft.py new file mode 100644 index 0000000000000000000000000000000000000000..df1ccc639f2041cfc8a6aec50190b34f72d25c84 --- /dev/null +++ b/shared/package-files/4a/4a6461cfb27f9b04f4a2986c559c5681f9bd7d8991affe1c45a5e9449662c42e/test_short_time_fft.py @@ -0,0 +1,880 @@ +"""Unit tests for module `_short_time_fft`. + +This file's structure loosely groups the tests into the following sequential +categories: + +1. Test function `_calc_dual_canonical_window`. +2. Test for invalid parameters and exceptions in `ShortTimeFFT` (until the + `test_from_window` function). +3. Test algorithmic properties of STFT/ISTFT. Some tests were ported from + ``test_spectral.py``. + +Notes +----- +* Mypy 0.990 does interpret the line:: + + from scipy.stats import norm as normal_distribution + + incorrectly (but the code works), hence a ``type: ignore`` was appended. +""" +import math +from itertools import product +from typing import cast, get_args, Literal + +import numpy as np +import pytest +from scipy._lib._array_api import xp_assert_close, xp_assert_equal +from scipy.fft import fftshift +from scipy.stats import norm as normal_distribution # type: ignore +from scipy.signal import get_window, welch, stft, istft, spectrogram + +from scipy.signal._short_time_fft import FFT_MODE_TYPE, \ + _calc_dual_canonical_window, ShortTimeFFT, PAD_TYPE +from scipy.signal.windows import gaussian + + +def test__calc_dual_canonical_window_roundtrip(): + """Test dual window calculation with a round trip to verify duality. + + Note that this works only for canonical window pairs (having minimal + energy) like a Gaussian. + + The window is the same as in the example of `from ShortTimeFFT.from_dual`. + """ + win = gaussian(51, std=10, sym=True) + d_win = _calc_dual_canonical_window(win, 10) + win2 = _calc_dual_canonical_window(d_win, 10) + xp_assert_close(win2, win) + + +def test__calc_dual_canonical_window_exceptions(): + """Raise all exceptions in `_calc_dual_canonical_window`.""" + # Verify that calculation can fail: + with pytest.raises(ValueError, match="hop=5 is larger than window len.*"): + _calc_dual_canonical_window(np.ones(4), 5) + with pytest.raises(ValueError, match=".* Transform not invertible!"): + _calc_dual_canonical_window(np.array([.1, .2, .3, 0]), 4) + + # Verify that parameter `win` may not be integers: + with pytest.raises(ValueError, match="Parameter 'win' cannot be of int.*"): + _calc_dual_canonical_window(np.ones(4, dtype=int), 1) + + +def test_invalid_initializer_parameters(): + """Verify that exceptions get raised on invalid parameters when + instantiating ShortTimeFFT. """ + with pytest.raises(ValueError, match=r"Parameter win must be 1d, " + + r"but win.shape=\(2, 2\)!"): + ShortTimeFFT(np.ones((2, 2)), hop=4, fs=1) + with pytest.raises(ValueError, match="Parameter win must have " + + "finite entries"): + ShortTimeFFT(np.array([1, np.inf, 2, 3]), hop=4, fs=1) + with pytest.raises(ValueError, match="Parameter hop=0 is not " + + "an integer >= 1!"): + ShortTimeFFT(np.ones(4), hop=0, fs=1) + with pytest.raises(ValueError, match="Parameter hop=2.0 is not " + + "an integer >= 1!"): + # noinspection PyTypeChecker + ShortTimeFFT(np.ones(4), hop=2.0, fs=1) + with pytest.raises(ValueError, match=r"dual_win.shape=\(5,\) must equal " + + r"win.shape=\(4,\)!"): + ShortTimeFFT(np.ones(4), hop=2, fs=1, dual_win=np.ones(5)) + with pytest.raises(ValueError, match="Parameter dual_win must be " + + "a finite array!"): + ShortTimeFFT(np.ones(3), hop=2, fs=1, + dual_win=np.array([np.nan, 2, 3])) + + +def test_exceptions_properties_methods(): + """Verify that exceptions get raised when setting properties or calling + method of ShortTimeFFT to/with invalid values.""" + SFT = ShortTimeFFT(np.ones(8), hop=4, fs=1) + with pytest.raises(ValueError, match="Sampling interval T=-1 must be " + + "positive!"): + SFT.T = -1 + with pytest.raises(ValueError, match="Sampling frequency fs=-1 must be " + + "positive!"): + SFT.fs = -1 + with pytest.raises(ValueError, match="fft_mode='invalid_typ' not in " + + r"\('twosided', 'centered', " + + r"'onesided', 'onesided2X'\)!"): + SFT.fft_mode = 'invalid_typ' + with pytest.raises(ValueError, match="For scaling is None, " + + "fft_mode='onesided2X' is invalid.*"): + SFT.fft_mode = 'onesided2X' + with pytest.raises(ValueError, match="Attribute mfft=7 needs to be " + + "at least the window length.*"): + SFT.mfft = 7 + with pytest.raises(ValueError, match="scaling='invalid' not in.*"): + # noinspection PyTypeChecker + SFT.scale_to('invalid') + with pytest.raises(ValueError, match="phase_shift=3.0 has the unit .*"): + SFT.phase_shift = 3.0 + with pytest.raises(ValueError, match="-mfft < phase_shift < mfft " + + "does not hold.*"): + SFT.phase_shift = 2*SFT.mfft + with pytest.raises(ValueError, match="Parameter padding='invalid' not.*"): + # noinspection PyTypeChecker + g = SFT._x_slices(np.zeros(16), k_off=0, p0=0, p1=1, padding='invalid') + next(g) # execute generator + with pytest.raises(ValueError, match="Trend type must be 'linear' " + + "or 'constant'"): + # noinspection PyTypeChecker + SFT.stft_detrend(np.zeros(16), detr='invalid') + with pytest.raises(ValueError, match="Parameter detr=nan is not a str, " + + "function or None!"): + # noinspection PyTypeChecker + SFT.stft_detrend(np.zeros(16), detr=np.nan) + with pytest.raises(ValueError, match="Invalid Parameter p0=0, p1=200.*"): + SFT.p_range(100, 0, 200) + + with pytest.raises(ValueError, match="f_axis=0 may not be equal to " + + "t_axis=0!"): + SFT.istft(np.zeros((SFT.f_pts, 2)), t_axis=0, f_axis=0) + with pytest.raises(ValueError, match=r"S.shape\[f_axis\]=2 must be equal" + + " to self.f_pts=5.*"): + SFT.istft(np.zeros((2, 2))) + with pytest.raises(ValueError, match=r"S.shape\[t_axis\]=1 needs to have" + + " at least 2 slices.*"): + SFT.istft(np.zeros((SFT.f_pts, 1))) + with pytest.raises(ValueError, match=r".*\(k1=100\) <= \(k_max=12\) " + + "is false!$"): + SFT.istft(np.zeros((SFT.f_pts, 3)), k1=100) + with pytest.raises(ValueError, match=r"\(k1=1\) - \(k0=0\) = 1 has to " + + "be at least.* length 4!"): + SFT.istft(np.zeros((SFT.f_pts, 3)), k0=0, k1=1) + + with pytest.raises(ValueError, match=r"Parameter axes_seq='invalid' " + + r"not in \['tf', 'ft'\]!"): + # noinspection PyTypeChecker + SFT.extent(n=100, axes_seq='invalid') + with pytest.raises(ValueError, match="Attribute fft_mode=twosided must.*"): + SFT.fft_mode = 'twosided' + SFT.extent(n=100) + + +@pytest.mark.parametrize('m', ('onesided', 'onesided2X')) +def test_exceptions_fft_mode_complex_win(m: FFT_MODE_TYPE): + """Verify that one-sided spectra are not allowed with complex-valued + windows or with complex-valued signals. + + The reason being, the `rfft` function only accepts real-valued input. + """ + with pytest.raises(ValueError, + match=f"One-sided spectra, i.e., fft_mode='{m}'.*"): + ShortTimeFFT(np.ones(8)*1j, hop=4, fs=1, fft_mode=m) + + SFT = ShortTimeFFT(np.ones(8)*1j, hop=4, fs=1, fft_mode='twosided') + with pytest.raises(ValueError, + match=f"One-sided spectra, i.e., fft_mode='{m}'.*"): + SFT.fft_mode = m + + SFT = ShortTimeFFT(np.ones(8), hop=4, fs=1, scale_to='psd', fft_mode='onesided') + with pytest.raises(ValueError, match="Complex-valued `x` not allowed for self.*"): + SFT.stft(np.ones(8)*1j) + SFT.fft_mode = 'onesided2X' + with pytest.raises(ValueError, match="Complex-valued `x` not allowed for self.*"): + SFT.stft(np.ones(8)*1j) + + +def test_invalid_fft_mode_RuntimeError(): + """Ensure exception gets raised when property `fft_mode` is invalid. """ + SFT = ShortTimeFFT(np.ones(8), hop=4, fs=1) + SFT._fft_mode = 'invalid_typ' + + with pytest.raises(RuntimeError): + _ = SFT.f + with pytest.raises(RuntimeError): + SFT._fft_func(np.ones(8)) + with pytest.raises(RuntimeError): + SFT._ifft_func(np.ones(8)) + + +@pytest.mark.parametrize('win_params, Nx', [(('gaussian', 2.), 9), # in docstr + ('triang', 7), + (('kaiser', 4.0), 9), + (('exponential', None, 1.), 9), + (4.0, 9)]) +def test_from_window(win_params, Nx: int): + """Verify that `from_window()` handles parameters correctly. + + The window parameterizations are documented in the `get_window` docstring. + """ + w_sym, fs = get_window(win_params, Nx, fftbins=False), 16. + w_per = get_window(win_params, Nx, fftbins=True) + SFT0 = ShortTimeFFT(w_sym, hop=3, fs=fs, fft_mode='twosided', + scale_to='psd', phase_shift=1) + nperseg = len(w_sym) + noverlap = nperseg - SFT0.hop + SFT1 = ShortTimeFFT.from_window(win_params, fs, nperseg, noverlap, + symmetric_win=True, fft_mode='twosided', + scale_to='psd', phase_shift=1) + # periodic window: + SFT2 = ShortTimeFFT.from_window(win_params, fs, nperseg, noverlap, + symmetric_win=False, fft_mode='twosided', + scale_to='psd', phase_shift=1) + # Be informative when comparing instances: + xp_assert_equal(SFT1.win, SFT0.win) + xp_assert_close(SFT2.win, w_per / np.sqrt(sum(w_per**2) * fs)) + for n_ in ('hop', 'T', 'fft_mode', 'mfft', 'scaling', 'phase_shift'): + v0, v1, v2 = (getattr(SFT_, n_) for SFT_ in (SFT0, SFT1, SFT2)) + assert v1 == v0, f"SFT1.{n_}={v1} does not equal SFT0.{n_}={v0}" + assert v2 == v0, f"SFT2.{n_}={v2} does not equal SFT0.{n_}={v0}" + + +def test_dual_win_roundtrip(): + """Verify the duality of `win` and `dual_win`. + + Note that this test does not work for arbitrary windows, since dual windows + are not unique. It always works for invertible STFTs if the windows do not + overlap. + """ + # Non-standard values for keyword arguments (except for `scale_to`): + kw = dict(hop=4, fs=1, fft_mode='twosided', mfft=8, scale_to=None, + phase_shift=2) + SFT0 = ShortTimeFFT(np.ones(4), **kw) + SFT1 = ShortTimeFFT.from_dual(SFT0.dual_win, **kw) + xp_assert_close(SFT1.dual_win, SFT0.win) + + +@pytest.mark.parametrize('scale_to, fac_psd, fac_mag', + [(None, 0.25, 0.125), + ('magnitude', 2.0, 1), + ('psd', 1, 0.5)]) +def test_scaling(scale_to: Literal['magnitude', 'psd'], fac_psd, fac_mag): + """Verify scaling calculations. + + * Verify passing `scale_to`parameter to ``__init__(). + * Roundtrip while changing scaling factor. + """ + SFT = ShortTimeFFT(np.ones(4) * 2, hop=4, fs=1, scale_to=scale_to) + assert SFT.fac_psd == fac_psd + assert SFT.fac_magnitude == fac_mag + # increase coverage by accessing properties twice: + assert SFT.fac_psd == fac_psd + assert SFT.fac_magnitude == fac_mag + + x = np.fft.irfft([0, 0, 7, 0, 0, 0, 0]) # periodic signal + Sx = SFT.stft(x) + Sx_mag, Sx_psd = Sx * SFT.fac_magnitude, Sx * SFT.fac_psd + + SFT.scale_to('magnitude') + x_mag = SFT.istft(Sx_mag, k1=len(x)) + xp_assert_close(x_mag, x) + + SFT.scale_to('psd') + x_psd = SFT.istft(Sx_psd, k1=len(x)) + xp_assert_close(x_psd, x) + + +def test_scale_to(): + """Verify `scale_to()` method.""" + SFT = ShortTimeFFT(np.ones(4) * 2, hop=4, fs=1, scale_to=None) + + SFT.scale_to('magnitude') + assert SFT.scaling == 'magnitude' + assert SFT.fac_psd == 2.0 + assert SFT.fac_magnitude == 1 + + SFT.scale_to('psd') + assert SFT.scaling == 'psd' + assert SFT.fac_psd == 1 + assert SFT.fac_magnitude == 0.5 + + SFT.scale_to('psd') # needed for coverage + + for scale, s_fac in zip(('magnitude', 'psd'), (8, 4)): + SFT = ShortTimeFFT(np.ones(4) * 2, hop=4, fs=1, scale_to=None) + dual_win = SFT.dual_win.copy() + + SFT.scale_to(cast(Literal['magnitude', 'psd'], scale)) + xp_assert_close(SFT.dual_win, dual_win * s_fac) + + +def test_x_slices_padding(): + """Verify padding. + + The reference arrays were taken from the docstrings of `zero_ext`, + `const_ext`, `odd_ext()`, and `even_ext()` from the _array_tools module. + """ + SFT = ShortTimeFFT(np.ones(5), hop=4, fs=1) + x = np.array([[1, 2, 3, 4, 5], [0, 1, 4, 9, 16]], dtype=float) + d = {'zeros': [[[0, 0, 1, 2, 3], [0, 0, 0, 1, 4]], + [[3, 4, 5, 0, 0], [4, 9, 16, 0, 0]]], + 'edge': [[[1, 1, 1, 2, 3], [0, 0, 0, 1, 4]], + [[3, 4, 5, 5, 5], [4, 9, 16, 16, 16]]], + 'even': [[[3, 2, 1, 2, 3], [4, 1, 0, 1, 4]], + [[3, 4, 5, 4, 3], [4, 9, 16, 9, 4]]], + 'odd': [[[-1, 0, 1, 2, 3], [-4, -1, 0, 1, 4]], + [[3, 4, 5, 6, 7], [4, 9, 16, 23, 28]]]} + for p_, xx in d.items(): + gen = SFT._x_slices(np.array(x), 0, 0, 2, padding=cast(PAD_TYPE, p_)) + yy = np.array([y_.copy() for y_ in gen]) # due to inplace copying + xx = np.asarray(xx, dtype=np.float64) + xp_assert_equal(yy, xx, err_msg=f"Failed '{p_}' padding.") + + +def test_invertible(): + """Verify `invertible` property. """ + SFT = ShortTimeFFT(np.ones(8), hop=4, fs=1) + assert SFT.invertible + SFT = ShortTimeFFT(np.ones(8), hop=9, fs=1) + assert not SFT.invertible + + +def test_border_values(): + """Ensure that minimum and maximum values of slices are correct.""" + SFT = ShortTimeFFT(np.ones(8), hop=4, fs=1) + assert SFT.p_min == 0 + assert SFT.k_min == -4 + assert SFT.lower_border_end == (4, 1) + assert SFT.lower_border_end == (4, 1) # needed to test caching + assert SFT.p_max(10) == 4 + assert SFT.k_max(10) == 16 + assert SFT.upper_border_begin(10) == (4, 2) + # Raise exceptions: + with pytest.raises(ValueError, match="^Parameter n must be"): + SFT.upper_border_begin(3) + with pytest.raises(ValueError, match="^Parameter n must be"): + SFT._post_padding(3) + +def test_border_values_exotic(): + """Ensure that the border calculations are correct for windows with + zeros. """ + w = np.array([0, 0, 0, 0, 0, 0, 0, 1.]) + SFT = ShortTimeFFT(w, hop=1, fs=1) + assert SFT.lower_border_end == (0, 0) + + SFT = ShortTimeFFT(np.flip(w), hop=20, fs=1) + assert SFT.upper_border_begin(4) == (16, 1) + assert SFT.upper_border_begin(5) == (16, 1) + assert SFT.upper_border_begin(23) == (36, 2) + assert SFT.upper_border_begin(24) == (36, 2) + assert SFT.upper_border_begin(25) == (36, 2) + + SFT._hop = -1 # provoke unreachable line + with pytest.raises(RuntimeError): + _ = SFT.k_max(4) + with pytest.raises(RuntimeError): + _ = SFT.k_min + + +def test_t(): + """Verify that the times of the slices are correct. """ + SFT = ShortTimeFFT(np.ones(8), hop=4, fs=2) + assert SFT.T == 1/2 + assert SFT.fs == 2. + assert SFT.delta_t == 4 * 1/2 + t_stft = np.arange(0, SFT.p_max(10)) * SFT.delta_t + xp_assert_equal(SFT.t(10), t_stft) + xp_assert_equal(SFT.t(10, 1, 3), t_stft[1:3]) + SFT.T = 1/4 + assert SFT.T == 1/4 + assert SFT.fs == 4 + SFT.fs = 1/8 + assert SFT.fs == 1/8 + assert SFT.T == 8 + + +@pytest.mark.parametrize('fft_mode, f', + [('onesided', [0., 1., 2.]), + ('onesided2X', [0., 1., 2.]), + ('twosided', [0., 1., 2., -2., -1.]), + ('centered', [-2., -1., 0., 1., 2.])]) +def test_f(fft_mode: FFT_MODE_TYPE, f): + """Verify the frequency values property `f`.""" + SFT = ShortTimeFFT(np.ones(5), hop=4, fs=5, fft_mode=fft_mode, + scale_to='psd') + xp_assert_equal(SFT.f, f) + + +@pytest.mark.parametrize('n', [20, 21]) +@pytest.mark.parametrize('m', [5, 6]) +@pytest.mark.parametrize('fft_mode', ['onesided', 'centered']) +def test_extent(n, m, fft_mode: FFT_MODE_TYPE): + """Ensure that the `extent()` method is correct. """ + SFT = ShortTimeFFT(np.ones(m), hop=m, fs=m, fft_mode=fft_mode) + + t0 = SFT.t(n)[0] # first timestamp + t1 = SFT.t(n)[-1] + SFT.delta_t # last timestamp + 1 + t0c, t1c = t0 - SFT.delta_t / 2, t1 - SFT.delta_t / 2 # centered timestamps + + f0 = SFT.f[0] # first frequency + f1 = SFT.f[-1] + SFT.delta_f # last frequency + 1 + f0c, f1c = f0 - SFT.delta_f / 2, f1 - SFT.delta_f / 2 # centered frequencies + + assert SFT.extent(n, 'tf', False) == (t0, t1, f0, f1) + assert SFT.extent(n, 'ft', False) == (f0, f1, t0, t1) + assert SFT.extent(n, 'tf', True) == (t0c, t1c, f0c, f1c) + assert SFT.extent(n, 'ft', True) == (f0c, f1c, t0c, t1c) + + +def test_spectrogram(): + """Verify spectrogram and cross-spectrogram methods. """ + SFT = ShortTimeFFT(np.ones(8), hop=4, fs=1) + x, y = np.ones(10), np.arange(10) + X, Y = SFT.stft(x), SFT.stft(y) + xp_assert_close(SFT.spectrogram(x), X.real**2+X.imag**2) + xp_assert_close(SFT.spectrogram(x, y), X * Y.conj()) + + +@pytest.mark.parametrize('n', [8, 9]) +def test_fft_func_roundtrip(n: int): + """Test roundtrip `ifft_func(fft_func(x)) == x` for all permutations of + relevant parameters. """ + np.random.seed(2394795) + x0 = np.random.rand(n) + w, h_n = np.ones(n), 4 + + pp = dict( + fft_mode=get_args(FFT_MODE_TYPE), + mfft=[None, n, n+1, n+2], + scaling=[None, 'magnitude', 'psd'], + phase_shift=[None, -n+1, 0, n // 2, n-1]) + for f_typ, mfft, scaling, phase_shift in product(*pp.values()): + if f_typ == 'onesided2X' and scaling is None: + continue # this combination is forbidden + SFT = ShortTimeFFT(w, h_n, fs=n, fft_mode=f_typ, mfft=mfft, + scale_to=scaling, phase_shift=phase_shift) + X0 = SFT._fft_func(x0) + x1 = SFT._ifft_func(X0) + xp_assert_close(x0.astype(x1.dtype), x1, + err_msg="_fft_func() roundtrip failed for " + + f"{f_typ=}, {mfft=}, {scaling=}, {phase_shift=}") + + SFT = ShortTimeFFT(w, h_n, fs=1) + SFT._fft_mode = 'invalid_fft' # type: ignore + with pytest.raises(RuntimeError): + SFT._fft_func(x0) + with pytest.raises(RuntimeError): + SFT._ifft_func(x0) + + +@pytest.mark.parametrize('i', range(19)) +def test_impulse_roundtrip(i): + """Roundtrip for an impulse being at different positions `i`.""" + n = 19 + w, h_n = np.ones(8), 3 + x = np.zeros(n) + x[i] = 1 + + SFT = ShortTimeFFT(w, hop=h_n, fs=1, scale_to=None, phase_shift=None) + Sx = SFT.stft(x) + # test slicing the input signal into two parts: + n_q = SFT.nearest_k_p(n // 2) + Sx0 = SFT.stft(x[:n_q], padding='zeros') + Sx1 = SFT.stft(x[n_q:], padding='zeros') + q0_ub = SFT.upper_border_begin(n_q)[1] - SFT.p_min + q1_le = SFT.lower_border_end[1] - SFT.p_min + xp_assert_close(Sx0[:, :q0_ub], Sx[:, :q0_ub], err_msg=f"{i=}") + xp_assert_close(Sx1[:, q1_le:], Sx[:, q1_le-Sx1.shape[1]:], + err_msg=f"{i=}") + + Sx01 = np.hstack((Sx0[:, :q0_ub], + Sx0[:, q0_ub:] + Sx1[:, :q1_le], + Sx1[:, q1_le:])) + xp_assert_close(Sx, Sx01, atol=1e-8, err_msg=f"{i=}") + + y = SFT.istft(Sx, 0, n) + xp_assert_close(y, x, atol=1e-8, err_msg=f"{i=}") + y0 = SFT.istft(Sx, 0, n//2) + xp_assert_close(x[:n//2], y0, atol=1e-8, err_msg=f"{i=}") + y1 = SFT.istft(Sx, n // 2, n) + xp_assert_close(x[n // 2:], y1, atol=1e-8, err_msg=f"{i=}") + + +@pytest.mark.parametrize('hop', [1, 7, 8]) +def test_asymmetric_window_roundtrip(hop: int): + """An asymmetric window could uncover indexing problems. """ + np.random.seed(23371) + + w = np.arange(16) / 8 # must be of type float + w[len(w)//2:] = 1 + SFT = ShortTimeFFT(w, hop, fs=1) + + x = 10 * np.random.randn(64) + Sx = SFT.stft(x) + x1 = SFT.istft(Sx, k1=len(x)) + xp_assert_close(x1, x1, err_msg="Roundtrip for asymmetric window with " + + f" {hop=} failed!") + + +@pytest.mark.parametrize('m_num', [6, 7]) +def test_minimal_length_signal(m_num): + """Verify that the shortest allowed signal works. """ + SFT = ShortTimeFFT(np.ones(m_num), m_num//2, fs=1) + n = math.ceil(m_num/2) + x = np.ones(n) + Sx = SFT.stft(x) + x1 = SFT.istft(Sx, k1=n) + xp_assert_close(x1, x, err_msg=f"Roundtrip minimal length signal ({n=})" + + f" for {m_num} sample window failed!") + with pytest.raises(ValueError, match=rf"len\(x\)={n-1} must be >= ceil.*"): + SFT.stft(x[:-1]) + with pytest.raises(ValueError, match=rf"S.shape\[t_axis\]={Sx.shape[1]-1}" + f" needs to have at least {Sx.shape[1]} slices"): + SFT.istft(Sx[:, :-1], k1=n) + + +def test_tutorial_stft_sliding_win(): + """Verify example in "Sliding Windows" subsection from the "User Guide". + + In :ref:`tutorial_stft_sliding_win` (file ``signal.rst``) of the + :ref:`user_guide` the behavior the border behavior of + ``ShortTimeFFT(np.ones(6), 2, fs=1)`` with a 50 sample signal is discussed. + This test verifies the presented indexes. + """ + SFT = ShortTimeFFT(np.ones(6), 2, fs=1) + + # Lower border: + assert SFT.m_num_mid == 3, f"Slice middle is not 3 but {SFT.m_num_mid=}" + assert SFT.p_min == -1, f"Lowest slice {SFT.p_min=} is not -1" + assert SFT.k_min == -5, f"Lowest slice sample {SFT.p_min=} is not -5" + k_lb, p_lb = SFT.lower_border_end + assert p_lb == 2, f"First unaffected slice {p_lb=} is not 2" + assert k_lb == 5, f"First unaffected sample {k_lb=} is not 5" + + n = 50 # upper signal border + assert (p_max := SFT.p_max(n)) == 27, f"Last slice {p_max=} must be 27" + assert (k_max := SFT.k_max(n)) == 55, f"Last sample {k_max=} must be 55" + k_ub, p_ub = SFT.upper_border_begin(n) + assert p_ub == 24, f"First upper border slice {p_ub=} must be 24" + assert k_ub == 45, f"First upper border slice {k_ub=} must be 45" + + +def test_tutorial_stft_legacy_stft(): + """Verify STFT example in "Comparison with Legacy Implementation" from the + "User Guide". + + In :ref:`tutorial_stft_legacy_stft` (file ``signal.rst``) of the + :ref:`user_guide` the legacy and the new implementation are compared. + """ + fs, N = 200, 1001 # # 200 Hz sampling rate for 5 s signal + t_z = np.arange(N) / fs # time indexes for signal + z = np.exp(2j*np.pi * 70 * (t_z - 0.2 * t_z ** 2)) # complex-valued chirp + + nperseg, noverlap = 50, 40 + win = ('gaussian', 1e-2 * fs) # Gaussian with 0.01 s standard deviation + + # Legacy STFT: + f0_u, t0, Sz0_u = stft(z, fs, win, nperseg, noverlap, + return_onesided=False, scaling='spectrum') + Sz0 = fftshift(Sz0_u, axes=0) + + # New STFT: + SFT = ShortTimeFFT.from_window(win, fs, nperseg, noverlap, + fft_mode='centered', + scale_to='magnitude', phase_shift=None) + Sz1 = SFT.stft(z) + + xp_assert_close(Sz0, Sz1[:, 2:-1]) + + xp_assert_close((abs(Sz1[:, 1]).min(), abs(Sz1[:, 1]).max()), + (6.925060911593139e-07, 8.00271269218721e-07)) + + t0_r, z0_r = istft(Sz0_u, fs, win, nperseg, noverlap, input_onesided=False, + scaling='spectrum') + z1_r = SFT.istft(Sz1, k1=N) + assert len(z0_r) == N + 9 + xp_assert_close(z0_r[:N], z) + xp_assert_close(z1_r, z) + + # Spectrogram is just the absolute square of th STFT: + xp_assert_close(SFT.spectrogram(z), abs(Sz1) ** 2) + + +def test_tutorial_stft_legacy_spectrogram(): + """Verify spectrogram example in "Comparison with Legacy Implementation" + from the "User Guide". + + In :ref:`tutorial_stft_legacy_stft` (file ``signal.rst``) of the + :ref:`user_guide` the legacy and the new implementation are compared. + """ + fs, N = 200, 1001 # 200 Hz sampling rate for almost 5 s signal + t_z = np.arange(N) / fs # time indexes for signal + z = np.exp(2j*np.pi*70 * (t_z - 0.2*t_z**2)) # complex-valued sweep + + nperseg, noverlap = 50, 40 + win = ('gaussian', 1e-2 * fs) # Gaussian with 0.01 s standard dev. + + # Legacy spectrogram: + f2_u, t2, Sz2_u = spectrogram(z, fs, win, nperseg, noverlap, detrend=None, + return_onesided=False, scaling='spectrum', + mode='complex') + + f2, Sz2 = fftshift(f2_u), fftshift(Sz2_u, axes=0) + + # New STFT: + SFT = ShortTimeFFT.from_window(win, fs, nperseg, noverlap, + fft_mode='centered', scale_to='magnitude', + phase_shift=None) + Sz3 = SFT.stft(z, p0=0, p1=(N-noverlap) // SFT.hop, k_offset=nperseg // 2) + t3 = SFT.t(N, p0=0, p1=(N-noverlap) // SFT.hop, k_offset=nperseg // 2) + + xp_assert_close(t2, t3) + xp_assert_close(f2, SFT.f) + xp_assert_close(Sz2, Sz3) + + +def test_permute_axes(): + """Verify correctness of four-dimensional signal by permuting its + shape. """ + n = 25 + SFT = ShortTimeFFT(np.ones(8)/8, hop=3, fs=n) + x0 = np.arange(n, dtype=np.float64) + Sx0 = SFT.stft(x0) + Sx0 = Sx0.reshape((Sx0.shape[0], 1, 1, 1, Sx0.shape[-1])) + SxT = np.moveaxis(Sx0, (0, -1), (-1, 0)) + + atol = 2 * np.finfo(SFT.win.dtype).resolution + for i in range(4): + y = np.reshape(x0, np.roll((n, 1, 1, 1), i)) + Sy = SFT.stft(y, axis=i) + xp_assert_close(Sy, np.moveaxis(Sx0, 0, i)) + + yb0 = SFT.istft(Sy, k1=n, f_axis=i) + xp_assert_close(yb0, y, atol=atol) + # explicit t-axis parameter (for coverage): + yb1 = SFT.istft(Sy, k1=n, f_axis=i, t_axis=Sy.ndim-1) + xp_assert_close(yb1, y, atol=atol) + + SyT = np.moveaxis(Sy, (i, -1), (-1, i)) + xp_assert_close(SyT, np.moveaxis(SxT, 0, i)) + + ybT = SFT.istft(SyT, k1=n, t_axis=i, f_axis=-1) + xp_assert_close(ybT, y, atol=atol) + + +@pytest.mark.parametrize("fft_mode", + ('twosided', 'centered', 'onesided', 'onesided2X')) +def test_roundtrip_multidimensional(fft_mode: FFT_MODE_TYPE): + """Test roundtrip of a multidimensional input signal versus its components. + + This test can uncover potential problems with `fftshift()`. + """ + n = 9 + x = np.arange(4*n*2, dtype=np.float64).reshape(4, n, 2) + SFT = ShortTimeFFT(get_window('hann', 4), hop=2, fs=1, + scale_to='magnitude', fft_mode=fft_mode) + Sx = SFT.stft(x, axis=1) + y = SFT.istft(Sx, k1=n, f_axis=1, t_axis=-1) + xp_assert_close(y, x.astype(y.dtype), err_msg='Multidim. roundtrip failed!') + + for i, j in product(range(x.shape[0]), range(x.shape[2])): + y_ = SFT.istft(Sx[i, :, j, :], k1=n) + xp_assert_close(y_, x[i, :, j].astype(y_.dtype), + err_msg="Multidim. roundtrip for component " + + f"x[{i}, :, {j}] and {fft_mode=} failed!") + +@pytest.mark.parametrize("phase_shift", (0, 4, None)) +def test_roundtrip_two_dimensional(phase_shift: int|None): + """Test roundtrip of a 2 channel input signal with `mfft` set with different + values for `phase_shift` + + Tests for Issue https://github.com/scipy/scipy/issues/21671 + """ + n = 21 + SFT = ShortTimeFFT.from_window('hann', fs=1, nperseg=13, noverlap=7, + mfft=16, phase_shift=phase_shift) + x = np.arange(2*n, dtype=float).reshape(2, n) + Sx = SFT.stft(x) + y = SFT.istft(Sx, k1=n) + xp_assert_close(y, x, atol=2 * np.finfo(SFT.win.dtype).resolution, + err_msg='2-dim. roundtrip failed!') + + +@pytest.mark.parametrize('window, n, nperseg, noverlap', + [('boxcar', 100, 10, 0), # Test no overlap + ('boxcar', 100, 10, 9), # Test high overlap + ('bartlett', 101, 51, 26), # Test odd nperseg + ('hann', 1024, 256, 128), # Test defaults + (('tukey', 0.5), 1152, 256, 64), # Test Tukey + ('hann', 1024, 256, 255), # Test overlapped hann + ('boxcar', 100, 10, 3), # NOLA True, COLA False + ('bartlett', 101, 51, 37), # NOLA True, COLA False + ('hann', 1024, 256, 127), # NOLA True, COLA False + # NOLA True, COLA False: + (('tukey', 0.5), 1152, 256, 14), + ('hann', 1024, 256, 5)]) # NOLA True, COLA False +def test_roundtrip_windows(window, n: int, nperseg: int, noverlap: int): + """Roundtrip test adapted from `test_spectral.TestSTFT`. + + The parameters are taken from the methods test_roundtrip_real(), + test_roundtrip_nola_not_cola(), test_roundtrip_float32(), + test_roundtrip_complex(). + """ + np.random.seed(2394655) + + w = get_window(window, nperseg) + SFT = ShortTimeFFT(w, nperseg - noverlap, fs=1, fft_mode='twosided', + phase_shift=None) + + z = 10 * np.random.randn(n) + 10j * np.random.randn(n) + Sz = SFT.stft(z) + z1 = SFT.istft(Sz, k1=len(z)) + xp_assert_close(z, z1, err_msg="Roundtrip for complex values failed") + + x = 10 * np.random.randn(n) + Sx = SFT.stft(x) + x1 = SFT.istft(Sx, k1=len(z)) + xp_assert_close(x.astype(np.complex128), x1, + err_msg="Roundtrip for float values failed") + + x32 = x.astype(np.float32) + Sx32 = SFT.stft(x32) + x32_1 = SFT.istft(Sx32, k1=len(x32)) + x32_1_r = x32_1.real + xp_assert_close(x32, x32_1_r.astype(np.float32), + err_msg="Roundtrip for 32 Bit float values failed") + xp_assert_close(x32.imag, np.zeros_like(x32.imag), + err_msg="Roundtrip for 32 Bit float values failed") + + +@pytest.mark.parametrize('signal_type', ('real', 'complex')) +def test_roundtrip_complex_window(signal_type): + """Test roundtrip for complex-valued window function + + The purpose of this test is to check if the dual window is calculated + correctly for complex-valued windows. + """ + np.random.seed(1354654) + win = np.exp(2j*np.linspace(0, np.pi, 8)) + SFT = ShortTimeFFT(win, 3, fs=1, fft_mode='twosided') + + z = 10 * np.random.randn(11) + if signal_type == 'complex': + z = z + 2j * z + Sz = SFT.stft(z) + z1 = SFT.istft(Sz, k1=len(z)) + xp_assert_close(z.astype(np.complex128), z1, + err_msg="Roundtrip for complex-valued window failed") + + +def test_average_all_segments(): + """Compare `welch` function with stft mean. + + Ported from `TestSpectrogram.test_average_all_segments` from file + ``test__spectral.py``. + """ + x = np.random.randn(1024) + + fs = 1.0 + window = ('tukey', 0.25) + nperseg, noverlap = 16, 2 + fw, Pw = welch(x, fs, window, nperseg, noverlap) + SFT = ShortTimeFFT.from_window(window, fs, nperseg, noverlap, + fft_mode='onesided2X', scale_to='psd', + phase_shift=None) + # `welch` positions the window differently than the STFT: + P = SFT.spectrogram(x, detr='constant', p0=0, + p1=(len(x)-noverlap)//SFT.hop, k_offset=nperseg//2) + + xp_assert_close(SFT.f, fw) + xp_assert_close(np.mean(P, axis=-1), Pw) + + +@pytest.mark.parametrize('window, N, nperseg, noverlap, mfft', + # from test_roundtrip_padded_FFT: + [('hann', 1024, 256, 128, 512), + ('hann', 1024, 256, 128, 501), + ('boxcar', 100, 10, 0, 33), + (('tukey', 0.5), 1152, 256, 64, 1024), + # from test_roundtrip_padded_signal: + ('boxcar', 101, 10, 0, None), + ('hann', 1000, 256, 128, None), + # from test_roundtrip_boundary_extension: + ('boxcar', 100, 10, 0, None), + ('boxcar', 100, 10, 9, None)]) +@pytest.mark.parametrize('padding', get_args(PAD_TYPE)) +def test_stft_padding_roundtrip(window, N: int, nperseg: int, noverlap: int, + mfft: int, padding): + """Test the parameter 'padding' of `stft` with roundtrips. + + The STFT parametrizations were taken from the methods + `test_roundtrip_padded_FFT`, `test_roundtrip_padded_signal` and + `test_roundtrip_boundary_extension` from class `TestSTFT` in file + ``test_spectral.py``. Note that the ShortTimeFFT does not need the + concept of "boundary extension". + """ + x = normal_distribution.rvs(size=N, random_state=2909) # real signal + z = x * np.exp(1j * np.pi / 4) # complex signal + + SFT = ShortTimeFFT.from_window(window, 1, nperseg, noverlap, + fft_mode='twosided', mfft=mfft) + Sx = SFT.stft(x, padding=padding) + x1 = SFT.istft(Sx, k1=N) + xp_assert_close(x1, x.astype(np.complex128), + err_msg=f"Failed real roundtrip with '{padding}' padding") + + Sz = SFT.stft(z, padding=padding) + z1 = SFT.istft(Sz, k1=N) + xp_assert_close(z1, z, err_msg="Failed complex roundtrip with " + + f" '{padding}' padding") + + +@pytest.mark.parametrize('N_x', (128, 129, 255, 256, 1337)) # signal length +@pytest.mark.parametrize('w_size', (128, 256)) # window length +@pytest.mark.parametrize('t_step', (4, 64)) # SFT time hop +@pytest.mark.parametrize('f_c', (7., 23.)) # frequency of input sine +def test_energy_conservation(N_x: int, w_size: int, t_step: int, f_c: float): + """Test if a `psd`-scaled STFT conserves the L2 norm. + + This test is adapted from MNE-Python [1]_. Besides being battle-tested, + this test has the benefit of using non-standard window including + non-positive values and a 2d input signal. + + Since `ShortTimeFFT` requires the signal length `N_x` to be at least the + window length `w_size`, the parameter `N_x` was changed from + ``(127, 128, 255, 256, 1337)`` to ``(128, 129, 255, 256, 1337)`` to be + more useful. + + .. [1] File ``test_stft.py`` of MNE-Python + https://github.com/mne-tools/mne-python/blob/main/mne/time_frequency/tests/test_stft.py + """ + window = np.sin(np.arange(.5, w_size + .5) / w_size * np.pi) + SFT = ShortTimeFFT(window, t_step, fs=1000, fft_mode='onesided2X', + scale_to='psd') + atol = 2*np.finfo(window.dtype).resolution + N_x = max(N_x, w_size) # minimal sing + # Test with low frequency signal + t = np.arange(N_x).astype(np.float64) + x = np.sin(2 * np.pi * f_c * t * SFT.T) + x = np.array([x, x + 1.]) + X = SFT.stft(x) + xp = SFT.istft(X, k1=N_x) + + max_freq = SFT.f[np.argmax(np.sum(np.abs(X[0]) ** 2, axis=1))] + + assert X.shape[1] == SFT.f_pts + assert np.all(SFT.f >= 0.) + assert np.abs(max_freq - f_c) < 1. + xp_assert_close(x, xp, atol=atol) + + # check L2-norm squared (i.e., energy) conservation: + E_x = np.sum(x**2, axis=-1) * SFT.T # numerical integration + aX2 = X.real**2 + X.imag.real**2 + E_X = np.sum(np.sum(aX2, axis=-1) * SFT.delta_t, axis=-1) * SFT.delta_f + xp_assert_close(E_X, E_x, atol=atol) + + # Test with random signal + np.random.seed(2392795) + x = np.random.randn(2, N_x) + X = SFT.stft(x) + xp = SFT.istft(X, k1=N_x) + + assert X.shape[1] == SFT.f_pts + assert np.all(SFT.f >= 0.) + assert np.abs(max_freq - f_c) < 1. + xp_assert_close(x, xp, atol=atol) + + # check L2-norm squared (i.e., energy) conservation: + E_x = np.sum(x**2, axis=-1) * SFT.T # numeric integration + aX2 = X.real ** 2 + X.imag.real ** 2 + E_X = np.sum(np.sum(aX2, axis=-1) * SFT.delta_t, axis=-1) * SFT.delta_f + xp_assert_close(E_X, E_x, atol=atol) + + # Try with empty array + x = np.zeros((0, N_x)) + X = SFT.stft(x) + xp = SFT.istft(X, k1=N_x) + assert xp.shape == x.shape diff --git a/shared/package-files/4a/4a67b5ed7cbaadbffd04657c4ecf14dde9b1bb95ca621680f32c18af35b150c6/alt4 b/shared/package-files/4a/4a67b5ed7cbaadbffd04657c4ecf14dde9b1bb95ca621680f32c18af35b150c6/alt4 new file mode 100644 index 0000000000000000000000000000000000000000..a6344d429f35df0c72ca771753611418e6c568c6 Binary files /dev/null and b/shared/package-files/4a/4a67b5ed7cbaadbffd04657c4ecf14dde9b1bb95ca621680f32c18af35b150c6/alt4 differ diff --git a/shared/package-files/4a/4a67b5ed7cbaadbffd04657c4ecf14dde9b1bb95ca621680f32c18af35b150c6/altos-4 b/shared/package-files/4a/4a67b5ed7cbaadbffd04657c4ecf14dde9b1bb95ca621680f32c18af35b150c6/altos-4 new file mode 100644 index 0000000000000000000000000000000000000000..a6344d429f35df0c72ca771753611418e6c568c6 Binary files /dev/null and b/shared/package-files/4a/4a67b5ed7cbaadbffd04657c4ecf14dde9b1bb95ca621680f32c18af35b150c6/altos-4 differ diff --git a/shared/package-files/4a/4a67b5ed7cbaadbffd04657c4ecf14dde9b1bb95ca621680f32c18af35b150c6/altos4 b/shared/package-files/4a/4a67b5ed7cbaadbffd04657c4ecf14dde9b1bb95ca621680f32c18af35b150c6/altos4 new file mode 100644 index 0000000000000000000000000000000000000000..a6344d429f35df0c72ca771753611418e6c568c6 Binary files /dev/null and b/shared/package-files/4a/4a67b5ed7cbaadbffd04657c4ecf14dde9b1bb95ca621680f32c18af35b150c6/altos4 differ diff --git a/shared/package-files/4a/4a68dc2ba798f32bbe4c19b73f2adfb6d3864bf372f66d676ec3d9dd0e0a1494/t_copy_ops.h b/shared/package-files/4a/4a68dc2ba798f32bbe4c19b73f2adfb6d3864bf372f66d676ec3d9dd0e0a1494/t_copy_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..6a17431bca56efdd5c9a32ef140839760e070546 --- /dev/null +++ b/shared/package-files/4a/4a68dc2ba798f32bbe4c19b73f2adfb6d3864bf372f66d676ec3d9dd0e0a1494/t_copy_ops.h @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API t_copy { + using schema = at::Tensor (const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::t_copy") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "t_copy(Tensor self) -> Tensor") + static at::Tensor call(const at::Tensor & self); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self); +}; + +struct TORCH_API t_copy_out { + using schema = at::Tensor & (const at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::t_copy") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "t_copy.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/4a/4a695ab53c30ecd9286c2d79d446ab7afda213a4131c06c7b1f479acb3a8c2d0/nsterm-s b/shared/package-files/4a/4a695ab53c30ecd9286c2d79d446ab7afda213a4131c06c7b1f479acb3a8c2d0/nsterm-s new file mode 100644 index 0000000000000000000000000000000000000000..c96f1ea89fcd9e3404acd6463789fb134868fa24 Binary files /dev/null and b/shared/package-files/4a/4a695ab53c30ecd9286c2d79d446ab7afda213a4131c06c7b1f479acb3a8c2d0/nsterm-s differ diff --git a/shared/package-files/4a/4a6e8660420bb413e4fe08f3d2c9e04e3c792669f879bb7179b7644153898114/top_level.txt b/shared/package-files/4a/4a6e8660420bb413e4fe08f3d2c9e04e3c792669f879bb7179b7644153898114/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..1777652f24915a4fe702f86bb5d763e10588c47e --- /dev/null +++ b/shared/package-files/4a/4a6e8660420bb413e4fe08f3d2c9e04e3c792669f879bb7179b7644153898114/top_level.txt @@ -0,0 +1 @@ +gmpy2 diff --git a/shared/package-files/4a/4a70c133798766b3897eb6cadfd6a14f44b52e1eb9bfa054f63f7a19096a1843/__init__.py b/shared/package-files/4a/4a70c133798766b3897eb6cadfd6a14f44b52e1eb9bfa054f63f7a19096a1843/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4f0b9a0a5a1945fd7eb22035b2a0b709264b41f9 --- /dev/null +++ b/shared/package-files/4a/4a70c133798766b3897eb6cadfd6a14f44b52e1eb9bfa054f63f7a19096a1843/__init__.py @@ -0,0 +1,30 @@ +# mypy: ignore-errors + +from . import fft, linalg, random +from ._dtypes import * # noqa: F403 +from ._funcs import * # noqa: F403 +from ._getlimits import finfo, iinfo +from ._ndarray import ( + array, + asarray, + ascontiguousarray, + can_cast, + from_dlpack, + ndarray, + newaxis, + result_type, +) +from ._ufuncs import * # noqa: F403 +from ._util import AxisError, UFuncTypeError + +# from . import testing + +alltrue = all +sometrue = any + +inf = float("inf") +nan = float("nan") +from math import pi, e # isort: skip + +False_ = False +True_ = True diff --git a/shared/package-files/4a/4a7195fec16c35b0aefd644d2b813e3e0987a54413f6f9c18554795fa82f2483/special_hermite_polynomial_he_meta.h b/shared/package-files/4a/4a7195fec16c35b0aefd644d2b813e3e0987a54413f6f9c18554795fa82f2483/special_hermite_polynomial_he_meta.h new file mode 100644 index 0000000000000000000000000000000000000000..d4388df4a6421ef8bfada58831acc73ed1f8785d --- /dev/null +++ b/shared/package-files/4a/4a7195fec16c35b0aefd644d2b813e3e0987a54413f6f9c18554795fa82f2483/special_hermite_polynomial_he_meta.h @@ -0,0 +1,27 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeMetaFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace meta { + +struct TORCH_API structured_special_hermite_polynomial_he : public TensorIteratorBase { + + + void meta(const at::Tensor & x, const at::Tensor & n); +}; + +} // namespace native +} // namespace at diff --git a/shared/package-files/4a/4a744d436d214a7bdc79a5ac4c88d945ed91f743400b9f0f54997d6ccb7ee350/traitlets.py b/shared/package-files/4a/4a744d436d214a7bdc79a5ac4c88d945ed91f743400b9f0f54997d6ccb7ee350/traitlets.py new file mode 100644 index 0000000000000000000000000000000000000000..2f979fa727127d12b7f66fa169c05778fae4801e --- /dev/null +++ b/shared/package-files/4a/4a744d436d214a7bdc79a5ac4c88d945ed91f743400b9f0f54997d6ccb7ee350/traitlets.py @@ -0,0 +1,6 @@ + +from warnings import warn + +warn("IPython.utils.traitlets has moved to a top-level traitlets package.", stacklevel=2) + +from traitlets import * diff --git a/shared/package-files/4a/4a749dcfc7654bd200549fce4582f661c6d4cc2e1ce78c4d07c6a70a2cbc46f1/test_impulse_responses.py b/shared/package-files/4a/4a749dcfc7654bd200549fce4582f661c6d4cc2e1ce78c4d07c6a70a2cbc46f1/test_impulse_responses.py new file mode 100644 index 0000000000000000000000000000000000000000..bfb0f17c6bf8dde4da5c88617a876695ff2e4165 --- /dev/null +++ b/shared/package-files/4a/4a749dcfc7654bd200549fce4582f661c6d4cc2e1ce78c4d07c6a70a2cbc46f1/test_impulse_responses.py @@ -0,0 +1,918 @@ +""" +Tests for impulse responses of time series + +Author: Chad Fulton +License: Simplified-BSD +""" + +from statsmodels.compat.pandas import MONTH_END + +import warnings + +import numpy as np +from numpy.testing import assert_, assert_allclose +import pandas as pd +import pytest +from scipy.stats import ortho_group + +from statsmodels.tools.sm_exceptions import EstimationWarning +from statsmodels.tsa.statespace import ( + dynamic_factor, + mlemodel, + sarimax, + structural, + varmax, +) +from statsmodels.tsa.vector_ar.tests.test_var import get_macrodata + + +def test_sarimax(): + # AR(1) + mod = sarimax.SARIMAX([0], order=(1, 0, 0)) + phi = 0.5 + actual = mod.impulse_responses([phi, 1], steps=10) + desired = np.r_[[phi**i for i in range(11)]] + assert_allclose(actual, desired) + + # MA(1) + mod = sarimax.SARIMAX([0], order=(0, 0, 1)) + theta = 0.5 + actual = mod.impulse_responses([theta, 1], steps=10) + desired = np.r_[1, theta, [0] * 9] + assert_allclose(actual, desired) + + # ARMA(2, 2) + constant + # Stata: + # webuse lutkepohl2 + # arima dln_inc, arima(2, 0, 2) + # irf create irf1, set(irf1) step(10) + # irf table irf + params = [ + 0.01928228, + -0.03656216, + 0.7588994, + 0.27070341, + -0.72928328, + 0.01122177**0.5, + ] + mod = sarimax.SARIMAX([0], order=(2, 0, 2), trend="c") + actual = mod.impulse_responses(params, steps=10) + desired = [ + 1, + 0.234141, + 0.021055, + 0.17692, + 0.00951, + 0.133917, + 0.002321, + 0.101544, + -0.001951, + 0.077133, + -0.004301, + ] + assert_allclose(actual, desired, atol=1e-6) + + # SARIMAX(1,1,1)x(1,0,1,4) + constant + exog + # Stata: + # webuse lutkepohl2 + # gen exog = _n^2 + # arima inc exog, arima(1,1,1) sarima(1,0,1,4) + # irf create irf2, set(irf2) step(10) + # irf table irf + params = [ + 0.12853289, + 12.207156, + 0.86384742, + -0.71463236, + 0.81878967, + -0.9533955, + 14.043884**0.5, + ] + exog = np.arange(1, 92) ** 2 + mod = sarimax.SARIMAX( + np.zeros(91), + order=(1, 1, 1), + seasonal_order=(1, 0, 1, 4), + trend="c", + exog=exog, + simple_differencing=True, + ) + actual = mod.impulse_responses(params, steps=10) + desired = [ + 1, + 0.149215, + 0.128899, + 0.111349, + -0.038417, + 0.063007, + 0.054429, + 0.047018, + -0.069598, + 0.018641, + 0.016103, + ] + assert_allclose(actual, desired, atol=1e-6) + + +def test_structural(): + steps = 10 + + # AR(1) + mod = structural.UnobservedComponents([0], autoregressive=1) + phi = 0.5 + actual = mod.impulse_responses([1, phi], steps) + desired = np.r_[[phi**i for i in range(steps + 1)]] + assert_allclose(actual, desired) + + # ARX(1) + # This is adequately tested in test_simulate.py, since in the time-varying + # case `impulse_responses` just calls `simulate` + + # Irregular + mod = structural.UnobservedComponents([0], "irregular") + actual = mod.impulse_responses([1.0], steps) + assert_allclose(actual, 0) + + # Fixed intercept + # (in practice this is a deterministic constant, because an irregular + # component must be added) + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + mod = structural.UnobservedComponents([0], "fixed intercept") + actual = mod.impulse_responses([1.0], steps) + assert_allclose(actual, 0) + + # Deterministic constant + mod = structural.UnobservedComponents([0], "deterministic constant") + actual = mod.impulse_responses([1.0], steps) + assert_allclose(actual, 0) + + # Local level + mod = structural.UnobservedComponents([0], "local level") + actual = mod.impulse_responses([1.0, 1.0], steps) + assert_allclose(actual, 1) + + # Random walk + mod = structural.UnobservedComponents([0], "random walk") + actual = mod.impulse_responses([1.0], steps) + assert_allclose(actual, 1) + + # Fixed slope + # (in practice this is a deterministic trend, because an irregular + # component must be added) + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + mod = structural.UnobservedComponents([0], "fixed slope") + actual = mod.impulse_responses([1.0], steps) + assert_allclose(actual, 0) + + # Deterministic trend + mod = structural.UnobservedComponents([0], "deterministic trend") + actual = mod.impulse_responses([1.0], steps) + assert_allclose(actual, 0) + + # Local linear deterministic trend + mod = structural.UnobservedComponents([0], "local linear deterministic trend") + actual = mod.impulse_responses([1.0, 1.0], steps) + assert_allclose(actual, 1) + + # Random walk with drift + mod = structural.UnobservedComponents([0], "random walk with drift") + actual = mod.impulse_responses([1.0], steps) + assert_allclose(actual, 1) + + # Local linear trend + mod = structural.UnobservedComponents([0], "local linear trend") + # - shock the level + actual = mod.impulse_responses([1.0, 1.0, 1.0], steps) + assert_allclose(actual, 1) + # - shock the trend + actual = mod.impulse_responses([1.0, 1.0, 1.0], steps, impulse=1) + assert_allclose(actual, np.arange(steps + 1)) + + # Smooth trend + mod = structural.UnobservedComponents([0], "smooth trend") + actual = mod.impulse_responses([1.0, 1.0], steps) + assert_allclose(actual, np.arange(steps + 1)) + + # Random trend + mod = structural.UnobservedComponents([0], "random trend") + actual = mod.impulse_responses([1.0, 1.0], steps) + assert_allclose(actual, np.arange(steps + 1)) + + # Seasonal (deterministic) + mod = structural.UnobservedComponents( + [0], "irregular", seasonal=2, stochastic_seasonal=False + ) + actual = mod.impulse_responses([1.0], steps) + assert_allclose(actual, 0) + + # Seasonal (stochastic) + mod = structural.UnobservedComponents([0], "irregular", seasonal=2) + actual = mod.impulse_responses([1.0, 1.0], steps) + desired = np.r_[1, np.tile([-1, 1], steps // 2)] + assert_allclose(actual, desired) + + # Cycle (deterministic) + mod = structural.UnobservedComponents([0], "irregular", cycle=True) + actual = mod.impulse_responses([1.0, 1.2], steps) + assert_allclose(actual, 0) + + # Cycle (stochastic) + mod = structural.UnobservedComponents( + [0], "irregular", cycle=True, stochastic_cycle=True + ) + actual = mod.impulse_responses([1.0, 1.0, 1.2], steps=10) + x1 = [np.cos(1.2), np.sin(1.2)] + x2 = [-np.sin(1.2), np.cos(1.2)] + T = np.array([x1, x2]) + desired = np.zeros(steps + 1) + states = [1, 0] + for i in range(steps + 1): + desired[i] += states[0] + states = np.dot(T, states) + assert_allclose(actual, desired) + + +def test_varmax(): + steps = 10 + + # Clear warnings + varmax.__warningregistry__ = {} + + # VAR(2) - single series + mod1 = varmax.VARMAX([[0]], order=(2, 0), trend="n") + mod2 = sarimax.SARIMAX([0], order=(2, 0, 0)) + actual = mod1.impulse_responses([0.5, 0.2, 1], steps) + desired = mod2.impulse_responses([0.5, 0.2, 1], steps) + assert_allclose(actual, desired) + + # VMA(2) - single series + mod1 = varmax.VARMAX([[0]], order=(0, 2), trend="n") + mod2 = sarimax.SARIMAX([0], order=(0, 0, 2)) + actual = mod1.impulse_responses([0.5, 0.2, 1], steps) + desired = mod2.impulse_responses([0.5, 0.2, 1], steps) + assert_allclose(actual, desired) + + # VARMA(2, 2) - single series + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + mod1 = varmax.VARMAX([[0]], order=(2, 2), trend="n") + mod2 = sarimax.SARIMAX([0], order=(2, 0, 2)) + actual = mod1.impulse_responses([0.5, 0.2, 0.1, -0.2, 1], steps) + desired = mod2.impulse_responses([0.5, 0.2, 0.1, -0.2, 1], steps) + assert_allclose(actual, desired) + + # VARMA(2, 2) + trend - single series + warning = EstimationWarning + match = r"VARMA\(p,q\) models is not" + with pytest.warns(warning, match=match): + mod1 = varmax.VARMAX([[0]], order=(2, 2), trend="c") + mod2 = sarimax.SARIMAX([0], order=(2, 0, 2), trend="c") + actual = mod1.impulse_responses([10, 0.5, 0.2, 0.1, -0.2, 1], steps) + desired = mod2.impulse_responses([10, 0.5, 0.2, 0.1, -0.2, 1], steps) + assert_allclose(actual, desired) + + # VAR(2) + constant + # Stata: + # webuse lutkepohl2 + # var dln_inv dln_inc, lags(1/2) + # irf create irf3, set(irf3) step(10) + # irf table irf + # irf table oirf + params = [ + -0.00122728, + 0.01503679, + -0.22741923, + 0.71030531, + -0.11596357, + 0.51494891, + 0.05974659, + 0.02094608, + 0.05635125, + 0.08332519, + 0.04297918, + 0.00159473, + 0.01096298, + ] + irf_00 = [ + 1, + -0.227419, + -0.021806, + 0.093362, + -0.001875, + -0.00906, + 0.009605, + 0.001323, + -0.001041, + 0.000769, + 0.00032, + ] + irf_01 = [ + 0, + 0.059747, + 0.044015, + -0.008218, + 0.007845, + 0.004629, + 0.000104, + 0.000451, + 0.000638, + 0.000063, + 0.000042, + ] + irf_10 = [ + 0, + 0.710305, + 0.36829, + -0.065697, + 0.084398, + 0.043038, + 0.000533, + 0.005755, + 0.006051, + 0.000548, + 0.000526, + ] + irf_11 = [ + 1, + 0.020946, + 0.126202, + 0.066419, + 0.028735, + 0.007477, + 0.009878, + 0.003287, + 0.001266, + 0.000986, + 0.0005, + ] + oirf_00 = [ + 0.042979, + -0.008642, + -0.00035, + 0.003908, + 0.000054, + -0.000321, + 0.000414, + 0.000066, + -0.000035, + 0.000034, + 0.000015, + ] + oirf_01 = [ + 0.001595, + 0.002601, + 0.002093, + -0.000247, + 0.000383, + 0.000211, + 0.00002, + 0.000025, + 0.000029, + 4.30e-06, + 2.60e-06, + ] + oirf_10 = [ + 0, + 0.007787, + 0.004037, + -0.00072, + 0.000925, + 0.000472, + 5.80e-06, + 0.000063, + 0.000066, + 6.00e-06, + 5.80e-06, + ] + oirf_11 = [ + 0.010963, + 0.00023, + 0.001384, + 0.000728, + 0.000315, + 0.000082, + 0.000108, + 0.000036, + 0.000014, + 0.000011, + 5.50e-06, + ] + + mod = varmax.VARMAX([[0, 0]], order=(2, 0), trend="c") + + # IRFs + actual = mod.impulse_responses(params, steps, impulse=0) + assert_allclose(actual, np.c_[irf_00, irf_01], atol=1e-6) + + actual = mod.impulse_responses(params, steps, impulse=1) + assert_allclose(actual, np.c_[irf_10, irf_11], atol=1e-6) + + # Orthogonalized IRFs + actual = mod.impulse_responses(params, steps, impulse=0, orthogonalized=True) + assert_allclose(actual, np.c_[oirf_00, oirf_01], atol=1e-6) + + actual = mod.impulse_responses(params, steps, impulse=1, orthogonalized=True) + assert_allclose(actual, np.c_[oirf_10, oirf_11], atol=1e-6) + + # Impulse response passing column name + data = get_macrodata().view((float, 3), type=np.ndarray) + + df = pd.DataFrame({"a": data[:, 0], "b": data[:, 1], "c": data[:, 2]}) + + mod1 = varmax.VARMAX(df, order=(1, 0), trend="c") + mod1_result = mod1.fit() + mod2 = varmax.VARMAX(data, order=(1, 0), trend="c") + mod2_result = mod2.fit() + + with pytest.raises(ValueError, match=r"Endog must be pd.DataFrame."): + mod2_result.impulse_responses(6, impulse="b") + + response1 = mod1_result.impulse_responses(6, impulse="b") + response2 = mod1_result.impulse_responses(6, impulse=[0, 1, 0]) + assert_allclose(response1, response2) + + # VARMA(2, 2) + trend + exog + # TODO: This is just a smoke test + rs = np.random.RandomState(2867613) + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + mod = varmax.VARMAX( + rs.normal(size=(steps, 2)), + order=(2, 2), + trend="c", + exog=np.ones(steps), + enforce_stationarity=False, + enforce_invertibility=False, + ) + mod.impulse_responses(mod.start_params, steps) + + +def test_dynamic_factor(): + rs = np.random.RandomState(2867611) + steps = 10 + exog = rs.normal(size=steps) + + # DFM: 2 series, AR(2) factor + mod1 = dynamic_factor.DynamicFactor([[0, 0]], k_factors=1, factor_order=2) + mod2 = sarimax.SARIMAX([0], order=(2, 0, 0)) + actual = mod1.impulse_responses([-0.9, 0.8, 1.0, 1.0, 0.5, 0.2], steps) + desired = mod2.impulse_responses([0.5, 0.2, 1], steps) + assert_allclose(actual[:, 0], -0.9 * desired) + assert_allclose(actual[:, 1], 0.8 * desired) + + # DFM: 2 series, AR(2) factor, exog + mod1 = dynamic_factor.DynamicFactor( + np.zeros((steps, 2)), k_factors=1, factor_order=2, exog=exog + ) + mod2 = sarimax.SARIMAX([0], order=(2, 0, 0)) + actual = mod1.impulse_responses([-0.9, 0.8, 5, -2, 1.0, 1.0, 0.5, 0.2], steps) + desired = mod2.impulse_responses([0.5, 0.2, 1], steps) + assert_allclose(actual[:, 0], -0.9 * desired) + assert_allclose(actual[:, 1], 0.8 * desired) + + # DFM, 3 series, VAR(2) factor, exog, error VAR + # TODO: This is just a smoke test + mod = dynamic_factor.DynamicFactor( + rs.normal(size=(steps, 3)), + k_factors=2, + factor_order=2, + exog=exog, + error_order=2, + error_var=True, + enforce_stationarity=False, + ) + mod.impulse_responses(mod.start_params, steps) + + +def test_time_varying_ssm(): + # Create an ad-hoc time-varying model + mod = sarimax.SARIMAX([0] * 11, order=(1, 0, 0)) + mod.update([0.5, 1.0]) + T = np.zeros((1, 1, 11)) + T[..., :5] = 0.5 + T[..., 5:] = 0.2 + mod["transition"] = T + + irfs = mod.ssm.impulse_responses() + desired = np.cumprod(np.r_[1, [0.5] * 4, [0.2] * 5]).reshape(10, 1) + assert_allclose(irfs, desired) + + +class TVSS(mlemodel.MLEModel): + """ + Time-varying state space model for testing + + This creates a state space model with randomly generated time-varying + system matrices. + + Uses a fixed RandomState. Modification needed for more general purpose use. + """ + + def __init__(self, endog, _k_states=None): + k_states = 2 + k_posdef = 2 + # Allow subcasses to add additional states + if _k_states is None: + _k_states = k_states + super().__init__( + endog, k_states=_k_states, k_posdef=k_posdef, initialization="diffuse" + ) + rs = np.random.RandomState(2867611) + self["obs_intercept"] = rs.normal(size=(self.k_endog, self.nobs)) + self["design"] = np.zeros((self.k_endog, self.k_states, self.nobs)) + self["transition"] = np.zeros((self.k_states, self.k_states, self.nobs)) + self["selection"] = np.zeros((self.k_states, self.ssm.k_posdef, self.nobs)) + self["design", :, :k_states, :] = rs.normal( + size=(self.k_endog, k_states, self.nobs) + ) + # For the transition matrices, enforce eigenvalues not too far outside + # unit circle. Otherwise, the random draws will often lead to large + # eigenvalues that cause the covariance matrices to blow up to huge + # values during long periods of missing data, which leads to numerical + # problems and essentially spurious test failures + D = [np.diag(d) for d in rs.uniform(-1.1, 1.1, size=(self.nobs, k_states))] + Q = ortho_group.rvs(k_states, size=self.nobs, random_state=rs) + self["transition", :k_states, :k_states, :] = ( + Q @ D @ Q.transpose(0, 2, 1) + ).transpose(1, 2, 0) + self["selection", :k_states, :, :] = rs.normal( + size=(k_states, self.ssm.k_posdef, self.nobs) + ) + + # Need to make sure the covariances are positive definite + H05 = rs.normal(size=(self.k_endog, self.k_endog, self.nobs)) + Q05 = rs.normal(size=(self.ssm.k_posdef, self.ssm.k_posdef, self.nobs)) + H = np.zeros_like(H05) + Q = np.zeros_like(Q05) + for t in range(self.nobs): + H[..., t] = np.dot(H05[..., t], H05[..., t].T) + Q[..., t] = np.dot(Q05[..., t], Q05[..., t].T) + self["obs_cov"] = H + self["state_cov"] = Q + + def clone(self, endog, exog=None, **kwargs): + mod = self.__class__(endog, **kwargs) + + for key in self.ssm.shapes.keys(): + if key in ["obs", "state_intercept"]: + continue + n = min(self.nobs, mod.nobs) + mod[key, ..., :n] = self.ssm[key, ..., :n] + + return mod + + +def test_time_varying_in_sample(): + mod = TVSS(np.zeros((10, 2))) + + # Compute the max number of in-sample IRFs + irfs = mod.impulse_responses([], steps=mod.nobs - 1) + # Compute the same thing, but now with explicit anchor argument + irfs_anchor = mod.impulse_responses([], steps=mod.nobs - 1, anchor=0) + + # Cumulative IRFs + cirfs = mod.impulse_responses([], steps=mod.nobs - 1, cumulative=True) + # Orthogonalized IRFs + oirfs = mod.impulse_responses([], steps=mod.nobs - 1, orthogonalized=True) + # Cumulative, orthogonalized IRFs + coirfs = mod.impulse_responses( + [], steps=mod.nobs - 1, cumulative=True, orthogonalized=True + ) + + # Compute IRFs manually + Z = mod["design"] + T = mod["transition"] + R = mod["selection"] + Q = mod["state_cov", ..., 0] + L = np.linalg.cholesky(Q) + + desired_irfs = np.zeros((mod.nobs - 1, 2)) * np.nan + desired_oirfs = np.zeros((mod.nobs - 1, 2)) * np.nan + tmp = R[..., 0] + for i in range(1, mod.nobs): + desired_irfs[i - 1] = Z[:, :, i].dot(tmp)[:, 0] + desired_oirfs[i - 1] = Z[:, :, i].dot(tmp).dot(L)[:, 0] + tmp = T[:, :, i].dot(tmp) + + assert_allclose(irfs, desired_irfs) + assert_allclose(irfs_anchor, desired_irfs) + + assert_allclose(cirfs, np.cumsum(desired_irfs, axis=0)) + assert_allclose(oirfs, desired_oirfs) + assert_allclose(coirfs, np.cumsum(desired_oirfs, axis=0)) + + +def test_time_varying_out_of_sample(): + rs = np.random.RandomState(2867611) + mod = TVSS(np.zeros((10, 2))) + + # Compute all in-sample IRFs and also one out-of-sample IRF + new_Z = rs.normal(size=mod["design", :, :, -1].shape) + new_T = rs.normal(size=mod["transition", :, :, -1].shape) + irfs = mod.impulse_responses( + [], steps=mod.nobs, design=new_Z[:, :, None], transition=new_T[:, :, None] + ) + # Compute the same thing, but now with explicit anchor argument + irfs_anchor = mod.impulse_responses( + [], + steps=mod.nobs, + anchor=0, + design=new_Z[:, :, None], + transition=new_T[:, :, None], + ) + + # Cumulative IRFs + cirfs = mod.impulse_responses( + [], + steps=mod.nobs, + design=new_Z[:, :, None], + transition=new_T[:, :, None], + cumulative=True, + ) + # Orthogonalized IRFs + oirfs = mod.impulse_responses( + [], + steps=mod.nobs, + design=new_Z[:, :, None], + transition=new_T[:, :, None], + orthogonalized=True, + ) + # Cumulative, orthogonalized IRFs + coirfs = mod.impulse_responses( + [], + steps=mod.nobs, + design=new_Z[:, :, None], + transition=new_T[:, :, None], + cumulative=True, + orthogonalized=True, + ) + + # Compute IRFs manually + Z = mod["design"] + T = mod["transition"] + R = mod["selection"] + Q = mod["state_cov", ..., 0] + L = np.linalg.cholesky(Q) + + desired_irfs = np.zeros((mod.nobs, 2)) * np.nan + desired_oirfs = np.zeros((mod.nobs, 2)) * np.nan + tmp = R[..., 0] + for i in range(1, mod.nobs): + desired_irfs[i - 1] = Z[:, :, i].dot(tmp)[:, 0] + desired_oirfs[i - 1] = Z[:, :, i].dot(tmp).dot(L)[:, 0] + tmp = T[:, :, i].dot(tmp) + desired_irfs[mod.nobs - 1] = new_Z.dot(tmp)[:, 0] + desired_oirfs[mod.nobs - 1] = new_Z.dot(tmp).dot(L)[:, 0] + + assert_allclose(irfs, desired_irfs) + assert_allclose(irfs_anchor, desired_irfs) + + assert_allclose(cirfs, np.cumsum(desired_irfs, axis=0)) + assert_allclose(oirfs, desired_oirfs) + assert_allclose(coirfs, np.cumsum(desired_oirfs, axis=0)) + + +def test_time_varying_in_sample_anchored(): + mod = TVSS(np.zeros((10, 2))) + + # Compute the max number of in-sample IRFs + anchor = 2 + irfs = mod.impulse_responses([], steps=mod.nobs - 1 - anchor, anchor=anchor) + + # Cumulative IRFs + cirfs = mod.impulse_responses( + [], steps=mod.nobs - 1 - anchor, anchor=anchor, cumulative=True + ) + # Orthogonalized IRFs + oirfs = mod.impulse_responses( + [], steps=mod.nobs - 1 - anchor, anchor=anchor, orthogonalized=True + ) + # Cumulative, orthogonalized IRFs + coirfs = mod.impulse_responses( + [], + steps=mod.nobs - 1 - anchor, + anchor=anchor, + cumulative=True, + orthogonalized=True, + ) + + # Compute IRFs manually + Z = mod["design"] + T = mod["transition"] + R = mod["selection"] + Q = mod["state_cov", ..., anchor] + L = np.linalg.cholesky(Q) + + desired_irfs = np.zeros((mod.nobs - anchor - 1, 2)) * np.nan + desired_oirfs = np.zeros((mod.nobs - anchor - 1, 2)) * np.nan + tmp = R[..., anchor] + for i in range(1, mod.nobs - anchor): + desired_irfs[i - 1] = Z[:, :, i + anchor].dot(tmp)[:, 0] + desired_oirfs[i - 1] = Z[:, :, i + anchor].dot(tmp).dot(L)[:, 0] + tmp = T[:, :, i + anchor].dot(tmp) + + assert_allclose(irfs, desired_irfs) + + assert_allclose(cirfs, np.cumsum(desired_irfs, axis=0)) + assert_allclose(oirfs, desired_oirfs) + assert_allclose(coirfs, np.cumsum(desired_oirfs, axis=0)) + + +def test_time_varying_out_of_sample_anchored(): + mod = TVSS(np.zeros((10, 2))) + + # Compute all in-sample IRFs and also one out-of-sample IRF + anchor = 2 + + new_Z = mod["design", :, :, -1] + new_T = mod["transition", :, :, -1] + irfs = mod.impulse_responses( + [], + steps=mod.nobs - anchor, + anchor=anchor, + design=new_Z[:, :, None], + transition=new_T[:, :, None], + ) + + # Cumulative IRFs + cirfs = mod.impulse_responses( + [], + steps=mod.nobs - anchor, + anchor=anchor, + design=new_Z[:, :, None], + transition=new_T[:, :, None], + cumulative=True, + ) + # Orthogonalized IRFs + oirfs = mod.impulse_responses( + [], + steps=mod.nobs - anchor, + anchor=anchor, + design=new_Z[:, :, None], + transition=new_T[:, :, None], + orthogonalized=True, + ) + # Cumulative, orthogonalized IRFs + coirfs = mod.impulse_responses( + [], + steps=mod.nobs - anchor, + anchor=anchor, + design=new_Z[:, :, None], + transition=new_T[:, :, None], + cumulative=True, + orthogonalized=True, + ) + + # Compute IRFs manually + Z = mod["design"] + T = mod["transition"] + R = mod["selection"] + Q = mod["state_cov", ..., anchor] + L = np.linalg.cholesky(Q) + + desired_irfs = np.zeros((mod.nobs - anchor, 2)) * np.nan + desired_oirfs = np.zeros((mod.nobs - anchor, 2)) * np.nan + tmp = R[..., anchor] + for i in range(1, mod.nobs - anchor): + desired_irfs[i - 1] = Z[:, :, i + anchor].dot(tmp)[:, 0] + desired_oirfs[i - 1] = Z[:, :, i + anchor].dot(tmp).dot(L)[:, 0] + tmp = T[:, :, i + anchor].dot(tmp) + desired_irfs[mod.nobs - anchor - 1] = new_Z.dot(tmp)[:, 0] + desired_oirfs[mod.nobs - anchor - 1] = new_Z.dot(tmp).dot(L)[:, 0] + + assert_allclose(irfs, desired_irfs) + + assert_allclose(cirfs, np.cumsum(desired_irfs, axis=0)) + assert_allclose(oirfs, desired_oirfs) + assert_allclose(coirfs, np.cumsum(desired_oirfs, axis=0)) + + +def test_time_varying_out_of_sample_anchored_end(): + rs = np.random.RandomState(2867611) + mod = TVSS(np.zeros((10, 2))) + + # Cannot compute the any in-sample IRFs when anchoring at the end + with pytest.raises(ValueError, match="Model has time-varying"): + mod.impulse_responses([], steps=2, anchor="end") + + # Compute two out-of-sample IRFs + new_Z = rs.normal(size=mod["design", :, :, -2:].shape) + new_T = rs.normal(size=mod["transition", :, :, -2:].shape) + irfs = mod.impulse_responses( + [], steps=2, anchor="end", design=new_Z, transition=new_T + ) + + # Cumulative IRFs + cirfs = mod.impulse_responses( + [], steps=2, anchor="end", design=new_Z, transition=new_T, cumulative=True + ) + # Orthogonalized IRFs + oirfs = mod.impulse_responses( + [], steps=2, anchor="end", design=new_Z, transition=new_T, orthogonalized=True + ) + # Cumulative, orthogonalized IRFs + coirfs = mod.impulse_responses( + [], + steps=2, + anchor="end", + design=new_Z, + transition=new_T, + cumulative=True, + orthogonalized=True, + ) + + # Compute IRFs manually + R = mod["selection"] + Q = mod["state_cov", ..., -1] + L = np.linalg.cholesky(Q) + + desired_irfs = np.zeros((2, 2)) * np.nan + desired_oirfs = np.zeros((2, 2)) * np.nan + # desired[0] = 0 + # Z_{T+1} R_T + tmp = R[..., -1] + desired_irfs[0] = new_Z[:, :, 0].dot(tmp)[:, 0] + desired_oirfs[0] = new_Z[:, :, 0].dot(tmp).dot(L)[:, 0] + # T_{T+1} R_T + tmp = new_T[..., 0].dot(tmp) + # Z_{T+2} T_{T+1} R_T + desired_irfs[1] = new_Z[:, :, 1].dot(tmp)[:, 0] + desired_oirfs[1] = new_Z[:, :, 1].dot(tmp).dot(L)[:, 0] + + assert_allclose(irfs, desired_irfs) + + assert_allclose(cirfs, np.cumsum(desired_irfs, axis=0)) + assert_allclose(oirfs, desired_oirfs) + assert_allclose(coirfs, np.cumsum(desired_oirfs, axis=0)) + + +def test_pandas_univariate_rangeindex(): + # Impulse responses have RangeIndex + endog = pd.Series(np.zeros(1)) + mod = sarimax.SARIMAX(endog) + res = mod.filter([0.5, 1.0]) + + actual = res.impulse_responses(2) + desired = pd.Series([1.0, 0.5, 0.25]) + assert_allclose(res.impulse_responses(2), desired) + assert_(actual.index.equals(desired.index)) + + +def test_pandas_univariate_dateindex(): + # Impulse responses still have RangeIndex (i.e., aren't wrapped with dates) + ix = pd.date_range(start="2000", periods=1, freq=MONTH_END) + endog = pd.Series(np.zeros(1), index=ix) + mod = sarimax.SARIMAX(endog) + res = mod.filter([0.5, 1.0]) + + actual = res.impulse_responses(2) + desired = pd.Series([1.0, 0.5, 0.25]) + assert_allclose(res.impulse_responses(2), desired) + assert_(actual.index.equals(desired.index)) + + +def test_pandas_multivariate_rangeindex(): + # Impulse responses have RangeIndex + endog = pd.DataFrame(np.zeros((1, 2))) + mod = varmax.VARMAX(endog, trend="n") + res = mod.filter([0.5, 0.0, 0.0, 0.2, 1.0, 0.0, 1.0]) + + actual = res.impulse_responses(2) + desired = pd.DataFrame([[1.0, 0.5, 0.25], [0.0, 0.0, 0.0]]).T + assert_allclose(actual, desired) + assert_(actual.index.equals(desired.index)) + + +def test_pandas_multivariate_dateindex(): + # Impulse responses still have RangeIndex (i.e., aren't wrapped with dates) + ix = pd.date_range(start="2000", periods=1, freq=MONTH_END) + endog = pd.DataFrame(np.zeros((1, 2)), index=ix) + mod = varmax.VARMAX(endog, trend="n") + res = mod.filter([0.5, 0.0, 0.0, 0.2, 1.0, 0.0, 1.0]) + + actual = res.impulse_responses(2) + desired = pd.DataFrame([[1.0, 0.5, 0.25], [0.0, 0.0, 0.0]]).T + assert_allclose(actual, desired) + assert_(actual.index.equals(desired.index)) + + +def test_pandas_anchor(): + # Test that anchor with dates works + ix = pd.date_range(start="2000", periods=10, freq=MONTH_END) + endog = pd.DataFrame(np.zeros((10, 2)), index=ix) + mod = TVSS(endog) + res = mod.filter([]) + + desired = res.impulse_responses(2, anchor=1) + + # Anchor to date + actual = res.impulse_responses(2, anchor=ix[1]) + assert_allclose(actual, desired) + assert_(actual.index.equals(desired.index)) + + # Anchor to negative index + actual = res.impulse_responses(2, anchor=-9) + assert_allclose(actual, desired) + assert_(actual.index.equals(desired.index)) diff --git a/shared/package-files/4a/4a77d4fc2137fdd05091b8bf4a43c6aac13c78382cb58ba9971ed70f12892320/transpose.py b/shared/package-files/4a/4a77d4fc2137fdd05091b8bf4a43c6aac13c78382cb58ba9971ed70f12892320/transpose.py new file mode 100644 index 0000000000000000000000000000000000000000..c83e3e27c191144e0052c902d3ab151315f94dd7 --- /dev/null +++ b/shared/package-files/4a/4a77d4fc2137fdd05091b8bf4a43c6aac13c78382cb58ba9971ed70f12892320/transpose.py @@ -0,0 +1,105 @@ +from sympy.core.basic import Basic +from sympy.functions import adjoint, conjugate + +from sympy.matrices.expressions.matexpr import MatrixExpr + + +class Transpose(MatrixExpr): + """ + The transpose of a matrix expression. + + This is a symbolic object that simply stores its argument without + evaluating it. To actually compute the transpose, use the ``transpose()`` + function, or the ``.T`` attribute of matrices. + + Examples + ======== + + >>> from sympy import MatrixSymbol, Transpose, transpose + >>> A = MatrixSymbol('A', 3, 5) + >>> B = MatrixSymbol('B', 5, 3) + >>> Transpose(A) + A.T + >>> A.T == transpose(A) == Transpose(A) + True + >>> Transpose(A*B) + (A*B).T + >>> transpose(A*B) + B.T*A.T + + """ + is_Transpose = True + + def doit(self, **hints): + arg = self.arg + if hints.get('deep', True) and isinstance(arg, Basic): + arg = arg.doit(**hints) + _eval_transpose = getattr(arg, '_eval_transpose', None) + if _eval_transpose is not None: + result = _eval_transpose() + return result if result is not None else Transpose(arg) + else: + return Transpose(arg) + + @property + def arg(self): + return self.args[0] + + @property + def shape(self): + return self.arg.shape[::-1] + + def _entry(self, i, j, expand=False, **kwargs): + return self.arg._entry(j, i, expand=expand, **kwargs) + + def _eval_adjoint(self): + return conjugate(self.arg) + + def _eval_conjugate(self): + return adjoint(self.arg) + + def _eval_transpose(self): + return self.arg + + def _eval_trace(self): + from .trace import Trace + return Trace(self.arg) # Trace(X.T) => Trace(X) + + def _eval_determinant(self): + from sympy.matrices.expressions.determinant import det + return det(self.arg) + + def _eval_derivative(self, x): + # x is a scalar: + return self.arg._eval_derivative(x) + + def _eval_derivative_matrix_lines(self, x): + lines = self.args[0]._eval_derivative_matrix_lines(x) + return [i.transpose() for i in lines] + + +def transpose(expr): + """Matrix transpose""" + return Transpose(expr).doit(deep=False) + + +from sympy.assumptions.ask import ask, Q +from sympy.assumptions.refine import handlers_dict + + +def refine_Transpose(expr, assumptions): + """ + >>> from sympy import MatrixSymbol, Q, assuming, refine + >>> X = MatrixSymbol('X', 2, 2) + >>> X.T + X.T + >>> with assuming(Q.symmetric(X)): + ... print(refine(X.T)) + X + """ + if ask(Q.symmetric(expr), assumptions): + return expr.arg + + return expr + +handlers_dict['Transpose'] = refine_Transpose diff --git a/shared/package-files/4a/4a7c442c1f5b704f07ebcb5850337750a30c3eefac11f6f04e52d49fc5a2ad5f/test_autocorr.py b/shared/package-files/4a/4a7c442c1f5b704f07ebcb5850337750a30c3eefac11f6f04e52d49fc5a2ad5f/test_autocorr.py new file mode 100644 index 0000000000000000000000000000000000000000..c1d768cf02f37baceb01b9ef39b91e419cef1e0f --- /dev/null +++ b/shared/package-files/4a/4a7c442c1f5b704f07ebcb5850337750a30c3eefac11f6f04e52d49fc5a2ad5f/test_autocorr.py @@ -0,0 +1,30 @@ +import numpy as np + + +class TestAutoCorr: + def test_autocorr(self, datetime_series): + # Just run the function + corr1 = datetime_series.autocorr() + + # Now run it with the lag parameter + corr2 = datetime_series.autocorr(lag=1) + + # corr() with lag needs Series of at least length 2 + if len(datetime_series) <= 2: + assert np.isnan(corr1) + assert np.isnan(corr2) + else: + assert corr1 == corr2 + + # Choose a random lag between 1 and length of Series - 2 + # and compare the result with the Series corr() function + n = 1 + np.random.default_rng(2).integers(max(1, len(datetime_series) - 2)) + corr1 = datetime_series.corr(datetime_series.shift(n)) + corr2 = datetime_series.autocorr(lag=n) + + # corr() with lag needs Series of at least length 2 + if len(datetime_series) <= 2: + assert np.isnan(corr1) + assert np.isnan(corr2) + else: + assert corr1 == corr2 diff --git a/shared/package-files/4a/4a7c44dd11ae3dcbc0f44fa6c14f6684f0a04f35fbf6f309f3fdee4db55b53a0/results_arma_forecasts.csv b/shared/package-files/4a/4a7c44dd11ae3dcbc0f44fa6c14f6684f0a04f35fbf6f309f3fdee4db55b53a0/results_arma_forecasts.csv new file mode 100644 index 0000000000000000000000000000000000000000..6c64a1a4019bf7ac173b73933ed218673520051c --- /dev/null +++ b/shared/package-files/4a/4a7c44dd11ae3dcbc0f44fa6c14f6684f0a04f35fbf6f309f3fdee4db55b53a0/results_arma_forecasts.csv @@ -0,0 +1,11 @@ +"fc11","fe11","fc41","fe41","fc50","fe50","fc11c","fe11c","fc41c","fe41c","fc50c","fe50c" +-0.0931139795,0.994743,-0.4298095393,0.91141,1.24361,0.938375,4.2276592922,1.03917,-1.3985445949,0.915488,4.779739852,0.973931 +-0.073415913,1.53122,-1.4961938371,1.22521,0.484195,1.16009,4.4387131881,1.52336,3.0228581596,1.29504,4.692859693,1.21992 +-0.057884931,1.78523,-3.770193621,1.2607,0.722602,1.17762,4.5789296469,1.6936,4.071345984,1.37495,3.8280155603,1.24654 +-0.0456394955,1.92633,-3.6148341892,1.27585,1.09664,1.20138,4.6720843135,1.76352,0.8457602276,1.38243,3.9467079457,1.26508 +-0.0359845562,2.00905,-1.5553772244,1.29131,0.854109,1.31833,4.7339728534,1.79351,-2.3126724383,1.39737,4.5998286564,1.37737 +-0.028372099,2.05881,-0.3162209074,1.49296,0.510239,1.39506,4.7750893268,1.80659,-0.833875753,1.5901,4.59173986,1.4486 +-0.0223700411,2.08914,-1.6253254747,1.67599,0.579206,1.41288,4.802405602,1.81234,2.8363368346,1.83677,4.1878148976,1.45879 +-0.017637706,2.10777,-3.3986372227,1.68533,0.721688,1.43171,4.8205535323,1.81487,3.7095186811,1.86802,4.2337457799,1.46621 +-0.0139064864,2.11928,-3.150618693,1.69048,0.60394,1.47332,4.8326103507,1.81598,0.6042207231,1.86845,4.553063531,1.49431 +-0.0109645984,2.1264,-1.2381045022,1.70353,0.43997,1.50507,4.8406204582,1.81647,-1.9229410947,1.87871,4.562562544,1.51482 diff --git a/shared/package-files/4a/4a7d9a475cb589ba15c73d02d7210cc3f3046c11e0c5b4a62e96c7da76f6294d/reflection_pad1d_backward_meta_dispatch.h b/shared/package-files/4a/4a7d9a475cb589ba15c73d02d7210cc3f3046c11e0c5b4a62e96c7da76f6294d/reflection_pad1d_backward_meta_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..475ba2a8f9f30b529c854c633fa62b265bfa2c2b --- /dev/null +++ b/shared/package-files/4a/4a7d9a475cb589ba15c73d02d7210cc3f3046c11e0c5b4a62e96c7da76f6294d/reflection_pad1d_backward_meta_dispatch.h @@ -0,0 +1,28 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace meta { + +TORCH_API at::Tensor reflection_pad1d_backward(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding); +TORCH_API at::Tensor reflection_pad1d_backward_symint(const at::Tensor & grad_output, const at::Tensor & self, c10::SymIntArrayRef padding); +TORCH_API at::Tensor & reflection_pad1d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding); +TORCH_API at::Tensor & reflection_pad1d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding, at::Tensor & grad_input); +TORCH_API at::Tensor & reflection_pad1d_backward_symint_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, c10::SymIntArrayRef padding); +TORCH_API at::Tensor & reflection_pad1d_backward_symint_outf(const at::Tensor & grad_output, const at::Tensor & self, c10::SymIntArrayRef padding, at::Tensor & grad_input); + +} // namespace meta +} // namespace at diff --git a/shared/package-files/4a/4a7dfe378fe06bedb44f3de92d4db1b5b435430af801a6c12ff613a785ea5a69/index_fill_compositeimplicitautograd_dispatch.h b/shared/package-files/4a/4a7dfe378fe06bedb44f3de92d4db1b5b435430af801a6c12ff613a785ea5a69/index_fill_compositeimplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..67d83db26f9da694c4ce49025dfe38448a971d8d --- /dev/null +++ b/shared/package-files/4a/4a7dfe378fe06bedb44f3de92d4db1b5b435430af801a6c12ff613a785ea5a69/index_fill_compositeimplicitautograd_dispatch.h @@ -0,0 +1,26 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeimplicitautograd { + +TORCH_API at::Tensor & index_fill_(at::Tensor & self, at::Dimname dim, const at::Tensor & index, const at::Scalar & value); +TORCH_API at::Tensor index_fill(const at::Tensor & self, at::Dimname dim, const at::Tensor & index, const at::Scalar & value); +TORCH_API at::Tensor & index_fill_(at::Tensor & self, at::Dimname dim, const at::Tensor & index, const at::Tensor & value); +TORCH_API at::Tensor index_fill(const at::Tensor & self, at::Dimname dim, const at::Tensor & index, const at::Tensor & value); + +} // namespace compositeimplicitautograd +} // namespace at diff --git a/shared/package-files/4a/4a8018471edac7b4efe753326330e56777cdebcdb1e13e8df3245e5f62dae3e2/_fourier.py b/shared/package-files/4a/4a8018471edac7b4efe753326330e56777cdebcdb1e13e8df3245e5f62dae3e2/_fourier.py new file mode 100644 index 0000000000000000000000000000000000000000..bb5ffa6b9287cb740611aefba5f1f322011518cf --- /dev/null +++ b/shared/package-files/4a/4a8018471edac7b4efe753326330e56777cdebcdb1e13e8df3245e5f62dae3e2/_fourier.py @@ -0,0 +1,306 @@ +# Copyright (C) 2003-2005 Peter J. Verveer +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# 3. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior +# written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import numpy as np +from scipy._lib._util import normalize_axis_index +from . import _ni_support +from . import _nd_image + +__all__ = ['fourier_gaussian', 'fourier_uniform', 'fourier_ellipsoid', + 'fourier_shift'] + + +def _get_output_fourier(output, input): + if output is None: + if input.dtype.type in [np.complex64, np.complex128, np.float32]: + output = np.zeros(input.shape, dtype=input.dtype) + else: + output = np.zeros(input.shape, dtype=np.float64) + elif type(output) is type: + if output not in [np.complex64, np.complex128, + np.float32, np.float64]: + raise RuntimeError("output type not supported") + output = np.zeros(input.shape, dtype=output) + elif output.shape != input.shape: + raise RuntimeError("output shape not correct") + return output + + +def _get_output_fourier_complex(output, input): + if output is None: + if input.dtype.type in [np.complex64, np.complex128]: + output = np.zeros(input.shape, dtype=input.dtype) + else: + output = np.zeros(input.shape, dtype=np.complex128) + elif type(output) is type: + if output not in [np.complex64, np.complex128]: + raise RuntimeError("output type not supported") + output = np.zeros(input.shape, dtype=output) + elif output.shape != input.shape: + raise RuntimeError("output shape not correct") + return output + + +def fourier_gaussian(input, sigma, n=-1, axis=-1, output=None): + """ + Multidimensional Gaussian fourier filter. + + The array is multiplied with the fourier transform of a Gaussian + kernel. + + Parameters + ---------- + input : array_like + The input array. + sigma : float or sequence + The sigma of the Gaussian kernel. If a float, `sigma` is the same for + all axes. If a sequence, `sigma` has to contain one value for each + axis. + n : int, optional + If `n` is negative (default), then the input is assumed to be the + result of a complex fft. + If `n` is larger than or equal to zero, the input is assumed to be the + result of a real fft, and `n` gives the length of the array before + transformation along the real transform direction. + axis : int, optional + The axis of the real transform. + output : ndarray, optional + If given, the result of filtering the input is placed in this array. + + Returns + ------- + fourier_gaussian : ndarray + The filtered input. + + Examples + -------- + >>> from scipy import ndimage, datasets + >>> import numpy.fft + >>> import matplotlib.pyplot as plt + >>> fig, (ax1, ax2) = plt.subplots(1, 2) + >>> plt.gray() # show the filtered result in grayscale + >>> ascent = datasets.ascent() + >>> input_ = numpy.fft.fft2(ascent) + >>> result = ndimage.fourier_gaussian(input_, sigma=4) + >>> result = numpy.fft.ifft2(result) + >>> ax1.imshow(ascent) + >>> ax2.imshow(result.real) # the imaginary part is an artifact + >>> plt.show() + """ + input = np.asarray(input) + output = _get_output_fourier(output, input) + axis = normalize_axis_index(axis, input.ndim) + sigmas = _ni_support._normalize_sequence(sigma, input.ndim) + sigmas = np.asarray(sigmas, dtype=np.float64) + if not sigmas.flags.contiguous: + sigmas = sigmas.copy() + + _nd_image.fourier_filter(input, sigmas, n, axis, output, 0) + return output + + +def fourier_uniform(input, size, n=-1, axis=-1, output=None): + """ + Multidimensional uniform fourier filter. + + The array is multiplied with the Fourier transform of a box of given + size. + + Parameters + ---------- + input : array_like + The input array. + size : float or sequence + The size of the box used for filtering. + If a float, `size` is the same for all axes. If a sequence, `size` has + to contain one value for each axis. + n : int, optional + If `n` is negative (default), then the input is assumed to be the + result of a complex fft. + If `n` is larger than or equal to zero, the input is assumed to be the + result of a real fft, and `n` gives the length of the array before + transformation along the real transform direction. + axis : int, optional + The axis of the real transform. + output : ndarray, optional + If given, the result of filtering the input is placed in this array. + + Returns + ------- + fourier_uniform : ndarray + The filtered input. + + Examples + -------- + >>> from scipy import ndimage, datasets + >>> import numpy.fft + >>> import matplotlib.pyplot as plt + >>> fig, (ax1, ax2) = plt.subplots(1, 2) + >>> plt.gray() # show the filtered result in grayscale + >>> ascent = datasets.ascent() + >>> input_ = numpy.fft.fft2(ascent) + >>> result = ndimage.fourier_uniform(input_, size=20) + >>> result = numpy.fft.ifft2(result) + >>> ax1.imshow(ascent) + >>> ax2.imshow(result.real) # the imaginary part is an artifact + >>> plt.show() + """ + input = np.asarray(input) + output = _get_output_fourier(output, input) + axis = normalize_axis_index(axis, input.ndim) + sizes = _ni_support._normalize_sequence(size, input.ndim) + sizes = np.asarray(sizes, dtype=np.float64) + if not sizes.flags.contiguous: + sizes = sizes.copy() + _nd_image.fourier_filter(input, sizes, n, axis, output, 1) + return output + + +def fourier_ellipsoid(input, size, n=-1, axis=-1, output=None): + """ + Multidimensional ellipsoid Fourier filter. + + The array is multiplied with the fourier transform of an ellipsoid of + given sizes. + + Parameters + ---------- + input : array_like + The input array. + size : float or sequence + The size of the box used for filtering. + If a float, `size` is the same for all axes. If a sequence, `size` has + to contain one value for each axis. + n : int, optional + If `n` is negative (default), then the input is assumed to be the + result of a complex fft. + If `n` is larger than or equal to zero, the input is assumed to be the + result of a real fft, and `n` gives the length of the array before + transformation along the real transform direction. + axis : int, optional + The axis of the real transform. + output : ndarray, optional + If given, the result of filtering the input is placed in this array. + + Returns + ------- + fourier_ellipsoid : ndarray + The filtered input. + + Notes + ----- + This function is implemented for arrays of rank 1, 2, or 3. + + Examples + -------- + >>> from scipy import ndimage, datasets + >>> import numpy.fft + >>> import matplotlib.pyplot as plt + >>> fig, (ax1, ax2) = plt.subplots(1, 2) + >>> plt.gray() # show the filtered result in grayscale + >>> ascent = datasets.ascent() + >>> input_ = numpy.fft.fft2(ascent) + >>> result = ndimage.fourier_ellipsoid(input_, size=20) + >>> result = numpy.fft.ifft2(result) + >>> ax1.imshow(ascent) + >>> ax2.imshow(result.real) # the imaginary part is an artifact + >>> plt.show() + """ + input = np.asarray(input) + if input.ndim > 3: + raise NotImplementedError("Only 1d, 2d and 3d inputs are supported") + output = _get_output_fourier(output, input) + if output.size == 0: + # The C code has a bug that can result in a segfault with arrays + # that have size 0 (gh-17270), so check here. + return output + axis = normalize_axis_index(axis, input.ndim) + sizes = _ni_support._normalize_sequence(size, input.ndim) + sizes = np.asarray(sizes, dtype=np.float64) + if not sizes.flags.contiguous: + sizes = sizes.copy() + _nd_image.fourier_filter(input, sizes, n, axis, output, 2) + return output + + +def fourier_shift(input, shift, n=-1, axis=-1, output=None): + """ + Multidimensional Fourier shift filter. + + The array is multiplied with the Fourier transform of a shift operation. + + Parameters + ---------- + input : array_like + The input array. + shift : float or sequence + The size of the box used for filtering. + If a float, `shift` is the same for all axes. If a sequence, `shift` + has to contain one value for each axis. + n : int, optional + If `n` is negative (default), then the input is assumed to be the + result of a complex fft. + If `n` is larger than or equal to zero, the input is assumed to be the + result of a real fft, and `n` gives the length of the array before + transformation along the real transform direction. + axis : int, optional + The axis of the real transform. + output : ndarray, optional + If given, the result of shifting the input is placed in this array. + + Returns + ------- + fourier_shift : ndarray + The shifted input. + + Examples + -------- + >>> from scipy import ndimage, datasets + >>> import matplotlib.pyplot as plt + >>> import numpy.fft + >>> fig, (ax1, ax2) = plt.subplots(1, 2) + >>> plt.gray() # show the filtered result in grayscale + >>> ascent = datasets.ascent() + >>> input_ = numpy.fft.fft2(ascent) + >>> result = ndimage.fourier_shift(input_, shift=200) + >>> result = numpy.fft.ifft2(result) + >>> ax1.imshow(ascent) + >>> ax2.imshow(result.real) # the imaginary part is an artifact + >>> plt.show() + """ + input = np.asarray(input) + output = _get_output_fourier_complex(output, input) + axis = normalize_axis_index(axis, input.ndim) + shifts = _ni_support._normalize_sequence(shift, input.ndim) + shifts = np.asarray(shifts, dtype=np.float64) + if not shifts.flags.contiguous: + shifts = shifts.copy() + _nd_image.fourier_shift(input, shifts, n, axis, output) + return output diff --git a/shared/package-files/4a/4a8215aea24517d1aef497dffdaa5f6e9aa0f108647c2e905b8ab3a1233eba43/test_convert.py b/shared/package-files/4a/4a8215aea24517d1aef497dffdaa5f6e9aa0f108647c2e905b8ab3a1233eba43/test_convert.py new file mode 100644 index 0000000000000000000000000000000000000000..44bed9438945a39bb5eb85477301f58cfcd70cf0 --- /dev/null +++ b/shared/package-files/4a/4a8215aea24517d1aef497dffdaa5f6e9aa0f108647c2e905b8ab3a1233eba43/test_convert.py @@ -0,0 +1,321 @@ +import pytest + +import networkx as nx +from networkx.convert import ( + from_dict_of_dicts, + from_dict_of_lists, + to_dict_of_dicts, + to_dict_of_lists, + to_networkx_graph, +) +from networkx.generators.classic import barbell_graph, cycle_graph +from networkx.utils import edges_equal, graphs_equal, nodes_equal + + +class TestConvert: + def edgelists_equal(self, e1, e2): + return sorted(sorted(e) for e in e1) == sorted(sorted(e) for e in e2) + + def test_simple_graphs(self): + for dest, source in [ + (to_dict_of_dicts, from_dict_of_dicts), + (to_dict_of_lists, from_dict_of_lists), + ]: + G = barbell_graph(10, 3) + G.graph = {} + dod = dest(G) + + # Dict of [dicts, lists] + GG = source(dod) + assert graphs_equal(G, GG) + GW = to_networkx_graph(dod) + assert graphs_equal(G, GW) + GI = nx.Graph(dod) + assert graphs_equal(G, GI) + + # With nodelist keyword + P4 = nx.path_graph(4) + P3 = nx.path_graph(3) + P4.graph = {} + P3.graph = {} + dod = dest(P4, nodelist=[0, 1, 2]) + Gdod = nx.Graph(dod) + assert graphs_equal(Gdod, P3) + + def test_exceptions(self): + # NX graph + class G: + adj = None + + pytest.raises(nx.NetworkXError, to_networkx_graph, G) + + # pygraphviz agraph + class G: + is_strict = None + + pytest.raises(nx.NetworkXError, to_networkx_graph, G) + + # Dict of [dicts, lists] + G = {"a": 0} + pytest.raises(TypeError, to_networkx_graph, G) + + # list or generator of edges + class G: + next = None + + pytest.raises(nx.NetworkXError, to_networkx_graph, G) + + # no match + pytest.raises(nx.NetworkXError, to_networkx_graph, "a") + + def test_digraphs(self): + for dest, source in [ + (to_dict_of_dicts, from_dict_of_dicts), + (to_dict_of_lists, from_dict_of_lists), + ]: + G = cycle_graph(10) + + # Dict of [dicts, lists] + dod = dest(G) + GG = source(dod) + assert nodes_equal(sorted(G.nodes()), sorted(GG.nodes())) + assert edges_equal(sorted(G.edges()), sorted(GG.edges())) + GW = to_networkx_graph(dod) + assert nodes_equal(sorted(G.nodes()), sorted(GW.nodes())) + assert edges_equal(sorted(G.edges()), sorted(GW.edges())) + GI = nx.Graph(dod) + assert nodes_equal(sorted(G.nodes()), sorted(GI.nodes())) + assert edges_equal(sorted(G.edges()), sorted(GI.edges())) + + G = cycle_graph(10, create_using=nx.DiGraph) + dod = dest(G) + GG = source(dod, create_using=nx.DiGraph) + assert sorted(G.nodes()) == sorted(GG.nodes()) + assert sorted(G.edges()) == sorted(GG.edges()) + GW = to_networkx_graph(dod, create_using=nx.DiGraph) + assert sorted(G.nodes()) == sorted(GW.nodes()) + assert sorted(G.edges()) == sorted(GW.edges()) + GI = nx.DiGraph(dod) + assert sorted(G.nodes()) == sorted(GI.nodes()) + assert sorted(G.edges()) == sorted(GI.edges()) + + def test_graph(self): + g = nx.cycle_graph(10) + G = nx.Graph() + G.add_nodes_from(g) + G.add_weighted_edges_from((u, v, u) for u, v in g.edges()) + + # Dict of dicts + dod = to_dict_of_dicts(G) + GG = from_dict_of_dicts(dod, create_using=nx.Graph) + assert nodes_equal(sorted(G.nodes()), sorted(GG.nodes())) + assert edges_equal(sorted(G.edges()), sorted(GG.edges())) + GW = to_networkx_graph(dod, create_using=nx.Graph) + assert nodes_equal(sorted(G.nodes()), sorted(GW.nodes())) + assert edges_equal(sorted(G.edges()), sorted(GW.edges())) + GI = nx.Graph(dod) + assert sorted(G.nodes()) == sorted(GI.nodes()) + assert sorted(G.edges()) == sorted(GI.edges()) + + # Dict of lists + dol = to_dict_of_lists(G) + GG = from_dict_of_lists(dol, create_using=nx.Graph) + # dict of lists throws away edge data so set it to none + enone = [(u, v, {}) for (u, v, d) in G.edges(data=True)] + assert nodes_equal(sorted(G.nodes()), sorted(GG.nodes())) + assert edges_equal(enone, sorted(GG.edges(data=True))) + GW = to_networkx_graph(dol, create_using=nx.Graph) + assert nodes_equal(sorted(G.nodes()), sorted(GW.nodes())) + assert edges_equal(enone, sorted(GW.edges(data=True))) + GI = nx.Graph(dol) + assert nodes_equal(sorted(G.nodes()), sorted(GI.nodes())) + assert edges_equal(enone, sorted(GI.edges(data=True))) + + def test_with_multiedges_self_loops(self): + G = cycle_graph(10) + XG = nx.Graph() + XG.add_nodes_from(G) + XG.add_weighted_edges_from((u, v, u) for u, v in G.edges()) + XGM = nx.MultiGraph() + XGM.add_nodes_from(G) + XGM.add_weighted_edges_from((u, v, u) for u, v in G.edges()) + XGM.add_edge(0, 1, weight=2) # multiedge + XGS = nx.Graph() + XGS.add_nodes_from(G) + XGS.add_weighted_edges_from((u, v, u) for u, v in G.edges()) + XGS.add_edge(0, 0, weight=100) # self loop + + # Dict of dicts + # with self loops, OK + dod = to_dict_of_dicts(XGS) + GG = from_dict_of_dicts(dod, create_using=nx.Graph) + assert nodes_equal(XGS.nodes(), GG.nodes()) + assert edges_equal(XGS.edges(), GG.edges()) + GW = to_networkx_graph(dod, create_using=nx.Graph) + assert nodes_equal(XGS.nodes(), GW.nodes()) + assert edges_equal(XGS.edges(), GW.edges()) + GI = nx.Graph(dod) + assert nodes_equal(XGS.nodes(), GI.nodes()) + assert edges_equal(XGS.edges(), GI.edges()) + + # Dict of lists + # with self loops, OK + dol = to_dict_of_lists(XGS) + GG = from_dict_of_lists(dol, create_using=nx.Graph) + # dict of lists throws away edge data so set it to none + enone = [(u, v, {}) for (u, v, d) in XGS.edges(data=True)] + assert nodes_equal(sorted(XGS.nodes()), sorted(GG.nodes())) + assert edges_equal(enone, sorted(GG.edges(data=True))) + GW = to_networkx_graph(dol, create_using=nx.Graph) + assert nodes_equal(sorted(XGS.nodes()), sorted(GW.nodes())) + assert edges_equal(enone, sorted(GW.edges(data=True))) + GI = nx.Graph(dol) + assert nodes_equal(sorted(XGS.nodes()), sorted(GI.nodes())) + assert edges_equal(enone, sorted(GI.edges(data=True))) + + # Dict of dicts + # with multiedges, OK + dod = to_dict_of_dicts(XGM) + GG = from_dict_of_dicts(dod, create_using=nx.MultiGraph, multigraph_input=True) + assert nodes_equal(sorted(XGM.nodes()), sorted(GG.nodes())) + assert edges_equal(sorted(XGM.edges()), sorted(GG.edges())) + GW = to_networkx_graph(dod, create_using=nx.MultiGraph, multigraph_input=True) + assert nodes_equal(sorted(XGM.nodes()), sorted(GW.nodes())) + assert edges_equal(sorted(XGM.edges()), sorted(GW.edges())) + GI = nx.MultiGraph(dod) + assert nodes_equal(sorted(XGM.nodes()), sorted(GI.nodes())) + assert sorted(XGM.edges()) == sorted(GI.edges()) + GE = from_dict_of_dicts(dod, create_using=nx.MultiGraph, multigraph_input=False) + assert nodes_equal(sorted(XGM.nodes()), sorted(GE.nodes())) + assert sorted(XGM.edges()) != sorted(GE.edges()) + GI = nx.MultiGraph(XGM) + assert nodes_equal(sorted(XGM.nodes()), sorted(GI.nodes())) + assert edges_equal(sorted(XGM.edges()), sorted(GI.edges())) + GM = nx.MultiGraph(G) + assert nodes_equal(sorted(GM.nodes()), sorted(G.nodes())) + assert edges_equal(sorted(GM.edges()), sorted(G.edges())) + + # Dict of lists + # with multiedges, OK, but better write as DiGraph else you'll + # get double edges + dol = to_dict_of_lists(G) + GG = from_dict_of_lists(dol, create_using=nx.MultiGraph) + assert nodes_equal(sorted(G.nodes()), sorted(GG.nodes())) + assert edges_equal(sorted(G.edges()), sorted(GG.edges())) + GW = to_networkx_graph(dol, create_using=nx.MultiGraph) + assert nodes_equal(sorted(G.nodes()), sorted(GW.nodes())) + assert edges_equal(sorted(G.edges()), sorted(GW.edges())) + GI = nx.MultiGraph(dol) + assert nodes_equal(sorted(G.nodes()), sorted(GI.nodes())) + assert edges_equal(sorted(G.edges()), sorted(GI.edges())) + + def test_edgelists(self): + P = nx.path_graph(4) + e = [(0, 1), (1, 2), (2, 3)] + G = nx.Graph(e) + assert nodes_equal(sorted(G.nodes()), sorted(P.nodes())) + assert edges_equal(sorted(G.edges()), sorted(P.edges())) + assert edges_equal(sorted(G.edges(data=True)), sorted(P.edges(data=True))) + + e = [(0, 1, {}), (1, 2, {}), (2, 3, {})] + G = nx.Graph(e) + assert nodes_equal(sorted(G.nodes()), sorted(P.nodes())) + assert edges_equal(sorted(G.edges()), sorted(P.edges())) + assert edges_equal(sorted(G.edges(data=True)), sorted(P.edges(data=True))) + + e = ((n, n + 1) for n in range(3)) + G = nx.Graph(e) + assert nodes_equal(sorted(G.nodes()), sorted(P.nodes())) + assert edges_equal(sorted(G.edges()), sorted(P.edges())) + assert edges_equal(sorted(G.edges(data=True)), sorted(P.edges(data=True))) + + def test_directed_to_undirected(self): + edges1 = [(0, 1), (1, 2), (2, 0)] + edges2 = [(0, 1), (1, 2), (0, 2)] + assert self.edgelists_equal(nx.Graph(nx.DiGraph(edges1)).edges(), edges1) + assert self.edgelists_equal(nx.Graph(nx.DiGraph(edges2)).edges(), edges1) + assert self.edgelists_equal(nx.MultiGraph(nx.DiGraph(edges1)).edges(), edges1) + assert self.edgelists_equal(nx.MultiGraph(nx.DiGraph(edges2)).edges(), edges1) + + assert self.edgelists_equal( + nx.MultiGraph(nx.MultiDiGraph(edges1)).edges(), edges1 + ) + assert self.edgelists_equal( + nx.MultiGraph(nx.MultiDiGraph(edges2)).edges(), edges1 + ) + + assert self.edgelists_equal(nx.Graph(nx.MultiDiGraph(edges1)).edges(), edges1) + assert self.edgelists_equal(nx.Graph(nx.MultiDiGraph(edges2)).edges(), edges1) + + def test_attribute_dict_integrity(self): + # we must not replace dict-like graph data structures with dicts + G = nx.Graph() + G.add_nodes_from("abc") + H = to_networkx_graph(G, create_using=nx.Graph) + assert list(H.nodes) == list(G.nodes) + H = nx.DiGraph(G) + assert list(H.nodes) == list(G.nodes) + + def test_to_edgelist(self): + G = nx.Graph([(1, 1)]) + elist = nx.to_edgelist(G, nodelist=list(G)) + assert edges_equal(G.edges(data=True), elist) + + def test_custom_node_attr_dict_safekeeping(self): + class custom_dict(dict): + pass + + class Custom(nx.Graph): + node_attr_dict_factory = custom_dict + + g = nx.Graph() + g.add_node(1, weight=1) + + h = Custom(g) + assert isinstance(g._node[1], dict) + assert isinstance(h._node[1], custom_dict) + + # this raise exception + # h._node.update((n, dd.copy()) for n, dd in g.nodes.items()) + # assert isinstance(h._node[1], custom_dict) + + +@pytest.mark.parametrize( + "edgelist", + ( + # Graph with no edge data + [(0, 1), (1, 2)], + # Graph with edge data + [(0, 1, {"weight": 1.0}), (1, 2, {"weight": 2.0})], + ), +) +def test_to_dict_of_dicts_with_edgedata_param(edgelist): + G = nx.Graph() + G.add_edges_from(edgelist) + # Innermost dict value == edge_data when edge_data != None. + # In the case when G has edge data, it is overwritten + expected = {0: {1: 10}, 1: {0: 10, 2: 10}, 2: {1: 10}} + assert nx.to_dict_of_dicts(G, edge_data=10) == expected + + +def test_to_dict_of_dicts_with_edgedata_and_nodelist(): + G = nx.path_graph(5) + nodelist = [2, 3, 4] + expected = {2: {3: 10}, 3: {2: 10, 4: 10}, 4: {3: 10}} + assert nx.to_dict_of_dicts(G, nodelist=nodelist, edge_data=10) == expected + + +def test_to_dict_of_dicts_with_edgedata_multigraph(): + """Multi edge data overwritten when edge_data != None""" + G = nx.MultiGraph() + G.add_edge(0, 1, key="a") + G.add_edge(0, 1, key="b") + # Multi edge data lost when edge_data is not None + expected = {0: {1: 10}, 1: {0: 10}} + assert nx.to_dict_of_dicts(G, edge_data=10) == expected + + +def test_to_networkx_graph_non_edgelist(): + invalid_edgelist = [1, 2, 3] + with pytest.raises(nx.NetworkXError, match="Input is not a valid edge list"): + nx.to_networkx_graph(invalid_edgelist) diff --git a/shared/package-files/4a/4a87da0310c42437f582de6c206542fcef2f4fd61c4dcf09ab5bdf9f054f8643/test_chains.py b/shared/package-files/4a/4a87da0310c42437f582de6c206542fcef2f4fd61c4dcf09ab5bdf9f054f8643/test_chains.py new file mode 100644 index 0000000000000000000000000000000000000000..6a1b1142caace872bdc6b779449c17cdc3089c77 --- /dev/null +++ b/shared/package-files/4a/4a87da0310c42437f582de6c206542fcef2f4fd61c4dcf09ab5bdf9f054f8643/test_chains.py @@ -0,0 +1,140 @@ +"""Unit tests for the chain decomposition functions.""" +from itertools import cycle, islice + +import pytest + +import networkx as nx + + +def cycles(seq): + """Yields cyclic permutations of the given sequence. + + For example:: + + >>> list(cycles("abc")) + [('a', 'b', 'c'), ('b', 'c', 'a'), ('c', 'a', 'b')] + + """ + n = len(seq) + cycled_seq = cycle(seq) + for x in seq: + yield tuple(islice(cycled_seq, n)) + next(cycled_seq) + + +def cyclic_equals(seq1, seq2): + """Decide whether two sequences are equal up to cyclic permutations. + + For example:: + + >>> cyclic_equals("xyz", "zxy") + True + >>> cyclic_equals("xyz", "zyx") + False + + """ + # Cast seq2 to a tuple since `cycles()` yields tuples. + seq2 = tuple(seq2) + return any(x == tuple(seq2) for x in cycles(seq1)) + + +class TestChainDecomposition: + """Unit tests for the chain decomposition function.""" + + def assertContainsChain(self, chain, expected): + # A cycle could be expressed in two different orientations, one + # forward and one backward, so we need to check for cyclic + # equality in both orientations. + reversed_chain = list(reversed([tuple(reversed(e)) for e in chain])) + for candidate in expected: + if cyclic_equals(chain, candidate): + break + if cyclic_equals(reversed_chain, candidate): + break + else: + self.fail("chain not found") + + def test_decomposition(self): + edges = [ + # DFS tree edges. + (1, 2), + (2, 3), + (3, 4), + (3, 5), + (5, 6), + (6, 7), + (7, 8), + (5, 9), + (9, 10), + # Nontree edges. + (1, 3), + (1, 4), + (2, 5), + (5, 10), + (6, 8), + ] + G = nx.Graph(edges) + expected = [ + [(1, 3), (3, 2), (2, 1)], + [(1, 4), (4, 3)], + [(2, 5), (5, 3)], + [(5, 10), (10, 9), (9, 5)], + [(6, 8), (8, 7), (7, 6)], + ] + chains = list(nx.chain_decomposition(G, root=1)) + assert len(chains) == len(expected) + + # This chain decomposition isn't unique + # for chain in chains: + # print(chain) + # self.assertContainsChain(chain, expected) + + def test_barbell_graph(self): + # The (3, 0) barbell graph has two triangles joined by a single edge. + G = nx.barbell_graph(3, 0) + chains = list(nx.chain_decomposition(G, root=0)) + expected = [[(0, 1), (1, 2), (2, 0)], [(3, 4), (4, 5), (5, 3)]] + assert len(chains) == len(expected) + for chain in chains: + self.assertContainsChain(chain, expected) + + def test_disconnected_graph(self): + """Test for a graph with multiple connected components.""" + G = nx.barbell_graph(3, 0) + H = nx.barbell_graph(3, 0) + mapping = dict(zip(range(6), "abcdef")) + nx.relabel_nodes(H, mapping, copy=False) + G = nx.union(G, H) + chains = list(nx.chain_decomposition(G)) + expected = [ + [(0, 1), (1, 2), (2, 0)], + [(3, 4), (4, 5), (5, 3)], + [("a", "b"), ("b", "c"), ("c", "a")], + [("d", "e"), ("e", "f"), ("f", "d")], + ] + assert len(chains) == len(expected) + for chain in chains: + self.assertContainsChain(chain, expected) + + def test_disconnected_graph_root_node(self): + """Test for a single component of a disconnected graph.""" + G = nx.barbell_graph(3, 0) + H = nx.barbell_graph(3, 0) + mapping = dict(zip(range(6), "abcdef")) + nx.relabel_nodes(H, mapping, copy=False) + G = nx.union(G, H) + chains = list(nx.chain_decomposition(G, root="a")) + expected = [ + [("a", "b"), ("b", "c"), ("c", "a")], + [("d", "e"), ("e", "f"), ("f", "d")], + ] + assert len(chains) == len(expected) + for chain in chains: + self.assertContainsChain(chain, expected) + + def test_chain_decomposition_root_not_in_G(self): + """Test chain decomposition when root is not in graph""" + G = nx.Graph() + G.add_nodes_from([1, 2, 3]) + with pytest.raises(nx.NodeNotFound): + nx.has_bridges(G, root=6) diff --git a/shared/package-files/4a/4a8e263e84a35e45e2487893cf3aae1f7555c950ff9e35e51c9484c583d7028c/progress_bars.py b/shared/package-files/4a/4a8e263e84a35e45e2487893cf3aae1f7555c950ff9e35e51c9484c583d7028c/progress_bars.py new file mode 100644 index 0000000000000000000000000000000000000000..0ad14031ca50c2c348dc0daa8fe7b38af532c0f5 --- /dev/null +++ b/shared/package-files/4a/4a8e263e84a35e45e2487893cf3aae1f7555c950ff9e35e51c9484c583d7028c/progress_bars.py @@ -0,0 +1,68 @@ +import functools +from typing import Callable, Generator, Iterable, Iterator, Optional, Tuple + +from pip._vendor.rich.progress import ( + BarColumn, + DownloadColumn, + FileSizeColumn, + Progress, + ProgressColumn, + SpinnerColumn, + TextColumn, + TimeElapsedColumn, + TimeRemainingColumn, + TransferSpeedColumn, +) + +from pip._internal.utils.logging import get_indentation + +DownloadProgressRenderer = Callable[[Iterable[bytes]], Iterator[bytes]] + + +def _rich_progress_bar( + iterable: Iterable[bytes], + *, + bar_type: str, + size: int, +) -> Generator[bytes, None, None]: + assert bar_type == "on", "This should only be used in the default mode." + + if not size: + total = float("inf") + columns: Tuple[ProgressColumn, ...] = ( + TextColumn("[progress.description]{task.description}"), + SpinnerColumn("line", speed=1.5), + FileSizeColumn(), + TransferSpeedColumn(), + TimeElapsedColumn(), + ) + else: + total = size + columns = ( + TextColumn("[progress.description]{task.description}"), + BarColumn(), + DownloadColumn(), + TransferSpeedColumn(), + TextColumn("eta"), + TimeRemainingColumn(), + ) + + progress = Progress(*columns, refresh_per_second=30) + task_id = progress.add_task(" " * (get_indentation() + 2), total=total) + with progress: + for chunk in iterable: + yield chunk + progress.update(task_id, advance=len(chunk)) + + +def get_download_progress_renderer( + *, bar_type: str, size: Optional[int] = None +) -> DownloadProgressRenderer: + """Get an object that can be used to render the download progress. + + Returns a callable, that takes an iterable to "wrap". + """ + if bar_type == "on": + return functools.partial(_rich_progress_bar, bar_type=bar_type, size=size) + else: + return iter # no-op, when passed an iterator diff --git a/shared/package-files/4a/4a90a0810f33ee902c87ff48ec0691500691a5f445e9914f07be020a20a45ae1/vc404-s b/shared/package-files/4a/4a90a0810f33ee902c87ff48ec0691500691a5f445e9914f07be020a20a45ae1/vc404-s new file mode 100644 index 0000000000000000000000000000000000000000..920d624b2e15a45997f67be91b376fe296ef9e8d Binary files /dev/null and b/shared/package-files/4a/4a90a0810f33ee902c87ff48ec0691500691a5f445e9914f07be020a20a45ae1/vc404-s differ diff --git a/shared/package-files/4a/4a94f2a66027681f3236a0512a40fe1b40e9c8a8114c09ce27b169e9f729f089/bitwise_xor.h b/shared/package-files/4a/4a94f2a66027681f3236a0512a40fe1b40e9c8a8114c09ce27b169e9f729f089/bitwise_xor.h new file mode 100644 index 0000000000000000000000000000000000000000..c2722f90131b990cb56986b7ec06709491ff8856 --- /dev/null +++ b/shared/package-files/4a/4a94f2a66027681f3236a0512a40fe1b40e9c8a8114c09ce27b169e9f729f089/bitwise_xor.h @@ -0,0 +1,67 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::bitwise_xor.Tensor_out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & bitwise_xor_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other) { + return at::_ops::bitwise_xor_Tensor_out::call(self, other, out); +} +// aten::bitwise_xor.Tensor_out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & bitwise_xor_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out) { + return at::_ops::bitwise_xor_Tensor_out::call(self, other, out); +} + +// aten::bitwise_xor.Scalar_out(Tensor self, Scalar other, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & bitwise_xor_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & other) { + return at::_ops::bitwise_xor_Scalar_out::call(self, other, out); +} +// aten::bitwise_xor.Scalar_out(Tensor self, Scalar other, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & bitwise_xor_outf(const at::Tensor & self, const at::Scalar & other, at::Tensor & out) { + return at::_ops::bitwise_xor_Scalar_out::call(self, other, out); +} + +// aten::bitwise_xor.Scalar(Tensor self, Scalar other) -> Tensor +inline at::Tensor bitwise_xor(const at::Tensor & self, const at::Scalar & other) { + return at::_ops::bitwise_xor_Scalar::call(self, other); +} + +// aten::bitwise_xor.Scalar_Tensor(Scalar self, Tensor other) -> Tensor +inline at::Tensor bitwise_xor(const at::Scalar & self, const at::Tensor & other) { + return at::_ops::bitwise_xor_Scalar_Tensor::call(self, other); +} + +// aten::bitwise_xor.Tensor(Tensor self, Tensor other) -> Tensor +inline at::Tensor bitwise_xor(const at::Tensor & self, const at::Tensor & other) { + return at::_ops::bitwise_xor_Tensor::call(self, other); +} + +// aten::bitwise_xor.Scalar_Tensor_out(Scalar self, Tensor other, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & bitwise_xor_out(at::Tensor & out, const at::Scalar & self, const at::Tensor & other) { + return at::_ops::bitwise_xor_Scalar_Tensor_out::call(self, other, out); +} +// aten::bitwise_xor.Scalar_Tensor_out(Scalar self, Tensor other, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & bitwise_xor_outf(const at::Scalar & self, const at::Tensor & other, at::Tensor & out) { + return at::_ops::bitwise_xor_Scalar_Tensor_out::call(self, other, out); +} + +} diff --git a/shared/package-files/4a/4a9a50b0cef6d1965206430a64213592b1c41db25a89a9a309857ecc20fa740c/_foreach_atan_compositeexplicitautograd_dispatch.h b/shared/package-files/4a/4a9a50b0cef6d1965206430a64213592b1c41db25a89a9a309857ecc20fa740c/_foreach_atan_compositeexplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..39d10ded32f021576b355e9d3708c7288ce76c5f --- /dev/null +++ b/shared/package-files/4a/4a9a50b0cef6d1965206430a64213592b1c41db25a89a9a309857ecc20fa740c/_foreach_atan_compositeexplicitautograd_dispatch.h @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API void _foreach_atan_out(at::TensorList out, at::TensorList self); +TORCH_API void _foreach_atan_outf(at::TensorList self, at::TensorList out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/4a/4a9aed3eb1f63a9906796e58fd62fd02fb5e8eaab070805aa141a1a343ea6f72/utils.cmake b/shared/package-files/4a/4a9aed3eb1f63a9906796e58fd62fd02fb5e8eaab070805aa141a1a343ea6f72/utils.cmake new file mode 100644 index 0000000000000000000000000000000000000000..78a90dbc587ca70f1d4d8593b81cc33eeec517e8 --- /dev/null +++ b/shared/package-files/4a/4a9aed3eb1f63a9906796e58fd62fd02fb5e8eaab070805aa141a1a343ea6f72/utils.cmake @@ -0,0 +1,559 @@ +################################################################################################ +# Exclude and prepend functionalities +function(exclude OUTPUT INPUT) +set(EXCLUDES ${ARGN}) +foreach(EXCLUDE ${EXCLUDES}) + list(REMOVE_ITEM INPUT "${EXCLUDE}") +endforeach() +set(${OUTPUT} ${INPUT} PARENT_SCOPE) +endfunction(exclude) + +function(prepend OUTPUT PREPEND) +set(OUT "") +foreach(ITEM ${ARGN}) + list(APPEND OUT "${PREPEND}${ITEM}") +endforeach() +set(${OUTPUT} ${OUT} PARENT_SCOPE) +endfunction(prepend) + + +################################################################################################ +# Clears variables from list +# Usage: +# caffe_clear_vars() +macro(caffe_clear_vars) + foreach(_var ${ARGN}) + unset(${_var}) + endforeach() +endmacro() + +################################################################################################ +# Prints list element per line +# Usage: +# caffe_print_list() +function(caffe_print_list) + foreach(e ${ARGN}) + message(STATUS ${e}) + endforeach() +endfunction() + +################################################################################################ +# Reads set of version defines from the header file +# Usage: +# caffe_parse_header( ..) +macro(caffe_parse_header FILENAME FILE_VAR) + set(vars_regex "") + set(__parnet_scope OFF) + set(__add_cache OFF) + foreach(name ${ARGN}) + if("${name}" STREQUAL "PARENT_SCOPE") + set(__parnet_scope ON) + elseif("${name}" STREQUAL "CACHE") + set(__add_cache ON) + elseif(vars_regex) + set(vars_regex "${vars_regex}|${name}") + else() + set(vars_regex "${name}") + endif() + endforeach() + if(EXISTS "${FILENAME}") + file(STRINGS "${FILENAME}" ${FILE_VAR} REGEX "#define[ \t]+(${vars_regex})[ \t]+[0-9]+" ) + else() + unset(${FILE_VAR}) + endif() + foreach(name ${ARGN}) + if(NOT "${name}" STREQUAL "PARENT_SCOPE" AND NOT "${name}" STREQUAL "CACHE") + if(${FILE_VAR}) + if(${FILE_VAR} MATCHES ".+[ \t]${name}[ \t]+([0-9]+).*") + string(REGEX REPLACE ".+[ \t]${name}[ \t]+([0-9]+).*" "\\1" ${name} "${${FILE_VAR}}") + else() + set(${name} "") + endif() + if(__add_cache) + set(${name} ${${name}} CACHE INTERNAL "${name} parsed from ${FILENAME}" FORCE) + elseif(__parnet_scope) + set(${name} "${${name}}" PARENT_SCOPE) + endif() + else() + unset(${name} CACHE) + endif() + endif() + endforeach() +endmacro() + +################################################################################################ +# Parses a version string that might have values beyond major, minor, and patch +# and set version variables for the library. +# Usage: +# caffe2_parse_version_str( ) +function(caffe2_parse_version_str LIBNAME VERSIONSTR) + string(REGEX REPLACE "^([0-9]+).*$" "\\1" ${LIBNAME}_VERSION_MAJOR "${VERSIONSTR}") + string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*$" "\\1" ${LIBNAME}_VERSION_MINOR "${VERSIONSTR}") + string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ${LIBNAME}_VERSION_PATCH "${VERSIONSTR}") + set(${LIBNAME}_VERSION_MAJOR ${${LIBNAME}_VERSION_MAJOR} ${ARGN} PARENT_SCOPE) + set(${LIBNAME}_VERSION_MINOR ${${LIBNAME}_VERSION_MINOR} ${ARGN} PARENT_SCOPE) + set(${LIBNAME}_VERSION_PATCH ${${LIBNAME}_VERSION_PATCH} ${ARGN} PARENT_SCOPE) + set(${LIBNAME}_VERSION "${${LIBNAME}_VERSION_MAJOR}.${${LIBNAME}_VERSION_MINOR}.${${LIBNAME}_VERSION_PATCH}" PARENT_SCOPE) +endfunction() + +### +# Removes common indentation from a block of text to produce code suitable for +# setting to `python -c`, or using with pycmd. This allows multiline code to be +# nested nicely in the surrounding code structure. +# +# This function respsects PYTHON_EXECUTABLE if it defined, otherwise it uses +# `python` and hopes for the best. An error will be thrown if it is not found. +# +# Args: +# outvar : variable that will hold the stdout of the python command +# text : text to remove indentation from +# +function(dedent outvar text) + # Use PYTHON_EXECUTABLE if it is defined, otherwise default to python + if("${PYTHON_EXECUTABLE}" STREQUAL "") + set(_python_exe "python") + else() + set(_python_exe "${PYTHON_EXECUTABLE}") + endif() + set(_fixup_cmd "import sys; from textwrap import dedent; print(dedent(sys.stdin.read()))") + file(WRITE "${CMAKE_BINARY_DIR}/indented.txt" "${text}") + execute_process( + COMMAND "${_python_exe}" -c "${_fixup_cmd}" + INPUT_FILE "${CMAKE_BINARY_DIR}/indented.txt" + RESULT_VARIABLE _dedent_exitcode + OUTPUT_VARIABLE _dedent_text) + if(NOT _dedent_exitcode EQUAL 0) + message(ERROR " Failed to remove indentation from: \n\"\"\"\n${text}\n\"\"\" + Python dedent failed with error code: ${_dedent_exitcode}") + message(FATAL_ERROR " Python dedent failed with error code: ${_dedent_exitcode}") + endif() + # Remove supurflous newlines (artifacts of print) + string(STRIP "${_dedent_text}" _dedent_text) + set(${outvar} "${_dedent_text}" PARENT_SCOPE) +endfunction() + + +function(pycmd_no_exit outvar exitcode cmd) + # Use PYTHON_EXECUTABLE if it is defined, otherwise default to python + if("${PYTHON_EXECUTABLE}" STREQUAL "") + set(_python_exe "python") + else() + set(_python_exe "${PYTHON_EXECUTABLE}") + endif() + # run the actual command + execute_process( + COMMAND "${_python_exe}" -c "${cmd}" + RESULT_VARIABLE _exitcode + OUTPUT_VARIABLE _output) + # Remove supurflous newlines (artifacts of print) + string(STRIP "${_output}" _output) + set(${outvar} "${_output}" PARENT_SCOPE) + set(${exitcode} "${_exitcode}" PARENT_SCOPE) +endfunction() + + +### +# Helper function to run `python -c ""` and capture the results of stdout +# +# Runs a python command and populates an outvar with the result of stdout. +# Common indentation in the text of `cmd` is removed before the command is +# executed, so the caller does not need to worry about indentation issues. +# +# This function respsects PYTHON_EXECUTABLE if it defined, otherwise it uses +# `python` and hopes for the best. An error will be thrown if it is not found. +# +# Args: +# outvar : variable that will hold the stdout of the python command +# cmd : text representing a (possibly multiline) block of python code +# +function(pycmd outvar cmd) + dedent(_dedent_cmd "${cmd}") + pycmd_no_exit(_output _exitcode "${_dedent_cmd}") + + if(NOT _exitcode EQUAL 0) + message(ERROR " Failed when running python code: \"\"\"\n${_dedent_cmd}\n\"\"\"") + message(FATAL_ERROR " Python command failed with error code: ${_exitcode}") + endif() + # Remove supurflous newlines (artifacts of print) + string(STRIP "${_output}" _output) + set(${outvar} "${_output}" PARENT_SCOPE) +endfunction() + + +############################################################################## +# Macro to update cached options. +macro(caffe2_update_option variable value) + if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO) + get_property(__help_string CACHE ${variable} PROPERTY HELPSTRING) + set(${variable} ${value} CACHE BOOL ${__help_string} FORCE) + else() + set(${variable} ${value}) + endif() +endmacro() + + +############################################################################## +# Add an interface library definition that is dependent on the source. +# +# It's probably easiest to explain why this macro exists, by describing +# what things would look like if we didn't have this macro. +# +# Let's suppose we want to statically link against torch. We've defined +# a library in cmake called torch, and we might think that we just +# target_link_libraries(my-app PUBLIC torch). This will result in a +# linker argument 'libtorch.a' getting passed to the linker. +# +# Unfortunately, this link command is wrong! We have static +# initializers in libtorch.a that would get improperly pruned by +# the default link settings. What we actually need is for you +# to do -Wl,--whole-archive,libtorch.a -Wl,--no-whole-archive to ensure +# that we keep all symbols, even if they are (seemingly) not used. +# +# What caffe2_interface_library does is create an interface library +# that indirectly depends on the real library, but sets up the link +# arguments so that you get all of the extra link settings you need. +# The result is not a "real" library, and so we have to manually +# copy over necessary properties from the original target. +# +# (The discussion above is about static libraries, but a similar +# situation occurs for dynamic libraries: if no symbols are used from +# a dynamic library, it will be pruned unless you are --no-as-needed) +macro(caffe2_interface_library SRC DST) + add_library(${DST} INTERFACE) + add_dependencies(${DST} ${SRC}) + # Depending on the nature of the source library as well as the compiler, + # determine the needed compilation flags. + get_target_property(__src_target_type ${SRC} TYPE) + # Depending on the type of the source library, we will set up the + # link command for the specific SRC library. + if(${__src_target_type} STREQUAL "STATIC_LIBRARY") + # In the case of static library, we will need to add whole-static flags. + if(APPLE) + target_link_libraries( + ${DST} INTERFACE -Wl,-force_load,\"$\") + elseif(MSVC) + # In MSVC, we will add whole archive in default. + target_link_libraries( + ${DST} INTERFACE "$") + target_link_options( + ${DST} INTERFACE "-WHOLEARCHIVE:$") + else() + # Assume everything else is like gcc + target_link_libraries(${DST} INTERFACE + "-Wl,--whole-archive,\"$\" -Wl,--no-whole-archive") + endif() + # Link all interface link libraries of the src target as well. + # For static library, we need to explicitly depend on all the libraries + # that are the dependent library of the source library. Note that we cannot + # use the populated INTERFACE_LINK_LIBRARIES property, because if one of the + # dependent library is not a target, cmake creates a $ wrapper + # and then one is not able to find target "src". For more discussions, check + # https://gitlab.kitware.com/cmake/cmake/issues/15415 + # https://cmake.org/pipermail/cmake-developers/2013-May/019019.html + # Specifically the following quote + # + # """ + # For STATIC libraries we can define that the PUBLIC/PRIVATE/INTERFACE keys + # are ignored for linking and that it always populates both LINK_LIBRARIES + # LINK_INTERFACE_LIBRARIES. Note that for STATIC libraries the + # LINK_LIBRARIES property will not be used for anything except build-order + # dependencies. + # """ + target_link_libraries(${DST} INTERFACE + $) + elseif(${__src_target_type} STREQUAL "SHARED_LIBRARY") + if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") + target_link_libraries(${DST} INTERFACE + "-Wl,--no-as-needed,\"$\" -Wl,--as-needed") + else() + target_link_libraries(${DST} INTERFACE ${SRC}) + endif() + # Link all interface link libraries of the src target as well. + # For shared libraries, we can simply depend on the INTERFACE_LINK_LIBRARIES + # property of the target. + target_link_libraries(${DST} INTERFACE + $) + else() + message(FATAL_ERROR + "You made a CMake build file error: target " ${SRC} + " must be of type either STATIC_LIBRARY or SHARED_LIBRARY. However, " + "I got " ${__src_target_type} ".") + endif() + # For all other interface properties, manually inherit from the source target. + set_target_properties(${DST} PROPERTIES + INTERFACE_COMPILE_DEFINITIONS + $ + INTERFACE_COMPILE_OPTIONS + $ + INTERFACE_INCLUDE_DIRECTORIES + $ + INTERFACE_SYSTEM_INCLUDE_DIRECTORIES + $) +endmacro() + + +############################################################################## +# Creating a Caffe2 binary target with sources specified with relative path. +# Usage: +# caffe2_binary_target(target_name_or_src [] [] ...) +# If only target_name_or_src is specified, this target is build with one single +# source file and the target name is autogen from the filename. Otherwise, the +# target name is given by the first argument and the rest are the source files +# to build the target. +function(caffe2_binary_target target_name_or_src) + # https://cmake.org/cmake/help/latest/command/function.html + # Checking that ARGC is greater than # is the only way to ensure + # that ARGV# was passed to the function as an extra argument. + if(ARGC GREATER 1) + set(__target ${target_name_or_src}) + prepend(__srcs "${CMAKE_CURRENT_SOURCE_DIR}/" "${ARGN}") + else() + get_filename_component(__target ${target_name_or_src} NAME_WE) + prepend(__srcs "${CMAKE_CURRENT_SOURCE_DIR}/" "${target_name_or_src}") + endif() + add_executable(${__target} ${__srcs}) + target_link_libraries(${__target} torch_library) + # If we have Caffe2_MODULES defined, we will also link with the modules. + if(DEFINED Caffe2_MODULES) + target_link_libraries(${__target} ${Caffe2_MODULES}) + endif() + if(USE_TBB AND NOT USE_SYSTEM_TBB) + target_include_directories(${__target} PUBLIC ${TBB_INCLUDE_DIR}) + endif() + install(TARGETS ${__target} DESTINATION bin) +endfunction() + +function(caffe2_hip_binary_target target_name_or_src) + if(ARGC GREATER 1) + set(__target ${target_name_or_src}) + prepend(__srcs "${CMAKE_CURRENT_SOURCE_DIR}/" "${ARGN}") + else() + get_filename_component(__target ${target_name_or_src} NAME_WE) + prepend(__srcs "${CMAKE_CURRENT_SOURCE_DIR}/" "${target_name_or_src}") + endif() + + caffe2_binary_target(${target_name_or_src}) + + target_compile_options(${__target} PRIVATE ${HIP_CXX_FLAGS}) + target_include_directories(${__target} PRIVATE ${Caffe2_HIP_INCLUDE}) +endfunction() + + +############################################################################## +# Multiplex between adding libraries for CUDA versus HIP (AMD Software Stack). +# Usage: +# torch_cuda_based_add_library(cuda_target) +# +macro(torch_cuda_based_add_library cuda_target) + if(USE_ROCM) + hip_add_library(${cuda_target} ${ARGN}) + elseif(USE_CUDA) + add_library(${cuda_target} ${ARGN}) + else() + endif() +endmacro() + +############################################################################## +# Get the HIP arch flags specified by PYTORCH_ROCM_ARCH. +# Usage: +# torch_hip_get_arch_list(variable_to_store_flags) +# +macro(torch_hip_get_arch_list store_var) + if(DEFINED ENV{PYTORCH_ROCM_ARCH}) + set(_TMP $ENV{PYTORCH_ROCM_ARCH}) + else() + # Use arch of installed GPUs as default + execute_process(COMMAND "rocm_agent_enumerator" COMMAND bash "-c" "grep -v gfx000 | sort -u | xargs | tr -d '\n'" + RESULT_VARIABLE ROCM_AGENT_ENUMERATOR_RESULT + OUTPUT_VARIABLE ROCM_ARCH_INSTALLED) + if(NOT ROCM_AGENT_ENUMERATOR_RESULT EQUAL 0) + message(FATAL_ERROR " Could not detect ROCm arch for GPUs on machine. Result: '${ROCM_AGENT_ENUMERATOR_RESULT}'") + endif() + set(_TMP ${ROCM_ARCH_INSTALLED}) + endif() + string(REPLACE " " ";" ${store_var} "${_TMP}") +endmacro() + +############################################################################## +# Get the NVCC arch flags specified by TORCH_CUDA_ARCH_LIST and CUDA_ARCH_NAME. +# Usage: +# torch_cuda_get_nvcc_gencode_flag(variable_to_store_flags) +# +macro(torch_cuda_get_nvcc_gencode_flag store_var) + # setting nvcc arch flags + if((NOT DEFINED TORCH_CUDA_ARCH_LIST) AND (DEFINED ENV{TORCH_CUDA_ARCH_LIST})) + message(WARNING + "In the future we will require one to explicitly pass " + "TORCH_CUDA_ARCH_LIST to cmake instead of implicitly setting it as an " + "env variable. This will become a FATAL_ERROR in future version of " + "pytorch.") + set(TORCH_CUDA_ARCH_LIST $ENV{TORCH_CUDA_ARCH_LIST}) + endif() + if(DEFINED CUDA_ARCH_NAME) + message(WARNING + "CUDA_ARCH_NAME is no longer used. Use TORCH_CUDA_ARCH_LIST instead. " + "Right now, CUDA_ARCH_NAME is ${CUDA_ARCH_NAME} and " + "TORCH_CUDA_ARCH_LIST is ${TORCH_CUDA_ARCH_LIST}.") + set(TORCH_CUDA_ARCH_LIST TORCH_CUDA_ARCH_LIST ${CUDA_ARCH_NAME}) + endif() + + # Invoke cuda_select_nvcc_arch_flags from proper cmake FindCUDA. + cuda_select_nvcc_arch_flags(${store_var} ${TORCH_CUDA_ARCH_LIST}) +endmacro() + + +############################################################################## +# Add standard compile options. +# Usage: +# torch_compile_options(lib_name) +function(torch_compile_options libname) + set_property(TARGET ${libname} PROPERTY CXX_STANDARD 17) + set(private_compile_options "") + + # ---[ Check if warnings should be errors. + if(WERROR) + list(APPEND private_compile_options -Werror) + endif() + + # until they can be unified, keep these lists synced with setup.py + if(MSVC) + + if(MSVC_Z7_OVERRIDE) + set(MSVC_DEBINFO_OPTION "/Z7") + else() + set(MSVC_DEBINFO_OPTION "/Zi") + endif() + + target_compile_options(${libname} PUBLIC + $<$: + ${MSVC_RUNTIME_LIBRARY_OPTION} + $<$,$>:${MSVC_DEBINFO_OPTION}> + /EHsc + /bigobj> + ) + else() + list(APPEND private_compile_options + -Wall + -Wextra + -Wdeprecated + -Wno-unused-parameter + -Wno-unused-function + -Wno-missing-field-initializers + -Wno-unknown-pragmas + -Wno-type-limits + -Wno-array-bounds + -Wno-unknown-pragmas + -Wno-strict-overflow + -Wno-strict-aliasing + ) + if(NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + list(APPEND private_compile_options + # Considered to be flaky. See the discussion at + # https://github.com/pytorch/pytorch/pull/9608 + -Wno-maybe-uninitialized) + endif() + + endif() + + if(MSVC) + elseif(WERROR) + list(APPEND private_compile_options -Wno-strict-overflow) + endif() + + target_compile_options(${libname} PRIVATE + $<$:${private_compile_options}>) + if(USE_CUDA) + string(FIND "${private_compile_options}" " " space_position) + if(NOT space_position EQUAL -1) + message(FATAL_ERROR "Found spaces in private_compile_options='${private_compile_options}'") + endif() + # Convert CMake list to comma-separated list + string(REPLACE ";" "," private_compile_options "${private_compile_options}") + target_compile_options(${libname} PRIVATE + $<$:-Xcompiler=${private_compile_options}>) + endif() + + if(NOT WIN32 AND NOT USE_ASAN) + # Enable hidden visibility by default to make it easier to debug issues with + # TORCH_API annotations. Hidden visibility with selective default visibility + # behaves close enough to Windows' dllimport/dllexport. + # + # Unfortunately, hidden visibility messes up some ubsan warnings because + # templated classes crossing library boundary get duplicated (but identical) + # definitions. It's easier to just disable it. + target_compile_options(${libname} PRIVATE + $<$: -fvisibility=hidden>) + endif() + + # Use -O2 for release builds (-O3 doesn't improve perf, and -Os results in perf regression) + target_compile_options(${libname} PRIVATE + $<$,$,$>>:-O2>) + +endfunction() + +############################################################################## +# Set old-style FindCuda.cmake compile flags from modern CMake cuda flags. +# Usage: +# torch_update_find_cuda_flags() +function(torch_update_find_cuda_flags) + # Convert -O2 -Xcompiler="-O2 -Wall" to "-O2;-Xcompiler=-O2,-Wall" + if(USE_CUDA) + separate_arguments(FLAGS UNIX_COMMAND "${CMAKE_CUDA_FLAGS}") + string(REPLACE " " "," FLAGS "${FLAGS}") + set(CUDA_NVCC_FLAGS ${FLAGS} PARENT_SCOPE) + + separate_arguments(FLAGS_DEBUG UNIX_COMMAND "${CMAKE_CUDA_FLAGS_DEBUG}") + string(REPLACE " " "," FLAGS_DEBUG "${FLAGS_DEBUG}") + set(CUDA_NVCC_FLAGS_DEBUG "${FLAGS_DEBUG}" PARENT_SCOPE) + + separate_arguments(FLAGS_RELEASE UNIX_COMMAND "${CMAKE_CUDA_FLAGS_RELEASE}") + string(REPLACE " " "," FLAGS_RELEASE "${FLAGS_RELEASE}") + set(CUDA_NVCC_FLAGS_RELEASE "${FLAGS_RELEASE}" PARENT_SCOPE) + + separate_arguments(FLAGS_MINSIZEREL UNIX_COMMAND "${CMAKE_CUDA_FLAGS_MINSIZEREL}") + string(REPLACE " " "," FLAGS_MINSIZEREL "${FLAGS_MINSIZEREL}") + set(CUDA_NVCC_FLAGS_MINSIZEREL "${FLAGS_MINSIZEREL}" PARENT_SCOPE) + + separate_arguments(FLAGS_RELWITHDEBINFO UNIX_COMMAND "${CMAKE_CUDA_FLAGS_RELWITHDEBINFO}") + string(REPLACE " " "," FLAGS_RELWITHDEBINFO "${FLAGS_RELWITHDEBINFO}") + set(CUDA_NVCC_FLAGS_RELWITHDEBINFO "${FLAGS_RELWITHDEBINFO}" PARENT_SCOPE) + + message(STATUS "Converting CMAKE_CUDA_FLAGS to CUDA_NVCC_FLAGS:\n" + " CUDA_NVCC_FLAGS = ${FLAGS}\n" + " CUDA_NVCC_FLAGS_DEBUG = ${FLAGS_DEBUG}\n" + " CUDA_NVCC_FLAGS_RELEASE = ${FLAGS_RELEASE}\n" + " CUDA_NVCC_FLAGS_RELWITHDEBINFO = ${FLAGS_RELWITHDEBINFO}\n" + " CUDA_NVCC_FLAGS_MINSIZEREL = ${FLAGS_MINSIZEREL}") + endif() +endfunction() + +include(CheckCXXCompilerFlag) + +############################################################################## +# CHeck if given flag is supported and append it to provided outputvar +# Also define HAS_UPPER_CASE_FLAG_NAME variable +# Usage: +# append_cxx_flag_if_supported("-Werror" CMAKE_CXX_FLAGS) +function(append_cxx_flag_if_supported flag outputvar) + string(TOUPPER "HAS${flag}" _FLAG_NAME) + string(REGEX REPLACE "[=-]" "_" _FLAG_NAME "${_FLAG_NAME}") + # GCC silents unknown -Wno-XXX flags, so we detect the corresponding -WXXX. + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + string(REGEX REPLACE "Wno-" "W" new_flag "${flag}") + else() + set(new_flag ${flag}) + endif() + check_cxx_compiler_flag("${new_flag}" ${_FLAG_NAME}) + if(${_FLAG_NAME}) + string(APPEND ${outputvar} " ${flag}") + set(${outputvar} "${${outputvar}}" PARENT_SCOPE) + endif() +endfunction() + +function(target_compile_options_if_supported target flag) + set(_compile_options "") + append_cxx_flag_if_supported("${flag}" _compile_options) + if(NOT "${_compile_options}" STREQUAL "") + target_compile_options(${target} PRIVATE ${flag}) + endif() +endfunction() diff --git a/shared/package-files/4a/4a9b176339418ab4563749869d07b431d37a1fc7ef9605cf257e4f8ce1e711a9/AVC.py b/shared/package-files/4a/4a9b176339418ab4563749869d07b431d37a1fc7ef9605cf257e4f8ce1e711a9/AVC.py new file mode 100644 index 0000000000000000000000000000000000000000..a27ae2d61fee662df968b290330f0c3aea536410 --- /dev/null +++ b/shared/package-files/4a/4a9b176339418ab4563749869d07b431d37a1fc7ef9605cf257e4f8ce1e711a9/AVC.py @@ -0,0 +1,26 @@ +# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license + +# Copyright (C) 2016 Nominum, Inc. +# +# Permission to use, copy, modify, and distribute this software and its +# documentation for any purpose with or without fee is hereby granted, +# provided that the above copyright notice and this permission notice +# appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +import dns.immutable +import dns.rdtypes.txtbase + + +@dns.immutable.immutable +class AVC(dns.rdtypes.txtbase.TXTBase): + """AVC record""" + + # See: IANA dns parameters for AVC diff --git a/shared/package-files/4a/4a9b7b376a88fe33fced363a3aa7e7e6ad492a89db3e64271a7ef23013c0abdb/graphlib.pyi b/shared/package-files/4a/4a9b7b376a88fe33fced363a3aa7e7e6ad492a89db3e64271a7ef23013c0abdb/graphlib.pyi new file mode 100644 index 0000000000000000000000000000000000000000..ca21b42329d27f5c63f7479459e4cbc4b436cfe1 --- /dev/null +++ b/shared/package-files/4a/4a9b7b376a88fe33fced363a3aa7e7e6ad492a89db3e64271a7ef23013c0abdb/graphlib.pyi @@ -0,0 +1,16 @@ +from _typeshed import SupportsItems +from typing import Generic, Iterable, Optional, Tuple, TypeVar + +_T = TypeVar("_T") + +class TopologicalSorter(Generic[_T]): + def __init__(self, graph: Optional[SupportsItems[_T, Iterable[_T]]] = ...) -> None: ... + def add(self, node: _T, *predecessors: _T) -> None: ... + def prepare(self) -> None: ... + def is_active(self) -> bool: ... + def __bool__(self) -> bool: ... + def done(self, *nodes: _T) -> None: ... + def get_ready(self) -> Tuple[_T, ...]: ... + def static_order(self) -> Iterable[_T]: ... + +class CycleError(ValueError): ... diff --git a/shared/package-files/4a/4a9faf2c9a26e0f4658467d8e91a54adeed28d89b7dc936af4d0b0086796f9f4/entry_points.txt b/shared/package-files/4a/4a9faf2c9a26e0f4658467d8e91a54adeed28d89b7dc936af4d0b0086796f9f4/entry_points.txt new file mode 100644 index 0000000000000000000000000000000000000000..42a12f960335556fcee728e5754c346447d4e89c --- /dev/null +++ b/shared/package-files/4a/4a9faf2c9a26e0f4658467d8e91a54adeed28d89b7dc936af4d0b0086796f9f4/entry_points.txt @@ -0,0 +1,2 @@ +[console_scripts] +isympy = isympy:main diff --git a/shared/package-files/4a/4aa2a76429a15113cf377d44f60e34f475fcf03e35eac70c4304914c9eddb876/jsonpointer.py b/shared/package-files/4a/4aa2a76429a15113cf377d44f60e34f475fcf03e35eac70c4304914c9eddb876/jsonpointer.py new file mode 100644 index 0000000000000000000000000000000000000000..29b4c8037dabcf40a4b2d3de62fba21082f4937a --- /dev/null +++ b/shared/package-files/4a/4aa2a76429a15113cf377d44f60e34f475fcf03e35eac70c4304914c9eddb876/jsonpointer.py @@ -0,0 +1,331 @@ +# -*- coding: utf-8 -*- +# +# python-json-pointer - An implementation of the JSON Pointer syntax +# https://github.com/stefankoegl/python-json-pointer +# +# Copyright (c) 2011 Stefan Kögl +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +""" Identify specific nodes in a JSON document (RFC 6901) """ + +from __future__ import unicode_literals + +# Will be parsed by setup.py to determine package metadata +__author__ = 'Stefan Kögl ' +__version__ = '2.1' +__website__ = 'https://github.com/stefankoegl/python-json-pointer' +__license__ = 'Modified BSD License' + + +try: + from itertools import izip + str = unicode +except ImportError: # Python 3 + izip = zip + +try: + from collections.abc import Mapping, Sequence +except ImportError: # Python 3 + from collections import Mapping, Sequence + +from itertools import tee +import re +import copy + + +_nothing = object() + + +def set_pointer(doc, pointer, value, inplace=True): + """Resolves pointer against doc and sets the value of the target within doc. + + With inplace set to true, doc is modified as long as pointer is not the + root. + + >>> obj = {'foo': {'anArray': [ {'prop': 44}], 'another prop': {'baz': 'A string' }}} + + >>> set_pointer(obj, '/foo/anArray/0/prop', 55) == \ + {'foo': {'another prop': {'baz': 'A string'}, 'anArray': [{'prop': 55}]}} + True + + >>> set_pointer(obj, '/foo/yet another prop', 'added prop') == \ + {'foo': {'another prop': {'baz': 'A string'}, 'yet another prop': 'added prop', 'anArray': [{'prop': 55}]}} + True + + >>> obj = {'foo': {}} + >>> set_pointer(obj, '/foo/a%20b', 'x') == \ + {'foo': {'a%20b': 'x' }} + True + """ + + pointer = JsonPointer(pointer) + return pointer.set(doc, value, inplace) + + +def resolve_pointer(doc, pointer, default=_nothing): + """ Resolves pointer against doc and returns the referenced object + + >>> obj = {'foo': {'anArray': [ {'prop': 44}], 'another prop': {'baz': 'A string' }}, 'a%20b': 1, 'c d': 2} + + >>> resolve_pointer(obj, '') == obj + True + + >>> resolve_pointer(obj, '/foo') == obj['foo'] + True + + >>> resolve_pointer(obj, '/foo/another prop') == obj['foo']['another prop'] + True + + >>> resolve_pointer(obj, '/foo/another prop/baz') == obj['foo']['another prop']['baz'] + True + + >>> resolve_pointer(obj, '/foo/anArray/0') == obj['foo']['anArray'][0] + True + + >>> resolve_pointer(obj, '/some/path', None) == None + True + + >>> resolve_pointer(obj, '/a b', None) == None + True + + >>> resolve_pointer(obj, '/a%20b') == 1 + True + + >>> resolve_pointer(obj, '/c d') == 2 + True + + >>> resolve_pointer(obj, '/c%20d', None) == None + True + """ + + pointer = JsonPointer(pointer) + return pointer.resolve(doc, default) + + +def pairwise(iterable): + """ Transforms a list to a list of tuples of adjacent items + + s -> (s0,s1), (s1,s2), (s2, s3), ... + + >>> list(pairwise([])) + [] + + >>> list(pairwise([1])) + [] + + >>> list(pairwise([1, 2, 3, 4])) + [(1, 2), (2, 3), (3, 4)] + """ + a, b = tee(iterable) + for _ in b: + break + return izip(a, b) + + +class JsonPointerException(Exception): + pass + + +class EndOfList(object): + """Result of accessing element "-" of a list""" + + def __init__(self, list_): + self.list_ = list_ + + def __repr__(self): + return '{cls}({lst})'.format(cls=self.__class__.__name__, + lst=repr(self.list_)) + + +class JsonPointer(object): + """A JSON Pointer that can reference parts of a JSON document""" + + # Array indices must not contain: + # leading zeros, signs, spaces, decimals, etc + _RE_ARRAY_INDEX = re.compile('0|[1-9][0-9]*$') + _RE_INVALID_ESCAPE = re.compile('(~[^01]|~$)') + + def __init__(self, pointer): + + # validate escapes + invalid_escape = self._RE_INVALID_ESCAPE.search(pointer) + if invalid_escape: + raise JsonPointerException('Found invalid escape {}'.format( + invalid_escape.group())) + + parts = pointer.split('/') + if parts.pop(0) != '': + raise JsonPointerException('Location must start with /') + + parts = [unescape(part) for part in parts] + self.parts = parts + + def to_last(self, doc): + """Resolves ptr until the last step, returns (sub-doc, last-step)""" + + if not self.parts: + return doc, None + + for part in self.parts[:-1]: + doc = self.walk(doc, part) + + return doc, self.get_part(doc, self.parts[-1]) + + def resolve(self, doc, default=_nothing): + """Resolves the pointer against doc and returns the referenced object""" + + for part in self.parts: + + try: + doc = self.walk(doc, part) + except JsonPointerException: + if default is _nothing: + raise + else: + return default + + return doc + + get = resolve + + def set(self, doc, value, inplace=True): + """Resolve the pointer against the doc and replace the target with value.""" + + if len(self.parts) == 0: + if inplace: + raise JsonPointerException('Cannot set root in place') + return value + + if not inplace: + doc = copy.deepcopy(doc) + + (parent, part) = self.to_last(doc) + + parent[part] = value + return doc + + def get_part(self, doc, part): + """Returns the next step in the correct type""" + + if isinstance(doc, Mapping): + return part + + elif isinstance(doc, Sequence): + + if part == '-': + return part + + if not self._RE_ARRAY_INDEX.match(str(part)): + raise JsonPointerException("'%s' is not a valid sequence index" % part) + + return int(part) + + elif hasattr(doc, '__getitem__'): + # Allow indexing via ducktyping + # if the target has defined __getitem__ + return part + + else: + raise JsonPointerException("Document '%s' does not support indexing, " + "must be mapping/sequence or support __getitem__" % type(doc)) + + + def walk(self, doc, part): + """ Walks one step in doc and returns the referenced part """ + + part = self.get_part(doc, part) + + assert hasattr(doc, '__getitem__'), "invalid document type %s" % (type(doc),) + + if isinstance(doc, Sequence): + if part == '-': + return EndOfList(doc) + + try: + return doc[part] + + except IndexError: + raise JsonPointerException("index '%s' is out of bounds" % (part, )) + + # Else the object is a mapping or supports __getitem__(so assume custom indexing) + try: + return doc[part] + + except KeyError: + raise JsonPointerException("member '%s' not found in %s" % (part, doc)) + + + def contains(self, ptr): + """ Returns True if self contains the given ptr """ + return self.parts[:len(ptr.parts)] == ptr.parts + + def __contains__(self, item): + """ Returns True if self contains the given ptr """ + return self.contains(item) + + @property + def path(self): + """Returns the string representation of the pointer + + >>> ptr = JsonPointer('/~0/0/~1').path == '/~0/0/~1' + """ + parts = [escape(part) for part in self.parts] + return ''.join('/' + part for part in parts) + + def __eq__(self, other): + """Compares a pointer to another object + + Pointers can be compared by comparing their strings (or splitted + strings), because no two different parts can point to the same + structure in an object (eg no different number representations) + """ + + if not isinstance(other, JsonPointer): + return False + + return self.parts == other.parts + + def __hash__(self): + return hash(tuple(self.parts)) + + @classmethod + def from_parts(cls, parts): + """Constructs a JsonPointer from a list of (unescaped) paths + + >>> JsonPointer.from_parts(['a', '~', '/', 0]).path == '/a/~0/~1/0' + True + """ + parts = [escape(str(part)) for part in parts] + ptr = cls(''.join('/' + part for part in parts)) + return ptr + + +def escape(s): + return s.replace('~', '~0').replace('/', '~1') + +def unescape(s): + return s.replace('~1', '/').replace('~0', '~') diff --git a/shared/package-files/4a/4aa363f54efbc8e9f965fe098ba0aa2fcf83d9e360fc5ef5187a3c57c48c574e/top_level.txt b/shared/package-files/4a/4aa363f54efbc8e9f965fe098ba0aa2fcf83d9e360fc5ef5187a3c57c48c574e/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..86c1cb19e2763e3c2e7bab63fc0971722ead7fdf --- /dev/null +++ b/shared/package-files/4a/4aa363f54efbc8e9f965fe098ba0aa2fcf83d9e360fc5ef5187a3c57c48c574e/top_level.txt @@ -0,0 +1 @@ +jedi diff --git a/shared/package-files/4a/4aa46dda537644c3ad8f907d43587bdf17316d52537d9d1b6337e01f49e73696/dialog.pyi b/shared/package-files/4a/4aa46dda537644c3ad8f907d43587bdf17316d52537d9d1b6337e01f49e73696/dialog.pyi new file mode 100644 index 0000000000000000000000000000000000000000..d02036a64f10f03f8eb2eb6599f97838312afb7f --- /dev/null +++ b/shared/package-files/4a/4aa46dda537644c3ad8f907d43587bdf17316d52537d9d1b6337e01f49e73696/dialog.pyi @@ -0,0 +1,10 @@ +from tkinter import Widget +from typing import Any, Mapping, Optional + +DIALOG_ICON: str + +class Dialog(Widget): + widgetName: str = ... + num: int = ... + def __init__(self, master: Optional[Any] = ..., cnf: Mapping[str, Any] = ..., **kw) -> None: ... + def destroy(self) -> None: ... diff --git a/shared/package-files/4a/4aa7d6ccc6905561d014f9fbfc3148d38caf01365c6b12655c0c1ff5a4a8344f/tclass.py b/shared/package-files/4a/4aa7d6ccc6905561d014f9fbfc3148d38caf01365c6b12655c0c1ff5a4a8344f/tclass.py new file mode 100644 index 0000000000000000000000000000000000000000..6bd9ffcd9a09e58f24b217e706fef1d7d2465cfe --- /dev/null +++ b/shared/package-files/4a/4aa7d6ccc6905561d014f9fbfc3148d38caf01365c6b12655c0c1ff5a4a8344f/tclass.py @@ -0,0 +1,34 @@ +"""Simple script to be run *twice*, to check reference counting bugs. + +See test_run for details.""" + + +import sys + +# We want to ensure that while objects remain available for immediate access, +# objects from *previous* runs of the same script get collected, to avoid +# accumulating massive amounts of old references. +class C(object): + def __init__(self,name): + self.name = name + self.p = print + self.flush_stdout = sys.stdout.flush + + def __del__(self): + self.p('tclass.py: deleting object:',self.name) + self.flush_stdout() + +try: + name = sys.argv[1] +except IndexError: + pass +else: + if name.startswith('C'): + c = C(name) + +#print >> sys.stderr, "ARGV:", sys.argv # dbg + +# This next print statement is NOT debugging, we're making the check on a +# completely separate process so we verify by capturing stdout: +print('ARGV 1-:', sys.argv[1:]) +sys.stdout.flush() diff --git a/shared/package-files/4a/4aaa05d6330869f832bdfd8fbf1985c4db68d0842cd4792685c78a6f6f79256d/dependencies.py b/shared/package-files/4a/4aaa05d6330869f832bdfd8fbf1985c4db68d0842cd4792685c78a6f6f79256d/dependencies.py new file mode 100644 index 0000000000000000000000000000000000000000..a2bb6ec717adf89380fb60dab02e4912cd34baed --- /dev/null +++ b/shared/package-files/4a/4aaa05d6330869f832bdfd8fbf1985c4db68d0842cd4792685c78a6f6f79256d/dependencies.py @@ -0,0 +1,134 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +if TYPE_CHECKING: + from typing_extensions import TypeIs + + from narwhals.stable.v1.typing import IntoDataFrameT, IntoLazyFrameT, IntoSeriesT + + +from narwhals.dependencies import ( + _is_cudf_dataframe as is_cudf_dataframe, + _is_cudf_series as is_cudf_series, + _is_dask_dataframe as is_dask_dataframe, + _is_duckdb_relation as is_duckdb_relation, + _is_ibis_table as is_ibis_table, + _is_modin_dataframe as is_modin_dataframe, + _is_modin_series as is_modin_series, + _is_native_dataframe, + _is_native_lazyframe, + _is_native_series, + _is_pandas_dataframe as is_pandas_dataframe, + _is_pandas_like_dataframe as is_pandas_like_dataframe, + _is_pandas_like_series as is_pandas_like_series, + _is_pandas_series as is_pandas_series, + _is_polars_dataframe as is_polars_dataframe, + _is_polars_lazyframe as is_polars_lazyframe, + _is_polars_series as is_polars_series, + _is_pyarrow_chunked_array as is_pyarrow_chunked_array, + _is_pyarrow_table as is_pyarrow_table, + _is_pyspark_connect_dataframe as is_pyspark_connect_dataframe, + _is_pyspark_dataframe as is_pyspark_dataframe, + _is_sqlframe_dataframe as is_sqlframe_dataframe, + get_cudf, + get_dask, + get_dask_dataframe, + get_duckdb, + get_ibis, + get_modin, + get_numpy, + get_pandas, + get_polars, + get_pyarrow, + get_pyspark, + get_pyspark_connect, + get_pyspark_sql, + get_sqlframe, + is_cudf_index, + is_modin_index, + is_narwhals_dataframe, + is_narwhals_lazyframe, + is_narwhals_series, + is_numpy_array, + is_pandas_index, + is_pandas_like_index, +) + + +# TODO(Unassigned): For duckdb and ibis backends: +# * is_into_dataframe(native_frame) returns False +# * nw_v1.from_native(native_frame) returns a narwhals.stable.v1.DataFrame +# * Therefore is_into_dataframe(nw_v1.from_native(native_frame)) returns True +# See discussion https://github.com/narwhals-dev/narwhals/pull/3613#discussion_r3288440039 +def is_into_dataframe(native_dataframe: Any | IntoDataFrameT) -> TypeIs[IntoDataFrameT]: + """Check whether `native_dataframe` can be converted to a narwhals.stable.v1.DataFrame.""" + from narwhals.stable.v1 import DataFrame + + return isinstance(native_dataframe, DataFrame) or _is_native_dataframe( + native_dataframe + ) + + +def is_into_lazyframe(native_lazyframe: Any | IntoLazyFrameT) -> TypeIs[IntoLazyFrameT]: + """Check whether `native_lazyframe` can be converted to a narwhals.stable.v1.LazyFrame.""" + from narwhals.stable.v1 import LazyFrame + + return isinstance(native_lazyframe, LazyFrame) or _is_native_lazyframe( + native_lazyframe + ) + + +def is_into_series(native_series: Any | IntoSeriesT) -> TypeIs[IntoSeriesT]: + """Check whether `native_series` can be converted to a narwhals.stable.v1.Series.""" + from narwhals.stable.v1 import Series + + return isinstance(native_series, Series) or _is_native_series(native_series) + + +__all__ = [ + "get_cudf", + "get_dask", + "get_dask_dataframe", + "get_duckdb", + "get_ibis", + "get_modin", + "get_numpy", + "get_pandas", + "get_polars", + "get_pyarrow", + "get_pyspark", + "get_pyspark_connect", + "get_pyspark_sql", + "get_sqlframe", + "is_cudf_dataframe", + "is_cudf_index", + "is_cudf_series", + "is_dask_dataframe", + "is_duckdb_relation", + "is_ibis_table", + "is_into_dataframe", + "is_into_lazyframe", + "is_into_series", + "is_modin_dataframe", + "is_modin_index", + "is_modin_series", + "is_narwhals_dataframe", + "is_narwhals_lazyframe", + "is_narwhals_series", + "is_numpy_array", + "is_pandas_dataframe", + "is_pandas_index", + "is_pandas_like_dataframe", + "is_pandas_like_index", + "is_pandas_like_series", + "is_pandas_series", + "is_polars_dataframe", + "is_polars_lazyframe", + "is_polars_series", + "is_pyarrow_chunked_array", + "is_pyarrow_table", + "is_pyspark_connect_dataframe", + "is_pyspark_dataframe", + "is_sqlframe_dataframe", +] diff --git a/shared/package-files/4a/4aad36199e954625d60b2da5504d5ee3bfc450376bf3cae6599a0a0b11f47e04/domreg.pyi b/shared/package-files/4a/4aad36199e954625d60b2da5504d5ee3bfc450376bf3cae6599a0a0b11f47e04/domreg.pyi new file mode 100644 index 0000000000000000000000000000000000000000..6f479b097b65845e173f9eaca2b2946c2bac531f --- /dev/null +++ b/shared/package-files/4a/4aad36199e954625d60b2da5504d5ee3bfc450376bf3cae6599a0a0b11f47e04/domreg.pyi @@ -0,0 +1,10 @@ +from _typeshed.xml import DOMImplementation +from typing import Any, Callable, Dict, Iterable, Optional, Tuple, Union + +well_known_implementations: Dict[str, str] +registered: Dict[str, Callable[[], DOMImplementation]] + +def registerDOMImplementation(name: str, factory: Callable[[], DOMImplementation]) -> None: ... +def getDOMImplementation( + name: Optional[str] = ..., features: Union[str, Iterable[Tuple[str, Optional[str]]]] = ... +) -> DOMImplementation: ... diff --git a/shared/package-files/4a/4aae5cdc22aad2e8f9683c8ea071e43c43bf56c4a967dd0945a2f6ac02879392/compat.pxi b/shared/package-files/4a/4aae5cdc22aad2e8f9683c8ea071e43c43bf56c4a967dd0945a2f6ac02879392/compat.pxi new file mode 100644 index 0000000000000000000000000000000000000000..8cf106d5609b50dd84c082dcfd36aee5b16fbee4 --- /dev/null +++ b/shared/package-files/4a/4aae5cdc22aad2e8f9683c8ea071e43c43bf56c4a967dd0945a2f6ac02879392/compat.pxi @@ -0,0 +1,71 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +def encode_file_path(path): + if isinstance(path, str): + # POSIX systems can handle utf-8. UTF8 is converted to utf16-le in + # libarrow + encoded_path = path.encode('utf-8') + else: + encoded_path = path + + # Windows file system requires utf-16le for file names; Arrow C++ libraries + # will convert utf8 to utf16 + return encoded_path + + +# Starting with Python 3.7, dicts are guaranteed to be insertion-ordered. +ordered_dict = dict + + +try: + import cloudpickle as pickle +except ImportError: + import pickle + + +def tobytes(o): + """ + Encode a unicode or bytes string to bytes. + + Parameters + ---------- + o : str or bytes + Input string. + """ + if isinstance(o, str): + return o.encode('utf8') + else: + return o + + +def frombytes(o, *, safe=False): + """ + Decode the given bytestring to unicode. + + Parameters + ---------- + o : bytes-like + Input object. + safe : bool, default False + If true, raise on encoding errors. + """ + if safe: + return o.decode('utf8', errors='replace') + else: + return o.decode('utf8') diff --git a/shared/package-files/4a/4ab2c62caac835a416c60921fc255e07828b65d7bb023763ce5c4b0854c9d173/ansi-mr b/shared/package-files/4a/4ab2c62caac835a416c60921fc255e07828b65d7bb023763ce5c4b0854c9d173/ansi-mr new file mode 100644 index 0000000000000000000000000000000000000000..92ab01a574db69a42d2a4bda12b197e90c9576ea Binary files /dev/null and b/shared/package-files/4a/4ab2c62caac835a416c60921fc255e07828b65d7bb023763ce5c4b0854c9d173/ansi-mr differ diff --git a/shared/package-files/4a/4ab48897041265c424d6f81b39dfcc38548980071e4f7cecf3caa403ec0b86a1/rnn_tanh_cell_compositeimplicitautograd_dispatch.h b/shared/package-files/4a/4ab48897041265c424d6f81b39dfcc38548980071e4f7cecf3caa403ec0b86a1/rnn_tanh_cell_compositeimplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..b4186ec6a6f2e8afec9ffcd4ac339fd8c69ef87d --- /dev/null +++ b/shared/package-files/4a/4ab48897041265c424d6f81b39dfcc38548980071e4f7cecf3caa403ec0b86a1/rnn_tanh_cell_compositeimplicitautograd_dispatch.h @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeimplicitautograd { + +TORCH_API at::Tensor rnn_tanh_cell(const at::Tensor & input, const at::Tensor & hx, const at::Tensor & w_ih, const at::Tensor & w_hh, const c10::optional & b_ih={}, const c10::optional & b_hh={}); + +} // namespace compositeimplicitautograd +} // namespace at diff --git a/shared/package-files/4a/4aba5bd607f91d1b8764912d13d43d138d67f20dfd58ec240f86446460ddba6b/_unique_ops.h b/shared/package-files/4a/4aba5bd607f91d1b8764912d13d43d138d67f20dfd58ec240f86446460ddba6b/_unique_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..2bf756c622fa3c86d763e44787735626268da822 --- /dev/null +++ b/shared/package-files/4a/4aba5bd607f91d1b8764912d13d43d138d67f20dfd58ec240f86446460ddba6b/_unique_ops.h @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API _unique { + using schema = ::std::tuple (const at::Tensor &, bool, bool); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_unique") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_unique(Tensor self, bool sorted=True, bool return_inverse=False) -> (Tensor, Tensor)") + static ::std::tuple call(const at::Tensor & self, bool sorted, bool return_inverse); + static ::std::tuple redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, bool sorted, bool return_inverse); +}; + +struct TORCH_API _unique_out { + using schema = ::std::tuple (const at::Tensor &, bool, bool, at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_unique") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_unique.out(Tensor self, bool sorted=True, bool return_inverse=False, *, Tensor(a!) out0, Tensor(b!) out1) -> (Tensor(a!), Tensor(b!))") + static ::std::tuple call(const at::Tensor & self, bool sorted, bool return_inverse, at::Tensor & out0, at::Tensor & out1); + static ::std::tuple redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, bool sorted, bool return_inverse, at::Tensor & out0, at::Tensor & out1); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/4a/4abe77927fd55a5fc493cdbf92e4d229556e9ea9a4841a76f885c4387fc42545/geometric_ops.h b/shared/package-files/4a/4abe77927fd55a5fc493cdbf92e4d229556e9ea9a4841a76f885c4387fc42545/geometric_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..4573c6deb4a569cc5af077dd975e5c9093d81fea --- /dev/null +++ b/shared/package-files/4a/4abe77927fd55a5fc493cdbf92e4d229556e9ea9a4841a76f885c4387fc42545/geometric_ops.h @@ -0,0 +1,50 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API geometric_ { + using schema = at::Tensor & (at::Tensor &, double, c10::optional); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::geometric_") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "geometric_(Tensor(a!) self, float p, *, Generator? generator=None) -> Tensor(a!)") + static at::Tensor & call(at::Tensor & self, double p, c10::optional generator); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, at::Tensor & self, double p, c10::optional generator); +}; + +struct TORCH_API geometric_out { + using schema = at::Tensor & (const at::Tensor &, double, c10::optional, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::geometric") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "geometric.out(Tensor self, float p, *, Generator? generator=None, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, double p, c10::optional generator, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, double p, c10::optional generator, at::Tensor & out); +}; + +struct TORCH_API geometric { + using schema = at::Tensor (const at::Tensor &, double, c10::optional); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::geometric") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "geometric(Tensor self, float p, *, Generator? generator=None) -> Tensor") + static at::Tensor call(const at::Tensor & self, double p, c10::optional generator); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, double p, c10::optional generator); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/4a/4acd9fdc321a9c71253a4fd2152e9d717e621b44aaa5fd49376e0072de4cdf7e/bincount_cuda_dispatch.h b/shared/package-files/4a/4acd9fdc321a9c71253a4fd2152e9d717e621b44aaa5fd49376e0072de4cdf7e/bincount_cuda_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..f290700d4ee6984e8e8e16c678957736ee92c600 --- /dev/null +++ b/shared/package-files/4a/4acd9fdc321a9c71253a4fd2152e9d717e621b44aaa5fd49376e0072de4cdf7e/bincount_cuda_dispatch.h @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API at::Tensor bincount(const at::Tensor & self, const c10::optional & weights={}, int64_t minlength=0); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/4a/4ad167b098928c1e01339b4cf90f6134e21de32b95af35a3d10b06bce6b09034/contract.py b/shared/package-files/4a/4ad167b098928c1e01339b4cf90f6134e21de32b95af35a3d10b06bce6b09034/contract.py new file mode 100644 index 0000000000000000000000000000000000000000..2a6983023f76e26698a3c4e8ee477fae9e7eb508 --- /dev/null +++ b/shared/package-files/4a/4ad167b098928c1e01339b4cf90f6134e21de32b95af35a3d10b06bce6b09034/contract.py @@ -0,0 +1,194 @@ +import uuid +from collections import OrderedDict +from functools import wraps +from typing import Callable, Dict, List, Optional, Type + +import torch.nn as nn +from torch.distributed._composable_state import _State + + +def generate_state_key(string="__composable_api_state_key"): + return f"{string}_{str(uuid.uuid4())}" + + +STATE_KEY = generate_state_key() +REGISTRY_KEY = generate_state_key() + + +# TODO: we can add additional info to RegistryItem to share across APIs. E.g., +# we can add args and kwargs here, and then we can detect whether fully_shard +# is combined with reentrant activation checkpointing and error out with a clear +# message. +class RegistryItem: + pass + + +def contract(state_cls: Type[_State] = _State): + r""" + Decorate a function as a composable distributed API, where the first + argument of the function must be an :class:`nn.Module` instance. The + decorator verifies that the wrapped function does not modify parameter, + buffer or sub-module fully-qualified names (FQN). + + When a function ``func`` is decorated by ``@contract()``, a + ``.state(module: nn.Module)`` method will be installed to the decorated + function. Then you can retrieve and modify the state on a module by calling + ``func.state(module)``. + + Example:: + >>> # xdoctest: +SKIP + >>> import torch.nn as nn + >>> + >>> class MyModel(nn.Module): + >>> def __init__(self): + >>> super().__init__() + >>> self.l1 = nn.Linear(10, 10) + >>> self.l2 = nn.Linear(10, 10) + >>> + >>> def forward(self, x): + >>> return self.l2(self.l1(x)) + >>> + >>> @contract() + >>> def my_feature(module: nn.Module) -> nn.Module: + >>> my_feature.state(module).some_state = "any value" + >>> return module + >>> + >>> model = MyModel() + >>> my_feature(model.l1) + >>> assert my_feature.state(model.l1).some_state == "any value" + >>> my_feature(model.l2) + >>> model(torch.randn(2, 10)).sum().backward() + """ + + # wraps will make functions decorated with contract() pickleable - needed for integration with torch.package + @wraps(state_cls) + def inner(func): + @wraps(func) + def wrapper(module: nn.Module, *args, **kwargs) -> Optional[nn.Module]: + # get existing global states + default_all_state: Dict[Callable, _State] = OrderedDict() + all_state: Dict[Callable, _State] = module.__dict__.setdefault( # type: ignore[call-overload] + STATE_KEY, default_all_state + ) + assert isinstance( + all_state, dict + ), "Distributed composable API states corrupted" + + # get global registry + default_registry: Dict[str, RegistryItem] = OrderedDict() + registry: Dict[str, RegistryItem] = module.__dict__.setdefault( # type: ignore[call-overload] + REGISTRY_KEY, default_registry + ) + + assert isinstance( + registry, dict + ), "Distributed composable API registry corrupted" + + # make sure the API func has not been applied to the input module yet. + assert func not in all_state and func.__name__ not in registry, ( + "Each distinct composable distributed API can only be applied to a " + f"module once. {func.__name__} has already been applied to the " + f"following module.\n{module}" + ) + + # install states specific to the wrapped ``func`` + all_state.setdefault(func, state_cls()) + # register ``func`` in the global registry by name + registry.setdefault(func.__name__, RegistryItem()) + + orig_named_params = OrderedDict(module.named_parameters()) + orig_named_buffers = OrderedDict( + module.named_buffers(remove_duplicate=False) + ) + orig_named_modules = OrderedDict( + module.named_modules(remove_duplicate=False) + ) + + updated = func(module, *args, **kwargs) + + if updated is None: + updated = module + + new_named_params = OrderedDict(updated.named_parameters()) + new_named_buffers = OrderedDict( + updated.named_buffers(remove_duplicate=False) + ) + new_named_modules = OrderedDict( + updated.named_modules(remove_duplicate=False) + ) + + assert isinstance(updated, nn.Module), ( + "Output of composable distributed APIs must be either None or " + f"nn.Module, but got {type(updated)}" + ) + + def check_fqn(orig_fqns: List[str], new_fqns: List[str], check_key: str): + if orig_fqns == new_fqns: + return + + orig_fqn_set, new_fqn_set = set(orig_fqns), set(new_fqns) + orig_only = orig_fqn_set - new_fqn_set + new_only = new_fqn_set - orig_fqn_set + if len(orig_only) or len(new_only): + raise RuntimeError( + f"{check_key}" + "Composable distributed API implementations cannot modify " + "FQNs.\n" + f"Only in original FQNs: {orig_only},\n" + f"Only in new FQNs: {new_only}" + ) + else: + raise RuntimeError( + f"{check_key}" + "Composable distributed API implementations cannot modify " + "the order of FQNs.\n" + f"Original FQNs: {orig_only}\n" + f"New FQNs: {new_only}" + ) + + check_fqn( + list(orig_named_params.keys()), + list(new_named_params.keys()), + "Check parameters, ", + ) + check_fqn( + list(orig_named_buffers.keys()), + list(new_named_buffers.keys()), + "Check buffer, ", + ) + check_fqn( + list(orig_named_modules.keys()), + list(new_named_modules.keys()), + "Check modules, ", + ) + + # TODO: a stricter verification should also reject changing module + # types and monkey-patching forward() method implementations. + + # TODO: verify that installed distributed paradigms are compatible with + # each other. + + return updated + + def get_state(module: nn.Module) -> Optional[_State]: + return module.__dict__.setdefault( # type: ignore[call-overload] + STATE_KEY, + {}, # TODO(@yhcharles): this is a temporary fix, need a better way + ).get( + func + ) # type: ignore[call-overload] + + wrapper.state = get_state # type: ignore[attr-defined] + + return wrapper + + return inner + + +def _get_registry(module: nn.Module) -> Optional[Dict[str, RegistryItem]]: + r""" + Get an ``OrderedDict`` of composable APIs that have been applied to the + ``module``, indexed by the API name. If no API has been applied, then this + returns ``None``. + """ + return getattr(module, REGISTRY_KEY, None) diff --git a/shared/package-files/4a/4ad1c820fa0e48e7be4bd25b89c6a5ea48de113d7e6a413502d6cdcdbf736839/expand_as.h b/shared/package-files/4a/4ad1c820fa0e48e7be4bd25b89c6a5ea48de113d7e6a413502d6cdcdbf736839/expand_as.h new file mode 100644 index 0000000000000000000000000000000000000000..173787aba901b457c5748693b770d61e28c239e9 --- /dev/null +++ b/shared/package-files/4a/4ad1c820fa0e48e7be4bd25b89c6a5ea48de113d7e6a413502d6cdcdbf736839/expand_as.h @@ -0,0 +1,26 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + + +} diff --git a/shared/package-files/4a/4ad5403ad4b0fa4107816e14ba7c0ccab5b1e5a4dc6c3ce47eeaca1f9bb162c2/discriminant_analysis.py b/shared/package-files/4a/4ad5403ad4b0fa4107816e14ba7c0ccab5b1e5a4dc6c3ce47eeaca1f9bb162c2/discriminant_analysis.py new file mode 100644 index 0000000000000000000000000000000000000000..6df26a05a87817a1c50c10c73626c1638df09ccb --- /dev/null +++ b/shared/package-files/4a/4ad5403ad4b0fa4107816e14ba7c0ccab5b1e5a4dc6c3ce47eeaca1f9bb162c2/discriminant_analysis.py @@ -0,0 +1,1129 @@ +"""Linear and quadratic discriminant analysis.""" + +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + +import warnings +from numbers import Integral, Real + +import numpy as np +import scipy.linalg +from scipy import linalg + +from .base import ( + BaseEstimator, + ClassifierMixin, + ClassNamePrefixFeaturesOutMixin, + TransformerMixin, + _fit_context, +) +from .covariance import empirical_covariance, ledoit_wolf, shrunk_covariance +from .linear_model._base import LinearClassifierMixin +from .preprocessing import StandardScaler +from .utils._array_api import _expit, device, get_namespace, size +from .utils._param_validation import HasMethods, Interval, StrOptions +from .utils.extmath import softmax +from .utils.multiclass import check_classification_targets, unique_labels +from .utils.validation import check_is_fitted, validate_data + +__all__ = ["LinearDiscriminantAnalysis", "QuadraticDiscriminantAnalysis"] + + +def _cov(X, shrinkage=None, covariance_estimator=None): + """Estimate covariance matrix (using optional covariance_estimator). + Parameters + ---------- + X : array-like of shape (n_samples, n_features) + Input data. + + shrinkage : {'empirical', 'auto'} or float, default=None + Shrinkage parameter, possible values: + - None or 'empirical': no shrinkage (default). + - 'auto': automatic shrinkage using the Ledoit-Wolf lemma. + - float between 0 and 1: fixed shrinkage parameter. + + Shrinkage parameter is ignored if `covariance_estimator` + is not None. + + covariance_estimator : estimator, default=None + If not None, `covariance_estimator` is used to estimate + the covariance matrices instead of relying on the empirical + covariance estimator (with potential shrinkage). + The object should have a fit method and a ``covariance_`` attribute + like the estimators in :mod:`sklearn.covariance``. + if None the shrinkage parameter drives the estimate. + + .. versionadded:: 0.24 + + Returns + ------- + s : ndarray of shape (n_features, n_features) + Estimated covariance matrix. + """ + if covariance_estimator is None: + shrinkage = "empirical" if shrinkage is None else shrinkage + if isinstance(shrinkage, str): + if shrinkage == "auto": + sc = StandardScaler() # standardize features + X = sc.fit_transform(X) + s = ledoit_wolf(X)[0] + # rescale + s = sc.scale_[:, np.newaxis] * s * sc.scale_[np.newaxis, :] + elif shrinkage == "empirical": + s = empirical_covariance(X) + elif isinstance(shrinkage, Real): + s = shrunk_covariance(empirical_covariance(X), shrinkage) + else: + if shrinkage is not None and shrinkage != 0: + raise ValueError( + "covariance_estimator and shrinkage parameters " + "are not None. Only one of the two can be set." + ) + covariance_estimator.fit(X) + if not hasattr(covariance_estimator, "covariance_"): + raise ValueError( + "%s does not have a covariance_ attribute" + % covariance_estimator.__class__.__name__ + ) + s = covariance_estimator.covariance_ + return s + + +def _class_means(X, y): + """Compute class means. + + Parameters + ---------- + X : array-like of shape (n_samples, n_features) + Input data. + + y : array-like of shape (n_samples,) or (n_samples, n_targets) + Target values. + + Returns + ------- + means : array-like of shape (n_classes, n_features) + Class means. + """ + xp, is_array_api_compliant = get_namespace(X) + classes, y = xp.unique_inverse(y) + means = xp.zeros((classes.shape[0], X.shape[1]), device=device(X), dtype=X.dtype) + + if is_array_api_compliant: + for i in range(classes.shape[0]): + means[i, :] = xp.mean(X[y == i], axis=0) + else: + # TODO: Explore the choice of using bincount + add.at as it seems sub optimal + # from a performance-wise + cnt = np.bincount(y) + np.add.at(means, y, X) + means /= cnt[:, None] + return means + + +def _class_cov(X, y, priors, shrinkage=None, covariance_estimator=None): + """Compute weighted within-class covariance matrix. + + The per-class covariance are weighted by the class priors. + + Parameters + ---------- + X : array-like of shape (n_samples, n_features) + Input data. + + y : array-like of shape (n_samples,) or (n_samples, n_targets) + Target values. + + priors : array-like of shape (n_classes,) + Class priors. + + shrinkage : 'auto' or float, default=None + Shrinkage parameter, possible values: + - None: no shrinkage (default). + - 'auto': automatic shrinkage using the Ledoit-Wolf lemma. + - float between 0 and 1: fixed shrinkage parameter. + + Shrinkage parameter is ignored if `covariance_estimator` is not None. + + covariance_estimator : estimator, default=None + If not None, `covariance_estimator` is used to estimate + the covariance matrices instead of relying the empirical + covariance estimator (with potential shrinkage). + The object should have a fit method and a ``covariance_`` attribute + like the estimators in sklearn.covariance. + If None, the shrinkage parameter drives the estimate. + + .. versionadded:: 0.24 + + Returns + ------- + cov : array-like of shape (n_features, n_features) + Weighted within-class covariance matrix + """ + classes = np.unique(y) + cov = np.zeros(shape=(X.shape[1], X.shape[1])) + for idx, group in enumerate(classes): + Xg = X[y == group, :] + cov += priors[idx] * np.atleast_2d(_cov(Xg, shrinkage, covariance_estimator)) + return cov + + +class DiscriminantAnalysisPredictionMixin: + """Mixin class for QuadraticDiscriminantAnalysis and NearestCentroid.""" + + def decision_function(self, X): + """Apply decision function to an array of samples. + + Parameters + ---------- + X : {array-like, sparse matrix} of shape (n_samples, n_features) + Array of samples (test vectors). + + Returns + ------- + y_scores : ndarray of shape (n_samples,) or (n_samples, n_classes) + Decision function values related to each class, per sample. + In the two-class case, the shape is `(n_samples,)`, giving the + log likelihood ratio of the positive class. + """ + y_scores = self._decision_function(X) + if len(self.classes_) == 2: + return y_scores[:, 1] - y_scores[:, 0] + return y_scores + + def predict(self, X): + """Perform classification on an array of vectors `X`. + + Returns the class label for each sample. + + Parameters + ---------- + X : {array-like, sparse matrix} of shape (n_samples, n_features) + Input vectors, where `n_samples` is the number of samples and + `n_features` is the number of features. + + Returns + ------- + y_pred : ndarray of shape (n_samples,) + Class label for each sample. + """ + scores = self._decision_function(X) + return self.classes_.take(scores.argmax(axis=1)) + + def predict_proba(self, X): + """Estimate class probabilities. + + Parameters + ---------- + X : {array-like, sparse matrix} of shape (n_samples, n_features) + Input data. + + Returns + ------- + y_proba : ndarray of shape (n_samples, n_classes) + Probability estimate of the sample for each class in the + model, where classes are ordered as they are in `self.classes_`. + """ + return np.exp(self.predict_log_proba(X)) + + def predict_log_proba(self, X): + """Estimate log class probabilities. + + Parameters + ---------- + X : {array-like, sparse matrix} of shape (n_samples, n_features) + Input data. + + Returns + ------- + y_log_proba : ndarray of shape (n_samples, n_classes) + Estimated log probabilities. + """ + scores = self._decision_function(X) + log_likelihood = scores - scores.max(axis=1)[:, np.newaxis] + return log_likelihood - np.log( + np.exp(log_likelihood).sum(axis=1)[:, np.newaxis] + ) + + +class LinearDiscriminantAnalysis( + ClassNamePrefixFeaturesOutMixin, + LinearClassifierMixin, + TransformerMixin, + BaseEstimator, +): + """Linear Discriminant Analysis. + + A classifier with a linear decision boundary, generated by fitting class + conditional densities to the data and using Bayes' rule. + + The model fits a Gaussian density to each class, assuming that all classes + share the same covariance matrix. + + The fitted model can also be used to reduce the dimensionality of the input + by projecting it to the most discriminative directions, using the + `transform` method. + + .. versionadded:: 0.17 + + For a comparison between + :class:`~sklearn.discriminant_analysis.LinearDiscriminantAnalysis` + and :class:`~sklearn.discriminant_analysis.QuadraticDiscriminantAnalysis`, see + :ref:`sphx_glr_auto_examples_classification_plot_lda_qda.py`. + + Read more in the :ref:`User Guide `. + + Parameters + ---------- + solver : {'svd', 'lsqr', 'eigen'}, default='svd' + Solver to use, possible values: + - 'svd': Singular value decomposition (default). + Does not compute the covariance matrix, therefore this solver is + recommended for data with a large number of features. + - 'lsqr': Least squares solution. + Can be combined with shrinkage or custom covariance estimator. + - 'eigen': Eigenvalue decomposition. + Can be combined with shrinkage or custom covariance estimator. + + .. versionchanged:: 1.2 + `solver="svd"` now has experimental Array API support. See the + :ref:`Array API User Guide ` for more details. + + shrinkage : 'auto' or float, default=None + Shrinkage parameter, possible values: + - None: no shrinkage (default). + - 'auto': automatic shrinkage using the Ledoit-Wolf lemma. + - float between 0 and 1: fixed shrinkage parameter. + + This should be left to None if `covariance_estimator` is used. + Note that shrinkage works only with 'lsqr' and 'eigen' solvers. + + For a usage example, see + :ref:`sphx_glr_auto_examples_classification_plot_lda.py`. + + priors : array-like of shape (n_classes,), default=None + The class prior probabilities. By default, the class proportions are + inferred from the training data. + + n_components : int, default=None + Number of components (<= min(n_classes - 1, n_features)) for + dimensionality reduction. If None, will be set to + min(n_classes - 1, n_features). This parameter only affects the + `transform` method. + + For a usage example, see + :ref:`sphx_glr_auto_examples_decomposition_plot_pca_vs_lda.py`. + + store_covariance : bool, default=False + If True, explicitly compute the weighted within-class covariance + matrix when solver is 'svd'. The matrix is always computed + and stored for the other solvers. + + .. versionadded:: 0.17 + + tol : float, default=1.0e-4 + Absolute threshold for a singular value of X to be considered + significant, used to estimate the rank of X. Dimensions whose + singular values are non-significant are discarded. Only used if + solver is 'svd'. + + .. versionadded:: 0.17 + + covariance_estimator : covariance estimator, default=None + If not None, `covariance_estimator` is used to estimate + the covariance matrices instead of relying on the empirical + covariance estimator (with potential shrinkage). + The object should have a fit method and a ``covariance_`` attribute + like the estimators in :mod:`sklearn.covariance`. + if None the shrinkage parameter drives the estimate. + + This should be left to None if `shrinkage` is used. + Note that `covariance_estimator` works only with 'lsqr' and 'eigen' + solvers. + + .. versionadded:: 0.24 + + Attributes + ---------- + coef_ : ndarray of shape (n_features,) or (n_classes, n_features) + Weight vector(s). + + intercept_ : ndarray of shape (n_classes,) + Intercept term. + + covariance_ : array-like of shape (n_features, n_features) + Weighted within-class covariance matrix. It corresponds to + `sum_k prior_k * C_k` where `C_k` is the covariance matrix of the + samples in class `k`. The `C_k` are estimated using the (potentially + shrunk) biased estimator of covariance. If solver is 'svd', only + exists when `store_covariance` is True. + + explained_variance_ratio_ : ndarray of shape (n_components,) + Percentage of variance explained by each of the selected components. + If ``n_components`` is not set then all components are stored and the + sum of explained variances is equal to 1.0. Only available when eigen + or svd solver is used. + + means_ : array-like of shape (n_classes, n_features) + Class-wise means. + + priors_ : array-like of shape (n_classes,) + Class priors (sum to 1). + + scalings_ : array-like of shape (rank, n_classes - 1) + Scaling of the features in the space spanned by the class centroids. + Only available for 'svd' and 'eigen' solvers. + + xbar_ : array-like of shape (n_features,) + Overall mean. Only present if solver is 'svd'. + + classes_ : array-like of shape (n_classes,) + Unique class labels. + + n_features_in_ : int + Number of features seen during :term:`fit`. + + .. versionadded:: 0.24 + + feature_names_in_ : ndarray of shape (`n_features_in_`,) + Names of features seen during :term:`fit`. Defined only when `X` + has feature names that are all strings. + + .. versionadded:: 1.0 + + See Also + -------- + QuadraticDiscriminantAnalysis : Quadratic Discriminant Analysis. + + Examples + -------- + >>> import numpy as np + >>> from sklearn.discriminant_analysis import LinearDiscriminantAnalysis + >>> X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]]) + >>> y = np.array([1, 1, 1, 2, 2, 2]) + >>> clf = LinearDiscriminantAnalysis() + >>> clf.fit(X, y) + LinearDiscriminantAnalysis() + >>> print(clf.predict([[-0.8, -1]])) + [1] + """ + + _parameter_constraints: dict = { + "solver": [StrOptions({"svd", "lsqr", "eigen"})], + "shrinkage": [StrOptions({"auto"}), Interval(Real, 0, 1, closed="both"), None], + "n_components": [Interval(Integral, 1, None, closed="left"), None], + "priors": ["array-like", None], + "store_covariance": ["boolean"], + "tol": [Interval(Real, 0, None, closed="left")], + "covariance_estimator": [HasMethods("fit"), None], + } + + def __init__( + self, + solver="svd", + shrinkage=None, + priors=None, + n_components=None, + store_covariance=False, + tol=1e-4, + covariance_estimator=None, + ): + self.solver = solver + self.shrinkage = shrinkage + self.priors = priors + self.n_components = n_components + self.store_covariance = store_covariance # used only in svd solver + self.tol = tol # used only in svd solver + self.covariance_estimator = covariance_estimator + + def _solve_lstsq(self, X, y, shrinkage, covariance_estimator): + """Least squares solver. + + The least squares solver computes a straightforward solution of the + optimal decision rule based directly on the discriminant functions. It + can only be used for classification (with any covariance estimator), + because + estimation of eigenvectors is not performed. Therefore, dimensionality + reduction with the transform is not supported. + + Parameters + ---------- + X : array-like of shape (n_samples, n_features) + Training data. + + y : array-like of shape (n_samples,) or (n_samples, n_classes) + Target values. + + shrinkage : 'auto', float or None + Shrinkage parameter, possible values: + - None: no shrinkage. + - 'auto': automatic shrinkage using the Ledoit-Wolf lemma. + - float between 0 and 1: fixed shrinkage parameter. + + Shrinkage parameter is ignored if `covariance_estimator` i + not None + + covariance_estimator : estimator, default=None + If not None, `covariance_estimator` is used to estimate + the covariance matrices instead of relying the empirical + covariance estimator (with potential shrinkage). + The object should have a fit method and a ``covariance_`` attribute + like the estimators in sklearn.covariance. + if None the shrinkage parameter drives the estimate. + + .. versionadded:: 0.24 + + Notes + ----- + This solver is based on [1]_, section 2.6.2, pp. 39-41. + + References + ---------- + .. [1] R. O. Duda, P. E. Hart, D. G. Stork. Pattern Classification + (Second Edition). John Wiley & Sons, Inc., New York, 2001. ISBN + 0-471-05669-3. + """ + self.means_ = _class_means(X, y) + self.covariance_ = _class_cov( + X, y, self.priors_, shrinkage, covariance_estimator + ) + self.coef_ = linalg.lstsq(self.covariance_, self.means_.T)[0].T + self.intercept_ = -0.5 * np.diag(np.dot(self.means_, self.coef_.T)) + np.log( + self.priors_ + ) + + def _solve_eigen(self, X, y, shrinkage, covariance_estimator): + """Eigenvalue solver. + + The eigenvalue solver computes the optimal solution of the Rayleigh + coefficient (basically the ratio of between class scatter to within + class scatter). This solver supports both classification and + dimensionality reduction (with any covariance estimator). + + Parameters + ---------- + X : array-like of shape (n_samples, n_features) + Training data. + + y : array-like of shape (n_samples,) or (n_samples, n_targets) + Target values. + + shrinkage : 'auto', float or None + Shrinkage parameter, possible values: + - None: no shrinkage. + - 'auto': automatic shrinkage using the Ledoit-Wolf lemma. + - float between 0 and 1: fixed shrinkage constant. + + Shrinkage parameter is ignored if `covariance_estimator` i + not None + + covariance_estimator : estimator, default=None + If not None, `covariance_estimator` is used to estimate + the covariance matrices instead of relying the empirical + covariance estimator (with potential shrinkage). + The object should have a fit method and a ``covariance_`` attribute + like the estimators in sklearn.covariance. + if None the shrinkage parameter drives the estimate. + + .. versionadded:: 0.24 + + Notes + ----- + This solver is based on [1]_, section 3.8.3, pp. 121-124. + + References + ---------- + .. [1] R. O. Duda, P. E. Hart, D. G. Stork. Pattern Classification + (Second Edition). John Wiley & Sons, Inc., New York, 2001. ISBN + 0-471-05669-3. + """ + self.means_ = _class_means(X, y) + self.covariance_ = _class_cov( + X, y, self.priors_, shrinkage, covariance_estimator + ) + + Sw = self.covariance_ # within scatter + St = _cov(X, shrinkage, covariance_estimator) # total scatter + Sb = St - Sw # between scatter + + evals, evecs = linalg.eigh(Sb, Sw) + self.explained_variance_ratio_ = np.sort(evals / np.sum(evals))[::-1][ + : self._max_components + ] + evecs = evecs[:, np.argsort(evals)[::-1]] # sort eigenvectors + + self.scalings_ = evecs + self.coef_ = np.dot(self.means_, evecs).dot(evecs.T) + self.intercept_ = -0.5 * np.diag(np.dot(self.means_, self.coef_.T)) + np.log( + self.priors_ + ) + + def _solve_svd(self, X, y): + """SVD solver. + + Parameters + ---------- + X : array-like of shape (n_samples, n_features) + Training data. + + y : array-like of shape (n_samples,) or (n_samples, n_targets) + Target values. + """ + xp, is_array_api_compliant = get_namespace(X) + + if is_array_api_compliant: + svd = xp.linalg.svd + else: + svd = scipy.linalg.svd + + n_samples, n_features = X.shape + n_classes = self.classes_.shape[0] + + self.means_ = _class_means(X, y) + if self.store_covariance: + self.covariance_ = _class_cov(X, y, self.priors_) + + Xc = [] + for idx, group in enumerate(self.classes_): + Xg = X[y == group] + Xc.append(Xg - self.means_[idx, :]) + + self.xbar_ = self.priors_ @ self.means_ + + Xc = xp.concat(Xc, axis=0) + + # 1) within (univariate) scaling by with classes std-dev + std = xp.std(Xc, axis=0) + # avoid division by zero in normalization + std[std == 0] = 1.0 + fac = xp.asarray(1.0 / (n_samples - n_classes), dtype=X.dtype, device=device(X)) + + # 2) Within variance scaling + X = xp.sqrt(fac) * (Xc / std) + # SVD of centered (within)scaled data + U, S, Vt = svd(X, full_matrices=False) + + rank = xp.sum(xp.astype(S > self.tol, xp.int32)) + # Scaling of within covariance is: V' 1/S + scalings = (Vt[:rank, :] / std).T / S[:rank] + fac = 1.0 if n_classes == 1 else 1.0 / (n_classes - 1) + + # 3) Between variance scaling + # Scale weighted centers + X = ( + (xp.sqrt((n_samples * self.priors_) * fac)) * (self.means_ - self.xbar_).T + ).T @ scalings + # Centers are living in a space with n_classes-1 dim (maximum) + # Use SVD to find projection in the space spanned by the + # (n_classes) centers + _, S, Vt = svd(X, full_matrices=False) + + if self._max_components == 0: + self.explained_variance_ratio_ = xp.empty((0,), dtype=S.dtype) + else: + self.explained_variance_ratio_ = (S**2 / xp.sum(S**2))[ + : self._max_components + ] + + rank = xp.sum(xp.astype(S > self.tol * S[0], xp.int32)) + self.scalings_ = scalings @ Vt.T[:, :rank] + coef = (self.means_ - self.xbar_) @ self.scalings_ + self.intercept_ = -0.5 * xp.sum(coef**2, axis=1) + xp.log(self.priors_) + self.coef_ = coef @ self.scalings_.T + self.intercept_ -= self.xbar_ @ self.coef_.T + + @_fit_context( + # LinearDiscriminantAnalysis.covariance_estimator is not validated yet + prefer_skip_nested_validation=False + ) + def fit(self, X, y): + """Fit the Linear Discriminant Analysis model. + + .. versionchanged:: 0.19 + `store_covariance` and `tol` has been moved to main constructor. + + Parameters + ---------- + X : array-like of shape (n_samples, n_features) + Training data. + + y : array-like of shape (n_samples,) + Target values. + + Returns + ------- + self : object + Fitted estimator. + """ + xp, _ = get_namespace(X) + + X, y = validate_data( + self, X, y, ensure_min_samples=2, dtype=[xp.float64, xp.float32] + ) + self.classes_ = unique_labels(y) + n_samples, _ = X.shape + n_classes = self.classes_.shape[0] + + if n_samples == n_classes: + raise ValueError( + "The number of samples must be more than the number of classes." + ) + + if self.priors is None: # estimate priors from sample + _, cnts = xp.unique_counts(y) # non-negative ints + self.priors_ = xp.astype(cnts, X.dtype) / float(y.shape[0]) + else: + self.priors_ = xp.asarray(self.priors, dtype=X.dtype) + + if xp.any(self.priors_ < 0): + raise ValueError("priors must be non-negative") + + if xp.abs(xp.sum(self.priors_) - 1.0) > 1e-5: + warnings.warn("The priors do not sum to 1. Renormalizing", UserWarning) + self.priors_ = self.priors_ / self.priors_.sum() + + # Maximum number of components no matter what n_components is + # specified: + max_components = min(n_classes - 1, X.shape[1]) + + if self.n_components is None: + self._max_components = max_components + else: + if self.n_components > max_components: + raise ValueError( + "n_components cannot be larger than min(n_features, n_classes - 1)." + ) + self._max_components = self.n_components + + if self.solver == "svd": + if self.shrinkage is not None: + raise NotImplementedError("shrinkage not supported with 'svd' solver.") + if self.covariance_estimator is not None: + raise ValueError( + "covariance estimator " + "is not supported " + "with svd solver. Try another solver" + ) + self._solve_svd(X, y) + elif self.solver == "lsqr": + self._solve_lstsq( + X, + y, + shrinkage=self.shrinkage, + covariance_estimator=self.covariance_estimator, + ) + elif self.solver == "eigen": + self._solve_eigen( + X, + y, + shrinkage=self.shrinkage, + covariance_estimator=self.covariance_estimator, + ) + if size(self.classes_) == 2: # treat binary case as a special case + coef_ = xp.asarray(self.coef_[1, :] - self.coef_[0, :], dtype=X.dtype) + self.coef_ = xp.reshape(coef_, (1, -1)) + intercept_ = xp.asarray( + self.intercept_[1] - self.intercept_[0], dtype=X.dtype + ) + self.intercept_ = xp.reshape(intercept_, (1,)) + self._n_features_out = self._max_components + return self + + def transform(self, X): + """Project data to maximize class separation. + + Parameters + ---------- + X : array-like of shape (n_samples, n_features) + Input data. + + Returns + ------- + X_new : ndarray of shape (n_samples, n_components) or \ + (n_samples, min(rank, n_components)) + Transformed data. In the case of the 'svd' solver, the shape + is (n_samples, min(rank, n_components)). + """ + if self.solver == "lsqr": + raise NotImplementedError( + "transform not implemented for 'lsqr' solver (use 'svd' or 'eigen')." + ) + check_is_fitted(self) + xp, _ = get_namespace(X) + X = validate_data(self, X, reset=False) + + if self.solver == "svd": + X_new = (X - self.xbar_) @ self.scalings_ + elif self.solver == "eigen": + X_new = X @ self.scalings_ + + return X_new[:, : self._max_components] + + def predict_proba(self, X): + """Estimate probability. + + Parameters + ---------- + X : array-like of shape (n_samples, n_features) + Input data. + + Returns + ------- + C : ndarray of shape (n_samples, n_classes) + Estimated probabilities. + """ + check_is_fitted(self) + xp, is_array_api_compliant = get_namespace(X) + decision = self.decision_function(X) + if size(self.classes_) == 2: + proba = _expit(decision, xp) + return xp.stack([1 - proba, proba], axis=1) + else: + return softmax(decision) + + def predict_log_proba(self, X): + """Estimate log probability. + + Parameters + ---------- + X : array-like of shape (n_samples, n_features) + Input data. + + Returns + ------- + C : ndarray of shape (n_samples, n_classes) + Estimated log probabilities. + """ + xp, _ = get_namespace(X) + prediction = self.predict_proba(X) + + info = xp.finfo(prediction.dtype) + if hasattr(info, "smallest_normal"): + smallest_normal = info.smallest_normal + else: + # smallest_normal was introduced in NumPy 1.22 + smallest_normal = info.tiny + + prediction[prediction == 0.0] += smallest_normal + return xp.log(prediction) + + def decision_function(self, X): + """Apply decision function to an array of samples. + + The decision function is equal (up to a constant factor) to the + log-posterior of the model, i.e. `log p(y = k | x)`. In a binary + classification setting this instead corresponds to the difference + `log p(y = 1 | x) - log p(y = 0 | x)`. See :ref:`lda_qda_math`. + + Parameters + ---------- + X : array-like of shape (n_samples, n_features) + Array of samples (test vectors). + + Returns + ------- + y_scores : ndarray of shape (n_samples,) or (n_samples, n_classes) + Decision function values related to each class, per sample. + In the two-class case, the shape is `(n_samples,)`, giving the + log likelihood ratio of the positive class. + """ + # Only override for the doc + return super().decision_function(X) + + def __sklearn_tags__(self): + tags = super().__sklearn_tags__() + tags.array_api_support = True + return tags + + +class QuadraticDiscriminantAnalysis( + DiscriminantAnalysisPredictionMixin, ClassifierMixin, BaseEstimator +): + """Quadratic Discriminant Analysis. + + A classifier with a quadratic decision boundary, generated + by fitting class conditional densities to the data + and using Bayes' rule. + + The model fits a Gaussian density to each class. + + .. versionadded:: 0.17 + + For a comparison between + :class:`~sklearn.discriminant_analysis.QuadraticDiscriminantAnalysis` + and :class:`~sklearn.discriminant_analysis.LinearDiscriminantAnalysis`, see + :ref:`sphx_glr_auto_examples_classification_plot_lda_qda.py`. + + Read more in the :ref:`User Guide `. + + Parameters + ---------- + priors : array-like of shape (n_classes,), default=None + Class priors. By default, the class proportions are inferred from the + training data. + + reg_param : float, default=0.0 + Regularizes the per-class covariance estimates by transforming S2 as + ``S2 = (1 - reg_param) * S2 + reg_param * np.eye(n_features)``, + where S2 corresponds to the `scaling_` attribute of a given class. + + store_covariance : bool, default=False + If True, the class covariance matrices are explicitly computed and + stored in the `self.covariance_` attribute. + + .. versionadded:: 0.17 + + tol : float, default=1.0e-4 + Absolute threshold for the covariance matrix to be considered rank + deficient after applying some regularization (see `reg_param`) to each + `Sk` where `Sk` represents covariance matrix for k-th class. This + parameter does not affect the predictions. It controls when a warning + is raised if the covariance matrix is not full rank. + + .. versionadded:: 0.17 + + Attributes + ---------- + covariance_ : list of len n_classes of ndarray \ + of shape (n_features, n_features) + For each class, gives the covariance matrix estimated using the + samples of that class. The estimations are unbiased. Only present if + `store_covariance` is True. + + means_ : array-like of shape (n_classes, n_features) + Class-wise means. + + priors_ : array-like of shape (n_classes,) + Class priors (sum to 1). + + rotations_ : list of len n_classes of ndarray of shape (n_features, n_k) + For each class k an array of shape (n_features, n_k), where + ``n_k = min(n_features, number of elements in class k)`` + It is the rotation of the Gaussian distribution, i.e. its + principal axis. It corresponds to `V`, the matrix of eigenvectors + coming from the SVD of `Xk = U S Vt` where `Xk` is the centered + matrix of samples from class k. + + scalings_ : list of len n_classes of ndarray of shape (n_k,) + For each class, contains the scaling of + the Gaussian distributions along its principal axes, i.e. the + variance in the rotated coordinate system. It corresponds to `S^2 / + (n_samples - 1)`, where `S` is the diagonal matrix of singular values + from the SVD of `Xk`, where `Xk` is the centered matrix of samples + from class k. + + classes_ : ndarray of shape (n_classes,) + Unique class labels. + + n_features_in_ : int + Number of features seen during :term:`fit`. + + .. versionadded:: 0.24 + + feature_names_in_ : ndarray of shape (`n_features_in_`,) + Names of features seen during :term:`fit`. Defined only when `X` + has feature names that are all strings. + + .. versionadded:: 1.0 + + See Also + -------- + LinearDiscriminantAnalysis : Linear Discriminant Analysis. + + Examples + -------- + >>> from sklearn.discriminant_analysis import QuadraticDiscriminantAnalysis + >>> import numpy as np + >>> X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]]) + >>> y = np.array([1, 1, 1, 2, 2, 2]) + >>> clf = QuadraticDiscriminantAnalysis() + >>> clf.fit(X, y) + QuadraticDiscriminantAnalysis() + >>> print(clf.predict([[-0.8, -1]])) + [1] + """ + + _parameter_constraints: dict = { + "priors": ["array-like", None], + "reg_param": [Interval(Real, 0, 1, closed="both")], + "store_covariance": ["boolean"], + "tol": [Interval(Real, 0, None, closed="left")], + } + + def __init__( + self, *, priors=None, reg_param=0.0, store_covariance=False, tol=1.0e-4 + ): + self.priors = priors + self.reg_param = reg_param + self.store_covariance = store_covariance + self.tol = tol + + @_fit_context(prefer_skip_nested_validation=True) + def fit(self, X, y): + """Fit the model according to the given training data and parameters. + + .. versionchanged:: 0.19 + ``store_covariances`` has been moved to main constructor as + ``store_covariance``. + + .. versionchanged:: 0.19 + ``tol`` has been moved to main constructor. + + Parameters + ---------- + X : array-like of shape (n_samples, n_features) + Training vector, where `n_samples` is the number of samples and + `n_features` is the number of features. + + y : array-like of shape (n_samples,) + Target values (integers). + + Returns + ------- + self : object + Fitted estimator. + """ + X, y = validate_data(self, X, y) + check_classification_targets(y) + self.classes_, y = np.unique(y, return_inverse=True) + n_samples, n_features = X.shape + n_classes = len(self.classes_) + if n_classes < 2: + raise ValueError( + "The number of classes has to be greater than one; got %d class" + % (n_classes) + ) + if self.priors is None: + self.priors_ = np.bincount(y) / float(n_samples) + else: + self.priors_ = np.array(self.priors) + + cov = None + store_covariance = self.store_covariance + if store_covariance: + cov = [] + means = [] + scalings = [] + rotations = [] + for ind in range(n_classes): + Xg = X[y == ind, :] + meang = Xg.mean(0) + means.append(meang) + if len(Xg) == 1: + raise ValueError( + "y has only 1 sample in class %s, covariance is ill defined." + % str(self.classes_[ind]) + ) + Xgc = Xg - meang + # Xgc = U * S * V.T + _, S, Vt = np.linalg.svd(Xgc, full_matrices=False) + S2 = (S**2) / (len(Xg) - 1) + S2 = ((1 - self.reg_param) * S2) + self.reg_param + rank = np.sum(S2 > self.tol) + if rank < n_features: + warnings.warn( + f"The covariance matrix of class {ind} is not full rank. " + "Increasing the value of parameter `reg_param` might help" + " reducing the collinearity.", + linalg.LinAlgWarning, + ) + if self.store_covariance or store_covariance: + # cov = V * (S^2 / (n-1)) * V.T + cov.append(np.dot(S2 * Vt.T, Vt)) + scalings.append(S2) + rotations.append(Vt.T) + if self.store_covariance or store_covariance: + self.covariance_ = cov + self.means_ = np.asarray(means) + self.scalings_ = scalings + self.rotations_ = rotations + return self + + def _decision_function(self, X): + # return log posterior, see eq (4.12) p. 110 of the ESL. + check_is_fitted(self) + + X = validate_data(self, X, reset=False) + norm2 = [] + for i in range(len(self.classes_)): + R = self.rotations_[i] + S = self.scalings_[i] + Xm = X - self.means_[i] + X2 = np.dot(Xm, R * (S ** (-0.5))) + norm2.append(np.sum(X2**2, axis=1)) + norm2 = np.array(norm2).T # shape = [len(X), n_classes] + u = np.asarray([np.sum(np.log(s)) for s in self.scalings_]) + return -0.5 * (norm2 + u) + np.log(self.priors_) + + def decision_function(self, X): + """Apply decision function to an array of samples. + + The decision function is equal (up to a constant factor) to the + log-posterior of the model, i.e. `log p(y = k | x)`. In a binary + classification setting this instead corresponds to the difference + `log p(y = 1 | x) - log p(y = 0 | x)`. See :ref:`lda_qda_math`. + + Parameters + ---------- + X : array-like of shape (n_samples, n_features) + Array of samples (test vectors). + + Returns + ------- + C : ndarray of shape (n_samples,) or (n_samples, n_classes) + Decision function values related to each class, per sample. + In the two-class case, the shape is `(n_samples,)`, giving the + log likelihood ratio of the positive class. + """ + return super().decision_function(X) + + def predict(self, X): + """Perform classification on an array of test vectors X. + + The predicted class C for each sample in X is returned. + + Parameters + ---------- + X : array-like of shape (n_samples, n_features) + Vector to be scored, where `n_samples` is the number of samples and + `n_features` is the number of features. + + Returns + ------- + C : ndarray of shape (n_samples,) + Estimated probabilities. + """ + return super().predict(X) + + def predict_proba(self, X): + """Return posterior probabilities of classification. + + Parameters + ---------- + X : array-like of shape (n_samples, n_features) + Array of samples/test vectors. + + Returns + ------- + C : ndarray of shape (n_samples, n_classes) + Posterior probabilities of classification per class. + """ + # compute the likelihood of the underlying gaussian models + # up to a multiplicative constant. + return super().predict_proba(X) + + def predict_log_proba(self, X): + """Return log of posterior probabilities of classification. + + Parameters + ---------- + X : array-like of shape (n_samples, n_features) + Array of samples/test vectors. + + Returns + ------- + C : ndarray of shape (n_samples, n_classes) + Posterior log-probabilities of classification per class. + """ + # XXX : can do better to avoid precision overflows + return super().predict_log_proba(X) diff --git a/shared/package-files/4a/4ad9b174ade678d3440cefc21b3548aa5b5b5f1c1f5f4a50c6c9e09cf41f76d0/test_insert.py b/shared/package-files/4a/4ad9b174ade678d3440cefc21b3548aa5b5b5f1c1f5f4a50c6c9e09cf41f76d0/test_insert.py new file mode 100644 index 0000000000000000000000000000000000000000..ebfe490e0e067807f7a38d3f8f285aee76718fcf --- /dev/null +++ b/shared/package-files/4a/4ad9b174ade678d3440cefc21b3548aa5b5b5f1c1f5f4a50c6c9e09cf41f76d0/test_insert.py @@ -0,0 +1,265 @@ +from datetime import datetime + +import numpy as np +import pytest +import pytz + +from pandas import ( + NA, + DatetimeIndex, + Index, + NaT, + Timestamp, + date_range, +) +import pandas._testing as tm + + +class TestInsert: + @pytest.mark.parametrize("null", [None, np.nan, np.datetime64("NaT"), NaT, NA]) + @pytest.mark.parametrize("tz", [None, "UTC", "US/Eastern"]) + def test_insert_nat(self, tz, null): + # GH#16537, GH#18295 (test missing) + + idx = DatetimeIndex(["2017-01-01"], tz=tz) + expected = DatetimeIndex(["NaT", "2017-01-01"], tz=tz) + if tz is not None and isinstance(null, np.datetime64): + expected = Index([null, idx[0]], dtype=object) + + res = idx.insert(0, null) + tm.assert_index_equal(res, expected) + + @pytest.mark.parametrize("tz", [None, "UTC", "US/Eastern"]) + def test_insert_invalid_na(self, tz): + idx = DatetimeIndex(["2017-01-01"], tz=tz) + + item = np.timedelta64("NaT") + result = idx.insert(0, item) + expected = Index([item] + list(idx), dtype=object) + tm.assert_index_equal(result, expected) + + def test_insert_empty_preserves_freq(self, tz_naive_fixture): + # GH#33573 + tz = tz_naive_fixture + dti = DatetimeIndex([], tz=tz, freq="D") + item = Timestamp("2017-04-05").tz_localize(tz) + + result = dti.insert(0, item) + assert result.freq == dti.freq + + # But not when we insert an item that doesn't conform to freq + dti = DatetimeIndex([], tz=tz, freq="W-THU") + result = dti.insert(0, item) + assert result.freq is None + + def test_insert(self, unit): + idx = DatetimeIndex( + ["2000-01-04", "2000-01-01", "2000-01-02"], name="idx" + ).as_unit(unit) + + result = idx.insert(2, datetime(2000, 1, 5)) + exp = DatetimeIndex( + ["2000-01-04", "2000-01-01", "2000-01-05", "2000-01-02"], name="idx" + ).as_unit(unit) + tm.assert_index_equal(result, exp) + + # insertion of non-datetime should coerce to object index + result = idx.insert(1, "inserted") + expected = Index( + [ + datetime(2000, 1, 4), + "inserted", + datetime(2000, 1, 1), + datetime(2000, 1, 2), + ], + name="idx", + ) + assert not isinstance(result, DatetimeIndex) + tm.assert_index_equal(result, expected) + assert result.name == expected.name + + def test_insert2(self, unit): + idx = date_range("1/1/2000", periods=3, freq="ME", name="idx", unit=unit) + + # preserve freq + expected_0 = DatetimeIndex( + ["1999-12-31", "2000-01-31", "2000-02-29", "2000-03-31"], + name="idx", + freq="ME", + ).as_unit(unit) + expected_3 = DatetimeIndex( + ["2000-01-31", "2000-02-29", "2000-03-31", "2000-04-30"], + name="idx", + freq="ME", + ).as_unit(unit) + + # reset freq to None + expected_1_nofreq = DatetimeIndex( + ["2000-01-31", "2000-01-31", "2000-02-29", "2000-03-31"], + name="idx", + freq=None, + ).as_unit(unit) + expected_3_nofreq = DatetimeIndex( + ["2000-01-31", "2000-02-29", "2000-03-31", "2000-01-02"], + name="idx", + freq=None, + ).as_unit(unit) + + cases = [ + (0, datetime(1999, 12, 31), expected_0), + (-3, datetime(1999, 12, 31), expected_0), + (3, datetime(2000, 4, 30), expected_3), + (1, datetime(2000, 1, 31), expected_1_nofreq), + (3, datetime(2000, 1, 2), expected_3_nofreq), + ] + + for n, d, expected in cases: + result = idx.insert(n, d) + tm.assert_index_equal(result, expected) + assert result.name == expected.name + assert result.freq == expected.freq + + def test_insert3(self, unit): + idx = date_range("1/1/2000", periods=3, freq="ME", name="idx", unit=unit) + + # reset freq to None + result = idx.insert(3, datetime(2000, 1, 2)) + expected = DatetimeIndex( + ["2000-01-31", "2000-02-29", "2000-03-31", "2000-01-02"], + name="idx", + freq=None, + ).as_unit(unit) + tm.assert_index_equal(result, expected) + assert result.name == expected.name + assert result.freq is None + + def test_insert4(self, unit): + for tz in ["US/Pacific", "Asia/Singapore"]: + idx = date_range( + "1/1/2000 09:00", periods=6, freq="h", tz=tz, name="idx", unit=unit + ) + # preserve freq + expected = date_range( + "1/1/2000 09:00", periods=7, freq="h", tz=tz, name="idx", unit=unit + ) + for d in [ + Timestamp("2000-01-01 15:00", tz=tz), + pytz.timezone(tz).localize(datetime(2000, 1, 1, 15)), + ]: + result = idx.insert(6, d) + tm.assert_index_equal(result, expected) + assert result.name == expected.name + assert result.freq == expected.freq + assert result.tz == expected.tz + + expected = DatetimeIndex( + [ + "2000-01-01 09:00", + "2000-01-01 10:00", + "2000-01-01 11:00", + "2000-01-01 12:00", + "2000-01-01 13:00", + "2000-01-01 14:00", + "2000-01-01 10:00", + ], + name="idx", + tz=tz, + freq=None, + ).as_unit(unit) + # reset freq to None + for d in [ + Timestamp("2000-01-01 10:00", tz=tz), + pytz.timezone(tz).localize(datetime(2000, 1, 1, 10)), + ]: + result = idx.insert(6, d) + tm.assert_index_equal(result, expected) + assert result.name == expected.name + assert result.tz == expected.tz + assert result.freq is None + + # TODO: also changes DataFrame.__setitem__ with expansion + def test_insert_mismatched_tzawareness(self): + # see GH#7299 + idx = date_range("1/1/2000", periods=3, freq="D", tz="Asia/Tokyo", name="idx") + + # mismatched tz-awareness + item = Timestamp("2000-01-04") + result = idx.insert(3, item) + expected = Index( + list(idx[:3]) + [item] + list(idx[3:]), dtype=object, name="idx" + ) + tm.assert_index_equal(result, expected) + + # mismatched tz-awareness + item = datetime(2000, 1, 4) + result = idx.insert(3, item) + expected = Index( + list(idx[:3]) + [item] + list(idx[3:]), dtype=object, name="idx" + ) + tm.assert_index_equal(result, expected) + + # TODO: also changes DataFrame.__setitem__ with expansion + def test_insert_mismatched_tz(self): + # see GH#7299 + # pre-2.0 with mismatched tzs we would cast to object + idx = date_range("1/1/2000", periods=3, freq="D", tz="Asia/Tokyo", name="idx") + + # mismatched tz -> cast to object (could reasonably cast to same tz or UTC) + item = Timestamp("2000-01-04", tz="US/Eastern") + result = idx.insert(3, item) + expected = Index( + list(idx[:3]) + [item.tz_convert(idx.tz)] + list(idx[3:]), + name="idx", + ) + assert expected.dtype == idx.dtype + tm.assert_index_equal(result, expected) + + item = datetime(2000, 1, 4, tzinfo=pytz.timezone("US/Eastern")) + result = idx.insert(3, item) + expected = Index( + list(idx[:3]) + [item.astimezone(idx.tzinfo)] + list(idx[3:]), + name="idx", + ) + assert expected.dtype == idx.dtype + tm.assert_index_equal(result, expected) + + @pytest.mark.parametrize( + "item", [0, np.int64(0), np.float64(0), np.array(0), np.timedelta64(456)] + ) + def test_insert_mismatched_types_raises(self, tz_aware_fixture, item): + # GH#33703 dont cast these to dt64 + tz = tz_aware_fixture + dti = date_range("2019-11-04", periods=9, freq="-1D", name=9, tz=tz) + + result = dti.insert(1, item) + + if isinstance(item, np.ndarray): + assert item.item() == 0 + expected = Index([dti[0], 0] + list(dti[1:]), dtype=object, name=9) + else: + expected = Index([dti[0], item] + list(dti[1:]), dtype=object, name=9) + + tm.assert_index_equal(result, expected) + + def test_insert_castable_str(self, tz_aware_fixture): + # GH#33703 + tz = tz_aware_fixture + dti = date_range("2019-11-04", periods=3, freq="-1D", name=9, tz=tz) + + value = "2019-11-05" + result = dti.insert(0, value) + + ts = Timestamp(value).tz_localize(tz) + expected = DatetimeIndex([ts] + list(dti), dtype=dti.dtype, name=9) + tm.assert_index_equal(result, expected) + + def test_insert_non_castable_str(self, tz_aware_fixture): + # GH#33703 + tz = tz_aware_fixture + dti = date_range("2019-11-04", periods=3, freq="-1D", name=9, tz=tz) + + value = "foo" + result = dti.insert(0, value) + + expected = Index(["foo"] + list(dti), dtype=object, name=9) + tm.assert_index_equal(result, expected) diff --git a/shared/package-files/4a/4addb6d721876ed935735e96f0aa8712c6f51a9efc92b7bbd95eb9893202e947/diagonal_scatter_compositeexplicitautograd_dispatch.h b/shared/package-files/4a/4addb6d721876ed935735e96f0aa8712c6f51a9efc92b7bbd95eb9893202e947/diagonal_scatter_compositeexplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..48da4d394acc4e1470d4df3c5dd5006be7a2796d --- /dev/null +++ b/shared/package-files/4a/4addb6d721876ed935735e96f0aa8712c6f51a9efc92b7bbd95eb9893202e947/diagonal_scatter_compositeexplicitautograd_dispatch.h @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API at::Tensor & diagonal_scatter_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & src, int64_t offset=0, int64_t dim1=0, int64_t dim2=1); +TORCH_API at::Tensor & diagonal_scatter_outf(const at::Tensor & self, const at::Tensor & src, int64_t offset, int64_t dim1, int64_t dim2, at::Tensor & out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/4a/4adf738b17691489c71c4b9d9a64b12961ada8667b81856f7adbc61dffeadf29/panedwindow.tcl b/shared/package-files/4a/4adf738b17691489c71c4b9d9a64b12961ada8667b81856f7adbc61dffeadf29/panedwindow.tcl new file mode 100644 index 0000000000000000000000000000000000000000..d3dfabc643c245d9c9d35bd7f4a49e953a0918df --- /dev/null +++ b/shared/package-files/4a/4adf738b17691489c71c4b9d9a64b12961ada8667b81856f7adbc61dffeadf29/panedwindow.tcl @@ -0,0 +1,194 @@ +# panedwindow.tcl -- +# +# This file defines the default bindings for Tk panedwindow widgets and +# provides procedures that help in implementing those bindings. + +bind Panedwindow { ::tk::panedwindow::MarkSash %W %x %y 1 } +bind Panedwindow { ::tk::panedwindow::MarkSash %W %x %y 0 } + +bind Panedwindow { ::tk::panedwindow::DragSash %W %x %y 1 } +bind Panedwindow { ::tk::panedwindow::DragSash %W %x %y 0 } + +bind Panedwindow {::tk::panedwindow::ReleaseSash %W 1} +bind Panedwindow {::tk::panedwindow::ReleaseSash %W 0} + +bind Panedwindow { ::tk::panedwindow::Motion %W %x %y } + +bind Panedwindow { ::tk::panedwindow::Leave %W } + +# Initialize namespace +namespace eval ::tk::panedwindow {} + +# ::tk::panedwindow::MarkSash -- +# +# Handle marking the correct sash for possible dragging +# +# Arguments: +# w the widget +# x widget local x coord +# y widget local y coord +# proxy whether this should be a proxy sash +# Results: +# None +# +proc ::tk::panedwindow::MarkSash {w x y proxy} { + variable ::tk::Priv + if {[$w cget -opaqueresize]} { + set proxy 0 + } + set what [$w identify $x $y] + if { [llength $what] == 2 } { + lassign $what index which + if {!$::tk_strictMotif || $which eq "handle"} { + if {!$proxy} { + $w sash mark $index $x $y + } + set Priv(sash) $index + lassign [$w sash coord $index] sx sy + set Priv(dx) [expr {$sx-$x}] + set Priv(dy) [expr {$sy-$y}] + # Do this to init the proxy location + DragSash $w $x $y $proxy + } + } +} + +# ::tk::panedwindow::DragSash -- +# +# Handle dragging of the correct sash +# +# Arguments: +# w the widget +# x widget local x coord +# y widget local y coord +# proxy whether this should be a proxy sash +# Results: +# Moves sash +# +proc ::tk::panedwindow::DragSash {w x y proxy} { + variable ::tk::Priv + if {[$w cget -opaqueresize]} { + set proxy 0 + } + if {[info exists Priv(sash)]} { + if {$proxy} { + $w proxy place [expr {$x+$Priv(dx)}] [expr {$y+$Priv(dy)}] + } else { + $w sash place $Priv(sash) \ + [expr {$x+$Priv(dx)}] [expr {$y+$Priv(dy)}] + } + } +} + +# ::tk::panedwindow::ReleaseSash -- +# +# Handle releasing of the sash +# +# Arguments: +# w the widget +# proxy whether this should be a proxy sash +# Results: +# Returns ... +# +proc ::tk::panedwindow::ReleaseSash {w proxy} { + variable ::tk::Priv + if {[$w cget -opaqueresize]} { + set proxy 0 + } + if {[info exists Priv(sash)]} { + if {$proxy} { + lassign [$w proxy coord] x y + $w sash place $Priv(sash) $x $y + $w proxy forget + } + unset Priv(sash) Priv(dx) Priv(dy) + } +} + +# ::tk::panedwindow::Motion -- +# +# Handle motion on the widget. This is used to change the cursor +# when the user moves over the sash area. +# +# Arguments: +# w the widget +# x widget local x coord +# y widget local y coord +# Results: +# May change the cursor. Sets up a timer to verify that we are still +# over the widget. +# +proc ::tk::panedwindow::Motion {w x y} { + variable ::tk::Priv + set id [$w identify $x $y] + if {([llength $id] == 2) && \ + (!$::tk_strictMotif || [lindex $id 1] eq "handle")} { + if {![info exists Priv($w,panecursor)]} { + set Priv($w,panecursor) [$w cget -cursor] + if {[$w cget -sashcursor] ne ""} { + $w configure -cursor [$w cget -sashcursor] + } elseif {[$w cget -orient] eq "horizontal"} { + $w configure -cursor sb_h_double_arrow + } else { + $w configure -cursor sb_v_double_arrow + } + if {[info exists Priv($w,pwAfterId)]} { + after cancel $Priv($w,pwAfterId) + } + set Priv($w,pwAfterId) [after 150 \ + [list ::tk::panedwindow::Cursor $w]] + } + return + } + if {[info exists Priv($w,panecursor)]} { + $w configure -cursor $Priv($w,panecursor) + unset Priv($w,panecursor) + } +} + +# ::tk::panedwindow::Cursor -- +# +# Handles returning the normal cursor when we are no longer over the +# sash area. This needs to be done this way, because the panedwindow +# won't see Leave events when the mouse moves from the sash to a +# paned child, although the child does receive an Enter event. +# +# Arguments: +# w the widget +# Results: +# May restore the default cursor, or schedule a timer to do it. +# +proc ::tk::panedwindow::Cursor {w} { + variable ::tk::Priv + # Make sure to check window existence in case it is destroyed. + if {[info exists Priv($w,panecursor)] && [winfo exists $w]} { + if {[winfo containing [winfo pointerx $w] [winfo pointery $w]] eq $w} { + set Priv($w,pwAfterId) [after 150 \ + [list ::tk::panedwindow::Cursor $w]] + } else { + $w configure -cursor $Priv($w,panecursor) + unset Priv($w,panecursor) + if {[info exists Priv($w,pwAfterId)]} { + after cancel $Priv($w,pwAfterId) + unset Priv($w,pwAfterId) + } + } + } +} + +# ::tk::panedwindow::Leave -- +# +# Return to default cursor when leaving the pw widget. +# +# Arguments: +# w the widget +# Results: +# Restores the default cursor +# +proc ::tk::panedwindow::Leave {w} { + variable ::tk::Priv + if {[info exists Priv($w,panecursor)]} { + $w configure -cursor $Priv($w,panecursor) + unset Priv($w,panecursor) + } +} diff --git a/shared/package-files/4a/4ae4f1c39f9d159347192ef24f021459e30ca7d45f22e47b9bf850842b69c566/screen.minitel12-80 b/shared/package-files/4a/4ae4f1c39f9d159347192ef24f021459e30ca7d45f22e47b9bf850842b69c566/screen.minitel12-80 new file mode 100644 index 0000000000000000000000000000000000000000..c4d61d0c07c3325135e21e8e92ce9d18431e8879 Binary files /dev/null and b/shared/package-files/4a/4ae4f1c39f9d159347192ef24f021459e30ca7d45f22e47b9bf850842b69c566/screen.minitel12-80 differ diff --git a/shared/package-files/4a/4ae4f1c39f9d159347192ef24f021459e30ca7d45f22e47b9bf850842b69c566/screen.minitel1b-80 b/shared/package-files/4a/4ae4f1c39f9d159347192ef24f021459e30ca7d45f22e47b9bf850842b69c566/screen.minitel1b-80 new file mode 100644 index 0000000000000000000000000000000000000000..c4d61d0c07c3325135e21e8e92ce9d18431e8879 Binary files /dev/null and b/shared/package-files/4a/4ae4f1c39f9d159347192ef24f021459e30ca7d45f22e47b9bf850842b69c566/screen.minitel1b-80 differ diff --git a/shared/package-files/4a/4ae4f1c39f9d159347192ef24f021459e30ca7d45f22e47b9bf850842b69c566/screen.minitel2-80 b/shared/package-files/4a/4ae4f1c39f9d159347192ef24f021459e30ca7d45f22e47b9bf850842b69c566/screen.minitel2-80 new file mode 100644 index 0000000000000000000000000000000000000000..c4d61d0c07c3325135e21e8e92ce9d18431e8879 Binary files /dev/null and b/shared/package-files/4a/4ae4f1c39f9d159347192ef24f021459e30ca7d45f22e47b9bf850842b69c566/screen.minitel2-80 differ diff --git a/shared/package-files/4a/4ae7c22b54a33fe40e8467755614ada4b71d462ba87330465f729d0780b8202b/plistlib.pyi b/shared/package-files/4a/4ae7c22b54a33fe40e8467755614ada4b71d462ba87330465f729d0780b8202b/plistlib.pyi new file mode 100644 index 0000000000000000000000000000000000000000..5aadae9fc97b9c05b627095fcf47aa08042e1df0 --- /dev/null +++ b/shared/package-files/4a/4ae7c22b54a33fe40e8467755614ada4b71d462ba87330465f729d0780b8202b/plistlib.pyi @@ -0,0 +1,72 @@ +import sys +from typing import IO, Any, Dict as DictT, Mapping, MutableMapping, Optional, Text, Type, Union + +if sys.version_info >= (3,): + from enum import Enum + class PlistFormat(Enum): + FMT_XML: int + FMT_BINARY: int + FMT_XML = PlistFormat.FMT_XML + FMT_BINARY = PlistFormat.FMT_BINARY + +_Path = Union[str, Text] + +if sys.version_info >= (3, 9): + def load(fp: IO[bytes], *, fmt: Optional[PlistFormat] = ..., dict_type: Type[MutableMapping[str, Any]] = ...) -> Any: ... + def loads(value: bytes, *, fmt: Optional[PlistFormat] = ..., dict_type: Type[MutableMapping[str, Any]] = ...) -> Any: ... + +elif sys.version_info >= (3, 4): + def load( + fp: IO[bytes], + *, + fmt: Optional[PlistFormat] = ..., + use_builtin_types: bool = ..., + dict_type: Type[MutableMapping[str, Any]] = ..., + ) -> Any: ... + def loads( + value: bytes, + *, + fmt: Optional[PlistFormat] = ..., + use_builtin_types: bool = ..., + dict_type: Type[MutableMapping[str, Any]] = ..., + ) -> Any: ... + +if sys.version_info >= (3, 4): + def dump( + value: Mapping[str, Any], fp: IO[bytes], *, fmt: PlistFormat = ..., sort_keys: bool = ..., skipkeys: bool = ... + ) -> None: ... + def dumps(value: Mapping[str, Any], *, fmt: PlistFormat = ..., skipkeys: bool = ..., sort_keys: bool = ...) -> bytes: ... + +if sys.version_info < (3, 9): + def readPlist(pathOrFile: Union[_Path, IO[bytes]]) -> Any: ... + def writePlist(value: Mapping[str, Any], pathOrFile: Union[_Path, IO[bytes]]) -> None: ... + def readPlistFromBytes(data: bytes) -> Any: ... + def writePlistToBytes(value: Mapping[str, Any]) -> bytes: ... + +if sys.version_info < (3,): + def readPlistFromResource(path: _Path, restype: str = ..., resid: int = ...) -> Any: ... + def writePlistToResource(rootObject: Mapping[str, Any], path: _Path, restype: str = ..., resid: int = ...) -> None: ... + def readPlistFromString(data: str) -> Any: ... + def writePlistToString(rootObject: Mapping[str, Any]) -> str: ... + +if sys.version_info < (3, 7): + class Dict(DictT[str, Any]): + def __getattr__(self, attr: str) -> Any: ... + def __setattr__(self, attr: str, value: Any) -> None: ... + def __delattr__(self, attr: str) -> None: ... + +if sys.version_info < (3, 9): + class Data: + data: bytes + def __init__(self, data: bytes) -> None: ... + +if sys.version_info >= (3, 8): + class UID: + data: int + def __init__(self, data: int) -> None: ... + def __index__(self) -> int: ... + def __reduce__(self) -> Any: ... + def __hash__(self) -> int: ... + +class InvalidFileException(ValueError): + def __init__(self, message: str = ...) -> None: ... diff --git a/shared/package-files/4a/4ae9db23518cabd12fbc057297a5b962cf2b089c3e7afe95307dfce2cbc8eee5/nwp-517 b/shared/package-files/4a/4ae9db23518cabd12fbc057297a5b962cf2b089c3e7afe95307dfce2cbc8eee5/nwp-517 new file mode 100644 index 0000000000000000000000000000000000000000..a51a6973dcd285b6d6d1a56c985ca19fbf196b21 Binary files /dev/null and b/shared/package-files/4a/4ae9db23518cabd12fbc057297a5b962cf2b089c3e7afe95307dfce2cbc8eee5/nwp-517 differ diff --git a/shared/package-files/4a/4ae9db23518cabd12fbc057297a5b962cf2b089c3e7afe95307dfce2cbc8eee5/nwp517 b/shared/package-files/4a/4ae9db23518cabd12fbc057297a5b962cf2b089c3e7afe95307dfce2cbc8eee5/nwp517 new file mode 100644 index 0000000000000000000000000000000000000000..a51a6973dcd285b6d6d1a56c985ca19fbf196b21 Binary files /dev/null and b/shared/package-files/4a/4ae9db23518cabd12fbc057297a5b962cf2b089c3e7afe95307dfce2cbc8eee5/nwp517 differ diff --git a/shared/package-files/4a/4af0829ec4ad81bb4b4f2aa6443f542bdb62fad924160772a1a42de371e9e3a4/_foreach_exp_compositeexplicitautograd_dispatch.h b/shared/package-files/4a/4af0829ec4ad81bb4b4f2aa6443f542bdb62fad924160772a1a42de371e9e3a4/_foreach_exp_compositeexplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..13b1f5ff77cf54134b9298ac643d456a71523926 --- /dev/null +++ b/shared/package-files/4a/4af0829ec4ad81bb4b4f2aa6443f542bdb62fad924160772a1a42de371e9e3a4/_foreach_exp_compositeexplicitautograd_dispatch.h @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API void _foreach_exp_out(at::TensorList out, at::TensorList self); +TORCH_API void _foreach_exp_outf(at::TensorList self, at::TensorList out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/4a/4af37dc910378b4d8ee0914c5f1673d14abfbc9e59a6f0bea42dac7c5e7a0392/npy_3kcompat.h b/shared/package-files/4a/4af37dc910378b4d8ee0914c5f1673d14abfbc9e59a6f0bea42dac7c5e7a0392/npy_3kcompat.h new file mode 100644 index 0000000000000000000000000000000000000000..62fde943aacc4ad117712182846a94faf69a767b --- /dev/null +++ b/shared/package-files/4a/4af37dc910378b4d8ee0914c5f1673d14abfbc9e59a6f0bea42dac7c5e7a0392/npy_3kcompat.h @@ -0,0 +1,595 @@ +/* + * This is a convenience header file providing compatibility utilities + * for supporting different minor versions of Python 3. + * It was originally used to support the transition from Python 2, + * hence the "3k" naming. + * + * If you want to use this for your own projects, it's recommended to make a + * copy of it. Although the stuff below is unlikely to change, we don't provide + * strong backwards compatibility guarantees at the moment. + */ + +#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_3KCOMPAT_H_ +#define NUMPY_CORE_INCLUDE_NUMPY_NPY_3KCOMPAT_H_ + +#include +#include + +#ifndef NPY_PY3K +#define NPY_PY3K 1 +#endif + +#include "numpy/npy_common.h" +#include "numpy/ndarrayobject.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * PyInt -> PyLong + */ + + +/* + * This is a renamed copy of the Python non-limited API function _PyLong_AsInt. It is + * included here because it is missing from the PyPy API. It completes the PyLong_As* + * group of functions and can be useful in replacing PyInt_Check. + */ +static inline int +Npy__PyLong_AsInt(PyObject *obj) +{ + int overflow; + long result = PyLong_AsLongAndOverflow(obj, &overflow); + + /* INT_MAX and INT_MIN are defined in Python.h */ + if (overflow || result > INT_MAX || result < INT_MIN) { + /* XXX: could be cute and give a different + message for overflow == -1 */ + PyErr_SetString(PyExc_OverflowError, + "Python int too large to convert to C int"); + return -1; + } + return (int)result; +} + + +#if defined(NPY_PY3K) +/* Return True only if the long fits in a C long */ +static inline int PyInt_Check(PyObject *op) { + int overflow = 0; + if (!PyLong_Check(op)) { + return 0; + } + PyLong_AsLongAndOverflow(op, &overflow); + return (overflow == 0); +} + + +#define PyInt_FromLong PyLong_FromLong +#define PyInt_AsLong PyLong_AsLong +#define PyInt_AS_LONG PyLong_AsLong +#define PyInt_AsSsize_t PyLong_AsSsize_t +#define PyNumber_Int PyNumber_Long + +/* NOTE: + * + * Since the PyLong type is very different from the fixed-range PyInt, + * we don't define PyInt_Type -> PyLong_Type. + */ +#endif /* NPY_PY3K */ + +/* Py3 changes PySlice_GetIndicesEx' first argument's type to PyObject* */ +#ifdef NPY_PY3K +# define NpySlice_GetIndicesEx PySlice_GetIndicesEx +#else +# define NpySlice_GetIndicesEx(op, nop, start, end, step, slicelength) \ + PySlice_GetIndicesEx((PySliceObject *)op, nop, start, end, step, slicelength) +#endif + +#if PY_VERSION_HEX < 0x030900a4 + /* Introduced in https://github.com/python/cpython/commit/d2ec81a8c99796b51fb8c49b77a7fe369863226f */ + #define Py_SET_TYPE(obj, type) ((Py_TYPE(obj) = (type)), (void)0) + /* Introduced in https://github.com/python/cpython/commit/b10dc3e7a11fcdb97e285882eba6da92594f90f9 */ + #define Py_SET_SIZE(obj, size) ((Py_SIZE(obj) = (size)), (void)0) + /* Introduced in https://github.com/python/cpython/commit/c86a11221df7e37da389f9c6ce6e47ea22dc44ff */ + #define Py_SET_REFCNT(obj, refcnt) ((Py_REFCNT(obj) = (refcnt)), (void)0) +#endif + + +#define Npy_EnterRecursiveCall(x) Py_EnterRecursiveCall(x) + +/* + * PyString -> PyBytes + */ + +#if defined(NPY_PY3K) + +#define PyString_Type PyBytes_Type +#define PyString_Check PyBytes_Check +#define PyStringObject PyBytesObject +#define PyString_FromString PyBytes_FromString +#define PyString_FromStringAndSize PyBytes_FromStringAndSize +#define PyString_AS_STRING PyBytes_AS_STRING +#define PyString_AsStringAndSize PyBytes_AsStringAndSize +#define PyString_FromFormat PyBytes_FromFormat +#define PyString_Concat PyBytes_Concat +#define PyString_ConcatAndDel PyBytes_ConcatAndDel +#define PyString_AsString PyBytes_AsString +#define PyString_GET_SIZE PyBytes_GET_SIZE +#define PyString_Size PyBytes_Size + +#define PyUString_Type PyUnicode_Type +#define PyUString_Check PyUnicode_Check +#define PyUStringObject PyUnicodeObject +#define PyUString_FromString PyUnicode_FromString +#define PyUString_FromStringAndSize PyUnicode_FromStringAndSize +#define PyUString_FromFormat PyUnicode_FromFormat +#define PyUString_Concat PyUnicode_Concat2 +#define PyUString_ConcatAndDel PyUnicode_ConcatAndDel +#define PyUString_GET_SIZE PyUnicode_GET_SIZE +#define PyUString_Size PyUnicode_Size +#define PyUString_InternFromString PyUnicode_InternFromString +#define PyUString_Format PyUnicode_Format + +#define PyBaseString_Check(obj) (PyUnicode_Check(obj)) + +#else + +#define PyBytes_Type PyString_Type +#define PyBytes_Check PyString_Check +#define PyBytesObject PyStringObject +#define PyBytes_FromString PyString_FromString +#define PyBytes_FromStringAndSize PyString_FromStringAndSize +#define PyBytes_AS_STRING PyString_AS_STRING +#define PyBytes_AsStringAndSize PyString_AsStringAndSize +#define PyBytes_FromFormat PyString_FromFormat +#define PyBytes_Concat PyString_Concat +#define PyBytes_ConcatAndDel PyString_ConcatAndDel +#define PyBytes_AsString PyString_AsString +#define PyBytes_GET_SIZE PyString_GET_SIZE +#define PyBytes_Size PyString_Size + +#define PyUString_Type PyString_Type +#define PyUString_Check PyString_Check +#define PyUStringObject PyStringObject +#define PyUString_FromString PyString_FromString +#define PyUString_FromStringAndSize PyString_FromStringAndSize +#define PyUString_FromFormat PyString_FromFormat +#define PyUString_Concat PyString_Concat +#define PyUString_ConcatAndDel PyString_ConcatAndDel +#define PyUString_GET_SIZE PyString_GET_SIZE +#define PyUString_Size PyString_Size +#define PyUString_InternFromString PyString_InternFromString +#define PyUString_Format PyString_Format + +#define PyBaseString_Check(obj) (PyBytes_Check(obj) || PyUnicode_Check(obj)) + +#endif /* NPY_PY3K */ + +/* + * Macros to protect CRT calls against instant termination when passed an + * invalid parameter (https://bugs.python.org/issue23524). + */ +#if defined _MSC_VER && _MSC_VER >= 1900 + +#include + +extern _invalid_parameter_handler _Py_silent_invalid_parameter_handler; +#define NPY_BEGIN_SUPPRESS_IPH { _invalid_parameter_handler _Py_old_handler = \ + _set_thread_local_invalid_parameter_handler(_Py_silent_invalid_parameter_handler); +#define NPY_END_SUPPRESS_IPH _set_thread_local_invalid_parameter_handler(_Py_old_handler); } + +#else + +#define NPY_BEGIN_SUPPRESS_IPH +#define NPY_END_SUPPRESS_IPH + +#endif /* _MSC_VER >= 1900 */ + + +static inline void +PyUnicode_ConcatAndDel(PyObject **left, PyObject *right) +{ + Py_SETREF(*left, PyUnicode_Concat(*left, right)); + Py_DECREF(right); +} + +static inline void +PyUnicode_Concat2(PyObject **left, PyObject *right) +{ + Py_SETREF(*left, PyUnicode_Concat(*left, right)); +} + +/* + * PyFile_* compatibility + */ + +/* + * Get a FILE* handle to the file represented by the Python object + */ +static inline FILE* +npy_PyFile_Dup2(PyObject *file, char *mode, npy_off_t *orig_pos) +{ + int fd, fd2, unbuf; + Py_ssize_t fd2_tmp; + PyObject *ret, *os, *io, *io_raw; + npy_off_t pos; + FILE *handle; + + /* For Python 2 PyFileObject, use PyFile_AsFile */ +#if !defined(NPY_PY3K) + if (PyFile_Check(file)) { + return PyFile_AsFile(file); + } +#endif + + /* Flush first to ensure things end up in the file in the correct order */ + ret = PyObject_CallMethod(file, "flush", ""); + if (ret == NULL) { + return NULL; + } + Py_DECREF(ret); + fd = PyObject_AsFileDescriptor(file); + if (fd == -1) { + return NULL; + } + + /* + * The handle needs to be dup'd because we have to call fclose + * at the end + */ + os = PyImport_ImportModule("os"); + if (os == NULL) { + return NULL; + } + ret = PyObject_CallMethod(os, "dup", "i", fd); + Py_DECREF(os); + if (ret == NULL) { + return NULL; + } + fd2_tmp = PyNumber_AsSsize_t(ret, PyExc_IOError); + Py_DECREF(ret); + if (fd2_tmp == -1 && PyErr_Occurred()) { + return NULL; + } + if (fd2_tmp < INT_MIN || fd2_tmp > INT_MAX) { + PyErr_SetString(PyExc_IOError, + "Getting an 'int' from os.dup() failed"); + return NULL; + } + fd2 = (int)fd2_tmp; + + /* Convert to FILE* handle */ +#ifdef _WIN32 + NPY_BEGIN_SUPPRESS_IPH + handle = _fdopen(fd2, mode); + NPY_END_SUPPRESS_IPH +#else + handle = fdopen(fd2, mode); +#endif + if (handle == NULL) { + PyErr_SetString(PyExc_IOError, + "Getting a FILE* from a Python file object via " + "_fdopen failed. If you built NumPy, you probably " + "linked with the wrong debug/release runtime"); + return NULL; + } + + /* Record the original raw file handle position */ + *orig_pos = npy_ftell(handle); + if (*orig_pos == -1) { + /* The io module is needed to determine if buffering is used */ + io = PyImport_ImportModule("io"); + if (io == NULL) { + fclose(handle); + return NULL; + } + /* File object instances of RawIOBase are unbuffered */ + io_raw = PyObject_GetAttrString(io, "RawIOBase"); + Py_DECREF(io); + if (io_raw == NULL) { + fclose(handle); + return NULL; + } + unbuf = PyObject_IsInstance(file, io_raw); + Py_DECREF(io_raw); + if (unbuf == 1) { + /* Succeed if the IO is unbuffered */ + return handle; + } + else { + PyErr_SetString(PyExc_IOError, "obtaining file position failed"); + fclose(handle); + return NULL; + } + } + + /* Seek raw handle to the Python-side position */ + ret = PyObject_CallMethod(file, "tell", ""); + if (ret == NULL) { + fclose(handle); + return NULL; + } + pos = PyLong_AsLongLong(ret); + Py_DECREF(ret); + if (PyErr_Occurred()) { + fclose(handle); + return NULL; + } + if (npy_fseek(handle, pos, SEEK_SET) == -1) { + PyErr_SetString(PyExc_IOError, "seeking file failed"); + fclose(handle); + return NULL; + } + return handle; +} + +/* + * Close the dup-ed file handle, and seek the Python one to the current position + */ +static inline int +npy_PyFile_DupClose2(PyObject *file, FILE* handle, npy_off_t orig_pos) +{ + int fd, unbuf; + PyObject *ret, *io, *io_raw; + npy_off_t position; + + /* For Python 2 PyFileObject, do nothing */ +#if !defined(NPY_PY3K) + if (PyFile_Check(file)) { + return 0; + } +#endif + + position = npy_ftell(handle); + + /* Close the FILE* handle */ + fclose(handle); + + /* + * Restore original file handle position, in order to not confuse + * Python-side data structures + */ + fd = PyObject_AsFileDescriptor(file); + if (fd == -1) { + return -1; + } + + if (npy_lseek(fd, orig_pos, SEEK_SET) == -1) { + + /* The io module is needed to determine if buffering is used */ + io = PyImport_ImportModule("io"); + if (io == NULL) { + return -1; + } + /* File object instances of RawIOBase are unbuffered */ + io_raw = PyObject_GetAttrString(io, "RawIOBase"); + Py_DECREF(io); + if (io_raw == NULL) { + return -1; + } + unbuf = PyObject_IsInstance(file, io_raw); + Py_DECREF(io_raw); + if (unbuf == 1) { + /* Succeed if the IO is unbuffered */ + return 0; + } + else { + PyErr_SetString(PyExc_IOError, "seeking file failed"); + return -1; + } + } + + if (position == -1) { + PyErr_SetString(PyExc_IOError, "obtaining file position failed"); + return -1; + } + + /* Seek Python-side handle to the FILE* handle position */ + ret = PyObject_CallMethod(file, "seek", NPY_OFF_T_PYFMT "i", position, 0); + if (ret == NULL) { + return -1; + } + Py_DECREF(ret); + return 0; +} + +static inline int +npy_PyFile_Check(PyObject *file) +{ + int fd; + /* For Python 2, check if it is a PyFileObject */ +#if !defined(NPY_PY3K) + if (PyFile_Check(file)) { + return 1; + } +#endif + fd = PyObject_AsFileDescriptor(file); + if (fd == -1) { + PyErr_Clear(); + return 0; + } + return 1; +} + +static inline PyObject* +npy_PyFile_OpenFile(PyObject *filename, const char *mode) +{ + PyObject *open; + open = PyDict_GetItemString(PyEval_GetBuiltins(), "open"); + if (open == NULL) { + return NULL; + } + return PyObject_CallFunction(open, "Os", filename, mode); +} + +static inline int +npy_PyFile_CloseFile(PyObject *file) +{ + PyObject *ret; + + ret = PyObject_CallMethod(file, "close", NULL); + if (ret == NULL) { + return -1; + } + Py_DECREF(ret); + return 0; +} + + +/* This is a copy of _PyErr_ChainExceptions + */ +static inline void +npy_PyErr_ChainExceptions(PyObject *exc, PyObject *val, PyObject *tb) +{ + if (exc == NULL) + return; + + if (PyErr_Occurred()) { + /* only py3 supports this anyway */ + #ifdef NPY_PY3K + PyObject *exc2, *val2, *tb2; + PyErr_Fetch(&exc2, &val2, &tb2); + PyErr_NormalizeException(&exc, &val, &tb); + if (tb != NULL) { + PyException_SetTraceback(val, tb); + Py_DECREF(tb); + } + Py_DECREF(exc); + PyErr_NormalizeException(&exc2, &val2, &tb2); + PyException_SetContext(val2, val); + PyErr_Restore(exc2, val2, tb2); + #endif + } + else { + PyErr_Restore(exc, val, tb); + } +} + + +/* This is a copy of _PyErr_ChainExceptions, with: + * - a minimal implementation for python 2 + * - __cause__ used instead of __context__ + */ +static inline void +npy_PyErr_ChainExceptionsCause(PyObject *exc, PyObject *val, PyObject *tb) +{ + if (exc == NULL) + return; + + if (PyErr_Occurred()) { + /* only py3 supports this anyway */ + #ifdef NPY_PY3K + PyObject *exc2, *val2, *tb2; + PyErr_Fetch(&exc2, &val2, &tb2); + PyErr_NormalizeException(&exc, &val, &tb); + if (tb != NULL) { + PyException_SetTraceback(val, tb); + Py_DECREF(tb); + } + Py_DECREF(exc); + PyErr_NormalizeException(&exc2, &val2, &tb2); + PyException_SetCause(val2, val); + PyErr_Restore(exc2, val2, tb2); + #endif + } + else { + PyErr_Restore(exc, val, tb); + } +} + +/* + * PyObject_Cmp + */ +#if defined(NPY_PY3K) +static inline int +PyObject_Cmp(PyObject *i1, PyObject *i2, int *cmp) +{ + int v; + v = PyObject_RichCompareBool(i1, i2, Py_LT); + if (v == 1) { + *cmp = -1; + return 1; + } + else if (v == -1) { + return -1; + } + + v = PyObject_RichCompareBool(i1, i2, Py_GT); + if (v == 1) { + *cmp = 1; + return 1; + } + else if (v == -1) { + return -1; + } + + v = PyObject_RichCompareBool(i1, i2, Py_EQ); + if (v == 1) { + *cmp = 0; + return 1; + } + else { + *cmp = 0; + return -1; + } +} +#endif + +/* + * PyCObject functions adapted to PyCapsules. + * + * The main job here is to get rid of the improved error handling + * of PyCapsules. It's a shame... + */ +static inline PyObject * +NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *)) +{ + PyObject *ret = PyCapsule_New(ptr, NULL, dtor); + if (ret == NULL) { + PyErr_Clear(); + } + return ret; +} + +static inline PyObject * +NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(PyObject *)) +{ + PyObject *ret = NpyCapsule_FromVoidPtr(ptr, dtor); + if (ret != NULL && PyCapsule_SetContext(ret, context) != 0) { + PyErr_Clear(); + Py_DECREF(ret); + ret = NULL; + } + return ret; +} + +static inline void * +NpyCapsule_AsVoidPtr(PyObject *obj) +{ + void *ret = PyCapsule_GetPointer(obj, NULL); + if (ret == NULL) { + PyErr_Clear(); + } + return ret; +} + +static inline void * +NpyCapsule_GetDesc(PyObject *obj) +{ + return PyCapsule_GetContext(obj); +} + +static inline int +NpyCapsule_Check(PyObject *ptr) +{ + return PyCapsule_CheckExact(ptr); +} + +#ifdef __cplusplus +} +#endif + + +#endif /* NUMPY_CORE_INCLUDE_NUMPY_NPY_3KCOMPAT_H_ */ diff --git a/shared/package-files/4a/4af5787370eb04f6afbaba15bf2327f99435977e503f7c9e8aca80f3837aaea3/one_hot_ops.h b/shared/package-files/4a/4af5787370eb04f6afbaba15bf2327f99435977e503f7c9e8aca80f3837aaea3/one_hot_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..380e59fea9fe315e6d6186d4f6205150871f4d03 --- /dev/null +++ b/shared/package-files/4a/4af5787370eb04f6afbaba15bf2327f99435977e503f7c9e8aca80f3837aaea3/one_hot_ops.h @@ -0,0 +1,28 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API one_hot { + using schema = at::Tensor (const at::Tensor &, int64_t); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::one_hot") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "one_hot(Tensor self, int num_classes=-1) -> Tensor") + static at::Tensor call(const at::Tensor & self, int64_t num_classes); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, int64_t num_classes); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/4a/4af5a9cdf907fb9c5c1bc4e39154f47153586d07ff903b413c1d460be88d7c3c/_graph.py b/shared/package-files/4a/4af5a9cdf907fb9c5c1bc4e39154f47153586d07ff903b413c1d460be88d7c3c/_graph.py new file mode 100644 index 0000000000000000000000000000000000000000..3562fab1fcf01b5487d210a11d83d203bffd7835 --- /dev/null +++ b/shared/package-files/4a/4af5a9cdf907fb9c5c1bc4e39154f47153586d07ff903b413c1d460be88d7c3c/_graph.py @@ -0,0 +1,704 @@ +"""Nearest Neighbors graph functions""" + +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + +import itertools + +from ..base import ClassNamePrefixFeaturesOutMixin, TransformerMixin, _fit_context +from ..utils._param_validation import ( + Integral, + Interval, + Real, + StrOptions, + validate_params, +) +from ..utils.validation import check_is_fitted +from ._base import VALID_METRICS, KNeighborsMixin, NeighborsBase, RadiusNeighborsMixin +from ._unsupervised import NearestNeighbors + + +def _check_params(X, metric, p, metric_params): + """Check the validity of the input parameters""" + params = zip(["metric", "p", "metric_params"], [metric, p, metric_params]) + est_params = X.get_params() + for param_name, func_param in params: + if func_param != est_params[param_name]: + raise ValueError( + "Got %s for %s, while the estimator has %s for the same parameter." + % (func_param, param_name, est_params[param_name]) + ) + + +def _query_include_self(X, include_self, mode): + """Return the query based on include_self param""" + if include_self == "auto": + include_self = mode == "connectivity" + + # it does not include each sample as its own neighbors + if not include_self: + X = None + + return X + + +@validate_params( + { + "X": ["array-like", "sparse matrix", KNeighborsMixin], + "n_neighbors": [Interval(Integral, 1, None, closed="left")], + "mode": [StrOptions({"connectivity", "distance"})], + "metric": [StrOptions(set(itertools.chain(*VALID_METRICS.values()))), callable], + "p": [Interval(Real, 0, None, closed="right"), None], + "metric_params": [dict, None], + "include_self": ["boolean", StrOptions({"auto"})], + "n_jobs": [Integral, None], + }, + prefer_skip_nested_validation=False, # metric is not validated yet +) +def kneighbors_graph( + X, + n_neighbors, + *, + mode="connectivity", + metric="minkowski", + p=2, + metric_params=None, + include_self=False, + n_jobs=None, +): + """Compute the (weighted) graph of k-Neighbors for points in X. + + Read more in the :ref:`User Guide `. + + Parameters + ---------- + X : {array-like, sparse matrix} of shape (n_samples, n_features) + Sample data. + + n_neighbors : int + Number of neighbors for each sample. + + mode : {'connectivity', 'distance'}, default='connectivity' + Type of returned matrix: 'connectivity' will return the connectivity + matrix with ones and zeros, and 'distance' will return the distances + between neighbors according to the given metric. + + metric : str, default='minkowski' + Metric to use for distance computation. Default is "minkowski", which + results in the standard Euclidean distance when p = 2. See the + documentation of `scipy.spatial.distance + `_ and + the metrics listed in + :class:`~sklearn.metrics.pairwise.distance_metrics` for valid metric + values. + + p : float, default=2 + Power parameter for the Minkowski metric. When p = 1, this is equivalent + to using manhattan_distance (l1), and euclidean_distance (l2) for p = 2. + For arbitrary p, minkowski_distance (l_p) is used. This parameter is expected + to be positive. + + metric_params : dict, default=None + Additional keyword arguments for the metric function. + + include_self : bool or 'auto', default=False + Whether or not to mark each sample as the first nearest neighbor to + itself. If 'auto', then True is used for mode='connectivity' and False + for mode='distance'. + + n_jobs : int, default=None + The number of parallel jobs to run for neighbors search. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. + + Returns + ------- + A : sparse matrix of shape (n_samples, n_samples) + Graph where A[i, j] is assigned the weight of edge that + connects i to j. The matrix is of CSR format. + + See Also + -------- + radius_neighbors_graph: Compute the (weighted) graph of Neighbors for points in X. + + Examples + -------- + >>> X = [[0], [3], [1]] + >>> from sklearn.neighbors import kneighbors_graph + >>> A = kneighbors_graph(X, 2, mode='connectivity', include_self=True) + >>> A.toarray() + array([[1., 0., 1.], + [0., 1., 1.], + [1., 0., 1.]]) + """ + if not isinstance(X, KNeighborsMixin): + X = NearestNeighbors( + n_neighbors=n_neighbors, + metric=metric, + p=p, + metric_params=metric_params, + n_jobs=n_jobs, + ).fit(X) + else: + _check_params(X, metric, p, metric_params) + + query = _query_include_self(X._fit_X, include_self, mode) + return X.kneighbors_graph(X=query, n_neighbors=n_neighbors, mode=mode) + + +@validate_params( + { + "X": ["array-like", "sparse matrix", RadiusNeighborsMixin], + "radius": [Interval(Real, 0, None, closed="both")], + "mode": [StrOptions({"connectivity", "distance"})], + "metric": [StrOptions(set(itertools.chain(*VALID_METRICS.values()))), callable], + "p": [Interval(Real, 0, None, closed="right"), None], + "metric_params": [dict, None], + "include_self": ["boolean", StrOptions({"auto"})], + "n_jobs": [Integral, None], + }, + prefer_skip_nested_validation=False, # metric is not validated yet +) +def radius_neighbors_graph( + X, + radius, + *, + mode="connectivity", + metric="minkowski", + p=2, + metric_params=None, + include_self=False, + n_jobs=None, +): + """Compute the (weighted) graph of Neighbors for points in X. + + Neighborhoods are restricted the points at a distance lower than + radius. + + Read more in the :ref:`User Guide `. + + Parameters + ---------- + X : {array-like, sparse matrix} of shape (n_samples, n_features) + Sample data. + + radius : float + Radius of neighborhoods. + + mode : {'connectivity', 'distance'}, default='connectivity' + Type of returned matrix: 'connectivity' will return the connectivity + matrix with ones and zeros, and 'distance' will return the distances + between neighbors according to the given metric. + + metric : str, default='minkowski' + Metric to use for distance computation. Default is "minkowski", which + results in the standard Euclidean distance when p = 2. See the + documentation of `scipy.spatial.distance + `_ and + the metrics listed in + :class:`~sklearn.metrics.pairwise.distance_metrics` for valid metric + values. + + p : float, default=2 + Power parameter for the Minkowski metric. When p = 1, this is + equivalent to using manhattan_distance (l1), and euclidean_distance + (l2) for p = 2. For arbitrary p, minkowski_distance (l_p) is used. + + metric_params : dict, default=None + Additional keyword arguments for the metric function. + + include_self : bool or 'auto', default=False + Whether or not to mark each sample as the first nearest neighbor to + itself. If 'auto', then True is used for mode='connectivity' and False + for mode='distance'. + + n_jobs : int, default=None + The number of parallel jobs to run for neighbors search. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. + + Returns + ------- + A : sparse matrix of shape (n_samples, n_samples) + Graph where A[i, j] is assigned the weight of edge that connects + i to j. The matrix is of CSR format. + + See Also + -------- + kneighbors_graph: Compute the weighted graph of k-neighbors for points in X. + + Examples + -------- + >>> X = [[0], [3], [1]] + >>> from sklearn.neighbors import radius_neighbors_graph + >>> A = radius_neighbors_graph(X, 1.5, mode='connectivity', + ... include_self=True) + >>> A.toarray() + array([[1., 0., 1.], + [0., 1., 0.], + [1., 0., 1.]]) + """ + if not isinstance(X, RadiusNeighborsMixin): + X = NearestNeighbors( + radius=radius, + metric=metric, + p=p, + metric_params=metric_params, + n_jobs=n_jobs, + ).fit(X) + else: + _check_params(X, metric, p, metric_params) + + query = _query_include_self(X._fit_X, include_self, mode) + return X.radius_neighbors_graph(query, radius, mode) + + +class KNeighborsTransformer( + ClassNamePrefixFeaturesOutMixin, KNeighborsMixin, TransformerMixin, NeighborsBase +): + """Transform X into a (weighted) graph of k nearest neighbors. + + The transformed data is a sparse graph as returned by kneighbors_graph. + + Read more in the :ref:`User Guide `. + + .. versionadded:: 0.22 + + Parameters + ---------- + mode : {'distance', 'connectivity'}, default='distance' + Type of returned matrix: 'connectivity' will return the connectivity + matrix with ones and zeros, and 'distance' will return the distances + between neighbors according to the given metric. + + n_neighbors : int, default=5 + Number of neighbors for each sample in the transformed sparse graph. + For compatibility reasons, as each sample is considered as its own + neighbor, one extra neighbor will be computed when mode == 'distance'. + In this case, the sparse graph contains (n_neighbors + 1) neighbors. + + algorithm : {'auto', 'ball_tree', 'kd_tree', 'brute'}, default='auto' + Algorithm used to compute the nearest neighbors: + + - 'ball_tree' will use :class:`BallTree` + - 'kd_tree' will use :class:`KDTree` + - 'brute' will use a brute-force search. + - 'auto' will attempt to decide the most appropriate algorithm + based on the values passed to :meth:`fit` method. + + Note: fitting on sparse input will override the setting of + this parameter, using brute force. + + leaf_size : int, default=30 + Leaf size passed to BallTree or KDTree. This can affect the + speed of the construction and query, as well as the memory + required to store the tree. The optimal value depends on the + nature of the problem. + + metric : str or callable, default='minkowski' + Metric to use for distance computation. Default is "minkowski", which + results in the standard Euclidean distance when p = 2. See the + documentation of `scipy.spatial.distance + `_ and + the metrics listed in + :class:`~sklearn.metrics.pairwise.distance_metrics` for valid metric + values. + + If metric is a callable function, it takes two arrays representing 1D + vectors as inputs and must return one value indicating the distance + between those vectors. This works for Scipy's metrics, but is less + efficient than passing the metric name as a string. + + Distance matrices are not supported. + + p : float, default=2 + Parameter for the Minkowski metric from + sklearn.metrics.pairwise.pairwise_distances. When p = 1, this is + equivalent to using manhattan_distance (l1), and euclidean_distance + (l2) for p = 2. For arbitrary p, minkowski_distance (l_p) is used. + This parameter is expected to be positive. + + metric_params : dict, default=None + Additional keyword arguments for the metric function. + + n_jobs : int, default=None + The number of parallel jobs to run for neighbors search. + If ``-1``, then the number of jobs is set to the number of CPU cores. + + Attributes + ---------- + effective_metric_ : str or callable + The distance metric used. It will be same as the `metric` parameter + or a synonym of it, e.g. 'euclidean' if the `metric` parameter set to + 'minkowski' and `p` parameter set to 2. + + effective_metric_params_ : dict + Additional keyword arguments for the metric function. For most metrics + will be same with `metric_params` parameter, but may also contain the + `p` parameter value if the `effective_metric_` attribute is set to + 'minkowski'. + + n_features_in_ : int + Number of features seen during :term:`fit`. + + .. versionadded:: 0.24 + + feature_names_in_ : ndarray of shape (`n_features_in_`,) + Names of features seen during :term:`fit`. Defined only when `X` + has feature names that are all strings. + + .. versionadded:: 1.0 + + n_samples_fit_ : int + Number of samples in the fitted data. + + See Also + -------- + kneighbors_graph : Compute the weighted graph of k-neighbors for + points in X. + RadiusNeighborsTransformer : Transform X into a weighted graph of + neighbors nearer than a radius. + + Notes + ----- + For an example of using :class:`~sklearn.neighbors.KNeighborsTransformer` + in combination with :class:`~sklearn.manifold.TSNE` see + :ref:`sphx_glr_auto_examples_neighbors_approximate_nearest_neighbors.py`. + + Examples + -------- + >>> from sklearn.datasets import load_wine + >>> from sklearn.neighbors import KNeighborsTransformer + >>> X, _ = load_wine(return_X_y=True) + >>> X.shape + (178, 13) + >>> transformer = KNeighborsTransformer(n_neighbors=5, mode='distance') + >>> X_dist_graph = transformer.fit_transform(X) + >>> X_dist_graph.shape + (178, 178) + """ + + _parameter_constraints: dict = { + **NeighborsBase._parameter_constraints, + "mode": [StrOptions({"distance", "connectivity"})], + } + _parameter_constraints.pop("radius") + + def __init__( + self, + *, + mode="distance", + n_neighbors=5, + algorithm="auto", + leaf_size=30, + metric="minkowski", + p=2, + metric_params=None, + n_jobs=None, + ): + super().__init__( + n_neighbors=n_neighbors, + radius=None, + algorithm=algorithm, + leaf_size=leaf_size, + metric=metric, + p=p, + metric_params=metric_params, + n_jobs=n_jobs, + ) + self.mode = mode + + @_fit_context( + # KNeighborsTransformer.metric is not validated yet + prefer_skip_nested_validation=False + ) + def fit(self, X, y=None): + """Fit the k-nearest neighbors transformer from the training dataset. + + Parameters + ---------- + X : {array-like, sparse matrix} of shape (n_samples, n_features) or \ + (n_samples, n_samples) if metric='precomputed' + Training data. + y : Ignored + Not used, present for API consistency by convention. + + Returns + ------- + self : KNeighborsTransformer + The fitted k-nearest neighbors transformer. + """ + self._fit(X) + self._n_features_out = self.n_samples_fit_ + return self + + def transform(self, X): + """Compute the (weighted) graph of Neighbors for points in X. + + Parameters + ---------- + X : array-like of shape (n_samples_transform, n_features) + Sample data. + + Returns + ------- + Xt : sparse matrix of shape (n_samples_transform, n_samples_fit) + Xt[i, j] is assigned the weight of edge that connects i to j. + Only the neighbors have an explicit value. + The diagonal is always explicit. + The matrix is of CSR format. + """ + check_is_fitted(self) + add_one = self.mode == "distance" + return self.kneighbors_graph( + X, mode=self.mode, n_neighbors=self.n_neighbors + add_one + ) + + def fit_transform(self, X, y=None): + """Fit to data, then transform it. + + Fits transformer to X and y with optional parameters fit_params + and returns a transformed version of X. + + Parameters + ---------- + X : array-like of shape (n_samples, n_features) + Training set. + + y : Ignored + Not used, present for API consistency by convention. + + Returns + ------- + Xt : sparse matrix of shape (n_samples, n_samples) + Xt[i, j] is assigned the weight of edge that connects i to j. + Only the neighbors have an explicit value. + The diagonal is always explicit. + The matrix is of CSR format. + """ + return self.fit(X).transform(X) + + +class RadiusNeighborsTransformer( + ClassNamePrefixFeaturesOutMixin, + RadiusNeighborsMixin, + TransformerMixin, + NeighborsBase, +): + """Transform X into a (weighted) graph of neighbors nearer than a radius. + + The transformed data is a sparse graph as returned by + `radius_neighbors_graph`. + + Read more in the :ref:`User Guide `. + + .. versionadded:: 0.22 + + Parameters + ---------- + mode : {'distance', 'connectivity'}, default='distance' + Type of returned matrix: 'connectivity' will return the connectivity + matrix with ones and zeros, and 'distance' will return the distances + between neighbors according to the given metric. + + radius : float, default=1.0 + Radius of neighborhood in the transformed sparse graph. + + algorithm : {'auto', 'ball_tree', 'kd_tree', 'brute'}, default='auto' + Algorithm used to compute the nearest neighbors: + + - 'ball_tree' will use :class:`BallTree` + - 'kd_tree' will use :class:`KDTree` + - 'brute' will use a brute-force search. + - 'auto' will attempt to decide the most appropriate algorithm + based on the values passed to :meth:`fit` method. + + Note: fitting on sparse input will override the setting of + this parameter, using brute force. + + leaf_size : int, default=30 + Leaf size passed to BallTree or KDTree. This can affect the + speed of the construction and query, as well as the memory + required to store the tree. The optimal value depends on the + nature of the problem. + + metric : str or callable, default='minkowski' + Metric to use for distance computation. Default is "minkowski", which + results in the standard Euclidean distance when p = 2. See the + documentation of `scipy.spatial.distance + `_ and + the metrics listed in + :class:`~sklearn.metrics.pairwise.distance_metrics` for valid metric + values. + + If metric is a callable function, it takes two arrays representing 1D + vectors as inputs and must return one value indicating the distance + between those vectors. This works for Scipy's metrics, but is less + efficient than passing the metric name as a string. + + Distance matrices are not supported. + + p : float, default=2 + Parameter for the Minkowski metric from + sklearn.metrics.pairwise.pairwise_distances. When p = 1, this is + equivalent to using manhattan_distance (l1), and euclidean_distance + (l2) for p = 2. For arbitrary p, minkowski_distance (l_p) is used. + This parameter is expected to be positive. + + metric_params : dict, default=None + Additional keyword arguments for the metric function. + + n_jobs : int, default=None + The number of parallel jobs to run for neighbors search. + If ``-1``, then the number of jobs is set to the number of CPU cores. + + Attributes + ---------- + effective_metric_ : str or callable + The distance metric used. It will be same as the `metric` parameter + or a synonym of it, e.g. 'euclidean' if the `metric` parameter set to + 'minkowski' and `p` parameter set to 2. + + effective_metric_params_ : dict + Additional keyword arguments for the metric function. For most metrics + will be same with `metric_params` parameter, but may also contain the + `p` parameter value if the `effective_metric_` attribute is set to + 'minkowski'. + + n_features_in_ : int + Number of features seen during :term:`fit`. + + .. versionadded:: 0.24 + + feature_names_in_ : ndarray of shape (`n_features_in_`,) + Names of features seen during :term:`fit`. Defined only when `X` + has feature names that are all strings. + + .. versionadded:: 1.0 + + n_samples_fit_ : int + Number of samples in the fitted data. + + See Also + -------- + kneighbors_graph : Compute the weighted graph of k-neighbors for + points in X. + KNeighborsTransformer : Transform X into a weighted graph of k + nearest neighbors. + + Examples + -------- + >>> import numpy as np + >>> from sklearn.datasets import load_wine + >>> from sklearn.cluster import DBSCAN + >>> from sklearn.neighbors import RadiusNeighborsTransformer + >>> from sklearn.pipeline import make_pipeline + >>> X, _ = load_wine(return_X_y=True) + >>> estimator = make_pipeline( + ... RadiusNeighborsTransformer(radius=42.0, mode='distance'), + ... DBSCAN(eps=25.0, metric='precomputed')) + >>> X_clustered = estimator.fit_predict(X) + >>> clusters, counts = np.unique(X_clustered, return_counts=True) + >>> print(counts) + [ 29 15 111 11 12] + """ + + _parameter_constraints: dict = { + **NeighborsBase._parameter_constraints, + "mode": [StrOptions({"distance", "connectivity"})], + } + _parameter_constraints.pop("n_neighbors") + + def __init__( + self, + *, + mode="distance", + radius=1.0, + algorithm="auto", + leaf_size=30, + metric="minkowski", + p=2, + metric_params=None, + n_jobs=None, + ): + super().__init__( + n_neighbors=None, + radius=radius, + algorithm=algorithm, + leaf_size=leaf_size, + metric=metric, + p=p, + metric_params=metric_params, + n_jobs=n_jobs, + ) + self.mode = mode + + @_fit_context( + # RadiusNeighborsTransformer.metric is not validated yet + prefer_skip_nested_validation=False + ) + def fit(self, X, y=None): + """Fit the radius neighbors transformer from the training dataset. + + Parameters + ---------- + X : {array-like, sparse matrix} of shape (n_samples, n_features) or \ + (n_samples, n_samples) if metric='precomputed' + Training data. + + y : Ignored + Not used, present for API consistency by convention. + + Returns + ------- + self : RadiusNeighborsTransformer + The fitted radius neighbors transformer. + """ + self._fit(X) + self._n_features_out = self.n_samples_fit_ + return self + + def transform(self, X): + """Compute the (weighted) graph of Neighbors for points in X. + + Parameters + ---------- + X : array-like of shape (n_samples_transform, n_features) + Sample data. + + Returns + ------- + Xt : sparse matrix of shape (n_samples_transform, n_samples_fit) + Xt[i, j] is assigned the weight of edge that connects i to j. + Only the neighbors have an explicit value. + The diagonal is always explicit. + The matrix is of CSR format. + """ + check_is_fitted(self) + return self.radius_neighbors_graph(X, mode=self.mode, sort_results=True) + + def fit_transform(self, X, y=None): + """Fit to data, then transform it. + + Fits transformer to X and y with optional parameters fit_params + and returns a transformed version of X. + + Parameters + ---------- + X : array-like of shape (n_samples, n_features) + Training set. + + y : Ignored + Not used, present for API consistency by convention. + + Returns + ------- + Xt : sparse matrix of shape (n_samples, n_samples) + Xt[i, j] is assigned the weight of edge that connects i to j. + Only the neighbors have an explicit value. + The diagonal is always explicit. + The matrix is of CSR format. + """ + return self.fit(X).transform(X) diff --git a/shared/package-files/4a/4af8c620a65ac18ca8b736dbc29c29702edf57e9d944d943c1186ad402f6010d/test_decompositions.py b/shared/package-files/4a/4af8c620a65ac18ca8b736dbc29c29702edf57e9d944d943c1186ad402f6010d/test_decompositions.py new file mode 100644 index 0000000000000000000000000000000000000000..b4f1ed92f4dd49777a7063b2b4c1e1afd49965b6 --- /dev/null +++ b/shared/package-files/4a/4af8c620a65ac18ca8b736dbc29c29702edf57e9d944d943c1186ad402f6010d/test_decompositions.py @@ -0,0 +1,474 @@ +from sympy.core.function import expand_mul +from sympy.core.numbers import I, Rational +from sympy.core.singleton import S +from sympy.core.symbol import Symbol +from sympy.functions.elementary.miscellaneous import sqrt +from sympy.functions.elementary.complexes import Abs +from sympy.simplify.simplify import simplify +from sympy.matrices.matrices import NonSquareMatrixError +from sympy.matrices import Matrix, zeros, eye, SparseMatrix +from sympy.abc import x, y, z +from sympy.testing.pytest import raises, slow +from sympy.testing.matrices import allclose + + +def test_LUdecomp(): + testmat = Matrix([[0, 2, 5, 3], + [3, 3, 7, 4], + [8, 4, 0, 2], + [-2, 6, 3, 4]]) + L, U, p = testmat.LUdecomposition() + assert L.is_lower + assert U.is_upper + assert (L*U).permute_rows(p, 'backward') - testmat == zeros(4) + + testmat = Matrix([[6, -2, 7, 4], + [0, 3, 6, 7], + [1, -2, 7, 4], + [-9, 2, 6, 3]]) + L, U, p = testmat.LUdecomposition() + assert L.is_lower + assert U.is_upper + assert (L*U).permute_rows(p, 'backward') - testmat == zeros(4) + + # non-square + testmat = Matrix([[1, 2, 3], + [4, 5, 6], + [7, 8, 9], + [10, 11, 12]]) + L, U, p = testmat.LUdecomposition(rankcheck=False) + assert L.is_lower + assert U.is_upper + assert (L*U).permute_rows(p, 'backward') - testmat == zeros(4, 3) + + # square and singular + testmat = Matrix([[1, 2, 3], + [2, 4, 6], + [4, 5, 6]]) + L, U, p = testmat.LUdecomposition(rankcheck=False) + assert L.is_lower + assert U.is_upper + assert (L*U).permute_rows(p, 'backward') - testmat == zeros(3) + + M = Matrix(((1, x, 1), (2, y, 0), (y, 0, z))) + L, U, p = M.LUdecomposition() + assert L.is_lower + assert U.is_upper + assert (L*U).permute_rows(p, 'backward') - M == zeros(3) + + mL = Matrix(( + (1, 0, 0), + (2, 3, 0), + )) + assert mL.is_lower is True + assert mL.is_upper is False + mU = Matrix(( + (1, 2, 3), + (0, 4, 5), + )) + assert mU.is_lower is False + assert mU.is_upper is True + + # test FF LUdecomp + M = Matrix([[1, 3, 3], + [3, 2, 6], + [3, 2, 2]]) + P, L, Dee, U = M.LUdecompositionFF() + assert P*M == L*Dee.inv()*U + + M = Matrix([[1, 2, 3, 4], + [3, -1, 2, 3], + [3, 1, 3, -2], + [6, -1, 0, 2]]) + P, L, Dee, U = M.LUdecompositionFF() + assert P*M == L*Dee.inv()*U + + M = Matrix([[0, 0, 1], + [2, 3, 0], + [3, 1, 4]]) + P, L, Dee, U = M.LUdecompositionFF() + assert P*M == L*Dee.inv()*U + + # issue 15794 + M = Matrix( + [[1, 2, 3], + [4, 5, 6], + [7, 8, 9]] + ) + raises(ValueError, lambda : M.LUdecomposition_Simple(rankcheck=True)) + +def test_singular_value_decompositionD(): + A = Matrix([[1, 2], [2, 1]]) + U, S, V = A.singular_value_decomposition() + assert U * S * V.T == A + assert U.T * U == eye(U.cols) + assert V.T * V == eye(V.cols) + + B = Matrix([[1, 2]]) + U, S, V = B.singular_value_decomposition() + + assert U * S * V.T == B + assert U.T * U == eye(U.cols) + assert V.T * V == eye(V.cols) + + C = Matrix([ + [1, 0, 0, 0, 2], + [0, 0, 3, 0, 0], + [0, 0, 0, 0, 0], + [0, 2, 0, 0, 0], + ]) + + U, S, V = C.singular_value_decomposition() + + assert U * S * V.T == C + assert U.T * U == eye(U.cols) + assert V.T * V == eye(V.cols) + + D = Matrix([[Rational(1, 3), sqrt(2)], [0, Rational(1, 4)]]) + U, S, V = D.singular_value_decomposition() + assert simplify(U.T * U) == eye(U.cols) + assert simplify(V.T * V) == eye(V.cols) + assert simplify(U * S * V.T) == D + + +def test_QR(): + A = Matrix([[1, 2], [2, 3]]) + Q, S = A.QRdecomposition() + R = Rational + assert Q == Matrix([ + [ 5**R(-1, 2), (R(2)/5)*(R(1)/5)**R(-1, 2)], + [2*5**R(-1, 2), (-R(1)/5)*(R(1)/5)**R(-1, 2)]]) + assert S == Matrix([[5**R(1, 2), 8*5**R(-1, 2)], [0, (R(1)/5)**R(1, 2)]]) + assert Q*S == A + assert Q.T * Q == eye(2) + + A = Matrix([[1, 1, 1], [1, 1, 3], [2, 3, 4]]) + Q, R = A.QRdecomposition() + assert Q.T * Q == eye(Q.cols) + assert R.is_upper + assert A == Q*R + + A = Matrix([[12, 0, -51], [6, 0, 167], [-4, 0, 24]]) + Q, R = A.QRdecomposition() + assert Q.T * Q == eye(Q.cols) + assert R.is_upper + assert A == Q*R + + x = Symbol('x') + A = Matrix([x]) + Q, R = A.QRdecomposition() + assert Q == Matrix([x / Abs(x)]) + assert R == Matrix([Abs(x)]) + + A = Matrix([[x, 0], [0, x]]) + Q, R = A.QRdecomposition() + assert Q == x / Abs(x) * Matrix([[1, 0], [0, 1]]) + assert R == Abs(x) * Matrix([[1, 0], [0, 1]]) + + +def test_QR_non_square(): + # Narrow (cols < rows) matrices + A = Matrix([[9, 0, 26], [12, 0, -7], [0, 4, 4], [0, -3, -3]]) + Q, R = A.QRdecomposition() + assert Q.T * Q == eye(Q.cols) + assert R.is_upper + assert A == Q*R + + A = Matrix([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]]) + Q, R = A.QRdecomposition() + assert Q.T * Q == eye(Q.cols) + assert R.is_upper + assert A == Q*R + + A = Matrix(2, 1, [1, 2]) + Q, R = A.QRdecomposition() + assert Q.T * Q == eye(Q.cols) + assert R.is_upper + assert A == Q*R + + # Wide (cols > rows) matrices + A = Matrix([[1, 2, 3], [4, 5, 6]]) + Q, R = A.QRdecomposition() + assert Q.T * Q == eye(Q.cols) + assert R.is_upper + assert A == Q*R + + A = Matrix([[1, 2, 3, 4], [1, 4, 9, 16], [1, 8, 27, 64]]) + Q, R = A.QRdecomposition() + assert Q.T * Q == eye(Q.cols) + assert R.is_upper + assert A == Q*R + + A = Matrix(1, 2, [1, 2]) + Q, R = A.QRdecomposition() + assert Q.T * Q == eye(Q.cols) + assert R.is_upper + assert A == Q*R + +def test_QR_trivial(): + # Rank deficient matrices + A = Matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) + Q, R = A.QRdecomposition() + assert Q.T * Q == eye(Q.cols) + assert R.is_upper + assert A == Q*R + + A = Matrix([[1, 1, 1], [2, 2, 2], [3, 3, 3], [4, 4, 4]]) + Q, R = A.QRdecomposition() + assert Q.T * Q == eye(Q.cols) + assert R.is_upper + assert A == Q*R + + A = Matrix([[1, 1, 1], [2, 2, 2], [3, 3, 3], [4, 4, 4]]).T + Q, R = A.QRdecomposition() + assert Q.T * Q == eye(Q.cols) + assert R.is_upper + assert A == Q*R + + # Zero rank matrices + A = Matrix([[0, 0, 0]]) + Q, R = A.QRdecomposition() + assert Q.T * Q == eye(Q.cols) + assert R.is_upper + assert A == Q*R + + A = Matrix([[0, 0, 0]]).T + Q, R = A.QRdecomposition() + assert Q.T * Q == eye(Q.cols) + assert R.is_upper + assert A == Q*R + + A = Matrix([[0, 0, 0], [0, 0, 0]]) + Q, R = A.QRdecomposition() + assert Q.T * Q == eye(Q.cols) + assert R.is_upper + assert A == Q*R + + A = Matrix([[0, 0, 0], [0, 0, 0]]).T + Q, R = A.QRdecomposition() + assert Q.T * Q == eye(Q.cols) + assert R.is_upper + assert A == Q*R + + # Rank deficient matrices with zero norm from beginning columns + A = Matrix([[0, 0, 0], [1, 2, 3]]).T + Q, R = A.QRdecomposition() + assert Q.T * Q == eye(Q.cols) + assert R.is_upper + assert A == Q*R + + A = Matrix([[0, 0, 0, 0], [1, 2, 3, 4], [0, 0, 0, 0]]).T + Q, R = A.QRdecomposition() + assert Q.T * Q == eye(Q.cols) + assert R.is_upper + assert A == Q*R + + A = Matrix([[0, 0, 0, 0], [1, 2, 3, 4], [0, 0, 0, 0], [2, 4, 6, 8]]).T + Q, R = A.QRdecomposition() + assert Q.T * Q == eye(Q.cols) + assert R.is_upper + assert A == Q*R + + A = Matrix([[0, 0, 0], [0, 0, 0], [0, 0, 0], [1, 2, 3]]).T + Q, R = A.QRdecomposition() + assert Q.T * Q == eye(Q.cols) + assert R.is_upper + assert A == Q*R + + +def test_QR_float(): + A = Matrix([[1, 1], [1, 1.01]]) + Q, R = A.QRdecomposition() + assert allclose(Q * R, A) + assert allclose(Q * Q.T, Matrix.eye(2)) + assert allclose(Q.T * Q, Matrix.eye(2)) + + A = Matrix([[1, 1], [1, 1.001]]) + Q, R = A.QRdecomposition() + assert allclose(Q * R, A) + assert allclose(Q * Q.T, Matrix.eye(2)) + assert allclose(Q.T * Q, Matrix.eye(2)) + + +def test_LUdecomposition_Simple_iszerofunc(): + # Test if callable passed to matrices.LUdecomposition_Simple() as iszerofunc keyword argument is used inside + # matrices.LUdecomposition_Simple() + magic_string = "I got passed in!" + def goofyiszero(value): + raise ValueError(magic_string) + + try: + lu, p = Matrix([[1, 0], [0, 1]]).LUdecomposition_Simple(iszerofunc=goofyiszero) + except ValueError as err: + assert magic_string == err.args[0] + return + + assert False + +def test_LUdecomposition_iszerofunc(): + # Test if callable passed to matrices.LUdecomposition() as iszerofunc keyword argument is used inside + # matrices.LUdecomposition_Simple() + magic_string = "I got passed in!" + def goofyiszero(value): + raise ValueError(magic_string) + + try: + l, u, p = Matrix([[1, 0], [0, 1]]).LUdecomposition(iszerofunc=goofyiszero) + except ValueError as err: + assert magic_string == err.args[0] + return + + assert False + +def test_LDLdecomposition(): + raises(NonSquareMatrixError, lambda: Matrix((1, 2)).LDLdecomposition()) + raises(ValueError, lambda: Matrix(((1, 2), (3, 4))).LDLdecomposition()) + raises(ValueError, lambda: Matrix(((5 + I, 0), (0, 1))).LDLdecomposition()) + raises(ValueError, lambda: Matrix(((1, 5), (5, 1))).LDLdecomposition()) + raises(ValueError, lambda: Matrix(((1, 2), (3, 4))).LDLdecomposition(hermitian=False)) + A = Matrix(((1, 5), (5, 1))) + L, D = A.LDLdecomposition(hermitian=False) + assert L * D * L.T == A + A = Matrix(((25, 15, -5), (15, 18, 0), (-5, 0, 11))) + L, D = A.LDLdecomposition() + assert L * D * L.T == A + assert L.is_lower + assert L == Matrix([[1, 0, 0], [ Rational(3, 5), 1, 0], [Rational(-1, 5), Rational(1, 3), 1]]) + assert D.is_diagonal() + assert D == Matrix([[25, 0, 0], [0, 9, 0], [0, 0, 9]]) + A = Matrix(((4, -2*I, 2 + 2*I), (2*I, 2, -1 + I), (2 - 2*I, -1 - I, 11))) + L, D = A.LDLdecomposition() + assert expand_mul(L * D * L.H) == A + assert L.expand() == Matrix([[1, 0, 0], [I/2, 1, 0], [S.Half - I/2, 0, 1]]) + assert D.expand() == Matrix(((4, 0, 0), (0, 1, 0), (0, 0, 9))) + + raises(NonSquareMatrixError, lambda: SparseMatrix((1, 2)).LDLdecomposition()) + raises(ValueError, lambda: SparseMatrix(((1, 2), (3, 4))).LDLdecomposition()) + raises(ValueError, lambda: SparseMatrix(((5 + I, 0), (0, 1))).LDLdecomposition()) + raises(ValueError, lambda: SparseMatrix(((1, 5), (5, 1))).LDLdecomposition()) + raises(ValueError, lambda: SparseMatrix(((1, 2), (3, 4))).LDLdecomposition(hermitian=False)) + A = SparseMatrix(((1, 5), (5, 1))) + L, D = A.LDLdecomposition(hermitian=False) + assert L * D * L.T == A + A = SparseMatrix(((25, 15, -5), (15, 18, 0), (-5, 0, 11))) + L, D = A.LDLdecomposition() + assert L * D * L.T == A + assert L.is_lower + assert L == Matrix([[1, 0, 0], [ Rational(3, 5), 1, 0], [Rational(-1, 5), Rational(1, 3), 1]]) + assert D.is_diagonal() + assert D == Matrix([[25, 0, 0], [0, 9, 0], [0, 0, 9]]) + A = SparseMatrix(((4, -2*I, 2 + 2*I), (2*I, 2, -1 + I), (2 - 2*I, -1 - I, 11))) + L, D = A.LDLdecomposition() + assert expand_mul(L * D * L.H) == A + assert L == Matrix(((1, 0, 0), (I/2, 1, 0), (S.Half - I/2, 0, 1))) + assert D == Matrix(((4, 0, 0), (0, 1, 0), (0, 0, 9))) + +def test_pinv_succeeds_with_rank_decomposition_method(): + # Test rank decomposition method of pseudoinverse succeeding + As = [Matrix([ + [61, 89, 55, 20, 71, 0], + [62, 96, 85, 85, 16, 0], + [69, 56, 17, 4, 54, 0], + [10, 54, 91, 41, 71, 0], + [ 7, 30, 10, 48, 90, 0], + [0,0,0,0,0,0]])] + for A in As: + A_pinv = A.pinv(method="RD") + AAp = A * A_pinv + ApA = A_pinv * A + assert simplify(AAp * A) == A + assert simplify(ApA * A_pinv) == A_pinv + assert AAp.H == AAp + assert ApA.H == ApA + +def test_rank_decomposition(): + a = Matrix(0, 0, []) + c, f = a.rank_decomposition() + assert f.is_echelon + assert c.cols == f.rows == a.rank() + assert c * f == a + + a = Matrix(1, 1, [5]) + c, f = a.rank_decomposition() + assert f.is_echelon + assert c.cols == f.rows == a.rank() + assert c * f == a + + a = Matrix(3, 3, [1, 2, 3, 1, 2, 3, 1, 2, 3]) + c, f = a.rank_decomposition() + assert f.is_echelon + assert c.cols == f.rows == a.rank() + assert c * f == a + + a = Matrix([ + [0, 0, 1, 2, 2, -5, 3], + [-1, 5, 2, 2, 1, -7, 5], + [0, 0, -2, -3, -3, 8, -5], + [-1, 5, 0, -1, -2, 1, 0]]) + c, f = a.rank_decomposition() + assert f.is_echelon + assert c.cols == f.rows == a.rank() + assert c * f == a + + +@slow +def test_upper_hessenberg_decomposition(): + A = Matrix([ + [1, 0, sqrt(3)], + [sqrt(2), Rational(1, 2), 2], + [1, Rational(1, 4), 3], + ]) + H, P = A.upper_hessenberg_decomposition() + assert simplify(P * P.H) == eye(P.cols) + assert simplify(P.H * P) == eye(P.cols) + assert H.is_upper_hessenberg + assert (simplify(P * H * P.H)) == A + + + B = Matrix([ + [1, 2, 10], + [8, 2, 5], + [3, 12, 34], + ]) + H, P = B.upper_hessenberg_decomposition() + assert simplify(P * P.H) == eye(P.cols) + assert simplify(P.H * P) == eye(P.cols) + assert H.is_upper_hessenberg + assert simplify(P * H * P.H) == B + + C = Matrix([ + [1, sqrt(2), 2, 3], + [0, 5, 3, 4], + [1, 1, 4, sqrt(5)], + [0, 2, 2, 3] + ]) + + H, P = C.upper_hessenberg_decomposition() + assert simplify(P * P.H) == eye(P.cols) + assert simplify(P.H * P) == eye(P.cols) + assert H.is_upper_hessenberg + assert simplify(P * H * P.H) == C + + D = Matrix([ + [1, 2, 3], + [-3, 5, 6], + [4, -8, 9], + ]) + H, P = D.upper_hessenberg_decomposition() + assert simplify(P * P.H) == eye(P.cols) + assert simplify(P.H * P) == eye(P.cols) + assert H.is_upper_hessenberg + assert simplify(P * H * P.H) == D + + E = Matrix([ + [1, 0, 0, 0], + [0, 1, 0, 0], + [1, 1, 0, 1], + [1, 1, 1, 0] + ]) + + H, P = E.upper_hessenberg_decomposition() + assert simplify(P * P.H) == eye(P.cols) + assert simplify(P.H * P) == eye(P.cols) + assert H.is_upper_hessenberg + assert simplify(P * H * P.H) == E diff --git a/shared/package-files/4a/4afa91b12160706c64143652fa4ba5e41fa68bc1b120d4d2f7cb94cc0cb8761c/test_optimization.py b/shared/package-files/4a/4afa91b12160706c64143652fa4ba5e41fa68bc1b120d4d2f7cb94cc0cb8761c/test_optimization.py new file mode 100644 index 0000000000000000000000000000000000000000..812b1cfa35e658d4f730a5b22b1caa3cc4bab9b9 --- /dev/null +++ b/shared/package-files/4a/4afa91b12160706c64143652fa4ba5e41fa68bc1b120d4d2f7cb94cc0cb8761c/test_optimization.py @@ -0,0 +1,86 @@ +import numpy as np + +from numba.cuda.testing import skip_on_cudasim, CUDATestCase +from numba import cuda, float64 +import unittest + + +def kernel_func(x): + x[0] = 1 + + +def device_func(x, y, z): + return x * y + z + + +# Fragments of code that are removed from kernel_func's PTX when optimization +# is on +removed_by_opt = ( '__local_depot0', 'call.uni', 'st.param.b64') + + +@skip_on_cudasim('Simulator does not optimize code') +class TestOptimization(CUDATestCase): + def test_eager_opt(self): + # Optimization should occur by default + sig = (float64[::1],) + kernel = cuda.jit(sig)(kernel_func) + ptx = kernel.inspect_asm() + + for fragment in removed_by_opt: + with self.subTest(fragment=fragment): + self.assertNotIn(fragment, ptx[sig]) + + def test_eager_noopt(self): + # Optimization disabled + sig = (float64[::1],) + kernel = cuda.jit(sig, opt=False)(kernel_func) + ptx = kernel.inspect_asm() + + for fragment in removed_by_opt: + with self.subTest(fragment=fragment): + self.assertIn(fragment, ptx[sig]) + + def test_lazy_opt(self): + # Optimization should occur by default + kernel = cuda.jit(kernel_func) + x = np.zeros(1, dtype=np.float64) + kernel[1, 1](x) + + # Grab the PTX for the one definition that has just been jitted + ptx = next(iter(kernel.inspect_asm().items()))[1] + + for fragment in removed_by_opt: + with self.subTest(fragment=fragment): + self.assertNotIn(fragment, ptx) + + def test_lazy_noopt(self): + # Optimization disabled + kernel = cuda.jit(opt=False)(kernel_func) + x = np.zeros(1, dtype=np.float64) + kernel[1, 1](x) + + # Grab the PTX for the one definition that has just been jitted + ptx = next(iter(kernel.inspect_asm().items()))[1] + + for fragment in removed_by_opt: + with self.subTest(fragment=fragment): + self.assertIn(fragment, ptx) + + def test_device_opt(self): + # Optimization should occur by default + sig = (float64, float64, float64) + device = cuda.jit(sig, device=True)(device_func) + ptx = device.inspect_asm(sig) + self.assertIn('fma.rn.f64', ptx) + + def test_device_noopt(self): + # Optimization disabled + sig = (float64, float64, float64) + device = cuda.jit(sig, device=True, opt=False)(device_func) + ptx = device.inspect_asm(sig) + # Fused-multiply adds should be disabled when not optimizing + self.assertNotIn('fma.rn.f64', ptx) + + +if __name__ == '__main__': + unittest.main() diff --git a/shared/package-files/4a/4afeed0690a73b32274f3f6756165ea3a59acf86eb5f53ed4b9d462b340dc0e5/upload.pyi b/shared/package-files/4a/4afeed0690a73b32274f3f6756165ea3a59acf86eb5f53ed4b9d462b340dc0e5/upload.pyi new file mode 100644 index 0000000000000000000000000000000000000000..c49a4e5b4937a59771d260f9ca869bedcd956418 --- /dev/null +++ b/shared/package-files/4a/4afeed0690a73b32274f3f6756165ea3a59acf86eb5f53ed4b9d462b340dc0e5/upload.pyi @@ -0,0 +1,8 @@ +from distutils.config import PyPIRCCommand +from typing import ClassVar, List, Optional, Tuple + +class upload(PyPIRCCommand): + description: ClassVar[str] + boolean_options: ClassVar[List[str]] + def run(self) -> None: ... + def upload_file(self, command, pyversion, filename) -> None: ... diff --git a/shared/package-files/4a/4aff3860b1fd5db95e04ad744417985bdaf983b7e513e5a133544fb8eecc402d/_chunk_cat_compositeexplicitautograd_dispatch.h b/shared/package-files/4a/4aff3860b1fd5db95e04ad744417985bdaf983b7e513e5a133544fb8eecc402d/_chunk_cat_compositeexplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..5076f49f7a7e14d8f819fa9907700abc520b9110 --- /dev/null +++ b/shared/package-files/4a/4aff3860b1fd5db95e04ad744417985bdaf983b7e513e5a133544fb8eecc402d/_chunk_cat_compositeexplicitautograd_dispatch.h @@ -0,0 +1,25 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API at::Tensor _chunk_cat(at::TensorList tensors, int64_t dim, int64_t num_chunks); +TORCH_API at::Tensor & _chunk_cat_out(at::Tensor & out, at::TensorList tensors, int64_t dim, int64_t num_chunks); +TORCH_API at::Tensor & _chunk_cat_outf(at::TensorList tensors, int64_t dim, int64_t num_chunks, at::Tensor & out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/75/750007a61b9a86c49e4ee516cc31667b7c969861748dee48a2d81cd32b8da07e/_amp_foreach_non_finite_check_and_unscale_cuda_dispatch.h b/shared/package-files/75/750007a61b9a86c49e4ee516cc31667b7c969861748dee48a2d81cd32b8da07e/_amp_foreach_non_finite_check_and_unscale_cuda_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..ecaf86eabb9f71f018ff84639425431ad905566e --- /dev/null +++ b/shared/package-files/75/750007a61b9a86c49e4ee516cc31667b7c969861748dee48a2d81cd32b8da07e/_amp_foreach_non_finite_check_and_unscale_cuda_dispatch.h @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API void _amp_foreach_non_finite_check_and_unscale_(at::TensorList self, at::Tensor & found_inf, const at::Tensor & inv_scale); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/75/7501011389a364fb724632972ba67e6cc1c9745aa9c21233c431f8c74e2b2989/Montevideo b/shared/package-files/75/7501011389a364fb724632972ba67e6cc1c9745aa9c21233c431f8c74e2b2989/Montevideo new file mode 100644 index 0000000000000000000000000000000000000000..e7bbfbb8c332fee14ae1b4aa07cc4d128e6a3ca7 Binary files /dev/null and b/shared/package-files/75/7501011389a364fb724632972ba67e6cc1c9745aa9c21233c431f8c74e2b2989/Montevideo differ diff --git a/shared/package-files/75/7502587d52e7810228f2ecb45ac4319ea0f5c008b7ac91053b920010dc6ddf94/shiftjis.enc b/shared/package-files/75/7502587d52e7810228f2ecb45ac4319ea0f5c008b7ac91053b920010dc6ddf94/shiftjis.enc new file mode 100644 index 0000000000000000000000000000000000000000..140aec4c15169a946ae9f4d8d133c930e417e804 --- /dev/null +++ b/shared/package-files/75/7502587d52e7810228f2ecb45ac4319ea0f5c008b7ac91053b920010dc6ddf94/shiftjis.enc @@ -0,0 +1,690 @@ +# Encoding file: shiftjis, multi-byte +M +003F 0 40 +00 +0000000100020003000400050006000700080009000A000B000C000D000E000F +0010001100120013001400150016001700180019001A001B001C001D001E001F +0020002100220023002400250026002700280029002A002B002C002D002E002F +0030003100320033003400350036003700380039003A003B003C003D003E003F +0040004100420043004400450046004700480049004A004B004C004D004E004F +0050005100520053005400550056005700580059005A005B005C005D005E005F +0060006100620063006400650066006700680069006A006B006C006D006E006F +0070007100720073007400750076007700780079007A007B007C007D007E007F +0080000000000000000000850086008700000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000FF61FF62FF63FF64FF65FF66FF67FF68FF69FF6AFF6BFF6CFF6DFF6EFF6F +FF70FF71FF72FF73FF74FF75FF76FF77FF78FF79FF7AFF7BFF7CFF7DFF7EFF7F +FF80FF81FF82FF83FF84FF85FF86FF87FF88FF89FF8AFF8BFF8CFF8DFF8EFF8F +FF90FF91FF92FF93FF94FF95FF96FF97FF98FF99FF9AFF9BFF9CFF9DFF9EFF9F +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +81 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +300030013002FF0CFF0E30FBFF1AFF1BFF1FFF01309B309C00B4FF4000A8FF3E +FFE3FF3F30FD30FE309D309E30034EDD30053006300730FC20152010FF0FFF3C +301C2016FF5C2026202520182019201C201DFF08FF0930143015FF3BFF3DFF5B +FF5D30083009300A300B300C300D300E300F30103011FF0B221200B100D70000 +00F7FF1D2260FF1CFF1E22662267221E22342642264000B0203220332103FFE5 +FF0400A200A3FF05FF03FF06FF0AFF2000A72606260525CB25CF25CE25C725C6 +25A125A025B325B225BD25BC203B301221922190219121933013000000000000 +000000000000000000000000000000002208220B2286228722822283222A2229 +000000000000000000000000000000002227222800AC21D221D4220022030000 +0000000000000000000000000000000000000000222022A52312220222072261 +2252226A226B221A223D221D2235222B222C0000000000000000000000000000 +212B2030266F266D266A2020202100B6000000000000000025EF000000000000 +82 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000FF10 +FF11FF12FF13FF14FF15FF16FF17FF18FF190000000000000000000000000000 +FF21FF22FF23FF24FF25FF26FF27FF28FF29FF2AFF2BFF2CFF2DFF2EFF2FFF30 +FF31FF32FF33FF34FF35FF36FF37FF38FF39FF3A000000000000000000000000 +0000FF41FF42FF43FF44FF45FF46FF47FF48FF49FF4AFF4BFF4CFF4DFF4EFF4F +FF50FF51FF52FF53FF54FF55FF56FF57FF58FF59FF5A00000000000000003041 +30423043304430453046304730483049304A304B304C304D304E304F30503051 +30523053305430553056305730583059305A305B305C305D305E305F30603061 +30623063306430653066306730683069306A306B306C306D306E306F30703071 +30723073307430753076307730783079307A307B307C307D307E307F30803081 +30823083308430853086308730883089308A308B308C308D308E308F30903091 +3092309300000000000000000000000000000000000000000000000000000000 +83 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +30A130A230A330A430A530A630A730A830A930AA30AB30AC30AD30AE30AF30B0 +30B130B230B330B430B530B630B730B830B930BA30BB30BC30BD30BE30BF30C0 +30C130C230C330C430C530C630C730C830C930CA30CB30CC30CD30CE30CF30D0 +30D130D230D330D430D530D630D730D830D930DA30DB30DC30DD30DE30DF0000 +30E030E130E230E330E430E530E630E730E830E930EA30EB30EC30ED30EE30EF +30F030F130F230F330F430F530F6000000000000000000000000000000000391 +03920393039403950396039703980399039A039B039C039D039E039F03A003A1 +03A303A403A503A603A703A803A90000000000000000000000000000000003B1 +03B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF03C003C1 +03C303C403C503C603C703C803C9000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +84 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +04100411041204130414041504010416041704180419041A041B041C041D041E +041F0420042104220423042404250426042704280429042A042B042C042D042E +042F000000000000000000000000000000000000000000000000000000000000 +04300431043204330434043504510436043704380439043A043B043C043D0000 +043E043F0440044104420443044404450446044704480449044A044B044C044D +044E044F00000000000000000000000000000000000000000000000000002500 +2502250C251025182514251C252C25242534253C25012503250F2513251B2517 +25232533252B253B254B2520252F25282537253F251D25302525253825420000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +88 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000004E9C +55165A03963F54C0611B632859F690228475831C7A5060AA63E16E2565ED8466 +82A69BF56893572765A162715B9B59D0867B98F47D627DBE9B8E62167C9F88B7 +5B895EB563096697684895C7978D674F4EE54F0A4F4D4F9D504956F2593759D4 +5A015C0960DF610F61706613690570BA754F757079FB7DAD7DEF80C3840E8863 +8B029055907A533B4E954EA557DF80B290C178EF4E0058F16EA290387A328328 +828B9C2F5141537054BD54E156E059FB5F1598F26DEB80E4852D000000000000 +89 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +9662967096A097FB540B53F35B8770CF7FBD8FC296E8536F9D5C7ABA4E117893 +81FC6E26561855046B1D851A9C3B59E553A96D6674DC958F56424E91904B96F2 +834F990C53E155B65B305F71662066F368046C386CF36D29745B76C87A4E9834 +82F1885B8A6092ED6DB275AB76CA99C560A68B018D8A95B2698E53AD51860000 +5712583059445BB45EF6602863A963F46CBF6F14708E7114715971D5733F7E01 +827682D185979060925B9D1B586965BC6C5A752551F9592E59655F805FDC62BC +65FA6A2A6B276BB4738B7FC189569D2C9D0E9EC45CA16C96837B51045C4B61B6 +81C6687672614E594FFA537860696E297A4F97F34E0B53164EEE4F554F3D4FA1 +4F7352A053EF5609590F5AC15BB65BE179D16687679C67B66B4C6CB3706B73C2 +798D79BE7A3C7B8782B182DB8304837783EF83D387668AB256298CA88FE6904E +971E868A4FC45CE862117259753B81E582BD86FE8CC096C5991399D54ECB4F1A +89E356DE584A58CA5EFB5FEB602A6094606261D0621262D06539000000000000 +8A +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +9B41666668B06D777070754C76867D7582A587F9958B968E8C9D51F152BE5916 +54B35BB35D16616869826DAF788D84CB88578A7293A79AB86D6C99A886D957A3 +67FF86CE920E5283568754045ED362E164B9683C68386BBB737278BA7A6B899A +89D28D6B8F0390ED95A3969497695B665CB3697D984D984E639B7B206A2B0000 +6A7F68B69C0D6F5F5272559D607062EC6D3B6E076ED1845B89108F444E149C39 +53F6691B6A3A9784682A515C7AC384B291DC938C565B9D286822830584317CA5 +520882C574E64E7E4F8351A05BD2520A52D852E75DFB559A582A59E65B8C5B98 +5BDB5E725E7960A3611F616361BE63DB656267D1685368FA6B3E6B536C576F22 +6F976F4574B0751876E3770B7AFF7BA17C217DE97F367FF0809D8266839E89B3 +8ACC8CAB908494519593959195A2966597D3992882184E38542B5CB85DCC73A9 +764C773C5CA97FEB8D0B96C19811985498584F014F0E5371559C566857FA5947 +5B095BC45C905E0C5E7E5FCC63EE673A65D765E2671F68CB68C4000000000000 +8B +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +6A5F5E306BC56C176C7D757F79485B637A007D005FBD898F8A188CB48D778ECC +8F1D98E29A0E9B3C4E80507D510059935B9C622F628064EC6B3A72A075917947 +7FA987FB8ABC8B7063AC83CA97A05409540355AB68546A588A70782767759ECD +53745BA2811A865090064E184E454EC74F1153CA54385BAE5F13602565510000 +673D6C426C726CE3707874037A767AAE7B087D1A7CFE7D6665E7725B53BB5C45 +5DE862D262E063196E20865A8A318DDD92F86F0179A69B5A4EA84EAB4EAC4F9B +4FA050D151477AF6517151F653545321537F53EB55AC58835CE15F375F4A602F +6050606D631F65596A4B6CC172C272ED77EF80F881058208854E90F793E197FF +99579A5A4EF051DD5C2D6681696D5C4066F26975738968507C8150C552E45747 +5DFE932665A46B236B3D7434798179BD7B4B7DCA82B983CC887F895F8B398FD1 +91D1541F92804E5D503653E5533A72D7739677E982E68EAF99C699C899D25177 +611A865E55B07A7A50765BD3904796854E326ADB91E75C515C48000000000000 +8C +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +63987A9F6C9397748F617AAA718A96887C8268177E706851936C52F2541B85AB +8A137FA48ECD90E15366888879414FC250BE521151445553572D73EA578B5951 +5F625F8460756176616761A963B2643A656C666F68426E1375667A3D7CFB7D4C +7D997E4B7F6B830E834A86CD8A088A638B668EFD981A9D8F82B88FCE9BE80000 +5287621F64836FC09699684150916B206C7A6F547A747D5088408A2367084EF6 +503950265065517C5238526355A7570F58055ACC5EFA61B261F862F36372691C +6A29727D72AC732E7814786F7D79770C80A9898B8B198CE28ED290639375967A +98559A139E785143539F53B35E7B5F266E1B6E90738473FE7D4382378A008AFA +96504E4E500B53E4547C56FA59D15B645DF15EAB5F276238654567AF6E5672D0 +7CCA88B480A180E183F0864E8A878DE8923796C798679F134E944E924F0D5348 +5449543E5A2F5F8C5FA1609F68A76A8E745A78818A9E8AA48B7791904E5E9BC9 +4EA44F7C4FAF501950165149516C529F52B952FE539A53E35411000000000000 +8D +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +540E5589575157A2597D5B545B5D5B8F5DE55DE75DF75E785E835E9A5EB75F18 +6052614C629762D863A7653B6602664366F4676D6821689769CB6C5F6D2A6D69 +6E2F6E9D75327687786C7A3F7CE07D057D187D5E7DB18015800380AF80B18154 +818F822A8352884C88618B1B8CA28CFC90CA91759271783F92FC95A4964D0000 +980599999AD89D3B525B52AB53F7540858D562F76FE08C6A8F5F9EB9514B523B +544A56FD7A4091779D609ED273446F09817075115FFD60DA9AA872DB8FBC6B64 +98034ECA56F0576458BE5A5A606861C7660F6606683968B16DF775D57D3A826E +9B424E9B4F5053C955065D6F5DE65DEE67FB6C99747378028A50939688DF5750 +5EA7632B50B550AC518D670054C9585E59BB5BB05F69624D63A1683D6B736E08 +707D91C7728078157826796D658E7D3083DC88C18F09969B5264572867507F6A +8CA151B45742962A583A698A80B454B25D0E57FC78959DFA4F5C524A548B643E +6628671467F57A847B567D22932F685C9BAD7B395319518A5237000000000000 +8E +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +5BDF62F664AE64E6672D6BBA85A996D176909BD6634C93069BAB76BF66524E09 +509853C25C7160E864926563685F71E673CA75237B977E8286958B838CDB9178 +991065AC66AB6B8B4ED54ED44F3A4F7F523A53F853F255E356DB58EB59CB59C9 +59FF5B505C4D5E025E2B5FD7601D6307652F5B5C65AF65BD65E8679D6B620000 +6B7B6C0F7345794979C17CF87D197D2B80A2810281F389968A5E8A698A668A8C +8AEE8CC78CDC96CC98FC6B6F4E8B4F3C4F8D51505B575BFA6148630166426B21 +6ECB6CBB723E74BD75D478C1793A800C803381EA84948F9E6C509E7F5F0F8B58 +9D2B7AFA8EF85B8D96EB4E0353F157F759315AC95BA460896E7F6F0675BE8CEA +5B9F85007BE0507267F4829D5C61854A7E1E820E51995C0463688D66659C716E +793E7D1780058B1D8ECA906E86C790AA501F52FA5C3A6753707C7235914C91C8 +932B82E55BC25F3160F94E3B53D65B88624B67316B8A72E973E07A2E816B8DA3 +91529996511253D7546A5BFF63886A397DAC970056DA53CE5468000000000000 +8F +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +5B975C315DDE4FEE610162FE6D3279C079CB7D427E4D7FD281ED821F84908846 +89728B908E748F2F9031914B916C96C6919C4EC04F4F514553415F93620E67D4 +6C416E0B73637E2691CD928353D459195BBF6DD1795D7E2E7C9B587E719F51FA +88538FF04FCA5CFB662577AC7AE3821C99FF51C65FAA65EC696F6B896DF30000 +6E966F6476FE7D145DE190759187980651E6521D6240669166D96E1A5EB67DD2 +7F7266F885AF85F78AF852A953D959735E8F5F90605592E4966450B7511F52DD +5320534753EC54E8554655315617596859BE5A3C5BB55C065C0F5C115C1A5E84 +5E8A5EE05F70627F628462DB638C63776607660C662D6676677E68A26A1F6A35 +6CBC6D886E096E58713C7126716775C77701785D7901796579F07AE07B117CA7 +7D39809683D6848B8549885D88F38A1F8A3C8A548A738C618CDE91A49266937E +9418969C97984E0A4E084E1E4E575197527057CE583458CC5B225E3860C564FE +676167566D4472B675737A6384B88B7291B89320563157F498FE000000000000 +90 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +62ED690D6B9671ED7E548077827289E698DF87558FB15C3B4F384FE14FB55507 +5A205BDD5BE95FC3614E632F65B0664B68EE699B6D786DF1753375B9771F795E +79E67D3381E382AF85AA89AA8A3A8EAB8F9B903291DD97074EBA4EC152035875 +58EC5C0B751A5C3D814E8A0A8FC59663976D7B258ACF9808916256F353A80000 +9017543957825E2563A86C34708A77617C8B7FE088709042915493109318968F +745E9AC45D075D69657067A28DA896DB636E6749691983C5981796C088FE6F84 +647A5BF84E16702C755D662F51C4523652E259D35F8160276210653F6574661F +667468F268166B636E057272751F76DB7CBE805658F088FD897F8AA08A938ACB +901D91929752975965897A0E810696BB5E2D60DC621A65A56614679077F37A4D +7C4D7E3E810A8CAC8D648DE18E5F78A9520762D963A5644262988A2D7A837BC0 +8AAC96EA7D76820C87494ED95148534353605BA35C025C165DDD6226624764B0 +681368346CC96D456D1767D36F5C714E717D65CB7A7F7BAD7DDA000000000000 +91 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +7E4A7FA8817A821B823985A68A6E8CCE8DF59078907792AD929195839BAE524D +55846F387136516879857E5581B37CCE564C58515CA863AA66FE66FD695A72D9 +758F758E790E795679DF7C977D207D4486078A34963B90619F2050E7527553CC +53E2500955AA58EE594F723D5B8B5C64531D60E360F3635C6383633F63BB0000 +64CD65E966F95DE369CD69FD6F1571E54E8975E976F87A937CDF7DCF7D9C8061 +83498358846C84BC85FB88C58D709001906D9397971C9A1250CF5897618E81D3 +85358D0890204FC3507452475373606F6349675F6E2C8DB3901F4FD75C5E8CCA +65CF7D9A53528896517663C35B585B6B5C0A640D6751905C4ED6591A592A6C70 +8A51553E581559A560F0625367C182356955964099C49A284F5358065BFE8010 +5CB15E2F5F856020614B623466FF6CF06EDE80CE817F82D4888B8CB89000902E +968A9EDB9BDB4EE353F059277B2C918D984C9DF96EDD7027535355445B856258 +629E62D36CA26FEF74228A1794386FC18AFE833851E786F853EA000000000000 +92 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +53E94F4690548FB0596A81315DFD7AEA8FBF68DA8C3772F89C486A3D8AB04E39 +53585606576662C563A265E66B4E6DE16E5B70AD77ED7AEF7BAA7DBB803D80C6 +86CB8A95935B56E358C75F3E65AD66966A806BB575378AC7502477E557305F1B +6065667A6C6075F47A1A7F6E81F48718904599B37BC9755C7AF97B5184C40000 +901079E97A9283365AE177404E2D4EF25B995FE062BD663C67F16CE8866B8877 +8A3B914E92F399D06A177026732A82E784578CAF4E01514651CB558B5BF55E16 +5E335E815F145F355F6B5FB461F2631166A2671D6F6E7252753A773A80748139 +817887768ABF8ADC8D858DF3929A957798029CE552C5635776F467156C8873CD +8CC393AE96736D25589C690E69CC8FFD939A75DB901A585A680263B469FB4F43 +6F2C67D88FBB85267DB49354693F6F70576A58F75B2C7D2C722A540A91E39DB4 +4EAD4F4E505C507552438C9E544858245B9A5E1D5E955EAD5EF75F1F608C62B5 +633A63D068AF6C407887798E7A0B7DE082478A028AE68E449013000000000000 +93 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +90B8912D91D89F0E6CE5645864E265756EF476847B1B906993D16EBA54F25FB9 +64A48F4D8FED92445178586B59295C555E976DFB7E8F751C8CBC8EE2985B70B9 +4F1D6BBF6FB1753096FB514E54105835585759AC5C605F926597675C6E21767B +83DF8CED901490FD934D7825783A52AA5EA6571F597460125012515A51AC0000 +51CD520055105854585859575B955CF65D8B60BC6295642D6771684368BC68DF +76D76DD86E6F6D9B706F71C85F5375D879777B497B547B527CD67D7152308463 +856985E48A0E8B048C468E0F9003900F94199676982D9A3095D850CD52D5540C +58025C0E61A7649E6D1E77B37AE580F48404905392855CE09D07533F5F975FB3 +6D9C7279776379BF7BE46BD272EC8AAD68036A6151F87A8169345C4A9CF682EB +5BC59149701E56785C6F60C765666C8C8C5A90419813545166C7920D594890A3 +51854E4D51EA85998B0E7058637A934B696299B47E047577535769608EDF96E3 +6C5D4E8C5C3C5F108FE953028CD1808986795EFF65E54E735165000000000000 +94 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +59825C3F97EE4EFB598A5FCD8A8D6FE179B079625BE78471732B71B15E745FF5 +637B649A71C37C984E435EFC4E4B57DC56A260A96FC37D0D80FD813381BF8FB2 +899786A45DF4628A64AD898767776CE26D3E743678345A467F7582AD99AC4FF3 +5EC362DD63926557676F76C3724C80CC80BA8F29914D500D57F95A9268850000 +6973716472FD8CB758F28CE0966A9019877F79E477E784294F2F5265535A62CD +67CF6CCA767D7B947C95823685848FEB66DD6F2072067E1B83AB99C19EA651FD +7BB178727BB880877B486AE85E61808C75517560516B92626E8C767A91979AEA +4F107F70629C7B4F95A59CE9567A585986E496BC4F345224534A53CD53DB5E06 +642C6591677F6C3E6C4E724872AF73ED75547E41822C85E98CA97BC491C67169 +981298EF633D6669756A76E478D0854386EE532A5351542659835E875F7C60B2 +6249627962AB65906BD46CCC75B276AE789179D87DCB7F7780A588AB8AB98CBB +907F975E98DB6A0B7C3850995C3E5FAE67876BD8743577097F8E000000000000 +95 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +9F3B67CA7A175339758B9AED5F66819D83F180985F3C5FC575627B46903C6867 +59EB5A9B7D10767E8B2C4FF55F6A6A196C376F0274E2796888688A558C795EDF +63CF75C579D282D7932892F2849C86ED9C2D54C15F6C658C6D5C70158CA78CD3 +983B654F74F64E0D4ED857E0592B5A665BCC51A85E035E9C6016627665770000 +65A7666E6D6E72367B268150819A82998B5C8CA08CE68D74961C96444FAE64AB +6B66821E8461856A90E85C01695398A8847A85574F0F526F5FA95E45670D798F +8179890789866DF55F1762556CB84ECF72699B925206543B567458B361A4626E +711A596E7C897CDE7D1B96F06587805E4E194F75517558405E635E735F0A67C4 +4E26853D9589965B7C73980150FB58C1765678A7522577A585117B86504F5909 +72477BC77DE88FBA8FD4904D4FBF52C95A295F0197AD4FDD821792EA57036355 +6B69752B88DC8F147A4252DF58936155620A66AE6BCD7C3F83E950234FF85305 +5446583159495B9D5CF05CEF5D295E9662B16367653E65B9670B000000000000 +96 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +6CD56CE170F978327E2B80DE82B3840C84EC870289128A2A8C4A90A692D298FD +9CF39D6C4E4F4EA1508D5256574A59A85E3D5FD85FD9623F66B4671B67D068D2 +51927D2180AA81A88B008C8C8CBF927E96325420982C531750D5535C58A864B2 +6734726777667A4691E652C36CA16B8658005E4C5954672C7FFB51E176C60000 +646978E89B549EBB57CB59B96627679A6BCE54E969D95E55819C67959BAA67FE +9C52685D4EA64FE353C862B9672B6CAB8FC44FAD7E6D9EBF4E0761626E806F2B +85135473672A9B455DF37B955CAC5BC6871C6E4A84D17A14810859997C8D6C11 +772052D959227121725F77DB97279D61690B5A7F5A1851A5540D547D660E76DF +8FF792989CF459EA725D6EC5514D68C97DBF7DEC97629EBA64786A2183025984 +5B5F6BDB731B76F27DB280178499513267289ED976EE676252FF99055C24623B +7C7E8CB0554F60B67D0B958053014E5F51B6591C723A803691CE5F2577E25384 +5F797D0485AC8A338E8D975667F385AE9453610961086CB9765200000000FF5E +97 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +8AED8F38552F4F51512A52C753CB5BA55E7D60A0618263D6670967DA6E676D8C +733673377531795088D58A98904A909190F596C4878D59154E884F594E0E8A89 +8F3F981050AD5E7C59965BB95EB863DA63FA64C166DC694A69D86D0B6EB67194 +75287AAF7F8A8000844984C989818B218E0A9065967D990A617E62916B320000 +6C836D747FCC7FFC6DC07F8587BA88F8676583B1983C96F76D1B7D61843D916A +4E7153755D506B046FEB85CD862D89A75229540F5C65674E68A87406748375E2 +88CF88E191CC96E296785F8B73877ACB844E63A0756552896D416E9C74097559 +786B7C9296867ADC9F8D4FB6616E65C5865C4E864EAE50DA4E2151CC5BEE6599 +68816DBC731F764277AD7A1C7CE7826F8AD2907C91CF96759818529B7DD1502B +539867976DCB71D0743381E88F2A96A39C579E9F746058416D997D2F985E4EE4 +4F364F8B51B752B15DBA601C73B2793C82D3923496B796F6970A9E979F6266A6 +6B74521752A370C888C25EC9604B61906F2371497C3E7DF4806F000000000000 +98 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +84EE9023932C54429B6F6AD370898CC28DEF973252B45A415ECA5F046717697C +69946D6A6F0F726272FC7BED8001807E874B90CE516D9E937984808B93328AD6 +502D548C8A716B6A8CC4810760D167A09DF24E994E989C108A6B85C185686900 +6E7E789781550000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000005F0C +4E104E154E2A4E314E364E3C4E3F4E424E564E584E824E858C6B4E8A82125F0D +4E8E4E9E4E9F4EA04EA24EB04EB34EB64ECE4ECD4EC44EC64EC24ED74EDE4EED +4EDF4EF74F094F5A4F304F5B4F5D4F574F474F764F884F8F4F984F7B4F694F70 +4F914F6F4F864F9651184FD44FDF4FCE4FD84FDB4FD14FDA4FD04FE44FE5501A +50285014502A502550054F1C4FF650215029502C4FFE4FEF5011500650435047 +6703505550505048505A5056506C50785080509A508550B450B2000000000000 +99 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +50C950CA50B350C250D650DE50E550ED50E350EE50F950F55109510151025116 +51155114511A5121513A5137513C513B513F51405152514C515451627AF85169 +516A516E5180518256D8518C5189518F519151935195519651A451A651A251A9 +51AA51AB51B351B151B251B051B551BD51C551C951DB51E0865551E951ED0000 +51F051F551FE5204520B5214520E5227522A522E52335239524F5244524B524C +525E5254526A527452695273527F527D528D529452925271528852918FA88FA7 +52AC52AD52BC52B552C152CD52D752DE52E352E698ED52E052F352F552F852F9 +530653087538530D5310530F5315531A5323532F533153335338534053465345 +4E175349534D51D6535E5369536E5918537B53775382539653A053A653A553AE +53B053B653C37C1296D953DF66FC71EE53EE53E853ED53FA5401543D5440542C +542D543C542E54365429541D544E548F5475548E545F5471547754705492547B +5480547654845490548654C754A254B854A554AC54C454C854A8000000000000 +9A +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +54AB54C254A454BE54BC54D854E554E6550F551454FD54EE54ED54FA54E25539 +55405563554C552E555C55455556555755385533555D5599558054AF558A559F +557B557E5598559E55AE557C558355A9558755A855DA55C555DF55C455DC55E4 +55D4561455F7561655FE55FD561B55F9564E565071DF56345636563256380000 +566B5664562F566C566A56865680568A56A05694568F56A556AE56B656B456C2 +56BC56C156C356C056C856CE56D156D356D756EE56F9570056FF570457095708 +570B570D57135718571655C7571C572657375738574E573B5740574F576957C0 +57885761577F5789579357A057B357A457AA57B057C357C657D457D257D3580A +57D657E3580B5819581D587258215862584B58706BC05852583D5879588558B9 +589F58AB58BA58DE58BB58B858AE58C558D358D158D758D958D858E558DC58E4 +58DF58EF58FA58F958FB58FC58FD5902590A5910591B68A65925592C592D5932 +5938593E7AD259555950594E595A5958596259605967596C5969000000000000 +9B +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +59785981599D4F5E4FAB59A359B259C659E859DC598D59D959DA5A255A1F5A11 +5A1C5A095A1A5A405A6C5A495A355A365A625A6A5A9A5ABC5ABE5ACB5AC25ABD +5AE35AD75AE65AE95AD65AFA5AFB5B0C5B0B5B165B325AD05B2A5B365B3E5B43 +5B455B405B515B555B5A5B5B5B655B695B705B735B755B7865885B7A5B800000 +5B835BA65BB85BC35BC75BC95BD45BD05BE45BE65BE25BDE5BE55BEB5BF05BF6 +5BF35C055C075C085C0D5C135C205C225C285C385C395C415C465C4E5C535C50 +5C4F5B715C6C5C6E4E625C765C795C8C5C915C94599B5CAB5CBB5CB65CBC5CB7 +5CC55CBE5CC75CD95CE95CFD5CFA5CED5D8C5CEA5D0B5D155D175D5C5D1F5D1B +5D115D145D225D1A5D195D185D4C5D525D4E5D4B5D6C5D735D765D875D845D82 +5DA25D9D5DAC5DAE5DBD5D905DB75DBC5DC95DCD5DD35DD25DD65DDB5DEB5DF2 +5DF55E0B5E1A5E195E115E1B5E365E375E445E435E405E4E5E575E545E5F5E62 +5E645E475E755E765E7A9EBC5E7F5EA05EC15EC25EC85ED05ECF000000000000 +9C +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +5ED65EE35EDD5EDA5EDB5EE25EE15EE85EE95EEC5EF15EF35EF05EF45EF85EFE +5F035F095F5D5F5C5F0B5F115F165F295F2D5F385F415F485F4C5F4E5F2F5F51 +5F565F575F595F615F6D5F735F775F835F825F7F5F8A5F885F915F875F9E5F99 +5F985FA05FA85FAD5FBC5FD65FFB5FE45FF85FF15FDD60B35FFF602160600000 +601960106029600E6031601B6015602B6026600F603A605A6041606A6077605F +604A6046604D6063604360646042606C606B60596081608D60E76083609A6084 +609B60966097609260A7608B60E160B860E060D360B45FF060BD60C660B560D8 +614D6115610660F660F7610060F460FA6103612160FB60F1610D610E6147613E +61286127614A613F613C612C6134613D614261446173617761586159615A616B +6174616F61656171615F615D6153617561996196618761AC6194619A618A6191 +61AB61AE61CC61CA61C961F761C861C361C661BA61CB7F7961CD61E661E361F6 +61FA61F461FF61FD61FC61FE620062086209620D620C6214621B000000000000 +9D +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +621E6221622A622E6230623262336241624E625E6263625B62606268627C6282 +6289627E62926293629662D46283629462D762D162BB62CF62FF62C664D462C8 +62DC62CC62CA62C262C7629B62C9630C62EE62F163276302630862EF62F56350 +633E634D641C634F6396638E638063AB637663A3638F6389639F63B5636B0000 +636963BE63E963C063C663E363C963D263F663C4641664346406641364266436 +651D64176428640F6467646F6476644E652A6495649364A564A9648864BC64DA +64D264C564C764BB64D864C264F164E7820964E064E162AC64E364EF652C64F6 +64F464F264FA650064FD6518651C650565246523652B65346535653765366538 +754B654865566555654D6558655E655D65726578658265838B8A659B659F65AB +65B765C365C665C165C465CC65D265DB65D965E065E165F16772660A660365FB +6773663566366634661C664F664466496641665E665D666466676668665F6662 +667066836688668E668966846698669D66C166B966C966BE66BC000000000000 +9E +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +66C466B866D666DA66E0663F66E666E966F066F566F7670F6716671E67266727 +9738672E673F67366741673867376746675E67606759676367646789677067A9 +677C676A678C678B67A667A1678567B767EF67B467EC67B367E967B867E467DE +67DD67E267EE67B967CE67C667E76A9C681E684668296840684D6832684E0000 +68B3682B685968636877687F689F688F68AD6894689D689B68836AAE68B96874 +68B568A068BA690F688D687E690168CA690868D86922692668E1690C68CD68D4 +68E768D569366912690468D768E3692568F968E068EF6928692A691A69236921 +68C669796977695C6978696B6954697E696E69396974693D695969306961695E +695D6981696A69B269AE69D069BF69C169D369BE69CE5BE869CA69DD69BB69C3 +69A76A2E699169A0699C699569B469DE69E86A026A1B69FF6B0A69F969F269E7 +6A0569B16A1E69ED6A1469EB6A0A6A126AC16A236A136A446A0C6A726A366A78 +6A476A626A596A666A486A386A226A906A8D6AA06A846AA26AA3000000000000 +9F +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +6A9786176ABB6AC36AC26AB86AB36AAC6ADE6AD16ADF6AAA6ADA6AEA6AFB6B05 +86166AFA6B126B169B316B1F6B386B3776DC6B3998EE6B476B436B496B506B59 +6B546B5B6B5F6B616B786B796B7F6B806B846B836B8D6B986B956B9E6BA46BAA +6BAB6BAF6BB26BB16BB36BB76BBC6BC66BCB6BD36BDF6BEC6BEB6BF36BEF0000 +9EBE6C086C136C146C1B6C246C236C5E6C556C626C6A6C826C8D6C9A6C816C9B +6C7E6C686C736C926C906CC46CF16CD36CBD6CD76CC56CDD6CAE6CB16CBE6CBA +6CDB6CEF6CD96CEA6D1F884D6D366D2B6D3D6D386D196D356D336D126D0C6D63 +6D936D646D5A6D796D596D8E6D956FE46D856DF96E156E0A6DB56DC76DE66DB8 +6DC66DEC6DDE6DCC6DE86DD26DC56DFA6DD96DE46DD56DEA6DEE6E2D6E6E6E2E +6E196E726E5F6E3E6E236E6B6E2B6E766E4D6E1F6E436E3A6E4E6E246EFF6E1D +6E386E826EAA6E986EC96EB76ED36EBD6EAF6EC46EB26ED46ED56E8F6EA56EC2 +6E9F6F416F11704C6EEC6EF86EFE6F3F6EF26F316EEF6F326ECC000000000000 +E0 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +6F3E6F136EF76F866F7A6F786F816F806F6F6F5B6FF36F6D6F826F7C6F586F8E +6F916FC26F666FB36FA36FA16FA46FB96FC66FAA6FDF6FD56FEC6FD46FD86FF1 +6FEE6FDB7009700B6FFA70117001700F6FFE701B701A6F74701D7018701F7030 +703E7032705170637099709270AF70F170AC70B870B370AE70DF70CB70DD0000 +70D9710970FD711C711971657155718871667162714C7156716C718F71FB7184 +719571A871AC71D771B971BE71D271C971D471CE71E071EC71E771F571FC71F9 +71FF720D7210721B7228722D722C72307232723B723C723F72407246724B7258 +7274727E7282728172877292729672A272A772B972B272C372C672C472CE72D2 +72E272E072E172F972F7500F7317730A731C7316731D7334732F73297325733E +734E734F9ED87357736A7368737073787375737B737A73C873B373CE73BB73C0 +73E573EE73DE74A27405746F742573F87432743A7455743F745F74597441745C +746974707463746A7476747E748B749E74A774CA74CF74D473F1000000000000 +E1 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +74E074E374E774E974EE74F274F074F174F874F7750475037505750C750E750D +75157513751E7526752C753C7544754D754A7549755B7546755A756975647567 +756B756D75787576758675877574758A758975827594759A759D75A575A375C2 +75B375C375B575BD75B875BC75B175CD75CA75D275D975E375DE75FE75FF0000 +75FC760175F075FA75F275F3760B760D7609761F762776207621762276247634 +7630763B764776487646765C76587661766276687669766A7667766C76707672 +76767678767C768076837688768B768E769676937699769A76B076B476B876B9 +76BA76C276CD76D676D276DE76E176E576E776EA862F76FB7708770777047729 +7724771E77257726771B773777387747775A7768776B775B7765777F777E7779 +778E778B779177A0779E77B077B677B977BF77BC77BD77BB77C777CD77D777DA +77DC77E377EE77FC780C781279267820792A7845788E78747886787C789A788C +78A378B578AA78AF78D178C678CB78D478BE78BC78C578CA78EC000000000000 +E2 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +78E778DA78FD78F47907791279117919792C792B794079607957795F795A7955 +7953797A797F798A799D79A79F4B79AA79AE79B379B979BA79C979D579E779EC +79E179E37A087A0D7A187A197A207A1F79807A317A3B7A3E7A377A437A577A49 +7A617A627A699F9D7A707A797A7D7A887A977A957A987A967AA97AC87AB00000 +7AB67AC57AC47ABF90837AC77ACA7ACD7ACF7AD57AD37AD97ADA7ADD7AE17AE2 +7AE67AED7AF07B027B0F7B0A7B067B337B187B197B1E7B357B287B367B507B7A +7B047B4D7B0B7B4C7B457B757B657B747B677B707B717B6C7B6E7B9D7B987B9F +7B8D7B9C7B9A7B8B7B927B8F7B5D7B997BCB7BC17BCC7BCF7BB47BC67BDD7BE9 +7C117C147BE67BE57C607C007C077C137BF37BF77C177C0D7BF67C237C277C2A +7C1F7C377C2B7C3D7C4C7C437C547C4F7C407C507C587C5F7C647C567C657C6C +7C757C837C907CA47CAD7CA27CAB7CA17CA87CB37CB27CB17CAE7CB97CBD7CC0 +7CC57CC27CD87CD27CDC7CE29B3B7CEF7CF27CF47CF67CFA7D06000000000000 +E3 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +7D027D1C7D157D0A7D457D4B7D2E7D327D3F7D357D467D737D567D4E7D727D68 +7D6E7D4F7D637D937D897D5B7D8F7D7D7D9B7DBA7DAE7DA37DB57DC77DBD7DAB +7E3D7DA27DAF7DDC7DB87D9F7DB07DD87DDD7DE47DDE7DFB7DF27DE17E057E0A +7E237E217E127E317E1F7E097E0B7E227E467E667E3B7E357E397E437E370000 +7E327E3A7E677E5D7E567E5E7E597E5A7E797E6A7E697E7C7E7B7E837DD57E7D +8FAE7E7F7E887E897E8C7E927E907E937E947E967E8E7E9B7E9C7F387F3A7F45 +7F4C7F4D7F4E7F507F517F557F547F587F5F7F607F687F697F677F787F827F86 +7F837F887F877F8C7F947F9E7F9D7F9A7FA37FAF7FB27FB97FAE7FB67FB88B71 +7FC57FC67FCA7FD57FD47FE17FE67FE97FF37FF998DC80068004800B80128018 +8019801C80218028803F803B804A804680528058805A805F8062806880738072 +807080768079807D807F808480868085809B8093809A80AD519080AC80DB80E5 +80D980DD80C480DA80D6810980EF80F1811B81298123812F814B000000000000 +E4 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +968B8146813E8153815180FC8171816E81658166817481838188818A81808182 +81A0819581A481A3815F819381A981B081B581BE81B881BD81C081C281BA81C9 +81CD81D181D981D881C881DA81DF81E081E781FA81FB81FE8201820282058207 +820A820D821082168229822B82388233824082598258825D825A825F82640000 +82628268826A826B822E827182778278827E828D829282AB829F82BB82AC82E1 +82E382DF82D282F482F382FA8393830382FB82F982DE830682DC830982D98335 +83348316833283318340833983508345832F832B831783188385839A83AA839F +83A283968323838E8387838A837C83B58373837583A0838983A883F4841383EB +83CE83FD840383D8840B83C183F7840783E083F2840D8422842083BD84388506 +83FB846D842A843C855A84848477846B84AD846E848284698446842C846F8479 +843584CA846284B984BF849F84D984CD84BB84DA84D084C184C684D684A18521 +84FF84F485178518852C851F8515851484FC8540856385588548000000000000 +E5 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +85418602854B8555858085A485888591858A85A8856D8594859B85EA8587859C +8577857E859085C985BA85CF85B985D085D585DD85E585DC85F9860A8613860B +85FE85FA86068622861A8630863F864D4E558654865F86678671869386A386A9 +86AA868B868C86B686AF86C486C686B086C9882386AB86D486DE86E986EC0000 +86DF86DB86EF8712870687088700870386FB87118709870D86F9870A8734873F +8737873B87258729871A8760875F8778874C874E877487578768876E87598753 +8763876A880587A2879F878287AF87CB87BD87C087D096D687AB87C487B387C7 +87C687BB87EF87F287E0880F880D87FE87F687F7880E87D28811881688158822 +88218831883688398827883B8844884288528859885E8862886B8881887E889E +8875887D88B5887288828897889288AE889988A2888D88A488B088BF88B188C3 +88C488D488D888D988DD88F9890288FC88F488E888F28904890C890A89138943 +891E8925892A892B89418944893B89368938894C891D8960895E000000000000 +E6 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +89668964896D896A896F89748977897E89838988898A8993899889A189A989A6 +89AC89AF89B289BA89BD89BF89C089DA89DC89DD89E789F489F88A038A168A10 +8A0C8A1B8A1D8A258A368A418A5B8A528A468A488A7C8A6D8A6C8A628A858A82 +8A848AA88AA18A918AA58AA68A9A8AA38AC48ACD8AC28ADA8AEB8AF38AE70000 +8AE48AF18B148AE08AE28AF78ADE8ADB8B0C8B078B1A8AE18B168B108B178B20 +8B3397AB8B268B2B8B3E8B288B418B4C8B4F8B4E8B498B568B5B8B5A8B6B8B5F +8B6C8B6F8B748B7D8B808B8C8B8E8B928B938B968B998B9A8C3A8C418C3F8C48 +8C4C8C4E8C508C558C628C6C8C788C7A8C828C898C858C8A8C8D8C8E8C948C7C +8C98621D8CAD8CAA8CBD8CB28CB38CAE8CB68CC88CC18CE48CE38CDA8CFD8CFA +8CFB8D048D058D0A8D078D0F8D0D8D109F4E8D138CCD8D148D168D678D6D8D71 +8D738D818D998DC28DBE8DBA8DCF8DDA8DD68DCC8DDB8DCB8DEA8DEB8DDF8DE3 +8DFC8E088E098DFF8E1D8E1E8E108E1F8E428E358E308E348E4A000000000000 +E7 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +8E478E498E4C8E508E488E598E648E608E2A8E638E558E768E728E7C8E818E87 +8E858E848E8B8E8A8E938E918E948E998EAA8EA18EAC8EB08EC68EB18EBE8EC5 +8EC88ECB8EDB8EE38EFC8EFB8EEB8EFE8F0A8F058F158F128F198F138F1C8F1F +8F1B8F0C8F268F338F3B8F398F458F428F3E8F4C8F498F468F4E8F578F5C0000 +8F628F638F648F9C8F9F8FA38FAD8FAF8FB78FDA8FE58FE28FEA8FEF90878FF4 +90058FF98FFA901190159021900D901E9016900B90279036903590398FF8904F +905090519052900E9049903E90569058905E9068906F907696A890729082907D +90819080908A9089908F90A890AF90B190B590E290E4624890DB910291129119 +91329130914A9156915891639165916991739172918B9189918291A291AB91AF +91AA91B591B491BA91C091C191C991CB91D091D691DF91E191DB91FC91F591F6 +921E91FF9214922C92159211925E925792459249926492489295923F924B9250 +929C92969293929B925A92CF92B992B792E9930F92FA9344932E000000000000 +E8 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +93199322931A9323933A9335933B935C9360937C936E935693B093AC93AD9394 +93B993D693D793E893E593D893C393DD93D093C893E4941A9414941394039407 +94109436942B94359421943A944194529444945B94609462945E946A92299470 +94759477947D945A947C947E9481947F95829587958A95949596959895990000 +95A095A895A795AD95BC95BB95B995BE95CA6FF695C395CD95CC95D595D495D6 +95DC95E195E595E296219628962E962F9642964C964F964B9677965C965E965D +965F96669672966C968D96989695969796AA96A796B196B296B096B496B696B8 +96B996CE96CB96C996CD894D96DC970D96D596F99704970697089713970E9711 +970F971697199724972A97309739973D973E97449746974897429749975C9760 +97649766976852D2976B977197799785977C9781977A9786978B978F9790979C +97A897A697A397B397B497C397C697C897CB97DC97ED9F4F97F27ADF97F697F5 +980F980C9838982498219837983D9846984F984B986B986F9870000000000000 +E9 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +98719874987398AA98AF98B198B698C498C398C698E998EB9903990999129914 +99189921991D991E99249920992C992E993D993E9942994999459950994B9951 +9952994C99559997999899A599AD99AE99BC99DF99DB99DD99D899D199ED99EE +99F199F299FB99F89A019A0F9A0599E29A199A2B9A379A459A429A409A430000 +9A3E9A559A4D9A5B9A579A5F9A629A659A649A699A6B9A6A9AAD9AB09ABC9AC0 +9ACF9AD19AD39AD49ADE9ADF9AE29AE39AE69AEF9AEB9AEE9AF49AF19AF79AFB +9B069B189B1A9B1F9B229B239B259B279B289B299B2A9B2E9B2F9B329B449B43 +9B4F9B4D9B4E9B519B589B749B939B839B919B969B979B9F9BA09BA89BB49BC0 +9BCA9BB99BC69BCF9BD19BD29BE39BE29BE49BD49BE19C3A9BF29BF19BF09C15 +9C149C099C139C0C9C069C089C129C0A9C049C2E9C1B9C259C249C219C309C47 +9C329C469C3E9C5A9C609C679C769C789CE79CEC9CF09D099D089CEB9D039D06 +9D2A9D269DAF9D239D1F9D449D159D129D419D3F9D3E9D469D48000000000000 +EA +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +9D5D9D5E9D649D519D509D599D729D899D879DAB9D6F9D7A9D9A9DA49DA99DB2 +9DC49DC19DBB9DB89DBA9DC69DCF9DC29DD99DD39DF89DE69DED9DEF9DFD9E1A +9E1B9E1E9E759E799E7D9E819E889E8B9E8C9E929E959E919E9D9EA59EA99EB8 +9EAA9EAD97619ECC9ECE9ECF9ED09ED49EDC9EDE9EDD9EE09EE59EE89EEF0000 +9EF49EF69EF79EF99EFB9EFC9EFD9F079F0876B79F159F219F2C9F3E9F4A9F52 +9F549F639F5F9F609F619F669F679F6C9F6A9F779F729F769F959F9C9FA0582F +69C79059746451DC719900000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +R +8160 301C FF5E +8161 2016 2225 +817C 2212 FF0D +8191 00A2 FFE0 +8192 00A3 FFE1 +81CA 00AC FFE2 diff --git a/shared/package-files/75/75038d5b2a5bcdfbf31820ed769dccfcd25ac12709bccd838876f1d64fb0c3b8/svg.py b/shared/package-files/75/75038d5b2a5bcdfbf31820ed769dccfcd25ac12709bccd838876f1d64fb0c3b8/svg.py new file mode 100644 index 0000000000000000000000000000000000000000..a8727ed8592533a009b6202be92f438d4152e793 --- /dev/null +++ b/shared/package-files/75/75038d5b2a5bcdfbf31820ed769dccfcd25ac12709bccd838876f1d64fb0c3b8/svg.py @@ -0,0 +1,188 @@ +""" + pygments.formatters.svg + ~~~~~~~~~~~~~~~~~~~~~~~ + + Formatter for SVG output. + + :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pip._vendor.pygments.formatter import Formatter +from pip._vendor.pygments.token import Comment +from pip._vendor.pygments.util import get_bool_opt, get_int_opt + +__all__ = ['SvgFormatter'] + + +def escape_html(text): + """Escape &, <, > as well as single and double quotes for HTML.""" + return text.replace('&', '&'). \ + replace('<', '<'). \ + replace('>', '>'). \ + replace('"', '"'). \ + replace("'", ''') + + +class2style = {} + +class SvgFormatter(Formatter): + """ + Format tokens as an SVG graphics file. This formatter is still experimental. + Each line of code is a ```` element with explicit ``x`` and ``y`` + coordinates containing ```` elements with the individual token styles. + + By default, this formatter outputs a full SVG document including doctype + declaration and the ```` root element. + + .. versionadded:: 0.9 + + Additional options accepted: + + `nowrap` + Don't wrap the SVG ```` elements in ```` elements and + don't add a XML declaration and a doctype. If true, the `fontfamily` + and `fontsize` options are ignored. Defaults to ``False``. + + `fontfamily` + The value to give the wrapping ```` element's ``font-family`` + attribute, defaults to ``"monospace"``. + + `fontsize` + The value to give the wrapping ```` element's ``font-size`` + attribute, defaults to ``"14px"``. + + `linenos` + If ``True``, add line numbers (default: ``False``). + + `linenostart` + The line number for the first line (default: ``1``). + + `linenostep` + If set to a number n > 1, only every nth line number is printed. + + `linenowidth` + Maximum width devoted to line numbers (default: ``3*ystep``, sufficient + for up to 4-digit line numbers. Increase width for longer code blocks). + + `xoffset` + Starting offset in X direction, defaults to ``0``. + + `yoffset` + Starting offset in Y direction, defaults to the font size if it is given + in pixels, or ``20`` else. (This is necessary since text coordinates + refer to the text baseline, not the top edge.) + + `ystep` + Offset to add to the Y coordinate for each subsequent line. This should + roughly be the text size plus 5. It defaults to that value if the text + size is given in pixels, or ``25`` else. + + `spacehack` + Convert spaces in the source to `` ``, which are non-breaking + spaces. SVG provides the ``xml:space`` attribute to control how + whitespace inside tags is handled, in theory, the ``preserve`` value + could be used to keep all whitespace as-is. However, many current SVG + viewers don't obey that rule, so this option is provided as a workaround + and defaults to ``True``. + """ + name = 'SVG' + aliases = ['svg'] + filenames = ['*.svg'] + + def __init__(self, **options): + Formatter.__init__(self, **options) + self.nowrap = get_bool_opt(options, 'nowrap', False) + self.fontfamily = options.get('fontfamily', 'monospace') + self.fontsize = options.get('fontsize', '14px') + self.xoffset = get_int_opt(options, 'xoffset', 0) + fs = self.fontsize.strip() + if fs.endswith('px'): fs = fs[:-2].strip() + try: + int_fs = int(fs) + except: + int_fs = 20 + self.yoffset = get_int_opt(options, 'yoffset', int_fs) + self.ystep = get_int_opt(options, 'ystep', int_fs + 5) + self.spacehack = get_bool_opt(options, 'spacehack', True) + self.linenos = get_bool_opt(options,'linenos',False) + self.linenostart = get_int_opt(options,'linenostart',1) + self.linenostep = get_int_opt(options,'linenostep',1) + self.linenowidth = get_int_opt(options,'linenowidth', 3*self.ystep) + self._stylecache = {} + + def format_unencoded(self, tokensource, outfile): + """ + Format ``tokensource``, an iterable of ``(tokentype, tokenstring)`` + tuples and write it into ``outfile``. + + For our implementation we put all lines in their own 'line group'. + """ + x = self.xoffset + y = self.yoffset + if not self.nowrap: + if self.encoding: + outfile.write('\n' % + self.encoding) + else: + outfile.write('\n') + outfile.write('\n') + outfile.write('\n') + outfile.write('\n' % + (self.fontfamily, self.fontsize)) + + counter = self.linenostart + counter_step = self.linenostep + counter_style = self._get_style(Comment) + line_x = x + + if self.linenos: + if counter % counter_step == 0: + outfile.write('%s' % + (x+self.linenowidth,y,counter_style,counter)) + line_x += self.linenowidth + self.ystep + counter += 1 + + outfile.write('' % (line_x, y)) + for ttype, value in tokensource: + style = self._get_style(ttype) + tspan = style and '' or '' + tspanend = tspan and '' or '' + value = escape_html(value) + if self.spacehack: + value = value.expandtabs().replace(' ', ' ') + parts = value.split('\n') + for part in parts[:-1]: + outfile.write(tspan + part + tspanend) + y += self.ystep + outfile.write('\n') + if self.linenos and counter % counter_step == 0: + outfile.write('%s' % + (x+self.linenowidth,y,counter_style,counter)) + + counter += 1 + outfile.write('' % (line_x,y)) + outfile.write(tspan + parts[-1] + tspanend) + outfile.write('') + + if not self.nowrap: + outfile.write('\n') + + def _get_style(self, tokentype): + if tokentype in self._stylecache: + return self._stylecache[tokentype] + otokentype = tokentype + while not self.style.styles_token(tokentype): + tokentype = tokentype.parent + value = self.style.style_for_token(tokentype) + result = '' + if value['color']: + result = ' fill="#' + value['color'] + '"' + if value['bold']: + result += ' font-weight="bold"' + if value['italic']: + result += ' font-style="italic"' + self._stylecache[otokentype] = result + return result diff --git a/shared/package-files/75/7505076b53c6a49b0d136c7f490171b4e5fe8e8bac12aa65c07d5b76c93a9a71/__version__.py b/shared/package-files/75/7505076b53c6a49b0d136c7f490171b4e5fe8e8bac12aa65c07d5b76c93a9a71/__version__.py new file mode 100644 index 0000000000000000000000000000000000000000..63c5578000dbd4c910295cc0e98a1b819ab6afcd --- /dev/null +++ b/shared/package-files/75/7505076b53c6a49b0d136c7f490171b4e5fe8e8bac12aa65c07d5b76c93a9a71/__version__.py @@ -0,0 +1,4 @@ +# file generated by setuptools_scm +# don't change, don't track in version control +__version__ = version = '0.2.0' +__version_tuple__ = version_tuple = (0, 2, 0) diff --git a/shared/package-files/75/7505f48f7ae32af9c3cce082d4d3c7d4adc28018d428e52968dd27b50b586edf/_mkldnn_reshape_compositeexplicitautograd_dispatch.h b/shared/package-files/75/7505f48f7ae32af9c3cce082d4d3c7d4adc28018d428e52968dd27b50b586edf/_mkldnn_reshape_compositeexplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..c2635e8d4940c4521f60a8a9d2122e30a80b565c --- /dev/null +++ b/shared/package-files/75/7505f48f7ae32af9c3cce082d4d3c7d4adc28018d428e52968dd27b50b586edf/_mkldnn_reshape_compositeexplicitautograd_dispatch.h @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API at::Tensor & _mkldnn_reshape_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef shape); +TORCH_API at::Tensor & _mkldnn_reshape_outf(const at::Tensor & self, at::IntArrayRef shape, at::Tensor & out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/75/750a5404fadd8bddb13c09751eacd776c431166e124a0e2dd0d01bd9b8fb2314/_distributed_c10d.pyi b/shared/package-files/75/750a5404fadd8bddb13c09751eacd776c431166e124a0e2dd0d01bd9b8fb2314/_distributed_c10d.pyi new file mode 100644 index 0000000000000000000000000000000000000000..9a6aaa23023cb49ab1c49691ef8dffc03d1403c1 --- /dev/null +++ b/shared/package-files/75/750a5404fadd8bddb13c09751eacd776c431166e124a0e2dd0d01bd9b8fb2314/_distributed_c10d.pyi @@ -0,0 +1,590 @@ +# mypy: disable-error-code="type-arg" +from datetime import timedelta +from enum import Enum +from typing import Any, Dict, List, Optional, overload, Tuple, Union + +import torch +from torch import Tensor +from torch._C import ScriptObject +from torch.futures import Future + +# This module is defined in torch/csrc/distributed/c10d/init.cpp + +_DEFAULT_FIRST_BUCKET_BYTES: int +_DEFAULT_NO_TIMEOUT: timedelta +_DEFAULT_PG_TIMEOUT: timedelta +_DEFAULT_PG_NCCL_TIMEOUT: timedelta + +class BuiltinCommHookType(Enum): + ALLREDUCE = ... + FP16_COMPRESS = ... + +def _register_comm_hook(reducer: Reducer, state: Any, comm_hook: Any): ... +def _register_builtin_comm_hook( + reducer: Reducer, + comm_hook_type: BuiltinCommHookType, +): ... +def _set_global_rank(rank: int) -> None: ... +def _hash_tensors(tensors: List[Tensor]) -> int: ... + +class GradBucket: + def index(self) -> int: ... + def buffer(self) -> Tensor: ... + def gradients(self) -> List[Tensor]: ... + def is_last(self) -> bool: ... + def set_buffer(self, tensor: Tensor) -> None: ... + def parameters(self) -> List[Tensor]: ... + +class Reducer: + def __init__( + self, + params: List[Tensor], + bucket_indices: List[List[int]], + per_bucket_size_limits: List[int], + process_group: ProcessGroup, + expect_sparse_gradients: List[bool] = ..., + bucket_bytes_cap: int = ..., # kDefaultBucketBytesCap in reducer.hpp + find_unused_parameters: bool = ..., + gradient_as_bucket_view: bool = ..., + param_to_name_mapping: Dict[int, str] = ..., + first_bucket_types_cap: int = ..., # kDefaultFirstBucketBytes in reducer.hpp + ): ... + def prepare_for_forward(self) -> None: ... + def prepare_for_backward(self, output: List[Tensor]) -> None: ... + def get_backward_stats(self) -> List[int]: ... + def _install_post_backward_futures(self, futures: List[Future]) -> None: ... + def _rebuild_buckets(self) -> bool: ... + def _get_zeros_like_grad_buckets(self) -> List[GradBucket]: ... + def _push_all_rebuilt_params(self) -> None: ... + def _set_forward_pass_work_handle( + self, + work: Work, + use_static_world_size: bool, + ): ... + def _get_local_used_map(self) -> Tensor: ... + def _set_ddp_runtime_logging_sample_rate(self, sample_rate: int) -> None: ... + def _set_static_graph(self) -> None: ... + def _run_comm_hook(self, bucket: GradBucket) -> Future: ... + def set_logger(self, logger: Logger) -> None: ... + def _remove_autograd_hooks(self) -> None: ... + def _check_reducer_finalized(self) -> None: ... + def _set_sparse_metadata(self, global_unique_ids: Dict[str, Tensor]) -> None: ... + def _reset_state(self) -> None: ... + def _update_process_group(self, new_process_group: ProcessGroup) -> None: ... + +class DDPLoggingData: + strs_map: Dict[str, str] + ints_map: Dict[str, int] + +class Logger: + def __init__(self, reducer: Reducer): ... + def set_construction_data_and_log( + self, + module_name: str, + device_ids: List[int], + output_device: int, + broadcast_buffers: bool, + has_sync_bn: bool, + static_graph: bool, + ): ... + def set_runtime_stats_and_log(self) -> None: ... + def set_error_and_log(self, error: str) -> None: ... + def _get_ddp_logging_data(self) -> DDPLoggingData: ... + def _set_comm_hook_name(self, comm_hook: str) -> None: ... + def _set_uneven_input_join(self) -> None: ... + def _set_static_graph(self) -> None: ... + +def get_debug_level(): ... +def set_debug_level(): ... +def set_debug_level_from_env(): ... + +class DebugLevel(Enum): + OFF = ... + INFO = ... + DETAIL = ... + +class ReduceOp: + def __init__(self, op: RedOpType): ... + + SUM: RedOpType = ... + AVG: RedOpType = ... + PRODUCT: RedOpType = ... + MIN: RedOpType = ... + MAX: RedOpType = ... + BAND: RedOpType = ... + BOR: RedOpType = ... + BXOR: RedOpType = ... + PREMUL_SUM: RedOpType = ... + UNUSED: RedOpType = ... + + class RedOpType(Enum): ... + +class BroadcastOptions: + rootRank: int + rootTensor: int + timeout: timedelta + asyncOp: bool + +class AllreduceOptions: + reduceOp: ReduceOp + timeout: timedelta + +class AllreduceCoalescedOptions(AllreduceOptions): ... + +class ReduceOptions: + reduceOp: ReduceOp + rootRank: int + rootTensor: int + timeout: timedelta + +class AllgatherOptions: + timeout: timedelta + asyncOp: bool + +class GatherOptions: + rootRank: int + timeout: timedelta + +class ScatterOptions: + rootRank: int + timeout: timedelta + asyncOp: bool + +class ReduceScatterOptions: + reduceOp: ReduceOp + timeout: timedelta + asyncOp: bool + +class BarrierOptions: + device_ids: List[int] + device: torch.device + timeout: timedelta + +class AllToAllOptions: + timeout: timedelta + +class Store: + def set(self, key: str, value: str): ... + def get(self, key: str) -> bytes: ... + def add(self, key: str, value: int) -> int: ... + def compare_set( + self, + key: str, + expected_value: str, + desired_value: str, + ) -> bytes: ... + def delete_key(self, key: str) -> bool: ... + def num_keys(self) -> int: ... + def set_timeout(self, timeout: timedelta): ... + @overload + def wait(self, keys: List[str]): ... + @overload + def wait(self, keys: List[str], timeout: timedelta): ... + +class FileStore(Store): + def __init__(self, path: str, numWorkers: int = ...): ... + +class HashStore(Store): + def __init__(self): ... + +class TCPStore(Store): + def __init__( + self, + host_name: str, + port: int, + world_size: Optional[int] = ..., + is_master: bool = ..., + timeout: timedelta = ..., + wait_for_workers: bool = ..., + multi_tenant: bool = ..., + master_listen_fd: Optional[int] = ..., + use_libuv: Optional[bool] = ..., + ): ... + @property + def host(self) -> str: ... + @property + def port(self) -> int: ... + +class PrefixStore(Store): + def __init__(self, prefix: str, store: Store): ... + @property + def underlying_store(self) -> Store: ... + +class _DistributedBackendOptions: + def __init__(self): ... + @property + def store(self) -> Store: ... + @store.setter + def store(self, store: Store) -> None: ... + @property + def group_rank(self) -> int: ... + @group_rank.setter + def group_rank(self, rank: int) -> None: ... + @property + def group_size(self) -> int: ... + @group_size.setter + def group_size(self, size: int) -> None: ... + @property + def timeout(self) -> timedelta: ... + @timeout.setter + def timeout(self, timeout: timedelta) -> None: ... + @property + def group_id(self) -> str: ... + @group_id.setter + def group_id(self, group_id: str) -> None: ... + @property + def global_ranks_in_group(self) -> List[int]: ... + @global_ranks_in_group.setter + def global_ranks_in_group(self, ranks: List[int]) -> None: ... + +class Work: + def is_completed(self) -> bool: ... + def is_success(self) -> bool: ... + def exception(self) -> Any: ... + def wait(self, timeout: timedelta = ...) -> bool: ... + def get_future(self) -> Future: ... + def source_rank(self) -> int: ... + def _source_rank(self) -> int: ... + def result(self) -> List[Tensor]: ... + def synchronize(self): ... + def boxed(self) -> ScriptObject: ... + @staticmethod + def unbox(obj: ScriptObject) -> Work: ... + +class Backend: + def __init__( + self, + rank: int, + size: int, + ): ... + @property + def supports_splitting(self) -> bool: ... + def rank(self) -> int: ... + def size(self) -> int: ... + def eager_connect_single_device(self, device: Optional[torch.device]) -> None: ... + def _set_sequence_number_for_group(self) -> None: ... + +class ProcessGroup: + class Options: + def __init__(self, backend: str, timeout: timedelta = ...): ... + @property + def backend(self) -> str: ... + @property + def _timeout(self) -> timedelta: ... + @_timeout.setter + def _timeout(self, val: timedelta) -> None: ... + + class BackendType(Enum): + UNDEFINED = ... + GLOO = ... + NCCL = ... + UCC = ... + MPI = ... + CUSTOM = ... + def __init__(self, store: Store, rank: int, size: int, options: Options): ... + def rank(self) -> int: ... + def size(self) -> int: ... + @overload + def broadcast( + self, + tensors: List[Tensor], + opts=..., + ) -> Work: ... + @overload + def broadcast( + self, + tensor: Tensor, + root: int, + ) -> Work: ... + @overload + def allreduce( + self, + tensors: List[Tensor], + opts: AllreduceOptions = ..., + ) -> Work: ... + @overload + def allreduce( + self, + tensors: List[Tensor], + op=..., + ) -> Work: ... + @overload + def allreduce( + self, + tensor: Tensor, + op=..., + ) -> Work: ... + def allreduce_coalesced( + self, + tensors: List[Tensor], + opts=..., + ) -> Work: ... + def reduce_scatter_tensor_coalesced( + self, + outputTensors: List[Tensor], + inputTensors: List[Tensor], + opts: Optional[ReduceScatterOptions] = None, + ) -> Work: ... + @overload + def reduce( + self, + tensors: List[Tensor], + opts=..., + ) -> Work: ... + @overload + def reduce( + self, + tensor: Tensor, + root: int, + op=..., + ) -> Work: ... + @overload + def allgather( + self, + output_tensors: List[List[Tensor]], + input_tensors: List[Tensor], + opts=..., + ) -> Work: ... + @overload + def allgather( + self, + output_tensors: List[Tensor], + input_tensor: Tensor, + ) -> Work: ... + def _allgather_base( + self, + output: Tensor, + input: Tensor, + opts=..., + ) -> Work: ... + def allgather_coalesced( + self, + output_lists: List[List[Tensor]], + input_list: List[Tensor], + opts=..., + ) -> Work: ... + def allgather_into_tensor_coalesced( + self, + output_lists: List[Tensor], + input_list: List[Tensor], + opts=..., + ) -> Work: ... + @overload + def gather( + self, + output_tensors: List[List[Tensor]], + input_tensors: List[Tensor], + opts=..., + ) -> Work: ... + @overload + def gather( + self, + output_tensors: List[Tensor], + input_tensor: Tensor, + root: int, + ) -> Work: ... + @overload + def scatter( + self, + output_tensors: List[Tensor], + input_tensors: List[List[Tensor]], + opts=..., + ) -> Work: ... + @overload + def scatter( + self, + output_tensor: Tensor, + input_tensors: List[Tensor], + root: int, + ) -> Work: ... + @overload + def reduce_scatter( + self, + output_tensors: List[Tensor], + input_tensors: List[List[Tensor]], + opts=..., + ) -> Work: ... + @overload + def reduce_scatter( + self, + output_tensors: Tensor, + input_tensor: List[Tensor], + ) -> Work: ... + def _reduce_scatter_base( + self, + outputTensor: Tensor, + inputTensor: Tensor, + opts: Optional[ReduceScatterOptions], + ) -> Work: ... + @overload + def alltoall_base( + self, + output_tensor: Tensor, + input_tensor: Tensor, + output_split_sizes: List[int], + input_split_sizes: List[int], + opts=..., + ) -> Work: ... + @overload + def alltoall_base( + self, + output: Tensor, + input: Tensor, + output_split_sizes: List[int], + input_split_sizes: List[int], + ) -> Work: ... + @overload + def alltoall( + self, + output_tensor: List[Tensor], + input_tensor: List[Tensor], + opts=..., + ) -> Work: ... + @overload + def alltoall( + self, + output: List[Tensor], + input: List[Tensor], + ) -> Work: ... + def send( + self, + tensors: List[Tensor], + dstRank: int, + tag: int, + ) -> Work: ... + def recv( + self, + tensors: List[Tensor], + srcRank: int, + tag: int, + ) -> Work: ... + def recv_anysource(self, tensors: List[Tensor], tag: int) -> Work: ... + def barrier(self, opts=...) -> Work: ... + def boxed(self) -> ScriptObject: ... + @staticmethod + def unbox(obj: ScriptObject) -> ProcessGroup: ... + def _start_coalescing(self, device: torch.device) -> None: ... + def _end_coalescing(self, device: torch.device) -> Work: ... + def _get_backend_name(self) -> str: ... + def _backend_id(self, backend_type: BackendType) -> int: ... + @property + def _device_types(self) -> List[torch.device]: ... + def _get_backend(self, device: torch.device) -> Backend: ... + def _register_backend( + self, + device: torch.device, + backend_type: BackendType, + backend: Optional[Backend], + ) -> None: ... + def _set_group_name(self, name: str) -> None: ... + def name(self) -> str: ... + def _has_hooks(self) -> bool: ... + def _wait_for_pending_works(self) -> None: ... + def _set_sequence_number_for_group(self) -> None: ... + @property + def bound_device_id(self) -> Optional[torch.device]: ... + @bound_device_id.setter + def bound_device_id(self, device: Optional[torch.device]) -> None: ... + @property + def group_name(self) -> str: ... + +class ProcessGroupRoundRobin(ProcessGroup): ... + +def _round_robin_process_groups( + process_groups: List[ProcessGroup], +) -> ProcessGroupRoundRobin: ... + +class ProcessGroupGloo(Backend): + class Device: ... + class Options: ... + + def __init__( + self, + store: Store, + rank: int, + size: int, + timeout: timedelta, + ): ... + @staticmethod + def create_device(hostname="", interface="") -> Device: ... + @staticmethod + def create_default_device() -> Device: ... + def _set_default_timeout(self, timeout) -> None: ... + +class _ProcessGroupWrapper(Backend): + def __init__(self, pg: Backend, gloo_pg: ProcessGroupGloo): ... + wrapped_pg: Backend + +class ProcessGroupNCCL(Backend): + class Options: + def __init__(self, timeout: Optional[timedelta] = None): ... + @property + def backend(self) -> str: ... + @property + def _timeout(self) -> timedelta: ... + @_timeout.setter + def _timeout(self, val: timedelta) -> None: ... + @property + def _is_high_priority_stream(self) -> bool: ... + @_is_high_priority_stream.setter + def _is_high_priority_stream(self, val: bool) -> None: ... + + def __init__( + self, + store: Store, + rank: int, + size: int, + timeout: timedelta, + ): ... + def _group_start(self) -> None: ... + def _group_end(self) -> None: ... + def _set_default_timeout(self, timeout) -> None: ... + def _shutdown(self) -> None: ... + @property + def uid(self) -> int: ... + +class ProcessGroupUCC(Backend): + def __init__( + self, + store: Store, + rank: int, + size: int, + timeout: timedelta, + ): ... + +class ProcessGroupMPI(Backend): + def __init__( + self, + rank: int, + size: int, + pgComm: int, + ): ... + @staticmethod + def create(ranks: List[int]) -> ProcessGroupMPI: ... + +def _compute_bucket_assignment_by_size( + tensors: List[Tensor], + bucket_size_limits: List[int], + expect_sparse_gradient: List[bool] = ..., + tensor_indices: List[int] = ..., +) -> Tuple[List[List[int]], List[int]]: ... +def _broadcast_coalesced( + process_group: ProcessGroup, + tensors: List[Tensor], + buffer_size: int, + src: int, +): ... +def _test_python_store(store: Store): ... +def _verify_params_across_processes( + process_group: ProcessGroup, + params: List[Tensor], + logger: Optional[Logger], +): ... +def _make_nccl_premul_sum(factor: Union[float, List[Tensor]]) -> ReduceOp: ... +def _register_process_group( + group_name: str, + process_group: ProcessGroup, +) -> None: ... +def _resolve_process_group(group_name: str) -> ProcessGroup: ... +def _unregister_all_process_groups() -> None: ... +def _unregister_process_group(group_name: str) -> None: ... diff --git a/shared/package-files/75/750c6b9abcaee83e2a1cacaa7e5c588e87c4a28cfac5707dae39edb908087b84/test_resample_api.py b/shared/package-files/75/750c6b9abcaee83e2a1cacaa7e5c588e87c4a28cfac5707dae39edb908087b84/test_resample_api.py new file mode 100644 index 0000000000000000000000000000000000000000..74d06117cbb4ab262b4855c82e1e3aa2428caaca --- /dev/null +++ b/shared/package-files/75/750c6b9abcaee83e2a1cacaa7e5c588e87c4a28cfac5707dae39edb908087b84/test_resample_api.py @@ -0,0 +1,1113 @@ +from datetime import datetime +import re + +import numpy as np +import pytest + +from pandas._libs import lib +from pandas.errors import UnsupportedFunctionCall + +import pandas as pd +from pandas import ( + DataFrame, + NamedAgg, + Series, +) +import pandas._testing as tm +from pandas.core.indexes.datetimes import date_range + + +@pytest.fixture +def dti(): + return date_range(start=datetime(2005, 1, 1), end=datetime(2005, 1, 10), freq="Min") + + +@pytest.fixture +def _test_series(dti): + return Series(np.random.default_rng(2).random(len(dti)), dti) + + +@pytest.fixture +def test_frame(dti, _test_series): + return DataFrame({"A": _test_series, "B": _test_series, "C": np.arange(len(dti))}) + + +def test_str(_test_series): + r = _test_series.resample("h") + assert ( + "DatetimeIndexResampler [freq=, axis=0, closed=left, " + "label=left, convention=start, origin=start_day]" in str(r) + ) + + r = _test_series.resample("h", origin="2000-01-01") + assert ( + "DatetimeIndexResampler [freq=, axis=0, closed=left, " + "label=left, convention=start, origin=2000-01-01 00:00:00]" in str(r) + ) + + +def test_api(_test_series): + r = _test_series.resample("h") + result = r.mean() + assert isinstance(result, Series) + assert len(result) == 217 + + r = _test_series.to_frame().resample("h") + result = r.mean() + assert isinstance(result, DataFrame) + assert len(result) == 217 + + +def test_groupby_resample_api(): + # GH 12448 + # .groupby(...).resample(...) hitting warnings + # when appropriate + df = DataFrame( + { + "date": date_range(start="2016-01-01", periods=4, freq="W"), + "group": [1, 1, 2, 2], + "val": [5, 6, 7, 8], + } + ).set_index("date") + + # replication step + i = ( + date_range("2016-01-03", periods=8).tolist() + + date_range("2016-01-17", periods=8).tolist() + ) + index = pd.MultiIndex.from_arrays([[1] * 8 + [2] * 8, i], names=["group", "date"]) + expected = DataFrame({"val": [5] * 7 + [6] + [7] * 7 + [8]}, index=index) + msg = "DataFrameGroupBy.apply operated on the grouping columns" + with tm.assert_produces_warning(FutureWarning, match=msg): + result = df.groupby("group").apply(lambda x: x.resample("1D").ffill())[["val"]] + tm.assert_frame_equal(result, expected) + + +def test_groupby_resample_on_api(): + # GH 15021 + # .groupby(...).resample(on=...) results in an unexpected + # keyword warning. + df = DataFrame( + { + "key": ["A", "B"] * 5, + "dates": date_range("2016-01-01", periods=10), + "values": np.random.default_rng(2).standard_normal(10), + } + ) + + expected = df.set_index("dates").groupby("key").resample("D").mean() + result = df.groupby("key").resample("D", on="dates").mean() + tm.assert_frame_equal(result, expected) + + +def test_resample_group_keys(): + df = DataFrame({"A": 1, "B": 2}, index=date_range("2000", periods=10)) + expected = df.copy() + + # group_keys=False + g = df.resample("5D", group_keys=False) + result = g.apply(lambda x: x) + tm.assert_frame_equal(result, expected) + + # group_keys defaults to False + g = df.resample("5D") + result = g.apply(lambda x: x) + tm.assert_frame_equal(result, expected) + + # group_keys=True + expected.index = pd.MultiIndex.from_arrays( + [ + pd.to_datetime(["2000-01-01", "2000-01-06"]).as_unit("ns").repeat(5), + expected.index, + ] + ) + g = df.resample("5D", group_keys=True) + result = g.apply(lambda x: x) + tm.assert_frame_equal(result, expected) + + +def test_pipe(test_frame, _test_series): + # GH17905 + + # series + r = _test_series.resample("h") + expected = r.max() - r.mean() + result = r.pipe(lambda x: x.max() - x.mean()) + tm.assert_series_equal(result, expected) + + # dataframe + r = test_frame.resample("h") + expected = r.max() - r.mean() + result = r.pipe(lambda x: x.max() - x.mean()) + tm.assert_frame_equal(result, expected) + + +def test_getitem(test_frame): + r = test_frame.resample("h") + tm.assert_index_equal(r._selected_obj.columns, test_frame.columns) + + r = test_frame.resample("h")["B"] + assert r._selected_obj.name == test_frame.columns[1] + + # technically this is allowed + r = test_frame.resample("h")["A", "B"] + tm.assert_index_equal(r._selected_obj.columns, test_frame.columns[[0, 1]]) + + r = test_frame.resample("h")["A", "B"] + tm.assert_index_equal(r._selected_obj.columns, test_frame.columns[[0, 1]]) + + +@pytest.mark.parametrize("key", [["D"], ["A", "D"]]) +def test_select_bad_cols(key, test_frame): + g = test_frame.resample("h") + # 'A' should not be referenced as a bad column... + # will have to rethink regex if you change message! + msg = r"^\"Columns not found: 'D'\"$" + with pytest.raises(KeyError, match=msg): + g[key] + + +def test_attribute_access(test_frame): + r = test_frame.resample("h") + tm.assert_series_equal(r.A.sum(), r["A"].sum()) + + +@pytest.mark.parametrize("attr", ["groups", "ngroups", "indices"]) +def test_api_compat_before_use(attr): + # make sure that we are setting the binner + # on these attributes + rng = date_range("1/1/2012", periods=100, freq="s") + ts = Series(np.arange(len(rng)), index=rng) + rs = ts.resample("30s") + + # before use + getattr(rs, attr) + + # after grouper is initialized is ok + rs.mean() + getattr(rs, attr) + + +def tests_raises_on_nuisance(test_frame, using_infer_string): + df = test_frame + df["D"] = "foo" + r = df.resample("h") + result = r[["A", "B"]].mean() + expected = pd.concat([r.A.mean(), r.B.mean()], axis=1) + tm.assert_frame_equal(result, expected) + + expected = r[["A", "B", "C"]].mean() + msg = re.escape("agg function failed [how->mean,dtype->") + if using_infer_string: + msg = "dtype 'str' does not support operation 'mean'" + with pytest.raises(TypeError, match=msg): + r.mean() + result = r.mean(numeric_only=True) + tm.assert_frame_equal(result, expected) + + +def test_downsample_but_actually_upsampling(): + # this is reindex / asfreq + rng = date_range("1/1/2012", periods=100, freq="s") + ts = Series(np.arange(len(rng), dtype="int64"), index=rng) + result = ts.resample("20s").asfreq() + expected = Series( + [0, 20, 40, 60, 80], + index=date_range("2012-01-01 00:00:00", freq="20s", periods=5), + ) + tm.assert_series_equal(result, expected) + + +def test_combined_up_downsampling_of_irregular(): + # since we are really doing an operation like this + # ts2.resample('2s').mean().ffill() + # preserve these semantics + + rng = date_range("1/1/2012", periods=100, freq="s") + ts = Series(np.arange(len(rng)), index=rng) + ts2 = ts.iloc[[0, 1, 2, 3, 5, 7, 11, 15, 16, 25, 30]] + + result = ts2.resample("2s").mean().ffill() + expected = Series( + [ + 0.5, + 2.5, + 5.0, + 7.0, + 7.0, + 11.0, + 11.0, + 15.0, + 16.0, + 16.0, + 16.0, + 16.0, + 25.0, + 25.0, + 25.0, + 30.0, + ], + index=pd.DatetimeIndex( + [ + "2012-01-01 00:00:00", + "2012-01-01 00:00:02", + "2012-01-01 00:00:04", + "2012-01-01 00:00:06", + "2012-01-01 00:00:08", + "2012-01-01 00:00:10", + "2012-01-01 00:00:12", + "2012-01-01 00:00:14", + "2012-01-01 00:00:16", + "2012-01-01 00:00:18", + "2012-01-01 00:00:20", + "2012-01-01 00:00:22", + "2012-01-01 00:00:24", + "2012-01-01 00:00:26", + "2012-01-01 00:00:28", + "2012-01-01 00:00:30", + ], + dtype="datetime64[ns]", + freq="2s", + ), + ) + tm.assert_series_equal(result, expected) + + +def test_transform_series(_test_series): + r = _test_series.resample("20min") + expected = _test_series.groupby(pd.Grouper(freq="20min")).transform("mean") + result = r.transform("mean") + tm.assert_series_equal(result, expected) + + +@pytest.mark.parametrize("on", [None, "date"]) +def test_transform_frame(on): + # GH#47079 + index = date_range(datetime(2005, 1, 1), datetime(2005, 1, 10), freq="D") + index.name = "date" + df = DataFrame( + np.random.default_rng(2).random((10, 2)), columns=list("AB"), index=index + ) + expected = df.groupby(pd.Grouper(freq="20min")).transform("mean") + if on == "date": + # Move date to being a column; result will then have a RangeIndex + expected = expected.reset_index(drop=True) + df = df.reset_index() + + r = df.resample("20min", on=on) + result = r.transform("mean") + tm.assert_frame_equal(result, expected) + + +def test_fillna(): + # need to upsample here + rng = date_range("1/1/2012", periods=10, freq="2s") + ts = Series(np.arange(len(rng), dtype="int64"), index=rng) + r = ts.resample("s") + + expected = r.ffill() + msg = "DatetimeIndexResampler.fillna is deprecated" + with tm.assert_produces_warning(FutureWarning, match=msg): + result = r.fillna(method="ffill") + tm.assert_series_equal(result, expected) + + expected = r.bfill() + with tm.assert_produces_warning(FutureWarning, match=msg): + result = r.fillna(method="bfill") + tm.assert_series_equal(result, expected) + + msg2 = ( + r"Invalid fill method\. Expecting pad \(ffill\), backfill " + r"\(bfill\) or nearest\. Got 0" + ) + with pytest.raises(ValueError, match=msg2): + with tm.assert_produces_warning(FutureWarning, match=msg): + r.fillna(0) + + +@pytest.mark.parametrize( + "func", + [ + lambda x: x.resample("20min", group_keys=False), + lambda x: x.groupby(pd.Grouper(freq="20min"), group_keys=False), + ], + ids=["resample", "groupby"], +) +def test_apply_without_aggregation(func, _test_series): + # both resample and groupby should work w/o aggregation + t = func(_test_series) + result = t.apply(lambda x: x) + tm.assert_series_equal(result, _test_series) + + +def test_apply_without_aggregation2(_test_series): + grouped = _test_series.to_frame(name="foo").resample("20min", group_keys=False) + result = grouped["foo"].apply(lambda x: x) + tm.assert_series_equal(result, _test_series.rename("foo")) + + +def test_agg_consistency(): + # make sure that we are consistent across + # similar aggregations with and w/o selection list + df = DataFrame( + np.random.default_rng(2).standard_normal((1000, 3)), + index=date_range("1/1/2012", freq="s", periods=1000), + columns=["A", "B", "C"], + ) + + r = df.resample("3min") + + msg = r"Column\(s\) \['r1', 'r2'\] do not exist" + with pytest.raises(KeyError, match=msg): + r.agg({"r1": "mean", "r2": "sum"}) + + +def test_agg_consistency_int_str_column_mix(): + # GH#39025 + df = DataFrame( + np.random.default_rng(2).standard_normal((1000, 2)), + index=date_range("1/1/2012", freq="s", periods=1000), + columns=[1, "a"], + ) + + r = df.resample("3min") + + msg = r"Column\(s\) \[2, 'b'\] do not exist" + with pytest.raises(KeyError, match=msg): + r.agg({2: "mean", "b": "sum"}) + + +# TODO(GH#14008): once GH 14008 is fixed, move these tests into +# `Base` test class + + +@pytest.fixture +def index(): + index = date_range(datetime(2005, 1, 1), datetime(2005, 1, 10), freq="D") + index.name = "date" + return index + + +@pytest.fixture +def df(index): + frame = DataFrame( + np.random.default_rng(2).random((10, 2)), columns=list("AB"), index=index + ) + return frame + + +@pytest.fixture +def df_col(df): + return df.reset_index() + + +@pytest.fixture +def df_mult(df_col, index): + df_mult = df_col.copy() + df_mult.index = pd.MultiIndex.from_arrays( + [range(10), index], names=["index", "date"] + ) + return df_mult + + +@pytest.fixture +def a_mean(df): + return df.resample("2D")["A"].mean() + + +@pytest.fixture +def a_std(df): + return df.resample("2D")["A"].std() + + +@pytest.fixture +def a_sum(df): + return df.resample("2D")["A"].sum() + + +@pytest.fixture +def b_mean(df): + return df.resample("2D")["B"].mean() + + +@pytest.fixture +def b_std(df): + return df.resample("2D")["B"].std() + + +@pytest.fixture +def b_sum(df): + return df.resample("2D")["B"].sum() + + +@pytest.fixture +def df_resample(df): + return df.resample("2D") + + +@pytest.fixture +def df_col_resample(df_col): + return df_col.resample("2D", on="date") + + +@pytest.fixture +def df_mult_resample(df_mult): + return df_mult.resample("2D", level="date") + + +@pytest.fixture +def df_grouper_resample(df): + return df.groupby(pd.Grouper(freq="2D")) + + +@pytest.fixture( + params=["df_resample", "df_col_resample", "df_mult_resample", "df_grouper_resample"] +) +def cases(request): + return request.getfixturevalue(request.param) + + +def test_agg_mixed_column_aggregation(cases, a_mean, a_std, b_mean, b_std, request): + expected = pd.concat([a_mean, a_std, b_mean, b_std], axis=1) + expected.columns = pd.MultiIndex.from_product([["A", "B"], ["mean", "std"]]) + msg = "using SeriesGroupBy.[mean|std]" + # "date" is an index and a column, so get included in the agg + if "df_mult" in request.node.callspec.id: + date_mean = cases["date"].mean() + date_std = cases["date"].std() + expected = pd.concat([date_mean, date_std, expected], axis=1) + expected.columns = pd.MultiIndex.from_product( + [["date", "A", "B"], ["mean", "std"]] + ) + with tm.assert_produces_warning(FutureWarning, match=msg): + result = cases.aggregate([np.mean, np.std]) + tm.assert_frame_equal(result, expected) + + +@pytest.mark.parametrize( + "agg", + [ + {"func": {"A": np.mean, "B": np.std}}, + {"A": ("A", np.mean), "B": ("B", np.std)}, + {"A": NamedAgg("A", np.mean), "B": NamedAgg("B", np.std)}, + ], +) +def test_agg_both_mean_std_named_result(cases, a_mean, b_std, agg): + msg = "using SeriesGroupBy.[mean|std]" + expected = pd.concat([a_mean, b_std], axis=1) + with tm.assert_produces_warning(FutureWarning, match=msg): + result = cases.aggregate(**agg) + tm.assert_frame_equal(result, expected, check_like=True) + + +def test_agg_both_mean_std_dict_of_list(cases, a_mean, a_std): + expected = pd.concat([a_mean, a_std], axis=1) + expected.columns = pd.MultiIndex.from_tuples([("A", "mean"), ("A", "std")]) + result = cases.aggregate({"A": ["mean", "std"]}) + tm.assert_frame_equal(result, expected) + + +@pytest.mark.parametrize( + "agg", [{"func": ["mean", "sum"]}, {"mean": "mean", "sum": "sum"}] +) +def test_agg_both_mean_sum(cases, a_mean, a_sum, agg): + expected = pd.concat([a_mean, a_sum], axis=1) + expected.columns = ["mean", "sum"] + result = cases["A"].aggregate(**agg) + tm.assert_frame_equal(result, expected) + + +@pytest.mark.parametrize( + "agg", + [ + {"A": {"mean": "mean", "sum": "sum"}}, + { + "A": {"mean": "mean", "sum": "sum"}, + "B": {"mean2": "mean", "sum2": "sum"}, + }, + ], +) +def test_agg_dict_of_dict_specificationerror(cases, agg): + msg = "nested renamer is not supported" + with pytest.raises(pd.errors.SpecificationError, match=msg): + cases.aggregate(agg) + + +def test_agg_dict_of_lists(cases, a_mean, a_std, b_mean, b_std): + expected = pd.concat([a_mean, a_std, b_mean, b_std], axis=1) + expected.columns = pd.MultiIndex.from_tuples( + [("A", "mean"), ("A", "std"), ("B", "mean"), ("B", "std")] + ) + result = cases.aggregate({"A": ["mean", "std"], "B": ["mean", "std"]}) + tm.assert_frame_equal(result, expected, check_like=True) + + +@pytest.mark.parametrize( + "agg", + [ + {"func": {"A": np.sum, "B": lambda x: np.std(x, ddof=1)}}, + {"A": ("A", np.sum), "B": ("B", lambda x: np.std(x, ddof=1))}, + {"A": NamedAgg("A", np.sum), "B": NamedAgg("B", lambda x: np.std(x, ddof=1))}, + ], +) +def test_agg_with_lambda(cases, agg): + # passed lambda + msg = "using SeriesGroupBy.sum" + rcustom = cases["B"].apply(lambda x: np.std(x, ddof=1)) + expected = pd.concat([cases["A"].sum(), rcustom], axis=1) + with tm.assert_produces_warning(FutureWarning, match=msg): + result = cases.agg(**agg) + tm.assert_frame_equal(result, expected, check_like=True) + + +@pytest.mark.parametrize( + "agg", + [ + {"func": {"result1": np.sum, "result2": np.mean}}, + {"A": ("result1", np.sum), "B": ("result2", np.mean)}, + {"A": NamedAgg("result1", np.sum), "B": NamedAgg("result2", np.mean)}, + ], +) +def test_agg_no_column(cases, agg): + msg = r"Column\(s\) \['result1', 'result2'\] do not exist" + with pytest.raises(KeyError, match=msg): + cases[["A", "B"]].agg(**agg) + + +@pytest.mark.parametrize( + "cols, agg", + [ + [None, {"A": ["sum", "std"], "B": ["mean", "std"]}], + [ + [ + "A", + "B", + ], + {"A": ["sum", "std"], "B": ["mean", "std"]}, + ], + ], +) +def test_agg_specificationerror_nested(cases, cols, agg, a_sum, a_std, b_mean, b_std): + # agg with different hows + # equivalent of using a selection list / or not + expected = pd.concat([a_sum, a_std, b_mean, b_std], axis=1) + expected.columns = pd.MultiIndex.from_tuples( + [("A", "sum"), ("A", "std"), ("B", "mean"), ("B", "std")] + ) + if cols is not None: + obj = cases[cols] + else: + obj = cases + + result = obj.agg(agg) + tm.assert_frame_equal(result, expected, check_like=True) + + +@pytest.mark.parametrize( + "agg", [{"A": ["sum", "std"]}, {"A": ["sum", "std"], "B": ["mean", "std"]}] +) +def test_agg_specificationerror_series(cases, agg): + msg = "nested renamer is not supported" + + # series like aggs + with pytest.raises(pd.errors.SpecificationError, match=msg): + cases["A"].agg(agg) + + +def test_agg_specificationerror_invalid_names(cases): + # errors + # invalid names in the agg specification + msg = r"Column\(s\) \['B'\] do not exist" + with pytest.raises(KeyError, match=msg): + cases[["A"]].agg({"A": ["sum", "std"], "B": ["mean", "std"]}) + + +@pytest.mark.parametrize( + "func", [["min"], ["mean", "max"], {"A": "sum"}, {"A": "prod", "B": "median"}] +) +def test_multi_agg_axis_1_raises(func): + # GH#46904 + + index = date_range(datetime(2005, 1, 1), datetime(2005, 1, 10), freq="D") + index.name = "date" + df = DataFrame( + np.random.default_rng(2).random((10, 2)), columns=list("AB"), index=index + ).T + warning_msg = "DataFrame.resample with axis=1 is deprecated." + with tm.assert_produces_warning(FutureWarning, match=warning_msg): + res = df.resample("ME", axis=1) + with pytest.raises( + NotImplementedError, match="axis other than 0 is not supported" + ): + res.agg(func) + + +def test_agg_nested_dicts(): + index = date_range(datetime(2005, 1, 1), datetime(2005, 1, 10), freq="D") + index.name = "date" + df = DataFrame( + np.random.default_rng(2).random((10, 2)), columns=list("AB"), index=index + ) + df_col = df.reset_index() + df_mult = df_col.copy() + df_mult.index = pd.MultiIndex.from_arrays( + [range(10), df.index], names=["index", "date"] + ) + r = df.resample("2D") + cases = [ + r, + df_col.resample("2D", on="date"), + df_mult.resample("2D", level="date"), + df.groupby(pd.Grouper(freq="2D")), + ] + + msg = "nested renamer is not supported" + for t in cases: + with pytest.raises(pd.errors.SpecificationError, match=msg): + t.aggregate({"r1": {"A": ["mean", "sum"]}, "r2": {"B": ["mean", "sum"]}}) + + for t in cases: + with pytest.raises(pd.errors.SpecificationError, match=msg): + t[["A", "B"]].agg( + {"A": {"ra": ["mean", "std"]}, "B": {"rb": ["mean", "std"]}} + ) + + with pytest.raises(pd.errors.SpecificationError, match=msg): + t.agg({"A": {"ra": ["mean", "std"]}, "B": {"rb": ["mean", "std"]}}) + + +def test_try_aggregate_non_existing_column(): + # GH 16766 + data = [ + {"dt": datetime(2017, 6, 1, 0), "x": 1.0, "y": 2.0}, + {"dt": datetime(2017, 6, 1, 1), "x": 2.0, "y": 2.0}, + {"dt": datetime(2017, 6, 1, 2), "x": 3.0, "y": 1.5}, + ] + df = DataFrame(data).set_index("dt") + + # Error as we don't have 'z' column + msg = r"Column\(s\) \['z'\] do not exist" + with pytest.raises(KeyError, match=msg): + df.resample("30min").agg({"x": ["mean"], "y": ["median"], "z": ["sum"]}) + + +def test_agg_list_like_func_with_args(): + # 50624 + df = DataFrame( + {"x": [1, 2, 3]}, index=date_range("2020-01-01", periods=3, freq="D") + ) + + def foo1(x, a=1, c=0): + return x + a + c + + def foo2(x, b=2, c=0): + return x + b + c + + msg = r"foo1\(\) got an unexpected keyword argument 'b'" + with pytest.raises(TypeError, match=msg): + df.resample("D").agg([foo1, foo2], 3, b=3, c=4) + + result = df.resample("D").agg([foo1, foo2], 3, c=4) + expected = DataFrame( + [[8, 8], [9, 9], [10, 10]], + index=date_range("2020-01-01", periods=3, freq="D"), + columns=pd.MultiIndex.from_tuples([("x", "foo1"), ("x", "foo2")]), + ) + tm.assert_frame_equal(result, expected) + + +def test_selection_api_validation(): + # GH 13500 + index = date_range(datetime(2005, 1, 1), datetime(2005, 1, 10), freq="D") + + rng = np.arange(len(index), dtype=np.int64) + df = DataFrame( + {"date": index, "a": rng}, + index=pd.MultiIndex.from_arrays([rng, index], names=["v", "d"]), + ) + df_exp = DataFrame({"a": rng}, index=index) + + # non DatetimeIndex + msg = ( + "Only valid with DatetimeIndex, TimedeltaIndex or PeriodIndex, " + "but got an instance of 'Index'" + ) + with pytest.raises(TypeError, match=msg): + df.resample("2D", level="v") + + msg = "The Grouper cannot specify both a key and a level!" + with pytest.raises(ValueError, match=msg): + df.resample("2D", on="date", level="d") + + msg = "unhashable type: 'list'" + with pytest.raises(TypeError, match=msg): + df.resample("2D", on=["a", "date"]) + + msg = r"\"Level \['a', 'date'\] not found\"" + with pytest.raises(KeyError, match=msg): + df.resample("2D", level=["a", "date"]) + + # upsampling not allowed + msg = ( + "Upsampling from level= or on= selection is not supported, use " + r"\.set_index\(\.\.\.\) to explicitly set index to datetime-like" + ) + with pytest.raises(ValueError, match=msg): + df.resample("2D", level="d").asfreq() + with pytest.raises(ValueError, match=msg): + df.resample("2D", on="date").asfreq() + + exp = df_exp.resample("2D").sum() + exp.index.name = "date" + result = df.resample("2D", on="date").sum() + tm.assert_frame_equal(exp, result) + + exp.index.name = "d" + with pytest.raises(TypeError, match="datetime64 type does not support sum"): + df.resample("2D", level="d").sum() + result = df.resample("2D", level="d").sum(numeric_only=True) + tm.assert_frame_equal(exp, result) + + +@pytest.mark.parametrize( + "col_name", ["t2", "t2x", "t2q", "T_2M", "t2p", "t2m", "t2m1", "T2M"] +) +def test_agg_with_datetime_index_list_agg_func(col_name): + # GH 22660 + # The parametrized column names would get converted to dates by our + # date parser. Some would result in OutOfBoundsError (ValueError) while + # others would result in OverflowError when passed into Timestamp. + # We catch these errors and move on to the correct branch. + df = DataFrame( + list(range(200)), + index=date_range( + start="2017-01-01", freq="15min", periods=200, tz="Europe/Berlin" + ), + columns=[col_name], + ) + result = df.resample("1d").aggregate(["mean"]) + expected = DataFrame( + [47.5, 143.5, 195.5], + index=date_range(start="2017-01-01", freq="D", periods=3, tz="Europe/Berlin"), + columns=pd.MultiIndex(levels=[[col_name], ["mean"]], codes=[[0], [0]]), + ) + tm.assert_frame_equal(result, expected) + + +def test_resample_agg_readonly(): + # GH#31710 cython needs to allow readonly data + index = date_range("2020-01-01", "2020-01-02", freq="1h") + arr = np.zeros_like(index) + arr.setflags(write=False) + + ser = Series(arr, index=index) + rs = ser.resample("1D") + + expected = Series([pd.Timestamp(0), pd.Timestamp(0)], index=index[::24]) + + result = rs.agg("last") + tm.assert_series_equal(result, expected) + + result = rs.agg("first") + tm.assert_series_equal(result, expected) + + result = rs.agg("max") + tm.assert_series_equal(result, expected) + + result = rs.agg("min") + tm.assert_series_equal(result, expected) + + +@pytest.mark.parametrize( + "start,end,freq,data,resample_freq,origin,closed,exp_data,exp_end,exp_periods", + [ + ( + "2000-10-01 23:30:00", + "2000-10-02 00:26:00", + "7min", + [0, 3, 6, 9, 12, 15, 18, 21, 24], + "17min", + "end", + None, + [0, 18, 27, 63], + "20001002 00:26:00", + 4, + ), + ( + "20200101 8:26:35", + "20200101 9:31:58", + "77s", + [1] * 51, + "7min", + "end", + "right", + [1, 6, 5, 6, 5, 6, 5, 6, 5, 6], + "2020-01-01 09:30:45", + 10, + ), + ( + "2000-10-01 23:30:00", + "2000-10-02 00:26:00", + "7min", + [0, 3, 6, 9, 12, 15, 18, 21, 24], + "17min", + "end", + "left", + [0, 18, 27, 39, 24], + "20001002 00:43:00", + 5, + ), + ( + "2000-10-01 23:30:00", + "2000-10-02 00:26:00", + "7min", + [0, 3, 6, 9, 12, 15, 18, 21, 24], + "17min", + "end_day", + None, + [3, 15, 45, 45], + "2000-10-02 00:29:00", + 4, + ), + ], +) +def test_end_and_end_day_origin( + start, + end, + freq, + data, + resample_freq, + origin, + closed, + exp_data, + exp_end, + exp_periods, +): + rng = date_range(start, end, freq=freq) + ts = Series(data, index=rng) + + res = ts.resample(resample_freq, origin=origin, closed=closed).sum() + expected = Series( + exp_data, + index=date_range(end=exp_end, freq=resample_freq, periods=exp_periods), + ) + + tm.assert_series_equal(res, expected) + + +@pytest.mark.parametrize( + # expected_data is a string when op raises a ValueError + "method, numeric_only, expected_data", + [ + ("sum", True, {"num": [25]}), + ("sum", False, {"cat": ["cat_1cat_2"], "num": [25]}), + ("sum", lib.no_default, {"cat": ["cat_1cat_2"], "num": [25]}), + ("prod", True, {"num": [100]}), + ("prod", False, "can't multiply sequence"), + ("prod", lib.no_default, "can't multiply sequence"), + ("min", True, {"num": [5]}), + ("min", False, {"cat": ["cat_1"], "num": [5]}), + ("min", lib.no_default, {"cat": ["cat_1"], "num": [5]}), + ("max", True, {"num": [20]}), + ("max", False, {"cat": ["cat_2"], "num": [20]}), + ("max", lib.no_default, {"cat": ["cat_2"], "num": [20]}), + ("first", True, {"num": [5]}), + ("first", False, {"cat": ["cat_1"], "num": [5]}), + ("first", lib.no_default, {"cat": ["cat_1"], "num": [5]}), + ("last", True, {"num": [20]}), + ("last", False, {"cat": ["cat_2"], "num": [20]}), + ("last", lib.no_default, {"cat": ["cat_2"], "num": [20]}), + ("mean", True, {"num": [12.5]}), + ("mean", False, "Could not convert"), + ("mean", lib.no_default, "Could not convert"), + ("median", True, {"num": [12.5]}), + ("median", False, r"Cannot convert \['cat_1' 'cat_2'\] to numeric"), + ("median", lib.no_default, r"Cannot convert \['cat_1' 'cat_2'\] to numeric"), + ("std", True, {"num": [10.606601717798213]}), + ("std", False, "could not convert string to float"), + ("std", lib.no_default, "could not convert string to float"), + ("var", True, {"num": [112.5]}), + ("var", False, "could not convert string to float"), + ("var", lib.no_default, "could not convert string to float"), + ("sem", True, {"num": [7.5]}), + ("sem", False, "could not convert string to float"), + ("sem", lib.no_default, "could not convert string to float"), + ], +) +def test_frame_downsample_method( + method, numeric_only, expected_data, using_infer_string +): + # GH#46442 test if `numeric_only` behave as expected for DataFrameGroupBy + + index = date_range("2018-01-01", periods=2, freq="D") + expected_index = date_range("2018-12-31", periods=1, freq="YE") + df = DataFrame({"cat": ["cat_1", "cat_2"], "num": [5, 20]}, index=index) + resampled = df.resample("YE") + if numeric_only is lib.no_default: + kwargs = {} + else: + kwargs = {"numeric_only": numeric_only} + + func = getattr(resampled, method) + if isinstance(expected_data, str): + if method in ("var", "mean", "median", "prod"): + klass = TypeError + msg = re.escape(f"agg function failed [how->{method},dtype->") + if using_infer_string: + msg = f"dtype 'str' does not support operation '{method}'" + elif method in ["sum", "std", "sem"] and using_infer_string: + klass = TypeError + msg = f"dtype 'str' does not support operation '{method}'" + else: + klass = ValueError + msg = expected_data + with pytest.raises(klass, match=msg): + _ = func(**kwargs) + else: + result = func(**kwargs) + expected = DataFrame(expected_data, index=expected_index) + tm.assert_frame_equal(result, expected) + + +@pytest.mark.parametrize( + "method, numeric_only, expected_data", + [ + ("sum", True, ()), + ("sum", False, ["cat_1cat_2"]), + ("sum", lib.no_default, ["cat_1cat_2"]), + ("prod", True, ()), + ("prod", False, ()), + ("prod", lib.no_default, ()), + ("min", True, ()), + ("min", False, ["cat_1"]), + ("min", lib.no_default, ["cat_1"]), + ("max", True, ()), + ("max", False, ["cat_2"]), + ("max", lib.no_default, ["cat_2"]), + ("first", True, ()), + ("first", False, ["cat_1"]), + ("first", lib.no_default, ["cat_1"]), + ("last", True, ()), + ("last", False, ["cat_2"]), + ("last", lib.no_default, ["cat_2"]), + ], +) +def test_series_downsample_method( + method, numeric_only, expected_data, using_infer_string +): + # GH#46442 test if `numeric_only` behave as expected for SeriesGroupBy + + index = date_range("2018-01-01", periods=2, freq="D") + expected_index = date_range("2018-12-31", periods=1, freq="YE") + df = Series(["cat_1", "cat_2"], index=index) + resampled = df.resample("YE") + kwargs = {} if numeric_only is lib.no_default else {"numeric_only": numeric_only} + + func = getattr(resampled, method) + if numeric_only and numeric_only is not lib.no_default: + msg = rf"Cannot use numeric_only=True with SeriesGroupBy\.{method}" + with pytest.raises(TypeError, match=msg): + func(**kwargs) + elif method == "prod": + msg = re.escape("agg function failed [how->prod,dtype->") + if using_infer_string: + msg = "dtype 'str' does not support operation 'prod'" + with pytest.raises(TypeError, match=msg): + func(**kwargs) + + else: + result = func(**kwargs) + expected = Series(expected_data, index=expected_index) + tm.assert_series_equal(result, expected) + + +@pytest.mark.parametrize( + "method, raises", + [ + ("sum", True), + ("prod", True), + ("min", True), + ("max", True), + ("first", False), + ("last", False), + ("median", False), + ("mean", True), + ("std", True), + ("var", True), + ("sem", False), + ("ohlc", False), + ("nunique", False), + ], +) +def test_args_kwargs_depr(method, raises): + index = date_range("20180101", periods=3, freq="h") + df = Series([2, 4, 6], index=index) + resampled = df.resample("30min") + args = () + + func = getattr(resampled, method) + + error_msg = "numpy operations are not valid with resample." + error_msg_type = "too many arguments passed in" + warn_msg = f"Passing additional args to DatetimeIndexResampler.{method}" + + if raises: + with tm.assert_produces_warning(FutureWarning, match=warn_msg): + with pytest.raises(UnsupportedFunctionCall, match=error_msg): + func(*args, 1, 2, 3, 4) + else: + with tm.assert_produces_warning(FutureWarning, match=warn_msg): + with pytest.raises(TypeError, match=error_msg_type): + func(*args, 1, 2, 3, 4) + + +def test_df_axis_param_depr(): + index = date_range(datetime(2005, 1, 1), datetime(2005, 1, 10), freq="D") + index.name = "date" + df = DataFrame( + np.random.default_rng(2).random((10, 2)), columns=list("AB"), index=index + ).T + + # Deprecation error when axis=1 is explicitly passed + warning_msg = "DataFrame.resample with axis=1 is deprecated." + with tm.assert_produces_warning(FutureWarning, match=warning_msg): + df.resample("ME", axis=1) + + # Deprecation error when axis=0 is explicitly passed + df = df.T + warning_msg = ( + "The 'axis' keyword in DataFrame.resample is deprecated and " + "will be removed in a future version." + ) + with tm.assert_produces_warning(FutureWarning, match=warning_msg): + df.resample("ME", axis=0) + + +def test_series_axis_param_depr(_test_series): + warning_msg = ( + "The 'axis' keyword in Series.resample is " + "deprecated and will be removed in a future version." + ) + with tm.assert_produces_warning(FutureWarning, match=warning_msg): + _test_series.resample("h", axis=0) + + +def test_resample_empty(): + # GH#52484 + df = DataFrame( + index=pd.to_datetime( + ["2018-01-01 00:00:00", "2018-01-01 12:00:00", "2018-01-02 00:00:00"] + ) + ) + expected = DataFrame( + index=pd.to_datetime( + [ + "2018-01-01 00:00:00", + "2018-01-01 08:00:00", + "2018-01-01 16:00:00", + "2018-01-02 00:00:00", + ] + ) + ) + result = df.resample("8h").mean() + tm.assert_frame_equal(result, expected) diff --git a/shared/package-files/75/750d3bcc9d7ebe5a45a96041bbf734707c53d325dc192bbba3b2f10c2132077b/terminalwriter.py b/shared/package-files/75/750d3bcc9d7ebe5a45a96041bbf734707c53d325dc192bbba3b2f10c2132077b/terminalwriter.py new file mode 100644 index 0000000000000000000000000000000000000000..70ebd3d061b78da4e274dd81dec4492257044097 --- /dev/null +++ b/shared/package-files/75/750d3bcc9d7ebe5a45a96041bbf734707c53d325dc192bbba3b2f10c2132077b/terminalwriter.py @@ -0,0 +1,274 @@ +"""Helper functions for writing to terminals and files.""" + +from __future__ import annotations + +import os +import shutil +import sys +from typing import final +from typing import Literal +from typing import Sequence +from typing import TextIO +from typing import TYPE_CHECKING + +from ..compat import assert_never +from .wcwidth import wcswidth + + +if TYPE_CHECKING: + from pygments.formatter import Formatter + from pygments.lexer import Lexer + + +# This code was initially copied from py 1.8.1, file _io/terminalwriter.py. + + +def get_terminal_width() -> int: + width, _ = shutil.get_terminal_size(fallback=(80, 24)) + + # The Windows get_terminal_size may be bogus, let's sanify a bit. + if width < 40: + width = 80 + + return width + + +def should_do_markup(file: TextIO) -> bool: + if os.environ.get("PY_COLORS") == "1": + return True + if os.environ.get("PY_COLORS") == "0": + return False + if os.environ.get("NO_COLOR"): + return False + if os.environ.get("FORCE_COLOR"): + return True + return ( + hasattr(file, "isatty") and file.isatty() and os.environ.get("TERM") != "dumb" + ) + + +@final +class TerminalWriter: + _esctable = dict( + black=30, + red=31, + green=32, + yellow=33, + blue=34, + purple=35, + cyan=36, + white=37, + Black=40, + Red=41, + Green=42, + Yellow=43, + Blue=44, + Purple=45, + Cyan=46, + White=47, + bold=1, + light=2, + blink=5, + invert=7, + ) + + def __init__(self, file: TextIO | None = None) -> None: + if file is None: + file = sys.stdout + if hasattr(file, "isatty") and file.isatty() and sys.platform == "win32": + try: + import colorama + except ImportError: + pass + else: + file = colorama.AnsiToWin32(file).stream + assert file is not None + self._file = file + self.hasmarkup = should_do_markup(file) + self._current_line = "" + self._terminal_width: int | None = None + self.code_highlight = True + + @property + def fullwidth(self) -> int: + if self._terminal_width is not None: + return self._terminal_width + return get_terminal_width() + + @fullwidth.setter + def fullwidth(self, value: int) -> None: + self._terminal_width = value + + @property + def width_of_current_line(self) -> int: + """Return an estimate of the width so far in the current line.""" + return wcswidth(self._current_line) + + def markup(self, text: str, **markup: bool) -> str: + for name in markup: + if name not in self._esctable: + raise ValueError(f"unknown markup: {name!r}") + if self.hasmarkup: + esc = [self._esctable[name] for name, on in markup.items() if on] + if esc: + text = "".join(f"\x1b[{cod}m" for cod in esc) + text + "\x1b[0m" + return text + + def sep( + self, + sepchar: str, + title: str | None = None, + fullwidth: int | None = None, + **markup: bool, + ) -> None: + if fullwidth is None: + fullwidth = self.fullwidth + # The goal is to have the line be as long as possible + # under the condition that len(line) <= fullwidth. + if sys.platform == "win32": + # If we print in the last column on windows we are on a + # new line but there is no way to verify/neutralize this + # (we may not know the exact line width). + # So let's be defensive to avoid empty lines in the output. + fullwidth -= 1 + if title is not None: + # we want 2 + 2*len(fill) + len(title) <= fullwidth + # i.e. 2 + 2*len(sepchar)*N + len(title) <= fullwidth + # 2*len(sepchar)*N <= fullwidth - len(title) - 2 + # N <= (fullwidth - len(title) - 2) // (2*len(sepchar)) + N = max((fullwidth - len(title) - 2) // (2 * len(sepchar)), 1) + fill = sepchar * N + line = f"{fill} {title} {fill}" + else: + # we want len(sepchar)*N <= fullwidth + # i.e. N <= fullwidth // len(sepchar) + line = sepchar * (fullwidth // len(sepchar)) + # In some situations there is room for an extra sepchar at the right, + # in particular if we consider that with a sepchar like "_ " the + # trailing space is not important at the end of the line. + if len(line) + len(sepchar.rstrip()) <= fullwidth: + line += sepchar.rstrip() + + self.line(line, **markup) + + def write(self, msg: str, *, flush: bool = False, **markup: bool) -> None: + if msg: + current_line = msg.rsplit("\n", 1)[-1] + if "\n" in msg: + self._current_line = current_line + else: + self._current_line += current_line + + msg = self.markup(msg, **markup) + + try: + self._file.write(msg) + except UnicodeEncodeError: + # Some environments don't support printing general Unicode + # strings, due to misconfiguration or otherwise; in that case, + # print the string escaped to ASCII. + # When the Unicode situation improves we should consider + # letting the error propagate instead of masking it (see #7475 + # for one brief attempt). + msg = msg.encode("unicode-escape").decode("ascii") + self._file.write(msg) + + if flush: + self.flush() + + def line(self, s: str = "", **markup: bool) -> None: + self.write(s, **markup) + self.write("\n") + + def flush(self) -> None: + self._file.flush() + + def _write_source(self, lines: Sequence[str], indents: Sequence[str] = ()) -> None: + """Write lines of source code possibly highlighted. + + Keeping this private for now because the API is clunky. We should discuss how + to evolve the terminal writer so we can have more precise color support, for example + being able to write part of a line in one color and the rest in another, and so on. + """ + if indents and len(indents) != len(lines): + raise ValueError( + f"indents size ({len(indents)}) should have same size as lines ({len(lines)})" + ) + if not indents: + indents = [""] * len(lines) + source = "\n".join(lines) + new_lines = self._highlight(source).splitlines() + for indent, new_line in zip(indents, new_lines): + self.line(indent + new_line) + + def _get_pygments_lexer(self, lexer: Literal["python", "diff"]) -> Lexer | None: + try: + if lexer == "python": + from pygments.lexers.python import PythonLexer + + return PythonLexer() + elif lexer == "diff": + from pygments.lexers.diff import DiffLexer + + return DiffLexer() + else: + assert_never(lexer) + except ModuleNotFoundError: + return None + + def _get_pygments_formatter(self) -> Formatter | None: + try: + import pygments.util + except ModuleNotFoundError: + return None + + from _pytest.config.exceptions import UsageError + + theme = os.getenv("PYTEST_THEME") + theme_mode = os.getenv("PYTEST_THEME_MODE", "dark") + + try: + from pygments.formatters.terminal import TerminalFormatter + + return TerminalFormatter(bg=theme_mode, style=theme) + + except pygments.util.ClassNotFound as e: + raise UsageError( + f"PYTEST_THEME environment variable has an invalid value: '{theme}'. " + "Hint: See available pygments styles with `pygmentize -L styles`." + ) from e + except pygments.util.OptionError as e: + raise UsageError( + f"PYTEST_THEME_MODE environment variable has an invalid value: '{theme_mode}'. " + "The allowed values are 'dark' (default) and 'light'." + ) from e + + def _highlight( + self, source: str, lexer: Literal["diff", "python"] = "python" + ) -> str: + """Highlight the given source if we have markup support.""" + if not source or not self.hasmarkup or not self.code_highlight: + return source + + pygments_lexer = self._get_pygments_lexer(lexer) + if pygments_lexer is None: + return source + + pygments_formatter = self._get_pygments_formatter() + if pygments_formatter is None: + return source + + from pygments import highlight + + highlighted: str = highlight(source, pygments_lexer, pygments_formatter) + # pygments terminal formatter may add a newline when there wasn't one. + # We don't want this, remove. + if highlighted[-1] == "\n" and source[-1] != "\n": + highlighted = highlighted[:-1] + + # Some lexers will not set the initial color explicitly + # which may lead to the previous color being propagated to the + # start of the expression, so reset first. + highlighted = "\x1b[0m" + highlighted + + return highlighted diff --git a/shared/package-files/75/750dae72b20664681807a852e202c8cc5283118a5f00135b3f9e254bb1fa0084/c.py b/shared/package-files/75/750dae72b20664681807a852e202c8cc5283118a5f00135b3f9e254bb1fa0084/c.py new file mode 100644 index 0000000000000000000000000000000000000000..0921dbf5556bd8ef49a1b0468e2a765ed20b486c --- /dev/null +++ b/shared/package-files/75/750dae72b20664681807a852e202c8cc5283118a5f00135b3f9e254bb1fa0084/c.py @@ -0,0 +1,747 @@ +""" +C code printer + +The C89CodePrinter & C99CodePrinter converts single SymPy expressions into +single C expressions, using the functions defined in math.h where possible. + +A complete code generator, which uses ccode extensively, can be found in +sympy.utilities.codegen. The codegen module can be used to generate complete +source code files that are compilable without further modifications. + + +""" + +from __future__ import annotations +from typing import Any + +from functools import wraps +from itertools import chain + +from sympy.core import S +from sympy.core.numbers import equal_valued +from sympy.codegen.ast import ( + Assignment, Pointer, Variable, Declaration, Type, + real, complex_, integer, bool_, float32, float64, float80, + complex64, complex128, intc, value_const, pointer_const, + int8, int16, int32, int64, uint8, uint16, uint32, uint64, untyped, + none +) +from sympy.printing.codeprinter import CodePrinter, requires +from sympy.printing.precedence import precedence, PRECEDENCE +from sympy.sets.fancysets import Range + +# These are defined in the other file so we can avoid importing sympy.codegen +# from the top-level 'import sympy'. Export them here as well. +from sympy.printing.codeprinter import ccode, print_ccode # noqa:F401 + +# dictionary mapping SymPy function to (argument_conditions, C_function). +# Used in C89CodePrinter._print_Function(self) +known_functions_C89 = { + "Abs": [(lambda x: not x.is_integer, "fabs"), (lambda x: x.is_integer, "abs")], + "sin": "sin", + "cos": "cos", + "tan": "tan", + "asin": "asin", + "acos": "acos", + "atan": "atan", + "atan2": "atan2", + "exp": "exp", + "log": "log", + "sinh": "sinh", + "cosh": "cosh", + "tanh": "tanh", + "floor": "floor", + "ceiling": "ceil", + "sqrt": "sqrt", # To enable automatic rewrites +} + +known_functions_C99 = dict(known_functions_C89, **{ + 'exp2': 'exp2', + 'expm1': 'expm1', + 'log10': 'log10', + 'log2': 'log2', + 'log1p': 'log1p', + 'Cbrt': 'cbrt', + 'hypot': 'hypot', + 'fma': 'fma', + 'loggamma': 'lgamma', + 'erfc': 'erfc', + 'Max': 'fmax', + 'Min': 'fmin', + "asinh": "asinh", + "acosh": "acosh", + "atanh": "atanh", + "erf": "erf", + "gamma": "tgamma", +}) + +# These are the core reserved words in the C language. Taken from: +# https://en.cppreference.com/w/c/keyword + +reserved_words = [ + 'auto', 'break', 'case', 'char', 'const', 'continue', 'default', 'do', + 'double', 'else', 'enum', 'extern', 'float', 'for', 'goto', 'if', 'int', + 'long', 'register', 'return', 'short', 'signed', 'sizeof', 'static', + 'struct', 'entry', # never standardized, we'll leave it here anyway + 'switch', 'typedef', 'union', 'unsigned', 'void', 'volatile', 'while' +] + +reserved_words_c99 = ['inline', 'restrict'] + +def get_math_macros(): + """ Returns a dictionary with math-related macros from math.h/cmath + + Note that these macros are not strictly required by the C/C++-standard. + For MSVC they are enabled by defining "_USE_MATH_DEFINES" (preferably + via a compilation flag). + + Returns + ======= + + Dictionary mapping SymPy expressions to strings (macro names) + + """ + from sympy.codegen.cfunctions import log2, Sqrt + from sympy.functions.elementary.exponential import log + from sympy.functions.elementary.miscellaneous import sqrt + + return { + S.Exp1: 'M_E', + log2(S.Exp1): 'M_LOG2E', + 1/log(2): 'M_LOG2E', + log(2): 'M_LN2', + log(10): 'M_LN10', + S.Pi: 'M_PI', + S.Pi/2: 'M_PI_2', + S.Pi/4: 'M_PI_4', + 1/S.Pi: 'M_1_PI', + 2/S.Pi: 'M_2_PI', + 2/sqrt(S.Pi): 'M_2_SQRTPI', + 2/Sqrt(S.Pi): 'M_2_SQRTPI', + sqrt(2): 'M_SQRT2', + Sqrt(2): 'M_SQRT2', + 1/sqrt(2): 'M_SQRT1_2', + 1/Sqrt(2): 'M_SQRT1_2' + } + + +def _as_macro_if_defined(meth): + """ Decorator for printer methods + + When a Printer's method is decorated using this decorator the expressions printed + will first be looked for in the attribute ``math_macros``, and if present it will + print the macro name in ``math_macros`` followed by a type suffix for the type + ``real``. e.g. printing ``sympy.pi`` would print ``M_PIl`` if real is mapped to float80. + + """ + @wraps(meth) + def _meth_wrapper(self, expr, **kwargs): + if expr in self.math_macros: + return '%s%s' % (self.math_macros[expr], self._get_math_macro_suffix(real)) + else: + return meth(self, expr, **kwargs) + + return _meth_wrapper + + +class C89CodePrinter(CodePrinter): + """A printer to convert Python expressions to strings of C code""" + printmethod = "_ccode" + language = "C" + standard = "C89" + reserved_words = set(reserved_words) + + _default_settings: dict[str, Any] = { + 'order': None, + 'full_prec': 'auto', + 'precision': 17, + 'user_functions': {}, + 'human': True, + 'allow_unknown_functions': False, + 'contract': True, + 'dereference': set(), + 'error_on_reserved': False, + 'reserved_word_suffix': '_', + } + + type_aliases = { + real: float64, + complex_: complex128, + integer: intc + } + + type_mappings: dict[Type, Any] = { + real: 'double', + intc: 'int', + float32: 'float', + float64: 'double', + integer: 'int', + bool_: 'bool', + int8: 'int8_t', + int16: 'int16_t', + int32: 'int32_t', + int64: 'int64_t', + uint8: 'int8_t', + uint16: 'int16_t', + uint32: 'int32_t', + uint64: 'int64_t', + } + + type_headers = { + bool_: {'stdbool.h'}, + int8: {'stdint.h'}, + int16: {'stdint.h'}, + int32: {'stdint.h'}, + int64: {'stdint.h'}, + uint8: {'stdint.h'}, + uint16: {'stdint.h'}, + uint32: {'stdint.h'}, + uint64: {'stdint.h'}, + } + + # Macros needed to be defined when using a Type + type_macros: dict[Type, tuple[str, ...]] = {} + + type_func_suffixes = { + float32: 'f', + float64: '', + float80: 'l' + } + + type_literal_suffixes = { + float32: 'F', + float64: '', + float80: 'L' + } + + type_math_macro_suffixes = { + float80: 'l' + } + + math_macros = None + + _ns = '' # namespace, C++ uses 'std::' + # known_functions-dict to copy + _kf: dict[str, Any] = known_functions_C89 + + def __init__(self, settings=None): + settings = settings or {} + if self.math_macros is None: + self.math_macros = settings.pop('math_macros', get_math_macros()) + self.type_aliases = dict(chain(self.type_aliases.items(), + settings.pop('type_aliases', {}).items())) + self.type_mappings = dict(chain(self.type_mappings.items(), + settings.pop('type_mappings', {}).items())) + self.type_headers = dict(chain(self.type_headers.items(), + settings.pop('type_headers', {}).items())) + self.type_macros = dict(chain(self.type_macros.items(), + settings.pop('type_macros', {}).items())) + self.type_func_suffixes = dict(chain(self.type_func_suffixes.items(), + settings.pop('type_func_suffixes', {}).items())) + self.type_literal_suffixes = dict(chain(self.type_literal_suffixes.items(), + settings.pop('type_literal_suffixes', {}).items())) + self.type_math_macro_suffixes = dict(chain(self.type_math_macro_suffixes.items(), + settings.pop('type_math_macro_suffixes', {}).items())) + super().__init__(settings) + self.known_functions = dict(self._kf, **settings.get('user_functions', {})) + self._dereference = set(settings.get('dereference', [])) + self.headers = set() + self.libraries = set() + self.macros = set() + + def _rate_index_position(self, p): + return p*5 + + def _get_statement(self, codestring): + """ Get code string as a statement - i.e. ending with a semicolon. """ + return codestring if codestring.endswith(';') else codestring + ';' + + def _get_comment(self, text): + return "/* {} */".format(text) + + def _declare_number_const(self, name, value): + type_ = self.type_aliases[real] + var = Variable(name, type=type_, value=value.evalf(type_.decimal_dig), attrs={value_const}) + decl = Declaration(var) + return self._get_statement(self._print(decl)) + + def _format_code(self, lines): + return self.indent_code(lines) + + def _traverse_matrix_indices(self, mat): + rows, cols = mat.shape + return ((i, j) for i in range(rows) for j in range(cols)) + + @_as_macro_if_defined + def _print_Mul(self, expr, **kwargs): + return super()._print_Mul(expr, **kwargs) + + @_as_macro_if_defined + def _print_Pow(self, expr): + if "Pow" in self.known_functions: + return self._print_Function(expr) + PREC = precedence(expr) + suffix = self._get_func_suffix(real) + if equal_valued(expr.exp, -1): + literal_suffix = self._get_literal_suffix(real) + return '1.0%s/%s' % (literal_suffix, self.parenthesize(expr.base, PREC)) + elif equal_valued(expr.exp, 0.5): + return '%ssqrt%s(%s)' % (self._ns, suffix, self._print(expr.base)) + elif expr.exp == S.One/3 and self.standard != 'C89': + return '%scbrt%s(%s)' % (self._ns, suffix, self._print(expr.base)) + else: + return '%spow%s(%s, %s)' % (self._ns, suffix, self._print(expr.base), + self._print(expr.exp)) + + def _print_Mod(self, expr): + num, den = expr.args + if num.is_integer and den.is_integer: + PREC = precedence(expr) + snum, sden = [self.parenthesize(arg, PREC) for arg in expr.args] + # % is remainder (same sign as numerator), not modulo (same sign as + # denominator), in C. Hence, % only works as modulo if both numbers + # have the same sign + if (num.is_nonnegative and den.is_nonnegative or + num.is_nonpositive and den.is_nonpositive): + return f"{snum} % {sden}" + return f"(({snum} % {sden}) + {sden}) % {sden}" + # Not guaranteed integer + return self._print_math_func(expr, known='fmod') + + def _print_Rational(self, expr): + p, q = int(expr.p), int(expr.q) + suffix = self._get_literal_suffix(real) + return '%d.0%s/%d.0%s' % (p, suffix, q, suffix) + + def _print_Indexed(self, expr): + # calculate index for 1d array + offset = getattr(expr.base, 'offset', S.Zero) + strides = getattr(expr.base, 'strides', None) + indices = expr.indices + + if strides is None or isinstance(strides, str): + dims = expr.shape + shift = S.One + temp = () + if strides == 'C' or strides is None: + traversal = reversed(range(expr.rank)) + indices = indices[::-1] + elif strides == 'F': + traversal = range(expr.rank) + + for i in traversal: + temp += (shift,) + shift *= dims[i] + strides = temp + flat_index = sum([x[0]*x[1] for x in zip(indices, strides)]) + offset + return "%s[%s]" % (self._print(expr.base.label), + self._print(flat_index)) + + def _print_Idx(self, expr): + return self._print(expr.label) + + @_as_macro_if_defined + def _print_NumberSymbol(self, expr): + return super()._print_NumberSymbol(expr) + + def _print_Infinity(self, expr): + return 'HUGE_VAL' + + def _print_NegativeInfinity(self, expr): + return '-HUGE_VAL' + + def _print_Piecewise(self, expr): + if expr.args[-1].cond != True: + # We need the last conditional to be a True, otherwise the resulting + # function may not return a result. + raise ValueError("All Piecewise expressions must contain an " + "(expr, True) statement to be used as a default " + "condition. Without one, the generated " + "expression may not evaluate to anything under " + "some condition.") + lines = [] + if expr.has(Assignment): + for i, (e, c) in enumerate(expr.args): + if i == 0: + lines.append("if (%s) {" % self._print(c)) + elif i == len(expr.args) - 1 and c == True: + lines.append("else {") + else: + lines.append("else if (%s) {" % self._print(c)) + code0 = self._print(e) + lines.append(code0) + lines.append("}") + return "\n".join(lines) + else: + # The piecewise was used in an expression, need to do inline + # operators. This has the downside that inline operators will + # not work for statements that span multiple lines (Matrix or + # Indexed expressions). + ecpairs = ["((%s) ? (\n%s\n)\n" % (self._print(c), + self._print(e)) + for e, c in expr.args[:-1]] + last_line = ": (\n%s\n)" % self._print(expr.args[-1].expr) + return ": ".join(ecpairs) + last_line + " ".join([")"*len(ecpairs)]) + + def _print_ITE(self, expr): + from sympy.functions import Piecewise + return self._print(expr.rewrite(Piecewise, deep=False)) + + def _print_MatrixElement(self, expr): + return "{}[{}]".format(self.parenthesize(expr.parent, PRECEDENCE["Atom"], + strict=True), expr.j + expr.i*expr.parent.shape[1]) + + def _print_Symbol(self, expr): + name = super()._print_Symbol(expr) + if expr in self._settings['dereference']: + return '(*{})'.format(name) + else: + return name + + def _print_Relational(self, expr): + lhs_code = self._print(expr.lhs) + rhs_code = self._print(expr.rhs) + op = expr.rel_op + return "{} {} {}".format(lhs_code, op, rhs_code) + + def _print_For(self, expr): + target = self._print(expr.target) + if isinstance(expr.iterable, Range): + start, stop, step = expr.iterable.args + else: + raise NotImplementedError("Only iterable currently supported is Range") + body = self._print(expr.body) + return ('for ({target} = {start}; {target} < {stop}; {target} += ' + '{step}) {{\n{body}\n}}').format(target=target, start=start, + stop=stop, step=step, body=body) + + def _print_sign(self, func): + return '((({0}) > 0) - (({0}) < 0))'.format(self._print(func.args[0])) + + def _print_Max(self, expr): + if "Max" in self.known_functions: + return self._print_Function(expr) + def inner_print_max(args): # The more natural abstraction of creating + if len(args) == 1: # and printing smaller Max objects is slow + return self._print(args[0]) # when there are many arguments. + half = len(args) // 2 + return "((%(a)s > %(b)s) ? %(a)s : %(b)s)" % { + 'a': inner_print_max(args[:half]), + 'b': inner_print_max(args[half:]) + } + return inner_print_max(expr.args) + + def _print_Min(self, expr): + if "Min" in self.known_functions: + return self._print_Function(expr) + def inner_print_min(args): # The more natural abstraction of creating + if len(args) == 1: # and printing smaller Min objects is slow + return self._print(args[0]) # when there are many arguments. + half = len(args) // 2 + return "((%(a)s < %(b)s) ? %(a)s : %(b)s)" % { + 'a': inner_print_min(args[:half]), + 'b': inner_print_min(args[half:]) + } + return inner_print_min(expr.args) + + def indent_code(self, code): + """Accepts a string of code or a list of code lines""" + + if isinstance(code, str): + code_lines = self.indent_code(code.splitlines(True)) + return ''.join(code_lines) + + tab = " " + inc_token = ('{', '(', '{\n', '(\n') + dec_token = ('}', ')') + + code = [line.lstrip(' \t') for line in code] + + increase = [int(any(map(line.endswith, inc_token))) for line in code] + decrease = [int(any(map(line.startswith, dec_token))) for line in code] + + pretty = [] + level = 0 + for n, line in enumerate(code): + if line in ('', '\n'): + pretty.append(line) + continue + level -= decrease[n] + pretty.append("%s%s" % (tab*level, line)) + level += increase[n] + return pretty + + def _get_func_suffix(self, type_): + return self.type_func_suffixes[self.type_aliases.get(type_, type_)] + + def _get_literal_suffix(self, type_): + return self.type_literal_suffixes[self.type_aliases.get(type_, type_)] + + def _get_math_macro_suffix(self, type_): + alias = self.type_aliases.get(type_, type_) + dflt = self.type_math_macro_suffixes.get(alias, '') + return self.type_math_macro_suffixes.get(type_, dflt) + + def _print_Tuple(self, expr): + return '{'+', '.join(self._print(e) for e in expr)+'}' + + _print_List = _print_Tuple + + def _print_Type(self, type_): + self.headers.update(self.type_headers.get(type_, set())) + self.macros.update(self.type_macros.get(type_, set())) + return self._print(self.type_mappings.get(type_, type_.name)) + + def _print_Declaration(self, decl): + from sympy.codegen.cnodes import restrict + var = decl.variable + val = var.value + if var.type == untyped: + raise ValueError("C does not support untyped variables") + + if isinstance(var, Pointer): + result = '{vc}{t} *{pc} {r}{s}'.format( + vc='const ' if value_const in var.attrs else '', + t=self._print(var.type), + pc=' const' if pointer_const in var.attrs else '', + r='restrict ' if restrict in var.attrs else '', + s=self._print(var.symbol) + ) + elif isinstance(var, Variable): + result = '{vc}{t} {s}'.format( + vc='const ' if value_const in var.attrs else '', + t=self._print(var.type), + s=self._print(var.symbol) + ) + else: + raise NotImplementedError("Unknown type of var: %s" % type(var)) + if val != None: # Must be "!= None", cannot be "is not None" + result += ' = %s' % self._print(val) + return result + + def _print_Float(self, flt): + type_ = self.type_aliases.get(real, real) + self.macros.update(self.type_macros.get(type_, set())) + suffix = self._get_literal_suffix(type_) + num = str(flt.evalf(type_.decimal_dig)) + if 'e' not in num and '.' not in num: + num += '.0' + num_parts = num.split('e') + num_parts[0] = num_parts[0].rstrip('0') + if num_parts[0].endswith('.'): + num_parts[0] += '0' + return 'e'.join(num_parts) + suffix + + @requires(headers={'stdbool.h'}) + def _print_BooleanTrue(self, expr): + return 'true' + + @requires(headers={'stdbool.h'}) + def _print_BooleanFalse(self, expr): + return 'false' + + def _print_Element(self, elem): + if elem.strides == None: # Must be "== None", cannot be "is None" + if elem.offset != None: # Must be "!= None", cannot be "is not None" + raise ValueError("Expected strides when offset is given") + idxs = ']['.join((self._print(arg) for arg in elem.indices)) + else: + global_idx = sum([i*s for i, s in zip(elem.indices, elem.strides)]) + if elem.offset != None: # Must be "!= None", cannot be "is not None" + global_idx += elem.offset + idxs = self._print(global_idx) + + return "{symb}[{idxs}]".format( + symb=self._print(elem.symbol), + idxs=idxs + ) + + def _print_CodeBlock(self, expr): + """ Elements of code blocks printed as statements. """ + return '\n'.join([self._get_statement(self._print(i)) for i in expr.args]) + + def _print_While(self, expr): + return 'while ({condition}) {{\n{body}\n}}'.format(**expr.kwargs( + apply=lambda arg: self._print(arg))) + + def _print_Scope(self, expr): + return '{\n%s\n}' % self._print_CodeBlock(expr.body) + + @requires(headers={'stdio.h'}) + def _print_Print(self, expr): + return 'printf({fmt}, {pargs})'.format( + fmt=self._print(expr.format_string), + pargs=', '.join((self._print(arg) for arg in expr.print_args)) + ) + + def _print_FunctionPrototype(self, expr): + pars = ', '.join((self._print(Declaration(arg)) for arg in expr.parameters)) + return "%s %s(%s)" % ( + tuple((self._print(arg) for arg in (expr.return_type, expr.name))) + (pars,) + ) + + def _print_FunctionDefinition(self, expr): + return "%s%s" % (self._print_FunctionPrototype(expr), + self._print_Scope(expr)) + + def _print_Return(self, expr): + arg, = expr.args + return 'return %s' % self._print(arg) + + def _print_CommaOperator(self, expr): + return '(%s)' % ', '.join((self._print(arg) for arg in expr.args)) + + def _print_Label(self, expr): + if expr.body == none: + return '%s:' % str(expr.name) + if len(expr.body.args) == 1: + return '%s:\n%s' % (str(expr.name), self._print_CodeBlock(expr.body)) + return '%s:\n{\n%s\n}' % (str(expr.name), self._print_CodeBlock(expr.body)) + + def _print_goto(self, expr): + return 'goto %s' % expr.label.name + + def _print_PreIncrement(self, expr): + arg, = expr.args + return '++(%s)' % self._print(arg) + + def _print_PostIncrement(self, expr): + arg, = expr.args + return '(%s)++' % self._print(arg) + + def _print_PreDecrement(self, expr): + arg, = expr.args + return '--(%s)' % self._print(arg) + + def _print_PostDecrement(self, expr): + arg, = expr.args + return '(%s)--' % self._print(arg) + + def _print_struct(self, expr): + return "%(keyword)s %(name)s {\n%(lines)s}" % { + "keyword": expr.__class__.__name__, "name": expr.name, "lines": ';\n'.join( + [self._print(decl) for decl in expr.declarations] + ['']) + } + + def _print_BreakToken(self, _): + return 'break' + + def _print_ContinueToken(self, _): + return 'continue' + + _print_union = _print_struct + +class C99CodePrinter(C89CodePrinter): + standard = 'C99' + reserved_words = set(reserved_words + reserved_words_c99) + type_mappings=dict(chain(C89CodePrinter.type_mappings.items(), { + complex64: 'float complex', + complex128: 'double complex', + }.items())) + type_headers = dict(chain(C89CodePrinter.type_headers.items(), { + complex64: {'complex.h'}, + complex128: {'complex.h'} + }.items())) + + # known_functions-dict to copy + _kf: dict[str, Any] = known_functions_C99 + + # functions with versions with 'f' and 'l' suffixes: + _prec_funcs = ('fabs fmod remainder remquo fma fmax fmin fdim nan exp exp2' + ' expm1 log log10 log2 log1p pow sqrt cbrt hypot sin cos tan' + ' asin acos atan atan2 sinh cosh tanh asinh acosh atanh erf' + ' erfc tgamma lgamma ceil floor trunc round nearbyint rint' + ' frexp ldexp modf scalbn ilogb logb nextafter copysign').split() + + def _print_Infinity(self, expr): + return 'INFINITY' + + def _print_NegativeInfinity(self, expr): + return '-INFINITY' + + def _print_NaN(self, expr): + return 'NAN' + + # tgamma was already covered by 'known_functions' dict + + @requires(headers={'math.h'}, libraries={'m'}) + @_as_macro_if_defined + def _print_math_func(self, expr, nest=False, known=None): + if known is None: + known = self.known_functions[expr.__class__.__name__] + if not isinstance(known, str): + for cb, name in known: + if cb(*expr.args): + known = name + break + else: + raise ValueError("No matching printer") + try: + return known(self, *expr.args) + except TypeError: + suffix = self._get_func_suffix(real) if self._ns + known in self._prec_funcs else '' + + if nest: + args = self._print(expr.args[0]) + if len(expr.args) > 1: + paren_pile = '' + for curr_arg in expr.args[1:-1]: + paren_pile += ')' + args += ', {ns}{name}{suffix}({next}'.format( + ns=self._ns, + name=known, + suffix=suffix, + next = self._print(curr_arg) + ) + args += ', %s%s' % ( + self._print(expr.func(expr.args[-1])), + paren_pile + ) + else: + args = ', '.join((self._print(arg) for arg in expr.args)) + return '{ns}{name}{suffix}({args})'.format( + ns=self._ns, + name=known, + suffix=suffix, + args=args + ) + + def _print_Max(self, expr): + return self._print_math_func(expr, nest=True) + + def _print_Min(self, expr): + return self._print_math_func(expr, nest=True) + + def _get_loop_opening_ending(self, indices): + open_lines = [] + close_lines = [] + loopstart = "for (int %(var)s=%(start)s; %(var)s<%(end)s; %(var)s++){" # C99 + for i in indices: + # C arrays start at 0 and end at dimension-1 + open_lines.append(loopstart % { + 'var': self._print(i.label), + 'start': self._print(i.lower), + 'end': self._print(i.upper + 1)}) + close_lines.append("}") + return open_lines, close_lines + + +for k in ('Abs Sqrt exp exp2 expm1 log log10 log2 log1p Cbrt hypot fma' + ' loggamma sin cos tan asin acos atan atan2 sinh cosh tanh asinh acosh ' + 'atanh erf erfc loggamma gamma ceiling floor').split(): + setattr(C99CodePrinter, '_print_%s' % k, C99CodePrinter._print_math_func) + + +class C11CodePrinter(C99CodePrinter): + + @requires(headers={'stdalign.h'}) + def _print_alignof(self, expr): + arg, = expr.args + return 'alignof(%s)' % self._print(arg) + + +c_code_printers = { + 'c89': C89CodePrinter, + 'c99': C99CodePrinter, + 'c11': C11CodePrinter +} diff --git a/shared/package-files/75/7510eeb3ef2a9159b938104fdf56be45d49a85872b9fd1c66097204dafcb3c12/slugify.pyi b/shared/package-files/75/7510eeb3ef2a9159b938104fdf56be45d49a85872b9fd1c66097204dafcb3c12/slugify.pyi new file mode 100644 index 0000000000000000000000000000000000000000..a51c78732ac4a25854737d26ffd43a07a2bf69af --- /dev/null +++ b/shared/package-files/75/7510eeb3ef2a9159b938104fdf56be45d49a85872b9fd1c66097204dafcb3c12/slugify.pyi @@ -0,0 +1,19 @@ +from typing import Iterable, Optional + +def smart_truncate( + string: str, max_length: int = ..., word_boundary: bool = ..., separator: str = ..., save_order: bool = ... +) -> str: ... +def slugify( + text: str, + entities: bool = ..., + decimal: bool = ..., + hexadecimal: bool = ..., + max_length: int = ..., + word_boundary: bool = ..., + separator: str = ..., + save_order: bool = ..., + stopwords: Iterable[str] = ..., + regex_pattern: Optional[str] = ..., + lowercase: bool = ..., + replacements: Iterable[str] = ..., +) -> str: ... diff --git a/shared/package-files/75/7513950e2f6446f91b49dca77772f4f6da7dfdec7343842a1b7c67371efc25e5/__init__.py b/shared/package-files/75/7513950e2f6446f91b49dca77772f4f6da7dfdec7343842a1b7c67371efc25e5/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0671484c9a0780df353b9b783813b6fa7492d38d --- /dev/null +++ b/shared/package-files/75/7513950e2f6446f91b49dca77772f4f6da7dfdec7343842a1b7c67371efc25e5/__init__.py @@ -0,0 +1,9 @@ +""" FFT backend using pypocketfft """ + +from .basic import * +from .realtransforms import * +from .helper import * + +from scipy._lib._testutils import PytestTester +test = PytestTester(__name__) +del PytestTester diff --git a/shared/package-files/75/7513a174b46308686a1fb6c8dffc946cf06beda20a04cd4ab3f8968beec73aad/exceptions.pyi b/shared/package-files/75/7513a174b46308686a1fb6c8dffc946cf06beda20a04cd4ab3f8968beec73aad/exceptions.pyi new file mode 100644 index 0000000000000000000000000000000000000000..ecec9560a850bbef8c3abbffd20ca4cbc14fd781 --- /dev/null +++ b/shared/package-files/75/7513a174b46308686a1fb6c8dffc946cf06beda20a04cd4ab3f8968beec73aad/exceptions.pyi @@ -0,0 +1,15 @@ +import sys +from typing import Optional + +if sys.version_info >= (3, 8): + class CancelledError(BaseException): ... + class TimeoutError(Exception): ... + class InvalidStateError(Exception): ... + class SendfileNotAvailableError(RuntimeError): ... + class IncompleteReadError(EOFError): + expected: Optional[int] + partial: bytes + def __init__(self, partial: bytes, expected: Optional[int]) -> None: ... + class LimitOverrunError(Exception): + consumed: int + def __init__(self, message: str, consumed: int) -> None: ... diff --git a/shared/package-files/75/7518c360c036ef0b0fdaebdaec9f8a81dcb952fba4354a7a21f42d8629b35de1/sign_cpu_dispatch.h b/shared/package-files/75/7518c360c036ef0b0fdaebdaec9f8a81dcb952fba4354a7a21f42d8629b35de1/sign_cpu_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..d97da238b6870f524914553bd83d323dbfa55a16 --- /dev/null +++ b/shared/package-files/75/7518c360c036ef0b0fdaebdaec9f8a81dcb952fba4354a7a21f42d8629b35de1/sign_cpu_dispatch.h @@ -0,0 +1,26 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cpu { + +TORCH_API at::Tensor sign(const at::Tensor & self); +TORCH_API at::Tensor & sign_out(at::Tensor & out, const at::Tensor & self); +TORCH_API at::Tensor & sign_outf(const at::Tensor & self, at::Tensor & out); +TORCH_API at::Tensor & sign_(at::Tensor & self); + +} // namespace cpu +} // namespace at diff --git a/shared/package-files/75/75193016ad610ad89daf29e4b2bc84b3c2f8e3667b445c314e3cb0c24d2b6546/cat_compositeexplicitautogradnonfunctional_dispatch.h b/shared/package-files/75/75193016ad610ad89daf29e4b2bc84b3c2f8e3667b445c314e3cb0c24d2b6546/cat_compositeexplicitautogradnonfunctional_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..e504a5eaf81ddf258dd7682f86be0f21731d5c2e --- /dev/null +++ b/shared/package-files/75/75193016ad610ad89daf29e4b2bc84b3c2f8e3667b445c314e3cb0c24d2b6546/cat_compositeexplicitautogradnonfunctional_dispatch.h @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautogradnonfunctional { + +TORCH_API at::Tensor cat(const at::ITensorListRef & tensors, int64_t dim=0); + +} // namespace compositeexplicitautogradnonfunctional +} // namespace at diff --git a/shared/package-files/75/751c6320bf926c5558d2adc88d232b7e00531eb9b52d90e02ceca0541c226197/__init__.py b/shared/package-files/75/751c6320bf926c5558d2adc88d232b7e00531eb9b52d90e02ceca0541c226197/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..73f58d7740813264d20047ffe918c82e1acc84eb --- /dev/null +++ b/shared/package-files/75/751c6320bf926c5558d2adc88d232b7e00531eb9b52d90e02ceca0541c226197/__init__.py @@ -0,0 +1,177 @@ +"""Rich text and beautiful formatting in the terminal.""" + +import os +from typing import IO, TYPE_CHECKING, Any, Callable, Optional, Union + +from ._extension import load_ipython_extension # noqa: F401 + +__all__ = ["get_console", "reconfigure", "print", "inspect", "print_json"] + +if TYPE_CHECKING: + from .console import Console + +# Global console used by alternative print +_console: Optional["Console"] = None + +try: + _IMPORT_CWD = os.path.abspath(os.getcwd()) +except FileNotFoundError: + # Can happen if the cwd has been deleted + _IMPORT_CWD = "" + + +def get_console() -> "Console": + """Get a global :class:`~rich.console.Console` instance. This function is used when Rich requires a Console, + and hasn't been explicitly given one. + + Returns: + Console: A console instance. + """ + global _console + if _console is None: + from .console import Console + + _console = Console() + + return _console + + +def reconfigure(*args: Any, **kwargs: Any) -> None: + """Reconfigures the global console by replacing it with another. + + Args: + *args (Any): Positional arguments for the replacement :class:`~rich.console.Console`. + **kwargs (Any): Keyword arguments for the replacement :class:`~rich.console.Console`. + """ + from pip._vendor.rich.console import Console + + new_console = Console(*args, **kwargs) + _console = get_console() + _console.__dict__ = new_console.__dict__ + + +def print( + *objects: Any, + sep: str = " ", + end: str = "\n", + file: Optional[IO[str]] = None, + flush: bool = False, +) -> None: + r"""Print object(s) supplied via positional arguments. + This function has an identical signature to the built-in print. + For more advanced features, see the :class:`~rich.console.Console` class. + + Args: + sep (str, optional): Separator between printed objects. Defaults to " ". + end (str, optional): Character to write at end of output. Defaults to "\\n". + file (IO[str], optional): File to write to, or None for stdout. Defaults to None. + flush (bool, optional): Has no effect as Rich always flushes output. Defaults to False. + + """ + from .console import Console + + write_console = get_console() if file is None else Console(file=file) + return write_console.print(*objects, sep=sep, end=end) + + +def print_json( + json: Optional[str] = None, + *, + data: Any = None, + indent: Union[None, int, str] = 2, + highlight: bool = True, + skip_keys: bool = False, + ensure_ascii: bool = False, + check_circular: bool = True, + allow_nan: bool = True, + default: Optional[Callable[[Any], Any]] = None, + sort_keys: bool = False, +) -> None: + """Pretty prints JSON. Output will be valid JSON. + + Args: + json (str): A string containing JSON. + data (Any): If json is not supplied, then encode this data. + indent (int, optional): Number of spaces to indent. Defaults to 2. + highlight (bool, optional): Enable highlighting of output: Defaults to True. + skip_keys (bool, optional): Skip keys not of a basic type. Defaults to False. + ensure_ascii (bool, optional): Escape all non-ascii characters. Defaults to False. + check_circular (bool, optional): Check for circular references. Defaults to True. + allow_nan (bool, optional): Allow NaN and Infinity values. Defaults to True. + default (Callable, optional): A callable that converts values that can not be encoded + in to something that can be JSON encoded. Defaults to None. + sort_keys (bool, optional): Sort dictionary keys. Defaults to False. + """ + + get_console().print_json( + json, + data=data, + indent=indent, + highlight=highlight, + skip_keys=skip_keys, + ensure_ascii=ensure_ascii, + check_circular=check_circular, + allow_nan=allow_nan, + default=default, + sort_keys=sort_keys, + ) + + +def inspect( + obj: Any, + *, + console: Optional["Console"] = None, + title: Optional[str] = None, + help: bool = False, + methods: bool = False, + docs: bool = True, + private: bool = False, + dunder: bool = False, + sort: bool = True, + all: bool = False, + value: bool = True, +) -> None: + """Inspect any Python object. + + * inspect() to see summarized info. + * inspect(, methods=True) to see methods. + * inspect(, help=True) to see full (non-abbreviated) help. + * inspect(, private=True) to see private attributes (single underscore). + * inspect(, dunder=True) to see attributes beginning with double underscore. + * inspect(, all=True) to see all attributes. + + Args: + obj (Any): An object to inspect. + title (str, optional): Title to display over inspect result, or None use type. Defaults to None. + help (bool, optional): Show full help text rather than just first paragraph. Defaults to False. + methods (bool, optional): Enable inspection of callables. Defaults to False. + docs (bool, optional): Also render doc strings. Defaults to True. + private (bool, optional): Show private attributes (beginning with underscore). Defaults to False. + dunder (bool, optional): Show attributes starting with double underscore. Defaults to False. + sort (bool, optional): Sort attributes alphabetically. Defaults to True. + all (bool, optional): Show all attributes. Defaults to False. + value (bool, optional): Pretty print value. Defaults to True. + """ + _console = console or get_console() + from pip._vendor.rich._inspect import Inspect + + # Special case for inspect(inspect) + is_inspect = obj is inspect + + _inspect = Inspect( + obj, + title=title, + help=is_inspect or help, + methods=is_inspect or methods, + docs=is_inspect or docs, + private=private, + dunder=dunder, + sort=sort, + all=all, + value=value, + ) + _console.print(_inspect) + + +if __name__ == "__main__": # pragma: no cover + print("Hello, **World**") diff --git a/shared/package-files/75/751d9124f157e3907b0ed61ac19ec07444db9edec14cebd0e486f7095d4abe08/etcd_store.py b/shared/package-files/75/751d9124f157e3907b0ed61ac19ec07444db9edec14cebd0e486f7095d4abe08/etcd_store.py new file mode 100644 index 0000000000000000000000000000000000000000..7690439237add63999cbbb0b5179043036d5b9c3 --- /dev/null +++ b/shared/package-files/75/751d9124f157e3907b0ed61ac19ec07444db9edec14cebd0e486f7095d4abe08/etcd_store.py @@ -0,0 +1,204 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + +import datetime +import random +import time +from base64 import b64decode, b64encode +from typing import Optional + +import etcd # type: ignore[import] + +# pyre-ignore[21]: Could not find name `Store` in `torch.distributed`. +from torch.distributed import Store + + +# Delay (sleep) for a small random amount to reduce CAS failures. +# This does not affect correctness, but will reduce requests to etcd server. +def cas_delay(): + time.sleep(random.uniform(0, 0.1)) + + +# pyre-fixme[11]: Annotation `Store` is not defined as a type. +class EtcdStore(Store): + """ + Implement a c10 Store interface by piggybacking on the rendezvous etcd instance. + + This is the store object returned by ``EtcdRendezvous``. + """ + + def __init__( + self, + etcd_client, + etcd_store_prefix, + # Default timeout same as in c10d/Store.hpp + timeout: Optional[datetime.timedelta] = None, + ): + super().__init__() # required for pybind trampoline. + + self.client = etcd_client + self.prefix = etcd_store_prefix + + if timeout is not None: + self.set_timeout(timeout) + + if not self.prefix.endswith("/"): + self.prefix += "/" + + def set(self, key, value): + """ + Write a key/value pair into ``EtcdStore``. + + Both key and value may be either Python ``str`` or ``bytes``. + """ + self.client.set(key=self.prefix + self._encode(key), value=self._encode(value)) + + def get(self, key) -> bytes: + """ + Get a value by key, possibly doing a blocking wait. + + If key is not immediately present, will do a blocking wait + for at most ``timeout`` duration or until the key is published. + + + Returns: + value ``(bytes)`` + + Raises: + LookupError - If key still not published after timeout + """ + b64_key = self.prefix + self._encode(key) + kvs = self._try_wait_get([b64_key]) + + if kvs is None: + raise LookupError(f"Key {key} not found in EtcdStore") + + return self._decode(kvs[b64_key]) + + def add(self, key, num: int) -> int: + """ + Atomically increment a value by an integer amount. + + The integer is represented as a string using base 10. If key is not present, + a default value of ``0`` will be assumed. + + Returns: + the new (incremented) value + + + """ + b64_key = self._encode(key) + # c10d Store assumes value is an integer represented as a decimal string + try: + # Assume default value "0", if this key didn't yet: + node = self.client.write( + key=self.prefix + b64_key, + value=self._encode(str(num)), # i.e. 0 + num + prevExist=False, + ) + return int(self._decode(node.value)) + except etcd.EtcdAlreadyExist: + pass + + while True: + # Note: c10d Store does not have a method to delete keys, so we + # can be sure it's still there. + node = self.client.get(key=self.prefix + b64_key) + new_value = self._encode(str(int(self._decode(node.value)) + num)) + try: + node = self.client.test_and_set( + key=node.key, value=new_value, prev_value=node.value + ) + return int(self._decode(node.value)) + except etcd.EtcdCompareFailed: + cas_delay() + + def wait(self, keys, override_timeout: Optional[datetime.timedelta] = None): + """ + Wait until all of the keys are published, or until timeout. + + Raises: + LookupError - if timeout occurs + """ + b64_keys = [self.prefix + self._encode(key) for key in keys] + kvs = self._try_wait_get(b64_keys, override_timeout) + if kvs is None: + raise LookupError("Timeout while waiting for keys in EtcdStore") + # No return value on success + + def check(self, keys) -> bool: + """Check if all of the keys are immediately present (without waiting).""" + b64_keys = [self.prefix + self._encode(key) for key in keys] + kvs = self._try_wait_get( + b64_keys, + override_timeout=datetime.timedelta(microseconds=1), # as if no wait + ) + return kvs is not None + + # + # Encode key/value data in base64, so we can store arbitrary binary data + # in EtcdStore. Input can be `str` or `bytes`. + # In case of `str`, utf-8 encoding is assumed. + # + def _encode(self, value) -> str: + if type(value) == bytes: + return b64encode(value).decode() + elif type(value) == str: + return b64encode(value.encode()).decode() + raise ValueError("Value must be of type str or bytes") + + # + # Decode a base64 string (of type `str` or `bytes`). + # Return type is `bytes`, which is more convenient with the Store interface. + # + def _decode(self, value) -> bytes: + if type(value) == bytes: + return b64decode(value) + elif type(value) == str: + return b64decode(value.encode()) + raise ValueError("Value must be of type str or bytes") + + # + # Get all of the (base64-encoded) etcd keys at once, or wait until all the keys + # are published or timeout occurs. + # This is a helper method for the public interface methods. + # + # On success, a dictionary of {etcd key -> etcd value} is returned. + # On timeout, None is returned. + # + def _try_wait_get(self, b64_keys, override_timeout=None): + timeout = self.timeout if override_timeout is None else override_timeout # type: ignore[attr-defined] + deadline = time.time() + timeout.total_seconds() + + while True: + # Read whole directory (of keys), filter only the ones waited for + all_nodes = self.client.get(key=self.prefix) + req_nodes = { + node.key: node.value for node in all_nodes.children if node.key in b64_keys + } + + if len(req_nodes) == len(b64_keys): + # All keys are available + return req_nodes + + watch_timeout = deadline - time.time() + if watch_timeout <= 0: + return None + + try: + self.client.watch( + key=self.prefix, + recursive=True, + timeout=watch_timeout, + index=all_nodes.etcd_index + 1, + ) + except etcd.EtcdWatchTimedOut: + if time.time() >= deadline: + return None + else: + continue + except etcd.EtcdEventIndexCleared: + continue diff --git a/shared/package-files/75/752297e4e2cef56804b28cb461cfbd7bd8dfcd455b2d42a2797f5a1ced4b692a/scoped_term.py b/shared/package-files/75/752297e4e2cef56804b28cb461cfbd7bd8dfcd455b2d42a2797f5a1ced4b692a/scoped_term.py new file mode 100644 index 0000000000000000000000000000000000000000..838366353ccf4b71a66a4cbd78e45d4763baec6f --- /dev/null +++ b/shared/package-files/75/752297e4e2cef56804b28cb461cfbd7bd8dfcd455b2d42a2797f5a1ced4b692a/scoped_term.py @@ -0,0 +1,98 @@ +from __future__ import annotations + +from collections.abc import Iterable, Mapping +from typing import Any + +from formulaic.materializers.types.evaluated_factor import EvaluatedFactor +from formulaic.utils.variables import Variable + +from .scoped_factor import ScopedFactor + + +class ScopedTerm: + """ + A representation of a `Term` where scopes have been applied to the factors. + Recall that "scopes" in this context refer to whether or not the factor + values have been reduced in rank or not. + + Attributes: + factors: The `ScopedFactor` instances. + scale: The global factor associated with the term that should be applied + during column materialization. + """ + + __slots__ = ("factors", "scale") + + def __init__(self, factors: Iterable[ScopedFactor], scale: float = 1): + self.factors = tuple(dict.fromkeys(factors)) + self.scale = scale + + def __hash__(self) -> int: + return hash(tuple(sorted(self.factors))) + + def __eq__(self, other: Any) -> bool: + if isinstance(other, ScopedTerm): + return sorted(self.factors) == sorted(other.factors) + return NotImplemented + + def __repr__(self) -> str: + factor_repr = ( + ":".join(f.__repr__() for f in self.factors) if self.factors else "1" + ) + if self.scale is not None and self.scale != 1: + return f"{self.scale}*{factor_repr}" + return factor_repr + + def copy(self, *, without_values: bool = False) -> ScopedTerm: + """ + Return a copy of this `ScopedTerm` instance, potentially without the + materialized values attached. This is used during the generation of + model specs in order to reduce the size of the serialized specs. + + Args: + without_values: Whether the materialized values should be omitted + from the copy. + """ + factors: Iterable[ScopedFactor] = self.factors + if without_values: + factors = [ + ScopedFactor( + factor=factor.factor.replace(values=None), + reduced=factor.reduced, + ) + for factor in factors + ] + return ScopedTerm(factors, scale=self.scale) + + def rehydrate(self, factor_values: Mapping[str, EvaluatedFactor]) -> ScopedTerm: + """ + Rehydrate the `ScopedTerm` instance with new `EvaluatedFactor` instances + that have been computed for each factor. An exception will be raised if + any required factor is missing from the `factor_values` mapping. This is + used to allow the reuse of serialized `ScopedTerm` structure that have + had their factor values excised using `.copy(without_values=True)`. + + Args: + factor_values: A mapping from factor expressions to `EvaluatedFactor` + instances. This mapping should contain all factors in the term. + """ + return ScopedTerm( + [ + ScopedFactor( + factor=factor_values[factor.factor.expr], + reduced=factor.reduced, + ) + for factor in self.factors + ], + scale=self.scale, + ) + + @property + def variables(self) -> set[Variable]: + return Variable.union( + *( + factor.factor.variables + for factor in self.factors + if factor.factor.variables is not None + ) + ) diff --git a/shared/package-files/75/75235d661a1cf1ae21e74c11b5b3b12f0a668148ae305a5eeb2b532d445ca656/bench_meijerint.py b/shared/package-files/75/75235d661a1cf1ae21e74c11b5b3b12f0a668148ae305a5eeb2b532d445ca656/bench_meijerint.py new file mode 100644 index 0000000000000000000000000000000000000000..d648c3e02463d5a7ee1dcbe3b22af5cc22fef43d --- /dev/null +++ b/shared/package-files/75/75235d661a1cf1ae21e74c11b5b3b12f0a668148ae305a5eeb2b532d445ca656/bench_meijerint.py @@ -0,0 +1,261 @@ +# conceal the implicit import from the code quality tester +from sympy.core.numbers import (oo, pi) +from sympy.core.symbol import (Symbol, symbols) +from sympy.functions.elementary.exponential import exp +from sympy.functions.elementary.miscellaneous import sqrt +from sympy.functions.special.bessel import besseli +from sympy.functions.special.gamma_functions import gamma +from sympy.integrals.integrals import integrate +from sympy.integrals.transforms import (mellin_transform, + inverse_fourier_transform, inverse_mellin_transform, + laplace_transform, inverse_laplace_transform, fourier_transform) + +LT = laplace_transform +FT = fourier_transform +MT = mellin_transform +IFT = inverse_fourier_transform +ILT = inverse_laplace_transform +IMT = inverse_mellin_transform + +from sympy.abc import x, y +nu, beta, rho = symbols('nu beta rho') + +apos, bpos, cpos, dpos, posk, p = symbols('a b c d k p', positive=True) +k = Symbol('k', real=True) +negk = Symbol('k', negative=True) + +mu1, mu2 = symbols('mu1 mu2', real=True, nonzero=True, finite=True) +sigma1, sigma2 = symbols('sigma1 sigma2', real=True, nonzero=True, + finite=True, positive=True) +rate = Symbol('lambda', positive=True) + + +def normal(x, mu, sigma): + return 1/sqrt(2*pi*sigma**2)*exp(-(x - mu)**2/2/sigma**2) + + +def exponential(x, rate): + return rate*exp(-rate*x) +alpha, beta = symbols('alpha beta', positive=True) +betadist = x**(alpha - 1)*(1 + x)**(-alpha - beta)*gamma(alpha + beta) \ + /gamma(alpha)/gamma(beta) +kint = Symbol('k', integer=True, positive=True) +chi = 2**(1 - kint/2)*x**(kint - 1)*exp(-x**2/2)/gamma(kint/2) +chisquared = 2**(-k/2)/gamma(k/2)*x**(k/2 - 1)*exp(-x/2) +dagum = apos*p/x*(x/bpos)**(apos*p)/(1 + x**apos/bpos**apos)**(p + 1) +d1, d2 = symbols('d1 d2', positive=True) +f = sqrt(((d1*x)**d1 * d2**d2)/(d1*x + d2)**(d1 + d2))/x \ + /gamma(d1/2)/gamma(d2/2)*gamma((d1 + d2)/2) +nupos, sigmapos = symbols('nu sigma', positive=True) +rice = x/sigmapos**2*exp(-(x**2 + nupos**2)/2/sigmapos**2)*besseli(0, x* + nupos/sigmapos**2) +mu = Symbol('mu', real=True) +laplace = exp(-abs(x - mu)/bpos)/2/bpos + +u = Symbol('u', polar=True) +tpos = Symbol('t', positive=True) + + +def E(expr): + integrate(expr*exponential(x, rate)*normal(y, mu1, sigma1), + (x, 0, oo), (y, -oo, oo), meijerg=True) + integrate(expr*exponential(x, rate)*normal(y, mu1, sigma1), + (y, -oo, oo), (x, 0, oo), meijerg=True) + +bench = [ + 'MT(x**nu*Heaviside(x - 1), x, s)', + 'MT(x**nu*Heaviside(1 - x), x, s)', + 'MT((1-x)**(beta - 1)*Heaviside(1-x), x, s)', + 'MT((x-1)**(beta - 1)*Heaviside(x-1), x, s)', + 'MT((1+x)**(-rho), x, s)', + 'MT(abs(1-x)**(-rho), x, s)', + 'MT((1-x)**(beta-1)*Heaviside(1-x) + a*(x-1)**(beta-1)*Heaviside(x-1), x, s)', + 'MT((x**a-b**a)/(x-b), x, s)', + 'MT((x**a-bpos**a)/(x-bpos), x, s)', + 'MT(exp(-x), x, s)', + 'MT(exp(-1/x), x, s)', + 'MT(log(x)**4*Heaviside(1-x), x, s)', + 'MT(log(x)**3*Heaviside(x-1), x, s)', + 'MT(log(x + 1), x, s)', + 'MT(log(1/x + 1), x, s)', + 'MT(log(abs(1 - x)), x, s)', + 'MT(log(abs(1 - 1/x)), x, s)', + 'MT(log(x)/(x+1), x, s)', + 'MT(log(x)**2/(x+1), x, s)', + 'MT(log(x)/(x+1)**2, x, s)', + 'MT(erf(sqrt(x)), x, s)', + + 'MT(besselj(a, 2*sqrt(x)), x, s)', + 'MT(sin(sqrt(x))*besselj(a, sqrt(x)), x, s)', + 'MT(cos(sqrt(x))*besselj(a, sqrt(x)), x, s)', + 'MT(besselj(a, sqrt(x))**2, x, s)', + 'MT(besselj(a, sqrt(x))*besselj(-a, sqrt(x)), x, s)', + 'MT(besselj(a - 1, sqrt(x))*besselj(a, sqrt(x)), x, s)', + 'MT(besselj(a, sqrt(x))*besselj(b, sqrt(x)), x, s)', + 'MT(besselj(a, sqrt(x))**2 + besselj(-a, sqrt(x))**2, x, s)', + 'MT(bessely(a, 2*sqrt(x)), x, s)', + 'MT(sin(sqrt(x))*bessely(a, sqrt(x)), x, s)', + 'MT(cos(sqrt(x))*bessely(a, sqrt(x)), x, s)', + 'MT(besselj(a, sqrt(x))*bessely(a, sqrt(x)), x, s)', + 'MT(besselj(a, sqrt(x))*bessely(b, sqrt(x)), x, s)', + 'MT(bessely(a, sqrt(x))**2, x, s)', + + 'MT(besselk(a, 2*sqrt(x)), x, s)', + 'MT(besselj(a, 2*sqrt(2*sqrt(x)))*besselk(a, 2*sqrt(2*sqrt(x))), x, s)', + 'MT(besseli(a, sqrt(x))*besselk(a, sqrt(x)), x, s)', + 'MT(besseli(b, sqrt(x))*besselk(a, sqrt(x)), x, s)', + 'MT(exp(-x/2)*besselk(a, x/2), x, s)', + + # later: ILT, IMT + + 'LT((t-apos)**bpos*exp(-cpos*(t-apos))*Heaviside(t-apos), t, s)', + 'LT(t**apos, t, s)', + 'LT(Heaviside(t), t, s)', + 'LT(Heaviside(t - apos), t, s)', + 'LT(1 - exp(-apos*t), t, s)', + 'LT((exp(2*t)-1)*exp(-bpos - t)*Heaviside(t)/2, t, s, noconds=True)', + 'LT(exp(t), t, s)', + 'LT(exp(2*t), t, s)', + 'LT(exp(apos*t), t, s)', + 'LT(log(t/apos), t, s)', + 'LT(erf(t), t, s)', + 'LT(sin(apos*t), t, s)', + 'LT(cos(apos*t), t, s)', + 'LT(exp(-apos*t)*sin(bpos*t), t, s)', + 'LT(exp(-apos*t)*cos(bpos*t), t, s)', + 'LT(besselj(0, t), t, s, noconds=True)', + 'LT(besselj(1, t), t, s, noconds=True)', + + 'FT(Heaviside(1 - abs(2*apos*x)), x, k)', + 'FT(Heaviside(1-abs(apos*x))*(1-abs(apos*x)), x, k)', + 'FT(exp(-apos*x)*Heaviside(x), x, k)', + 'IFT(1/(apos + 2*pi*I*x), x, posk, noconds=False)', + 'IFT(1/(apos + 2*pi*I*x), x, -posk, noconds=False)', + 'IFT(1/(apos + 2*pi*I*x), x, negk)', + 'FT(x*exp(-apos*x)*Heaviside(x), x, k)', + 'FT(exp(-apos*x)*sin(bpos*x)*Heaviside(x), x, k)', + 'FT(exp(-apos*x**2), x, k)', + 'IFT(sqrt(pi/apos)*exp(-(pi*k)**2/apos), k, x)', + 'FT(exp(-apos*abs(x)), x, k)', + + 'integrate(normal(x, mu1, sigma1), (x, -oo, oo), meijerg=True)', + 'integrate(x*normal(x, mu1, sigma1), (x, -oo, oo), meijerg=True)', + 'integrate(x**2*normal(x, mu1, sigma1), (x, -oo, oo), meijerg=True)', + 'integrate(x**3*normal(x, mu1, sigma1), (x, -oo, oo), meijerg=True)', + 'integrate(normal(x, mu1, sigma1)*normal(y, mu2, sigma2),' + ' (x, -oo, oo), (y, -oo, oo), meijerg=True)', + 'integrate(x*normal(x, mu1, sigma1)*normal(y, mu2, sigma2),' + ' (x, -oo, oo), (y, -oo, oo), meijerg=True)', + 'integrate(y*normal(x, mu1, sigma1)*normal(y, mu2, sigma2),' + ' (x, -oo, oo), (y, -oo, oo), meijerg=True)', + 'integrate(x*y*normal(x, mu1, sigma1)*normal(y, mu2, sigma2),' + ' (x, -oo, oo), (y, -oo, oo), meijerg=True)', + 'integrate((x+y+1)*normal(x, mu1, sigma1)*normal(y, mu2, sigma2),' + ' (x, -oo, oo), (y, -oo, oo), meijerg=True)', + 'integrate((x+y-1)*normal(x, mu1, sigma1)*normal(y, mu2, sigma2),' + ' (x, -oo, oo), (y, -oo, oo), meijerg=True)', + 'integrate(x**2*normal(x, mu1, sigma1)*normal(y, mu2, sigma2),' + ' (x, -oo, oo), (y, -oo, oo), meijerg=True)', + 'integrate(y**2*normal(x, mu1, sigma1)*normal(y, mu2, sigma2),' + ' (x, -oo, oo), (y, -oo, oo), meijerg=True)', + 'integrate(exponential(x, rate), (x, 0, oo), meijerg=True)', + 'integrate(x*exponential(x, rate), (x, 0, oo), meijerg=True)', + 'integrate(x**2*exponential(x, rate), (x, 0, oo), meijerg=True)', + 'E(1)', + 'E(x*y)', + 'E(x*y**2)', + 'E((x+y+1)**2)', + 'E(x+y+1)', + 'E((x+y-1)**2)', + 'integrate(betadist, (x, 0, oo), meijerg=True)', + 'integrate(x*betadist, (x, 0, oo), meijerg=True)', + 'integrate(x**2*betadist, (x, 0, oo), meijerg=True)', + 'integrate(chi, (x, 0, oo), meijerg=True)', + 'integrate(x*chi, (x, 0, oo), meijerg=True)', + 'integrate(x**2*chi, (x, 0, oo), meijerg=True)', + 'integrate(chisquared, (x, 0, oo), meijerg=True)', + 'integrate(x*chisquared, (x, 0, oo), meijerg=True)', + 'integrate(x**2*chisquared, (x, 0, oo), meijerg=True)', + 'integrate(((x-k)/sqrt(2*k))**3*chisquared, (x, 0, oo), meijerg=True)', + 'integrate(dagum, (x, 0, oo), meijerg=True)', + 'integrate(x*dagum, (x, 0, oo), meijerg=True)', + 'integrate(x**2*dagum, (x, 0, oo), meijerg=True)', + 'integrate(f, (x, 0, oo), meijerg=True)', + 'integrate(x*f, (x, 0, oo), meijerg=True)', + 'integrate(x**2*f, (x, 0, oo), meijerg=True)', + 'integrate(rice, (x, 0, oo), meijerg=True)', + 'integrate(laplace, (x, -oo, oo), meijerg=True)', + 'integrate(x*laplace, (x, -oo, oo), meijerg=True)', + 'integrate(x**2*laplace, (x, -oo, oo), meijerg=True)', + 'integrate(log(x) * x**(k-1) * exp(-x) / gamma(k), (x, 0, oo))', + + 'integrate(sin(z*x)*(x**2-1)**(-(y+S(1)/2)), (x, 1, oo), meijerg=True)', + 'integrate(besselj(0,x)*besselj(1,x)*exp(-x**2), (x, 0, oo), meijerg=True)', + 'integrate(besselj(0,x)*besselj(1,x)*besselk(0,x), (x, 0, oo), meijerg=True)', + 'integrate(besselj(0,x)*besselj(1,x)*exp(-x**2), (x, 0, oo), meijerg=True)', + 'integrate(besselj(a,x)*besselj(b,x)/x, (x,0,oo), meijerg=True)', + + 'hyperexpand(meijerg((-s - a/2 + 1, -s + a/2 + 1), (-a/2 - S(1)/2, -s + a/2 + S(3)/2), (a/2, -a/2), (-a/2 - S(1)/2, -s + a/2 + S(3)/2), 1))', + "gammasimp(S('2**(2*s)*(-pi*gamma(-a + 1)*gamma(a + 1)*gamma(-a - s + 1)*gamma(-a + s - 1/2)*gamma(a - s + 3/2)*gamma(a + s + 1)/(a*(a + s)) - gamma(-a - 1/2)*gamma(-a + 1)*gamma(a + 1)*gamma(a + 3/2)*gamma(-s + 3/2)*gamma(s - 1/2)*gamma(-a + s + 1)*gamma(a - s + 1)/(a*(-a + s)))*gamma(-2*s + 1)*gamma(s + 1)/(pi*s*gamma(-a - 1/2)*gamma(a + 3/2)*gamma(-s + 1)*gamma(-s + 3/2)*gamma(s - 1/2)*gamma(-a - s + 1)*gamma(-a + s - 1/2)*gamma(a - s + 1)*gamma(a - s + 3/2))'))", + + 'mellin_transform(E1(x), x, s)', + 'inverse_mellin_transform(gamma(s)/s, s, x, (0, oo))', + 'mellin_transform(expint(a, x), x, s)', + 'mellin_transform(Si(x), x, s)', + 'inverse_mellin_transform(-2**s*sqrt(pi)*gamma((s + 1)/2)/(2*s*gamma(-s/2 + 1)), s, x, (-1, 0))', + 'mellin_transform(Ci(sqrt(x)), x, s)', + 'inverse_mellin_transform(-4**s*sqrt(pi)*gamma(s)/(2*s*gamma(-s + S(1)/2)),s, u, (0, 1))', + 'laplace_transform(Ci(x), x, s)', + 'laplace_transform(expint(a, x), x, s)', + 'laplace_transform(expint(1, x), x, s)', + 'laplace_transform(expint(2, x), x, s)', + 'inverse_laplace_transform(-log(1 + s**2)/2/s, s, u)', + 'inverse_laplace_transform(log(s + 1)/s, s, x)', + 'inverse_laplace_transform((s - log(s + 1))/s**2, s, x)', + 'laplace_transform(Chi(x), x, s)', + 'laplace_transform(Shi(x), x, s)', + + 'integrate(exp(-z*x)/x, (x, 1, oo), meijerg=True, conds="none")', + 'integrate(exp(-z*x)/x**2, (x, 1, oo), meijerg=True, conds="none")', + 'integrate(exp(-z*x)/x**3, (x, 1, oo), meijerg=True,conds="none")', + 'integrate(-cos(x)/x, (x, tpos, oo), meijerg=True)', + 'integrate(-sin(x)/x, (x, tpos, oo), meijerg=True)', + 'integrate(sin(x)/x, (x, 0, z), meijerg=True)', + 'integrate(sinh(x)/x, (x, 0, z), meijerg=True)', + 'integrate(exp(-x)/x, x, meijerg=True)', + 'integrate(exp(-x)/x**2, x, meijerg=True)', + 'integrate(cos(u)/u, u, meijerg=True)', + 'integrate(cosh(u)/u, u, meijerg=True)', + 'integrate(expint(1, x), x, meijerg=True)', + 'integrate(expint(2, x), x, meijerg=True)', + 'integrate(Si(x), x, meijerg=True)', + 'integrate(Ci(u), u, meijerg=True)', + 'integrate(Shi(x), x, meijerg=True)', + 'integrate(Chi(u), u, meijerg=True)', + 'integrate(Si(x)*exp(-x), (x, 0, oo), meijerg=True)', + 'integrate(expint(1, x)*sin(x), (x, 0, oo), meijerg=True)' +] + +from time import time +from sympy.core.cache import clear_cache +import sys + +timings = [] + +if __name__ == '__main__': + for n, string in enumerate(bench): + clear_cache() + _t = time() + exec(string) + _t = time() - _t + timings += [(_t, string)] + sys.stdout.write('.') + sys.stdout.flush() + if n % (len(bench) // 10) == 0: + sys.stdout.write('%s' % (10*n // len(bench))) + print() + + timings.sort(key=lambda x: -x[0]) + + for ti, string in timings: + print('%.2fs %s' % (ti, string)) diff --git a/shared/package-files/75/7523f6f7746da075be73a707f55468cd1afcd73c2a2f6e03062f7063fa2952ec/_cast_Long_native.h b/shared/package-files/75/7523f6f7746da075be73a707f55468cd1afcd73c2a2f6e03062f7063fa2952ec/_cast_Long_native.h new file mode 100644 index 0000000000000000000000000000000000000000..291640d2a8d96e3bb2e1cdb865b1bb60b2f43d18 --- /dev/null +++ b/shared/package-files/75/7523f6f7746da075be73a707f55468cd1afcd73c2a2f6e03062f7063fa2952ec/_cast_Long_native.h @@ -0,0 +1,21 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor _cast_Long(const at::Tensor & self, bool non_blocking=false); +} // namespace native +} // namespace at diff --git a/shared/package-files/75/75240f0a25da63a2c532ae50653cce37807e98e2384f232cf1deabff30686c63/logical_xor_ops.h b/shared/package-files/75/75240f0a25da63a2c532ae50653cce37807e98e2384f232cf1deabff30686c63/logical_xor_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..12031eb68e7525b6dca1555b2696ede3c40dac73 --- /dev/null +++ b/shared/package-files/75/75240f0a25da63a2c532ae50653cce37807e98e2384f232cf1deabff30686c63/logical_xor_ops.h @@ -0,0 +1,50 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API logical_xor { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::logical_xor") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "logical_xor(Tensor self, Tensor other) -> Tensor") + static at::Tensor call(const at::Tensor & self, const at::Tensor & other); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & other); +}; + +struct TORCH_API logical_xor_ { + using schema = at::Tensor & (at::Tensor &, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::logical_xor_") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "logical_xor_(Tensor(a!) self, Tensor other) -> Tensor(a!)") + static at::Tensor & call(at::Tensor & self, const at::Tensor & other); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, at::Tensor & self, const at::Tensor & other); +}; + +struct TORCH_API logical_xor_out { + using schema = at::Tensor & (const at::Tensor &, const at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::logical_xor") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "logical_xor.out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, const at::Tensor & other, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & other, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/75/7524540714554e1f9d5ccacc47fa10dd9212bb64127e1499962934dcc8dbbb7d/__init__.py b/shared/package-files/75/7524540714554e1f9d5ccacc47fa10dd9212bb64127e1499962934dcc8dbbb7d/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7cfa792f744b7e0b4e28a536c0603f142ded6518 --- /dev/null +++ b/shared/package-files/75/7524540714554e1f9d5ccacc47fa10dd9212bb64127e1499962934dcc8dbbb7d/__init__.py @@ -0,0 +1,132 @@ +# SPDX-License-Identifier: MIT + +""" +Classes Without Boilerplate +""" + +from functools import partial +from typing import Callable + +from . import converters, exceptions, filters, setters, validators +from ._cmp import cmp_using +from ._config import get_run_validators, set_run_validators +from ._funcs import asdict, assoc, astuple, evolve, has, resolve_types +from ._make import ( + NOTHING, + Attribute, + Factory, + attrib, + attrs, + fields, + fields_dict, + make_class, + validate, +) +from ._next_gen import define, field, frozen, mutable +from ._version_info import VersionInfo + + +s = attributes = attrs +ib = attr = attrib +dataclass = partial(attrs, auto_attribs=True) # happy Easter ;) + + +class AttrsInstance: + pass + + +__all__ = [ + "Attribute", + "AttrsInstance", + "Factory", + "NOTHING", + "asdict", + "assoc", + "astuple", + "attr", + "attrib", + "attributes", + "attrs", + "cmp_using", + "converters", + "define", + "evolve", + "exceptions", + "field", + "fields", + "fields_dict", + "filters", + "frozen", + "get_run_validators", + "has", + "ib", + "make_class", + "mutable", + "resolve_types", + "s", + "set_run_validators", + "setters", + "validate", + "validators", +] + + +def _make_getattr(mod_name: str) -> Callable: + """ + Create a metadata proxy for packaging information that uses *mod_name* in + its warnings and errors. + """ + + def __getattr__(name: str) -> str: + dunder_to_metadata = { + "__title__": "Name", + "__copyright__": "", + "__version__": "version", + "__version_info__": "version", + "__description__": "summary", + "__uri__": "", + "__url__": "", + "__author__": "", + "__email__": "", + "__license__": "license", + } + if name not in dunder_to_metadata.keys(): + raise AttributeError(f"module {mod_name} has no attribute {name}") + + import sys + import warnings + + if sys.version_info < (3, 8): + from importlib_metadata import metadata + else: + from importlib.metadata import metadata + + if name != "__version_info__": + warnings.warn( + f"Accessing {mod_name}.{name} is deprecated and will be " + "removed in a future release. Use importlib.metadata directly " + "to query for attrs's packaging metadata.", + DeprecationWarning, + stacklevel=2, + ) + + meta = metadata("attrs") + if name == "__license__": + return "MIT" + elif name == "__copyright__": + return "Copyright (c) 2015 Hynek Schlawack" + elif name in ("__uri__", "__url__"): + return meta["Project-URL"].split(" ", 1)[-1] + elif name == "__version_info__": + return VersionInfo._from_version_string(meta["version"]) + elif name == "__author__": + return meta["Author-email"].rsplit(" ", 1)[0] + elif name == "__email__": + return meta["Author-email"].rsplit("<", 1)[1][:-1] + + return meta[dunder_to_metadata[name]] + + return __getattr__ + + +__getattr__ = _make_getattr(__name__) diff --git a/shared/package-files/75/752560d1d1de753f70d503b617502f5a87a5e3f87cc26b984b882e11a2fee4a9/Maceio b/shared/package-files/75/752560d1d1de753f70d503b617502f5a87a5e3f87cc26b984b882e11a2fee4a9/Maceio new file mode 100644 index 0000000000000000000000000000000000000000..dbb8d57d91d6640c1282fab3a063567d1f663f88 Binary files /dev/null and b/shared/package-files/75/752560d1d1de753f70d503b617502f5a87a5e3f87cc26b984b882e11a2fee4a9/Maceio differ diff --git a/shared/package-files/75/752571886a9d351ea06c5e34578276b46850f93e110ef4b21b2a47bd870f0d83/test_preview.py b/shared/package-files/75/752571886a9d351ea06c5e34578276b46850f93e110ef4b21b2a47bd870f0d83/test_preview.py new file mode 100644 index 0000000000000000000000000000000000000000..91771ceb0466d6b0fee00570426713d02da14872 --- /dev/null +++ b/shared/package-files/75/752571886a9d351ea06c5e34578276b46850f93e110ef4b21b2a47bd870f0d83/test_preview.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- + +from sympy.core.relational import Eq +from sympy.core.symbol import Symbol +from sympy.functions.elementary.piecewise import Piecewise +from sympy.printing.preview import preview + +from io import BytesIO + + +def test_preview(): + x = Symbol('x') + obj = BytesIO() + try: + preview(x, output='png', viewer='BytesIO', outputbuffer=obj) + except RuntimeError: + pass # latex not installed on CI server + + +def test_preview_unicode_symbol(): + # issue 9107 + a = Symbol('α') + obj = BytesIO() + try: + preview(a, output='png', viewer='BytesIO', outputbuffer=obj) + except RuntimeError: + pass # latex not installed on CI server + + +def test_preview_latex_construct_in_expr(): + # see PR 9801 + x = Symbol('x') + pw = Piecewise((1, Eq(x, 0)), (0, True)) + obj = BytesIO() + try: + preview(pw, output='png', viewer='BytesIO', outputbuffer=obj) + except RuntimeError: + pass # latex not installed on CI server diff --git a/shared/package-files/75/7529f3512586bcbd947268aa68f79cf9d6d344c2063d4ed38fbfafa859751314/bn_relu.py b/shared/package-files/75/7529f3512586bcbd947268aa68f79cf9d6d344c2063d4ed38fbfafa859751314/bn_relu.py new file mode 100644 index 0000000000000000000000000000000000000000..856fa43aac9941b54af5f74d7ea961bab364cb8f --- /dev/null +++ b/shared/package-files/75/7529f3512586bcbd947268aa68f79cf9d6d344c2063d4ed38fbfafa859751314/bn_relu.py @@ -0,0 +1,82 @@ + +import torch +import torch.ao.nn.intrinsic +import torch.ao.nn.intrinsic.qat +import torch.ao.nn.quantized as nnq + +__all__ = [ + "BNReLU2d", + "BNReLU3d" +] + +class BNReLU2d(nnq.BatchNorm2d): + r""" + A BNReLU2d module is a fused module of BatchNorm2d and ReLU + + We adopt the same interface as :class:`torch.ao.nn.quantized.BatchNorm2d`. + + Attributes: + Same as torch.ao.nn.quantized.BatchNorm2d + + """ + _FLOAT_MODULE = torch.ao.nn.intrinsic.BNReLU2d + + def __init__(self, num_features, eps=1e-5, momentum=0.1, device=None, dtype=None): + super().__init__(num_features, eps=eps, momentum=momentum, device=device, dtype=dtype) + + def forward(self, input): + # Temporarily using len(shape) instead of ndim due to JIT issue + # https://github.com/pytorch/pytorch/issues/23890 + if len(input.shape) != 4: + raise ValueError("Input shape must be `(N, C, H, W)`!") + return torch.ops.quantized.batch_norm2d_relu( + input, self.weight, self.bias, self.running_mean, + self.running_var, self.eps, self.scale, self.zero_point) + + def _get_name(self): + return 'QuantizedBNReLU2d' + + @classmethod + def from_float(cls, mod): + # TODO: Add qat support for BNReLU2d + return super().from_float(mod) + + @classmethod + def from_reference(cls, bn_relu, output_scale, output_zero_point): + return super().from_reference(bn_relu[0], output_scale, output_zero_point) + +class BNReLU3d(nnq.BatchNorm3d): + r""" + A BNReLU3d module is a fused module of BatchNorm3d and ReLU + + We adopt the same interface as :class:`torch.ao.nn.quantized.BatchNorm3d`. + + Attributes: + Same as torch.ao.nn.quantized.BatchNorm3d + + """ + _FLOAT_MODULE = torch.ao.nn.intrinsic.BNReLU3d + + def __init__(self, num_features, eps=1e-5, momentum=0.1, device=None, dtype=None): + super().__init__(num_features, eps=eps, momentum=momentum, device=device, dtype=dtype) + + def forward(self, input): + # Temporarily using len(shape) instead of ndim due to JIT issue + # https://github.com/pytorch/pytorch/issues/23890 + if len(input.shape) != 5: + raise ValueError("Input shape must be `(N, C, D, H, W)`!") + return torch.ops.quantized.batch_norm3d_relu( + input, self.weight, self.bias, self.running_mean, + self.running_var, self.eps, self.scale, self.zero_point) + + def _get_name(self): + return 'QuantizedBNReLU3d' + + @classmethod + def from_float(cls, mod): + # TODO: Add qat support for BNReLU3d + return super().from_float(mod) + + @classmethod + def from_reference(cls, bn_relu, output_scale, output_zero_point): + return super().from_reference(bn_relu[0], output_scale, output_zero_point) diff --git a/shared/package-files/75/752ad8827ddb5678e68114cca31f7830a5881b91aeaf8dce47113f2be51df840/miopen_convolution_relu_cuda_dispatch.h b/shared/package-files/75/752ad8827ddb5678e68114cca31f7830a5881b91aeaf8dce47113f2be51df840/miopen_convolution_relu_cuda_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..e2f0fbc2b4df8b3f699f5294f2870a2d710dfb22 --- /dev/null +++ b/shared/package-files/75/752ad8827ddb5678e68114cca31f7830a5881b91aeaf8dce47113f2be51df840/miopen_convolution_relu_cuda_dispatch.h @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API at::Tensor miopen_convolution_relu(const at::Tensor & self, const at::Tensor & weight, const c10::optional & bias, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, int64_t groups); +TORCH_API at::Tensor miopen_convolution_relu_symint(const at::Tensor & self, const at::Tensor & weight, const c10::optional & bias, c10::SymIntArrayRef stride, c10::SymIntArrayRef padding, c10::SymIntArrayRef dilation, c10::SymInt groups); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/75/7531be245e6cf3693e2ebb502ccc7558d65e7f756b6466bfb016ef4d2027938f/_values_copy_ops.h b/shared/package-files/75/7531be245e6cf3693e2ebb502ccc7558d65e7f756b6466bfb016ef4d2027938f/_values_copy_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..5ea7e87e7f3238853b048c222fcd8164ebbc6dc4 --- /dev/null +++ b/shared/package-files/75/7531be245e6cf3693e2ebb502ccc7558d65e7f756b6466bfb016ef4d2027938f/_values_copy_ops.h @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API _values_copy { + using schema = at::Tensor (const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_values_copy") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_values_copy(Tensor self) -> Tensor") + static at::Tensor call(const at::Tensor & self); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self); +}; + +struct TORCH_API _values_copy_out { + using schema = at::Tensor & (const at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_values_copy") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_values_copy.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/75/753a445ffcfeac512a9d02375efa71182c3e204d5aa94c59c3a284bf493ce92a/__init__.pyi b/shared/package-files/75/753a445ffcfeac512a9d02375efa71182c3e204d5aa94c59c3a284bf493ce92a/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..a411dbb456d2b9da8de739d6184d78a13180034c --- /dev/null +++ b/shared/package-files/75/753a445ffcfeac512a9d02375efa71182c3e204d5aa94c59c3a284bf493ce92a/__init__.pyi @@ -0,0 +1,25 @@ +import sys +from typing import Optional + +def version() -> str: ... + +if sys.version_info >= (3, 0): + def bootstrap( + *, + root: Optional[str] = ..., + upgrade: bool = ..., + user: bool = ..., + altinstall: bool = ..., + default_pip: bool = ..., + verbosity: int = ..., + ) -> None: ... + +else: + def bootstrap( + root: Optional[str] = ..., + upgrade: bool = ..., + user: bool = ..., + altinstall: bool = ..., + default_pip: bool = ..., + verbosity: int = ..., + ) -> None: ... diff --git a/shared/package-files/75/753d07f8c2e2eb64977a22a32d02741153eec644e534ec695ad371039b8124fb/faulthandler.py b/shared/package-files/75/753d07f8c2e2eb64977a22a32d02741153eec644e534ec695ad371039b8124fb/faulthandler.py new file mode 100644 index 0000000000000000000000000000000000000000..d16aea1eb887caafec2165ef21c9814cb5bbb551 --- /dev/null +++ b/shared/package-files/75/753d07f8c2e2eb64977a22a32d02741153eec644e534ec695ad371039b8124fb/faulthandler.py @@ -0,0 +1,105 @@ +from __future__ import annotations + +import os +import sys +from typing import Generator + +from _pytest.config import Config +from _pytest.config.argparsing import Parser +from _pytest.nodes import Item +from _pytest.stash import StashKey +import pytest + + +fault_handler_original_stderr_fd_key = StashKey[int]() +fault_handler_stderr_fd_key = StashKey[int]() + + +def pytest_addoption(parser: Parser) -> None: + help = ( + "Dump the traceback of all threads if a test takes " + "more than TIMEOUT seconds to finish" + ) + parser.addini("faulthandler_timeout", help, default=0.0) + + +def pytest_configure(config: Config) -> None: + import faulthandler + + # at teardown we want to restore the original faulthandler fileno + # but faulthandler has no api to return the original fileno + # so here we stash the stderr fileno to be used at teardown + # sys.stderr and sys.__stderr__ may be closed or patched during the session + # so we can't rely on their values being good at that point (#11572). + stderr_fileno = get_stderr_fileno() + if faulthandler.is_enabled(): + config.stash[fault_handler_original_stderr_fd_key] = stderr_fileno + config.stash[fault_handler_stderr_fd_key] = os.dup(stderr_fileno) + faulthandler.enable(file=config.stash[fault_handler_stderr_fd_key]) + + +def pytest_unconfigure(config: Config) -> None: + import faulthandler + + faulthandler.disable() + # Close the dup file installed during pytest_configure. + if fault_handler_stderr_fd_key in config.stash: + os.close(config.stash[fault_handler_stderr_fd_key]) + del config.stash[fault_handler_stderr_fd_key] + # Re-enable the faulthandler if it was originally enabled. + if fault_handler_original_stderr_fd_key in config.stash: + faulthandler.enable(config.stash[fault_handler_original_stderr_fd_key]) + del config.stash[fault_handler_original_stderr_fd_key] + + +def get_stderr_fileno() -> int: + try: + fileno = sys.stderr.fileno() + # The Twisted Logger will return an invalid file descriptor since it is not backed + # by an FD. So, let's also forward this to the same code path as with pytest-xdist. + if fileno == -1: + raise AttributeError() + return fileno + except (AttributeError, ValueError): + # pytest-xdist monkeypatches sys.stderr with an object that is not an actual file. + # https://docs.python.org/3/library/faulthandler.html#issue-with-file-descriptors + # This is potentially dangerous, but the best we can do. + assert sys.__stderr__ is not None + return sys.__stderr__.fileno() + + +def get_timeout_config_value(config: Config) -> float: + return float(config.getini("faulthandler_timeout") or 0.0) + + +@pytest.hookimpl(wrapper=True, trylast=True) +def pytest_runtest_protocol(item: Item) -> Generator[None, object, object]: + timeout = get_timeout_config_value(item.config) + if timeout > 0: + import faulthandler + + stderr = item.config.stash[fault_handler_stderr_fd_key] + faulthandler.dump_traceback_later(timeout, file=stderr) + try: + return (yield) + finally: + faulthandler.cancel_dump_traceback_later() + else: + return (yield) + + +@pytest.hookimpl(tryfirst=True) +def pytest_enter_pdb() -> None: + """Cancel any traceback dumping due to timeout before entering pdb.""" + import faulthandler + + faulthandler.cancel_dump_traceback_later() + + +@pytest.hookimpl(tryfirst=True) +def pytest_exception_interact() -> None: + """Cancel any traceback dumping due to an interactive exception being + raised.""" + import faulthandler + + faulthandler.cancel_dump_traceback_later() diff --git a/shared/package-files/75/753dda518a7e9f6dc0309721b1faae58c9661f545801da9f04728391f70be2d0/iso2022.enc b/shared/package-files/75/753dda518a7e9f6dc0309721b1faae58c9661f545801da9f04728391f70be2d0/iso2022.enc new file mode 100644 index 0000000000000000000000000000000000000000..a58f8e3e297ea002161efa8d6146fe64b1daf321 --- /dev/null +++ b/shared/package-files/75/753dda518a7e9f6dc0309721b1faae58c9661f545801da9f04728391f70be2d0/iso2022.enc @@ -0,0 +1,14 @@ +# Encoding file: iso2022, escape-driven +E +name iso2022 +init {} +final {} +iso8859-1 \x1b(B +jis0201 \x1b(J +gb1988 \x1b(T +jis0208 \x1b$B +jis0208 \x1b$@ +jis0212 \x1b$(D +gb2312 \x1b$A +ksc5601 \x1b$(C +jis0208 \x1b&@\x1b$B diff --git a/shared/package-files/75/7540139585546646e0810e8f5329832a107450aa83a3e2827f4169fc48d6b133/pointless.py b/shared/package-files/75/7540139585546646e0810e8f5329832a107450aa83a3e2827f4169fc48d6b133/pointless.py new file mode 100644 index 0000000000000000000000000000000000000000..eb73b2a795d7c7d4d3efbef3b2abdbbd882e93c6 --- /dev/null +++ b/shared/package-files/75/7540139585546646e0810e8f5329832a107450aa83a3e2827f4169fc48d6b133/pointless.py @@ -0,0 +1,71 @@ +""" + pygments.lexers.pointless + ~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for Pointless. + + :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, words +from pygments.token import Comment, Error, Keyword, Name, Number, Operator, \ + Punctuation, String, Text + +__all__ = ['PointlessLexer'] + + +class PointlessLexer(RegexLexer): + """ + For Pointless source code. + + .. versionadded:: 2.7 + """ + + name = 'Pointless' + url = 'https://ptls.dev' + aliases = ['pointless'] + filenames = ['*.ptls'] + + ops = words([ + "+", "-", "*", "/", "**", "%", "+=", "-=", "*=", + "/=", "**=", "%=", "|>", "=", "==", "!=", "<", ">", + "<=", ">=", "=>", "$", "++", + ]) + + keywords = words([ + "if", "then", "else", "where", "with", "cond", + "case", "and", "or", "not", "in", "as", "for", + "requires", "throw", "try", "catch", "when", + "yield", "upval", + ], suffix=r'\b') + + tokens = { + 'root': [ + (r'[ \n\r]+', Text), + (r'--.*$', Comment.Single), + (r'"""', String, 'multiString'), + (r'"', String, 'string'), + (r'[\[\](){}:;,.]', Punctuation), + (ops, Operator), + (keywords, Keyword), + (r'\d+|\d*\.\d+', Number), + (r'(true|false)\b', Name.Builtin), + (r'[A-Z][a-zA-Z0-9]*\b', String.Symbol), + (r'output\b', Name.Variable.Magic), + (r'(export|import)\b', Keyword.Namespace), + (r'[a-z][a-zA-Z0-9]*\b', Name.Variable) + ], + 'multiString': [ + (r'\\.', String.Escape), + (r'"""', String, '#pop'), + (r'"', String), + (r'[^\\"]+', String), + ], + 'string': [ + (r'\\.', String.Escape), + (r'"', String, '#pop'), + (r'\n', Error), + (r'[^\\"]+', String), + ], + } diff --git a/shared/package-files/75/75415caa5bfc77d316399d798f213b94ad69cace64389cb703efbbf6e0fec3a4/zero_native.h b/shared/package-files/75/75415caa5bfc77d316399d798f213b94ad69cace64389cb703efbbf6e0fec3a4/zero_native.h new file mode 100644 index 0000000000000000000000000000000000000000..39751b677ee39d3614b38dd58454ef41143fec97 --- /dev/null +++ b/shared/package-files/75/75415caa5bfc77d316399d798f213b94ad69cace64389cb703efbbf6e0fec3a4/zero_native.h @@ -0,0 +1,28 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor zero(const at::Tensor & self); +TORCH_API at::Tensor & zero_out(const at::Tensor & self, at::Tensor & out); +TORCH_API at::Tensor & zero_(at::Tensor & self); +TORCH_API at::Tensor & zero_nested_(at::Tensor & self); +TORCH_API at::Tensor & zero_sparse_(at::Tensor & self); +TORCH_API at::Tensor & zero_sparse_csr_(at::Tensor & self); +TORCH_API at::Tensor & zero_meta_(at::Tensor & self); +TORCH_API at::Tensor & mkldnn_zero_(at::Tensor & self); +} // namespace native +} // namespace at diff --git a/shared/package-files/75/7543cbbbc7eb94afaf99fdfe8ab5ffeeebf0cb0e3171cbfa1088b398867cf243/bessel.py b/shared/package-files/75/7543cbbbc7eb94afaf99fdfe8ab5ffeeebf0cb0e3171cbfa1088b398867cf243/bessel.py new file mode 100644 index 0000000000000000000000000000000000000000..8b41d87bb0118de61d5561433dabcb181f872f84 --- /dev/null +++ b/shared/package-files/75/7543cbbbc7eb94afaf99fdfe8ab5ffeeebf0cb0e3171cbfa1088b398867cf243/bessel.py @@ -0,0 +1,1108 @@ +from .functions import defun, defun_wrapped + +@defun +def j0(ctx, x): + """Computes the Bessel function `J_0(x)`. See :func:`~mpmath.besselj`.""" + return ctx.besselj(0, x) + +@defun +def j1(ctx, x): + """Computes the Bessel function `J_1(x)`. See :func:`~mpmath.besselj`.""" + return ctx.besselj(1, x) + +@defun +def besselj(ctx, n, z, derivative=0, **kwargs): + if type(n) is int: + n_isint = True + else: + n = ctx.convert(n) + n_isint = ctx.isint(n) + if n_isint: + n = int(ctx._re(n)) + if n_isint and n < 0: + return (-1)**n * ctx.besselj(-n, z, derivative, **kwargs) + z = ctx.convert(z) + M = ctx.mag(z) + if derivative: + d = ctx.convert(derivative) + # TODO: the integer special-casing shouldn't be necessary. + # However, the hypergeometric series gets inaccurate for large d + # because of inaccurate pole cancellation at a pole far from + # zero (needs to be fixed in hypercomb or hypsum) + if ctx.isint(d) and d >= 0: + d = int(d) + orig = ctx.prec + try: + ctx.prec += 15 + v = ctx.fsum((-1)**k * ctx.binomial(d,k) * ctx.besselj(2*k+n-d,z) + for k in range(d+1)) + finally: + ctx.prec = orig + v *= ctx.mpf(2)**(-d) + else: + def h(n,d): + r = ctx.fmul(ctx.fmul(z, z, prec=ctx.prec+M), -0.25, exact=True) + B = [0.5*(n-d+1), 0.5*(n-d+2)] + T = [([2,ctx.pi,z],[d-2*n,0.5,n-d],[],B,[(n+1)*0.5,(n+2)*0.5],B+[n+1],r)] + return T + v = ctx.hypercomb(h, [n,d], **kwargs) + else: + # Fast case: J_n(x), n int, appropriate magnitude for fixed-point calculation + if (not derivative) and n_isint and abs(M) < 10 and abs(n) < 20: + try: + return ctx._besselj(n, z) + except NotImplementedError: + pass + if not z: + if not n: + v = ctx.one + n+z + elif ctx.re(n) > 0: + v = n*z + else: + v = ctx.inf + z + n + else: + #v = 0 + orig = ctx.prec + try: + # XXX: workaround for accuracy in low level hypergeometric series + # when alternating, large arguments + ctx.prec += min(3*abs(M), ctx.prec) + w = ctx.fmul(z, 0.5, exact=True) + def h(n): + r = ctx.fneg(ctx.fmul(w, w, prec=max(0,ctx.prec+M)), exact=True) + return [([w], [n], [], [n+1], [], [n+1], r)] + v = ctx.hypercomb(h, [n], **kwargs) + finally: + ctx.prec = orig + v = +v + return v + +@defun +def besseli(ctx, n, z, derivative=0, **kwargs): + n = ctx.convert(n) + z = ctx.convert(z) + if not z: + if derivative: + raise ValueError + if not n: + # I(0,0) = 1 + return 1+n+z + if ctx.isint(n): + return 0*(n+z) + r = ctx.re(n) + if r == 0: + return ctx.nan*(n+z) + elif r > 0: + return 0*(n+z) + else: + return ctx.inf+(n+z) + M = ctx.mag(z) + if derivative: + d = ctx.convert(derivative) + def h(n,d): + r = ctx.fmul(ctx.fmul(z, z, prec=ctx.prec+M), 0.25, exact=True) + B = [0.5*(n-d+1), 0.5*(n-d+2), n+1] + T = [([2,ctx.pi,z],[d-2*n,0.5,n-d],[n+1],B,[(n+1)*0.5,(n+2)*0.5],B,r)] + return T + v = ctx.hypercomb(h, [n,d], **kwargs) + else: + def h(n): + w = ctx.fmul(z, 0.5, exact=True) + r = ctx.fmul(w, w, prec=max(0,ctx.prec+M)) + return [([w], [n], [], [n+1], [], [n+1], r)] + v = ctx.hypercomb(h, [n], **kwargs) + return v + +@defun_wrapped +def bessely(ctx, n, z, derivative=0, **kwargs): + if not z: + if derivative: + # Not implemented + raise ValueError + if not n: + # ~ log(z/2) + return -ctx.inf + (n+z) + if ctx.im(n): + return ctx.nan * (n+z) + r = ctx.re(n) + q = n+0.5 + if ctx.isint(q): + if n > 0: + return -ctx.inf + (n+z) + else: + return 0 * (n+z) + if r < 0 and int(ctx.floor(q)) % 2: + return ctx.inf + (n+z) + else: + return ctx.ninf + (n+z) + # XXX: use hypercomb + ctx.prec += 10 + m, d = ctx.nint_distance(n) + if d < -ctx.prec: + h = +ctx.eps + ctx.prec *= 2 + n += h + elif d < 0: + ctx.prec -= d + # TODO: avoid cancellation for imaginary arguments + cos, sin = ctx.cospi_sinpi(n) + return (ctx.besselj(n,z,derivative,**kwargs)*cos - \ + ctx.besselj(-n,z,derivative,**kwargs))/sin + +@defun_wrapped +def besselk(ctx, n, z, **kwargs): + if not z: + return ctx.inf + M = ctx.mag(z) + if M < 1: + # Represent as limit definition + def h(n): + r = (z/2)**2 + T1 = [z, 2], [-n, n-1], [n], [], [], [1-n], r + T2 = [z, 2], [n, -n-1], [-n], [], [], [1+n], r + return T1, T2 + # We could use the limit definition always, but it leads + # to very bad cancellation (of exponentially large terms) + # for large real z + # Instead represent in terms of 2F0 + else: + ctx.prec += M + def h(n): + return [([ctx.pi/2, z, ctx.exp(-z)], [0.5,-0.5,1], [], [], \ + [n+0.5, 0.5-n], [], -1/(2*z))] + return ctx.hypercomb(h, [n], **kwargs) + +@defun_wrapped +def hankel1(ctx,n,x,**kwargs): + return ctx.besselj(n,x,**kwargs) + ctx.j*ctx.bessely(n,x,**kwargs) + +@defun_wrapped +def hankel2(ctx,n,x,**kwargs): + return ctx.besselj(n,x,**kwargs) - ctx.j*ctx.bessely(n,x,**kwargs) + +@defun_wrapped +def whitm(ctx,k,m,z,**kwargs): + if z == 0: + # M(k,m,z) = 0^(1/2+m) + if ctx.re(m) > -0.5: + return z + elif ctx.re(m) < -0.5: + return ctx.inf + z + else: + return ctx.nan * z + x = ctx.fmul(-0.5, z, exact=True) + y = 0.5+m + return ctx.exp(x) * z**y * ctx.hyp1f1(y-k, 1+2*m, z, **kwargs) + +@defun_wrapped +def whitw(ctx,k,m,z,**kwargs): + if z == 0: + g = abs(ctx.re(m)) + if g < 0.5: + return z + elif g > 0.5: + return ctx.inf + z + else: + return ctx.nan * z + x = ctx.fmul(-0.5, z, exact=True) + y = 0.5+m + return ctx.exp(x) * z**y * ctx.hyperu(y-k, 1+2*m, z, **kwargs) + +@defun +def hyperu(ctx, a, b, z, **kwargs): + a, atype = ctx._convert_param(a) + b, btype = ctx._convert_param(b) + z = ctx.convert(z) + if not z: + if ctx.re(b) <= 1: + return ctx.gammaprod([1-b],[a-b+1]) + else: + return ctx.inf + z + bb = 1+a-b + bb, bbtype = ctx._convert_param(bb) + try: + orig = ctx.prec + try: + ctx.prec += 10 + v = ctx.hypsum(2, 0, (atype, bbtype), [a, bb], -1/z, maxterms=ctx.prec) + return v / z**a + finally: + ctx.prec = orig + except ctx.NoConvergence: + pass + def h(a,b): + w = ctx.sinpi(b) + T1 = ([ctx.pi,w],[1,-1],[],[a-b+1,b],[a],[b],z) + T2 = ([-ctx.pi,w,z],[1,-1,1-b],[],[a,2-b],[a-b+1],[2-b],z) + return T1, T2 + return ctx.hypercomb(h, [a,b], **kwargs) + +@defun +def struveh(ctx,n,z, **kwargs): + n = ctx.convert(n) + z = ctx.convert(z) + # http://functions.wolfram.com/Bessel-TypeFunctions/StruveH/26/01/02/ + def h(n): + return [([z/2, 0.5*ctx.sqrt(ctx.pi)], [n+1, -1], [], [n+1.5], [1], [1.5, n+1.5], -(z/2)**2)] + return ctx.hypercomb(h, [n], **kwargs) + +@defun +def struvel(ctx,n,z, **kwargs): + n = ctx.convert(n) + z = ctx.convert(z) + # http://functions.wolfram.com/Bessel-TypeFunctions/StruveL/26/01/02/ + def h(n): + return [([z/2, 0.5*ctx.sqrt(ctx.pi)], [n+1, -1], [], [n+1.5], [1], [1.5, n+1.5], (z/2)**2)] + return ctx.hypercomb(h, [n], **kwargs) + +def _anger(ctx,which,v,z,**kwargs): + v = ctx._convert_param(v)[0] + z = ctx.convert(z) + def h(v): + b = ctx.mpq_1_2 + u = v*b + m = b*3 + a1,a2,b1,b2 = m-u, m+u, 1-u, 1+u + c, s = ctx.cospi_sinpi(u) + if which == 0: + A, B = [b*z, s], [c] + if which == 1: + A, B = [b*z, -c], [s] + w = ctx.square_exp_arg(z, mult=-0.25) + T1 = A, [1, 1], [], [a1,a2], [1], [a1,a2], w + T2 = B, [1], [], [b1,b2], [1], [b1,b2], w + return T1, T2 + return ctx.hypercomb(h, [v], **kwargs) + +@defun +def angerj(ctx, v, z, **kwargs): + return _anger(ctx, 0, v, z, **kwargs) + +@defun +def webere(ctx, v, z, **kwargs): + return _anger(ctx, 1, v, z, **kwargs) + +@defun +def lommels1(ctx, u, v, z, **kwargs): + u = ctx._convert_param(u)[0] + v = ctx._convert_param(v)[0] + z = ctx.convert(z) + def h(u,v): + b = ctx.mpq_1_2 + w = ctx.square_exp_arg(z, mult=-0.25) + return ([u-v+1, u+v+1, z], [-1, -1, u+1], [], [], [1], \ + [b*(u-v+3),b*(u+v+3)], w), + return ctx.hypercomb(h, [u,v], **kwargs) + +@defun +def lommels2(ctx, u, v, z, **kwargs): + u = ctx._convert_param(u)[0] + v = ctx._convert_param(v)[0] + z = ctx.convert(z) + # Asymptotic expansion (GR p. 947) -- need to be careful + # not to use for small arguments + # def h(u,v): + # b = ctx.mpq_1_2 + # w = -(z/2)**(-2) + # return ([z], [u-1], [], [], [b*(1-u+v)], [b*(1-u-v)], w), + def h(u,v): + b = ctx.mpq_1_2 + w = ctx.square_exp_arg(z, mult=-0.25) + T1 = [u-v+1, u+v+1, z], [-1, -1, u+1], [], [], [1], [b*(u-v+3),b*(u+v+3)], w + T2 = [2, z], [u+v-1, -v], [v, b*(u+v+1)], [b*(v-u+1)], [], [1-v], w + T3 = [2, z], [u-v-1, v], [-v, b*(u-v+1)], [b*(1-u-v)], [], [1+v], w + #c1 = ctx.cospi((u-v)*b) + #c2 = ctx.cospi((u+v)*b) + #s = ctx.sinpi(v) + #r1 = (u-v+1)*b + #r2 = (u+v+1)*b + #T2 = [c1, s, z, 2], [1, -1, -v, v], [], [-v+1], [], [-v+1], w + #T3 = [-c2, s, z, 2], [1, -1, v, -v], [], [v+1], [], [v+1], w + #T2 = [c1, s, z, 2], [1, -1, -v, v+u-1], [r1, r2], [-v+1], [], [-v+1], w + #T3 = [-c2, s, z, 2], [1, -1, v, -v+u-1], [r1, r2], [v+1], [], [v+1], w + return T1, T2, T3 + return ctx.hypercomb(h, [u,v], **kwargs) + +@defun +def ber(ctx, n, z, **kwargs): + n = ctx.convert(n) + z = ctx.convert(z) + # http://functions.wolfram.com/Bessel-TypeFunctions/KelvinBer2/26/01/02/0001/ + def h(n): + r = -(z/4)**4 + cos, sin = ctx.cospi_sinpi(-0.75*n) + T1 = [cos, z/2], [1, n], [], [n+1], [], [0.5, 0.5*(n+1), 0.5*n+1], r + T2 = [sin, z/2], [1, n+2], [], [n+2], [], [1.5, 0.5*(n+3), 0.5*n+1], r + return T1, T2 + return ctx.hypercomb(h, [n], **kwargs) + +@defun +def bei(ctx, n, z, **kwargs): + n = ctx.convert(n) + z = ctx.convert(z) + # http://functions.wolfram.com/Bessel-TypeFunctions/KelvinBei2/26/01/02/0001/ + def h(n): + r = -(z/4)**4 + cos, sin = ctx.cospi_sinpi(0.75*n) + T1 = [cos, z/2], [1, n+2], [], [n+2], [], [1.5, 0.5*(n+3), 0.5*n+1], r + T2 = [sin, z/2], [1, n], [], [n+1], [], [0.5, 0.5*(n+1), 0.5*n+1], r + return T1, T2 + return ctx.hypercomb(h, [n], **kwargs) + +@defun +def ker(ctx, n, z, **kwargs): + n = ctx.convert(n) + z = ctx.convert(z) + # http://functions.wolfram.com/Bessel-TypeFunctions/KelvinKer2/26/01/02/0001/ + def h(n): + r = -(z/4)**4 + cos1, sin1 = ctx.cospi_sinpi(0.25*n) + cos2, sin2 = ctx.cospi_sinpi(0.75*n) + T1 = [2, z, 4*cos1], [-n-3, n, 1], [-n], [], [], [0.5, 0.5*(1+n), 0.5*(n+2)], r + T2 = [2, z, -sin1], [-n-3, 2+n, 1], [-n-1], [], [], [1.5, 0.5*(3+n), 0.5*(n+2)], r + T3 = [2, z, 4*cos2], [n-3, -n, 1], [n], [], [], [0.5, 0.5*(1-n), 1-0.5*n], r + T4 = [2, z, -sin2], [n-3, 2-n, 1], [n-1], [], [], [1.5, 0.5*(3-n), 1-0.5*n], r + return T1, T2, T3, T4 + return ctx.hypercomb(h, [n], **kwargs) + +@defun +def kei(ctx, n, z, **kwargs): + n = ctx.convert(n) + z = ctx.convert(z) + # http://functions.wolfram.com/Bessel-TypeFunctions/KelvinKei2/26/01/02/0001/ + def h(n): + r = -(z/4)**4 + cos1, sin1 = ctx.cospi_sinpi(0.75*n) + cos2, sin2 = ctx.cospi_sinpi(0.25*n) + T1 = [-cos1, 2, z], [1, n-3, 2-n], [n-1], [], [], [1.5, 0.5*(3-n), 1-0.5*n], r + T2 = [-sin1, 2, z], [1, n-1, -n], [n], [], [], [0.5, 0.5*(1-n), 1-0.5*n], r + T3 = [-sin2, 2, z], [1, -n-1, n], [-n], [], [], [0.5, 0.5*(n+1), 0.5*(n+2)], r + T4 = [-cos2, 2, z], [1, -n-3, n+2], [-n-1], [], [], [1.5, 0.5*(n+3), 0.5*(n+2)], r + return T1, T2, T3, T4 + return ctx.hypercomb(h, [n], **kwargs) + +# TODO: do this more generically? +def c_memo(f): + name = f.__name__ + def f_wrapped(ctx): + cache = ctx._misc_const_cache + prec = ctx.prec + p,v = cache.get(name, (-1,0)) + if p >= prec: + return +v + else: + cache[name] = (prec, f(ctx)) + return cache[name][1] + return f_wrapped + +@c_memo +def _airyai_C1(ctx): + return 1 / (ctx.cbrt(9) * ctx.gamma(ctx.mpf(2)/3)) + +@c_memo +def _airyai_C2(ctx): + return -1 / (ctx.cbrt(3) * ctx.gamma(ctx.mpf(1)/3)) + +@c_memo +def _airybi_C1(ctx): + return 1 / (ctx.nthroot(3,6) * ctx.gamma(ctx.mpf(2)/3)) + +@c_memo +def _airybi_C2(ctx): + return ctx.nthroot(3,6) / ctx.gamma(ctx.mpf(1)/3) + +def _airybi_n2_inf(ctx): + prec = ctx.prec + try: + v = ctx.power(3,'2/3')*ctx.gamma('2/3')/(2*ctx.pi) + finally: + ctx.prec = prec + return +v + +# Derivatives at z = 0 +# TODO: could be expressed more elegantly using triple factorials +def _airyderiv_0(ctx, z, n, ntype, which): + if ntype == 'Z': + if n < 0: + return z + r = ctx.mpq_1_3 + prec = ctx.prec + try: + ctx.prec += 10 + v = ctx.gamma((n+1)*r) * ctx.power(3,n*r) / ctx.pi + if which == 0: + v *= ctx.sinpi(2*(n+1)*r) + v /= ctx.power(3,'2/3') + else: + v *= abs(ctx.sinpi(2*(n+1)*r)) + v /= ctx.power(3,'1/6') + finally: + ctx.prec = prec + return +v + z + else: + # singular (does the limit exist?) + raise NotImplementedError + +@defun +def airyai(ctx, z, derivative=0, **kwargs): + z = ctx.convert(z) + if derivative: + n, ntype = ctx._convert_param(derivative) + else: + n = 0 + # Values at infinities + if not ctx.isnormal(z) and z: + if n and ntype == 'Z': + if n == -1: + if z == ctx.inf: + return ctx.mpf(1)/3 + 1/z + if z == ctx.ninf: + return ctx.mpf(-2)/3 + 1/z + if n < -1: + if z == ctx.inf: + return z + if z == ctx.ninf: + return (-1)**n * (-z) + if (not n) and z == ctx.inf or z == ctx.ninf: + return 1/z + # TODO: limits + raise ValueError("essential singularity of Ai(z)") + # Account for exponential scaling + if z: + extraprec = max(0, int(1.5*ctx.mag(z))) + else: + extraprec = 0 + if n: + if n == 1: + def h(): + # http://functions.wolfram.com/03.07.06.0005.01 + if ctx._re(z) > 4: + ctx.prec += extraprec + w = z**1.5; r = -0.75/w; u = -2*w/3 + ctx.prec -= extraprec + C = -ctx.exp(u)/(2*ctx.sqrt(ctx.pi))*ctx.nthroot(z,4) + return ([C],[1],[],[],[(-1,6),(7,6)],[],r), + # http://functions.wolfram.com/03.07.26.0001.01 + else: + ctx.prec += extraprec + w = z**3 / 9 + ctx.prec -= extraprec + C1 = _airyai_C1(ctx) * 0.5 + C2 = _airyai_C2(ctx) + T1 = [C1,z],[1,2],[],[],[],[ctx.mpq_5_3],w + T2 = [C2],[1],[],[],[],[ctx.mpq_1_3],w + return T1, T2 + return ctx.hypercomb(h, [], **kwargs) + else: + if z == 0: + return _airyderiv_0(ctx, z, n, ntype, 0) + # http://functions.wolfram.com/03.05.20.0004.01 + def h(n): + ctx.prec += extraprec + w = z**3/9 + ctx.prec -= extraprec + q13,q23,q43 = ctx.mpq_1_3, ctx.mpq_2_3, ctx.mpq_4_3 + a1=q13; a2=1; b1=(1-n)*q13; b2=(2-n)*q13; b3=1-n*q13 + T1 = [3, z], [n-q23, -n], [a1], [b1,b2,b3], \ + [a1,a2], [b1,b2,b3], w + a1=q23; b1=(2-n)*q13; b2=1-n*q13; b3=(4-n)*q13 + T2 = [3, z, -z], [n-q43, -n, 1], [a1], [b1,b2,b3], \ + [a1,a2], [b1,b2,b3], w + return T1, T2 + v = ctx.hypercomb(h, [n], **kwargs) + if ctx._is_real_type(z) and ctx.isint(n): + v = ctx._re(v) + return v + else: + def h(): + if ctx._re(z) > 4: + # We could use 1F1, but it results in huge cancellation; + # the following expansion is better. + # TODO: asymptotic series for derivatives + ctx.prec += extraprec + w = z**1.5; r = -0.75/w; u = -2*w/3 + ctx.prec -= extraprec + C = ctx.exp(u)/(2*ctx.sqrt(ctx.pi)*ctx.nthroot(z,4)) + return ([C],[1],[],[],[(1,6),(5,6)],[],r), + else: + ctx.prec += extraprec + w = z**3 / 9 + ctx.prec -= extraprec + C1 = _airyai_C1(ctx) + C2 = _airyai_C2(ctx) + T1 = [C1],[1],[],[],[],[ctx.mpq_2_3],w + T2 = [z*C2],[1],[],[],[],[ctx.mpq_4_3],w + return T1, T2 + return ctx.hypercomb(h, [], **kwargs) + +@defun +def airybi(ctx, z, derivative=0, **kwargs): + z = ctx.convert(z) + if derivative: + n, ntype = ctx._convert_param(derivative) + else: + n = 0 + # Values at infinities + if not ctx.isnormal(z) and z: + if n and ntype == 'Z': + if z == ctx.inf: + return z + if z == ctx.ninf: + if n == -1: + return 1/z + if n == -2: + return _airybi_n2_inf(ctx) + if n < -2: + return (-1)**n * (-z) + if not n: + if z == ctx.inf: + return z + if z == ctx.ninf: + return 1/z + # TODO: limits + raise ValueError("essential singularity of Bi(z)") + if z: + extraprec = max(0, int(1.5*ctx.mag(z))) + else: + extraprec = 0 + if n: + if n == 1: + # http://functions.wolfram.com/03.08.26.0001.01 + def h(): + ctx.prec += extraprec + w = z**3 / 9 + ctx.prec -= extraprec + C1 = _airybi_C1(ctx)*0.5 + C2 = _airybi_C2(ctx) + T1 = [C1,z],[1,2],[],[],[],[ctx.mpq_5_3],w + T2 = [C2],[1],[],[],[],[ctx.mpq_1_3],w + return T1, T2 + return ctx.hypercomb(h, [], **kwargs) + else: + if z == 0: + return _airyderiv_0(ctx, z, n, ntype, 1) + def h(n): + ctx.prec += extraprec + w = z**3/9 + ctx.prec -= extraprec + q13,q23,q43 = ctx.mpq_1_3, ctx.mpq_2_3, ctx.mpq_4_3 + q16 = ctx.mpq_1_6 + q56 = ctx.mpq_5_6 + a1=q13; a2=1; b1=(1-n)*q13; b2=(2-n)*q13; b3=1-n*q13 + T1 = [3, z], [n-q16, -n], [a1], [b1,b2,b3], \ + [a1,a2], [b1,b2,b3], w + a1=q23; b1=(2-n)*q13; b2=1-n*q13; b3=(4-n)*q13 + T2 = [3, z], [n-q56, 1-n], [a1], [b1,b2,b3], \ + [a1,a2], [b1,b2,b3], w + return T1, T2 + v = ctx.hypercomb(h, [n], **kwargs) + if ctx._is_real_type(z) and ctx.isint(n): + v = ctx._re(v) + return v + else: + def h(): + ctx.prec += extraprec + w = z**3 / 9 + ctx.prec -= extraprec + C1 = _airybi_C1(ctx) + C2 = _airybi_C2(ctx) + T1 = [C1],[1],[],[],[],[ctx.mpq_2_3],w + T2 = [z*C2],[1],[],[],[],[ctx.mpq_4_3],w + return T1, T2 + return ctx.hypercomb(h, [], **kwargs) + +def _airy_zero(ctx, which, k, derivative, complex=False): + # Asymptotic formulas are given in DLMF section 9.9 + def U(t): return t**(2/3.)*(1-7/(t**2*48)) + def T(t): return t**(2/3.)*(1+5/(t**2*48)) + k = int(k) + if k < 1: + raise ValueError("k cannot be less than 1") + if not derivative in (0,1): + raise ValueError("Derivative should lie between 0 and 1") + if which == 0: + if derivative: + return ctx.findroot(lambda z: ctx.airyai(z,1), + -U(3*ctx.pi*(4*k-3)/8)) + return ctx.findroot(ctx.airyai, -T(3*ctx.pi*(4*k-1)/8)) + if which == 1 and complex == False: + if derivative: + return ctx.findroot(lambda z: ctx.airybi(z,1), + -U(3*ctx.pi*(4*k-1)/8)) + return ctx.findroot(ctx.airybi, -T(3*ctx.pi*(4*k-3)/8)) + if which == 1 and complex == True: + if derivative: + t = 3*ctx.pi*(4*k-3)/8 + 0.75j*ctx.ln2 + s = ctx.expjpi(ctx.mpf(1)/3) * T(t) + return ctx.findroot(lambda z: ctx.airybi(z,1), s) + t = 3*ctx.pi*(4*k-1)/8 + 0.75j*ctx.ln2 + s = ctx.expjpi(ctx.mpf(1)/3) * U(t) + return ctx.findroot(ctx.airybi, s) + +@defun +def airyaizero(ctx, k, derivative=0): + return _airy_zero(ctx, 0, k, derivative, False) + +@defun +def airybizero(ctx, k, derivative=0, complex=False): + return _airy_zero(ctx, 1, k, derivative, complex) + +def _scorer(ctx, z, which, kwargs): + z = ctx.convert(z) + if ctx.isinf(z): + if z == ctx.inf: + if which == 0: return 1/z + if which == 1: return z + if z == ctx.ninf: + return 1/z + raise ValueError("essential singularity") + if z: + extraprec = max(0, int(1.5*ctx.mag(z))) + else: + extraprec = 0 + if kwargs.get('derivative'): + raise NotImplementedError + # Direct asymptotic expansions, to avoid + # exponentially large cancellation + try: + if ctx.mag(z) > 3: + if which == 0 and abs(ctx.arg(z)) < ctx.pi/3 * 0.999: + def h(): + return (([ctx.pi,z],[-1,-1],[],[],[(1,3),(2,3),1],[],9/z**3),) + return ctx.hypercomb(h, [], maxterms=ctx.prec, force_series=True) + if which == 1 and abs(ctx.arg(-z)) < 2*ctx.pi/3 * 0.999: + def h(): + return (([-ctx.pi,z],[-1,-1],[],[],[(1,3),(2,3),1],[],9/z**3),) + return ctx.hypercomb(h, [], maxterms=ctx.prec, force_series=True) + except ctx.NoConvergence: + pass + def h(): + A = ctx.airybi(z, **kwargs)/3 + B = -2*ctx.pi + if which == 1: + A *= 2 + B *= -1 + ctx.prec += extraprec + w = z**3/9 + ctx.prec -= extraprec + T1 = [A], [1], [], [], [], [], 0 + T2 = [B,z], [-1,2], [], [], [1], [ctx.mpq_4_3,ctx.mpq_5_3], w + return T1, T2 + return ctx.hypercomb(h, [], **kwargs) + +@defun +def scorergi(ctx, z, **kwargs): + return _scorer(ctx, z, 0, kwargs) + +@defun +def scorerhi(ctx, z, **kwargs): + return _scorer(ctx, z, 1, kwargs) + +@defun_wrapped +def coulombc(ctx, l, eta, _cache={}): + if (l, eta) in _cache and _cache[l,eta][0] >= ctx.prec: + return +_cache[l,eta][1] + G3 = ctx.loggamma(2*l+2) + G1 = ctx.loggamma(1+l+ctx.j*eta) + G2 = ctx.loggamma(1+l-ctx.j*eta) + v = 2**l * ctx.exp((-ctx.pi*eta+G1+G2)/2 - G3) + if not (ctx.im(l) or ctx.im(eta)): + v = ctx.re(v) + _cache[l,eta] = (ctx.prec, v) + return v + +@defun_wrapped +def coulombf(ctx, l, eta, z, w=1, chop=True, **kwargs): + # Regular Coulomb wave function + # Note: w can be either 1 or -1; the other may be better in some cases + # TODO: check that chop=True chops when and only when it should + #ctx.prec += 10 + def h(l, eta): + try: + jw = ctx.j*w + jwz = ctx.fmul(jw, z, exact=True) + jwz2 = ctx.fmul(jwz, -2, exact=True) + C = ctx.coulombc(l, eta) + T1 = [C, z, ctx.exp(jwz)], [1, l+1, 1], [], [], [1+l+jw*eta], \ + [2*l+2], jwz2 + except ValueError: + T1 = [0], [-1], [], [], [], [], 0 + return (T1,) + v = ctx.hypercomb(h, [l,eta], **kwargs) + if chop and (not ctx.im(l)) and (not ctx.im(eta)) and (not ctx.im(z)) and \ + (ctx.re(z) >= 0): + v = ctx.re(v) + return v + +@defun_wrapped +def _coulomb_chi(ctx, l, eta, _cache={}): + if (l, eta) in _cache and _cache[l,eta][0] >= ctx.prec: + return _cache[l,eta][1] + def terms(): + l2 = -l-1 + jeta = ctx.j*eta + return [ctx.loggamma(1+l+jeta) * (-0.5j), + ctx.loggamma(1+l-jeta) * (0.5j), + ctx.loggamma(1+l2+jeta) * (0.5j), + ctx.loggamma(1+l2-jeta) * (-0.5j), + -(l+0.5)*ctx.pi] + v = ctx.sum_accurately(terms, 1) + _cache[l,eta] = (ctx.prec, v) + return v + +@defun_wrapped +def coulombg(ctx, l, eta, z, w=1, chop=True, **kwargs): + # Irregular Coulomb wave function + # Note: w can be either 1 or -1; the other may be better in some cases + # TODO: check that chop=True chops when and only when it should + if not ctx._im(l): + l = ctx._re(l) # XXX: for isint + def h(l, eta): + # Force perturbation for integers and half-integers + if ctx.isint(l*2): + T1 = [0], [-1], [], [], [], [], 0 + return (T1,) + l2 = -l-1 + try: + chi = ctx._coulomb_chi(l, eta) + jw = ctx.j*w + s = ctx.sin(chi); c = ctx.cos(chi) + C1 = ctx.coulombc(l,eta) + C2 = ctx.coulombc(l2,eta) + u = ctx.exp(jw*z) + x = -2*jw*z + T1 = [s, C1, z, u, c], [-1, 1, l+1, 1, 1], [], [], \ + [1+l+jw*eta], [2*l+2], x + T2 = [-s, C2, z, u], [-1, 1, l2+1, 1], [], [], \ + [1+l2+jw*eta], [2*l2+2], x + return T1, T2 + except ValueError: + T1 = [0], [-1], [], [], [], [], 0 + return (T1,) + v = ctx.hypercomb(h, [l,eta], **kwargs) + if chop and (not ctx._im(l)) and (not ctx._im(eta)) and (not ctx._im(z)) and \ + (ctx._re(z) >= 0): + v = ctx._re(v) + return v + +def mcmahon(ctx,kind,prime,v,m): + """ + Computes an estimate for the location of the Bessel function zero + j_{v,m}, y_{v,m}, j'_{v,m} or y'_{v,m} using McMahon's asymptotic + expansion (Abramowitz & Stegun 9.5.12-13, DLMF 20.21(vi)). + + Returns (r,err) where r is the estimated location of the root + and err is a positive number estimating the error of the + asymptotic expansion. + """ + u = 4*v**2 + if kind == 1 and not prime: b = (4*m+2*v-1)*ctx.pi/4 + if kind == 2 and not prime: b = (4*m+2*v-3)*ctx.pi/4 + if kind == 1 and prime: b = (4*m+2*v-3)*ctx.pi/4 + if kind == 2 and prime: b = (4*m+2*v-1)*ctx.pi/4 + if not prime: + s1 = b + s2 = -(u-1)/(8*b) + s3 = -4*(u-1)*(7*u-31)/(3*(8*b)**3) + s4 = -32*(u-1)*(83*u**2-982*u+3779)/(15*(8*b)**5) + s5 = -64*(u-1)*(6949*u**3-153855*u**2+1585743*u-6277237)/(105*(8*b)**7) + if prime: + s1 = b + s2 = -(u+3)/(8*b) + s3 = -4*(7*u**2+82*u-9)/(3*(8*b)**3) + s4 = -32*(83*u**3+2075*u**2-3039*u+3537)/(15*(8*b)**5) + s5 = -64*(6949*u**4+296492*u**3-1248002*u**2+7414380*u-5853627)/(105*(8*b)**7) + terms = [s1,s2,s3,s4,s5] + s = s1 + err = 0.0 + for i in range(1,len(terms)): + if abs(terms[i]) < abs(terms[i-1]): + s += terms[i] + else: + err = abs(terms[i]) + if i == len(terms)-1: + err = abs(terms[-1]) + return s, err + +def generalized_bisection(ctx,f,a,b,n): + """ + Given f known to have exactly n simple roots within [a,b], + return a list of n intervals isolating the roots + and having opposite signs at the endpoints. + + TODO: this can be optimized, e.g. by reusing evaluation points. + """ + if n < 1: + raise ValueError("n cannot be less than 1") + N = n+1 + points = [] + signs = [] + while 1: + points = ctx.linspace(a,b,N) + signs = [ctx.sign(f(x)) for x in points] + ok_intervals = [(points[i],points[i+1]) for i in range(N-1) \ + if signs[i]*signs[i+1] == -1] + if len(ok_intervals) == n: + return ok_intervals + N = N*2 + +def find_in_interval(ctx, f, ab): + return ctx.findroot(f, ab, solver='illinois', verify=False) + +def bessel_zero(ctx, kind, prime, v, m, isoltol=0.01, _interval_cache={}): + prec = ctx.prec + workprec = max(prec, ctx.mag(v), ctx.mag(m))+10 + try: + ctx.prec = workprec + v = ctx.mpf(v) + m = int(m) + prime = int(prime) + if v < 0: + raise ValueError("v cannot be negative") + if m < 1: + raise ValueError("m cannot be less than 1") + if not prime in (0,1): + raise ValueError("prime should lie between 0 and 1") + if kind == 1: + if prime: f = lambda x: ctx.besselj(v,x,derivative=1) + else: f = lambda x: ctx.besselj(v,x) + if kind == 2: + if prime: f = lambda x: ctx.bessely(v,x,derivative=1) + else: f = lambda x: ctx.bessely(v,x) + # The first root of J' is very close to 0 for small + # orders, and this needs to be special-cased + if kind == 1 and prime and m == 1: + if v == 0: + return ctx.zero + if v <= 1: + # TODO: use v <= j'_{v,1} < y_{v,1}? + r = 2*ctx.sqrt(v*(1+v)/(v+2)) + return find_in_interval(ctx, f, (r/10, 2*r)) + if (kind,prime,v,m) in _interval_cache: + return find_in_interval(ctx, f, _interval_cache[kind,prime,v,m]) + r, err = mcmahon(ctx, kind, prime, v, m) + if err < isoltol: + return find_in_interval(ctx, f, (r-isoltol, r+isoltol)) + # An x such that 0 < x < r_{v,1} + if kind == 1 and not prime: low = 2.4 + if kind == 1 and prime: low = 1.8 + if kind == 2 and not prime: low = 0.8 + if kind == 2 and prime: low = 2.0 + n = m+1 + while 1: + r1, err = mcmahon(ctx, kind, prime, v, n) + if err < isoltol: + r2, err2 = mcmahon(ctx, kind, prime, v, n+1) + intervals = generalized_bisection(ctx, f, low, 0.5*(r1+r2), n) + for k, ab in enumerate(intervals): + _interval_cache[kind,prime,v,k+1] = ab + return find_in_interval(ctx, f, intervals[m-1]) + else: + n = n*2 + finally: + ctx.prec = prec + +@defun +def besseljzero(ctx, v, m, derivative=0): + r""" + For a real order `\nu \ge 0` and a positive integer `m`, returns + `j_{\nu,m}`, the `m`-th positive zero of the Bessel function of the + first kind `J_{\nu}(z)` (see :func:`~mpmath.besselj`). Alternatively, + with *derivative=1*, gives the first nonnegative simple zero + `j'_{\nu,m}` of `J'_{\nu}(z)`. + + The indexing convention is that used by Abramowitz & Stegun + and the DLMF. Note the special case `j'_{0,1} = 0`, while all other + zeros are positive. In effect, only simple zeros are counted + (all zeros of Bessel functions are simple except possibly `z = 0`) + and `j_{\nu,m}` becomes a monotonic function of both `\nu` + and `m`. + + The zeros are interlaced according to the inequalities + + .. math :: + + j'_{\nu,k} < j_{\nu,k} < j'_{\nu,k+1} + + j_{\nu,1} < j_{\nu+1,2} < j_{\nu,2} < j_{\nu+1,2} < j_{\nu,3} < \cdots + + **Examples** + + Initial zeros of the Bessel functions `J_0(z), J_1(z), J_2(z)`:: + + >>> from mpmath import * + >>> mp.dps = 25; mp.pretty = True + >>> besseljzero(0,1); besseljzero(0,2); besseljzero(0,3) + 2.404825557695772768621632 + 5.520078110286310649596604 + 8.653727912911012216954199 + >>> besseljzero(1,1); besseljzero(1,2); besseljzero(1,3) + 3.831705970207512315614436 + 7.01558666981561875353705 + 10.17346813506272207718571 + >>> besseljzero(2,1); besseljzero(2,2); besseljzero(2,3) + 5.135622301840682556301402 + 8.417244140399864857783614 + 11.61984117214905942709415 + + Initial zeros of `J'_0(z), J'_1(z), J'_2(z)`:: + + 0.0 + 3.831705970207512315614436 + 7.01558666981561875353705 + >>> besseljzero(1,1,1); besseljzero(1,2,1); besseljzero(1,3,1) + 1.84118378134065930264363 + 5.331442773525032636884016 + 8.536316366346285834358961 + >>> besseljzero(2,1,1); besseljzero(2,2,1); besseljzero(2,3,1) + 3.054236928227140322755932 + 6.706133194158459146634394 + 9.969467823087595793179143 + + Zeros with large index:: + + >>> besseljzero(0,100); besseljzero(0,1000); besseljzero(0,10000) + 313.3742660775278447196902 + 3140.807295225078628895545 + 31415.14114171350798533666 + >>> besseljzero(5,100); besseljzero(5,1000); besseljzero(5,10000) + 321.1893195676003157339222 + 3148.657306813047523500494 + 31422.9947255486291798943 + >>> besseljzero(0,100,1); besseljzero(0,1000,1); besseljzero(0,10000,1) + 311.8018681873704508125112 + 3139.236339643802482833973 + 31413.57032947022399485808 + + Zeros of functions with large order:: + + >>> besseljzero(50,1) + 57.11689916011917411936228 + >>> besseljzero(50,2) + 62.80769876483536093435393 + >>> besseljzero(50,100) + 388.6936600656058834640981 + >>> besseljzero(50,1,1) + 52.99764038731665010944037 + >>> besseljzero(50,2,1) + 60.02631933279942589882363 + >>> besseljzero(50,100,1) + 387.1083151608726181086283 + + Zeros of functions with fractional order:: + + >>> besseljzero(0.5,1); besseljzero(1.5,1); besseljzero(2.25,4) + 3.141592653589793238462643 + 4.493409457909064175307881 + 15.15657692957458622921634 + + Both `J_{\nu}(z)` and `J'_{\nu}(z)` can be expressed as infinite + products over their zeros:: + + >>> v,z = 2, mpf(1) + >>> (z/2)**v/gamma(v+1) * \ + ... nprod(lambda k: 1-(z/besseljzero(v,k))**2, [1,inf]) + ... + 0.1149034849319004804696469 + >>> besselj(v,z) + 0.1149034849319004804696469 + >>> (z/2)**(v-1)/2/gamma(v) * \ + ... nprod(lambda k: 1-(z/besseljzero(v,k,1))**2, [1,inf]) + ... + 0.2102436158811325550203884 + >>> besselj(v,z,1) + 0.2102436158811325550203884 + + """ + return +bessel_zero(ctx, 1, derivative, v, m) + +@defun +def besselyzero(ctx, v, m, derivative=0): + r""" + For a real order `\nu \ge 0` and a positive integer `m`, returns + `y_{\nu,m}`, the `m`-th positive zero of the Bessel function of the + second kind `Y_{\nu}(z)` (see :func:`~mpmath.bessely`). Alternatively, + with *derivative=1*, gives the first positive zero `y'_{\nu,m}` of + `Y'_{\nu}(z)`. + + The zeros are interlaced according to the inequalities + + .. math :: + + y_{\nu,k} < y'_{\nu,k} < y_{\nu,k+1} + + y_{\nu,1} < y_{\nu+1,2} < y_{\nu,2} < y_{\nu+1,2} < y_{\nu,3} < \cdots + + **Examples** + + Initial zeros of the Bessel functions `Y_0(z), Y_1(z), Y_2(z)`:: + + >>> from mpmath import * + >>> mp.dps = 25; mp.pretty = True + >>> besselyzero(0,1); besselyzero(0,2); besselyzero(0,3) + 0.8935769662791675215848871 + 3.957678419314857868375677 + 7.086051060301772697623625 + >>> besselyzero(1,1); besselyzero(1,2); besselyzero(1,3) + 2.197141326031017035149034 + 5.429681040794135132772005 + 8.596005868331168926429606 + >>> besselyzero(2,1); besselyzero(2,2); besselyzero(2,3) + 3.384241767149593472701426 + 6.793807513268267538291167 + 10.02347797936003797850539 + + Initial zeros of `Y'_0(z), Y'_1(z), Y'_2(z)`:: + + >>> besselyzero(0,1,1); besselyzero(0,2,1); besselyzero(0,3,1) + 2.197141326031017035149034 + 5.429681040794135132772005 + 8.596005868331168926429606 + >>> besselyzero(1,1,1); besselyzero(1,2,1); besselyzero(1,3,1) + 3.683022856585177699898967 + 6.941499953654175655751944 + 10.12340465543661307978775 + >>> besselyzero(2,1,1); besselyzero(2,2,1); besselyzero(2,3,1) + 5.002582931446063945200176 + 8.350724701413079526349714 + 11.57419546521764654624265 + + Zeros with large index:: + + >>> besselyzero(0,100); besselyzero(0,1000); besselyzero(0,10000) + 311.8034717601871549333419 + 3139.236498918198006794026 + 31413.57034538691205229188 + >>> besselyzero(5,100); besselyzero(5,1000); besselyzero(5,10000) + 319.6183338562782156235062 + 3147.086508524556404473186 + 31421.42392920214673402828 + >>> besselyzero(0,100,1); besselyzero(0,1000,1); besselyzero(0,10000,1) + 313.3726705426359345050449 + 3140.807136030340213610065 + 31415.14112579761578220175 + + Zeros of functions with large order:: + + >>> besselyzero(50,1) + 53.50285882040036394680237 + >>> besselyzero(50,2) + 60.11244442774058114686022 + >>> besselyzero(50,100) + 387.1096509824943957706835 + >>> besselyzero(50,1,1) + 56.96290427516751320063605 + >>> besselyzero(50,2,1) + 62.74888166945933944036623 + >>> besselyzero(50,100,1) + 388.6923300548309258355475 + + Zeros of functions with fractional order:: + + >>> besselyzero(0.5,1); besselyzero(1.5,1); besselyzero(2.25,4) + 1.570796326794896619231322 + 2.798386045783887136720249 + 13.56721208770735123376018 + + """ + return +bessel_zero(ctx, 2, derivative, v, m) diff --git a/shared/package-files/75/75451687b5c0c7492a340e7ab377ccdd94f75ad1153474080152d18b672f5e3b/prod_cpu_dispatch.h b/shared/package-files/75/75451687b5c0c7492a340e7ab377ccdd94f75ad1153474080152d18b672f5e3b/prod_cpu_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..50530de9e91b79bd05386ab4d3a73756a75fbf9b --- /dev/null +++ b/shared/package-files/75/75451687b5c0c7492a340e7ab377ccdd94f75ad1153474080152d18b672f5e3b/prod_cpu_dispatch.h @@ -0,0 +1,26 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cpu { + +TORCH_API at::Tensor prod(const at::Tensor & self, c10::optional dtype=c10::nullopt); +TORCH_API at::Tensor prod(const at::Tensor & self, int64_t dim, bool keepdim=false, c10::optional dtype=c10::nullopt); +TORCH_API at::Tensor & prod_out(at::Tensor & out, const at::Tensor & self, int64_t dim, bool keepdim=false, c10::optional dtype=c10::nullopt); +TORCH_API at::Tensor & prod_outf(const at::Tensor & self, int64_t dim, bool keepdim, c10::optional dtype, at::Tensor & out); + +} // namespace cpu +} // namespace at diff --git a/shared/package-files/75/75468aa931383117d4ab6ad65576dba2eee4cc3ed9f4f13d2a8f1a5cbcdaf090/seaborn-v0_8-poster.mplstyle b/shared/package-files/75/75468aa931383117d4ab6ad65576dba2eee4cc3ed9f4f13d2a8f1a5cbcdaf090/seaborn-v0_8-poster.mplstyle new file mode 100644 index 0000000000000000000000000000000000000000..47f237006caeac212840f23a8c2568947523c596 --- /dev/null +++ b/shared/package-files/75/75468aa931383117d4ab6ad65576dba2eee4cc3ed9f4f13d2a8f1a5cbcdaf090/seaborn-v0_8-poster.mplstyle @@ -0,0 +1,21 @@ +# Seaborn poster context +figure.figsize: 12.8, 8.8 +axes.labelsize: 17.6 +axes.titlesize: 19.2 +xtick.labelsize: 16 +ytick.labelsize: 16 +legend.fontsize: 16 + +grid.linewidth: 1.6 +lines.linewidth: 2.8 +patch.linewidth: 0.48 +lines.markersize: 11.2 +lines.markeredgewidth: 0 + +xtick.major.width: 1.6 +ytick.major.width: 1.6 +xtick.minor.width: 0.8 +ytick.minor.width: 0.8 + +xtick.major.pad: 11.2 +ytick.major.pad: 11.2 diff --git a/shared/package-files/75/7547c37c87687ca62e7f0c36f6357c9954268255350271b6b84c91129358ed5d/test_matchpy_connector.py b/shared/package-files/75/7547c37c87687ca62e7f0c36f6357c9954268255350271b6b84c91129358ed5d/test_matchpy_connector.py new file mode 100644 index 0000000000000000000000000000000000000000..6f244b4279f1e44e3f76d82ab9336a12b437a375 --- /dev/null +++ b/shared/package-files/75/7547c37c87687ca62e7f0c36f6357c9954268255350271b6b84c91129358ed5d/test_matchpy_connector.py @@ -0,0 +1,153 @@ +import pickle + +from sympy.core.relational import (Eq, Ne) +from sympy.core.singleton import S +from sympy.core.symbol import symbols +from sympy.functions.elementary.miscellaneous import sqrt +from sympy.functions.elementary.trigonometric import (cos, sin) +from sympy.external import import_module +from sympy.testing.pytest import skip +from sympy.utilities.matchpy_connector import WildDot, WildPlus, WildStar, Replacer + +matchpy = import_module("matchpy") + +x, y, z = symbols("x y z") + + +def _get_first_match(expr, pattern): + from matchpy import ManyToOneMatcher, Pattern + + matcher = ManyToOneMatcher() + matcher.add(Pattern(pattern)) + return next(iter(matcher.match(expr))) + + +def test_matchpy_connector(): + if matchpy is None: + skip("matchpy not installed") + + from multiset import Multiset + from matchpy import Pattern, Substitution + + w_ = WildDot("w_") + w__ = WildPlus("w__") + w___ = WildStar("w___") + + expr = x + y + pattern = x + w_ + p, subst = _get_first_match(expr, pattern) + assert p == Pattern(pattern) + assert subst == Substitution({'w_': y}) + + expr = x + y + z + pattern = x + w__ + p, subst = _get_first_match(expr, pattern) + assert p == Pattern(pattern) + assert subst == Substitution({'w__': Multiset([y, z])}) + + expr = x + y + z + pattern = x + y + z + w___ + p, subst = _get_first_match(expr, pattern) + assert p == Pattern(pattern) + assert subst == Substitution({'w___': Multiset()}) + + +def test_matchpy_optional(): + if matchpy is None: + skip("matchpy not installed") + + from matchpy import Pattern, Substitution + from matchpy import ManyToOneReplacer, ReplacementRule + + p = WildDot("p", optional=1) + q = WildDot("q", optional=0) + + pattern = p*x + q + + expr1 = 2*x + pa, subst = _get_first_match(expr1, pattern) + assert pa == Pattern(pattern) + assert subst == Substitution({'p': 2, 'q': 0}) + + expr2 = x + 3 + pa, subst = _get_first_match(expr2, pattern) + assert pa == Pattern(pattern) + assert subst == Substitution({'p': 1, 'q': 3}) + + expr3 = x + pa, subst = _get_first_match(expr3, pattern) + assert pa == Pattern(pattern) + assert subst == Substitution({'p': 1, 'q': 0}) + + expr4 = x*y + z + pa, subst = _get_first_match(expr4, pattern) + assert pa == Pattern(pattern) + assert subst == Substitution({'p': y, 'q': z}) + + replacer = ManyToOneReplacer() + replacer.add(ReplacementRule(Pattern(pattern), lambda p, q: sin(p)*cos(q))) + assert replacer.replace(expr1) == sin(2)*cos(0) + assert replacer.replace(expr2) == sin(1)*cos(3) + assert replacer.replace(expr3) == sin(1)*cos(0) + assert replacer.replace(expr4) == sin(y)*cos(z) + + +def test_replacer(): + if matchpy is None: + skip("matchpy not installed") + + x1_ = WildDot("x1_") + x2_ = WildDot("x2_") + + a_ = WildDot("a_", optional=S.One) + b_ = WildDot("b_", optional=S.One) + c_ = WildDot("c_", optional=S.Zero) + + replacer = Replacer(common_constraints=[ + matchpy.CustomConstraint(lambda a_: not a_.has(x)), + matchpy.CustomConstraint(lambda b_: not b_.has(x)), + matchpy.CustomConstraint(lambda c_: not c_.has(x)), + ]) + + # Rewrite the equation into implicit form, unless it's already solved: + replacer.add(Eq(x1_, x2_), Eq(x1_ - x2_, 0), conditions_nonfalse=[Ne(x2_, 0), Ne(x1_, 0), Ne(x1_, x), Ne(x2_, x)]) + + # Simple equation solver for real numbers: + replacer.add(Eq(a_*x + b_, 0), Eq(x, -b_/a_)) + disc = b_**2 - 4*a_*c_ + replacer.add( + Eq(a_*x**2 + b_*x + c_, 0), + Eq(x, (-b_ - sqrt(disc))/(2*a_)) | Eq(x, (-b_ + sqrt(disc))/(2*a_)), + conditions_nonfalse=[disc >= 0] + ) + replacer.add( + Eq(a_*x**2 + c_, 0), + Eq(x, sqrt(-c_/a_)) | Eq(x, -sqrt(-c_/a_)), + conditions_nonfalse=[-c_*a_ > 0] + ) + + assert replacer.replace(Eq(3*x, y)) == Eq(x, y/3) + assert replacer.replace(Eq(x**2 + 1, 0)) == Eq(x**2 + 1, 0) + assert replacer.replace(Eq(x**2, 4)) == (Eq(x, 2) | Eq(x, -2)) + assert replacer.replace(Eq(x**2 + 4*y*x + 4*y**2, 0)) == Eq(x, -2*y) + + +def test_matchpy_object_pickle(): + if matchpy is None: + return + + a1 = WildDot("a") + a2 = pickle.loads(pickle.dumps(a1)) + assert a1 == a2 + + a1 = WildDot("a", S(1)) + a2 = pickle.loads(pickle.dumps(a1)) + assert a1 == a2 + + a1 = WildPlus("a", S(1)) + a2 = pickle.loads(pickle.dumps(a1)) + assert a1 == a2 + + a1 = WildStar("a", S(1)) + a2 = pickle.loads(pickle.dumps(a1)) + assert a1 == a2 diff --git a/shared/package-files/75/754aa574f3e220d8c28f6e8e9f5c4e17d5e1fb17cae447a429cd33485633992b/isposinf_cuda_dispatch.h b/shared/package-files/75/754aa574f3e220d8c28f6e8e9f5c4e17d5e1fb17cae447a429cd33485633992b/isposinf_cuda_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..5e8ad855dda3d589b9df3ec6d86da5d65220b07c --- /dev/null +++ b/shared/package-files/75/754aa574f3e220d8c28f6e8e9f5c4e17d5e1fb17cae447a429cd33485633992b/isposinf_cuda_dispatch.h @@ -0,0 +1,25 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API at::Tensor isposinf(const at::Tensor & self); +TORCH_API at::Tensor & isposinf_out(at::Tensor & out, const at::Tensor & self); +TORCH_API at::Tensor & isposinf_outf(const at::Tensor & self, at::Tensor & out); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/75/754af9bf9ddc4794b8d2bef5402015cb4a9474a3313af89a5804f4a6dadc8d34/_svdp.py b/shared/package-files/75/754af9bf9ddc4794b8d2bef5402015cb4a9474a3313af89a5804f4a6dadc8d34/_svdp.py new file mode 100644 index 0000000000000000000000000000000000000000..fd64c6d0c3069eceb5a347111f1ac77bea8ea942 --- /dev/null +++ b/shared/package-files/75/754af9bf9ddc4794b8d2bef5402015cb4a9474a3313af89a5804f4a6dadc8d34/_svdp.py @@ -0,0 +1,309 @@ +""" +Python wrapper for PROPACK +-------------------------- + +PROPACK is a collection of Fortran routines for iterative computation +of partial SVDs of large matrices or linear operators. + +Based on BSD licensed pypropack project: + http://github.com/jakevdp/pypropack + Author: Jake Vanderplas + +PROPACK source is BSD licensed, and available at + http://soi.stanford.edu/~rmunk/PROPACK/ +""" + +__all__ = ['_svdp'] + +import numpy as np + +from scipy.sparse.linalg import aslinearoperator +from scipy.linalg import LinAlgError + +from ._propack import _spropack # type: ignore[attr-defined] +from ._propack import _dpropack # type: ignore[attr-defined] +from ._propack import _cpropack # type: ignore[attr-defined] +from ._propack import _zpropack # type: ignore[attr-defined] + + +_lansvd_dict = { + 'f': _spropack.slansvd, + 'd': _dpropack.dlansvd, + 'F': _cpropack.clansvd, + 'D': _zpropack.zlansvd, +} + + +_lansvd_irl_dict = { + 'f': _spropack.slansvd_irl, + 'd': _dpropack.dlansvd_irl, + 'F': _cpropack.clansvd_irl, + 'D': _zpropack.zlansvd_irl, +} + +_which_converter = { + 'LM': 'L', + 'SM': 'S', +} + + +class _AProd: + """ + Wrapper class for linear operator + + The call signature of the __call__ method matches the callback of + the PROPACK routines. + """ + def __init__(self, A): + try: + self.A = aslinearoperator(A) + except TypeError: + self.A = aslinearoperator(np.asarray(A)) + + def __call__(self, transa, m, n, x, y, sparm, iparm): + if transa == 'n': + y[:] = self.A.matvec(x) + else: + y[:] = self.A.rmatvec(x) + + @property + def shape(self): + return self.A.shape + + @property + def dtype(self): + try: + return self.A.dtype + except AttributeError: + return self.A.matvec(np.zeros(self.A.shape[1])).dtype + + +def _svdp(A, k, which='LM', irl_mode=True, kmax=None, + compute_u=True, compute_v=True, v0=None, full_output=False, tol=0, + delta=None, eta=None, anorm=0, cgs=False, elr=True, + min_relgap=0.002, shifts=None, maxiter=None, rng=None): + """ + Compute the singular value decomposition of a linear operator using PROPACK + + Parameters + ---------- + A : array_like, sparse matrix, or LinearOperator + Operator for which SVD will be computed. If `A` is a LinearOperator + object, it must define both ``matvec`` and ``rmatvec`` methods. + k : int + Number of singular values/vectors to compute + which : {"LM", "SM"} + Which singular triplets to compute: + - 'LM': compute triplets corresponding to the `k` largest singular + values + - 'SM': compute triplets corresponding to the `k` smallest singular + values + `which='SM'` requires `irl_mode=True`. Computes largest singular + values by default. + irl_mode : bool, optional + If `True`, then compute SVD using IRL (implicitly restarted Lanczos) + mode. Default is `True`. + kmax : int, optional + Maximal number of iterations / maximal dimension of the Krylov + subspace. Default is ``10 * k``. + compute_u : bool, optional + If `True` (default) then compute left singular vectors, `u`. + compute_v : bool, optional + If `True` (default) then compute right singular vectors, `v`. + tol : float, optional + The desired relative accuracy for computed singular values. + If not specified, it will be set based on machine precision. + v0 : array_like, optional + Starting vector for iterations: must be of length ``A.shape[0]``. + If not specified, PROPACK will generate a starting vector. + full_output : bool, optional + If `True`, then return sigma_bound. Default is `False`. + delta : float, optional + Level of orthogonality to maintain between Lanczos vectors. + Default is set based on machine precision. + eta : float, optional + Orthogonality cutoff. During reorthogonalization, vectors with + component larger than `eta` along the Lanczos vector will be purged. + Default is set based on machine precision. + anorm : float, optional + Estimate of ``||A||``. Default is ``0``. + cgs : bool, optional + If `True`, reorthogonalization is done using classical Gram-Schmidt. + If `False` (default), it is done using modified Gram-Schmidt. + elr : bool, optional + If `True` (default), then extended local orthogonality is enforced + when obtaining singular vectors. + min_relgap : float, optional + The smallest relative gap allowed between any shift in IRL mode. + Default is ``0.001``. Accessed only if ``irl_mode=True``. + shifts : int, optional + Number of shifts per restart in IRL mode. Default is determined + to satisfy ``k <= min(kmax-shifts, m, n)``. Must be + >= 0, but choosing 0 might lead to performance degradation. + Accessed only if ``irl_mode=True``. + maxiter : int, optional + Maximum number of restarts in IRL mode. Default is ``1000``. + Accessed only if ``irl_mode=True``. + rng : `numpy.random.Generator`, optional + Pseudorandom number generator state. When `rng` is None, a new + `numpy.random.Generator` is created using entropy from the + operating system. Types other than `numpy.random.Generator` are + passed to `numpy.random.default_rng` to instantiate a ``Generator``. + + Returns + ------- + u : ndarray + The `k` largest (``which="LM"``) or smallest (``which="SM"``) left + singular vectors, ``shape == (A.shape[0], 3)``, returned only if + ``compute_u=True``. + sigma : ndarray + The top `k` singular values, ``shape == (k,)`` + vt : ndarray + The `k` largest (``which="LM"``) or smallest (``which="SM"``) right + singular vectors, ``shape == (3, A.shape[1])``, returned only if + ``compute_v=True``. + sigma_bound : ndarray + the error bounds on the singular values sigma, returned only if + ``full_output=True``. + + """ + if rng is None: + raise ValueError("`rng` must be a normalized numpy.random.Generator instance") + + which = which.upper() + if which not in {'LM', 'SM'}: + raise ValueError("`which` must be either 'LM' or 'SM'") + if not irl_mode and which == 'SM': + raise ValueError("`which`='SM' requires irl_mode=True") + + aprod = _AProd(A) + typ = aprod.dtype.char + + try: + lansvd_irl = _lansvd_irl_dict[typ] + lansvd = _lansvd_dict[typ] + except KeyError: + # work with non-supported types using native system precision + if np.iscomplexobj(np.empty(0, dtype=typ)): + typ = np.dtype(complex).char + else: + typ = np.dtype(float).char + lansvd_irl = _lansvd_irl_dict[typ] + lansvd = _lansvd_dict[typ] + + m, n = aprod.shape + if (k < 1) or (k > min(m, n)): + raise ValueError("k must be positive and not greater than m or n") + + if kmax is None: + kmax = 10*k + if maxiter is None: + maxiter = 1000 + + # guard against unnecessarily large kmax + kmax = min(m + 1, n + 1, kmax) + if kmax < k: + raise ValueError( + "kmax must be greater than or equal to k, " + f"but kmax ({kmax}) < k ({k})") + + # convert python args to fortran args + jobu = 'y' if compute_u else 'n' + jobv = 'y' if compute_v else 'n' + + # these will be the output arrays + u = np.zeros((m, kmax + 1), order='F', dtype=typ) + v = np.zeros((n, kmax), order='F', dtype=typ) + + # Specify the starting vector. if v0 is all zero, PROPACK will generate + # a random starting vector: the random seed cannot be controlled in that + # case, so we'll instead use numpy to generate a random vector + if v0 is None: + u[:, 0] = rng.uniform(size=m) + if np.iscomplexobj(np.empty(0, dtype=typ)): # complex type + u[:, 0] += 1j * rng.uniform(size=m) + else: + try: + u[:, 0] = v0 + except ValueError: + raise ValueError(f"v0 must be of length {m}") + + # process options for the fit + if delta is None: + delta = np.sqrt(np.finfo(typ).eps) + if eta is None: + eta = np.finfo(typ).eps ** 0.75 + + if irl_mode: + doption = np.array((delta, eta, anorm, min_relgap), dtype=typ.lower()) + + # validate or find default shifts + if shifts is None: + shifts = kmax - k + if k > min(kmax - shifts, m, n): + raise ValueError('shifts must satisfy ' + 'k <= min(kmax-shifts, m, n)!') + elif shifts < 0: + raise ValueError('shifts must be >= 0!') + + else: + doption = np.array((delta, eta, anorm), dtype=typ.lower()) + + ioption = np.array((int(bool(cgs)), int(bool(elr))), dtype='i') + + # If computing `u` or `v` (left and right singular vectors, + # respectively), `blocksize` controls how large a fraction of the + # work is done via fast BLAS level 3 operations. A larger blocksize + # may lead to faster computation at the expense of greater memory + # consumption. `blocksize` must be ``>= 1``. Choosing blocksize + # of 16, but docs don't specify; it's almost surely a + # power of 2. + blocksize = 16 + + # Determine lwork & liwork: + # the required lengths are specified in the PROPACK documentation + if compute_u or compute_v: + lwork = m + n + 9*kmax + 5*kmax*kmax + 4 + max( + 3*kmax*kmax + 4*kmax + 4, + blocksize*max(m, n)) + liwork = 8*kmax + else: + lwork = m + n + 9*kmax + 2*kmax*kmax + 4 + max(m + n, 4*kmax + 4) + liwork = 2*kmax + 1 + work = np.empty(lwork, dtype=typ.lower()) + iwork = np.empty(liwork, dtype=np.int32) + + # dummy arguments: these are passed to aprod, and not used in this wrapper + dparm = np.empty(1, dtype=typ.lower()) + iparm = np.empty(1, dtype=np.int32) + + if typ.isupper(): + # PROPACK documentation is unclear on the required length of zwork. + # Use the same length Julia's wrapper uses + # see https://github.com/JuliaSmoothOptimizers/PROPACK.jl/ + zwork = np.empty(m + n + 32*m, dtype=typ) + works = work, zwork, iwork + else: + works = work, iwork + + if irl_mode: + u, sigma, bnd, v, info = lansvd_irl(_which_converter[which], jobu, + jobv, m, n, shifts, k, maxiter, + aprod, u, v, tol, *works, doption, + ioption, dparm, iparm) + else: + u, sigma, bnd, v, info = lansvd(jobu, jobv, m, n, k, aprod, u, v, tol, + *works, doption, ioption, dparm, iparm) + + if info > 0: + raise LinAlgError( + f"An invariant subspace of dimension {info} was found.") + elif info < 0: + raise LinAlgError( + f"k={k} singular triplets did not converge within " + f"kmax={kmax} iterations") + + # info == 0: The K largest (or smallest) singular triplets were computed + # successfully! + + return u[:, :k], sigma, v[:, :k].conj().T, bnd diff --git a/shared/package-files/75/754b92bbc50434879a89fe3fb69bcd4581a38f4fa4fefe68e24a556d64983f88/non_strict_utils.py b/shared/package-files/75/754b92bbc50434879a89fe3fb69bcd4581a38f4fa4fefe68e24a556d64983f88/non_strict_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..1cf9bcefcfc6e3071c97f0dff3c9fad5f2cbdfa8 --- /dev/null +++ b/shared/package-files/75/754b92bbc50434879a89fe3fb69bcd4581a38f4fa4fefe68e24a556d64983f88/non_strict_utils.py @@ -0,0 +1,258 @@ +import inspect +from collections import defaultdict +from typing import Any, Callable, Dict, List, Tuple, Union + +import torch +from torch._dynamo.source import ( + AttrSource, + GetItemSource, + LocalSource, + TensorProperty, + TensorPropertySource, +) +from torch._dynamo.variables.builder import TrackedFake +from torch._export.passes.add_runtime_assertions_for_constraints_pass import InputDim +from torch._guards import Source +from torch._subclasses.fake_tensor import FakeTensorMode +from torch.export import Constraint +from torch.export.graph_signature import CustomObjArgument +from torch.fx.experimental.symbolic_shapes import ( + ConstraintViolationError, + DimDynamic, + EqualityConstraint, + ShapeEnv, + StatelessSymbolicContext, +) +from torch.utils._pytree import ( + GetAttrKey, + KeyPath, + MappingKey, + SequenceKey, + tree_map_with_path, +) + + +def key_path_to_source(kp: KeyPath) -> Source: + """ + Given a key path, return the source for the key path. + """ + source: Source = LocalSource("args") + for k in kp: + if isinstance(k, SequenceKey): + source = GetItemSource(source, k.idx) + elif isinstance(k, MappingKey): + source = GetItemSource(source, k.key) + elif isinstance(k, GetAttrKey): + source = AttrSource(source, k.name) + else: + raise ValueError(f"Unknown KeyEntry {k}") + + return source + + +def _is_constant_argument(t): + return t is None or isinstance(t, (int, float, bool, str)) + + +def fakify( + mode: FakeTensorMode, + kp: KeyPath, + t: Any, + t_constraints: Dict[int, Dict[int, Constraint]], + sources: Dict[Tuple[int, int], List[Source]], +): + source = key_path_to_source(kp) + if _is_constant_argument(t) or isinstance(t, torch.ScriptObject): + return t + if not isinstance(t, torch.Tensor): + raise ValueError(f"Unsupported input type {type(t)}") + n_dims = len(t.shape) + symbolic_context = StatelessSymbolicContext( + dynamic_sizes=[DimDynamic.STATIC] * n_dims, + constraint_sizes=[None] * n_dims, + ) + t_id = id(t) + if t_id in t_constraints: + for i, constraint in t_constraints[t_id].items(): + symbolic_context.constraint_sizes[i] = constraint.constraint_range + symbolic_context.dynamic_sizes[i] = DimDynamic.DYNAMIC + src = TensorPropertySource(base=source, prop=TensorProperty.SIZE, idx=i) + sources[(t_id, i)].append(src) + mode.shape_env.source_name_to_debug_name[src.name()] = constraint.debug_name + fake = mode.from_tensor(t, source=source, symbolic_context=symbolic_context) + mode.shape_env.tracked_fakes.append(TrackedFake(fake, source, symbolic_context)) + return fake + + +def make_fake_params_buffers( + fake_mode: FakeTensorMode, + params_buffers: Dict[str, torch.Tensor], +) -> Dict[str, Union[torch.Tensor, torch.nn.Parameter]]: + faked_params_buffers = {} + for key, value in params_buffers.items(): + faked_params_buffers[key] = fake_mode.from_tensor(value, static_shapes=True) + return faked_params_buffers + + +def make_fake_inputs(nn_module, args, kwargs, constraints): + """ + Given an nn module, example inputs, and constraints, return a new fake mode, + fake inputs created in that mode whose dynamic shape dimensions are constrained + by the given ranges, and sources for pairs of dynamic shape dimensions that are + constrained to be equal. + """ + # TODO(avik): refactor Dynamo to avoid duplication of the following code + # between non-strict and strict. + # Specifically, here (non-strict) we do the following pre-tracing steps: + # - Fakify inputs. + # - Process input shape equalities. + # In strict, these steps are spread across multiple files: + # - output_graph.py fakifies inputs. + # - [post-tracing] guards.py processes input shape equalities. + + t_constraints: Dict[int, Dict[int, Constraint]] = defaultdict(dict) + for constraint in constraints: + t_constraints[constraint.t_id][constraint.dim] = constraint + if constraint.shared is not None: + t_constraints[constraint.shared.t_id][constraint.shared.dim] = constraint + + code = nn_module.forward.__code__ + co_fields = { + "co_name": code.co_name, + "co_filename": code.co_filename, + "co_firstlineno": code.co_firstlineno, + } + + fake_mode = FakeTensorMode( + shape_env=ShapeEnv(tracked_fakes=[], co_fields=co_fields), + allow_non_fake_inputs=True, + ) + if fake_mode.shape_env is None or fake_mode.shape_env.tracked_fakes is None: + raise ValueError( + "Detected fake_mode does not have a shape_env with tracked fakes. " + "If you constructed the module under a FakeTensorMode, " + "please initialize it like: FakeTensorMode(shape_env=ShapeEnv(tracked_fakes=[]))" + ) + + with fake_mode: + original_signature = inspect.signature(nn_module.forward) + sources: Dict[Tuple[int, int], List[Source]] = defaultdict(list) + fake_args, fake_kwargs = tree_map_with_path( + lambda kp, val: fakify(fake_mode, kp, val, t_constraints, sources), + (args, kwargs), + ) + + from sympy import Symbol + + source_pairs: List[Tuple[Source, Source]] = [] + derived_equalities: List[Tuple[Source, Union[Source, Symbol], Callable]] = [] + phantom_symbols: Dict[str, Symbol] = {} + for constraint in constraints: + torch.export.dynamic_shapes._process_equalities( + constraint, + lambda t_id, dim: sources[(t_id, dim)], + fake_mode.shape_env, + source_pairs, + derived_equalities, + phantom_symbols, + ) + + equalities_inputs = EqualityConstraint( + source_pairs=source_pairs, + derived_equalities=derived_equalities, + phantom_symbols=list(phantom_symbols.values()), + warn_only=False, + ) + return fake_mode, fake_args, fake_kwargs, equalities_inputs, original_signature + + +def make_constraints( + fake_mode, + equalities_inputs, + original_signature, + gm, +): + """ + Given a fake mode, sources pairs corresponding to equal dynamic shape dimensions, + and a graph module, produce guards on the fake mode's shape env (raising constraint + violations if any), solve (to suggest simplifications or fixes), and return the + resulting range constraints and equality constraints. + """ + # TODO(avik): refactor Dynamo to avoid duplication of the following code + # between non-strict and strict. + # Specifically, here (non-strict) we do the following post-tracing steps: + # - Produce guards. + # - Solve constraints. + # - Install shape metadata in IR. + # In strict, these steps are spread across multiple files: + # - guards.py produces guards. + # - eval_frame.py solves constraints + # - _trace.py installs shape metadata in IR. + + shape_env = fake_mode.shape_env + placeholders = [tf.fake for tf in shape_env.tracked_fakes] + sources = [tf.source for tf in shape_env.tracked_fakes] + input_contexts = [tf.symbolic_context for tf in shape_env.tracked_fakes] + constraint_violation_error = None + try: + shape_env.produce_guards( + placeholders, + sources, + input_contexts=input_contexts, + equalities_inputs=equalities_inputs, + ignore_static=False, + ) + except ConstraintViolationError as e: + constraint_violation_error = e + + shape_env.frozen = True + dim_constraints = shape_env.dim_constraints + if dim_constraints is None: + # Expected when shape_env.produce_guards throws an early constraint violation error. + # There is nothing to solve for in this case. + # TODO(avik): Maybe record the constraint violation error instead and replay later? + assert constraint_violation_error + raise constraint_violation_error + dim_constraints.solve() + dim_constraints.remove_redundant_dynamic_results() + forced_specializations = dim_constraints.forced_specializations() + msg = dim_constraints.prettify_results( + original_signature, constraint_violation_error, forced_specializations + ) + if constraint_violation_error: + constraint_violation_error.args = (constraint_violation_error.args[0] + msg,) + elif forced_specializations: + constraint_violation_error = ConstraintViolationError(msg) + if constraint_violation_error: + raise constraint_violation_error + + range_constraints = {} + input_dims = defaultdict(list) + free_symbols = set() + for node in gm.graph.nodes: + if node.op != "placeholder": + continue + if _is_constant_argument(node.meta["val"]) or isinstance( + node.meta["val"], CustomObjArgument + ): + continue + for i, d in enumerate(node.meta["val"].shape): + if isinstance(d, torch.SymInt): + # Look up the range constraint for the symbol corresponding to this shape dimension + # and store it indexed by the symbolic expression corresponding to it. + # NOTE(avik): Use node._expr instead of node.expr for the lookup here because + # we want the symbol, not its replacement, which could be an expression. Maybe + # there's a better way to do this, e.g., by (re)computing value ranges for expressions? + range_constraints[d.node.expr] = shape_env.var_to_range[d.node._expr] + input_dims[d.node.expr].append(InputDim(input_name=node.name, dim=i)) + free_symbols.update(d.node.expr.free_symbols) + + for symbol in free_symbols: + if symbol not in range_constraints: + # Placeholders can have symbolic shapes that are derived expressions. + # The above code will record direct range constraints for them + # so that we can do runtime assertions. In addition, for serde checks + # we want to record range constraints for their root symbols. + range_constraints[symbol] = shape_env.var_to_range[symbol] + + return range_constraints diff --git a/shared/package-files/75/754cd6751b89340c671985458c3a9407c0cc62d8b76f2d56ce22847c10ce941e/__init__.py b/shared/package-files/75/754cd6751b89340c671985458c3a9407c0cc62d8b76f2d56ce22847c10ce941e/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..25728ead5f7ea277e6e94c359d5a5603b99eeb38 --- /dev/null +++ b/shared/package-files/75/754cd6751b89340c671985458c3a9407c0cc62d8b76f2d56ce22847c10ce941e/__init__.py @@ -0,0 +1,4 @@ +# +from .rcont import rvs_rcont1, rvs_rcont2 + +__all__ = ["rvs_rcont1", "rvs_rcont2"] diff --git a/shared/package-files/75/754cf01b8affdf215646d0d5272250956771e8fe47bd3bf3f4ef398ffacbfd4e/_make_dual_compositeexplicitautograd_dispatch.h b/shared/package-files/75/754cf01b8affdf215646d0d5272250956771e8fe47bd3bf3f4ef398ffacbfd4e/_make_dual_compositeexplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..188e5b4769cc53829bf3e13f85ee2ee51dd1fb55 --- /dev/null +++ b/shared/package-files/75/754cf01b8affdf215646d0d5272250956771e8fe47bd3bf3f4ef398ffacbfd4e/_make_dual_compositeexplicitautograd_dispatch.h @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API at::Tensor _make_dual(const at::Tensor & primal, const at::Tensor & tangent, int64_t level); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/75/754ef6bf3a564228ab0b56dde391521dcc1a6c83cfb95d4b761141e71d2e8e87/iso8859-1.enc b/shared/package-files/75/754ef6bf3a564228ab0b56dde391521dcc1a6c83cfb95d4b761141e71d2e8e87/iso8859-1.enc new file mode 100644 index 0000000000000000000000000000000000000000..045d8fa28b448ef90dd4b5ad2642c1e4942ca324 --- /dev/null +++ b/shared/package-files/75/754ef6bf3a564228ab0b56dde391521dcc1a6c83cfb95d4b761141e71d2e8e87/iso8859-1.enc @@ -0,0 +1,20 @@ +# Encoding file: iso8859-1, single-byte +S +003F 0 1 +00 +0000000100020003000400050006000700080009000A000B000C000D000E000F +0010001100120013001400150016001700180019001A001B001C001D001E001F +0020002100220023002400250026002700280029002A002B002C002D002E002F +0030003100320033003400350036003700380039003A003B003C003D003E003F +0040004100420043004400450046004700480049004A004B004C004D004E004F +0050005100520053005400550056005700580059005A005B005C005D005E005F +0060006100620063006400650066006700680069006A006B006C006D006E006F +0070007100720073007400750076007700780079007A007B007C007D007E007F +0080008100820083008400850086008700880089008A008B008C008D008E008F +0090009100920093009400950096009700980099009A009B009C009D009E009F +00A000A100A200A300A400A500A600A700A800A900AA00AB00AC00AD00AE00AF +00B000B100B200B300B400B500B600B700B800B900BA00BB00BC00BD00BE00BF +00C000C100C200C300C400C500C600C700C800C900CA00CB00CC00CD00CE00CF +00D000D100D200D300D400D500D600D700D800D900DA00DB00DC00DD00DE00DF +00E000E100E200E300E400E500E600E700E800E900EA00EB00EC00ED00EE00EF +00F000F100F200F300F400F500F600F700F800F900FA00FB00FC00FD00FE00FF diff --git a/shared/package-files/75/755171caa60845e1cfcaf5abcb1b2cb0555a4f4206238560f504840c9b48bd92/embedding_sparse_backward.h b/shared/package-files/75/755171caa60845e1cfcaf5abcb1b2cb0555a4f4206238560f504840c9b48bd92/embedding_sparse_backward.h new file mode 100644 index 0000000000000000000000000000000000000000..293a3ca8dfa79ec35921db7d257ab62fc0fe3499 --- /dev/null +++ b/shared/package-files/75/755171caa60845e1cfcaf5abcb1b2cb0555a4f4206238560f504840c9b48bd92/embedding_sparse_backward.h @@ -0,0 +1,30 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::embedding_sparse_backward(Tensor grad, Tensor indices, int num_weights, int padding_idx, bool scale_grad_by_freq) -> Tensor +inline at::Tensor embedding_sparse_backward(const at::Tensor & grad, const at::Tensor & indices, int64_t num_weights, int64_t padding_idx, bool scale_grad_by_freq) { + return at::_ops::embedding_sparse_backward::call(grad, indices, num_weights, padding_idx, scale_grad_by_freq); +} + +} diff --git a/shared/package-files/75/7557a8be036938d7ca3b18b7dae9e5d9a8c95de3c00b1fe9659dee45cd59e21e/sdist.py b/shared/package-files/75/7557a8be036938d7ca3b18b7dae9e5d9a8c95de3c00b1fe9659dee45cd59e21e/sdist.py new file mode 100644 index 0000000000000000000000000000000000000000..c04823c1590f7bdca9df840cfc17c2500b66d64e --- /dev/null +++ b/shared/package-files/75/7557a8be036938d7ca3b18b7dae9e5d9a8c95de3c00b1fe9659dee45cd59e21e/sdist.py @@ -0,0 +1,215 @@ +from distutils import log +import distutils.command.sdist as orig +import os +import sys +import io +import contextlib +from itertools import chain + +from .._importlib import metadata +from .build import _ORIGINAL_SUBCOMMANDS + +_default_revctrl = list + + +def walk_revctrl(dirname=''): + """Find all files under revision control""" + for ep in metadata.entry_points(group='setuptools.file_finders'): + for item in ep.load()(dirname): + yield item + + +class sdist(orig.sdist): + """Smart sdist that finds anything supported by revision control""" + + user_options = [ + ('formats=', None, "formats for source distribution (comma-separated list)"), + ( + 'keep-temp', + 'k', + "keep the distribution tree around after creating " + "archive file(s)", + ), + ( + 'dist-dir=', + 'd', + "directory to put the source distribution archive(s) in " "[default: dist]", + ), + ( + 'owner=', + 'u', + "Owner name used when creating a tar file [default: current user]", + ), + ( + 'group=', + 'g', + "Group name used when creating a tar file [default: current group]", + ), + ] + + negative_opt = {} + + README_EXTENSIONS = ['', '.rst', '.txt', '.md'] + READMES = tuple('README{0}'.format(ext) for ext in README_EXTENSIONS) + + def run(self): + self.run_command('egg_info') + ei_cmd = self.get_finalized_command('egg_info') + self.filelist = ei_cmd.filelist + self.filelist.append(os.path.join(ei_cmd.egg_info, 'SOURCES.txt')) + self.check_readme() + + # Run sub commands + for cmd_name in self.get_sub_commands(): + self.run_command(cmd_name) + + self.make_distribution() + + dist_files = getattr(self.distribution, 'dist_files', []) + for file in self.archive_files: + data = ('sdist', '', file) + if data not in dist_files: + dist_files.append(data) + + def initialize_options(self): + orig.sdist.initialize_options(self) + + self._default_to_gztar() + + def _default_to_gztar(self): + # only needed on Python prior to 3.6. + if sys.version_info >= (3, 6, 0, 'beta', 1): + return + self.formats = ['gztar'] + + def make_distribution(self): + """ + Workaround for #516 + """ + with self._remove_os_link(): + orig.sdist.make_distribution(self) + + @staticmethod + @contextlib.contextmanager + def _remove_os_link(): + """ + In a context, remove and restore os.link if it exists + """ + + class NoValue: + pass + + orig_val = getattr(os, 'link', NoValue) + try: + del os.link + except Exception: + pass + try: + yield + finally: + if orig_val is not NoValue: + setattr(os, 'link', orig_val) + + def add_defaults(self): + super().add_defaults() + self._add_defaults_build_sub_commands() + + def _add_defaults_optional(self): + super()._add_defaults_optional() + if os.path.isfile('pyproject.toml'): + self.filelist.append('pyproject.toml') + + def _add_defaults_python(self): + """getting python files""" + if self.distribution.has_pure_modules(): + build_py = self.get_finalized_command('build_py') + self.filelist.extend(build_py.get_source_files()) + self._add_data_files(self._safe_data_files(build_py)) + + def _add_defaults_build_sub_commands(self): + build = self.get_finalized_command("build") + missing_cmds = set(build.get_sub_commands()) - _ORIGINAL_SUBCOMMANDS + # ^-- the original built-in sub-commands are already handled by default. + cmds = (self.get_finalized_command(c) for c in missing_cmds) + files = (c.get_source_files() for c in cmds if hasattr(c, "get_source_files")) + self.filelist.extend(chain.from_iterable(files)) + + def _safe_data_files(self, build_py): + """ + Since the ``sdist`` class is also used to compute the MANIFEST + (via :obj:`setuptools.command.egg_info.manifest_maker`), + there might be recursion problems when trying to obtain the list of + data_files and ``include_package_data=True`` (which in turn depends on + the files included in the MANIFEST). + + To avoid that, ``manifest_maker`` should be able to overwrite this + method and avoid recursive attempts to build/analyze the MANIFEST. + """ + return build_py.data_files + + def _add_data_files(self, data_files): + """ + Add data files as found in build_py.data_files. + """ + self.filelist.extend( + os.path.join(src_dir, name) + for _, src_dir, _, filenames in data_files + for name in filenames + ) + + def _add_defaults_data_files(self): + try: + super()._add_defaults_data_files() + except TypeError: + log.warn("data_files contains unexpected objects") + + def check_readme(self): + for f in self.READMES: + if os.path.exists(f): + return + else: + self.warn( + "standard file not found: should have one of " + ', '.join(self.READMES) + ) + + def make_release_tree(self, base_dir, files): + orig.sdist.make_release_tree(self, base_dir, files) + + # Save any egg_info command line options used to create this sdist + dest = os.path.join(base_dir, 'setup.cfg') + if hasattr(os, 'link') and os.path.exists(dest): + # unlink and re-copy, since it might be hard-linked, and + # we don't want to change the source version + os.unlink(dest) + self.copy_file('setup.cfg', dest) + + self.get_finalized_command('egg_info').save_version_info(dest) + + def _manifest_is_not_generated(self): + # check for special comment used in 2.7.1 and higher + if not os.path.isfile(self.manifest): + return False + + with io.open(self.manifest, 'rb') as fp: + first_line = fp.readline() + return first_line != '# file GENERATED by distutils, do NOT edit\n'.encode() + + def read_manifest(self): + """Read the manifest file (named by 'self.manifest') and use it to + fill in 'self.filelist', the list of files to include in the source + distribution. + """ + log.info("reading manifest file '%s'", self.manifest) + manifest = open(self.manifest, 'rb') + for line in manifest: + # The manifest must contain UTF-8. See #303. + try: + line = line.decode('UTF-8') + except UnicodeDecodeError: + log.warn("%r not UTF-8 decodable -- skipping" % line) + continue + # ignore comments and blank lines + line = line.strip() + if line.startswith('#') or not line: + continue + self.filelist.append(line) + manifest.close() diff --git a/shared/package-files/75/7557d42d8f79f67170a65e4d0b1c82a621f235c48d691ec760e83b414db56b9b/__init__.py b/shared/package-files/75/7557d42d8f79f67170a65e4d0b1c82a621f235c48d691ec760e83b414db56b9b/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2eb2f71afd54a67b54d7012347e5d1a983fac7be --- /dev/null +++ b/shared/package-files/75/7557d42d8f79f67170a65e4d0b1c82a621f235c48d691ec760e83b414db56b9b/__init__.py @@ -0,0 +1,6 @@ +import warnings +warnings.warn( + "scipy.misc is deprecated and will be removed in 2.0.0", + DeprecationWarning, + stacklevel=2 +) diff --git a/shared/package-files/75/755b5e6cce810a5ad89f7072c84f637fb73962277150883f6ff7323ce5fbaeb6/movedim_native.h b/shared/package-files/75/755b5e6cce810a5ad89f7072c84f637fb73962277150883f6ff7323ce5fbaeb6/movedim_native.h new file mode 100644 index 0000000000000000000000000000000000000000..c45aa6d3e1ab081f0e62c0bc7bce566e330abad2 --- /dev/null +++ b/shared/package-files/75/755b5e6cce810a5ad89f7072c84f637fb73962277150883f6ff7323ce5fbaeb6/movedim_native.h @@ -0,0 +1,22 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor movedim(const at::Tensor & self, at::IntArrayRef source, at::IntArrayRef destination); +TORCH_API at::Tensor movedim(const at::Tensor & self, int64_t source, int64_t destination); +} // namespace native +} // namespace at diff --git a/shared/package-files/75/755c5d8dc5b41cd64154263849d2f00936aef269ae0e79f047980900ba88e091/normal_cuda_dispatch.h b/shared/package-files/75/755c5d8dc5b41cd64154263849d2f00936aef269ae0e79f047980900ba88e091/normal_cuda_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..3f7d5a090449fd008bc2a70f3d3f26ad18ae683c --- /dev/null +++ b/shared/package-files/75/755c5d8dc5b41cd64154263849d2f00936aef269ae0e79f047980900ba88e091/normal_cuda_dispatch.h @@ -0,0 +1,32 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API at::Tensor & normal_(at::Tensor & self, double mean=0, double std=1, c10::optional generator=c10::nullopt); +TORCH_API at::Tensor normal(const at::Tensor & mean, double std=1, c10::optional generator=c10::nullopt); +TORCH_API at::Tensor & normal_out(at::Tensor & out, const at::Tensor & mean, double std=1, c10::optional generator=c10::nullopt); +TORCH_API at::Tensor & normal_outf(const at::Tensor & mean, double std, c10::optional generator, at::Tensor & out); +TORCH_API at::Tensor normal(double mean, const at::Tensor & std, c10::optional generator=c10::nullopt); +TORCH_API at::Tensor & normal_out(at::Tensor & out, double mean, const at::Tensor & std, c10::optional generator=c10::nullopt); +TORCH_API at::Tensor & normal_outf(double mean, const at::Tensor & std, c10::optional generator, at::Tensor & out); +TORCH_API at::Tensor normal(const at::Tensor & mean, const at::Tensor & std, c10::optional generator=c10::nullopt); +TORCH_API at::Tensor & normal_out(at::Tensor & out, const at::Tensor & mean, const at::Tensor & std, c10::optional generator=c10::nullopt); +TORCH_API at::Tensor & normal_outf(const at::Tensor & mean, const at::Tensor & std, c10::optional generator, at::Tensor & out); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/75/755c76e5f5674012f7d1471386185b5b7c1ca47e51bb910cfe15b8e3c41e14f8/abc.pyi b/shared/package-files/75/755c76e5f5674012f7d1471386185b5b7c1ca47e51bb910cfe15b8e3c41e14f8/abc.pyi new file mode 100644 index 0000000000000000000000000000000000000000..c9d69978afd2dacedb446f606573fa2a434d88ba --- /dev/null +++ b/shared/package-files/75/755c76e5f5674012f7d1471386185b5b7c1ca47e51bb910cfe15b8e3c41e14f8/abc.pyi @@ -0,0 +1,27 @@ +from . import ( + AsyncGenerator as AsyncGenerator, + AsyncIterable as AsyncIterable, + AsyncIterator as AsyncIterator, + Awaitable as Awaitable, + ByteString as ByteString, + Callable as Callable, + Collection as Collection, + Container as Container, + Coroutine as Coroutine, + Generator as Generator, + Hashable as Hashable, + ItemsView as ItemsView, + Iterable as Iterable, + Iterator as Iterator, + KeysView as KeysView, + Mapping as Mapping, + MappingView as MappingView, + MutableMapping as MutableMapping, + MutableSequence as MutableSequence, + MutableSet as MutableSet, + Reversible as Reversible, + Sequence as Sequence, + Set as Set, + Sized as Sized, + ValuesView as ValuesView, +) diff --git a/shared/package-files/75/755cd183b44471946cad2f21e834ac3238a3e35f08dbcd4c85ad6d621c0ee6ea/__init__.py b/shared/package-files/75/755cd183b44471946cad2f21e834ac3238a3e35f08dbcd4c85ad6d621c0ee6ea/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4a30c316c4a524b3a41a080dd7e82fe597e6f130 --- /dev/null +++ b/shared/package-files/75/755cd183b44471946cad2f21e834ac3238a3e35f08dbcd4c85ad6d621c0ee6ea/__init__.py @@ -0,0 +1,22 @@ +from numba import runtests +from numba.core import config + +if config.ENABLE_CUDASIM: + from .simulator_init import * +else: + from .device_init import * + from .device_init import _auto_device + +from numba.cuda.compiler import (compile, compile_for_current_device, + compile_ptx, compile_ptx_for_current_device) + +# Are we the numba.cuda built in to upstream Numba, or the out-of-tree +# NVIDIA-maintained target? +implementation = "Built-in" + + +def test(*args, **kwargs): + if not is_available(): + raise cuda_error() + + return runtests.main("numba.cuda.tests", *args, **kwargs) diff --git a/shared/package-files/75/755e6d01f8dafe27dd88db89e882f85f68c57c3a36e16d55bf45f640f72a35e0/_nested_view_from_buffer_copy_ops.h b/shared/package-files/75/755e6d01f8dafe27dd88db89e882f85f68c57c3a36e16d55bf45f640f72a35e0/_nested_view_from_buffer_copy_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..fc4fd5112070a6db675d1ae354e482ea9e424deb --- /dev/null +++ b/shared/package-files/75/755e6d01f8dafe27dd88db89e882f85f68c57c3a36e16d55bf45f640f72a35e0/_nested_view_from_buffer_copy_ops.h @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API _nested_view_from_buffer_copy { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &, const at::Tensor &, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_nested_view_from_buffer_copy") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_nested_view_from_buffer_copy(Tensor self, Tensor nested_size, Tensor nested_strides, Tensor offsets) -> Tensor") + static at::Tensor call(const at::Tensor & self, const at::Tensor & nested_size, const at::Tensor & nested_strides, const at::Tensor & offsets); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & nested_size, const at::Tensor & nested_strides, const at::Tensor & offsets); +}; + +struct TORCH_API _nested_view_from_buffer_copy_out { + using schema = at::Tensor & (const at::Tensor &, const at::Tensor &, const at::Tensor &, const at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_nested_view_from_buffer_copy") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_nested_view_from_buffer_copy.out(Tensor self, Tensor nested_size, Tensor nested_strides, Tensor offsets, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, const at::Tensor & nested_size, const at::Tensor & nested_strides, const at::Tensor & offsets, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & nested_size, const at::Tensor & nested_strides, const at::Tensor & offsets, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/75/756102b7eb1b7ef69288af3e620a7902aca3a0de62dba5443ab5ea834d6b9378/philox-testset-2.csv b/shared/package-files/75/756102b7eb1b7ef69288af3e620a7902aca3a0de62dba5443ab5ea834d6b9378/philox-testset-2.csv new file mode 100644 index 0000000000000000000000000000000000000000..69d24c38c28959361283624e02f8891fa69b6c5f --- /dev/null +++ b/shared/package-files/75/756102b7eb1b7ef69288af3e620a7902aca3a0de62dba5443ab5ea834d6b9378/philox-testset-2.csv @@ -0,0 +1,1001 @@ +seed, 0x0 +0, 0x399e5b222b82fa9 +1, 0x41fd08c1f00f3bc5 +2, 0x78b8824162ee4d04 +3, 0x176747919e02739d +4, 0xfaa88f002a8d3596 +5, 0x418eb6f592e6c227 +6, 0xef83020b8344dd45 +7, 0x30a74a1a6eaa064b +8, 0x93d43bf97a490c3 +9, 0xe4ba28b442194cc +10, 0xc829083a168a8656 +11, 0x73f45d50f8e22849 +12, 0xf912db57352824cc +13, 0xf524216927b12ada +14, 0x22b7697473b1dfda +15, 0x311e2a936414b39f +16, 0xb905abfdcc425be6 +17, 0x4b14630d031eac9c +18, 0x1cf0c4ae01222bc8 +19, 0xa6c33efc6e82ef3 +20, 0x43b3576937ba0948 +21, 0x1e483d17cdde108a +22, 0x6722784cac11ac88 +23, 0xee87569a48fc45d7 +24, 0xb821dcbe74d18661 +25, 0xa5d1876ef3da1a81 +26, 0xe4121c2af72a483 +27, 0x2d747e355a52cf43 +28, 0x609059957bd03725 +29, 0xc3327244b49e16c5 +30, 0xb5ae6cb000dde769 +31, 0x774315003209017 +32, 0xa2013397ba8db605 +33, 0x73b228945dbcd957 +34, 0x801af7190375d3c0 +35, 0xae6dca29f24c9c67 +36, 0xd1cc0bcb1ca26249 +37, 0x1defa62a5bd853be +38, 0x67c2f5557fa89462 +39, 0xf1729b58122fab02 +40, 0xb67eb71949ec6c42 +41, 0x5456366ec1f8f7d7 +42, 0x44492b32eb7966f5 +43, 0xa801804159f175f1 +44, 0x5a416f23cac70d84 +45, 0x186f55293302303d +46, 0x7339d5d7b6a43639 +47, 0xfc6df38d6a566121 +48, 0xed2fe018f150b39e +49, 0x508e0b04a781fa1b +50, 0x8bee9d50f32eaf50 +51, 0x9870015d37e63cc +52, 0x93c6b12309c14f2d +53, 0xb571cf798abe93ff +54, 0x85c35a297a88ae6e +55, 0x9b1b79afe497a2ae +56, 0x1ca02e5b95d96b8d +57, 0x5bb695a666c0a94a +58, 0x4e3caf9bbab0b208 +59, 0x44a44be1a89f2dc1 +60, 0x4ff37c33445758d1 +61, 0xd0e02875322f35da +62, 0xfd449a91fb92646b +63, 0xbe0b49096b95db4d +64, 0xffa3647cad13ef5d +65, 0x75c127a61acd10c8 +66, 0xd65f697756f5f98e +67, 0x3ced84be93d94434 +68, 0x4da3095c2fc46d68 +69, 0x67564e2a771ee9ac +70, 0x36944775180644a9 +71, 0xf458db1c177cdb60 +72, 0x5b58406dcd034c8 +73, 0x793301a3fdab2a73 +74, 0x1c2a1a16d6db6128 +75, 0xc2dacd4ddddbe56c +76, 0x2e7d15be2301a111 +77, 0xd4f4a6341b3bcd18 +78, 0x3622996bbe6a9e3b +79, 0xaf29aa9a7d6d47da +80, 0x6d7dbb74a4cd68ae +81, 0xc260a17e0f39f841 +82, 0xdee0170f2af66f0d +83, 0xf84ae780d7b5a06e +84, 0x8326247b73f43c3a +85, 0xd44eef44b4f98b84 +86, 0x3d10aee62ec895e3 +87, 0x4f23fef01bf703b3 +88, 0xf8e50aa57d888df6 +89, 0x7da67411e3bef261 +90, 0x1d00f2769b2f96d7 +91, 0x7ef9a15b7444b84e +92, 0xcfa16436cc2b7e21 +93, 0x29ab8cfac00460ff +94, 0x23613de8608b0e70 +95, 0xb1aa0980625798a8 +96, 0xb9256fd29db7df99 +97, 0xdacf311bf3e7fa18 +98, 0xa013c8f9fada20d8 +99, 0xaf5fd4fe8230fe3e +100, 0xd3d59ca55102bc5c +101, 0x9d08e2aa5242767f +102, 0x40278fe131e83b53 +103, 0x56397d03c7c14c98 +104, 0xe874b77b119359b3 +105, 0x926a1ba4304ab19f +106, 0x1e115d5aa695a91d +107, 0xc6a459df441f2fe3 +108, 0x2ca842bc1b0b3c6a +109, 0x24c804cf8e5eed16 +110, 0x7ca00fc4a4c3ebd3 +111, 0x546af7cecc4a4ba6 +112, 0x8faae1fa18fd6e3 +113, 0x40420b0089641a6a +114, 0x88175a35d9abcb83 +115, 0xf7d746d1b8b1357c +116, 0x7dae771a651be970 +117, 0x2f6485247ee4df84 +118, 0x6883702fab2d8ec5 +119, 0xeb7eea829a67f9a6 +120, 0x60d5880b485562ed +121, 0x7d4ca3d7e41a4e7e +122, 0xbb7fef961ab8de18 +123, 0x3b92452fb810c164 +124, 0x5f4b4755348b338 +125, 0xca45a715a7539806 +126, 0xc33efd9da5399dd +127, 0x593d665a51d4aedd +128, 0x75d6b8636563036b +129, 0x7b57caa55e262082 +130, 0x4ede7427969e0dd5 +131, 0xc3f19b6f78ea00b +132, 0xeea7bab9be2181ea +133, 0x652c45fe9c420c04 +134, 0x14ba9e3d175670ee +135, 0xd2ad156ba6490474 +136, 0x4d65ae41065f614 +137, 0x6ff911c8afa28eb1 +138, 0xedc2b33588f3cb68 +139, 0x437c8bc324666a2f +140, 0x828cee25457a3f0 +141, 0x530c986091f31b9b +142, 0x2f34671e8326ade7 +143, 0x4f686a8f4d77f6da +144, 0xa4c1987083498895 +145, 0xbce5a88b672b0fb1 +146, 0x8476115a9e6a00cc +147, 0x16de18a55dd2c238 +148, 0xdf38cf4c416232bc +149, 0x2cb837924e7559f3 +150, 0xfad4727484e982ed +151, 0x32a55d4b7801e4f +152, 0x8b9ef96804bd10a5 +153, 0xa1fd422c9b5cf2a9 +154, 0xf46ddb122eb7e442 +155, 0x6e3842547afa3b33 +156, 0x863dee1c34afe5c4 +157, 0x6a43a1935b6db171 +158, 0x1060a5c2f8145821 +159, 0xf783ec9ed34c4607 +160, 0x1da4a86bf5f8c0b0 +161, 0x4c7714041ba12af8 +162, 0x580da7010be2f192 +163, 0xad682fe795a7ea7a +164, 0x6687b6cb88a9ed2c +165, 0x3c8d4b175517cd18 +166, 0xe9247c3a524a6b6b +167, 0x337ca9cfaa02658 +168, 0xed95399481c6feec +169, 0x58726a088e606062 +170, 0xfe7588a5b4ee342a +171, 0xee434c7ed146fdee +172, 0xe2ade8b60fdc4ba5 +173, 0xd57e4c155de4eaab +174, 0xdefeae12de1137cb +175, 0xb7a276a241316ac1 +176, 0xeb838b1b1df4ca15 +177, 0x6f78965edea32f6f +178, 0x18bebd264d7a5d53 +179, 0x3641c691d77005ec +180, 0xbe70ed7efea8c24c +181, 0x33047fa8d03ca560 +182, 0x3bed0d2221ff0f87 +183, 0x23083a6ffbcf38a2 +184, 0xc23eb827073d3fa5 +185, 0xc873bb3415e9fb9b +186, 0xa4645179e54147fe +187, 0x2c72fb443f66e207 +188, 0x98084915dd89d8f4 +189, 0x88baa2de12c99037 +190, 0x85c74ab238cb795f +191, 0xe122186469ea3a26 +192, 0x4c3bba99b3249292 +193, 0x85d6845d9a015234 +194, 0x147ddd69c13e6a31 +195, 0x255f4d678c9a570b +196, 0x2d7c0c410bf962b4 +197, 0x58eb7649e0aa16ca +198, 0x9d240bf662fe0783 +199, 0x5f74f6fa32d293cc +200, 0x4928e52f0f79d9b9 +201, 0xe61c2b87146b706d +202, 0xcfcd90d100cf5431 +203, 0xf15ea8138e6aa178 +204, 0x6ab8287024f9a819 +205, 0xed8942593db74e01 +206, 0xefc00e4ec2ae36dd +207, 0xc21429fb9387f334 +208, 0xf9a3389e285a9bce +209, 0xacdee8c43aae49b3 +210, 0xefc382f02ad55c25 +211, 0x1153b50e8d406b72 +212, 0xb00d39ebcc2f89d8 +213, 0xde62f0b9831c8850 +214, 0xc076994662eef6c7 +215, 0x66f08f4752f1e3ef +216, 0x283b90619796249a +217, 0x4e4869bc4227499e +218, 0xb45ad78a49efd7ed +219, 0xffe19aa77abf5f4b +220, 0xfce11a0daf913aef +221, 0x7e4e64450d5cdceb +222, 0xe9621997cfd62762 +223, 0x4d2c9e156868081 +224, 0x4e2d96eb7cc9a08 +225, 0xda74849bba6e3bd3 +226, 0x6f4621da935e7fde +227, 0xb94b914aa0497259 +228, 0xd50d03e8b8db1563 +229, 0x1a45c1ce5dca422e +230, 0xc8d30d33276f843f +231, 0xb57245774e4176b4 +232, 0x8d36342c05abbbb1 +233, 0x3591ad893ecf9e78 +234, 0x62f4717239ee0ac8 +235, 0x9b71148a1a1d4200 +236, 0x65f8e0f56dd94463 +237, 0x453b1fcfd4fac8c2 +238, 0x4c25e48e54a55865 +239, 0xa866baa05112ace2 +240, 0x7741d3c69c6e79c5 +241, 0x7deb375e8f4f7a8a +242, 0xc242087ede42abd8 +243, 0x2fa9d1d488750c4b +244, 0xe8940137a935d3d3 +245, 0x1dab4918ca24b2f2 +246, 0xe2368c782168fe3e +247, 0x6e8b2d1d73695909 +248, 0x70455ebea268b33e +249, 0x656a919202e28da1 +250, 0x5a5a8935647da999 +251, 0x428c6f77e118c13c +252, 0xa87aee2b675bb083 +253, 0x3873a6412b239969 +254, 0x5f72c1e91cb8a2ee +255, 0xa25af80a1beb5679 +256, 0x1af65d27c7b4abc3 +257, 0x133437060670e067 +258, 0xb1990fa39a97d32e +259, 0x724adc89ae10ed17 +260, 0x3f682a3f2363a240 +261, 0x29198f8dbd343499 +262, 0xdfaeeaa42bc51105 +263, 0x5baff3901b9480c2 +264, 0x3f760a67043e77f5 +265, 0x610fa7aa355a43ba +266, 0x394856ac09c4f7a7 +267, 0x1d9229d058aee82e +268, 0x19c674804c41aeec +269, 0x74cf12372012f4aa +270, 0xa5d89b353fa2f6ca +271, 0x697e4f672ac363dd +272, 0xde6f55ba73df5af9 +273, 0x679cf537510bd68f +274, 0x3dc916114ae9ef7e +275, 0xd7e31a66ec2ee7ba +276, 0xc21bebb968728495 +277, 0xc5e0781414e2adfd +278, 0x71147b5412ddd4bd +279, 0x3b864b410625cca9 +280, 0x433d67c0036cdc6 +281, 0x48083afa0ae20b1b +282, 0x2d80beecd64ac4e8 +283, 0x2a753c27c3a3ee3e +284, 0xb2c5e6afd1fe051a +285, 0xea677930cd66c46b +286, 0x4c3960932f92810a +287, 0xf1b367a9e527eaba +288, 0xb7d92a8a9a69a98e +289, 0x9f9ad3210bd6b453 +290, 0x817f2889db2dcbd8 +291, 0x4270a665ac15813c +292, 0x90b85353bd2be4dd +293, 0x10c0460f7b2d68d +294, 0x11cef32b94f947f5 +295, 0x3cf29ed8e7d477e8 +296, 0x793aaa9bd50599ef +297, 0xbac15d1190014aad +298, 0x987944ae80b5cb13 +299, 0x460aa51f8d57c484 +300, 0xc77df0385f97c2d3 +301, 0x92e743b7293a3822 +302, 0xbc3458bcfbcbb8c0 +303, 0xe277bcf3d04b4ed7 +304, 0xa537ae5cf1c9a31c +305, 0x95eb00d30bd8cfb2 +306, 0x6376361c24e4f2dd +307, 0x374477fe87b9ea8e +308, 0x8210f1a9a039902e +309, 0xe7628f7031321f68 +310, 0x8b8e9c0888fc1d3d +311, 0x306be461fdc9e0ed +312, 0x510009372f9b56f5 +313, 0xa6e6fa486b7a027a +314, 0x9d3f002025203b5a +315, 0x7a46e0e81ecbef86 +316, 0x41e280c611d04df0 +317, 0xedcec10418a99e8a +318, 0x5c27b6327e0b9dbd +319, 0xa81ed2035b509f07 +320, 0x3581e855983a4cc4 +321, 0x4744594b25e9809d +322, 0xc737ac7c27fbd0ed +323, 0x1b523a307045433a +324, 0x8b4ce9171076f1d9 +325, 0x2db02d817cd5eec0 +326, 0x24a1f1229af50288 +327, 0x5550c0dcf583ff16 +328, 0x3587baaa122ec422 +329, 0xf9d3dc894229e510 +330, 0xf3100430d5cf8e87 +331, 0xc31af79862f8e2fb +332, 0xd20582063b9f3537 +333, 0xac5e90ac95fcc7ad +334, 0x107c4c704d5109d4 +335, 0xebc8628906dbfd70 +336, 0x215242776da8c531 +337, 0xa98002f1dcf08b51 +338, 0xbc3bdc07f3b09718 +339, 0x238677062495b512 +340, 0x53b4796f2a3c49e8 +341, 0x6424286467e22f0e +342, 0x14d0952a11a71bac +343, 0x2f97098149b82514 +344, 0x3777f2fdc425ad2 +345, 0xa32f2382938876d4 +346, 0xda8a39a021f20ae3 +347, 0x364361ef0a6ac32c +348, 0x4413eede008ff05a +349, 0x8dda8ace851aa327 +350, 0x4303cabbdcecd1ee +351, 0x2e69f06d74aa549f +352, 0x4797079cd4d9275c +353, 0xc7b1890917e98307 +354, 0x34031b0e822a4b4c +355, 0xfc79f76b566303ea +356, 0x77014adbe255a930 +357, 0xab6c43dd162f3be5 +358, 0xa430041f3463f6b9 +359, 0x5c191a32ada3f84a +360, 0xe8674a0781645a31 +361, 0x3a11cb667b8d0916 +362, 0xaedc73e80c39fd8a +363, 0xfde12c1b42328765 +364, 0x97abb7dcccdc1a0b +365, 0x52475c14d2167bc8 +366, 0x540e8811196d5aff +367, 0xa867e4ccdb2b4b77 +368, 0x2be04af61e5bcfb9 +369, 0x81b645102bfc5dfd +370, 0x96a52c9a66c6450f +371, 0x632ec2d136889234 +372, 0x4ed530c0b36a6c25 +373, 0x6f4851225546b75 +374, 0x2c065d6ba46a1144 +375, 0xf8a3613ff416551d +376, 0xb5f0fd60e9c971a9 +377, 0x339011a03bb4be65 +378, 0x9439f72b6995ded6 +379, 0xc1b03f3ef3b2292d +380, 0xad12fd221daab3ae +381, 0xf615b770f2cf996f +382, 0x269d0fdcb764172 +383, 0x67837025e8039256 +384, 0x6402831fc823fafa +385, 0x22854146a4abb964 +386, 0x7b5ad9b5a1bad7a8 +387, 0x67170e7beb6ac935 +388, 0xfc2d1e8e24adfaaa +389, 0x7ded4395345ff40d +390, 0x418981760a80dd07 +391, 0xc03bef38022c1d2 +392, 0x3a11850b26eade29 +393, 0xaa56d02c7175c5f4 +394, 0xd83b7917b9bfbff5 +395, 0x3c1df2f8fa6fced3 +396, 0xf3d6e2999c0bb760 +397, 0xc66d683a59a950e3 +398, 0x8e3972a9d73ffabf +399, 0x97720a0443edffd9 +400, 0xa85f5d2fe198444a +401, 0xfc5f0458e1b0de5e +402, 0xe3973f03df632b87 +403, 0xe151073c84c594b3 +404, 0x68eb4e22e7ff8ecf +405, 0x274f36eaed7cae27 +406, 0x3b87b1eb60896b13 +407, 0xbe0b2f831442d70a +408, 0x2782ed7a48a1b328 +409, 0xb3619d890310f704 +410, 0xb03926b11b55921a +411, 0xdb46fc44aa6a0ce4 +412, 0x4b063e2ef2e9453a +413, 0xe1584f1aeec60fb5 +414, 0x7092bd6a879c5a49 +415, 0xb84e1e7c7d52b0e6 +416, 0x29d09ca48db64dfb +417, 0x8f6c4a402066e905 +418, 0x77390795eabc36b +419, 0xcc2dc2e4141cc69f +420, 0x2727f83beb9e3c7c +421, 0x1b29868619331de0 +422, 0xd38c571e192c246f +423, 0x535327479fe37b6f +424, 0xaff9ce5758617eb3 +425, 0x5658539e9288a4e4 +426, 0x8df91d87126c4c6d +427, 0xe931cf8fdba6e255 +428, 0x815dfdf25fbee9e8 +429, 0x5c61f4c7cba91697 +430, 0xdd5f5512fe2313a1 +431, 0x499dd918a92a53cd +432, 0xa7e969d007c97dfd +433, 0xb8d39c6fc81ac0bb +434, 0x1d646983def5746c +435, 0x44d4b3b17432a60c +436, 0x65664232a14db1e3 +437, 0xda8fae6433e7500b +438, 0xbe51b94ff2a3fe94 +439, 0xe9b1bd9a9098ef9f +440, 0xfe47d54176297ef5 +441, 0xb8ab99bc03bb7135 +442, 0xcfad97f608565b38 +443, 0xf05da71f6760d9c1 +444, 0xef8da40a7c70e7b +445, 0xe0465d58dbd5d138 +446, 0xb54a2d70eb1a938 +447, 0xfdd50c905958f2d8 +448, 0x3c41933c90a57d43 +449, 0x678f6d894c6ad0bb +450, 0x403e8f4582274e8 +451, 0x5cbbe975668df6b0 +452, 0x297e6520a7902f03 +453, 0x8f6dded33cd1efd7 +454, 0x8e903c97be8d783b +455, 0x10bd015577e30f77 +456, 0x3fcd69d1c36eab0c +457, 0xb45989f3ca198d3 +458, 0x507655ce02b491a9 +459, 0xa92cf99bb78602ce +460, 0xebfb82055fbc2f0f +461, 0x3334256279289b7a +462, 0xc19d2a0f740ee0ac +463, 0x8bb070dea3934905 +464, 0xa4ab57d3a8d1b3eb +465, 0xfee1b09bcacf7ff4 +466, 0xccc7fb41ceec41fa +467, 0xd4da49094eb5a74d +468, 0xed5c693770af02ed +469, 0x369dabc9bbfaa8e4 +470, 0x7eab9f360d054199 +471, 0xe36dbebf5ee94076 +472, 0xd30840e499b23d7 +473, 0x8678e6cb545015ff +474, 0x3a47932ca0b336e +475, 0xeb7c742b6e93d6fe +476, 0x1404ea51fe5a62a9 +477, 0xa72cd49db978e288 +478, 0xfd7bada020173dcf +479, 0xc9e74fc7abe50054 +480, 0x93197847bb66808d +481, 0x25fd5f053dce5698 +482, 0xe198a9b18cc21f4 +483, 0x5cc27b1689452d5d +484, 0x8b3657af955a98dc +485, 0xc17f7584f54aa1c0 +486, 0xe821b088246b1427 +487, 0x32b5a9f6b45b6fa0 +488, 0x2aef7c315c2bae0c +489, 0xe1af8129846b705a +490, 0x4123b4c091b34614 +491, 0x6999d61ec341c073 +492, 0x14b9a8fcf86831ea +493, 0xfd4cff6548f46c9f +494, 0x350c3b7e6cc8d7d6 +495, 0x202a5047fecafcd5 +496, 0xa82509fe496bb57d +497, 0x835e4b2608b575fe +498, 0xf3abe3da919f54ec +499, 0x8705a21e2c9b8796 +500, 0xfd02d1427005c314 +501, 0xa38458faa637f49b +502, 0x61622f2360e7622a +503, 0xe89335a773c2963b +504, 0x481264b659b0e0d0 +505, 0x1e82ae94ebf62f15 +506, 0x8ea7812de49209d4 +507, 0xff963d764680584 +508, 0x418a68bef717f4af +509, 0x581f0e7621a8ab91 +510, 0x840337e9a0ec4150 +511, 0x951ef61b344be505 +512, 0xc8b1b899feb61ec2 +513, 0x8b78ca13c56f6ed9 +514, 0x3d2fd793715a946f +515, 0xf1c04fabcd0f4084 +516, 0x92b602614a9a9fcc +517, 0x7991bd7a94a65be7 +518, 0x5dead10b06cad2d7 +519, 0xda7719b33f722f06 +520, 0x9d87a722b7bff71e +521, 0xb038e479071409e9 +522, 0xf4e8bbec48054775 +523, 0x4fec2cd7a28a88ea +524, 0x839e28526aad3e56 +525, 0xd37ec57852a98bf0 +526, 0xdef2cbbe00f3a02d +527, 0x1aecfe01a9e4d801 +528, 0x59018d3c8beaf067 +529, 0x892753e6ac8bf3cd +530, 0xefdd3437023d2d1c +531, 0x447bfbd148c8cb88 +532, 0x282380221bd442b8 +533, 0xfce8658d1347384a +534, 0x60b211a7ec6bfa8 +535, 0xd21729cfcc692974 +536, 0x162087ecd5038a47 +537, 0x2b17000c4bce39d2 +538, 0x3a1f75ff6adcdce0 +539, 0x721a411d312f1a2c +540, 0x9c13b6133f66934d +541, 0xaa975d14978980e5 +542, 0x9403dbd4754203fa +543, 0x588c15762fdd643 +544, 0xdd1290f8d0ada73a +545, 0xd9b77380936103f4 +546, 0xb2e2047a356eb829 +547, 0x7019e5e7f76f7a47 +548, 0x3c29a461f62b001d +549, 0xa07dc6cfab59c116 +550, 0x9b97e278433f8eb +551, 0x6affc714e7236588 +552, 0x36170aeb32911a73 +553, 0x4a665104d364a789 +554, 0x4be01464ec276c9c +555, 0x71bb10271a8b4ecf +556, 0xbf62e1d068bc018 +557, 0xc9ada5db2cbbb413 +558, 0x2bded75e726650e5 +559, 0x33d5a7af2f34385d +560, 0x8179c46661d85657 +561, 0x324ebcfd29267359 +562, 0xac4c9311dc9f9110 +563, 0xc14bb6a52f9f9c0 +564, 0xc430abe15e7fb9db +565, 0xf1cce5c14df91c38 +566, 0x651e3efa2c0750d3 +567, 0x38a33604a8be5c75 +568, 0x7aaf77fe7ff56a49 +569, 0xc0d1cc56bbf27706 +570, 0x887aa47324e156c6 +571, 0x12547c004b085e8d +572, 0xd86a8d6fbbbfd011 +573, 0x57c860188c92d7b4 +574, 0xcd5d3843d361b8ca +575, 0x8f586ef05a9cb3ef +576, 0x174456e1ba6267d5 +577, 0xf5dc302c62fe583c +578, 0xa349442fabcdb71 +579, 0xe5123c1a8b6fd08e +580, 0x80681552aa318593 +581, 0xb295396deaef1e31 +582, 0xabb626e0b900e32b +583, 0xf024db8d3f19c15e +584, 0x1d04bb9548e2fb6c +585, 0xd8ed2b2214936c2b +586, 0x618ca1e430a52bc9 +587, 0xccbca44a6088136b +588, 0xd0481855c8b9ccbe +589, 0x3c92a2fade28bdf7 +590, 0x855e9fefc38c0816 +591, 0x1269bbfe55a7b27c +592, 0x1d6c853d83726d43 +593, 0xc8655511cc7fcafc +594, 0x301503eb125a9b0e +595, 0xb3108e4532016b11 +596, 0xbb7ab6245da9cb3d +597, 0x18004c49116d85eb +598, 0x3480849c20f61129 +599, 0xe28f45157463937b +600, 0x8e85e61060f2ce1 +601, 0x1673da4ec589ba5e +602, 0x74b9a6bd1b194712 +603, 0xed39e147fa8b7601 +604, 0x28ce54019102ca77 +605, 0x42e0347f6d7a2f30 +606, 0xb6a908d1c4814731 +607, 0x16c3435e4e9a126d +608, 0x8880190514c1ad54 +609, 0xfffd86229a6f773c +610, 0x4f2420cdb0aa1a93 +611, 0xf8e1acb4120fc1fa +612, 0x63a8c553ab36a2f2 +613, 0x86b88cf3c0a6a190 +614, 0x44d8b2801622c792 +615, 0xf6eae14e93082ff1 +616, 0xd9ed4f5d1b8fac61 +617, 0x1808ce17f4e1f70 +618, 0x446e83ea336f262f +619, 0xc7c802b04c0917b7 +620, 0x626f45fd64968b73 +621, 0x9ffa540edc9b2c5c +622, 0xa96a1e219e486af8 +623, 0x2bb8963884e887a1 +624, 0xba7f68a5d029e3c4 +625, 0xefc45f44392d9ca0 +626, 0x98d77762503c5eab +627, 0xd89bcf62f2da627c +628, 0xa3cab8347f833151 +629, 0xa095b7595907d5c7 +630, 0x3b3041274286181 +631, 0xb518db8919eb71fa +632, 0x187036c14fdc9a36 +633, 0xd06e28301e696f5d +634, 0xdbc71184e0c56492 +635, 0xfe51e9cae6125bfd +636, 0x3b12d17cd014df24 +637, 0x3b95e4e2c986ac1a +638, 0x29c1cce59fb2dea2 +639, 0x58c05793182a49d6 +640, 0xc016477e330d8c00 +641, 0x79ef335133ada5d +642, 0x168e2cad941203f3 +643, 0xf99d0f219d702ef0 +644, 0x655628068f8f135b +645, 0xdcdea51910ae3f92 +646, 0x8e4505039c567892 +647, 0x91a9ec7e947c89ae +648, 0x8717172530f93949 +649, 0x1c80aba9a440171a +650, 0x9c8f83f6ebe7441e +651, 0x6c05e1efea4aa7f9 +652, 0x10af696b777c01b +653, 0x5892e9d9a92fc309 +654, 0xd2ba7da71e709432 +655, 0x46378c7c3269a466 +656, 0x942c63dfe18e772c +657, 0x6245cf02ef2476f +658, 0x6f265b2759ea2aea +659, 0x5aa757f17d17f4a6 +660, 0x1ad6a3c44fa09be6 +661, 0xe861af14e7015fb8 +662, 0x86be2e7db388c77 +663, 0x5c7bba32b519e9a0 +664, 0x3feb314850c4437b +665, 0x97955add60cfb45b +666, 0xfdb536230a540bdc +667, 0xdac9d7bf6e58512e +668, 0x4894c00e474e8120 +669, 0xa1918a37739da366 +670, 0xa8097f2096532807 +671, 0x592afe50e6c5e643 +672, 0xd69050ee6dcb33dc +673, 0xa6956b262dd3c561 +674, 0x1a55c815555e63f7 +675, 0x2ec7fd37516de2bb +676, 0x8ec251d9c70e76ba +677, 0x9b76e4abafd2689 +678, 0x9ce3f5c751a57df1 +679, 0x915c4818bf287bc7 +680, 0x2293a0d1fe07c735 +681, 0x7627dcd5d5a66d3d +682, 0xb5e4f92cc49c7138 +683, 0x6fc51298731d268c +684, 0xd19800aa95441f87 +685, 0x14f70f31162fa115 +686, 0x41a3da3752936f59 +687, 0xbec0652be95652ee +688, 0x7aa4bdb1020a290f +689, 0x4382d0d9bee899ef +690, 0xe6d988ae4277d6ff +691, 0xe618088ccb2a32d1 +692, 0x411669dfaa899e90 +693, 0x234e2bf4ba76d9f +694, 0xe109fe4cb7828687 +695, 0x1fb96b5022b0b360 +696, 0x6b24ad76c061a716 +697, 0x7e1781d4d7ecee15 +698, 0xf20c2dbe82ba38ba +699, 0xeda8e8ae1d943655 +700, 0xa58d196e2a77eaec +701, 0x44564765a5995a0b +702, 0x11902fe871ecae21 +703, 0x2ea60279900e675d +704, 0x38427227c18a9a96 +705, 0xe0af01490a1b1b48 +706, 0x826f91997e057824 +707, 0x1e57308e6e50451 +708, 0xb42d469bbbfdc350 +709, 0xb9734cff1109c49b +710, 0x98967559bb9d364f +711, 0xd6be360041907c12 +712, 0xa86a1279122a1e21 +713, 0x26f99a8527bfc698 +714, 0xfa8b85758f28f5d6 +715, 0xe3057429940806ae +716, 0x4bee2d7e84f93b2b +717, 0x948350a76ea506f4 +718, 0xa139154488045e74 +719, 0x8893579ba5e78085 +720, 0x5f21c215c6a9e397 +721, 0x456134f3a59641dc +722, 0x92c0273f8e97a9c6 +723, 0xd2936c9c3f0c6936 +724, 0xcfa4221e752c4735 +725, 0x28cd5a7457355dca +726, 0xecdfdde23d90999f +727, 0x60631b2d494d032b +728, 0xf67289df269a827f +729, 0xcbe8011ef0f5b7ef +730, 0x20eea973c70a84f5 +731, 0xbe1fd200398557ce +732, 0xd2279ee030191bba +733, 0xf2bd4291dedaf819 +734, 0xfc6d167dbe8c402 +735, 0x39ac298da5d0044b +736, 0xceac026f5f561ce +737, 0x10a5b0bdd8ad60e6 +738, 0xdeb3c626df6d4bcb +739, 0x3c128962e77ff6ca +740, 0xc786262e9c67a0e5 +741, 0x4332855b3febcdc0 +742, 0x7bda9724d1c0e020 +743, 0x6a8c93399bc4df22 +744, 0xa9b20100ac707396 +745, 0xa11a3458502c4eb5 +746, 0xb185461c60478941 +747, 0x13131d56195b7ff6 +748, 0x8d55875ddbd4aa1c +749, 0xc09b67425f469aa5 +750, 0x39e33786cc7594c4 +751, 0x75e96db8e4b08b93 +752, 0xda01cd12a3275d1e +753, 0x2c49e7822344fab5 +754, 0x9bd5f10612514ca7 +755, 0x1c801a5c828e7332 +756, 0x29797d3f4f6c7b4c +757, 0xac992715e21e4e53 +758, 0xe40e89ee887ddb37 +759, 0x15189a2b265a783b +760, 0xa854159a52af5c5 +761, 0xb9d8a5a81c12bead +762, 0x3240cdc9d59e2a58 +763, 0x1d0b872234cf8e23 +764, 0xc01224cf6ce12cff +765, 0x2601e9f3905c8663 +766, 0xd4ecf9890168d6b4 +767, 0xa45db796d89bfdd5 +768, 0x9f389406dad64ab4 +769, 0xa5a851adce43ffe3 +770, 0xd0962c41c26e5aa9 +771, 0x8a671679e48510a4 +772, 0xc196dc0924a6bfeb +773, 0x3ead661043b549cb +774, 0x51af4ca737d405ac +775, 0xf4425b5c62275fb6 +776, 0x71e69d1f818c10f5 +777, 0xacaf4af2d3c70162 +778, 0x2e1f1d4fd7524244 +779, 0xe54fdd8f388890e8 +780, 0xfda0d33e84eb2b83 +781, 0x53965c5e392b81da +782, 0x5c92288267263097 +783, 0xcac1b431c878c66c +784, 0x36c0e1cf417241c6 +785, 0x5cc4d9cd1a36bf2c +786, 0x32e4257bb5d3e470 +787, 0x4aecff904adb44fb +788, 0x4d91a8e0d1d60cac +789, 0xa3b478388385b038 +790, 0x48d955f24eba70be +791, 0x310e4deb07f24f68 +792, 0x8853e73b1f30a5a +793, 0x278aee45c2a65c5 +794, 0xf6932eedbd62fb0b +795, 0xafb95958c82fafad +796, 0x78e807c18616c16c +797, 0xd7abadda7488ed9f +798, 0x2dd72e2572aa2ae6 +799, 0x6ec3791982c2be09 +800, 0x6865bb314fac478f +801, 0xa14dc0ce09000d1a +802, 0xb8081ad134da10f2 +803, 0xc4ac1534aa825ef5 +804, 0xd83aeb48ae2d538f +805, 0x38052027e3074be4 +806, 0xa9833e06ef136582 +807, 0x4f02d790ec9fd78 +808, 0xec2f60bc711c5bdc +809, 0x9253b0d12268e561 +810, 0xa8ac607fdd62c206 +811, 0x895e28ebc920289f +812, 0xe2fd42b154243ac7 +813, 0xc69cac2f776eee19 +814, 0xf4d4ac11db56d0dc +815, 0xa8d37049b9f39833 +816, 0x75abbf8a196c337c +817, 0xb115bb76750d27b8 +818, 0x39426d187839154 +819, 0xd488423e7f38bf83 +820, 0xbb92e0c76ecb6a62 +821, 0x3055a018ce39f4e3 +822, 0xc93fe0e907729bfb +823, 0x65985d17c5863340 +824, 0x2088ae081b2028e1 +825, 0x6e628de873314057 +826, 0x864377cccf573f0e +827, 0xae03f4c9aa63d132 +828, 0xb1db766d6404c66d +829, 0xdce5a22414a374b +830, 0x622155b777819997 +831, 0x69fe96e620371f3c +832, 0xa9c67dbc326d94fc +833, 0x932a84ae5dd43bab +834, 0xe2301a20f6c48c3f +835, 0x795d2e79c6477300 +836, 0xd8e3e631289521e7 +837, 0xae2684979002dfd6 +838, 0xc9c2392377550f89 +839, 0xa1b0c99d508ef7ec +840, 0x593aef3c5a5272ec +841, 0xe32e511a4b7162cd +842, 0xab3b81655f5a2857 +843, 0x1b535e1a0aaf053e +844, 0x5b33f56c1b6a07e2 +845, 0x782dc8cfcac4ef36 +846, 0xb3d4f256eecfd202 +847, 0xf73a6598f58c4f7e +848, 0xd5722189524870ae +849, 0x707878de6b995fc0 +850, 0xc3eb6ba73e3d7e8a +851, 0xca75c017655b75a7 +852, 0x1b29369ea3541e5f +853, 0x352e98858bdb58a3 +854, 0x1e4412d184b6b27d +855, 0x2d375ba0304b2d17 +856, 0x56c30fce69a5d08e +857, 0x6b8c2b0c06584bda +858, 0xde4dfff228c8c91f +859, 0xb7c9edd574e6287f +860, 0xf6078281c9fca2b2 +861, 0xb9b9a51de02a2f1e +862, 0xa411bef31c0103b0 +863, 0xc5facd8fc5e1d7a3 +864, 0x54e631c05ddf7359 +865, 0x815b42b3fd06c474 +866, 0xc9ac07566fda18ec +867, 0xd84ea62957bd8e15 +868, 0x5575f74b5cfd8803 +869, 0x5779a8d460c2e304 +870, 0xfd6e87e264a85587 +871, 0xa1d674daa320b26d +872, 0x2c3c3ec64b35afc4 +873, 0x393a274ff03e6935 +874, 0x1f40ecbac52c50ea +875, 0xc3de64fa324ffc0c +876, 0x56ae828b7f9deb04 +877, 0xe7c1a77b5c1f2cb3 +878, 0xa4c4aab19ea921cc +879, 0xec164c238825822c +880, 0xa6a3304770c03b03 +881, 0x3a63641d5b1e8123 +882, 0x42677be3a54617ef +883, 0xa2680423e3a200c0 +884, 0x8b17cf75f3f37277 +885, 0xe7ce65a49242be3d +886, 0x7f85934271323e4b +887, 0xcfb0f431f79a4fab +888, 0x392e4041a8505b65 +889, 0xd3e5daf0d8b25ea6 +890, 0x9447eff675d80f53 +891, 0xea27a9d53cfaeea8 +892, 0xe3f2335945a83ba +893, 0x8875a43ce216413b +894, 0xe49941f9eabce33e +895, 0x9357c1296683a5b1 +896, 0xf0f16439e81ee701 +897, 0x3181515295ffd79a +898, 0x9d7150fffd169ed8 +899, 0x2d6a1d281e255a72 +900, 0x81bf1286fb3a92b6 +901, 0x566d3079b499e279 +902, 0xc7939ca8f047341 +903, 0xb1f8050e7c2d59f6 +904, 0x605701045e7be192 +905, 0x51b73360e8e31a1c +906, 0x9f4ad54483ba9fe0 +907, 0xd3085b8fcf69d1c8 +908, 0xc3e7475026dc5f0b +909, 0x5800f8554b157354 +910, 0x37dfdf858cfcd963 +911, 0x3a1fce05ce385072 +912, 0xf495c062645c20c3 +913, 0xdcbeec2c3492c773 +914, 0xc38f427589d1d0b4 +915, 0x681ead60216a8184 +916, 0x4bd569c40cc88c41 +917, 0x49b0d442e130b7a2 +918, 0xee349156b7d1fa3f +919, 0x2bde2d2db055135b +920, 0xc6a460d2fbcb2378 +921, 0xd0f170494ff3dbb +922, 0xb294422492528a23 +923, 0xfc95873c854e7b86 +924, 0x6c9c3ad1797bb19c +925, 0xe0c06f2aab65062d +926, 0x58e32ce0f11e3a81 +927, 0xa745fcd729ff5036 +928, 0x599b249b2fc2cdb2 +929, 0x78f23b5b0dd5b082 +930, 0x6de3e957f549ecfc +931, 0x9d0712fa6d878756 +932, 0x9076e8554e4a413a +933, 0xf3185818c0294de8 +934, 0x5de7cdf4b455b9b6 +935, 0xb15f6908ed703f7d +936, 0x98c654dfedc6818 +937, 0x120502ab0e93ae42 +938, 0x67966a98a58dc120 +939, 0x1caa0fc628989482 +940, 0xd8b2c3cd480a8625 +941, 0x85c70071b3aed671 +942, 0xff385f8473714662 +943, 0xe2868e4bf3773b63 +944, 0x96cf8019b279298e +945, 0x8511cc930bd74800 +946, 0x5312e48fdd55f5ab +947, 0xfcdae564b52df78d +948, 0x9eee48373e652176 +949, 0x953788f6bcbc56b0 +950, 0xd1a3855dbd2f6b37 +951, 0x3ad32acf77f4d1e9 +952, 0x917c7be81b003e30 +953, 0x9ce817da1e2e9dfb +954, 0x2968983db162d44d +955, 0x1e005decef5828ad +956, 0xc38fe59d1aa4f3d5 +957, 0xf357f1710dc02f1d +958, 0x2613912a4c83ec67 +959, 0x832a11470b9a17cb +960, 0x5e85508a611f0dad +961, 0x2781131677f59d56 +962, 0xa82358d7d4b0237f +963, 0xfbf8b3cc030c3af6 +964, 0x68b2f68ac8a55adb +965, 0x3b6fcf353add0ada +966, 0xd1956049bcd15bd5 +967, 0x95b76f31c7f98b6d +968, 0x814b6690df971a84 +969, 0xdcf7959cddd819e4 +970, 0xcf8c72c5d804fc88 +971, 0x56883769c8945a22 +972, 0x1f034652f658cf46 +973, 0x41df1324cda235a1 +974, 0xeccd32524504a054 +975, 0x974e0910a04ec02c +976, 0x72104507b821f6db +977, 0x791f8d089f273044 +978, 0xe0f79a4f567f73c3 +979, 0x52fe5bea3997f024 +980, 0x5f8b9b446494f78 +981, 0xfd9f511947059190 +982, 0x3aea9dac6063bce3 +983, 0xbfdae4dfc24aee60 +984, 0xa82cdbbf0a280318 +985, 0xf460aae18d70aa9d +986, 0x997367cb204a57c4 +987, 0x616e21ab95ba05ef +988, 0x9bfc93bec116769f +989, 0x2b2ee27c37a3fa5b +990, 0xb25c6ed54006ee38 +991, 0xab04d4a5c69e69a5 +992, 0x6d2f6b45f2d8438f +993, 0x4ad2f32afc82f092 +994, 0x513d718908f709c0 +995, 0x5272aadc4fffca51 +996, 0xeb3f87e66156ef5d +997, 0xf8a3d5a46a86ba85 +998, 0xdb4548a86f27abfd +999, 0x57c05f47ff62380d diff --git a/shared/package-files/75/75611c22748976f65aa4d8ddd95be792c5072b28f8fc05525496aca7bbaa141c/__init__.pyi b/shared/package-files/75/75611c22748976f65aa4d8ddd95be792c5072b28f8fc05525496aca7bbaa141c/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..69c82a9c6cd17fe27554622fcd61073f360923f8 --- /dev/null +++ b/shared/package-files/75/75611c22748976f65aa4d8ddd95be792c5072b28f8fc05525496aca7bbaa141c/__init__.pyi @@ -0,0 +1,57 @@ +from _typeshed import SupportsRead +from typing import IO, Any, Callable, Dict, List, Optional, Tuple, Type, Union + +from .decoder import JSONDecodeError as JSONDecodeError, JSONDecoder as JSONDecoder +from .encoder import JSONEncoder as JSONEncoder + +def dumps( + obj: Any, + *, + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + cls: Optional[Type[JSONEncoder]] = ..., + indent: Union[None, int, str] = ..., + separators: Optional[Tuple[str, str]] = ..., + default: Optional[Callable[[Any], Any]] = ..., + sort_keys: bool = ..., + **kwds: Any, +) -> str: ... +def dump( + obj: Any, + fp: IO[str], + *, + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + cls: Optional[Type[JSONEncoder]] = ..., + indent: Union[None, int, str] = ..., + separators: Optional[Tuple[str, str]] = ..., + default: Optional[Callable[[Any], Any]] = ..., + sort_keys: bool = ..., + **kwds: Any, +) -> None: ... +def loads( + s: Union[str, bytes], + *, + cls: Optional[Type[JSONDecoder]] = ..., + object_hook: Optional[Callable[[Dict[Any, Any]], Any]] = ..., + parse_float: Optional[Callable[[str], Any]] = ..., + parse_int: Optional[Callable[[str], Any]] = ..., + parse_constant: Optional[Callable[[str], Any]] = ..., + object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ..., + **kwds: Any, +) -> Any: ... +def load( + fp: SupportsRead[Union[str, bytes]], + *, + cls: Optional[Type[JSONDecoder]] = ..., + object_hook: Optional[Callable[[Dict[Any, Any]], Any]] = ..., + parse_float: Optional[Callable[[str], Any]] = ..., + parse_int: Optional[Callable[[str], Any]] = ..., + parse_constant: Optional[Callable[[str], Any]] = ..., + object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ..., + **kwds: Any, +) -> Any: ... diff --git a/shared/package-files/75/75634be5c80dff0a74207d6256b7cd13832709415f1a5f2bfaee9771e84e8e67/cudnn_affine_grid_generator.h b/shared/package-files/75/75634be5c80dff0a74207d6256b7cd13832709415f1a5f2bfaee9771e84e8e67/cudnn_affine_grid_generator.h new file mode 100644 index 0000000000000000000000000000000000000000..742f900db1aec7ad7cee452e8503ba6822d8c629 --- /dev/null +++ b/shared/package-files/75/75634be5c80dff0a74207d6256b7cd13832709415f1a5f2bfaee9771e84e8e67/cudnn_affine_grid_generator.h @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::cudnn_affine_grid_generator(Tensor theta, int N, int C, int H, int W) -> Tensor grid +inline at::Tensor cudnn_affine_grid_generator(const at::Tensor & theta, int64_t N, int64_t C, int64_t H, int64_t W) { + return at::_ops::cudnn_affine_grid_generator::call(theta, N, C, H, W); +} + +// aten::cudnn_affine_grid_generator.out(Tensor theta, int N, int C, int H, int W, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & cudnn_affine_grid_generator_out(at::Tensor & out, const at::Tensor & theta, int64_t N, int64_t C, int64_t H, int64_t W) { + return at::_ops::cudnn_affine_grid_generator_out::call(theta, N, C, H, W, out); +} +// aten::cudnn_affine_grid_generator.out(Tensor theta, int N, int C, int H, int W, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & cudnn_affine_grid_generator_outf(const at::Tensor & theta, int64_t N, int64_t C, int64_t H, int64_t W, at::Tensor & out) { + return at::_ops::cudnn_affine_grid_generator_out::call(theta, N, C, H, W, out); +} + +} diff --git a/shared/package-files/75/7564256bb869ec0e11a88d9ad2a44d40b58d3c4baeafaf250f77554f292d7415/decompogen.py b/shared/package-files/75/7564256bb869ec0e11a88d9ad2a44d40b58d3c4baeafaf250f77554f292d7415/decompogen.py new file mode 100644 index 0000000000000000000000000000000000000000..ec1b3b683511a34e6f98b9839d112b87517390d8 --- /dev/null +++ b/shared/package-files/75/7564256bb869ec0e11a88d9ad2a44d40b58d3c4baeafaf250f77554f292d7415/decompogen.py @@ -0,0 +1,126 @@ +from sympy.core import (Function, Pow, sympify, Expr) +from sympy.core.relational import Relational +from sympy.core.singleton import S +from sympy.polys import Poly, decompose +from sympy.utilities.misc import func_name +from sympy.functions.elementary.miscellaneous import Min, Max + + +def decompogen(f, symbol): + """ + Computes General functional decomposition of ``f``. + Given an expression ``f``, returns a list ``[f_1, f_2, ..., f_n]``, + where:: + f = f_1 o f_2 o ... f_n = f_1(f_2(... f_n)) + + Note: This is a General decomposition function. It also decomposes + Polynomials. For only Polynomial decomposition see ``decompose`` in polys. + + Examples + ======== + + >>> from sympy.abc import x + >>> from sympy import decompogen, sqrt, sin, cos + >>> decompogen(sin(cos(x)), x) + [sin(x), cos(x)] + >>> decompogen(sin(x)**2 + sin(x) + 1, x) + [x**2 + x + 1, sin(x)] + >>> decompogen(sqrt(6*x**2 - 5), x) + [sqrt(x), 6*x**2 - 5] + >>> decompogen(sin(sqrt(cos(x**2 + 1))), x) + [sin(x), sqrt(x), cos(x), x**2 + 1] + >>> decompogen(x**4 + 2*x**3 - x - 1, x) + [x**2 - x - 1, x**2 + x] + + """ + f = sympify(f) + if not isinstance(f, Expr) or isinstance(f, Relational): + raise TypeError('expecting Expr but got: `%s`' % func_name(f)) + if symbol not in f.free_symbols: + return [f] + + + # ===== Simple Functions ===== # + if isinstance(f, (Function, Pow)): + if f.is_Pow and f.base == S.Exp1: + arg = f.exp + else: + arg = f.args[0] + if arg == symbol: + return [f] + return [f.subs(arg, symbol)] + decompogen(arg, symbol) + + # ===== Min/Max Functions ===== # + if isinstance(f, (Min, Max)): + args = list(f.args) + d0 = None + for i, a in enumerate(args): + if not a.has_free(symbol): + continue + d = decompogen(a, symbol) + if len(d) == 1: + d = [symbol] + d + if d0 is None: + d0 = d[1:] + elif d[1:] != d0: + # decomposition is not the same for each arg: + # mark as having no decomposition + d = [symbol] + break + args[i] = d[0] + if d[0] == symbol: + return [f] + return [f.func(*args)] + d0 + + # ===== Convert to Polynomial ===== # + fp = Poly(f) + gens = list(filter(lambda x: symbol in x.free_symbols, fp.gens)) + + if len(gens) == 1 and gens[0] != symbol: + f1 = f.subs(gens[0], symbol) + f2 = gens[0] + return [f1] + decompogen(f2, symbol) + + # ===== Polynomial decompose() ====== # + try: + return decompose(f) + except ValueError: + return [f] + + +def compogen(g_s, symbol): + """ + Returns the composition of functions. + Given a list of functions ``g_s``, returns their composition ``f``, + where: + f = g_1 o g_2 o .. o g_n + + Note: This is a General composition function. It also composes Polynomials. + For only Polynomial composition see ``compose`` in polys. + + Examples + ======== + + >>> from sympy.solvers.decompogen import compogen + >>> from sympy.abc import x + >>> from sympy import sqrt, sin, cos + >>> compogen([sin(x), cos(x)], x) + sin(cos(x)) + >>> compogen([x**2 + x + 1, sin(x)], x) + sin(x)**2 + sin(x) + 1 + >>> compogen([sqrt(x), 6*x**2 - 5], x) + sqrt(6*x**2 - 5) + >>> compogen([sin(x), sqrt(x), cos(x), x**2 + 1], x) + sin(sqrt(cos(x**2 + 1))) + >>> compogen([x**2 - x - 1, x**2 + x], x) + -x**2 - x + (x**2 + x)**2 - 1 + """ + if len(g_s) == 1: + return g_s[0] + + foo = g_s[0].subs(symbol, g_s[1]) + + if len(g_s) == 2: + return foo + + return compogen([foo] + g_s[2:], symbol) diff --git a/shared/package-files/75/7568f8f50d28babe24e12182936ece4ab4e48d73e671b1021b1cbee33c1b251e/_gather_sparse_backward_ops.h b/shared/package-files/75/7568f8f50d28babe24e12182936ece4ab4e48d73e671b1021b1cbee33c1b251e/_gather_sparse_backward_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..c4d546942f8608e8f91b149cc94fa4590dfc7799 --- /dev/null +++ b/shared/package-files/75/7568f8f50d28babe24e12182936ece4ab4e48d73e671b1021b1cbee33c1b251e/_gather_sparse_backward_ops.h @@ -0,0 +1,28 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API _gather_sparse_backward { + using schema = at::Tensor (const at::Tensor &, int64_t, const at::Tensor &, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_gather_sparse_backward") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_gather_sparse_backward(Tensor self, int dim, Tensor index, Tensor grad) -> Tensor") + static at::Tensor call(const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & grad); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & grad); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/75/756c2b15e3f0f1e5f6ac185e0178b5015c6bfe0a810fadd564a7d6f3584da107/test_sample_finite_rv.py b/shared/package-files/75/756c2b15e3f0f1e5f6ac185e0178b5015c6bfe0a810fadd564a7d6f3584da107/test_sample_finite_rv.py new file mode 100644 index 0000000000000000000000000000000000000000..96cabe0ff4aaa5977e16600217fbbdeb08b962ae --- /dev/null +++ b/shared/package-files/75/756c2b15e3f0f1e5f6ac185e0178b5015c6bfe0a810fadd564a7d6f3584da107/test_sample_finite_rv.py @@ -0,0 +1,94 @@ +from sympy.core.numbers import Rational +from sympy.core.singleton import S +from sympy.external import import_module +from sympy.stats import Binomial, sample, Die, FiniteRV, DiscreteUniform, Bernoulli, BetaBinomial, Hypergeometric, \ + Rademacher +from sympy.testing.pytest import skip, raises + +def test_given_sample(): + X = Die('X', 6) + scipy = import_module('scipy') + if not scipy: + skip('Scipy is not installed. Abort tests') + assert sample(X, X > 5) == 6 + +def test_sample_numpy(): + distribs_numpy = [ + Binomial("B", 5, 0.4), + Hypergeometric("H", 2, 1, 1) + ] + size = 3 + numpy = import_module('numpy') + if not numpy: + skip('Numpy is not installed. Abort tests for _sample_numpy.') + else: + for X in distribs_numpy: + samps = sample(X, size=size, library='numpy') + for sam in samps: + assert sam in X.pspace.domain.set + raises(NotImplementedError, + lambda: sample(Die("D"), library='numpy')) + raises(NotImplementedError, + lambda: Die("D").pspace.sample(library='tensorflow')) + + +def test_sample_scipy(): + distribs_scipy = [ + FiniteRV('F', {1: S.Half, 2: Rational(1, 4), 3: Rational(1, 4)}), + DiscreteUniform("Y", list(range(5))), + Die("D"), + Bernoulli("Be", 0.3), + Binomial("Bi", 5, 0.4), + BetaBinomial("Bb", 2, 1, 1), + Hypergeometric("H", 1, 1, 1), + Rademacher("R") + ] + + size = 3 + scipy = import_module('scipy') + if not scipy: + skip('Scipy not installed. Abort tests for _sample_scipy.') + else: + for X in distribs_scipy: + samps = sample(X, size=size) + samps2 = sample(X, size=(2, 2)) + for sam in samps: + assert sam in X.pspace.domain.set + for i in range(2): + for j in range(2): + assert samps2[i][j] in X.pspace.domain.set + + +def test_sample_pymc(): + distribs_pymc = [ + Bernoulli('B', 0.2), + Binomial('N', 5, 0.4) + ] + size = 3 + pymc = import_module('pymc') + if not pymc: + skip('PyMC is not installed. Abort tests for _sample_pymc.') + else: + for X in distribs_pymc: + samps = sample(X, size=size, library='pymc') + for sam in samps: + assert sam in X.pspace.domain.set + raises(NotImplementedError, + lambda: (sample(Die("D"), library='pymc'))) + + +def test_sample_seed(): + F = FiniteRV('F', {1: S.Half, 2: Rational(1, 4), 3: Rational(1, 4)}) + size = 10 + libraries = ['scipy', 'numpy', 'pymc'] + for lib in libraries: + try: + imported_lib = import_module(lib) + if imported_lib: + s0 = sample(F, size=size, library=lib, seed=0) + s1 = sample(F, size=size, library=lib, seed=0) + s2 = sample(F, size=size, library=lib, seed=1) + assert all(s0 == s1) + assert not all(s1 == s2) + except NotImplementedError: + continue diff --git a/shared/package-files/75/756d25bc26fff3e4e8c82ae038cf96333504d4aa0596b00c0a7dc4eae296cfec/_foreach_addcmul_native.h b/shared/package-files/75/756d25bc26fff3e4e8c82ae038cf96333504d4aa0596b00c0a7dc4eae296cfec/_foreach_addcmul_native.h new file mode 100644 index 0000000000000000000000000000000000000000..828870361b20b215c4d575f82dd75c8343cdd44d --- /dev/null +++ b/shared/package-files/75/756d25bc26fff3e4e8c82ae038cf96333504d4aa0596b00c0a7dc4eae296cfec/_foreach_addcmul_native.h @@ -0,0 +1,35 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API void _foreach_addcmul_Scalar_out(at::TensorList self, at::TensorList tensor1, at::TensorList tensor2, const at::Scalar & value, at::TensorList out); +TORCH_API ::std::vector foreach_tensor_addcmul_scalar_slow(at::TensorList self, at::TensorList tensor1, at::TensorList tensor2, const at::Scalar & value=1); +TORCH_API void foreach_tensor_addcmul_scalar_slow_(at::TensorList self, at::TensorList tensor1, at::TensorList tensor2, const at::Scalar & value=1); +TORCH_API ::std::vector foreach_tensor_addcmul_scalar_cuda(at::TensorList self, at::TensorList tensor1, at::TensorList tensor2, const at::Scalar & value=1); +TORCH_API void foreach_tensor_addcmul_scalar_cuda_(at::TensorList self, at::TensorList tensor1, at::TensorList tensor2, const at::Scalar & value=1); +TORCH_API void _foreach_addcmul_ScalarList_out(at::TensorList self, at::TensorList tensor1, at::TensorList tensor2, at::ArrayRef scalars, at::TensorList out); +TORCH_API ::std::vector foreach_tensor_addcmul_scalarlist_slow(at::TensorList self, at::TensorList tensor1, at::TensorList tensor2, at::ArrayRef scalars); +TORCH_API void foreach_tensor_addcmul_scalarlist_slow_(at::TensorList self, at::TensorList tensor1, at::TensorList tensor2, at::ArrayRef scalars); +TORCH_API ::std::vector foreach_tensor_addcmul_scalarlist_cuda(at::TensorList self, at::TensorList tensor1, at::TensorList tensor2, at::ArrayRef scalars); +TORCH_API void foreach_tensor_addcmul_scalarlist_cuda_(at::TensorList self, at::TensorList tensor1, at::TensorList tensor2, at::ArrayRef scalars); +TORCH_API void _foreach_addcmul_Tensor_out(at::TensorList self, at::TensorList tensor1, at::TensorList tensor2, const at::Tensor & scalars, at::TensorList out); +TORCH_API ::std::vector foreach_tensor_addcmul_tensor_slow(at::TensorList self, at::TensorList tensor1, at::TensorList tensor2, const at::Tensor & scalars); +TORCH_API void foreach_tensor_addcmul_tensor_slow_(at::TensorList self, at::TensorList tensor1, at::TensorList tensor2, const at::Tensor & scalars); +TORCH_API ::std::vector foreach_tensor_addcmul_tensor_cuda(at::TensorList self, at::TensorList tensor1, at::TensorList tensor2, const at::Tensor & scalars); +TORCH_API void foreach_tensor_addcmul_tensor_cuda_(at::TensorList self, at::TensorList tensor1, at::TensorList tensor2, const at::Tensor & scalars); +} // namespace native +} // namespace at diff --git a/shared/package-files/75/756e457b79541cff1d9ac48f0c631b95d1a5d86967111e08f735a1094ea0ffbf/local_wrap_kms_client.h b/shared/package-files/75/756e457b79541cff1d9ac48f0c631b95d1a5d86967111e08f735a1094ea0ffbf/local_wrap_kms_client.h new file mode 100644 index 0000000000000000000000000000000000000000..607c75a4c2e8828a55a73c85c48c0551d1b72aa2 --- /dev/null +++ b/shared/package-files/75/756e457b79541cff1d9ac48f0c631b95d1a5d86967111e08f735a1094ea0ffbf/local_wrap_kms_client.h @@ -0,0 +1,95 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include +#include + +#include "arrow/util/concurrent_map.h" + +#include "parquet/encryption/kms_client.h" +#include "parquet/platform.h" + +namespace parquet::encryption { + +/// This class supports local wrapping mode, master keys will be fetched from the KMS +/// server and used to encrypt other keys (data encryption keys or key encryption keys). +class PARQUET_EXPORT LocalWrapKmsClient : public KmsClient { + public: + static constexpr const char kLocalWrapNoKeyVersion[] = "NO_VERSION"; + + explicit LocalWrapKmsClient(const KmsConnectionConfig& kms_connection_config); + + std::string WrapKey(const ::arrow::util::SecureString& key_bytes, + const std::string& master_key_identifier) override; + + ::arrow::util::SecureString UnwrapKey( + const std::string& wrapped_key, const std::string& master_key_identifier) override; + + protected: + /// Get master key from the remote KMS server. + /// Note: this function might be called by multiple threads + virtual const ::arrow::util::SecureString& GetMasterKeyFromServer( + const std::string& master_key_identifier) = 0; + + private: + /// KMS systems wrap keys by encrypting them by master keys, and attaching additional + /// information (such as the version number of the masker key) to the result of + /// encryption. The master key version is required in key rotation. Currently, the + /// local wrapping mode does not support key rotation (because not all KMS systems allow + /// to fetch a master key by its ID and version number). Still, the local wrapping mode + /// adds a placeholder for the master key version, that will enable support for key + /// rotation in this mode in the future, with appropriate KMS systems. This will also + /// enable backward compatibility, where future readers will be able to extract master + /// key version in the files written by the current code. + /// + /// LocalKeyWrap class writes (and reads) the "key wrap" as a flat json with the + /// following fields: + /// 1. "masterKeyVersion" - a String, with the master key version. In the current + /// version, only one value is allowed - "NO_VERSION". + /// 2. "encryptedKey" - a String, with the key encrypted by the master key + /// (base64-encoded). + class LocalKeyWrap { + public: + static constexpr const char kLocalWrapKeyVersionField[] = "masterKeyVersion"; + static constexpr const char kLocalWrapEncryptedKeyField[] = "encryptedKey"; + + LocalKeyWrap(std::string master_key_version, std::string encrypted_encoded_key); + + static std::string CreateSerialized(const std::string& encrypted_encoded_key); + + static LocalKeyWrap Parse(const std::string& wrapped_key); + + const std::string& master_key_version() const { return master_key_version_; } + + const std::string& encrypted_encoded_key() const { return encrypted_encoded_key_; } + + private: + std::string encrypted_encoded_key_; + std::string master_key_version_; + }; + + const ::arrow::util::SecureString& GetKeyFromServer(const std::string& key_identifier); + + protected: + KmsConnectionConfig kms_connection_config_; + ::arrow::util::ConcurrentMap + master_key_cache_; +}; + +} // namespace parquet::encryption diff --git a/shared/package-files/75/75708fb4b8867d0f41da983fb3f60aedfbd6c145be09b54e3d8527f69685a2c9/test_timezones.py b/shared/package-files/75/75708fb4b8867d0f41da983fb3f60aedfbd6c145be09b54e3d8527f69685a2c9/test_timezones.py new file mode 100644 index 0000000000000000000000000000000000000000..cb2a35be907cdca8d6777b708623c50288d6cca7 --- /dev/null +++ b/shared/package-files/75/75708fb4b8867d0f41da983fb3f60aedfbd6c145be09b54e3d8527f69685a2c9/test_timezones.py @@ -0,0 +1,24 @@ +""" +Tests for Timestamp timezone-related methods +""" +from datetime import datetime + +from pandas._libs.tslibs import timezones + +from pandas import Timestamp + + +class TestTimestampTZOperations: + # ------------------------------------------------------------------ + + def test_timestamp_timetz_equivalent_with_datetime_tz(self, tz_naive_fixture): + # GH21358 + tz = timezones.maybe_get_tz(tz_naive_fixture) + + stamp = Timestamp("2018-06-04 10:20:30", tz=tz) + _datetime = datetime(2018, 6, 4, hour=10, minute=20, second=30, tzinfo=tz) + + result = stamp.timetz() + expected = _datetime.timetz() + + assert result == expected diff --git a/shared/package-files/75/7570ac0189fb699b968b972919463dfcf09cf16f458e05cadd9927a97e90f78a/rbcomm b/shared/package-files/75/7570ac0189fb699b968b972919463dfcf09cf16f458e05cadd9927a97e90f78a/rbcomm new file mode 100644 index 0000000000000000000000000000000000000000..2f5cd2939de25682e63c588b16a18f6ebd0ede0f Binary files /dev/null and b/shared/package-files/75/7570ac0189fb699b968b972919463dfcf09cf16f458e05cadd9927a97e90f78a/rbcomm differ diff --git a/shared/package-files/75/75732a474b99b4da1ffaf3818e50bb4c12527ae498f91c3881e47b4cc2d8ba80/CUDACachingAllocator.h b/shared/package-files/75/75732a474b99b4da1ffaf3818e50bb4c12527ae498f91c3881e47b4cc2d8ba80/CUDACachingAllocator.h new file mode 100644 index 0000000000000000000000000000000000000000..7f83db3796b41443700d604e4103755b0f9043e4 --- /dev/null +++ b/shared/package-files/75/75732a474b99b4da1ffaf3818e50bb4c12527ae498f91c3881e47b4cc2d8ba80/CUDACachingAllocator.h @@ -0,0 +1,481 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace c10 { + +// Caching allocator will execute every registered callback if it unable to find +// block inside of already allocated area. +class C10_CUDA_API FreeMemoryCallback { + public: + virtual ~FreeMemoryCallback() = default; + virtual bool Execute() = 0; +}; + +C10_DECLARE_REGISTRY(FreeCudaMemoryCallbacksRegistry, FreeMemoryCallback); +#define REGISTER_FREE_MEMORY_CALLBACK(name, ...) \ + C10_REGISTER_CLASS(FreeCudaMemoryCallbacksRegistry, name, __VA_ARGS__); +} // namespace c10 + // +// TODO: Turn this into an honest to goodness class. I briefly attempted to do +// this, but it was a bit irritating to figure out how to also correctly +// apply pimpl pattern so I didn't have to leak any internal implementation +// details in the header (CUDACachingAllocator could be made a pimpl, but +// you also need to appropriately define a class which is a subclass +// of Allocator. Not impossible, but required a bit more surgery than +// I wanted to do at the time.) +// +// Why is this using a namespace rather than old-style THCCachingAllocator_ +// prefix? Mostly because it made the HIPify rules easier to write; _ is +// not counted as a word boundary, so you would otherwise have to list each +// of these functions. + +namespace c10::cuda::CUDACachingAllocator { + +extern const size_t kLargeBuffer; + +struct Stat { + int64_t current = 0; + int64_t peak = 0; + int64_t allocated = 0; + int64_t freed = 0; +}; + +enum struct StatType : uint64_t { + AGGREGATE = 0, + SMALL_POOL = 1, + LARGE_POOL = 2, + NUM_TYPES = 3 // remember to update this whenever a new stat type is added +}; + +typedef std::array(StatType::NUM_TYPES)> StatArray; + +// Struct containing memory allocator summary statistics for a device. +struct DeviceStats { + // COUNT: allocations requested by client code + StatArray allocation; + // COUNT: number of allocated segments from cudaMalloc(). + StatArray segment; + // COUNT: number of active memory blocks (allocated or used by stream) + StatArray active; + // COUNT: number of inactive, split memory blocks (unallocated but can't be + // released via cudaFree) + StatArray inactive_split; + + // SUM: bytes allocated by this memory alocator + StatArray allocated_bytes; + // SUM: bytes reserved by this memory allocator (both free and used) + StatArray reserved_bytes; + // SUM: bytes within active memory blocks + StatArray active_bytes; + // SUM: bytes within inactive, split memory blocks + StatArray inactive_split_bytes; + // SUM: bytes requested by client code + StatArray requested_bytes; + + // COUNT: total number of failed calls to CUDA malloc necessitating cache + // flushes. + int64_t num_alloc_retries = 0; + + // COUNT: total number of OOMs (i.e. failed calls to CUDA after cache flush) + int64_t num_ooms = 0; + + // COUNT: total number of oversize blocks allocated from pool + Stat oversize_allocations; + + // COUNT: total number of oversize blocks requiring malloc + Stat oversize_segments; + + // COUNT: total number of synchronize_and_free_events() calls + int64_t num_sync_all_streams = 0; + + // COUNT: total number of CUDA allocation calls. This includes both cuMemMap + // and cudaMalloc. + int64_t num_device_alloc = 0; + + // COUNT: total number of CUDA free calls. This includes both cuMemUnmap + // and cudaFree. + int64_t num_device_free = 0; + + // SIZE: maximum block size that is allowed to be split. + int64_t max_split_size = 0; +}; + +typedef std::shared_ptr (*CreateContextFn)(); + +// Struct containing info of an allocation block (i.e. a fractional part of a +// cudaMalloc).. +struct BlockInfo { + int64_t size = 0; + int64_t requested_size = 0; + int32_t gc_counter = 0; + bool allocated = false; + bool active = false; + std::shared_ptr + context_when_allocated; // per-watcher context +}; + +// Struct containing info of a memory segment (i.e. one contiguous cudaMalloc). +struct SegmentInfo { + c10::DeviceIndex device = 0; + int64_t address = 0; + int64_t total_size = 0; + int64_t requested_size = 0; // unrounded, actually requested size + int64_t allocated_size = 0; + int64_t active_size = 0; + cudaStream_t stream = nullptr; + bool is_large = false; + bool is_expandable = false; + MempoolId_t owner_private_pool_id = {0, 0}; + std::vector blocks; + std::shared_ptr context_when_allocated; +}; + +struct AllocatorState { + virtual ~AllocatorState() = default; +}; + +union trace_time_ { + time_t t_; + approx_time_t approx_t_; +}; + +struct TraceEntry { + enum Action { + ALLOC, // API made to the caching allocator for new memory + FREE_REQUESTED, // API call made to the caching allocator to free memory + FREE_COMPLETED, // The allocator might have to delay a free because + // it is still in use on another stream via record_stream + // This event is generated when a free actually completes. + SEGMENT_ALLOC, // a call to cudaMalloc to get more memory from the OS + SEGMENT_FREE, // a call to cudaFree to return memory to the OS (e.g. to + // defragment or empty_caches) + SEGMENT_MAP, // a call to cuMemMap (used with expandable_segments) + SEGMENT_UNMAP, // unmap part of a segment (used with expandable segments) + SNAPSHOT, // a call to snapshot, used to correlate memory snapshots to trace + // events + OOM // the allocator threw an OutOfMemoryError (addr_ is the amount of free + // bytes reported by cuda) + }; + TraceEntry( + Action action, + c10::DeviceIndex device, + int64_t addr, + size_t size, + cudaStream_t stream, + approx_time_t time, + std::shared_ptr context = nullptr) + : action_(action), + device_(device), + addr_(addr), + context_(std::move(context)), + stream_(stream), + size_(static_cast(size)) { + time_.approx_t_ = time; + } + Action action_; + c10::DeviceIndex device_; + int64_t addr_; // for OOM, this is the amount of free bytes reported by cuda + std::shared_ptr context_; + cudaStream_t stream_{}; + int64_t size_; + trace_time_ time_{}; +}; + +struct AllocatorConfigInfo { + double garbage_collection_threshold; + size_t max_split_size; + size_t pinned_num_register_threads; + bool expandable_segments; + bool release_lock_on_malloc; + bool pinned_use_host_register; + std::string last_allocator_settings; + std::vector roundup_power2_divisions; +}; + +struct SnapshotInfo { + std::vector segments; + std::vector> device_traces; + AllocatorConfigInfo config_metadata; +}; + +// returns the pointers freed in the pool +// and the pointers allocated. Note: a pointer +// may appear in both freed and allocated +struct CheckpointDelta { + std::vector ptrs_freed; + std::vector dataptrs_allocd; +}; + +enum struct RecordContext { + NEVER = 0, + STATE = 1, // only keep stacks for active allocations + ALLOC = 2, // additionally keep stacks for allocations in the trace history + ALL = 3, // additionally record stacks for when something is freed +}; + +// Size pretty-printer +std::string format_size(uint64_t size); + +using OutOfMemoryObserver = std::function; + +using AllocatorTraceTracker = std::function; + +class CUDAAllocator : public Allocator { + public: + virtual void* raw_alloc(size_t nbytes) = 0; + virtual void* raw_alloc_with_stream(size_t nbytes, cudaStream_t stream) = 0; + virtual void raw_delete(void* ptr) = 0; + virtual void init(int device_count) = 0; + virtual bool initialized() = 0; + virtual void setMemoryFraction(double fraction, c10::DeviceIndex device) = 0; + virtual void emptyCache() = 0; + virtual void cacheInfo(c10::DeviceIndex device, size_t* largestBlock) = 0; + virtual void* getBaseAllocation(void* ptr, size_t* size) = 0; + virtual void recordStream(const DataPtr&, CUDAStream stream) = 0; + virtual DeviceStats getDeviceStats(c10::DeviceIndex device) = 0; + virtual void resetAccumulatedStats(c10::DeviceIndex device) = 0; + virtual void resetPeakStats(c10::DeviceIndex device) = 0; + virtual SnapshotInfo snapshot() = 0; + virtual void beginAllocateToPool( + c10::DeviceIndex device, + MempoolId_t mempool_id, + std::function filter) = 0; + virtual void endAllocateToPool( + c10::DeviceIndex device, + MempoolId_t mempool_id) = 0; + virtual void releasePool(c10::DeviceIndex device, MempoolId_t mempool_id) = 0; + // returns true if the allocated blocks are equal to expected live allocations + virtual bool checkPoolLiveAllocations( + c10::DeviceIndex device, + MempoolId_t mempool_id, + const std::unordered_set& expected_live_allocations) { + TORCH_CHECK( + false, + name(), + " does not yet support checkPoolLiveAllocations. " + "If you need it, please file an issue describing your use case."); + } + virtual std::shared_ptr getIpcDevPtr(std::string handle) = 0; + virtual bool isHistoryEnabled() { + TORCH_CHECK( + false, + name(), + " does not yet support recordHistory. " + "If you need it, please file an issue describing your use case."); + } + virtual void recordHistory( + bool enabled, + CreateContextFn context_recorder, + size_t alloc_trace_max_entries, + RecordContext when) = 0; + virtual void attachOutOfMemoryObserver(OutOfMemoryObserver observer) = 0; + + // Attached AllocatorTraceTracker callbacks will be called while the + // per-device allocator lock is held. Any additional locks taken from within + // the callback must be proven to always have the lock order that never + // triggers a deadlock. In particular, Python's GIL may be held when + // calling the allocator so it is unsafe to try to acquire the GIL in this + // callback. + virtual void attachAllocatorTraceTracker(AllocatorTraceTracker tracker) = 0; + + virtual void enablePeerAccess( + c10::DeviceIndex dev, + c10::DeviceIndex dev_to_access) = 0; + + // memory not allocated from cudaMalloc cannot be copied + // across devices using cudaMemcpyAsync if peer to peer access is disabled. + // instead it requires cudaMemcpyAsyncPeer + // with P2P Enabled, all combinations work + // with P2P Disabled: + // cudaMalloc cudaMallocAsync/cuMemMap + // cudaMemcpyAsyncPeer works works + // cudaMemcpyAsync works error + + // This function performs chooses to use the Peer version of + // memcpy if required based on where the allocated put dst/src. + virtual cudaError_t memcpyAsync( + void* dst, + int dstDevice, + const void* src, + int srcDevice, + size_t count, + cudaStream_t stream, + bool p2p_enabled) = 0; + virtual std::shared_ptr getCheckpointState( + c10::DeviceIndex device, + MempoolId_t id) = 0; + virtual CheckpointDelta setCheckpointPoolState( + c10::DeviceIndex device, + std::shared_ptr pps) = 0; + virtual std::string name() = 0; +}; + +// Allocator object, statically initialized +// See BackendInitializer in CUDACachingAllocator.cpp. +// Atomic loads on x86 are just normal loads, +// (atomic stores are different), so reading this value +// is no different than loading a pointer. +C10_CUDA_API extern std::atomic allocator; + +inline CUDAAllocator* get() { + return allocator.load(); +} + +// Called directly by clients. +inline void* raw_alloc(size_t nbytes) { + return get()->raw_alloc(nbytes); +} + +inline void* raw_alloc_with_stream(size_t nbytes, cudaStream_t stream) { + return get()->raw_alloc_with_stream(nbytes, stream); +} + +inline void raw_delete(void* ptr) { + return get()->raw_delete(ptr); +} + +inline void init(int device_count) { + return get()->init(device_count); +} + +inline void setMemoryFraction(double fraction, c10::DeviceIndex device) { + return get()->setMemoryFraction(fraction, device); +} + +inline void emptyCache() { + return get()->emptyCache(); +} + +inline void cacheInfo(c10::DeviceIndex device, size_t* largestBlock) { + return get()->cacheInfo(device, largestBlock); +} + +inline void* getBaseAllocation(void* ptr, size_t* size) { + return get()->getBaseAllocation(ptr, size); +} + +inline void recordStream(const DataPtr& dataPtr, CUDAStream stream) { + return get()->recordStream(dataPtr, stream); +} + +inline DeviceStats getDeviceStats(c10::DeviceIndex device) { + return get()->getDeviceStats(device); +} + +inline void resetAccumulatedStats(c10::DeviceIndex device) { + return get()->resetAccumulatedStats(device); +} + +inline void resetPeakStats(c10::DeviceIndex device) { + return get()->resetPeakStats(device); +} + +inline SnapshotInfo snapshot() { + return get()->snapshot(); +} + +inline std::shared_ptr getCheckpointState( + c10::DeviceIndex device, + MempoolId_t id) { + return get()->getCheckpointState(device, id); +} + +inline CheckpointDelta setCheckpointPoolState( + c10::DeviceIndex device, + std::shared_ptr pps) { + return get()->setCheckpointPoolState(device, std::move(pps)); +} + +// CUDAGraph interactions +inline void beginAllocateToPool( + c10::DeviceIndex device, + MempoolId_t mempool_id, + std::function filter) { + get()->beginAllocateToPool(device, mempool_id, std::move(filter)); +} + +inline void endAllocateToPool(c10::DeviceIndex device, MempoolId_t mempool_id) { + get()->endAllocateToPool(device, mempool_id); +} + +inline void recordHistory( + bool enabled, + CreateContextFn context_recorder, + size_t alloc_trace_max_entries, + RecordContext when) { + return get()->recordHistory( + enabled, context_recorder, alloc_trace_max_entries, when); +} + +inline bool isHistoryEnabled() { + return get()->isHistoryEnabled(); +} + +inline bool checkPoolLiveAllocations( + c10::DeviceIndex device, + MempoolId_t mempool_id, + const std::unordered_set& expected_live_allocations) { + return get()->checkPoolLiveAllocations( + device, mempool_id, expected_live_allocations); +} + +inline void attachOutOfMemoryObserver(OutOfMemoryObserver observer) { + return get()->attachOutOfMemoryObserver(std::move(observer)); +} + +inline void attachAllocatorTraceTracker(AllocatorTraceTracker tracker) { + return get()->attachAllocatorTraceTracker(std::move(tracker)); +} + +inline void releasePool(c10::DeviceIndex device, MempoolId_t mempool_id) { + return get()->releasePool(device, mempool_id); +} +// Not part of CUDA_ALLOCATOR_BACKEND_INTERFACE +inline std::shared_ptr getIpcDevPtr(std::string handle) { + return get()->getIpcDevPtr(std::move(handle)); +} + +inline std::string name() { + return get()->name(); +} + +inline cudaError_t memcpyAsync( + void* dst, + int dstDevice, + const void* src, + int srcDevice, + size_t count, + cudaStream_t stream, + bool p2p_enabled) { + return get()->memcpyAsync( + dst, dstDevice, src, srcDevice, count, stream, p2p_enabled); +} + +inline void enablePeerAccess( + c10::DeviceIndex dev, + c10::DeviceIndex dev_to_access) { + return get()->enablePeerAccess(dev, dev_to_access); +} + +} // namespace c10::cuda::CUDACachingAllocator diff --git a/shared/package-files/75/757338c2147c00fc0cab3d2b8ef15a75eb7139fe290209cfa8c4f0aee7ca48ef/symbolic_shape_analysis.h b/shared/package-files/75/757338c2147c00fc0cab3d2b8ef15a75eb7139fe290209cfa8c4f0aee7ca48ef/symbolic_shape_analysis.h new file mode 100644 index 0000000000000000000000000000000000000000..824740792aaf031a0adcc181cb84a666ef539fe4 --- /dev/null +++ b/shared/package-files/75/757338c2147c00fc0cab3d2b8ef15a75eb7139fe290209cfa8c4f0aee7ca48ef/symbolic_shape_analysis.h @@ -0,0 +1,58 @@ +#pragma once + +#include +#include +#include +#include +#include + +namespace torch { +namespace jit { + +// CAUTION NOT TO BE USED, STILL A WIP, NOT STABLE + +TORCH_API void PropagateShapesOnGraph(std::shared_ptr& graph); + +// CAUTION NOT TO BE USED, STILL A WIP, NOT STABLE +// From [beg, end) attempt to propagate shapes and +// build up a graph that will compute all remaining symbolic +// shapes in [beg, end) that can be executed before beg + +struct ShapeComputeGraphMapping { + ShapeComputeGraphMapping( + std::shared_ptr partial_eval_shape_graph, + std::unordered_map + enclosing_graph_value_to_shape_graph_input, + std::unordered_map graph_output_to_symbolic_shape_dim) + : partial_eval_shape_graph(std::move(partial_eval_shape_graph)), + enclosing_graph_value_to_shape_graph_input_( + std::move(enclosing_graph_value_to_shape_graph_input)), + graph_output_to_symbolic_shape_dim_( + std::move(graph_output_to_symbolic_shape_dim)){}; + + std::shared_ptr partial_eval_shape_graph; + std::unordered_map + enclosing_graph_value_to_shape_graph_input_; + std::unordered_map graph_output_to_symbolic_shape_dim_; +}; + +TORCH_API c10::optional +PropagateShapesAndBuildLargeShapeComputeGraph( + std::shared_ptr& graph, + Node* beg, + Node* end); + +// don't insert complete tensor shapes in shape compute graphs and instead +// rely on our partial evaluation pipeline to propagate information. +// this is a good proxy for our ability to propagate non-complete shape +// information. +TORCH_API bool setSymbolicShapeAnalysisTestMode(bool value); +TORCH_API bool symbolicShapeAnalysisTestModeEnabled(); + +using SSAInput = std::variant; +TORCH_API c10::optional> +calculateSymbolicShapesOnOp( + const FunctionSchema* schema, + const std::vector& inputs); +} // namespace jit +} // namespace torch diff --git a/shared/package-files/75/7573581dec27e90b0c7d34057d9f4ef89727317d55f2c4e0428a47740fb1eb7a/de_be.msg b/shared/package-files/75/7573581dec27e90b0c7d34057d9f4ef89727317d55f2c4e0428a47740fb1eb7a/de_be.msg new file mode 100644 index 0000000000000000000000000000000000000000..3614763a3c35bf0e54c0dc47ed564f8c1b499ca1 --- /dev/null +++ b/shared/package-files/75/7573581dec27e90b0c7d34057d9f4ef89727317d55f2c4e0428a47740fb1eb7a/de_be.msg @@ -0,0 +1,53 @@ +# created by tools/loadICU.tcl -- do not edit +namespace eval ::tcl::clock { + ::msgcat::mcset de_BE DAYS_OF_WEEK_ABBREV [list \ + "Son"\ + "Mon"\ + "Die"\ + "Mit"\ + "Don"\ + "Fre"\ + "Sam"] + ::msgcat::mcset de_BE DAYS_OF_WEEK_FULL [list \ + "Sonntag"\ + "Montag"\ + "Dienstag"\ + "Mittwoch"\ + "Donnerstag"\ + "Freitag"\ + "Samstag"] + ::msgcat::mcset de_BE MONTHS_ABBREV [list \ + "Jan"\ + "Feb"\ + "M\u00e4r"\ + "Apr"\ + "Mai"\ + "Jun"\ + "Jul"\ + "Aug"\ + "Sep"\ + "Okt"\ + "Nov"\ + "Dez"\ + ""] + ::msgcat::mcset de_BE MONTHS_FULL [list \ + "Januar"\ + "Februar"\ + "M\u00e4rz"\ + "April"\ + "Mai"\ + "Juni"\ + "Juli"\ + "August"\ + "September"\ + "Oktober"\ + "November"\ + "Dezember"\ + ""] + ::msgcat::mcset de_BE AM "vorm" + ::msgcat::mcset de_BE PM "nachm" + ::msgcat::mcset de_BE DATE_FORMAT "%Y-%m-%d" + ::msgcat::mcset de_BE TIME_FORMAT "%T" + ::msgcat::mcset de_BE TIME_FORMAT_12 "%T" + ::msgcat::mcset de_BE DATE_TIME_FORMAT "%a %d %b %Y %T %z" +} diff --git a/shared/package-files/75/75741fcd550c3fd39c07a88abf9ca8d462c4c05077809e3ca61220a3837e78cd/setup.py b/shared/package-files/75/75741fcd550c3fd39c07a88abf9ca8d462c4c05077809e3ca61220a3837e78cd/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..b58e867a133f804fbaf0d31099258a11e29058aa --- /dev/null +++ b/shared/package-files/75/75741fcd550c3fd39c07a88abf9ca8d462c4c05077809e3ca61220a3837e78cd/setup.py @@ -0,0 +1,10 @@ +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + config = Configuration('polynomial', parent_package, top_path) + config.add_subpackage('tests') + config.add_data_files('*.pyi') + return config + +if __name__ == '__main__': + from numpy.distutils.core import setup + setup(configuration=configuration) diff --git a/shared/package-files/75/7574ab15cf4a698f3e46f700fba0541eeee1eaacbd4f6ea3819081d952fd88a6/ir_builder.h b/shared/package-files/75/7574ab15cf4a698f3e46f700fba0541eeee1eaacbd4f6ea3819081d952fd88a6/ir_builder.h new file mode 100644 index 0000000000000000000000000000000000000000..1f32a3521ba8a58e73ff83abaa71c034799b2941 --- /dev/null +++ b/shared/package-files/75/7574ab15cf4a698f3e46f700fba0541eeee1eaacbd4f6ea3819081d952fd88a6/ir_builder.h @@ -0,0 +1,71 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace torch { +namespace lazy { + +struct TorchScriptIrBuilder : IrBuilder { + NodePtr MakeDeviceData( + const std::shared_ptr& data) const override { + return DeviceData::Create(data); + } + // TODO: Scalar node is not currently used by ts_backend. Enable reusing + // Scalar node later if needed. + NodePtr MakeScalar(const at::Scalar& value, const at::ScalarType& type) + const override { + return MakeNode(value, type); + } + NodePtr MakeExpand( + const Value& input0, + const std::vector& size, + const bool& is_scalar_expand) const override { + return ReuseOrMakeNode(input0, size, is_scalar_expand); + } + NodePtr MakeCast( + const Value& input0, + const at::ScalarType& dtype, + const c10::optional& stype = + c10::nullopt) const override { + return ReuseOrMakeNode(input0, dtype, stype); + } + NodePtr MakeTensorList(const OpList& inputs) const override { + return ReuseOrMakeNode(inputs); + } + // Generic needs cleanup + NodePtr MakeGeneric( + const OpKind& op, + const OpList& operands, + const Shape& shape, + const size_t& num_outputs = 1, + const hash_t& hash_seed = + static_cast(0x5a2d296e9)) const override { + return MakeNode(op, operands, shape, num_outputs, hash_seed); + } + + // dynamic ir nodes + // TODO: verify if IR node reusing works for Dynamic shape ops + NodePtr MakeSizeNode(const Value& input, size_t dim) const override { + return MakeNode(input, dim); + } + NodePtr MakeSizeAdd(const Value& a, const Value& b) const override { + return MakeNode(a, b); + } + NodePtr MakeSizeMul(const Value& a, const Value& b) const override { + return MakeNode(a, b); + } + NodePtr MakeSizeDiv(const Value& a, const Value& b) const override { + return MakeNode(a, b); + } +}; + +} // namespace lazy +} // namespace torch diff --git a/shared/package-files/75/75750b90fe67dacc2cba93f52a5709f81f5c319752d9b08b2c2a31738be00f90/linalg_inv_ops.h b/shared/package-files/75/75750b90fe67dacc2cba93f52a5709f81f5c319752d9b08b2c2a31738be00f90/linalg_inv_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..b6327ea0294cb9d1834af9ac0b19a6f522fab99b --- /dev/null +++ b/shared/package-files/75/75750b90fe67dacc2cba93f52a5709f81f5c319752d9b08b2c2a31738be00f90/linalg_inv_ops.h @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API linalg_inv { + using schema = at::Tensor (const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::linalg_inv") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "linalg_inv(Tensor A) -> Tensor") + static at::Tensor call(const at::Tensor & A); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & A); +}; + +struct TORCH_API linalg_inv_out { + using schema = at::Tensor & (const at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::linalg_inv") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "linalg_inv.out(Tensor A, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & A, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & A, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/75/757848512824db5273b6c7f176bb0d5aae347d039584f2e6316450a1ccbfab73/invalid_arguments.h b/shared/package-files/75/757848512824db5273b6c7f176bb0d5aae347d039584f2e6316450a1ccbfab73/invalid_arguments.h new file mode 100644 index 0000000000000000000000000000000000000000..fecf93225e76b9a67f4022da81708ffdbff94097 --- /dev/null +++ b/shared/package-files/75/757848512824db5273b6c7f176bb0d5aae347d039584f2e6316450a1ccbfab73/invalid_arguments.h @@ -0,0 +1,15 @@ +#pragma once + +#include +#include +#include + +namespace torch { + +std::string format_invalid_args( + PyObject* given_args, + PyObject* given_kwargs, + const std::string& function_name, + const std::vector& options); + +} // namespace torch diff --git a/shared/package-files/75/7579a3868cd7e58cdbec3b2bb5b7454ea0318bd675519349bc6c63faf1ccedc3/test_distributedmodules.py b/shared/package-files/75/7579a3868cd7e58cdbec3b2bb5b7454ea0318bd675519349bc6c63faf1ccedc3/test_distributedmodules.py new file mode 100644 index 0000000000000000000000000000000000000000..c95672f99f878f3def660aadec901afbde9adf8b --- /dev/null +++ b/shared/package-files/75/7579a3868cd7e58cdbec3b2bb5b7454ea0318bd675519349bc6c63faf1ccedc3/test_distributedmodules.py @@ -0,0 +1,208 @@ +"""Tests for sparse distributed modules. """ + +from sympy.polys.distributedmodules import ( + sdm_monomial_mul, sdm_monomial_deg, sdm_monomial_divides, + sdm_add, sdm_LM, sdm_LT, sdm_mul_term, sdm_zero, sdm_deg, + sdm_LC, sdm_from_dict, + sdm_spoly, sdm_ecart, sdm_nf_mora, sdm_groebner, + sdm_from_vector, sdm_to_vector, sdm_monomial_lcm +) + +from sympy.polys.orderings import lex, grlex, InverseOrder +from sympy.polys.domains import QQ + +from sympy.abc import x, y, z + + +def test_sdm_monomial_mul(): + assert sdm_monomial_mul((1, 1, 0), (1, 3)) == (1, 2, 3) + + +def test_sdm_monomial_deg(): + assert sdm_monomial_deg((5, 2, 1)) == 3 + + +def test_sdm_monomial_lcm(): + assert sdm_monomial_lcm((1, 2, 3), (1, 5, 0)) == (1, 5, 3) + + +def test_sdm_monomial_divides(): + assert sdm_monomial_divides((1, 0, 0), (1, 0, 0)) is True + assert sdm_monomial_divides((1, 0, 0), (1, 2, 1)) is True + assert sdm_monomial_divides((5, 1, 1), (5, 2, 1)) is True + + assert sdm_monomial_divides((1, 0, 0), (2, 0, 0)) is False + assert sdm_monomial_divides((1, 1, 0), (1, 0, 0)) is False + assert sdm_monomial_divides((5, 1, 2), (5, 0, 1)) is False + + +def test_sdm_LC(): + assert sdm_LC([((1, 2, 3), QQ(5))], QQ) == QQ(5) + + +def test_sdm_from_dict(): + dic = {(1, 2, 1, 1): QQ(1), (1, 1, 2, 1): QQ(1), (1, 0, 2, 1): QQ(1), + (1, 0, 0, 3): QQ(1), (1, 1, 1, 0): QQ(1)} + assert sdm_from_dict(dic, grlex) == \ + [((1, 2, 1, 1), QQ(1)), ((1, 1, 2, 1), QQ(1)), + ((1, 0, 2, 1), QQ(1)), ((1, 0, 0, 3), QQ(1)), ((1, 1, 1, 0), QQ(1))] + +# TODO test to_dict? + + +def test_sdm_add(): + assert sdm_add([((1, 1, 1), QQ(1))], [((2, 0, 0), QQ(1))], lex, QQ) == \ + [((2, 0, 0), QQ(1)), ((1, 1, 1), QQ(1))] + assert sdm_add([((1, 1, 1), QQ(1))], [((1, 1, 1), QQ(-1))], lex, QQ) == [] + assert sdm_add([((1, 0, 0), QQ(1))], [((1, 0, 0), QQ(2))], lex, QQ) == \ + [((1, 0, 0), QQ(3))] + assert sdm_add([((1, 0, 1), QQ(1))], [((1, 1, 0), QQ(1))], lex, QQ) == \ + [((1, 1, 0), QQ(1)), ((1, 0, 1), QQ(1))] + + +def test_sdm_LM(): + dic = {(1, 2, 3): QQ(1), (4, 0, 0): QQ(1), (4, 0, 1): QQ(1)} + assert sdm_LM(sdm_from_dict(dic, lex)) == (4, 0, 1) + + +def test_sdm_LT(): + dic = {(1, 2, 3): QQ(1), (4, 0, 0): QQ(2), (4, 0, 1): QQ(3)} + assert sdm_LT(sdm_from_dict(dic, lex)) == ((4, 0, 1), QQ(3)) + + +def test_sdm_mul_term(): + assert sdm_mul_term([((1, 0, 0), QQ(1))], ((0, 0), QQ(0)), lex, QQ) == [] + assert sdm_mul_term([], ((1, 0), QQ(1)), lex, QQ) == [] + assert sdm_mul_term([((1, 0, 0), QQ(1))], ((1, 0), QQ(1)), lex, QQ) == \ + [((1, 1, 0), QQ(1))] + f = [((2, 0, 1), QQ(4)), ((1, 1, 0), QQ(3))] + assert sdm_mul_term(f, ((1, 1), QQ(2)), lex, QQ) == \ + [((2, 1, 2), QQ(8)), ((1, 2, 1), QQ(6))] + + +def test_sdm_zero(): + assert sdm_zero() == [] + + +def test_sdm_deg(): + assert sdm_deg([((1, 2, 3), 1), ((10, 0, 1), 1), ((2, 3, 4), 4)]) == 7 + + +def test_sdm_spoly(): + f = [((2, 1, 1), QQ(1)), ((1, 0, 1), QQ(1))] + g = [((2, 3, 0), QQ(1))] + h = [((1, 2, 3), QQ(1))] + assert sdm_spoly(f, h, lex, QQ) == [] + assert sdm_spoly(f, g, lex, QQ) == [((1, 2, 1), QQ(1))] + + +def test_sdm_ecart(): + assert sdm_ecart([((1, 2, 3), 1), ((1, 0, 1), 1)]) == 0 + assert sdm_ecart([((2, 2, 1), 1), ((1, 5, 1), 1)]) == 3 + + +def test_sdm_nf_mora(): + f = sdm_from_dict({(1, 2, 1, 1): QQ(1), (1, 1, 2, 1): QQ(1), + (1, 0, 2, 1): QQ(1), (1, 0, 0, 3): QQ(1), (1, 1, 1, 0): QQ(1)}, + grlex) + f1 = sdm_from_dict({(1, 1, 1, 0): QQ(1), (1, 0, 2, 0): QQ(1), + (1, 0, 0, 0): QQ(-1)}, grlex) + f2 = sdm_from_dict({(1, 1, 1, 0): QQ(1)}, grlex) + (id0, id1, id2) = [sdm_from_dict({(i, 0, 0, 0): QQ(1)}, grlex) + for i in range(3)] + + assert sdm_nf_mora(f, [f1, f2], grlex, QQ, phantom=(id0, [id1, id2])) == \ + ([((1, 0, 2, 1), QQ(1)), ((1, 0, 0, 3), QQ(1)), ((1, 1, 1, 0), QQ(1)), + ((1, 1, 0, 1), QQ(1))], + [((1, 1, 0, 1), QQ(-1)), ((0, 0, 0, 0), QQ(1))]) + assert sdm_nf_mora(f, [f2, f1], grlex, QQ, phantom=(id0, [id2, id1])) == \ + ([((1, 0, 2, 1), QQ(1)), ((1, 0, 0, 3), QQ(1)), ((1, 1, 1, 0), QQ(1))], + [((2, 1, 0, 1), QQ(-1)), ((2, 0, 1, 1), QQ(-1)), ((0, 0, 0, 0), QQ(1))]) + + f = sdm_from_vector([x*z, y**2 + y*z - z, y], lex, QQ, gens=[x, y, z]) + f1 = sdm_from_vector([x, y, 1], lex, QQ, gens=[x, y, z]) + f2 = sdm_from_vector([x*y, z, z**2], lex, QQ, gens=[x, y, z]) + assert sdm_nf_mora(f, [f1, f2], lex, QQ) == \ + sdm_nf_mora(f, [f2, f1], lex, QQ) == \ + [((1, 0, 1, 1), QQ(1)), ((1, 0, 0, 1), QQ(-1)), ((0, 1, 1, 0), QQ(-1)), + ((0, 1, 0, 1), QQ(1))] + + +def test_conversion(): + f = [x**2 + y**2, 2*z] + g = [((1, 0, 0, 1), QQ(2)), ((0, 2, 0, 0), QQ(1)), ((0, 0, 2, 0), QQ(1))] + assert sdm_to_vector(g, [x, y, z], QQ) == f + assert sdm_from_vector(f, lex, QQ) == g + assert sdm_from_vector( + [x, 1], lex, QQ) == [((1, 0), QQ(1)), ((0, 1), QQ(1))] + assert sdm_to_vector([((1, 1, 0, 0), 1)], [x, y, z], QQ, n=3) == [0, x, 0] + assert sdm_from_vector([0, 0], lex, QQ, gens=[x, y]) == sdm_zero() + + +def test_nontrivial(): + gens = [x, y, z] + + def contains(I, f): + S = [sdm_from_vector([g], lex, QQ, gens=gens) for g in I] + G = sdm_groebner(S, sdm_nf_mora, lex, QQ) + return sdm_nf_mora(sdm_from_vector([f], lex, QQ, gens=gens), + G, lex, QQ) == sdm_zero() + + assert contains([x, y], x) + assert contains([x, y], x + y) + assert not contains([x, y], 1) + assert not contains([x, y], z) + assert contains([x**2 + y, x**2 + x], x - y) + assert not contains([x + y + z, x*y + x*z + y*z, x*y*z], x**2) + assert contains([x + y + z, x*y + x*z + y*z, x*y*z], x**3) + assert contains([x + y + z, x*y + x*z + y*z, x*y*z], x**4) + assert not contains([x + y + z, x*y + x*z + y*z, x*y*z], x*y**2) + assert contains([x + y + z, x*y + x*z + y*z, x*y*z], x**4 + y**3 + 2*z*y*x) + assert contains([x + y + z, x*y + x*z + y*z, x*y*z], x*y*z) + assert contains([x, 1 + x + y, 5 - 7*y], 1) + assert contains( + [x**3 + y**3, y**3 + z**3, z**3 + x**3, x**2*y + x**2*z + y**2*z], + x**3) + assert not contains( + [x**3 + y**3, y**3 + z**3, z**3 + x**3, x**2*y + x**2*z + y**2*z], + x**2 + y**2) + + # compare local order + assert not contains([x*(1 + x + y), y*(1 + z)], x) + assert not contains([x*(1 + x + y), y*(1 + z)], x + y) + + +def test_local(): + igrlex = InverseOrder(grlex) + gens = [x, y, z] + + def contains(I, f): + S = [sdm_from_vector([g], igrlex, QQ, gens=gens) for g in I] + G = sdm_groebner(S, sdm_nf_mora, igrlex, QQ) + return sdm_nf_mora(sdm_from_vector([f], lex, QQ, gens=gens), + G, lex, QQ) == sdm_zero() + assert contains([x, y], x) + assert contains([x, y], x + y) + assert not contains([x, y], 1) + assert not contains([x, y], z) + assert contains([x**2 + y, x**2 + x], x - y) + assert not contains([x + y + z, x*y + x*z + y*z, x*y*z], x**2) + assert contains([x*(1 + x + y), y*(1 + z)], x) + assert contains([x*(1 + x + y), y*(1 + z)], x + y) + + +def test_uncovered_line(): + gens = [x, y] + f1 = sdm_zero() + f2 = sdm_from_vector([x, 0], lex, QQ, gens=gens) + f3 = sdm_from_vector([0, y], lex, QQ, gens=gens) + + assert sdm_spoly(f1, f2, lex, QQ) == sdm_zero() + assert sdm_spoly(f3, f2, lex, QQ) == sdm_zero() + + +def test_chain_criterion(): + gens = [x] + f1 = sdm_from_vector([1, x], grlex, QQ, gens=gens) + f2 = sdm_from_vector([0, x - 2], grlex, QQ, gens=gens) + assert len(sdm_groebner([f1, f2], sdm_nf_mora, grlex, QQ)) == 2 diff --git a/shared/package-files/75/757c0807435a8fed138e56a6b0a41cae53514e13c75b79ef047b54b76f2747a0/mock.pyi b/shared/package-files/75/757c0807435a8fed138e56a6b0a41cae53514e13c75b79ef047b54b76f2747a0/mock.pyi new file mode 100644 index 0000000000000000000000000000000000000000..bf7e3ef769b84074ca54628a65b724fb83688f0a --- /dev/null +++ b/shared/package-files/75/757c0807435a8fed138e56a6b0a41cae53514e13c75b79ef047b54b76f2747a0/mock.pyi @@ -0,0 +1,441 @@ +import sys +from typing import Any, Callable, Generic, List, Mapping, Optional, Sequence, Tuple, Type, TypeVar, Union, overload + +_F = TypeVar("_F", bound=Callable[..., Any]) +_T = TypeVar("_T") +_TT = TypeVar("_TT", bound=Type[Any]) +_R = TypeVar("_R") + +__all__ = [ + "Mock", + "MagicMock", + "patch", + "sentinel", + "DEFAULT", + "ANY", + "call", + "create_autospec", + "AsyncMock", + "FILTER_DIR", + "NonCallableMock", + "NonCallableMagicMock", + "mock_open", + "PropertyMock", + "seal", +] +__version__: str + +FILTER_DIR: Any + +class _slotted: ... + +class _SentinelObject: + name: Any + def __init__(self, name: Any) -> None: ... + +class _Sentinel: + def __init__(self) -> None: ... + def __getattr__(self, name: str) -> Any: ... + +sentinel: Any +DEFAULT: Any + +class _Call(Tuple[Any, ...]): + def __new__( + cls, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ... + ) -> Any: ... + name: Any + parent: Any + from_kall: Any + def __init__( + self, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ... + ) -> None: ... + def __eq__(self, other: Any) -> bool: ... + __ne__: Any + def __call__(self, *args: Any, **kwargs: Any) -> _Call: ... + def __getattr__(self, attr: Any) -> Any: ... + def count(self, *args: Any, **kwargs: Any) -> Any: ... + def index(self, *args: Any, **kwargs: Any) -> Any: ... + def call_list(self) -> Any: ... + +call: _Call + +class _CallList(List[_Call]): + def __contains__(self, value: Any) -> bool: ... + +class _MockIter: + obj: Any + def __init__(self, obj: Any) -> None: ... + def __iter__(self) -> Any: ... + def __next__(self) -> Any: ... + +class Base: + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + +class NonCallableMock(Base, Any): # type: ignore + def __new__(__cls, *args: Any, **kw: Any) -> NonCallableMock: ... + def __init__( + self, + spec: Union[List[str], object, Type[object], None] = ..., + wraps: Optional[Any] = ..., + name: Optional[str] = ..., + spec_set: Union[List[str], object, Type[object], None] = ..., + parent: Optional[NonCallableMock] = ..., + _spec_state: Optional[Any] = ..., + _new_name: str = ..., + _new_parent: Optional[NonCallableMock] = ..., + _spec_as_instance: bool = ..., + _eat_self: Optional[bool] = ..., + unsafe: bool = ..., + **kwargs: Any, + ) -> None: ... + def __getattr__(self, name: str) -> Any: ... + if sys.version_info >= (3, 8): + def _calls_repr(self, prefix: str = ...) -> str: ... + def assert_called_with(self, *args: Any, **kwargs: Any) -> None: ... + def assert_not_called(self) -> None: ... + def assert_called_once_with(self, *args: Any, **kwargs: Any) -> None: ... + def _format_mock_failure_message(self, args: Any, kwargs: Any, action: str = ...) -> str: ... + elif sys.version_info >= (3, 5): + def assert_called_with(_mock_self, *args: Any, **kwargs: Any) -> None: ... + def assert_not_called(_mock_self) -> None: ... + def assert_called_once_with(_mock_self, *args: Any, **kwargs: Any) -> None: ... + def _format_mock_failure_message(self, args: Any, kwargs: Any) -> str: ... + if sys.version_info >= (3, 8): + def assert_called(self) -> None: ... + def assert_called_once(self) -> None: ... + elif sys.version_info >= (3, 6): + def assert_called(_mock_self) -> None: ... + def assert_called_once(_mock_self) -> None: ... + if sys.version_info >= (3, 6): + def reset_mock(self, visited: Any = ..., *, return_value: bool = ..., side_effect: bool = ...) -> None: ... + elif sys.version_info >= (3, 5): + def reset_mock(self, visited: Any = ...) -> None: ... + if sys.version_info >= (3, 7): + def _extract_mock_name(self) -> str: ... + def _get_call_signature_from_name(self, name: str) -> Any: ... + def assert_any_call(self, *args: Any, **kwargs: Any) -> None: ... + def assert_has_calls(self, calls: Sequence[_Call], any_order: bool = ...) -> None: ... + def mock_add_spec(self, spec: Any, spec_set: bool = ...) -> None: ... + def _mock_add_spec(self, spec: Any, spec_set: bool, _spec_as_instance: bool = ..., _eat_self: bool = ...) -> None: ... + def attach_mock(self, mock: NonCallableMock, attribute: str) -> None: ... + def configure_mock(self, **kwargs: Any) -> None: ... + return_value: Any + side_effect: Any + called: bool + call_count: int + call_args: Any + call_args_list: _CallList + mock_calls: _CallList + def _format_mock_call_signature(self, args: Any, kwargs: Any) -> str: ... + def _call_matcher(self, _call: Tuple[_Call, ...]) -> _Call: ... + def _get_child_mock(self, **kw: Any) -> NonCallableMock: ... + +class CallableMixin(Base): + side_effect: Any + def __init__( + self, + spec: Optional[Any] = ..., + side_effect: Optional[Any] = ..., + return_value: Any = ..., + wraps: Optional[Any] = ..., + name: Optional[Any] = ..., + spec_set: Optional[Any] = ..., + parent: Optional[Any] = ..., + _spec_state: Optional[Any] = ..., + _new_name: Any = ..., + _new_parent: Optional[Any] = ..., + **kwargs: Any, + ) -> None: ... + def __call__(_mock_self, *args: Any, **kwargs: Any) -> Any: ... + +class Mock(CallableMixin, NonCallableMock): ... + +class _patch(Generic[_T]): + attribute_name: Any + getter: Callable[[], Any] + attribute: str + new: _T + new_callable: Any + spec: Any + create: bool + has_local: Any + spec_set: Any + autospec: Any + kwargs: Mapping[str, Any] + additional_patchers: Any + if sys.version_info >= (3, 8): + @overload + def __init__( + self: _patch[Union[MagicMock, AsyncMock]], + getter: Callable[[], Any], + attribute: str, + *, + spec: Optional[Any], + create: bool, + spec_set: Optional[Any], + autospec: Optional[Any], + new_callable: Optional[Any], + kwargs: Mapping[str, Any], + ) -> None: ... + # This overload also covers the case, where new==DEFAULT. In this case, self is _patch[Any]. + # Ideally we'd be able to add an overload for it so that self is _patch[MagicMock], + # but that's impossible with the current type system. + @overload + def __init__( + self: _patch[_T], + getter: Callable[[], Any], + attribute: str, + new: _T, + spec: Optional[Any], + create: bool, + spec_set: Optional[Any], + autospec: Optional[Any], + new_callable: Optional[Any], + kwargs: Mapping[str, Any], + ) -> None: ... + else: + @overload + def __init__( + self: _patch[MagicMock], + getter: Callable[[], Any], + attribute: str, + *, + spec: Optional[Any], + create: bool, + spec_set: Optional[Any], + autospec: Optional[Any], + new_callable: Optional[Any], + kwargs: Mapping[str, Any], + ) -> None: ... + @overload + def __init__( + self: _patch[_T], + getter: Callable[[], Any], + attribute: str, + new: _T, + spec: Optional[Any], + create: bool, + spec_set: Optional[Any], + autospec: Optional[Any], + new_callable: Optional[Any], + kwargs: Mapping[str, Any], + ) -> None: ... + def copy(self) -> _patch[_T]: ... + def __call__(self, func: Callable[..., _R]) -> Callable[..., _R]: ... + def decorate_class(self, klass: _TT) -> _TT: ... + def decorate_callable(self, func: _F) -> _F: ... + def get_original(self) -> Tuple[Any, bool]: ... + target: Any + temp_original: Any + is_local: bool + def __enter__(self) -> _T: ... + def __exit__(self, *exc_info: Any) -> None: ... + def start(self) -> _T: ... + def stop(self) -> None: ... + +class _patch_dict: + in_dict: Any + values: Any + clear: Any + def __init__(self, in_dict: Any, values: Any = ..., clear: Any = ..., **kwargs: Any) -> None: ... + def __call__(self, f: Any) -> Any: ... + def decorate_class(self, klass: Any) -> Any: ... + def __enter__(self) -> Any: ... + def __exit__(self, *args: Any) -> Any: ... + start: Any + stop: Any + +class _patcher: + TEST_PREFIX: str + dict: Type[_patch_dict] + if sys.version_info >= (3, 8): + @overload + def __call__( # type: ignore + self, + target: Any, + *, + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[Union[MagicMock, AsyncMock]]: ... + # This overload also covers the case, where new==DEFAULT. In this case, the return type is _patch[Any]. + # Ideally we'd be able to add an overload for it so that the return type is _patch[MagicMock], + # but that's impossible with the current type system. + @overload + def __call__( + self, + target: Any, + new: _T, + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[_T]: ... + else: + @overload + def __call__( # type: ignore + self, + target: Any, + *, + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[MagicMock]: ... + @overload + def __call__( + self, + target: Any, + new: _T, + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[_T]: ... + if sys.version_info >= (3, 8): + @overload + def object( # type: ignore + self, + target: Any, + attribute: str, + *, + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[Union[MagicMock, AsyncMock]]: ... + @overload + def object( + self, + target: Any, + attribute: str, + new: _T = ..., + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[_T]: ... + else: + @overload + def object( # type: ignore + self, + target: Any, + attribute: str, + *, + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[MagicMock]: ... + @overload + def object( + self, + target: Any, + attribute: str, + new: _T = ..., + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[_T]: ... + def multiple( + self, + target: Any, + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: _T, + ) -> _patch[_T]: ... + def stopall(self) -> None: ... + +patch: _patcher + +class MagicMixin: + def __init__(self, *args: Any, **kw: Any) -> None: ... + +class NonCallableMagicMock(MagicMixin, NonCallableMock): + def mock_add_spec(self, spec: Any, spec_set: bool = ...) -> None: ... + +class MagicMock(MagicMixin, Mock): + def mock_add_spec(self, spec: Any, spec_set: bool = ...) -> None: ... + +if sys.version_info >= (3, 8): + class AsyncMockMixin(Base): + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + async def _execute_mock_call(self, *args: Any, **kwargs: Any) -> Any: ... + def assert_awaited(self) -> None: ... + def assert_awaited_once(self) -> None: ... + def assert_awaited_with(self, *args: Any, **kwargs: Any) -> None: ... + def assert_awaited_once_with(self, *args: Any, **kwargs: Any) -> None: ... + def assert_any_await(self, *args: Any, **kwargs: Any) -> None: ... + def assert_has_awaits(self, calls: _CallList, any_order: bool = ...) -> None: ... + def assert_not_awaited(self) -> None: ... + def reset_mock(self, *args, **kwargs) -> None: ... + await_count: int + await_args: Optional[_Call] + await_args_list: _CallList + class AsyncMagicMixin(MagicMixin): + def __init__(self, *args: Any, **kw: Any) -> None: ... + class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock): ... + +class MagicProxy: + name: Any + parent: Any + def __init__(self, name: Any, parent: Any) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def create_mock(self) -> Any: ... + def __get__(self, obj: Any, _type: Optional[Any] = ...) -> Any: ... + +class _ANY: + def __eq__(self, other: Any) -> bool: ... + def __ne__(self, other: Any) -> bool: ... + +ANY: Any + +def create_autospec( + spec: Any, spec_set: Any = ..., instance: Any = ..., _parent: Optional[Any] = ..., _name: Optional[Any] = ..., **kwargs: Any +) -> Any: ... + +class _SpecState: + spec: Any + ids: Any + spec_set: Any + parent: Any + instance: Any + name: Any + def __init__( + self, + spec: Any, + spec_set: Any = ..., + parent: Optional[Any] = ..., + name: Optional[Any] = ..., + ids: Optional[Any] = ..., + instance: Any = ..., + ) -> None: ... + +def mock_open(mock: Optional[Any] = ..., read_data: Any = ...) -> Any: ... + +PropertyMock = Any + +if sys.version_info >= (3, 7): + def seal(mock: Any) -> None: ... diff --git a/shared/package-files/75/757d547ab3c42c63d5e25cec6a316ad8137327853caed781fe2346ea963d3092/eq_cpu_dispatch.h b/shared/package-files/75/757d547ab3c42c63d5e25cec6a316ad8137327853caed781fe2346ea963d3092/eq_cpu_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..a15f08555822b803f3b3400e9b0da39ea3247f43 --- /dev/null +++ b/shared/package-files/75/757d547ab3c42c63d5e25cec6a316ad8137327853caed781fe2346ea963d3092/eq_cpu_dispatch.h @@ -0,0 +1,30 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cpu { + +TORCH_API at::Tensor eq(const at::Tensor & self, const at::Scalar & other); +TORCH_API at::Tensor & eq_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & other); +TORCH_API at::Tensor & eq_outf(const at::Tensor & self, const at::Scalar & other, at::Tensor & out); +TORCH_API at::Tensor & eq_(at::Tensor & self, const at::Scalar & other); +TORCH_API at::Tensor eq(const at::Tensor & self, const at::Tensor & other); +TORCH_API at::Tensor & eq_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other); +TORCH_API at::Tensor & eq_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out); +TORCH_API at::Tensor & eq_(at::Tensor & self, const at::Tensor & other); + +} // namespace cpu +} // namespace at diff --git a/shared/package-files/75/7580ac059609cc6773fff13034735b0386b49db0a0c4df41f29fb5380ffa8fc7/linalg_det_compositeimplicitautograd_dispatch.h b/shared/package-files/75/7580ac059609cc6773fff13034735b0386b49db0a0c4df41f29fb5380ffa8fc7/linalg_det_compositeimplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..b7ec419f0b79876a4d1e51bf319baf120fc3ce64 --- /dev/null +++ b/shared/package-files/75/7580ac059609cc6773fff13034735b0386b49db0a0c4df41f29fb5380ffa8fc7/linalg_det_compositeimplicitautograd_dispatch.h @@ -0,0 +1,25 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeimplicitautograd { + +TORCH_API at::Tensor linalg_det(const at::Tensor & A); +TORCH_API at::Tensor & linalg_det_out(at::Tensor & out, const at::Tensor & A); +TORCH_API at::Tensor & linalg_det_outf(const at::Tensor & A, at::Tensor & out); + +} // namespace compositeimplicitautograd +} // namespace at diff --git a/shared/package-files/75/7584d1b57bcc0d71e22b35c70f64a1d1f704ba4a1bdf0aff19b49ea9a66bacef/ruletest11.py b/shared/package-files/75/7584d1b57bcc0d71e22b35c70f64a1d1f704ba4a1bdf0aff19b49ea9a66bacef/ruletest11.py new file mode 100644 index 0000000000000000000000000000000000000000..4ec2397ea96261d7b582d1f699e3897caae88f20 --- /dev/null +++ b/shared/package-files/75/7584d1b57bcc0d71e22b35c70f64a1d1f704ba4a1bdf0aff19b49ea9a66bacef/ruletest11.py @@ -0,0 +1,14 @@ +import sympy.physics.mechanics as _me +import sympy as _sm +import math as m +import numpy as _np + +x, y = _me.dynamicsymbols('x y') +a11, a12, a21, a22, b1, b2 = _sm.symbols('a11 a12 a21 a22 b1 b2', real=True) +eqn = _sm.Matrix([[0]]) +eqn[0] = a11*x+a12*y-b1 +eqn = eqn.row_insert(eqn.shape[0], _sm.Matrix([[0]])) +eqn[eqn.shape[0]-1] = a21*x+a22*y-b2 +eqn_list = [] +for i in eqn: eqn_list.append(i.subs({a11:2, a12:5, a21:3, a22:4, b1:7, b2:6})) +print(_sm.linsolve(eqn_list, x,y)) diff --git a/shared/package-files/75/75882dd66f83674fe776dc4ae418cf070606f0df22f8de5b90dadcd30994eba8/optional_input.py b/shared/package-files/75/75882dd66f83674fe776dc4ae418cf070606f0df22f8de5b90dadcd30994eba8/optional_input.py new file mode 100644 index 0000000000000000000000000000000000000000..4a06207b6eaf8f24d673c7ec227c3a5643c2d6a3 --- /dev/null +++ b/shared/package-files/75/75882dd66f83674fe776dc4ae418cf070606f0df22f8de5b90dadcd30994eba8/optional_input.py @@ -0,0 +1,19 @@ +import torch + +from torch._export.db.case import export_case, SupportLevel + + +@export_case( + example_inputs=(torch.randn(2, 3),), + tags={"python.object-model"}, + support_level=SupportLevel.NOT_SUPPORTED_YET, +) +class OptionalInput(torch.nn.Module): + """ + Tracing through optional input is not supported yet + """ + + def forward(self, x, y=torch.ones(2, 3)): + if y is not None: + return x + y + return x diff --git a/shared/package-files/75/758c26e7c89566c9b4199beb8fbbf53bbc1df5fa3bb106fbc20e33bb0ec1748f/reciprocal_cuda_dispatch.h b/shared/package-files/75/758c26e7c89566c9b4199beb8fbbf53bbc1df5fa3bb106fbc20e33bb0ec1748f/reciprocal_cuda_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..db4db85c90ae8c33c7554157eaaa3cca5b5a4b14 --- /dev/null +++ b/shared/package-files/75/758c26e7c89566c9b4199beb8fbbf53bbc1df5fa3bb106fbc20e33bb0ec1748f/reciprocal_cuda_dispatch.h @@ -0,0 +1,26 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API at::Tensor reciprocal(const at::Tensor & self); +TORCH_API at::Tensor & reciprocal_out(at::Tensor & out, const at::Tensor & self); +TORCH_API at::Tensor & reciprocal_outf(const at::Tensor & self, at::Tensor & out); +TORCH_API at::Tensor & reciprocal_(at::Tensor & self); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/75/758f7f1c0f6d887e85158251ab128e245b5c967a7f7c238ceaf49b917c538790/log10_meta_dispatch.h b/shared/package-files/75/758f7f1c0f6d887e85158251ab128e245b5c967a7f7c238ceaf49b917c538790/log10_meta_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..da65f15fad8bd854b6090ac4cb704d6367a1674d --- /dev/null +++ b/shared/package-files/75/758f7f1c0f6d887e85158251ab128e245b5c967a7f7c238ceaf49b917c538790/log10_meta_dispatch.h @@ -0,0 +1,26 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace meta { + +TORCH_API at::Tensor log10(const at::Tensor & self); +TORCH_API at::Tensor & log10_out(at::Tensor & out, const at::Tensor & self); +TORCH_API at::Tensor & log10_outf(const at::Tensor & self, at::Tensor & out); +TORCH_API at::Tensor & log10_(at::Tensor & self); + +} // namespace meta +} // namespace at diff --git a/shared/package-files/75/758fa52c656bd2b43ea7fcbef313f9a5aa6f084b9206e68590d782f000c437f3/routing.pyi b/shared/package-files/75/758fa52c656bd2b43ea7fcbef313f9a5aa6f084b9206e68590d782f000c437f3/routing.pyi new file mode 100644 index 0000000000000000000000000000000000000000..a1cfe8d9f21a8c3164274574d8fd4e4d9a8e7809 --- /dev/null +++ b/shared/package-files/75/758fa52c656bd2b43ea7fcbef313f9a5aa6f084b9206e68590d782f000c437f3/routing.pyi @@ -0,0 +1,230 @@ +from typing import Any, Optional, Text + +from werkzeug.exceptions import HTTPException + +def parse_converter_args(argstr): ... +def parse_rule(rule): ... + +class RoutingException(Exception): ... + +class RequestRedirect(HTTPException, RoutingException): + code: Any + new_url: Any + def __init__(self, new_url): ... + def get_response(self, environ): ... + +class RequestSlash(RoutingException): ... + +class RequestAliasRedirect(RoutingException): + matched_values: Any + def __init__(self, matched_values): ... + +class BuildError(RoutingException, LookupError): + endpoint: Any + values: Any + method: Any + adapter: Optional[MapAdapter] + def __init__(self, endpoint, values, method, adapter: Optional[MapAdapter] = ...) -> None: ... + @property + def suggested(self) -> Optional[Rule]: ... + def closest_rule(self, adapter: Optional[MapAdapter]) -> Optional[Rule]: ... + +class ValidationError(ValueError): ... + +class RuleFactory: + def get_rules(self, map): ... + +class Subdomain(RuleFactory): + subdomain: Any + rules: Any + def __init__(self, subdomain, rules): ... + def get_rules(self, map): ... + +class Submount(RuleFactory): + path: Any + rules: Any + def __init__(self, path, rules): ... + def get_rules(self, map): ... + +class EndpointPrefix(RuleFactory): + prefix: Any + rules: Any + def __init__(self, prefix, rules): ... + def get_rules(self, map): ... + +class RuleTemplate: + rules: Any + def __init__(self, rules): ... + def __call__(self, *args, **kwargs): ... + +class RuleTemplateFactory(RuleFactory): + rules: Any + context: Any + def __init__(self, rules, context): ... + def get_rules(self, map): ... + +class Rule(RuleFactory): + rule: Any + is_leaf: Any + map: Any + strict_slashes: Any + subdomain: Any + host: Any + defaults: Any + build_only: Any + alias: Any + methods: Any + endpoint: Any + redirect_to: Any + arguments: Any + def __init__( + self, + string, + defaults: Optional[Any] = ..., + subdomain: Optional[Any] = ..., + methods: Optional[Any] = ..., + build_only: bool = ..., + endpoint: Optional[Any] = ..., + strict_slashes: Optional[Any] = ..., + redirect_to: Optional[Any] = ..., + alias: bool = ..., + host: Optional[Any] = ..., + ): ... + def empty(self): ... + def get_empty_kwargs(self): ... + def get_rules(self, map): ... + def refresh(self): ... + def bind(self, map, rebind: bool = ...): ... + def get_converter(self, variable_name, converter_name, args, kwargs): ... + def compile(self): ... + def match(self, path, method: Optional[Any] = ...): ... + def build(self, values, append_unknown: bool = ...): ... + def provides_defaults_for(self, rule): ... + def suitable_for(self, values, method: Optional[Any] = ...): ... + def match_compare_key(self): ... + def build_compare_key(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class BaseConverter: + regex: Any + weight: Any + map: Any + def __init__(self, map): ... + def to_python(self, value): ... + def to_url(self, value) -> str: ... + +class UnicodeConverter(BaseConverter): + regex: Any + def __init__(self, map, minlength: int = ..., maxlength: Optional[Any] = ..., length: Optional[Any] = ...): ... + +class AnyConverter(BaseConverter): + regex: Any + def __init__(self, map, *items): ... + +class PathConverter(BaseConverter): + regex: Any + weight: Any + +class NumberConverter(BaseConverter): + weight: Any + fixed_digits: Any + min: Any + max: Any + def __init__(self, map, fixed_digits: int = ..., min: Optional[Any] = ..., max: Optional[Any] = ...): ... + def to_python(self, value): ... + def to_url(self, value) -> str: ... + +class IntegerConverter(NumberConverter): + regex: Any + num_convert: Any + +class FloatConverter(NumberConverter): + regex: Any + num_convert: Any + def __init__(self, map, min: Optional[Any] = ..., max: Optional[Any] = ...): ... + +class UUIDConverter(BaseConverter): + regex: Any + def to_python(self, value): ... + def to_url(self, value) -> str: ... + +DEFAULT_CONVERTERS: Any + +class Map: + default_converters: Any + default_subdomain: Any + charset: Text + encoding_errors: Text + strict_slashes: Any + redirect_defaults: Any + host_matching: Any + converters: Any + sort_parameters: Any + sort_key: Any + def __init__( + self, + rules: Optional[Any] = ..., + default_subdomain: str = ..., + charset: Text = ..., + strict_slashes: bool = ..., + redirect_defaults: bool = ..., + converters: Optional[Any] = ..., + sort_parameters: bool = ..., + sort_key: Optional[Any] = ..., + encoding_errors: Text = ..., + host_matching: bool = ..., + ): ... + def is_endpoint_expecting(self, endpoint, *arguments): ... + def iter_rules(self, endpoint: Optional[Any] = ...): ... + def add(self, rulefactory): ... + def bind( + self, + server_name, + script_name: Optional[Any] = ..., + subdomain: Optional[Any] = ..., + url_scheme: str = ..., + default_method: str = ..., + path_info: Optional[Any] = ..., + query_args: Optional[Any] = ..., + ): ... + def bind_to_environ(self, environ, server_name: Optional[Any] = ..., subdomain: Optional[Any] = ...): ... + def update(self): ... + +class MapAdapter: + map: Any + server_name: Any + script_name: Any + subdomain: Any + url_scheme: Any + path_info: Any + default_method: Any + query_args: Any + def __init__( + self, map, server_name, script_name, subdomain, url_scheme, path_info, default_method, query_args: Optional[Any] = ... + ): ... + def dispatch( + self, view_func, path_info: Optional[Any] = ..., method: Optional[Any] = ..., catch_http_exceptions: bool = ... + ): ... + def match( + self, + path_info: Optional[Any] = ..., + method: Optional[Any] = ..., + return_rule: bool = ..., + query_args: Optional[Any] = ..., + ): ... + def test(self, path_info: Optional[Any] = ..., method: Optional[Any] = ...): ... + def allowed_methods(self, path_info: Optional[Any] = ...): ... + def get_host(self, domain_part): ... + def get_default_redirect(self, rule, method, values, query_args): ... + def encode_query_args(self, query_args): ... + def make_redirect_url(self, path_info, query_args: Optional[Any] = ..., domain_part: Optional[Any] = ...): ... + def make_alias_redirect_url(self, path, endpoint, values, method, query_args): ... + def build( + self, + endpoint, + values: Optional[Any] = ..., + method: Optional[Any] = ..., + force_external: bool = ..., + append_unknown: bool = ..., + ): ... diff --git a/shared/package-files/75/7592891e016ba2a78ff43fc5d5d193275f60496fbde337c82539832de169e7f9/_monitor.pyi b/shared/package-files/75/7592891e016ba2a78ff43fc5d5d193275f60496fbde337c82539832de169e7f9/_monitor.pyi new file mode 100644 index 0000000000000000000000000000000000000000..9950a9e8c30a4b38f69ca9627e3980e948dfc213 --- /dev/null +++ b/shared/package-files/75/7592891e016ba2a78ff43fc5d5d193275f60496fbde337c82539832de169e7f9/_monitor.pyi @@ -0,0 +1,44 @@ +# Defined in torch/csrc/monitor/python_init.cpp + +import datetime +from enum import Enum +from typing import Callable, Dict, List, Union + +class Aggregation(Enum): + VALUE = ... + MEAN = ... + COUNT = ... + SUM = ... + MAX = ... + MIN = ... + +class Stat: + name: str + count: int + def __init__( + self, + name: str, + aggregations: List[Aggregation], + window_size: int, + max_samples: int = -1, + ) -> None: ... + def add(self, v: float) -> None: ... + def get(self) -> Dict[Aggregation, float]: ... + +class Event: + name: str + timestamp: datetime.datetime + data: Dict[str, Union[int, float, bool, str]] + def __init__( + self, + name: str, + timestamp: datetime.datetime, + data: Dict[str, Union[int, float, bool, str]], + ) -> None: ... + +def log_event(e: Event) -> None: ... + +class EventHandlerHandle: ... + +def register_event_handler(handler: Callable[[Event], None]) -> EventHandlerHandle: ... +def unregister_event_handler(handle: EventHandlerHandle) -> None: ... diff --git a/shared/package-files/75/7593d4ab920a93bce693f9d287dfef77b09a5f903349bdd500da933d0b785f27/test_linalg.py b/shared/package-files/75/7593d4ab920a93bce693f9d287dfef77b09a5f903349bdd500da933d0b785f27/test_linalg.py new file mode 100644 index 0000000000000000000000000000000000000000..97bd13a4134d602ab0a0a11e8964768ea0c9e82d --- /dev/null +++ b/shared/package-files/75/7593d4ab920a93bce693f9d287dfef77b09a5f903349bdd500da933d0b785f27/test_linalg.py @@ -0,0 +1,27 @@ +import numpy as np +from numpy.testing import assert_allclose +from scipy.linalg import toeplitz + +from statsmodels.tools import linalg + + +def test_stationary_solve_1d(): + rs = np.random.RandomState(283821) + b = rs.uniform(size=10) + r = rs.uniform(size=9) + t = np.concatenate((np.r_[1], r)) + tmat = toeplitz(t) + soln = np.linalg.solve(tmat, b) + soln1 = linalg.stationary_solve(r, b) + assert_allclose(soln, soln1, rtol=1e-5, atol=1e-5) + + +def test_stationary_solve_2d(): + rs = np.random.RandomState(283822) + b = rs.uniform(size=(10, 2)) + r = rs.uniform(size=9) + t = np.concatenate((np.r_[1], r)) + tmat = toeplitz(t) + soln = np.linalg.solve(tmat, b) + soln1 = linalg.stationary_solve(r, b) + assert_allclose(soln, soln1, rtol=1e-5, atol=1e-5) diff --git a/shared/package-files/75/7593fe027fea343257c4ccd6b085f57dc4c8a1cdea23e5889b8f014b780024b9/bdb.pyi b/shared/package-files/75/7593fe027fea343257c4ccd6b085f57dc4c8a1cdea23e5889b8f014b780024b9/bdb.pyi new file mode 100644 index 0000000000000000000000000000000000000000..9d76b3afde222ba5e5a9b829a218ea6f20f3b56e --- /dev/null +++ b/shared/package-files/75/7593fe027fea343257c4ccd6b085f57dc4c8a1cdea23e5889b8f014b780024b9/bdb.pyi @@ -0,0 +1,98 @@ +from types import CodeType, FrameType, TracebackType +from typing import IO, Any, Callable, Dict, Iterable, List, Mapping, Optional, Set, SupportsInt, Tuple, Type, TypeVar, Union + +_T = TypeVar("_T") +_TraceDispatch = Callable[[FrameType, str, Any], Any] # TODO: Recursive type +_ExcInfo = Tuple[Type[BaseException], BaseException, FrameType] + +GENERATOR_AND_COROUTINE_FLAGS: int = ... + +class BdbQuit(Exception): ... + +class Bdb: + + skip: Optional[Set[str]] + breaks: Dict[str, List[int]] + fncache: Dict[str, str] + frame_returning: Optional[FrameType] + botframe: Optional[FrameType] + quitting: bool + stopframe: Optional[FrameType] + returnframe: Optional[FrameType] + stoplineno: int + def __init__(self, skip: Optional[Iterable[str]] = ...) -> None: ... + def canonic(self, filename: str) -> str: ... + def reset(self) -> None: ... + def trace_dispatch(self, frame: FrameType, event: str, arg: Any) -> _TraceDispatch: ... + def dispatch_line(self, frame: FrameType) -> _TraceDispatch: ... + def dispatch_call(self, frame: FrameType, arg: None) -> _TraceDispatch: ... + def dispatch_return(self, frame: FrameType, arg: Any) -> _TraceDispatch: ... + def dispatch_exception(self, frame: FrameType, arg: _ExcInfo) -> _TraceDispatch: ... + def is_skipped_module(self, module_name: str) -> bool: ... + def stop_here(self, frame: FrameType) -> bool: ... + def break_here(self, frame: FrameType) -> bool: ... + def do_clear(self, arg: Any) -> Optional[bool]: ... + def break_anywhere(self, frame: FrameType) -> bool: ... + def user_call(self, frame: FrameType, argument_list: None) -> None: ... + def user_line(self, frame: FrameType) -> None: ... + def user_return(self, frame: FrameType, return_value: Any) -> None: ... + def user_exception(self, frame: FrameType, exc_info: _ExcInfo) -> None: ... + def set_until(self, frame: FrameType, lineno: Optional[int] = ...) -> None: ... + def set_step(self) -> None: ... + def set_next(self, frame: FrameType) -> None: ... + def set_return(self, frame: FrameType) -> None: ... + def set_trace(self, frame: Optional[FrameType] = ...) -> None: ... + def set_continue(self) -> None: ... + def set_quit(self) -> None: ... + def set_break( + self, filename: str, lineno: int, temporary: bool = ..., cond: Optional[str] = ..., funcname: Optional[str] = ... + ) -> None: ... + def clear_break(self, filename: str, lineno: int) -> None: ... + def clear_bpbynumber(self, arg: SupportsInt) -> None: ... + def clear_all_file_breaks(self, filename: str) -> None: ... + def clear_all_breaks(self) -> None: ... + def get_bpbynumber(self, arg: SupportsInt) -> Breakpoint: ... + def get_break(self, filename: str, lineno: int) -> bool: ... + def get_breaks(self, filename: str, lineno: int) -> List[Breakpoint]: ... + def get_file_breaks(self, filename: str) -> List[Breakpoint]: ... + def get_all_breaks(self) -> List[Breakpoint]: ... + def get_stack(self, f: Optional[FrameType], t: Optional[TracebackType]) -> Tuple[List[Tuple[FrameType, int]], int]: ... + def format_stack_entry(self, frame_lineno: int, lprefix: str = ...) -> str: ... + def run( + self, cmd: Union[str, CodeType], globals: Optional[Dict[str, Any]] = ..., locals: Optional[Mapping[str, Any]] = ... + ) -> None: ... + def runeval(self, expr: str, globals: Optional[Dict[str, Any]] = ..., locals: Optional[Mapping[str, Any]] = ...) -> None: ... + def runctx( + self, cmd: Union[str, CodeType], globals: Optional[Dict[str, Any]], locals: Optional[Mapping[str, Any]] + ) -> None: ... + def runcall(self, __func: Callable[..., _T], *args: Any, **kwds: Any) -> Optional[_T]: ... + +class Breakpoint: + + next: int = ... + bplist: Dict[Tuple[str, int], List[Breakpoint]] = ... + bpbynumber: List[Optional[Breakpoint]] = ... + + funcname: Optional[str] + func_first_executable_line: Optional[int] + file: str + line: int + temporary: bool + cond: Optional[str] + enabled: bool + ignore: int + hits: int + number: int + def __init__( + self, file: str, line: int, temporary: bool = ..., cond: Optional[str] = ..., funcname: Optional[str] = ... + ) -> None: ... + def deleteMe(self) -> None: ... + def enable(self) -> None: ... + def disable(self) -> None: ... + def bpprint(self, out: Optional[IO[str]] = ...) -> None: ... + def bpformat(self) -> str: ... + def __str__(self) -> str: ... + +def checkfuncname(b: Breakpoint, frame: FrameType) -> bool: ... +def effective(file: str, line: int, frame: FrameType) -> Union[Tuple[Breakpoint, bool], Tuple[None, None]]: ... +def set_trace() -> None: ... diff --git a/shared/package-files/75/75958aa9f74b46f26f6c0106fdfa1fffc8a410ac636a400332dcb590b0bf97f3/_exceptions.py b/shared/package-files/75/75958aa9f74b46f26f6c0106fdfa1fffc8a410ac636a400332dcb590b0bf97f3/_exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..87d4213a6d42cf090f8db75571244840dd68cd5a --- /dev/null +++ b/shared/package-files/75/75958aa9f74b46f26f6c0106fdfa1fffc8a410ac636a400332dcb590b0bf97f3/_exceptions.py @@ -0,0 +1,172 @@ +""" +Various richly-typed exceptions, that also help us deal with string formatting +in python where it's easier. + +By putting the formatting in `__str__`, we also avoid paying the cost for +users who silence the exceptions. +""" +from .._utils import set_module + +def _unpack_tuple(tup): + if len(tup) == 1: + return tup[0] + else: + return tup + + +def _display_as_base(cls): + """ + A decorator that makes an exception class look like its base. + + We use this to hide subclasses that are implementation details - the user + should catch the base type, which is what the traceback will show them. + + Classes decorated with this decorator are subject to removal without a + deprecation warning. + """ + assert issubclass(cls, Exception) + cls.__name__ = cls.__base__.__name__ + return cls + + +class UFuncTypeError(TypeError): + """ Base class for all ufunc exceptions """ + def __init__(self, ufunc): + self.ufunc = ufunc + + +@_display_as_base +class _UFuncNoLoopError(UFuncTypeError): + """ Thrown when a ufunc loop cannot be found """ + def __init__(self, ufunc, dtypes): + super().__init__(ufunc) + self.dtypes = tuple(dtypes) + + def __str__(self): + return ( + "ufunc {!r} did not contain a loop with signature matching types " + "{!r} -> {!r}" + ).format( + self.ufunc.__name__, + _unpack_tuple(self.dtypes[:self.ufunc.nin]), + _unpack_tuple(self.dtypes[self.ufunc.nin:]) + ) + + +@_display_as_base +class _UFuncBinaryResolutionError(_UFuncNoLoopError): + """ Thrown when a binary resolution fails """ + def __init__(self, ufunc, dtypes): + super().__init__(ufunc, dtypes) + assert len(self.dtypes) == 2 + + def __str__(self): + return ( + "ufunc {!r} cannot use operands with types {!r} and {!r}" + ).format( + self.ufunc.__name__, *self.dtypes + ) + + +@_display_as_base +class _UFuncCastingError(UFuncTypeError): + def __init__(self, ufunc, casting, from_, to): + super().__init__(ufunc) + self.casting = casting + self.from_ = from_ + self.to = to + + +@_display_as_base +class _UFuncInputCastingError(_UFuncCastingError): + """ Thrown when a ufunc input cannot be casted """ + def __init__(self, ufunc, casting, from_, to, i): + super().__init__(ufunc, casting, from_, to) + self.in_i = i + + def __str__(self): + # only show the number if more than one input exists + i_str = "{} ".format(self.in_i) if self.ufunc.nin != 1 else "" + return ( + "Cannot cast ufunc {!r} input {}from {!r} to {!r} with casting " + "rule {!r}" + ).format( + self.ufunc.__name__, i_str, self.from_, self.to, self.casting + ) + + +@_display_as_base +class _UFuncOutputCastingError(_UFuncCastingError): + """ Thrown when a ufunc output cannot be casted """ + def __init__(self, ufunc, casting, from_, to, i): + super().__init__(ufunc, casting, from_, to) + self.out_i = i + + def __str__(self): + # only show the number if more than one output exists + i_str = "{} ".format(self.out_i) if self.ufunc.nout != 1 else "" + return ( + "Cannot cast ufunc {!r} output {}from {!r} to {!r} with casting " + "rule {!r}" + ).format( + self.ufunc.__name__, i_str, self.from_, self.to, self.casting + ) + + +@_display_as_base +class _ArrayMemoryError(MemoryError): + """ Thrown when an array cannot be allocated""" + def __init__(self, shape, dtype): + self.shape = shape + self.dtype = dtype + + @property + def _total_size(self): + num_bytes = self.dtype.itemsize + for dim in self.shape: + num_bytes *= dim + return num_bytes + + @staticmethod + def _size_to_string(num_bytes): + """ Convert a number of bytes into a binary size string """ + + # https://en.wikipedia.org/wiki/Binary_prefix + LOG2_STEP = 10 + STEP = 1024 + units = ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB'] + + unit_i = max(num_bytes.bit_length() - 1, 1) // LOG2_STEP + unit_val = 1 << (unit_i * LOG2_STEP) + n_units = num_bytes / unit_val + del unit_val + + # ensure we pick a unit that is correct after rounding + if round(n_units) == STEP: + unit_i += 1 + n_units /= STEP + + # deal with sizes so large that we don't have units for them + if unit_i >= len(units): + new_unit_i = len(units) - 1 + n_units *= 1 << ((unit_i - new_unit_i) * LOG2_STEP) + unit_i = new_unit_i + + unit_name = units[unit_i] + # format with a sensible number of digits + if unit_i == 0: + # no decimal point on bytes + return '{:.0f} {}'.format(n_units, unit_name) + elif round(n_units) < 1000: + # 3 significant figures, if none are dropped to the left of the . + return '{:#.3g} {}'.format(n_units, unit_name) + else: + # just give all the digits otherwise + return '{:#.0f} {}'.format(n_units, unit_name) + + def __str__(self): + size_str = self._size_to_string(self._total_size) + return ( + "Unable to allocate {} for an array with shape {} and data type {}" + .format(size_str, self.shape, self.dtype) + ) diff --git a/shared/package-files/75/75973ae495e5475979ba505a42b57390bbf4cfc2e0c17065ac11713b14520599/test_datetimes.py b/shared/package-files/75/75973ae495e5475979ba505a42b57390bbf4cfc2e0c17065ac11713b14520599/test_datetimes.py new file mode 100644 index 0000000000000000000000000000000000000000..4c94dc0d51f7e7de9fbd43150b1331282fbabb90 --- /dev/null +++ b/shared/package-files/75/75973ae495e5475979ba505a42b57390bbf4cfc2e0c17065ac11713b14520599/test_datetimes.py @@ -0,0 +1,606 @@ +import datetime as dt +from datetime import datetime + +import dateutil +import numpy as np +import pytest + +import pandas as pd +from pandas import ( + DataFrame, + DatetimeIndex, + Index, + MultiIndex, + Series, + Timestamp, + concat, + date_range, + to_timedelta, +) +import pandas._testing as tm + + +class TestDatetimeConcat: + def test_concat_datetime64_block(self): + rng = date_range("1/1/2000", periods=10) + + df = DataFrame({"time": rng}) + + result = concat([df, df]) + assert (result.iloc[:10]["time"] == rng).all() + assert (result.iloc[10:]["time"] == rng).all() + + def test_concat_datetime_datetime64_frame(self): + # GH#2624 + rows = [] + rows.append([datetime(2010, 1, 1), 1]) + rows.append([datetime(2010, 1, 2), "hi"]) + + df2_obj = DataFrame.from_records(rows, columns=["date", "test"]) + + ind = date_range(start="2000/1/1", freq="D", periods=10) + df1 = DataFrame({"date": ind, "test": range(10)}) + + # it works! + concat([df1, df2_obj]) + + def test_concat_datetime_timezone(self): + # GH 18523 + idx1 = date_range("2011-01-01", periods=3, freq="h", tz="Europe/Paris") + idx2 = date_range(start=idx1[0], end=idx1[-1], freq="h") + df1 = DataFrame({"a": [1, 2, 3]}, index=idx1) + df2 = DataFrame({"b": [1, 2, 3]}, index=idx2) + result = concat([df1, df2], axis=1) + + exp_idx = DatetimeIndex( + [ + "2011-01-01 00:00:00+01:00", + "2011-01-01 01:00:00+01:00", + "2011-01-01 02:00:00+01:00", + ], + dtype="M8[ns, Europe/Paris]", + freq="h", + ) + expected = DataFrame( + [[1, 1], [2, 2], [3, 3]], index=exp_idx, columns=["a", "b"] + ) + + tm.assert_frame_equal(result, expected) + + idx3 = date_range("2011-01-01", periods=3, freq="h", tz="Asia/Tokyo") + df3 = DataFrame({"b": [1, 2, 3]}, index=idx3) + result = concat([df1, df3], axis=1) + + exp_idx = DatetimeIndex( + [ + "2010-12-31 15:00:00+00:00", + "2010-12-31 16:00:00+00:00", + "2010-12-31 17:00:00+00:00", + "2010-12-31 23:00:00+00:00", + "2011-01-01 00:00:00+00:00", + "2011-01-01 01:00:00+00:00", + ] + ).as_unit("ns") + + expected = DataFrame( + [ + [np.nan, 1], + [np.nan, 2], + [np.nan, 3], + [1, np.nan], + [2, np.nan], + [3, np.nan], + ], + index=exp_idx, + columns=["a", "b"], + ) + + tm.assert_frame_equal(result, expected) + + # GH 13783: Concat after resample + result = concat([df1.resample("h").mean(), df2.resample("h").mean()], sort=True) + expected = DataFrame( + {"a": [1, 2, 3] + [np.nan] * 3, "b": [np.nan] * 3 + [1, 2, 3]}, + index=idx1.append(idx1), + ) + tm.assert_frame_equal(result, expected) + + def test_concat_datetimeindex_freq(self): + # GH 3232 + # Monotonic index result + dr = date_range("01-Jan-2013", periods=100, freq="50ms", tz="UTC") + data = list(range(100)) + expected = DataFrame(data, index=dr) + result = concat([expected[:50], expected[50:]]) + tm.assert_frame_equal(result, expected) + + # Non-monotonic index result + result = concat([expected[50:], expected[:50]]) + expected = DataFrame(data[50:] + data[:50], index=dr[50:].append(dr[:50])) + expected.index._data.freq = None + tm.assert_frame_equal(result, expected) + + def test_concat_multiindex_datetime_object_index(self): + # https://github.com/pandas-dev/pandas/issues/11058 + idx = Index( + [dt.date(2013, 1, 1), dt.date(2014, 1, 1), dt.date(2015, 1, 1)], + dtype="object", + ) + + s = Series( + ["a", "b"], + index=MultiIndex.from_arrays( + [ + [1, 2], + idx[:-1], + ], + names=["first", "second"], + ), + ) + s2 = Series( + ["a", "b"], + index=MultiIndex.from_arrays( + [[1, 2], idx[::2]], + names=["first", "second"], + ), + ) + mi = MultiIndex.from_arrays( + [[1, 2, 2], idx], + names=["first", "second"], + ) + assert mi.levels[1].dtype == object + + expected = DataFrame( + [["a", "a"], ["b", np.nan], [np.nan, "b"]], + index=mi, + ) + result = concat([s, s2], axis=1) + tm.assert_frame_equal(result, expected) + + def test_concat_NaT_series(self): + # GH 11693 + # test for merging NaT series with datetime series. + x = Series( + date_range("20151124 08:00", "20151124 09:00", freq="1h", tz="US/Eastern") + ) + y = Series(pd.NaT, index=[0, 1], dtype="datetime64[ns, US/Eastern]") + expected = Series([x[0], x[1], pd.NaT, pd.NaT]) + + result = concat([x, y], ignore_index=True) + tm.assert_series_equal(result, expected) + + # all NaT with tz + expected = Series(pd.NaT, index=range(4), dtype="datetime64[ns, US/Eastern]") + result = concat([y, y], ignore_index=True) + tm.assert_series_equal(result, expected) + + def test_concat_NaT_series2(self): + # without tz + x = Series(date_range("20151124 08:00", "20151124 09:00", freq="1h")) + y = Series(date_range("20151124 10:00", "20151124 11:00", freq="1h")) + y[:] = pd.NaT + expected = Series([x[0], x[1], pd.NaT, pd.NaT]) + result = concat([x, y], ignore_index=True) + tm.assert_series_equal(result, expected) + + # all NaT without tz + x[:] = pd.NaT + expected = Series(pd.NaT, index=range(4), dtype="datetime64[ns]") + result = concat([x, y], ignore_index=True) + tm.assert_series_equal(result, expected) + + @pytest.mark.parametrize("tz", [None, "UTC"]) + def test_concat_NaT_dataframes(self, tz): + # GH 12396 + + dti = DatetimeIndex([pd.NaT, pd.NaT], tz=tz) + first = DataFrame({0: dti}) + second = DataFrame( + [[Timestamp("2015/01/01", tz=tz)], [Timestamp("2016/01/01", tz=tz)]], + index=[2, 3], + ) + expected = DataFrame( + [ + pd.NaT, + pd.NaT, + Timestamp("2015/01/01", tz=tz), + Timestamp("2016/01/01", tz=tz), + ] + ) + + result = concat([first, second], axis=0) + tm.assert_frame_equal(result, expected) + + @pytest.mark.parametrize("tz1", [None, "UTC"]) + @pytest.mark.parametrize("tz2", [None, "UTC"]) + @pytest.mark.parametrize("item", [pd.NaT, Timestamp("20150101")]) + def test_concat_NaT_dataframes_all_NaT_axis_0( + self, tz1, tz2, item, using_array_manager + ): + # GH 12396 + + # tz-naive + first = DataFrame([[pd.NaT], [pd.NaT]]).apply(lambda x: x.dt.tz_localize(tz1)) + second = DataFrame([item]).apply(lambda x: x.dt.tz_localize(tz2)) + + result = concat([first, second], axis=0) + expected = DataFrame(Series([pd.NaT, pd.NaT, item], index=[0, 1, 0])) + expected = expected.apply(lambda x: x.dt.tz_localize(tz2)) + if tz1 != tz2: + expected = expected.astype(object) + if item is pd.NaT and not using_array_manager: + # GH#18463 + # TODO: setting nan here is to keep the test passing as we + # make assert_frame_equal stricter, but is nan really the + # ideal behavior here? + if tz1 is not None: + expected.iloc[-1, 0] = np.nan + else: + expected.iloc[:-1, 0] = np.nan + + tm.assert_frame_equal(result, expected) + + @pytest.mark.parametrize("tz1", [None, "UTC"]) + @pytest.mark.parametrize("tz2", [None, "UTC"]) + def test_concat_NaT_dataframes_all_NaT_axis_1(self, tz1, tz2): + # GH 12396 + + first = DataFrame(Series([pd.NaT, pd.NaT]).dt.tz_localize(tz1)) + second = DataFrame(Series([pd.NaT]).dt.tz_localize(tz2), columns=[1]) + expected = DataFrame( + { + 0: Series([pd.NaT, pd.NaT]).dt.tz_localize(tz1), + 1: Series([pd.NaT, pd.NaT]).dt.tz_localize(tz2), + } + ) + result = concat([first, second], axis=1) + tm.assert_frame_equal(result, expected) + + @pytest.mark.parametrize("tz1", [None, "UTC"]) + @pytest.mark.parametrize("tz2", [None, "UTC"]) + def test_concat_NaT_series_dataframe_all_NaT(self, tz1, tz2): + # GH 12396 + + # tz-naive + first = Series([pd.NaT, pd.NaT]).dt.tz_localize(tz1) + second = DataFrame( + [ + [Timestamp("2015/01/01", tz=tz2)], + [Timestamp("2016/01/01", tz=tz2)], + ], + index=[2, 3], + ) + + expected = DataFrame( + [ + pd.NaT, + pd.NaT, + Timestamp("2015/01/01", tz=tz2), + Timestamp("2016/01/01", tz=tz2), + ] + ) + if tz1 != tz2: + expected = expected.astype(object) + + result = concat([first, second]) + tm.assert_frame_equal(result, expected) + + +class TestTimezoneConcat: + def test_concat_tz_series(self): + # gh-11755: tz and no tz + x = Series(date_range("20151124 08:00", "20151124 09:00", freq="1h", tz="UTC")) + y = Series(date_range("2012-01-01", "2012-01-02")) + expected = Series([x[0], x[1], y[0], y[1]], dtype="object") + result = concat([x, y], ignore_index=True) + tm.assert_series_equal(result, expected) + + def test_concat_tz_series2(self): + # gh-11887: concat tz and object + x = Series(date_range("20151124 08:00", "20151124 09:00", freq="1h", tz="UTC")) + y = Series(["a", "b"]) + expected = Series([x[0], x[1], y[0], y[1]], dtype="object") + result = concat([x, y], ignore_index=True) + tm.assert_series_equal(result, expected) + + def test_concat_tz_series3(self, unit, unit2): + # see gh-12217 and gh-12306 + # Concatenating two UTC times + first = DataFrame([[datetime(2016, 1, 1)]], dtype=f"M8[{unit}]") + first[0] = first[0].dt.tz_localize("UTC") + + second = DataFrame([[datetime(2016, 1, 2)]], dtype=f"M8[{unit2}]") + second[0] = second[0].dt.tz_localize("UTC") + + result = concat([first, second]) + exp_unit = tm.get_finest_unit(unit, unit2) + assert result[0].dtype == f"datetime64[{exp_unit}, UTC]" + + def test_concat_tz_series4(self, unit, unit2): + # Concatenating two London times + first = DataFrame([[datetime(2016, 1, 1)]], dtype=f"M8[{unit}]") + first[0] = first[0].dt.tz_localize("Europe/London") + + second = DataFrame([[datetime(2016, 1, 2)]], dtype=f"M8[{unit2}]") + second[0] = second[0].dt.tz_localize("Europe/London") + + result = concat([first, second]) + exp_unit = tm.get_finest_unit(unit, unit2) + assert result[0].dtype == f"datetime64[{exp_unit}, Europe/London]" + + def test_concat_tz_series5(self, unit, unit2): + # Concatenating 2+1 London times + first = DataFrame( + [[datetime(2016, 1, 1)], [datetime(2016, 1, 2)]], dtype=f"M8[{unit}]" + ) + first[0] = first[0].dt.tz_localize("Europe/London") + + second = DataFrame([[datetime(2016, 1, 3)]], dtype=f"M8[{unit2}]") + second[0] = second[0].dt.tz_localize("Europe/London") + + result = concat([first, second]) + exp_unit = tm.get_finest_unit(unit, unit2) + assert result[0].dtype == f"datetime64[{exp_unit}, Europe/London]" + + def test_concat_tz_series6(self, unit, unit2): + # Concatenating 1+2 London times + first = DataFrame([[datetime(2016, 1, 1)]], dtype=f"M8[{unit}]") + first[0] = first[0].dt.tz_localize("Europe/London") + + second = DataFrame( + [[datetime(2016, 1, 2)], [datetime(2016, 1, 3)]], dtype=f"M8[{unit2}]" + ) + second[0] = second[0].dt.tz_localize("Europe/London") + + result = concat([first, second]) + exp_unit = tm.get_finest_unit(unit, unit2) + assert result[0].dtype == f"datetime64[{exp_unit}, Europe/London]" + + def test_concat_tz_series_tzlocal(self): + # see gh-13583 + x = [ + Timestamp("2011-01-01", tz=dateutil.tz.tzlocal()), + Timestamp("2011-02-01", tz=dateutil.tz.tzlocal()), + ] + y = [ + Timestamp("2012-01-01", tz=dateutil.tz.tzlocal()), + Timestamp("2012-02-01", tz=dateutil.tz.tzlocal()), + ] + + result = concat([Series(x), Series(y)], ignore_index=True) + tm.assert_series_equal(result, Series(x + y)) + assert result.dtype == "datetime64[ns, tzlocal()]" + + def test_concat_tz_series_with_datetimelike(self): + # see gh-12620: tz and timedelta + x = [ + Timestamp("2011-01-01", tz="US/Eastern"), + Timestamp("2011-02-01", tz="US/Eastern"), + ] + y = [pd.Timedelta("1 day"), pd.Timedelta("2 day")] + result = concat([Series(x), Series(y)], ignore_index=True) + tm.assert_series_equal(result, Series(x + y, dtype="object")) + + # tz and period + y = [pd.Period("2011-03", freq="M"), pd.Period("2011-04", freq="M")] + result = concat([Series(x), Series(y)], ignore_index=True) + tm.assert_series_equal(result, Series(x + y, dtype="object")) + + def test_concat_tz_frame(self): + df2 = DataFrame( + { + "A": Timestamp("20130102", tz="US/Eastern"), + "B": Timestamp("20130603", tz="CET"), + }, + index=range(5), + ) + + # concat + df3 = concat([df2.A.to_frame(), df2.B.to_frame()], axis=1) + tm.assert_frame_equal(df2, df3) + + def test_concat_multiple_tzs(self): + # GH#12467 + # combining datetime tz-aware and naive DataFrames + ts1 = Timestamp("2015-01-01", tz=None) + ts2 = Timestamp("2015-01-01", tz="UTC") + ts3 = Timestamp("2015-01-01", tz="EST") + + df1 = DataFrame({"time": [ts1]}) + df2 = DataFrame({"time": [ts2]}) + df3 = DataFrame({"time": [ts3]}) + + results = concat([df1, df2]).reset_index(drop=True) + expected = DataFrame({"time": [ts1, ts2]}, dtype=object) + tm.assert_frame_equal(results, expected) + + results = concat([df1, df3]).reset_index(drop=True) + expected = DataFrame({"time": [ts1, ts3]}, dtype=object) + tm.assert_frame_equal(results, expected) + + results = concat([df2, df3]).reset_index(drop=True) + expected = DataFrame({"time": [ts2, ts3]}) + tm.assert_frame_equal(results, expected) + + def test_concat_multiindex_with_tz(self): + # GH 6606 + df = DataFrame( + { + "dt": DatetimeIndex( + [ + datetime(2014, 1, 1), + datetime(2014, 1, 2), + datetime(2014, 1, 3), + ], + dtype="M8[ns, US/Pacific]", + ), + "b": ["A", "B", "C"], + "c": [1, 2, 3], + "d": [4, 5, 6], + } + ) + df = df.set_index(["dt", "b"]) + + exp_idx1 = DatetimeIndex( + ["2014-01-01", "2014-01-02", "2014-01-03"] * 2, + dtype="M8[ns, US/Pacific]", + name="dt", + ) + exp_idx2 = Index(["A", "B", "C"] * 2, name="b") + exp_idx = MultiIndex.from_arrays([exp_idx1, exp_idx2]) + expected = DataFrame( + {"c": [1, 2, 3] * 2, "d": [4, 5, 6] * 2}, index=exp_idx, columns=["c", "d"] + ) + + result = concat([df, df]) + tm.assert_frame_equal(result, expected) + + def test_concat_tz_not_aligned(self): + # GH#22796 + ts = pd.to_datetime([1, 2]).tz_localize("UTC") + a = DataFrame({"A": ts}) + b = DataFrame({"A": ts, "B": ts}) + result = concat([a, b], sort=True, ignore_index=True) + expected = DataFrame( + {"A": list(ts) + list(ts), "B": [pd.NaT, pd.NaT] + list(ts)} + ) + tm.assert_frame_equal(result, expected) + + @pytest.mark.parametrize( + "t1", + [ + "2015-01-01", + pytest.param( + pd.NaT, + marks=pytest.mark.xfail( + reason="GH23037 incorrect dtype when concatenating" + ), + ), + ], + ) + def test_concat_tz_NaT(self, t1): + # GH#22796 + # Concatenating tz-aware multicolumn DataFrames + ts1 = Timestamp(t1, tz="UTC") + ts2 = Timestamp("2015-01-01", tz="UTC") + ts3 = Timestamp("2015-01-01", tz="UTC") + + df1 = DataFrame([[ts1, ts2]]) + df2 = DataFrame([[ts3]]) + + result = concat([df1, df2]) + expected = DataFrame([[ts1, ts2], [ts3, pd.NaT]], index=[0, 0]) + + tm.assert_frame_equal(result, expected) + + def test_concat_tz_with_empty(self): + # GH 9188 + result = concat( + [DataFrame(date_range("2000", periods=1, tz="UTC")), DataFrame()] + ) + expected = DataFrame(date_range("2000", periods=1, tz="UTC")) + tm.assert_frame_equal(result, expected) + + +class TestPeriodConcat: + def test_concat_period_series(self): + x = Series(pd.PeriodIndex(["2015-11-01", "2015-12-01"], freq="D")) + y = Series(pd.PeriodIndex(["2015-10-01", "2016-01-01"], freq="D")) + expected = Series([x[0], x[1], y[0], y[1]], dtype="Period[D]") + result = concat([x, y], ignore_index=True) + tm.assert_series_equal(result, expected) + + def test_concat_period_multiple_freq_series(self): + x = Series(pd.PeriodIndex(["2015-11-01", "2015-12-01"], freq="D")) + y = Series(pd.PeriodIndex(["2015-10-01", "2016-01-01"], freq="M")) + expected = Series([x[0], x[1], y[0], y[1]], dtype="object") + result = concat([x, y], ignore_index=True) + tm.assert_series_equal(result, expected) + assert result.dtype == "object" + + def test_concat_period_other_series(self): + x = Series(pd.PeriodIndex(["2015-11-01", "2015-12-01"], freq="D")) + y = Series(pd.PeriodIndex(["2015-11-01", "2015-12-01"], freq="M")) + expected = Series([x[0], x[1], y[0], y[1]], dtype="object") + result = concat([x, y], ignore_index=True) + tm.assert_series_equal(result, expected) + assert result.dtype == "object" + + def test_concat_period_other_series2(self): + # non-period + x = Series(pd.PeriodIndex(["2015-11-01", "2015-12-01"], freq="D")) + y = Series(DatetimeIndex(["2015-11-01", "2015-12-01"])) + expected = Series([x[0], x[1], y[0], y[1]], dtype="object") + result = concat([x, y], ignore_index=True) + tm.assert_series_equal(result, expected) + assert result.dtype == "object" + + def test_concat_period_other_series3(self): + x = Series(pd.PeriodIndex(["2015-11-01", "2015-12-01"], freq="D")) + y = Series(["A", "B"]) + expected = Series([x[0], x[1], y[0], y[1]], dtype="object") + result = concat([x, y], ignore_index=True) + tm.assert_series_equal(result, expected) + assert result.dtype == "object" + + +def test_concat_timedelta64_block(): + rng = to_timedelta(np.arange(10), unit="s") + + df = DataFrame({"time": rng}) + + result = concat([df, df]) + tm.assert_frame_equal(result.iloc[:10], df) + tm.assert_frame_equal(result.iloc[10:], df) + + +def test_concat_multiindex_datetime_nat(): + # GH#44900 + left = DataFrame({"a": 1}, index=MultiIndex.from_tuples([(1, pd.NaT)])) + right = DataFrame( + {"b": 2}, index=MultiIndex.from_tuples([(1, pd.NaT), (2, pd.NaT)]) + ) + result = concat([left, right], axis="columns") + expected = DataFrame( + {"a": [1.0, np.nan], "b": 2}, MultiIndex.from_tuples([(1, pd.NaT), (2, pd.NaT)]) + ) + tm.assert_frame_equal(result, expected) + + +def test_concat_float_datetime64(using_array_manager): + # GH#32934 + df_time = DataFrame({"A": pd.array(["2000"], dtype="datetime64[ns]")}) + df_float = DataFrame({"A": pd.array([1.0], dtype="float64")}) + + expected = DataFrame( + { + "A": [ + pd.array(["2000"], dtype="datetime64[ns]")[0], + pd.array([1.0], dtype="float64")[0], + ] + }, + index=[0, 0], + ) + result = concat([df_time, df_float]) + tm.assert_frame_equal(result, expected) + + expected = DataFrame({"A": pd.array([], dtype="object")}) + result = concat([df_time.iloc[:0], df_float.iloc[:0]]) + tm.assert_frame_equal(result, expected) + + expected = DataFrame({"A": pd.array([1.0], dtype="object")}) + result = concat([df_time.iloc[:0], df_float]) + tm.assert_frame_equal(result, expected) + + if not using_array_manager: + expected = DataFrame({"A": pd.array(["2000"], dtype="datetime64[ns]")}) + msg = "The behavior of DataFrame concatenation with empty or all-NA entries" + with tm.assert_produces_warning(FutureWarning, match=msg): + result = concat([df_time, df_float.iloc[:0]]) + tm.assert_frame_equal(result, expected) + else: + expected = DataFrame({"A": pd.array(["2000"], dtype="datetime64[ns]")}).astype( + {"A": "object"} + ) + result = concat([df_time, df_float.iloc[:0]]) + tm.assert_frame_equal(result, expected) diff --git a/shared/package-files/75/7598eb7dc59a500f811d4b6eb732ce58f94e48d2d8cc1a9215eba4111e8bfdb0/gmpyrationalfield.py b/shared/package-files/75/7598eb7dc59a500f811d4b6eb732ce58f94e48d2d8cc1a9215eba4111e8bfdb0/gmpyrationalfield.py new file mode 100644 index 0000000000000000000000000000000000000000..10bae5b2b7b476f96ba06f637c549ee4afff4c6d --- /dev/null +++ b/shared/package-files/75/7598eb7dc59a500f811d4b6eb732ce58f94e48d2d8cc1a9215eba4111e8bfdb0/gmpyrationalfield.py @@ -0,0 +1,100 @@ +"""Implementation of :class:`GMPYRationalField` class. """ + + +from sympy.polys.domains.groundtypes import ( + GMPYRational, SymPyRational, + gmpy_numer, gmpy_denom, factorial as gmpy_factorial, +) +from sympy.polys.domains.rationalfield import RationalField +from sympy.polys.polyerrors import CoercionFailed +from sympy.utilities import public + +@public +class GMPYRationalField(RationalField): + """Rational field based on GMPY's ``mpq`` type. + + This will be the implementation of :ref:`QQ` if ``gmpy`` or ``gmpy2`` is + installed. Elements will be of type ``gmpy.mpq``. + """ + + dtype = GMPYRational + zero = dtype(0) + one = dtype(1) + tp = type(one) + alias = 'QQ_gmpy' + + def __init__(self): + pass + + def get_ring(self): + """Returns ring associated with ``self``. """ + from sympy.polys.domains import GMPYIntegerRing + return GMPYIntegerRing() + + def to_sympy(self, a): + """Convert ``a`` to a SymPy object. """ + return SymPyRational(int(gmpy_numer(a)), + int(gmpy_denom(a))) + + def from_sympy(self, a): + """Convert SymPy's Integer to ``dtype``. """ + if a.is_Rational: + return GMPYRational(a.p, a.q) + elif a.is_Float: + from sympy.polys.domains import RR + return GMPYRational(*map(int, RR.to_rational(a))) + else: + raise CoercionFailed("expected ``Rational`` object, got %s" % a) + + def from_ZZ_python(K1, a, K0): + """Convert a Python ``int`` object to ``dtype``. """ + return GMPYRational(a) + + def from_QQ_python(K1, a, K0): + """Convert a Python ``Fraction`` object to ``dtype``. """ + return GMPYRational(a.numerator, a.denominator) + + def from_ZZ_gmpy(K1, a, K0): + """Convert a GMPY ``mpz`` object to ``dtype``. """ + return GMPYRational(a) + + def from_QQ_gmpy(K1, a, K0): + """Convert a GMPY ``mpq`` object to ``dtype``. """ + return a + + def from_GaussianRationalField(K1, a, K0): + """Convert a ``GaussianElement`` object to ``dtype``. """ + if a.y == 0: + return GMPYRational(a.x) + + def from_RealField(K1, a, K0): + """Convert a mpmath ``mpf`` object to ``dtype``. """ + return GMPYRational(*map(int, K0.to_rational(a))) + + def exquo(self, a, b): + """Exact quotient of ``a`` and ``b``, implies ``__truediv__``. """ + return GMPYRational(a) / GMPYRational(b) + + def quo(self, a, b): + """Quotient of ``a`` and ``b``, implies ``__truediv__``. """ + return GMPYRational(a) / GMPYRational(b) + + def rem(self, a, b): + """Remainder of ``a`` and ``b``, implies nothing. """ + return self.zero + + def div(self, a, b): + """Division of ``a`` and ``b``, implies ``__truediv__``. """ + return GMPYRational(a) / GMPYRational(b), self.zero + + def numer(self, a): + """Returns numerator of ``a``. """ + return a.numerator + + def denom(self, a): + """Returns denominator of ``a``. """ + return a.denominator + + def factorial(self, a): + """Returns factorial of ``a``. """ + return GMPYRational(gmpy_factorial(int(a))) diff --git a/shared/package-files/75/7599113abfe4c7930b55d88ff674da1e221d417f7fab7df4fbb497ae0577a639/_perceptron.py b/shared/package-files/75/7599113abfe4c7930b55d88ff674da1e221d417f7fab7df4fbb497ae0577a639/_perceptron.py new file mode 100644 index 0000000000000000000000000000000000000000..e93200ba385faf037be75654061932ee6e886b7b --- /dev/null +++ b/shared/package-files/75/7599113abfe4c7930b55d88ff674da1e221d417f7fab7df4fbb497ae0577a639/_perceptron.py @@ -0,0 +1,226 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + +from numbers import Real + +from ..utils._param_validation import Interval, StrOptions +from ._stochastic_gradient import BaseSGDClassifier + + +class Perceptron(BaseSGDClassifier): + """Linear perceptron classifier. + + The implementation is a wrapper around :class:`~sklearn.linear_model.SGDClassifier` + by fixing the `loss` and `learning_rate` parameters as:: + + SGDClassifier(loss="perceptron", learning_rate="constant") + + Other available parameters are described below and are forwarded to + :class:`~sklearn.linear_model.SGDClassifier`. + + Read more in the :ref:`User Guide `. + + Parameters + ---------- + + penalty : {'l2','l1','elasticnet'}, default=None + The penalty (aka regularization term) to be used. + + alpha : float, default=0.0001 + Constant that multiplies the regularization term if regularization is + used. + + l1_ratio : float, default=0.15 + The Elastic Net mixing parameter, with `0 <= l1_ratio <= 1`. + `l1_ratio=0` corresponds to L2 penalty, `l1_ratio=1` to L1. + Only used if `penalty='elasticnet'`. + + .. versionadded:: 0.24 + + fit_intercept : bool, default=True + Whether the intercept should be estimated or not. If False, the + data is assumed to be already centered. + + max_iter : int, default=1000 + The maximum number of passes over the training data (aka epochs). + It only impacts the behavior in the ``fit`` method, and not the + :meth:`partial_fit` method. + + .. versionadded:: 0.19 + + tol : float or None, default=1e-3 + The stopping criterion. If it is not None, the iterations will stop + when (loss > previous_loss - tol). + + .. versionadded:: 0.19 + + shuffle : bool, default=True + Whether or not the training data should be shuffled after each epoch. + + verbose : int, default=0 + The verbosity level. + + eta0 : float, default=1 + Constant by which the updates are multiplied. + + n_jobs : int, default=None + The number of CPUs to use to do the OVA (One Versus All, for + multi-class problems) computation. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. + + random_state : int, RandomState instance or None, default=0 + Used to shuffle the training data, when ``shuffle`` is set to + ``True``. Pass an int for reproducible output across multiple + function calls. + See :term:`Glossary `. + + early_stopping : bool, default=False + Whether to use early stopping to terminate training when validation + score is not improving. If set to True, it will automatically set aside + a stratified fraction of training data as validation and terminate + training when validation score is not improving by at least `tol` for + `n_iter_no_change` consecutive epochs. + + .. versionadded:: 0.20 + + validation_fraction : float, default=0.1 + The proportion of training data to set aside as validation set for + early stopping. Must be between 0 and 1. + Only used if early_stopping is True. + + .. versionadded:: 0.20 + + n_iter_no_change : int, default=5 + Number of iterations with no improvement to wait before early stopping. + + .. versionadded:: 0.20 + + class_weight : dict, {class_label: weight} or "balanced", default=None + Preset for the class_weight fit parameter. + + Weights associated with classes. If not given, all classes + are supposed to have weight one. + + The "balanced" mode uses the values of y to automatically adjust + weights inversely proportional to class frequencies in the input data + as ``n_samples / (n_classes * np.bincount(y))``. + + warm_start : bool, default=False + When set to True, reuse the solution of the previous call to fit as + initialization, otherwise, just erase the previous solution. See + :term:`the Glossary `. + + Attributes + ---------- + classes_ : ndarray of shape (n_classes,) + The unique classes labels. + + coef_ : ndarray of shape (1, n_features) if n_classes == 2 else \ + (n_classes, n_features) + Weights assigned to the features. + + intercept_ : ndarray of shape (1,) if n_classes == 2 else (n_classes,) + Constants in decision function. + + n_features_in_ : int + Number of features seen during :term:`fit`. + + .. versionadded:: 0.24 + + feature_names_in_ : ndarray of shape (`n_features_in_`,) + Names of features seen during :term:`fit`. Defined only when `X` + has feature names that are all strings. + + .. versionadded:: 1.0 + + n_iter_ : int + The actual number of iterations to reach the stopping criterion. + For multiclass fits, it is the maximum over every binary fit. + + t_ : int + Number of weight updates performed during training. + Same as ``(n_iter_ * n_samples + 1)``. + + See Also + -------- + sklearn.linear_model.SGDClassifier : Linear classifiers + (SVM, logistic regression, etc.) with SGD training. + + Notes + ----- + ``Perceptron`` is a classification algorithm which shares the same + underlying implementation with ``SGDClassifier``. In fact, + ``Perceptron()`` is equivalent to `SGDClassifier(loss="perceptron", + eta0=1, learning_rate="constant", penalty=None)`. + + References + ---------- + https://en.wikipedia.org/wiki/Perceptron and references therein. + + Examples + -------- + >>> from sklearn.datasets import load_digits + >>> from sklearn.linear_model import Perceptron + >>> X, y = load_digits(return_X_y=True) + >>> clf = Perceptron(tol=1e-3, random_state=0) + >>> clf.fit(X, y) + Perceptron() + >>> clf.score(X, y) + 0.939... + """ + + _parameter_constraints: dict = {**BaseSGDClassifier._parameter_constraints} + _parameter_constraints.pop("loss") + _parameter_constraints.pop("average") + _parameter_constraints.update( + { + "penalty": [StrOptions({"l2", "l1", "elasticnet"}), None], + "alpha": [Interval(Real, 0, None, closed="left")], + "l1_ratio": [Interval(Real, 0, 1, closed="both")], + "eta0": [Interval(Real, 0, None, closed="left")], + } + ) + + def __init__( + self, + *, + penalty=None, + alpha=0.0001, + l1_ratio=0.15, + fit_intercept=True, + max_iter=1000, + tol=1e-3, + shuffle=True, + verbose=0, + eta0=1.0, + n_jobs=None, + random_state=0, + early_stopping=False, + validation_fraction=0.1, + n_iter_no_change=5, + class_weight=None, + warm_start=False, + ): + super().__init__( + loss="perceptron", + penalty=penalty, + alpha=alpha, + l1_ratio=l1_ratio, + fit_intercept=fit_intercept, + max_iter=max_iter, + tol=tol, + shuffle=shuffle, + verbose=verbose, + random_state=random_state, + learning_rate="constant", + eta0=eta0, + early_stopping=early_stopping, + validation_fraction=validation_fraction, + n_iter_no_change=n_iter_no_change, + power_t=0.5, + warm_start=warm_start, + class_weight=class_weight, + n_jobs=n_jobs, + ) diff --git a/shared/package-files/75/759bba151956b82248b0aed8358df43e7f9760d30bc439372409e1e1d861e4b8/microb b/shared/package-files/75/759bba151956b82248b0aed8358df43e7f9760d30bc439372409e1e1d861e4b8/microb new file mode 100644 index 0000000000000000000000000000000000000000..13025af0120ebc51dc4dac85eb37aa93ae67bd18 Binary files /dev/null and b/shared/package-files/75/759bba151956b82248b0aed8358df43e7f9760d30bc439372409e1e1d861e4b8/microb differ diff --git a/shared/package-files/75/759bba151956b82248b0aed8358df43e7f9760d30bc439372409e1e1d861e4b8/microbee b/shared/package-files/75/759bba151956b82248b0aed8358df43e7f9760d30bc439372409e1e1d861e4b8/microbee new file mode 100644 index 0000000000000000000000000000000000000000..13025af0120ebc51dc4dac85eb37aa93ae67bd18 Binary files /dev/null and b/shared/package-files/75/759bba151956b82248b0aed8358df43e7f9760d30bc439372409e1e1d861e4b8/microbee differ diff --git a/shared/package-files/75/759d6f0d9d14db0ea00c87b07926d4e19ea43e1ca35c8f466058f2bad08a1943/arima212_forecast.csv b/shared/package-files/75/759d6f0d9d14db0ea00c87b07926d4e19ea43e1ca35c8f466058f2bad08a1943/arima212_forecast.csv new file mode 100644 index 0000000000000000000000000000000000000000..a73ec00a47273fdbf131d29f0387e84d3b2415cc --- /dev/null +++ b/shared/package-files/75/759d6f0d9d14db0ea00c87b07926d4e19ea43e1ca35c8f466058f2bad08a1943/arima212_forecast.csv @@ -0,0 +1,224 @@ +dates, cpi, predict, stderr, conf1, conf2 +1950:1, 28.980,,,, +1950:2, 29.150, 29.848,, +1950:3, 29.350, 29.751,, +1950:4, 29.370, 29.925,, +1951:1, 29.540, 29.788,, +1951:2, 29.550, 30.005,, +1951:3, 29.750, 29.872,, +1951:4, 29.840, 30.181,, +1952:1, 29.810, 30.125,, +1952:2, 29.920, 30.154,, +1952:3, 29.980, 30.203,, +1952:4, 30.040, 30.290,, +1953:1, 30.210, 30.306,, +1953:2, 30.220, 30.535,, +1953:3, 30.380, 30.450,, +1953:4, 30.440, 30.721,, +1954:1, 30.480, 30.657,, +1954:2, 30.690, 30.793,, +1954:3, 30.750, 30.955,, +1954:4, 30.940, 31.034,, +1955:1, 30.950, 31.237,, +1955:2, 31.020, 31.194,, +1955:3, 31.120, 31.310,, +1955:4, 31.280, 31.371,, +1956:1, 31.380, 31.588,, +1956:2, 31.580, 31.629,, +1956:3, 31.650, 31.915,, +1956:4, 31.880, 31.882,, +1957:1, 32.280, 32.248,, +1957:2, 32.450, 32.601,, +1957:3, 32.850, 32.794,, +1957:4, 32.900, 33.245,, +1958:1, 33.100, 33.179,, +1958:2, 33.400, 33.502,, +1958:3, 33.700, 33.723,, +1958:4, 34.100, 34.119,, +1959:1, 34.400, 34.481,, +1959:2, 34.900, 34.819,, +1959:3, 35.300, 35.358,, +1959:4, 35.700, 35.737,, +1960:1, 36.300, 36.176,, +1960:2, 36.800, 36.821,, +1960:3, 37.300, 37.301,, +1960:4, 37.900, 37.844,, +1961:1, 38.500, 38.456,, +1961:2, 38.900, 39.082,, +1961:3, 39.400, 39.423,, +1961:4, 39.900, 39.995,, +1962:1, 40.100, 40.436,, +1962:2, 40.600, 40.599,, +1962:3, 40.900, 41.175,, +1962:4, 41.200, 41.354,, +1963:1, 41.500, 41.738,, +1963:2, 41.800, 41.936,, +1963:3, 42.200, 42.311,, +1963:4, 42.700, 42.658,, +1964:1, 43.700, 43.247,, +1964:2, 44.200, 44.354,, +1964:3, 45.600, 44.715,, +1964:4, 46.800, 46.538,, +1965:1, 48.100, 47.464,, +1965:2, 49.300, 49.162,, +1965:3, 51.000, 50.071,, +1965:4, 52.300, 52.276,, +1966:1, 53.000, 53.138,, +1966:2, 54.000, 54.101,, +1966:3, 54.900, 54.875,, +1966:4, 55.800, 55.948,, +1967:1, 56.100, 56.663,, +1967:2, 57.000, 56.919,, +1967:3, 57.900, 57.917,, +1967:4, 58.700, 58.733,, +1968:1, 60.000, 59.585,, +1968:2, 60.800, 60.985,, +1968:3, 61.600, 61.618,, +1968:4, 62.700, 62.545,, +1969:1, 63.900, 63.602,, +1969:2, 65.500, 64.917,, +1969:3, 67.100, 66.596,, +1969:4, 68.500, 68.249,, +1970:1, 70.600, 69.639,, +1970:2, 73.000, 72.023,, +1970:3, 75.200, 74.438,, +1970:4, 78.000, 76.768,, +1971:1, 80.900, 79.775,, +1971:2, 82.600, 82.748,, +1971:3, 84.700, 84.201,, +1971:4, 87.200, 86.591,, +1972:1, 89.100, 88.976,, +1972:2, 91.500, 90.888,, +1972:3, 93.400, 93.401,, +1972:4, 94.400, 95.103,, +1973:1, 95.000, 95.950,, +1973:2, 97.500, 96.342,, +1973:3, 98.100, 99.392,, +1973:4, 97.900, 99.031,, +1974:1, 98.800, 99.216,, +1974:2, 99.800, 99.751,, +1974:3, 100.800, 101.044,, +1974:4, 102.100, 101.727 ,, +1975:1, 103.300, 103.382 ,, +1975:2, 104.100, 104.251 ,, +1975:3, 105.100, 105.233 ,, +1975:4, 105.700, 106.052 ,, +1976:1, 107.000, 106.667 ,, +1976:2, 107.700, 108.081 ,, +1976:3, 108.500, 108.538 ,, +1976:4, 109.900, 109.523 ,, +1977:1, 108.700, 110.907 ,, +1977:2, 109.500, 108.963 ,, +1977:3, 110.200, 110.651 ,, +1977:4, 111.400, 110.524 ,, +1978:1, 112.700, 112.660 ,, +1978:2, 113.800, 113.230 ,, +1978:3, 115.000, 115.051 ,, +1978:4, 116.000, 115.662 ,, +1979:1, 117.200, 117.204 ,, +1979:2, 118.500, 117.975 ,, +1979:3, 119.900, 119.754 ,, +1979:4, 121.200, 120.802 ,, +1980:1, 123.100, 122.467 ,, +1980:2, 124.500, 124.261 ,, +1980:3, 125.400, 125.749 ,, +1980:4, 127.500, 126.429 ,, +1981:1, 128.900, 129.043 ,, +1981:2, 130.500, 129.915 ,, +1981:3, 133.400, 132.075 ,, +1981:4, 134.700, 134.922 ,, +1982:1, 135.100, 136.050 ,, +1982:2, 136.200, 136.239 ,, +1982:3, 137.200, 137.516 ,, +1982:4, 138.300, 138.258 ,, +1983:1, 139.400, 139.559 ,, +1983:2, 140.500, 140.434 ,, +1983:3, 141.700, 141.711 ,, +1983:4, 142.800, 142.753 ,, +1984:1, 143.800, 143.966 ,, +1984:2, 144.500, 144.807 ,, +1984:3, 145.600, 145.519 ,, +1984:4, 146.300, 146.646 ,, +1985:1, 147.200, 147.195 ,, +1985:2, 148.400, 148.223 ,, +1985:3, 149.400, 149.379 ,, +1985:4, 150.500, 150.396 ,, +1986:1, 151.800, 151.507 ,, +1986:2, 152.600, 152.878 ,, +1986:3, 153.500, 153.502 ,, +1986:4, 154.700, 154.540 ,, +1987:1, 156.100, 155.683 ,, +1987:2, 157.000, 157.240 ,, +1987:3, 158.200, 157.903 ,, +1987:4, 159.400, 159.379 ,, +1988:1, 159.900, 160.350 ,, +1988:2, 160.400, 160.856 ,, +1988:3, 161.500, 161.226 ,, +1988:4, 162.000, 162.540 ,, +1989:1, 162.200, 162.682 ,, +1989:2, 163.200, 163.025 ,, +1989:3, 163.900, 164.017 ,, +1989:4, 164.700, 164.677 ,, +1990:1, 165.900, 165.527 ,, +1990:2, 166.700, 166.815 ,, +1990:3, 168.100, 167.488 ,, +1990:4, 169.300, 169.190 ,, +1991:1, 170.900, 170.157 ,, +1991:2, 172.700, 172.157 ,, +1991:3, 173.900, 173.775 ,, +1991:4, 175.600, 175.092 ,, +1992:1, 176.400, 176.843 ,, +1992:2, 177.400, 177.401 ,, +1992:3, 177.600, 178.590 ,, +1992:4, 177.700, 178.310 ,, +1993:1, 179.300, 178.624 ,, +1993:2, 180.000, 180.330 ,, +1993:3, 181.200, 180.791 ,, +1993:4, 182.600, 182.320 ,, +1994:1, 183.200, 183.535 ,, +1994:2, 183.700, 184.132 ,, +1994:3, 184.900, 184.510 ,, +1994:4, 186.300, 185.955 ,, +1995:1, 187.400, 187.256 ,, +1995:2, 189.100, 188.443 ,, +1995:3, 190.800, 190.274 ,, +1995:4, 191.800, 191.988 ,, +1996:1, 193.800, 192.858 ,, +1996:2, 194.700, 195.254 ,, +1996:3, 199.200, 195.589 ,, +1996:4, 199.400, 201.698 ,, +1997:1, 200.700, 199.660 ,, +1997:2, 202.700, 203.065 ,, +1997:3, 201.900, 203.288 ,, +1997:4, 203.574, 203.327 ,, +1998:1, 205.920, 204.543 ,, +1998:2, 207.338, 207.635 ,, +1998:3, 209.133, 208.278 ,, +1998:4, 212.495, 210.909 ,, +1999:1, 213.997, 214.077 ,, +1999:2, 218.610, 215.531 ,, +1999:3, 216.889, 221.137 ,, +1999:4, 212.174, 217.006 ,, +2000:1, 212.671, 212.741 ,, +2000:2, 214.469, 213.240 ,, +2000:3, 216.385, 215.464,,, +2000:4,, 217.291, 0.7691, 215.784, 218.799 +2001:1,, 218.197, 1.2775, 215.693, 220.701 +2001:2,, 219.100, 1.6382, 215.889, 222.311 +2001:3,, 220.002, 2.0322, 216.019, 223.985 +2001:4,, 220.902, 2.3838, 216.230, 225.574 +2002:1,, 221.801, 2.7544, 216.403, 227.200 +2002:2,, 222.699, 3.1082, 216.607, 228.791 +2002:3,, 223.595, 3.4721, 216.790, 230.400 +2002:4,, 224.490, 3.8288, 216.986, 231.994 +2003:1,, 225.384, 4.1908, 217.170, 233.598 +2003:2,, 226.276, 4.5494, 217.360, 235.193 +2003:3,, 227.168, 4.9105, 217.544, 236.793 +2003:4,, 228.059, 5.2698, 217.730, 238.387 +2004:1,, 228.948, 5.6300, 217.914, 239.983 +2004:2,, 229.837, 5.9888, 218.099, 241.574 +2004:3,, 230.724, 6.3475, 218.283, 243.165 +2004:4,, 231.611, 6.7049, 218.470, 244.752 +2005:1,, 232.497, 7.0614, 218.657, 246.337 +2005:2,, 233.382, 7.4165, 218.846, 247.918 +2005:3,, 234.266, 7.7704, 219.037, 249.496 diff --git a/shared/package-files/75/759d77d3a4bc6be4a310327fde118a554c039803cefeb51709db92cbf1722c7b/README b/shared/package-files/75/759d77d3a4bc6be4a310327fde118a554c039803cefeb51709db92cbf1722c7b/README new file mode 100644 index 0000000000000000000000000000000000000000..7285a93894418f41d21ab0c8d67a16d157a46ec4 --- /dev/null +++ b/shared/package-files/75/759d77d3a4bc6be4a310327fde118a554c039803cefeb51709db92cbf1722c7b/README @@ -0,0 +1,44 @@ +This directory contains a collection of programs to demonstrate +the features of the Tk toolkit. The programs are all scripts for +"wish", a windowing shell. If wish has been installed on your path +then you can invoke any of the programs in this directory just +by typing its file name to your command shell under Unix. Otherwise +invoke wish with the file as its first argument, e.g., "wish hello". +The rest of this file contains a brief description of each program. +Files with names ending in ".tcl" are procedure packages used by one +or more of the demo programs; they can't be used as programs by +themselves so they aren't described below. + +hello - Creates a single button; if you click on it, a message + is typed and the application terminates. + +widget - Contains a collection of demonstrations of the widgets + currently available in the Tk library. Most of the .tcl + files are scripts for individual demos available through + the "widget" program. + +ixset - A simple Tk-based wrapper for the "xset" program, which + allows you to interactively query and set various X options + such as mouse acceleration and bell volume. Thanks to + Pierre David for contributing this example. + +rolodex - A mock-up of a simple rolodex application. It has much of + the user interface for such an application but no back-end + database. This program was written in response to Tom + LaStrange's toolkit benchmark challenge. + +tcolor - A color editor. Allows you to edit colors in several + different ways, and will also perform automatic updates + using "send". + +rmt - Allows you to "hook-up" remotely to any Tk application + on the display. Select an application with the menu, + then just type commands: they'll go to that application. + +timer - Displays a seconds timer with start and stop buttons. + Control-c and control-q cause it to exit. + +browse - A simple directory browser. Invoke it with and argument + giving the name of the directory you'd like to browse. + Double-click on files or subdirectories to browse them. + Control-c and control-q cause the program to exit. diff --git a/shared/package-files/75/759db65021b8801d4bec54d088b9fc031540cdb0042150cb6fa2f96446b29ab9/pcvt35 b/shared/package-files/75/759db65021b8801d4bec54d088b9fc031540cdb0042150cb6fa2f96446b29ab9/pcvt35 new file mode 100644 index 0000000000000000000000000000000000000000..98e1cb04c2e201fecdf1d911af1968c596d519c4 Binary files /dev/null and b/shared/package-files/75/759db65021b8801d4bec54d088b9fc031540cdb0042150cb6fa2f96446b29ab9/pcvt35 differ diff --git a/shared/package-files/75/759f16f9f927d00dc8e3509b42ef759af49c814ed22efc5f6230d7dbd1322231/test_buffer_protocol.py b/shared/package-files/75/759f16f9f927d00dc8e3509b42ef759af49c814ed22efc5f6230d7dbd1322231/test_buffer_protocol.py new file mode 100644 index 0000000000000000000000000000000000000000..b680d819e72e48e983405c3bf969d13544eb73a7 --- /dev/null +++ b/shared/package-files/75/759f16f9f927d00dc8e3509b42ef759af49c814ed22efc5f6230d7dbd1322231/test_buffer_protocol.py @@ -0,0 +1,289 @@ +import array + +import numpy as np + +from numba import jit +from numba.tests.support import TestCase, compile_function, MemoryLeakMixin +import unittest + + +@jit(nopython=True) +def len_usecase(buf): + return len(buf) + + +@jit(nopython=True) +def getitem_usecase(buf, i): + return buf[i] + + +@jit(nopython=True) +def getslice_usecase(buf, i, j): + s = buf[i:j] + return s[0] + 2 * s[-1] + + +@jit(nopython=True) +def setitem_usecase(buf, i, v): + buf[i] = v + + +@jit(nopython=True) +def iter_usecase(buf): + res = 0.0 + for i, x in enumerate(buf): + res += x + res *= i + 1 + return res + + +def attrgetter(attr): + code = """def func(x): + return x.%(attr)s +""" % locals() + pyfunc = compile_function("func", code, globals()) + return jit(nopython=True)(pyfunc) + + +contiguous_usecase = attrgetter("contiguous") +c_contiguous_usecase = attrgetter("c_contiguous") +f_contiguous_usecase = attrgetter("f_contiguous") +itemsize_usecase = attrgetter("itemsize") +nbytes_usecase = attrgetter("nbytes") +ndim_usecase = attrgetter("ndim") +readonly_usecase = attrgetter("readonly") +shape_usecase = attrgetter("shape") +strides_usecase = attrgetter("strides") + + +class TestBufferProtocol(MemoryLeakMixin, TestCase): + """ + Test operations on buffer-providing objects. + """ + + def _arrays(self): + n = 10 + for letter, offset in [ + ('b', -3), + ('B', 0), + ('h', -5000), + ('H', 40000), + ('i', -100000), + ('I', 1000000), + ('l', -100000), + ('L', 1000000), + ('q', -2**60), + ('Q', 2**63 + 1), + ('f', 1.5), + ('d', -1.5), + ]: + yield array.array(letter, [i + offset for i in range(n)]) + + def _memoryviews(self): + n = 10 + yield memoryview(bytearray(b"abcdefghi")) + yield memoryview(b"abcdefghi") + # Different item types + for dtype, start, stop in [ + ('int8', -10, 10), + ('uint8', 0, 10), + ('int16', -5000, 1000), + ('uint16', 40000, 50000), + ('int32', -100000, 100000), + ('uint32', 0, 1000000), + ('int64', -2**60, 10), + ('uint64', 0, 2**64 - 10), + ('float32', 1.5, 3.5), + ('float64', 1.5, 3.5), + ('complex64', -8j, 12 + 5j), + ('complex128', -8j, 12 + 5j), + ]: + yield memoryview(np.linspace(start, stop, n).astype(dtype)) + # Different layouts + arr = np.arange(12).reshape((3, 4)) + assert arr.flags.c_contiguous and not arr.flags.f_contiguous + yield memoryview(arr) + arr = arr.T + assert arr.flags.f_contiguous and not arr.flags.c_contiguous + yield memoryview(arr) + arr = arr[::2] + assert not arr.flags.f_contiguous and not arr.flags.c_contiguous + yield memoryview(arr) + + def _readonlies(self): + yield b"xyz" + yield memoryview(b"abcdefghi") + arr = np.arange(5) + arr.setflags(write=False) + yield memoryview(arr) + + def _check_unary(self, jitfunc, *args): + pyfunc = jitfunc.py_func + self.assertPreciseEqual(jitfunc(*args), pyfunc(*args)) + + def check_len(self, obj): + self._check_unary(len_usecase, obj) + + def check_iter(self, obj): + self._check_unary(iter_usecase, obj) + + def check_getitem(self, obj): + # Be careful to index all dimensions, since we don't support + # partial indexing yet. + def yield_indices(obj): + try: + shape = obj.shape + except AttributeError: + shape = len(obj), + for tup in np.ndindex(shape): + # Simple 1d buffer-providing objects usually don't support + # tuple indexing. + if len(tup) == 1: + yield tup[0] + else: + yield tup + + for i in yield_indices(obj): + try: + expected = obj[i] + except (NotImplementedError, TypeError): + if isinstance(obj, memoryview): + # The memoryview object doesn't support all codes yet, + # fall back on the underlying object. + expected = obj.obj[i] + else: + raise + self.assertPreciseEqual(getitem_usecase(obj, i), expected) + + def check_setitem(self, obj): + for i in range(len(obj)): + orig = list(obj) + val = obj[i] // 2 + 1 + setitem_usecase(obj, i, val) + self.assertEqual(obj[i], val) + for j, val in enumerate(orig): + if j != i: + self.assertEqual(obj[j], val) + + def check_getslice(self, obj): + self._check_unary(getslice_usecase, obj, 1, len(obj) - 1) + + def test_len(self): + self.check_len(bytearray(5)) + self.check_len(b"xyz") + for mem in self._memoryviews(): + self.check_len(mem) + for arr in self._arrays(): + self.check_len(arr) + for buf in self._readonlies(): + self.check_getitem(buf) + + def test_getitem(self): + self.check_getitem(bytearray(b"abc")) + self.check_getitem(b"xyz") + for mem in self._memoryviews(): + self.check_getitem(mem) + for arr in self._arrays(): + self.check_getitem(arr) + for buf in self._readonlies(): + self.check_getitem(buf) + + def test_getslice(self): + with self.assertTypingError(): + self.check_getslice(bytearray(b"abcde")) + self.check_getslice(b"xyzuvw") + self.check_getslice(memoryview(b"xyzuvw")) + with self.assertTypingError(): + self.check_getslice(array.array('i', range(10))) + for buf in self._readonlies(): + self.check_getitem(buf) + + def test_setitem(self): + self.check_setitem(bytearray(b"abcdefghi")) + for arr in self._arrays(): + self.check_setitem(arr) + for mem in self._memoryviews(): + self.check_getitem(mem) + # Read-only buffers + for buf in self._readonlies(): + with self.assertTypingError(): + self.check_setitem(buf) + + def test_iter(self): + self.check_iter(bytearray(b"abc")) + self.check_iter(b"xyz") + self.check_iter(memoryview(b"xyz")) + for arr in self._arrays(): + self.check_iter(arr) + for buf in self._readonlies(): + self.check_getitem(buf) + + +class TestMemoryView(MemoryLeakMixin, TestCase): + """ + Test memoryview-specific attributes and operations. + """ + + def _arrays(self): + arr = np.arange(12) + yield arr + arr = arr.reshape((3, 4)) + yield arr + yield arr.T + yield arr[::2] + arr.setflags(write=False) + yield arr + arr = np.zeros(()) + assert arr.ndim == 0 + yield arr + + def test_ndim(self): + for arr in self._arrays(): + m = memoryview(arr) + self.assertPreciseEqual(ndim_usecase(m), arr.ndim) + + def test_shape(self): + for arr in self._arrays(): + m = memoryview(arr) + self.assertPreciseEqual(shape_usecase(m), arr.shape) + + def test_strides(self): + for arr in self._arrays(): + m = memoryview(arr) + self.assertPreciseEqual(strides_usecase(m), arr.strides) + + def test_itemsize(self): + for arr in self._arrays(): + m = memoryview(arr) + self.assertPreciseEqual(itemsize_usecase(m), arr.itemsize) + + def test_nbytes(self): + for arr in self._arrays(): + m = memoryview(arr) + self.assertPreciseEqual(nbytes_usecase(m), arr.size * arr.itemsize) + + def test_readonly(self): + for arr in self._arrays(): + m = memoryview(arr) + self.assertIs(readonly_usecase(m), not arr.flags.writeable) + m = memoryview(b"xyz") + self.assertIs(readonly_usecase(m), True) + m = memoryview(bytearray(b"xyz")) + self.assertIs(readonly_usecase(m), False) + + def test_contiguous(self): + m = memoryview(bytearray(b"xyz")) + self.assertIs(contiguous_usecase(m), True) + self.assertIs(c_contiguous_usecase(m), True) + self.assertIs(f_contiguous_usecase(m), True) + for arr in self._arrays(): + m = memoryview(arr) + # Note `arr.flags.contiguous` is wrong (it mimics c_contiguous) + self.assertIs(contiguous_usecase(m), + arr.flags.f_contiguous or arr.flags.c_contiguous) + self.assertIs(c_contiguous_usecase(m), arr.flags.c_contiguous) + self.assertIs(f_contiguous_usecase(m), arr.flags.f_contiguous) + + +if __name__ == '__main__': + unittest.main() diff --git a/shared/package-files/75/759fdf5a20c9762cfd0c56b7646047d6ee7e7258de5eb398e43622c71c39acfe/test_classification_threshold.py b/shared/package-files/75/759fdf5a20c9762cfd0c56b7646047d6ee7e7258de5eb398e43622c71c39acfe/test_classification_threshold.py new file mode 100644 index 0000000000000000000000000000000000000000..1ba4dcea369748622d366df0477e3b7911873593 --- /dev/null +++ b/shared/package-files/75/759fdf5a20c9762cfd0c56b7646047d6ee7e7258de5eb398e43622c71c39acfe/test_classification_threshold.py @@ -0,0 +1,618 @@ +import numpy as np +import pytest + +from sklearn import config_context +from sklearn.base import clone +from sklearn.datasets import ( + load_breast_cancer, + load_iris, + make_classification, + make_multilabel_classification, +) +from sklearn.dummy import DummyClassifier +from sklearn.ensemble import GradientBoostingClassifier +from sklearn.exceptions import NotFittedError +from sklearn.linear_model import LogisticRegression +from sklearn.metrics import ( + balanced_accuracy_score, + f1_score, + fbeta_score, + make_scorer, +) +from sklearn.metrics._scorer import _CurveScorer +from sklearn.model_selection import ( + FixedThresholdClassifier, + StratifiedShuffleSplit, + TunedThresholdClassifierCV, +) +from sklearn.model_selection._classification_threshold import ( + _fit_and_score_over_thresholds, +) +from sklearn.pipeline import make_pipeline +from sklearn.preprocessing import StandardScaler +from sklearn.svm import SVC +from sklearn.tree import DecisionTreeClassifier +from sklearn.utils._mocking import CheckingClassifier +from sklearn.utils._testing import ( + _convert_container, + assert_allclose, + assert_array_equal, +) + + +def test_fit_and_score_over_thresholds_curve_scorers(): + """Check that `_fit_and_score_over_thresholds` returns thresholds in ascending order + for the different accepted curve scorers.""" + X, y = make_classification(n_samples=100, random_state=0) + train_idx, val_idx = np.arange(50), np.arange(50, 100) + classifier = LogisticRegression() + + curve_scorer = _CurveScorer( + score_func=balanced_accuracy_score, + sign=1, + response_method="predict_proba", + thresholds=10, + kwargs={}, + ) + scores, thresholds = _fit_and_score_over_thresholds( + classifier, + X, + y, + fit_params={}, + train_idx=train_idx, + val_idx=val_idx, + curve_scorer=curve_scorer, + score_params={}, + ) + + assert np.all(thresholds[:-1] <= thresholds[1:]) + assert isinstance(scores, np.ndarray) + assert np.logical_and(scores >= 0, scores <= 1).all() + + +def test_fit_and_score_over_thresholds_prefit(): + """Check the behaviour with a prefit classifier.""" + X, y = make_classification(n_samples=100, random_state=0) + + # `train_idx is None` to indicate that the classifier is prefit + train_idx, val_idx = None, np.arange(50, 100) + classifier = DecisionTreeClassifier(random_state=0).fit(X, y) + # make sure that the classifier memorized the full dataset such that + # we get perfect predictions and thus match the expected score + assert classifier.score(X[val_idx], y[val_idx]) == pytest.approx(1.0) + + curve_scorer = _CurveScorer( + score_func=balanced_accuracy_score, + sign=1, + response_method="predict_proba", + thresholds=2, + kwargs={}, + ) + scores, thresholds = _fit_and_score_over_thresholds( + classifier, + X, + y, + fit_params={}, + train_idx=train_idx, + val_idx=val_idx, + curve_scorer=curve_scorer, + score_params={}, + ) + assert np.all(thresholds[:-1] <= thresholds[1:]) + assert_allclose(scores, [0.5, 1.0]) + + +@config_context(enable_metadata_routing=True) +def test_fit_and_score_over_thresholds_sample_weight(): + """Check that we dispatch the sample-weight to fit and score the classifier.""" + X, y = load_iris(return_X_y=True) + X, y = X[:100], y[:100] # only 2 classes + + # create a dataset and repeat twice the sample of class #0 + X_repeated, y_repeated = np.vstack([X, X[y == 0]]), np.hstack([y, y[y == 0]]) + # create a sample weight vector that is equivalent to the repeated dataset + sample_weight = np.ones_like(y) + sample_weight[:50] *= 2 + + classifier = LogisticRegression() + train_repeated_idx = np.arange(X_repeated.shape[0]) + val_repeated_idx = np.arange(X_repeated.shape[0]) + curve_scorer = _CurveScorer( + score_func=balanced_accuracy_score, + sign=1, + response_method="predict_proba", + thresholds=10, + kwargs={}, + ) + scores_repeated, thresholds_repeated = _fit_and_score_over_thresholds( + classifier, + X_repeated, + y_repeated, + fit_params={}, + train_idx=train_repeated_idx, + val_idx=val_repeated_idx, + curve_scorer=curve_scorer, + score_params={}, + ) + + train_idx, val_idx = np.arange(X.shape[0]), np.arange(X.shape[0]) + scores, thresholds = _fit_and_score_over_thresholds( + classifier.set_fit_request(sample_weight=True), + X, + y, + fit_params={"sample_weight": sample_weight}, + train_idx=train_idx, + val_idx=val_idx, + curve_scorer=curve_scorer.set_score_request(sample_weight=True), + score_params={"sample_weight": sample_weight}, + ) + + assert_allclose(thresholds_repeated, thresholds) + assert_allclose(scores_repeated, scores) + + +@pytest.mark.parametrize("fit_params_type", ["list", "array"]) +@config_context(enable_metadata_routing=True) +def test_fit_and_score_over_thresholds_fit_params(fit_params_type): + """Check that we pass `fit_params` to the classifier when calling `fit`.""" + X, y = make_classification(n_samples=100, random_state=0) + fit_params = { + "a": _convert_container(y, fit_params_type), + "b": _convert_container(y, fit_params_type), + } + + classifier = CheckingClassifier(expected_fit_params=["a", "b"], random_state=0) + classifier.set_fit_request(a=True, b=True) + train_idx, val_idx = np.arange(50), np.arange(50, 100) + + curve_scorer = _CurveScorer( + score_func=balanced_accuracy_score, + sign=1, + response_method="predict_proba", + thresholds=10, + kwargs={}, + ) + _fit_and_score_over_thresholds( + classifier, + X, + y, + fit_params=fit_params, + train_idx=train_idx, + val_idx=val_idx, + curve_scorer=curve_scorer, + score_params={}, + ) + + +@pytest.mark.parametrize( + "data", + [ + make_classification(n_classes=3, n_clusters_per_class=1, random_state=0), + make_multilabel_classification(random_state=0), + ], +) +def test_tuned_threshold_classifier_no_binary(data): + """Check that we raise an informative error message for non-binary problem.""" + err_msg = "Only binary classification is supported." + with pytest.raises(ValueError, match=err_msg): + TunedThresholdClassifierCV(LogisticRegression()).fit(*data) + + +@pytest.mark.parametrize( + "params, err_type, err_msg", + [ + ( + {"cv": "prefit", "refit": True}, + ValueError, + "When cv='prefit', refit cannot be True.", + ), + ( + {"cv": 10, "refit": False}, + ValueError, + "When cv has several folds, refit cannot be False.", + ), + ( + {"cv": "prefit", "refit": False}, + NotFittedError, + "`estimator` must be fitted.", + ), + ], +) +def test_tuned_threshold_classifier_conflict_cv_refit(params, err_type, err_msg): + """Check that we raise an informative error message when `cv` and `refit` + cannot be used together. + """ + X, y = make_classification(n_samples=100, random_state=0) + with pytest.raises(err_type, match=err_msg): + TunedThresholdClassifierCV(LogisticRegression(), **params).fit(X, y) + + +@pytest.mark.parametrize( + "estimator", + [LogisticRegression(), SVC(), GradientBoostingClassifier(n_estimators=4)], +) +@pytest.mark.parametrize( + "response_method", ["predict_proba", "predict_log_proba", "decision_function"] +) +@pytest.mark.parametrize( + "ThresholdClassifier", [FixedThresholdClassifier, TunedThresholdClassifierCV] +) +def test_threshold_classifier_estimator_response_methods( + ThresholdClassifier, estimator, response_method +): + """Check that `TunedThresholdClassifierCV` exposes the same response methods as the + underlying estimator. + """ + X, y = make_classification(n_samples=100, random_state=0) + + model = ThresholdClassifier(estimator=estimator) + assert hasattr(model, response_method) == hasattr(estimator, response_method) + + model.fit(X, y) + assert hasattr(model, response_method) == hasattr(estimator, response_method) + + if hasattr(model, response_method): + y_pred_cutoff = getattr(model, response_method)(X) + y_pred_underlying_estimator = getattr(model.estimator_, response_method)(X) + + assert_allclose(y_pred_cutoff, y_pred_underlying_estimator) + + +@pytest.mark.parametrize( + "response_method", ["auto", "decision_function", "predict_proba"] +) +def test_tuned_threshold_classifier_without_constraint_value(response_method): + """Check that `TunedThresholdClassifierCV` is optimizing a given objective + metric.""" + X, y = load_breast_cancer(return_X_y=True) + # remove feature to degrade performances + X = X[:, :5] + + # make the problem completely imbalanced such that the balanced accuracy is low + indices_pos = np.flatnonzero(y == 1) + indices_pos = indices_pos[: indices_pos.size // 50] + indices_neg = np.flatnonzero(y == 0) + + X = np.vstack([X[indices_neg], X[indices_pos]]) + y = np.hstack([y[indices_neg], y[indices_pos]]) + + lr = make_pipeline(StandardScaler(), LogisticRegression()).fit(X, y) + thresholds = 100 + model = TunedThresholdClassifierCV( + estimator=lr, + scoring="balanced_accuracy", + response_method=response_method, + thresholds=thresholds, + store_cv_results=True, + ) + score_optimized = balanced_accuracy_score(y, model.fit(X, y).predict(X)) + score_baseline = balanced_accuracy_score(y, lr.predict(X)) + assert score_optimized > score_baseline + assert model.cv_results_["thresholds"].shape == (thresholds,) + assert model.cv_results_["scores"].shape == (thresholds,) + + +def test_tuned_threshold_classifier_metric_with_parameter(): + """Check that we can pass a metric with a parameter in addition check that + `f_beta` with `beta=1` is equivalent to `f1` and different from `f_beta` with + `beta=2`. + """ + X, y = load_breast_cancer(return_X_y=True) + lr = make_pipeline(StandardScaler(), LogisticRegression()).fit(X, y) + model_fbeta_1 = TunedThresholdClassifierCV( + estimator=lr, scoring=make_scorer(fbeta_score, beta=1) + ).fit(X, y) + model_fbeta_2 = TunedThresholdClassifierCV( + estimator=lr, scoring=make_scorer(fbeta_score, beta=2) + ).fit(X, y) + model_f1 = TunedThresholdClassifierCV( + estimator=lr, scoring=make_scorer(f1_score) + ).fit(X, y) + + assert model_fbeta_1.best_threshold_ == pytest.approx(model_f1.best_threshold_) + assert model_fbeta_1.best_threshold_ != pytest.approx(model_fbeta_2.best_threshold_) + + +@pytest.mark.parametrize( + "response_method", ["auto", "decision_function", "predict_proba"] +) +@pytest.mark.parametrize( + "metric", + [ + make_scorer(balanced_accuracy_score), + make_scorer(f1_score, pos_label="cancer"), + ], +) +def test_tuned_threshold_classifier_with_string_targets(response_method, metric): + """Check that targets represented by str are properly managed. + Also, check with several metrics to be sure that `pos_label` is properly + dispatched. + """ + X, y = load_breast_cancer(return_X_y=True) + # Encode numeric targets by meaningful strings. We purposely designed the class + # names such that the `pos_label` is the first alphabetically sorted class and thus + # encoded as 0. + classes = np.array(["cancer", "healthy"], dtype=object) + y = classes[y] + model = TunedThresholdClassifierCV( + estimator=make_pipeline(StandardScaler(), LogisticRegression()), + scoring=metric, + response_method=response_method, + thresholds=100, + ).fit(X, y) + assert_array_equal(model.classes_, np.sort(classes)) + y_pred = model.predict(X) + assert_array_equal(np.unique(y_pred), np.sort(classes)) + + +@pytest.mark.parametrize("with_sample_weight", [True, False]) +@config_context(enable_metadata_routing=True) +def test_tuned_threshold_classifier_refit(with_sample_weight, global_random_seed): + """Check the behaviour of the `refit` parameter.""" + rng = np.random.RandomState(global_random_seed) + X, y = make_classification(n_samples=100, random_state=0) + if with_sample_weight: + sample_weight = rng.randn(X.shape[0]) + sample_weight = np.abs(sample_weight, out=sample_weight) + else: + sample_weight = None + + # check that `estimator_` if fitted on the full dataset when `refit=True` + estimator = LogisticRegression().set_fit_request(sample_weight=True) + model = TunedThresholdClassifierCV(estimator, refit=True).fit( + X, y, sample_weight=sample_weight + ) + + assert model.estimator_ is not estimator + estimator.fit(X, y, sample_weight=sample_weight) + assert_allclose(model.estimator_.coef_, estimator.coef_) + assert_allclose(model.estimator_.intercept_, estimator.intercept_) + + # check that `estimator_` was not altered when `refit=False` and `cv="prefit"` + estimator = LogisticRegression().set_fit_request(sample_weight=True) + estimator.fit(X, y, sample_weight=sample_weight) + coef = estimator.coef_.copy() + model = TunedThresholdClassifierCV(estimator, cv="prefit", refit=False).fit( + X, y, sample_weight=sample_weight + ) + + assert model.estimator_ is estimator + assert_allclose(model.estimator_.coef_, coef) + + # check that we train `estimator_` on the training split of a given cross-validation + estimator = LogisticRegression().set_fit_request(sample_weight=True) + cv = [ + (np.arange(50), np.arange(50, 100)), + ] # single split + model = TunedThresholdClassifierCV(estimator, cv=cv, refit=False).fit( + X, y, sample_weight=sample_weight + ) + + assert model.estimator_ is not estimator + if with_sample_weight: + sw_train = sample_weight[cv[0][0]] + else: + sw_train = None + estimator.fit(X[cv[0][0]], y[cv[0][0]], sample_weight=sw_train) + assert_allclose(model.estimator_.coef_, estimator.coef_) + + +@pytest.mark.parametrize("fit_params_type", ["list", "array"]) +@config_context(enable_metadata_routing=True) +def test_tuned_threshold_classifier_fit_params(fit_params_type): + """Check that we pass `fit_params` to the classifier when calling `fit`.""" + X, y = make_classification(n_samples=100, random_state=0) + fit_params = { + "a": _convert_container(y, fit_params_type), + "b": _convert_container(y, fit_params_type), + } + + classifier = CheckingClassifier(expected_fit_params=["a", "b"], random_state=0) + classifier.set_fit_request(a=True, b=True) + model = TunedThresholdClassifierCV(classifier) + model.fit(X, y, **fit_params) + + +@config_context(enable_metadata_routing=True) +def test_tuned_threshold_classifier_cv_zeros_sample_weights_equivalence(): + """Check that passing removing some sample from the dataset `X` is + equivalent to passing a `sample_weight` with a factor 0.""" + X, y = load_iris(return_X_y=True) + # Scale the data to avoid any convergence issue + X = StandardScaler().fit_transform(X) + # Only use 2 classes and select samples such that 2-fold cross-validation + # split will lead to an equivalence with a `sample_weight` of 0 + X = np.vstack((X[:40], X[50:90])) + y = np.hstack((y[:40], y[50:90])) + sample_weight = np.zeros_like(y) + sample_weight[::2] = 1 + + estimator = LogisticRegression().set_fit_request(sample_weight=True) + model_without_weights = TunedThresholdClassifierCV(estimator, cv=2) + model_with_weights = clone(model_without_weights) + + model_with_weights.fit(X, y, sample_weight=sample_weight) + model_without_weights.fit(X[::2], y[::2]) + + assert_allclose( + model_with_weights.estimator_.coef_, model_without_weights.estimator_.coef_ + ) + + y_pred_with_weights = model_with_weights.predict_proba(X) + y_pred_without_weights = model_without_weights.predict_proba(X) + assert_allclose(y_pred_with_weights, y_pred_without_weights) + + +def test_tuned_threshold_classifier_thresholds_array(): + """Check that we can pass an array to `thresholds` and it is used as candidate + threshold internally.""" + X, y = make_classification(random_state=0) + estimator = LogisticRegression() + thresholds = np.linspace(0, 1, 11) + tuned_model = TunedThresholdClassifierCV( + estimator, + thresholds=thresholds, + response_method="predict_proba", + store_cv_results=True, + ).fit(X, y) + assert_allclose(tuned_model.cv_results_["thresholds"], thresholds) + + +@pytest.mark.parametrize("store_cv_results", [True, False]) +def test_tuned_threshold_classifier_store_cv_results(store_cv_results): + """Check that if `cv_results_` exists depending on `store_cv_results`.""" + X, y = make_classification(random_state=0) + estimator = LogisticRegression() + tuned_model = TunedThresholdClassifierCV( + estimator, store_cv_results=store_cv_results + ).fit(X, y) + if store_cv_results: + assert hasattr(tuned_model, "cv_results_") + else: + assert not hasattr(tuned_model, "cv_results_") + + +def test_tuned_threshold_classifier_cv_float(): + """Check the behaviour when `cv` is set to a float.""" + X, y = make_classification(random_state=0) + + # case where `refit=False` and cv is a float: the underlying estimator will be fit + # on the training set given by a ShuffleSplit. We check that we get the same model + # coefficients. + test_size = 0.3 + estimator = LogisticRegression() + tuned_model = TunedThresholdClassifierCV( + estimator, cv=test_size, refit=False, random_state=0 + ).fit(X, y) + tuned_model.fit(X, y) + + cv = StratifiedShuffleSplit(n_splits=1, test_size=test_size, random_state=0) + train_idx, val_idx = next(cv.split(X, y)) + cloned_estimator = clone(estimator).fit(X[train_idx], y[train_idx]) + + assert_allclose(tuned_model.estimator_.coef_, cloned_estimator.coef_) + + # case where `refit=True`, then the underlying estimator is fitted on the full + # dataset. + tuned_model.set_params(refit=True).fit(X, y) + cloned_estimator = clone(estimator).fit(X, y) + + assert_allclose(tuned_model.estimator_.coef_, cloned_estimator.coef_) + + +def test_tuned_threshold_classifier_error_constant_predictor(): + """Check that we raise a ValueError if the underlying classifier returns constant + probabilities such that we cannot find any threshold. + """ + X, y = make_classification(random_state=0) + estimator = DummyClassifier(strategy="constant", constant=1) + tuned_model = TunedThresholdClassifierCV(estimator, response_method="predict_proba") + err_msg = "The provided estimator makes constant predictions" + with pytest.raises(ValueError, match=err_msg): + tuned_model.fit(X, y) + + +@pytest.mark.parametrize( + "response_method", ["auto", "predict_proba", "decision_function"] +) +def test_fixed_threshold_classifier_equivalence_default(response_method): + """Check that `FixedThresholdClassifier` has the same behaviour as the vanilla + classifier. + """ + X, y = make_classification(random_state=0) + classifier = LogisticRegression().fit(X, y) + classifier_default_threshold = FixedThresholdClassifier( + estimator=clone(classifier), response_method=response_method + ) + classifier_default_threshold.fit(X, y) + + # emulate the response method that should take into account the `pos_label` + if response_method in ("auto", "predict_proba"): + y_score = classifier_default_threshold.predict_proba(X)[:, 1] + threshold = 0.5 + else: # response_method == "decision_function" + y_score = classifier_default_threshold.decision_function(X) + threshold = 0.0 + + y_pred_lr = (y_score >= threshold).astype(int) + assert_allclose(classifier_default_threshold.predict(X), y_pred_lr) + + +@pytest.mark.parametrize( + "response_method, threshold", [("predict_proba", 0.7), ("decision_function", 2.0)] +) +@pytest.mark.parametrize("pos_label", [0, 1]) +def test_fixed_threshold_classifier(response_method, threshold, pos_label): + """Check that applying `predict` lead to the same prediction as applying the + threshold to the output of the response method. + """ + X, y = make_classification(n_samples=50, random_state=0) + logistic_regression = LogisticRegression().fit(X, y) + model = FixedThresholdClassifier( + estimator=clone(logistic_regression), + threshold=threshold, + response_method=response_method, + pos_label=pos_label, + ).fit(X, y) + + # check that the underlying estimator is the same + assert_allclose(model.estimator_.coef_, logistic_regression.coef_) + + # emulate the response method that should take into account the `pos_label` + if response_method == "predict_proba": + y_score = model.predict_proba(X)[:, pos_label] + else: # response_method == "decision_function" + y_score = model.decision_function(X) + y_score = y_score if pos_label == 1 else -y_score + + # create a mapping from boolean values to class labels + map_to_label = np.array([0, 1]) if pos_label == 1 else np.array([1, 0]) + y_pred_lr = map_to_label[(y_score >= threshold).astype(int)] + assert_allclose(model.predict(X), y_pred_lr) + + for method in ("predict_proba", "predict_log_proba", "decision_function"): + assert_allclose( + getattr(model, method)(X), getattr(logistic_regression, method)(X) + ) + assert_allclose( + getattr(model.estimator_, method)(X), + getattr(logistic_regression, method)(X), + ) + + +@config_context(enable_metadata_routing=True) +def test_fixed_threshold_classifier_metadata_routing(): + """Check that everything works with metadata routing.""" + X, y = make_classification(random_state=0) + sample_weight = np.ones_like(y) + sample_weight[::2] = 2 + classifier = LogisticRegression().set_fit_request(sample_weight=True) + classifier.fit(X, y, sample_weight=sample_weight) + classifier_default_threshold = FixedThresholdClassifier(estimator=clone(classifier)) + classifier_default_threshold.fit(X, y, sample_weight=sample_weight) + assert_allclose(classifier_default_threshold.estimator_.coef_, classifier.coef_) + + +@pytest.mark.parametrize( + "method", ["predict_proba", "decision_function", "predict", "predict_log_proba"] +) +def test_fixed_threshold_classifier_fitted_estimator(method): + """Check that if the underlying estimator is already fitted, no fit is required.""" + X, y = make_classification(random_state=0) + classifier = LogisticRegression().fit(X, y) + fixed_threshold_classifier = FixedThresholdClassifier(estimator=classifier) + # This should not raise an error + getattr(fixed_threshold_classifier, method)(X) + + +def test_fixed_threshold_classifier_classes_(): + """Check that the classes_ attribute is properly set.""" + X, y = make_classification(random_state=0) + with pytest.raises( + AttributeError, match="The underlying estimator is not fitted yet." + ): + FixedThresholdClassifier(estimator=LogisticRegression()).classes_ + + classifier = LogisticRegression().fit(X, y) + fixed_threshold_classifier = FixedThresholdClassifier(estimator=classifier) + assert_array_equal(fixed_threshold_classifier.classes_, classifier.classes_) diff --git a/shared/package-files/75/75a416de44a4a7b89c0a69539fda42be769abb3eb493f7817f8c7551017e5d56/test_iterators.py b/shared/package-files/75/75a416de44a4a7b89c0a69539fda42be769abb3eb493f7817f8c7551017e5d56/test_iterators.py new file mode 100644 index 0000000000000000000000000000000000000000..47366f3803e1a76bc1ab27f5390db250071baf31 --- /dev/null +++ b/shared/package-files/75/75a416de44a4a7b89c0a69539fda42be769abb3eb493f7817f8c7551017e5d56/test_iterators.py @@ -0,0 +1,99 @@ +from numba import cuda +from numba.cuda.testing import unittest, CUDATestCase + +import numpy as np + + +class TestIterators(CUDATestCase): + + def test_enumerate(self): + @cuda.jit + def enumerator(x, error): + count = 0 + + for i, v in enumerate(x): + if count != i: + error[0] = 1 + if v != x[i]: + error[0] = 2 + + count += 1 + + if count != len(x): + error[0] = 3 + + x = np.asarray((10, 9, 8, 7, 6)) + error = np.zeros(1, dtype=np.int32) + + enumerator[1, 1](x, error) + self.assertEqual(error[0], 0) + + def _test_twoarg_function(self, f): + x = np.asarray((10, 9, 8, 7, 6)) + y = np.asarray((1, 2, 3, 4, 5)) + error = np.zeros(1, dtype=np.int32) + + f[1, 1](x, y, error) + self.assertEqual(error[0], 0) + + def test_zip(self): + @cuda.jit + def zipper(x, y, error): + i = 0 + + for xv, yv in zip(x, y): + if xv != x[i]: + error[0] = 1 + if yv != y[i]: + error[0] = 2 + + i += 1 + + if i != len(x): + error[0] = 3 + + self._test_twoarg_function(zipper) + + def test_enumerate_zip(self): + @cuda.jit + def enumerator_zipper(x, y, error): + count = 0 + + for i, (xv, yv) in enumerate(zip(x, y)): + if i != count: + error[0] = 1 + if xv != x[i]: + error[0] = 2 + if yv != y[i]: + error[0] = 3 + + count += 1 + + if count != len(x): + error[0] = 4 + + self._test_twoarg_function(enumerator_zipper) + + def test_zip_enumerate(self): + @cuda.jit + def zipper_enumerator(x, y, error): + count = 0 + + for (i, xv), yv in zip(enumerate(x), y): + if i != count: + error[0] = 1 + if xv != x[i]: + error[0] = 2 + if yv != y[i]: + error[0] = 3 + + count += 1 + + if count != len(x): + error[0] = 4 + + self._test_twoarg_function(zipper_enumerator) + + +if __name__ == '__main__': + unittest.main() diff --git a/shared/package-files/75/75a5e07029b97b3c75e84a42f37274e1da15e5f1d0d666652cb08480896d4596/__init__.pyi b/shared/package-files/75/75a5e07029b97b3c75e84a42f37274e1da15e5f1d0d666652cb08480896d4596/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..c298f74c5643edff67f3284091213d4eccb685ae --- /dev/null +++ b/shared/package-files/75/75a5e07029b97b3c75e84a42f37274e1da15e5f1d0d666652cb08480896d4596/__init__.pyi @@ -0,0 +1,109 @@ +import logging +from typing import Any, Optional, Text + +from .s3.connection import S3Connection + +Version: Any +UserAgent: Any +config: Any +BUCKET_NAME_RE: Any +TOO_LONG_DNS_NAME_COMP: Any +GENERATION_RE: Any +VERSION_RE: Any +ENDPOINTS_PATH: Any + +def init_logging(): ... + +class NullHandler(logging.Handler): + def emit(self, record): ... + +log: Any +perflog: Any + +def set_file_logger(name, filepath, level: Any = ..., format_string: Optional[Any] = ...): ... +def set_stream_logger(name, level: Any = ..., format_string: Optional[Any] = ...): ... +def connect_sqs(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_s3( + aws_access_key_id: Optional[Text] = ..., aws_secret_access_key: Optional[Text] = ..., **kwargs +) -> S3Connection: ... +def connect_gs(gs_access_key_id: Optional[Any] = ..., gs_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_ec2(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_elb(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_autoscale(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudwatch(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_sdb(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_fps(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_mturk(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudfront(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_vpc(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_rds(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_rds2(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_emr(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_sns(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_iam(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_route53(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudformation(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_euca( + host: Optional[Any] = ..., + aws_access_key_id: Optional[Any] = ..., + aws_secret_access_key: Optional[Any] = ..., + port: int = ..., + path: str = ..., + is_secure: bool = ..., + **kwargs, +): ... +def connect_glacier(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_ec2_endpoint(url, aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_walrus( + host: Optional[Any] = ..., + aws_access_key_id: Optional[Any] = ..., + aws_secret_access_key: Optional[Any] = ..., + port: int = ..., + path: str = ..., + is_secure: bool = ..., + **kwargs, +): ... +def connect_ses(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_sts(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_ia( + ia_access_key_id: Optional[Any] = ..., ia_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., **kwargs +): ... +def connect_dynamodb(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_swf(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudsearch(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudsearch2( + aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., sign_request: bool = ..., **kwargs +): ... +def connect_cloudsearchdomain(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_beanstalk(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_elastictranscoder(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_opsworks(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_redshift(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_support(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudtrail(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_directconnect(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_kinesis(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_logs(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_route53domains(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cognito_identity(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cognito_sync(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_kms(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_awslambda(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_codedeploy(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_configservice(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudhsm(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_ec2containerservice(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_machinelearning(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def storage_uri( + uri_str, + default_scheme: str = ..., + debug: int = ..., + validate: bool = ..., + bucket_storage_uri_class: Any = ..., + suppress_consec_slashes: bool = ..., + is_latest: bool = ..., +): ... +def storage_uri_for_key(key): ... + +# Explicitly mark this package as incomplete. +def __getattr__(name: str) -> Any: ... diff --git a/shared/package-files/75/75a6da22075c05405d30ce3edf989145297ccc1ae4dd4b79485e59509f20fd13/wy85 b/shared/package-files/75/75a6da22075c05405d30ce3edf989145297ccc1ae4dd4b79485e59509f20fd13/wy85 new file mode 100644 index 0000000000000000000000000000000000000000..04c4883c050bad7a89b52e85b58293e3b4e4052d Binary files /dev/null and b/shared/package-files/75/75a6da22075c05405d30ce3edf989145297ccc1ae4dd4b79485e59509f20fd13/wy85 differ diff --git a/shared/package-files/75/75a6da22075c05405d30ce3edf989145297ccc1ae4dd4b79485e59509f20fd13/wyse85 b/shared/package-files/75/75a6da22075c05405d30ce3edf989145297ccc1ae4dd4b79485e59509f20fd13/wyse85 new file mode 100644 index 0000000000000000000000000000000000000000..04c4883c050bad7a89b52e85b58293e3b4e4052d Binary files /dev/null and b/shared/package-files/75/75a6da22075c05405d30ce3edf989145297ccc1ae4dd4b79485e59509f20fd13/wyse85 differ diff --git a/shared/package-files/75/75a70efa1e815a83c89d86235094e8924fa6fa024589c23c8f08fb79efa11584/rshift.h b/shared/package-files/75/75a70efa1e815a83c89d86235094e8924fa6fa024589c23c8f08fb79efa11584/rshift.h new file mode 100644 index 0000000000000000000000000000000000000000..edb93bd66e6c9c107e8c9ab50caa58f5721c29bf --- /dev/null +++ b/shared/package-files/75/75a70efa1e815a83c89d86235094e8924fa6fa024589c23c8f08fb79efa11584/rshift.h @@ -0,0 +1,53 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::__rshift__.Scalar(Tensor self, Scalar other) -> Tensor +inline at::Tensor __rshift__(const at::Tensor & self, const at::Scalar & other) { + return at::_ops::__rshift___Scalar::call(self, other); +} + +// aten::__rshift__.Tensor(Tensor self, Tensor other) -> Tensor +inline at::Tensor __rshift__(const at::Tensor & self, const at::Tensor & other) { + return at::_ops::__rshift___Tensor::call(self, other); +} + +// aten::__rshift__.Scalar_out(Tensor self, Scalar other, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & __rshift___out(at::Tensor & out, const at::Tensor & self, const at::Scalar & other) { + return at::_ops::__rshift___Scalar_out::call(self, other, out); +} +// aten::__rshift__.Scalar_out(Tensor self, Scalar other, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & __rshift___outf(const at::Tensor & self, const at::Scalar & other, at::Tensor & out) { + return at::_ops::__rshift___Scalar_out::call(self, other, out); +} + +// aten::__rshift__.Tensor_out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & __rshift___out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other) { + return at::_ops::__rshift___Tensor_out::call(self, other, out); +} +// aten::__rshift__.Tensor_out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & __rshift___outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out) { + return at::_ops::__rshift___Tensor_out::call(self, other, out); +} + +} diff --git a/shared/package-files/75/75a7f74e9e4392757b9725ad19ee67d2357b53423fe87c283293a796009d62fd/hooks.pyi b/shared/package-files/75/75a7f74e9e4392757b9725ad19ee67d2357b53423fe87c283293a796009d62fd/hooks.pyi new file mode 100644 index 0000000000000000000000000000000000000000..f706016ca3869e8639bcfcefefacee34d4fc4011 --- /dev/null +++ b/shared/package-files/75/75a7f74e9e4392757b9725ad19ee67d2357b53423fe87c283293a796009d62fd/hooks.pyi @@ -0,0 +1,6 @@ +from typing import Any + +HOOKS: Any + +def default_hooks(): ... +def dispatch_hook(key, hooks, hook_data, **kwargs): ... diff --git a/shared/package-files/75/75a9bbf13a7f0a8cf26cda82636258806052dd473d16e254013f6807496894eb/tar.py b/shared/package-files/75/75a9bbf13a7f0a8cf26cda82636258806052dd473d16e254013f6807496894eb/tar.py new file mode 100644 index 0000000000000000000000000000000000000000..412e5ba4d2cdea7db090dc96412e697909a38d78 --- /dev/null +++ b/shared/package-files/75/75a9bbf13a7f0a8cf26cda82636258806052dd473d16e254013f6807496894eb/tar.py @@ -0,0 +1,124 @@ +import logging +import tarfile + +import fsspec +from fsspec.archive import AbstractArchiveFileSystem +from fsspec.compression import compr +from fsspec.utils import infer_compression + +typemap = {b"0": "file", b"5": "directory"} + +logger = logging.getLogger("tar") + + +class TarFileSystem(AbstractArchiveFileSystem): + """Compressed Tar archives as a file-system (read-only) + + Supports the following formats: + tar.gz, tar.bz2, tar.xz + """ + + root_marker = "" + protocol = "tar" + cachable = False + + def __init__( + self, + fo="", + index_store=None, + target_options=None, + target_protocol=None, + compression=None, + **kwargs, + ): + super().__init__(**kwargs) + target_options = target_options or {} + + if isinstance(fo, str): + self.of = fsspec.open(fo, protocol=target_protocol, **target_options) + fo = self.of.open() # keep the reference + + # Try to infer compression. + if compression is None: + name = None + + # Try different ways to get hold of the filename. `fo` might either + # be a `fsspec.LocalFileOpener`, an `io.BufferedReader` or an + # `fsspec.AbstractFileSystem` instance. + try: + # Amended io.BufferedReader or similar. + # This uses a "protocol extension" where original filenames are + # propagated to archive-like filesystems in order to let them + # infer the right compression appropriately. + if hasattr(fo, "original"): + name = fo.original + + # fsspec.LocalFileOpener + elif hasattr(fo, "path"): + name = fo.path + + # io.BufferedReader + elif hasattr(fo, "name"): + name = fo.name + + # fsspec.AbstractFileSystem + elif hasattr(fo, "info"): + name = fo.info()["name"] + + except Exception as ex: + logger.warning( + f"Unable to determine file name, not inferring compression: {ex}" + ) + + if name is not None: + compression = infer_compression(name) + logger.info(f"Inferred compression {compression} from file name {name}") + + if compression is not None: + # TODO: tarfile already implements compression with modes like "'r:gz'", + # but then would seek to offset in the file work? + fo = compr[compression](fo) + + self._fo_ref = fo + self.fo = fo # the whole instance is a context + self.tar = tarfile.TarFile(fileobj=self.fo) + self.dir_cache = None + + self.index_store = index_store + self.index = None + self._index() + + def _index(self): + # TODO: load and set saved index, if exists + out = {} + for ti in self.tar: + info = ti.get_info() + info["type"] = typemap.get(info["type"], "file") + name = ti.get_info()["name"].rstrip("/") + out[name] = (info, ti.offset_data) + + self.index = out + # TODO: save index to self.index_store here, if set + + def _get_dirs(self): + if self.dir_cache is not None: + return + + # This enables ls to get directories as children as well as files + self.dir_cache = { + dirname: {"name": dirname, "size": 0, "type": "directory"} + for dirname in self._all_dirnames(self.tar.getnames()) + } + for member in self.tar.getmembers(): + info = member.get_info() + info["name"] = info["name"].rstrip("/") + info["type"] = typemap.get(info["type"], "file") + self.dir_cache[info["name"]] = info + + def _open(self, path, mode="rb", **kwargs): + if mode != "rb": + raise ValueError("Read-only filesystem implementation") + details, offset = self.index[path] + if details["type"] != "file": + raise ValueError("Can only handle regular files") + return self.tar.extractfile(path) diff --git a/shared/package-files/75/75aa686ff901c9e66e51d36e8e78e5154b57ee9045784568f6a8798ea9689207/gv.msg b/shared/package-files/75/75aa686ff901c9e66e51d36e8e78e5154b57ee9045784568f6a8798ea9689207/gv.msg new file mode 100644 index 0000000000000000000000000000000000000000..7d332ad5c40b14dadf4ed342662787c283c7a772 --- /dev/null +++ b/shared/package-files/75/75aa686ff901c9e66e51d36e8e78e5154b57ee9045784568f6a8798ea9689207/gv.msg @@ -0,0 +1,47 @@ +# created by tools/loadICU.tcl -- do not edit +namespace eval ::tcl::clock { + ::msgcat::mcset gv DAYS_OF_WEEK_ABBREV [list \ + "Jed"\ + "Jel"\ + "Jem"\ + "Jerc"\ + "Jerd"\ + "Jeh"\ + "Jes"] + ::msgcat::mcset gv DAYS_OF_WEEK_FULL [list \ + "Jedoonee"\ + "Jelhein"\ + "Jemayrt"\ + "Jercean"\ + "Jerdein"\ + "Jeheiney"\ + "Jesarn"] + ::msgcat::mcset gv MONTHS_ABBREV [list \ + "J-guer"\ + "T-arree"\ + "Mayrnt"\ + "Avrril"\ + "Boaldyn"\ + "M-souree"\ + "J-souree"\ + "Luanistyn"\ + "M-fouyir"\ + "J-fouyir"\ + "M.Houney"\ + "M.Nollick"\ + ""] + ::msgcat::mcset gv MONTHS_FULL [list \ + "Jerrey-geuree"\ + "Toshiaght-arree"\ + "Mayrnt"\ + "Averil"\ + "Boaldyn"\ + "Mean-souree"\ + "Jerrey-souree"\ + "Luanistyn"\ + "Mean-fouyir"\ + "Jerrey-fouyir"\ + "Mee Houney"\ + "Mee ny Nollick"\ + ""] +} diff --git a/shared/package-files/75/75ad3cb4c8c8b08c3c87df9658e8dec0bf6fefaa3ebabdfee35b437adddcfbcf/gnutls.pc b/shared/package-files/75/75ad3cb4c8c8b08c3c87df9658e8dec0bf6fefaa3ebabdfee35b437adddcfbcf/gnutls.pc new file mode 100644 index 0000000000000000000000000000000000000000..33e93c189d972b038efebfffcb20851bf7a5a6be --- /dev/null +++ b/shared/package-files/75/75ad3cb4c8c8b08c3c87df9658e8dec0bf6fefaa3ebabdfee35b437adddcfbcf/gnutls.pc @@ -0,0 +1,24 @@ +# Process this file with autoconf to produce a pkg-config metadata file. + +# Copyright (C) 2004-2012 Free Software Foundation, Inc. + +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. This file is offered as-is, +# without any warranty. + +# Author: Simon Josefsson + +prefix=/opt/conda +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: GnuTLS +Description: Transport Security Layer implementation for the GNU system +URL: https://www.gnutls.org/ +Version: 3.6.15 +Libs: -L${libdir} -lgnutls +Libs.private: -pthread -lgmp -lunistring -latomic +Requires.private: nettle, hogweed, libtasn1, libidn2 +Cflags: -I${includedir} diff --git a/shared/package-files/75/75ad6bd38f9a074b35bf83d1e1dfd32ab79d5e9564651fa496e430d6ad3b57e5/tz.pyi b/shared/package-files/75/75ad6bd38f9a074b35bf83d1e1dfd32ab79d5e9564651fa496e430d6ad3b57e5/tz.pyi new file mode 100644 index 0000000000000000000000000000000000000000..7719adb1b15800a733af6a056849ed67c02052a4 --- /dev/null +++ b/shared/package-files/75/75ad6bd38f9a074b35bf83d1e1dfd32ab79d5e9564651fa496e430d6ad3b57e5/tz.pyi @@ -0,0 +1,33 @@ +from datetime import datetime +from typing import Any, Optional, Union + +from django.template.base import FilterExpression, NodeList, Parser, Token +from django.utils.timezone import FixedOffset + +from django.template import Node + +register: Any + +class datetimeobject(datetime): ... + +def localtime(value: Optional[Union[datetime, str]]) -> Any: ... +def utc(value: Optional[Union[datetime, str]]) -> Any: ... +def do_timezone(value: Optional[Union[datetime, str]], arg: Optional[Union[FixedOffset, str]]) -> Any: ... + +class LocalTimeNode(Node): + nodelist: NodeList = ... + use_tz: bool = ... + def __init__(self, nodelist: NodeList, use_tz: bool) -> None: ... + +class TimezoneNode(Node): + nodelist: NodeList = ... + tz: FilterExpression = ... + def __init__(self, nodelist: NodeList, tz: FilterExpression) -> None: ... + +class GetCurrentTimezoneNode(Node): + variable: str = ... + def __init__(self, variable: str) -> None: ... + +def localtime_tag(parser: Parser, token: Token) -> LocalTimeNode: ... +def timezone_tag(parser: Parser, token: Token) -> TimezoneNode: ... +def get_current_timezone_tag(parser: Parser, token: Token) -> GetCurrentTimezoneNode: ... diff --git a/shared/package-files/75/75aecda0a7141714bbf0820402c63a917ccbfa6382ad5d32ca115641437aa7c9/array.py b/shared/package-files/75/75aecda0a7141714bbf0820402c63a917ccbfa6382ad5d32ca115641437aa7c9/array.py new file mode 100644 index 0000000000000000000000000000000000000000..2306f5974ba186587dedb1159d64374601f55c86 --- /dev/null +++ b/shared/package-files/75/75aecda0a7141714bbf0820402c63a917ccbfa6382ad5d32ca115641437aa7c9/array.py @@ -0,0 +1,188 @@ +from __future__ import annotations + +import datetime as dt +from typing import ( + TYPE_CHECKING, + Any, + cast, +) + +import numpy as np + +from pandas.core.dtypes.dtypes import register_extension_dtype + +from pandas.api.extensions import ( + ExtensionArray, + ExtensionDtype, +) +from pandas.api.types import pandas_dtype + +if TYPE_CHECKING: + from collections.abc import Sequence + + from pandas._typing import ( + Dtype, + PositionalIndexer, + ) + + +@register_extension_dtype +class DateDtype(ExtensionDtype): + @property + def type(self): + return dt.date + + @property + def name(self): + return "DateDtype" + + @classmethod + def construct_from_string(cls, string: str): + if not isinstance(string, str): + raise TypeError( + f"'construct_from_string' expects a string, got {type(string)}" + ) + + if string == cls.__name__: + return cls() + else: + raise TypeError(f"Cannot construct a '{cls.__name__}' from '{string}'") + + @classmethod + def construct_array_type(cls): + return DateArray + + @property + def na_value(self): + return dt.date.min + + def __repr__(self) -> str: + return self.name + + +class DateArray(ExtensionArray): + def __init__( + self, + dates: ( + dt.date + | Sequence[dt.date] + | tuple[np.ndarray, np.ndarray, np.ndarray] + | np.ndarray + ), + ) -> None: + if isinstance(dates, dt.date): + self._year = np.array([dates.year]) + self._month = np.array([dates.month]) + self._day = np.array([dates.year]) + return + + ldates = len(dates) + if isinstance(dates, list): + # pre-allocate the arrays since we know the size before hand + self._year = np.zeros(ldates, dtype=np.uint16) # 65535 (0, 9999) + self._month = np.zeros(ldates, dtype=np.uint8) # 255 (1, 31) + self._day = np.zeros(ldates, dtype=np.uint8) # 255 (1, 12) + # populate them + for i, (y, m, d) in enumerate( + (date.year, date.month, date.day) for date in dates + ): + self._year[i] = y + self._month[i] = m + self._day[i] = d + + elif isinstance(dates, tuple): + # only support triples + if ldates != 3: + raise ValueError("only triples are valid") + # check if all elements have the same type + if any(not isinstance(x, np.ndarray) for x in dates): + raise TypeError("invalid type") + ly, lm, ld = (len(cast(np.ndarray, d)) for d in dates) + if not ly == lm == ld: + raise ValueError( + f"tuple members must have the same length: {(ly, lm, ld)}" + ) + self._year = dates[0].astype(np.uint16) + self._month = dates[1].astype(np.uint8) + self._day = dates[2].astype(np.uint8) + + elif isinstance(dates, np.ndarray) and dates.dtype == "U10": + self._year = np.zeros(ldates, dtype=np.uint16) # 65535 (0, 9999) + self._month = np.zeros(ldates, dtype=np.uint8) # 255 (1, 31) + self._day = np.zeros(ldates, dtype=np.uint8) # 255 (1, 12) + + # error: "object_" object is not iterable + obj = np.char.split(dates, sep="-") + for (i,), (y, m, d) in np.ndenumerate(obj): # type: ignore[misc] + self._year[i] = int(y) + self._month[i] = int(m) + self._day[i] = int(d) + + else: + raise TypeError(f"{type(dates)} is not supported") + + @property + def dtype(self) -> ExtensionDtype: + return DateDtype() + + def astype(self, dtype, copy=True): + dtype = pandas_dtype(dtype) + + if isinstance(dtype, DateDtype): + data = self.copy() if copy else self + else: + data = self.to_numpy(dtype=dtype, copy=copy, na_value=dt.date.min) + + return data + + @property + def nbytes(self) -> int: + return self._year.nbytes + self._month.nbytes + self._day.nbytes + + def __len__(self) -> int: + return len(self._year) # all 3 arrays are enforced to have the same length + + def __getitem__(self, item: PositionalIndexer): + if isinstance(item, int): + return dt.date(self._year[item], self._month[item], self._day[item]) + else: + raise NotImplementedError("only ints are supported as indexes") + + def __setitem__(self, key: int | slice | np.ndarray, value: Any) -> None: + if not isinstance(key, int): + raise NotImplementedError("only ints are supported as indexes") + + if not isinstance(value, dt.date): + raise TypeError("you can only set datetime.date types") + + self._year[key] = value.year + self._month[key] = value.month + self._day[key] = value.day + + def __repr__(self) -> str: + return f"DateArray{list(zip(self._year, self._month, self._day))}" + + def copy(self) -> DateArray: + return DateArray((self._year.copy(), self._month.copy(), self._day.copy())) + + def isna(self) -> np.ndarray: + return np.logical_and( + np.logical_and( + self._year == dt.date.min.year, self._month == dt.date.min.month + ), + self._day == dt.date.min.day, + ) + + @classmethod + def _from_sequence(cls, scalars, *, dtype: Dtype | None = None, copy=False): + if isinstance(scalars, dt.date): + raise TypeError + elif isinstance(scalars, DateArray): + if dtype is not None: + return scalars.astype(dtype, copy=copy) + if copy: + return scalars.copy() + return scalars[:] + elif isinstance(scalars, np.ndarray): + scalars = scalars.astype("U10") # 10 chars for yyyy-mm-dd + return DateArray(scalars) diff --git a/shared/package-files/75/75afb8ee0276e8b5214c2d6b5bb8cb74e07e109c7a3be1f1e86cae5d4c75a464/basic_strategy.py b/shared/package-files/75/75afb8ee0276e8b5214c2d6b5bb8cb74e07e109c7a3be1f1e86cae5d4c75a464/basic_strategy.py new file mode 100644 index 0000000000000000000000000000000000000000..80055281236fa9a7c186d00d0363eb947a22755b --- /dev/null +++ b/shared/package-files/75/75afb8ee0276e8b5214c2d6b5bb8cb74e07e109c7a3be1f1e86cae5d4c75a464/basic_strategy.py @@ -0,0 +1,184 @@ +import itertools +from dataclasses import dataclass + +from typing import List, Tuple + +from torch.distributed._tensor.op_schema import OpStrategy, PlacementStrategy +from torch.distributed._tensor.placement_types import ( + _Partial, + DTensorSpec, + Placement, + Replicate, + Shard, +) + +from torch.distributed.device_mesh import DeviceMesh + + +@dataclass +class EinsumDims: + contracting_dims: List[str] + batch_dims: List[str] + lhs_out_only_dims: List[str] + rhs_out_only_dims: List[str] + + @classmethod + def parse_equation(cls, equation: str) -> Tuple[List[str], str]: + # parse einop equation and extract arg specs + """ + Parse the einsum equation str to input dim chars and output dim char + """ + inputs, outputs = equation.split("->") + input_dims, output_dims = inputs.split(","), outputs.split(",") + + # NOTE: only support at most two inputs, and single output + # extend to support more inputs if needed in future + assert len(input_dims) <= 2, "Only support at most two inputs" + assert len(output_dims) == 1, "Only support single output" + output_dim = output_dims[0] + return input_dims, output_dim + + @classmethod + def parse_dims(cls, input_dims: List[str], output_dim: str) -> "EinsumDims": + """ + Parse the dims and extract the contracting, batch, and free dimensions + for the left and right hand sides. + """ + dim_char_set = set() + for input_dim in input_dims: + for input_char in list(input_dim): + dim_char_set.add(input_char) + + # get a determinisitc order of all dim chars + all_dim_chars = sorted(dim_char_set) + + # parse input and output dimensions + lhs_out_only_dims, rhs_out_only_dims = [], [] + batch_dims, contracting_dims = [], [] + + for dim_char in all_dim_chars: + if dim_char not in output_dim: + contracting_dims.append(dim_char) + else: + is_batch_dim = True + for input_dim in input_dims: + is_batch_dim = is_batch_dim and dim_char in input_dim + + if is_batch_dim: + batch_dims.append(dim_char) + else: + assert ( + len(input_dims) == 2 + ), "free dimension only supported for two inputs!" + lhs, rhs = input_dims + if dim_char in lhs: + lhs_out_only_dims.append(dim_char) + elif dim_char in rhs: + rhs_out_only_dims.append(dim_char) + else: + raise RuntimeError("Invalid dimension character") + + return cls( + contracting_dims=contracting_dims, + batch_dims=batch_dims, + lhs_out_only_dims=lhs_out_only_dims, + rhs_out_only_dims=rhs_out_only_dims, + ) + + +def gen_einsum_strategies( + equation: str, + mesh: DeviceMesh, + *, + linearity: bool = False, +) -> OpStrategy: + """ + Generate a strategy list for the ops that follow einsum style notation. + """ + # parse einop equation and extract dims + input_dims, output_dim = EinsumDims.parse_equation(equation) + edims = EinsumDims.parse_dims(input_dims, output_dim) + + all_mesh_dim_strategies = [] + + # generate strategies for each mesh dim + for mesh_dim in range(mesh.ndim): + mesh_dim_strategies = [] + + # placement list stores placements of [output, input1, input2, ...] + # first we always have replicate all for inputs and output + placement_list: List[Placement] = [Replicate()] * (len(input_dims) + 1) + mesh_dim_strategies.append(placement_list) + + if mesh.size(mesh_dim) <= 1: + # only replicate strategy for mesh dim with size 1 + # TODO: see if this is valid for the submesh case + continue + + # split batch dim + for batch_dim in edims.batch_dims: + output_batch_dim = output_dim.index(batch_dim) + placement_list = [Shard(output_batch_dim)] + for input_dim in input_dims: + input_batch_dim = input_dim.index(batch_dim) + placement_list.append(Shard(input_batch_dim)) + + mesh_dim_strategies.append(placement_list) + + # split contracting dim + for contracting_dim in edims.contracting_dims: + placement_list = [_Partial()] + for input_dim in input_dims: + input_contracting_dim = input_dim.index(contracting_dim) + placement_list.append(Shard(input_contracting_dim)) + + mesh_dim_strategies.append(placement_list) + + # split lhs free dim + for lhs_dim in edims.lhs_out_only_dims: + lhs_free_dim = output_dim.index(lhs_dim) + # this means split the lhs input and output + # i.e. S(0), R -> S(0) + lhs_placement_list: List[Placement] = [ + Shard(lhs_free_dim), + Shard(lhs_free_dim), + Replicate(), + ] + mesh_dim_strategies.append(lhs_placement_list) + + # split rhs free dim + for rhs_dim in edims.rhs_out_only_dims: + rhs_free_dim = output_dim.index(rhs_dim) + rhs_placement_list: List[Placement] = [ + Shard(rhs_free_dim), + Replicate(), + Shard(rhs_free_dim), + ] + mesh_dim_strategies.append(rhs_placement_list) + + # linearity strategy + if linearity: + linearity_placement_list: List[Placement] = [_Partial()] + for input_dim in input_dims: + linearity_placement_list.append(_Partial()) + mesh_dim_strategies.append(linearity_placement_list) + + all_mesh_dim_strategies.append(mesh_dim_strategies) + + # generate strategies for entire mesh + strategy_combs = itertools.product(*all_mesh_dim_strategies) + + # TODO: filter out invalid strategies, at this point we generate + # all possible strategies without considering the whether the tensor + # dim could be sharded or not, we would need to filter out invalid + # strategies base on the actual tensor shape + # (i.e. for Shard, tensor dim size must > mesh size) + all_strategies = [] + for strategy_comb in strategy_combs: + spec_list = [] + for specs in zip(*strategy_comb): + spec_list.append(DTensorSpec(mesh, tuple(specs))) + strat = PlacementStrategy(output_specs=spec_list[0], input_specs=spec_list[1:]) + all_strategies.append(strat) + + return OpStrategy(all_strategies) diff --git a/shared/package-files/75/75b68272cdbb77237d827316185e6703f06b567e90f8dae329826957dfdf801b/ordered_set.py b/shared/package-files/75/75b68272cdbb77237d827316185e6703f06b567e90f8dae329826957dfdf801b/ordered_set.py new file mode 100644 index 0000000000000000000000000000000000000000..14876000de895a609d5b9f3de39c3c8fc44ef1fc --- /dev/null +++ b/shared/package-files/75/75b68272cdbb77237d827316185e6703f06b567e90f8dae329826957dfdf801b/ordered_set.py @@ -0,0 +1,488 @@ +""" +An OrderedSet is a custom MutableSet that remembers its order, so that every +entry has an index that can be looked up. + +Based on a recipe originally posted to ActiveState Recipes by Raymond Hettiger, +and released under the MIT license. +""" +import itertools as it +from collections import deque + +try: + # Python 3 + from collections.abc import MutableSet, Sequence +except ImportError: + # Python 2.7 + from collections import MutableSet, Sequence + +SLICE_ALL = slice(None) +__version__ = "3.1" + + +def is_iterable(obj): + """ + Are we being asked to look up a list of things, instead of a single thing? + We check for the `__iter__` attribute so that this can cover types that + don't have to be known by this module, such as NumPy arrays. + + Strings, however, should be considered as atomic values to look up, not + iterables. The same goes for tuples, since they are immutable and therefore + valid entries. + + We don't need to check for the Python 2 `unicode` type, because it doesn't + have an `__iter__` attribute anyway. + """ + return ( + hasattr(obj, "__iter__") + and not isinstance(obj, str) + and not isinstance(obj, tuple) + ) + + +class OrderedSet(MutableSet, Sequence): + """ + An OrderedSet is a custom MutableSet that remembers its order, so that + every entry has an index that can be looked up. + + Example: + >>> OrderedSet([1, 1, 2, 3, 2]) + OrderedSet([1, 2, 3]) + """ + + def __init__(self, iterable=None): + self.items = [] + self.map = {} + if iterable is not None: + self |= iterable + + def __len__(self): + """ + Returns the number of unique elements in the ordered set + + Example: + >>> len(OrderedSet([])) + 0 + >>> len(OrderedSet([1, 2])) + 2 + """ + return len(self.items) + + def __getitem__(self, index): + """ + Get the item at a given index. + + If `index` is a slice, you will get back that slice of items, as a + new OrderedSet. + + If `index` is a list or a similar iterable, you'll get a list of + items corresponding to those indices. This is similar to NumPy's + "fancy indexing". The result is not an OrderedSet because you may ask + for duplicate indices, and the number of elements returned should be + the number of elements asked for. + + Example: + >>> oset = OrderedSet([1, 2, 3]) + >>> oset[1] + 2 + """ + if isinstance(index, slice) and index == SLICE_ALL: + return self.copy() + elif is_iterable(index): + return [self.items[i] for i in index] + elif hasattr(index, "__index__") or isinstance(index, slice): + result = self.items[index] + if isinstance(result, list): + return self.__class__(result) + else: + return result + else: + raise TypeError("Don't know how to index an OrderedSet by %r" % index) + + def copy(self): + """ + Return a shallow copy of this object. + + Example: + >>> this = OrderedSet([1, 2, 3]) + >>> other = this.copy() + >>> this == other + True + >>> this is other + False + """ + return self.__class__(self) + + def __getstate__(self): + if len(self) == 0: + # The state can't be an empty list. + # We need to return a truthy value, or else __setstate__ won't be run. + # + # This could have been done more gracefully by always putting the state + # in a tuple, but this way is backwards- and forwards- compatible with + # previous versions of OrderedSet. + return (None,) + else: + return list(self) + + def __setstate__(self, state): + if state == (None,): + self.__init__([]) + else: + self.__init__(state) + + def __contains__(self, key): + """ + Test if the item is in this ordered set + + Example: + >>> 1 in OrderedSet([1, 3, 2]) + True + >>> 5 in OrderedSet([1, 3, 2]) + False + """ + return key in self.map + + def add(self, key): + """ + Add `key` as an item to this OrderedSet, then return its index. + + If `key` is already in the OrderedSet, return the index it already + had. + + Example: + >>> oset = OrderedSet() + >>> oset.append(3) + 0 + >>> print(oset) + OrderedSet([3]) + """ + if key not in self.map: + self.map[key] = len(self.items) + self.items.append(key) + return self.map[key] + + append = add + + def update(self, sequence): + """ + Update the set with the given iterable sequence, then return the index + of the last element inserted. + + Example: + >>> oset = OrderedSet([1, 2, 3]) + >>> oset.update([3, 1, 5, 1, 4]) + 4 + >>> print(oset) + OrderedSet([1, 2, 3, 5, 4]) + """ + item_index = None + try: + for item in sequence: + item_index = self.add(item) + except TypeError: + raise ValueError( + "Argument needs to be an iterable, got %s" % type(sequence) + ) + return item_index + + def index(self, key): + """ + Get the index of a given entry, raising an IndexError if it's not + present. + + `key` can be an iterable of entries that is not a string, in which case + this returns a list of indices. + + Example: + >>> oset = OrderedSet([1, 2, 3]) + >>> oset.index(2) + 1 + """ + if is_iterable(key): + return [self.index(subkey) for subkey in key] + return self.map[key] + + # Provide some compatibility with pd.Index + get_loc = index + get_indexer = index + + def pop(self): + """ + Remove and return the last element from the set. + + Raises KeyError if the set is empty. + + Example: + >>> oset = OrderedSet([1, 2, 3]) + >>> oset.pop() + 3 + """ + if not self.items: + raise KeyError("Set is empty") + + elem = self.items[-1] + del self.items[-1] + del self.map[elem] + return elem + + def discard(self, key): + """ + Remove an element. Do not raise an exception if absent. + + The MutableSet mixin uses this to implement the .remove() method, which + *does* raise an error when asked to remove a non-existent item. + + Example: + >>> oset = OrderedSet([1, 2, 3]) + >>> oset.discard(2) + >>> print(oset) + OrderedSet([1, 3]) + >>> oset.discard(2) + >>> print(oset) + OrderedSet([1, 3]) + """ + if key in self: + i = self.map[key] + del self.items[i] + del self.map[key] + for k, v in self.map.items(): + if v >= i: + self.map[k] = v - 1 + + def clear(self): + """ + Remove all items from this OrderedSet. + """ + del self.items[:] + self.map.clear() + + def __iter__(self): + """ + Example: + >>> list(iter(OrderedSet([1, 2, 3]))) + [1, 2, 3] + """ + return iter(self.items) + + def __reversed__(self): + """ + Example: + >>> list(reversed(OrderedSet([1, 2, 3]))) + [3, 2, 1] + """ + return reversed(self.items) + + def __repr__(self): + if not self: + return "%s()" % (self.__class__.__name__,) + return "%s(%r)" % (self.__class__.__name__, list(self)) + + def __eq__(self, other): + """ + Returns true if the containers have the same items. If `other` is a + Sequence, then order is checked, otherwise it is ignored. + + Example: + >>> oset = OrderedSet([1, 3, 2]) + >>> oset == [1, 3, 2] + True + >>> oset == [1, 2, 3] + False + >>> oset == [2, 3] + False + >>> oset == OrderedSet([3, 2, 1]) + False + """ + # In Python 2 deque is not a Sequence, so treat it as one for + # consistent behavior with Python 3. + if isinstance(other, (Sequence, deque)): + # Check that this OrderedSet contains the same elements, in the + # same order, as the other object. + return list(self) == list(other) + try: + other_as_set = set(other) + except TypeError: + # If `other` can't be converted into a set, it's not equal. + return False + else: + return set(self) == other_as_set + + def union(self, *sets): + """ + Combines all unique items. + Each items order is defined by its first appearance. + + Example: + >>> oset = OrderedSet.union(OrderedSet([3, 1, 4, 1, 5]), [1, 3], [2, 0]) + >>> print(oset) + OrderedSet([3, 1, 4, 5, 2, 0]) + >>> oset.union([8, 9]) + OrderedSet([3, 1, 4, 5, 2, 0, 8, 9]) + >>> oset | {10} + OrderedSet([3, 1, 4, 5, 2, 0, 10]) + """ + cls = self.__class__ if isinstance(self, OrderedSet) else OrderedSet + containers = map(list, it.chain([self], sets)) + items = it.chain.from_iterable(containers) + return cls(items) + + def __and__(self, other): + # the parent implementation of this is backwards + return self.intersection(other) + + def intersection(self, *sets): + """ + Returns elements in common between all sets. Order is defined only + by the first set. + + Example: + >>> oset = OrderedSet.intersection(OrderedSet([0, 1, 2, 3]), [1, 2, 3]) + >>> print(oset) + OrderedSet([1, 2, 3]) + >>> oset.intersection([2, 4, 5], [1, 2, 3, 4]) + OrderedSet([2]) + >>> oset.intersection() + OrderedSet([1, 2, 3]) + """ + cls = self.__class__ if isinstance(self, OrderedSet) else OrderedSet + if sets: + common = set.intersection(*map(set, sets)) + items = (item for item in self if item in common) + else: + items = self + return cls(items) + + def difference(self, *sets): + """ + Returns all elements that are in this set but not the others. + + Example: + >>> OrderedSet([1, 2, 3]).difference(OrderedSet([2])) + OrderedSet([1, 3]) + >>> OrderedSet([1, 2, 3]).difference(OrderedSet([2]), OrderedSet([3])) + OrderedSet([1]) + >>> OrderedSet([1, 2, 3]) - OrderedSet([2]) + OrderedSet([1, 3]) + >>> OrderedSet([1, 2, 3]).difference() + OrderedSet([1, 2, 3]) + """ + cls = self.__class__ + if sets: + other = set.union(*map(set, sets)) + items = (item for item in self if item not in other) + else: + items = self + return cls(items) + + def issubset(self, other): + """ + Report whether another set contains this set. + + Example: + >>> OrderedSet([1, 2, 3]).issubset({1, 2}) + False + >>> OrderedSet([1, 2, 3]).issubset({1, 2, 3, 4}) + True + >>> OrderedSet([1, 2, 3]).issubset({1, 4, 3, 5}) + False + """ + if len(self) > len(other): # Fast check for obvious cases + return False + return all(item in other for item in self) + + def issuperset(self, other): + """ + Report whether this set contains another set. + + Example: + >>> OrderedSet([1, 2]).issuperset([1, 2, 3]) + False + >>> OrderedSet([1, 2, 3, 4]).issuperset({1, 2, 3}) + True + >>> OrderedSet([1, 4, 3, 5]).issuperset({1, 2, 3}) + False + """ + if len(self) < len(other): # Fast check for obvious cases + return False + return all(item in self for item in other) + + def symmetric_difference(self, other): + """ + Return the symmetric difference of two OrderedSets as a new set. + That is, the new set will contain all elements that are in exactly + one of the sets. + + Their order will be preserved, with elements from `self` preceding + elements from `other`. + + Example: + >>> this = OrderedSet([1, 4, 3, 5, 7]) + >>> other = OrderedSet([9, 7, 1, 3, 2]) + >>> this.symmetric_difference(other) + OrderedSet([4, 5, 9, 2]) + """ + cls = self.__class__ if isinstance(self, OrderedSet) else OrderedSet + diff1 = cls(self).difference(other) + diff2 = cls(other).difference(self) + return diff1.union(diff2) + + def _update_items(self, items): + """ + Replace the 'items' list of this OrderedSet with a new one, updating + self.map accordingly. + """ + self.items = items + self.map = {item: idx for (idx, item) in enumerate(items)} + + def difference_update(self, *sets): + """ + Update this OrderedSet to remove items from one or more other sets. + + Example: + >>> this = OrderedSet([1, 2, 3]) + >>> this.difference_update(OrderedSet([2, 4])) + >>> print(this) + OrderedSet([1, 3]) + + >>> this = OrderedSet([1, 2, 3, 4, 5]) + >>> this.difference_update(OrderedSet([2, 4]), OrderedSet([1, 4, 6])) + >>> print(this) + OrderedSet([3, 5]) + """ + items_to_remove = set() + for other in sets: + items_to_remove |= set(other) + self._update_items([item for item in self.items if item not in items_to_remove]) + + def intersection_update(self, other): + """ + Update this OrderedSet to keep only items in another set, preserving + their order in this set. + + Example: + >>> this = OrderedSet([1, 4, 3, 5, 7]) + >>> other = OrderedSet([9, 7, 1, 3, 2]) + >>> this.intersection_update(other) + >>> print(this) + OrderedSet([1, 3, 7]) + """ + other = set(other) + self._update_items([item for item in self.items if item in other]) + + def symmetric_difference_update(self, other): + """ + Update this OrderedSet to remove items from another set, then + add items from the other set that were not present in this set. + + Example: + >>> this = OrderedSet([1, 4, 3, 5, 7]) + >>> other = OrderedSet([9, 7, 1, 3, 2]) + >>> this.symmetric_difference_update(other) + >>> print(this) + OrderedSet([4, 5, 9, 2]) + """ + items_to_add = [item for item in other if item not in self] + items_to_remove = set(other) + self._update_items( + [item for item in self.items if item not in items_to_remove] + items_to_add + ) diff --git a/shared/package-files/75/75b7efbc4ac8938320faa41c24ec1b27751cfc23fcea4cbb845b9380a1b233c4/reportviews.py b/shared/package-files/75/75b7efbc4ac8938320faa41c24ec1b27751cfc23fcea4cbb845b9380a1b233c4/reportviews.py new file mode 100644 index 0000000000000000000000000000000000000000..4503566e7c63c2687cad90097b64c73fdb9bccec --- /dev/null +++ b/shared/package-files/75/75b7efbc4ac8938320faa41c24ec1b27751cfc23fcea4cbb845b9380a1b233c4/reportviews.py @@ -0,0 +1,1431 @@ +""" +View Classes provide node, edge and degree "views" of a graph. + +Views for nodes, edges and degree are provided for all base graph classes. +A view means a read-only object that is quick to create, automatically +updated when the graph changes, and provides basic access like `n in V`, +`for n in V`, `V[n]` and sometimes set operations. + +The views are read-only iterable containers that are updated as the +graph is updated. As with dicts, the graph should not be updated +while iterating through the view. Views can be iterated multiple times. + +Edge and Node views also allow data attribute lookup. +The resulting attribute dict is writable as `G.edges[3, 4]['color']='red'` +Degree views allow lookup of degree values for single nodes. +Weighted degree is supported with the `weight` argument. + +NodeView +======== + + `V = G.nodes` (or `V = G.nodes()`) allows `len(V)`, `n in V`, set + operations e.g. "G.nodes & H.nodes", and `dd = G.nodes[n]`, where + `dd` is the node data dict. Iteration is over the nodes by default. + +NodeDataView +============ + + To iterate over (node, data) pairs, use arguments to `G.nodes()` + to create a DataView e.g. `DV = G.nodes(data='color', default='red')`. + The DataView iterates as `for n, color in DV` and allows + `(n, 'red') in DV`. Using `DV = G.nodes(data=True)`, the DataViews + use the full datadict in writeable form also allowing contain testing as + `(n, {'color': 'red'}) in VD`. DataViews allow set operations when + data attributes are hashable. + +DegreeView +========== + + `V = G.degree` allows iteration over (node, degree) pairs as well + as lookup: `deg=V[n]`. There are many flavors of DegreeView + for In/Out/Directed/Multi. For Directed Graphs, `G.degree` + counts both in and out going edges. `G.out_degree` and + `G.in_degree` count only specific directions. + Weighted degree using edge data attributes is provide via + `V = G.degree(weight='attr_name')` where any string with the + attribute name can be used. `weight=None` is the default. + No set operations are implemented for degrees, use NodeView. + + The argument `nbunch` restricts iteration to nodes in nbunch. + The DegreeView can still lookup any node even if nbunch is specified. + +EdgeView +======== + + `V = G.edges` or `V = G.edges()` allows iteration over edges as well as + `e in V`, set operations and edge data lookup `dd = G.edges[2, 3]`. + Iteration is over 2-tuples `(u, v)` for Graph/DiGraph. For multigraphs + edges 3-tuples `(u, v, key)` are the default but 2-tuples can be obtained + via `V = G.edges(keys=False)`. + + Set operations for directed graphs treat the edges as a set of 2-tuples. + For undirected graphs, 2-tuples are not a unique representation of edges. + So long as the set being compared to contains unique representations + of its edges, the set operations will act as expected. If the other + set contains both `(0, 1)` and `(1, 0)` however, the result of set + operations may contain both representations of the same edge. + +EdgeDataView +============ + + Edge data can be reported using an EdgeDataView typically created + by calling an EdgeView: `DV = G.edges(data='weight', default=1)`. + The EdgeDataView allows iteration over edge tuples, membership checking + but no set operations. + + Iteration depends on `data` and `default` and for multigraph `keys` + If `data is False` (the default) then iterate over 2-tuples `(u, v)`. + If `data is True` iterate over 3-tuples `(u, v, datadict)`. + Otherwise iterate over `(u, v, datadict.get(data, default))`. + For Multigraphs, if `keys is True`, replace `u, v` with `u, v, key` + to create 3-tuples and 4-tuples. + + The argument `nbunch` restricts edges to those incident to nodes in nbunch. +""" +from collections.abc import Mapping, Set + +import networkx as nx + +__all__ = [ + "NodeView", + "NodeDataView", + "EdgeView", + "OutEdgeView", + "InEdgeView", + "EdgeDataView", + "OutEdgeDataView", + "InEdgeDataView", + "MultiEdgeView", + "OutMultiEdgeView", + "InMultiEdgeView", + "MultiEdgeDataView", + "OutMultiEdgeDataView", + "InMultiEdgeDataView", + "DegreeView", + "DiDegreeView", + "InDegreeView", + "OutDegreeView", + "MultiDegreeView", + "DiMultiDegreeView", + "InMultiDegreeView", + "OutMultiDegreeView", +] + + +# NodeViews +class NodeView(Mapping, Set): + """A NodeView class to act as G.nodes for a NetworkX Graph + + Set operations act on the nodes without considering data. + Iteration is over nodes. Node data can be looked up like a dict. + Use NodeDataView to iterate over node data or to specify a data + attribute for lookup. NodeDataView is created by calling the NodeView. + + Parameters + ---------- + graph : NetworkX graph-like class + + Examples + -------- + >>> G = nx.path_graph(3) + >>> NV = G.nodes() + >>> 2 in NV + True + >>> for n in NV: + ... print(n) + 0 + 1 + 2 + >>> assert NV & {1, 2, 3} == {1, 2} + + >>> G.add_node(2, color="blue") + >>> NV[2] + {'color': 'blue'} + >>> G.add_node(8, color="red") + >>> NDV = G.nodes(data=True) + >>> (2, NV[2]) in NDV + True + >>> for n, dd in NDV: + ... print((n, dd.get("color", "aqua"))) + (0, 'aqua') + (1, 'aqua') + (2, 'blue') + (8, 'red') + >>> NDV[2] == NV[2] + True + + >>> NVdata = G.nodes(data="color", default="aqua") + >>> (2, NVdata[2]) in NVdata + True + >>> for n, dd in NVdata: + ... print((n, dd)) + (0, 'aqua') + (1, 'aqua') + (2, 'blue') + (8, 'red') + >>> NVdata[2] == NV[2] # NVdata gets 'color', NV gets datadict + False + """ + + __slots__ = ("_nodes",) + + def __getstate__(self): + return {"_nodes": self._nodes} + + def __setstate__(self, state): + self._nodes = state["_nodes"] + + def __init__(self, graph): + self._nodes = graph._node + + # Mapping methods + def __len__(self): + return len(self._nodes) + + def __iter__(self): + return iter(self._nodes) + + def __getitem__(self, n): + if isinstance(n, slice): + raise nx.NetworkXError( + f"{type(self).__name__} does not support slicing, " + f"try list(G.nodes)[{n.start}:{n.stop}:{n.step}]" + ) + return self._nodes[n] + + # Set methods + def __contains__(self, n): + return n in self._nodes + + @classmethod + def _from_iterable(cls, it): + return set(it) + + # DataView method + def __call__(self, data=False, default=None): + if data is False: + return self + return NodeDataView(self._nodes, data, default) + + def data(self, data=True, default=None): + """ + Return a read-only view of node data. + + Parameters + ---------- + data : bool or node data key, default=True + If ``data=True`` (the default), return a `NodeDataView` object that + maps each node to *all* of its attributes. `data` may also be an + arbitrary key, in which case the `NodeDataView` maps each node to + the value for the keyed attribute. In this case, if a node does + not have the `data` attribute, the `default` value is used. + default : object, default=None + The value used when a node does not have a specific attribute. + + Returns + ------- + NodeDataView + The layout of the returned NodeDataView depends on the value of the + `data` parameter. + + Notes + ----- + If ``data=False``, returns a `NodeView` object without data. + + See Also + -------- + NodeDataView + + Examples + -------- + >>> G = nx.Graph() + >>> G.add_nodes_from([ + ... (0, {"color": "red", "weight": 10}), + ... (1, {"color": "blue"}), + ... (2, {"color": "yellow", "weight": 2}) + ... ]) + + Accessing node data with ``data=True`` (the default) returns a + NodeDataView mapping each node to all of its attributes: + + >>> G.nodes.data() + NodeDataView({0: {'color': 'red', 'weight': 10}, 1: {'color': 'blue'}, 2: {'color': 'yellow', 'weight': 2}}) + + If `data` represents a key in the node attribute dict, a NodeDataView mapping + the nodes to the value for that specific key is returned: + + >>> G.nodes.data("color") + NodeDataView({0: 'red', 1: 'blue', 2: 'yellow'}, data='color') + + If a specific key is not found in an attribute dict, the value specified + by `default` is returned: + + >>> G.nodes.data("weight", default=-999) + NodeDataView({0: 10, 1: -999, 2: 2}, data='weight') + + Note that there is no check that the `data` key is in any of the + node attribute dictionaries: + + >>> G.nodes.data("height") + NodeDataView({0: None, 1: None, 2: None}, data='height') + """ + if data is False: + return self + return NodeDataView(self._nodes, data, default) + + def __str__(self): + return str(list(self)) + + def __repr__(self): + return f"{self.__class__.__name__}({tuple(self)})" + + +class NodeDataView(Set): + """A DataView class for nodes of a NetworkX Graph + + The main use for this class is to iterate through node-data pairs. + The data can be the entire data-dictionary for each node, or it + can be a specific attribute (with default) for each node. + Set operations are enabled with NodeDataView, but don't work in + cases where the data is not hashable. Use with caution. + Typically, set operations on nodes use NodeView, not NodeDataView. + That is, they use `G.nodes` instead of `G.nodes(data='foo')`. + + Parameters + ========== + graph : NetworkX graph-like class + data : bool or string (default=False) + default : object (default=None) + """ + + __slots__ = ("_nodes", "_data", "_default") + + def __getstate__(self): + return {"_nodes": self._nodes, "_data": self._data, "_default": self._default} + + def __setstate__(self, state): + self._nodes = state["_nodes"] + self._data = state["_data"] + self._default = state["_default"] + + def __init__(self, nodedict, data=False, default=None): + self._nodes = nodedict + self._data = data + self._default = default + + @classmethod + def _from_iterable(cls, it): + try: + return set(it) + except TypeError as err: + if "unhashable" in str(err): + msg = " : Could be b/c data=True or your values are unhashable" + raise TypeError(str(err) + msg) from err + raise + + def __len__(self): + return len(self._nodes) + + def __iter__(self): + data = self._data + if data is False: + return iter(self._nodes) + if data is True: + return iter(self._nodes.items()) + return ( + (n, dd[data] if data in dd else self._default) + for n, dd in self._nodes.items() + ) + + def __contains__(self, n): + try: + node_in = n in self._nodes + except TypeError: + n, d = n + return n in self._nodes and self[n] == d + if node_in is True: + return node_in + try: + n, d = n + except (TypeError, ValueError): + return False + return n in self._nodes and self[n] == d + + def __getitem__(self, n): + if isinstance(n, slice): + raise nx.NetworkXError( + f"{type(self).__name__} does not support slicing, " + f"try list(G.nodes.data())[{n.start}:{n.stop}:{n.step}]" + ) + ddict = self._nodes[n] + data = self._data + if data is False or data is True: + return ddict + return ddict[data] if data in ddict else self._default + + def __str__(self): + return str(list(self)) + + def __repr__(self): + name = self.__class__.__name__ + if self._data is False: + return f"{name}({tuple(self)})" + if self._data is True: + return f"{name}({dict(self)})" + return f"{name}({dict(self)}, data={self._data!r})" + + +# DegreeViews +class DiDegreeView: + """A View class for degree of nodes in a NetworkX Graph + + The functionality is like dict.items() with (node, degree) pairs. + Additional functionality includes read-only lookup of node degree, + and calling with optional features nbunch (for only a subset of nodes) + and weight (use edge weights to compute degree). + + Parameters + ========== + graph : NetworkX graph-like class + nbunch : node, container of nodes, or None meaning all nodes (default=None) + weight : bool or string (default=None) + + Notes + ----- + DegreeView can still lookup any node even if nbunch is specified. + + Examples + -------- + >>> G = nx.path_graph(3) + >>> DV = G.degree() + >>> assert DV[2] == 1 + >>> assert sum(deg for n, deg in DV) == 4 + + >>> DVweight = G.degree(weight="span") + >>> G.add_edge(1, 2, span=34) + >>> DVweight[2] + 34 + >>> DVweight[0] # default edge weight is 1 + 1 + >>> sum(span for n, span in DVweight) # sum weighted degrees + 70 + + >>> DVnbunch = G.degree(nbunch=(1, 2)) + >>> assert len(list(DVnbunch)) == 2 # iteration over nbunch only + """ + + def __init__(self, G, nbunch=None, weight=None): + self._graph = G + self._succ = G._succ if hasattr(G, "_succ") else G._adj + self._pred = G._pred if hasattr(G, "_pred") else G._adj + self._nodes = self._succ if nbunch is None else list(G.nbunch_iter(nbunch)) + self._weight = weight + + def __call__(self, nbunch=None, weight=None): + if nbunch is None: + if weight == self._weight: + return self + return self.__class__(self._graph, None, weight) + try: + if nbunch in self._nodes: + if weight == self._weight: + return self[nbunch] + return self.__class__(self._graph, None, weight)[nbunch] + except TypeError: + pass + return self.__class__(self._graph, nbunch, weight) + + def __getitem__(self, n): + weight = self._weight + succs = self._succ[n] + preds = self._pred[n] + if weight is None: + return len(succs) + len(preds) + return sum(dd.get(weight, 1) for dd in succs.values()) + sum( + dd.get(weight, 1) for dd in preds.values() + ) + + def __iter__(self): + weight = self._weight + if weight is None: + for n in self._nodes: + succs = self._succ[n] + preds = self._pred[n] + yield (n, len(succs) + len(preds)) + else: + for n in self._nodes: + succs = self._succ[n] + preds = self._pred[n] + deg = sum(dd.get(weight, 1) for dd in succs.values()) + sum( + dd.get(weight, 1) for dd in preds.values() + ) + yield (n, deg) + + def __len__(self): + return len(self._nodes) + + def __str__(self): + return str(list(self)) + + def __repr__(self): + return f"{self.__class__.__name__}({dict(self)})" + + +class DegreeView(DiDegreeView): + """A DegreeView class to act as G.degree for a NetworkX Graph + + Typical usage focuses on iteration over `(node, degree)` pairs. + The degree is by default the number of edges incident to the node. + Optional argument `weight` enables weighted degree using the edge + attribute named in the `weight` argument. Reporting and iteration + can also be restricted to a subset of nodes using `nbunch`. + + Additional functionality include node lookup so that `G.degree[n]` + reported the (possibly weighted) degree of node `n`. Calling the + view creates a view with different arguments `nbunch` or `weight`. + + Parameters + ========== + graph : NetworkX graph-like class + nbunch : node, container of nodes, or None meaning all nodes (default=None) + weight : string or None (default=None) + + Notes + ----- + DegreeView can still lookup any node even if nbunch is specified. + + Examples + -------- + >>> G = nx.path_graph(3) + >>> DV = G.degree() + >>> assert DV[2] == 1 + >>> assert G.degree[2] == 1 + >>> assert sum(deg for n, deg in DV) == 4 + + >>> DVweight = G.degree(weight="span") + >>> G.add_edge(1, 2, span=34) + >>> DVweight[2] + 34 + >>> DVweight[0] # default edge weight is 1 + 1 + >>> sum(span for n, span in DVweight) # sum weighted degrees + 70 + + >>> DVnbunch = G.degree(nbunch=(1, 2)) + >>> assert len(list(DVnbunch)) == 2 # iteration over nbunch only + """ + + def __getitem__(self, n): + weight = self._weight + nbrs = self._succ[n] + if weight is None: + return len(nbrs) + (n in nbrs) + return sum(dd.get(weight, 1) for dd in nbrs.values()) + ( + n in nbrs and nbrs[n].get(weight, 1) + ) + + def __iter__(self): + weight = self._weight + if weight is None: + for n in self._nodes: + nbrs = self._succ[n] + yield (n, len(nbrs) + (n in nbrs)) + else: + for n in self._nodes: + nbrs = self._succ[n] + deg = sum(dd.get(weight, 1) for dd in nbrs.values()) + ( + n in nbrs and nbrs[n].get(weight, 1) + ) + yield (n, deg) + + +class OutDegreeView(DiDegreeView): + """A DegreeView class to report out_degree for a DiGraph; See DegreeView""" + + def __getitem__(self, n): + weight = self._weight + nbrs = self._succ[n] + if self._weight is None: + return len(nbrs) + return sum(dd.get(self._weight, 1) for dd in nbrs.values()) + + def __iter__(self): + weight = self._weight + if weight is None: + for n in self._nodes: + succs = self._succ[n] + yield (n, len(succs)) + else: + for n in self._nodes: + succs = self._succ[n] + deg = sum(dd.get(weight, 1) for dd in succs.values()) + yield (n, deg) + + +class InDegreeView(DiDegreeView): + """A DegreeView class to report in_degree for a DiGraph; See DegreeView""" + + def __getitem__(self, n): + weight = self._weight + nbrs = self._pred[n] + if weight is None: + return len(nbrs) + return sum(dd.get(weight, 1) for dd in nbrs.values()) + + def __iter__(self): + weight = self._weight + if weight is None: + for n in self._nodes: + preds = self._pred[n] + yield (n, len(preds)) + else: + for n in self._nodes: + preds = self._pred[n] + deg = sum(dd.get(weight, 1) for dd in preds.values()) + yield (n, deg) + + +class MultiDegreeView(DiDegreeView): + """A DegreeView class for undirected multigraphs; See DegreeView""" + + def __getitem__(self, n): + weight = self._weight + nbrs = self._succ[n] + if weight is None: + return sum(len(keys) for keys in nbrs.values()) + ( + n in nbrs and len(nbrs[n]) + ) + # edge weighted graph - degree is sum of nbr edge weights + deg = sum( + d.get(weight, 1) for key_dict in nbrs.values() for d in key_dict.values() + ) + if n in nbrs: + deg += sum(d.get(weight, 1) for d in nbrs[n].values()) + return deg + + def __iter__(self): + weight = self._weight + if weight is None: + for n in self._nodes: + nbrs = self._succ[n] + deg = sum(len(keys) for keys in nbrs.values()) + ( + n in nbrs and len(nbrs[n]) + ) + yield (n, deg) + else: + for n in self._nodes: + nbrs = self._succ[n] + deg = sum( + d.get(weight, 1) + for key_dict in nbrs.values() + for d in key_dict.values() + ) + if n in nbrs: + deg += sum(d.get(weight, 1) for d in nbrs[n].values()) + yield (n, deg) + + +class DiMultiDegreeView(DiDegreeView): + """A DegreeView class for MultiDiGraph; See DegreeView""" + + def __getitem__(self, n): + weight = self._weight + succs = self._succ[n] + preds = self._pred[n] + if weight is None: + return sum(len(keys) for keys in succs.values()) + sum( + len(keys) for keys in preds.values() + ) + # edge weighted graph - degree is sum of nbr edge weights + deg = sum( + d.get(weight, 1) for key_dict in succs.values() for d in key_dict.values() + ) + sum( + d.get(weight, 1) for key_dict in preds.values() for d in key_dict.values() + ) + return deg + + def __iter__(self): + weight = self._weight + if weight is None: + for n in self._nodes: + succs = self._succ[n] + preds = self._pred[n] + deg = sum(len(keys) for keys in succs.values()) + sum( + len(keys) for keys in preds.values() + ) + yield (n, deg) + else: + for n in self._nodes: + succs = self._succ[n] + preds = self._pred[n] + deg = sum( + d.get(weight, 1) + for key_dict in succs.values() + for d in key_dict.values() + ) + sum( + d.get(weight, 1) + for key_dict in preds.values() + for d in key_dict.values() + ) + yield (n, deg) + + +class InMultiDegreeView(DiDegreeView): + """A DegreeView class for inward degree of MultiDiGraph; See DegreeView""" + + def __getitem__(self, n): + weight = self._weight + nbrs = self._pred[n] + if weight is None: + return sum(len(data) for data in nbrs.values()) + # edge weighted graph - degree is sum of nbr edge weights + return sum( + d.get(weight, 1) for key_dict in nbrs.values() for d in key_dict.values() + ) + + def __iter__(self): + weight = self._weight + if weight is None: + for n in self._nodes: + nbrs = self._pred[n] + deg = sum(len(data) for data in nbrs.values()) + yield (n, deg) + else: + for n in self._nodes: + nbrs = self._pred[n] + deg = sum( + d.get(weight, 1) + for key_dict in nbrs.values() + for d in key_dict.values() + ) + yield (n, deg) + + +class OutMultiDegreeView(DiDegreeView): + """A DegreeView class for outward degree of MultiDiGraph; See DegreeView""" + + def __getitem__(self, n): + weight = self._weight + nbrs = self._succ[n] + if weight is None: + return sum(len(data) for data in nbrs.values()) + # edge weighted graph - degree is sum of nbr edge weights + return sum( + d.get(weight, 1) for key_dict in nbrs.values() for d in key_dict.values() + ) + + def __iter__(self): + weight = self._weight + if weight is None: + for n in self._nodes: + nbrs = self._succ[n] + deg = sum(len(data) for data in nbrs.values()) + yield (n, deg) + else: + for n in self._nodes: + nbrs = self._succ[n] + deg = sum( + d.get(weight, 1) + for key_dict in nbrs.values() + for d in key_dict.values() + ) + yield (n, deg) + + +# EdgeDataViews +class OutEdgeDataView: + """EdgeDataView for outward edges of DiGraph; See EdgeDataView""" + + __slots__ = ( + "_viewer", + "_nbunch", + "_data", + "_default", + "_adjdict", + "_nodes_nbrs", + "_report", + ) + + def __getstate__(self): + return { + "viewer": self._viewer, + "nbunch": self._nbunch, + "data": self._data, + "default": self._default, + } + + def __setstate__(self, state): + self.__init__(**state) + + def __init__(self, viewer, nbunch=None, data=False, default=None): + self._viewer = viewer + adjdict = self._adjdict = viewer._adjdict + if nbunch is None: + self._nodes_nbrs = adjdict.items + else: + # dict retains order of nodes but acts like a set + nbunch = dict.fromkeys(viewer._graph.nbunch_iter(nbunch)) + self._nodes_nbrs = lambda: [(n, adjdict[n]) for n in nbunch] + self._nbunch = nbunch + self._data = data + self._default = default + # Set _report based on data and default + if data is True: + self._report = lambda n, nbr, dd: (n, nbr, dd) + elif data is False: + self._report = lambda n, nbr, dd: (n, nbr) + else: # data is attribute name + self._report = ( + lambda n, nbr, dd: (n, nbr, dd[data]) + if data in dd + else (n, nbr, default) + ) + + def __len__(self): + return sum(len(nbrs) for n, nbrs in self._nodes_nbrs()) + + def __iter__(self): + return ( + self._report(n, nbr, dd) + for n, nbrs in self._nodes_nbrs() + for nbr, dd in nbrs.items() + ) + + def __contains__(self, e): + u, v = e[:2] + if self._nbunch is not None and u not in self._nbunch: + return False # this edge doesn't start in nbunch + try: + ddict = self._adjdict[u][v] + except KeyError: + return False + return e == self._report(u, v, ddict) + + def __str__(self): + return str(list(self)) + + def __repr__(self): + return f"{self.__class__.__name__}({list(self)})" + + +class EdgeDataView(OutEdgeDataView): + """A EdgeDataView class for edges of Graph + + This view is primarily used to iterate over the edges reporting + edges as node-tuples with edge data optionally reported. The + argument `nbunch` allows restriction to edges incident to nodes + in that container/singleton. The default (nbunch=None) + reports all edges. The arguments `data` and `default` control + what edge data is reported. The default `data is False` reports + only node-tuples for each edge. If `data is True` the entire edge + data dict is returned. Otherwise `data` is assumed to hold the name + of the edge attribute to report with default `default` if that + edge attribute is not present. + + Parameters + ---------- + nbunch : container of nodes, node or None (default None) + data : False, True or string (default False) + default : default value (default None) + + Examples + -------- + >>> G = nx.path_graph(3) + >>> G.add_edge(1, 2, foo="bar") + >>> list(G.edges(data="foo", default="biz")) + [(0, 1, 'biz'), (1, 2, 'bar')] + >>> assert (0, 1, "biz") in G.edges(data="foo", default="biz") + """ + + __slots__ = () + + def __len__(self): + return sum(1 for e in self) + + def __iter__(self): + seen = {} + for n, nbrs in self._nodes_nbrs(): + for nbr, dd in nbrs.items(): + if nbr not in seen: + yield self._report(n, nbr, dd) + seen[n] = 1 + del seen + + def __contains__(self, e): + u, v = e[:2] + if self._nbunch is not None and u not in self._nbunch and v not in self._nbunch: + return False # this edge doesn't start and it doesn't end in nbunch + try: + ddict = self._adjdict[u][v] + except KeyError: + return False + return e == self._report(u, v, ddict) + + +class InEdgeDataView(OutEdgeDataView): + """An EdgeDataView class for outward edges of DiGraph; See EdgeDataView""" + + __slots__ = () + + def __iter__(self): + return ( + self._report(nbr, n, dd) + for n, nbrs in self._nodes_nbrs() + for nbr, dd in nbrs.items() + ) + + def __contains__(self, e): + u, v = e[:2] + if self._nbunch is not None and v not in self._nbunch: + return False # this edge doesn't end in nbunch + try: + ddict = self._adjdict[v][u] + except KeyError: + return False + return e == self._report(u, v, ddict) + + +class OutMultiEdgeDataView(OutEdgeDataView): + """An EdgeDataView for outward edges of MultiDiGraph; See EdgeDataView""" + + __slots__ = ("keys",) + + def __getstate__(self): + return { + "viewer": self._viewer, + "nbunch": self._nbunch, + "keys": self.keys, + "data": self._data, + "default": self._default, + } + + def __setstate__(self, state): + self.__init__(**state) + + def __init__(self, viewer, nbunch=None, data=False, keys=False, default=None): + self._viewer = viewer + adjdict = self._adjdict = viewer._adjdict + self.keys = keys + if nbunch is None: + self._nodes_nbrs = adjdict.items + else: + # dict retains order of nodes but acts like a set + nbunch = dict.fromkeys(viewer._graph.nbunch_iter(nbunch)) + self._nodes_nbrs = lambda: [(n, adjdict[n]) for n in nbunch] + self._nbunch = nbunch + self._data = data + self._default = default + # Set _report based on data and default + if data is True: + if keys is True: + self._report = lambda n, nbr, k, dd: (n, nbr, k, dd) + else: + self._report = lambda n, nbr, k, dd: (n, nbr, dd) + elif data is False: + if keys is True: + self._report = lambda n, nbr, k, dd: (n, nbr, k) + else: + self._report = lambda n, nbr, k, dd: (n, nbr) + else: # data is attribute name + if keys is True: + self._report = ( + lambda n, nbr, k, dd: (n, nbr, k, dd[data]) + if data in dd + else (n, nbr, k, default) + ) + else: + self._report = ( + lambda n, nbr, k, dd: (n, nbr, dd[data]) + if data in dd + else (n, nbr, default) + ) + + def __len__(self): + return sum(1 for e in self) + + def __iter__(self): + return ( + self._report(n, nbr, k, dd) + for n, nbrs in self._nodes_nbrs() + for nbr, kd in nbrs.items() + for k, dd in kd.items() + ) + + def __contains__(self, e): + u, v = e[:2] + if self._nbunch is not None and u not in self._nbunch: + return False # this edge doesn't start in nbunch + try: + kdict = self._adjdict[u][v] + except KeyError: + return False + if self.keys is True: + k = e[2] + try: + dd = kdict[k] + except KeyError: + return False + return e == self._report(u, v, k, dd) + return any(e == self._report(u, v, k, dd) for k, dd in kdict.items()) + + +class MultiEdgeDataView(OutMultiEdgeDataView): + """An EdgeDataView class for edges of MultiGraph; See EdgeDataView""" + + __slots__ = () + + def __iter__(self): + seen = {} + for n, nbrs in self._nodes_nbrs(): + for nbr, kd in nbrs.items(): + if nbr not in seen: + for k, dd in kd.items(): + yield self._report(n, nbr, k, dd) + seen[n] = 1 + del seen + + def __contains__(self, e): + u, v = e[:2] + if self._nbunch is not None and u not in self._nbunch and v not in self._nbunch: + return False # this edge doesn't start and doesn't end in nbunch + try: + kdict = self._adjdict[u][v] + except KeyError: + try: + kdict = self._adjdict[v][u] + except KeyError: + return False + if self.keys is True: + k = e[2] + try: + dd = kdict[k] + except KeyError: + return False + return e == self._report(u, v, k, dd) + return any(e == self._report(u, v, k, dd) for k, dd in kdict.items()) + + +class InMultiEdgeDataView(OutMultiEdgeDataView): + """An EdgeDataView for inward edges of MultiDiGraph; See EdgeDataView""" + + __slots__ = () + + def __iter__(self): + return ( + self._report(nbr, n, k, dd) + for n, nbrs in self._nodes_nbrs() + for nbr, kd in nbrs.items() + for k, dd in kd.items() + ) + + def __contains__(self, e): + u, v = e[:2] + if self._nbunch is not None and v not in self._nbunch: + return False # this edge doesn't end in nbunch + try: + kdict = self._adjdict[v][u] + except KeyError: + return False + if self.keys is True: + k = e[2] + dd = kdict[k] + return e == self._report(u, v, k, dd) + return any(e == self._report(u, v, k, dd) for k, dd in kdict.items()) + + +# EdgeViews have set operations and no data reported +class OutEdgeView(Set, Mapping): + """A EdgeView class for outward edges of a DiGraph""" + + __slots__ = ("_adjdict", "_graph", "_nodes_nbrs") + + def __getstate__(self): + return {"_graph": self._graph, "_adjdict": self._adjdict} + + def __setstate__(self, state): + self._graph = state["_graph"] + self._adjdict = state["_adjdict"] + self._nodes_nbrs = self._adjdict.items + + @classmethod + def _from_iterable(cls, it): + return set(it) + + dataview = OutEdgeDataView + + def __init__(self, G): + self._graph = G + self._adjdict = G._succ if hasattr(G, "succ") else G._adj + self._nodes_nbrs = self._adjdict.items + + # Set methods + def __len__(self): + return sum(len(nbrs) for n, nbrs in self._nodes_nbrs()) + + def __iter__(self): + for n, nbrs in self._nodes_nbrs(): + for nbr in nbrs: + yield (n, nbr) + + def __contains__(self, e): + try: + u, v = e + return v in self._adjdict[u] + except KeyError: + return False + + # Mapping Methods + def __getitem__(self, e): + if isinstance(e, slice): + raise nx.NetworkXError( + f"{type(self).__name__} does not support slicing, " + f"try list(G.edges)[{e.start}:{e.stop}:{e.step}]" + ) + u, v = e + return self._adjdict[u][v] + + # EdgeDataView methods + def __call__(self, nbunch=None, data=False, default=None): + if nbunch is None and data is False: + return self + return self.dataview(self, nbunch, data, default) + + def data(self, data=True, default=None, nbunch=None): + """ + Return a read-only view of edge data. + + Parameters + ---------- + data : bool or edge attribute key + If ``data=True``, then the data view maps each edge to a dictionary + containing all of its attributes. If `data` is a key in the edge + dictionary, then the data view maps each edge to its value for + the keyed attribute. In this case, if the edge doesn't have the + attribute, the `default` value is returned. + default : object, default=None + The value used when an edge does not have a specific attribute + nbunch : container of nodes, optional (default=None) + Allows restriction to edges only involving certain nodes. All edges + are considered by default. + + Returns + ------- + dataview + Returns an `EdgeDataView` for undirected Graphs, `OutEdgeDataView` + for DiGraphs, `MultiEdgeDataView` for MultiGraphs and + `OutMultiEdgeDataView` for MultiDiGraphs. + + Notes + ----- + If ``data=False``, returns an `EdgeView` without any edge data. + + See Also + -------- + EdgeDataView + OutEdgeDataView + MultiEdgeDataView + OutMultiEdgeDataView + + Examples + -------- + >>> G = nx.Graph() + >>> G.add_edges_from([ + ... (0, 1, {"dist": 3, "capacity": 20}), + ... (1, 2, {"dist": 4}), + ... (2, 0, {"dist": 5}) + ... ]) + + Accessing edge data with ``data=True`` (the default) returns an + edge data view object listing each edge with all of its attributes: + + >>> G.edges.data() + EdgeDataView([(0, 1, {'dist': 3, 'capacity': 20}), (0, 2, {'dist': 5}), (1, 2, {'dist': 4})]) + + If `data` represents a key in the edge attribute dict, a dataview listing + each edge with its value for that specific key is returned: + + >>> G.edges.data("dist") + EdgeDataView([(0, 1, 3), (0, 2, 5), (1, 2, 4)]) + + `nbunch` can be used to limit the edges: + + >>> G.edges.data("dist", nbunch=[0]) + EdgeDataView([(0, 1, 3), (0, 2, 5)]) + + If a specific key is not found in an edge attribute dict, the value + specified by `default` is used: + + >>> G.edges.data("capacity") + EdgeDataView([(0, 1, 20), (0, 2, None), (1, 2, None)]) + + Note that there is no check that the `data` key is present in any of + the edge attribute dictionaries: + + >>> G.edges.data("speed") + EdgeDataView([(0, 1, None), (0, 2, None), (1, 2, None)]) + """ + if nbunch is None and data is False: + return self + return self.dataview(self, nbunch, data, default) + + # String Methods + def __str__(self): + return str(list(self)) + + def __repr__(self): + return f"{self.__class__.__name__}({list(self)})" + + +class EdgeView(OutEdgeView): + """A EdgeView class for edges of a Graph + + This densely packed View allows iteration over edges, data lookup + like a dict and set operations on edges represented by node-tuples. + In addition, edge data can be controlled by calling this object + possibly creating an EdgeDataView. Typically edges are iterated over + and reported as `(u, v)` node tuples or `(u, v, key)` node/key tuples + for multigraphs. Those edge representations can also be using to + lookup the data dict for any edge. Set operations also are available + where those tuples are the elements of the set. + Calling this object with optional arguments `data`, `default` and `keys` + controls the form of the tuple (see EdgeDataView). Optional argument + `nbunch` allows restriction to edges only involving certain nodes. + + If `data is False` (the default) then iterate over 2-tuples `(u, v)`. + If `data is True` iterate over 3-tuples `(u, v, datadict)`. + Otherwise iterate over `(u, v, datadict.get(data, default))`. + For Multigraphs, if `keys is True`, replace `u, v` with `u, v, key` above. + + Parameters + ========== + graph : NetworkX graph-like class + nbunch : (default= all nodes in graph) only report edges with these nodes + keys : (only for MultiGraph. default=False) report edge key in tuple + data : bool or string (default=False) see above + default : object (default=None) + + Examples + ======== + >>> G = nx.path_graph(4) + >>> EV = G.edges() + >>> (2, 3) in EV + True + >>> for u, v in EV: + ... print((u, v)) + (0, 1) + (1, 2) + (2, 3) + >>> assert EV & {(1, 2), (3, 4)} == {(1, 2)} + + >>> EVdata = G.edges(data="color", default="aqua") + >>> G.add_edge(2, 3, color="blue") + >>> assert (2, 3, "blue") in EVdata + >>> for u, v, c in EVdata: + ... print(f"({u}, {v}) has color: {c}") + (0, 1) has color: aqua + (1, 2) has color: aqua + (2, 3) has color: blue + + >>> EVnbunch = G.edges(nbunch=2) + >>> assert (2, 3) in EVnbunch + >>> assert (0, 1) not in EVnbunch + >>> for u, v in EVnbunch: + ... assert u == 2 or v == 2 + + >>> MG = nx.path_graph(4, create_using=nx.MultiGraph) + >>> EVmulti = MG.edges(keys=True) + >>> (2, 3, 0) in EVmulti + True + >>> (2, 3) in EVmulti # 2-tuples work even when keys is True + True + >>> key = MG.add_edge(2, 3) + >>> for u, v, k in EVmulti: + ... print((u, v, k)) + (0, 1, 0) + (1, 2, 0) + (2, 3, 0) + (2, 3, 1) + """ + + __slots__ = () + + dataview = EdgeDataView + + def __len__(self): + num_nbrs = (len(nbrs) + (n in nbrs) for n, nbrs in self._nodes_nbrs()) + return sum(num_nbrs) // 2 + + def __iter__(self): + seen = {} + for n, nbrs in self._nodes_nbrs(): + for nbr in list(nbrs): + if nbr not in seen: + yield (n, nbr) + seen[n] = 1 + del seen + + def __contains__(self, e): + try: + u, v = e[:2] + return v in self._adjdict[u] or u in self._adjdict[v] + except (KeyError, ValueError): + return False + + +class InEdgeView(OutEdgeView): + """A EdgeView class for inward edges of a DiGraph""" + + __slots__ = () + + def __setstate__(self, state): + self._graph = state["_graph"] + self._adjdict = state["_adjdict"] + self._nodes_nbrs = self._adjdict.items + + dataview = InEdgeDataView + + def __init__(self, G): + self._graph = G + self._adjdict = G._pred if hasattr(G, "pred") else G._adj + self._nodes_nbrs = self._adjdict.items + + def __iter__(self): + for n, nbrs in self._nodes_nbrs(): + for nbr in nbrs: + yield (nbr, n) + + def __contains__(self, e): + try: + u, v = e + return u in self._adjdict[v] + except KeyError: + return False + + def __getitem__(self, e): + if isinstance(e, slice): + raise nx.NetworkXError( + f"{type(self).__name__} does not support slicing, " + f"try list(G.in_edges)[{e.start}:{e.stop}:{e.step}]" + ) + u, v = e + return self._adjdict[v][u] + + +class OutMultiEdgeView(OutEdgeView): + """A EdgeView class for outward edges of a MultiDiGraph""" + + __slots__ = () + + dataview = OutMultiEdgeDataView + + def __len__(self): + return sum( + len(kdict) for n, nbrs in self._nodes_nbrs() for nbr, kdict in nbrs.items() + ) + + def __iter__(self): + for n, nbrs in self._nodes_nbrs(): + for nbr, kdict in nbrs.items(): + for key in kdict: + yield (n, nbr, key) + + def __contains__(self, e): + N = len(e) + if N == 3: + u, v, k = e + elif N == 2: + u, v = e + k = 0 + else: + raise ValueError("MultiEdge must have length 2 or 3") + try: + return k in self._adjdict[u][v] + except KeyError: + return False + + def __getitem__(self, e): + if isinstance(e, slice): + raise nx.NetworkXError( + f"{type(self).__name__} does not support slicing, " + f"try list(G.edges)[{e.start}:{e.stop}:{e.step}]" + ) + u, v, k = e + return self._adjdict[u][v][k] + + def __call__(self, nbunch=None, data=False, keys=False, default=None): + if nbunch is None and data is False and keys is True: + return self + return self.dataview(self, nbunch, data, keys, default) + + def data(self, data=True, keys=False, default=None, nbunch=None): + if nbunch is None and data is False and keys is True: + return self + return self.dataview(self, nbunch, data, keys, default) + + +class MultiEdgeView(OutMultiEdgeView): + """A EdgeView class for edges of a MultiGraph""" + + __slots__ = () + + dataview = MultiEdgeDataView + + def __len__(self): + return sum(1 for e in self) + + def __iter__(self): + seen = {} + for n, nbrs in self._nodes_nbrs(): + for nbr, kd in nbrs.items(): + if nbr not in seen: + for k, dd in kd.items(): + yield (n, nbr, k) + seen[n] = 1 + del seen + + +class InMultiEdgeView(OutMultiEdgeView): + """A EdgeView class for inward edges of a MultiDiGraph""" + + __slots__ = () + + def __setstate__(self, state): + self._graph = state["_graph"] + self._adjdict = state["_adjdict"] + self._nodes_nbrs = self._adjdict.items + + dataview = InMultiEdgeDataView + + def __init__(self, G): + self._graph = G + self._adjdict = G._pred if hasattr(G, "pred") else G._adj + self._nodes_nbrs = self._adjdict.items + + def __iter__(self): + for n, nbrs in self._nodes_nbrs(): + for nbr, kdict in nbrs.items(): + for key in kdict: + yield (nbr, n, key) + + def __contains__(self, e): + N = len(e) + if N == 3: + u, v, k = e + elif N == 2: + u, v = e + k = 0 + else: + raise ValueError("MultiEdge must have length 2 or 3") + try: + return k in self._adjdict[v][u] + except KeyError: + return False + + def __getitem__(self, e): + if isinstance(e, slice): + raise nx.NetworkXError( + f"{type(self).__name__} does not support slicing, " + f"try list(G.in_edges)[{e.start}:{e.stop}:{e.step}]" + ) + u, v, k = e + return self._adjdict[v][u][k] diff --git a/shared/package-files/75/75b8c68841c0041f192ba72de64223e372d29a136e4c8bd3573205c1eb9755e1/__init__.py b/shared/package-files/75/75b8c68841c0041f192ba72de64223e372d29a136e4c8bd3573205c1eb9755e1/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f17a0ae75b0416e4d9e37f84cb15a70e32413689 --- /dev/null +++ b/shared/package-files/75/75b8c68841c0041f192ba72de64223e372d29a136e4c8bd3573205c1eb9755e1/__init__.py @@ -0,0 +1,17 @@ +from statsmodels.tsa.holtwinters.model import ( + PY_SMOOTHERS, + SMOOTHERS, + ExponentialSmoothing, + Holt, + SimpleExpSmoothing, +) +from statsmodels.tsa.holtwinters.results import HoltWintersResults + +__all__ = [ + "PY_SMOOTHERS", + "SMOOTHERS", + "ExponentialSmoothing", + "Holt", + "HoltWintersResults", + "SimpleExpSmoothing", +] diff --git a/shared/package-files/75/75b8e0e428594f6dca6bdcfd0c73977ddb52a4fc147dd80c5e78fc34ea25cbec/_re.py b/shared/package-files/75/75b8e0e428594f6dca6bdcfd0c73977ddb52a4fc147dd80c5e78fc34ea25cbec/_re.py new file mode 100644 index 0000000000000000000000000000000000000000..994bb7493fd92865e6ab87c277ba5741b44c31a9 --- /dev/null +++ b/shared/package-files/75/75b8e0e428594f6dca6bdcfd0c73977ddb52a4fc147dd80c5e78fc34ea25cbec/_re.py @@ -0,0 +1,107 @@ +# SPDX-License-Identifier: MIT +# SPDX-FileCopyrightText: 2021 Taneli Hukkinen +# Licensed to PSF under a Contributor Agreement. + +from __future__ import annotations + +from datetime import date, datetime, time, timedelta, timezone, tzinfo +from functools import lru_cache +import re +from typing import Any + +from ._types import ParseFloat + +# E.g. +# - 00:32:00.999999 +# - 00:32:00 +_TIME_RE_STR = r"([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])(?:\.([0-9]{1,6})[0-9]*)?" + +RE_NUMBER = re.compile( + r""" +0 +(?: + x[0-9A-Fa-f](?:_?[0-9A-Fa-f])* # hex + | + b[01](?:_?[01])* # bin + | + o[0-7](?:_?[0-7])* # oct +) +| +[+-]?(?:0|[1-9](?:_?[0-9])*) # dec, integer part +(?P + (?:\.[0-9](?:_?[0-9])*)? # optional fractional part + (?:[eE][+-]?[0-9](?:_?[0-9])*)? # optional exponent part +) +""", + flags=re.VERBOSE, +) +RE_LOCALTIME = re.compile(_TIME_RE_STR) +RE_DATETIME = re.compile( + rf""" +([0-9]{{4}})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]) # date, e.g. 1988-10-27 +(?: + [Tt ] + {_TIME_RE_STR} + (?:([Zz])|([+-])([01][0-9]|2[0-3]):([0-5][0-9]))? # optional time offset +)? +""", + flags=re.VERBOSE, +) + + +def match_to_datetime(match: re.Match) -> datetime | date: + """Convert a `RE_DATETIME` match to `datetime.datetime` or `datetime.date`. + + Raises ValueError if the match does not correspond to a valid date + or datetime. + """ + ( + year_str, + month_str, + day_str, + hour_str, + minute_str, + sec_str, + micros_str, + zulu_time, + offset_sign_str, + offset_hour_str, + offset_minute_str, + ) = match.groups() + year, month, day = int(year_str), int(month_str), int(day_str) + if hour_str is None: + return date(year, month, day) + hour, minute, sec = int(hour_str), int(minute_str), int(sec_str) + micros = int(micros_str.ljust(6, "0")) if micros_str else 0 + if offset_sign_str: + tz: tzinfo | None = cached_tz( + offset_hour_str, offset_minute_str, offset_sign_str + ) + elif zulu_time: + tz = timezone.utc + else: # local date-time + tz = None + return datetime(year, month, day, hour, minute, sec, micros, tzinfo=tz) + + +@lru_cache(maxsize=None) +def cached_tz(hour_str: str, minute_str: str, sign_str: str) -> timezone: + sign = 1 if sign_str == "+" else -1 + return timezone( + timedelta( + hours=sign * int(hour_str), + minutes=sign * int(minute_str), + ) + ) + + +def match_to_localtime(match: re.Match) -> time: + hour_str, minute_str, sec_str, micros_str = match.groups() + micros = int(micros_str.ljust(6, "0")) if micros_str else 0 + return time(int(hour_str), int(minute_str), int(sec_str), micros) + + +def match_to_number(match: re.Match, parse_float: ParseFloat) -> Any: + if match.group("floatpart"): + return parse_float(match.group()) + return int(match.group(), 0) diff --git a/shared/package-files/75/75b9a0df9cf01703d289847ee4eb9203bf74b2504472df0de82d639045dc841b/test_asfreq.py b/shared/package-files/75/75b9a0df9cf01703d289847ee4eb9203bf74b2504472df0de82d639045dc841b/test_asfreq.py new file mode 100644 index 0000000000000000000000000000000000000000..73c4d8061c25789c1ec2a5e4d2c2851d4066a90e --- /dev/null +++ b/shared/package-files/75/75b9a0df9cf01703d289847ee4eb9203bf74b2504472df0de82d639045dc841b/test_asfreq.py @@ -0,0 +1,828 @@ +import pytest + +from pandas._libs.tslibs.period import INVALID_FREQ_ERR_MSG +from pandas.errors import OutOfBoundsDatetime + +from pandas import ( + Period, + Timestamp, + offsets, +) +import pandas._testing as tm + +bday_msg = "Period with BDay freq is deprecated" + + +class TestFreqConversion: + """Test frequency conversion of date objects""" + + @pytest.mark.filterwarnings("ignore:Period with BDay:FutureWarning") + @pytest.mark.parametrize("freq", ["Y", "Q", "M", "W", "B", "D"]) + def test_asfreq_near_zero(self, freq): + # GH#19643, GH#19650 + per = Period("0001-01-01", freq=freq) + tup1 = (per.year, per.hour, per.day) + + prev = per - 1 + assert prev.ordinal == per.ordinal - 1 + tup2 = (prev.year, prev.month, prev.day) + assert tup2 < tup1 + + def test_asfreq_near_zero_weekly(self): + # GH#19834 + per1 = Period("0001-01-01", "D") + 6 + per2 = Period("0001-01-01", "D") - 6 + week1 = per1.asfreq("W") + week2 = per2.asfreq("W") + assert week1 != week2 + assert week1.asfreq("D", "E") >= per1 + assert week2.asfreq("D", "S") <= per2 + + def test_to_timestamp_out_of_bounds(self): + # GH#19643, used to incorrectly give Timestamp in 1754 + with tm.assert_produces_warning(FutureWarning, match=bday_msg): + per = Period("0001-01-01", freq="B") + msg = "Out of bounds nanosecond timestamp" + with pytest.raises(OutOfBoundsDatetime, match=msg): + with tm.assert_produces_warning(FutureWarning, match=bday_msg): + per.to_timestamp() + + def test_asfreq_corner(self): + val = Period(freq="Y", year=2007) + result1 = val.asfreq("5min") + result2 = val.asfreq("min") + expected = Period("2007-12-31 23:59", freq="min") + assert result1.ordinal == expected.ordinal + assert result1.freqstr == "5min" + assert result2.ordinal == expected.ordinal + assert result2.freqstr == "min" + + def test_conv_annual(self): + # frequency conversion tests: from Annual Frequency + + ival_A = Period(freq="Y", year=2007) + + ival_AJAN = Period(freq="Y-JAN", year=2007) + ival_AJUN = Period(freq="Y-JUN", year=2007) + ival_ANOV = Period(freq="Y-NOV", year=2007) + + ival_A_to_Q_start = Period(freq="Q", year=2007, quarter=1) + ival_A_to_Q_end = Period(freq="Q", year=2007, quarter=4) + ival_A_to_M_start = Period(freq="M", year=2007, month=1) + ival_A_to_M_end = Period(freq="M", year=2007, month=12) + ival_A_to_W_start = Period(freq="W", year=2007, month=1, day=1) + ival_A_to_W_end = Period(freq="W", year=2007, month=12, day=31) + with tm.assert_produces_warning(FutureWarning, match=bday_msg): + ival_A_to_B_start = Period(freq="B", year=2007, month=1, day=1) + ival_A_to_B_end = Period(freq="B", year=2007, month=12, day=31) + ival_A_to_D_start = Period(freq="D", year=2007, month=1, day=1) + ival_A_to_D_end = Period(freq="D", year=2007, month=12, day=31) + ival_A_to_H_start = Period(freq="h", year=2007, month=1, day=1, hour=0) + ival_A_to_H_end = Period(freq="h", year=2007, month=12, day=31, hour=23) + ival_A_to_T_start = Period( + freq="Min", year=2007, month=1, day=1, hour=0, minute=0 + ) + ival_A_to_T_end = Period( + freq="Min", year=2007, month=12, day=31, hour=23, minute=59 + ) + ival_A_to_S_start = Period( + freq="s", year=2007, month=1, day=1, hour=0, minute=0, second=0 + ) + ival_A_to_S_end = Period( + freq="s", year=2007, month=12, day=31, hour=23, minute=59, second=59 + ) + + ival_AJAN_to_D_end = Period(freq="D", year=2007, month=1, day=31) + ival_AJAN_to_D_start = Period(freq="D", year=2006, month=2, day=1) + ival_AJUN_to_D_end = Period(freq="D", year=2007, month=6, day=30) + ival_AJUN_to_D_start = Period(freq="D", year=2006, month=7, day=1) + ival_ANOV_to_D_end = Period(freq="D", year=2007, month=11, day=30) + ival_ANOV_to_D_start = Period(freq="D", year=2006, month=12, day=1) + + assert ival_A.asfreq("Q", "s") == ival_A_to_Q_start + assert ival_A.asfreq("Q", "e") == ival_A_to_Q_end + assert ival_A.asfreq("M", "s") == ival_A_to_M_start + assert ival_A.asfreq("M", "E") == ival_A_to_M_end + assert ival_A.asfreq("W", "s") == ival_A_to_W_start + assert ival_A.asfreq("W", "E") == ival_A_to_W_end + with tm.assert_produces_warning(FutureWarning, match=bday_msg): + assert ival_A.asfreq("B", "s") == ival_A_to_B_start + assert ival_A.asfreq("B", "E") == ival_A_to_B_end + assert ival_A.asfreq("D", "s") == ival_A_to_D_start + assert ival_A.asfreq("D", "E") == ival_A_to_D_end + msg = "'H' is deprecated and will be removed in a future version." + with tm.assert_produces_warning(FutureWarning, match=msg): + assert ival_A.asfreq("H", "s") == ival_A_to_H_start + assert ival_A.asfreq("H", "E") == ival_A_to_H_end + assert ival_A.asfreq("min", "s") == ival_A_to_T_start + assert ival_A.asfreq("min", "E") == ival_A_to_T_end + msg = "'T' is deprecated and will be removed in a future version." + with tm.assert_produces_warning(FutureWarning, match=msg): + assert ival_A.asfreq("T", "s") == ival_A_to_T_start + assert ival_A.asfreq("T", "E") == ival_A_to_T_end + msg = "'S' is deprecated and will be removed in a future version." + with tm.assert_produces_warning(FutureWarning, match=msg): + assert ival_A.asfreq("S", "S") == ival_A_to_S_start + assert ival_A.asfreq("S", "E") == ival_A_to_S_end + + assert ival_AJAN.asfreq("D", "s") == ival_AJAN_to_D_start + assert ival_AJAN.asfreq("D", "E") == ival_AJAN_to_D_end + + assert ival_AJUN.asfreq("D", "s") == ival_AJUN_to_D_start + assert ival_AJUN.asfreq("D", "E") == ival_AJUN_to_D_end + + assert ival_ANOV.asfreq("D", "s") == ival_ANOV_to_D_start + assert ival_ANOV.asfreq("D", "E") == ival_ANOV_to_D_end + + assert ival_A.asfreq("Y") == ival_A + + def test_conv_quarterly(self): + # frequency conversion tests: from Quarterly Frequency + + ival_Q = Period(freq="Q", year=2007, quarter=1) + ival_Q_end_of_year = Period(freq="Q", year=2007, quarter=4) + + ival_QEJAN = Period(freq="Q-JAN", year=2007, quarter=1) + ival_QEJUN = Period(freq="Q-JUN", year=2007, quarter=1) + + ival_Q_to_A = Period(freq="Y", year=2007) + ival_Q_to_M_start = Period(freq="M", year=2007, month=1) + ival_Q_to_M_end = Period(freq="M", year=2007, month=3) + ival_Q_to_W_start = Period(freq="W", year=2007, month=1, day=1) + ival_Q_to_W_end = Period(freq="W", year=2007, month=3, day=31) + with tm.assert_produces_warning(FutureWarning, match=bday_msg): + ival_Q_to_B_start = Period(freq="B", year=2007, month=1, day=1) + ival_Q_to_B_end = Period(freq="B", year=2007, month=3, day=30) + ival_Q_to_D_start = Period(freq="D", year=2007, month=1, day=1) + ival_Q_to_D_end = Period(freq="D", year=2007, month=3, day=31) + ival_Q_to_H_start = Period(freq="h", year=2007, month=1, day=1, hour=0) + ival_Q_to_H_end = Period(freq="h", year=2007, month=3, day=31, hour=23) + ival_Q_to_T_start = Period( + freq="Min", year=2007, month=1, day=1, hour=0, minute=0 + ) + ival_Q_to_T_end = Period( + freq="Min", year=2007, month=3, day=31, hour=23, minute=59 + ) + ival_Q_to_S_start = Period( + freq="s", year=2007, month=1, day=1, hour=0, minute=0, second=0 + ) + ival_Q_to_S_end = Period( + freq="s", year=2007, month=3, day=31, hour=23, minute=59, second=59 + ) + + ival_QEJAN_to_D_start = Period(freq="D", year=2006, month=2, day=1) + ival_QEJAN_to_D_end = Period(freq="D", year=2006, month=4, day=30) + + ival_QEJUN_to_D_start = Period(freq="D", year=2006, month=7, day=1) + ival_QEJUN_to_D_end = Period(freq="D", year=2006, month=9, day=30) + + assert ival_Q.asfreq("Y") == ival_Q_to_A + assert ival_Q_end_of_year.asfreq("Y") == ival_Q_to_A + + assert ival_Q.asfreq("M", "s") == ival_Q_to_M_start + assert ival_Q.asfreq("M", "E") == ival_Q_to_M_end + assert ival_Q.asfreq("W", "s") == ival_Q_to_W_start + assert ival_Q.asfreq("W", "E") == ival_Q_to_W_end + with tm.assert_produces_warning(FutureWarning, match=bday_msg): + assert ival_Q.asfreq("B", "s") == ival_Q_to_B_start + assert ival_Q.asfreq("B", "E") == ival_Q_to_B_end + assert ival_Q.asfreq("D", "s") == ival_Q_to_D_start + assert ival_Q.asfreq("D", "E") == ival_Q_to_D_end + assert ival_Q.asfreq("h", "s") == ival_Q_to_H_start + assert ival_Q.asfreq("h", "E") == ival_Q_to_H_end + assert ival_Q.asfreq("Min", "s") == ival_Q_to_T_start + assert ival_Q.asfreq("Min", "E") == ival_Q_to_T_end + assert ival_Q.asfreq("s", "s") == ival_Q_to_S_start + assert ival_Q.asfreq("s", "E") == ival_Q_to_S_end + + assert ival_QEJAN.asfreq("D", "s") == ival_QEJAN_to_D_start + assert ival_QEJAN.asfreq("D", "E") == ival_QEJAN_to_D_end + assert ival_QEJUN.asfreq("D", "s") == ival_QEJUN_to_D_start + assert ival_QEJUN.asfreq("D", "E") == ival_QEJUN_to_D_end + + assert ival_Q.asfreq("Q") == ival_Q + + def test_conv_monthly(self): + # frequency conversion tests: from Monthly Frequency + + ival_M = Period(freq="M", year=2007, month=1) + ival_M_end_of_year = Period(freq="M", year=2007, month=12) + ival_M_end_of_quarter = Period(freq="M", year=2007, month=3) + ival_M_to_A = Period(freq="Y", year=2007) + ival_M_to_Q = Period(freq="Q", year=2007, quarter=1) + ival_M_to_W_start = Period(freq="W", year=2007, month=1, day=1) + ival_M_to_W_end = Period(freq="W", year=2007, month=1, day=31) + with tm.assert_produces_warning(FutureWarning, match=bday_msg): + ival_M_to_B_start = Period(freq="B", year=2007, month=1, day=1) + ival_M_to_B_end = Period(freq="B", year=2007, month=1, day=31) + ival_M_to_D_start = Period(freq="D", year=2007, month=1, day=1) + ival_M_to_D_end = Period(freq="D", year=2007, month=1, day=31) + ival_M_to_H_start = Period(freq="h", year=2007, month=1, day=1, hour=0) + ival_M_to_H_end = Period(freq="h", year=2007, month=1, day=31, hour=23) + ival_M_to_T_start = Period( + freq="Min", year=2007, month=1, day=1, hour=0, minute=0 + ) + ival_M_to_T_end = Period( + freq="Min", year=2007, month=1, day=31, hour=23, minute=59 + ) + ival_M_to_S_start = Period( + freq="s", year=2007, month=1, day=1, hour=0, minute=0, second=0 + ) + ival_M_to_S_end = Period( + freq="s", year=2007, month=1, day=31, hour=23, minute=59, second=59 + ) + + assert ival_M.asfreq("Y") == ival_M_to_A + assert ival_M_end_of_year.asfreq("Y") == ival_M_to_A + assert ival_M.asfreq("Q") == ival_M_to_Q + assert ival_M_end_of_quarter.asfreq("Q") == ival_M_to_Q + + assert ival_M.asfreq("W", "s") == ival_M_to_W_start + assert ival_M.asfreq("W", "E") == ival_M_to_W_end + with tm.assert_produces_warning(FutureWarning, match=bday_msg): + assert ival_M.asfreq("B", "s") == ival_M_to_B_start + assert ival_M.asfreq("B", "E") == ival_M_to_B_end + assert ival_M.asfreq("D", "s") == ival_M_to_D_start + assert ival_M.asfreq("D", "E") == ival_M_to_D_end + assert ival_M.asfreq("h", "s") == ival_M_to_H_start + assert ival_M.asfreq("h", "E") == ival_M_to_H_end + assert ival_M.asfreq("Min", "s") == ival_M_to_T_start + assert ival_M.asfreq("Min", "E") == ival_M_to_T_end + assert ival_M.asfreq("s", "s") == ival_M_to_S_start + assert ival_M.asfreq("s", "E") == ival_M_to_S_end + + assert ival_M.asfreq("M") == ival_M + + def test_conv_weekly(self): + # frequency conversion tests: from Weekly Frequency + ival_W = Period(freq="W", year=2007, month=1, day=1) + + ival_WSUN = Period(freq="W", year=2007, month=1, day=7) + ival_WSAT = Period(freq="W-SAT", year=2007, month=1, day=6) + ival_WFRI = Period(freq="W-FRI", year=2007, month=1, day=5) + ival_WTHU = Period(freq="W-THU", year=2007, month=1, day=4) + ival_WWED = Period(freq="W-WED", year=2007, month=1, day=3) + ival_WTUE = Period(freq="W-TUE", year=2007, month=1, day=2) + ival_WMON = Period(freq="W-MON", year=2007, month=1, day=1) + + ival_WSUN_to_D_start = Period(freq="D", year=2007, month=1, day=1) + ival_WSUN_to_D_end = Period(freq="D", year=2007, month=1, day=7) + ival_WSAT_to_D_start = Period(freq="D", year=2006, month=12, day=31) + ival_WSAT_to_D_end = Period(freq="D", year=2007, month=1, day=6) + ival_WFRI_to_D_start = Period(freq="D", year=2006, month=12, day=30) + ival_WFRI_to_D_end = Period(freq="D", year=2007, month=1, day=5) + ival_WTHU_to_D_start = Period(freq="D", year=2006, month=12, day=29) + ival_WTHU_to_D_end = Period(freq="D", year=2007, month=1, day=4) + ival_WWED_to_D_start = Period(freq="D", year=2006, month=12, day=28) + ival_WWED_to_D_end = Period(freq="D", year=2007, month=1, day=3) + ival_WTUE_to_D_start = Period(freq="D", year=2006, month=12, day=27) + ival_WTUE_to_D_end = Period(freq="D", year=2007, month=1, day=2) + ival_WMON_to_D_start = Period(freq="D", year=2006, month=12, day=26) + ival_WMON_to_D_end = Period(freq="D", year=2007, month=1, day=1) + + ival_W_end_of_year = Period(freq="W", year=2007, month=12, day=31) + ival_W_end_of_quarter = Period(freq="W", year=2007, month=3, day=31) + ival_W_end_of_month = Period(freq="W", year=2007, month=1, day=31) + ival_W_to_A = Period(freq="Y", year=2007) + ival_W_to_Q = Period(freq="Q", year=2007, quarter=1) + ival_W_to_M = Period(freq="M", year=2007, month=1) + + if Period(freq="D", year=2007, month=12, day=31).weekday == 6: + ival_W_to_A_end_of_year = Period(freq="Y", year=2007) + else: + ival_W_to_A_end_of_year = Period(freq="Y", year=2008) + + if Period(freq="D", year=2007, month=3, day=31).weekday == 6: + ival_W_to_Q_end_of_quarter = Period(freq="Q", year=2007, quarter=1) + else: + ival_W_to_Q_end_of_quarter = Period(freq="Q", year=2007, quarter=2) + + if Period(freq="D", year=2007, month=1, day=31).weekday == 6: + ival_W_to_M_end_of_month = Period(freq="M", year=2007, month=1) + else: + ival_W_to_M_end_of_month = Period(freq="M", year=2007, month=2) + + with tm.assert_produces_warning(FutureWarning, match=bday_msg): + ival_W_to_B_start = Period(freq="B", year=2007, month=1, day=1) + ival_W_to_B_end = Period(freq="B", year=2007, month=1, day=5) + ival_W_to_D_start = Period(freq="D", year=2007, month=1, day=1) + ival_W_to_D_end = Period(freq="D", year=2007, month=1, day=7) + ival_W_to_H_start = Period(freq="h", year=2007, month=1, day=1, hour=0) + ival_W_to_H_end = Period(freq="h", year=2007, month=1, day=7, hour=23) + ival_W_to_T_start = Period( + freq="Min", year=2007, month=1, day=1, hour=0, minute=0 + ) + ival_W_to_T_end = Period( + freq="Min", year=2007, month=1, day=7, hour=23, minute=59 + ) + ival_W_to_S_start = Period( + freq="s", year=2007, month=1, day=1, hour=0, minute=0, second=0 + ) + ival_W_to_S_end = Period( + freq="s", year=2007, month=1, day=7, hour=23, minute=59, second=59 + ) + + assert ival_W.asfreq("Y") == ival_W_to_A + assert ival_W_end_of_year.asfreq("Y") == ival_W_to_A_end_of_year + + assert ival_W.asfreq("Q") == ival_W_to_Q + assert ival_W_end_of_quarter.asfreq("Q") == ival_W_to_Q_end_of_quarter + + assert ival_W.asfreq("M") == ival_W_to_M + assert ival_W_end_of_month.asfreq("M") == ival_W_to_M_end_of_month + + with tm.assert_produces_warning(FutureWarning, match=bday_msg): + assert ival_W.asfreq("B", "s") == ival_W_to_B_start + assert ival_W.asfreq("B", "E") == ival_W_to_B_end + + assert ival_W.asfreq("D", "s") == ival_W_to_D_start + assert ival_W.asfreq("D", "E") == ival_W_to_D_end + + assert ival_WSUN.asfreq("D", "s") == ival_WSUN_to_D_start + assert ival_WSUN.asfreq("D", "E") == ival_WSUN_to_D_end + assert ival_WSAT.asfreq("D", "s") == ival_WSAT_to_D_start + assert ival_WSAT.asfreq("D", "E") == ival_WSAT_to_D_end + assert ival_WFRI.asfreq("D", "s") == ival_WFRI_to_D_start + assert ival_WFRI.asfreq("D", "E") == ival_WFRI_to_D_end + assert ival_WTHU.asfreq("D", "s") == ival_WTHU_to_D_start + assert ival_WTHU.asfreq("D", "E") == ival_WTHU_to_D_end + assert ival_WWED.asfreq("D", "s") == ival_WWED_to_D_start + assert ival_WWED.asfreq("D", "E") == ival_WWED_to_D_end + assert ival_WTUE.asfreq("D", "s") == ival_WTUE_to_D_start + assert ival_WTUE.asfreq("D", "E") == ival_WTUE_to_D_end + assert ival_WMON.asfreq("D", "s") == ival_WMON_to_D_start + assert ival_WMON.asfreq("D", "E") == ival_WMON_to_D_end + + assert ival_W.asfreq("h", "s") == ival_W_to_H_start + assert ival_W.asfreq("h", "E") == ival_W_to_H_end + assert ival_W.asfreq("Min", "s") == ival_W_to_T_start + assert ival_W.asfreq("Min", "E") == ival_W_to_T_end + assert ival_W.asfreq("s", "s") == ival_W_to_S_start + assert ival_W.asfreq("s", "E") == ival_W_to_S_end + + assert ival_W.asfreq("W") == ival_W + + msg = INVALID_FREQ_ERR_MSG + with pytest.raises(ValueError, match=msg): + ival_W.asfreq("WK") + + def test_conv_weekly_legacy(self): + # frequency conversion tests: from Weekly Frequency + msg = INVALID_FREQ_ERR_MSG + with pytest.raises(ValueError, match=msg): + Period(freq="WK", year=2007, month=1, day=1) + + with pytest.raises(ValueError, match=msg): + Period(freq="WK-SAT", year=2007, month=1, day=6) + with pytest.raises(ValueError, match=msg): + Period(freq="WK-FRI", year=2007, month=1, day=5) + with pytest.raises(ValueError, match=msg): + Period(freq="WK-THU", year=2007, month=1, day=4) + with pytest.raises(ValueError, match=msg): + Period(freq="WK-WED", year=2007, month=1, day=3) + with pytest.raises(ValueError, match=msg): + Period(freq="WK-TUE", year=2007, month=1, day=2) + with pytest.raises(ValueError, match=msg): + Period(freq="WK-MON", year=2007, month=1, day=1) + + def test_conv_business(self): + # frequency conversion tests: from Business Frequency" + + with tm.assert_produces_warning(FutureWarning, match=bday_msg): + ival_B = Period(freq="B", year=2007, month=1, day=1) + ival_B_end_of_year = Period(freq="B", year=2007, month=12, day=31) + ival_B_end_of_quarter = Period(freq="B", year=2007, month=3, day=30) + ival_B_end_of_month = Period(freq="B", year=2007, month=1, day=31) + ival_B_end_of_week = Period(freq="B", year=2007, month=1, day=5) + + ival_B_to_A = Period(freq="Y", year=2007) + ival_B_to_Q = Period(freq="Q", year=2007, quarter=1) + ival_B_to_M = Period(freq="M", year=2007, month=1) + ival_B_to_W = Period(freq="W", year=2007, month=1, day=7) + ival_B_to_D = Period(freq="D", year=2007, month=1, day=1) + ival_B_to_H_start = Period(freq="h", year=2007, month=1, day=1, hour=0) + ival_B_to_H_end = Period(freq="h", year=2007, month=1, day=1, hour=23) + ival_B_to_T_start = Period( + freq="Min", year=2007, month=1, day=1, hour=0, minute=0 + ) + ival_B_to_T_end = Period( + freq="Min", year=2007, month=1, day=1, hour=23, minute=59 + ) + ival_B_to_S_start = Period( + freq="s", year=2007, month=1, day=1, hour=0, minute=0, second=0 + ) + ival_B_to_S_end = Period( + freq="s", year=2007, month=1, day=1, hour=23, minute=59, second=59 + ) + + assert ival_B.asfreq("Y") == ival_B_to_A + assert ival_B_end_of_year.asfreq("Y") == ival_B_to_A + assert ival_B.asfreq("Q") == ival_B_to_Q + assert ival_B_end_of_quarter.asfreq("Q") == ival_B_to_Q + assert ival_B.asfreq("M") == ival_B_to_M + assert ival_B_end_of_month.asfreq("M") == ival_B_to_M + assert ival_B.asfreq("W") == ival_B_to_W + assert ival_B_end_of_week.asfreq("W") == ival_B_to_W + + assert ival_B.asfreq("D") == ival_B_to_D + + assert ival_B.asfreq("h", "s") == ival_B_to_H_start + assert ival_B.asfreq("h", "E") == ival_B_to_H_end + assert ival_B.asfreq("Min", "s") == ival_B_to_T_start + assert ival_B.asfreq("Min", "E") == ival_B_to_T_end + assert ival_B.asfreq("s", "s") == ival_B_to_S_start + assert ival_B.asfreq("s", "E") == ival_B_to_S_end + + with tm.assert_produces_warning(FutureWarning, match=bday_msg): + assert ival_B.asfreq("B") == ival_B + + def test_conv_daily(self): + # frequency conversion tests: from Business Frequency" + + ival_D = Period(freq="D", year=2007, month=1, day=1) + ival_D_end_of_year = Period(freq="D", year=2007, month=12, day=31) + ival_D_end_of_quarter = Period(freq="D", year=2007, month=3, day=31) + ival_D_end_of_month = Period(freq="D", year=2007, month=1, day=31) + ival_D_end_of_week = Period(freq="D", year=2007, month=1, day=7) + + ival_D_friday = Period(freq="D", year=2007, month=1, day=5) + ival_D_saturday = Period(freq="D", year=2007, month=1, day=6) + ival_D_sunday = Period(freq="D", year=2007, month=1, day=7) + + with tm.assert_produces_warning(FutureWarning, match=bday_msg): + ival_B_friday = Period(freq="B", year=2007, month=1, day=5) + ival_B_monday = Period(freq="B", year=2007, month=1, day=8) + + ival_D_to_A = Period(freq="Y", year=2007) + + ival_Deoq_to_AJAN = Period(freq="Y-JAN", year=2008) + ival_Deoq_to_AJUN = Period(freq="Y-JUN", year=2007) + ival_Deoq_to_ADEC = Period(freq="Y-DEC", year=2007) + + ival_D_to_QEJAN = Period(freq="Q-JAN", year=2007, quarter=4) + ival_D_to_QEJUN = Period(freq="Q-JUN", year=2007, quarter=3) + ival_D_to_QEDEC = Period(freq="Q-DEC", year=2007, quarter=1) + + ival_D_to_M = Period(freq="M", year=2007, month=1) + ival_D_to_W = Period(freq="W", year=2007, month=1, day=7) + + ival_D_to_H_start = Period(freq="h", year=2007, month=1, day=1, hour=0) + ival_D_to_H_end = Period(freq="h", year=2007, month=1, day=1, hour=23) + ival_D_to_T_start = Period( + freq="Min", year=2007, month=1, day=1, hour=0, minute=0 + ) + ival_D_to_T_end = Period( + freq="Min", year=2007, month=1, day=1, hour=23, minute=59 + ) + ival_D_to_S_start = Period( + freq="s", year=2007, month=1, day=1, hour=0, minute=0, second=0 + ) + ival_D_to_S_end = Period( + freq="s", year=2007, month=1, day=1, hour=23, minute=59, second=59 + ) + + assert ival_D.asfreq("Y") == ival_D_to_A + + assert ival_D_end_of_quarter.asfreq("Y-JAN") == ival_Deoq_to_AJAN + assert ival_D_end_of_quarter.asfreq("Y-JUN") == ival_Deoq_to_AJUN + assert ival_D_end_of_quarter.asfreq("Y-DEC") == ival_Deoq_to_ADEC + + assert ival_D_end_of_year.asfreq("Y") == ival_D_to_A + assert ival_D_end_of_quarter.asfreq("Q") == ival_D_to_QEDEC + assert ival_D.asfreq("Q-JAN") == ival_D_to_QEJAN + assert ival_D.asfreq("Q-JUN") == ival_D_to_QEJUN + assert ival_D.asfreq("Q-DEC") == ival_D_to_QEDEC + assert ival_D.asfreq("M") == ival_D_to_M + assert ival_D_end_of_month.asfreq("M") == ival_D_to_M + assert ival_D.asfreq("W") == ival_D_to_W + assert ival_D_end_of_week.asfreq("W") == ival_D_to_W + + with tm.assert_produces_warning(FutureWarning, match=bday_msg): + assert ival_D_friday.asfreq("B") == ival_B_friday + assert ival_D_saturday.asfreq("B", "s") == ival_B_friday + assert ival_D_saturday.asfreq("B", "E") == ival_B_monday + assert ival_D_sunday.asfreq("B", "s") == ival_B_friday + assert ival_D_sunday.asfreq("B", "E") == ival_B_monday + + assert ival_D.asfreq("h", "s") == ival_D_to_H_start + assert ival_D.asfreq("h", "E") == ival_D_to_H_end + assert ival_D.asfreq("Min", "s") == ival_D_to_T_start + assert ival_D.asfreq("Min", "E") == ival_D_to_T_end + assert ival_D.asfreq("s", "s") == ival_D_to_S_start + assert ival_D.asfreq("s", "E") == ival_D_to_S_end + + assert ival_D.asfreq("D") == ival_D + + def test_conv_hourly(self): + # frequency conversion tests: from Hourly Frequency" + + ival_H = Period(freq="h", year=2007, month=1, day=1, hour=0) + ival_H_end_of_year = Period(freq="h", year=2007, month=12, day=31, hour=23) + ival_H_end_of_quarter = Period(freq="h", year=2007, month=3, day=31, hour=23) + ival_H_end_of_month = Period(freq="h", year=2007, month=1, day=31, hour=23) + ival_H_end_of_week = Period(freq="h", year=2007, month=1, day=7, hour=23) + ival_H_end_of_day = Period(freq="h", year=2007, month=1, day=1, hour=23) + ival_H_end_of_bus = Period(freq="h", year=2007, month=1, day=1, hour=23) + + ival_H_to_A = Period(freq="Y", year=2007) + ival_H_to_Q = Period(freq="Q", year=2007, quarter=1) + ival_H_to_M = Period(freq="M", year=2007, month=1) + ival_H_to_W = Period(freq="W", year=2007, month=1, day=7) + ival_H_to_D = Period(freq="D", year=2007, month=1, day=1) + with tm.assert_produces_warning(FutureWarning, match=bday_msg): + ival_H_to_B = Period(freq="B", year=2007, month=1, day=1) + + ival_H_to_T_start = Period( + freq="Min", year=2007, month=1, day=1, hour=0, minute=0 + ) + ival_H_to_T_end = Period( + freq="Min", year=2007, month=1, day=1, hour=0, minute=59 + ) + ival_H_to_S_start = Period( + freq="s", year=2007, month=1, day=1, hour=0, minute=0, second=0 + ) + ival_H_to_S_end = Period( + freq="s", year=2007, month=1, day=1, hour=0, minute=59, second=59 + ) + + assert ival_H.asfreq("Y") == ival_H_to_A + assert ival_H_end_of_year.asfreq("Y") == ival_H_to_A + assert ival_H.asfreq("Q") == ival_H_to_Q + assert ival_H_end_of_quarter.asfreq("Q") == ival_H_to_Q + assert ival_H.asfreq("M") == ival_H_to_M + assert ival_H_end_of_month.asfreq("M") == ival_H_to_M + assert ival_H.asfreq("W") == ival_H_to_W + assert ival_H_end_of_week.asfreq("W") == ival_H_to_W + assert ival_H.asfreq("D") == ival_H_to_D + assert ival_H_end_of_day.asfreq("D") == ival_H_to_D + with tm.assert_produces_warning(FutureWarning, match=bday_msg): + assert ival_H.asfreq("B") == ival_H_to_B + assert ival_H_end_of_bus.asfreq("B") == ival_H_to_B + + assert ival_H.asfreq("Min", "s") == ival_H_to_T_start + assert ival_H.asfreq("Min", "E") == ival_H_to_T_end + assert ival_H.asfreq("s", "s") == ival_H_to_S_start + assert ival_H.asfreq("s", "E") == ival_H_to_S_end + + assert ival_H.asfreq("h") == ival_H + + def test_conv_minutely(self): + # frequency conversion tests: from Minutely Frequency" + + ival_T = Period(freq="Min", year=2007, month=1, day=1, hour=0, minute=0) + ival_T_end_of_year = Period( + freq="Min", year=2007, month=12, day=31, hour=23, minute=59 + ) + ival_T_end_of_quarter = Period( + freq="Min", year=2007, month=3, day=31, hour=23, minute=59 + ) + ival_T_end_of_month = Period( + freq="Min", year=2007, month=1, day=31, hour=23, minute=59 + ) + ival_T_end_of_week = Period( + freq="Min", year=2007, month=1, day=7, hour=23, minute=59 + ) + ival_T_end_of_day = Period( + freq="Min", year=2007, month=1, day=1, hour=23, minute=59 + ) + ival_T_end_of_bus = Period( + freq="Min", year=2007, month=1, day=1, hour=23, minute=59 + ) + ival_T_end_of_hour = Period( + freq="Min", year=2007, month=1, day=1, hour=0, minute=59 + ) + + ival_T_to_A = Period(freq="Y", year=2007) + ival_T_to_Q = Period(freq="Q", year=2007, quarter=1) + ival_T_to_M = Period(freq="M", year=2007, month=1) + ival_T_to_W = Period(freq="W", year=2007, month=1, day=7) + ival_T_to_D = Period(freq="D", year=2007, month=1, day=1) + with tm.assert_produces_warning(FutureWarning, match=bday_msg): + ival_T_to_B = Period(freq="B", year=2007, month=1, day=1) + ival_T_to_H = Period(freq="h", year=2007, month=1, day=1, hour=0) + + ival_T_to_S_start = Period( + freq="s", year=2007, month=1, day=1, hour=0, minute=0, second=0 + ) + ival_T_to_S_end = Period( + freq="s", year=2007, month=1, day=1, hour=0, minute=0, second=59 + ) + + assert ival_T.asfreq("Y") == ival_T_to_A + assert ival_T_end_of_year.asfreq("Y") == ival_T_to_A + assert ival_T.asfreq("Q") == ival_T_to_Q + assert ival_T_end_of_quarter.asfreq("Q") == ival_T_to_Q + assert ival_T.asfreq("M") == ival_T_to_M + assert ival_T_end_of_month.asfreq("M") == ival_T_to_M + assert ival_T.asfreq("W") == ival_T_to_W + assert ival_T_end_of_week.asfreq("W") == ival_T_to_W + assert ival_T.asfreq("D") == ival_T_to_D + assert ival_T_end_of_day.asfreq("D") == ival_T_to_D + with tm.assert_produces_warning(FutureWarning, match=bday_msg): + assert ival_T.asfreq("B") == ival_T_to_B + assert ival_T_end_of_bus.asfreq("B") == ival_T_to_B + assert ival_T.asfreq("h") == ival_T_to_H + assert ival_T_end_of_hour.asfreq("h") == ival_T_to_H + + assert ival_T.asfreq("s", "s") == ival_T_to_S_start + assert ival_T.asfreq("s", "E") == ival_T_to_S_end + + assert ival_T.asfreq("Min") == ival_T + + def test_conv_secondly(self): + # frequency conversion tests: from Secondly Frequency" + + ival_S = Period(freq="s", year=2007, month=1, day=1, hour=0, minute=0, second=0) + ival_S_end_of_year = Period( + freq="s", year=2007, month=12, day=31, hour=23, minute=59, second=59 + ) + ival_S_end_of_quarter = Period( + freq="s", year=2007, month=3, day=31, hour=23, minute=59, second=59 + ) + ival_S_end_of_month = Period( + freq="s", year=2007, month=1, day=31, hour=23, minute=59, second=59 + ) + ival_S_end_of_week = Period( + freq="s", year=2007, month=1, day=7, hour=23, minute=59, second=59 + ) + ival_S_end_of_day = Period( + freq="s", year=2007, month=1, day=1, hour=23, minute=59, second=59 + ) + ival_S_end_of_bus = Period( + freq="s", year=2007, month=1, day=1, hour=23, minute=59, second=59 + ) + ival_S_end_of_hour = Period( + freq="s", year=2007, month=1, day=1, hour=0, minute=59, second=59 + ) + ival_S_end_of_minute = Period( + freq="s", year=2007, month=1, day=1, hour=0, minute=0, second=59 + ) + + ival_S_to_A = Period(freq="Y", year=2007) + ival_S_to_Q = Period(freq="Q", year=2007, quarter=1) + ival_S_to_M = Period(freq="M", year=2007, month=1) + ival_S_to_W = Period(freq="W", year=2007, month=1, day=7) + ival_S_to_D = Period(freq="D", year=2007, month=1, day=1) + with tm.assert_produces_warning(FutureWarning, match=bday_msg): + ival_S_to_B = Period(freq="B", year=2007, month=1, day=1) + ival_S_to_H = Period(freq="h", year=2007, month=1, day=1, hour=0) + ival_S_to_T = Period(freq="Min", year=2007, month=1, day=1, hour=0, minute=0) + + assert ival_S.asfreq("Y") == ival_S_to_A + assert ival_S_end_of_year.asfreq("Y") == ival_S_to_A + assert ival_S.asfreq("Q") == ival_S_to_Q + assert ival_S_end_of_quarter.asfreq("Q") == ival_S_to_Q + assert ival_S.asfreq("M") == ival_S_to_M + assert ival_S_end_of_month.asfreq("M") == ival_S_to_M + assert ival_S.asfreq("W") == ival_S_to_W + assert ival_S_end_of_week.asfreq("W") == ival_S_to_W + assert ival_S.asfreq("D") == ival_S_to_D + assert ival_S_end_of_day.asfreq("D") == ival_S_to_D + with tm.assert_produces_warning(FutureWarning, match=bday_msg): + assert ival_S.asfreq("B") == ival_S_to_B + assert ival_S_end_of_bus.asfreq("B") == ival_S_to_B + assert ival_S.asfreq("h") == ival_S_to_H + assert ival_S_end_of_hour.asfreq("h") == ival_S_to_H + assert ival_S.asfreq("Min") == ival_S_to_T + assert ival_S_end_of_minute.asfreq("Min") == ival_S_to_T + + assert ival_S.asfreq("s") == ival_S + + def test_conv_microsecond(self): + # GH#31475 Avoid floating point errors dropping the start_time to + # before the beginning of the Period + per = Period("2020-01-30 15:57:27.576166", freq="us") + assert per.ordinal == 1580399847576166 + + start = per.start_time + expected = Timestamp("2020-01-30 15:57:27.576166") + assert start == expected + assert start._value == per.ordinal * 1000 + + per2 = Period("2300-01-01", "us") + msg = "2300-01-01" + with pytest.raises(OutOfBoundsDatetime, match=msg): + per2.start_time + with pytest.raises(OutOfBoundsDatetime, match=msg): + per2.end_time + + def test_asfreq_mult(self): + # normal freq to mult freq + p = Period(freq="Y", year=2007) + # ordinal will not change + for freq in ["3Y", offsets.YearEnd(3)]: + result = p.asfreq(freq) + expected = Period("2007", freq="3Y") + + assert result == expected + assert result.ordinal == expected.ordinal + assert result.freq == expected.freq + # ordinal will not change + for freq in ["3Y", offsets.YearEnd(3)]: + result = p.asfreq(freq, how="S") + expected = Period("2007", freq="3Y") + + assert result == expected + assert result.ordinal == expected.ordinal + assert result.freq == expected.freq + + # mult freq to normal freq + p = Period(freq="3Y", year=2007) + # ordinal will change because how=E is the default + for freq in ["Y", offsets.YearEnd()]: + result = p.asfreq(freq) + expected = Period("2009", freq="Y") + + assert result == expected + assert result.ordinal == expected.ordinal + assert result.freq == expected.freq + # ordinal will not change + for freq in ["Y", offsets.YearEnd()]: + result = p.asfreq(freq, how="s") + expected = Period("2007", freq="Y") + + assert result == expected + assert result.ordinal == expected.ordinal + assert result.freq == expected.freq + + p = Period(freq="Y", year=2007) + for freq in ["2M", offsets.MonthEnd(2)]: + result = p.asfreq(freq) + expected = Period("2007-12", freq="2M") + + assert result == expected + assert result.ordinal == expected.ordinal + assert result.freq == expected.freq + for freq in ["2M", offsets.MonthEnd(2)]: + result = p.asfreq(freq, how="s") + expected = Period("2007-01", freq="2M") + + assert result == expected + assert result.ordinal == expected.ordinal + assert result.freq == expected.freq + + p = Period(freq="3Y", year=2007) + for freq in ["2M", offsets.MonthEnd(2)]: + result = p.asfreq(freq) + expected = Period("2009-12", freq="2M") + + assert result == expected + assert result.ordinal == expected.ordinal + assert result.freq == expected.freq + for freq in ["2M", offsets.MonthEnd(2)]: + result = p.asfreq(freq, how="s") + expected = Period("2007-01", freq="2M") + + assert result == expected + assert result.ordinal == expected.ordinal + assert result.freq == expected.freq + + def test_asfreq_combined(self): + # normal freq to combined freq + p = Period("2007", freq="h") + + # ordinal will not change + expected = Period("2007", freq="25h") + for freq, how in zip(["1D1h", "1h1D"], ["E", "S"]): + result = p.asfreq(freq, how=how) + assert result == expected + assert result.ordinal == expected.ordinal + assert result.freq == expected.freq + + # combined freq to normal freq + p1 = Period(freq="1D1h", year=2007) + p2 = Period(freq="1h1D", year=2007) + + # ordinal will change because how=E is the default + result1 = p1.asfreq("h") + result2 = p2.asfreq("h") + expected = Period("2007-01-02", freq="h") + assert result1 == expected + assert result1.ordinal == expected.ordinal + assert result1.freq == expected.freq + assert result2 == expected + assert result2.ordinal == expected.ordinal + assert result2.freq == expected.freq + + # ordinal will not change + result1 = p1.asfreq("h", how="S") + result2 = p2.asfreq("h", how="S") + expected = Period("2007-01-01", freq="h") + assert result1 == expected + assert result1.ordinal == expected.ordinal + assert result1.freq == expected.freq + assert result2 == expected + assert result2.ordinal == expected.ordinal + assert result2.freq == expected.freq + + def test_asfreq_MS(self): + initial = Period("2013") + + assert initial.asfreq(freq="M", how="S") == Period("2013-01", "M") + + msg = "MS is not supported as period frequency" + with pytest.raises(ValueError, match=msg): + initial.asfreq(freq="MS", how="S") + + with pytest.raises(ValueError, match=msg): + Period("2013-01", "MS") diff --git a/shared/package-files/75/75ba535dc240ad6451fc7879253bb2d862487e08d5a3acd2db4a3999d544187e/test_trace.py b/shared/package-files/75/75ba535dc240ad6451fc7879253bb2d862487e08d5a3acd2db4a3999d544187e/test_trace.py new file mode 100644 index 0000000000000000000000000000000000000000..85db6c60ad9d2bd1fbfafcf5d84b97d2fe304250 --- /dev/null +++ b/shared/package-files/75/75ba535dc240ad6451fc7879253bb2d862487e08d5a3acd2db4a3999d544187e/test_trace.py @@ -0,0 +1,109 @@ +from sympy.core.containers import Tuple +from sympy.core.symbol import symbols +from sympy.matrices.dense import Matrix +from sympy.physics.quantum.trace import Tr +from sympy.testing.pytest import raises, warns_deprecated_sympy + + +def test_trace_new(): + a, b, c, d, Y = symbols('a b c d Y') + A, B, C, D = symbols('A B C D', commutative=False) + + assert Tr(a + b) == a + b + assert Tr(A + B) == Tr(A) + Tr(B) + + #check trace args not implicitly permuted + assert Tr(C*D*A*B).args[0].args == (C, D, A, B) + + # check for mul and adds + assert Tr((a*b) + ( c*d)) == (a*b) + (c*d) + # Tr(scalar*A) = scalar*Tr(A) + assert Tr(a*A) == a*Tr(A) + assert Tr(a*A*B*b) == a*b*Tr(A*B) + + # since A is symbol and not commutative + assert isinstance(Tr(A), Tr) + + #POW + assert Tr(pow(a, b)) == a**b + assert isinstance(Tr(pow(A, a)), Tr) + + #Matrix + M = Matrix([[1, 1], [2, 2]]) + assert Tr(M) == 3 + + ##test indices in different forms + #no index + t = Tr(A) + assert t.args[1] == Tuple() + + #single index + t = Tr(A, 0) + assert t.args[1] == Tuple(0) + + #index in a list + t = Tr(A, [0]) + assert t.args[1] == Tuple(0) + + t = Tr(A, [0, 1, 2]) + assert t.args[1] == Tuple(0, 1, 2) + + #index is tuple + t = Tr(A, (0)) + assert t.args[1] == Tuple(0) + + t = Tr(A, (1, 2)) + assert t.args[1] == Tuple(1, 2) + + #trace indices test + t = Tr((A + B), [2]) + assert t.args[0].args[1] == Tuple(2) and t.args[1].args[1] == Tuple(2) + + t = Tr(a*A, [2, 3]) + assert t.args[1].args[1] == Tuple(2, 3) + + #class with trace method defined + #to simulate numpy objects + class Foo: + def trace(self): + return 1 + assert Tr(Foo()) == 1 + + #argument test + # check for value error, when either/both arguments are not provided + raises(ValueError, lambda: Tr()) + raises(ValueError, lambda: Tr(A, 1, 2)) + + +def test_trace_doit(): + a, b, c, d = symbols('a b c d') + A, B, C, D = symbols('A B C D', commutative=False) + + #TODO: needed while testing reduced density operations, etc. + + +def test_permute(): + A, B, C, D, E, F, G = symbols('A B C D E F G', commutative=False) + t = Tr(A*B*C*D*E*F*G) + + assert t.permute(0).args[0].args == (A, B, C, D, E, F, G) + assert t.permute(2).args[0].args == (F, G, A, B, C, D, E) + assert t.permute(4).args[0].args == (D, E, F, G, A, B, C) + assert t.permute(6).args[0].args == (B, C, D, E, F, G, A) + assert t.permute(8).args[0].args == t.permute(1).args[0].args + + assert t.permute(-1).args[0].args == (B, C, D, E, F, G, A) + assert t.permute(-3).args[0].args == (D, E, F, G, A, B, C) + assert t.permute(-5).args[0].args == (F, G, A, B, C, D, E) + assert t.permute(-8).args[0].args == t.permute(-1).args[0].args + + t = Tr((A + B)*(B*B)*C*D) + assert t.permute(2).args[0].args == (C, D, (A + B), (B**2)) + + t1 = Tr(A*B) + t2 = t1.permute(1) + assert id(t1) != id(t2) and t1 == t2 + +def test_deprecated_core_trace(): + with warns_deprecated_sympy(): + from sympy.core.trace import Tr # noqa:F401 diff --git a/shared/package-files/75/75bdfdbbb57c7a50e0252997621308be79a535ceb1eb6ba01a462b7e7ffdf19d/uuid.py b/shared/package-files/75/75bdfdbbb57c7a50e0252997621308be79a535ceb1eb6ba01a462b7e7ffdf19d/uuid.py new file mode 100644 index 0000000000000000000000000000000000000000..fe9f87b79457fac74f7dee5643a01870dd3fd8e9 --- /dev/null +++ b/shared/package-files/75/75bdfdbbb57c7a50e0252997621308be79a535ceb1eb6ba01a462b7e7ffdf19d/uuid.py @@ -0,0 +1,733 @@ +r"""UUID objects (universally unique identifiers) according to RFC 4122. + +This module provides immutable UUID objects (class UUID) and the functions +uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5 +UUIDs as specified in RFC 4122. + +If all you want is a unique ID, you should probably call uuid1() or uuid4(). +Note that uuid1() may compromise privacy since it creates a UUID containing +the computer's network address. uuid4() creates a random UUID. + +Typical usage: + + >>> import uuid + + # make a UUID based on the host ID and current time + >>> uuid.uuid1() # doctest: +SKIP + UUID('a8098c1a-f86e-11da-bd1a-00112444be1e') + + # make a UUID using an MD5 hash of a namespace UUID and a name + >>> uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org') + UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e') + + # make a random UUID + >>> uuid.uuid4() # doctest: +SKIP + UUID('16fd2706-8baf-433b-82eb-8c7fada847da') + + # make a UUID using a SHA-1 hash of a namespace UUID and a name + >>> uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org') + UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d') + + # make a UUID from a string of hex digits (braces and hyphens ignored) + >>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}') + + # convert a UUID to a string of hex digits in standard form + >>> str(x) + '00010203-0405-0607-0809-0a0b0c0d0e0f' + + # get the raw 16 bytes of the UUID + >>> x.bytes + b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f' + + # make a UUID from a 16-byte string + >>> uuid.UUID(bytes=x.bytes) + UUID('00010203-0405-0607-0809-0a0b0c0d0e0f') +""" + +import os +import sys + +from enum import Enum + + +__author__ = 'Ka-Ping Yee ' + +# The recognized platforms - known behaviors +if sys.platform in ('win32', 'darwin'): + _AIX = _LINUX = False +else: + import platform + _platform_system = platform.system() + _AIX = _platform_system == 'AIX' + _LINUX = _platform_system == 'Linux' + +_MAC_DELIM = b':' +_MAC_OMITS_LEADING_ZEROES = False +if _AIX: + _MAC_DELIM = b'.' + _MAC_OMITS_LEADING_ZEROES = True + +RESERVED_NCS, RFC_4122, RESERVED_MICROSOFT, RESERVED_FUTURE = [ + 'reserved for NCS compatibility', 'specified in RFC 4122', + 'reserved for Microsoft compatibility', 'reserved for future definition'] + +int_ = int # The built-in int type +bytes_ = bytes # The built-in bytes type + + +class SafeUUID(Enum): + safe = 0 + unsafe = -1 + unknown = None + + +class UUID: + """Instances of the UUID class represent UUIDs as specified in RFC 4122. + UUID objects are immutable, hashable, and usable as dictionary keys. + Converting a UUID to a string with str() yields something in the form + '12345678-1234-1234-1234-123456789abc'. The UUID constructor accepts + five possible forms: a similar string of hexadecimal digits, or a tuple + of six integer fields (with 32-bit, 16-bit, 16-bit, 8-bit, 8-bit, and + 48-bit values respectively) as an argument named 'fields', or a string + of 16 bytes (with all the integer fields in big-endian order) as an + argument named 'bytes', or a string of 16 bytes (with the first three + fields in little-endian order) as an argument named 'bytes_le', or a + single 128-bit integer as an argument named 'int'. + + UUIDs have these read-only attributes: + + bytes the UUID as a 16-byte string (containing the six + integer fields in big-endian byte order) + + bytes_le the UUID as a 16-byte string (with time_low, time_mid, + and time_hi_version in little-endian byte order) + + fields a tuple of the six integer fields of the UUID, + which are also available as six individual attributes + and two derived attributes: + + time_low the first 32 bits of the UUID + time_mid the next 16 bits of the UUID + time_hi_version the next 16 bits of the UUID + clock_seq_hi_variant the next 8 bits of the UUID + clock_seq_low the next 8 bits of the UUID + node the last 48 bits of the UUID + + time the 60-bit timestamp + clock_seq the 14-bit sequence number + + hex the UUID as a 32-character hexadecimal string + + int the UUID as a 128-bit integer + + urn the UUID as a URN as specified in RFC 4122 + + variant the UUID variant (one of the constants RESERVED_NCS, + RFC_4122, RESERVED_MICROSOFT, or RESERVED_FUTURE) + + version the UUID version number (1 through 5, meaningful only + when the variant is RFC_4122) + + is_safe An enum indicating whether the UUID has been generated in + a way that is safe for multiprocessing applications, via + uuid_generate_time_safe(3). + """ + + __slots__ = ('int', 'is_safe', '__weakref__') + + def __init__(self, hex=None, bytes=None, bytes_le=None, fields=None, + int=None, version=None, + *, is_safe=SafeUUID.unknown): + r"""Create a UUID from either a string of 32 hexadecimal digits, + a string of 16 bytes as the 'bytes' argument, a string of 16 bytes + in little-endian order as the 'bytes_le' argument, a tuple of six + integers (32-bit time_low, 16-bit time_mid, 16-bit time_hi_version, + 8-bit clock_seq_hi_variant, 8-bit clock_seq_low, 48-bit node) as + the 'fields' argument, or a single 128-bit integer as the 'int' + argument. When a string of hex digits is given, curly braces, + hyphens, and a URN prefix are all optional. For example, these + expressions all yield the same UUID: + + UUID('{12345678-1234-5678-1234-567812345678}') + UUID('12345678123456781234567812345678') + UUID('urn:uuid:12345678-1234-5678-1234-567812345678') + UUID(bytes='\x12\x34\x56\x78'*4) + UUID(bytes_le='\x78\x56\x34\x12\x34\x12\x78\x56' + + '\x12\x34\x56\x78\x12\x34\x56\x78') + UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678)) + UUID(int=0x12345678123456781234567812345678) + + Exactly one of 'hex', 'bytes', 'bytes_le', 'fields', or 'int' must + be given. The 'version' argument is optional; if given, the resulting + UUID will have its variant and version set according to RFC 4122, + overriding the given 'hex', 'bytes', 'bytes_le', 'fields', or 'int'. + + is_safe is an enum exposed as an attribute on the instance. It + indicates whether the UUID has been generated in a way that is safe + for multiprocessing applications, via uuid_generate_time_safe(3). + """ + + if [hex, bytes, bytes_le, fields, int].count(None) != 4: + raise TypeError('one of the hex, bytes, bytes_le, fields, ' + 'or int arguments must be given') + if hex is not None: + hex = hex.replace('urn:', '').replace('uuid:', '') + hex = hex.strip('{}').replace('-', '') + if len(hex) != 32: + raise ValueError('badly formed hexadecimal UUID string') + int = int_(hex, 16) + if bytes_le is not None: + if len(bytes_le) != 16: + raise ValueError('bytes_le is not a 16-char string') + bytes = (bytes_le[4-1::-1] + bytes_le[6-1:4-1:-1] + + bytes_le[8-1:6-1:-1] + bytes_le[8:]) + if bytes is not None: + if len(bytes) != 16: + raise ValueError('bytes is not a 16-char string') + assert isinstance(bytes, bytes_), repr(bytes) + int = int_.from_bytes(bytes, byteorder='big') + if fields is not None: + if len(fields) != 6: + raise ValueError('fields is not a 6-tuple') + (time_low, time_mid, time_hi_version, + clock_seq_hi_variant, clock_seq_low, node) = fields + if not 0 <= time_low < 1<<32: + raise ValueError('field 1 out of range (need a 32-bit value)') + if not 0 <= time_mid < 1<<16: + raise ValueError('field 2 out of range (need a 16-bit value)') + if not 0 <= time_hi_version < 1<<16: + raise ValueError('field 3 out of range (need a 16-bit value)') + if not 0 <= clock_seq_hi_variant < 1<<8: + raise ValueError('field 4 out of range (need an 8-bit value)') + if not 0 <= clock_seq_low < 1<<8: + raise ValueError('field 5 out of range (need an 8-bit value)') + if not 0 <= node < 1<<48: + raise ValueError('field 6 out of range (need a 48-bit value)') + clock_seq = (clock_seq_hi_variant << 8) | clock_seq_low + int = ((time_low << 96) | (time_mid << 80) | + (time_hi_version << 64) | (clock_seq << 48) | node) + if int is not None: + if not 0 <= int < 1<<128: + raise ValueError('int is out of range (need a 128-bit value)') + if version is not None: + if not 1 <= version <= 5: + raise ValueError('illegal version number') + # Set the variant to RFC 4122. + int &= ~(0xc000 << 48) + int |= 0x8000 << 48 + # Set the version number. + int &= ~(0xf000 << 64) + int |= version << 76 + object.__setattr__(self, 'int', int) + object.__setattr__(self, 'is_safe', is_safe) + + def __getstate__(self): + d = {'int': self.int} + if self.is_safe != SafeUUID.unknown: + # is_safe is a SafeUUID instance. Return just its value, so that + # it can be un-pickled in older Python versions without SafeUUID. + d['is_safe'] = self.is_safe.value + return d + + def __setstate__(self, state): + object.__setattr__(self, 'int', state['int']) + # is_safe was added in 3.7; it is also omitted when it is "unknown" + object.__setattr__(self, 'is_safe', + SafeUUID(state['is_safe']) + if 'is_safe' in state else SafeUUID.unknown) + + def __eq__(self, other): + if isinstance(other, UUID): + return self.int == other.int + return NotImplemented + + # Q. What's the value of being able to sort UUIDs? + # A. Use them as keys in a B-Tree or similar mapping. + + def __lt__(self, other): + if isinstance(other, UUID): + return self.int < other.int + return NotImplemented + + def __gt__(self, other): + if isinstance(other, UUID): + return self.int > other.int + return NotImplemented + + def __le__(self, other): + if isinstance(other, UUID): + return self.int <= other.int + return NotImplemented + + def __ge__(self, other): + if isinstance(other, UUID): + return self.int >= other.int + return NotImplemented + + def __hash__(self): + return hash(self.int) + + def __int__(self): + return self.int + + def __repr__(self): + return '%s(%r)' % (self.__class__.__name__, str(self)) + + def __setattr__(self, name, value): + raise TypeError('UUID objects are immutable') + + def __str__(self): + hex = '%032x' % self.int + return '%s-%s-%s-%s-%s' % ( + hex[:8], hex[8:12], hex[12:16], hex[16:20], hex[20:]) + + @property + def bytes(self): + return self.int.to_bytes(16, 'big') + + @property + def bytes_le(self): + bytes = self.bytes + return (bytes[4-1::-1] + bytes[6-1:4-1:-1] + bytes[8-1:6-1:-1] + + bytes[8:]) + + @property + def fields(self): + return (self.time_low, self.time_mid, self.time_hi_version, + self.clock_seq_hi_variant, self.clock_seq_low, self.node) + + @property + def time_low(self): + return self.int >> 96 + + @property + def time_mid(self): + return (self.int >> 80) & 0xffff + + @property + def time_hi_version(self): + return (self.int >> 64) & 0xffff + + @property + def clock_seq_hi_variant(self): + return (self.int >> 56) & 0xff + + @property + def clock_seq_low(self): + return (self.int >> 48) & 0xff + + @property + def time(self): + return (((self.time_hi_version & 0x0fff) << 48) | + (self.time_mid << 32) | self.time_low) + + @property + def clock_seq(self): + return (((self.clock_seq_hi_variant & 0x3f) << 8) | + self.clock_seq_low) + + @property + def node(self): + return self.int & 0xffffffffffff + + @property + def hex(self): + return '%032x' % self.int + + @property + def urn(self): + return 'urn:uuid:' + str(self) + + @property + def variant(self): + if not self.int & (0x8000 << 48): + return RESERVED_NCS + elif not self.int & (0x4000 << 48): + return RFC_4122 + elif not self.int & (0x2000 << 48): + return RESERVED_MICROSOFT + else: + return RESERVED_FUTURE + + @property + def version(self): + # The version bits are only meaningful for RFC 4122 UUIDs. + if self.variant == RFC_4122: + return int((self.int >> 76) & 0xf) + + +def _get_command_stdout(command, *args): + import io, os, shutil, subprocess + + try: + path_dirs = os.environ.get('PATH', os.defpath).split(os.pathsep) + path_dirs.extend(['/sbin', '/usr/sbin']) + executable = shutil.which(command, path=os.pathsep.join(path_dirs)) + if executable is None: + return None + # LC_ALL=C to ensure English output, stderr=DEVNULL to prevent output + # on stderr (Note: we don't have an example where the words we search + # for are actually localized, but in theory some system could do so.) + env = dict(os.environ) + env['LC_ALL'] = 'C' + # Empty strings will be quoted by popen so we should just ommit it + if args != ('',): + command = (executable, *args) + else: + command = (executable,) + proc = subprocess.Popen(command, + stdout=subprocess.PIPE, + stderr=subprocess.DEVNULL, + env=env) + if not proc: + return None + stdout, stderr = proc.communicate() + return io.BytesIO(stdout) + except (OSError, subprocess.SubprocessError): + return None + + +# For MAC (a.k.a. IEEE 802, or EUI-48) addresses, the second least significant +# bit of the first octet signifies whether the MAC address is universally (0) +# or locally (1) administered. Network cards from hardware manufacturers will +# always be universally administered to guarantee global uniqueness of the MAC +# address, but any particular machine may have other interfaces which are +# locally administered. An example of the latter is the bridge interface to +# the Touch Bar on MacBook Pros. +# +# This bit works out to be the 42nd bit counting from 1 being the least +# significant, or 1<<41. We'll prefer universally administered MAC addresses +# over locally administered ones since the former are globally unique, but +# we'll return the first of the latter found if that's all the machine has. +# +# See https://en.wikipedia.org/wiki/MAC_address#Universal_vs._local + +def _is_universal(mac): + return not (mac & (1 << 41)) + + +def _find_mac_near_keyword(command, args, keywords, get_word_index): + """Searches a command's output for a MAC address near a keyword. + + Each line of words in the output is case-insensitively searched for + any of the given keywords. Upon a match, get_word_index is invoked + to pick a word from the line, given the index of the match. For + example, lambda i: 0 would get the first word on the line, while + lambda i: i - 1 would get the word preceding the keyword. + """ + stdout = _get_command_stdout(command, args) + if stdout is None: + return None + + first_local_mac = None + for line in stdout: + words = line.lower().rstrip().split() + for i in range(len(words)): + if words[i] in keywords: + try: + word = words[get_word_index(i)] + mac = int(word.replace(_MAC_DELIM, b''), 16) + except (ValueError, IndexError): + # Virtual interfaces, such as those provided by + # VPNs, do not have a colon-delimited MAC address + # as expected, but a 16-byte HWAddr separated by + # dashes. These should be ignored in favor of a + # real MAC address + pass + else: + if _is_universal(mac): + return mac + first_local_mac = first_local_mac or mac + return first_local_mac or None + + +def _parse_mac(word): + # Accept 'HH:HH:HH:HH:HH:HH' MAC address (ex: '52:54:00:9d:0e:67'), + # but reject IPv6 address (ex: 'fe80::5054:ff:fe9' or '123:2:3:4:5:6:7:8'). + # + # Virtual interfaces, such as those provided by VPNs, do not have a + # colon-delimited MAC address as expected, but a 16-byte HWAddr separated + # by dashes. These should be ignored in favor of a real MAC address + parts = word.split(_MAC_DELIM) + if len(parts) != 6: + return + if _MAC_OMITS_LEADING_ZEROES: + # (Only) on AIX the macaddr value given is not prefixed by 0, e.g. + # en0 1500 link#2 fa.bc.de.f7.62.4 110854824 0 160133733 0 0 + # not + # en0 1500 link#2 fa.bc.de.f7.62.04 110854824 0 160133733 0 0 + if not all(1 <= len(part) <= 2 for part in parts): + return + hexstr = b''.join(part.rjust(2, b'0') for part in parts) + else: + if not all(len(part) == 2 for part in parts): + return + hexstr = b''.join(parts) + try: + return int(hexstr, 16) + except ValueError: + return + + +def _find_mac_under_heading(command, args, heading): + """Looks for a MAC address under a heading in a command's output. + + The first line of words in the output is searched for the given + heading. Words at the same word index as the heading in subsequent + lines are then examined to see if they look like MAC addresses. + """ + stdout = _get_command_stdout(command, args) + if stdout is None: + return None + + keywords = stdout.readline().rstrip().split() + try: + column_index = keywords.index(heading) + except ValueError: + return None + + first_local_mac = None + for line in stdout: + words = line.rstrip().split() + try: + word = words[column_index] + except IndexError: + continue + + mac = _parse_mac(word) + if mac is None: + continue + if _is_universal(mac): + return mac + if first_local_mac is None: + first_local_mac = mac + + return first_local_mac + + +# The following functions call external programs to 'get' a macaddr value to +# be used as basis for an uuid +def _ifconfig_getnode(): + """Get the hardware address on Unix by running ifconfig.""" + # This works on Linux ('' or '-a'), Tru64 ('-av'), but not all Unixes. + keywords = (b'hwaddr', b'ether', b'address:', b'lladdr') + for args in ('', '-a', '-av'): + mac = _find_mac_near_keyword('ifconfig', args, keywords, lambda i: i+1) + if mac: + return mac + return None + +def _ip_getnode(): + """Get the hardware address on Unix by running ip.""" + # This works on Linux with iproute2. + mac = _find_mac_near_keyword('ip', 'link', [b'link/ether'], lambda i: i+1) + if mac: + return mac + return None + +def _arp_getnode(): + """Get the hardware address on Unix by running arp.""" + import os, socket + try: + ip_addr = socket.gethostbyname(socket.gethostname()) + except OSError: + return None + + # Try getting the MAC addr from arp based on our IP address (Solaris). + mac = _find_mac_near_keyword('arp', '-an', [os.fsencode(ip_addr)], lambda i: -1) + if mac: + return mac + + # This works on OpenBSD + mac = _find_mac_near_keyword('arp', '-an', [os.fsencode(ip_addr)], lambda i: i+1) + if mac: + return mac + + # This works on Linux, FreeBSD and NetBSD + mac = _find_mac_near_keyword('arp', '-an', [os.fsencode('(%s)' % ip_addr)], + lambda i: i+2) + # Return None instead of 0. + if mac: + return mac + return None + +def _lanscan_getnode(): + """Get the hardware address on Unix by running lanscan.""" + # This might work on HP-UX. + return _find_mac_near_keyword('lanscan', '-ai', [b'lan0'], lambda i: 0) + +def _netstat_getnode(): + """Get the hardware address on Unix by running netstat.""" + # This works on AIX and might work on Tru64 UNIX. + return _find_mac_under_heading('netstat', '-ian', b'Address') + +def _ipconfig_getnode(): + """[DEPRECATED] Get the hardware address on Windows.""" + # bpo-40501: UuidCreateSequential() is now the only supported approach + return _windll_getnode() + +def _netbios_getnode(): + """[DEPRECATED] Get the hardware address on Windows.""" + # bpo-40501: UuidCreateSequential() is now the only supported approach + return _windll_getnode() + + +# Import optional C extension at toplevel, to help disabling it when testing +try: + import _uuid + _generate_time_safe = getattr(_uuid, "generate_time_safe", None) + _UuidCreate = getattr(_uuid, "UuidCreate", None) + _has_uuid_generate_time_safe = _uuid.has_uuid_generate_time_safe +except ImportError: + _uuid = None + _generate_time_safe = None + _UuidCreate = None + _has_uuid_generate_time_safe = None + + +def _load_system_functions(): + """[DEPRECATED] Platform-specific functions loaded at import time""" + + +def _unix_getnode(): + """Get the hardware address on Unix using the _uuid extension module.""" + if _generate_time_safe: + uuid_time, _ = _generate_time_safe() + return UUID(bytes=uuid_time).node + +def _windll_getnode(): + """Get the hardware address on Windows using the _uuid extension module.""" + if _UuidCreate: + uuid_bytes = _UuidCreate() + return UUID(bytes_le=uuid_bytes).node + +def _random_getnode(): + """Get a random node ID.""" + # RFC 4122, $4.1.6 says "For systems with no IEEE address, a randomly or + # pseudo-randomly generated value may be used; see Section 4.5. The + # multicast bit must be set in such addresses, in order that they will + # never conflict with addresses obtained from network cards." + # + # The "multicast bit" of a MAC address is defined to be "the least + # significant bit of the first octet". This works out to be the 41st bit + # counting from 1 being the least significant bit, or 1<<40. + # + # See https://en.wikipedia.org/wiki/MAC_address#Unicast_vs._multicast + import random + return random.getrandbits(48) | (1 << 40) + + +# _OS_GETTERS, when known, are targeted for a specific OS or platform. +# The order is by 'common practice' on the specified platform. +# Note: 'posix' and 'windows' _OS_GETTERS are prefixed by a dll/dlload() method +# which, when successful, means none of these "external" methods are called. +# _GETTERS is (also) used by test_uuid.py to SkipUnless(), e.g., +# @unittest.skipUnless(_uuid._ifconfig_getnode in _uuid._GETTERS, ...) +if _LINUX: + _OS_GETTERS = [_ip_getnode, _ifconfig_getnode] +elif sys.platform == 'darwin': + _OS_GETTERS = [_ifconfig_getnode, _arp_getnode, _netstat_getnode] +elif sys.platform == 'win32': + # bpo-40201: _windll_getnode will always succeed, so these are not needed + _OS_GETTERS = [] +elif _AIX: + _OS_GETTERS = [_netstat_getnode] +else: + _OS_GETTERS = [_ifconfig_getnode, _ip_getnode, _arp_getnode, + _netstat_getnode, _lanscan_getnode] +if os.name == 'posix': + _GETTERS = [_unix_getnode] + _OS_GETTERS +elif os.name == 'nt': + _GETTERS = [_windll_getnode] + _OS_GETTERS +else: + _GETTERS = _OS_GETTERS + +_node = None + +def getnode(): + """Get the hardware address as a 48-bit positive integer. + + The first time this runs, it may launch a separate program, which could + be quite slow. If all attempts to obtain the hardware address fail, we + choose a random 48-bit number with its eighth bit set to 1 as recommended + in RFC 4122. + """ + global _node + if _node is not None: + return _node + + for getter in _GETTERS + [_random_getnode]: + try: + _node = getter() + except: + continue + if (_node is not None) and (0 <= _node < (1 << 48)): + return _node + assert False, '_random_getnode() returned invalid value: {}'.format(_node) + + +_last_timestamp = None + +def uuid1(node=None, clock_seq=None): + """Generate a UUID from a host ID, sequence number, and the current time. + If 'node' is not given, getnode() is used to obtain the hardware + address. If 'clock_seq' is given, it is used as the sequence number; + otherwise a random 14-bit sequence number is chosen.""" + + # When the system provides a version-1 UUID generator, use it (but don't + # use UuidCreate here because its UUIDs don't conform to RFC 4122). + if _generate_time_safe is not None and node is clock_seq is None: + uuid_time, safely_generated = _generate_time_safe() + try: + is_safe = SafeUUID(safely_generated) + except ValueError: + is_safe = SafeUUID.unknown + return UUID(bytes=uuid_time, is_safe=is_safe) + + global _last_timestamp + import time + nanoseconds = time.time_ns() + # 0x01b21dd213814000 is the number of 100-ns intervals between the + # UUID epoch 1582-10-15 00:00:00 and the Unix epoch 1970-01-01 00:00:00. + timestamp = nanoseconds // 100 + 0x01b21dd213814000 + if _last_timestamp is not None and timestamp <= _last_timestamp: + timestamp = _last_timestamp + 1 + _last_timestamp = timestamp + if clock_seq is None: + import random + clock_seq = random.getrandbits(14) # instead of stable storage + time_low = timestamp & 0xffffffff + time_mid = (timestamp >> 32) & 0xffff + time_hi_version = (timestamp >> 48) & 0x0fff + clock_seq_low = clock_seq & 0xff + clock_seq_hi_variant = (clock_seq >> 8) & 0x3f + if node is None: + node = getnode() + return UUID(fields=(time_low, time_mid, time_hi_version, + clock_seq_hi_variant, clock_seq_low, node), version=1) + +def uuid3(namespace, name): + """Generate a UUID from the MD5 hash of a namespace UUID and a name.""" + from hashlib import md5 + digest = md5( + namespace.bytes + bytes(name, "utf-8"), + usedforsecurity=False + ).digest() + return UUID(bytes=digest[:16], version=3) + +def uuid4(): + """Generate a random UUID.""" + return UUID(bytes=os.urandom(16), version=4) + +def uuid5(namespace, name): + """Generate a UUID from the SHA-1 hash of a namespace UUID and a name.""" + from hashlib import sha1 + hash = sha1(namespace.bytes + bytes(name, "utf-8")).digest() + return UUID(bytes=hash[:16], version=5) + +# The following standard UUIDs are for use with uuid3() or uuid5(). + +NAMESPACE_DNS = UUID('6ba7b810-9dad-11d1-80b4-00c04fd430c8') +NAMESPACE_URL = UUID('6ba7b811-9dad-11d1-80b4-00c04fd430c8') +NAMESPACE_OID = UUID('6ba7b812-9dad-11d1-80b4-00c04fd430c8') +NAMESPACE_X500 = UUID('6ba7b814-9dad-11d1-80b4-00c04fd430c8') diff --git a/shared/package-files/75/75c0f7cc6b1e8e8c67228db88fb665b909442f095818def1b7e9610aed6c15fd/dispatcher.py b/shared/package-files/75/75c0f7cc6b1e8e8c67228db88fb665b909442f095818def1b7e9610aed6c15fd/dispatcher.py new file mode 100644 index 0000000000000000000000000000000000000000..58816959f7cd2276274d71436c46d2c36315c631 --- /dev/null +++ b/shared/package-files/75/75c0f7cc6b1e8e8c67228db88fb665b909442f095818def1b7e9610aed6c15fd/dispatcher.py @@ -0,0 +1,118 @@ +import itertools +from typing import List, Sequence, Union + +from torchgen.api import cpp + +from torchgen.api.types import ArgName, Binding, CType, NamedCType +from torchgen.model import ( + Argument, + FunctionSchema, + Return, + SelfArgument, + TensorOptionsArguments, + Type, +) +from torchgen.utils import assert_never, concatMap + +# This file describes the translation of JIT schema to the dispatcher +# API, the *unboxed* calling convention by which invocations through +# the dispatcher are made. Historically, the dispatcher API matched +# the C++ API, but with the establishment of the boxed API, we've +# made changes to the dispatcher API to so that the unboxed API +# better aligns with the boxed API. The dispatcher API hooks heavily +# into our template based boxing/unboxing machinery, so changes +# to this convention will usually need template updates too. +# +# Prominent characteristics of the dispatcher API: +# +# - dtype, layout, device and pin_memory are represented as separate +# arguments. +# + + +def name(func: FunctionSchema) -> str: + return cpp.name(func) + + +def argumenttype_type( + t: Type, + *, + mutable: bool, + binds: ArgName, + remove_non_owning_ref_types: bool = False, + symint: bool = True, +) -> NamedCType: + # This is a faux amis. If it makes sense in the future to add + # more special cases here, or invert things so cpp.argument_type + # calls this, or just completely inline the function, please do + # it. + return cpp.argumenttype_type( + t, + mutable=mutable, + binds=binds, + symint=symint, + remove_non_owning_ref_types=remove_non_owning_ref_types, + ) + + +def argument_type( + a: Argument, + *, + binds: ArgName, + remove_non_owning_ref_types: bool = False, + symint: bool = True, +) -> NamedCType: + return argumenttype_type( + a.type, + mutable=a.is_write, + binds=binds, + remove_non_owning_ref_types=remove_non_owning_ref_types, + symint=symint, + ) + + +def returns_type(rs: Sequence[Return], *, symint: bool = True) -> CType: + # At present, there is no difference. But there could be! + return cpp.returns_type(rs, symint=symint) + + +def jit_arguments(func: FunctionSchema) -> List[Argument]: + def to_argument( + a: Union[Argument, TensorOptionsArguments, SelfArgument] + ) -> List[Argument]: + if isinstance(a, Argument): + return [a] + elif isinstance(a, SelfArgument): + return [a.argument] + elif isinstance(a, TensorOptionsArguments): + return [a.dtype, a.layout, a.device, a.pin_memory] + else: + assert_never(a) + + return list( + concatMap( + to_argument, + itertools.chain( + func.arguments.positional, func.arguments.kwarg_only, func.arguments.out + ), + ) + ) + + +def argument( + a: Argument, *, remove_non_owning_ref_types: bool = False, symint: bool = True +) -> Binding: + return Binding( + nctype=argument_type( + a, + binds=a.name, + remove_non_owning_ref_types=remove_non_owning_ref_types, + symint=symint, + ), + name=a.name, + argument=a, + ) + + +def arguments(func: FunctionSchema, *, symint: bool = True) -> List[Binding]: + return [argument(a, symint=symint) for a in jit_arguments(func)] diff --git a/shared/package-files/75/75c3e50711eaa4a27a253049b24bf0d821372187daf97b74db48df4ac9702e3b/test_round.py b/shared/package-files/75/75c3e50711eaa4a27a253049b24bf0d821372187daf97b74db48df4ac9702e3b/test_round.py new file mode 100644 index 0000000000000000000000000000000000000000..a96df27b48d7d8dc0b2f26cc25f0dca16ea3b462 --- /dev/null +++ b/shared/package-files/75/75c3e50711eaa4a27a253049b24bf0d821372187daf97b74db48df4ac9702e3b/test_round.py @@ -0,0 +1,225 @@ +import numpy as np +import pytest + +import pandas as pd +from pandas import ( + DataFrame, + Series, + date_range, +) +import pandas._testing as tm + + +class TestDataFrameRound: + def test_round(self): + # GH#2665 + + # Test that rounding an empty DataFrame does nothing + df = DataFrame() + tm.assert_frame_equal(df, df.round()) + + # Here's the test frame we'll be working with + df = DataFrame({"col1": [1.123, 2.123, 3.123], "col2": [1.234, 2.234, 3.234]}) + + # Default round to integer (i.e. decimals=0) + expected_rounded = DataFrame({"col1": [1.0, 2.0, 3.0], "col2": [1.0, 2.0, 3.0]}) + tm.assert_frame_equal(df.round(), expected_rounded) + + # Round with an integer + decimals = 2 + expected_rounded = DataFrame( + {"col1": [1.12, 2.12, 3.12], "col2": [1.23, 2.23, 3.23]} + ) + tm.assert_frame_equal(df.round(decimals), expected_rounded) + + # This should also work with np.round (since np.round dispatches to + # df.round) + tm.assert_frame_equal(np.round(df, decimals), expected_rounded) + + # Round with a list + round_list = [1, 2] + msg = "decimals must be an integer, a dict-like or a Series" + with pytest.raises(TypeError, match=msg): + df.round(round_list) + + # Round with a dictionary + expected_rounded = DataFrame( + {"col1": [1.1, 2.1, 3.1], "col2": [1.23, 2.23, 3.23]} + ) + round_dict = {"col1": 1, "col2": 2} + tm.assert_frame_equal(df.round(round_dict), expected_rounded) + + # Incomplete dict + expected_partially_rounded = DataFrame( + {"col1": [1.123, 2.123, 3.123], "col2": [1.2, 2.2, 3.2]} + ) + partial_round_dict = {"col2": 1} + tm.assert_frame_equal(df.round(partial_round_dict), expected_partially_rounded) + + # Dict with unknown elements + wrong_round_dict = {"col3": 2, "col2": 1} + tm.assert_frame_equal(df.round(wrong_round_dict), expected_partially_rounded) + + # float input to `decimals` + non_int_round_dict = {"col1": 1, "col2": 0.5} + msg = "Values in decimals must be integers" + with pytest.raises(TypeError, match=msg): + df.round(non_int_round_dict) + + # String input + non_int_round_dict = {"col1": 1, "col2": "foo"} + with pytest.raises(TypeError, match=msg): + df.round(non_int_round_dict) + + non_int_round_Series = Series(non_int_round_dict) + with pytest.raises(TypeError, match=msg): + df.round(non_int_round_Series) + + # List input + non_int_round_dict = {"col1": 1, "col2": [1, 2]} + with pytest.raises(TypeError, match=msg): + df.round(non_int_round_dict) + + non_int_round_Series = Series(non_int_round_dict) + with pytest.raises(TypeError, match=msg): + df.round(non_int_round_Series) + + # Non integer Series inputs + non_int_round_Series = Series(non_int_round_dict) + with pytest.raises(TypeError, match=msg): + df.round(non_int_round_Series) + + non_int_round_Series = Series(non_int_round_dict) + with pytest.raises(TypeError, match=msg): + df.round(non_int_round_Series) + + # Negative numbers + negative_round_dict = {"col1": -1, "col2": -2} + big_df = df * 100 + expected_neg_rounded = DataFrame( + {"col1": [110.0, 210, 310], "col2": [100.0, 200, 300]} + ) + tm.assert_frame_equal(big_df.round(negative_round_dict), expected_neg_rounded) + + # nan in Series round + nan_round_Series = Series({"col1": np.nan, "col2": 1}) + + with pytest.raises(TypeError, match=msg): + df.round(nan_round_Series) + + # Make sure this doesn't break existing Series.round + tm.assert_series_equal(df["col1"].round(1), expected_rounded["col1"]) + + # named columns + # GH#11986 + decimals = 2 + expected_rounded = DataFrame( + {"col1": [1.12, 2.12, 3.12], "col2": [1.23, 2.23, 3.23]} + ) + df.columns.name = "cols" + expected_rounded.columns.name = "cols" + tm.assert_frame_equal(df.round(decimals), expected_rounded) + + # interaction of named columns & series + tm.assert_series_equal(df["col1"].round(decimals), expected_rounded["col1"]) + tm.assert_series_equal(df.round(decimals)["col1"], expected_rounded["col1"]) + + def test_round_numpy(self): + # GH#12600 + df = DataFrame([[1.53, 1.36], [0.06, 7.01]]) + out = np.round(df, decimals=0) + expected = DataFrame([[2.0, 1.0], [0.0, 7.0]]) + tm.assert_frame_equal(out, expected) + + msg = "the 'out' parameter is not supported" + with pytest.raises(ValueError, match=msg): + np.round(df, decimals=0, out=df) + + def test_round_numpy_with_nan(self): + # See GH#14197 + df = Series([1.53, np.nan, 0.06]).to_frame() + with tm.assert_produces_warning(None): + result = df.round() + expected = Series([2.0, np.nan, 0.0]).to_frame() + tm.assert_frame_equal(result, expected) + + def test_round_mixed_type(self): + # GH#11885 + df = DataFrame( + { + "col1": [1.1, 2.2, 3.3, 4.4], + "col2": ["1", "a", "c", "f"], + "col3": date_range("20111111", periods=4), + } + ) + round_0 = DataFrame( + { + "col1": [1.0, 2.0, 3.0, 4.0], + "col2": ["1", "a", "c", "f"], + "col3": date_range("20111111", periods=4), + } + ) + tm.assert_frame_equal(df.round(), round_0) + tm.assert_frame_equal(df.round(1), df) + tm.assert_frame_equal(df.round({"col1": 1}), df) + tm.assert_frame_equal(df.round({"col1": 0}), round_0) + tm.assert_frame_equal(df.round({"col1": 0, "col2": 1}), round_0) + tm.assert_frame_equal(df.round({"col3": 1}), df) + + def test_round_with_duplicate_columns(self): + # GH#11611 + + df = DataFrame( + np.random.default_rng(2).random([3, 3]), + columns=["A", "B", "C"], + index=["first", "second", "third"], + ) + + dfs = pd.concat((df, df), axis=1) + rounded = dfs.round() + tm.assert_index_equal(rounded.index, dfs.index) + + decimals = Series([1, 0, 2], index=["A", "B", "A"]) + msg = "Index of decimals must be unique" + with pytest.raises(ValueError, match=msg): + df.round(decimals) + + def test_round_builtin(self): + # GH#11763 + # Here's the test frame we'll be working with + df = DataFrame({"col1": [1.123, 2.123, 3.123], "col2": [1.234, 2.234, 3.234]}) + + # Default round to integer (i.e. decimals=0) + expected_rounded = DataFrame({"col1": [1.0, 2.0, 3.0], "col2": [1.0, 2.0, 3.0]}) + tm.assert_frame_equal(round(df), expected_rounded) + + def test_round_nonunique_categorical(self): + # See GH#21809 + idx = pd.CategoricalIndex(["low"] * 3 + ["hi"] * 3) + df = DataFrame(np.random.default_rng(2).random((6, 3)), columns=list("abc")) + + expected = df.round(3) + expected.index = idx + + df_categorical = df.copy().set_index(idx) + assert df_categorical.shape == (6, 3) + result = df_categorical.round(3) + assert result.shape == (6, 3) + + tm.assert_frame_equal(result, expected) + + def test_round_interval_category_columns(self): + # GH#30063 + columns = pd.CategoricalIndex(pd.interval_range(0, 2)) + df = DataFrame([[0.66, 1.1], [0.3, 0.25]], columns=columns) + + result = df.round() + expected = DataFrame([[1.0, 1.0], [0.0, 0.0]], columns=columns) + tm.assert_frame_equal(result, expected) + + def test_round_empty_not_input(self): + # GH#51032 + df = DataFrame() + result = df.round() + tm.assert_frame_equal(df, result) + assert df is not result diff --git a/shared/package-files/75/75c5fd90d28b1e2fd75e414704f4be7dc33e3da7982a45fcd239b3c42d2c8a24/index_methods.py b/shared/package-files/75/75c5fd90d28b1e2fd75e414704f4be7dc33e3da7982a45fcd239b3c42d2c8a24/index_methods.py new file mode 100644 index 0000000000000000000000000000000000000000..12f707b60b4ad0bcadc35a222d9abe0cc5e033fc --- /dev/null +++ b/shared/package-files/75/75c5fd90d28b1e2fd75e414704f4be7dc33e3da7982a45fcd239b3c42d2c8a24/index_methods.py @@ -0,0 +1,469 @@ +"""Module with functions operating on IndexedBase, Indexed and Idx objects + + - Check shape conformance + - Determine indices in resulting expression + + etc. + + Methods in this module could be implemented by calling methods on Expr + objects instead. When things stabilize this could be a useful + refactoring. +""" + +from functools import reduce + +from sympy.core.function import Function +from sympy.functions import exp, Piecewise +from sympy.tensor.indexed import Idx, Indexed +from sympy.utilities import sift + +from collections import OrderedDict + +class IndexConformanceException(Exception): + pass + +def _unique_and_repeated(inds): + """ + Returns the unique and repeated indices. Also note, from the examples given below + that the order of indices is maintained as given in the input. + + Examples + ======== + + >>> from sympy.tensor.index_methods import _unique_and_repeated + >>> _unique_and_repeated([2, 3, 1, 3, 0, 4, 0]) + ([2, 1, 4], [3, 0]) + """ + uniq = OrderedDict() + for i in inds: + if i in uniq: + uniq[i] = 0 + else: + uniq[i] = 1 + return sift(uniq, lambda x: uniq[x], binary=True) + +def _remove_repeated(inds): + """ + Removes repeated objects from sequences + + Returns a set of the unique objects and a tuple of all that have been + removed. + + Examples + ======== + + >>> from sympy.tensor.index_methods import _remove_repeated + >>> l1 = [1, 2, 3, 2] + >>> _remove_repeated(l1) + ({1, 3}, (2,)) + + """ + u, r = _unique_and_repeated(inds) + return set(u), tuple(r) + + +def _get_indices_Mul(expr, return_dummies=False): + """Determine the outer indices of a Mul object. + + Examples + ======== + + >>> from sympy.tensor.index_methods import _get_indices_Mul + >>> from sympy.tensor.indexed import IndexedBase, Idx + >>> i, j, k = map(Idx, ['i', 'j', 'k']) + >>> x = IndexedBase('x') + >>> y = IndexedBase('y') + >>> _get_indices_Mul(x[i, k]*y[j, k]) + ({i, j}, {}) + >>> _get_indices_Mul(x[i, k]*y[j, k], return_dummies=True) + ({i, j}, {}, (k,)) + + """ + + inds = list(map(get_indices, expr.args)) + inds, syms = list(zip(*inds)) + + inds = list(map(list, inds)) + inds = list(reduce(lambda x, y: x + y, inds)) + inds, dummies = _remove_repeated(inds) + + symmetry = {} + for s in syms: + for pair in s: + if pair in symmetry: + symmetry[pair] *= s[pair] + else: + symmetry[pair] = s[pair] + + if return_dummies: + return inds, symmetry, dummies + else: + return inds, symmetry + + +def _get_indices_Pow(expr): + """Determine outer indices of a power or an exponential. + + A power is considered a universal function, so that the indices of a Pow is + just the collection of indices present in the expression. This may be + viewed as a bit inconsistent in the special case: + + x[i]**2 = x[i]*x[i] (1) + + The above expression could have been interpreted as the contraction of x[i] + with itself, but we choose instead to interpret it as a function + + lambda y: y**2 + + applied to each element of x (a universal function in numpy terms). In + order to allow an interpretation of (1) as a contraction, we need + contravariant and covariant Idx subclasses. (FIXME: this is not yet + implemented) + + Expressions in the base or exponent are subject to contraction as usual, + but an index that is present in the exponent, will not be considered + contractable with its own base. Note however, that indices in the same + exponent can be contracted with each other. + + Examples + ======== + + >>> from sympy.tensor.index_methods import _get_indices_Pow + >>> from sympy import Pow, exp, IndexedBase, Idx + >>> A = IndexedBase('A') + >>> x = IndexedBase('x') + >>> i, j, k = map(Idx, ['i', 'j', 'k']) + >>> _get_indices_Pow(exp(A[i, j]*x[j])) + ({i}, {}) + >>> _get_indices_Pow(Pow(x[i], x[i])) + ({i}, {}) + >>> _get_indices_Pow(Pow(A[i, j]*x[j], x[i])) + ({i}, {}) + + """ + base, exp = expr.as_base_exp() + binds, bsyms = get_indices(base) + einds, esyms = get_indices(exp) + + inds = binds | einds + + # FIXME: symmetries from power needs to check special cases, else nothing + symmetries = {} + + return inds, symmetries + + +def _get_indices_Add(expr): + """Determine outer indices of an Add object. + + In a sum, each term must have the same set of outer indices. A valid + expression could be + + x(i)*y(j) - x(j)*y(i) + + But we do not allow expressions like: + + x(i)*y(j) - z(j)*z(j) + + FIXME: Add support for Numpy broadcasting + + Examples + ======== + + >>> from sympy.tensor.index_methods import _get_indices_Add + >>> from sympy.tensor.indexed import IndexedBase, Idx + >>> i, j, k = map(Idx, ['i', 'j', 'k']) + >>> x = IndexedBase('x') + >>> y = IndexedBase('y') + >>> _get_indices_Add(x[i] + x[k]*y[i, k]) + ({i}, {}) + + """ + + inds = list(map(get_indices, expr.args)) + inds, syms = list(zip(*inds)) + + # allow broadcast of scalars + non_scalars = [x for x in inds if x != set()] + if not non_scalars: + return set(), {} + + if not all(x == non_scalars[0] for x in non_scalars[1:]): + raise IndexConformanceException("Indices are not consistent: %s" % expr) + if not reduce(lambda x, y: x != y or y, syms): + symmetries = syms[0] + else: + # FIXME: search for symmetries + symmetries = {} + + return non_scalars[0], symmetries + + +def get_indices(expr): + """Determine the outer indices of expression ``expr`` + + By *outer* we mean indices that are not summation indices. Returns a set + and a dict. The set contains outer indices and the dict contains + information about index symmetries. + + Examples + ======== + + >>> from sympy.tensor.index_methods import get_indices + >>> from sympy import symbols + >>> from sympy.tensor import IndexedBase + >>> x, y, A = map(IndexedBase, ['x', 'y', 'A']) + >>> i, j, a, z = symbols('i j a z', integer=True) + + The indices of the total expression is determined, Repeated indices imply a + summation, for instance the trace of a matrix A: + + >>> get_indices(A[i, i]) + (set(), {}) + + In the case of many terms, the terms are required to have identical + outer indices. Else an IndexConformanceException is raised. + + >>> get_indices(x[i] + A[i, j]*y[j]) + ({i}, {}) + + :Exceptions: + + An IndexConformanceException means that the terms ar not compatible, e.g. + + >>> get_indices(x[i] + y[j]) #doctest: +SKIP + (...) + IndexConformanceException: Indices are not consistent: x(i) + y(j) + + .. warning:: + The concept of *outer* indices applies recursively, starting on the deepest + level. This implies that dummies inside parenthesis are assumed to be + summed first, so that the following expression is handled gracefully: + + >>> get_indices((x[i] + A[i, j]*y[j])*x[j]) + ({i, j}, {}) + + This is correct and may appear convenient, but you need to be careful + with this as SymPy will happily .expand() the product, if requested. The + resulting expression would mix the outer ``j`` with the dummies inside + the parenthesis, which makes it a different expression. To be on the + safe side, it is best to avoid such ambiguities by using unique indices + for all contractions that should be held separate. + + """ + # We call ourself recursively to determine indices of sub expressions. + + # break recursion + if isinstance(expr, Indexed): + c = expr.indices + inds, dummies = _remove_repeated(c) + return inds, {} + elif expr is None: + return set(), {} + elif isinstance(expr, Idx): + return {expr}, {} + elif expr.is_Atom: + return set(), {} + + + # recurse via specialized functions + else: + if expr.is_Mul: + return _get_indices_Mul(expr) + elif expr.is_Add: + return _get_indices_Add(expr) + elif expr.is_Pow or isinstance(expr, exp): + return _get_indices_Pow(expr) + + elif isinstance(expr, Piecewise): + # FIXME: No support for Piecewise yet + return set(), {} + elif isinstance(expr, Function): + # Support ufunc like behaviour by returning indices from arguments. + # Functions do not interpret repeated indices across arguments + # as summation + ind0 = set() + for arg in expr.args: + ind, sym = get_indices(arg) + ind0 |= ind + return ind0, sym + + # this test is expensive, so it should be at the end + elif not expr.has(Indexed): + return set(), {} + raise NotImplementedError( + "FIXME: No specialized handling of type %s" % type(expr)) + + +def get_contraction_structure(expr): + """Determine dummy indices of ``expr`` and describe its structure + + By *dummy* we mean indices that are summation indices. + + The structure of the expression is determined and described as follows: + + 1) A conforming summation of Indexed objects is described with a dict where + the keys are summation indices and the corresponding values are sets + containing all terms for which the summation applies. All Add objects + in the SymPy expression tree are described like this. + + 2) For all nodes in the SymPy expression tree that are *not* of type Add, the + following applies: + + If a node discovers contractions in one of its arguments, the node + itself will be stored as a key in the dict. For that key, the + corresponding value is a list of dicts, each of which is the result of a + recursive call to get_contraction_structure(). The list contains only + dicts for the non-trivial deeper contractions, omitting dicts with None + as the one and only key. + + .. Note:: The presence of expressions among the dictionary keys indicates + multiple levels of index contractions. A nested dict displays nested + contractions and may itself contain dicts from a deeper level. In + practical calculations the summation in the deepest nested level must be + calculated first so that the outer expression can access the resulting + indexed object. + + Examples + ======== + + >>> from sympy.tensor.index_methods import get_contraction_structure + >>> from sympy import default_sort_key + >>> from sympy.tensor import IndexedBase, Idx + >>> x, y, A = map(IndexedBase, ['x', 'y', 'A']) + >>> i, j, k, l = map(Idx, ['i', 'j', 'k', 'l']) + >>> get_contraction_structure(x[i]*y[i] + A[j, j]) + {(i,): {x[i]*y[i]}, (j,): {A[j, j]}} + >>> get_contraction_structure(x[i]*y[j]) + {None: {x[i]*y[j]}} + + A multiplication of contracted factors results in nested dicts representing + the internal contractions. + + >>> d = get_contraction_structure(x[i, i]*y[j, j]) + >>> sorted(d.keys(), key=default_sort_key) + [None, x[i, i]*y[j, j]] + + In this case, the product has no contractions: + + >>> d[None] + {x[i, i]*y[j, j]} + + Factors are contracted "first": + + >>> sorted(d[x[i, i]*y[j, j]], key=default_sort_key) + [{(i,): {x[i, i]}}, {(j,): {y[j, j]}}] + + A parenthesized Add object is also returned as a nested dictionary. The + term containing the parenthesis is a Mul with a contraction among the + arguments, so it will be found as a key in the result. It stores the + dictionary resulting from a recursive call on the Add expression. + + >>> d = get_contraction_structure(x[i]*(y[i] + A[i, j]*x[j])) + >>> sorted(d.keys(), key=default_sort_key) + [(A[i, j]*x[j] + y[i])*x[i], (i,)] + >>> d[(i,)] + {(A[i, j]*x[j] + y[i])*x[i]} + >>> d[x[i]*(A[i, j]*x[j] + y[i])] + [{None: {y[i]}, (j,): {A[i, j]*x[j]}}] + + Powers with contractions in either base or exponent will also be found as + keys in the dictionary, mapping to a list of results from recursive calls: + + >>> d = get_contraction_structure(A[j, j]**A[i, i]) + >>> d[None] + {A[j, j]**A[i, i]} + >>> nested_contractions = d[A[j, j]**A[i, i]] + >>> nested_contractions[0] + {(j,): {A[j, j]}} + >>> nested_contractions[1] + {(i,): {A[i, i]}} + + The description of the contraction structure may appear complicated when + represented with a string in the above examples, but it is easy to iterate + over: + + >>> from sympy import Expr + >>> for key in d: + ... if isinstance(key, Expr): + ... continue + ... for term in d[key]: + ... if term in d: + ... # treat deepest contraction first + ... pass + ... # treat outermost contactions here + + """ + + # We call ourself recursively to inspect sub expressions. + + if isinstance(expr, Indexed): + junk, key = _remove_repeated(expr.indices) + return {key or None: {expr}} + elif expr.is_Atom: + return {None: {expr}} + elif expr.is_Mul: + junk, junk, key = _get_indices_Mul(expr, return_dummies=True) + result = {key or None: {expr}} + # recurse on every factor + nested = [] + for fac in expr.args: + facd = get_contraction_structure(fac) + if not (None in facd and len(facd) == 1): + nested.append(facd) + if nested: + result[expr] = nested + return result + elif expr.is_Pow or isinstance(expr, exp): + # recurse in base and exp separately. If either has internal + # contractions we must include ourselves as a key in the returned dict + b, e = expr.as_base_exp() + dbase = get_contraction_structure(b) + dexp = get_contraction_structure(e) + + dicts = [] + for d in dbase, dexp: + if not (None in d and len(d) == 1): + dicts.append(d) + result = {None: {expr}} + if dicts: + result[expr] = dicts + return result + elif expr.is_Add: + # Note: we just collect all terms with identical summation indices, We + # do nothing to identify equivalent terms here, as this would require + # substitutions or pattern matching in expressions of unknown + # complexity. + result = {} + for term in expr.args: + # recurse on every term + d = get_contraction_structure(term) + for key in d: + if key in result: + result[key] |= d[key] + else: + result[key] = d[key] + return result + + elif isinstance(expr, Piecewise): + # FIXME: No support for Piecewise yet + return {None: expr} + elif isinstance(expr, Function): + # Collect non-trivial contraction structures in each argument + # We do not report repeated indices in separate arguments as a + # contraction + deeplist = [] + for arg in expr.args: + deep = get_contraction_structure(arg) + if not (None in deep and len(deep) == 1): + deeplist.append(deep) + d = {None: {expr}} + if deeplist: + d[expr] = deeplist + return d + + # this test is expensive, so it should be at the end + elif not expr.has(Indexed): + return {None: {expr}} + raise NotImplementedError( + "FIXME: No specialized handling of type %s" % type(expr)) diff --git a/shared/package-files/75/75c8ab309e6c9420377888c1f5545c186dd4da1b53b572fc06260e2ef1c27ddb/test_streams.py b/shared/package-files/75/75c8ab309e6c9420377888c1f5545c186dd4da1b53b572fc06260e2ef1c27ddb/test_streams.py new file mode 100644 index 0000000000000000000000000000000000000000..d8768d8e9251c6e47debeb65dff3ec056d38ee56 --- /dev/null +++ b/shared/package-files/75/75c8ab309e6c9420377888c1f5545c186dd4da1b53b572fc06260e2ef1c27ddb/test_streams.py @@ -0,0 +1,232 @@ +""" Testing + +""" + +import os +import zlib + +from io import BytesIO + + +from tempfile import mkstemp +from contextlib import contextmanager + +import numpy as np + +from numpy.testing import assert_, assert_equal +from pytest import raises as assert_raises + +from scipy.io.matlab._streams import (make_stream, + GenericStream, ZlibInputStream, + _read_into, _read_string, BLOCK_SIZE) + + +@contextmanager +def setup_test_file(): + val = b'a\x00string' + fd, fname = mkstemp() + + with os.fdopen(fd, 'wb') as fs: + fs.write(val) + with open(fname, 'rb') as fs: + gs = BytesIO(val) + cs = BytesIO(val) + yield fs, gs, cs + os.unlink(fname) + + +def test_make_stream(): + with setup_test_file() as (fs, gs, cs): + # test stream initialization + assert_(isinstance(make_stream(gs), GenericStream)) + + +def test_tell_seek(): + with setup_test_file() as (fs, gs, cs): + for s in (fs, gs, cs): + st = make_stream(s) + res = st.seek(0) + assert_equal(res, 0) + assert_equal(st.tell(), 0) + res = st.seek(5) + assert_equal(res, 0) + assert_equal(st.tell(), 5) + res = st.seek(2, 1) + assert_equal(res, 0) + assert_equal(st.tell(), 7) + res = st.seek(-2, 2) + assert_equal(res, 0) + assert_equal(st.tell(), 6) + + +def test_read(): + with setup_test_file() as (fs, gs, cs): + for s in (fs, gs, cs): + st = make_stream(s) + st.seek(0) + res = st.read(-1) + assert_equal(res, b'a\x00string') + st.seek(0) + res = st.read(4) + assert_equal(res, b'a\x00st') + # read into + st.seek(0) + res = _read_into(st, 4) + assert_equal(res, b'a\x00st') + res = _read_into(st, 4) + assert_equal(res, b'ring') + assert_raises(OSError, _read_into, st, 2) + # read alloc + st.seek(0) + res = _read_string(st, 4) + assert_equal(res, b'a\x00st') + res = _read_string(st, 4) + assert_equal(res, b'ring') + assert_raises(OSError, _read_string, st, 2) + + +class TestZlibInputStream: + def _get_data(self, size): + data = np.random.randint(0, 256, size).astype(np.uint8).tobytes() + compressed_data = zlib.compress(data) + stream = BytesIO(compressed_data) + return stream, len(compressed_data), data + + def test_read(self): + SIZES = [0, 1, 10, BLOCK_SIZE//2, BLOCK_SIZE-1, + BLOCK_SIZE, BLOCK_SIZE+1, 2*BLOCK_SIZE-1] + + READ_SIZES = [BLOCK_SIZE//2, BLOCK_SIZE-1, + BLOCK_SIZE, BLOCK_SIZE+1] + + def check(size, read_size): + compressed_stream, compressed_data_len, data = self._get_data(size) + stream = ZlibInputStream(compressed_stream, compressed_data_len) + data2 = b'' + so_far = 0 + while True: + block = stream.read(min(read_size, + size - so_far)) + if not block: + break + so_far += len(block) + data2 += block + assert_equal(data, data2) + + for size in SIZES: + for read_size in READ_SIZES: + check(size, read_size) + + def test_read_max_length(self): + size = 1234 + data = np.random.randint(0, 256, size).astype(np.uint8).tobytes() + compressed_data = zlib.compress(data) + compressed_stream = BytesIO(compressed_data + b"abbacaca") + stream = ZlibInputStream(compressed_stream, len(compressed_data)) + + stream.read(len(data)) + assert_equal(compressed_stream.tell(), len(compressed_data)) + + assert_raises(OSError, stream.read, 1) + + def test_read_bad_checksum(self): + data = np.random.randint(0, 256, 10).astype(np.uint8).tobytes() + compressed_data = zlib.compress(data) + + # break checksum + compressed_data = (compressed_data[:-1] + + bytes([(compressed_data[-1] + 1) & 255])) + + compressed_stream = BytesIO(compressed_data) + stream = ZlibInputStream(compressed_stream, len(compressed_data)) + + assert_raises(zlib.error, stream.read, len(data)) + + def test_seek(self): + compressed_stream, compressed_data_len, data = self._get_data(1024) + + stream = ZlibInputStream(compressed_stream, compressed_data_len) + + stream.seek(123) + p = 123 + assert_equal(stream.tell(), p) + d1 = stream.read(11) + assert_equal(d1, data[p:p+11]) + + stream.seek(321, 1) + p = 123+11+321 + assert_equal(stream.tell(), p) + d2 = stream.read(21) + assert_equal(d2, data[p:p+21]) + + stream.seek(641, 0) + p = 641 + assert_equal(stream.tell(), p) + d3 = stream.read(11) + assert_equal(d3, data[p:p+11]) + + assert_raises(OSError, stream.seek, 10, 2) + assert_raises(OSError, stream.seek, -1, 1) + assert_raises(ValueError, stream.seek, 1, 123) + + stream.seek(10000, 1) + assert_raises(OSError, stream.read, 12) + + def test_seek_bad_checksum(self): + data = np.random.randint(0, 256, 10).astype(np.uint8).tobytes() + compressed_data = zlib.compress(data) + + # break checksum + compressed_data = (compressed_data[:-1] + + bytes([(compressed_data[-1] + 1) & 255])) + + compressed_stream = BytesIO(compressed_data) + stream = ZlibInputStream(compressed_stream, len(compressed_data)) + + assert_raises(zlib.error, stream.seek, len(data)) + + def test_all_data_read(self): + compressed_stream, compressed_data_len, data = self._get_data(1024) + stream = ZlibInputStream(compressed_stream, compressed_data_len) + assert_(not stream.all_data_read()) + stream.seek(512) + assert_(not stream.all_data_read()) + stream.seek(1024) + assert_(stream.all_data_read()) + + def test_all_data_read_overlap(self): + COMPRESSION_LEVEL = 6 + + data = np.arange(33707000).astype(np.uint8).tobytes() + compressed_data = zlib.compress(data, COMPRESSION_LEVEL) + compressed_data_len = len(compressed_data) + + # check that part of the checksum overlaps + assert_(compressed_data_len == BLOCK_SIZE + 2) + + compressed_stream = BytesIO(compressed_data) + stream = ZlibInputStream(compressed_stream, compressed_data_len) + assert_(not stream.all_data_read()) + stream.seek(len(data)) + assert_(stream.all_data_read()) + + def test_all_data_read_bad_checksum(self): + COMPRESSION_LEVEL = 6 + + data = np.arange(33707000).astype(np.uint8).tobytes() + compressed_data = zlib.compress(data, COMPRESSION_LEVEL) + compressed_data_len = len(compressed_data) + + # check that part of the checksum overlaps + assert_(compressed_data_len == BLOCK_SIZE + 2) + + # break checksum + compressed_data = (compressed_data[:-1] + + bytes([(compressed_data[-1] + 1) & 255])) + + compressed_stream = BytesIO(compressed_data) + stream = ZlibInputStream(compressed_stream, compressed_data_len) + assert_(not stream.all_data_read()) + stream.seek(len(data)) + + assert_raises(zlib.error, stream.all_data_read) diff --git a/shared/package-files/75/75c99aa1f34f965f596aa93aadaa0c648bff5906e3d080263ede8308e8cadea8/_reshape_alias_copy_native.h b/shared/package-files/75/75c99aa1f34f965f596aa93aadaa0c648bff5906e3d080263ede8308e8cadea8/_reshape_alias_copy_native.h new file mode 100644 index 0000000000000000000000000000000000000000..95609e7045991abb311e7965a2f20700b9914745 --- /dev/null +++ b/shared/package-files/75/75c99aa1f34f965f596aa93aadaa0c648bff5906e3d080263ede8308e8cadea8/_reshape_alias_copy_native.h @@ -0,0 +1,22 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor & _reshape_alias_copy_out_symint(const at::Tensor & self, c10::SymIntArrayRef size, c10::SymIntArrayRef stride, at::Tensor & out); +TORCH_API at::Tensor _reshape_alias_copy_symint(const at::Tensor & self, c10::SymIntArrayRef size, c10::SymIntArrayRef stride); +} // namespace native +} // namespace at diff --git a/shared/package-files/75/75c9c04a5db21193171986ec050907d56f8a2c1a104d24a811fba3ba63491e33/ATenGeneral.h b/shared/package-files/75/75c9c04a5db21193171986ec050907d56f8a2c1a104d24a811fba3ba63491e33/ATenGeneral.h new file mode 100644 index 0000000000000000000000000000000000000000..9b787a2163e87c903ce0bd034b424eb1773c644d --- /dev/null +++ b/shared/package-files/75/75c9c04a5db21193171986ec050907d56f8a2c1a104d24a811fba3ba63491e33/ATenGeneral.h @@ -0,0 +1,3 @@ +#pragma once + +#include diff --git a/shared/package-files/75/75ca0533eae2ad1f2a75cd5bbe027248f859be4db74ba364cf7fb62dcdf4a4c9/console.py b/shared/package-files/75/75ca0533eae2ad1f2a75cd5bbe027248f859be4db74ba364cf7fb62dcdf4a4c9/console.py new file mode 100644 index 0000000000000000000000000000000000000000..2a6cbe07629031687c249f70b51bdfbe2dd84041 --- /dev/null +++ b/shared/package-files/75/75ca0533eae2ad1f2a75cd5bbe027248f859be4db74ba364cf7fb62dcdf4a4c9/console.py @@ -0,0 +1,94 @@ +""" +Internal module for console introspection +""" +from __future__ import annotations + +from shutil import get_terminal_size + + +def get_console_size() -> tuple[int | None, int | None]: + """ + Return console size as tuple = (width, height). + + Returns (None,None) in non-interactive session. + """ + from pandas import get_option + + display_width = get_option("display.width") + display_height = get_option("display.max_rows") + + # Consider + # interactive shell terminal, can detect term size + # interactive non-shell terminal (ipnb/ipqtconsole), cannot detect term + # size non-interactive script, should disregard term size + + # in addition + # width,height have default values, but setting to 'None' signals + # should use Auto-Detection, But only in interactive shell-terminal. + # Simple. yeah. + + if in_interactive_session(): + if in_ipython_frontend(): + # sane defaults for interactive non-shell terminal + # match default for width,height in config_init + from pandas._config.config import get_default_val + + terminal_width = get_default_val("display.width") + terminal_height = get_default_val("display.max_rows") + else: + # pure terminal + terminal_width, terminal_height = get_terminal_size() + else: + terminal_width, terminal_height = None, None + + # Note if the User sets width/Height to None (auto-detection) + # and we're in a script (non-inter), this will return (None,None) + # caller needs to deal. + return display_width or terminal_width, display_height or terminal_height + + +# ---------------------------------------------------------------------- +# Detect our environment + + +def in_interactive_session() -> bool: + """ + Check if we're running in an interactive shell. + + Returns + ------- + bool + True if running under python/ipython interactive shell. + """ + from pandas import get_option + + def check_main(): + try: + import __main__ as main + except ModuleNotFoundError: + return get_option("mode.sim_interactive") + return not hasattr(main, "__file__") or get_option("mode.sim_interactive") + + try: + # error: Name '__IPYTHON__' is not defined + return __IPYTHON__ or check_main() # type: ignore[name-defined] + except NameError: + return check_main() + + +def in_ipython_frontend() -> bool: + """ + Check if we're inside an IPython zmq frontend. + + Returns + ------- + bool + """ + try: + # error: Name 'get_ipython' is not defined + ip = get_ipython() # type: ignore[name-defined] + return "zmq" in str(type(ip)).lower() + except NameError: + pass + + return False diff --git a/shared/package-files/75/75cbdd4007f9419b53d55fa8b05a133c725723c423d12af8ae67ca6640e79e7d/reshard.py b/shared/package-files/75/75cbdd4007f9419b53d55fa8b05a133c725723c423d12af8ae67ca6640e79e7d/reshard.py new file mode 100644 index 0000000000000000000000000000000000000000..de7a44bb820090e34bbbf7e80788e93948c801ec --- /dev/null +++ b/shared/package-files/75/75cbdd4007f9419b53d55fa8b05a133c725723c423d12af8ae67ca6640e79e7d/reshard.py @@ -0,0 +1,248 @@ +import copy +from typing import List, Tuple + +import torch +import torch.distributed as dist +from torch._C._distributed_c10d import ( + ProcessGroup, +) +import torch.distributed._shard.sharding_spec as shard_spec +from torch.distributed._shard.sharding_spec._internals import ( + get_split_size, + get_chunked_dim_size, +) +from torch.distributed.nn.functional import ( + all_to_all, + all_to_all_single, +) +from torch.distributed._shard.metadata import ShardMetadata + +from .shard import Shard + + +def get_idx_from_placements(placements, current_rank) -> int: + """ + Return the position of the current rank in the given placements. + + Args: + placements(List[Union[_remote_device, str]]): + Specifies the placement of each shard of the Tensor. The size of + the list represents the number of shards to be created. This could + be a list of + :class:`torch.distributed._remote_device`'s. This list + could also contain a string which represents remote + device as accepted by + :class:`torch.distributed._remote_device` + current_rank (int): number of current device. + + Returns: + A int which contains the position of current device in the placement list. + """ + for idx, placement in enumerate(placements): # type: ignore[attr-defined] + if current_rank == placement.rank(): # type: ignore[union-attr] + return idx + raise RuntimeError('current_rank not in the placement.') + + +def build_reshard_metadata( + st_size: torch.Size, + sharding_spec: shard_spec.ShardingSpec, + world_size: int, +) -> Tuple[List[ShardMetadata], List[int]]: + """ + Based the given sharding spec, we calculate the offset and local shard size. + We then build a ShardMetadata on top of the calculation result. + + Args: + st_size (torch.Size): The size of the sharded tensor. + sharding_spec (:class:`torch.distributed._shard.sharding_spec.ShardingSpec`): The + specification describing how the tensor is sharded. + world_size (int): number of ranks. + + Returns: + A Tuple of the followings: + A List[`ShardMetadata`] which contains the metadata for the shard, including + offsets, lengths and device placement. + A List[int] which contains the ranks in the order of placement. + """ + shard_dim = int(sharding_spec.dim) # type: ignore[attr-defined] + shards_metadata = [None] * world_size + ranks = [] + offsets = [0] * len(st_size) + split_size = get_split_size(st_size[shard_dim], world_size) + for idx, placement in enumerate(sharding_spec.placements): # type: ignore[attr-defined] + ranks.append(placement.rank()) + sharded_dim_size = get_chunked_dim_size(st_size[shard_dim], split_size, idx) + local_tensor_size = list(st_size) + local_tensor_size[shard_dim] = sharded_dim_size + shards_metadata[placement.rank()] = ShardMetadata( # type: ignore[call-overload] + shard_offsets=copy.deepcopy(offsets), + shard_sizes=local_tensor_size, + placement=placement, + ) + offsets[shard_dim] += sharded_dim_size + return shards_metadata, ranks # type: ignore[return-value] + + +def reshuffle_local_shard( + local_shard: torch.Tensor, + st_size: torch.Size, + sharding_spec: shard_spec.ShardingSpec, + resharding_spec: shard_spec.ShardingSpec, + pg: ProcessGroup, +) -> Tuple[List[Shard], List[ShardMetadata]]: + """ + Reshuffle the local shard directly when the reshard dim is same as the original + sharding dim. Logically we do this in two step: + 1. To collect all shards based on original sharding spec. + 2. Reshard the tensor based on the given resharding spec. + + In reality, we consolidate the two steps into one by sending the local tensor to + the new shard directly based on the resharding spec. + + Args: + local_shard (Tensor): Local tensor stored in the current rank. + st_size (torch.Size): The size of the sharded tensor. + sharding_spec (:class:`torch.distributed._shard.sharding_spec.ShardingSpec`): The + specification describing how the tensor is sharded originally. + resharding_spec (:class:`torch.distributed._shard.sharding_spec.ShardingSpec`): The + specification describing how the tensor will be resharded. + pg (ProcessGroup): The process group to aggregate on. + + Returns: + A Tuple of the followings: + A List[`Shard`] which contains the local tensor and its metadata. + A List[`ShardMetadata`] which contains the metadata for the shard, including + offsets, lengths and device placement. + """ + current_rank = dist.get_rank(pg) + world_size = dist.get_world_size(pg) + # Build shards_metadata first. + shards_metadata, ranks = build_reshard_metadata( + st_size, resharding_spec, world_size + ) + # Get input split size for all2all. + reshard_dim = int(resharding_spec.dim) # type: ignore[attr-defined] + split_size = get_split_size(st_size[reshard_dim], world_size) + input_split_sizes = [0] * world_size + idx = get_idx_from_placements(sharding_spec.placements, current_rank) # type: ignore[attr-defined] + new_rank = resharding_spec.placements[idx].rank() # type: ignore[union-attr, attr-defined] + input_split_sizes[new_rank] = local_shard.size(reshard_dim) + # Get output split size for all2all. + output_split_sizes = [0] * world_size + new_idx = ranks.index(current_rank) + sharded_dim_size = get_chunked_dim_size(st_size[reshard_dim], split_size, new_idx) + output_split_sizes[new_rank] = sharded_dim_size + # Get gathered_input for all2all. + local_shard = local_shard.transpose(0, reshard_dim).contiguous() + gathered_input_size = list(local_shard.size()) + gathered_input_size[0] = sharded_dim_size + gathered_input = torch.empty(gathered_input_size, device=local_shard.device, dtype=local_shard.dtype) + # all2all. + local_shard = all_to_all_single( + gathered_input, + local_shard, + input_split_sizes=input_split_sizes, + output_split_sizes=output_split_sizes, + group=pg, + ) + local_tensor = local_shard.transpose(0, reshard_dim).contiguous() + local_shards = [Shard(local_tensor, shards_metadata[current_rank])] + return local_shards, shards_metadata + + +def reshard_local_shard( + local_tensor: torch.Tensor, + st_size: torch.Size, + sharding_spec: shard_spec.ShardingSpec, + resharding_spec: shard_spec.ShardingSpec, + pg: ProcessGroup, +) -> Tuple[List[Shard], List[ShardMetadata]]: + """ + Reshard a sharded tensor given the ``resharding_spec``. When the reshard dim is + different from the original sharding dim, we need to do two steps logically: + 1. To collect all shards based on original sharding spec. + 2. Reshard the tensor based on the given resharding spec. + + In reality, we consolidate the two steps into one by sending each rank the new + shard based on the resharding spec. + + Args: + local_tensor (Tensor): Local tensor stored in the current rank. + st_size (torch.Size): The size of the sharded tensor. + sharding_spec (:class:`torch.distributed._shard.sharding_spec.ShardingSpec`): The + specification describing how the tensor is sharded originally. + resharding_spec (:class:`torch.distributed._shard.sharding_spec.ShardingSpec`): The + specification describing how the tensor will be resharded. + pg (ProcessGroup): The process group to aggregate on. + + Returns: + A Tuple of the followings: + A List[`Shard`] which contains the local tensor and its metadata. + A List[`ShardMetadata`] which contains the metadata for the shard, including + offsets, lengths and device placement. + """ + current_rank = dist.get_rank(pg) + world_size = dist.get_world_size(pg) + current_sharding_dim = int(sharding_spec.dim) # type: ignore[attr-defined] + reshard_dim = int(resharding_spec.dim) # type: ignore[attr-defined] + + # Build shards_metadata first. + shards_metadata, ranks = build_reshard_metadata( + st_size, resharding_spec, world_size + ) + + # Compute expected size + input_split_sizes = [] + for metadata in shards_metadata: + input_split_sizes.append(metadata.shard_sizes[reshard_dim]) + rearrange_input = any(ranks[i] > ranks[i + 1] for i in range(len(ranks) - 1)) + + if rearrange_input: + # Need to re-arrange reshard_dim of local_tensor before all2all. + indices: List[int] = [] + for metadata in shards_metadata: + offset_start_idx = metadata.shard_offsets[reshard_dim] + split_size = metadata.shard_sizes[reshard_dim] + indices += range(offset_start_idx, offset_start_idx + split_size) + local_tensor = local_tensor.index_select( + reshard_dim, torch.tensor(indices, device=local_tensor.device) + ) + + # Because reshard_dim != original shard_dim. We need to compute the + # size of tensor from each rank. + output_tensor_list = [torch.tensor(1)] * world_size + split_size = get_split_size(st_size[current_sharding_dim], world_size) + rearrange_output_list = False + indices = [] + for idx, placement in enumerate(sharding_spec.placements): # type: ignore[attr-defined] + sharded_dim_size = get_chunked_dim_size( + st_size[current_sharding_dim], split_size, idx + ) + output_tensor_size = list(st_size) + output_tensor_size[current_sharding_dim] = sharded_dim_size + output_tensor_size[reshard_dim] = input_split_sizes[current_rank] + output_tensor_list[ + placement.rank() + ] = torch.empty( # type: ignore[union-attr, index] + output_tensor_size, device=local_tensor.device, dtype=local_tensor.dtype + ) + indices.append(placement.rank()) # type: ignore[union-attr, index, arg-type] + if idx != placement.rank(): # type: ignore[union-attr] + rearrange_output_list = True + + # Perform autograd enabled all2all. + input_tensor_tuple = torch.split(local_tensor, input_split_sizes, dim=reshard_dim) + input_tensor_list = [tensor.contiguous() for tensor in input_tensor_tuple] + output_tensor_list = all_to_all( + output_tensor_list, + input_tensor_list, + group=pg, + ) + + if rearrange_output_list: + # Need to re-arrange original shard_dim of output_tensor_list. + output_tensor_list = [output_tensor_list[idx] for idx in indices] # type: ignore[call-overload] + local_tensor = torch.cat(output_tensor_list, dim=current_sharding_dim) + local_shards = [Shard(local_tensor, shards_metadata[current_rank])] + return local_shards, shards_metadata diff --git a/shared/package-files/75/75ce3fc4d19c5fa8e3490b74ce2c28a13bce5bad69207450db669290e16a0a6a/test_deprecations.py b/shared/package-files/75/75ce3fc4d19c5fa8e3490b74ce2c28a13bce5bad69207450db669290e16a0a6a/test_deprecations.py new file mode 100644 index 0000000000000000000000000000000000000000..fdb3b7b0f1dfe68cbc82c04ff675a451148cfeee --- /dev/null +++ b/shared/package-files/75/75ce3fc4d19c5fa8e3490b74ce2c28a13bce5bad69207450db669290e16a0a6a/test_deprecations.py @@ -0,0 +1,415 @@ +from contextlib import contextmanager +from io import BytesIO +from unittest import TestCase, mock +import importlib.metadata +import json +import subprocess +import sys +import urllib.request + +import referencing.exceptions + +from jsonschema import FormatChecker, exceptions, protocols, validators + + +class TestDeprecations(TestCase): + def test_version(self): + """ + As of v4.0.0, __version__ is deprecated in favor of importlib.metadata. + """ + + message = "Accessing jsonschema.__version__ is deprecated" + with self.assertWarnsRegex(DeprecationWarning, message) as w: + from jsonschema import __version__ + + self.assertEqual(__version__, importlib.metadata.version("jsonschema")) + self.assertEqual(w.filename, __file__) + + def test_validators_ErrorTree(self): + """ + As of v4.0.0, importing ErrorTree from jsonschema.validators is + deprecated in favor of doing so from jsonschema.exceptions. + """ + + message = "Importing ErrorTree from jsonschema.validators is " + with self.assertWarnsRegex(DeprecationWarning, message) as w: + from jsonschema.validators import ErrorTree + + self.assertEqual(ErrorTree, exceptions.ErrorTree) + self.assertEqual(w.filename, __file__) + + def test_import_ErrorTree(self): + """ + As of v4.18.0, importing ErrorTree from the package root is + deprecated in favor of doing so from jsonschema.exceptions. + """ + + message = "Importing ErrorTree directly from the jsonschema package " + with self.assertWarnsRegex(DeprecationWarning, message) as w: + from jsonschema import ErrorTree + + self.assertEqual(ErrorTree, exceptions.ErrorTree) + self.assertEqual(w.filename, __file__) + + def test_import_FormatError(self): + """ + As of v4.18.0, importing FormatError from the package root is + deprecated in favor of doing so from jsonschema.exceptions. + """ + + message = "Importing FormatError directly from the jsonschema package " + with self.assertWarnsRegex(DeprecationWarning, message) as w: + from jsonschema import FormatError + + self.assertEqual(FormatError, exceptions.FormatError) + self.assertEqual(w.filename, __file__) + + def test_import_Validator(self): + """ + As of v4.19.0, importing Validator from the package root is + deprecated in favor of doing so from jsonschema.protocols. + """ + + message = "Importing Validator directly from the jsonschema package " + with self.assertWarnsRegex(DeprecationWarning, message) as w: + from jsonschema import Validator + + self.assertEqual(Validator, protocols.Validator) + self.assertEqual(w.filename, __file__) + + def test_validators_validators(self): + """ + As of v4.0.0, accessing jsonschema.validators.validators is + deprecated. + """ + + message = "Accessing jsonschema.validators.validators is deprecated" + with self.assertWarnsRegex(DeprecationWarning, message) as w: + value = validators.validators + + self.assertEqual(value, validators._VALIDATORS) + self.assertEqual(w.filename, __file__) + + def test_validators_meta_schemas(self): + """ + As of v4.0.0, accessing jsonschema.validators.meta_schemas is + deprecated. + """ + + message = "Accessing jsonschema.validators.meta_schemas is deprecated" + with self.assertWarnsRegex(DeprecationWarning, message) as w: + value = validators.meta_schemas + + self.assertEqual(value, validators._META_SCHEMAS) + self.assertEqual(w.filename, __file__) + + def test_RefResolver_in_scope(self): + """ + As of v4.0.0, RefResolver.in_scope is deprecated. + """ + + resolver = validators._RefResolver.from_schema({}) + message = "jsonschema.RefResolver.in_scope is deprecated " + with self.assertWarnsRegex(DeprecationWarning, message) as w: + with resolver.in_scope("foo"): + pass + + self.assertEqual(w.filename, __file__) + + def test_Validator_is_valid_two_arguments(self): + """ + As of v4.0.0, calling is_valid with two arguments (to provide a + different schema) is deprecated. + """ + + validator = validators.Draft7Validator({}) + message = "Passing a schema to Validator.is_valid is deprecated " + with self.assertWarnsRegex(DeprecationWarning, message) as w: + result = validator.is_valid("foo", {"type": "number"}) + + self.assertFalse(result) + self.assertEqual(w.filename, __file__) + + def test_Validator_iter_errors_two_arguments(self): + """ + As of v4.0.0, calling iter_errors with two arguments (to provide a + different schema) is deprecated. + """ + + validator = validators.Draft7Validator({}) + message = "Passing a schema to Validator.iter_errors is deprecated " + with self.assertWarnsRegex(DeprecationWarning, message) as w: + error, = validator.iter_errors("foo", {"type": "number"}) + + self.assertEqual(error.validator, "type") + self.assertEqual(w.filename, __file__) + + def test_Validator_resolver(self): + """ + As of v4.18.0, accessing Validator.resolver is deprecated. + """ + + validator = validators.Draft7Validator({}) + message = "Accessing Draft7Validator.resolver is " + with self.assertWarnsRegex(DeprecationWarning, message) as w: + self.assertIsInstance(validator.resolver, validators._RefResolver) + + self.assertEqual(w.filename, __file__) + + def test_RefResolver(self): + """ + As of v4.18.0, RefResolver is fully deprecated. + """ + + message = "jsonschema.RefResolver is deprecated" + with self.assertWarnsRegex(DeprecationWarning, message) as w: + from jsonschema import RefResolver + self.assertEqual(w.filename, __file__) + + with self.assertWarnsRegex(DeprecationWarning, message) as w: + from jsonschema.validators import RefResolver # noqa: F401, F811 + self.assertEqual(w.filename, __file__) + + def test_RefResolutionError(self): + """ + As of v4.18.0, RefResolutionError is deprecated in favor of directly + catching errors from the referencing library. + """ + + message = "jsonschema.exceptions.RefResolutionError is deprecated" + with self.assertWarnsRegex(DeprecationWarning, message) as w: + from jsonschema import RefResolutionError + + self.assertEqual(RefResolutionError, exceptions._RefResolutionError) + self.assertEqual(w.filename, __file__) + + with self.assertWarnsRegex(DeprecationWarning, message) as w: + from jsonschema.exceptions import RefResolutionError + + self.assertEqual(RefResolutionError, exceptions._RefResolutionError) + self.assertEqual(w.filename, __file__) + + def test_catching_Unresolvable_directly(self): + """ + This behavior is the intended behavior (i.e. it's not deprecated), but + given we do "tricksy" things in the iterim to wrap exceptions in a + multiple inheritance subclass, we need to be extra sure it works and + stays working. + """ + validator = validators.Draft202012Validator({"$ref": "urn:nothing"}) + + with self.assertRaises(referencing.exceptions.Unresolvable) as e: + validator.validate(12) + + expected = referencing.exceptions.Unresolvable(ref="urn:nothing") + self.assertEqual( + (e.exception, str(e.exception)), + (expected, "Unresolvable: urn:nothing") + ) + + def test_catching_Unresolvable_via_RefResolutionError(self): + """ + Until RefResolutionError is removed, it is still possible to catch + exceptions from reference resolution using it, even though they may + have been raised by referencing. + """ + with self.assertWarns(DeprecationWarning): + from jsonschema import RefResolutionError + + validator = validators.Draft202012Validator({"$ref": "urn:nothing"}) + + with self.assertRaises(referencing.exceptions.Unresolvable) as u: + validator.validate(12) + + with self.assertRaises(RefResolutionError) as e: + validator.validate(12) + + self.assertEqual( + (e.exception, str(e.exception)), + (u.exception, "Unresolvable: urn:nothing") + ) + + def test_WrappedReferencingError_hashability(self): + """ + Ensure the wrapped referencing errors are hashable when possible. + """ + with self.assertWarns(DeprecationWarning): + from jsonschema import RefResolutionError + + validator = validators.Draft202012Validator({"$ref": "urn:nothing"}) + + with self.assertRaises(referencing.exceptions.Unresolvable) as u: + validator.validate(12) + + with self.assertRaises(RefResolutionError) as e: + validator.validate(12) + + self.assertIn(e.exception, {u.exception}) + self.assertIn(u.exception, {e.exception}) + + def test_Validator_subclassing(self): + """ + As of v4.12.0, subclassing a validator class produces an explicit + deprecation warning. + + This was never intended to be public API (and some comments over the + years in issues said so, but obviously that's not a great way to make + sure it's followed). + + A future version will explicitly raise an error. + """ + + message = "Subclassing validator classes is " + with self.assertWarnsRegex(DeprecationWarning, message) as w: + class Subclass(validators.Draft202012Validator): + pass + + self.assertEqual(w.filename, __file__) + + with self.assertWarnsRegex(DeprecationWarning, message) as w: + class AnotherSubclass(validators.create(meta_schema={})): + pass + + def test_FormatChecker_cls_checks(self): + """ + As of v4.14.0, FormatChecker.cls_checks is deprecated without + replacement. + """ + + self.addCleanup(FormatChecker.checkers.pop, "boom", None) + + message = "FormatChecker.cls_checks " + with self.assertWarnsRegex(DeprecationWarning, message) as w: + FormatChecker.cls_checks("boom") + + self.assertEqual(w.filename, __file__) + + def test_draftN_format_checker(self): + """ + As of v4.16.0, accessing jsonschema.draftn_format_checker is deprecated + in favor of Validator.FORMAT_CHECKER. + """ + + message = "Accessing jsonschema.draft202012_format_checker is " + with self.assertWarnsRegex(DeprecationWarning, message) as w: + from jsonschema import draft202012_format_checker + + self.assertIs( + draft202012_format_checker, + validators.Draft202012Validator.FORMAT_CHECKER, + ) + self.assertEqual(w.filename, __file__) + + message = "Accessing jsonschema.draft201909_format_checker is " + with self.assertWarnsRegex(DeprecationWarning, message) as w: + from jsonschema import draft201909_format_checker + + self.assertIs( + draft201909_format_checker, + validators.Draft201909Validator.FORMAT_CHECKER, + ) + self.assertEqual(w.filename, __file__) + + message = "Accessing jsonschema.draft7_format_checker is " + with self.assertWarnsRegex(DeprecationWarning, message) as w: + from jsonschema import draft7_format_checker + + self.assertIs( + draft7_format_checker, + validators.Draft7Validator.FORMAT_CHECKER, + ) + self.assertEqual(w.filename, __file__) + + message = "Accessing jsonschema.draft6_format_checker is " + with self.assertWarnsRegex(DeprecationWarning, message) as w: + from jsonschema import draft6_format_checker + + self.assertIs( + draft6_format_checker, + validators.Draft6Validator.FORMAT_CHECKER, + ) + self.assertEqual(w.filename, __file__) + + message = "Accessing jsonschema.draft4_format_checker is " + with self.assertWarnsRegex(DeprecationWarning, message) as w: + from jsonschema import draft4_format_checker + + self.assertIs( + draft4_format_checker, + validators.Draft4Validator.FORMAT_CHECKER, + ) + self.assertEqual(w.filename, __file__) + + message = "Accessing jsonschema.draft3_format_checker is " + with self.assertWarnsRegex(DeprecationWarning, message) as w: + from jsonschema import draft3_format_checker + + self.assertIs( + draft3_format_checker, + validators.Draft3Validator.FORMAT_CHECKER, + ) + self.assertEqual(w.filename, __file__) + + with self.assertRaises(ImportError): + from jsonschema import draft1234_format_checker # noqa + + def test_import_cli(self): + """ + As of v4.17.0, importing jsonschema.cli is deprecated. + """ + + message = "The jsonschema CLI is deprecated and will be removed " + with self.assertWarnsRegex(DeprecationWarning, message) as w: + import jsonschema.cli + importlib.reload(jsonschema.cli) + + self.assertEqual(w.filename, importlib.__file__) + + def test_cli(self): + """ + As of v4.17.0, the jsonschema CLI is deprecated. + """ + + process = subprocess.run( + [sys.executable, "-m", "jsonschema"], + capture_output=True, + ) + self.assertIn(b"The jsonschema CLI is deprecated ", process.stderr) + + def test_automatic_remote_retrieval(self): + """ + Automatic retrieval of remote references is deprecated as of v4.18.0. + """ + ref = "http://bar#/$defs/baz" + schema = {"$defs": {"baz": {"type": "integer"}}} + + if "requests" in sys.modules: # pragma: no cover + self.addCleanup( + sys.modules.__setitem__, "requests", sys.modules["requests"], + ) + sys.modules["requests"] = None + + @contextmanager + def fake_urlopen(request): + self.assertIsInstance(request, urllib.request.Request) + self.assertEqual(request.full_url, "http://bar") + + # Ha ha urllib.request.Request "normalizes" header names and + # Request.get_header does not also normalize them... + (header, value), = request.header_items() + self.assertEqual(header.lower(), "user-agent") + self.assertEqual( + value, "python-jsonschema (deprecated $ref resolution)", + ) + yield BytesIO(json.dumps(schema).encode("utf8")) + + validator = validators.Draft202012Validator({"$ref": ref}) + + message = "Automatically retrieving remote references " + patch = mock.patch.object(urllib.request, "urlopen", new=fake_urlopen) + + with patch, self.assertWarnsRegex(DeprecationWarning, message): + self.assertEqual( + (validator.is_valid({}), validator.is_valid(37)), + (False, True), + ) diff --git a/shared/package-files/75/75cfdd35ecb6f641fa28b535993d836a4abbb59de405fcc41b0cce983cf0d45f/filters.py b/shared/package-files/75/75cfdd35ecb6f641fa28b535993d836a4abbb59de405fcc41b0cce983cf0d45f/filters.py new file mode 100644 index 0000000000000000000000000000000000000000..52959005b088f0e5116c8b6acdbcc5937bbaacc8 --- /dev/null +++ b/shared/package-files/75/75cfdd35ecb6f641fa28b535993d836a4abbb59de405fcc41b0cce983cf0d45f/filters.py @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: MIT + +from attr.filters import * # noqa diff --git a/shared/package-files/75/75cff1387ca65fa141aa635923c58e9d287764be9b90a3dbf607f590b1ca4530/xnuppc+80x30 b/shared/package-files/75/75cff1387ca65fa141aa635923c58e9d287764be9b90a3dbf607f590b1ca4530/xnuppc+80x30 new file mode 100644 index 0000000000000000000000000000000000000000..52c54f54b2b0936dc48321c610fb04968e7fbe47 Binary files /dev/null and b/shared/package-files/75/75cff1387ca65fa141aa635923c58e9d287764be9b90a3dbf607f590b1ca4530/xnuppc+80x30 differ diff --git a/shared/package-files/75/75d2795625ee95b3cba1c1ebf919162b6ed6252b95d965d4c7be236722f434e8/_tight_bbox.py b/shared/package-files/75/75d2795625ee95b3cba1c1ebf919162b6ed6252b95d965d4c7be236722f434e8/_tight_bbox.py new file mode 100644 index 0000000000000000000000000000000000000000..db72bbdff020680dfd833229cac41e9b33e428ee --- /dev/null +++ b/shared/package-files/75/75d2795625ee95b3cba1c1ebf919162b6ed6252b95d965d4c7be236722f434e8/_tight_bbox.py @@ -0,0 +1,84 @@ +""" +Helper module for the *bbox_inches* parameter in `.Figure.savefig`. +""" + +from matplotlib.transforms import Bbox, TransformedBbox, Affine2D + + +def adjust_bbox(fig, bbox_inches, fixed_dpi=None): + """ + Temporarily adjust the figure so that only the specified area + (bbox_inches) is saved. + + It modifies fig.bbox, fig.bbox_inches, + fig.transFigure._boxout, and fig.patch. While the figure size + changes, the scale of the original figure is conserved. A + function which restores the original values are returned. + """ + origBbox = fig.bbox + origBboxInches = fig.bbox_inches + _boxout = fig.transFigure._boxout + + old_aspect = [] + locator_list = [] + sentinel = object() + for ax in fig.axes: + locator = ax.get_axes_locator() + if locator is not None: + ax.apply_aspect(locator(ax, None)) + locator_list.append(locator) + current_pos = ax.get_position(original=False).frozen() + ax.set_axes_locator(lambda a, r, _pos=current_pos: _pos) + # override the method that enforces the aspect ratio on the Axes + if 'apply_aspect' in ax.__dict__: + old_aspect.append(ax.apply_aspect) + else: + old_aspect.append(sentinel) + ax.apply_aspect = lambda pos=None: None + + def restore_bbox(): + for ax, loc, aspect in zip(fig.axes, locator_list, old_aspect): + ax.set_axes_locator(loc) + if aspect is sentinel: + # delete our no-op function which un-hides the original method + del ax.apply_aspect + else: + ax.apply_aspect = aspect + + fig.bbox = origBbox + fig.bbox_inches = origBboxInches + fig.transFigure._boxout = _boxout + fig.transFigure.invalidate() + fig.patch.set_bounds(0, 0, 1, 1) + + if fixed_dpi is None: + fixed_dpi = fig.dpi + tr = Affine2D().scale(fixed_dpi) + dpi_scale = fixed_dpi / fig.dpi + + fig.bbox_inches = Bbox.from_bounds(0, 0, *bbox_inches.size) + x0, y0 = tr.transform(bbox_inches.p0) + w1, h1 = fig.bbox.size * dpi_scale + fig.transFigure._boxout = Bbox.from_bounds(-x0, -y0, w1, h1) + fig.transFigure.invalidate() + + fig.bbox = TransformedBbox(fig.bbox_inches, tr) + + fig.patch.set_bounds(x0 / w1, y0 / h1, + fig.bbox.width / w1, fig.bbox.height / h1) + + return restore_bbox + + +def process_figure_for_rasterizing(fig, bbox_inches_restore, fixed_dpi=None): + """ + A function that needs to be called when figure dpi changes during the + drawing (e.g., rasterizing). It recovers the bbox and re-adjust it with + the new dpi. + """ + + bbox_inches, restore_bbox = bbox_inches_restore + restore_bbox() + r = adjust_bbox(fig, bbox_inches, fixed_dpi) + + return bbox_inches, r diff --git a/shared/package-files/75/75d47701bf02b9087e5a83bdff9c1a28ab8ffd0d77d20913cdff8e5345c9bf49/Array.h b/shared/package-files/75/75d47701bf02b9087e5a83bdff9c1a28ab8ffd0d77d20913cdff8e5345c9bf49/Array.h new file mode 100644 index 0000000000000000000000000000000000000000..300ae51cef6b9044b1060376b19f7278fcf18a94 --- /dev/null +++ b/shared/package-files/75/75d47701bf02b9087e5a83bdff9c1a28ab8ffd0d77d20913cdff8e5345c9bf49/Array.h @@ -0,0 +1,39 @@ +#pragma once + +// A fixed-size array type usable from both host and +// device code. + +#include +#include + +namespace at { namespace detail { + +template +struct Array { + T data[size_]; + + C10_HOST_DEVICE T operator[](int i) const { + return data[i]; + } + C10_HOST_DEVICE T& operator[](int i) { + return data[i]; + } +#if defined(USE_ROCM) + C10_HOST_DEVICE Array() = default; + C10_HOST_DEVICE Array(const Array&) = default; + C10_HOST_DEVICE Array& operator=(const Array&) = default; +#else + Array() = default; + Array(const Array&) = default; + Array& operator=(const Array&) = default; +#endif + static constexpr int size(){return size_;} + // Fill the array with x. + C10_HOST_DEVICE Array(T x) { + for (int i = 0; i < size_; i++) { + data[i] = x; + } + } +}; + +}} diff --git a/shared/package-files/75/75d8d4cce43482489604bb55c151584c9c9d688756dea01ce01095b1cc63efe4/test_redundancy.py b/shared/package-files/75/75d8d4cce43482489604bb55c151584c9c9d688756dea01ce01095b1cc63efe4/test_redundancy.py new file mode 100644 index 0000000000000000000000000000000000000000..7ab7813d5facd2953e1d661d3b64a2223b38e48b --- /dev/null +++ b/shared/package-files/75/75d8d4cce43482489604bb55c151584c9c9d688756dea01ce01095b1cc63efe4/test_redundancy.py @@ -0,0 +1,37 @@ +"""Unit tests for the :mod:`networkx.algorithms.bipartite.redundancy` module. + +""" + +import pytest + +from networkx import NetworkXError, cycle_graph +from networkx.algorithms.bipartite import complete_bipartite_graph, node_redundancy + + +def test_no_redundant_nodes(): + G = complete_bipartite_graph(2, 2) + + # when nodes is None + rc = node_redundancy(G) + assert all(redundancy == 1 for redundancy in rc.values()) + + # when set of nodes is specified + rc = node_redundancy(G, (2, 3)) + assert rc == {2: 1.0, 3: 1.0} + + +def test_redundant_nodes(): + G = cycle_graph(6) + edge = {0, 3} + G.add_edge(*edge) + redundancy = node_redundancy(G) + for v in edge: + assert redundancy[v] == 2 / 3 + for v in set(G) - edge: + assert redundancy[v] == 1 + + +def test_not_enough_neighbors(): + with pytest.raises(NetworkXError): + G = complete_bipartite_graph(1, 2) + node_redundancy(G) diff --git a/shared/package-files/75/75dc16aff517cecce90bd1f2ba14b7be265e95ad507236f2b5472da735d058e0/fft_rfftfreq_compositeexplicitautograd_dispatch.h b/shared/package-files/75/75dc16aff517cecce90bd1f2ba14b7be265e95ad507236f2b5472da735d058e0/fft_rfftfreq_compositeexplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..299972343f5f39d5b395e3761f67f4a4ecb5ed76 --- /dev/null +++ b/shared/package-files/75/75dc16aff517cecce90bd1f2ba14b7be265e95ad507236f2b5472da735d058e0/fft_rfftfreq_compositeexplicitautograd_dispatch.h @@ -0,0 +1,26 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API at::Tensor fft_rfftfreq(int64_t n, double d=1.0, at::TensorOptions options={}); +TORCH_API at::Tensor fft_rfftfreq(int64_t n, double d, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); +TORCH_API at::Tensor & fft_rfftfreq_out(at::Tensor & out, int64_t n, double d=1.0); +TORCH_API at::Tensor & fft_rfftfreq_outf(int64_t n, double d, at::Tensor & out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/75/75e67af2e02ad23a1d11eba626905859759c8885dc0587e9b0ba5ed5fd562cef/tree.py b/shared/package-files/75/75e67af2e02ad23a1d11eba626905859759c8885dc0587e9b0ba5ed5fd562cef/tree.py new file mode 100644 index 0000000000000000000000000000000000000000..e5298711ead793683b7054190819a6d58167ef41 --- /dev/null +++ b/shared/package-files/75/75e67af2e02ad23a1d11eba626905859759c8885dc0587e9b0ba5ed5fd562cef/tree.py @@ -0,0 +1,488 @@ +from abc import abstractmethod, abstractproperty +from typing import List, Optional, Tuple, Union + +from parso.utils import split_lines + + +def search_ancestor(node: 'NodeOrLeaf', *node_types: str) -> 'Optional[BaseNode]': + """ + Recursively looks at the parents of a node and returns the first found node + that matches ``node_types``. Returns ``None`` if no matching node is found. + + This function is deprecated, use :meth:`NodeOrLeaf.search_ancestor` instead. + + :param node: The ancestors of this node will be checked. + :param node_types: type names that are searched for. + """ + n = node.parent + while n is not None: + if n.type in node_types: + return n + n = n.parent + return None + + +class NodeOrLeaf: + """ + The base class for nodes and leaves. + """ + __slots__ = ('parent',) + type: str + ''' + The type is a string that typically matches the types of the grammar file. + ''' + parent: 'Optional[BaseNode]' + ''' + The parent :class:`BaseNode` of this node or leaf. + None if this is the root node. + ''' + + def get_root_node(self): + """ + Returns the root node of a parser tree. The returned node doesn't have + a parent node like all the other nodes/leaves. + """ + scope = self + while scope.parent is not None: + scope = scope.parent + return scope + + def get_next_sibling(self): + """ + Returns the node immediately following this node in this parent's + children list. If this node does not have a next sibling, it is None + """ + parent = self.parent + if parent is None: + return None + + # Can't use index(); we need to test by identity + for i, child in enumerate(parent.children): + if child is self: + try: + return self.parent.children[i + 1] + except IndexError: + return None + + def get_previous_sibling(self): + """ + Returns the node immediately preceding this node in this parent's + children list. If this node does not have a previous sibling, it is + None. + """ + parent = self.parent + if parent is None: + return None + + # Can't use index(); we need to test by identity + for i, child in enumerate(parent.children): + if child is self: + if i == 0: + return None + return self.parent.children[i - 1] + + def get_previous_leaf(self): + """ + Returns the previous leaf in the parser tree. + Returns `None` if this is the first element in the parser tree. + """ + if self.parent is None: + return None + + node = self + while True: + c = node.parent.children + i = c.index(node) + if i == 0: + node = node.parent + if node.parent is None: + return None + else: + node = c[i - 1] + break + + while True: + try: + node = node.children[-1] + except AttributeError: # A Leaf doesn't have children. + return node + + def get_next_leaf(self): + """ + Returns the next leaf in the parser tree. + Returns None if this is the last element in the parser tree. + """ + if self.parent is None: + return None + + node = self + while True: + c = node.parent.children + i = c.index(node) + if i == len(c) - 1: + node = node.parent + if node.parent is None: + return None + else: + node = c[i + 1] + break + + while True: + try: + node = node.children[0] + except AttributeError: # A Leaf doesn't have children. + return node + + @abstractproperty + def start_pos(self) -> Tuple[int, int]: + """ + Returns the starting position of the prefix as a tuple, e.g. `(3, 4)`. + + :return tuple of int: (line, column) + """ + + @abstractproperty + def end_pos(self) -> Tuple[int, int]: + """ + Returns the end position of the prefix as a tuple, e.g. `(3, 4)`. + + :return tuple of int: (line, column) + """ + + @abstractmethod + def get_start_pos_of_prefix(self): + """ + Returns the start_pos of the prefix. This means basically it returns + the end_pos of the last prefix. The `get_start_pos_of_prefix()` of the + prefix `+` in `2 + 1` would be `(1, 1)`, while the start_pos is + `(1, 2)`. + + :return tuple of int: (line, column) + """ + + @abstractmethod + def get_first_leaf(self): + """ + Returns the first leaf of a node or itself if this is a leaf. + """ + + @abstractmethod + def get_last_leaf(self): + """ + Returns the last leaf of a node or itself if this is a leaf. + """ + + @abstractmethod + def get_code(self, include_prefix=True): + """ + Returns the code that was the input for the parser for this node. + + :param include_prefix: Removes the prefix (whitespace and comments) of + e.g. a statement. + """ + + def search_ancestor(self, *node_types: str) -> 'Optional[BaseNode]': + """ + Recursively looks at the parents of this node or leaf and returns the + first found node that matches ``node_types``. Returns ``None`` if no + matching node is found. + + :param node_types: type names that are searched for. + """ + node = self.parent + while node is not None: + if node.type in node_types: + return node + node = node.parent + return None + + def dump(self, *, indent: Optional[Union[int, str]] = 4) -> str: + """ + Returns a formatted dump of the parser tree rooted at this node or leaf. This is + mainly useful for debugging purposes. + + The ``indent`` parameter is interpreted in a similar way as :py:func:`ast.dump`. + If ``indent`` is a non-negative integer or string, then the tree will be + pretty-printed with that indent level. An indent level of 0, negative, or ``""`` + will only insert newlines. ``None`` selects the single line representation. + Using a positive integer indent indents that many spaces per level. If + ``indent`` is a string (such as ``"\\t"``), that string is used to indent each + level. + + :param indent: Indentation style as described above. The default indentation is + 4 spaces, which yields a pretty-printed dump. + + >>> import parso + >>> print(parso.parse("lambda x, y: x + y").dump()) + Module([ + Lambda([ + Keyword('lambda', (1, 0)), + Param([ + Name('x', (1, 7), prefix=' '), + Operator(',', (1, 8)), + ]), + Param([ + Name('y', (1, 10), prefix=' '), + ]), + Operator(':', (1, 11)), + PythonNode('arith_expr', [ + Name('x', (1, 13), prefix=' '), + Operator('+', (1, 15), prefix=' '), + Name('y', (1, 17), prefix=' '), + ]), + ]), + EndMarker('', (1, 18)), + ]) + """ + if indent is None: + newline = False + indent_string = '' + elif isinstance(indent, int): + newline = True + indent_string = ' ' * indent + elif isinstance(indent, str): + newline = True + indent_string = indent + else: + raise TypeError(f"expect 'indent' to be int, str or None, got {indent!r}") + + def _format_dump(node: NodeOrLeaf, indent: str = '', top_level: bool = True) -> str: + result = '' + node_type = type(node).__name__ + if isinstance(node, Leaf): + result += f'{indent}{node_type}(' + if isinstance(node, ErrorLeaf): + result += f'{node.token_type!r}, ' + elif isinstance(node, TypedLeaf): + result += f'{node.type!r}, ' + result += f'{node.value!r}, {node.start_pos!r}' + if node.prefix: + result += f', prefix={node.prefix!r}' + result += ')' + elif isinstance(node, BaseNode): + result += f'{indent}{node_type}(' + if isinstance(node, Node): + result += f'{node.type!r}, ' + result += '[' + if newline: + result += '\n' + for child in node.children: + result += _format_dump(child, indent=indent + indent_string, top_level=False) + result += f'{indent}])' + else: # pragma: no cover + # We shouldn't ever reach here, unless: + # - `NodeOrLeaf` is incorrectly subclassed else where + # - or a node's children list contains invalid nodes or leafs + # Both are unexpected internal errors. + raise TypeError(f'unsupported node encountered: {node!r}') + if not top_level: + if newline: + result += ',\n' + else: + result += ', ' + return result + + return _format_dump(self) + + +class Leaf(NodeOrLeaf): + ''' + Leafs are basically tokens with a better API. Leafs exactly know where they + were defined and what text preceeds them. + ''' + __slots__ = ('value', 'line', 'column', 'prefix') + prefix: str + + def __init__(self, value: str, start_pos: Tuple[int, int], prefix: str = '') -> None: + self.value = value + ''' + :py:func:`str` The value of the current token. + ''' + self.start_pos = start_pos + self.prefix = prefix + ''' + :py:func:`str` Typically a mixture of whitespace and comments. Stuff + that is syntactically irrelevant for the syntax tree. + ''' + self.parent: Optional[BaseNode] = None + ''' + The parent :class:`BaseNode` of this leaf. + ''' + + @property + def start_pos(self) -> Tuple[int, int]: + return self.line, self.column + + @start_pos.setter + def start_pos(self, value: Tuple[int, int]) -> None: + self.line = value[0] + self.column = value[1] + + def get_start_pos_of_prefix(self): + previous_leaf = self.get_previous_leaf() + if previous_leaf is None: + lines = split_lines(self.prefix) + # + 1 is needed because split_lines always returns at least ['']. + return self.line - len(lines) + 1, 0 # It's the first leaf. + return previous_leaf.end_pos + + def get_first_leaf(self): + return self + + def get_last_leaf(self): + return self + + def get_code(self, include_prefix=True): + if include_prefix: + return self.prefix + self.value + else: + return self.value + + @property + def end_pos(self) -> Tuple[int, int]: + lines = split_lines(self.value) + end_pos_line = self.line + len(lines) - 1 + # Check for multiline token + if self.line == end_pos_line: + end_pos_column = self.column + len(lines[-1]) + else: + end_pos_column = len(lines[-1]) + return end_pos_line, end_pos_column + + def __repr__(self): + value = self.value + if not value: + value = self.type + return "<%s: %s>" % (type(self).__name__, value) + + +class TypedLeaf(Leaf): + __slots__ = ('type',) + + def __init__(self, type, value, start_pos, prefix=''): + super().__init__(value, start_pos, prefix) + self.type = type + + +class BaseNode(NodeOrLeaf): + """ + The super class for all nodes. + A node has children, a type and possibly a parent node. + """ + __slots__ = ('children',) + + def __init__(self, children: List[NodeOrLeaf]) -> None: + self.children = children + """ + A list of :class:`NodeOrLeaf` child nodes. + """ + self.parent: Optional[BaseNode] = None + ''' + The parent :class:`BaseNode` of this node. + None if this is the root node. + ''' + for child in children: + child.parent = self + + @property + def start_pos(self) -> Tuple[int, int]: + return self.children[0].start_pos + + def get_start_pos_of_prefix(self): + return self.children[0].get_start_pos_of_prefix() + + @property + def end_pos(self) -> Tuple[int, int]: + return self.children[-1].end_pos + + def _get_code_for_children(self, children, include_prefix): + if include_prefix: + return "".join(c.get_code() for c in children) + else: + first = children[0].get_code(include_prefix=False) + return first + "".join(c.get_code() for c in children[1:]) + + def get_code(self, include_prefix=True): + return self._get_code_for_children(self.children, include_prefix) + + def get_leaf_for_position(self, position, include_prefixes=False): + """ + Get the :py:class:`parso.tree.Leaf` at ``position`` + + :param tuple position: A position tuple, row, column. Rows start from 1 + :param bool include_prefixes: If ``False``, ``None`` will be returned if ``position`` falls + on whitespace or comments before a leaf + :return: :py:class:`parso.tree.Leaf` at ``position``, or ``None`` + """ + def binary_search(lower, upper): + if lower == upper: + element = self.children[lower] + if not include_prefixes and position < element.start_pos: + # We're on a prefix. + return None + # In case we have prefixes, a leaf always matches + try: + return element.get_leaf_for_position(position, include_prefixes) + except AttributeError: + return element + + index = int((lower + upper) / 2) + element = self.children[index] + if position <= element.end_pos: + return binary_search(lower, index) + else: + return binary_search(index + 1, upper) + + if not ((1, 0) <= position <= self.children[-1].end_pos): + raise ValueError('Please provide a position that exists within this node.') + return binary_search(0, len(self.children) - 1) + + def get_first_leaf(self): + return self.children[0].get_first_leaf() + + def get_last_leaf(self): + return self.children[-1].get_last_leaf() + + def __repr__(self): + code = self.get_code().replace('\n', ' ').replace('\r', ' ').strip() + return "<%s: %s@%s,%s>" % \ + (type(self).__name__, code, self.start_pos[0], self.start_pos[1]) + + +class Node(BaseNode): + """Concrete implementation for interior nodes.""" + __slots__ = ('type',) + + def __init__(self, type, children): + super().__init__(children) + self.type = type + + def __repr__(self): + return "%s(%s, %r)" % (self.__class__.__name__, self.type, self.children) + + +class ErrorNode(BaseNode): + """ + A node that contains valid nodes/leaves that we're follow by a token that + was invalid. This basically means that the leaf after this node is where + Python would mark a syntax error. + """ + __slots__ = () + type = 'error_node' + + +class ErrorLeaf(Leaf): + """ + A leaf that is either completely invalid in a language (like `$` in Python) + or is invalid at that position. Like the star in `1 +* 1`. + """ + __slots__ = ('token_type',) + type = 'error_leaf' + + def __init__(self, token_type, value, start_pos, prefix=''): + super().__init__(value, start_pos, prefix) + self.token_type = token_type + + def __repr__(self): + return "<%s: %s:%s, %s>" % \ + (type(self).__name__, self.token_type, repr(self.value), self.start_pos) diff --git a/shared/package-files/75/75e81de9d2da0c4bc458d1e6bd29d4657a2cd5cb08cdaaa347f8c0bad9bc25f2/mrecords.py b/shared/package-files/75/75e81de9d2da0c4bc458d1e6bd29d4657a2cd5cb08cdaaa347f8c0bad9bc25f2/mrecords.py new file mode 100644 index 0000000000000000000000000000000000000000..1e8103bcf63271a51122dd90fd1ba6f4c722502c --- /dev/null +++ b/shared/package-files/75/75e81de9d2da0c4bc458d1e6bd29d4657a2cd5cb08cdaaa347f8c0bad9bc25f2/mrecords.py @@ -0,0 +1,783 @@ +""":mod:`numpy.ma..mrecords` + +Defines the equivalent of :class:`numpy.recarrays` for masked arrays, +where fields can be accessed as attributes. +Note that :class:`numpy.ma.MaskedArray` already supports structured datatypes +and the masking of individual fields. + +.. moduleauthor:: Pierre Gerard-Marchant + +""" +# We should make sure that no field is called '_mask','mask','_fieldmask', +# or whatever restricted keywords. An idea would be to no bother in the +# first place, and then rename the invalid fields with a trailing +# underscore. Maybe we could just overload the parser function ? + +from numpy.ma import ( + MAError, MaskedArray, masked, nomask, masked_array, getdata, + getmaskarray, filled +) +import numpy.ma as ma +import warnings + +import numpy as np +from numpy import ( + bool_, dtype, ndarray, recarray, array as narray +) +from numpy.core.records import ( + fromarrays as recfromarrays, fromrecords as recfromrecords +) + +_byteorderconv = np.core.records._byteorderconv + + +_check_fill_value = ma.core._check_fill_value + + +__all__ = [ + 'MaskedRecords', 'mrecarray', 'fromarrays', 'fromrecords', + 'fromtextfile', 'addfield', +] + +reserved_fields = ['_data', '_mask', '_fieldmask', 'dtype'] + + +def _checknames(descr, names=None): + """ + Checks that field names ``descr`` are not reserved keywords. + + If this is the case, a default 'f%i' is substituted. If the argument + `names` is not None, updates the field names to valid names. + + """ + ndescr = len(descr) + default_names = ['f%i' % i for i in range(ndescr)] + if names is None: + new_names = default_names + else: + if isinstance(names, (tuple, list)): + new_names = names + elif isinstance(names, str): + new_names = names.split(',') + else: + raise NameError(f'illegal input names {names!r}') + nnames = len(new_names) + if nnames < ndescr: + new_names += default_names[nnames:] + ndescr = [] + for (n, d, t) in zip(new_names, default_names, descr.descr): + if n in reserved_fields: + if t[0] in reserved_fields: + ndescr.append((d, t[1])) + else: + ndescr.append(t) + else: + ndescr.append((n, t[1])) + return np.dtype(ndescr) + + +def _get_fieldmask(self): + mdescr = [(n, '|b1') for n in self.dtype.names] + fdmask = np.empty(self.shape, dtype=mdescr) + fdmask.flat = tuple([False] * len(mdescr)) + return fdmask + + +class MaskedRecords(MaskedArray): + """ + + Attributes + ---------- + _data : recarray + Underlying data, as a record array. + _mask : boolean array + Mask of the records. A record is masked when all its fields are + masked. + _fieldmask : boolean recarray + Record array of booleans, setting the mask of each individual field + of each record. + _fill_value : record + Filling values for each field. + + """ + + def __new__(cls, shape, dtype=None, buf=None, offset=0, strides=None, + formats=None, names=None, titles=None, + byteorder=None, aligned=False, + mask=nomask, hard_mask=False, fill_value=None, keep_mask=True, + copy=False, + **options): + + self = recarray.__new__(cls, shape, dtype=dtype, buf=buf, offset=offset, + strides=strides, formats=formats, names=names, + titles=titles, byteorder=byteorder, + aligned=aligned,) + + mdtype = ma.make_mask_descr(self.dtype) + if mask is nomask or not np.size(mask): + if not keep_mask: + self._mask = tuple([False] * len(mdtype)) + else: + mask = np.array(mask, copy=copy) + if mask.shape != self.shape: + (nd, nm) = (self.size, mask.size) + if nm == 1: + mask = np.resize(mask, self.shape) + elif nm == nd: + mask = np.reshape(mask, self.shape) + else: + msg = "Mask and data not compatible: data size is %i, " + \ + "mask size is %i." + raise MAError(msg % (nd, nm)) + if not keep_mask: + self.__setmask__(mask) + self._sharedmask = True + else: + if mask.dtype == mdtype: + _mask = mask + else: + _mask = np.array([tuple([m] * len(mdtype)) for m in mask], + dtype=mdtype) + self._mask = _mask + return self + + def __array_finalize__(self, obj): + # Make sure we have a _fieldmask by default + _mask = getattr(obj, '_mask', None) + if _mask is None: + objmask = getattr(obj, '_mask', nomask) + _dtype = ndarray.__getattribute__(self, 'dtype') + if objmask is nomask: + _mask = ma.make_mask_none(self.shape, dtype=_dtype) + else: + mdescr = ma.make_mask_descr(_dtype) + _mask = narray([tuple([m] * len(mdescr)) for m in objmask], + dtype=mdescr).view(recarray) + # Update some of the attributes + _dict = self.__dict__ + _dict.update(_mask=_mask) + self._update_from(obj) + if _dict['_baseclass'] == ndarray: + _dict['_baseclass'] = recarray + return + + @property + def _data(self): + """ + Returns the data as a recarray. + + """ + return ndarray.view(self, recarray) + + @property + def _fieldmask(self): + """ + Alias to mask. + + """ + return self._mask + + def __len__(self): + """ + Returns the length + + """ + # We have more than one record + if self.ndim: + return len(self._data) + # We have only one record: return the nb of fields + return len(self.dtype) + + def __getattribute__(self, attr): + try: + return object.__getattribute__(self, attr) + except AttributeError: + # attr must be a fieldname + pass + fielddict = ndarray.__getattribute__(self, 'dtype').fields + try: + res = fielddict[attr][:2] + except (TypeError, KeyError) as e: + raise AttributeError( + f'record array has no attribute {attr}') from e + # So far, so good + _localdict = ndarray.__getattribute__(self, '__dict__') + _data = ndarray.view(self, _localdict['_baseclass']) + obj = _data.getfield(*res) + if obj.dtype.names is not None: + raise NotImplementedError("MaskedRecords is currently limited to" + "simple records.") + # Get some special attributes + # Reset the object's mask + hasmasked = False + _mask = _localdict.get('_mask', None) + if _mask is not None: + try: + _mask = _mask[attr] + except IndexError: + # Couldn't find a mask: use the default (nomask) + pass + tp_len = len(_mask.dtype) + hasmasked = _mask.view((bool, ((tp_len,) if tp_len else ()))).any() + if (obj.shape or hasmasked): + obj = obj.view(MaskedArray) + obj._baseclass = ndarray + obj._isfield = True + obj._mask = _mask + # Reset the field values + _fill_value = _localdict.get('_fill_value', None) + if _fill_value is not None: + try: + obj._fill_value = _fill_value[attr] + except ValueError: + obj._fill_value = None + else: + obj = obj.item() + return obj + + def __setattr__(self, attr, val): + """ + Sets the attribute attr to the value val. + + """ + # Should we call __setmask__ first ? + if attr in ['mask', 'fieldmask']: + self.__setmask__(val) + return + # Create a shortcut (so that we don't have to call getattr all the time) + _localdict = object.__getattribute__(self, '__dict__') + # Check whether we're creating a new field + newattr = attr not in _localdict + try: + # Is attr a generic attribute ? + ret = object.__setattr__(self, attr, val) + except Exception: + # Not a generic attribute: exit if it's not a valid field + fielddict = ndarray.__getattribute__(self, 'dtype').fields or {} + optinfo = ndarray.__getattribute__(self, '_optinfo') or {} + if not (attr in fielddict or attr in optinfo): + raise + else: + # Get the list of names + fielddict = ndarray.__getattribute__(self, 'dtype').fields or {} + # Check the attribute + if attr not in fielddict: + return ret + if newattr: + # We just added this one or this setattr worked on an + # internal attribute. + try: + object.__delattr__(self, attr) + except Exception: + return ret + # Let's try to set the field + try: + res = fielddict[attr][:2] + except (TypeError, KeyError) as e: + raise AttributeError( + f'record array has no attribute {attr}') from e + + if val is masked: + _fill_value = _localdict['_fill_value'] + if _fill_value is not None: + dval = _localdict['_fill_value'][attr] + else: + dval = val + mval = True + else: + dval = filled(val) + mval = getmaskarray(val) + obj = ndarray.__getattribute__(self, '_data').setfield(dval, *res) + _localdict['_mask'].__setitem__(attr, mval) + return obj + + def __getitem__(self, indx): + """ + Returns all the fields sharing the same fieldname base. + + The fieldname base is either `_data` or `_mask`. + + """ + _localdict = self.__dict__ + _mask = ndarray.__getattribute__(self, '_mask') + _data = ndarray.view(self, _localdict['_baseclass']) + # We want a field + if isinstance(indx, str): + # Make sure _sharedmask is True to propagate back to _fieldmask + # Don't use _set_mask, there are some copies being made that + # break propagation Don't force the mask to nomask, that wreaks + # easy masking + obj = _data[indx].view(MaskedArray) + obj._mask = _mask[indx] + obj._sharedmask = True + fval = _localdict['_fill_value'] + if fval is not None: + obj._fill_value = fval[indx] + # Force to masked if the mask is True + if not obj.ndim and obj._mask: + return masked + return obj + # We want some elements. + # First, the data. + obj = np.array(_data[indx], copy=False).view(mrecarray) + obj._mask = np.array(_mask[indx], copy=False).view(recarray) + return obj + + def __setitem__(self, indx, value): + """ + Sets the given record to value. + + """ + MaskedArray.__setitem__(self, indx, value) + if isinstance(indx, str): + self._mask[indx] = ma.getmaskarray(value) + + def __str__(self): + """ + Calculates the string representation. + + """ + if self.size > 1: + mstr = [f"({','.join([str(i) for i in s])})" + for s in zip(*[getattr(self, f) for f in self.dtype.names])] + return f"[{', '.join(mstr)}]" + else: + mstr = [f"{','.join([str(i) for i in s])}" + for s in zip([getattr(self, f) for f in self.dtype.names])] + return f"({', '.join(mstr)})" + + def __repr__(self): + """ + Calculates the repr representation. + + """ + _names = self.dtype.names + fmt = "%%%is : %%s" % (max([len(n) for n in _names]) + 4,) + reprstr = [fmt % (f, getattr(self, f)) for f in self.dtype.names] + reprstr.insert(0, 'masked_records(') + reprstr.extend([fmt % (' fill_value', self.fill_value), + ' )']) + return str("\n".join(reprstr)) + + def view(self, dtype=None, type=None): + """ + Returns a view of the mrecarray. + + """ + # OK, basic copy-paste from MaskedArray.view. + if dtype is None: + if type is None: + output = ndarray.view(self) + else: + output = ndarray.view(self, type) + # Here again. + elif type is None: + try: + if issubclass(dtype, ndarray): + output = ndarray.view(self, dtype) + else: + output = ndarray.view(self, dtype) + # OK, there's the change + except TypeError: + dtype = np.dtype(dtype) + # we need to revert to MaskedArray, but keeping the possibility + # of subclasses (eg, TimeSeriesRecords), so we'll force a type + # set to the first parent + if dtype.fields is None: + basetype = self.__class__.__bases__[0] + output = self.__array__().view(dtype, basetype) + output._update_from(self) + else: + output = ndarray.view(self, dtype) + output._fill_value = None + else: + output = ndarray.view(self, dtype, type) + # Update the mask, just like in MaskedArray.view + if (getattr(output, '_mask', nomask) is not nomask): + mdtype = ma.make_mask_descr(output.dtype) + output._mask = self._mask.view(mdtype, ndarray) + output._mask.shape = output.shape + return output + + def harden_mask(self): + """ + Forces the mask to hard. + + """ + self._hardmask = True + + def soften_mask(self): + """ + Forces the mask to soft + + """ + self._hardmask = False + + def copy(self): + """ + Returns a copy of the masked record. + + """ + copied = self._data.copy().view(type(self)) + copied._mask = self._mask.copy() + return copied + + def tolist(self, fill_value=None): + """ + Return the data portion of the array as a list. + + Data items are converted to the nearest compatible Python type. + Masked values are converted to fill_value. If fill_value is None, + the corresponding entries in the output list will be ``None``. + + """ + if fill_value is not None: + return self.filled(fill_value).tolist() + result = narray(self.filled().tolist(), dtype=object) + mask = narray(self._mask.tolist()) + result[mask] = None + return result.tolist() + + def __getstate__(self): + """Return the internal state of the masked array. + + This is for pickling. + + """ + state = (1, + self.shape, + self.dtype, + self.flags.fnc, + self._data.tobytes(), + self._mask.tobytes(), + self._fill_value, + ) + return state + + def __setstate__(self, state): + """ + Restore the internal state of the masked array. + + This is for pickling. ``state`` is typically the output of the + ``__getstate__`` output, and is a 5-tuple: + + - class name + - a tuple giving the shape of the data + - a typecode for the data + - a binary string for the data + - a binary string for the mask. + + """ + (ver, shp, typ, isf, raw, msk, flv) = state + ndarray.__setstate__(self, (shp, typ, isf, raw)) + mdtype = dtype([(k, bool_) for (k, _) in self.dtype.descr]) + self.__dict__['_mask'].__setstate__((shp, mdtype, isf, msk)) + self.fill_value = flv + + def __reduce__(self): + """ + Return a 3-tuple for pickling a MaskedArray. + + """ + return (_mrreconstruct, + (self.__class__, self._baseclass, (0,), 'b',), + self.__getstate__()) + + +def _mrreconstruct(subtype, baseclass, baseshape, basetype,): + """ + Build a new MaskedArray from the information stored in a pickle. + + """ + _data = ndarray.__new__(baseclass, baseshape, basetype).view(subtype) + _mask = ndarray.__new__(ndarray, baseshape, 'b1') + return subtype.__new__(subtype, _data, mask=_mask, dtype=basetype,) + +mrecarray = MaskedRecords + + +############################################################################### +# Constructors # +############################################################################### + + +def fromarrays(arraylist, dtype=None, shape=None, formats=None, + names=None, titles=None, aligned=False, byteorder=None, + fill_value=None): + """ + Creates a mrecarray from a (flat) list of masked arrays. + + Parameters + ---------- + arraylist : sequence + A list of (masked) arrays. Each element of the sequence is first converted + to a masked array if needed. If a 2D array is passed as argument, it is + processed line by line + dtype : {None, dtype}, optional + Data type descriptor. + shape : {None, integer}, optional + Number of records. If None, shape is defined from the shape of the + first array in the list. + formats : {None, sequence}, optional + Sequence of formats for each individual field. If None, the formats will + be autodetected by inspecting the fields and selecting the highest dtype + possible. + names : {None, sequence}, optional + Sequence of the names of each field. + fill_value : {None, sequence}, optional + Sequence of data to be used as filling values. + + Notes + ----- + Lists of tuples should be preferred over lists of lists for faster processing. + + """ + datalist = [getdata(x) for x in arraylist] + masklist = [np.atleast_1d(getmaskarray(x)) for x in arraylist] + _array = recfromarrays(datalist, + dtype=dtype, shape=shape, formats=formats, + names=names, titles=titles, aligned=aligned, + byteorder=byteorder).view(mrecarray) + _array._mask.flat = list(zip(*masklist)) + if fill_value is not None: + _array.fill_value = fill_value + return _array + + +def fromrecords(reclist, dtype=None, shape=None, formats=None, names=None, + titles=None, aligned=False, byteorder=None, + fill_value=None, mask=nomask): + """ + Creates a MaskedRecords from a list of records. + + Parameters + ---------- + reclist : sequence + A list of records. Each element of the sequence is first converted + to a masked array if needed. If a 2D array is passed as argument, it is + processed line by line + dtype : {None, dtype}, optional + Data type descriptor. + shape : {None,int}, optional + Number of records. If None, ``shape`` is defined from the shape of the + first array in the list. + formats : {None, sequence}, optional + Sequence of formats for each individual field. If None, the formats will + be autodetected by inspecting the fields and selecting the highest dtype + possible. + names : {None, sequence}, optional + Sequence of the names of each field. + fill_value : {None, sequence}, optional + Sequence of data to be used as filling values. + mask : {nomask, sequence}, optional. + External mask to apply on the data. + + Notes + ----- + Lists of tuples should be preferred over lists of lists for faster processing. + + """ + # Grab the initial _fieldmask, if needed: + _mask = getattr(reclist, '_mask', None) + # Get the list of records. + if isinstance(reclist, ndarray): + # Make sure we don't have some hidden mask + if isinstance(reclist, MaskedArray): + reclist = reclist.filled().view(ndarray) + # Grab the initial dtype, just in case + if dtype is None: + dtype = reclist.dtype + reclist = reclist.tolist() + mrec = recfromrecords(reclist, dtype=dtype, shape=shape, formats=formats, + names=names, titles=titles, + aligned=aligned, byteorder=byteorder).view(mrecarray) + # Set the fill_value if needed + if fill_value is not None: + mrec.fill_value = fill_value + # Now, let's deal w/ the mask + if mask is not nomask: + mask = np.array(mask, copy=False) + maskrecordlength = len(mask.dtype) + if maskrecordlength: + mrec._mask.flat = mask + elif mask.ndim == 2: + mrec._mask.flat = [tuple(m) for m in mask] + else: + mrec.__setmask__(mask) + if _mask is not None: + mrec._mask[:] = _mask + return mrec + + +def _guessvartypes(arr): + """ + Tries to guess the dtypes of the str_ ndarray `arr`. + + Guesses by testing element-wise conversion. Returns a list of dtypes. + The array is first converted to ndarray. If the array is 2D, the test + is performed on the first line. An exception is raised if the file is + 3D or more. + + """ + vartypes = [] + arr = np.asarray(arr) + if arr.ndim == 2: + arr = arr[0] + elif arr.ndim > 2: + raise ValueError("The array should be 2D at most!") + # Start the conversion loop. + for f in arr: + try: + int(f) + except (ValueError, TypeError): + try: + float(f) + except (ValueError, TypeError): + try: + complex(f) + except (ValueError, TypeError): + vartypes.append(arr.dtype) + else: + vartypes.append(np.dtype(complex)) + else: + vartypes.append(np.dtype(float)) + else: + vartypes.append(np.dtype(int)) + return vartypes + + +def openfile(fname): + """ + Opens the file handle of file `fname`. + + """ + # A file handle + if hasattr(fname, 'readline'): + return fname + # Try to open the file and guess its type + try: + f = open(fname) + except FileNotFoundError as e: + raise FileNotFoundError(f"No such file: '{fname}'") from e + if f.readline()[:2] != "\\x": + f.seek(0, 0) + return f + f.close() + raise NotImplementedError("Wow, binary file") + + +def fromtextfile(fname, delimiter=None, commentchar='#', missingchar='', + varnames=None, vartypes=None, + *, delimitor=np._NoValue): # backwards compatibility + """ + Creates a mrecarray from data stored in the file `filename`. + + Parameters + ---------- + fname : {file name/handle} + Handle of an opened file. + delimiter : {None, string}, optional + Alphanumeric character used to separate columns in the file. + If None, any (group of) white spacestring(s) will be used. + commentchar : {'#', string}, optional + Alphanumeric character used to mark the start of a comment. + missingchar : {'', string}, optional + String indicating missing data, and used to create the masks. + varnames : {None, sequence}, optional + Sequence of the variable names. If None, a list will be created from + the first non empty line of the file. + vartypes : {None, sequence}, optional + Sequence of the variables dtypes. If None, it will be estimated from + the first non-commented line. + + + Ultra simple: the varnames are in the header, one line""" + if delimitor is not np._NoValue: + if delimiter is not None: + raise TypeError("fromtextfile() got multiple values for argument " + "'delimiter'") + # NumPy 1.22.0, 2021-09-23 + warnings.warn("The 'delimitor' keyword argument of " + "numpy.ma.mrecords.fromtextfile() is deprecated " + "since NumPy 1.22.0, use 'delimiter' instead.", + DeprecationWarning, stacklevel=2) + delimiter = delimitor + + # Try to open the file. + ftext = openfile(fname) + + # Get the first non-empty line as the varnames + while True: + line = ftext.readline() + firstline = line[:line.find(commentchar)].strip() + _varnames = firstline.split(delimiter) + if len(_varnames) > 1: + break + if varnames is None: + varnames = _varnames + + # Get the data. + _variables = masked_array([line.strip().split(delimiter) for line in ftext + if line[0] != commentchar and len(line) > 1]) + (_, nfields) = _variables.shape + ftext.close() + + # Try to guess the dtype. + if vartypes is None: + vartypes = _guessvartypes(_variables[0]) + else: + vartypes = [np.dtype(v) for v in vartypes] + if len(vartypes) != nfields: + msg = "Attempting to %i dtypes for %i fields!" + msg += " Reverting to default." + warnings.warn(msg % (len(vartypes), nfields), stacklevel=2) + vartypes = _guessvartypes(_variables[0]) + + # Construct the descriptor. + mdescr = [(n, f) for (n, f) in zip(varnames, vartypes)] + mfillv = [ma.default_fill_value(f) for f in vartypes] + + # Get the data and the mask. + # We just need a list of masked_arrays. It's easier to create it like that: + _mask = (_variables.T == missingchar) + _datalist = [masked_array(a, mask=m, dtype=t, fill_value=f) + for (a, m, t, f) in zip(_variables.T, _mask, vartypes, mfillv)] + + return fromarrays(_datalist, dtype=mdescr) + + +def addfield(mrecord, newfield, newfieldname=None): + """Adds a new field to the masked record array + + Uses `newfield` as data and `newfieldname` as name. If `newfieldname` + is None, the new field name is set to 'fi', where `i` is the number of + existing fields. + + """ + _data = mrecord._data + _mask = mrecord._mask + if newfieldname is None or newfieldname in reserved_fields: + newfieldname = 'f%i' % len(_data.dtype) + newfield = ma.array(newfield) + # Get the new data. + # Create a new empty recarray + newdtype = np.dtype(_data.dtype.descr + [(newfieldname, newfield.dtype)]) + newdata = recarray(_data.shape, newdtype) + # Add the existing field + [newdata.setfield(_data.getfield(*f), *f) + for f in _data.dtype.fields.values()] + # Add the new field + newdata.setfield(newfield._data, *newdata.dtype.fields[newfieldname]) + newdata = newdata.view(MaskedRecords) + # Get the new mask + # Create a new empty recarray + newmdtype = np.dtype([(n, bool_) for n in newdtype.names]) + newmask = recarray(_data.shape, newmdtype) + # Add the old masks + [newmask.setfield(_mask.getfield(*f), *f) + for f in _mask.dtype.fields.values()] + # Add the mask of the new field + newmask.setfield(getmaskarray(newfield), + *newmask.dtype.fields[newfieldname]) + newdata._mask = newmask + return newdata diff --git a/shared/package-files/75/75ec8de90781c22acb9f3efc46bdb82b3863d5f40d5a2b02f94f57461717410f/darwin-128x48 b/shared/package-files/75/75ec8de90781c22acb9f3efc46bdb82b3863d5f40d5a2b02f94f57461717410f/darwin-128x48 new file mode 100644 index 0000000000000000000000000000000000000000..844e2c9de87506b5b6aba4eaa5af2a80123aa473 Binary files /dev/null and b/shared/package-files/75/75ec8de90781c22acb9f3efc46bdb82b3863d5f40d5a2b02f94f57461717410f/darwin-128x48 differ diff --git a/shared/package-files/75/75ec8de90781c22acb9f3efc46bdb82b3863d5f40d5a2b02f94f57461717410f/xnuppc-128x48 b/shared/package-files/75/75ec8de90781c22acb9f3efc46bdb82b3863d5f40d5a2b02f94f57461717410f/xnuppc-128x48 new file mode 100644 index 0000000000000000000000000000000000000000..844e2c9de87506b5b6aba4eaa5af2a80123aa473 Binary files /dev/null and b/shared/package-files/75/75ec8de90781c22acb9f3efc46bdb82b3863d5f40d5a2b02f94f57461717410f/xnuppc-128x48 differ diff --git a/shared/package-files/75/75edd1f0f84d24ee654fda02a91c5ef1edbf484de30691ce9306cda82ae58234/udf.h b/shared/package-files/75/75edd1f0f84d24ee654fda02a91c5ef1edbf484de30691ce9306cda82ae58234/udf.h new file mode 100644 index 0000000000000000000000000000000000000000..d8c4e430e53d49a8fe7d237ffe7ba8feae5e452f --- /dev/null +++ b/shared/package-files/75/75edd1f0f84d24ee654fda02a91c5ef1edbf484de30691ce9306cda82ae58234/udf.h @@ -0,0 +1,81 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include "arrow/compute/exec.h" +#include "arrow/compute/function.h" +#include "arrow/compute/registry.h" +#include "arrow/python/platform.h" +#include "arrow/record_batch.h" +#include "arrow/util/iterator.h" + +#include "arrow/python/common.h" +#include "arrow/python/pyarrow.h" +#include "arrow/python/visibility.h" + +namespace arrow { + +namespace py { + +// TODO: TODO(ARROW-16041): UDF Options are not exposed to the Python +// users. This feature will be included when extending to provide advanced +// options for the users. +struct ARROW_PYTHON_EXPORT UdfOptions { + std::string func_name; + compute::Arity arity; + compute::FunctionDoc func_doc; + std::vector> input_types; + std::shared_ptr output_type; +}; + +/// \brief A context passed as the first argument of UDF functions. +struct ARROW_PYTHON_EXPORT UdfContext { + MemoryPool* pool; + int64_t batch_length; +}; + +using UdfWrapperCallback = std::function; + +/// \brief register a Scalar user-defined-function from Python +Status ARROW_PYTHON_EXPORT RegisterScalarFunction( + PyObject* user_function, UdfWrapperCallback wrapper, const UdfOptions& options, + compute::FunctionRegistry* registry = NULLPTR); + +/// \brief register a Table user-defined-function from Python +Status ARROW_PYTHON_EXPORT RegisterTabularFunction( + PyObject* user_function, UdfWrapperCallback wrapper, const UdfOptions& options, + compute::FunctionRegistry* registry = NULLPTR); + +/// \brief register a Aggregate user-defined-function from Python +Status ARROW_PYTHON_EXPORT RegisterAggregateFunction( + PyObject* user_function, UdfWrapperCallback wrapper, const UdfOptions& options, + compute::FunctionRegistry* registry = NULLPTR); + +/// \brief register a Vector user-defined-function from Python +Status ARROW_PYTHON_EXPORT RegisterVectorFunction( + PyObject* user_function, UdfWrapperCallback wrapper, const UdfOptions& options, + compute::FunctionRegistry* registry = NULLPTR); + +Result> ARROW_PYTHON_EXPORT +CallTabularFunction(const std::string& func_name, const std::vector& args, + compute::FunctionRegistry* registry = NULLPTR); + +} // namespace py + +} // namespace arrow diff --git a/shared/package-files/75/75ee39c1382e9b598d373054455c5b9f2204f535a1141e256a92564f449c55cc/PdfParser.py b/shared/package-files/75/75ee39c1382e9b598d373054455c5b9f2204f535a1141e256a92564f449c55cc/PdfParser.py new file mode 100644 index 0000000000000000000000000000000000000000..0144600066ff3b8690ce93f2fa9480d4246417d9 --- /dev/null +++ b/shared/package-files/75/75ee39c1382e9b598d373054455c5b9f2204f535a1141e256a92564f449c55cc/PdfParser.py @@ -0,0 +1,998 @@ +from __future__ import annotations + +import calendar +import codecs +import collections +import mmap +import os +import re +import time +import zlib + + +# see 7.9.2.2 Text String Type on page 86 and D.3 PDFDocEncoding Character Set +# on page 656 +def encode_text(s): + return codecs.BOM_UTF16_BE + s.encode("utf_16_be") + + +PDFDocEncoding = { + 0x16: "\u0017", + 0x18: "\u02D8", + 0x19: "\u02C7", + 0x1A: "\u02C6", + 0x1B: "\u02D9", + 0x1C: "\u02DD", + 0x1D: "\u02DB", + 0x1E: "\u02DA", + 0x1F: "\u02DC", + 0x80: "\u2022", + 0x81: "\u2020", + 0x82: "\u2021", + 0x83: "\u2026", + 0x84: "\u2014", + 0x85: "\u2013", + 0x86: "\u0192", + 0x87: "\u2044", + 0x88: "\u2039", + 0x89: "\u203A", + 0x8A: "\u2212", + 0x8B: "\u2030", + 0x8C: "\u201E", + 0x8D: "\u201C", + 0x8E: "\u201D", + 0x8F: "\u2018", + 0x90: "\u2019", + 0x91: "\u201A", + 0x92: "\u2122", + 0x93: "\uFB01", + 0x94: "\uFB02", + 0x95: "\u0141", + 0x96: "\u0152", + 0x97: "\u0160", + 0x98: "\u0178", + 0x99: "\u017D", + 0x9A: "\u0131", + 0x9B: "\u0142", + 0x9C: "\u0153", + 0x9D: "\u0161", + 0x9E: "\u017E", + 0xA0: "\u20AC", +} + + +def decode_text(b): + if b[: len(codecs.BOM_UTF16_BE)] == codecs.BOM_UTF16_BE: + return b[len(codecs.BOM_UTF16_BE) :].decode("utf_16_be") + else: + return "".join(PDFDocEncoding.get(byte, chr(byte)) for byte in b) + + +class PdfFormatError(RuntimeError): + """An error that probably indicates a syntactic or semantic error in the + PDF file structure""" + + pass + + +def check_format_condition(condition, error_message): + if not condition: + raise PdfFormatError(error_message) + + +class IndirectReference( + collections.namedtuple("IndirectReferenceTuple", ["object_id", "generation"]) +): + def __str__(self): + return f"{self.object_id} {self.generation} R" + + def __bytes__(self): + return self.__str__().encode("us-ascii") + + def __eq__(self, other): + return ( + other.__class__ is self.__class__ + and other.object_id == self.object_id + and other.generation == self.generation + ) + + def __ne__(self, other): + return not (self == other) + + def __hash__(self): + return hash((self.object_id, self.generation)) + + +class IndirectObjectDef(IndirectReference): + def __str__(self): + return f"{self.object_id} {self.generation} obj" + + +class XrefTable: + def __init__(self): + self.existing_entries = {} # object ID => (offset, generation) + self.new_entries = {} # object ID => (offset, generation) + self.deleted_entries = {0: 65536} # object ID => generation + self.reading_finished = False + + def __setitem__(self, key, value): + if self.reading_finished: + self.new_entries[key] = value + else: + self.existing_entries[key] = value + if key in self.deleted_entries: + del self.deleted_entries[key] + + def __getitem__(self, key): + try: + return self.new_entries[key] + except KeyError: + return self.existing_entries[key] + + def __delitem__(self, key): + if key in self.new_entries: + generation = self.new_entries[key][1] + 1 + del self.new_entries[key] + self.deleted_entries[key] = generation + elif key in self.existing_entries: + generation = self.existing_entries[key][1] + 1 + self.deleted_entries[key] = generation + elif key in self.deleted_entries: + generation = self.deleted_entries[key] + else: + msg = ( + "object ID " + str(key) + " cannot be deleted because it doesn't exist" + ) + raise IndexError(msg) + + def __contains__(self, key): + return key in self.existing_entries or key in self.new_entries + + def __len__(self): + return len( + set(self.existing_entries.keys()) + | set(self.new_entries.keys()) + | set(self.deleted_entries.keys()) + ) + + def keys(self): + return ( + set(self.existing_entries.keys()) - set(self.deleted_entries.keys()) + ) | set(self.new_entries.keys()) + + def write(self, f): + keys = sorted(set(self.new_entries.keys()) | set(self.deleted_entries.keys())) + deleted_keys = sorted(set(self.deleted_entries.keys())) + startxref = f.tell() + f.write(b"xref\n") + while keys: + # find a contiguous sequence of object IDs + prev = None + for index, key in enumerate(keys): + if prev is None or prev + 1 == key: + prev = key + else: + contiguous_keys = keys[:index] + keys = keys[index:] + break + else: + contiguous_keys = keys + keys = None + f.write(b"%d %d\n" % (contiguous_keys[0], len(contiguous_keys))) + for object_id in contiguous_keys: + if object_id in self.new_entries: + f.write(b"%010d %05d n \n" % self.new_entries[object_id]) + else: + this_deleted_object_id = deleted_keys.pop(0) + check_format_condition( + object_id == this_deleted_object_id, + f"expected the next deleted object ID to be {object_id}, " + f"instead found {this_deleted_object_id}", + ) + try: + next_in_linked_list = deleted_keys[0] + except IndexError: + next_in_linked_list = 0 + f.write( + b"%010d %05d f \n" + % (next_in_linked_list, self.deleted_entries[object_id]) + ) + return startxref + + +class PdfName: + def __init__(self, name): + if isinstance(name, PdfName): + self.name = name.name + elif isinstance(name, bytes): + self.name = name + else: + self.name = name.encode("us-ascii") + + def name_as_str(self): + return self.name.decode("us-ascii") + + def __eq__(self, other): + return ( + isinstance(other, PdfName) and other.name == self.name + ) or other == self.name + + def __hash__(self): + return hash(self.name) + + def __repr__(self): + return f"PdfName({repr(self.name)})" + + @classmethod + def from_pdf_stream(cls, data): + return cls(PdfParser.interpret_name(data)) + + allowed_chars = set(range(33, 127)) - {ord(c) for c in "#%/()<>[]{}"} + + def __bytes__(self): + result = bytearray(b"/") + for b in self.name: + if b in self.allowed_chars: + result.append(b) + else: + result.extend(b"#%02X" % b) + return bytes(result) + + +class PdfArray(list): + def __bytes__(self): + return b"[ " + b" ".join(pdf_repr(x) for x in self) + b" ]" + + +class PdfDict(collections.UserDict): + def __setattr__(self, key, value): + if key == "data": + collections.UserDict.__setattr__(self, key, value) + else: + self[key.encode("us-ascii")] = value + + def __getattr__(self, key): + try: + value = self[key.encode("us-ascii")] + except KeyError as e: + raise AttributeError(key) from e + if isinstance(value, bytes): + value = decode_text(value) + if key.endswith("Date"): + if value.startswith("D:"): + value = value[2:] + + relationship = "Z" + if len(value) > 17: + relationship = value[14] + offset = int(value[15:17]) * 60 + if len(value) > 20: + offset += int(value[18:20]) + + format = "%Y%m%d%H%M%S"[: len(value) - 2] + value = time.strptime(value[: len(format) + 2], format) + if relationship in ["+", "-"]: + offset *= 60 + if relationship == "+": + offset *= -1 + value = time.gmtime(calendar.timegm(value) + offset) + return value + + def __bytes__(self): + out = bytearray(b"<<") + for key, value in self.items(): + if value is None: + continue + value = pdf_repr(value) + out.extend(b"\n") + out.extend(bytes(PdfName(key))) + out.extend(b" ") + out.extend(value) + out.extend(b"\n>>") + return bytes(out) + + +class PdfBinary: + def __init__(self, data): + self.data = data + + def __bytes__(self): + return b"<%s>" % b"".join(b"%02X" % b for b in self.data) + + +class PdfStream: + def __init__(self, dictionary, buf): + self.dictionary = dictionary + self.buf = buf + + def decode(self): + try: + filter = self.dictionary.Filter + except AttributeError: + return self.buf + if filter == b"FlateDecode": + try: + expected_length = self.dictionary.DL + except AttributeError: + expected_length = self.dictionary.Length + return zlib.decompress(self.buf, bufsize=int(expected_length)) + else: + msg = f"stream filter {repr(self.dictionary.Filter)} unknown/unsupported" + raise NotImplementedError(msg) + + +def pdf_repr(x): + if x is True: + return b"true" + elif x is False: + return b"false" + elif x is None: + return b"null" + elif isinstance(x, (PdfName, PdfDict, PdfArray, PdfBinary)): + return bytes(x) + elif isinstance(x, (int, float)): + return str(x).encode("us-ascii") + elif isinstance(x, time.struct_time): + return b"(D:" + time.strftime("%Y%m%d%H%M%SZ", x).encode("us-ascii") + b")" + elif isinstance(x, dict): + return bytes(PdfDict(x)) + elif isinstance(x, list): + return bytes(PdfArray(x)) + elif isinstance(x, str): + return pdf_repr(encode_text(x)) + elif isinstance(x, bytes): + # XXX escape more chars? handle binary garbage + x = x.replace(b"\\", b"\\\\") + x = x.replace(b"(", b"\\(") + x = x.replace(b")", b"\\)") + return b"(" + x + b")" + else: + return bytes(x) + + +class PdfParser: + """Based on + https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/PDF32000_2008.pdf + Supports PDF up to 1.4 + """ + + def __init__(self, filename=None, f=None, buf=None, start_offset=0, mode="rb"): + if buf and f: + msg = "specify buf or f or filename, but not both buf and f" + raise RuntimeError(msg) + self.filename = filename + self.buf = buf + self.f = f + self.start_offset = start_offset + self.should_close_buf = False + self.should_close_file = False + if filename is not None and f is None: + self.f = f = open(filename, mode) + self.should_close_file = True + if f is not None: + self.buf = buf = self.get_buf_from_file(f) + self.should_close_buf = True + if not filename and hasattr(f, "name"): + self.filename = f.name + self.cached_objects = {} + if buf: + self.read_pdf_info() + else: + self.file_size_total = self.file_size_this = 0 + self.root = PdfDict() + self.root_ref = None + self.info = PdfDict() + self.info_ref = None + self.page_tree_root = {} + self.pages = [] + self.orig_pages = [] + self.pages_ref = None + self.last_xref_section_offset = None + self.trailer_dict = {} + self.xref_table = XrefTable() + self.xref_table.reading_finished = True + if f: + self.seek_end() + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + return False # do not suppress exceptions + + def start_writing(self): + self.close_buf() + self.seek_end() + + def close_buf(self): + try: + self.buf.close() + except AttributeError: + pass + self.buf = None + + def close(self): + if self.should_close_buf: + self.close_buf() + if self.f is not None and self.should_close_file: + self.f.close() + self.f = None + + def seek_end(self): + self.f.seek(0, os.SEEK_END) + + def write_header(self): + self.f.write(b"%PDF-1.4\n") + + def write_comment(self, s): + self.f.write(f"% {s}\n".encode()) + + def write_catalog(self): + self.del_root() + self.root_ref = self.next_object_id(self.f.tell()) + self.pages_ref = self.next_object_id(0) + self.rewrite_pages() + self.write_obj(self.root_ref, Type=PdfName(b"Catalog"), Pages=self.pages_ref) + self.write_obj( + self.pages_ref, + Type=PdfName(b"Pages"), + Count=len(self.pages), + Kids=self.pages, + ) + return self.root_ref + + def rewrite_pages(self): + pages_tree_nodes_to_delete = [] + for i, page_ref in enumerate(self.orig_pages): + page_info = self.cached_objects[page_ref] + del self.xref_table[page_ref.object_id] + pages_tree_nodes_to_delete.append(page_info[PdfName(b"Parent")]) + if page_ref not in self.pages: + # the page has been deleted + continue + # make dict keys into strings for passing to write_page + stringified_page_info = {} + for key, value in page_info.items(): + # key should be a PdfName + stringified_page_info[key.name_as_str()] = value + stringified_page_info["Parent"] = self.pages_ref + new_page_ref = self.write_page(None, **stringified_page_info) + for j, cur_page_ref in enumerate(self.pages): + if cur_page_ref == page_ref: + # replace the page reference with the new one + self.pages[j] = new_page_ref + # delete redundant Pages tree nodes from xref table + for pages_tree_node_ref in pages_tree_nodes_to_delete: + while pages_tree_node_ref: + pages_tree_node = self.cached_objects[pages_tree_node_ref] + if pages_tree_node_ref.object_id in self.xref_table: + del self.xref_table[pages_tree_node_ref.object_id] + pages_tree_node_ref = pages_tree_node.get(b"Parent", None) + self.orig_pages = [] + + def write_xref_and_trailer(self, new_root_ref=None): + if new_root_ref: + self.del_root() + self.root_ref = new_root_ref + if self.info: + self.info_ref = self.write_obj(None, self.info) + start_xref = self.xref_table.write(self.f) + num_entries = len(self.xref_table) + trailer_dict = {b"Root": self.root_ref, b"Size": num_entries} + if self.last_xref_section_offset is not None: + trailer_dict[b"Prev"] = self.last_xref_section_offset + if self.info: + trailer_dict[b"Info"] = self.info_ref + self.last_xref_section_offset = start_xref + self.f.write( + b"trailer\n" + + bytes(PdfDict(trailer_dict)) + + b"\nstartxref\n%d\n%%%%EOF" % start_xref + ) + + def write_page(self, ref, *objs, **dict_obj): + if isinstance(ref, int): + ref = self.pages[ref] + if "Type" not in dict_obj: + dict_obj["Type"] = PdfName(b"Page") + if "Parent" not in dict_obj: + dict_obj["Parent"] = self.pages_ref + return self.write_obj(ref, *objs, **dict_obj) + + def write_obj(self, ref, *objs, **dict_obj): + f = self.f + if ref is None: + ref = self.next_object_id(f.tell()) + else: + self.xref_table[ref.object_id] = (f.tell(), ref.generation) + f.write(bytes(IndirectObjectDef(*ref))) + stream = dict_obj.pop("stream", None) + if stream is not None: + dict_obj["Length"] = len(stream) + if dict_obj: + f.write(pdf_repr(dict_obj)) + for obj in objs: + f.write(pdf_repr(obj)) + if stream is not None: + f.write(b"stream\n") + f.write(stream) + f.write(b"\nendstream\n") + f.write(b"endobj\n") + return ref + + def del_root(self): + if self.root_ref is None: + return + del self.xref_table[self.root_ref.object_id] + del self.xref_table[self.root[b"Pages"].object_id] + + @staticmethod + def get_buf_from_file(f): + if hasattr(f, "getbuffer"): + return f.getbuffer() + elif hasattr(f, "getvalue"): + return f.getvalue() + else: + try: + return mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) + except ValueError: # cannot mmap an empty file + return b"" + + def read_pdf_info(self): + self.file_size_total = len(self.buf) + self.file_size_this = self.file_size_total - self.start_offset + self.read_trailer() + self.root_ref = self.trailer_dict[b"Root"] + self.info_ref = self.trailer_dict.get(b"Info", None) + self.root = PdfDict(self.read_indirect(self.root_ref)) + if self.info_ref is None: + self.info = PdfDict() + else: + self.info = PdfDict(self.read_indirect(self.info_ref)) + check_format_condition(b"Type" in self.root, "/Type missing in Root") + check_format_condition( + self.root[b"Type"] == b"Catalog", "/Type in Root is not /Catalog" + ) + check_format_condition(b"Pages" in self.root, "/Pages missing in Root") + check_format_condition( + isinstance(self.root[b"Pages"], IndirectReference), + "/Pages in Root is not an indirect reference", + ) + self.pages_ref = self.root[b"Pages"] + self.page_tree_root = self.read_indirect(self.pages_ref) + self.pages = self.linearize_page_tree(self.page_tree_root) + # save the original list of page references + # in case the user modifies, adds or deletes some pages + # and we need to rewrite the pages and their list + self.orig_pages = self.pages[:] + + def next_object_id(self, offset=None): + try: + # TODO: support reuse of deleted objects + reference = IndirectReference(max(self.xref_table.keys()) + 1, 0) + except ValueError: + reference = IndirectReference(1, 0) + if offset is not None: + self.xref_table[reference.object_id] = (offset, 0) + return reference + + delimiter = rb"[][()<>{}/%]" + delimiter_or_ws = rb"[][()<>{}/%\000\011\012\014\015\040]" + whitespace = rb"[\000\011\012\014\015\040]" + whitespace_or_hex = rb"[\000\011\012\014\015\0400-9a-fA-F]" + whitespace_optional = whitespace + b"*" + whitespace_mandatory = whitespace + b"+" + # No "\012" aka "\n" or "\015" aka "\r": + whitespace_optional_no_nl = rb"[\000\011\014\040]*" + newline_only = rb"[\r\n]+" + newline = whitespace_optional_no_nl + newline_only + whitespace_optional_no_nl + re_trailer_end = re.compile( + whitespace_mandatory + + rb"trailer" + + whitespace_optional + + rb"<<(.*>>)" + + newline + + rb"startxref" + + newline + + rb"([0-9]+)" + + newline + + rb"%%EOF" + + whitespace_optional + + rb"$", + re.DOTALL, + ) + re_trailer_prev = re.compile( + whitespace_optional + + rb"trailer" + + whitespace_optional + + rb"<<(.*?>>)" + + newline + + rb"startxref" + + newline + + rb"([0-9]+)" + + newline + + rb"%%EOF" + + whitespace_optional, + re.DOTALL, + ) + + def read_trailer(self): + search_start_offset = len(self.buf) - 16384 + if search_start_offset < self.start_offset: + search_start_offset = self.start_offset + m = self.re_trailer_end.search(self.buf, search_start_offset) + check_format_condition(m, "trailer end not found") + # make sure we found the LAST trailer + last_match = m + while m: + last_match = m + m = self.re_trailer_end.search(self.buf, m.start() + 16) + if not m: + m = last_match + trailer_data = m.group(1) + self.last_xref_section_offset = int(m.group(2)) + self.trailer_dict = self.interpret_trailer(trailer_data) + self.xref_table = XrefTable() + self.read_xref_table(xref_section_offset=self.last_xref_section_offset) + if b"Prev" in self.trailer_dict: + self.read_prev_trailer(self.trailer_dict[b"Prev"]) + + def read_prev_trailer(self, xref_section_offset): + trailer_offset = self.read_xref_table(xref_section_offset=xref_section_offset) + m = self.re_trailer_prev.search( + self.buf[trailer_offset : trailer_offset + 16384] + ) + check_format_condition(m, "previous trailer not found") + trailer_data = m.group(1) + check_format_condition( + int(m.group(2)) == xref_section_offset, + "xref section offset in previous trailer doesn't match what was expected", + ) + trailer_dict = self.interpret_trailer(trailer_data) + if b"Prev" in trailer_dict: + self.read_prev_trailer(trailer_dict[b"Prev"]) + + re_whitespace_optional = re.compile(whitespace_optional) + re_name = re.compile( + whitespace_optional + + rb"/([!-$&'*-.0-;=?-Z\\^-z|~]+)(?=" + + delimiter_or_ws + + rb")" + ) + re_dict_start = re.compile(whitespace_optional + rb"<<") + re_dict_end = re.compile(whitespace_optional + rb">>" + whitespace_optional) + + @classmethod + def interpret_trailer(cls, trailer_data): + trailer = {} + offset = 0 + while True: + m = cls.re_name.match(trailer_data, offset) + if not m: + m = cls.re_dict_end.match(trailer_data, offset) + check_format_condition( + m and m.end() == len(trailer_data), + "name not found in trailer, remaining data: " + + repr(trailer_data[offset:]), + ) + break + key = cls.interpret_name(m.group(1)) + value, offset = cls.get_value(trailer_data, m.end()) + trailer[key] = value + check_format_condition( + b"Size" in trailer and isinstance(trailer[b"Size"], int), + "/Size not in trailer or not an integer", + ) + check_format_condition( + b"Root" in trailer and isinstance(trailer[b"Root"], IndirectReference), + "/Root not in trailer or not an indirect reference", + ) + return trailer + + re_hashes_in_name = re.compile(rb"([^#]*)(#([0-9a-fA-F]{2}))?") + + @classmethod + def interpret_name(cls, raw, as_text=False): + name = b"" + for m in cls.re_hashes_in_name.finditer(raw): + if m.group(3): + name += m.group(1) + bytearray.fromhex(m.group(3).decode("us-ascii")) + else: + name += m.group(1) + if as_text: + return name.decode("utf-8") + else: + return bytes(name) + + re_null = re.compile(whitespace_optional + rb"null(?=" + delimiter_or_ws + rb")") + re_true = re.compile(whitespace_optional + rb"true(?=" + delimiter_or_ws + rb")") + re_false = re.compile(whitespace_optional + rb"false(?=" + delimiter_or_ws + rb")") + re_int = re.compile( + whitespace_optional + rb"([-+]?[0-9]+)(?=" + delimiter_or_ws + rb")" + ) + re_real = re.compile( + whitespace_optional + + rb"([-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+))(?=" + + delimiter_or_ws + + rb")" + ) + re_array_start = re.compile(whitespace_optional + rb"\[") + re_array_end = re.compile(whitespace_optional + rb"]") + re_string_hex = re.compile( + whitespace_optional + rb"<(" + whitespace_or_hex + rb"*)>" + ) + re_string_lit = re.compile(whitespace_optional + rb"\(") + re_indirect_reference = re.compile( + whitespace_optional + + rb"([-+]?[0-9]+)" + + whitespace_mandatory + + rb"([-+]?[0-9]+)" + + whitespace_mandatory + + rb"R(?=" + + delimiter_or_ws + + rb")" + ) + re_indirect_def_start = re.compile( + whitespace_optional + + rb"([-+]?[0-9]+)" + + whitespace_mandatory + + rb"([-+]?[0-9]+)" + + whitespace_mandatory + + rb"obj(?=" + + delimiter_or_ws + + rb")" + ) + re_indirect_def_end = re.compile( + whitespace_optional + rb"endobj(?=" + delimiter_or_ws + rb")" + ) + re_comment = re.compile( + rb"(" + whitespace_optional + rb"%[^\r\n]*" + newline + rb")*" + ) + re_stream_start = re.compile(whitespace_optional + rb"stream\r?\n") + re_stream_end = re.compile( + whitespace_optional + rb"endstream(?=" + delimiter_or_ws + rb")" + ) + + @classmethod + def get_value(cls, data, offset, expect_indirect=None, max_nesting=-1): + if max_nesting == 0: + return None, None + m = cls.re_comment.match(data, offset) + if m: + offset = m.end() + m = cls.re_indirect_def_start.match(data, offset) + if m: + check_format_condition( + int(m.group(1)) > 0, + "indirect object definition: object ID must be greater than 0", + ) + check_format_condition( + int(m.group(2)) >= 0, + "indirect object definition: generation must be non-negative", + ) + check_format_condition( + expect_indirect is None + or expect_indirect + == IndirectReference(int(m.group(1)), int(m.group(2))), + "indirect object definition different than expected", + ) + object, offset = cls.get_value(data, m.end(), max_nesting=max_nesting - 1) + if offset is None: + return object, None + m = cls.re_indirect_def_end.match(data, offset) + check_format_condition(m, "indirect object definition end not found") + return object, m.end() + check_format_condition( + not expect_indirect, "indirect object definition not found" + ) + m = cls.re_indirect_reference.match(data, offset) + if m: + check_format_condition( + int(m.group(1)) > 0, + "indirect object reference: object ID must be greater than 0", + ) + check_format_condition( + int(m.group(2)) >= 0, + "indirect object reference: generation must be non-negative", + ) + return IndirectReference(int(m.group(1)), int(m.group(2))), m.end() + m = cls.re_dict_start.match(data, offset) + if m: + offset = m.end() + result = {} + m = cls.re_dict_end.match(data, offset) + while not m: + key, offset = cls.get_value(data, offset, max_nesting=max_nesting - 1) + if offset is None: + return result, None + value, offset = cls.get_value(data, offset, max_nesting=max_nesting - 1) + result[key] = value + if offset is None: + return result, None + m = cls.re_dict_end.match(data, offset) + offset = m.end() + m = cls.re_stream_start.match(data, offset) + if m: + try: + stream_len = int(result[b"Length"]) + except (TypeError, KeyError, ValueError) as e: + msg = "bad or missing Length in stream dict (%r)" % result.get( + b"Length", None + ) + raise PdfFormatError(msg) from e + stream_data = data[m.end() : m.end() + stream_len] + m = cls.re_stream_end.match(data, m.end() + stream_len) + check_format_condition(m, "stream end not found") + offset = m.end() + result = PdfStream(PdfDict(result), stream_data) + else: + result = PdfDict(result) + return result, offset + m = cls.re_array_start.match(data, offset) + if m: + offset = m.end() + result = [] + m = cls.re_array_end.match(data, offset) + while not m: + value, offset = cls.get_value(data, offset, max_nesting=max_nesting - 1) + result.append(value) + if offset is None: + return result, None + m = cls.re_array_end.match(data, offset) + return result, m.end() + m = cls.re_null.match(data, offset) + if m: + return None, m.end() + m = cls.re_true.match(data, offset) + if m: + return True, m.end() + m = cls.re_false.match(data, offset) + if m: + return False, m.end() + m = cls.re_name.match(data, offset) + if m: + return PdfName(cls.interpret_name(m.group(1))), m.end() + m = cls.re_int.match(data, offset) + if m: + return int(m.group(1)), m.end() + m = cls.re_real.match(data, offset) + if m: + # XXX Decimal instead of float??? + return float(m.group(1)), m.end() + m = cls.re_string_hex.match(data, offset) + if m: + # filter out whitespace + hex_string = bytearray( + b for b in m.group(1) if b in b"0123456789abcdefABCDEF" + ) + if len(hex_string) % 2 == 1: + # append a 0 if the length is not even - yes, at the end + hex_string.append(ord(b"0")) + return bytearray.fromhex(hex_string.decode("us-ascii")), m.end() + m = cls.re_string_lit.match(data, offset) + if m: + return cls.get_literal_string(data, m.end()) + # return None, offset # fallback (only for debugging) + msg = "unrecognized object: " + repr(data[offset : offset + 32]) + raise PdfFormatError(msg) + + re_lit_str_token = re.compile( + rb"(\\[nrtbf()\\])|(\\[0-9]{1,3})|(\\(\r\n|\r|\n))|(\r\n|\r|\n)|(\()|(\))" + ) + escaped_chars = { + b"n": b"\n", + b"r": b"\r", + b"t": b"\t", + b"b": b"\b", + b"f": b"\f", + b"(": b"(", + b")": b")", + b"\\": b"\\", + ord(b"n"): b"\n", + ord(b"r"): b"\r", + ord(b"t"): b"\t", + ord(b"b"): b"\b", + ord(b"f"): b"\f", + ord(b"("): b"(", + ord(b")"): b")", + ord(b"\\"): b"\\", + } + + @classmethod + def get_literal_string(cls, data, offset): + nesting_depth = 0 + result = bytearray() + for m in cls.re_lit_str_token.finditer(data, offset): + result.extend(data[offset : m.start()]) + if m.group(1): + result.extend(cls.escaped_chars[m.group(1)[1]]) + elif m.group(2): + result.append(int(m.group(2)[1:], 8)) + elif m.group(3): + pass + elif m.group(5): + result.extend(b"\n") + elif m.group(6): + result.extend(b"(") + nesting_depth += 1 + elif m.group(7): + if nesting_depth == 0: + return bytes(result), m.end() + result.extend(b")") + nesting_depth -= 1 + offset = m.end() + msg = "unfinished literal string" + raise PdfFormatError(msg) + + re_xref_section_start = re.compile(whitespace_optional + rb"xref" + newline) + re_xref_subsection_start = re.compile( + whitespace_optional + + rb"([0-9]+)" + + whitespace_mandatory + + rb"([0-9]+)" + + whitespace_optional + + newline_only + ) + re_xref_entry = re.compile(rb"([0-9]{10}) ([0-9]{5}) ([fn])( \r| \n|\r\n)") + + def read_xref_table(self, xref_section_offset): + subsection_found = False + m = self.re_xref_section_start.match( + self.buf, xref_section_offset + self.start_offset + ) + check_format_condition(m, "xref section start not found") + offset = m.end() + while True: + m = self.re_xref_subsection_start.match(self.buf, offset) + if not m: + check_format_condition( + subsection_found, "xref subsection start not found" + ) + break + subsection_found = True + offset = m.end() + first_object = int(m.group(1)) + num_objects = int(m.group(2)) + for i in range(first_object, first_object + num_objects): + m = self.re_xref_entry.match(self.buf, offset) + check_format_condition(m, "xref entry not found") + offset = m.end() + is_free = m.group(3) == b"f" + if not is_free: + generation = int(m.group(2)) + new_entry = (int(m.group(1)), generation) + if i not in self.xref_table: + self.xref_table[i] = new_entry + return offset + + def read_indirect(self, ref, max_nesting=-1): + offset, generation = self.xref_table[ref[0]] + check_format_condition( + generation == ref[1], + f"expected to find generation {ref[1]} for object ID {ref[0]} in xref " + f"table, instead found generation {generation} at offset {offset}", + ) + value = self.get_value( + self.buf, + offset + self.start_offset, + expect_indirect=IndirectReference(*ref), + max_nesting=max_nesting, + )[0] + self.cached_objects[ref] = value + return value + + def linearize_page_tree(self, node=None): + if node is None: + node = self.page_tree_root + check_format_condition( + node[b"Type"] == b"Pages", "/Type of page tree node is not /Pages" + ) + pages = [] + for kid in node[b"Kids"]: + kid_object = self.read_indirect(kid) + if kid_object[b"Type"] == b"Page": + pages.append(kid) + else: + pages.extend(self.linearize_page_tree(node=kid_object)) + return pages diff --git a/shared/package-files/75/75ee9e626dc3fd87445b5ac428e2044bf684caf6e3a9133df08ebb97c4061955/decorators.py b/shared/package-files/75/75ee9e626dc3fd87445b5ac428e2044bf684caf6e3a9133df08ebb97c4061955/decorators.py new file mode 100644 index 0000000000000000000000000000000000000000..1da77d2be6b8351ad16ef142f7add51f316e58ef --- /dev/null +++ b/shared/package-files/75/75ee9e626dc3fd87445b5ac428e2044bf684caf6e3a9133df08ebb97c4061955/decorators.py @@ -0,0 +1,238 @@ +""" +SymPy core decorators. + +The purpose of this module is to expose decorators without any other +dependencies, so that they can be easily imported anywhere in sympy/core. +""" + +from functools import wraps +from .sympify import SympifyError, sympify + + +def _sympifyit(arg, retval=None): + """ + decorator to smartly _sympify function arguments + + Explanation + =========== + + @_sympifyit('other', NotImplemented) + def add(self, other): + ... + + In add, other can be thought of as already being a SymPy object. + + If it is not, the code is likely to catch an exception, then other will + be explicitly _sympified, and the whole code restarted. + + if _sympify(arg) fails, NotImplemented will be returned + + See also + ======== + + __sympifyit + """ + def deco(func): + return __sympifyit(func, arg, retval) + + return deco + + +def __sympifyit(func, arg, retval=None): + """Decorator to _sympify `arg` argument for function `func`. + + Do not use directly -- use _sympifyit instead. + """ + + # we support f(a,b) only + if not func.__code__.co_argcount: + raise LookupError("func not found") + # only b is _sympified + assert func.__code__.co_varnames[1] == arg + if retval is None: + @wraps(func) + def __sympifyit_wrapper(a, b): + return func(a, sympify(b, strict=True)) + + else: + @wraps(func) + def __sympifyit_wrapper(a, b): + try: + # If an external class has _op_priority, it knows how to deal + # with SymPy objects. Otherwise, it must be converted. + if not hasattr(b, '_op_priority'): + b = sympify(b, strict=True) + return func(a, b) + except SympifyError: + return retval + + return __sympifyit_wrapper + + +def call_highest_priority(method_name): + """A decorator for binary special methods to handle _op_priority. + + Explanation + =========== + + Binary special methods in Expr and its subclasses use a special attribute + '_op_priority' to determine whose special method will be called to + handle the operation. In general, the object having the highest value of + '_op_priority' will handle the operation. Expr and subclasses that define + custom binary special methods (__mul__, etc.) should decorate those + methods with this decorator to add the priority logic. + + The ``method_name`` argument is the name of the method of the other class + that will be called. Use this decorator in the following manner:: + + # Call other.__rmul__ if other._op_priority > self._op_priority + @call_highest_priority('__rmul__') + def __mul__(self, other): + ... + + # Call other.__mul__ if other._op_priority > self._op_priority + @call_highest_priority('__mul__') + def __rmul__(self, other): + ... + """ + def priority_decorator(func): + @wraps(func) + def binary_op_wrapper(self, other): + if hasattr(other, '_op_priority'): + if other._op_priority > self._op_priority: + f = getattr(other, method_name, None) + if f is not None: + return f(self) + return func(self, other) + return binary_op_wrapper + return priority_decorator + + +def sympify_method_args(cls): + '''Decorator for a class with methods that sympify arguments. + + Explanation + =========== + + The sympify_method_args decorator is to be used with the sympify_return + decorator for automatic sympification of method arguments. This is + intended for the common idiom of writing a class like : + + Examples + ======== + + >>> from sympy import Basic, SympifyError, S + >>> from sympy.core.sympify import _sympify + + >>> class MyTuple(Basic): + ... def __add__(self, other): + ... try: + ... other = _sympify(other) + ... except SympifyError: + ... return NotImplemented + ... if not isinstance(other, MyTuple): + ... return NotImplemented + ... return MyTuple(*(self.args + other.args)) + + >>> MyTuple(S(1), S(2)) + MyTuple(S(3), S(4)) + MyTuple(1, 2, 3, 4) + + In the above it is important that we return NotImplemented when other is + not sympifiable and also when the sympified result is not of the expected + type. This allows the MyTuple class to be used cooperatively with other + classes that overload __add__ and want to do something else in combination + with instance of Tuple. + + Using this decorator the above can be written as + + >>> from sympy.core.decorators import sympify_method_args, sympify_return + + >>> @sympify_method_args + ... class MyTuple(Basic): + ... @sympify_return([('other', 'MyTuple')], NotImplemented) + ... def __add__(self, other): + ... return MyTuple(*(self.args + other.args)) + + >>> MyTuple(S(1), S(2)) + MyTuple(S(3), S(4)) + MyTuple(1, 2, 3, 4) + + The idea here is that the decorators take care of the boiler-plate code + for making this happen in each method that potentially needs to accept + unsympified arguments. Then the body of e.g. the __add__ method can be + written without needing to worry about calling _sympify or checking the + type of the resulting object. + + The parameters for sympify_return are a list of tuples of the form + (parameter_name, expected_type) and the value to return (e.g. + NotImplemented). The expected_type parameter can be a type e.g. Tuple or a + string 'Tuple'. Using a string is useful for specifying a Type within its + class body (as in the above example). + + Notes: Currently sympify_return only works for methods that take a single + argument (not including self). Specifying an expected_type as a string + only works for the class in which the method is defined. + ''' + # Extract the wrapped methods from each of the wrapper objects created by + # the sympify_return decorator. Doing this here allows us to provide the + # cls argument which is used for forward string referencing. + for attrname, obj in cls.__dict__.items(): + if isinstance(obj, _SympifyWrapper): + setattr(cls, attrname, obj.make_wrapped(cls)) + return cls + + +def sympify_return(*args): + '''Function/method decorator to sympify arguments automatically + + See the docstring of sympify_method_args for explanation. + ''' + # Store a wrapper object for the decorated method + def wrapper(func): + return _SympifyWrapper(func, args) + return wrapper + + +class _SympifyWrapper: + '''Internal class used by sympify_return and sympify_method_args''' + + def __init__(self, func, args): + self.func = func + self.args = args + + def make_wrapped(self, cls): + func = self.func + parameters, retval = self.args + + # XXX: Handle more than one parameter? + [(parameter, expectedcls)] = parameters + + # Handle forward references to the current class using strings + if expectedcls == cls.__name__: + expectedcls = cls + + # Raise RuntimeError since this is a failure at import time and should + # not be recoverable. + nargs = func.__code__.co_argcount + # we support f(a, b) only + if nargs != 2: + raise RuntimeError('sympify_return can only be used with 2 argument functions') + # only b is _sympified + if func.__code__.co_varnames[1] != parameter: + raise RuntimeError('parameter name mismatch "%s" in %s' % + (parameter, func.__name__)) + + @wraps(func) + def _func(self, other): + # XXX: The check for _op_priority here should be removed. It is + # needed to stop mutable matrices from being sympified to + # immutable matrices which breaks things in quantum... + if not hasattr(other, '_op_priority'): + try: + other = sympify(other, strict=True) + except SympifyError: + return retval + if not isinstance(other, expectedcls): + return retval + return func(self, other) + + return _func diff --git a/shared/package-files/75/75ef12387b6d39f395efff2d1b7d9f6abbb9ecd0d671c0f1da0e19d7b378c616/ampex232w b/shared/package-files/75/75ef12387b6d39f395efff2d1b7d9f6abbb9ecd0d671c0f1da0e19d7b378c616/ampex232w new file mode 100644 index 0000000000000000000000000000000000000000..2efbbde5e4ec6be67441a54b7f787f6d2aebe7b1 Binary files /dev/null and b/shared/package-files/75/75ef12387b6d39f395efff2d1b7d9f6abbb9ecd0d671c0f1da0e19d7b378c616/ampex232w differ diff --git a/shared/package-files/75/75ef87d8dc6fe952363fc297c808ab292f0801db4960a7ea3e80e7de631a2323/libsvm_template.cpp b/shared/package-files/75/75ef87d8dc6fe952363fc297c808ab292f0801db4960a7ea3e80e7de631a2323/libsvm_template.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8f6dbd0dfd9ecd81bdd79c74a19d7299e179389d --- /dev/null +++ b/shared/package-files/75/75ef87d8dc6fe952363fc297c808ab292f0801db4960a7ea3e80e7de631a2323/libsvm_template.cpp @@ -0,0 +1,8 @@ + +/* this is a hack to generate libsvm with both sparse and dense + methods in the same binary*/ + +#define _DENSE_REP +#include "svm.cpp" +#undef _DENSE_REP +#include "svm.cpp" diff --git a/shared/package-files/75/75f14876a059a20d72be1c920ea592b87fae6536d19264c431641c0205ddbb23/dense_dim_ops.h b/shared/package-files/75/75f14876a059a20d72be1c920ea592b87fae6536d19264c431641c0205ddbb23/dense_dim_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..92f7c65644bfd5ed82499b6aac475bed04448cb5 --- /dev/null +++ b/shared/package-files/75/75f14876a059a20d72be1c920ea592b87fae6536d19264c431641c0205ddbb23/dense_dim_ops.h @@ -0,0 +1,28 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API dense_dim { + using schema = int64_t (const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::dense_dim") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "dense_dim(Tensor self) -> int") + static int64_t call(const at::Tensor & self); + static int64_t redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/75/75f267ab2132a439de8cf4f0635ddff833534836ac3325a6f4be7c09b4905b2b/upsample_linear1d_meta_dispatch.h b/shared/package-files/75/75f267ab2132a439de8cf4f0635ddff833534836ac3325a6f4be7c09b4905b2b/upsample_linear1d_meta_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..4853f006d737d1f5b0207a57ea7920132dd7c660 --- /dev/null +++ b/shared/package-files/75/75f267ab2132a439de8cf4f0635ddff833534836ac3325a6f4be7c09b4905b2b/upsample_linear1d_meta_dispatch.h @@ -0,0 +1,28 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace meta { + +TORCH_API at::Tensor upsample_linear1d(const at::Tensor & self, at::IntArrayRef output_size, bool align_corners, c10::optional scales=c10::nullopt); +TORCH_API at::Tensor upsample_linear1d_symint(const at::Tensor & self, c10::SymIntArrayRef output_size, bool align_corners, c10::optional scales=c10::nullopt); +TORCH_API at::Tensor & upsample_linear1d_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef output_size, bool align_corners, c10::optional scales=c10::nullopt); +TORCH_API at::Tensor & upsample_linear1d_outf(const at::Tensor & self, at::IntArrayRef output_size, bool align_corners, c10::optional scales, at::Tensor & out); +TORCH_API at::Tensor & upsample_linear1d_symint_out(at::Tensor & out, const at::Tensor & self, c10::SymIntArrayRef output_size, bool align_corners, c10::optional scales=c10::nullopt); +TORCH_API at::Tensor & upsample_linear1d_symint_outf(const at::Tensor & self, c10::SymIntArrayRef output_size, bool align_corners, c10::optional scales, at::Tensor & out); + +} // namespace meta +} // namespace at diff --git a/shared/package-files/75/75f55b51dab37e573afd512878f440b5cbbcc18ab8ecbf2437f71e928fd6b6c2/bitwise_not_compositeexplicitautogradnonfunctional_dispatch.h b/shared/package-files/75/75f55b51dab37e573afd512878f440b5cbbcc18ab8ecbf2437f71e928fd6b6c2/bitwise_not_compositeexplicitautogradnonfunctional_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..6c370da3fa693bc313ddf97ffb48b696e5d36cd1 --- /dev/null +++ b/shared/package-files/75/75f55b51dab37e573afd512878f440b5cbbcc18ab8ecbf2437f71e928fd6b6c2/bitwise_not_compositeexplicitautogradnonfunctional_dispatch.h @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautogradnonfunctional { + +TORCH_API at::Tensor bitwise_not(const at::Tensor & self); +TORCH_API at::Tensor & bitwise_not_(at::Tensor & self); + +} // namespace compositeexplicitautogradnonfunctional +} // namespace at diff --git a/shared/package-files/75/75f7db8e25bf5540107bb883f249c54bf29ea54213b7417ac6ec1fedd696c0ac/test_relabel.py b/shared/package-files/75/75f7db8e25bf5540107bb883f249c54bf29ea54213b7417ac6ec1fedd696c0ac/test_relabel.py new file mode 100644 index 0000000000000000000000000000000000000000..0ebf4d3ef490afce48e3e1298412edb05a385cdc --- /dev/null +++ b/shared/package-files/75/75f7db8e25bf5540107bb883f249c54bf29ea54213b7417ac6ec1fedd696c0ac/test_relabel.py @@ -0,0 +1,347 @@ +import pytest + +import networkx as nx +from networkx.generators.classic import empty_graph +from networkx.utils import edges_equal, nodes_equal + + +class TestRelabel: + def test_convert_node_labels_to_integers(self): + # test that empty graph converts fine for all options + G = empty_graph() + H = nx.convert_node_labels_to_integers(G, 100) + assert list(H.nodes()) == [] + assert list(H.edges()) == [] + + for opt in ["default", "sorted", "increasing degree", "decreasing degree"]: + G = empty_graph() + H = nx.convert_node_labels_to_integers(G, 100, ordering=opt) + assert list(H.nodes()) == [] + assert list(H.edges()) == [] + + G = empty_graph() + G.add_edges_from([("A", "B"), ("A", "C"), ("B", "C"), ("C", "D")]) + H = nx.convert_node_labels_to_integers(G) + degH = (d for n, d in H.degree()) + degG = (d for n, d in G.degree()) + assert sorted(degH) == sorted(degG) + + H = nx.convert_node_labels_to_integers(G, 1000) + degH = (d for n, d in H.degree()) + degG = (d for n, d in G.degree()) + assert sorted(degH) == sorted(degG) + assert nodes_equal(H.nodes(), [1000, 1001, 1002, 1003]) + + H = nx.convert_node_labels_to_integers(G, ordering="increasing degree") + degH = (d for n, d in H.degree()) + degG = (d for n, d in G.degree()) + assert sorted(degH) == sorted(degG) + assert H.degree(0) == 1 + assert H.degree(1) == 2 + assert H.degree(2) == 2 + assert H.degree(3) == 3 + + H = nx.convert_node_labels_to_integers(G, ordering="decreasing degree") + degH = (d for n, d in H.degree()) + degG = (d for n, d in G.degree()) + assert sorted(degH) == sorted(degG) + assert H.degree(0) == 3 + assert H.degree(1) == 2 + assert H.degree(2) == 2 + assert H.degree(3) == 1 + + H = nx.convert_node_labels_to_integers( + G, ordering="increasing degree", label_attribute="label" + ) + degH = (d for n, d in H.degree()) + degG = (d for n, d in G.degree()) + assert sorted(degH) == sorted(degG) + assert H.degree(0) == 1 + assert H.degree(1) == 2 + assert H.degree(2) == 2 + assert H.degree(3) == 3 + + # check mapping + assert H.nodes[3]["label"] == "C" + assert H.nodes[0]["label"] == "D" + assert H.nodes[1]["label"] == "A" or H.nodes[2]["label"] == "A" + assert H.nodes[1]["label"] == "B" or H.nodes[2]["label"] == "B" + + def test_convert_to_integers2(self): + G = empty_graph() + G.add_edges_from([("C", "D"), ("A", "B"), ("A", "C"), ("B", "C")]) + H = nx.convert_node_labels_to_integers(G, ordering="sorted") + degH = (d for n, d in H.degree()) + degG = (d for n, d in G.degree()) + assert sorted(degH) == sorted(degG) + + H = nx.convert_node_labels_to_integers( + G, ordering="sorted", label_attribute="label" + ) + assert H.nodes[0]["label"] == "A" + assert H.nodes[1]["label"] == "B" + assert H.nodes[2]["label"] == "C" + assert H.nodes[3]["label"] == "D" + + def test_convert_to_integers_raise(self): + with pytest.raises(nx.NetworkXError): + G = nx.Graph() + H = nx.convert_node_labels_to_integers(G, ordering="increasing age") + + def test_relabel_nodes_copy(self): + G = nx.empty_graph() + G.add_edges_from([("A", "B"), ("A", "C"), ("B", "C"), ("C", "D")]) + mapping = {"A": "aardvark", "B": "bear", "C": "cat", "D": "dog"} + H = nx.relabel_nodes(G, mapping) + assert nodes_equal(H.nodes(), ["aardvark", "bear", "cat", "dog"]) + + def test_relabel_nodes_function(self): + G = nx.empty_graph() + G.add_edges_from([("A", "B"), ("A", "C"), ("B", "C"), ("C", "D")]) + # function mapping no longer encouraged but works + + def mapping(n): + return ord(n) + + H = nx.relabel_nodes(G, mapping) + assert nodes_equal(H.nodes(), [65, 66, 67, 68]) + + def test_relabel_nodes_callable_type(self): + G = nx.path_graph(4) + H = nx.relabel_nodes(G, str) + assert nodes_equal(H.nodes, ["0", "1", "2", "3"]) + + @pytest.mark.parametrize("non_mc", ("0123", ["0", "1", "2", "3"])) + def test_relabel_nodes_non_mapping_or_callable(self, non_mc): + """If `mapping` is neither a Callable or a Mapping, an exception + should be raised.""" + G = nx.path_graph(4) + with pytest.raises(AttributeError): + nx.relabel_nodes(G, non_mc) + + def test_relabel_nodes_graph(self): + G = nx.Graph([("A", "B"), ("A", "C"), ("B", "C"), ("C", "D")]) + mapping = {"A": "aardvark", "B": "bear", "C": "cat", "D": "dog"} + H = nx.relabel_nodes(G, mapping) + assert nodes_equal(H.nodes(), ["aardvark", "bear", "cat", "dog"]) + + def test_relabel_nodes_orderedgraph(self): + G = nx.Graph() + G.add_nodes_from([1, 2, 3]) + G.add_edges_from([(1, 3), (2, 3)]) + mapping = {1: "a", 2: "b", 3: "c"} + H = nx.relabel_nodes(G, mapping) + assert list(H.nodes) == ["a", "b", "c"] + + def test_relabel_nodes_digraph(self): + G = nx.DiGraph([("A", "B"), ("A", "C"), ("B", "C"), ("C", "D")]) + mapping = {"A": "aardvark", "B": "bear", "C": "cat", "D": "dog"} + H = nx.relabel_nodes(G, mapping, copy=False) + assert nodes_equal(H.nodes(), ["aardvark", "bear", "cat", "dog"]) + + def test_relabel_nodes_multigraph(self): + G = nx.MultiGraph([("a", "b"), ("a", "b")]) + mapping = {"a": "aardvark", "b": "bear"} + G = nx.relabel_nodes(G, mapping, copy=False) + assert nodes_equal(G.nodes(), ["aardvark", "bear"]) + assert edges_equal(G.edges(), [("aardvark", "bear"), ("aardvark", "bear")]) + + def test_relabel_nodes_multidigraph(self): + G = nx.MultiDiGraph([("a", "b"), ("a", "b")]) + mapping = {"a": "aardvark", "b": "bear"} + G = nx.relabel_nodes(G, mapping, copy=False) + assert nodes_equal(G.nodes(), ["aardvark", "bear"]) + assert edges_equal(G.edges(), [("aardvark", "bear"), ("aardvark", "bear")]) + + def test_relabel_isolated_nodes_to_same(self): + G = nx.Graph() + G.add_nodes_from(range(4)) + mapping = {1: 1} + H = nx.relabel_nodes(G, mapping, copy=False) + assert nodes_equal(H.nodes(), list(range(4))) + + def test_relabel_nodes_missing(self): + G = nx.Graph([("A", "B"), ("A", "C"), ("B", "C"), ("C", "D")]) + mapping = {0: "aardvark"} + # copy=True + H = nx.relabel_nodes(G, mapping, copy=True) + assert nodes_equal(H.nodes, G.nodes) + # copy=False + GG = G.copy() + nx.relabel_nodes(G, mapping, copy=False) + assert nodes_equal(G.nodes, GG.nodes) + + def test_relabel_copy_name(self): + G = nx.Graph() + H = nx.relabel_nodes(G, {}, copy=True) + assert H.graph == G.graph + H = nx.relabel_nodes(G, {}, copy=False) + assert H.graph == G.graph + G.name = "first" + H = nx.relabel_nodes(G, {}, copy=True) + assert H.graph == G.graph + H = nx.relabel_nodes(G, {}, copy=False) + assert H.graph == G.graph + + def test_relabel_toposort(self): + K5 = nx.complete_graph(4) + G = nx.complete_graph(4) + G = nx.relabel_nodes(G, {i: i + 1 for i in range(4)}, copy=False) + assert nx.is_isomorphic(K5, G) + G = nx.complete_graph(4) + G = nx.relabel_nodes(G, {i: i - 1 for i in range(4)}, copy=False) + assert nx.is_isomorphic(K5, G) + + def test_relabel_selfloop(self): + G = nx.DiGraph([(1, 1), (1, 2), (2, 3)]) + G = nx.relabel_nodes(G, {1: "One", 2: "Two", 3: "Three"}, copy=False) + assert nodes_equal(G.nodes(), ["One", "Three", "Two"]) + G = nx.MultiDiGraph([(1, 1), (1, 2), (2, 3)]) + G = nx.relabel_nodes(G, {1: "One", 2: "Two", 3: "Three"}, copy=False) + assert nodes_equal(G.nodes(), ["One", "Three", "Two"]) + G = nx.MultiDiGraph([(1, 1)]) + G = nx.relabel_nodes(G, {1: 0}, copy=False) + assert nodes_equal(G.nodes(), [0]) + + def test_relabel_multidigraph_inout_merge_nodes(self): + for MG in (nx.MultiGraph, nx.MultiDiGraph): + for cc in (True, False): + G = MG([(0, 4), (1, 4), (4, 2), (4, 3)]) + G[0][4][0]["value"] = "a" + G[1][4][0]["value"] = "b" + G[4][2][0]["value"] = "c" + G[4][3][0]["value"] = "d" + G.add_edge(0, 4, key="x", value="e") + G.add_edge(4, 3, key="x", value="f") + mapping = {0: 9, 1: 9, 2: 9, 3: 9} + H = nx.relabel_nodes(G, mapping, copy=cc) + # No ordering on keys enforced + assert {"value": "a"} in H[9][4].values() + assert {"value": "b"} in H[9][4].values() + assert {"value": "c"} in H[4][9].values() + assert len(H[4][9]) == 3 if G.is_directed() else 6 + assert {"value": "d"} in H[4][9].values() + assert {"value": "e"} in H[9][4].values() + assert {"value": "f"} in H[4][9].values() + assert len(H[9][4]) == 3 if G.is_directed() else 6 + + def test_relabel_multigraph_merge_inplace(self): + G = nx.MultiGraph([(0, 1), (0, 2), (0, 3), (0, 1), (0, 2), (0, 3)]) + G[0][1][0]["value"] = "a" + G[0][2][0]["value"] = "b" + G[0][3][0]["value"] = "c" + mapping = {1: 4, 2: 4, 3: 4} + nx.relabel_nodes(G, mapping, copy=False) + # No ordering on keys enforced + assert {"value": "a"} in G[0][4].values() + assert {"value": "b"} in G[0][4].values() + assert {"value": "c"} in G[0][4].values() + + def test_relabel_multidigraph_merge_inplace(self): + G = nx.MultiDiGraph([(0, 1), (0, 2), (0, 3)]) + G[0][1][0]["value"] = "a" + G[0][2][0]["value"] = "b" + G[0][3][0]["value"] = "c" + mapping = {1: 4, 2: 4, 3: 4} + nx.relabel_nodes(G, mapping, copy=False) + # No ordering on keys enforced + assert {"value": "a"} in G[0][4].values() + assert {"value": "b"} in G[0][4].values() + assert {"value": "c"} in G[0][4].values() + + def test_relabel_multidigraph_inout_copy(self): + G = nx.MultiDiGraph([(0, 4), (1, 4), (4, 2), (4, 3)]) + G[0][4][0]["value"] = "a" + G[1][4][0]["value"] = "b" + G[4][2][0]["value"] = "c" + G[4][3][0]["value"] = "d" + G.add_edge(0, 4, key="x", value="e") + G.add_edge(4, 3, key="x", value="f") + mapping = {0: 9, 1: 9, 2: 9, 3: 9} + H = nx.relabel_nodes(G, mapping, copy=True) + # No ordering on keys enforced + assert {"value": "a"} in H[9][4].values() + assert {"value": "b"} in H[9][4].values() + assert {"value": "c"} in H[4][9].values() + assert len(H[4][9]) == 3 + assert {"value": "d"} in H[4][9].values() + assert {"value": "e"} in H[9][4].values() + assert {"value": "f"} in H[4][9].values() + assert len(H[9][4]) == 3 + + def test_relabel_multigraph_merge_copy(self): + G = nx.MultiGraph([(0, 1), (0, 2), (0, 3)]) + G[0][1][0]["value"] = "a" + G[0][2][0]["value"] = "b" + G[0][3][0]["value"] = "c" + mapping = {1: 4, 2: 4, 3: 4} + H = nx.relabel_nodes(G, mapping, copy=True) + assert {"value": "a"} in H[0][4].values() + assert {"value": "b"} in H[0][4].values() + assert {"value": "c"} in H[0][4].values() + + def test_relabel_multidigraph_merge_copy(self): + G = nx.MultiDiGraph([(0, 1), (0, 2), (0, 3)]) + G[0][1][0]["value"] = "a" + G[0][2][0]["value"] = "b" + G[0][3][0]["value"] = "c" + mapping = {1: 4, 2: 4, 3: 4} + H = nx.relabel_nodes(G, mapping, copy=True) + assert {"value": "a"} in H[0][4].values() + assert {"value": "b"} in H[0][4].values() + assert {"value": "c"} in H[0][4].values() + + def test_relabel_multigraph_nonnumeric_key(self): + for MG in (nx.MultiGraph, nx.MultiDiGraph): + for cc in (True, False): + G = nx.MultiGraph() + G.add_edge(0, 1, key="I", value="a") + G.add_edge(0, 2, key="II", value="b") + G.add_edge(0, 3, key="II", value="c") + mapping = {1: 4, 2: 4, 3: 4} + nx.relabel_nodes(G, mapping, copy=False) + assert {"value": "a"} in G[0][4].values() + assert {"value": "b"} in G[0][4].values() + assert {"value": "c"} in G[0][4].values() + assert 0 in G[0][4] + assert "I" in G[0][4] + assert "II" in G[0][4] + + def test_relabel_circular(self): + G = nx.path_graph(3) + mapping = {0: 1, 1: 0} + H = nx.relabel_nodes(G, mapping, copy=True) + with pytest.raises(nx.NetworkXUnfeasible): + H = nx.relabel_nodes(G, mapping, copy=False) + + def test_relabel_preserve_node_order_full_mapping_with_copy_true(self): + G = nx.path_graph(3) + original_order = list(G.nodes()) + mapping = {2: "a", 1: "b", 0: "c"} # dictionary keys out of order on purpose + H = nx.relabel_nodes(G, mapping, copy=True) + new_order = list(H.nodes()) + assert [mapping.get(i, i) for i in original_order] == new_order + + def test_relabel_preserve_node_order_full_mapping_with_copy_false(self): + G = nx.path_graph(3) + original_order = list(G) + mapping = {2: "a", 1: "b", 0: "c"} # dictionary keys out of order on purpose + H = nx.relabel_nodes(G, mapping, copy=False) + new_order = list(H) + assert [mapping.get(i, i) for i in original_order] == new_order + + def test_relabel_preserve_node_order_partial_mapping_with_copy_true(self): + G = nx.path_graph(3) + original_order = list(G) + mapping = {1: "a", 0: "b"} # partial mapping and keys out of order on purpose + H = nx.relabel_nodes(G, mapping, copy=True) + new_order = list(H) + assert [mapping.get(i, i) for i in original_order] == new_order + + def test_relabel_preserve_node_order_partial_mapping_with_copy_false(self): + G = nx.path_graph(3) + original_order = list(G) + mapping = {1: "a", 0: "b"} # partial mapping and keys out of order on purpose + H = nx.relabel_nodes(G, mapping, copy=False) + new_order = list(H) + assert [mapping.get(i, i) for i in original_order] != new_order diff --git a/shared/package-files/75/75f83787d7c261d8036c60ede9eceba96e5081f51b547a947092889d66bec845/__init__.py b/shared/package-files/75/75f83787d7c261d8036c60ede9eceba96e5081f51b547a947092889d66bec845/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5755b99c7571bc4decbcd8671141dc65fddee1b1 --- /dev/null +++ b/shared/package-files/75/75f83787d7c261d8036c60ede9eceba96e5081f51b547a947092889d66bec845/__init__.py @@ -0,0 +1,18 @@ + +import torch + + +def is_available(): + return hasattr(torch._C, "_faulty_agent_init") + + +if is_available() and not torch._C._faulty_agent_init(): + raise RuntimeError("Failed to initialize torch.distributed.rpc._testing") + +if is_available(): + # Registers FAULTY_TENSORPIPE RPC backend. + from . import faulty_agent_backend_registry + from torch._C._distributed_rpc_testing import ( + FaultyTensorPipeRpcBackendOptions, + FaultyTensorPipeAgent, + ) diff --git a/shared/package-files/7c/7c01b40185a8289ffeab36e4253218999fcbaebd12e6db3aa417f65ebc251603/ProcessGroupNCCL.hpp b/shared/package-files/7c/7c01b40185a8289ffeab36e4253218999fcbaebd12e6db3aa417f65ebc251603/ProcessGroupNCCL.hpp new file mode 100644 index 0000000000000000000000000000000000000000..c21cb1cec88adae7bb11006447c15f5a29c3de77 --- /dev/null +++ b/shared/package-files/7c/7c01b40185a8289ffeab36e4253218999fcbaebd12e6db3aa417f65ebc251603/ProcessGroupNCCL.hpp @@ -0,0 +1,1097 @@ +#pragma once + +#if defined(__linux__) +#include +#include +#include +#include +#endif + +#ifdef USE_C10D_NCCL + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace c10d { + +// Control whether or not wait() is blocking or non-blocking. +static std::vector TORCH_NCCL_BLOCKING_WAIT = { + "TORCH_NCCL_BLOCKING_WAIT", + "NCCL_BLOCKING_WAIT"}; + +// Control whether or not we perform Async Error Handling with NCCL. +static std::vector TORCH_NCCL_ASYNC_ERROR_HANDLING = { + "TORCH_NCCL_ASYNC_ERROR_HANDLING", + "NCCL_ASYNC_ERROR_HANDLING"}; + +// Control whether dumping debug info on watchdog +// timeout is enabled. This variable must be set together with +// TORCH_NCCL_ENABLE_MONITORING=1 and TORCH_NCCL_TRACE_BUFFER_SIZE > 0. +static std::vector TORCH_NCCL_DUMP_ON_TIMEOUT = { + "TORCH_NCCL_DUMP_ON_TIMEOUT"}; + +// Control whether Desync Debug is enabled. This variable must be set +// together with TORCH_NCCL_ASYNC_ERROR_HANDLING. +static std::vector TORCH_NCCL_DESYNC_DEBUG = { + "TORCH_NCCL_DESYNC_DEBUG", + "NCCL_DESYNC_DEBUG"}; + +// Enable recording start-events for all ProcessGroupNCCL collectives, and +// compute accurate collective timing per-collective. (Note: end-events are +// recorded by default. Turn on this flag can increase chances of a watchdog +// hang due to performing a CUDA event query which eventually calls +// cudaEventElapsedTime() API. +static std::vector TORCH_NCCL_ENABLE_TIMING = { + "TORCH_NCCL_ENABLE_TIMING", + "NCCL_ENABLE_TIMING"}; + +// Enable monitoring thread which aborts the process when the ProcessGroupNCCL +// Watchdog thread gets stuck and no heartbeat is detected after +// TORCH_NCCL_HEARTBEAT_TIMEOUT_SEC. This can happen due to calling CUDA/NCCL +// APIs that may hang. It is Useful to prevent jobs being stuck for a prolonged +// time than necessary tying up cluster resources. +static std::vector TORCH_NCCL_ENABLE_MONITORING = { + "TORCH_NCCL_ENABLE_MONITORING"}; + +// Control the watchdog heartbeat timeout period after which the monitoring +// thread will abort the process. +static std::vector TORCH_NCCL_HEARTBEAT_TIMEOUT_SEC = { + "TORCH_NCCL_HEARTBEAT_TIMEOUT_SEC"}; + +// The maximum number of events we store in the flight recorder's ring buffer. +// (One event could be the start or end of a collective, for example). +static std::vector TORCH_NCCL_TRACE_BUFFER_SIZE = { + "TORCH_NCCL_TRACE_BUFFER_SIZE"}; + +// Control how much extra time we will wait for dumping the debugging info +// before we exit and throws timeout exception. +static std::vector TORCH_NCCL_WAIT_TIMEOUT_DUMP_MILSEC = { + "TORCH_NCCL_WAIT_TIMEOUT_DUMP_MILSEC"}; + +// Control the interval inside the watchdog thread to check the coordinated +// signal from other ranks, e.g. to dump the debugging information. +static std::vector TORCH_NCCL_COORD_CHECK_MILSEC = { + "TORCH_NCCL_COORD_CHECK_MILSEC"}; + +// Whether to abort the communicators when users call destroy_process_group(). +// If yes, communicators will be aborted when destroy_process_group is called, +// but not in destructor. +static std::vector TORCH_NCCL_ABORT_IN_DESTROY_PG = { + "TORCH_NCCL_ABORT_IN_DESTROY_PG"}; + +constexpr const char* NCCL_BACKEND_NAME = "nccl"; + +constexpr const char* TIMEOUT_DUMP = "timeout_dump"; + +constexpr const int kWorkStatusUpdatePeriodMs = 10 * 1000; // 10 seconds + +constexpr auto kProcessGroupNCCLDefaultTimeout = + std::chrono::milliseconds(10 * 60 * 1000); + +// NoHandling: do not handle asynchronous NCCL errors +// TearDown: tear down process upon error, see `WorkNCCL::handleException` +// CleanUpOnly: just clean up collectives and abort communicators without +// tearing down process SkipCleanUp: (this is a temporary option and can be +// removed in future) tear down process without cleaning up NCCL communicators. +// This should be used as a last resort in case `ncclCommAbort` itself is +// hanging +enum ErrorHandlingMode { + NoHandling = 0, + TearDown = 1, + CleanUpOnly = 2, + SkipCleanUp = 3 +}; + +#define SHOULD_CLEAN_UP(a) (a != NoHandling && a != SkipCleanUp) + +#define SHOULD_TEAR_DOWN(a) (a != NoHandling && a != CleanUpOnly) + +#define PRINT_COLLECTIVE_HASH_SIGNATURE(phase, opType, numel, hashValue) \ + LOG(WARNING) << logPrefix() << "Hash of " << phase << " to NCCL " << opType \ + << " with size " << numel << " is " << hashValue; + +// If set, ProcessGroupNCCL doesn't use recordStream calls to ensure +// caching allocator safety for tensors used on both user-facing and +// internal comm streams. +// Instead, it stashes live references to those tensors until after +// user-facing streams are synced with comm streams. +// See stashed_for_allocator_safety_ below. +static std::vector TORCH_NCCL_AVOID_RECORD_STREAMS = { + "TORCH_NCCL_AVOID_RECORD_STREAMS"}; + +// If set, ProcessGroupNCCL registers postAlloc and preFree hooks to cuda cache +// allocator so that whenever a tensor is allocated or freed, ProcessGroupNCCL +// can register/deregister the tensor on all available NCCL communicators. +static std::vector TORCH_NCCL_USE_TENSOR_REGISTER_ALLOCATOR_HOOK = + {"TORCH_NCCL_USE_TENSOR_REGISTER_ALLOCATOR_HOOK", + "NCCL_USE_TENSOR_REGISTER_ALLOCATOR_HOOK"}; + +#if defined(__linux__) +struct DumpPipe { + DumpPipe(int rank) { + std::string fileStem = + getCvarString({"TORCH_NCCL_DEBUG_INFO_PIPE_FILE"}, ""); + if (fileStem.empty() || + getCvarInt({"TORCH_NCCL_TRACE_BUFFER_SIZE"}, 0) <= 0) { + return; + } + TORCH_CHECK(!fileStem.empty(), "TORCH_NCCL_DEBUG_INFO_TEMP_FILE is empty"); + std::string filename = c10::str(fileStem, rank, ".pipe"); + TORCH_CHECK( + unlink(filename.c_str()) != -1 || errno == ENOENT, + "Error removing existing named pipe ", + filename); + TORCH_CHECK( + mkfifo(filename.c_str(), 0666) != -1, + "Error creating named pipe ", + filename); + fd_ = open(filename.c_str(), O_RDONLY | O_NONBLOCK); + LOG(INFO) << "Pipe file " << filename + << " has been opened, write to it to trigger NCCL Debug Dump."; + TORCH_CHECK(fd_ != -1, "Error opening named pipe ", filename); + } + bool shouldDump() { + if (fd_ == -1) { + return false; + } + char buf[128]; + // non-blocking from O_NONBLOCK above. + // Ignore EINTR because we already will poll this + // again later. + ssize_t bytesRead = read(fd_, &buf, 128); + return bytesRead > 0; + } + ~DumpPipe() { + if (fd_ != -1) { + close(fd_); + } + } + + private: + int fd_ = -1; +}; +#else +struct DumpPipe { + DumpPipe(int rank) {} + bool shouldDump() { + return false; + } +}; +#endif + +// ProcessGroupNCCL implements NCCL bindings for c10d. +// +// All functions of the class are expected to be called in the same order +// across all processes in the process group. This is the only way that we +// can guarantee to match up the same calls among all processes. +// +// All NCCL functions provided by this class are asynchronous functions. More +// specifically, each NCCL call is scheduled on a separate CUDA stream that is +// different from the current CUDA stream. This is for the purpose of +// achieving potentially concurrency and better performance. As a result, +// it is the callers' responsibility to make sure that the CUDA stream their +// code works on needs to wait for the NCCL operation from +// this class. +// +// This can be done by calling: +// +// either WorkNCCL::wait() or WorkNCCL::synchronize(), both achieves the same +// functionality and are synonyms. +// +// Also note that WorkNCCL::finishedGPUExecution() is a helper function only +// provided by ProcessGroupNCCL to check if the NCCL operation of WorkNCCL has +// finished execution on the GPU (not just scheduled). +// +// Example on using the NCCL process group +// +// ProcessGroupNCCL pg(store, rank, size); +// std::shared_ptr work = pg.allreduce(tensors); +// +// // At this point, NCCL kernel has already by queued successfully +// // Now, let current stream wait for the NCCL to finish, this function is +// // async operation as well +// +// work->wait() +// +// // Now continue on other work in the current stream. +class TORCH_API ProcessGroupNCCL : public Backend { + public: + class WorkNCCL : public Work, public std::enable_shared_from_this { + public: + friend struct WorkInfo; + + // Constructor takes a list of CUDA devices + WorkNCCL( + at::Device& device, + int rank, + OpType opType, + uint64_t seq, + const char* profilingTitle = nullptr, + const c10::optional>& inputs = c10::nullopt, + bool desyncDebug = false, + bool enableTiming = false, + DebugLevel distDebugLevel = DebugLevel::Off); + // Copy constructor doing partial copy without outputs_. Cleanup thread + // monitors and removes finished works. However it will deadlock when + // destructs outputs_ tensors who are view tensors in autograd graph. + WorkNCCL(const WorkNCCL& w); + + ~WorkNCCL() override; + + // Checks if the NCCL kernel has started to execute. + bool isStarted(); + + // Checks if request has completed. In this specific case of NCCL, it checks + // if the NCCL operation has completed on the GPU in its own NCCL stream. + // Non-blocking operation. + bool isCompleted() override; + + bool isSuccess() const override; + + // Same as calling synchronize() for NCCL work. + bool wait(std::chrono::milliseconds timeout = kNoTimeout) override; + + void abort() override; + + // Let current stream wait on the completing of the NCCL work + // Throws on exceptions. Blocking operation, which will wait for work + // completion. + void synchronize() override; + + // Synchronize streams by blocking each on the NCCL stream + void synchronizeStream(); + + // Helper function to handle exception (throw if needed). + void handleException(ErrorHandlingMode asyncErrorHandling); + + // Helper function that checks if the NCCL kernels have finished + // execution on the GPUs + bool finishedGPUExecution(); + + // Get a Future object that will be marked as completed internally. + c10::intrusive_ptr getFuture() override; + + float getDuration() const override; + + uint64_t getSequencenumber() const override; + + const std::string& logPrefix() const; + + // Helper function that sets an exception_ptr on the WorkNCCL object. + void setException(std::exception_ptr exception_ptr); + + // Helper function that returns True if the WorkNCCL object has timed out + // and False otherwise. + // In case of timeout, set exception on the WorkNCCL object. + bool checkTimeout( + c10::optional timeout = c10::nullopt); + + std::vector result() override; + + protected: + // The cached list of CUDA devices to operate on + at::Device device_; + + // The start CUDA event of NCCL operator tracking this work item. These + // start CUDA events are needed by desync debugging if enabled. + std::shared_ptr ncclStartEvent_; + + // The end CUDA event of NCCL operator tracking this work item. + std::shared_ptr ncclEndEvent_; + + // The NCCL communicator used for this work item. + std::shared_ptr ncclComm_; + + // Tensors used for barrier op + at::Tensor barrierTensor_; + + // Clone of blockingWait_ from ProcessGroupNCCL. + bool blockingWait_ = false; + + // Clone of avoidRecordStreams_ from ProcessGroupNCCL. + bool avoidRecordStreams_ = false; + + // Clone of opTimeout_ from ProcessGroupNCCL. + std::chrono::milliseconds opTimeout_; + + // Time point representing when the work started. + std::chrono::time_point workStartTime_; + + // Record the collective sequential number. + uint64_t seq_; + + // Indicates if the nccl start event has been updated to the store trace. + // This will be used by desync debug. + bool startTraceUpdated_{false}; + + // Record collective sizes for debug. We only record the size on the first + // device as multi-device per process is deprecated + size_t numelIn_ = -1; + size_t numelOut_ = -1; + + // Wrapper method for the static checkForNCCLErrors which can be overridden + // for tests. + virtual std::exception_ptr checkForNCCLErrors(); + + friend std::ostream& operator<<( + std::ostream& output, + const WorkNCCL& workNCCL); + + private: + // Helper function for synchronize + void synchronizeInternal(std::chrono::milliseconds timeout); + + // Checks for NCCL errors and sets an appropriate exception_ptr. + void checkAndSetException(); + + // Just checks whether GPU execution has started, without modifying + // exception_ptr. + bool startedGPUExecutionInternal() const; + + // Just checks whether GPU execution has completed, without modifying + // exception_ptr. + bool finishedGPUExecutionInternal() const; + + // Reference to the store so that we can write aborted communicators + // to the store. + c10::intrusive_ptr store_; + + // Store a reference to NCCL collective's outputs, used by result and to + // give a more descriptive message when representing the Work as a string. + std::shared_ptr> outputs_; + + // TORCH_NCCL_AVOID_RECORD_STREAMS implementation helper. + // Stores references to participating non-output tensors (ie inputs, + // flattened intermediates). + // We'll clear this list in synchronizeStream, just after user-facing + // stream(s) are synced with the nccl work stream(s). + // By keeping these refs (as well as outputs_) alive until after the + // collective's work rejoins the user-facing streams, we achieve + // caching allocator safety without any recordStream calls. + // For in-place collectives, some refs stashed here may alias outputs_, + // but that doesn't do any harm. + std::shared_ptr> stashed_for_allocator_safety_; + + // The future returned by getFuture. + c10::intrusive_ptr future_; + + bool timingEnabled_; + // unique id used to tell the trace buffer that this + // work has completed + c10::optional trace_id_; + DebugLevel distDebugLevel_; + friend class ProcessGroupNCCL; + }; + + struct Options : Backend::Options { + // NOTE: timeout in ProcessGroupNCCL::Options denote the timeout for + // operations. This is only used when blockingWait_ is enabled. + explicit Options(bool is_high_priority_stream = false); + + // return intrusive_ptr of the object + static c10::intrusive_ptr create( + bool is_high_priority_stream = false) { + return c10::make_intrusive(is_high_priority_stream); + } + + // Schedule NCCL operations on high priority CUDA streams + bool is_high_priority_stream; + +#ifdef NCCL_HAS_COMM_NONBLOCKING + // Configure ranks + ncclConfig_t config = NCCL_CONFIG_INITIALIZER; +#endif + + // Optional "parent" backend and color to create communicators from + // via `ncclCommSplit` + std::shared_ptr split_from; + int64_t split_color{0}; + std::vector global_ranks_in_group; + }; + + // If you wish to create multiple process groups, each with a potentially + // different rank and size, you can do so by passing a new store instance + // to each one. If you have only a single store object, you can + // use the `c10d::PrefixStore` to derive scoped instances. + // This is also what the Python API in torch.distributed does. + // + // The process group instance keeps a reference to the store because + // it may be used long after the constructor runs. In fact, the constructor + // doesn't create any NCCL communicators. A single NCCL communicator can + // only be used on a specific set of devices, and are therefore created + // on-demand when a collective runs. If another collective is executed later, + // against a different set of devices, the process group creates another NCCL + // communicator. These NCCL communicators are cached and reused if possible. + // + ProcessGroupNCCL( + const c10::intrusive_ptr& store, + int rank, + int size, + c10::intrusive_ptr options = Options::create()); + + // This constructor includes the deprecated `groupName` argument. + // If you have existing code that uses the `groupName`, you can replace + // it by specifying a `c10d::PrefixStore(groupName, store)` for store. + C10_DEPRECATED ProcessGroupNCCL( + const c10::intrusive_ptr& store, + int rank, + int size, + const std::string& groupName, + c10::intrusive_ptr options = Options::create()) + : ProcessGroupNCCL(store, rank, size, options) {} + + ~ProcessGroupNCCL() override; + + uint64_t getUid() { + return static_cast(uid_); + } + + c10::intrusive_ptr getOptions() { + return options_; + } + + const std::string getBackendName() const override { + return std::string(NCCL_BACKEND_NAME); + } + + bool supportsSplitting() const override { + return true; + } + + void startCoalescing() override; + + c10::intrusive_ptr endCoalescing() override; + + // For specifying a composite optype, such as ALLGATHER and REDUCE_SCATTER + c10::intrusive_ptr endCoalescing(OpType optype); + + c10::intrusive_ptr broadcast( + std::vector& tensors, + const BroadcastOptions& opts = BroadcastOptions()) override; + + c10::intrusive_ptr _broadcast_oop( + at::Tensor& outputTensors, + at::Tensor& inputTensors, + const BroadcastOptions& opts = BroadcastOptions()); + + c10::intrusive_ptr allreduce_sparse( + std::vector& tensors, + const AllreduceOptions& opts = AllreduceOptions()) override; + + c10::intrusive_ptr allreduce( + std::vector& tensors, + const AllreduceOptions& opts = AllreduceOptions()) override; + + c10::intrusive_ptr allreduce_coalesced( + std::vector& tensors, + const AllreduceCoalescedOptions& opts = + AllreduceCoalescedOptions()) override; + + c10::intrusive_ptr reduce( + std::vector& tensors, + const ReduceOptions& opts = ReduceOptions()) override; + + c10::intrusive_ptr _reduce_oop( + at::Tensor& outputTensors, + at::Tensor& inputTensors, + const ReduceOptions& opts = ReduceOptions()); + + c10::intrusive_ptr allgather( + std::vector>& outputTensors, + std::vector& inputTensors, + const AllgatherOptions& opts = AllgatherOptions()) override; + + c10::intrusive_ptr _allgather_base( + at::Tensor& outputbuffer, + at::Tensor& inputbuffer, + const AllgatherOptions& opts = AllgatherOptions()) override; + + c10::intrusive_ptr allgather_coalesced( + std::vector>& outputTensorLists, + std::vector& inputTensors, + const AllgatherOptions& opts = AllgatherOptions()) override; + + c10::intrusive_ptr allgather_into_tensor_coalesced( + std::vector& outputs, + std::vector& inputs, + const AllgatherOptions& opts = AllgatherOptions()) override; + + c10::intrusive_ptr reduce_scatter( + std::vector& outputTensors, + std::vector>& inputTensors, + const ReduceScatterOptions& opts = ReduceScatterOptions()) override; + + c10::intrusive_ptr _reduce_scatter_base( + at::Tensor& outputTensor, + at::Tensor& inputTensor, + const ReduceScatterOptions& opts = ReduceScatterOptions()) override; + + c10::intrusive_ptr reduce_scatter_tensor_coalesced( + std::vector& outputs, + std::vector& inputs, + const ReduceScatterOptions& opts = ReduceScatterOptions()) override; + + c10::intrusive_ptr barrier( + const BarrierOptions& opts = BarrierOptions()) override; + + c10::intrusive_ptr alltoall_base( + at::Tensor& outputTensor, + at::Tensor& inputTensor, + std::vector& outputSplitSizes, + std::vector& inputSplitSizes, + const AllToAllOptions& opts = AllToAllOptions()) override; + + c10::intrusive_ptr alltoall( + std::vector& outputTensors, + std::vector& inputTensors, + const AllToAllOptions& opts = AllToAllOptions()) override; + + c10::intrusive_ptr send( + std::vector& tensors, + int dstRank, + int tag) override; + + c10::intrusive_ptr recv( + std::vector& tensors, + int srcRank, + int tag) override; + + void groupStart(); + + void groupEnd(); + + void groupEndNonblocking(std::shared_ptr comm); + + c10::intrusive_ptr gather( + std::vector>& outputTensors, + std::vector& inputTensors, + const GatherOptions& opts = GatherOptions()) override; + + c10::intrusive_ptr scatter( + std::vector& outputTensors, + std::vector>& inputTensors, + const ScatterOptions& opts = ScatterOptions()) override; + + // Unsupported Ops + c10::intrusive_ptr recvAnysource( + std::vector& tensors, + int tag) override; + + // Agrees on an initial sequence number for the whole group by having rank 0 + // create it and broadcast it to other ranks using the store. + void setSequenceNumberForGroup() override; + + // Retrieves the current sequence number for the whole group, which should be + // in sync. If the returned number is not consistent across the group, it + // may indicate that there is some sort of collective desynchronization. + uint64_t getSequenceNumberForGroup() override; + + // Return the total number of splits the communicators held by this process + // group have performed. + uint64_t getCommSplitCounter() const; + + void registerOnCompletionHook( + std::function)>&& hook) override; + void waitForPendingWorks() override; + + void enableCollectivesTiming() override; + + // Helper function for iteratively aborting communicators in the provided map + void abortCommsFromMap( + std::unordered_map>& ncclCommsMap, + c10::optional abortReason); + + c10::intrusive_ptr initIntraNodeComm(); + + // Provides an API to abort the ProcessGroup (similar to ncclCommAbort) + // instead of relying on ProcessGroupNCCL destructor. + // return true if abort is successful, otherwise false + bool abort(c10::optional abortReason = c10::nullopt); + + void shutdown(c10::optional reason = c10::nullopt); + + void eagerConnectSingleDevice(at::Device device) override; + + void performNocolorSplit(at::Device device); + + protected: + // Helper that broadcasts nccl unique ID to all ranks through the store + void broadcastUniqueNCCLID( + ncclUniqueId* ncclID, + bool isSingleP2POp, + const std::string& devicesKey, + int p2pRank); + + // Helper that either looks up the cached NCCL communicators or creates + // a new set of NCCL communicators as a cache entry + std::shared_ptr getNCCLComm( + const std::string& deviceKey, + at::Device& device, + OpType opType, + int p2pRank = 0, + bool isSendRecvSelf = false); + + // Wrapper method which can be overridden for tests. + virtual std::exception_ptr checkForNCCLErrors( + std::shared_ptr& ncclComm); + + // Ensure thaht if record is True, the work obj will be enqueued via + // workEnqueue + virtual c10::intrusive_ptr initWork( + at::Device& device, + int rank, + OpType opType, + const char* profilingTitle = nullptr, + const std::vector& inputs = {}, + const std::vector& outputs = {}, + bool record = false); + + // In the timeout case and we will dump debug info such as the NCCL flight + // recorder to storage. Down the road, if we have more complicated or blocking + // operations, we might need to use a side thread to do it. + bool dumpDebuggingInfo(); + + private: + int globalRankStart; + int globalRankStride; + + // Helper that encapsulates work shared across all collective communication + // primitives. The callbacks have the following signatures: + // + // ncclResult_t fn(at::Tensor& input, at::Tensor& output, + // ncclComm_t, at::cuda::CUDAStream&); + // void {pre,post}(std::vector); + template + c10::intrusive_ptr collective( + at::Tensor& input, + at::Tensor& output, + Fn fn, + OpType opType, + const char* profilingTitle = nullptr, + bool avoidRecordStreams = false); + + template + c10::intrusive_ptr collective( + at::Tensor& input, + at::Tensor& output, + Fn fn, + PreProcess pre, + PostProcess post, + OpType opType, + const char* profilingTitle = nullptr, + bool avoidRecordStreams = false); + + template + c10::intrusive_ptr collectiveCoalesced( + std::vector& input, + std::vector& output, + Fn fn, + OpType opType, + const char* profilingTitle = nullptr, + bool avoidRecordStreams = false); + + // Helper that encapsulates work shared across point-to-point communication + // primitives. It is the same structure as the helper used for collective + // communication primitives. + template + c10::intrusive_ptr pointToPoint( + at::Tensor& tensor, + Fn fn, + int peer, + OpType opType, + const char* profilingTitle = nullptr); + + template + c10::intrusive_ptr pointToPoint( + at::Tensor& tensor, + Fn fn, + int peer, + OpType opType, + PreProcess pre, + PostProcess post, + const char* profilingTitle); + + c10::intrusive_ptr allreduce_impl( + at::Tensor& tensor, + const AllreduceOptions& opts = AllreduceOptions()); + + // Checks for NCCL errors on each of the communicators and returns an + // appropriate exception_ptr (nullptr if no errors). + static std::exception_ptr checkForNCCLErrorsInternal( + std::shared_ptr& ncclComm); + + // Function that runs as part of a separate thread and checks for errors on + // NCCL communicators. We need a separate thread to check for NCCL errors + // since we can't rely on the user calling certain methods like wait(), + // isCompleted() etc. to detect and remediate errors. In addition to this, we + // need a mechanism to safely abort and remove NCCL communicators from our + // cache. This can be done cleanly by having a thread for the ProcessGroupNCCL + // class. Attempting to modify the communicator cache from the WorkNCCL class + // might run into issues with object lifetime since the ProcessGroupNCCL + // object might get destroyed before the WorkNCCL object. + void ncclCommWatchdog(); + + // Return the CUDA device most likely associated with this backend. + // If we aren't bound to a specific device, there is no strict + // guarantee that this heuristic is the correct assignment of ranks + // to GPUs that Python layers use, but in practice it tends to be. + // Fortunately we don't rely on this for correctness of any tensor + // operations, just for ancillary uses like barriers. + at::Device guessDeviceForRank() const; + + // Destroys initialized NCCL communicators in devNCCLComMap_ given by input + // key. Throws if there are no communicators to destroy. Also removes + // communicators from the cache and clears used device indices. + void destroyNCCLComms(const std::string& devNCCLCommMapKey); + + // Watchdog's inside loop. + // Takes care of cleaning up completed work, and aborting upon failure or + // timeout. + void watchdogHandler(); + + void runHookLoop(); + + // Desync debug helper + void logWorkStart(WorkNCCL& work); + + // Desync debug helper + void logWorkEnd(WorkNCCL& work); + + // Generates a prefix that is unique to this process group and rank, for + // disambiguating logs + std::string createLogPrefix() const; + + // Returns the unique prefix created in createLogPrefix + const std::string& logPrefix() const; + + // Returns the global rank of the device. This function assumes that users + // always create a default global process group(PG) which includes all + // devices. It is called in the constructor of ProcessGroupNCCL, so it always + // return the rank_ of the the very first PG created, aka, default global PG. + const int& globalRank() const; + + // Returns the global ranks of a PG. + const std::vector& groupRanks() const; + + protected: + // Function that runs as part of a separate thread aside from watchdog + // thread because we need to check the heartbeat from watchdog thread + // so that when we get stuck in some NCCL/CUDA calls, + // we can dump the debugging information and abort the process. + virtual void heartbeatMonitor(); + + // Function that directly trigger std::abort so that the whole process + // gets terminated. + virtual void terminateProcess(std::string errMsg); + + // A helper function to wait for a future to complete or timeout. + void waitForFutureOrTimeout( + std::future& fut, + const std::chrono::milliseconds& timeOutMilSec, + const std::string& futDescription, + bool throwException = false); + + // When watchdog timeout, this function will be called and return debug info + // for users. For now we only get information from retrieveDesyncReport. + // We are working on enabling more useful debug information for watchdog + // timeout. + virtual std::string getNCCLWatchdogDebugInfo(); + + static const int64_t kWatchdogThreadSleepMillis; + + // The store is used to broadcast the NCCL unique ID of rank 0. This store + // comes with prefix and it is different across ProcessGroup NCCL instances + // (aka, different ProcessGroups). + c10::intrusive_ptr store_; + + // Reference to the store without prefix so that keys are same across all + // ProcessGroup NCCL instances and (key, value) pairs written to the store are + // global. + c10::intrusive_ptr globalStore_; + + bool storeError_{false}; + + const c10::intrusive_ptr options_; + + // The number of NCCL communicators that have been created during + // the lifetime of this process group. This sequence number is + // used to scope keys used in the store. + uint64_t ncclCommCounter_{0}; + + // The store keys to trace the last NCCL collective kernel CUDA events - start + // event and end event respectively. These are used to do desync root cause + // analysis. + const std::string traceKeyStart_; + const std::string traceKeyEnd_; + + // The NCCL communicator that the process group has cached. + // + // For collective operations: + // The key is a list of GPU devices that an operation is operating on + // The GPU devices are stored in a device sequence and the cache NCCL + // communicator is associated with this GPU device sequence + // + // e.g. If the process group op only uses device 0, then the value of + // the used device string stored (value of the hashmap) would be "0". + // + // If the process group op uses device 0 - 7 and the each tensor of the + // input tensor list is on device, 0, 1, 2, 3, 4, 5, 6, 7 separately, + // then the value of the used device string (key) stored would be + // "0,1,2,3,4,5,6,7" + // + // If the process group op uses device 0 - 7 and the each tensor of the + // input tensor list is on device, 0, 4, 5, 6, 7, 1, 2, 3 separately, + // then the value of the used device string stored would be + // "0,4,5,6,7,1,2,3" + // + // Note that the order of the device for the tensor list matters. + // + // For point-to-point operations: + // The key is a string of my current rank and the peer process rank. + // e.g. If process 1 and process 2 are involved in a point-to-point + // communication, the key will be "1:2" on both processes. Note: this is for + // the scenario where there is only 1 GPU per process. When it comes to + // multiple GPUs per process, this part may need to redesigned. + std::unordered_map> devNCCLCommMap_; + + // The NCCL communicators currently in process of being initialized. + std::unordered_map> + inInitializationCommMap_; + + // Map from ncclUniqueId to appropriate communicator. + std::unordered_map> ncclIdToCommMap_; + + // Mutex to guard maps like devNCCLCommMap_ and ncclIdToCommMap_. + std::mutex mutex_; + + // Heartbeat of watchdog thread. + std::atomic_uint64_t heartbeat_; + + // The time interval used for deciding whether there is no watchdog heartbeat. + int heartbeatTimeoutInSec_; + + // timeout for the dump to finish. + int waitTimeoutDumpInMilSec_; + + // Interval of check coordinated signals in ProcessGroupNCCL from other ranks + // e.g., trigger the dump of the debugging info for timeout when notified. + int coordCheckIntervalMilSec_; + + // Size of ring buffer where we store NCCL Traces for debugging. + int ncclTraceBufferSize_; + + // We gate the heartbeat monitor thread so that we can roll it out gradually. + std::atomic monitorThreadEnabled_; + + // Monitor thread which checks the heartbeat of Watchdog thread. + // If the monitor thread finds there is no heartbeat, it will dump debug info + // and then kill the watchdog thread to avoid hang. + std::thread ncclHeartbeatMonitorThread_; + + // Watchdog thread which looks for errors on the cached NCCL communicators. + std::thread ncclCommWatchdogThread_; + + std::thread onCompletionHookThread_; + + // Whether or not we should terminate the watchdog and workCleanup threads. + std::atomic terminateProcessGroup_; + + // Whether or not we should terminate the heartbeat monitoring threads. + std::atomic terminateHeartbeatMonitorThread_; + + // Whether we are in the shutdown mode when we are trying to get debug info, + // such as desync report. + std::atomic collectiveDebugInfoMode_; + + // Whether there are hooks pending to be fired + std::atomic hasPendingHooks_; + + // This is the signal from watchdog threads to indicate whether the monitor + // thread should dump. Making it static so that it is accessiable from all the + // PGs. With this flag, monitor thread would dump debug info under any one of + // the 3 conditions: 1: this flag is set to true by the watchdog thread when + // it detects a timeout. 2: timeout signal is received from + // other ranks through tcpstore 3: no heartbeat of watchdog Note that only the + // monitor thread from PG0 should dump the debug info and only once + static std::atomic shouldDump_; + + // Mutex to Guard workMetaList_ + std::mutex workMetaListMutex_; + + // Mutex to Guard monitorWakeUpCV_ + std::mutex monitorMutex_; + + bool writeDebugInfo_ = false; + + // Condition Variable for watchdog thread sleep + std::condition_variable workMetaListCV_; + + // Condition Variable for monitor thread to wake up early + std::condition_variable monitorWakeUpCV_; + + // Vector to Store WorkNCCL pointers + std::list workMetaList_; + + std::chrono::time_point lastWorkListUpdateTime_; + + // Mutex to Guard workMetaList_ + std::mutex completedWorkListMutex_; + + // Condition Variable for watchdog thread sleep + std::condition_variable completedWorkListCV_; + + std::list completedWorkList_; + + // Add Work Pointer to workVector + void workEnqueue(c10::intrusive_ptr); + + // The CUDA streams used by NCCL kernels + std::unordered_map ncclStreams_; + + // The CUDA events used to sync NCCL streams + std::unordered_map ncclEvents_; + + // Device Indexes used for all collectives in this group + std::set usedDeviceIdxs_; + + // Flag to denote if a coalescing groupStart/groupEnd block is active + int coalescing_state_ = 0; + + // Stores device indexes for all collectives run inside a coalescing block + std::vector coalescedDevices_; + + // Stores communicators for all collectives run inside a coalescing block + std::vector> coalescedComms_; + + // map from the key: "group name + pg counter (ID)" to the + // unique NCCL ID count. This needs to be group and pg specific + // + // For each process group, we need a uniform unique NCCL ID counter to ensure + // that NCCL operation in this process group can be completed successfully. + // Since each process group ID belongs to a group name, the key to this map + // is a combination of group name and ProcessGroupNCCL ID. + static std::unordered_map pgUniqueNCCLIDCnt_; + + // map from group name to the pg counter (ID) within that group + // + // For each group with the "group name" (which is the key), we need to + // keep track of a unique process group ID when creating a new + // ProcessGroupNCCL for this "group name". Therefore, the value of this + // map keeps the unique ProcessGroupNCCL's ID for a specific group with + // the "group name". The reason we need a per-group process group ID counter + // is that different group can have different ranks and we need ensure that + // each group has its own uniform process group ID for all its ranks. + static std::unordered_map processGroupCounterMap_; + + // Whether or not wait() and synchronize() are blocking operations that wait + // for the operation to complete. + bool blockingWait_ = false; + + // Whether to abort the communicators when users call destroy_process_group(). + // If yes, communicators will be aborted when destroy_process_group is called, + // but not in destructor. + bool abortInDestroyProcessGroup_ = false; + + // Whether or not to hook the cache allocator to register all allocated + // tensors + bool useTensorRegisterAllocatorHook_ = false; + + // Whether or not the workCleanupThread is used to perform async error + // handling. + ErrorHandlingMode asyncErrorHandling_ = NoHandling; + + // Whether or not to enable timeout root cause analysis. + bool desyncDebug_; + + // Whether or not to dump debug info on timeout + bool dumpOnTimeout_; + + // Whether or not to create start CUDAEvent and enable timing for start + // and end events. Note that enableTiming_ is always true if desyncDebug_ + // is set to true. + std::atomic enableTiming_; + + // Flag to enable the print of hash value of input/output of collectives for + // verification. + std::atomic enableCollecticeHashDebug_; + + // Whether or not TORCH_NCCL_AVOID_RECORD_STREAMS was set + bool avoidRecordStreams_ = false; + + // Set of communicators that this process group has aborted and their + // ncclUniqueId has been written to the store. We don't need a lock + // for this map since only the watchdog thread accesses this set. The + // set contains the string representation of ncclUniqueId. + std::unordered_set abortedComms_; + + // The number of active ncclGroupStart() calls. This counter will be increased + // by 1 when ncclGroupStart() is called and decreased by 1 when ncclGroupEnd() + // is called. + static thread_local uint64_t ncclActiveGroupCounter_; + + // Counting for the sequential number of NCCL collective call. + // (specifically, how many actual kernels we launched, which differs from + // op_id_ when coalescing is enabled) + uint64_t seq_{0}; + + // Incrementing counter for logical operations (collective or p2p) issued on + // the ProcessGroup + uint64_t op_id_{0}; + + // the sequential number of the last colletive enqueued into workMetaList_ + // This is useful for indentifying a rank that has not join a collective + uint64_t lastEnqueuedSeq_; + + // the sequential number of the last colletive completed marked by + // the watchdog thread + uint64_t lastCompletedSeq_; + + std::exception_ptr watchDogException_ = nullptr; + + size_t uid_; + + std::string logPrefix_; + + c10::intrusive_ptr intraNodeComm_; +}; + +TORCH_API std::string dump_nccl_trace(); + +// Gets a mutable reference to a global optional function. Heartbeat Monitor +// will query this function and if available, call it to dump traces. Inside +// fbcode, we store a function here that uses an internal tool for process +// tracing +TORCH_API c10::optional>& get_cpp_trace_dumper(); + +// Similar to get_cpp_trace_dumper, this stores a function defined in +// torch-python layer that lets us check whether the GIL can be acquired, +// helpful for instrumenting in cases where a hang was observed. +typedef bool (*gil_checker_t)(); + +TORCH_API gil_checker_t& get_gil_checker(); +} // namespace c10d + +#endif // USE_C10D_NCCL diff --git a/shared/package-files/7c/7c032686ee5e27ecc027eb267ea430442950dfe9e8cce0a6bc9ebe13c960189a/entry_points.txt b/shared/package-files/7c/7c032686ee5e27ecc027eb267ea430442950dfe9e8cce0a6bc9ebe13c960189a/entry_points.txt new file mode 100644 index 0000000000000000000000000000000000000000..a884269e7fc0d5f0cd96ba63c8d473c6560264b6 --- /dev/null +++ b/shared/package-files/7c/7c032686ee5e27ecc027eb267ea430442950dfe9e8cce0a6bc9ebe13c960189a/entry_points.txt @@ -0,0 +1,3 @@ +[console_scripts] +chardetect = chardet.cli.chardetect:main + diff --git a/shared/package-files/7c/7c03274b750f4a417059397a0c88ddeacf41ac5d3bc488cb49d5019e0afa5caa/hmod1 b/shared/package-files/7c/7c03274b750f4a417059397a0c88ddeacf41ac5d3bc488cb49d5019e0afa5caa/hmod1 new file mode 100644 index 0000000000000000000000000000000000000000..b8f0d0f5294ad1e182499c0729e6b7371fff6a5e Binary files /dev/null and b/shared/package-files/7c/7c03274b750f4a417059397a0c88ddeacf41ac5d3bc488cb49d5019e0afa5caa/hmod1 differ diff --git a/shared/package-files/7c/7c03ddb098804456e43c08a1e8d918af2d1da63e233ea7a5195325138c16156f/unicode.py b/shared/package-files/7c/7c03ddb098804456e43c08a1e8d918af2d1da63e233ea7a5195325138c16156f/unicode.py new file mode 100644 index 0000000000000000000000000000000000000000..ec0b3a4fe6055b276d5515a4e81d60d921c6f381 --- /dev/null +++ b/shared/package-files/7c/7c03ddb098804456e43c08a1e8d918af2d1da63e233ea7a5195325138c16156f/unicode.py @@ -0,0 +1,361 @@ +# unicode.py + +import sys +from itertools import filterfalse +from typing import List, Tuple, Union + + +class _lazyclassproperty: + def __init__(self, fn): + self.fn = fn + self.__doc__ = fn.__doc__ + self.__name__ = fn.__name__ + + def __get__(self, obj, cls): + if cls is None: + cls = type(obj) + if not hasattr(cls, "_intern") or any( + cls._intern is getattr(superclass, "_intern", []) + for superclass in cls.__mro__[1:] + ): + cls._intern = {} + attrname = self.fn.__name__ + if attrname not in cls._intern: + cls._intern[attrname] = self.fn(cls) + return cls._intern[attrname] + + +UnicodeRangeList = List[Union[Tuple[int, int], Tuple[int]]] + + +class unicode_set: + """ + A set of Unicode characters, for language-specific strings for + ``alphas``, ``nums``, ``alphanums``, and ``printables``. + A unicode_set is defined by a list of ranges in the Unicode character + set, in a class attribute ``_ranges``. Ranges can be specified using + 2-tuples or a 1-tuple, such as:: + + _ranges = [ + (0x0020, 0x007e), + (0x00a0, 0x00ff), + (0x0100,), + ] + + Ranges are left- and right-inclusive. A 1-tuple of (x,) is treated as (x, x). + + A unicode set can also be defined using multiple inheritance of other unicode sets:: + + class CJK(Chinese, Japanese, Korean): + pass + """ + + _ranges: UnicodeRangeList = [] + + @_lazyclassproperty + def _chars_for_ranges(cls): + ret = [] + for cc in cls.__mro__: + if cc is unicode_set: + break + for rr in getattr(cc, "_ranges", ()): + ret.extend(range(rr[0], rr[-1] + 1)) + return [chr(c) for c in sorted(set(ret))] + + @_lazyclassproperty + def printables(cls): + """all non-whitespace characters in this range""" + return "".join(filterfalse(str.isspace, cls._chars_for_ranges)) + + @_lazyclassproperty + def alphas(cls): + """all alphabetic characters in this range""" + return "".join(filter(str.isalpha, cls._chars_for_ranges)) + + @_lazyclassproperty + def nums(cls): + """all numeric digit characters in this range""" + return "".join(filter(str.isdigit, cls._chars_for_ranges)) + + @_lazyclassproperty + def alphanums(cls): + """all alphanumeric characters in this range""" + return cls.alphas + cls.nums + + @_lazyclassproperty + def identchars(cls): + """all characters in this range that are valid identifier characters, plus underscore '_'""" + return "".join( + sorted( + set( + "".join(filter(str.isidentifier, cls._chars_for_ranges)) + + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzªµº" + + "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ" + + "_" + ) + ) + ) + + @_lazyclassproperty + def identbodychars(cls): + """ + all characters in this range that are valid identifier body characters, + plus the digits 0-9, and · (Unicode MIDDLE DOT) + """ + return "".join( + sorted( + set( + cls.identchars + + "0123456789·" + + "".join( + [c for c in cls._chars_for_ranges if ("_" + c).isidentifier()] + ) + ) + ) + ) + + @_lazyclassproperty + def identifier(cls): + """ + a pyparsing Word expression for an identifier using this range's definitions for + identchars and identbodychars + """ + from pip._vendor.pyparsing import Word + + return Word(cls.identchars, cls.identbodychars) + + +class pyparsing_unicode(unicode_set): + """ + A namespace class for defining common language unicode_sets. + """ + + # fmt: off + + # define ranges in language character sets + _ranges: UnicodeRangeList = [ + (0x0020, sys.maxunicode), + ] + + class BasicMultilingualPlane(unicode_set): + """Unicode set for the Basic Multilingual Plane""" + _ranges: UnicodeRangeList = [ + (0x0020, 0xFFFF), + ] + + class Latin1(unicode_set): + """Unicode set for Latin-1 Unicode Character Range""" + _ranges: UnicodeRangeList = [ + (0x0020, 0x007E), + (0x00A0, 0x00FF), + ] + + class LatinA(unicode_set): + """Unicode set for Latin-A Unicode Character Range""" + _ranges: UnicodeRangeList = [ + (0x0100, 0x017F), + ] + + class LatinB(unicode_set): + """Unicode set for Latin-B Unicode Character Range""" + _ranges: UnicodeRangeList = [ + (0x0180, 0x024F), + ] + + class Greek(unicode_set): + """Unicode set for Greek Unicode Character Ranges""" + _ranges: UnicodeRangeList = [ + (0x0342, 0x0345), + (0x0370, 0x0377), + (0x037A, 0x037F), + (0x0384, 0x038A), + (0x038C,), + (0x038E, 0x03A1), + (0x03A3, 0x03E1), + (0x03F0, 0x03FF), + (0x1D26, 0x1D2A), + (0x1D5E,), + (0x1D60,), + (0x1D66, 0x1D6A), + (0x1F00, 0x1F15), + (0x1F18, 0x1F1D), + (0x1F20, 0x1F45), + (0x1F48, 0x1F4D), + (0x1F50, 0x1F57), + (0x1F59,), + (0x1F5B,), + (0x1F5D,), + (0x1F5F, 0x1F7D), + (0x1F80, 0x1FB4), + (0x1FB6, 0x1FC4), + (0x1FC6, 0x1FD3), + (0x1FD6, 0x1FDB), + (0x1FDD, 0x1FEF), + (0x1FF2, 0x1FF4), + (0x1FF6, 0x1FFE), + (0x2129,), + (0x2719, 0x271A), + (0xAB65,), + (0x10140, 0x1018D), + (0x101A0,), + (0x1D200, 0x1D245), + (0x1F7A1, 0x1F7A7), + ] + + class Cyrillic(unicode_set): + """Unicode set for Cyrillic Unicode Character Range""" + _ranges: UnicodeRangeList = [ + (0x0400, 0x052F), + (0x1C80, 0x1C88), + (0x1D2B,), + (0x1D78,), + (0x2DE0, 0x2DFF), + (0xA640, 0xA672), + (0xA674, 0xA69F), + (0xFE2E, 0xFE2F), + ] + + class Chinese(unicode_set): + """Unicode set for Chinese Unicode Character Range""" + _ranges: UnicodeRangeList = [ + (0x2E80, 0x2E99), + (0x2E9B, 0x2EF3), + (0x31C0, 0x31E3), + (0x3400, 0x4DB5), + (0x4E00, 0x9FEF), + (0xA700, 0xA707), + (0xF900, 0xFA6D), + (0xFA70, 0xFAD9), + (0x16FE2, 0x16FE3), + (0x1F210, 0x1F212), + (0x1F214, 0x1F23B), + (0x1F240, 0x1F248), + (0x20000, 0x2A6D6), + (0x2A700, 0x2B734), + (0x2B740, 0x2B81D), + (0x2B820, 0x2CEA1), + (0x2CEB0, 0x2EBE0), + (0x2F800, 0x2FA1D), + ] + + class Japanese(unicode_set): + """Unicode set for Japanese Unicode Character Range, combining Kanji, Hiragana, and Katakana ranges""" + + class Kanji(unicode_set): + "Unicode set for Kanji Unicode Character Range" + _ranges: UnicodeRangeList = [ + (0x4E00, 0x9FBF), + (0x3000, 0x303F), + ] + + class Hiragana(unicode_set): + """Unicode set for Hiragana Unicode Character Range""" + _ranges: UnicodeRangeList = [ + (0x3041, 0x3096), + (0x3099, 0x30A0), + (0x30FC,), + (0xFF70,), + (0x1B001,), + (0x1B150, 0x1B152), + (0x1F200,), + ] + + class Katakana(unicode_set): + """Unicode set for Katakana Unicode Character Range""" + _ranges: UnicodeRangeList = [ + (0x3099, 0x309C), + (0x30A0, 0x30FF), + (0x31F0, 0x31FF), + (0x32D0, 0x32FE), + (0xFF65, 0xFF9F), + (0x1B000,), + (0x1B164, 0x1B167), + (0x1F201, 0x1F202), + (0x1F213,), + ] + + 漢字 = Kanji + カタカナ = Katakana + ひらがな = Hiragana + + _ranges = ( + Kanji._ranges + + Hiragana._ranges + + Katakana._ranges + ) + + class Hangul(unicode_set): + """Unicode set for Hangul (Korean) Unicode Character Range""" + _ranges: UnicodeRangeList = [ + (0x1100, 0x11FF), + (0x302E, 0x302F), + (0x3131, 0x318E), + (0x3200, 0x321C), + (0x3260, 0x327B), + (0x327E,), + (0xA960, 0xA97C), + (0xAC00, 0xD7A3), + (0xD7B0, 0xD7C6), + (0xD7CB, 0xD7FB), + (0xFFA0, 0xFFBE), + (0xFFC2, 0xFFC7), + (0xFFCA, 0xFFCF), + (0xFFD2, 0xFFD7), + (0xFFDA, 0xFFDC), + ] + + Korean = Hangul + + class CJK(Chinese, Japanese, Hangul): + """Unicode set for combined Chinese, Japanese, and Korean (CJK) Unicode Character Range""" + + class Thai(unicode_set): + """Unicode set for Thai Unicode Character Range""" + _ranges: UnicodeRangeList = [ + (0x0E01, 0x0E3A), + (0x0E3F, 0x0E5B) + ] + + class Arabic(unicode_set): + """Unicode set for Arabic Unicode Character Range""" + _ranges: UnicodeRangeList = [ + (0x0600, 0x061B), + (0x061E, 0x06FF), + (0x0700, 0x077F), + ] + + class Hebrew(unicode_set): + """Unicode set for Hebrew Unicode Character Range""" + _ranges: UnicodeRangeList = [ + (0x0591, 0x05C7), + (0x05D0, 0x05EA), + (0x05EF, 0x05F4), + (0xFB1D, 0xFB36), + (0xFB38, 0xFB3C), + (0xFB3E,), + (0xFB40, 0xFB41), + (0xFB43, 0xFB44), + (0xFB46, 0xFB4F), + ] + + class Devanagari(unicode_set): + """Unicode set for Devanagari Unicode Character Range""" + _ranges: UnicodeRangeList = [ + (0x0900, 0x097F), + (0xA8E0, 0xA8FF) + ] + + BMP = BasicMultilingualPlane + + # add language identifiers using language Unicode + العربية = Arabic + 中文 = Chinese + кириллица = Cyrillic + Ελληνικά = Greek + עִברִית = Hebrew + 日本語 = Japanese + 한국어 = Korean + ไทย = Thai + देवनागरी = Devanagari + + # fmt: on diff --git a/shared/package-files/7c/7c0436a823b2263fa13522d016b6340832c2571ba946805f4426ee2943de0dde/is_nonzero_ops.h b/shared/package-files/7c/7c0436a823b2263fa13522d016b6340832c2571ba946805f4426ee2943de0dde/is_nonzero_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..6985552fa21a5903ee26a765baeeb81f02c19aff --- /dev/null +++ b/shared/package-files/7c/7c0436a823b2263fa13522d016b6340832c2571ba946805f4426ee2943de0dde/is_nonzero_ops.h @@ -0,0 +1,28 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API is_nonzero { + using schema = bool (const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::is_nonzero") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "is_nonzero(Tensor self) -> bool") + static bool call(const at::Tensor & self); + static bool redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/7c/7c049b8348bb88b8892048f9bc89220ee4eadf0534cf798a258d35f64ccaac59/test__plotutils.py b/shared/package-files/7c/7c049b8348bb88b8892048f9bc89220ee4eadf0534cf798a258d35f64ccaac59/test__plotutils.py new file mode 100644 index 0000000000000000000000000000000000000000..0e2553bf7ad56e97b567e5b334ccf17921f7f7f3 --- /dev/null +++ b/shared/package-files/7c/7c049b8348bb88b8892048f9bc89220ee4eadf0534cf798a258d35f64ccaac59/test__plotutils.py @@ -0,0 +1,91 @@ +import pytest +import numpy as np +from numpy.testing import assert_, assert_array_equal, assert_allclose + +try: + import matplotlib + matplotlib.rcParams['backend'] = 'Agg' + import matplotlib.pyplot as plt + has_matplotlib = True +except Exception: + has_matplotlib = False + +from scipy.spatial import \ + delaunay_plot_2d, voronoi_plot_2d, convex_hull_plot_2d, \ + Delaunay, Voronoi, ConvexHull + + +@pytest.mark.skipif(not has_matplotlib, reason="Matplotlib not available") +class TestPlotting: + points = [(0,0), (0,1), (1,0), (1,1)] + + def test_delaunay(self): + # Smoke test + fig = plt.figure() + obj = Delaunay(self.points) + s_before = obj.simplices.copy() + r = delaunay_plot_2d(obj, ax=fig.gca()) + assert_array_equal(obj.simplices, s_before) # shouldn't modify + assert_(r is fig) + delaunay_plot_2d(obj, ax=fig.gca()) + + def test_voronoi(self): + # Smoke test + fig = plt.figure() + obj = Voronoi(self.points) + r = voronoi_plot_2d(obj, ax=fig.gca()) + assert_(r is fig) + voronoi_plot_2d(obj) + voronoi_plot_2d(obj, show_vertices=False) + + def test_convex_hull(self): + # Smoke test + fig = plt.figure() + tri = ConvexHull(self.points) + r = convex_hull_plot_2d(tri, ax=fig.gca()) + assert_(r is fig) + convex_hull_plot_2d(tri) + + def test_gh_19653(self): + # aspect ratio sensitivity of voronoi_plot_2d + # infinite Voronoi edges + points = np.array([[245.059986986012, 10.971011721360075], + [320.49044143557785, 10.970258360366753], + [239.79023081978914, 13.108487516946218], + [263.38325791238833, 12.93241352743668], + [219.53334398353175, 13.346107628161008]]) + vor = Voronoi(points) + fig = voronoi_plot_2d(vor) + ax = fig.gca() + infinite_segments = ax.collections[1].get_segments() + expected_segments = np.array([[[282.77256, -254.76904], + [282.729714, -4544.744698]], + [[282.77256014, -254.76904029], + [430.08561382, 4032.67658742]], + [[229.26733285, -20.39957514], + [-168.17167404, -4291.92545966]], + [[289.93433364, 5151.40412217], + [330.40553385, 9441.18887532]]]) + assert_allclose(infinite_segments, expected_segments) + + def test_gh_19653_smaller_aspect(self): + # reasonable behavior for less extreme aspect + # ratio + points = np.array([[24.059986986012, 10.971011721360075], + [32.49044143557785, 10.970258360366753], + [23.79023081978914, 13.108487516946218], + [26.38325791238833, 12.93241352743668], + [21.53334398353175, 13.346107628161008]]) + vor = Voronoi(points) + fig = voronoi_plot_2d(vor) + ax = fig.gca() + infinite_segments = ax.collections[1].get_segments() + expected_segments = np.array([[[28.274979, 8.335027], + [28.270463, -42.19763338]], + [[28.27497869, 8.33502697], + [43.73223829, 56.44555501]], + [[22.51805823, 11.8621754], + [-12.09266506, -24.95694485]], + [[29.53092448, 78.46952378], + [33.82572726, 128.81934455]]]) + assert_allclose(infinite_segments, expected_segments) diff --git a/shared/package-files/7c/7c052b3585b286a4204bb460c5ff89af0afa9a201f28e08cdbc1ccdc10a353d9/std_mean.h b/shared/package-files/7c/7c052b3585b286a4204bb460c5ff89af0afa9a201f28e08cdbc1ccdc10a353d9/std_mean.h new file mode 100644 index 0000000000000000000000000000000000000000..8c53e460f7bd6405575282ba3ece851c760cfb40 --- /dev/null +++ b/shared/package-files/7c/7c052b3585b286a4204bb460c5ff89af0afa9a201f28e08cdbc1ccdc10a353d9/std_mean.h @@ -0,0 +1,59 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::std_mean(Tensor self, bool unbiased=True) -> (Tensor, Tensor) +inline ::std::tuple std_mean(const at::Tensor & self, bool unbiased) { + return at::_ops::std_mean::call(self, unbiased); +} + +// aten::std_mean.dim(Tensor self, int[1]? dim, bool unbiased=True, bool keepdim=False) -> (Tensor, Tensor) +inline ::std::tuple std_mean(const at::Tensor & self, at::OptionalIntArrayRef dim, bool unbiased, bool keepdim=false) { + return at::_ops::std_mean_dim::call(self, dim, unbiased, keepdim); +} + +// aten::std_mean.correction(Tensor self, int[1]? dim=None, *, Scalar? correction=None, bool keepdim=False) -> (Tensor, Tensor) +inline ::std::tuple std_mean(const at::Tensor & self, at::OptionalIntArrayRef dim=c10::nullopt, const c10::optional & correction=c10::nullopt, bool keepdim=false) { + return at::_ops::std_mean_correction::call(self, dim, correction, keepdim); +} + +// aten::std_mean.names_dim(Tensor self, Dimname[1] dim, bool unbiased=True, bool keepdim=False) -> (Tensor, Tensor) +inline ::std::tuple std_mean(const at::Tensor & self, at::DimnameList dim, bool unbiased, bool keepdim=false) { + return at::_ops::std_mean_names_dim::call(self, dim, unbiased, keepdim); +} + +// aten::std_mean.correction_names(Tensor self, Dimname[1] dim, *, Scalar? correction=None, bool keepdim=False) -> (Tensor, Tensor) +inline ::std::tuple std_mean(const at::Tensor & self, at::DimnameList dim, const c10::optional & correction=c10::nullopt, bool keepdim=false) { + return at::_ops::std_mean_correction_names::call(self, dim, correction, keepdim); +} + +// aten::std_mean.correction_out(Tensor self, int[1]? dim=None, *, Scalar? correction=None, bool keepdim=False, Tensor(a!) out0, Tensor(b!) out1) -> (Tensor(a!), Tensor(b!)) +inline ::std::tuple std_mean_out(at::Tensor & out0, at::Tensor & out1, const at::Tensor & self, at::OptionalIntArrayRef dim=c10::nullopt, const c10::optional & correction=c10::nullopt, bool keepdim=false) { + return at::_ops::std_mean_correction_out::call(self, dim, correction, keepdim, out0, out1); +} +// aten::std_mean.correction_out(Tensor self, int[1]? dim=None, *, Scalar? correction=None, bool keepdim=False, Tensor(a!) out0, Tensor(b!) out1) -> (Tensor(a!), Tensor(b!)) +inline ::std::tuple std_mean_outf(const at::Tensor & self, at::OptionalIntArrayRef dim, const c10::optional & correction, bool keepdim, at::Tensor & out0, at::Tensor & out1) { + return at::_ops::std_mean_correction_out::call(self, dim, correction, keepdim, out0, out1); +} + +} diff --git a/shared/package-files/7c/7c061a460bafc10d15c51d693fee3fe7e6ffc21dcfcfd8f3b4f55177cc38b0cf/batch_norm_backward_reduce.h b/shared/package-files/7c/7c061a460bafc10d15c51d693fee3fe7e6ffc21dcfcfd8f3b4f55177cc38b0cf/batch_norm_backward_reduce.h new file mode 100644 index 0000000000000000000000000000000000000000..20379c92b81b413a3aaba5d6a31d91c61313afaf --- /dev/null +++ b/shared/package-files/7c/7c061a460bafc10d15c51d693fee3fe7e6ffc21dcfcfd8f3b4f55177cc38b0cf/batch_norm_backward_reduce.h @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::batch_norm_backward_reduce(Tensor grad_out, Tensor input, Tensor mean, Tensor invstd, Tensor? weight, bool input_g, bool weight_g, bool bias_g) -> (Tensor, Tensor, Tensor, Tensor) +inline ::std::tuple batch_norm_backward_reduce(const at::Tensor & grad_out, const at::Tensor & input, const at::Tensor & mean, const at::Tensor & invstd, const c10::optional & weight, bool input_g, bool weight_g, bool bias_g) { + return at::_ops::batch_norm_backward_reduce::call(grad_out, input, mean, invstd, weight, input_g, weight_g, bias_g); +} + +// aten::batch_norm_backward_reduce.out(Tensor grad_out, Tensor input, Tensor mean, Tensor invstd, Tensor? weight, bool input_g, bool weight_g, bool bias_g, *, Tensor(a!) out0, Tensor(b!) out1, Tensor(c!) out2, Tensor(d!) out3) -> (Tensor(a!), Tensor(b!), Tensor(c!), Tensor(d!)) +inline ::std::tuple batch_norm_backward_reduce_out(at::Tensor & out0, at::Tensor & out1, at::Tensor & out2, at::Tensor & out3, const at::Tensor & grad_out, const at::Tensor & input, const at::Tensor & mean, const at::Tensor & invstd, const c10::optional & weight, bool input_g, bool weight_g, bool bias_g) { + return at::_ops::batch_norm_backward_reduce_out::call(grad_out, input, mean, invstd, weight, input_g, weight_g, bias_g, out0, out1, out2, out3); +} +// aten::batch_norm_backward_reduce.out(Tensor grad_out, Tensor input, Tensor mean, Tensor invstd, Tensor? weight, bool input_g, bool weight_g, bool bias_g, *, Tensor(a!) out0, Tensor(b!) out1, Tensor(c!) out2, Tensor(d!) out3) -> (Tensor(a!), Tensor(b!), Tensor(c!), Tensor(d!)) +inline ::std::tuple batch_norm_backward_reduce_outf(const at::Tensor & grad_out, const at::Tensor & input, const at::Tensor & mean, const at::Tensor & invstd, const c10::optional & weight, bool input_g, bool weight_g, bool bias_g, at::Tensor & out0, at::Tensor & out1, at::Tensor & out2, at::Tensor & out3) { + return at::_ops::batch_norm_backward_reduce_out::call(grad_out, input, mean, invstd, weight, input_g, weight_g, bias_g, out0, out1, out2, out3); +} + +} diff --git a/shared/package-files/7c/7c061fcc9d5ce53a6e293335e292b4f2aeb6b320c523b1ec79d491c4d7d2c1c3/_native_batch_norm_legit_no_training_native.h b/shared/package-files/7c/7c061fcc9d5ce53a6e293335e292b4f2aeb6b320c523b1ec79d491c4d7d2c1c3/_native_batch_norm_legit_no_training_native.h new file mode 100644 index 0000000000000000000000000000000000000000..5d0958b6ddb1b27e574b2d6337c8673881218945 --- /dev/null +++ b/shared/package-files/7c/7c061fcc9d5ce53a6e293335e292b4f2aeb6b320c523b1ec79d491c4d7d2c1c3/_native_batch_norm_legit_no_training_native.h @@ -0,0 +1,22 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API ::std::tuple _batch_norm_legit_no_training(const at::Tensor & input, const c10::optional & weight, const c10::optional & bias, const at::Tensor & running_mean, const at::Tensor & running_var, double momentum, double eps); +TORCH_API ::std::tuple _native_batch_norm_legit_no_training_out(const at::Tensor & input, const c10::optional & weight, const c10::optional & bias, const at::Tensor & running_mean, const at::Tensor & running_var, double momentum, double eps, at::Tensor & out0, at::Tensor & out1, at::Tensor & out2); +} // namespace native +} // namespace at diff --git a/shared/package-files/7c/7c08b91b35ae33d98a51eb0964ee7a2dc3c254c0ed9bae1cdad0bf614a48d6ab/cmdoptions.py b/shared/package-files/7c/7c08b91b35ae33d98a51eb0964ee7a2dc3c254c0ed9bae1cdad0bf614a48d6ab/cmdoptions.py new file mode 100644 index 0000000000000000000000000000000000000000..8fb16dc4a6a2d45a8e762aa182100ecd4506b3b5 --- /dev/null +++ b/shared/package-files/7c/7c08b91b35ae33d98a51eb0964ee7a2dc3c254c0ed9bae1cdad0bf614a48d6ab/cmdoptions.py @@ -0,0 +1,1077 @@ +""" +shared options and groups + +The principle here is to define options once, but *not* instantiate them +globally. One reason being that options with action='append' can carry state +between parses. pip parses general options twice internally, and shouldn't +pass on state. To be consistent, all options will follow this design. +""" + +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + +import importlib.util +import logging +import os +import textwrap +from functools import partial +from optparse import SUPPRESS_HELP, Option, OptionGroup, OptionParser, Values +from textwrap import dedent +from typing import Any, Callable, Dict, Optional, Tuple + +from pip._vendor.packaging.utils import canonicalize_name + +from pip._internal.cli.parser import ConfigOptionParser +from pip._internal.exceptions import CommandError +from pip._internal.locations import USER_CACHE_DIR, get_src_prefix +from pip._internal.models.format_control import FormatControl +from pip._internal.models.index import PyPI +from pip._internal.models.target_python import TargetPython +from pip._internal.utils.hashes import STRONG_HASHES +from pip._internal.utils.misc import strtobool + +logger = logging.getLogger(__name__) + + +def raise_option_error(parser: OptionParser, option: Option, msg: str) -> None: + """ + Raise an option parsing error using parser.error(). + + Args: + parser: an OptionParser instance. + option: an Option instance. + msg: the error text. + """ + msg = f"{option} error: {msg}" + msg = textwrap.fill(" ".join(msg.split())) + parser.error(msg) + + +def make_option_group(group: Dict[str, Any], parser: ConfigOptionParser) -> OptionGroup: + """ + Return an OptionGroup object + group -- assumed to be dict with 'name' and 'options' keys + parser -- an optparse Parser + """ + option_group = OptionGroup(parser, group["name"]) + for option in group["options"]: + option_group.add_option(option()) + return option_group + + +def check_dist_restriction(options: Values, check_target: bool = False) -> None: + """Function for determining if custom platform options are allowed. + + :param options: The OptionParser options. + :param check_target: Whether or not to check if --target is being used. + """ + dist_restriction_set = any( + [ + options.python_version, + options.platforms, + options.abis, + options.implementation, + ] + ) + + binary_only = FormatControl(set(), {":all:"}) + sdist_dependencies_allowed = ( + options.format_control != binary_only and not options.ignore_dependencies + ) + + # Installations or downloads using dist restrictions must not combine + # source distributions and dist-specific wheels, as they are not + # guaranteed to be locally compatible. + if dist_restriction_set and sdist_dependencies_allowed: + raise CommandError( + "When restricting platform and interpreter constraints using " + "--python-version, --platform, --abi, or --implementation, " + "either --no-deps must be set, or --only-binary=:all: must be " + "set and --no-binary must not be set (or must be set to " + ":none:)." + ) + + if check_target: + if not options.dry_run and dist_restriction_set and not options.target_dir: + raise CommandError( + "Can not use any platform or abi specific options unless " + "installing via '--target' or using '--dry-run'" + ) + + +def _path_option_check(option: Option, opt: str, value: str) -> str: + return os.path.expanduser(value) + + +def _package_name_option_check(option: Option, opt: str, value: str) -> str: + return canonicalize_name(value) + + +class PipOption(Option): + TYPES = Option.TYPES + ("path", "package_name") + TYPE_CHECKER = Option.TYPE_CHECKER.copy() + TYPE_CHECKER["package_name"] = _package_name_option_check + TYPE_CHECKER["path"] = _path_option_check + + +########### +# options # +########### + +help_: Callable[..., Option] = partial( + Option, + "-h", + "--help", + dest="help", + action="help", + help="Show help.", +) + +debug_mode: Callable[..., Option] = partial( + Option, + "--debug", + dest="debug_mode", + action="store_true", + default=False, + help=( + "Let unhandled exceptions propagate outside the main subroutine, " + "instead of logging them to stderr." + ), +) + +isolated_mode: Callable[..., Option] = partial( + Option, + "--isolated", + dest="isolated_mode", + action="store_true", + default=False, + help=( + "Run pip in an isolated mode, ignoring environment variables and user " + "configuration." + ), +) + +require_virtualenv: Callable[..., Option] = partial( + Option, + "--require-virtualenv", + "--require-venv", + dest="require_venv", + action="store_true", + default=False, + help=( + "Allow pip to only run in a virtual environment; " + "exit with an error otherwise." + ), +) + +override_externally_managed: Callable[..., Option] = partial( + Option, + "--break-system-packages", + dest="override_externally_managed", + action="store_true", + help="Allow pip to modify an EXTERNALLY-MANAGED Python installation", +) + +python: Callable[..., Option] = partial( + Option, + "--python", + dest="python", + help="Run pip with the specified Python interpreter.", +) + +verbose: Callable[..., Option] = partial( + Option, + "-v", + "--verbose", + dest="verbose", + action="count", + default=0, + help="Give more output. Option is additive, and can be used up to 3 times.", +) + +no_color: Callable[..., Option] = partial( + Option, + "--no-color", + dest="no_color", + action="store_true", + default=False, + help="Suppress colored output.", +) + +version: Callable[..., Option] = partial( + Option, + "-V", + "--version", + dest="version", + action="store_true", + help="Show version and exit.", +) + +quiet: Callable[..., Option] = partial( + Option, + "-q", + "--quiet", + dest="quiet", + action="count", + default=0, + help=( + "Give less output. Option is additive, and can be used up to 3" + " times (corresponding to WARNING, ERROR, and CRITICAL logging" + " levels)." + ), +) + +progress_bar: Callable[..., Option] = partial( + Option, + "--progress-bar", + dest="progress_bar", + type="choice", + choices=["on", "off"], + default="on", + help="Specify whether the progress bar should be used [on, off] (default: on)", +) + +log: Callable[..., Option] = partial( + PipOption, + "--log", + "--log-file", + "--local-log", + dest="log", + metavar="path", + type="path", + help="Path to a verbose appending log.", +) + +no_input: Callable[..., Option] = partial( + Option, + # Don't ask for input + "--no-input", + dest="no_input", + action="store_true", + default=False, + help="Disable prompting for input.", +) + +keyring_provider: Callable[..., Option] = partial( + Option, + "--keyring-provider", + dest="keyring_provider", + choices=["auto", "disabled", "import", "subprocess"], + default="auto", + help=( + "Enable the credential lookup via the keyring library if user input is allowed." + " Specify which mechanism to use [disabled, import, subprocess]." + " (default: disabled)" + ), +) + +proxy: Callable[..., Option] = partial( + Option, + "--proxy", + dest="proxy", + type="str", + default="", + help="Specify a proxy in the form scheme://[user:passwd@]proxy.server:port.", +) + +retries: Callable[..., Option] = partial( + Option, + "--retries", + dest="retries", + type="int", + default=5, + help="Maximum number of retries each connection should attempt " + "(default %default times).", +) + +timeout: Callable[..., Option] = partial( + Option, + "--timeout", + "--default-timeout", + metavar="sec", + dest="timeout", + type="float", + default=15, + help="Set the socket timeout (default %default seconds).", +) + + +def exists_action() -> Option: + return Option( + # Option when path already exist + "--exists-action", + dest="exists_action", + type="choice", + choices=["s", "i", "w", "b", "a"], + default=[], + action="append", + metavar="action", + help="Default action when a path already exists: " + "(s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.", + ) + + +cert: Callable[..., Option] = partial( + PipOption, + "--cert", + dest="cert", + type="path", + metavar="path", + help=( + "Path to PEM-encoded CA certificate bundle. " + "If provided, overrides the default. " + "See 'SSL Certificate Verification' in pip documentation " + "for more information." + ), +) + +client_cert: Callable[..., Option] = partial( + PipOption, + "--client-cert", + dest="client_cert", + type="path", + default=None, + metavar="path", + help="Path to SSL client certificate, a single file containing the " + "private key and the certificate in PEM format.", +) + +index_url: Callable[..., Option] = partial( + Option, + "-i", + "--index-url", + "--pypi-url", + dest="index_url", + metavar="URL", + default=PyPI.simple_url, + help="Base URL of the Python Package Index (default %default). " + "This should point to a repository compliant with PEP 503 " + "(the simple repository API) or a local directory laid out " + "in the same format.", +) + + +def extra_index_url() -> Option: + return Option( + "--extra-index-url", + dest="extra_index_urls", + metavar="URL", + action="append", + default=[], + help="Extra URLs of package indexes to use in addition to " + "--index-url. Should follow the same rules as " + "--index-url.", + ) + + +no_index: Callable[..., Option] = partial( + Option, + "--no-index", + dest="no_index", + action="store_true", + default=False, + help="Ignore package index (only looking at --find-links URLs instead).", +) + + +def find_links() -> Option: + return Option( + "-f", + "--find-links", + dest="find_links", + action="append", + default=[], + metavar="url", + help="If a URL or path to an html file, then parse for links to " + "archives such as sdist (.tar.gz) or wheel (.whl) files. " + "If a local path or file:// URL that's a directory, " + "then look for archives in the directory listing. " + "Links to VCS project URLs are not supported.", + ) + + +def trusted_host() -> Option: + return Option( + "--trusted-host", + dest="trusted_hosts", + action="append", + metavar="HOSTNAME", + default=[], + help="Mark this host or host:port pair as trusted, even though it " + "does not have valid or any HTTPS.", + ) + + +def constraints() -> Option: + return Option( + "-c", + "--constraint", + dest="constraints", + action="append", + default=[], + metavar="file", + help="Constrain versions using the given constraints file. " + "This option can be used multiple times.", + ) + + +def requirements() -> Option: + return Option( + "-r", + "--requirement", + dest="requirements", + action="append", + default=[], + metavar="file", + help="Install from the given requirements file. " + "This option can be used multiple times.", + ) + + +def editable() -> Option: + return Option( + "-e", + "--editable", + dest="editables", + action="append", + default=[], + metavar="path/url", + help=( + "Install a project in editable mode (i.e. setuptools " + '"develop mode") from a local project path or a VCS url.' + ), + ) + + +def _handle_src(option: Option, opt_str: str, value: str, parser: OptionParser) -> None: + value = os.path.abspath(value) + setattr(parser.values, option.dest, value) + + +src: Callable[..., Option] = partial( + PipOption, + "--src", + "--source", + "--source-dir", + "--source-directory", + dest="src_dir", + type="path", + metavar="dir", + default=get_src_prefix(), + action="callback", + callback=_handle_src, + help="Directory to check out editable projects into. " + 'The default in a virtualenv is "/src". ' + 'The default for global installs is "/src".', +) + + +def _get_format_control(values: Values, option: Option) -> Any: + """Get a format_control object.""" + return getattr(values, option.dest) + + +def _handle_no_binary( + option: Option, opt_str: str, value: str, parser: OptionParser +) -> None: + existing = _get_format_control(parser.values, option) + FormatControl.handle_mutual_excludes( + value, + existing.no_binary, + existing.only_binary, + ) + + +def _handle_only_binary( + option: Option, opt_str: str, value: str, parser: OptionParser +) -> None: + existing = _get_format_control(parser.values, option) + FormatControl.handle_mutual_excludes( + value, + existing.only_binary, + existing.no_binary, + ) + + +def no_binary() -> Option: + format_control = FormatControl(set(), set()) + return Option( + "--no-binary", + dest="format_control", + action="callback", + callback=_handle_no_binary, + type="str", + default=format_control, + help="Do not use binary packages. Can be supplied multiple times, and " + 'each time adds to the existing value. Accepts either ":all:" to ' + 'disable all binary packages, ":none:" to empty the set (notice ' + "the colons), or one or more package names with commas between " + "them (no colons). Note that some packages are tricky to compile " + "and may fail to install when this option is used on them.", + ) + + +def only_binary() -> Option: + format_control = FormatControl(set(), set()) + return Option( + "--only-binary", + dest="format_control", + action="callback", + callback=_handle_only_binary, + type="str", + default=format_control, + help="Do not use source packages. Can be supplied multiple times, and " + 'each time adds to the existing value. Accepts either ":all:" to ' + 'disable all source packages, ":none:" to empty the set, or one ' + "or more package names with commas between them. Packages " + "without binary distributions will fail to install when this " + "option is used on them.", + ) + + +platforms: Callable[..., Option] = partial( + Option, + "--platform", + dest="platforms", + metavar="platform", + action="append", + default=None, + help=( + "Only use wheels compatible with . Defaults to the " + "platform of the running system. Use this option multiple times to " + "specify multiple platforms supported by the target interpreter." + ), +) + + +# This was made a separate function for unit-testing purposes. +def _convert_python_version(value: str) -> Tuple[Tuple[int, ...], Optional[str]]: + """ + Convert a version string like "3", "37", or "3.7.3" into a tuple of ints. + + :return: A 2-tuple (version_info, error_msg), where `error_msg` is + non-None if and only if there was a parsing error. + """ + if not value: + # The empty string is the same as not providing a value. + return (None, None) + + parts = value.split(".") + if len(parts) > 3: + return ((), "at most three version parts are allowed") + + if len(parts) == 1: + # Then we are in the case of "3" or "37". + value = parts[0] + if len(value) > 1: + parts = [value[0], value[1:]] + + try: + version_info = tuple(int(part) for part in parts) + except ValueError: + return ((), "each version part must be an integer") + + return (version_info, None) + + +def _handle_python_version( + option: Option, opt_str: str, value: str, parser: OptionParser +) -> None: + """ + Handle a provided --python-version value. + """ + version_info, error_msg = _convert_python_version(value) + if error_msg is not None: + msg = "invalid --python-version value: {!r}: {}".format( + value, + error_msg, + ) + raise_option_error(parser, option=option, msg=msg) + + parser.values.python_version = version_info + + +python_version: Callable[..., Option] = partial( + Option, + "--python-version", + dest="python_version", + metavar="python_version", + action="callback", + callback=_handle_python_version, + type="str", + default=None, + help=dedent( + """\ + The Python interpreter version to use for wheel and "Requires-Python" + compatibility checks. Defaults to a version derived from the running + interpreter. The version can be specified using up to three dot-separated + integers (e.g. "3" for 3.0.0, "3.7" for 3.7.0, or "3.7.3"). A major-minor + version can also be given as a string without dots (e.g. "37" for 3.7.0). + """ + ), +) + + +implementation: Callable[..., Option] = partial( + Option, + "--implementation", + dest="implementation", + metavar="implementation", + default=None, + help=( + "Only use wheels compatible with Python " + "implementation , e.g. 'pp', 'jy', 'cp', " + " or 'ip'. If not specified, then the current " + "interpreter implementation is used. Use 'py' to force " + "implementation-agnostic wheels." + ), +) + + +abis: Callable[..., Option] = partial( + Option, + "--abi", + dest="abis", + metavar="abi", + action="append", + default=None, + help=( + "Only use wheels compatible with Python abi , e.g. 'pypy_41'. " + "If not specified, then the current interpreter abi tag is used. " + "Use this option multiple times to specify multiple abis supported " + "by the target interpreter. Generally you will need to specify " + "--implementation, --platform, and --python-version when using this " + "option." + ), +) + + +def add_target_python_options(cmd_opts: OptionGroup) -> None: + cmd_opts.add_option(platforms()) + cmd_opts.add_option(python_version()) + cmd_opts.add_option(implementation()) + cmd_opts.add_option(abis()) + + +def make_target_python(options: Values) -> TargetPython: + target_python = TargetPython( + platforms=options.platforms, + py_version_info=options.python_version, + abis=options.abis, + implementation=options.implementation, + ) + + return target_python + + +def prefer_binary() -> Option: + return Option( + "--prefer-binary", + dest="prefer_binary", + action="store_true", + default=False, + help=( + "Prefer binary packages over source packages, even if the " + "source packages are newer." + ), + ) + + +cache_dir: Callable[..., Option] = partial( + PipOption, + "--cache-dir", + dest="cache_dir", + default=USER_CACHE_DIR, + metavar="dir", + type="path", + help="Store the cache data in .", +) + + +def _handle_no_cache_dir( + option: Option, opt: str, value: str, parser: OptionParser +) -> None: + """ + Process a value provided for the --no-cache-dir option. + + This is an optparse.Option callback for the --no-cache-dir option. + """ + # The value argument will be None if --no-cache-dir is passed via the + # command-line, since the option doesn't accept arguments. However, + # the value can be non-None if the option is triggered e.g. by an + # environment variable, like PIP_NO_CACHE_DIR=true. + if value is not None: + # Then parse the string value to get argument error-checking. + try: + strtobool(value) + except ValueError as exc: + raise_option_error(parser, option=option, msg=str(exc)) + + # Originally, setting PIP_NO_CACHE_DIR to a value that strtobool() + # converted to 0 (like "false" or "no") caused cache_dir to be disabled + # rather than enabled (logic would say the latter). Thus, we disable + # the cache directory not just on values that parse to True, but (for + # backwards compatibility reasons) also on values that parse to False. + # In other words, always set it to False if the option is provided in + # some (valid) form. + parser.values.cache_dir = False + + +no_cache: Callable[..., Option] = partial( + Option, + "--no-cache-dir", + dest="cache_dir", + action="callback", + callback=_handle_no_cache_dir, + help="Disable the cache.", +) + +no_deps: Callable[..., Option] = partial( + Option, + "--no-deps", + "--no-dependencies", + dest="ignore_dependencies", + action="store_true", + default=False, + help="Don't install package dependencies.", +) + +ignore_requires_python: Callable[..., Option] = partial( + Option, + "--ignore-requires-python", + dest="ignore_requires_python", + action="store_true", + help="Ignore the Requires-Python information.", +) + +no_build_isolation: Callable[..., Option] = partial( + Option, + "--no-build-isolation", + dest="build_isolation", + action="store_false", + default=True, + help="Disable isolation when building a modern source distribution. " + "Build dependencies specified by PEP 518 must be already installed " + "if this option is used.", +) + +check_build_deps: Callable[..., Option] = partial( + Option, + "--check-build-dependencies", + dest="check_build_deps", + action="store_true", + default=False, + help="Check the build dependencies when PEP517 is used.", +) + + +def _handle_no_use_pep517( + option: Option, opt: str, value: str, parser: OptionParser +) -> None: + """ + Process a value provided for the --no-use-pep517 option. + + This is an optparse.Option callback for the no_use_pep517 option. + """ + # Since --no-use-pep517 doesn't accept arguments, the value argument + # will be None if --no-use-pep517 is passed via the command-line. + # However, the value can be non-None if the option is triggered e.g. + # by an environment variable, for example "PIP_NO_USE_PEP517=true". + if value is not None: + msg = """A value was passed for --no-use-pep517, + probably using either the PIP_NO_USE_PEP517 environment variable + or the "no-use-pep517" config file option. Use an appropriate value + of the PIP_USE_PEP517 environment variable or the "use-pep517" + config file option instead. + """ + raise_option_error(parser, option=option, msg=msg) + + # If user doesn't wish to use pep517, we check if setuptools and wheel are installed + # and raise error if it is not. + packages = ("setuptools", "wheel") + if not all(importlib.util.find_spec(package) for package in packages): + msg = ( + f"It is not possible to use --no-use-pep517 " + f"without {' and '.join(packages)} installed." + ) + raise_option_error(parser, option=option, msg=msg) + + # Otherwise, --no-use-pep517 was passed via the command-line. + parser.values.use_pep517 = False + + +use_pep517: Any = partial( + Option, + "--use-pep517", + dest="use_pep517", + action="store_true", + default=None, + help="Use PEP 517 for building source distributions " + "(use --no-use-pep517 to force legacy behaviour).", +) + +no_use_pep517: Any = partial( + Option, + "--no-use-pep517", + dest="use_pep517", + action="callback", + callback=_handle_no_use_pep517, + default=None, + help=SUPPRESS_HELP, +) + + +def _handle_config_settings( + option: Option, opt_str: str, value: str, parser: OptionParser +) -> None: + key, sep, val = value.partition("=") + if sep != "=": + parser.error(f"Arguments to {opt_str} must be of the form KEY=VAL") + dest = getattr(parser.values, option.dest) + if dest is None: + dest = {} + setattr(parser.values, option.dest, dest) + if key in dest: + if isinstance(dest[key], list): + dest[key].append(val) + else: + dest[key] = [dest[key], val] + else: + dest[key] = val + + +config_settings: Callable[..., Option] = partial( + Option, + "-C", + "--config-settings", + dest="config_settings", + type=str, + action="callback", + callback=_handle_config_settings, + metavar="settings", + help="Configuration settings to be passed to the PEP 517 build backend. " + "Settings take the form KEY=VALUE. Use multiple --config-settings options " + "to pass multiple keys to the backend.", +) + +build_options: Callable[..., Option] = partial( + Option, + "--build-option", + dest="build_options", + metavar="options", + action="append", + help="Extra arguments to be supplied to 'setup.py bdist_wheel'.", +) + +global_options: Callable[..., Option] = partial( + Option, + "--global-option", + dest="global_options", + action="append", + metavar="options", + help="Extra global options to be supplied to the setup.py " + "call before the install or bdist_wheel command.", +) + +no_clean: Callable[..., Option] = partial( + Option, + "--no-clean", + action="store_true", + default=False, + help="Don't clean up build directories.", +) + +pre: Callable[..., Option] = partial( + Option, + "--pre", + action="store_true", + default=False, + help="Include pre-release and development versions. By default, " + "pip only finds stable versions.", +) + +disable_pip_version_check: Callable[..., Option] = partial( + Option, + "--disable-pip-version-check", + dest="disable_pip_version_check", + action="store_true", + default=False, + help="Don't periodically check PyPI to determine whether a new version " + "of pip is available for download. Implied with --no-index.", +) + +root_user_action: Callable[..., Option] = partial( + Option, + "--root-user-action", + dest="root_user_action", + default="warn", + choices=["warn", "ignore"], + help="Action if pip is run as a root user. By default, a warning message is shown.", +) + + +def _handle_merge_hash( + option: Option, opt_str: str, value: str, parser: OptionParser +) -> None: + """Given a value spelled "algo:digest", append the digest to a list + pointed to in a dict by the algo name.""" + if not parser.values.hashes: + parser.values.hashes = {} + try: + algo, digest = value.split(":", 1) + except ValueError: + parser.error( + "Arguments to {} must be a hash name " + "followed by a value, like --hash=sha256:" + "abcde...".format(opt_str) + ) + if algo not in STRONG_HASHES: + parser.error( + "Allowed hash algorithms for {} are {}.".format( + opt_str, ", ".join(STRONG_HASHES) + ) + ) + parser.values.hashes.setdefault(algo, []).append(digest) + + +hash: Callable[..., Option] = partial( + Option, + "--hash", + # Hash values eventually end up in InstallRequirement.hashes due to + # __dict__ copying in process_line(). + dest="hashes", + action="callback", + callback=_handle_merge_hash, + type="string", + help="Verify that the package's archive matches this " + "hash before installing. Example: --hash=sha256:abcdef...", +) + + +require_hashes: Callable[..., Option] = partial( + Option, + "--require-hashes", + dest="require_hashes", + action="store_true", + default=False, + help="Require a hash to check each requirement against, for " + "repeatable installs. This option is implied when any package in a " + "requirements file has a --hash option.", +) + + +list_path: Callable[..., Option] = partial( + PipOption, + "--path", + dest="path", + type="path", + action="append", + help="Restrict to the specified installation path for listing " + "packages (can be used multiple times).", +) + + +def check_list_path_option(options: Values) -> None: + if options.path and (options.user or options.local): + raise CommandError("Cannot combine '--path' with '--user' or '--local'") + + +list_exclude: Callable[..., Option] = partial( + PipOption, + "--exclude", + dest="excludes", + action="append", + metavar="package", + type="package_name", + help="Exclude specified package from the output", +) + + +no_python_version_warning: Callable[..., Option] = partial( + Option, + "--no-python-version-warning", + dest="no_python_version_warning", + action="store_true", + default=False, + help="Silence deprecation warnings for upcoming unsupported Pythons.", +) + + +# Features that are now always on. A warning is printed if they are used. +ALWAYS_ENABLED_FEATURES = [ + "no-binary-enable-wheel-cache", # always on since 23.1 +] + +use_new_feature: Callable[..., Option] = partial( + Option, + "--use-feature", + dest="features_enabled", + metavar="feature", + action="append", + default=[], + choices=[ + "fast-deps", + "truststore", + ] + + ALWAYS_ENABLED_FEATURES, + help="Enable new functionality, that may be backward incompatible.", +) + +use_deprecated_feature: Callable[..., Option] = partial( + Option, + "--use-deprecated", + dest="deprecated_features_enabled", + metavar="feature", + action="append", + default=[], + choices=[ + "legacy-resolver", + ], + help=("Enable deprecated functionality, that will be removed in the future."), +) + + +########## +# groups # +########## + +general_group: Dict[str, Any] = { + "name": "General Options", + "options": [ + help_, + debug_mode, + isolated_mode, + require_virtualenv, + python, + verbose, + version, + quiet, + log, + no_input, + keyring_provider, + proxy, + retries, + timeout, + exists_action, + trusted_host, + cert, + client_cert, + cache_dir, + no_cache, + disable_pip_version_check, + no_color, + no_python_version_warning, + use_new_feature, + use_deprecated_feature, + ], +} + +index_group: Dict[str, Any] = { + "name": "Package Index Options", + "options": [ + index_url, + extra_index_url, + no_index, + find_links, + ], +} diff --git a/shared/package-files/7c/7c0a660d0d355739c5fee680e1b29c87422a1c77c130bc406b554c6bf73bb2ee/test_param_validation.py b/shared/package-files/7c/7c0a660d0d355739c5fee680e1b29c87422a1c77c130bc406b554c6bf73bb2ee/test_param_validation.py new file mode 100644 index 0000000000000000000000000000000000000000..a47eaace5b9a2362e7abf6326f2e0c7ad10c112f --- /dev/null +++ b/shared/package-files/7c/7c0a660d0d355739c5fee680e1b29c87422a1c77c130bc406b554c6bf73bb2ee/test_param_validation.py @@ -0,0 +1,786 @@ +from numbers import Integral, Real + +import numpy as np +import pytest +from scipy.sparse import csr_matrix + +from sklearn._config import config_context, get_config +from sklearn.base import BaseEstimator, _fit_context +from sklearn.model_selection import LeaveOneOut +from sklearn.utils import deprecated +from sklearn.utils._param_validation import ( + HasMethods, + Hidden, + Interval, + InvalidParameterError, + MissingValues, + Options, + RealNotInt, + StrOptions, + _ArrayLikes, + _Booleans, + _Callables, + _CVObjects, + _InstancesOf, + _IterablesNotString, + _NanConstraint, + _NoneConstraint, + _PandasNAConstraint, + _RandomStates, + _SparseMatrices, + _VerboseHelper, + generate_invalid_param_val, + generate_valid_param, + make_constraint, + validate_params, +) +from sklearn.utils.fixes import CSR_CONTAINERS + + +# Some helpers for the tests +@validate_params( + {"a": [Real], "b": [Real], "c": [Real], "d": [Real]}, + prefer_skip_nested_validation=True, +) +def _func(a, b=0, *args, c, d=0, **kwargs): + """A function to test the validation of functions.""" + + +class _Class: + """A class to test the _InstancesOf constraint and the validation of methods.""" + + @validate_params({"a": [Real]}, prefer_skip_nested_validation=True) + def _method(self, a): + """A validated method""" + + @deprecated() + @validate_params({"a": [Real]}, prefer_skip_nested_validation=True) + def _deprecated_method(self, a): + """A deprecated validated method""" + + +class _Estimator(BaseEstimator): + """An estimator to test the validation of estimator parameters.""" + + _parameter_constraints: dict = {"a": [Real]} + + def __init__(self, a): + self.a = a + + @_fit_context(prefer_skip_nested_validation=True) + def fit(self, X=None, y=None): + pass + + +@pytest.mark.parametrize("interval_type", [Integral, Real]) +def test_interval_range(interval_type): + """Check the range of values depending on closed.""" + interval = Interval(interval_type, -2, 2, closed="left") + assert -2 in interval + assert 2 not in interval + + interval = Interval(interval_type, -2, 2, closed="right") + assert -2 not in interval + assert 2 in interval + + interval = Interval(interval_type, -2, 2, closed="both") + assert -2 in interval + assert 2 in interval + + interval = Interval(interval_type, -2, 2, closed="neither") + assert -2 not in interval + assert 2 not in interval + + +@pytest.mark.parametrize("interval_type", [Integral, Real]) +def test_interval_large_integers(interval_type): + """Check that Interval constraint work with large integers. + + non-regression test for #26648. + """ + interval = Interval(interval_type, 0, 2, closed="neither") + assert 2**65 not in interval + assert 2**128 not in interval + assert float(2**65) not in interval + assert float(2**128) not in interval + + interval = Interval(interval_type, 0, 2**128, closed="neither") + assert 2**65 in interval + assert 2**128 not in interval + assert float(2**65) in interval + assert float(2**128) not in interval + + assert 2**1024 not in interval + + +def test_interval_inf_in_bounds(): + """Check that inf is included iff a bound is closed and set to None. + + Only valid for real intervals. + """ + interval = Interval(Real, 0, None, closed="right") + assert np.inf in interval + + interval = Interval(Real, None, 0, closed="left") + assert -np.inf in interval + + interval = Interval(Real, None, None, closed="neither") + assert np.inf not in interval + assert -np.inf not in interval + + +@pytest.mark.parametrize( + "interval", + [Interval(Real, 0, 1, closed="left"), Interval(Real, None, None, closed="both")], +) +def test_nan_not_in_interval(interval): + """Check that np.nan is not in any interval.""" + assert np.nan not in interval + + +@pytest.mark.parametrize( + "params, error, match", + [ + ( + {"type": Integral, "left": 1.0, "right": 2, "closed": "both"}, + TypeError, + r"Expecting left to be an int for an interval over the integers", + ), + ( + {"type": Integral, "left": 1, "right": 2.0, "closed": "neither"}, + TypeError, + "Expecting right to be an int for an interval over the integers", + ), + ( + {"type": Integral, "left": None, "right": 0, "closed": "left"}, + ValueError, + r"left can't be None when closed == left", + ), + ( + {"type": Integral, "left": 0, "right": None, "closed": "right"}, + ValueError, + r"right can't be None when closed == right", + ), + ( + {"type": Integral, "left": 1, "right": -1, "closed": "both"}, + ValueError, + r"right can't be less than left", + ), + ], +) +def test_interval_errors(params, error, match): + """Check that informative errors are raised for invalid combination of parameters""" + with pytest.raises(error, match=match): + Interval(**params) + + +def test_stroptions(): + """Sanity check for the StrOptions constraint""" + options = StrOptions({"a", "b", "c"}, deprecated={"c"}) + assert options.is_satisfied_by("a") + assert options.is_satisfied_by("c") + assert not options.is_satisfied_by("d") + + assert "'c' (deprecated)" in str(options) + + +def test_options(): + """Sanity check for the Options constraint""" + options = Options(Real, {-0.5, 0.5, np.inf}, deprecated={-0.5}) + assert options.is_satisfied_by(-0.5) + assert options.is_satisfied_by(np.inf) + assert not options.is_satisfied_by(1.23) + + assert "-0.5 (deprecated)" in str(options) + + +@pytest.mark.parametrize( + "type, expected_type_name", + [ + (int, "int"), + (Integral, "int"), + (Real, "float"), + (np.ndarray, "numpy.ndarray"), + ], +) +def test_instances_of_type_human_readable(type, expected_type_name): + """Check the string representation of the _InstancesOf constraint.""" + constraint = _InstancesOf(type) + assert str(constraint) == f"an instance of '{expected_type_name}'" + + +def test_hasmethods(): + """Check the HasMethods constraint.""" + constraint = HasMethods(["a", "b"]) + + class _Good: + def a(self): + pass # pragma: no cover + + def b(self): + pass # pragma: no cover + + class _Bad: + def a(self): + pass # pragma: no cover + + assert constraint.is_satisfied_by(_Good()) + assert not constraint.is_satisfied_by(_Bad()) + assert str(constraint) == "an object implementing 'a' and 'b'" + + +@pytest.mark.parametrize( + "constraint", + [ + Interval(Real, None, 0, closed="left"), + Interval(Real, 0, None, closed="left"), + Interval(Real, None, None, closed="neither"), + StrOptions({"a", "b", "c"}), + MissingValues(), + MissingValues(numeric_only=True), + _VerboseHelper(), + HasMethods("fit"), + _IterablesNotString(), + _CVObjects(), + ], +) +def test_generate_invalid_param_val(constraint): + """Check that the value generated does not satisfy the constraint""" + bad_value = generate_invalid_param_val(constraint) + assert not constraint.is_satisfied_by(bad_value) + + +@pytest.mark.parametrize( + "integer_interval, real_interval", + [ + ( + Interval(Integral, None, 3, closed="right"), + Interval(RealNotInt, -5, 5, closed="both"), + ), + ( + Interval(Integral, None, 3, closed="right"), + Interval(RealNotInt, -5, 5, closed="neither"), + ), + ( + Interval(Integral, None, 3, closed="right"), + Interval(RealNotInt, 4, 5, closed="both"), + ), + ( + Interval(Integral, None, 3, closed="right"), + Interval(RealNotInt, 5, None, closed="left"), + ), + ( + Interval(Integral, None, 3, closed="right"), + Interval(RealNotInt, 4, None, closed="neither"), + ), + ( + Interval(Integral, 3, None, closed="left"), + Interval(RealNotInt, -5, 5, closed="both"), + ), + ( + Interval(Integral, 3, None, closed="left"), + Interval(RealNotInt, -5, 5, closed="neither"), + ), + ( + Interval(Integral, 3, None, closed="left"), + Interval(RealNotInt, 1, 2, closed="both"), + ), + ( + Interval(Integral, 3, None, closed="left"), + Interval(RealNotInt, None, -5, closed="left"), + ), + ( + Interval(Integral, 3, None, closed="left"), + Interval(RealNotInt, None, -4, closed="neither"), + ), + ( + Interval(Integral, -5, 5, closed="both"), + Interval(RealNotInt, None, 1, closed="right"), + ), + ( + Interval(Integral, -5, 5, closed="both"), + Interval(RealNotInt, 1, None, closed="left"), + ), + ( + Interval(Integral, -5, 5, closed="both"), + Interval(RealNotInt, -10, -4, closed="neither"), + ), + ( + Interval(Integral, -5, 5, closed="both"), + Interval(RealNotInt, -10, -4, closed="right"), + ), + ( + Interval(Integral, -5, 5, closed="neither"), + Interval(RealNotInt, 6, 10, closed="neither"), + ), + ( + Interval(Integral, -5, 5, closed="neither"), + Interval(RealNotInt, 6, 10, closed="left"), + ), + ( + Interval(Integral, 2, None, closed="left"), + Interval(RealNotInt, 0, 1, closed="both"), + ), + ( + Interval(Integral, 1, None, closed="left"), + Interval(RealNotInt, 0, 1, closed="both"), + ), + ], +) +def test_generate_invalid_param_val_2_intervals(integer_interval, real_interval): + """Check that the value generated for an interval constraint does not satisfy any of + the interval constraints. + """ + bad_value = generate_invalid_param_val(constraint=real_interval) + assert not real_interval.is_satisfied_by(bad_value) + assert not integer_interval.is_satisfied_by(bad_value) + + bad_value = generate_invalid_param_val(constraint=integer_interval) + assert not real_interval.is_satisfied_by(bad_value) + assert not integer_interval.is_satisfied_by(bad_value) + + +@pytest.mark.parametrize( + "constraint", + [ + _ArrayLikes(), + _InstancesOf(list), + _Callables(), + _NoneConstraint(), + _RandomStates(), + _SparseMatrices(), + _Booleans(), + Interval(Integral, None, None, closed="neither"), + ], +) +def test_generate_invalid_param_val_all_valid(constraint): + """Check that the function raises NotImplementedError when there's no invalid value + for the constraint. + """ + with pytest.raises(NotImplementedError): + generate_invalid_param_val(constraint) + + +@pytest.mark.parametrize( + "constraint", + [ + _ArrayLikes(), + _Callables(), + _InstancesOf(list), + _NoneConstraint(), + _RandomStates(), + _SparseMatrices(), + _Booleans(), + _VerboseHelper(), + MissingValues(), + MissingValues(numeric_only=True), + StrOptions({"a", "b", "c"}), + Options(Integral, {1, 2, 3}), + Interval(Integral, None, None, closed="neither"), + Interval(Integral, 0, 10, closed="neither"), + Interval(Integral, 0, None, closed="neither"), + Interval(Integral, None, 0, closed="neither"), + Interval(Real, 0, 1, closed="neither"), + Interval(Real, 0, None, closed="both"), + Interval(Real, None, 0, closed="right"), + HasMethods("fit"), + _IterablesNotString(), + _CVObjects(), + ], +) +def test_generate_valid_param(constraint): + """Check that the value generated does satisfy the constraint.""" + value = generate_valid_param(constraint) + assert constraint.is_satisfied_by(value) + + +@pytest.mark.parametrize( + "constraint_declaration, value", + [ + (Interval(Real, 0, 1, closed="both"), 0.42), + (Interval(Integral, 0, None, closed="neither"), 42), + (StrOptions({"a", "b", "c"}), "b"), + (Options(type, {np.float32, np.float64}), np.float64), + (callable, lambda x: x + 1), + (None, None), + ("array-like", [[1, 2], [3, 4]]), + ("array-like", np.array([[1, 2], [3, 4]])), + ("sparse matrix", csr_matrix([[1, 2], [3, 4]])), + *[ + ("sparse matrix", container([[1, 2], [3, 4]])) + for container in CSR_CONTAINERS + ], + ("random_state", 0), + ("random_state", np.random.RandomState(0)), + ("random_state", None), + (_Class, _Class()), + (int, 1), + (Real, 0.5), + ("boolean", False), + ("verbose", 1), + ("nan", np.nan), + (MissingValues(), -1), + (MissingValues(), -1.0), + (MissingValues(), 2**1028), + (MissingValues(), None), + (MissingValues(), float("nan")), + (MissingValues(), np.nan), + (MissingValues(), "missing"), + (HasMethods("fit"), _Estimator(a=0)), + ("cv_object", 5), + ], +) +def test_is_satisfied_by(constraint_declaration, value): + """Sanity check for the is_satisfied_by method""" + constraint = make_constraint(constraint_declaration) + assert constraint.is_satisfied_by(value) + + +@pytest.mark.parametrize( + "constraint_declaration, expected_constraint_class", + [ + (Interval(Real, 0, 1, closed="both"), Interval), + (StrOptions({"option1", "option2"}), StrOptions), + (Options(Real, {0.42, 1.23}), Options), + ("array-like", _ArrayLikes), + ("sparse matrix", _SparseMatrices), + ("random_state", _RandomStates), + (None, _NoneConstraint), + (callable, _Callables), + (int, _InstancesOf), + ("boolean", _Booleans), + ("verbose", _VerboseHelper), + (MissingValues(numeric_only=True), MissingValues), + (HasMethods("fit"), HasMethods), + ("cv_object", _CVObjects), + ("nan", _NanConstraint), + (np.nan, _NanConstraint), + ], +) +def test_make_constraint(constraint_declaration, expected_constraint_class): + """Check that make_constraint dispatches to the appropriate constraint class""" + constraint = make_constraint(constraint_declaration) + assert constraint.__class__ is expected_constraint_class + + +def test_make_constraint_unknown(): + """Check that an informative error is raised when an unknown constraint is passed""" + with pytest.raises(ValueError, match="Unknown constraint"): + make_constraint("not a valid constraint") + + +def test_validate_params(): + """Check that validate_params works no matter how the arguments are passed""" + with pytest.raises( + InvalidParameterError, match="The 'a' parameter of _func must be" + ): + _func("wrong", c=1) + + with pytest.raises( + InvalidParameterError, match="The 'b' parameter of _func must be" + ): + _func(*[1, "wrong"], c=1) + + with pytest.raises( + InvalidParameterError, match="The 'c' parameter of _func must be" + ): + _func(1, **{"c": "wrong"}) + + with pytest.raises( + InvalidParameterError, match="The 'd' parameter of _func must be" + ): + _func(1, c=1, d="wrong") + + # check in the presence of extra positional and keyword args + with pytest.raises( + InvalidParameterError, match="The 'b' parameter of _func must be" + ): + _func(0, *["wrong", 2, 3], c=4, **{"e": 5}) + + with pytest.raises( + InvalidParameterError, match="The 'c' parameter of _func must be" + ): + _func(0, *[1, 2, 3], c="four", **{"e": 5}) + + +def test_validate_params_missing_params(): + """Check that no error is raised when there are parameters without + constraints + """ + + @validate_params({"a": [int]}, prefer_skip_nested_validation=True) + def func(a, b): + pass + + func(1, 2) + + +def test_decorate_validated_function(): + """Check that validate_params functions can be decorated""" + decorated_function = deprecated()(_func) + + with pytest.warns(FutureWarning, match="Function _func is deprecated"): + decorated_function(1, 2, c=3) + + # outer decorator does not interfere with validation + with pytest.warns(FutureWarning, match="Function _func is deprecated"): + with pytest.raises( + InvalidParameterError, match=r"The 'c' parameter of _func must be" + ): + decorated_function(1, 2, c="wrong") + + +def test_validate_params_method(): + """Check that validate_params works with methods""" + with pytest.raises( + InvalidParameterError, match="The 'a' parameter of _Class._method must be" + ): + _Class()._method("wrong") + + # validated method can be decorated + with pytest.warns(FutureWarning, match="Function _deprecated_method is deprecated"): + with pytest.raises( + InvalidParameterError, + match="The 'a' parameter of _Class._deprecated_method must be", + ): + _Class()._deprecated_method("wrong") + + +def test_validate_params_estimator(): + """Check that validate_params works with Estimator instances""" + # no validation in init + est = _Estimator("wrong") + + with pytest.raises( + InvalidParameterError, match="The 'a' parameter of _Estimator must be" + ): + est.fit() + + +def test_stroptions_deprecated_subset(): + """Check that the deprecated parameter must be a subset of options.""" + with pytest.raises(ValueError, match="deprecated options must be a subset"): + StrOptions({"a", "b", "c"}, deprecated={"a", "d"}) + + +def test_hidden_constraint(): + """Check that internal constraints are not exposed in the error message.""" + + @validate_params( + {"param": [Hidden(list), dict]}, prefer_skip_nested_validation=True + ) + def f(param): + pass + + # list and dict are valid params + f({"a": 1, "b": 2, "c": 3}) + f([1, 2, 3]) + + with pytest.raises( + InvalidParameterError, match="The 'param' parameter" + ) as exc_info: + f(param="bad") + + # the list option is not exposed in the error message + err_msg = str(exc_info.value) + assert "an instance of 'dict'" in err_msg + assert "an instance of 'list'" not in err_msg + + +def test_hidden_stroptions(): + """Check that we can have 2 StrOptions constraints, one being hidden.""" + + @validate_params( + {"param": [StrOptions({"auto"}), Hidden(StrOptions({"warn"}))]}, + prefer_skip_nested_validation=True, + ) + def f(param): + pass + + # "auto" and "warn" are valid params + f("auto") + f("warn") + + with pytest.raises( + InvalidParameterError, match="The 'param' parameter" + ) as exc_info: + f(param="bad") + + # the "warn" option is not exposed in the error message + err_msg = str(exc_info.value) + assert "auto" in err_msg + assert "warn" not in err_msg + + +def test_validate_params_set_param_constraints_attribute(): + """Check that the validate_params decorator properly sets the parameter constraints + as attribute of the decorated function/method. + """ + assert hasattr(_func, "_skl_parameter_constraints") + assert hasattr(_Class()._method, "_skl_parameter_constraints") + + +def test_boolean_constraint_deprecated_int(): + """Check that validate_params raise a deprecation message but still passes + validation when using an int for a parameter accepting a boolean. + """ + + @validate_params({"param": ["boolean"]}, prefer_skip_nested_validation=True) + def f(param): + pass + + # True/False and np.bool_(True/False) are valid params + f(True) + f(np.bool_(False)) + + +def test_no_validation(): + """Check that validation can be skipped for a parameter.""" + + @validate_params( + {"param1": [int, None], "param2": "no_validation"}, + prefer_skip_nested_validation=True, + ) + def f(param1=None, param2=None): + pass + + # param1 is validated + with pytest.raises(InvalidParameterError, match="The 'param1' parameter"): + f(param1="wrong") + + # param2 is not validated: any type is valid. + class SomeType: + pass + + f(param2=SomeType) + f(param2=SomeType()) + + +def test_pandas_na_constraint_with_pd_na(): + """Add a specific test for checking support for `pandas.NA`.""" + pd = pytest.importorskip("pandas") + + na_constraint = _PandasNAConstraint() + assert na_constraint.is_satisfied_by(pd.NA) + assert not na_constraint.is_satisfied_by(np.array([1, 2, 3])) + + +def test_iterable_not_string(): + """Check that a string does not satisfy the _IterableNotString constraint.""" + constraint = _IterablesNotString() + assert constraint.is_satisfied_by([1, 2, 3]) + assert constraint.is_satisfied_by(range(10)) + assert not constraint.is_satisfied_by("some string") + + +def test_cv_objects(): + """Check that the _CVObjects constraint accepts all current ways + to pass cv objects.""" + constraint = _CVObjects() + assert constraint.is_satisfied_by(5) + assert constraint.is_satisfied_by(LeaveOneOut()) + assert constraint.is_satisfied_by([([1, 2], [3, 4]), ([3, 4], [1, 2])]) + assert constraint.is_satisfied_by(None) + assert not constraint.is_satisfied_by("not a CV object") + + +def test_third_party_estimator(): + """Check that the validation from a scikit-learn estimator inherited by a third + party estimator does not impose a match between the dict of constraints and the + parameters of the estimator. + """ + + class ThirdPartyEstimator(_Estimator): + def __init__(self, b): + self.b = b + super().__init__(a=0) + + def fit(self, X=None, y=None): + super().fit(X, y) + + # does not raise, even though "b" is not in the constraints dict and "a" is not + # a parameter of the estimator. + ThirdPartyEstimator(b=0).fit() + + +def test_interval_real_not_int(): + """Check for the type RealNotInt in the Interval constraint.""" + constraint = Interval(RealNotInt, 0, 1, closed="both") + assert constraint.is_satisfied_by(1.0) + assert not constraint.is_satisfied_by(1) + + +def test_real_not_int(): + """Check for the RealNotInt type.""" + assert isinstance(1.0, RealNotInt) + assert not isinstance(1, RealNotInt) + assert isinstance(np.float64(1), RealNotInt) + assert not isinstance(np.int64(1), RealNotInt) + + +def test_skip_param_validation(): + """Check that param validation can be skipped using config_context.""" + + @validate_params({"a": [int]}, prefer_skip_nested_validation=True) + def f(a): + pass + + with pytest.raises(InvalidParameterError, match="The 'a' parameter"): + f(a="1") + + # does not raise + with config_context(skip_parameter_validation=True): + f(a="1") + + +@pytest.mark.parametrize("prefer_skip_nested_validation", [True, False]) +def test_skip_nested_validation(prefer_skip_nested_validation): + """Check that nested validation can be skipped.""" + + @validate_params({"a": [int]}, prefer_skip_nested_validation=True) + def f(a): + pass + + @validate_params( + {"b": [int]}, + prefer_skip_nested_validation=prefer_skip_nested_validation, + ) + def g(b): + # calls f with a bad parameter type + return f(a="invalid_param_value") + + # Validation for g is never skipped. + with pytest.raises(InvalidParameterError, match="The 'b' parameter"): + g(b="invalid_param_value") + + if prefer_skip_nested_validation: + g(b=1) # does not raise because inner f is not validated + else: + with pytest.raises(InvalidParameterError, match="The 'a' parameter"): + g(b=1) + + +@pytest.mark.parametrize( + "skip_parameter_validation, prefer_skip_nested_validation, expected_skipped", + [ + (True, True, True), + (True, False, True), + (False, True, True), + (False, False, False), + ], +) +def test_skip_nested_validation_and_config_context( + skip_parameter_validation, prefer_skip_nested_validation, expected_skipped +): + """Check interaction between global skip and local skip.""" + + @validate_params( + {"a": [int]}, prefer_skip_nested_validation=prefer_skip_nested_validation + ) + def g(a): + return get_config()["skip_parameter_validation"] + + with config_context(skip_parameter_validation=skip_parameter_validation): + actual_skipped = g(1) + + assert actual_skipped == expected_skipped diff --git a/shared/package-files/7c/7c0c295f48443337b9695e7b04feeb8c12f046265adc08defcd5e2ff7a35eb00/librilight_limited.py b/shared/package-files/7c/7c0c295f48443337b9695e7b04feeb8c12f046265adc08defcd5e2ff7a35eb00/librilight_limited.py new file mode 100644 index 0000000000000000000000000000000000000000..f0cb3100f7c4ad2e488c20bdfaac3833e0a136dd --- /dev/null +++ b/shared/package-files/7c/7c0c295f48443337b9695e7b04feeb8c12f046265adc08defcd5e2ff7a35eb00/librilight_limited.py @@ -0,0 +1,111 @@ +import os +from pathlib import Path +from typing import List, Tuple, Union + +import torchaudio +from torch import Tensor +from torch.utils.data import Dataset +from torchaudio._internal import download_url_to_file +from torchaudio.datasets.librispeech import _get_librispeech_metadata +from torchaudio.datasets.utils import _extract_tar + + +_ARCHIVE_NAME = "librispeech_finetuning" +_URL = "https://dl.fbaipublicfiles.com/librilight/data/librispeech_finetuning.tgz" +_CHECKSUM = "5d1efdc777b548194d7e09ba89126e2188026df9fd57aa57eb14408d2b2342af" +_SUBSET_MAP = {"10min": ["1h/0"], "1h": ["1h/*"], "10h": ["1h/*", "9h"]} + + +def _get_fileids_paths(path: Path, folders: List[str], _ext_audio: str) -> List[Tuple[str, str]]: + """Get the file names and the corresponding file paths without `speaker_id` + and `chapter_id` directories. + The format of path is like: + {root}/{_ARCHIVE_NAME}/1h/[0-5]/[clean, other] or + {root}/{_ARCHIVE_NAME}/9h/[clean, other] + + Args: + path (Path): Root path to the dataset. + folders (List[str]): Folders that contain the desired audio files. + _ext_audio (str): Extension of audio files. + + Returns: + List[Tuple[str, str]]: + List of tuples where the first element is the relative path to the audio file. + The format of relative path is like: + 1h/[0-5]/[clean, other] or 9h/[clean, other] + The second element is the file name without audio extension. + """ + + path = Path(path) + files_paths = [] + for folder in folders: + paths = [p.relative_to(path) for p in path.glob(f"{folder}/*/*/*/*{_ext_audio}")] + files_paths += [(str(p.parent.parent.parent), str(p.stem)) for p in paths] # get subset folder and file name + files_paths.sort(key=lambda x: x[0] + x[1]) + return files_paths + + +class LibriLightLimited(Dataset): + """Subset of Libri-light :cite:`librilight` dataset, + which was used in HuBERT :cite:`hsu2021hubert` for supervised fine-tuning. + + Args: + root (str or Path): Path to the directory where the dataset is found or downloaded. + subset (str, optional): The subset to use. Options: [``"10min"``, ``"1h"``, ``"10h"``] + (Default: ``"10min"``). + download (bool, optional): + Whether to download the dataset if it is not found at root path. (default: ``False``). + """ + + _ext_txt = ".trans.txt" + _ext_audio = ".flac" + + def __init__( + self, + root: Union[str, Path], + subset: str = "10min", + download: bool = False, + ) -> None: + if subset not in _SUBSET_MAP: + raise ValueError(f"`subset` must be one of {_SUBSET_MAP.keys()}. Found: {subset}") + folders = _SUBSET_MAP[subset] + + root = os.fspath(root) + self._path = os.path.join(root, _ARCHIVE_NAME) + archive = os.path.join(root, f"{_ARCHIVE_NAME}.tgz") + if not os.path.isdir(self._path): + if not download: + raise RuntimeError("Dataset not found. Please use `download=True` to download") + if not os.path.isfile(archive): + download_url_to_file(_URL, archive, hash_prefix=_CHECKSUM) + _extract_tar(archive) + self._fileids_paths = _get_fileids_paths(self._path, folders, self._ext_audio) + + def __getitem__(self, n: int) -> Tuple[Tensor, int, str, int, int, int]: + """Load the n-th sample from the dataset. + + Args: + n (int): The index of the sample to be loaded + Returns: + Tuple of the following items; + + Tensor: + Waveform + int: + Sample rate + str: + Transcript + int: + Speaker ID + int: + Chapter ID + int: + Utterance ID + """ + file_path, fileid = self._fileids_paths[n] + metadata = _get_librispeech_metadata(fileid, self._path, file_path, self._ext_audio, self._ext_txt) + waveform, _ = torchaudio.load(os.path.join(self._path, metadata[0])) + return (waveform,) + metadata[1:] + + def __len__(self) -> int: + return len(self._fileids_paths) diff --git a/shared/package-files/7c/7c0dffa2f25c3eaaf04f66cf8e677871218f0f2546e8748cf683f4ec73f547fb/modular.py b/shared/package-files/7c/7c0dffa2f25c3eaaf04f66cf8e677871218f0f2546e8748cf683f4ec73f547fb/modular.py new file mode 100644 index 0000000000000000000000000000000000000000..2962f511ff1473978ca9fb624e202094474b00dd --- /dev/null +++ b/shared/package-files/7c/7c0dffa2f25c3eaaf04f66cf8e677871218f0f2546e8748cf683f4ec73f547fb/modular.py @@ -0,0 +1,255 @@ +from functools import reduce +from math import prod + +from sympy.core.numbers import igcdex, igcd +from sympy.ntheory.primetest import isprime +from sympy.polys.domains import ZZ +from sympy.polys.galoistools import gf_crt, gf_crt1, gf_crt2 +from sympy.utilities.misc import as_int + + +def symmetric_residue(a, m): + """Return the residual mod m such that it is within half of the modulus. + + >>> from sympy.ntheory.modular import symmetric_residue + >>> symmetric_residue(1, 6) + 1 + >>> symmetric_residue(4, 6) + -2 + """ + if a <= m // 2: + return a + return a - m + + +def crt(m, v, symmetric=False, check=True): + r"""Chinese Remainder Theorem. + + The moduli in m are assumed to be pairwise coprime. The output + is then an integer f, such that f = v_i mod m_i for each pair out + of v and m. If ``symmetric`` is False a positive integer will be + returned, else \|f\| will be less than or equal to the LCM of the + moduli, and thus f may be negative. + + If the moduli are not co-prime the correct result will be returned + if/when the test of the result is found to be incorrect. This result + will be None if there is no solution. + + The keyword ``check`` can be set to False if it is known that the moduli + are coprime. + + Examples + ======== + + As an example consider a set of residues ``U = [49, 76, 65]`` + and a set of moduli ``M = [99, 97, 95]``. Then we have:: + + >>> from sympy.ntheory.modular import crt + + >>> crt([99, 97, 95], [49, 76, 65]) + (639985, 912285) + + This is the correct result because:: + + >>> [639985 % m for m in [99, 97, 95]] + [49, 76, 65] + + If the moduli are not co-prime, you may receive an incorrect result + if you use ``check=False``: + + >>> crt([12, 6, 17], [3, 4, 2], check=False) + (954, 1224) + >>> [954 % m for m in [12, 6, 17]] + [6, 0, 2] + >>> crt([12, 6, 17], [3, 4, 2]) is None + True + >>> crt([3, 6], [2, 5]) + (5, 6) + + Note: the order of gf_crt's arguments is reversed relative to crt, + and that solve_congruence takes residue, modulus pairs. + + Programmer's note: rather than checking that all pairs of moduli share + no GCD (an O(n**2) test) and rather than factoring all moduli and seeing + that there is no factor in common, a check that the result gives the + indicated residuals is performed -- an O(n) operation. + + See Also + ======== + + solve_congruence + sympy.polys.galoistools.gf_crt : low level crt routine used by this routine + """ + if check: + m = list(map(as_int, m)) + v = list(map(as_int, v)) + + result = gf_crt(v, m, ZZ) + mm = prod(m) + + if check: + if not all(v % m == result % m for v, m in zip(v, m)): + result = solve_congruence(*list(zip(v, m)), + check=False, symmetric=symmetric) + if result is None: + return result + result, mm = result + + if symmetric: + return symmetric_residue(result, mm), mm + return result, mm + + +def crt1(m): + """First part of Chinese Remainder Theorem, for multiple application. + + Examples + ======== + + >>> from sympy.ntheory.modular import crt1 + >>> crt1([18, 42, 6]) + (4536, [252, 108, 756], [0, 2, 0]) + """ + + return gf_crt1(m, ZZ) + + +def crt2(m, v, mm, e, s, symmetric=False): + """Second part of Chinese Remainder Theorem, for multiple application. + + Examples + ======== + + >>> from sympy.ntheory.modular import crt1, crt2 + >>> mm, e, s = crt1([18, 42, 6]) + >>> crt2([18, 42, 6], [0, 0, 0], mm, e, s) + (0, 4536) + """ + + result = gf_crt2(v, m, mm, e, s, ZZ) + + if symmetric: + return symmetric_residue(result, mm), mm + return result, mm + + +def solve_congruence(*remainder_modulus_pairs, **hint): + """Compute the integer ``n`` that has the residual ``ai`` when it is + divided by ``mi`` where the ``ai`` and ``mi`` are given as pairs to + this function: ((a1, m1), (a2, m2), ...). If there is no solution, + return None. Otherwise return ``n`` and its modulus. + + The ``mi`` values need not be co-prime. If it is known that the moduli are + not co-prime then the hint ``check`` can be set to False (default=True) and + the check for a quicker solution via crt() (valid when the moduli are + co-prime) will be skipped. + + If the hint ``symmetric`` is True (default is False), the value of ``n`` + will be within 1/2 of the modulus, possibly negative. + + Examples + ======== + + >>> from sympy.ntheory.modular import solve_congruence + + What number is 2 mod 3, 3 mod 5 and 2 mod 7? + + >>> solve_congruence((2, 3), (3, 5), (2, 7)) + (23, 105) + >>> [23 % m for m in [3, 5, 7]] + [2, 3, 2] + + If you prefer to work with all remainder in one list and + all moduli in another, send the arguments like this: + + >>> solve_congruence(*zip((2, 3, 2), (3, 5, 7))) + (23, 105) + + The moduli need not be co-prime; in this case there may or + may not be a solution: + + >>> solve_congruence((2, 3), (4, 6)) is None + True + + >>> solve_congruence((2, 3), (5, 6)) + (5, 6) + + The symmetric flag will make the result be within 1/2 of the modulus: + + >>> solve_congruence((2, 3), (5, 6), symmetric=True) + (-1, 6) + + See Also + ======== + + crt : high level routine implementing the Chinese Remainder Theorem + + """ + def combine(c1, c2): + """Return the tuple (a, m) which satisfies the requirement + that n = a + i*m satisfy n = a1 + j*m1 and n = a2 = k*m2. + + References + ========== + + .. [1] https://en.wikipedia.org/wiki/Method_of_successive_substitution + """ + a1, m1 = c1 + a2, m2 = c2 + a, b, c = m1, a2 - a1, m2 + g = reduce(igcd, [a, b, c]) + a, b, c = [i//g for i in [a, b, c]] + if a != 1: + inv_a, _, g = igcdex(a, c) + if g != 1: + return None + b *= inv_a + a, m = a1 + m1*b, m1*c + return a, m + + rm = remainder_modulus_pairs + symmetric = hint.get('symmetric', False) + + if hint.get('check', True): + rm = [(as_int(r), as_int(m)) for r, m in rm] + + # ignore redundant pairs but raise an error otherwise; also + # make sure that a unique set of bases is sent to gf_crt if + # they are all prime. + # + # The routine will work out less-trivial violations and + # return None, e.g. for the pairs (1,3) and (14,42) there + # is no answer because 14 mod 42 (having a gcd of 14) implies + # (14/2) mod (42/2), (14/7) mod (42/7) and (14/14) mod (42/14) + # which, being 0 mod 3, is inconsistent with 1 mod 3. But to + # preprocess the input beyond checking of another pair with 42 + # or 3 as the modulus (for this example) is not necessary. + uniq = {} + for r, m in rm: + r %= m + if m in uniq: + if r != uniq[m]: + return None + continue + uniq[m] = r + rm = [(r, m) for m, r in uniq.items()] + del uniq + + # if the moduli are co-prime, the crt will be significantly faster; + # checking all pairs for being co-prime gets to be slow but a prime + # test is a good trade-off + if all(isprime(m) for r, m in rm): + r, m = list(zip(*rm)) + return crt(m, r, symmetric=symmetric, check=False) + + rv = (0, 1) + for rmi in rm: + rv = combine(rv, rmi) + if rv is None: + break + n, m = rv + n = n % m + else: + if symmetric: + return symmetric_residue(n, m), m + return n, m diff --git a/shared/package-files/7c/7c0f5fc19a95400a78a0508aff291ccd2d2ce74aea7aa5ce967024a63d495913/__init__.py b/shared/package-files/7c/7c0f5fc19a95400a78a0508aff291ccd2d2ce74aea7aa5ce967024a63d495913/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..de8153e19c01f1a5fad4d3af807e1fe9eb346f17 --- /dev/null +++ b/shared/package-files/7c/7c0f5fc19a95400a78a0508aff291ccd2d2ce74aea7aa5ce967024a63d495913/__init__.py @@ -0,0 +1,249 @@ +from datetime import timedelta +import logging +import os +import threading +import warnings +from typing import Generator, Tuple +from urllib.parse import urlparse + +import torch +import torch.distributed as dist + +logger = logging.getLogger(__name__) + + +_init_counter = 0 +_init_counter_lock = threading.Lock() + +__all__ = ["is_available"] + +def is_available() -> bool: + return hasattr(torch._C, "_rpc_init") + + +if is_available() and not torch._C._rpc_init(): + raise RuntimeError("Failed to initialize torch.distributed.rpc") + + +if is_available(): + from torch._C._distributed_c10d import Store + from torch._C._distributed_rpc import ( + _disable_jit_rref_pickle, + _enable_jit_rref_pickle, + _disable_server_process_global_profiler, + _enable_server_process_global_profiler, + _set_and_start_rpc_agent, + _reset_current_rpc_agent, + _delete_all_user_and_unforked_owner_rrefs, + _destroy_rref_context, + _set_profiler_node_id, + _is_current_rpc_agent_set, + _rref_context_get_debug_info, + _cleanup_python_rpc_handler, + _invoke_rpc_builtin, + _invoke_rpc_python_udf, + _invoke_rpc_torchscript, + _invoke_remote_builtin, + _invoke_remote_python_udf, + _invoke_remote_torchscript, + _set_rpc_timeout, + _get_current_rpc_agent, + get_rpc_timeout, + enable_gil_profiling, + RpcBackendOptions, + _TensorPipeRpcBackendOptionsBase, + RpcAgent, + PyRRef, + TensorPipeAgent, + RemoteProfilerManager, + WorkerInfo, + _DEFAULT_INIT_METHOD, + _DEFAULT_NUM_WORKER_THREADS, + _UNSET_RPC_TIMEOUT, + _DEFAULT_RPC_TIMEOUT_SEC, + ) # noqa: F401 + + from . import api, backend_registry, functions + from .api import * # noqa: F401,F403 + import numbers + + import torch.distributed.autograd as dist_autograd + + from .backend_registry import BackendType + from .options import TensorPipeRpcBackendOptions # noqa: F401 + from .server_process_global_profiler import ( + _server_process_global_profile, + ) + + rendezvous_iterator: Generator[Tuple[Store, int, int], None, None] + + __all__ += ["init_rpc", "BackendType", "TensorPipeRpcBackendOptions"] + __all__ = __all__ + api.__all__ + backend_registry.__all__ # noqa: PLE0605 + + def init_rpc( + name, + backend=None, + rank=-1, + world_size=None, + rpc_backend_options=None, + ): + r""" + Initializes RPC primitives such as the local RPC agent + and distributed autograd, which immediately makes the current + process ready to send and receive RPCs. + + Args: + name (str): a globally unique name of this node. (e.g., + ``Trainer3``, ``ParameterServer2``, ``Master``, ``Worker1``) + Name can only contain number, alphabet, underscore, colon, + and/or dash, and must be shorter than 128 characters. + backend (BackendType, optional): The type of RPC backend + implementation. Supported values is + ``BackendType.TENSORPIPE`` (the default). + See :ref:`rpc-backends` for more information. + rank (int): a globally unique id/rank of this node. + world_size (int): The number of workers in the group. + rpc_backend_options (RpcBackendOptions, optional): The options + passed to the RpcAgent constructor. It must be an agent-specific + subclass of :class:`~torch.distributed.rpc.RpcBackendOptions` + and contains agent-specific initialization configurations. By + default, for all agents, it sets the default timeout to 60 + seconds and performs the rendezvous with an underlying process + group initialized using ``init_method = "env://"``, + meaning that environment variables ``MASTER_ADDR`` and + ``MASTER_PORT`` need to be set properly. See + :ref:`rpc-backends` for more information and find which options + are available. + """ + torch._C._log_api_usage_once("torch.distributed.init_rpc") + if backend is not None and not isinstance( + backend, backend_registry.BackendType + ): + raise TypeError("Argument backend must be a member of BackendType") + + if rpc_backend_options is not None and not isinstance( + rpc_backend_options, RpcBackendOptions + ): + raise TypeError( + "Argument rpc_backend_options must be an instance of RpcBackendOptions" + ) + + # Try to detect the backend from the options + if backend is None and rpc_backend_options is not None: + for candidate_backend in BackendType: + if isinstance( + rpc_backend_options, + type( + backend_registry.construct_rpc_backend_options( + candidate_backend + ) + ), + ): + backend = candidate_backend + break + else: + raise TypeError( + f"Could not infer backend for options {rpc_backend_options}" + ) + # Ignore type error because mypy doesn't handle dynamically generated type objects (#4865) + if backend != BackendType.TENSORPIPE: # type: ignore[attr-defined] + logger.warning( + "RPC was initialized with no explicit backend but with options " # type: ignore[attr-defined] + "corresponding to %(backend)s, hence that backend will be used " + "instead of the default BackendType.TENSORPIPE. To silence this " + "warning pass `backend=%(backend)s` explicitly.", + {'backend': backend} + ) + + if backend is None: + backend = BackendType.TENSORPIPE # type: ignore[attr-defined] + + if rpc_backend_options is None: + # default construct a set of RPC backend options. + rpc_backend_options = backend_registry.construct_rpc_backend_options( + backend + ) + + # Create store, performs rendezvous for static RPC group. + if not world_size: + # If world_size is not set in construction and also not set in environment variables + # The store will be created for the dynamic group setting + store = dist._create_store_from_options(rpc_backend_options, rank) + else: + # This rendezvous state sometimes is destroyed before all processes + # finishing handshaking. To avoid that issue, we make it global to + # keep it alive. + global rendezvous_iterator + rendezvous_iterator = dist.rendezvous( + rpc_backend_options.init_method, rank=rank, world_size=world_size + ) + store, _, _ = next(rendezvous_iterator) + # Use same timeout as RPC. + store.set_timeout(timedelta(seconds=rpc_backend_options.rpc_timeout)) + + # Use a PrefixStore to distinguish multiple invocations. + with _init_counter_lock: + global _init_counter + store = dist.PrefixStore(str(f"rpc_prefix_{_init_counter}"), store) + _init_counter += 1 + + # Initialize autograd before RPC since _init_rpc_backend guarantees all + # processes sync via the store. If we initialize autograd after RPC, + # there could be a race where some nodes might have initialized autograd + # and others might not have. As a result, a node calling + # torch.distributed.autograd.backward() would run into errors since + # other nodes might not have been initialized. + dist_autograd._init(rank) + + _set_profiler_node_id(rank) + # Initialize RPC. + _init_rpc_backend(backend, store, name, rank, world_size, rpc_backend_options) + + def _validate_rpc_args(backend, store, name, rank, world_size, rpc_backend_options): + type_mapping = { + backend: backend_registry.BackendType, + store: dist.Store, + name: str, + rank: numbers.Integral, + # world_size can be None for a dynamic group + world_size: (numbers.Integral, type(None)), + rpc_backend_options: RpcBackendOptions, + } + for arg, arg_type in type_mapping.items(): + if not isinstance(arg, arg_type): # type: ignore[arg-type] + raise RuntimeError( + f"Argument {arg} must be of type {arg_type} but got type {type(arg)}" + ) + + def _init_rpc_backend( + backend=BackendType.TENSORPIPE, # type: ignore[attr-defined] + store=None, + name=None, + rank=-1, + world_size=None, + rpc_backend_options=None, + ): + + _validate_rpc_args(backend, store, name, rank, world_size, rpc_backend_options) + + if _is_current_rpc_agent_set(): + raise RuntimeError("RPC is already initialized") + + # Initialize RPC. + rpc_agent = backend_registry.init_backend( + backend, + store=store, + name=name, + rank=rank, + world_size=world_size, + rpc_backend_options=rpc_backend_options, + ) + + api._init_rpc_states(rpc_agent) + + @api._require_initialized + def _get_debug_info(): + info = _rref_context_get_debug_info() + info.update(api._get_current_rpc_agent().get_debug_info()) + info.update(dist_autograd._get_debug_info()) + return info diff --git a/shared/package-files/7c/7c113202ef734cc1eef68be0c0ec2fee412c958858dfcb1dd06351efc77e1028/test_io.py b/shared/package-files/7c/7c113202ef734cc1eef68be0c0ec2fee412c958858dfcb1dd06351efc77e1028/test_io.py new file mode 100644 index 0000000000000000000000000000000000000000..a6d3546e57c68b75fb4e3abfae76440ab2474491 --- /dev/null +++ b/shared/package-files/7c/7c113202ef734cc1eef68be0c0ec2fee412c958858dfcb1dd06351efc77e1028/test_io.py @@ -0,0 +1,2212 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import bz2 +from contextlib import contextmanager +from io import (BytesIO, StringIO, TextIOWrapper, BufferedIOBase, IOBase) +import itertools +import gc +import gzip +import math +import os +import pathlib +import pytest +import random +import sys +import tempfile +import weakref + +try: + import numpy as np +except ImportError: + np = None + +from pyarrow.util import guid +from pyarrow import Codec +import pyarrow as pa + + +def check_large_seeks(file_factory, expected_error=None): + if sys.platform in ('win32', 'darwin', 'emscripten'): + pytest.skip("need sparse file support") + try: + filename = tempfile.mktemp(prefix='test_io') + with open(filename, 'wb') as f: + f.truncate(2 ** 32 + 10) + f.seek(2 ** 32 + 5) + f.write(b'mark\n') + if expected_error: + with expected_error: + file_factory(filename) + else: + with file_factory(filename) as f: + assert f.size() == 2 ** 32 + 10 + assert f.seek(2 ** 32 + 5) == 2 ** 32 + 5 + assert f.tell() == 2 ** 32 + 5 + assert f.read(5) == b'mark\n' + assert f.tell() == 2 ** 32 + 10 + finally: + os.unlink(filename) + + +@contextmanager +def assert_file_not_found(): + with pytest.raises(FileNotFoundError): + yield + + +# ---------------------------------------------------------------------- +# Python file-like objects + + +def test_python_file_write(): + buf = BytesIO() + + f = pa.PythonFile(buf) + + assert f.tell() == 0 + + s1 = b'enga\xc3\xb1ado' + s2 = b'foobar' + + f.write(s1) + assert f.tell() == len(s1) + + f.write(s2) + + expected = s1 + s2 + + result = buf.getvalue() + assert result == expected + + assert not f.closed + f.close() + assert f.closed + + with pytest.raises(TypeError, match="binary file expected"): + pa.PythonFile(StringIO()) + + +def test_python_file_read(): + data = b'some sample data' + + buf = BytesIO(data) + f = pa.PythonFile(buf, mode='r') + + assert f.size() == len(data) + + assert f.tell() == 0 + + assert f.read(4) == b'some' + assert f.tell() == 4 + + f.seek(0) + assert f.tell() == 0 + + f.seek(5) + assert f.tell() == 5 + + v = f.read(50) + assert v == b'sample data' + assert len(v) == 11 + + assert f.size() == len(data) + + assert not f.closed + f.close() + assert f.closed + + with pytest.raises(TypeError, match="binary file expected"): + pa.PythonFile(StringIO(), mode='r') + + +@pytest.mark.parametrize("nbytes", (-1, 0, 1, 5, 100)) +@pytest.mark.parametrize("file_offset", (-1, 0, 5, 100)) +def test_python_file_get_stream(nbytes, file_offset): + + data = b'data1data2data3data4data5' + + f = pa.PythonFile(BytesIO(data), mode='r') + + # negative nbytes or offsets don't make sense here, raise ValueError + if nbytes < 0 or file_offset < 0: + with pytest.raises(pa.ArrowInvalid, + match="should be a positive value"): + f.get_stream(file_offset=file_offset, nbytes=nbytes) + f.close() + return + else: + stream = f.get_stream(file_offset=file_offset, nbytes=nbytes) + + # Subsequent calls to 'read' should match behavior if same + # data passed to BytesIO where get_stream should handle if + # nbytes/file_offset results in no bytes b/c out of bounds. + start = min(file_offset, len(data)) + end = min(file_offset + nbytes, len(data)) + buf = BytesIO(data[start:end]) + + # read some chunks + assert stream.read(nbytes=4) == buf.read(4) + assert stream.read(nbytes=6) == buf.read(6) + + # Read to end of each stream + assert stream.read() == buf.read() + + # Try reading past the stream + n = len(data) * 2 + assert stream.read(n) == buf.read(n) + + # NativeFile[CInputStream] is not seekable + with pytest.raises(OSError, match="seekable"): + stream.seek(0) + + stream.close() + assert stream.closed + + +def test_python_file_read_at(): + data = b'some sample data' + + buf = BytesIO(data) + f = pa.PythonFile(buf, mode='r') + + # test simple read at + v = f.read_at(nbytes=5, offset=3) + assert v == b'e sam' + assert len(v) == 5 + + # test reading entire file when nbytes > len(file) + w = f.read_at(nbytes=50, offset=0) + assert w == data + assert len(w) == 16 + + +def test_python_file_readall(): + data = b'some sample data' + + buf = BytesIO(data) + with pa.PythonFile(buf, mode='r') as f: + assert f.readall() == data + + +def test_python_file_readinto(): + length = 10 + data = b'some sample data longer than 10' + dst_buf = bytearray(length) + src_buf = BytesIO(data) + + with pa.PythonFile(src_buf, mode='r') as f: + assert f.readinto(dst_buf) == 10 + + assert dst_buf[:length] == data[:length] + assert len(dst_buf) == length + + +def test_python_file_read_buffer(): + length = 10 + data = b'0123456798' + dst_buf = bytearray(data) + + class DuckReader: + def close(self): + pass + + @property + def closed(self): + return False + + def read_buffer(self, nbytes): + assert nbytes == length + return memoryview(dst_buf)[:nbytes] + + duck_reader = DuckReader() + with pa.PythonFile(duck_reader, mode='r') as f: + buf = f.read_buffer(length) + assert len(buf) == length + assert memoryview(buf).tobytes() == dst_buf[:length] + # buf should point to the same memory, so modifying it + memoryview(buf)[0] = ord(b'x') + # should modify the original + assert dst_buf[0] == ord(b'x') + + +def test_python_file_correct_abc(): + with pa.PythonFile(BytesIO(b''), mode='r') as f: + assert isinstance(f, BufferedIOBase) + assert isinstance(f, IOBase) + + +def test_python_file_iterable(): + data = b'''line1 + line2 + line3 + ''' + + buf = BytesIO(data) + buf2 = BytesIO(data) + + with pa.PythonFile(buf, mode='r') as f: + for read, expected in zip(f, buf2): + assert read == expected + + +def test_python_file_large_seeks(): + def factory(filename): + return pa.PythonFile(open(filename, 'rb')) + + check_large_seeks(factory) + + +def test_bytes_reader(): + # Like a BytesIO, but zero-copy underneath for C++ consumers + data = b'some sample data' + f = pa.BufferReader(data) + assert f.tell() == 0 + + assert f.size() == len(data) + + assert f.read(4) == b'some' + assert f.tell() == 4 + + f.seek(0) + assert f.tell() == 0 + + f.seek(0, 2) + assert f.tell() == len(data) + + f.seek(5) + assert f.tell() == 5 + + assert f.read(50) == b'sample data' + + assert not f.closed + f.close() + assert f.closed + + +def test_bytes_reader_non_bytes(): + with pytest.raises(TypeError): + pa.BufferReader('some sample data') + + +def test_bytes_reader_retains_parent_reference(): + import gc + + # ARROW-421 + def get_buffer(): + data = b'some sample data' * 1000 + reader = pa.BufferReader(data) + reader.seek(5) + return reader.read_buffer(6) + + buf = get_buffer() + gc.collect() + assert buf.to_pybytes() == b'sample' + assert buf.parent is not None + + +def test_python_file_implicit_mode(tmpdir): + path = os.path.join(str(tmpdir), 'foo.txt') + with open(path, 'wb') as f: + pf = pa.PythonFile(f) + assert pf.writable() + assert not pf.readable() + assert not pf.seekable() # PyOutputStream isn't seekable + f.write(b'foobar\n') + + with open(path, 'rb') as f: + pf = pa.PythonFile(f) + assert pf.readable() + assert not pf.writable() + assert pf.seekable() + assert pf.read() == b'foobar\n' + + bio = BytesIO() + pf = pa.PythonFile(bio) + assert pf.writable() + assert not pf.readable() + assert not pf.seekable() + pf.write(b'foobar\n') + assert bio.getvalue() == b'foobar\n' + + +def test_python_file_writelines(tmpdir): + lines = [b'line1\n', b'line2\n' b'line3'] + path = os.path.join(str(tmpdir), 'foo.txt') + with open(path, 'wb') as f: + try: + f = pa.PythonFile(f, mode='w') + assert f.writable() + f.writelines(lines) + finally: + f.close() + + with open(path, 'rb') as f: + try: + f = pa.PythonFile(f, mode='r') + assert f.readable() + assert f.read() == b''.join(lines) + finally: + f.close() + + +def test_python_file_closing(): + bio = BytesIO() + pf = pa.PythonFile(bio) + wr = weakref.ref(pf) + del pf + assert wr() is None # object was destroyed + assert not bio.closed + pf = pa.PythonFile(bio) + pf.close() + assert bio.closed + + +# ---------------------------------------------------------------------- +# Buffers + + +def check_buffer_pickling(buf, pickler): + # Check that buffer survives a pickle roundtrip + for protocol in range(0, pickler.HIGHEST_PROTOCOL + 1): + result = pickler.loads(pickler.dumps(buf, protocol=protocol)) + assert len(result) == len(buf) + assert memoryview(result) == memoryview(buf) + assert result.to_pybytes() == buf.to_pybytes() + assert result.is_mutable == buf.is_mutable + + +def test_buffer_bytes(pickle_module): + val = b'some data' + + buf = pa.py_buffer(val) + assert isinstance(buf, pa.Buffer) + assert not buf.is_mutable + assert buf.is_cpu + + result = buf.to_pybytes() + assert result == val + + check_buffer_pickling(buf, pickle_module) + + +def test_buffer_null_data(pickle_module): + null_buff = pa.foreign_buffer(address=0, size=0) + assert null_buff.to_pybytes() == b"" + assert null_buff.address == 0 + # ARROW-16048: we shouldn't expose a NULL address through the Python + # buffer protocol. + m = memoryview(null_buff) + assert m.tobytes() == b"" + assert pa.py_buffer(m).address != 0 + + check_buffer_pickling(null_buff, pickle_module) + + +def test_buffer_memoryview(pickle_module): + val = b'some data' + + buf = pa.py_buffer(val) + assert isinstance(buf, pa.Buffer) + assert not buf.is_mutable + assert buf.is_cpu + + result = memoryview(buf) + assert result == val + + check_buffer_pickling(buf, pickle_module) + + +def test_buffer_bytearray(pickle_module): + val = bytearray(b'some data') + + buf = pa.py_buffer(val) + assert isinstance(buf, pa.Buffer) + assert buf.is_mutable + assert buf.is_cpu + + result = bytearray(buf) + assert result == val + + check_buffer_pickling(buf, pickle_module) + + +def test_buffer_invalid(): + with pytest.raises(TypeError, + match="(bytes-like object|buffer interface)"): + pa.py_buffer(None) + + +def test_buffer_weakref(): + buf = pa.py_buffer(b'some data') + wr = weakref.ref(buf) + assert wr() is not None + del buf + assert wr() is None + + +@pytest.mark.parametrize('val, expected_hex_buffer', + [(b'check', b'636865636B'), + (b'\a0', b'0730'), + (b'', b'')]) +def test_buffer_hex(val, expected_hex_buffer): + buf = pa.py_buffer(val) + assert buf.hex() == expected_hex_buffer + + +@pytest.mark.numpy +def test_buffer_to_numpy(): + # Make sure creating a numpy array from an arrow buffer works + byte_array = bytearray(20) + byte_array[0] = 42 + buf = pa.py_buffer(byte_array) + array = np.frombuffer(buf, dtype="uint8") + assert array[0] == byte_array[0] + byte_array[0] += 1 + assert array[0] == byte_array[0] + assert array.base == buf + + +@pytest.mark.numpy +def test_buffer_from_numpy(): + # C-contiguous + arr = np.arange(12, dtype=np.int8).reshape((3, 4)) + buf = pa.py_buffer(arr) + assert buf.is_cpu + assert buf.is_mutable + assert buf.to_pybytes() == arr.tobytes() + # F-contiguous; note strides information is lost + buf = pa.py_buffer(arr.T) + assert buf.is_cpu + assert buf.is_mutable + assert buf.to_pybytes() == arr.tobytes() + # Non-contiguous + with pytest.raises(ValueError, match="not contiguous"): + buf = pa.py_buffer(arr.T[::2]) + + +@pytest.mark.numpy +def test_buffer_address(): + b1 = b'some data!' + b2 = bytearray(b1) + b3 = bytearray(b1) + + buf1 = pa.py_buffer(b1) + buf2 = pa.py_buffer(b1) + buf3 = pa.py_buffer(b2) + buf4 = pa.py_buffer(b3) + + assert buf1.address > 0 + assert buf1.address == buf2.address + assert buf3.address != buf2.address + assert buf4.address != buf3.address + + arr = np.arange(5) + buf = pa.py_buffer(arr) + assert buf.address == arr.ctypes.data + + +@pytest.mark.numpy +def test_buffer_equals(): + # Buffer.equals() returns true iff the buffers have the same contents + def eq(a, b): + assert a.equals(b) + assert a == b + assert not (a != b) + + def ne(a, b): + assert not a.equals(b) + assert not (a == b) + assert a != b + + b1 = b'some data!' + b2 = bytearray(b1) + b3 = bytearray(b1) + b3[0] = 42 + buf1 = pa.py_buffer(b1) + buf2 = pa.py_buffer(b2) + buf3 = pa.py_buffer(b2) + buf4 = pa.py_buffer(b3) + buf5 = pa.py_buffer(np.frombuffer(b2, dtype=np.int16)) + eq(buf1, buf1) + eq(buf1, buf2) + eq(buf2, buf3) + ne(buf2, buf4) + # Data type is indifferent + eq(buf2, buf5) + + +def test_buffer_eq_bytes(): + buf = pa.py_buffer(b'some data') + assert buf == b'some data' + assert buf == bytearray(b'some data') + assert buf != b'some dat1' + + with pytest.raises(TypeError): + buf == 'some data' + + +def test_buffer_getitem(): + data = bytearray(b'some data!') + buf = pa.py_buffer(data) + + n = len(data) + for ix in range(-n, n - 1): + assert buf[ix] == data[ix] + + with pytest.raises(IndexError): + buf[n] + + with pytest.raises(IndexError): + buf[-n - 1] + + +def test_buffer_slicing(): + data = b'some data!' + buf = pa.py_buffer(data) + + sliced = buf.slice(2) + expected = pa.py_buffer(b'me data!') + assert sliced.equals(expected) + + sliced2 = buf.slice(2, 4) + expected2 = pa.py_buffer(b'me d') + assert sliced2.equals(expected2) + + # 0 offset + assert buf.slice(0).equals(buf) + + # Slice past end of buffer + assert len(buf.slice(len(buf))) == 0 + + with pytest.raises(IndexError): + buf.slice(-1) + + with pytest.raises(IndexError): + buf.slice(len(buf) + 1) + assert buf[11:].to_pybytes() == b"" + + # Slice stop exceeds buffer length + with pytest.raises(IndexError): + buf.slice(1, len(buf)) + assert buf[1:11].to_pybytes() == buf.to_pybytes()[1:] + + # Negative length + with pytest.raises(IndexError): + buf.slice(1, -1) + + # Test slice notation + assert buf[2:].equals(buf.slice(2)) + assert buf[2:5].equals(buf.slice(2, 3)) + assert buf[-5:].equals(buf.slice(len(buf) - 5)) + assert buf[-5:-2].equals(buf.slice(len(buf) - 5, 3)) + + with pytest.raises(IndexError): + buf[::-1] + with pytest.raises(IndexError): + buf[::2] + + n = len(buf) + for start in range(-n * 2, n * 2): + for stop in range(-n * 2, n * 2): + assert buf[start:stop].to_pybytes() == buf.to_pybytes()[start:stop] + + +def test_buffer_hashing(): + # Buffers are unhashable + with pytest.raises(TypeError, match="unhashable"): + hash(pa.py_buffer(b'123')) + + +@pytest.mark.numpy +def test_buffer_protocol_respects_immutability(): + # ARROW-3228; NumPy's frombuffer ctor determines whether a buffer-like + # object is mutable by first attempting to get a mutable buffer using + # PyObject_FromBuffer. If that fails, it assumes that the object is + # immutable + a = b'12345' + arrow_ref = pa.py_buffer(a) + numpy_ref = np.frombuffer(arrow_ref, dtype=np.uint8) + assert not numpy_ref.flags.writeable + + +@pytest.mark.numpy +def test_foreign_buffer(): + obj = np.array([1, 2], dtype=np.int32) + addr = obj.__array_interface__["data"][0] + size = obj.nbytes + buf = pa.foreign_buffer(addr, size, obj) + wr = weakref.ref(obj) + del obj + assert np.frombuffer(buf, dtype=np.int32).tolist() == [1, 2] + assert wr() is not None + del buf + assert wr() is None + + +def test_allocate_buffer(): + buf = pa.allocate_buffer(100) + assert buf.size == 100 + assert buf.is_mutable + assert buf.parent is None + + bit = b'abcde' + writer = pa.FixedSizeBufferWriter(buf) + writer.write(bit) + + assert buf.to_pybytes()[:5] == bit + + +def test_allocate_buffer_resizable(): + buf = pa.allocate_buffer(100, resizable=True) + assert isinstance(buf, pa.ResizableBuffer) + + buf.resize(200) + assert buf.size == 200 + + +@pytest.mark.numpy +def test_non_cpu_buffer(pickle_module): + cuda = pytest.importorskip("pyarrow.cuda") + ctx = cuda.Context(0) + + data = np.array([b'testing']) + cuda_buf = ctx.buffer_from_data(data) + arr = pa.FixedSizeBinaryArray.from_buffers(pa.binary(7), 1, [None, cuda_buf]) + buf_on_gpu = arr.buffers()[1] + + assert buf_on_gpu.size == cuda_buf.size + assert buf_on_gpu.address == cuda_buf.address + assert buf_on_gpu.is_cpu == cuda_buf.is_cpu + assert buf_on_gpu.is_mutable + + repr1 = "" + assert repr1 in repr(buf_on_gpu) + assert repr2 in repr(buf_on_gpu) + + buf_on_gpu_sliced = buf_on_gpu.slice(2) + cuda_sliced = cuda.CudaBuffer.from_buffer(buf_on_gpu_sliced) + assert cuda_sliced.to_pybytes() == b'sting' + + buf_on_gpu_sliced = buf_on_gpu[2:4] + cuda_sliced = cuda.CudaBuffer.from_buffer(buf_on_gpu_sliced) + assert cuda_sliced.to_pybytes() == b'st' + + # Sliced buffers with same address + assert buf_on_gpu_sliced.equals(cuda_buf[2:4]) + + # Buffers on different devices + msg_device = "Device on which the data resides differs between buffers" + with pytest.raises(ValueError, match=msg_device): + buf_on_gpu.equals(pa.py_buffer(data)) + + msg = "Implemented only for data on CPU device" + # Buffers with different addresses + arr_short = np.array([b'sting']) + cuda_buf_short = ctx.buffer_from_data(arr_short) + with pytest.raises(NotImplementedError, match=msg): + buf_on_gpu_sliced.equals(cuda_buf_short) + arr_short = pa.FixedSizeBinaryArray.from_buffers( + pa.binary(5), 1, [None, cuda_buf_short] + ) + buf_on_gpu_short = arr_short.buffers()[1] + with pytest.raises(NotImplementedError, match=msg): + buf_on_gpu_sliced.equals(buf_on_gpu_short) + + with pytest.raises(NotImplementedError, match=msg): + buf_on_gpu.hex() + + with pytest.raises(NotImplementedError, match=msg): + cuda_buf.hex() + + with pytest.raises(NotImplementedError, match=msg): + buf_on_gpu[1] + + with pytest.raises(NotImplementedError, match=msg): + buf_on_gpu.to_pybytes() + + with pytest.raises(NotImplementedError, match=msg): + pickle_module.dumps(buf_on_gpu, protocol=4) + + with pytest.raises(NotImplementedError, match=msg): + pickle_module.dumps(cuda_buf, protocol=4) + + with pytest.raises(NotImplementedError, match=msg): + memoryview(buf_on_gpu) + + +def test_cache_options(): + opts1 = pa.CacheOptions() + opts2 = pa.CacheOptions(hole_size_limit=1024) + opts3 = pa.CacheOptions(hole_size_limit=4096, range_size_limit=8192) + opts4 = pa.CacheOptions(hole_size_limit=4096, + range_size_limit=8192, prefetch_limit=5) + opts5 = pa.CacheOptions(hole_size_limit=4096, + range_size_limit=8192, lazy=False) + opts6 = pa.CacheOptions.from_network_metrics(time_to_first_byte_millis=100, + transfer_bandwidth_mib_per_sec=200, + ideal_bandwidth_utilization_frac=0.9, + max_ideal_request_size_mib=64) + + assert opts1.hole_size_limit == 8192 + assert opts1.range_size_limit == 32 * 1024 * 1024 + assert opts1.lazy is True + assert opts1.prefetch_limit == 0 + + assert opts2.hole_size_limit == 1024 + assert opts2.range_size_limit == 32 * 1024 * 1024 + assert opts2.lazy is True + assert opts2.prefetch_limit == 0 + + assert opts3.hole_size_limit == 4096 + assert opts3.range_size_limit == 8192 + assert opts3.lazy is True + assert opts3.prefetch_limit == 0 + + assert opts4.hole_size_limit == 4096 + assert opts4.range_size_limit == 8192 + assert opts4.lazy is True + assert opts4.prefetch_limit == 5 + + assert opts5.hole_size_limit == 4096 + assert opts5.range_size_limit == 8192 + assert opts5.lazy is False + assert opts5.prefetch_limit == 0 + + assert opts6.lazy is False + + assert opts1 == opts1 + assert opts1 != opts2 + assert opts2 != opts3 + assert opts3 != opts4 + assert opts4 != opts5 + assert opts6 != opts1 + + +def test_cache_options_pickling(pickle_module): + options = [ + pa.CacheOptions(), + pa.CacheOptions(hole_size_limit=4096, range_size_limit=8192, + lazy=True, prefetch_limit=5), + ] + + for option in options: + assert pickle_module.loads(pickle_module.dumps(option)) == option + + +@pytest.mark.numpy +@pytest.mark.parametrize("compression", [ + pytest.param( + "bz2", marks=pytest.mark.xfail(raises=pa.lib.ArrowNotImplementedError) + ), + "brotli", + "gzip", + "lz4", + "zstd", + "snappy" +]) +def test_compress_decompress(compression): + if not Codec.is_available(compression): + pytest.skip(f"{compression} support is not built") + + INPUT_SIZE = 10000 + test_data = (np.random.randint(0, 255, size=INPUT_SIZE) + .astype(np.uint8) + .tobytes()) + test_buf = pa.py_buffer(test_data) + + compressed_buf = pa.compress(test_buf, codec=compression) + compressed_bytes = pa.compress(test_data, codec=compression, + asbytes=True) + + assert isinstance(compressed_bytes, bytes) + + decompressed_buf = pa.decompress(compressed_buf, INPUT_SIZE, + codec=compression) + decompressed_bytes = pa.decompress(compressed_bytes, INPUT_SIZE, + codec=compression, asbytes=True) + + assert isinstance(decompressed_bytes, bytes) + + assert decompressed_buf.equals(test_buf) + assert decompressed_bytes == test_data + + with pytest.raises(ValueError): + pa.decompress(compressed_bytes, codec=compression) + + +@pytest.mark.numpy +@pytest.mark.parametrize("compression", [ + pytest.param( + "bz2", marks=pytest.mark.xfail(raises=pa.lib.ArrowNotImplementedError) + ), + "brotli", + "gzip", + "lz4", + "zstd", + "snappy" +]) +def test_compression_level(compression): + if not Codec.is_available(compression): + pytest.skip(f"{compression} support is not built") + + codec = Codec(compression) + if codec.name == "snappy": + assert codec.compression_level is None + else: + assert isinstance(codec.compression_level, int) + + # These codecs do not support a compression level + no_level = ['snappy'] + if compression in no_level: + assert not Codec.supports_compression_level(compression) + with pytest.raises(ValueError): + Codec(compression, 0) + with pytest.raises(ValueError): + Codec.minimum_compression_level(compression) + with pytest.raises(ValueError): + Codec.maximum_compression_level(compression) + with pytest.raises(ValueError): + Codec.default_compression_level(compression) + return + + INPUT_SIZE = 10000 + test_data = (np.random.randint(0, 255, size=INPUT_SIZE) + .astype(np.uint8) + .tobytes()) + test_buf = pa.py_buffer(test_data) + + min_level = Codec.minimum_compression_level(compression) + max_level = Codec.maximum_compression_level(compression) + default_level = Codec.default_compression_level(compression) + + assert min_level < max_level + assert default_level >= min_level + assert default_level <= max_level + + for compression_level in range(min_level, max_level+1): + codec = Codec(compression, compression_level) + compressed_buf = codec.compress(test_buf) + compressed_bytes = codec.compress(test_data, asbytes=True) + assert isinstance(compressed_bytes, bytes) + decompressed_buf = codec.decompress(compressed_buf, INPUT_SIZE) + decompressed_bytes = codec.decompress(compressed_bytes, INPUT_SIZE, + asbytes=True) + + assert isinstance(decompressed_bytes, bytes) + + assert decompressed_buf.equals(test_buf) + assert decompressed_bytes == test_data + + with pytest.raises(ValueError): + codec.decompress(compressed_bytes) + + # The ability to set a seed this way is not present on older versions of + # numpy (currently in our python 3.6 CI build). Some inputs might just + # happen to compress the same between the two levels so using seeded + # random numbers is necessary to help get more reliable results + # + # The goal of this part is to ensure the compression_level is being + # passed down to the C++ layer, not to verify the compression algs + # themselves + if not hasattr(np.random, 'default_rng'): + pytest.skip('Requires newer version of numpy') + rng = np.random.default_rng(seed=42) + values = rng.integers(0, 100, 1000) + arr = pa.array(values) + hard_to_compress_buffer = arr.buffers()[1] + + weak_codec = Codec(compression, min_level) + weakly_compressed_buf = weak_codec.compress(hard_to_compress_buffer) + + strong_codec = Codec(compression, max_level) + strongly_compressed_buf = strong_codec.compress(hard_to_compress_buffer) + + assert len(weakly_compressed_buf) > len(strongly_compressed_buf) + + +def test_buffer_memoryview_is_immutable(): + val = b'some data' + + buf = pa.py_buffer(val) + assert not buf.is_mutable + assert isinstance(buf, pa.Buffer) + + result = memoryview(buf) + assert result.readonly + + with pytest.raises(TypeError) as exc: + result[0] = b'h' + assert 'cannot modify read-only' in str(exc.value) + + b = bytes(buf) + with pytest.raises(TypeError) as exc: + b[0] = b'h' + assert 'cannot modify read-only' in str(exc.value) + + +def test_uninitialized_buffer(): + # ARROW-2039: calling Buffer() directly creates an uninitialized object + # ARROW-2638: prevent calling extension class constructors directly + with pytest.raises(TypeError): + pa.Buffer() + + +def test_memory_output_stream(): + # 10 bytes + val = b'dataabcdef' + f = pa.BufferOutputStream() + + K = 1000 + for i in range(K): + f.write(val) + + buf = f.getvalue() + assert len(buf) == len(val) * K + assert buf.to_pybytes() == val * K + + +def test_inmemory_write_after_closed(): + f = pa.BufferOutputStream() + f.write(b'ok') + assert not f.closed + f.getvalue() + assert f.closed + + with pytest.raises(ValueError): + f.write(b'not ok') + + +def test_buffer_protocol_ref_counting(): + def make_buffer(bytes_obj): + return bytearray(pa.py_buffer(bytes_obj)) + + buf = make_buffer(b'foo') + gc.collect() + assert buf == b'foo' + + # ARROW-1053 + val = b'foo' + refcount_before = sys.getrefcount(val) + for i in range(10): + make_buffer(val) + gc.collect() + assert refcount_before == sys.getrefcount(val) + + +@pytest.mark.numpy +def test_nativefile_write_memoryview(): + f = pa.BufferOutputStream() + data = b'ok' + + arr = np.frombuffer(data, dtype='S1') + + f.write(arr) + f.write(bytearray(data)) + f.write(pa.py_buffer(data)) + with pytest.raises(TypeError): + f.write(data.decode('utf8')) + + buf = f.getvalue() + + assert buf.to_pybytes() == data * 3 + + +# ---------------------------------------------------------------------- +# Mock output stream + + +def test_mock_output_stream(): + # Make sure that the MockOutputStream and the BufferOutputStream record the + # same size + + # 10 bytes + val = b'dataabcdef' + + f1 = pa.MockOutputStream() + f2 = pa.BufferOutputStream() + + K = 1000 + for i in range(K): + f1.write(val) + f2.write(val) + + assert f1.size() == len(f2.getvalue()) + + # Do the same test with a table + record_batch = pa.RecordBatch.from_arrays([pa.array([1, 2, 3])], ['a']) + + f1 = pa.MockOutputStream() + f2 = pa.BufferOutputStream() + + stream_writer1 = pa.RecordBatchStreamWriter(f1, record_batch.schema) + stream_writer2 = pa.RecordBatchStreamWriter(f2, record_batch.schema) + + stream_writer1.write_batch(record_batch) + stream_writer2.write_batch(record_batch) + stream_writer1.close() + stream_writer2.close() + + assert f1.size() == len(f2.getvalue()) + + +# ---------------------------------------------------------------------- +# OS files and memory maps + + +@pytest.fixture +def sample_disk_data(request, tmpdir): + SIZE = 4096 + arr = [random.randint(0, 255) for _ in range(SIZE)] + data = bytes(arr[:SIZE]) + + path = os.path.join(str(tmpdir), guid()) + + with open(path, 'wb') as f: + f.write(data) + + def teardown(): + _try_delete(path) + + request.addfinalizer(teardown) + return path, data + + +def _check_native_file_reader(FACTORY, sample_data, + allow_read_out_of_bounds=True): + path, data = sample_data + + f = FACTORY(path, mode='r') + + assert f.read(10) == data[:10] + assert f.read(0) == b'' + assert f.tell() == 10 + + assert f.read() == data[10:] + + assert f.size() == len(data) + + f.seek(0) + assert f.tell() == 0 + + # Seeking past end of file not supported in memory maps + if allow_read_out_of_bounds: + f.seek(len(data) + 1) + assert f.tell() == len(data) + 1 + assert f.read(5) == b'' + + # Test whence argument of seek, ARROW-1287 + assert f.seek(3) == 3 + assert f.seek(3, os.SEEK_CUR) == 6 + assert f.tell() == 6 + + ex_length = len(data) - 2 + assert f.seek(-2, os.SEEK_END) == ex_length + assert f.tell() == ex_length + + +def test_memory_map_reader(sample_disk_data): + _check_native_file_reader(pa.memory_map, sample_disk_data, + allow_read_out_of_bounds=False) + + +def test_memory_map_retain_buffer_reference(sample_disk_data): + path, data = sample_disk_data + + cases = [] + with pa.memory_map(path, 'rb') as f: + cases.append((f.read_buffer(100), data[:100])) + cases.append((f.read_buffer(100), data[100:200])) + cases.append((f.read_buffer(100), data[200:300])) + + # Call gc.collect() for good measure + gc.collect() + + for buf, expected in cases: + assert buf.to_pybytes() == expected + + +def test_os_file_reader(sample_disk_data): + _check_native_file_reader(pa.OSFile, sample_disk_data) + + +def test_os_file_large_seeks(): + check_large_seeks(pa.OSFile) + + +def _try_delete(path): + try: + os.remove(path) + except os.error: + pass + + +def test_memory_map_writer(tmpdir): + if sys.platform == "emscripten": + pytest.xfail("Multiple memory maps to same file don't work on emscripten") + SIZE = 4096 + arr = [random.randint(0, 255) for _ in range(SIZE)] + data = bytes(arr[:SIZE]) + + path = os.path.join(str(tmpdir), guid()) + with open(path, 'wb') as f: + f.write(data) + + f = pa.memory_map(path, mode='r+b') + + f.seek(10) + f.write(b'peekaboo') + assert f.tell() == 18 + + f.seek(10) + assert f.read(8) == b'peekaboo' + + f2 = pa.memory_map(path, mode='r+b') + + f2.seek(10) + f2.write(b'booapeak') + f2.seek(10) + + f.seek(10) + assert f.read(8) == b'booapeak' + + # Does not truncate file + f3 = pa.memory_map(path, mode='w') + f3.write(b'foo') + + with pa.memory_map(path) as f4: + assert f4.size() == SIZE + + with pytest.raises(IOError): + f3.read(5) + + f.seek(0) + assert f.read(3) == b'foo' + + +def test_memory_map_resize(tmpdir): + SIZE = 4096 + arr = [random.randint(0, 255) for _ in range(SIZE)] + data1 = bytes(arr[:(SIZE // 2)]) + data2 = bytes(arr[(SIZE // 2):]) + + path = os.path.join(str(tmpdir), guid()) + + mmap = pa.create_memory_map(path, SIZE / 2) + mmap.write(data1) + + mmap.resize(SIZE) + mmap.write(data2) + + mmap.close() + + with open(path, 'rb') as f: + assert f.read() == bytes(arr[:SIZE]) + + +def test_memory_zero_length(tmpdir): + path = os.path.join(str(tmpdir), guid()) + f = open(path, 'wb') + f.close() + with pa.memory_map(path, mode='r+b') as memory_map: + assert memory_map.size() == 0 + + +def test_memory_map_large_seeks(): + if sys.maxsize >= 2**32: + expected_error = None + else: + expected_error = pytest.raises( + pa.ArrowCapacityError, + match="Requested memory map length 4294967306 " + "does not fit in a C size_t") + check_large_seeks(pa.memory_map, expected_error=expected_error) + + +def test_memory_map_close_remove(tmpdir): + # ARROW-6740: should be able to delete closed memory-mapped file (Windows) + path = os.path.join(str(tmpdir), guid()) + mmap = pa.create_memory_map(path, 4096) + mmap.close() + assert mmap.closed + os.remove(path) # Shouldn't fail + + +def test_memory_map_deref_remove(tmpdir): + path = os.path.join(str(tmpdir), guid()) + pa.create_memory_map(path, 4096) + os.remove(path) # Shouldn't fail + + +def test_os_file_writer(tmpdir): + SIZE = 4096 + arr = [random.randint(0, 255) for _ in range(SIZE)] + data = bytes(arr[:SIZE]) + + path = os.path.join(str(tmpdir), guid()) + with open(path, 'wb') as f: + f.write(data) + + # Truncates file + f2 = pa.OSFile(path, mode='w') + f2.write(b'foo') + + with pa.OSFile(path) as f3: + assert f3.size() == 3 + + with pytest.raises(IOError): + f2.read(5) + f2.close() + + # Append + with pa.OSFile(path, mode='ab') as f4: + f4.write(b'bar') + with pa.OSFile(path) as f5: + assert f5.size() == 6 # foo + bar + + +def test_native_file_write_reject_unicode(): + # ARROW-3227 + nf = pa.BufferOutputStream() + with pytest.raises(TypeError): + nf.write('foo') + + +def test_native_file_modes(tmpdir): + path = os.path.join(str(tmpdir), guid()) + with open(path, 'wb') as f: + f.write(b'foooo') + + with pa.OSFile(path, mode='r') as f: + assert f.mode == 'rb' + assert f.readable() + assert not f.writable() + assert f.seekable() + + with pa.OSFile(path, mode='rb') as f: + assert f.mode == 'rb' + assert f.readable() + assert not f.writable() + assert f.seekable() + + with pa.OSFile(path, mode='w') as f: + assert f.mode == 'wb' + assert not f.readable() + assert f.writable() + assert not f.seekable() + + with pa.OSFile(path, mode='wb') as f: + assert f.mode == 'wb' + assert not f.readable() + assert f.writable() + assert not f.seekable() + + with pa.OSFile(path, mode='ab') as f: + assert f.mode == 'ab' + assert not f.readable() + assert f.writable() + assert not f.seekable() + + with pa.OSFile(path, mode='a') as f: + assert f.mode == 'ab' + assert not f.readable() + assert f.writable() + assert not f.seekable() + + with open(path, 'wb') as f: + f.write(b'foooo') + + with pa.memory_map(path, 'r') as f: + assert f.mode == 'rb' + assert f.readable() + assert not f.writable() + assert f.seekable() + + with pa.memory_map(path, 'r+') as f: + assert f.mode == 'rb+' + assert f.readable() + assert f.writable() + assert f.seekable() + + with pa.memory_map(path, 'r+b') as f: + assert f.mode == 'rb+' + assert f.readable() + assert f.writable() + assert f.seekable() + + +@pytest.mark.xfail( + sys.platform == "emscripten", reason="umask doesn't work on Emscripten" +) +def test_native_file_permissions(tmpdir): + # ARROW-10124: permissions of created files should follow umask + cur_umask = os.umask(0o002) + os.umask(cur_umask) + + path = os.path.join(str(tmpdir), guid()) + with pa.OSFile(path, mode='w'): + pass + assert os.stat(path).st_mode & 0o777 == 0o666 & ~cur_umask + + path = os.path.join(str(tmpdir), guid()) + with pa.memory_map(path, 'w'): + pass + assert os.stat(path).st_mode & 0o777 == 0o666 & ~cur_umask + + +def test_native_file_raises_ValueError_after_close(tmpdir): + path = os.path.join(str(tmpdir), guid()) + with open(path, 'wb') as f: + f.write(b'foooo') + + with pa.OSFile(path, mode='rb') as os_file: + assert not os_file.closed + assert os_file.closed + + with pa.memory_map(path, mode='rb') as mmap_file: + assert not mmap_file.closed + assert mmap_file.closed + + files = [os_file, + mmap_file] + + methods = [('tell', ()), + ('seek', (0,)), + ('size', ()), + ('flush', ()), + ('readable', ()), + ('writable', ()), + ('seekable', ())] + + for f in files: + for method, args in methods: + with pytest.raises(ValueError): + getattr(f, method)(*args) + + +def test_native_file_TextIOWrapper(tmpdir): + data = ('foooo\n' + 'barrr\n' + 'bazzz\n') + + path = os.path.join(str(tmpdir), guid()) + with open(path, 'wb') as f: + f.write(data.encode('utf-8')) + + with TextIOWrapper(pa.OSFile(path, mode='rb')) as fil: + assert fil.readable() + res = fil.read() + assert res == data + assert fil.closed + + with TextIOWrapper(pa.OSFile(path, mode='rb')) as fil: + # Iteration works + lines = list(fil) + assert ''.join(lines) == data + + # Writing + path2 = os.path.join(str(tmpdir), guid()) + with TextIOWrapper(pa.OSFile(path2, mode='wb')) as fil: + assert fil.writable() + fil.write(data) + + with TextIOWrapper(pa.OSFile(path2, mode='rb')) as fil: + res = fil.read() + assert res == data + + +def test_native_file_TextIOWrapper_perf(tmpdir): + # ARROW-16272: TextIOWrapper.readline() shouldn't exhaust a large + # Arrow input stream. + data = b'foo\nquux\n' + path = str(tmpdir / 'largefile.txt') + with open(path, 'wb') as f: + f.write(data * 100_000) + + binary_file = pa.OSFile(path, mode='rb') + with TextIOWrapper(binary_file) as f: + assert binary_file.tell() == 0 + nbytes = 20_000 + lines = f.readlines(nbytes) + assert len(lines) == math.ceil(2 * nbytes / len(data)) + assert nbytes <= binary_file.tell() <= nbytes * 2 + + +def test_native_file_read1(tmpdir): + # ARROW-16272: read1() should not exhaust the input stream if there + # is a large amount of data remaining. + data = b'123\n' * 1_000_000 + path = str(tmpdir / 'largefile.txt') + with open(path, 'wb') as f: + f.write(data) + + chunks = [] + with pa.OSFile(path, mode='rb') as f: + while True: + b = f.read1() + assert len(b) < len(data) + chunks.append(b) + b = f.read1(30_000) + assert len(b) <= 30_000 + chunks.append(b) + if not b: + break + + assert b"".join(chunks) == data + + +@pytest.mark.pandas +def test_native_file_pandas_text_reader(tmpdir): + # ARROW-16272: Pandas' read_csv() should not exhaust an Arrow + # input stream when a small nrows is passed. + import pandas as pd + import pandas.testing as tm + data = b'a,b\n' * 10_000_000 + path = str(tmpdir / 'largefile.txt') + with open(path, 'wb') as f: + f.write(data) + + with pa.OSFile(path, mode='rb') as f: + df = pd.read_csv(f, nrows=10) + expected = pd.DataFrame({'a': ['a'] * 10, 'b': ['b'] * 10}) + tm.assert_frame_equal(df, expected) + # Some readahead occurred, but not up to the end of file + assert f.tell() <= 256 * 1024 + + +def test_native_file_open_error(): + with assert_file_not_found(): + pa.OSFile('non_existent_file', 'rb') + with assert_file_not_found(): + pa.memory_map('non_existent_file', 'rb') + + +# ---------------------------------------------------------------------- +# Buffered streams + +def test_buffered_input_stream(): + raw = pa.BufferReader(b"123456789") + f = pa.BufferedInputStream(raw, buffer_size=4) + assert f.read(2) == b"12" + assert raw.tell() == 4 + f.close() + assert f.closed + assert raw.closed + + +def test_buffered_input_stream_detach_seekable(): + # detach() to a seekable file (io::RandomAccessFile in C++) + f = pa.BufferedInputStream(pa.BufferReader(b"123456789"), buffer_size=4) + assert f.read(2) == b"12" + raw = f.detach() + assert f.closed + assert not raw.closed + assert raw.seekable() + assert raw.read(4) == b"5678" + raw.seek(2) + assert raw.read(4) == b"3456" + + +def test_buffered_input_stream_detach_non_seekable(): + # detach() to a non-seekable file (io::InputStream in C++) + f = pa.BufferedInputStream( + pa.BufferedInputStream(pa.BufferReader(b"123456789"), buffer_size=4), + buffer_size=4) + assert f.read(2) == b"12" + raw = f.detach() + assert f.closed + assert not raw.closed + assert not raw.seekable() + assert raw.read(4) == b"5678" + with pytest.raises(EnvironmentError): + raw.seek(2) + + +@pytest.mark.numpy +def test_buffered_output_stream(): + np_buf = np.zeros(100, dtype=np.int8) # zero-initialized buffer + buf = pa.py_buffer(np_buf) + + raw = pa.FixedSizeBufferWriter(buf) + f = pa.BufferedOutputStream(raw, buffer_size=4) + f.write(b"12") + assert np_buf[:4].tobytes() == b'\0\0\0\0' + f.flush() + assert np_buf[:4].tobytes() == b'12\0\0' + f.write(b"3456789") + f.close() + assert f.closed + assert raw.closed + assert np_buf[:10].tobytes() == b'123456789\0' + + +@pytest.mark.numpy +def test_buffered_output_stream_detach(): + np_buf = np.zeros(100, dtype=np.int8) # zero-initialized buffer + buf = pa.py_buffer(np_buf) + + f = pa.BufferedOutputStream(pa.FixedSizeBufferWriter(buf), buffer_size=4) + f.write(b"12") + assert np_buf[:4].tobytes() == b'\0\0\0\0' + raw = f.detach() + assert f.closed + assert not raw.closed + assert np_buf[:4].tobytes() == b'12\0\0' + + +# ---------------------------------------------------------------------- +# Compressed input and output streams + +def check_compressed_input(data, fn, compression): + raw = pa.OSFile(fn, mode="rb") + with pa.CompressedInputStream(raw, compression) as compressed: + assert not compressed.closed + assert compressed.readable() + assert not compressed.writable() + assert not compressed.seekable() + got = compressed.read() + assert got == data + assert compressed.closed + assert raw.closed + + # Same with read_buffer() + raw = pa.OSFile(fn, mode="rb") + with pa.CompressedInputStream(raw, compression) as compressed: + buf = compressed.read_buffer() + assert isinstance(buf, pa.Buffer) + assert buf.to_pybytes() == data + + +@pytest.mark.gzip +def test_compressed_input_gzip(tmpdir): + data = b"some test data\n" * 10 + b"eof\n" + fn = str(tmpdir / "compressed_input_test.gz") + with gzip.open(fn, "wb") as f: + f.write(data) + check_compressed_input(data, fn, "gzip") + + +def test_compressed_input_bz2(tmpdir): + data = b"some test data\n" * 10 + b"eof\n" + fn = str(tmpdir / "compressed_input_test.bz2") + with bz2.BZ2File(fn, "w") as f: + f.write(data) + try: + check_compressed_input(data, fn, "bz2") + except NotImplementedError as e: + pytest.skip(str(e)) + + +@pytest.mark.gzip +def test_compressed_input_openfile(tmpdir): + if not Codec.is_available("gzip"): + pytest.skip("gzip support is not built") + + data = b"some test data\n" * 10 + b"eof\n" + fn = str(tmpdir / "test_compressed_input_openfile.gz") + with gzip.open(fn, "wb") as f: + f.write(data) + + with pa.CompressedInputStream(fn, "gzip") as compressed: + buf = compressed.read_buffer() + assert buf.to_pybytes() == data + assert compressed.closed + + with pa.CompressedInputStream(pathlib.Path(fn), "gzip") as compressed: + buf = compressed.read_buffer() + assert buf.to_pybytes() == data + assert compressed.closed + + f = open(fn, "rb") + with pa.CompressedInputStream(f, "gzip") as compressed: + buf = compressed.read_buffer() + assert buf.to_pybytes() == data + assert f.closed + + +def check_compressed_concatenated(data, fn, compression): + raw = pa.OSFile(fn, mode="rb") + with pa.CompressedInputStream(raw, compression) as compressed: + got = compressed.read() + assert got == data + + +@pytest.mark.gzip +def test_compressed_concatenated_gzip(tmpdir): + data = b"some test data\n" * 10 + b"eof\n" + fn = str(tmpdir / "compressed_input_test2.gz") + with gzip.open(fn, "wb") as f: + f.write(data[:50]) + with gzip.open(fn, "ab") as f: + f.write(data[50:]) + check_compressed_concatenated(data, fn, "gzip") + + +@pytest.mark.gzip +def test_compressed_input_invalid(): + data = b"foo" * 10 + raw = pa.BufferReader(data) + with pytest.raises(ValueError): + pa.CompressedInputStream(raw, "unknown_compression") + with pytest.raises(TypeError): + pa.CompressedInputStream(raw, None) + + with pa.CompressedInputStream(raw, "gzip") as compressed: + with pytest.raises(IOError, match="zlib inflate failed"): + compressed.read() + + +def make_compressed_output(data, fn, compression): + raw = pa.BufferOutputStream() + with pa.CompressedOutputStream(raw, compression) as compressed: + assert not compressed.closed + assert not compressed.readable() + assert compressed.writable() + assert not compressed.seekable() + compressed.write(data) + assert compressed.closed + assert raw.closed + with open(fn, "wb") as f: + f.write(raw.getvalue()) + + +@pytest.mark.gzip +def test_compressed_output_gzip(tmpdir): + data = b"some test data\n" * 10 + b"eof\n" + fn = str(tmpdir / "compressed_output_test.gz") + make_compressed_output(data, fn, "gzip") + with gzip.open(fn, "rb") as f: + got = f.read() + assert got == data + + +def test_compressed_output_bz2(tmpdir): + data = b"some test data\n" * 10 + b"eof\n" + fn = str(tmpdir / "compressed_output_test.bz2") + try: + make_compressed_output(data, fn, "bz2") + except NotImplementedError as e: + pytest.skip(str(e)) + with bz2.BZ2File(fn, "r") as f: + got = f.read() + assert got == data + + +def test_output_stream_constructor(tmpdir): + if not Codec.is_available("gzip"): + pytest.skip("gzip support is not built") + with pa.CompressedOutputStream(tmpdir / "ctor.gz", "gzip") as stream: + stream.write(b"test") + with (tmpdir / "ctor2.gz").open("wb") as f: + with pa.CompressedOutputStream(f, "gzip") as stream: + stream.write(b"test") + + +@pytest.mark.parametrize(("path", "expected_compression"), [ + ("file.bz2", "bz2"), + ("file.lz4", "lz4"), + (pathlib.Path("file.gz"), "gzip"), + (pathlib.Path("path/to/file.zst"), "zstd"), +]) +def test_compression_detection(path, expected_compression): + if not Codec.is_available(expected_compression): + with pytest.raises(pa.lib.ArrowNotImplementedError): + Codec.detect(path) + else: + codec = Codec.detect(path) + assert isinstance(codec, Codec) + assert codec.name == expected_compression + + +def test_unknown_compression_raises(): + with pytest.raises(ValueError): + Codec.is_available('unknown') + with pytest.raises(TypeError): + Codec(None) + with pytest.raises(ValueError): + Codec('unknown') + + +@pytest.mark.parametrize("compression", [ + "bz2", + "brotli", + "gzip", + "lz4", + "zstd", + pytest.param( + "snappy", + marks=pytest.mark.xfail(raises=pa.lib.ArrowNotImplementedError) + ) +]) +def test_compressed_roundtrip(compression): + if not Codec.is_available(compression): + pytest.skip(f"{compression} support is not built") + + data = b"some test data\n" * 10 + b"eof\n" + raw = pa.BufferOutputStream() + with pa.CompressedOutputStream(raw, compression) as compressed: + compressed.write(data) + + cdata = raw.getvalue() + assert len(cdata) < len(data) + raw = pa.BufferReader(cdata) + with pa.CompressedInputStream(raw, compression) as compressed: + got = compressed.read() + assert got == data + + +@pytest.mark.parametrize( + "compression", + ["bz2", "brotli", "gzip", "lz4", "zstd"] +) +def test_compressed_recordbatch_stream(compression): + if not Codec.is_available(compression): + pytest.skip(f"{compression} support is not built") + + # ARROW-4836: roundtrip a RecordBatch through a compressed stream + table = pa.Table.from_arrays([pa.array([1, 2, 3, 4, 5])], ['a']) + raw = pa.BufferOutputStream() + stream = pa.CompressedOutputStream(raw, compression) + writer = pa.RecordBatchStreamWriter(stream, table.schema) + writer.write_table(table, max_chunksize=3) + writer.close() + stream.close() # Flush data + buf = raw.getvalue() + stream = pa.CompressedInputStream(pa.BufferReader(buf), compression) + got_table = pa.RecordBatchStreamReader(stream).read_all() + assert got_table == table + + +# ---------------------------------------------------------------------- +# Transform input streams + +unicode_transcoding_example = ( + "Dès Noël où un zéphyr haï me vêt de glaçons würmiens " + "je dîne d’exquis rôtis de bœuf au kir à l’aÿ d’âge mûr & cætera !" +) + + +def check_transcoding(data, src_encoding, dest_encoding, chunk_sizes): + chunk_sizes = iter(chunk_sizes) + stream = pa.transcoding_input_stream( + pa.BufferReader(data.encode(src_encoding)), + src_encoding, dest_encoding) + out = [] + while True: + buf = stream.read(next(chunk_sizes)) + out.append(buf) + if not buf: + break + out = b''.join(out) + assert out.decode(dest_encoding) == data + + +@pytest.mark.parametrize('src_encoding, dest_encoding', + [('utf-8', 'utf-16'), + ('utf-16', 'utf-8'), + ('utf-8', 'utf-32-le'), + ('utf-8', 'utf-32-be'), + ]) +def test_transcoding_input_stream(src_encoding, dest_encoding): + # All at once + check_transcoding(unicode_transcoding_example, + src_encoding, dest_encoding, [1000, 0]) + # Incremental + check_transcoding(unicode_transcoding_example, + src_encoding, dest_encoding, + itertools.cycle([1, 2, 3, 5])) + + +@pytest.mark.parametrize('src_encoding, dest_encoding', + [('utf-8', 'utf-8'), + ('utf-8', 'UTF8')]) +def test_transcoding_no_ops(src_encoding, dest_encoding): + # No indirection is wasted when a trivial transcoding is requested + stream = pa.BufferReader(b"abc123") + assert pa.transcoding_input_stream( + stream, src_encoding, dest_encoding) is stream + + +@pytest.mark.parametrize('src_encoding, dest_encoding', + [('utf-8', 'ascii'), + ('utf-8', 'latin-1'), + ]) +def test_transcoding_encoding_error(src_encoding, dest_encoding): + # Character \u0100 cannot be represented in the destination encoding + stream = pa.transcoding_input_stream( + pa.BufferReader("\u0100".encode(src_encoding)), + src_encoding, + dest_encoding) + with pytest.raises(UnicodeEncodeError): + stream.read(1) + + +@pytest.mark.parametrize('src_encoding, dest_encoding', + [('utf-8', 'utf-16'), + ('utf-16', 'utf-8'), + ]) +def test_transcoding_decoding_error(src_encoding, dest_encoding): + # The given bytestring is not valid in the source encoding + stream = pa.transcoding_input_stream( + pa.BufferReader(b"\xff\xff\xff\xff"), + src_encoding, + dest_encoding) + with pytest.raises(UnicodeError): + stream.read(1) + + +# ---------------------------------------------------------------------- +# High-level API + +@pytest.mark.gzip +def test_input_stream_buffer(): + data = b"some test data\n" * 10 + b"eof\n" + for arg in [pa.py_buffer(data), memoryview(data)]: + stream = pa.input_stream(arg) + assert stream.read() == data + + gz_data = gzip.compress(data) + stream = pa.input_stream(memoryview(gz_data)) + assert stream.read() == gz_data + stream = pa.input_stream(memoryview(gz_data), compression='gzip') + assert stream.read() == data + + +def test_input_stream_duck_typing(): + # Accept objects having the right file-like methods... + class DuckReader: + + def close(self): + pass + + @property + def closed(self): + return False + + def read(self, nbytes=None): + return b'hello' + + stream = pa.input_stream(DuckReader()) + assert stream.read(5) == b'hello' + + +def test_input_stream_file_path(tmpdir): + data = b"some test data\n" * 10 + b"eof\n" + file_path = tmpdir / 'input_stream' + with open(str(file_path), 'wb') as f: + f.write(data) + + stream = pa.input_stream(file_path) + assert stream.read() == data + stream = pa.input_stream(str(file_path)) + assert stream.read() == data + stream = pa.input_stream(pathlib.Path(str(file_path))) + assert stream.read() == data + + +@pytest.mark.gzip +def test_input_stream_file_path_compressed(tmpdir): + data = b"some test data\n" * 10 + b"eof\n" + gz_data = gzip.compress(data) + file_path = tmpdir / 'input_stream.gz' + with open(str(file_path), 'wb') as f: + f.write(gz_data) + + stream = pa.input_stream(file_path) + assert stream.read() == data + stream = pa.input_stream(str(file_path)) + assert stream.read() == data + stream = pa.input_stream(pathlib.Path(str(file_path))) + assert stream.read() == data + + stream = pa.input_stream(file_path, compression='gzip') + assert stream.read() == data + stream = pa.input_stream(file_path, compression=None) + assert stream.read() == gz_data + + +def test_input_stream_file_path_buffered(tmpdir): + data = b"some test data\n" * 10 + b"eof\n" + file_path = tmpdir / 'input_stream.buffered' + with open(str(file_path), 'wb') as f: + f.write(data) + + stream = pa.input_stream(file_path, buffer_size=32) + assert isinstance(stream, pa.BufferedInputStream) + assert stream.read() == data + stream = pa.input_stream(str(file_path), buffer_size=64) + assert isinstance(stream, pa.BufferedInputStream) + assert stream.read() == data + stream = pa.input_stream(pathlib.Path(str(file_path)), buffer_size=1024) + assert isinstance(stream, pa.BufferedInputStream) + assert stream.read() == data + + unbuffered_stream = pa.input_stream(file_path, buffer_size=0) + assert isinstance(unbuffered_stream, pa.OSFile) + + msg = 'Buffer size must be larger than zero' + with pytest.raises(ValueError, match=msg): + pa.input_stream(file_path, buffer_size=-1) + with pytest.raises(TypeError): + pa.input_stream(file_path, buffer_size='million') + + +@pytest.mark.gzip +def test_input_stream_file_path_compressed_and_buffered(tmpdir): + data = b"some test data\n" * 100 + b"eof\n" + gz_data = gzip.compress(data) + file_path = tmpdir / 'input_stream_compressed_and_buffered.gz' + with open(str(file_path), 'wb') as f: + f.write(gz_data) + + stream = pa.input_stream(file_path, buffer_size=32, compression='gzip') + assert stream.read() == data + stream = pa.input_stream(str(file_path), buffer_size=64) + assert stream.read() == data + stream = pa.input_stream(pathlib.Path(str(file_path)), buffer_size=1024) + assert stream.read() == data + + +@pytest.mark.gzip +def test_input_stream_python_file(tmpdir): + data = b"some test data\n" * 10 + b"eof\n" + bio = BytesIO(data) + + stream = pa.input_stream(bio) + assert stream.read() == data + + gz_data = gzip.compress(data) + bio = BytesIO(gz_data) + stream = pa.input_stream(bio) + assert stream.read() == gz_data + bio.seek(0) + stream = pa.input_stream(bio, compression='gzip') + assert stream.read() == data + + file_path = tmpdir / 'input_stream' + with open(str(file_path), 'wb') as f: + f.write(data) + with open(str(file_path), 'rb') as f: + stream = pa.input_stream(f) + assert stream.read() == data + + +@pytest.mark.gzip +def test_input_stream_native_file(): + data = b"some test data\n" * 10 + b"eof\n" + gz_data = gzip.compress(data) + reader = pa.BufferReader(gz_data) + stream = pa.input_stream(reader) + assert stream is reader + reader = pa.BufferReader(gz_data) + stream = pa.input_stream(reader, compression='gzip') + assert stream.read() == data + + +def test_input_stream_errors(tmpdir): + buf = memoryview(b"") + with pytest.raises(ValueError): + pa.input_stream(buf, compression="foo") + + for arg in [bytearray(), StringIO()]: + with pytest.raises(TypeError): + pa.input_stream(arg) + + with assert_file_not_found(): + pa.input_stream("non_existent_file") + + with open(str(tmpdir / 'new_file'), 'wb') as f: + with pytest.raises(TypeError, match="readable file expected"): + pa.input_stream(f) + + +def test_output_stream_buffer(): + data = b"some test data\n" * 10 + b"eof\n" + buf = bytearray(len(data)) + stream = pa.output_stream(pa.py_buffer(buf)) + stream.write(data) + assert buf == data + + buf = bytearray(len(data)) + stream = pa.output_stream(memoryview(buf)) + stream.write(data) + assert buf == data + + +def test_output_stream_duck_typing(): + # Accept objects having the right file-like methods... + class DuckWriter: + def __init__(self): + self.buf = pa.BufferOutputStream() + + def close(self): + pass + + @property + def closed(self): + return False + + def write(self, data): + self.buf.write(data) + + duck_writer = DuckWriter() + stream = pa.output_stream(duck_writer) + assert stream.write(b'hello') + assert duck_writer.buf.getvalue().to_pybytes() == b'hello' + + +def test_output_stream_file_path(tmpdir): + data = b"some test data\n" * 10 + b"eof\n" + file_path = tmpdir / 'output_stream' + + def check_data(file_path, data): + with pa.output_stream(file_path) as stream: + stream.write(data) + with open(str(file_path), 'rb') as f: + assert f.read() == data + + check_data(file_path, data) + check_data(str(file_path), data) + check_data(pathlib.Path(str(file_path)), data) + + +@pytest.mark.gzip +def test_output_stream_file_path_compressed(tmpdir): + data = b"some test data\n" * 10 + b"eof\n" + file_path = tmpdir / 'output_stream.gz' + + def check_data(file_path, data, **kwargs): + with pa.output_stream(file_path, **kwargs) as stream: + stream.write(data) + with open(str(file_path), 'rb') as f: + return f.read() + + assert gzip.decompress(check_data(file_path, data)) == data + assert gzip.decompress(check_data(str(file_path), data)) == data + assert gzip.decompress( + check_data(pathlib.Path(str(file_path)), data)) == data + + assert gzip.decompress( + check_data(file_path, data, compression='gzip')) == data + assert check_data(file_path, data, compression=None) == data + + with pytest.raises(ValueError, match='Invalid value for compression'): + assert check_data(file_path, data, compression='rabbit') == data + + +def test_output_stream_file_path_buffered(tmpdir): + data = b"some test data\n" * 10 + b"eof\n" + file_path = tmpdir / 'output_stream.buffered' + + def check_data(file_path, data, **kwargs): + with pa.output_stream(file_path, **kwargs) as stream: + if kwargs.get('buffer_size', 0) > 0: + assert isinstance(stream, pa.BufferedOutputStream) + stream.write(data) + with open(str(file_path), 'rb') as f: + return f.read() + + unbuffered_stream = pa.output_stream(file_path, buffer_size=0) + assert isinstance(unbuffered_stream, pa.OSFile) + + msg = 'Buffer size must be larger than zero' + with pytest.raises(ValueError, match=msg): + assert check_data(file_path, data, buffer_size=-128) == data + + assert check_data(file_path, data, buffer_size=32) == data + assert check_data(file_path, data, buffer_size=1024) == data + assert check_data(str(file_path), data, buffer_size=32) == data + + result = check_data(pathlib.Path(str(file_path)), data, buffer_size=32) + assert result == data + + +@pytest.mark.gzip +def test_output_stream_file_path_compressed_and_buffered(tmpdir): + data = b"some test data\n" * 100 + b"eof\n" + file_path = tmpdir / 'output_stream_compressed_and_buffered.gz' + + def check_data(file_path, data, **kwargs): + with pa.output_stream(file_path, **kwargs) as stream: + stream.write(data) + with open(str(file_path), 'rb') as f: + return f.read() + + result = check_data(file_path, data, buffer_size=32) + assert gzip.decompress(result) == data + + result = check_data(file_path, data, buffer_size=1024) + assert gzip.decompress(result) == data + + result = check_data(file_path, data, buffer_size=1024, compression='gzip') + assert gzip.decompress(result) == data + + +def test_output_stream_destructor(tmpdir): + # The wrapper returned by pa.output_stream() should respect Python + # file semantics, i.e. destroying it should close the underlying + # file cleanly. + data = b"some test data\n" + file_path = tmpdir / 'output_stream.buffered' + + def check_data(file_path, data, **kwargs): + stream = pa.output_stream(file_path, **kwargs) + stream.write(data) + del stream + gc.collect() + with open(str(file_path), 'rb') as f: + return f.read() + + assert check_data(file_path, data, buffer_size=0) == data + assert check_data(file_path, data, buffer_size=1024) == data + + +@pytest.mark.gzip +def test_output_stream_python_file(tmpdir): + data = b"some test data\n" * 10 + b"eof\n" + + def check_data(data, **kwargs): + # XXX cannot use BytesIO because stream.close() is necessary + # to finish writing compressed data, but it will also close the + # underlying BytesIO + fn = str(tmpdir / 'output_stream_file') + with open(fn, 'wb') as f: + with pa.output_stream(f, **kwargs) as stream: + stream.write(data) + with open(fn, 'rb') as f: + return f.read() + + assert check_data(data) == data + assert gzip.decompress(check_data(data, compression='gzip')) == data + + +def test_output_stream_errors(tmpdir): + buf = memoryview(bytearray()) + with pytest.raises(ValueError): + pa.output_stream(buf, compression="foo") + + for arg in [bytearray(), StringIO()]: + with pytest.raises(TypeError): + pa.output_stream(arg) + + fn = str(tmpdir / 'new_file') + with open(fn, 'wb') as f: + pass + with open(fn, 'rb') as f: + with pytest.raises(TypeError, match="writable file expected"): + pa.output_stream(f) diff --git a/shared/package-files/7c/7c125311645eed9ecc907015e85fe3dc44b980812d075b12b450bafa7cdccf15/darwin-100x37-m b/shared/package-files/7c/7c125311645eed9ecc907015e85fe3dc44b980812d075b12b450bafa7cdccf15/darwin-100x37-m new file mode 100644 index 0000000000000000000000000000000000000000..d1d76a42c68c89fc6fc473952b1e857368f19b1e Binary files /dev/null and b/shared/package-files/7c/7c125311645eed9ecc907015e85fe3dc44b980812d075b12b450bafa7cdccf15/darwin-100x37-m differ diff --git a/shared/package-files/7c/7c125311645eed9ecc907015e85fe3dc44b980812d075b12b450bafa7cdccf15/xnuppc-100x37-m b/shared/package-files/7c/7c125311645eed9ecc907015e85fe3dc44b980812d075b12b450bafa7cdccf15/xnuppc-100x37-m new file mode 100644 index 0000000000000000000000000000000000000000..d1d76a42c68c89fc6fc473952b1e857368f19b1e Binary files /dev/null and b/shared/package-files/7c/7c125311645eed9ecc907015e85fe3dc44b980812d075b12b450bafa7cdccf15/xnuppc-100x37-m differ diff --git a/shared/package-files/7c/7c12e283ccf9e3c82c041950c3a54974665be0872a263effd268b615dda77043/test_filters.py b/shared/package-files/7c/7c12e283ccf9e3c82c041950c3a54974665be0872a263effd268b615dda77043/test_filters.py new file mode 100644 index 0000000000000000000000000000000000000000..2da59117cad0d72d5830b53c8d19c6e0ca988d54 --- /dev/null +++ b/shared/package-files/7c/7c12e283ccf9e3c82c041950c3a54974665be0872a263effd268b615dda77043/test_filters.py @@ -0,0 +1,177 @@ +import pytest + +import networkx as nx + + +class TestFilterFactory: + def test_no_filter(self): + nf = nx.filters.no_filter + assert nf() + assert nf(1) + assert nf(2, 1) + + def test_hide_nodes(self): + f = nx.classes.filters.hide_nodes([1, 2, 3]) + assert not f(1) + assert not f(2) + assert not f(3) + assert f(4) + assert f(0) + assert f("a") + pytest.raises(TypeError, f, 1, 2) + pytest.raises(TypeError, f) + + def test_show_nodes(self): + f = nx.classes.filters.show_nodes([1, 2, 3]) + assert f(1) + assert f(2) + assert f(3) + assert not f(4) + assert not f(0) + assert not f("a") + pytest.raises(TypeError, f, 1, 2) + pytest.raises(TypeError, f) + + def test_hide_edges(self): + factory = nx.classes.filters.hide_edges + f = factory([(1, 2), (3, 4)]) + assert not f(1, 2) + assert not f(3, 4) + assert not f(4, 3) + assert f(2, 3) + assert f(0, -1) + assert f("a", "b") + pytest.raises(TypeError, f, 1, 2, 3) + pytest.raises(TypeError, f, 1) + pytest.raises(TypeError, f) + pytest.raises(TypeError, factory, [1, 2, 3]) + pytest.raises(ValueError, factory, [(1, 2, 3)]) + + def test_show_edges(self): + factory = nx.classes.filters.show_edges + f = factory([(1, 2), (3, 4)]) + assert f(1, 2) + assert f(3, 4) + assert f(4, 3) + assert not f(2, 3) + assert not f(0, -1) + assert not f("a", "b") + pytest.raises(TypeError, f, 1, 2, 3) + pytest.raises(TypeError, f, 1) + pytest.raises(TypeError, f) + pytest.raises(TypeError, factory, [1, 2, 3]) + pytest.raises(ValueError, factory, [(1, 2, 3)]) + + def test_hide_diedges(self): + factory = nx.classes.filters.hide_diedges + f = factory([(1, 2), (3, 4)]) + assert not f(1, 2) + assert not f(3, 4) + assert f(4, 3) + assert f(2, 3) + assert f(0, -1) + assert f("a", "b") + pytest.raises(TypeError, f, 1, 2, 3) + pytest.raises(TypeError, f, 1) + pytest.raises(TypeError, f) + pytest.raises(TypeError, factory, [1, 2, 3]) + pytest.raises(ValueError, factory, [(1, 2, 3)]) + + def test_show_diedges(self): + factory = nx.classes.filters.show_diedges + f = factory([(1, 2), (3, 4)]) + assert f(1, 2) + assert f(3, 4) + assert not f(4, 3) + assert not f(2, 3) + assert not f(0, -1) + assert not f("a", "b") + pytest.raises(TypeError, f, 1, 2, 3) + pytest.raises(TypeError, f, 1) + pytest.raises(TypeError, f) + pytest.raises(TypeError, factory, [1, 2, 3]) + pytest.raises(ValueError, factory, [(1, 2, 3)]) + + def test_hide_multiedges(self): + factory = nx.classes.filters.hide_multiedges + f = factory([(1, 2, 0), (3, 4, 1), (1, 2, 1)]) + assert not f(1, 2, 0) + assert not f(1, 2, 1) + assert f(1, 2, 2) + assert f(3, 4, 0) + assert not f(3, 4, 1) + assert not f(4, 3, 1) + assert f(4, 3, 0) + assert f(2, 3, 0) + assert f(0, -1, 0) + assert f("a", "b", 0) + pytest.raises(TypeError, f, 1, 2, 3, 4) + pytest.raises(TypeError, f, 1, 2) + pytest.raises(TypeError, f, 1) + pytest.raises(TypeError, f) + pytest.raises(TypeError, factory, [1, 2, 3]) + pytest.raises(ValueError, factory, [(1, 2)]) + pytest.raises(ValueError, factory, [(1, 2, 3, 4)]) + + def test_show_multiedges(self): + factory = nx.classes.filters.show_multiedges + f = factory([(1, 2, 0), (3, 4, 1), (1, 2, 1)]) + assert f(1, 2, 0) + assert f(1, 2, 1) + assert not f(1, 2, 2) + assert not f(3, 4, 0) + assert f(3, 4, 1) + assert f(4, 3, 1) + assert not f(4, 3, 0) + assert not f(2, 3, 0) + assert not f(0, -1, 0) + assert not f("a", "b", 0) + pytest.raises(TypeError, f, 1, 2, 3, 4) + pytest.raises(TypeError, f, 1, 2) + pytest.raises(TypeError, f, 1) + pytest.raises(TypeError, f) + pytest.raises(TypeError, factory, [1, 2, 3]) + pytest.raises(ValueError, factory, [(1, 2)]) + pytest.raises(ValueError, factory, [(1, 2, 3, 4)]) + + def test_hide_multidiedges(self): + factory = nx.classes.filters.hide_multidiedges + f = factory([(1, 2, 0), (3, 4, 1), (1, 2, 1)]) + assert not f(1, 2, 0) + assert not f(1, 2, 1) + assert f(1, 2, 2) + assert f(3, 4, 0) + assert not f(3, 4, 1) + assert f(4, 3, 1) + assert f(4, 3, 0) + assert f(2, 3, 0) + assert f(0, -1, 0) + assert f("a", "b", 0) + pytest.raises(TypeError, f, 1, 2, 3, 4) + pytest.raises(TypeError, f, 1, 2) + pytest.raises(TypeError, f, 1) + pytest.raises(TypeError, f) + pytest.raises(TypeError, factory, [1, 2, 3]) + pytest.raises(ValueError, factory, [(1, 2)]) + pytest.raises(ValueError, factory, [(1, 2, 3, 4)]) + + def test_show_multidiedges(self): + factory = nx.classes.filters.show_multidiedges + f = factory([(1, 2, 0), (3, 4, 1), (1, 2, 1)]) + assert f(1, 2, 0) + assert f(1, 2, 1) + assert not f(1, 2, 2) + assert not f(3, 4, 0) + assert f(3, 4, 1) + assert not f(4, 3, 1) + assert not f(4, 3, 0) + assert not f(2, 3, 0) + assert not f(0, -1, 0) + assert not f("a", "b", 0) + pytest.raises(TypeError, f, 1, 2, 3, 4) + pytest.raises(TypeError, f, 1, 2) + pytest.raises(TypeError, f, 1) + pytest.raises(TypeError, f) + pytest.raises(TypeError, factory, [1, 2, 3]) + pytest.raises(ValueError, factory, [(1, 2)]) + pytest.raises(ValueError, factory, [(1, 2, 3, 4)]) diff --git a/shared/package-files/7c/7c132097d9d7a3dc0e022f99afdbf1b99e03d4888399db98744206f3918308a5/diagonal_scatter_ops.h b/shared/package-files/7c/7c132097d9d7a3dc0e022f99afdbf1b99e03d4888399db98744206f3918308a5/diagonal_scatter_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..07495a5f2b2497d574269740413d740963190790 --- /dev/null +++ b/shared/package-files/7c/7c132097d9d7a3dc0e022f99afdbf1b99e03d4888399db98744206f3918308a5/diagonal_scatter_ops.h @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API diagonal_scatter { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &, int64_t, int64_t, int64_t); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::diagonal_scatter") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "diagonal_scatter(Tensor self, Tensor src, int offset=0, int dim1=0, int dim2=1) -> Tensor") + static at::Tensor call(const at::Tensor & self, const at::Tensor & src, int64_t offset, int64_t dim1, int64_t dim2); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & src, int64_t offset, int64_t dim1, int64_t dim2); +}; + +struct TORCH_API diagonal_scatter_out { + using schema = at::Tensor & (const at::Tensor &, const at::Tensor &, int64_t, int64_t, int64_t, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::diagonal_scatter") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "diagonal_scatter.out(Tensor self, Tensor src, int offset=0, int dim1=0, int dim2=1, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, const at::Tensor & src, int64_t offset, int64_t dim1, int64_t dim2, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & src, int64_t offset, int64_t dim1, int64_t dim2, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/7c/7c13d5d65ea4ae0b467c76ac45f68bef4f0cd3978db338c0406df7cfe36dbd48/jitlink.ptx b/shared/package-files/7c/7c13d5d65ea4ae0b467c76ac45f68bef4f0cd3978db338c0406df7cfe36dbd48/jitlink.ptx new file mode 100644 index 0000000000000000000000000000000000000000..dde0cc214aac1c6561534a483b60b7baa78629d2 --- /dev/null +++ b/shared/package-files/7c/7c13d5d65ea4ae0b467c76ac45f68bef4f0cd3978db338c0406df7cfe36dbd48/jitlink.ptx @@ -0,0 +1,51 @@ +// +// Generated by NVIDIA NVVM Compiler +// +// Compiler Build ID: CL-27506705 +// Cuda compilation tools, release 10.2, V10.2.89 +// Based on LLVM 3.4svn +// + +.version 6.5 +.target sm_50 +.address_size 64 + + // .globl bar + +.visible .func (.param .b32 func_retval0) bar( + .param .b64 bar_param_0, + .param .b32 bar_param_1 +) +{ + .reg .b32 %r<4>; + .reg .b64 %rd<2>; + + + ld.param.u64 %rd1, [bar_param_0]; + ld.param.u32 %r1, [bar_param_1]; + shl.b32 %r2, %r1, 1; + st.u32 [%rd1], %r2; + mov.u32 %r3, 0; + st.param.b32 [func_retval0+0], %r3; + ret; +} + + // .globl array_mutator +.visible .func (.param .b32 func_retval0) array_mutator( + .param .b64 array_mutator_param_0, + .param .b64 array_mutator_param_1 +) +{ + .reg .b32 %r<3>; + .reg .b64 %rd<2>; + + + ld.param.u64 %rd1, [array_mutator_param_1]; + ld.u32 %r1, [%rd1+4]; + st.u32 [%rd1], %r1; + mov.u32 %r2, 0; + st.param.b32 [func_retval0+0], %r2; + ret; +} + + diff --git a/shared/package-files/7c/7c14a11a75df13294d19cd5d72baa874358da91e0a345876b3b5aad2c17e7cb0/leased_path_entry.py b/shared/package-files/7c/7c14a11a75df13294d19cd5d72baa874358da91e0a345876b3b5aad2c17e7cb0/leased_path_entry.py new file mode 100644 index 0000000000000000000000000000000000000000..8b49397f5434c7a21827a55bc9009626c9415096 --- /dev/null +++ b/shared/package-files/7c/7c14a11a75df13294d19cd5d72baa874358da91e0a345876b3b5aad2c17e7cb0/leased_path_entry.py @@ -0,0 +1,27 @@ +# Copyright (C) 2012 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +from logging import getLogger + +from ..auxlib.entity import Entity, EnumField, StringField +from .enums import LeasedPathType + +log = getLogger(__name__) + + +class LeasedPathEntry(Entity): + """ + _path: short path for the leased path, using forward slashes + target_path: the full path to the executable in the private env + target_prefix: the full path to the private environment + leased_path: the full path for the lease in the root prefix + package_name: the package holding the lease + leased_path_type: application_entry_point + + """ + + _path = StringField() + target_path = StringField() + target_prefix = StringField() + leased_path = StringField() + package_name = StringField() + leased_path_type = EnumField(LeasedPathType) diff --git a/shared/package-files/7c/7c1a40bff4f0db44962a720da96f94ca2aa5e45584f5637a4adbd2a5fa07abbc/_amp_foreach_non_finite_check_and_unscale_compositeexplicitautograd_dispatch.h b/shared/package-files/7c/7c1a40bff4f0db44962a720da96f94ca2aa5e45584f5637a4adbd2a5fa07abbc/_amp_foreach_non_finite_check_and_unscale_compositeexplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..2540f4df92e1ba255b4ac36cce81a2e58500d4cc --- /dev/null +++ b/shared/package-files/7c/7c1a40bff4f0db44962a720da96f94ca2aa5e45584f5637a4adbd2a5fa07abbc/_amp_foreach_non_finite_check_and_unscale_compositeexplicitautograd_dispatch.h @@ -0,0 +1,25 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API ::std::tuple<::std::vector,at::Tensor> _amp_foreach_non_finite_check_and_unscale(at::TensorList self, const at::Tensor & found_inf, const at::Tensor & inv_scale); +TORCH_API void _amp_foreach_non_finite_check_and_unscale_out(at::TensorList out, at::TensorList self, at::Tensor & found_inf, const at::Tensor & inv_scale); +TORCH_API void _amp_foreach_non_finite_check_and_unscale_outf(at::TensorList self, at::Tensor & found_inf, const at::Tensor & inv_scale, at::TensorList out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/7c/7c1c707cd6ad3872515cf3fc9d8dd1a3f7cc08e3eb71813ed427499b256a8751/command_template b/shared/package-files/7c/7c1c707cd6ad3872515cf3fc9d8dd1a3f7cc08e3eb71813ed427499b256a8751/command_template new file mode 100644 index 0000000000000000000000000000000000000000..6106819db843b5d93e85c4ee6929825d45c2f08a --- /dev/null +++ b/shared/package-files/7c/7c1c707cd6ad3872515cf3fc9d8dd1a3f7cc08e3eb71813ed427499b256a8751/command_template @@ -0,0 +1,33 @@ +"""distutils.command.x + +Implements the Distutils 'x' command. +""" + +# created 2000/mm/dd, John Doe + +__revision__ = "$Id$" + +from distutils.core import Command + + +class x(Command): + + # Brief (40-50 characters) description of the command + description = "" + + # List of option tuples: long name, short name (None if no short + # name), and help string. + user_options = [('', '', + ""), + ] + + def initialize_options(self): + self. = None + self. = None + self. = None + + def finalize_options(self): + if self.x is None: + self.x = + + def run(self): diff --git a/shared/package-files/7c/7c1e5f21e8833b85947ab52ab1ebeb7ecfb8cfcd1122fcee57c3ad96fed8d8cd/knightstour.tcl b/shared/package-files/7c/7c1e5f21e8833b85947ab52ab1ebeb7ecfb8cfcd1122fcee57c3ad96fed8d8cd/knightstour.tcl new file mode 100644 index 0000000000000000000000000000000000000000..11b3b5cffd2020f178c885510d445cb3b197ba08 --- /dev/null +++ b/shared/package-files/7c/7c1e5f21e8833b85947ab52ab1ebeb7ecfb8cfcd1122fcee57c3ad96fed8d8cd/knightstour.tcl @@ -0,0 +1,268 @@ +# Copyright (C) 2008 Pat Thoyts +# +# Calculate a Knight's tour of a chessboard. +# +# This uses Warnsdorff's rule to calculate the next square each +# time. This specifies that the next square should be the one that +# has the least number of available moves. +# +# Using this rule it is possible to get to a position where +# there are no squares available to move into. In this implementation +# this occurs when the starting square is d6. +# +# To solve this fault an enhancement to the rule is that if we +# have a choice of squares with an equal score, we should choose +# the one nearest the edge of the board. +# +# If the call to the Edgemost function is commented out you can see +# this occur. +# +# You can drag the knight to a specific square to start if you wish. +# If you let it repeat then it will choose random start positions +# for each new tour. + +package require Tk + +# Return a list of accessible squares from a given square +proc ValidMoves {square} { + set moves {} + foreach pair {{-1 -2} {-2 -1} {-2 1} {-1 2} {1 2} {2 1} {2 -1} {1 -2}} { + set col [expr {($square % 8) + [lindex $pair 0]}] + set row [expr {($square / 8) + [lindex $pair 1]}] + if {$row >= 0 && $row < 8 && $col >= 0 && $col < 8} { + lappend moves [expr {$row * 8 + $col}] + } + } + return $moves +} + +# Return the number of available moves for this square +proc CheckSquare {square} { + variable visited + set moves 0 + foreach test [ValidMoves $square] { + if {[lsearch -exact -integer $visited $test] < 0} { + incr moves + } + } + return $moves +} + +# Select the next square to move to. Returns -1 if there are no available +# squares remaining that we can move to. +proc Next {square} { + variable visited + set minimum 9 + set nextSquare -1 + foreach testSquare [ValidMoves $square] { + if {[lsearch -exact -integer $visited $testSquare] < 0} { + set count [CheckSquare $testSquare] + if {$count < $minimum} { + set minimum $count + set nextSquare $testSquare + } elseif {$count == $minimum} { + # to remove the enhancement to Warnsdorff's rule + # remove the next line: + set nextSquare [Edgemost $nextSquare $testSquare] + } + } + } + return $nextSquare +} + +# Select the square nearest the edge of the board +proc Edgemost {a b} { + set colA [expr {3-int(abs(3.5-($a%8)))}] + set colB [expr {3-int(abs(3.5-($b%8)))}] + set rowA [expr {3-int(abs(3.5-($a/8)))}] + set rowB [expr {3-int(abs(3.5-($b/8)))}] + return [expr {($colA * $rowA) < ($colB * $rowB) ? $a : $b}] +} + +# Display a square number as a standard chess square notation. +proc N {square} { + return [format %c%d [expr {97 + $square % 8}] \ + [expr {$square / 8 + 1}]] +} + +# Perform a Knight's move and schedule the next move. +proc MovePiece {dlg last square} { + variable visited + variable delay + variable continuous + $dlg.f.txt insert end "[llength $visited]. [N $last] .. [N $square]\n" {} + $dlg.f.txt see end + $dlg.f.c itemconfigure [expr {1+$last}] -state normal -outline black + $dlg.f.c itemconfigure [expr {1+$square}] -state normal -outline red + $dlg.f.c moveto knight {*}[lrange [$dlg.f.c coords [expr {1+$square}]] 0 1] + lappend visited $square + set next [Next $square] + if {$next ne -1} { + variable aid [after $delay [list MovePiece $dlg $square $next]] + } else { + $dlg.tf.b1 configure -state normal + if {[llength $visited] == 64} { + variable initial + if {$initial == $square} { + $dlg.f.txt insert end "Closed tour!" + } else { + $dlg.f.txt insert end "Success\n" {} + if {$continuous} { + after [expr {$delay * 2}] [namespace code \ + [list Tour $dlg [expr {int(rand() * 64)}]]] + } + } + } else { + $dlg.f.txt insert end "FAILED!\n" {} + } + } +} + +# Begin a new tour of the board given a random start position +proc Tour {dlg {square {}}} { + variable visited {} + $dlg.f.txt delete 1.0 end + $dlg.tf.b1 configure -state disabled + for {set n 0} {$n < 64} {incr n} { + $dlg.f.c itemconfigure $n -state disabled -outline black + } + if {$square eq {}} { + set coords [lrange [$dlg.f.c coords knight] 0 1] + set square [expr {[$dlg.f.c find closest {*}$coords 0 65]-1}] + } + variable initial $square + after idle [list MovePiece $dlg $initial $initial] +} + +proc Stop {} { + variable aid + catch {after cancel $aid} +} + +proc Exit {dlg} { + Stop + destroy $dlg +} + +proc SetDelay {new} { + variable delay [expr {int($new)}] +} + +proc DragStart {w x y} { + $w dtag selected + $w addtag selected withtag current + variable dragging [list $x $y] +} +proc DragMotion {w x y} { + variable dragging + if {[info exists dragging]} { + $w move selected [expr {$x - [lindex $dragging 0]}] \ + [expr {$y - [lindex $dragging 1]}] + variable dragging [list $x $y] + } +} +proc DragEnd {w x y} { + set square [$w find closest $x $y 0 65] + $w moveto selected {*}[lrange [$w coords $square] 0 1] + $w dtag selected + variable dragging ; unset dragging +} + +proc CreateGUI {} { + catch {destroy .knightstour} + set dlg [toplevel .knightstour] + wm title $dlg "Knights tour" + wm withdraw $dlg + set f [ttk::frame $dlg.f] + set c [canvas $f.c -width 240 -height 240] + text $f.txt -width 10 -height 1 \ + -yscrollcommand [list $f.vs set] -font {Arial 8} + ttk::scrollbar $f.vs -command [list $f.txt yview] + + variable delay 600 + variable continuous 0 + ttk::frame $dlg.tf + ttk::label $dlg.tf.ls -text Speed + ttk::scale $dlg.tf.sc -from 8 -to 2000 -command [list SetDelay] \ + -variable [namespace which -variable delay] + ttk::checkbutton $dlg.tf.cc -text Repeat \ + -variable [namespace which -variable continuous] + ttk::button $dlg.tf.b1 -text Start -command [list Tour $dlg] + ttk::button $dlg.tf.b2 -text Exit -command [list Exit $dlg] + set square 0 + for {set row 7} {$row >= 0} {incr row -1} { + for {set col 0} {$col < 8} {incr col} { + if {(($col & 1) ^ ($row & 1))} { + set fill tan3 ; set dfill tan4 + } else { + set fill bisque ; set dfill bisque3 + } + set coords [list [expr {$col * 30 + 4}] [expr {$row * 30 + 4}] \ + [expr {$col * 30 + 30}] [expr {$row * 30 + 30}]] + $c create rectangle $coords -fill $fill -disabledfill $dfill \ + -width 2 -state disabled -outline black + } + } + if {[tk windowingsystem] ne "x11"} { + catch {eval font create KnightFont -size -24} + $c create text 0 0 -font KnightFont -text "\u265e" \ + -anchor nw -tags knight -fill black -activefill "#600000" + } else { + # On X11 we cannot reliably tell if the \u265e glyph is available + # so just use a polygon + set pts { + 2 25 24 25 21 19 20 8 14 0 10 0 0 13 0 16 + 2 17 4 14 5 15 3 17 5 17 9 14 10 15 5 21 + } + $c create polygon $pts -tag knight -offset 8 \ + -fill black -activefill "#600000" + } + $c moveto knight {*}[lrange [$c coords [expr {1 + int(rand() * 64)}]] 0 1] + $c bind knight [namespace code [list DragStart %W %x %y]] + $c bind knight [namespace code [list DragMotion %W %x %y]] + $c bind knight [namespace code [list DragEnd %W %x %y]] + + grid $c $f.txt $f.vs -sticky news + grid rowconfigure $f 0 -weight 1 + grid columnconfigure $f 1 -weight 1 + + grid $f - - - - - -sticky news + set things [list $dlg.tf.ls $dlg.tf.sc $dlg.tf.cc $dlg.tf.b1] + if {![info exists ::widgetDemo]} { + lappend things $dlg.tf.b2 + if {[tk windowingsystem] ne "aqua"} { + set things [linsert $things 0 [ttk::sizegrip $dlg.tf.sg]] + } + } + pack {*}$things -side right + if {[tk windowingsystem] eq "aqua"} { + pack configure {*}$things -padx {4 4} -pady {12 12} + pack configure [lindex $things 0] -padx {4 24} + pack configure [lindex $things end] -padx {16 4} + } + grid $dlg.tf - - - - - -sticky ew + if {[info exists ::widgetDemo]} { + grid [addSeeDismiss $dlg.buttons $dlg] - - - - - -sticky ew + } + + grid rowconfigure $dlg 0 -weight 1 + grid columnconfigure $dlg 0 -weight 1 + + bind $dlg {console show} + bind $dlg [list $dlg.tf.b1 invoke] + bind $dlg [list $dlg.tf.b2 invoke] + bind $dlg [namespace code [list Stop]] + wm protocol $dlg WM_DELETE_WINDOW [namespace code [list Exit $dlg]] + + wm deiconify $dlg + tkwait window $dlg +} + +if {![winfo exists .knightstour]} { + if {![info exists widgetDemo]} { wm withdraw . } + set r [catch [linsert $argv 0 CreateGUI] err] + if {$r} { + tk_messageBox -icon error -title "Error" -message $err + } + if {![info exists widgetDemo]} { exit $r } +} diff --git a/shared/package-files/7c/7c1f24f749470aa6465ea1caca5fef9aa93f31bd940e75dabc2d3e3e87f6f0ce/eq_native.h b/shared/package-files/7c/7c1f24f749470aa6465ea1caca5fef9aa93f31bd940e75dabc2d3e3e87f6f0ce/eq_native.h new file mode 100644 index 0000000000000000000000000000000000000000..5f42212b202cc466ef89091ad1bdac4576e59a4a --- /dev/null +++ b/shared/package-files/7c/7c1f24f749470aa6465ea1caca5fef9aa93f31bd940e75dabc2d3e3e87f6f0ce/eq_native.h @@ -0,0 +1,31 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace native { +struct TORCH_API structured_eq_Scalar_out : public at::meta::structured_eq_Scalar { +void impl(const at::Tensor & self, const at::Scalar & other, const at::Tensor & out); +}; +TORCH_API at::Tensor eq_scalar_nested(const at::Tensor & self, const at::Scalar & other); +TORCH_API at::Tensor eq_quantized_cpu(const at::Tensor & self, const at::Scalar & other); +TORCH_API at::Tensor & eq_out_quantized_cpu(const at::Tensor & self, const at::Scalar & other, at::Tensor & out); +struct TORCH_API structured_eq_Tensor_out : public at::meta::structured_eq_Tensor { +void impl(const at::Tensor & self, const at::Tensor & other, const at::Tensor & out); +}; +TORCH_API at::Tensor eq_quantized_cpu(const at::Tensor & self, const at::Tensor & other); +TORCH_API at::Tensor & eq_out_quantized_cpu(const at::Tensor & self, const at::Tensor & other, at::Tensor & out); +} // namespace native +} // namespace at diff --git a/shared/package-files/7c/7c1f715a4bcc49a5b9fd43e8793be8e4d45c396d21b7ed5add6da38ae095d495/batch_norm_ops.h b/shared/package-files/7c/7c1f715a4bcc49a5b9fd43e8793be8e4d45c396d21b7ed5add6da38ae095d495/batch_norm_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..eee2c45fd17cc2817e842d3edcd413b0cf142ffa --- /dev/null +++ b/shared/package-files/7c/7c1f715a4bcc49a5b9fd43e8793be8e4d45c396d21b7ed5add6da38ae095d495/batch_norm_ops.h @@ -0,0 +1,28 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API batch_norm { + using schema = at::Tensor (const at::Tensor &, const c10::optional &, const c10::optional &, const c10::optional &, const c10::optional &, bool, double, double, bool); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::batch_norm") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "batch_norm(Tensor input, Tensor? weight, Tensor? bias, Tensor? running_mean, Tensor? running_var, bool training, float momentum, float eps, bool cudnn_enabled) -> Tensor") + static at::Tensor call(const at::Tensor & input, const c10::optional & weight, const c10::optional & bias, const c10::optional & running_mean, const c10::optional & running_var, bool training, double momentum, double eps, bool cudnn_enabled); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & input, const c10::optional & weight, const c10::optional & bias, const c10::optional & running_mean, const c10::optional & running_var, bool training, double momentum, double eps, bool cudnn_enabled); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/7c/7c2044765616726237b029e9524da9cf6d8662d5f3a93929e8d78ea5d23ae0f6/converters.py b/shared/package-files/7c/7c2044765616726237b029e9524da9cf6d8662d5f3a93929e8d78ea5d23ae0f6/converters.py new file mode 100644 index 0000000000000000000000000000000000000000..edfa8d3c16ac8642773651778012a3cd57005d9b --- /dev/null +++ b/shared/package-files/7c/7c2044765616726237b029e9524da9cf6d8662d5f3a93929e8d78ea5d23ae0f6/converters.py @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: MIT + +from attr.converters import * # noqa diff --git a/shared/package-files/7c/7c217812c06ed17b2236f08f3726d13ab38da9fe2457794f17d3483f94da4aef/fractional_max_pool3d_backward_native.h b/shared/package-files/7c/7c217812c06ed17b2236f08f3726d13ab38da9fe2457794f17d3483f94da4aef/fractional_max_pool3d_backward_native.h new file mode 100644 index 0000000000000000000000000000000000000000..18939577da082d06e9d2d8e191cbf7343c683c07 --- /dev/null +++ b/shared/package-files/7c/7c217812c06ed17b2236f08f3726d13ab38da9fe2457794f17d3483f94da4aef/fractional_max_pool3d_backward_native.h @@ -0,0 +1,24 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor fractional_max_pool3d_backward_cpu(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef output_size, const at::Tensor & indices); +TORCH_API at::Tensor & fractional_max_pool3d_backward_out_cpu(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef output_size, const at::Tensor & indices, at::Tensor & grad_input); +TORCH_API at::Tensor fractional_max_pool3d_backward_cuda(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef output_size, const at::Tensor & indices); +TORCH_API at::Tensor & fractional_max_pool3d_backward_out_cuda(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef output_size, const at::Tensor & indices, at::Tensor & grad_input); +} // namespace native +} // namespace at diff --git a/shared/package-files/7c/7c21c7524d68b6725e4008fc9e7721e3bd323780f305b80660b00b68da364765/varma_process.py b/shared/package-files/7c/7c21c7524d68b6725e4008fc9e7721e3bd323780f305b80660b00b68da364765/varma_process.py new file mode 100644 index 0000000000000000000000000000000000000000..2a95520d1743d51c4bdcf9245f0b3f13d57c7fca --- /dev/null +++ b/shared/package-files/7c/7c21c7524d68b6725e4008fc9e7721e3bd323780f305b80660b00b68da364765/varma_process.py @@ -0,0 +1,791 @@ +""" +Helper and filter functions for VAR and VARMA, and basic VAR class + +Created on Mon Jan 11 11:04:23 2010 +Author: josef-pktd +License: BSD + +This is a new version, I did not look at the old version again, but similar +ideas. + +not copied/cleaned yet: + * fftn based filtering, creating samples with fft + * Tests: I ran examples but did not convert them to tests + examples look good for parameter estimate and forecast, and filter functions + +main TODOs: +* result statistics +* see whether Bayesian dummy observation can be included without changing + the single call to linalg.lstsq +* impulse response function does not treat correlation, see Hamilton and jplv + +Extensions +* constraints, Bayesian priors/penalization +* Error Correction Form and Cointegration +* Factor Models Stock-Watson, ??? + + +see also VAR section in Notes.txt + +""" + +import warnings + +import numpy as np +from scipy import signal + +from statsmodels.tools.validation import string_like +from statsmodels.tsa.tsatools import lagmat + + +def varfilter(x, a): + """ + Apply an autoregressive filter to a series x + + x can be 2d, a can be 1d, 2d, or 3d + + Parameters + ---------- + x : array_like + data array, 1d or 2d, if 2d then observations in rows + a : array_like + autoregressive filter coefficients, ar lag polynomial + see Notes + + Returns + ------- + y : ndarray + filtered array, 2d, number of columns determined by x and a + + Warnings + -------- + convolve does not work as expected; this likely does not work + correctly for nvars>3. + + Notes + ----- + + In general form this uses the linear filter :: + + y = a(L)x + + where + x : nobs, nvars + a : nlags, nvars, npoly + + Depending on the shape and dimension of a this uses different + Lag polynomial arrays + + case 1 : a is 1d or (nlags,1) + one lag polynomial is applied to all variables (columns of x) + case 2 : a is 2d, (nlags, nvars) + each series is independently filtered with its own + lag polynomial, uses loop over nvar + case 3 : a is 3d, (nlags, nvars, npoly) + the ith column of the output array is given by the linear filter + defined by the 2d array a[:,:,i], i.e., :: + + y[:,i] = a(.,.,i)(L) * x + y[t,i] = sum_p sum_j a(p,j,i)*x(t-p,j) + for p = 0,...nlags-1, j = 0,...nvars-1, + for all t >= nlags + + + Note: maybe convert to axis=1, Not + + TODO: initial conditions + + """ + x = np.asarray(x) + a = np.asarray(a) + if x.ndim == 1: + x = x[:, None] + if x.ndim > 2: + raise ValueError("x array has to be 1d or 2d") + nvar = x.shape[1] + nlags = a.shape[0] + ntrim = nlags // 2 + # for x is 2d with ncols >1 + + if a.ndim == 1: + # case: identical ar filter (lag polynomial) + return signal.convolve(x, a[:, None], mode="valid") + # alternative: + # return signal.lfilter(a,[1],x.astype(float),axis=0) + elif a.ndim == 2: + if min(a.shape) == 1: + # case: identical ar filter (lag polynomial) + return signal.convolve(x, a, mode="valid") + + # case: independent ar + # (a bit like recserar in gauss, but no x yet) + # (no, reserar is inverse filter) + result = np.zeros((x.shape[0] - nlags + 1, nvar)) + for i in range(nvar): + # could also use np.convolve, but easier for swiching to fft + result[:, i] = signal.convolve(x[:, i], a[:, i], mode="valid") + return result + + elif a.ndim == 3: + # case: vector autoregressive with lag matrices + # Note: we must have shape[1] == shape[2] == nvar + yf = signal.convolve(x[:, :, None], a) + yvalid = yf[ntrim:-ntrim, yf.shape[1] // 2, :] + return yvalid + + +def varinversefilter(ar, nobs, version=1): + """ + Creates inverse ar filter (MA representation) recursively + + The VAR lag polynomial is defined by :: + + ar(L) y_t = u_t or + y_t = -ar_{-1}(L) y_{t-1} + u_t + + the returned lagpolynomial is arinv(L)=ar^{-1}(L) in :: + + y_t = arinv(L) u_t + + Parameters + ---------- + ar : ndarray, (nlags,nvars,nvars) + matrix lagpolynomial, currently no exog + first row should be identity + nobs : int + Number of observations (time points) for which to compute the + inverse filter. + version : int, optional + Selects the implementation to use. If 1 (the default), the + inverse filter is computed recursively. If 0, the alternative + implementation is not yet finished and raises NotImplementedError. + + Returns + ------- + arinv : ndarray + The inverse (MA representation) lag polynomial array, of shape + (nobs + 1, nvars, nvars). + """ + nlags, nvars, nvarsex = ar.shape + if nvars != nvarsex: + print("exogenous variables not implemented not tested") + arinv = np.zeros((nobs + 1, nvarsex, nvars)) + arinv[0, :, :] = ar[0] + arinv[1:nlags, :, :] = -ar[1:] + if version == 1: + for i in range(2, nobs + 1): + tmp = np.zeros((nvars, nvars)) + for p in range(1, nlags): + tmp += np.dot(-ar[p], arinv[i - p, :, :]) + arinv[i, :, :] = tmp + if version == 0: + for i in range(nlags + 1, nobs + 1): + print(ar[1:].shape, arinv[i - 1 : i - nlags : -1, :, :].shape) + # arinv[i,:,:] = np.dot(-ar[1:],arinv[i-1:i-nlags:-1,:,:]) + # print(np.tensordot(-ar[1:],arinv[i-1:i-nlags:-1,:,:],axes=([2],[1])).shape + # arinv[i,:,:] = np.tensordot(-ar[1:],arinv[i-1:i-nlags:-1,:,:],axes=([2],[1])) + raise NotImplementedError("waiting for generalized ufuncs or something") + + return arinv + + +def vargenerate(ar, u, initvalues=None): + """ + Generate a VAR process with errors u + + similar to gauss + uses loop + + Parameters + ---------- + ar : ndarray + Matrix lagpolynomial, of shape (nlags, nvars, nvars). + u : ndarray + Error terms (innovations) for the VAR process, of shape + (nobs, nvars). + initvalues : ndarray, optional + Initial (presample) values for the process. If None, the initial + values are set to zero. + + Returns + ------- + sar : ndarray + Sample of the VAR process, the inverse filtered `u`. Has shape + (nobs + max(nlags - 1, len(initvalues)), nvars); the presample + values, including the initial condition y_0 = 0, are not + trimmed. + + Examples + -------- + # generate random sample of VAR + nobs, nvars = 10, 2 + u = numpy.random.randn(nobs,nvars) + a21 = np.array([[[ 1. , 0. ], + [ 0. , 1. ]], + + [[-0.8, 0. ], + [ 0., -0.6]]]) + vargenerate(a21,u) + + # Impulse Response to an initial shock to the first variable + imp = np.zeros((nobs, nvars)) + imp[0,0] = 1 + vargenerate(a21,imp) + + """ + nlags, nvars, nvarsex = ar.shape + nlagsm1 = nlags - 1 + nobs = u.shape[0] + if nvars != nvarsex: + print("exogenous variables not implemented not tested") + if u.shape[1] != nvars: + raise ValueError("u needs to have nvars columns") + if initvalues is None: + sar = np.zeros((nobs + nlagsm1, nvars)) + start = nlagsm1 + else: + start = max(nlagsm1, initvalues.shape[0]) + sar = np.zeros((nobs + start, nvars)) + sar[start - initvalues.shape[0] : start] = initvalues + # sar[nlagsm1:] = u + sar[start:] = u + # if version == 1: + for i in range(start, start + nobs): + for p in range(1, nlags): + sar[i] += np.dot(sar[i - p, :], -ar[p]) + + return sar + + +def padone(x, front=0, back=0, axis=0, fillvalue=0): + """ + Pad with zeros along one axis + + Can be used sequentially to pad several axes. + + Parameters + ---------- + x : ndarray + Array to pad. + front : int, optional + Number of `fillvalue` elements to add before the array along + `axis`. + back : int, optional + Number of `fillvalue` elements to add after the array along + `axis`. + axis : int, optional + Axis along which to pad. + fillvalue : scalar, optional + Value used to fill the padded elements. + + Returns + ------- + ndarray + The padded array. + + Examples + -------- + >>> padone(np.ones((2,3)),1,3,axis=1) + array([[ 0., 1., 1., 1., 0., 0., 0.], + [ 0., 1., 1., 1., 0., 0., 0.]]) + + >>> padone(np.ones((2,3)),1,1, fillvalue=np.nan) + array([[ NaN, NaN, NaN], + [ 1., 1., 1.], + [ 1., 1., 1.], + [ NaN, NaN, NaN]]) + """ + # primitive version + shape = np.array(x.shape) + shape[axis] += front + back + shapearr = np.array(x.shape) + out = np.empty(shape) + out.fill(fillvalue) + startind = np.zeros(x.ndim) + startind[axis] = front + endind = startind + shapearr + myslice = [slice(startind[k], endind[k]) for k in range(len(endind))] + # print(myslice + # print(out.shape + # print(out[tuple(myslice)].shape + out[tuple(myslice)] = x + return out + + +def trimone(x, front=0, back=0, axis=0): + """ + Trim a number of array elements along one axis + + Parameters + ---------- + x : ndarray + Array to trim. + front : int, optional + Number of elements to remove from the front along `axis`. + back : int, optional + Number of elements to remove from the back along `axis`. + axis : int, optional + Axis along which to trim. + + Returns + ------- + ndarray + The trimmed array. + + Examples + -------- + >>> xp = padone(np.ones((2,3)),1,3,axis=1) + >>> xp + array([[ 0., 1., 1., 1., 0., 0., 0.], + [ 0., 1., 1., 1., 0., 0., 0.]]) + >>> trimone(xp,1,3,1) + array([[ 1., 1., 1.], + [ 1., 1., 1.]]) + """ + shape = np.array(x.shape) + shape[axis] -= front + back + # print(shape, front, back + startind = np.zeros(x.ndim) + startind[axis] = front + endind = startind + shape + myslice = [slice(startind[k], endind[k]) for k in range(len(endind))] + # print(myslice + # print(shape, endind + # print(x[tuple(myslice)].shape + return x[tuple(myslice)] + + +def ar2full(ar): + """ + Make reduced lagpolynomial into a right side lagpoly array + + Parameters + ---------- + ar : ndarray + Reduced-form lag polynomial array, of shape (nlags, nvar, nvarex). + + Returns + ------- + ndarray + Full (right-hand side) lag polynomial array, of shape + (nlags + 1, nvar, nvarex), with an identity matrix prepended. + """ + nlags, nvar, nvarex = ar.shape + return np.r_[np.eye(nvar, nvarex)[None, :, :], -ar] + + +def ar2lhs(ar): + """ + Convert full (rhs) lagpolynomial into a reduced, left side lagpoly array + + This is mainly a reminder about the definition. + + Parameters + ---------- + ar : ndarray + Full (right-hand side) lag polynomial array. + + Returns + ------- + ndarray + Reduced, left-hand side lag polynomial array. + """ + return -ar[1:] + + +class _Var: + """ + Obsolete VAR class, use tsa.VAR instead, for internal use only + + Examples + -------- + + >>> v = Var(ar2s) + >>> v.fit(1) + >>> v.arhat + array([[[ 1. , 0. ], + [ 0. , 1. ]], + + [[-0.77784898, 0.01726193], + [ 0.10733009, -0.78665335]]]) + + """ + + def __init__(self, y): + warnings.warn( + "_Var is deprecated (its own docstring already called it " + "\"Obsolete\" -- use tsa.VAR instead). It has had no test " + "coverage and its behavior is not guaranteed. It will be " + "removed after statsmodels 0.16 is released. If you rely on " + "this class, please open an issue at " + "https://github.com/statsmodels/statsmodels/issues.", + FutureWarning, + stacklevel=2, + ) + self.y = y + self.nobs, self.nvars = y.shape + + def fit(self, nlags): + """ + Estimate parameters using OLS + + Parameters + ---------- + nlags : int + number of lags to include in regression, same for all variables + + Returns + ------- + None + Nothing is returned; the estimation results are attached to + the instance, see Notes. + + Notes + ----- + This currently assumes all parameters are estimated without restrictions. + In this case SUR is identical to OLS. + + The following are attached to the instance: + + arhat : ndarray of shape (nlags, nvar, nvar) + Full lag polynomial array. + arlhs : ndarray of shape (nlags - 1, nvar, nvar) + Reduced lag polynomial for the left-hand side. + estresults + The full result tuple as returned by ``linalg.lstsq``; other + statistics still need to be completed. + """ + self.nlags = nlags # without current period + nvars = self.nvars + # TODO: ar2s looks like a module variable, bug? + # lmat = lagmat(ar2s, nlags, trim='both', original='in') + lmat = lagmat(self.y, nlags, trim="both", original="in") + self.yred = lmat[:, :nvars] + self.xred = lmat[:, nvars:] + res = np.linalg.lstsq(self.xred, self.yred, rcond=-1) + self.estresults = res + self.arlhs = res[0].reshape(nlags, nvars, nvars) + self.arhat = ar2full(self.arlhs) + self.rss = res[1] + self.xredrank = res[2] + + def predict(self): + """Calculate estimated timeseries (yhat) for sample""" + + if not hasattr(self, "yhat"): + self.yhat = varfilter(self.y, self.arhat) + return self.yhat + + def covmat(self): + """ + Covariance matrix of estimate + + Notes + ----- + Not sure it's correct, need to check orientation everywhere. + Looks ok, display needs getting used to. + + Examples + -------- + >>> v.rss[None,None,:]*np.linalg.inv(np.dot(v.xred.T,v.xred))[:,:,None] + array([[[ 0.37247445, 0.32210609], + [ 0.1002642 , 0.08670584]], + + [[ 0.1002642 , 0.08670584], + [ 0.45903637, 0.39696255]]]) + >>> + >>> v.rss[0]*np.linalg.inv(np.dot(v.xred.T,v.xred)) + array([[ 0.37247445, 0.1002642 ], + [ 0.1002642 , 0.45903637]]) + >>> v.rss[1]*np.linalg.inv(np.dot(v.xred.T,v.xred)) + array([[ 0.32210609, 0.08670584], + [ 0.08670584, 0.39696255]]) + """ + + # check if orientation is same as self.arhat + self.paramcov = ( + self.rss[None, None, :] + * np.linalg.inv(np.dot(self.xred.T, self.xred))[:, :, None] + ) + + def forecast(self, horiz=1, u=None): + """ + Calculates forecast for horiz number of periods at end of sample + + Parameters + ---------- + horiz : int, optional + Forecast horizon. + u : ndarray, optional + Error term for forecast periods, of shape (horiz, nvars). If + None, then u is zero. + + Returns + ------- + yforecast : ndarray + Forecast array, of shape (nobs + horiz, nvars); this includes + the sample and the forecasts. + """ + if u is None: + u = np.zeros((horiz, self.nvars)) + return vargenerate(self.arhat, u, initvalues=self.y) + + +class VarmaPoly: + """ + Class to keep track of Varma polynomial format + + Parameters + ---------- + ar : ndarray + The autoregressive lag polynomial array, of shape + (nlags, nvarall, nvars). + ma : ndarray, optional + The moving-average lag polynomial array, of shape + (malags, nvars, nvars). If None, no moving-average terms are + used and an identity matrix is used in their place. + + Examples + -------- + + ar23 = np.array([[[ 1. , 0. ], + [ 0. , 1. ]], + + [[-0.6, 0. ], + [ 0.2, -0.6]], + + [[-0.1, 0. ], + [ 0.1, -0.1]]]) + + ma22 = np.array([[[ 1. , 0. ], + [ 0. , 1. ]], + + [[ 0.4, 0. ], + [ 0.2, 0.3]]]) + + + """ + + def __init__(self, ar, ma=None): + self.ar = ar + self.ma = ma + nlags, nvarall, nvars = ar.shape + self.nlags, self.nvarall, self.nvars = nlags, nvarall, nvars + self.isstructured = not (ar[0, :nvars] == np.eye(nvars)).all() + if self.ma is None: + self.ma = np.eye(nvars)[None, ...] + self.isindependent = True + else: + self.isindependent = not (ma[0] == np.eye(nvars)).all() + self.malags = ar.shape[0] + self.hasexog = nvarall > nvars + self.arm1 = -ar[1:] + + # @property + def vstack(self, a=None, name="ar"): + """ + Stack lagpolynomial vertically in 2d array + + Parameters + ---------- + a : ndarray, optional + Lag polynomial array to stack. If None, uses ``self.ar`` or + ``self.ma``, selected by `name`. + name : {"ar", "ma"}, optional + Which instance lag polynomial to use when `a` is None. + + Returns + ------- + ndarray + The lag polynomial stacked vertically into a 2d array. + """ + if a is not None: + _a = a + else: + name = string_like(name, "name", options=("ar", "ma")) + _a = self.ar if name == "ar" else self.ma + return _a.reshape(-1, self.nvarall) + + # @property + def hstack(self, a=None, name="ar"): + """ + Stack lagpolynomial horizontally in 2d array + + Parameters + ---------- + a : ndarray, optional + Lag polynomial array to stack. If None, uses ``self.ar`` or + ``self.ma``, selected by `name`. + name : {"ar", "ma"}, optional + Which instance lag polynomial to use when `a` is None. + + Returns + ------- + ndarray + The lag polynomial stacked horizontally into a 2d array. + """ + if a is not None: + _a = a + else: + name = string_like(name, "name", options=("ar", "ma")) + _a = self.ar if name == "ar" else self.ma + return _a.swapaxes(1, 2).reshape(-1, self.nvarall).T + + # @property + def stacksquare(self, a=None, name="ar", orientation="vertical"): + """ + Stack lagpolynomial vertically in 2d square array with eye + + Parameters + ---------- + a : ndarray, optional + Lag polynomial array to stack. If None, uses ``self.ar`` or + ``self.ma``, selected by `name`. + name : {"ar", "ma"}, optional + Which instance lag polynomial to use when `a` is None. + orientation : str, optional + Currently not used. + + Returns + ------- + ndarray + The lag polynomial stacked vertically into a 2d square array, + with an identity block appended. + """ + if a is not None: + _a = a + else: + name = string_like(name, "name", options=("ar", "ma")) + _a = self.ar if name == "ar" else self.ma + astacked = _a.reshape(-1, self.nvarall) + lenpk, nvars = astacked.shape # [0] + amat = np.eye(lenpk, k=nvars) + amat[:, :nvars] = astacked + return amat + + # @property + def vstackarma_minus1(self): + """Stack ar and lagpolynomial vertically in 2d array""" + a = np.concatenate((self.ar[1:], self.ma[1:]), 0) + return a.reshape(-1, self.nvarall) + + # @property + def hstackarma_minus1(self): + """ + Stack ar and lagpolynomial vertically in 2d array + + This is the Kalman Filter representation, I think. + """ + a = np.concatenate((self.ar[1:], self.ma[1:]), 0) + return a.swapaxes(1, 2).reshape(-1, self.nvarall) + + def getisstationary(self, a=None): + """ + Check whether the auto-regressive lag-polynomial is stationary + + Parameters + ---------- + a : ndarray, optional + The lag polynomial array to check. If None, uses the reduced + form of ``self.ar``. + + Returns + ------- + isstationary : bool + True if all eigenvalues of the lag-polynomial are less than one + in absolute value. + + Notes + ----- + Attaches ``areigenvalues``, the eigenvalues sorted by absolute + value, as a complex array. + + References + ---------- + Formula taken from NAG manual. + """ + if a is not None: + _a = a + elif self.isstructured: + _a = -self.reduceform(self.ar)[1:] + else: + _a = -self.ar[1:] + amat = self.stacksquare(_a) + ev = np.sort(np.linalg.eigvals(amat))[::-1] + self.areigenvalues = ev + return (np.abs(ev) < 1).all() + + def getisinvertible(self, a=None): + """ + Check whether the moving-average lag-polynomial is invertible + + Parameters + ---------- + a : ndarray, optional + The lag polynomial array to check. If None, uses the reduced + form of ``self.ma``. + + Returns + ------- + isinvertible : bool + True if all eigenvalues of the lag-polynomial are less than one + in absolute value. + + Notes + ----- + Attaches ``maeigenvalues``, the eigenvalues sorted by absolute + value, as a complex array. + + References + ---------- + Formula taken from NAG manual. + """ + if a is not None: + _a = a + elif self.isindependent: + _a = self.reduceform(self.ma)[1:] + else: + _a = self.ma[1:] + if _a.shape[0] == 0: + # no ma lags + self.maeigenvalues = np.array([], dtype=complex) + return True + + amat = self.stacksquare(_a) + ev = np.sort(np.linalg.eigvals(amat))[::-1] + self.maeigenvalues = ev + return (np.abs(ev) < 1).all() + + def reduceform(self, apoly): + """ + Convert a structural lag polynomial to reduced form + + This assumes no exog, todo + + Parameters + ---------- + apoly : ndarray + 3d lag polynomial array, of shape (nlags, nvars, nvars). + + Returns + ------- + ndarray + The reduced-form lag polynomial array, with the same shape as + `apoly`. + """ + if apoly.ndim != 3: + raise ValueError("apoly needs to be 3d") + nlags, nvarsex, nvars = apoly.shape + + try: + a0inv = np.linalg.inv(apoly[0, :nvars, :]) + except np.linalg.LinAlgError as la_err: + raise ValueError( + "matrix not invertible, ask for implementation of pinv" + ) from la_err + + a = np.empty_like(apoly) + for lag in range(nlags): + a[lag] = np.dot(a0inv, apoly[lag]) + + return a diff --git a/shared/package-files/7c/7c2372877793688738dda5eb84c6302f8554151560707beda5cf6f63ce20439b/_foreach_round_cuda_dispatch.h b/shared/package-files/7c/7c2372877793688738dda5eb84c6302f8554151560707beda5cf6f63ce20439b/_foreach_round_cuda_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..cd51138e08a6a8928ee316d8e064fe8d506309ff --- /dev/null +++ b/shared/package-files/7c/7c2372877793688738dda5eb84c6302f8554151560707beda5cf6f63ce20439b/_foreach_round_cuda_dispatch.h @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API ::std::vector _foreach_round(at::TensorList self); +TORCH_API void _foreach_round_(at::TensorList self); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/7c/7c24481ec3f85de7aabd9cd01851770c56f9c9a901f570ad4ab71827afede63b/logit_gam_mgcv.csv b/shared/package-files/7c/7c24481ec3f85de7aabd9cd01851770c56f9c9a901f570ad4ab71827afede63b/logit_gam_mgcv.csv new file mode 100644 index 0000000000000000000000000000000000000000..09ca2c0f8064899914d666bd626de0c93ebe5df2 --- /dev/null +++ b/shared/package-files/7c/7c24481ec3f85de7aabd9cd01851770c56f9c9a901f570ad4ab71827afede63b/logit_gam_mgcv.csv @@ -0,0 +1,201 @@ +"","x","y","y_est" +"1",-10,0,0.872773934309234 +"2",-9.89949748743719,0,0.914587328782016 +"3",-9.79899497487437,1,0.956147534160093 +"4",-9.69849246231156,1,0.997201361348758 +"5",-9.59798994974874,1,1.03749562125331 +"6",-9.49748743718593,1,1.07677712477903 +"7",-9.39698492462312,1,1.11479268283124 +"8",-9.2964824120603,1,1.1512891063152 +"9",-9.19597989949749,1,1.18601320613623 +"10",-9.09547738693467,1,1.21871179319962 +"11",-8.99497487437186,1,1.24913167841065 +"12",-8.89447236180905,1,1.27701967267464 +"13",-8.79396984924623,0,1.30212258689686 +"14",-8.69346733668342,1,1.32418723198261 +"15",-8.5929648241206,1,1.3429604188372 +"16",-8.49246231155779,1,1.35818895836591 +"17",-8.39195979899498,0,1.36961966147404 +"18",-8.29145728643216,1,1.37699933906688 +"19",-8.19095477386935,1,1.38007480204973 +"20",-8.09045226130653,0,1.37859286132787 +"21",-7.98994974874372,1,1.37230032780662 +"22",-7.8894472361809,1,1.36094401239126 +"23",-7.78894472361809,1,1.34427072598708 +"24",-7.68844221105528,1,1.32213697950808 +"25",-7.58793969849246,1,1.29501313254974 +"26",-7.48743718592965,0,1.26358294550573 +"27",-7.38693467336683,1,1.22853039302752 +"28",-7.28643216080402,0,1.1905394497666 +"29",-7.18592964824121,1,1.15029409037445 +"30",-7.08542713567839,1,1.10847828950257 +"31",-6.98492462311558,0,1.06577602180244 +"32",-6.88442211055276,1,1.02287126192554 +"33",-6.78391959798995,1,0.980447984523354 +"34",-6.68341708542714,1,0.939190164247379 +"35",-6.58291457286432,0,0.899781775749094 +"36",-6.48241206030151,1,0.862906793679986 +"37",-6.38190954773869,1,0.829249192691541 +"38",-6.28140703517588,1,0.799492947435244 +"39",-6.18090452261307,1,0.774322032562581 +"40",-6.08040201005025,1,0.754420422725038 +"41",-5.97989949748744,1,0.740472092574101 +"42",-5.87939698492462,0,0.733161016761255 +"43",-5.77889447236181,1,0.733171169937986 +"44",-5.67839195979899,1,0.741186526755779 +"45",-5.57788944723618,0,0.757891061866122 +"46",-5.47738693467337,0,0.783825768321446 +"47",-5.37688442211055,1,0.81839612350124 +"48",-5.27638190954774,0,0.860466108874879 +"49",-5.17587939698492,1,0.908896371063943 +"50",-5.07537688442211,1,0.962547556690015 +"51",-4.9748743718593,0,1.02028031237468 +"52",-4.87437185929648,1,1.08095528473951 +"53",-4.77386934673367,1,1.1434331204061 +"54",-4.67336683417085,1,1.20657446599603 +"55",-4.57286432160804,1,1.26923996813087 +"56",-4.47236180904523,1,1.33029027343222 +"57",-4.37185929648241,1,1.38858602852165 +"58",-4.2713567839196,1,1.44298788002074 +"59",-4.17085427135678,0,1.49235647455108 +"60",-4.07035175879397,1,1.53555245873425 +"61",-3.96984924623116,1,1.57143647919183 +"62",-3.86934673366834,1,1.59886918254541 +"63",-3.76884422110553,0,1.61671121541656 +"64",-3.66834170854271,1,1.62382322442687 +"65",-3.5678391959799,1,1.61906585619792 +"66",-3.46733668341709,1,1.60129975735129 +"67",-3.36683417085427,0,1.56938557450856 +"68",-3.26633165829146,1,1.52228903292485 +"69",-3.16582914572864,0,1.46019739696999 +"70",-3.06532663316583,1,1.38408602076526 +"71",-2.96482412060301,1,1.29494339326115 +"72",-2.8643216080402,1,1.19375800340811 +"73",-2.76381909547739,1,1.08151834015664 +"74",-2.66331658291457,0,0.959212892457185 +"75",-2.56281407035176,1,0.827830149260236 +"76",-2.46231155778894,1,0.688358599516262 +"77",-2.36180904522613,1,0.541786732175736 +"78",-2.26130653266332,1,0.389103036189131 +"79",-2.1608040201005,1,0.23129600050692 +"80",-2.06030150753769,0,0.0693541140795766 +"81",-1.95979899497487,1,-0.0957341341424275 +"82",-1.85929648241206,0,-0.262980255208617 +"83",-1.75879396984925,1,-0.431395760168519 +"84",-1.65829145728643,1,-0.599992160071661 +"85",-1.55778894472362,0,-0.76778096596757 +"86",-1.4572864321608,1,-0.933773688905772 +"87",-1.35678391959799,0,-1.09698183993579 +"88",-1.25628140703517,0,-1.25641693010716 +"89",-1.15577889447236,0,-1.41109047046941 +"90",-1.05527638190955,0,-1.5600238850824 +"91",-0.954773869346733,0,-1.70241655636777 +"92",-0.854271356783919,0,-1.83762179597183 +"93",-0.753768844221105,0,-1.96499799100219 +"94",-0.653266331658291,0,-2.08390352856645 +"95",-0.552763819095476,0,-2.19369679577221 +"96",-0.452261306532662,0,-2.29373617972709 +"97",-0.351758793969848,0,-2.38338006753869 +"98",-0.251256281407034,0,-2.46198684631461 +"99",-0.15075376884422,0,-2.52891490316247 +"100",-0.0502512562814061,0,-2.58352262518986 +"101",0.0502512562814079,0,-2.6251683995044 +"102",0.150753768844222,0,-2.65321061321369 +"103",0.251256281407036,0,-2.66700765342533 +"104",0.35175879396985,0,-2.66591790724694 +"105",0.452261306532664,0,-2.64929976178612 +"106",0.552763819095478,0,-2.61651160415047 +"107",0.653266331658292,0,-2.5669118214476 +"108",0.753768844221106,0,-2.49985880078512 +"109",0.85427135678392,0,-2.41471092927063 +"110",0.954773869346734,0,-2.31082659401174 +"111",1.05527638190955,0,-2.18756418211606 +"112",1.15577889447236,0,-2.04432087552674 +"113",1.25628140703518,0,-1.88167043080889 +"114",1.35678391959799,0,-1.70154684844915 +"115",1.4572864321608,0,-1.50595990009734 +"116",1.55778894472362,1,-1.29691935740326 +"117",1.65829145728643,0,-1.07643499201674 +"118",1.75879396984925,1,-0.846516575587594 +"119",1.85929648241206,0,-0.60917387976564 +"120",1.95979899497488,0,-0.366416676200693 +"121",2.06030150753769,1,-0.120254736542572 +"122",2.1608040201005,1,0.127302167558909 +"123",2.26130653266332,0,0.37424426445393 +"124",2.36180904522613,1,0.618561782492676 +"125",2.46231155778895,1,0.858244950025329 +"126",2.56281407035176,1,1.09128399540207 +"127",2.66331658291457,1,1.31566914697309 +"128",2.76381909547739,1,1.52939063308856 +"129",2.8643216080402,0,1.73043868209868 +"130",2.96482412060302,1,1.91680352235361 +"131",3.06532663316583,1,2.08647538220355 +"132",3.16582914572864,1,2.23744448999868 +"133",3.26633165829146,1,2.36770107408919 +"134",3.36683417085427,1,2.47525668488848 +"135",3.46733668341709,1,2.55940219660391 +"136",3.5678391959799,1,2.62141143532344 +"137",3.66834170854271,1,2.66272880364089 +"138",3.76884422110553,1,2.68479870415008 +"139",3.86934673366834,1,2.68906553944483 +"140",3.96984924623116,0,2.67697371211895 +"141",4.07035175879397,1,2.64996762476627 +"142",4.17085427135678,1,2.6094916799806 +"143",4.2713567839196,1,2.55699028035576 +"144",4.37185929648241,1,2.49390782848557 +"145",4.47236180904523,1,2.42168872696384 +"146",4.57286432160804,1,2.3417773783844 +"147",4.67336683417085,1,2.25561818534107 +"148",4.77386934673367,1,2.16465555042766 +"149",4.87437185929648,1,2.07033387623799 +"150",4.9748743718593,0,1.97409756536587 +"151",5.07537688442211,1,1.87739102040514 +"152",5.17587939698493,1,1.7816586439496 +"153",5.27638190954774,1,1.68834483859308 +"154",5.37688442211055,0,1.59889400692939 +"155",5.47738693467337,1,1.51475055155235 +"156",5.57788944723618,1,1.4373555314731 +"157",5.678391959799,1,1.36760709146401 +"158",5.77889447236181,1,1.30526488639263 +"159",5.87939698492462,1,1.24994521501885 +"160",5.97989949748744,0,1.20126437610251 +"161",6.08040201005025,1,1.15883866840349 +"162",6.18090452261307,1,1.12228439068165 +"163",6.28140703517588,1,1.09121784169686 +"164",6.38190954773869,1,1.06525532020898 +"165",6.48241206030151,1,1.04401312497788 +"166",6.58291457286432,0,1.02710755476343 +"167",6.68341708542714,1,1.01415490832548 +"168",6.78391959798995,0,1.0047714844239 +"169",6.88442211055277,1,0.998573581818567 +"170",6.98492462311558,1,0.995177499269337 +"171",7.08542713567839,0,0.994199535536078 +"172",7.18592964824121,1,0.995255989378654 +"173",7.28643216080402,1,0.997963159556932 +"174",7.38693467336683,1,1.00193734483078 +"175",7.48743718592965,1,1.00679484396005 +"176",7.58793969849246,1,1.01215195570463 +"177",7.68844221105528,1,1.01762497882437 +"178",7.78894472361809,0,1.02283030609777 +"179",7.88944723618091,0,1.02747797286506 +"180",7.98994974874372,1,1.03154737785938 +"181",8.09045226130653,1,1.03506605735562 +"182",8.19095477386935,0,1.03806154762869 +"183",8.29145728643216,1,1.0405613849535 +"184",8.39195979899498,0,1.04259310560495 +"185",8.49246231155779,1,1.04418424585794 +"186",8.5929648241206,1,1.04536234198738 +"187",8.69346733668342,1,1.04615493026816 +"188",8.79396984924623,1,1.0465895469752 +"189",8.89447236180905,1,1.0466937283834 +"190",8.99497487437186,1,1.04649501076765 +"191",9.09547738693468,1,1.04602093040287 +"192",9.19597989949749,1,1.04529902356396 +"193",9.2964824120603,1,1.04435682652581 +"194",9.39698492462312,0,1.04322187556335 +"195",9.49748743718593,1,1.04192170695146 +"196",9.59798994974874,0,1.04048385696505 +"197",9.69849246231156,0,1.03893586187903 +"198",9.79899497487437,1,1.03730525796829 +"199",9.89949748743719,1,1.03561958150775 +"200",10,1,1.03390636877231 diff --git a/shared/package-files/7c/7c262b62985863aad47f13b0ef5db2e5cc917b5d38002de9a2ea83ddb0883458/Midway b/shared/package-files/7c/7c262b62985863aad47f13b0ef5db2e5cc917b5d38002de9a2ea83ddb0883458/Midway new file mode 100644 index 0000000000000000000000000000000000000000..cb56709a77dedb471150f4907771bf38f1879ba4 Binary files /dev/null and b/shared/package-files/7c/7c262b62985863aad47f13b0ef5db2e5cc917b5d38002de9a2ea83ddb0883458/Midway differ diff --git a/shared/package-files/7c/7c262b62985863aad47f13b0ef5db2e5cc917b5d38002de9a2ea83ddb0883458/Pago_Pago b/shared/package-files/7c/7c262b62985863aad47f13b0ef5db2e5cc917b5d38002de9a2ea83ddb0883458/Pago_Pago new file mode 100644 index 0000000000000000000000000000000000000000..cb56709a77dedb471150f4907771bf38f1879ba4 Binary files /dev/null and b/shared/package-files/7c/7c262b62985863aad47f13b0ef5db2e5cc917b5d38002de9a2ea83ddb0883458/Pago_Pago differ diff --git a/shared/package-files/7c/7c262b62985863aad47f13b0ef5db2e5cc917b5d38002de9a2ea83ddb0883458/Samoa b/shared/package-files/7c/7c262b62985863aad47f13b0ef5db2e5cc917b5d38002de9a2ea83ddb0883458/Samoa new file mode 100644 index 0000000000000000000000000000000000000000..cb56709a77dedb471150f4907771bf38f1879ba4 Binary files /dev/null and b/shared/package-files/7c/7c262b62985863aad47f13b0ef5db2e5cc917b5d38002de9a2ea83ddb0883458/Samoa differ diff --git a/shared/package-files/7c/7c284fc3bc6770d0933cc5066f40bc042fa50ca1d6a045d2cfc45be16bfcbcda/test_spence.py b/shared/package-files/7c/7c284fc3bc6770d0933cc5066f40bc042fa50ca1d6a045d2cfc45be16bfcbcda/test_spence.py new file mode 100644 index 0000000000000000000000000000000000000000..fbb26ac281dff81ea71b30318731065fe5a78f94 --- /dev/null +++ b/shared/package-files/7c/7c284fc3bc6770d0933cc5066f40bc042fa50ca1d6a045d2cfc45be16bfcbcda/test_spence.py @@ -0,0 +1,32 @@ +import numpy as np +from numpy import sqrt, log, pi +from scipy.special._testutils import FuncData +from scipy.special import spence + + +def test_consistency(): + # Make sure the implementation of spence for real arguments + # agrees with the implementation of spence for imaginary arguments. + + x = np.logspace(-30, 300, 200) + dataset = np.vstack((x + 0j, spence(x))).T + FuncData(spence, dataset, 0, 1, rtol=1e-14).check() + + +def test_special_points(): + # Check against known values of Spence's function. + + phi = (1 + sqrt(5))/2 + dataset = [(1, 0), + (2, -pi**2/12), + (0.5, pi**2/12 - log(2)**2/2), + (0, pi**2/6), + (-1, pi**2/4 - 1j*pi*log(2)), + ((-1 + sqrt(5))/2, pi**2/15 - log(phi)**2), + ((3 - sqrt(5))/2, pi**2/10 - log(phi)**2), + (phi, -pi**2/15 + log(phi)**2/2), + # Corrected from Zagier, "The Dilogarithm Function" + ((3 + sqrt(5))/2, -pi**2/10 - log(phi)**2)] + + dataset = np.asarray(dataset) + FuncData(spence, dataset, 0, 1, rtol=1e-14).check() diff --git a/shared/package-files/7c/7c301fc7ccc7fb1d0f63ad366e487e18fe758ddd0b06d11db1ab7ea4e79eabfc/ps300 b/shared/package-files/7c/7c301fc7ccc7fb1d0f63ad366e487e18fe758ddd0b06d11db1ab7ea4e79eabfc/ps300 new file mode 100644 index 0000000000000000000000000000000000000000..de2ccd7689a6b6d204318bf574a65f4500d3199f Binary files /dev/null and b/shared/package-files/7c/7c301fc7ccc7fb1d0f63ad366e487e18fe758ddd0b06d11db1ab7ea4e79eabfc/ps300 differ diff --git a/shared/package-files/7c/7c329e09fba37782964c757184adee10727071cd73d296b82a986ae85416fcf4/conv.h b/shared/package-files/7c/7c329e09fba37782964c757184adee10727071cd73d296b82a986ae85416fcf4/conv.h new file mode 100644 index 0000000000000000000000000000000000000000..0b5b5b1b3f955abf2ec36a806fb1344611c4f060 --- /dev/null +++ b/shared/package-files/7c/7c329e09fba37782964c757184adee10727071cd73d296b82a986ae85416fcf4/conv.h @@ -0,0 +1,415 @@ +#pragma once + +#include +#include +#include +#include +#include + +namespace torch { +namespace nn { + +namespace detail { + +typedef std::variant< + enumtype::kZeros, + enumtype::kReflect, + enumtype::kReplicate, + enumtype::kCircular> + conv_padding_mode_t; + +template +using conv_padding_t = + std::variant, enumtype::kValid, enumtype::kSame>; + +/// Options for a `D`-dimensional convolution or convolution transpose module. +template +struct ConvNdOptions { + using padding_t = conv_padding_t; + ConvNdOptions( + int64_t in_channels, + int64_t out_channels, + ExpandingArray kernel_size) + : in_channels_(in_channels), + out_channels_(out_channels), + kernel_size_(std::move(kernel_size)) {} + + /// The number of channels the input volumes will have. + /// Changing this parameter after construction __has no effect__. + TORCH_ARG(int64_t, in_channels); + + /// The number of output channels the convolution should produce. + /// Changing this parameter after construction __has no effect__. + TORCH_ARG(int64_t, out_channels); + + /// The kernel size to use. + /// For a `D`-dim convolution, must be a single number or a list of `D` + /// numbers. + /// This parameter __can__ be changed after construction. + TORCH_ARG(ExpandingArray, kernel_size); + + /// The stride of the convolution. + /// For a `D`-dim convolution, must be a single number or a list of `D` + /// numbers. + /// This parameter __can__ be changed after construction. + TORCH_ARG(ExpandingArray, stride) = 1; + + /// The padding to add to the input volumes. + /// For a `D`-dim convolution, must be a single number or a list of `D` + /// numbers. + /// This parameter __can__ be changed after construction. + TORCH_ARG(padding_t, padding) = 0; + + public: + decltype(auto) padding(std::initializer_list il) { + return padding(IntArrayRef{il}); + } + + /// The kernel dilation. + /// For a `D`-dim convolution, must be a single number or a list of `D` + /// numbers. + /// This parameter __can__ be changed after construction. + TORCH_ARG(ExpandingArray, dilation) = 1; + + /// If true, convolutions will be transpose convolutions (a.k.a. + /// deconvolutions). + /// Changing this parameter after construction __has no effect__. + TORCH_ARG(bool, transposed) = false; + + /// For transpose convolutions, the padding to add to output volumes. + /// For a `D`-dim convolution, must be a single number or a list of `D` + /// numbers. + /// This parameter __can__ be changed after construction. + TORCH_ARG(ExpandingArray, output_padding) = 0; + + /// The number of convolution groups. + /// This parameter __can__ be changed after construction. + TORCH_ARG(int64_t, groups) = 1; + + /// Whether to add a bias after individual applications of the kernel. + /// Changing this parameter after construction __has no effect__. + TORCH_ARG(bool, bias) = true; + + /// Accepted values `torch::kZeros`, `torch::kReflect`, `torch::kReplicate` or + /// `torch::kCircular`. Default: `torch::kZeros` + TORCH_ARG(conv_padding_mode_t, padding_mode) = torch::kZeros; +}; + +} // namespace detail + +// ============================================================================ + +/// Options for a `D`-dimensional convolution module. +template +struct ConvOptions { + using padding_mode_t = detail::conv_padding_mode_t; + using padding_t = detail::conv_padding_t; + + ConvOptions( + int64_t in_channels, + int64_t out_channels, + ExpandingArray kernel_size) + : in_channels_(in_channels), + out_channels_(out_channels), + kernel_size_(std::move(kernel_size)) {} + + /// The number of channels the input volumes will have. + /// Changing this parameter after construction __has no effect__. + TORCH_ARG(int64_t, in_channels); + + /// The number of output channels the convolution should produce. + /// Changing this parameter after construction __has no effect__. + TORCH_ARG(int64_t, out_channels); + + /// The kernel size to use. + /// For a `D`-dim convolution, must be a single number or a list of `D` + /// numbers. + /// This parameter __can__ be changed after construction. + TORCH_ARG(ExpandingArray, kernel_size); + + /// The stride of the convolution. + /// For a `D`-dim convolution, must be a single number or a list of `D` + /// numbers. + /// This parameter __can__ be changed after construction. + TORCH_ARG(ExpandingArray, stride) = 1; + + /// The padding to add to the input volumes. + /// For a `D`-dim convolution, must be a single number or a list of `D` + /// numbers. + /// This parameter __can__ be changed after construction. + TORCH_ARG(padding_t, padding) = 0; + + public: + decltype(auto) padding(std::initializer_list il) { + return padding(IntArrayRef{il}); + } + + /// The kernel dilation. + /// For a `D`-dim convolution, must be a single number or a list of `D` + /// numbers. + /// This parameter __can__ be changed after construction. + TORCH_ARG(ExpandingArray, dilation) = 1; + + /// The number of convolution groups. + /// This parameter __can__ be changed after construction. + TORCH_ARG(int64_t, groups) = 1; + + /// Whether to add a bias after individual applications of the kernel. + /// Changing this parameter after construction __has no effect__. + TORCH_ARG(bool, bias) = true; + + /// Accepted values `torch::kZeros`, `torch::kReflect`, `torch::kReplicate` or + /// `torch::kCircular`. Default: `torch::kZeros` + TORCH_ARG(padding_mode_t, padding_mode) = torch::kZeros; +}; + +/// `ConvOptions` specialized for the `Conv1d` module. +/// +/// Example: +/// ``` +/// Conv1d model(Conv1dOptions(3, 2, 3).stride(1).bias(false)); +/// ``` +using Conv1dOptions = ConvOptions<1>; + +/// `ConvOptions` specialized for the `Conv2d` module. +/// +/// Example: +/// ``` +/// Conv2d model(Conv2dOptions(3, 2, 3).stride(1).bias(false)); +/// ``` +using Conv2dOptions = ConvOptions<2>; + +/// `ConvOptions` specialized for the `Conv3d` module. +/// +/// Example: +/// ``` +/// Conv3d model(Conv3dOptions(3, 2, 3).stride(1).bias(false)); +/// ``` +using Conv3dOptions = ConvOptions<3>; + +// ============================================================================ + +namespace functional { + +/// Options for a `D`-dimensional convolution functional. +template +struct ConvFuncOptions { + using padding_t = torch::nn::detail::conv_padding_t; + + /// optional bias of shape `(out_channels)`. Default: ``None`` + TORCH_ARG(torch::Tensor, bias) = Tensor(); + + /// The stride of the convolving kernel. + /// For a `D`-dim convolution, must be a single number or a list of `D` + /// numbers. + TORCH_ARG(ExpandingArray, stride) = 1; + + /// Implicit paddings on both sides of the input. + /// For a `D`-dim convolution, must be a single number or a list of `D` + /// numbers. + TORCH_ARG(padding_t, padding) = 0; + + public: + decltype(auto) padding(std::initializer_list il) { + return padding(IntArrayRef{il}); + } + + /// The spacing between kernel elements. + /// For a `D`-dim convolution, must be a single number or a list of `D` + /// numbers. + TORCH_ARG(ExpandingArray, dilation) = 1; + + /// Split input into groups, `in_channels` should be divisible by + /// the number of groups. + TORCH_ARG(int64_t, groups) = 1; +}; + +/// `ConvFuncOptions` specialized for `torch::nn::functional::conv1d`. +/// +/// Example: +/// ``` +/// namespace F = torch::nn::functional; +/// F::conv1d(x, weight, F::Conv1dFuncOptions().stride(1)); +/// ``` +using Conv1dFuncOptions = ConvFuncOptions<1>; + +/// `ConvFuncOptions` specialized for `torch::nn::functional::conv2d`. +/// +/// Example: +/// ``` +/// namespace F = torch::nn::functional; +/// F::conv2d(x, weight, F::Conv2dFuncOptions().stride(1)); +/// ``` +using Conv2dFuncOptions = ConvFuncOptions<2>; + +/// `ConvFuncOptions` specialized for `torch::nn::functional::conv3d`. +/// +/// Example: +/// ``` +/// namespace F = torch::nn::functional; +/// F::conv3d(x, weight, F::Conv3dFuncOptions().stride(1)); +/// ``` +using Conv3dFuncOptions = ConvFuncOptions<3>; + +} // namespace functional + +// ============================================================================ + +template +struct ConvTransposeOptions { + using padding_mode_t = detail::conv_padding_mode_t; + + ConvTransposeOptions( + int64_t in_channels, + int64_t out_channels, + ExpandingArray kernel_size) + : in_channels_(in_channels), + out_channels_(out_channels), + kernel_size_(std::move(kernel_size)) {} + + /// The number of channels the input volumes will have. + /// Changing this parameter after construction __has no effect__. + TORCH_ARG(int64_t, in_channels); + + /// The number of output channels the convolution should produce. + /// Changing this parameter after construction __has no effect__. + TORCH_ARG(int64_t, out_channels); + + /// The kernel size to use. + /// For a `D`-dim convolution, must be a single number or a list of `D` + /// numbers. + /// This parameter __can__ be changed after construction. + TORCH_ARG(ExpandingArray, kernel_size); + + /// The stride of the convolution. + /// For a `D`-dim convolution, must be a single number or a list of `D` + /// numbers. + /// This parameter __can__ be changed after construction. + TORCH_ARG(ExpandingArray, stride) = 1; + + /// The padding to add to the input volumes. + /// For a `D`-dim convolution, must be a single number or a list of `D` + /// numbers. + /// This parameter __can__ be changed after construction. + TORCH_ARG(ExpandingArray, padding) = 0; + + /// For transpose convolutions, the padding to add to output volumes. + /// For a `D`-dim convolution, must be a single number or a list of `D` + /// numbers. + /// This parameter __can__ be changed after construction. + TORCH_ARG(ExpandingArray, output_padding) = 0; + + /// The number of convolution groups. + /// This parameter __can__ be changed after construction. + TORCH_ARG(int64_t, groups) = 1; + + /// Whether to add a bias after individual applications of the kernel. + /// Changing this parameter after construction __has no effect__. + TORCH_ARG(bool, bias) = true; + + /// The kernel dilation. + /// For a `D`-dim convolution, must be a single number or a list of `D` + /// numbers. + /// This parameter __can__ be changed after construction. + TORCH_ARG(ExpandingArray, dilation) = 1; + + /// Accepted values `torch::kZeros`, `torch::kReflect`, `torch::kReplicate` or + /// `torch::kCircular`. Default: `torch::kZeros` + TORCH_ARG(padding_mode_t, padding_mode) = torch::kZeros; +}; + +/// `ConvTransposeOptions` specialized for the `ConvTranspose1d` module. +/// +/// Example: +/// ``` +/// ConvTranspose1d model(ConvTranspose1dOptions(3, 2, +/// 3).stride(1).bias(false)); +/// ``` +using ConvTranspose1dOptions = ConvTransposeOptions<1>; + +/// `ConvTransposeOptions` specialized for the `ConvTranspose2d` module. +/// +/// Example: +/// ``` +/// ConvTranspose2d model(ConvTranspose2dOptions(3, 2, +/// 3).stride(1).bias(false)); +/// ``` +using ConvTranspose2dOptions = ConvTransposeOptions<2>; + +/// `ConvTransposeOptions` specialized for the `ConvTranspose3d` module. +/// +/// Example: +/// ``` +/// ConvTranspose3d model(ConvTranspose3dOptions(2, 2, +/// 2).stride(1).bias(false)); +/// ``` +using ConvTranspose3dOptions = ConvTransposeOptions<3>; + +// ============================================================================ + +namespace functional { + +/// Options for a `D`-dimensional convolution functional. +template +struct ConvTransposeFuncOptions { + /// optional bias of shape `(out_channels)`. Default: ``None`` + TORCH_ARG(torch::Tensor, bias) = Tensor(); + + /// The stride of the convolving kernel. + /// For a `D`-dim convolution, must be a single number or a list of `D` + /// numbers. + TORCH_ARG(ExpandingArray, stride) = 1; + + /// Implicit paddings on both sides of the input. + /// For a `D`-dim convolution, must be a single number or a list of `D` + /// numbers. + TORCH_ARG(ExpandingArray, padding) = 0; + + /// Additional size added to one side of each dimension in the output shape. + /// Default: 0 + TORCH_ARG(ExpandingArray, output_padding) = 0; + + /// Split input into groups, `in_channels` should be divisible by + /// the number of groups. + TORCH_ARG(int64_t, groups) = 1; + + /// The spacing between kernel elements. + /// For a `D`-dim convolution, must be a single number or a list of `D` + /// numbers. + TORCH_ARG(ExpandingArray, dilation) = 1; +}; + +/// `ConvTransposeFuncOptions` specialized for +/// `torch::nn::functional::conv_transpose1d`. +/// +/// Example: +/// ``` +/// namespace F = torch::nn::functional; +/// F::conv_transpose1d(x, weight, F::ConvTranspose1dFuncOptions().stride(1)); +/// ``` +using ConvTranspose1dFuncOptions = ConvTransposeFuncOptions<1>; + +/// `ConvTransposeFuncOptions` specialized for +/// `torch::nn::functional::conv_transpose2d`. +/// +/// Example: +/// ``` +/// namespace F = torch::nn::functional; +/// F::conv_transpose2d(x, weight, F::ConvTranspose2dFuncOptions().stride(1)); +/// ``` +using ConvTranspose2dFuncOptions = ConvTransposeFuncOptions<2>; + +/// `ConvTransposeFuncOptions` specialized for +/// `torch::nn::functional::conv_transpose3d`. +/// +/// Example: +/// ``` +/// namespace F = torch::nn::functional; +/// F::conv_transpose3d(x, weight, F::ConvTranspose3dFuncOptions().stride(1)); +/// ``` +using ConvTranspose3dFuncOptions = ConvTransposeFuncOptions<3>; + +} // namespace functional + +} // namespace nn +} // namespace torch diff --git a/shared/package-files/7c/7c33f036b16003edcf2c5f5114dc6156fbb9b1e13973c6d30e9a19c6a1d2bd43/test_spectral.py b/shared/package-files/7c/7c33f036b16003edcf2c5f5114dc6156fbb9b1e13973c6d30e9a19c6a1d2bd43/test_spectral.py new file mode 100644 index 0000000000000000000000000000000000000000..71b11c9fe151c310f4fd5a60f99323360e493506 --- /dev/null +++ b/shared/package-files/7c/7c33f036b16003edcf2c5f5114dc6156fbb9b1e13973c6d30e9a19c6a1d2bd43/test_spectral.py @@ -0,0 +1,335 @@ +"""Testing for Spectral Clustering methods""" + +import pickle +import re + +import numpy as np +import pytest +from scipy.linalg import LinAlgError + +from sklearn.cluster import SpectralClustering, spectral_clustering +from sklearn.cluster._spectral import cluster_qr, discretize +from sklearn.datasets import make_blobs +from sklearn.feature_extraction import img_to_graph +from sklearn.metrics import adjusted_rand_score +from sklearn.metrics.pairwise import kernel_metrics, rbf_kernel +from sklearn.neighbors import NearestNeighbors +from sklearn.utils import check_random_state +from sklearn.utils._testing import assert_array_equal +from sklearn.utils.fixes import COO_CONTAINERS, CSR_CONTAINERS + +try: + from pyamg import smoothed_aggregation_solver # noqa: F401 + + amg_loaded = True +except ImportError: + amg_loaded = False + +centers = np.array([[1, 1], [-1, -1], [1, -1]]) + 10 +X, _ = make_blobs( + n_samples=60, + n_features=2, + centers=centers, + cluster_std=0.4, + shuffle=True, + random_state=0, +) + + +@pytest.mark.parametrize("csr_container", CSR_CONTAINERS) +@pytest.mark.parametrize("eigen_solver", ("arpack", "lobpcg")) +@pytest.mark.parametrize("assign_labels", ("kmeans", "discretize", "cluster_qr")) +def test_spectral_clustering( + eigen_solver, assign_labels, csr_container, global_random_seed +): + S = np.array( + [ + [1.0, 1.0, 1.0, 0.2, 0.0, 0.0, 0.0], + [1.0, 1.0, 1.0, 0.2, 0.0, 0.0, 0.0], + [1.0, 1.0, 1.0, 0.2, 0.0, 0.0, 0.0], + [0.2, 0.2, 0.2, 1.0, 1.0, 1.0, 1.0], + [0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0], + [0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0], + [0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0], + ] + ) + + for mat in (S, csr_container(S)): + model = SpectralClustering( + random_state=global_random_seed, + n_clusters=2, + affinity="precomputed", + eigen_solver=eigen_solver, + assign_labels=assign_labels, + ).fit(mat) + labels = model.labels_ + if labels[0] == 0: + labels = 1 - labels + + assert adjusted_rand_score(labels, [1, 1, 1, 0, 0, 0, 0]) == 1 + + model_copy = pickle.loads(pickle.dumps(model)) + assert model_copy.n_clusters == model.n_clusters + assert model_copy.eigen_solver == model.eigen_solver + assert_array_equal(model_copy.labels_, model.labels_) + + +@pytest.mark.parametrize("coo_container", COO_CONTAINERS) +@pytest.mark.parametrize("assign_labels", ("kmeans", "discretize", "cluster_qr")) +def test_spectral_clustering_sparse(assign_labels, coo_container, global_random_seed): + X, y = make_blobs( + n_samples=20, + random_state=global_random_seed, + centers=[[1, 1], [-1, -1]], + cluster_std=0.01, + ) + + S = rbf_kernel(X, gamma=1) + S = np.maximum(S - 1e-4, 0) + S = coo_container(S) + + labels = ( + SpectralClustering( + random_state=global_random_seed, + n_clusters=2, + affinity="precomputed", + assign_labels=assign_labels, + ) + .fit(S) + .labels_ + ) + assert adjusted_rand_score(y, labels) == 1 + + +def test_precomputed_nearest_neighbors_filtering(global_random_seed): + # Test precomputed graph filtering when containing too many neighbors + X, y = make_blobs( + n_samples=250, + random_state=global_random_seed, + centers=[[1, 1, 1], [-1, -1, -1]], + cluster_std=0.01, + ) + + n_neighbors = 2 + results = [] + for additional_neighbors in [0, 10]: + nn = NearestNeighbors(n_neighbors=n_neighbors + additional_neighbors).fit(X) + graph = nn.kneighbors_graph(X, mode="distance") + labels = ( + SpectralClustering( + random_state=global_random_seed, + n_clusters=2, + affinity="precomputed_nearest_neighbors", + n_neighbors=n_neighbors, + ) + .fit(graph) + .labels_ + ) + results.append(labels) + + assert_array_equal(results[0], results[1]) + + +def test_affinities(global_random_seed): + # Note: in the following, random_state has been selected to have + # a dataset that yields a stable eigen decomposition both when built + # on OSX and Linux + X, y = make_blobs( + n_samples=20, random_state=0, centers=[[1, 1], [-1, -1]], cluster_std=0.01 + ) + # nearest neighbors affinity + sp = SpectralClustering(n_clusters=2, affinity="nearest_neighbors", random_state=0) + with pytest.warns(UserWarning, match="not fully connected"): + sp.fit(X) + assert adjusted_rand_score(y, sp.labels_) == 1 + + sp = SpectralClustering(n_clusters=2, gamma=2, random_state=global_random_seed) + labels = sp.fit(X).labels_ + assert adjusted_rand_score(y, labels) == 1 + + X = check_random_state(10).rand(10, 5) * 10 + + kernels_available = kernel_metrics() + for kern in kernels_available: + # Additive chi^2 gives a negative similarity matrix which + # doesn't make sense for spectral clustering + if kern != "additive_chi2": + sp = SpectralClustering(n_clusters=2, affinity=kern, random_state=0) + labels = sp.fit(X).labels_ + assert (X.shape[0],) == labels.shape + + sp = SpectralClustering(n_clusters=2, affinity=lambda x, y: 1, random_state=0) + labels = sp.fit(X).labels_ + assert (X.shape[0],) == labels.shape + + def histogram(x, y, **kwargs): + # Histogram kernel implemented as a callable. + assert kwargs == {} # no kernel_params that we didn't ask for + return np.minimum(x, y).sum() + + sp = SpectralClustering(n_clusters=2, affinity=histogram, random_state=0) + labels = sp.fit(X).labels_ + assert (X.shape[0],) == labels.shape + + +def test_cluster_qr(global_random_seed): + # cluster_qr by itself should not be used for clustering generic data + # other than the rows of the eigenvectors within spectral clustering, + # but cluster_qr must still preserve the labels for different dtypes + # of the generic fixed input even if the labels may be meaningless. + random_state = np.random.RandomState(seed=global_random_seed) + n_samples, n_components = 10, 5 + data = random_state.randn(n_samples, n_components) + labels_float64 = cluster_qr(data.astype(np.float64)) + # Each sample is assigned a cluster identifier + assert labels_float64.shape == (n_samples,) + # All components should be covered by the assignment + assert np.array_equal(np.unique(labels_float64), np.arange(n_components)) + # Single precision data should yield the same cluster assignments + labels_float32 = cluster_qr(data.astype(np.float32)) + assert np.array_equal(labels_float64, labels_float32) + + +def test_cluster_qr_permutation_invariance(global_random_seed): + # cluster_qr must be invariant to sample permutation. + random_state = np.random.RandomState(seed=global_random_seed) + n_samples, n_components = 100, 5 + data = random_state.randn(n_samples, n_components) + perm = random_state.permutation(n_samples) + assert np.array_equal( + cluster_qr(data)[perm], + cluster_qr(data[perm]), + ) + + +@pytest.mark.parametrize("coo_container", COO_CONTAINERS) +@pytest.mark.parametrize("n_samples", [50, 100, 150, 500]) +def test_discretize(n_samples, coo_container, global_random_seed): + # Test the discretize using a noise assignment matrix + random_state = np.random.RandomState(seed=global_random_seed) + for n_class in range(2, 10): + # random class labels + y_true = random_state.randint(0, n_class + 1, n_samples) + y_true = np.array(y_true, float) + # noise class assignment matrix + y_indicator = coo_container( + (np.ones(n_samples), (np.arange(n_samples), y_true)), + shape=(n_samples, n_class + 1), + ) + y_true_noisy = y_indicator.toarray() + 0.1 * random_state.randn( + n_samples, n_class + 1 + ) + y_pred = discretize(y_true_noisy, random_state=random_state) + assert adjusted_rand_score(y_true, y_pred) > 0.8 + + +def test_spectral_clustering_with_arpack_amg_solvers(global_random_seed): + # Test that spectral_clustering is the same for arpack and amg solver + # Based on toy example from plot_segmentation_toy.py + + # a small two coin image + x, y = np.indices((40, 40)) + + center1, center2 = (14, 12), (20, 25) + radius1, radius2 = 8, 7 + + circle1 = (x - center1[0]) ** 2 + (y - center1[1]) ** 2 < radius1**2 + circle2 = (x - center2[0]) ** 2 + (y - center2[1]) ** 2 < radius2**2 + + circles = circle1 | circle2 + mask = circles.copy() + img = circles.astype(float) + + graph = img_to_graph(img, mask=mask) + graph.data = np.exp(-graph.data / graph.data.std()) + + labels_arpack = spectral_clustering( + graph, n_clusters=2, eigen_solver="arpack", random_state=global_random_seed + ) + + assert len(np.unique(labels_arpack)) == 2 + + if amg_loaded: + labels_amg = spectral_clustering( + graph, n_clusters=2, eigen_solver="amg", random_state=global_random_seed + ) + assert adjusted_rand_score(labels_arpack, labels_amg) == 1 + else: + with pytest.raises(ValueError): + spectral_clustering(graph, n_clusters=2, eigen_solver="amg", random_state=0) + + +def test_n_components(global_random_seed): + # Test that after adding n_components, result is different and + # n_components = n_clusters by default + X, y = make_blobs( + n_samples=20, + random_state=global_random_seed, + centers=[[1, 1], [-1, -1]], + cluster_std=0.01, + ) + sp = SpectralClustering(n_clusters=2, random_state=global_random_seed) + labels = sp.fit(X).labels_ + # set n_components = n_cluster and test if result is the same + labels_same_ncomp = ( + SpectralClustering( + n_clusters=2, n_components=2, random_state=global_random_seed + ) + .fit(X) + .labels_ + ) + # test that n_components=n_clusters by default + assert_array_equal(labels, labels_same_ncomp) + + # test that n_components affect result + # n_clusters=8 by default, and set n_components=2 + labels_diff_ncomp = ( + SpectralClustering(n_components=2, random_state=global_random_seed) + .fit(X) + .labels_ + ) + assert not np.array_equal(labels, labels_diff_ncomp) + + +@pytest.mark.parametrize("assign_labels", ("kmeans", "discretize", "cluster_qr")) +def test_verbose(assign_labels, capsys): + # Check verbose mode of KMeans for better coverage. + X, y = make_blobs( + n_samples=20, random_state=0, centers=[[1, 1], [-1, -1]], cluster_std=0.01 + ) + + SpectralClustering(n_clusters=2, random_state=42, verbose=1).fit(X) + + captured = capsys.readouterr() + + assert re.search(r"Computing label assignment using", captured.out) + + if assign_labels == "kmeans": + assert re.search(r"Initialization complete", captured.out) + assert re.search(r"Iteration [0-9]+, inertia", captured.out) + + +def test_spectral_clustering_np_matrix_raises(): + """Check that spectral_clustering raises an informative error when passed + a np.matrix. See #10993""" + X = np.matrix([[0.0, 2.0], [2.0, 0.0]]) + + msg = r"np\.matrix is not supported. Please convert to a numpy array" + with pytest.raises(TypeError, match=msg): + spectral_clustering(X) + + +def test_spectral_clustering_not_infinite_loop(capsys, monkeypatch): + """Check that discretize raises LinAlgError when svd never converges. + + Non-regression test for #21380 + """ + + def new_svd(*args, **kwargs): + raise LinAlgError() + + monkeypatch.setattr(np.linalg, "svd", new_svd) + vectors = np.ones((10, 4)) + + with pytest.raises(LinAlgError, match="SVD did not converge"): + discretize(vectors) diff --git a/shared/package-files/7c/7c34b19db1afe714e31a4f1d8f4338862268c92c5b50d74a12121508e5222b97/eh.py b/shared/package-files/7c/7c34b19db1afe714e31a4f1d8f4338862268c92c5b50d74a12121508e5222b97/eh.py new file mode 100644 index 0000000000000000000000000000000000000000..56132d50f04c4c8c0fd290b2dd69c0a69ba00329 --- /dev/null +++ b/shared/package-files/7c/7c34b19db1afe714e31a4f1d8f4338862268c92c5b50d74a12121508e5222b97/eh.py @@ -0,0 +1,62 @@ +""" +Exception handling intrinsics. +""" + +from numba.core import types, errors, cgutils +from numba.core.extending import intrinsic + + +@intrinsic +def exception_check(typingctx): + """An intrinsic to check if an exception is raised + """ + def codegen(context, builder, signature, args): + nrt = context.nrt + return nrt.eh_check(builder) + + restype = types.boolean + return restype(), codegen + + +@intrinsic +def mark_try_block(typingctx): + """An intrinsic to mark the start of a *try* block. + """ + def codegen(context, builder, signature, args): + nrt = context.nrt + nrt.eh_try(builder) + return context.get_dummy_value() + + restype = types.none + return restype(), codegen + + +@intrinsic +def end_try_block(typingctx): + """An intrinsic to mark the end of a *try* block. + """ + def codegen(context, builder, signature, args): + nrt = context.nrt + nrt.eh_end_try(builder) + return context.get_dummy_value() + + restype = types.none + return restype(), codegen + + +@intrinsic +def exception_match(typingctx, exc_value, exc_class): + """Basically do ``isinstance(exc_value, exc_class)`` for exception objects. + Used in ``except Exception:`` syntax. + """ + # Check for our limitation + if exc_class.exc_class is not Exception: + msg = "Exception matching is limited to {}" + raise errors.UnsupportedError(msg.format(Exception)) + + def codegen(context, builder, signature, args): + # Intentionally always True. + return cgutils.true_bit + + restype = types.boolean + return restype(exc_value, exc_class), codegen diff --git a/shared/package-files/7c/7c3602b8e21e7e08cd049ef38405189e23559794a5b52b36ef95da3682f44beb/test_insert.py b/shared/package-files/7c/7c3602b8e21e7e08cd049ef38405189e23559794a5b52b36ef95da3682f44beb/test_insert.py new file mode 100644 index 0000000000000000000000000000000000000000..f8164102815f61ec61962524db2a2b3dd0ff6d55 --- /dev/null +++ b/shared/package-files/7c/7c3602b8e21e7e08cd049ef38405189e23559794a5b52b36ef95da3682f44beb/test_insert.py @@ -0,0 +1,145 @@ +from datetime import timedelta + +import numpy as np +import pytest + +from pandas._libs import lib + +import pandas as pd +from pandas import ( + Index, + Timedelta, + TimedeltaIndex, + timedelta_range, +) +import pandas._testing as tm + + +class TestTimedeltaIndexInsert: + def test_insert(self): + idx = TimedeltaIndex(["4day", "1day", "2day"], name="idx") + + result = idx.insert(2, timedelta(days=5)) + exp = TimedeltaIndex(["4day", "1day", "5day", "2day"], name="idx") + tm.assert_index_equal(result, exp) + + # insertion of non-datetime should coerce to object index + result = idx.insert(1, "inserted") + expected = Index( + [Timedelta("4day"), "inserted", Timedelta("1day"), Timedelta("2day")], + name="idx", + ) + assert not isinstance(result, TimedeltaIndex) + tm.assert_index_equal(result, expected) + assert result.name == expected.name + + idx = timedelta_range("1day 00:00:01", periods=3, freq="s", name="idx") + + # preserve freq + expected_0 = TimedeltaIndex( + ["1day", "1day 00:00:01", "1day 00:00:02", "1day 00:00:03"], + name="idx", + freq="s", + ) + expected_3 = TimedeltaIndex( + ["1day 00:00:01", "1day 00:00:02", "1day 00:00:03", "1day 00:00:04"], + name="idx", + freq="s", + ) + + # reset freq to None + expected_1_nofreq = TimedeltaIndex( + ["1day 00:00:01", "1day 00:00:01", "1day 00:00:02", "1day 00:00:03"], + name="idx", + freq=None, + ) + expected_3_nofreq = TimedeltaIndex( + ["1day 00:00:01", "1day 00:00:02", "1day 00:00:03", "1day 00:00:05"], + name="idx", + freq=None, + ) + + cases = [ + (0, Timedelta("1day"), expected_0), + (-3, Timedelta("1day"), expected_0), + (3, Timedelta("1day 00:00:04"), expected_3), + (1, Timedelta("1day 00:00:01"), expected_1_nofreq), + (3, Timedelta("1day 00:00:05"), expected_3_nofreq), + ] + + for n, d, expected in cases: + result = idx.insert(n, d) + tm.assert_index_equal(result, expected) + assert result.name == expected.name + assert result.freq == expected.freq + + @pytest.mark.parametrize( + "null", [None, np.nan, np.timedelta64("NaT"), pd.NaT, pd.NA] + ) + def test_insert_nat(self, null): + # GH 18295 (test missing) + idx = timedelta_range("1day", "3day") + result = idx.insert(1, null) + expected = TimedeltaIndex(["1day", pd.NaT, "2day", "3day"]) + tm.assert_index_equal(result, expected) + + def test_insert_invalid_na(self): + idx = TimedeltaIndex(["4day", "1day", "2day"], name="idx") + + item = np.datetime64("NaT") + result = idx.insert(0, item) + + expected = Index([item] + list(idx), dtype=object, name="idx") + tm.assert_index_equal(result, expected) + + # Also works if we pass a different dt64nat object + item2 = np.datetime64("NaT") + result = idx.insert(0, item2) + tm.assert_index_equal(result, expected) + + @pytest.mark.parametrize( + "item", [0, np.int64(0), np.float64(0), np.array(0), np.datetime64(456, "us")] + ) + def test_insert_mismatched_types_raises(self, item): + # GH#33703 dont cast these to td64 + tdi = TimedeltaIndex(["4day", "1day", "2day"], name="idx") + + result = tdi.insert(1, item) + + expected = Index( + [tdi[0], lib.item_from_zerodim(item)] + list(tdi[1:]), + dtype=object, + name="idx", + ) + tm.assert_index_equal(result, expected) + + def test_insert_castable_str(self): + idx = timedelta_range("1day", "3day") + + result = idx.insert(0, "1 Day") + + expected = TimedeltaIndex([idx[0]] + list(idx)) + tm.assert_index_equal(result, expected) + + def test_insert_non_castable_str(self): + idx = timedelta_range("1day", "3day") + + result = idx.insert(0, "foo") + + expected = Index(["foo"] + list(idx), dtype=object) + tm.assert_index_equal(result, expected) + + def test_insert_empty(self): + # Corner case inserting with length zero doesn't raise IndexError + # GH#33573 for freq preservation + idx = timedelta_range("1 Day", periods=3) + td = idx[0] + + result = idx[:0].insert(0, td) + assert result.freq == "D" + + with pytest.raises(IndexError, match="loc must be an integer between"): + result = idx[:0].insert(1, td) + + with pytest.raises(IndexError, match="loc must be an integer between"): + result = idx[:0].insert(-1, td) diff --git a/shared/package-files/7c/7c3c57eb145a85eb2faa5358547f4fae4dbbe9ec3596b17d18648ee0fad8f0df/hp2621-nt b/shared/package-files/7c/7c3c57eb145a85eb2faa5358547f4fae4dbbe9ec3596b17d18648ee0fad8f0df/hp2621-nt new file mode 100644 index 0000000000000000000000000000000000000000..6c88515da87b658ac80f584205f8cc3bb158bba1 Binary files /dev/null and b/shared/package-files/7c/7c3c57eb145a85eb2faa5358547f4fae4dbbe9ec3596b17d18648ee0fad8f0df/hp2621-nt differ diff --git a/shared/package-files/7c/7c3e49ba06edff7f676757958cf35d020a0346e3574dc9d907d940e30ebceef3/index.py b/shared/package-files/7c/7c3e49ba06edff7f676757958cf35d020a0346e3574dc9d907d940e30ebceef3/index.py new file mode 100644 index 0000000000000000000000000000000000000000..72c4ebfb5d84ae82f74a4c814e72372a651ae6b8 --- /dev/null +++ b/shared/package-files/7c/7c3e49ba06edff7f676757958cf35d020a0346e3574dc9d907d940e30ebceef3/index.py @@ -0,0 +1,19 @@ +""" +Tests for Indexes backed by arbitrary ExtensionArrays. +""" +import pandas as pd + + +class BaseIndexTests: + """Tests for Index object backed by an ExtensionArray""" + + def test_index_from_array(self, data): + idx = pd.Index(data) + assert data.dtype == idx.dtype + + def test_index_from_listlike_with_dtype(self, data): + idx = pd.Index(data, dtype=data.dtype) + assert idx.dtype == data.dtype + + idx = pd.Index(list(data), dtype=data.dtype) + assert idx.dtype == data.dtype diff --git a/shared/package-files/7c/7c411676c7c6aa80510f711598786df0ef9ad986bbe9496b71d41da73734dab4/gnome-256color b/shared/package-files/7c/7c411676c7c6aa80510f711598786df0ef9ad986bbe9496b71d41da73734dab4/gnome-256color new file mode 100644 index 0000000000000000000000000000000000000000..72e96acfd29251832e595d96545d4f6f82edfbf4 Binary files /dev/null and b/shared/package-files/7c/7c411676c7c6aa80510f711598786df0ef9ad986bbe9496b71d41da73734dab4/gnome-256color differ diff --git a/shared/package-files/7c/7c424697b918fdd0c07abc5165c2c0238d0dc524d09e54c930b5e6a2f2aaa072/slow_conv_dilated3d_cpu_dispatch.h b/shared/package-files/7c/7c424697b918fdd0c07abc5165c2c0238d0dc524d09e54c930b5e6a2f2aaa072/slow_conv_dilated3d_cpu_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..77d72373651e551df5654b3440119ad2ba181f5a --- /dev/null +++ b/shared/package-files/7c/7c424697b918fdd0c07abc5165c2c0238d0dc524d09e54c930b5e6a2f2aaa072/slow_conv_dilated3d_cpu_dispatch.h @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cpu { + +TORCH_API at::Tensor slow_conv_dilated3d(const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional & bias={}, at::IntArrayRef stride=1, at::IntArrayRef padding=0, at::IntArrayRef dilation=1); +TORCH_API at::Tensor slow_conv_dilated3d_symint(const at::Tensor & self, const at::Tensor & weight, c10::SymIntArrayRef kernel_size, const c10::optional & bias={}, c10::SymIntArrayRef stride=c10::SymInt(1), c10::SymIntArrayRef padding=c10::SymInt(0), c10::SymIntArrayRef dilation=c10::SymInt(1)); + +} // namespace cpu +} // namespace at diff --git a/shared/package-files/7c/7c4301e0474ef1a5f8eda5b5decfa7552cbec8ce6a2337d7ace61a4249afdfe0/config.py b/shared/package-files/7c/7c4301e0474ef1a5f8eda5b5decfa7552cbec8ce6a2337d7ace61a4249afdfe0/config.py new file mode 100644 index 0000000000000000000000000000000000000000..407165147e353ce2776e98a6f2a3f6dfc6b2be7e --- /dev/null +++ b/shared/package-files/7c/7c4301e0474ef1a5f8eda5b5decfa7552cbec8ce6a2337d7ace61a4249afdfe0/config.py @@ -0,0 +1,388 @@ +from typing import Dict, Union + +from torchgen.model import NativeFunctionsGroup, NativeFunctionsViewGroup + + +def func_name_base_str(g: Union[NativeFunctionsGroup, NativeFunctionsViewGroup]) -> str: + if isinstance(g, NativeFunctionsGroup): + return str(g.functional.func.name.name.base) + else: + return str(g.view.root_name) + + +is_hand_written_ops_ = frozenset( + ( + "abs", + "add", + "addmm", + "all", + "any", + "argmin", + "bmm", + "clamp", + "clamp_min", + "cumsum", + "div", + "fmod", + "index_select", + "leaky_relu", + "linear", + "log", + "matmul", + "mul", + "narrow_copy", + "nonzero", + "pow", + "remainder", + "sigmoid", + "sign", + "sub", + "tanh", + "detach", + "expand_as", + "flatten", + "narrow", + "reshape_as", + "select", + "slice", + "softmax", + "split", + "squeeze", + "transpose", + "view", + "where", + ) +) + + +def is_hand_written(g: Union[NativeFunctionsGroup, NativeFunctionsViewGroup]) -> bool: + name_base = func_name_base_str(g) + return name_base in is_hand_written_ops_ + + +def override_test_values(arg_map: Dict[str, str], op_name: str, index: int) -> None: + assert index == 0 or index == 1 + if op_name == "addr": + if index == 0: + arg_map["self"] = "at::rand({6, 6})" + arg_map["vec1"] = "at::rand({6})" + arg_map["vec2"] = "at::rand({6})" + else: + arg_map["self"] = "at::rand({22, 22})" + arg_map["vec1"] = "at::rand({22})" + arg_map["vec2"] = "at::rand({22})" + return + if op_name == "mv": + if index == 0: + arg_map["self"] = "at::rand({6, 6})" + arg_map["vec"] = "at::rand({6})" + else: + arg_map["self"] = "at::rand({22, 22})" + arg_map["vec"] = "at::rand({22})" + return + if op_name == "addbmm": + if index == 0: + arg_map["self"] = "at::rand({6, 6})" + else: + arg_map["self"] = "at::rand({22, 22})" + return + if op_name == "cross": + if index == 0: + arg_map["self"] = "at::rand({3, 3, 3})" + arg_map["other"] = "at::rand({3, 3, 3})" + else: + arg_map["self"] = "at::rand({22, 3, 22})" + arg_map["other"] = "at::rand({22, 3, 22})" + return + if op_name == "take": + if index == 0: + arg_map["index"] = "at::randint(0, 216, {20}, torch::kInt64)" + else: + arg_map["index"] = "at::randint(0, 1000, {100}, torch::kInt64)" + return + if op_name == "take_along_dim": + if index == 0: + arg_map["indices"] = "at::argsort(self0, 1, true)" + else: + arg_map["indices"] = "at::argsort(self1, 1, true)" + return + if op_name == "masked_select": + if index == 0: + arg_map["mask"] = "at::randn({6, 6, 6}) > 0.5" + else: + arg_map["mask"] = "at::rand({22, 22, 22}) > 0.5" + return + if op_name == "orgqr": + if index == 0: + arg_map["input2"] = "at::rand({6, 6})" + else: + arg_map["input2"] = "at::rand({22, 22})" + return + if op_name == "ormqr": + if index == 0: + arg_map["input2"] = "at::rand({6, 6})" + else: + arg_map["input2"] = "at::rand({22, 22})" + return + if op_name == "quantile": + if index == 0: + arg_map["q"] = "at::rand({6})" + arg_map["interpolation"] = '"linear"' + else: + arg_map["q"] = "at::rand({22})" + arg_map["interpolation"] = '"linear"' + return + if op_name == "nanquantile": + if index == 0: + arg_map["q"] = "at::rand({6})" + arg_map["interpolation"] = '"linear"' + else: + arg_map["q"] = "at::rand({22})" + arg_map["interpolation"] = '"linear"' + return + if op_name == "multi_margin_loss": + if index == 0: + arg_map["self"] = "at::rand({6, 6})" + arg_map["target"] = "at::randint(6, {6}, torch::kInt64)" + arg_map["weight"] = "at::rand({6})" + else: + arg_map["self"] = "at::rand({22, 22})" + arg_map["target"] = "at::randint(22, {22}, torch::kInt64)" + arg_map["weight"] = "at::rand({22})" + return + if op_name == "multilabel_margin_loss": + if index == 0: + arg_map["self"] = "at::rand({6, 6})" + arg_map["target"] = "at::randint(6, {6, 6}, torch::kInt64)" + else: + arg_map["self"] = "at::rand({22, 22})" + arg_map["target"] = "at::randint(22, {22, 22}, torch::kInt64)" + return + if op_name == "nll_loss": + if index == 0: + arg_map["self"] = "at::rand({6, 6})" + arg_map["target"] = "at::randint(6, {6}, torch::kInt64)" + arg_map["weight"] = "at::rand({6})" + else: + arg_map["self"] = "at::rand({22, 22})" + arg_map["target"] = "at::randint(22, {22}, torch::kInt64)" + arg_map["weight"] = "at::rand({22})" + return + if op_name == "nll_loss2d": + if index == 0: + arg_map["self"] = "at::rand({6, 6, 6, 6})" + arg_map["target"] = "at::randint(6, {6, 6, 6}, torch::kInt64)" + arg_map["weight"] = "at::rand({6})" + else: + arg_map["self"] = "at::rand({22, 22, 22, 22})" + arg_map["target"] = "at::randint(22, {22, 22, 22}, torch::kInt64)" + arg_map["weight"] = "at::rand({22})" + return + if op_name in ( + "fft_fft", + "fft_ifft", + "fft_rfft", + "fft_irfft", + "fft_hfft", + "fft_ihfft", + ): + arg_map["norm"] = '"forward"' + return + if op_name == "linalg_tensorinv": + if index == 0: + arg_map["self"] = "at::rand({6, 6, 6, 6})" + arg_map["ind"] = "2" + else: + arg_map["self"] = "at::rand({22, 22, 22, 22})" + arg_map["ind"] = "2" + return + if op_name == "addmv": + if index == 0: + arg_map["self"] = "at::rand({2})" + arg_map["mat"] = "at::rand({2, 2})" + arg_map["vec"] = "at::rand({2})" + else: + arg_map["self"] = "at::rand({35})" + arg_map["mat"] = "at::rand({35, 35})" + arg_map["vec"] = "at::rand({35})" + return + if op_name == "acosh": + if index == 0: + arg_map["self"] = "at::rand({2, 2, 2}) + at::ones({2, 2, 2})" + else: + arg_map["self"] = "at::rand({5, 5, 5}) + at::ones({5, 5, 5})" + return + if op_name == "adaptive_max_pool2d_backward": + if index == 0: + arg_map["grad_output"] = "at::rand({2, 2, 2}, at::kFloat)" + arg_map["self"] = "at::rand({2, 2, 2}, at::kFloat)" + arg_map["indices"] = "at::randint(0, 1, {2, 2, 2}, at::kLong)" + else: + arg_map["grad_output"] = "at::rand({3, 3, 3}, at::kFloat)" + arg_map["self"] = "at::rand({3, 3, 3}, at::kFloat)" + arg_map["indices"] = "at::randint(0, 1, {3, 3, 3}, at::kLong)" + return + if op_name == "adaptive_max_pool3d_backward": + if index == 0: + arg_map["grad_output"] = "at::rand({2, 2, 2, 2}, at::kFloat)" + arg_map["self"] = "at::rand({2, 2, 2, 2}, at::kFloat)" + arg_map["indices"] = "at::randint(0, 1, {2, 2, 2, 2}, at::kLong)" + else: + arg_map["grad_output"] = "at::rand({3, 3, 3, 3}, at::kFloat)" + arg_map["self"] = "at::rand({3, 3, 3, 3}, at::kFloat)" + arg_map["indices"] = "at::randint(0, 1, {3, 3, 3, 3}, at::kLong)" + return + if op_name == "bitwise_left_shift": + if index == 0: + arg_map["self"] = "at::randint(1, 1 << 4, {6, 6, 6}, at::kInt)" + arg_map["other"] = "at::randint(1, 26, {6, 6, 6}, at::kInt)" + else: + arg_map["self"] = "at::randint(1, 1 << 4, {22, 22, 22}, at::kInt)" + arg_map["other"] = "at::randint(1, 26, {22, 22, 22}, at::kInt)" + return + if op_name == "bitwise_right_shift": + if index == 0: + arg_map["self"] = "at::randint(1 << 21, 1 << 30, {6, 6, 6}, at::kInt)" + arg_map["other"] = "at::randint(1, 22, {6, 6, 6}, at::kInt)" + else: + arg_map["self"] = "at::randint(1 << 21, 1 << 30, {22, 22, 22}, at::kInt)" + arg_map["other"] = "at::randint(1, 22, {22, 22, 22}, at::kInt)" + return + if op_name == "gather": + if index == 0: + arg_map["self"] = "at::randint(1, 100, {2,2,2}, at::kInt)" + arg_map["dim"] = "1" + arg_map["index"] = "at::randint(0, 1, {2,2,2}, torch::kInt64)" + arg_map["sparse_grad"] = "false" + else: + arg_map["self"] = "at::randint(1, 100, {5,5,5}, at::kInt)" + arg_map["dim"] = "1" + arg_map["index"] = "at::randint(0, 4, {5,5,5}, torch::kInt64)" + arg_map["sparse_grad"] = "false" + return + if op_name == "gelu": + if index == 0: + arg_map["self"] = "at::rand({6, 6, 6})" + arg_map["approximate"] = '"tanh"' + else: + arg_map["self"] = "at::rand({22, 22, 22})" + arg_map["approximate"] = '"tanh"' + return + if op_name == "gelu_backward": + if index == 0: + arg_map["grad_output"] = "at::rand({6, 6, 6})" + arg_map["self"] = "at::rand({6, 6, 6})" + arg_map["approximate"] = '"tanh"' + else: + arg_map["grad_output"] = "at::rand({22, 22, 22})" + arg_map["self"] = "at::rand({22, 22, 22})" + arg_map["approximate"] = '"tanh"' + return + if op_name == "index_add": + if index == 0: + arg_map["self"] = "at::rand({2})" + arg_map["dim"] = "0" + arg_map["index"] = "at::randint(0, 1, {2}, at::kInt)" + arg_map["source"] = "at::rand({2})" + arg_map["alpha"] = "2" + else: + arg_map["self"] = "at::rand({16})" + arg_map["dim"] = "0" + arg_map["index"] = "at::randint(0, 10, {16}, at::kInt)" + arg_map["source"] = "at::rand({16})" + arg_map["alpha"] = "2" + return + if op_name == "index_copy": + if index == 0: + arg_map["self"] = "at::rand({2})" + arg_map["dim"] = "0" + arg_map["index"] = "at::randint(0, 1, {2}, at::kLong)" + arg_map["source"] = "at::rand({2})" + else: + arg_map["self"] = "at::rand({32})" + arg_map["dim"] = "0" + arg_map["index"] = "at::randint(0, 10, {32}, at::kLong)" + arg_map["source"] = "at::rand({32})" + return + if op_name == "linalg_cross": + if index == 0: + arg_map["self"] = "at::rand({6, 3, 6})" + arg_map["other"] = "at::rand({6, 3, 6})" + arg_map["dim"] = "1" + else: + arg_map["self"] = "at::rand({22, 3, 22})" + arg_map["other"] = "at::rand({22, 3, 22})" + arg_map["dim"] = "1" + return + if op_name == "nll_loss_backward": + if index == 0: + arg_map["grad_output"] = "at::rand({})" + arg_map["self"] = "at::rand({6})" + arg_map["target"] = "at::randint(0, 5, {6}, torch::kInt64)" + arg_map["weight"] = "at::rand({6})" + arg_map["reduction"] = "1" + arg_map["ignore_index"] = "1" + arg_map["total_weight"] = "at::rand({})" + else: + arg_map["grad_output"] = "at::rand({})" + arg_map["self"] = "at::rand({36})" + arg_map["target"] = "at::randint(0, 11, {36}, torch::kInt64)" + arg_map["weight"] = "at::rand({36})" + arg_map["reduction"] = "1" + arg_map["ignore_index"] = "1" + arg_map["total_weight"] = "at::rand({})" + return + if op_name in ["scatter", "scatter_add", "_scatter_reduce"]: + if index == 0: + arg_map["self"] = "at::randint(1, 100, {2,2,2}, torch::kInt64)" + arg_map["index"] = "at::randint(0, 1, {2,2,2}, torch::kInt64)" + arg_map["src"] = "at::randint(1, 100, {2,2,2}, torch::kInt64)" + else: + arg_map["self"] = "at::randint(1, 100, {5,5,5}, torch::kInt64)" + arg_map["index"] = "at::randint(0, 1, {5,5,5}, torch::kInt64)" + arg_map["src"] = "at::randint(1, 100, {5,5,5}, torch::kInt64)" + if "reduce" in arg_map: + arg_map["reduce"] = '"sum"' if op_name == "_scatter_reduce" else '"add"' + return + if op_name == "scatter_reduce": + arg_map["reduce"] = '"mean"' + if index == 0: + arg_map["index"] = "at::randint(6, {6, 6, 6}, torch::kInt64)" + else: + arg_map["index"] = "at::randint(22, {22, 22, 22}, torch::kInt64)" + return + if op_name == "special_zeta": + if index == 0: + arg_map["self"] = "at::rand({2,2,2}, at::kDouble) + at::ones({2,2,2})" + arg_map["other"] = "at::rand({2,2,2}, at::kDouble) + at::ones({2,2,2})" + else: + arg_map["self"] = "at::rand({5,5,5}, at::kDouble) + at::ones({5,5,5})" + arg_map["other"] = "at::rand({5,5,5}, at::kDouble) + at::ones({5,5,5})" + return + if op_name == "_convert_indices_from_csr_to_coo": + if index == 0: + arg_map["crow_indices"] = "torch::tensor({1}, torch::kInt32)" + arg_map["col_indices"] = "torch::tensor({0, 1, 0}, torch::kInt32)" + arg_map["out_int32"] = "false" + else: + arg_map["crow_indices"] = "torch::tensor({0}, torch::kInt32)" + arg_map[ + "col_indices" + ] = "torch::tensor({0, 1, 0, 2, 1, 2, 0, 1, 0, 2, 1, 2}, torch::kInt32)" + arg_map["out_int32"] = "false" + return + if op_name == "_convert_indices_from_coo_to_csr": + if index == 0: + arg_map["self"] = "at::randint(0, 3, {2}, at::kInt)" + arg_map["size"] = "10" + arg_map["out_int32"] = "false" + else: + arg_map["self"] = "at::randint(0, 3, {12}, at::kInt)" + arg_map["size"] = "24" + arg_map["out_int32"] = "false" + return + if op_name in ("diagonal", "linalg_diagonal"): + arg_map["offset"] = "0" + arg_map["dim0"] = "1" + arg_map["dim1"] = "2" + return diff --git a/shared/package-files/7c/7c43efc28eac8f067dcad767b9f148504fa012421ed740db76c5f9d6fde58f2a/test_sputils.py b/shared/package-files/7c/7c43efc28eac8f067dcad767b9f148504fa012421ed740db76c5f9d6fde58f2a/test_sputils.py new file mode 100644 index 0000000000000000000000000000000000000000..fb328e3f6512081f76604c4b92fe3d407819e448 --- /dev/null +++ b/shared/package-files/7c/7c43efc28eac8f067dcad767b9f148504fa012421ed740db76c5f9d6fde58f2a/test_sputils.py @@ -0,0 +1,395 @@ +"""unit tests for sparse utility functions""" + +import numpy as np +from numpy.testing import assert_equal +import pytest +from pytest import raises as assert_raises +from scipy.sparse import _sputils as sputils, csr_array, bsr_array, dia_array, coo_array +from scipy.sparse._sputils import matrix + + +class TestSparseUtils: + + def test_upcast(self): + assert_equal(sputils.upcast('intc'), np.intc) + assert_equal(sputils.upcast('int32', 'float32'), np.float64) + assert_equal(sputils.upcast('bool', complex, float), np.complex128) + assert_equal(sputils.upcast('i', 'd'), np.float64) + + def test_getdtype(self): + A = np.array([1], dtype='int8') + + assert_equal(sputils.getdtype(None, default=float), float) + assert_equal(sputils.getdtype(None, a=A), np.int8) + + with assert_raises( + ValueError, + match="scipy.sparse does not support dtype object. .*", + ): + sputils.getdtype("O") + + with assert_raises( + ValueError, + match="scipy.sparse does not support dtype float16. .*", + ): + sputils.getdtype(None, default=np.float16) + + def test_isscalarlike(self): + assert_equal(sputils.isscalarlike(3.0), True) + assert_equal(sputils.isscalarlike(-4), True) + assert_equal(sputils.isscalarlike(2.5), True) + assert_equal(sputils.isscalarlike(1 + 3j), True) + assert_equal(sputils.isscalarlike(np.array(3)), True) + assert_equal(sputils.isscalarlike("16"), True) + + assert_equal(sputils.isscalarlike(np.array([3])), False) + assert_equal(sputils.isscalarlike([[3]]), False) + assert_equal(sputils.isscalarlike((1,)), False) + assert_equal(sputils.isscalarlike((1, 2)), False) + + def test_isintlike(self): + assert_equal(sputils.isintlike(-4), True) + assert_equal(sputils.isintlike(np.array(3)), True) + assert_equal(sputils.isintlike(np.array([3])), False) + with assert_raises( + ValueError, + match="Inexact indices into sparse matrices are not allowed" + ): + sputils.isintlike(3.0) + + assert_equal(sputils.isintlike(2.5), False) + assert_equal(sputils.isintlike(1 + 3j), False) + assert_equal(sputils.isintlike((1,)), False) + assert_equal(sputils.isintlike((1, 2)), False) + + def test_isshape(self): + assert_equal(sputils.isshape((1, 2)), True) + assert_equal(sputils.isshape((5, 2)), True) + + assert_equal(sputils.isshape((1.5, 2)), False) + assert_equal(sputils.isshape((2, 2, 2)), False) + assert_equal(sputils.isshape(([2], 2)), False) + assert_equal(sputils.isshape((-1, 2), nonneg=False),True) + assert_equal(sputils.isshape((2, -1), nonneg=False),True) + assert_equal(sputils.isshape((-1, 2), nonneg=True),False) + assert_equal(sputils.isshape((2, -1), nonneg=True),False) + + assert_equal(sputils.isshape((1.5, 2), allow_nd=(1, 2)), False) + assert_equal(sputils.isshape(([2], 2), allow_nd=(1, 2)), False) + assert_equal(sputils.isshape((2, 2, -2), nonneg=True, allow_nd=(1, 2)), + False) + assert_equal(sputils.isshape((2,), allow_nd=(1, 2)), True) + assert_equal(sputils.isshape((2, 2,), allow_nd=(1, 2)), True) + assert_equal(sputils.isshape((2, 2, 2), allow_nd=(1, 2)), False) + + def test_issequence(self): + assert_equal(sputils.issequence((1,)), True) + assert_equal(sputils.issequence((1, 2, 3)), True) + assert_equal(sputils.issequence([1]), True) + assert_equal(sputils.issequence([1, 2, 3]), True) + assert_equal(sputils.issequence(np.array([1, 2, 3])), True) + + assert_equal(sputils.issequence(np.array([[1], [2], [3]])), False) + assert_equal(sputils.issequence(3), False) + + def test_ismatrix(self): + assert_equal(sputils.ismatrix(((),)), True) + assert_equal(sputils.ismatrix([[1], [2]]), True) + assert_equal(sputils.ismatrix(np.arange(3)[None]), True) + + assert_equal(sputils.ismatrix([1, 2]), False) + assert_equal(sputils.ismatrix(np.arange(3)), False) + assert_equal(sputils.ismatrix([[[1]]]), False) + assert_equal(sputils.ismatrix(3), False) + + def test_isdense(self): + assert_equal(sputils.isdense(np.array([1])), True) + assert_equal(sputils.isdense(matrix([1])), True) + + def test_validateaxis(self): + assert_raises(TypeError, sputils.validateaxis, (0, 1)) + assert_raises(TypeError, sputils.validateaxis, 1.5) + assert_raises(ValueError, sputils.validateaxis, 3) + + # These function calls should not raise errors + for axis in (-2, -1, 0, 1, None): + sputils.validateaxis(axis) + + @pytest.mark.parametrize("container", [csr_array, bsr_array]) + def test_safely_cast_index_compressed(self, container): + # This is slow to test completely as nnz > imax is big + # and indptr is big for some shapes + # So we don't test large nnz, nor csc_array (same code as csr_array) + imax = np.int64(np.iinfo(np.int32).max) + + # Shape 32bit + A32 = container((1, imax)) + # indices big type, small values + B32 = A32.copy() + B32.indices = B32.indices.astype(np.int64) + B32.indptr = B32.indptr.astype(np.int64) + + # Shape 64bit + # indices big type, small values + A64 = csr_array((1, imax + 1)) + # indices small type, small values + B64 = A64.copy() + B64.indices = B64.indices.astype(np.int32) + B64.indptr = B64.indptr.astype(np.int32) + # indices big type, big values + C64 = A64.copy() + C64.indices = np.array([imax + 1], dtype=np.int64) + C64.indptr = np.array([0, 1], dtype=np.int64) + C64.data = np.array([2.2]) + + assert (A32.indices.dtype, A32.indptr.dtype) == (np.int32, np.int32) + assert (B32.indices.dtype, B32.indptr.dtype) == (np.int64, np.int64) + assert (A64.indices.dtype, A64.indptr.dtype) == (np.int64, np.int64) + assert (B64.indices.dtype, B64.indptr.dtype) == (np.int32, np.int32) + assert (C64.indices.dtype, C64.indptr.dtype) == (np.int64, np.int64) + + for A in [A32, B32, A64, B64]: + indices, indptr = sputils.safely_cast_index_arrays(A, np.int32) + assert (indices.dtype, indptr.dtype) == (np.int32, np.int32) + indices, indptr = sputils.safely_cast_index_arrays(A, np.int64) + assert (indices.dtype, indptr.dtype) == (np.int64, np.int64) + + indices, indptr = sputils.safely_cast_index_arrays(A, A.indices.dtype) + assert indices is A.indices + assert indptr is A.indptr + + with assert_raises(ValueError): + sputils.safely_cast_index_arrays(C64, np.int32) + indices, indptr = sputils.safely_cast_index_arrays(C64, np.int64) + assert indices is C64.indices + assert indptr is C64.indptr + + def test_safely_cast_index_coo(self): + # This is slow to test completely as nnz > imax is big + # So we don't test large nnz + imax = np.int64(np.iinfo(np.int32).max) + + # Shape 32bit + A32 = coo_array((1, imax)) + # coords big type, small values + B32 = A32.copy() + B32.coords = tuple(co.astype(np.int64) for co in B32.coords) + + # Shape 64bit + # coords big type, small values + A64 = coo_array((1, imax + 1)) + # coords small type, small values + B64 = A64.copy() + B64.coords = tuple(co.astype(np.int32) for co in B64.coords) + # coords big type, big values + C64 = A64.copy() + C64.coords = (np.array([imax + 1]), np.array([0])) + C64.data = np.array([2.2]) + + assert A32.coords[0].dtype == np.int32 + assert B32.coords[0].dtype == np.int64 + assert A64.coords[0].dtype == np.int64 + assert B64.coords[0].dtype == np.int32 + assert C64.coords[0].dtype == np.int64 + + for A in [A32, B32, A64, B64]: + coords = sputils.safely_cast_index_arrays(A, np.int32) + assert coords[0].dtype == np.int32 + coords = sputils.safely_cast_index_arrays(A, np.int64) + assert coords[0].dtype == np.int64 + + coords = sputils.safely_cast_index_arrays(A, A.coords[0].dtype) + assert coords[0] is A.coords[0] + + with assert_raises(ValueError): + sputils.safely_cast_index_arrays(C64, np.int32) + coords = sputils.safely_cast_index_arrays(C64, np.int64) + assert coords[0] is C64.coords[0] + + def test_safely_cast_index_dia(self): + # This is slow to test completely as nnz > imax is big + # So we don't test large nnz + imax = np.int64(np.iinfo(np.int32).max) + + # Shape 32bit + A32 = dia_array((1, imax)) + # offsets big type, small values + B32 = A32.copy() + B32.offsets = B32.offsets.astype(np.int64) + + # Shape 64bit + # offsets big type, small values + A64 = dia_array((1, imax + 2)) + # offsets small type, small values + B64 = A64.copy() + B64.offsets = B64.offsets.astype(np.int32) + # offsets big type, big values + C64 = A64.copy() + C64.offsets = np.array([imax + 1]) + C64.data = np.array([2.2]) + + assert A32.offsets.dtype == np.int32 + assert B32.offsets.dtype == np.int64 + assert A64.offsets.dtype == np.int64 + assert B64.offsets.dtype == np.int32 + assert C64.offsets.dtype == np.int64 + + for A in [A32, B32, A64, B64]: + offsets = sputils.safely_cast_index_arrays(A, np.int32) + assert offsets.dtype == np.int32 + offsets = sputils.safely_cast_index_arrays(A, np.int64) + assert offsets.dtype == np.int64 + + offsets = sputils.safely_cast_index_arrays(A, A.offsets.dtype) + assert offsets is A.offsets + + with assert_raises(ValueError): + sputils.safely_cast_index_arrays(C64, np.int32) + offsets = sputils.safely_cast_index_arrays(C64, np.int64) + assert offsets is C64.offsets + + def test_get_index_dtype(self): + imax = np.int64(np.iinfo(np.int32).max) + too_big = imax + 1 + + # Check that uint32's with no values too large doesn't return + # int64 + a1 = np.ones(90, dtype='uint32') + a2 = np.ones(90, dtype='uint32') + assert_equal( + np.dtype(sputils.get_index_dtype((a1, a2), check_contents=True)), + np.dtype('int32') + ) + + # Check that if we can not convert but all values are less than or + # equal to max that we can just convert to int32 + a1[-1] = imax + assert_equal( + np.dtype(sputils.get_index_dtype((a1, a2), check_contents=True)), + np.dtype('int32') + ) + + # Check that if it can not convert directly and the contents are + # too large that we return int64 + a1[-1] = too_big + assert_equal( + np.dtype(sputils.get_index_dtype((a1, a2), check_contents=True)), + np.dtype('int64') + ) + + # test that if can not convert and didn't specify to check_contents + # we return int64 + a1 = np.ones(89, dtype='uint32') + a2 = np.ones(89, dtype='uint32') + assert_equal( + np.dtype(sputils.get_index_dtype((a1, a2))), + np.dtype('int64') + ) + + # Check that even if we have arrays that can be converted directly + # that if we specify a maxval directly it takes precedence + a1 = np.ones(12, dtype='uint32') + a2 = np.ones(12, dtype='uint32') + assert_equal( + np.dtype(sputils.get_index_dtype( + (a1, a2), maxval=too_big, check_contents=True + )), + np.dtype('int64') + ) + + # Check that an array with a too max size and maxval set + # still returns int64 + a1[-1] = too_big + assert_equal( + np.dtype(sputils.get_index_dtype((a1, a2), maxval=too_big)), + np.dtype('int64') + ) + + # tests public broadcast_shapes largely from + # numpy/numpy/lib/tests/test_stride_tricks.py + # first 3 cause np.broadcast to raise index too large, but not sputils + @pytest.mark.parametrize("input_shapes,target_shape", [ + [((6, 5, 1, 4, 1, 1), (1, 2**32), (2**32, 1)), (6, 5, 1, 4, 2**32, 2**32)], + [((6, 5, 1, 4, 1, 1), (1, 2**32)), (6, 5, 1, 4, 1, 2**32)], + [((1, 2**32), (2**32, 1)), (2**32, 2**32)], + [[2, 2, 2], (2,)], + [[], ()], + [[()], ()], + [[(7,)], (7,)], + [[(1, 2), (2,)], (1, 2)], + [[(2,), (1, 2)], (1, 2)], + [[(1, 1)], (1, 1)], + [[(1, 1), (3, 4)], (3, 4)], + [[(6, 7), (5, 6, 1), (7,), (5, 1, 7)], (5, 6, 7)], + [[(5, 6, 1)], (5, 6, 1)], + [[(1, 3), (3, 1)], (3, 3)], + [[(1, 0), (0, 0)], (0, 0)], + [[(0, 1), (0, 0)], (0, 0)], + [[(1, 0), (0, 1)], (0, 0)], + [[(1, 1), (0, 0)], (0, 0)], + [[(1, 1), (1, 0)], (1, 0)], + [[(1, 1), (0, 1)], (0, 1)], + [[(), (0,)], (0,)], + [[(0,), (0, 0)], (0, 0)], + [[(0,), (0, 1)], (0, 0)], + [[(1,), (0, 0)], (0, 0)], + [[(), (0, 0)], (0, 0)], + [[(1, 1), (0,)], (1, 0)], + [[(1,), (0, 1)], (0, 1)], + [[(1,), (1, 0)], (1, 0)], + [[(), (1, 0)], (1, 0)], + [[(), (0, 1)], (0, 1)], + [[(1,), (3,)], (3,)], + [[2, (3, 2)], (3, 2)], + [[(1, 2)] * 32, (1, 2)], + [[(1, 2)] * 100, (1, 2)], + [[(2,)] * 32, (2,)], + ]) + def test_broadcast_shapes_successes(self, input_shapes, target_shape): + assert_equal(sputils.broadcast_shapes(*input_shapes), target_shape) + + # tests public broadcast_shapes failures + @pytest.mark.parametrize("input_shapes", [ + [(3,), (4,)], + [(2, 3), (2,)], + [2, (2, 3)], + [(3,), (3,), (4,)], + [(2, 5), (3, 5)], + [(2, 4), (2, 5)], + [(1, 3, 4), (2, 3, 3)], + [(1, 2), (3, 1), (3, 2), (10, 5)], + [(2,)] * 32 + [(3,)] * 32, + ]) + def test_broadcast_shapes_failures(self, input_shapes): + with assert_raises(ValueError, match="cannot be broadcast"): + sputils.broadcast_shapes(*input_shapes) + + def test_check_shape_overflow(self): + new_shape = sputils.check_shape([(10, -1)], (65535, 131070)) + assert_equal(new_shape, (10, 858967245)) + + def test_matrix(self): + a = [[1, 2, 3]] + b = np.array(a) + + assert isinstance(sputils.matrix(a), np.matrix) + assert isinstance(sputils.matrix(b), np.matrix) + + c = sputils.matrix(b) + c[:, :] = 123 + assert_equal(b, a) + + c = sputils.matrix(b, copy=False) + c[:, :] = 123 + assert_equal(b, [[123, 123, 123]]) + + def test_asmatrix(self): + a = [[1, 2, 3]] + b = np.array(a) + + assert isinstance(sputils.asmatrix(a), np.matrix) + assert isinstance(sputils.asmatrix(b), np.matrix) + + c = sputils.asmatrix(b) + c[:, :] = 123 + assert_equal(b, [[123, 123, 123]]) diff --git a/shared/package-files/7c/7c45c4f4af6cdb6a22556917f76058fa0d34fae5c22be1f18d9859c716002857/test_protocols.py b/shared/package-files/7c/7c45c4f4af6cdb6a22556917f76058fa0d34fae5c22be1f18d9859c716002857/test_protocols.py new file mode 100644 index 0000000000000000000000000000000000000000..55a2bcf72fad9bfae39f03badf0ae768eb305b85 --- /dev/null +++ b/shared/package-files/7c/7c45c4f4af6cdb6a22556917f76058fa0d34fae5c22be1f18d9859c716002857/test_protocols.py @@ -0,0 +1,44 @@ +import pytest +import warnings +import numpy as np + + +@pytest.mark.filterwarnings("error") +def test_getattr_warning(): + # issue gh-14735: make sure we clear only getattr errors, and let warnings + # through + class Wrapper: + def __init__(self, array): + self.array = array + + def __len__(self): + return len(self.array) + + def __getitem__(self, item): + return type(self)(self.array[item]) + + def __getattr__(self, name): + if name.startswith("__array_"): + warnings.warn("object got converted", UserWarning, stacklevel=1) + + return getattr(self.array, name) + + def __repr__(self): + return "".format(self=self) + + array = Wrapper(np.arange(10)) + with pytest.raises(UserWarning, match="object got converted"): + np.asarray(array) + + +def test_array_called(): + class Wrapper: + val = '0' * 100 + def __array__(self, result=None): + return np.array([self.val], dtype=object) + + + wrapped = Wrapper() + arr = np.array(wrapped, dtype=str) + assert arr.dtype == 'U100' + assert arr[0] == Wrapper.val diff --git a/shared/package-files/7c/7c4b4f52f7f19e14a1f61585e8ee7caad717fde3a3bcc02e043c4ec8752bb6fc/xlogy_ops.h b/shared/package-files/7c/7c4b4f52f7f19e14a1f61585e8ee7caad717fde3a3bcc02e043c4ec8752bb6fc/xlogy_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..ca01874bf8e98da0aa9555bef423f950cf15746c --- /dev/null +++ b/shared/package-files/7c/7c4b4f52f7f19e14a1f61585e8ee7caad717fde3a3bcc02e043c4ec8752bb6fc/xlogy_ops.h @@ -0,0 +1,105 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API xlogy_Tensor { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::xlogy") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Tensor") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "xlogy.Tensor(Tensor self, Tensor other) -> Tensor") + static at::Tensor call(const at::Tensor & self, const at::Tensor & other); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & other); +}; + +struct TORCH_API xlogy_Scalar_Self { + using schema = at::Tensor (const at::Scalar &, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::xlogy") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Scalar_Self") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "xlogy.Scalar_Self(Scalar self, Tensor other) -> Tensor") + static at::Tensor call(const at::Scalar & self, const at::Tensor & other); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Scalar & self, const at::Tensor & other); +}; + +struct TORCH_API xlogy_Scalar_Other { + using schema = at::Tensor (const at::Tensor &, const at::Scalar &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::xlogy") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Scalar_Other") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "xlogy.Scalar_Other(Tensor self, Scalar other) -> Tensor") + static at::Tensor call(const at::Tensor & self, const at::Scalar & other); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Scalar & other); +}; + +struct TORCH_API xlogy__Tensor { + using schema = at::Tensor & (at::Tensor &, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::xlogy_") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Tensor") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "xlogy_.Tensor(Tensor(a!) self, Tensor other) -> Tensor(a!)") + static at::Tensor & call(at::Tensor & self, const at::Tensor & other); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, at::Tensor & self, const at::Tensor & other); +}; + +struct TORCH_API xlogy__Scalar_Other { + using schema = at::Tensor & (at::Tensor &, const at::Scalar &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::xlogy_") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Scalar_Other") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "xlogy_.Scalar_Other(Tensor(a!) self, Scalar other) -> Tensor(a!)") + static at::Tensor & call(at::Tensor & self, const at::Scalar & other); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, at::Tensor & self, const at::Scalar & other); +}; + +struct TORCH_API xlogy_OutTensor { + using schema = at::Tensor & (const at::Tensor &, const at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::xlogy") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "OutTensor") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "xlogy.OutTensor(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, const at::Tensor & other, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & other, at::Tensor & out); +}; + +struct TORCH_API xlogy_OutScalar_Self { + using schema = at::Tensor & (const at::Scalar &, const at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::xlogy") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "OutScalar_Self") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "xlogy.OutScalar_Self(Scalar self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Scalar & self, const at::Tensor & other, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Scalar & self, const at::Tensor & other, at::Tensor & out); +}; + +struct TORCH_API xlogy_OutScalar_Other { + using schema = at::Tensor & (const at::Tensor &, const at::Scalar &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::xlogy") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "OutScalar_Other") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "xlogy.OutScalar_Other(Tensor self, Scalar other, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, const at::Scalar & other, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Scalar & other, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/7c/7c4df02bedd90733ec0da15ff44904d5d9c60d18496dc0aa8f2057466f06943e/capnproto.py b/shared/package-files/7c/7c4df02bedd90733ec0da15ff44904d5d9c60d18496dc0aa8f2057466f06943e/capnproto.py new file mode 100644 index 0000000000000000000000000000000000000000..04237f70d6dc8905e9cfa8c127aedf7ecb203b4d --- /dev/null +++ b/shared/package-files/7c/7c4df02bedd90733ec0da15ff44904d5d9c60d18496dc0aa8f2057466f06943e/capnproto.py @@ -0,0 +1,75 @@ +""" + pygments.lexers.capnproto + ~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for the Cap'n Proto schema language. + + :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, default +from pygments.token import Text, Comment, Keyword, Name, Literal, Whitespace + +__all__ = ['CapnProtoLexer'] + + +class CapnProtoLexer(RegexLexer): + """ + For Cap'n Proto source. + + .. versionadded:: 2.2 + """ + name = 'Cap\'n Proto' + url = 'https://capnproto.org' + filenames = ['*.capnp'] + aliases = ['capnp'] + + tokens = { + 'root': [ + (r'#.*?$', Comment.Single), + (r'@[0-9a-zA-Z]*', Name.Decorator), + (r'=', Literal, 'expression'), + (r':', Name.Class, 'type'), + (r'\$', Name.Attribute, 'annotation'), + (r'(struct|enum|interface|union|import|using|const|annotation|' + r'extends|in|of|on|as|with|from|fixed)\b', + Keyword), + (r'[\w.]+', Name), + (r'[^#@=:$\w\s]+', Text), + (r'\s+', Whitespace), + ], + 'type': [ + (r'[^][=;,(){}$]+', Name.Class), + (r'[\[(]', Name.Class, 'parentype'), + default('#pop'), + ], + 'parentype': [ + (r'[^][;()]+', Name.Class), + (r'[\[(]', Name.Class, '#push'), + (r'[])]', Name.Class, '#pop'), + default('#pop'), + ], + 'expression': [ + (r'[^][;,(){}$]+', Literal), + (r'[\[(]', Literal, 'parenexp'), + default('#pop'), + ], + 'parenexp': [ + (r'[^][;()]+', Literal), + (r'[\[(]', Literal, '#push'), + (r'[])]', Literal, '#pop'), + default('#pop'), + ], + 'annotation': [ + (r'[^][;,(){}=:]+', Name.Attribute), + (r'[\[(]', Name.Attribute, 'annexp'), + default('#pop'), + ], + 'annexp': [ + (r'[^][;()]+', Name.Attribute), + (r'[\[(]', Name.Attribute, '#push'), + (r'[])]', Name.Attribute, '#pop'), + default('#pop'), + ], + } diff --git a/shared/package-files/7c/7c4f177fd4ab1ef4d972fff30e982d3865a4dce21610d3e878a73086e3099c3b/formatter.py b/shared/package-files/7c/7c4f177fd4ab1ef4d972fff30e982d3865a4dce21610d3e878a73086e3099c3b/formatter.py new file mode 100644 index 0000000000000000000000000000000000000000..c821318d9b2ba3772eefbc2d0e2a4d838980a783 --- /dev/null +++ b/shared/package-files/7c/7c4f177fd4ab1ef4d972fff30e982d3865a4dce21610d3e878a73086e3099c3b/formatter.py @@ -0,0 +1,185 @@ +from bs4.dammit import EntitySubstitution + +class Formatter(EntitySubstitution): + """Describes a strategy to use when outputting a parse tree to a string. + + Some parts of this strategy come from the distinction between + HTML4, HTML5, and XML. Others are configurable by the user. + + Formatters are passed in as the `formatter` argument to methods + like `PageElement.encode`. Most people won't need to think about + formatters, and most people who need to think about them can pass + in one of these predefined strings as `formatter` rather than + making a new Formatter object: + + For HTML documents: + * 'html' - HTML entity substitution for generic HTML documents. (default) + * 'html5' - HTML entity substitution for HTML5 documents, as + well as some optimizations in the way tags are rendered. + * 'minimal' - Only make the substitutions necessary to guarantee + valid HTML. + * None - Do not perform any substitution. This will be faster + but may result in invalid markup. + + For XML documents: + * 'html' - Entity substitution for XHTML documents. + * 'minimal' - Only make the substitutions necessary to guarantee + valid XML. (default) + * None - Do not perform any substitution. This will be faster + but may result in invalid markup. + """ + # Registries of XML and HTML formatters. + XML_FORMATTERS = {} + HTML_FORMATTERS = {} + + HTML = 'html' + XML = 'xml' + + HTML_DEFAULTS = dict( + cdata_containing_tags=set(["script", "style"]), + ) + + def _default(self, language, value, kwarg): + if value is not None: + return value + if language == self.XML: + return set() + return self.HTML_DEFAULTS[kwarg] + + def __init__( + self, language=None, entity_substitution=None, + void_element_close_prefix='/', cdata_containing_tags=None, + empty_attributes_are_booleans=False, indent=1, + ): + """Constructor. + + :param language: This should be Formatter.XML if you are formatting + XML markup and Formatter.HTML if you are formatting HTML markup. + + :param entity_substitution: A function to call to replace special + characters with XML/HTML entities. For examples, see + bs4.dammit.EntitySubstitution.substitute_html and substitute_xml. + :param void_element_close_prefix: By default, void elements + are represented as (XML rules) rather than + (HTML rules). To get , pass in the empty string. + :param cdata_containing_tags: The list of tags that are defined + as containing CDATA in this dialect. For example, in HTML, +