Compare commits

...
3 Commits
Author SHA1 Message Date
dela 0ba01fe5e2 fix: align lint role-before-use check with siblings
supertensor lint.py now rejects role= used before \stsetrole, matching
superfig and superderive lint behavior. Previously this was only caught
at TeX compile time by \stcheckrole.
2026-08-22 10:13:49 +08:00
dela 7210f890ca fix: \stsignature derives node name from anchor (#2-sig)
Align with superfig/superderive convention. Two signatures in one
figure can now coexist without colliding on the hardcoded name.
2026-08-21 14:56:52 +08:00
dela 8ada8e57c5 docs: route architecture, rewrites, and paper notes away
Send block diagrams to superfig, rewrite figures to superderive,
and full paper notes to superpaper.
2026-08-17 10:23:11 +08:00
3 changed files with 10 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
--- ---
name: supertensor name: supertensor
description: Create or refine clean, shape-aware figures for tensor/matrix/vector formulas or tensor code — matrix-block diagrams, entry heatmaps, row/column shard stripes, stacked 3D/4D tensors, attention, tensor/expert parallelism, broadcasting, reductions, contractions, gather/scatter and routing. Use whenever tensor shapes or axis meanings must be visually aligned with the computation. Not for plotting numeric data (loss curves, benchmark bars, scatter plots), architecture block diagrams without shapes, or generic flowcharts. description: Create or refine clean, shape-aware figures for tensor/matrix/vector formulas or tensor code — matrix-block diagrams, entry heatmaps, row/column shard stripes, stacked 3D/4D tensors, attention, tensor/expert parallelism, broadcasting, reductions, contractions, gather/scatter and routing. Use whenever tensor shapes or axis meanings must be visually aligned with the computation, or the user runs $supertensor. Not for plotting numeric data (loss curves, benchmark bars, scatter plots), architecture block diagrams without shapes (use superfig), stepwise rewrite figures (use superderive), or full paper notes (use superpaper).
--- ---
# supertensor # supertensor
+1 -1
View File
@@ -838,6 +838,6 @@
% ------------------------------------------------------------- signature ---- % ------------------------------------------------------------- signature ----
% Optional centered subject line, outside the meaning box, low contrast. % Optional centered subject line, outside the meaning box, low contrast.
\newcommand{\stsignature}[2]{% \newcommand{\stsignature}[2]{%
\node[below=2.2mm of #2, font=\scriptsize, text=black!45] (st-signature) {#1};} \node[below=2.2mm of #2, font=\scriptsize, text=black!45] (#2-sig) {#1};}
\endinput \endinput
+8
View File
@@ -68,6 +68,14 @@ def lint(path: Path) -> list[str]:
dimensions = check_unique(source, DIM_RE, "axis", errors) dimensions = check_unique(source, DIM_RE, "axis", errors)
roles = check_unique(source, ROLE_RE, "role", errors) roles = check_unique(source, ROLE_RE, "role", errors)
for match in ROLE_KEY_RE.finditer(source):
role = match.group(1)
if role not in roles:
errors.append(
f"line {line_of(source, match.start())}: role {role!r} is used "
f"before \\stsetrole"
)
formula_positions = [m.start() for m in re.finditer(r"\\sttopformula\b", source)] formula_positions = [m.start() for m in re.finditer(r"\\sttopformula\b", source)]
row_ends = [m.start() for m in re.finditer(r"\\strowend\b", source)] row_ends = [m.start() for m in re.finditer(r"\\strowend\b", source)]
if not formula_positions and "allow-missing-formula" not in allowed: if not formula_positions and "allow-missing-formula" not in allowed: