mirror of
https://github.com/juanjiant-bit/JIANT.git
synced 2026-12-06 21:04:32 +01:00
- voice.c voice_cap: VOICES_2CORE 12 while the second core takes parts (fx.c mc_two: CORES 2, not REC at
power-on, not given up); one core 8, LOAD ECO 6; a track still NVOICE 8 (no RAM). After Skiff by illuminus5.
cpu_vg: mix/v12 (both cores 3924 instr/sample), mix/v12.c0 (core 0 1949), mix/v12.one (one core, 8 voices 3241);
regress.c chk_budget_2core; the dual-core equivalence test at one budget (mc_host_v12).
- Sound types (PT_BASS..PT_FX) on all factory presets in preset_t.mono bits 1..4 (no format change); PRESETS LIST
ALL / FAV / BASS LEAD PAD KEYS PLUCK BELL VOX DRUM FX across engines, saved in favorites.factory[15][18];
gen.c keeps PT_BASS sounds off the other roles (was a name match). After Skiff by illuminus5.
- MIDI LEARN ported from Felucca 1.5 (midi_learn.c): 10 CCs, 3 bytes each in DIGITAL's favourites row, reserved
CCs and the standard map refused, any channel, USB and TRS; MENU > MIDI tab (MIDI OUT, LEARN, LEARN CLEAR);
state in the pool.
- fm6_vbank.c: 0xE7000 holding foreign data (Skiff's pattern bank) reads as no bank and is never erased at
power-on; only a bank the user sends replaces it. fm6bank_test foreign_test.
- Copyright (C) 2026 Juan Ignacio Antonucci (Juan Jiant) in JIANT's files ("Portions" in mostly-Felucca ones),
README / LICENSING.md / MENU > ABOUT credits (Felucca, Skiff).
- Docs: MANUAL.md / MANUAL.es.md, README v0.9.12 draft, EDITOR_PROTOCOL.md (tabs), cheat sheets, nav map.
Flash 576192 -> 577712 B (+1520), .data+.bss unchanged, pool +8 B (spare 10528 B).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
71 lines
3.2 KiB
Python
71 lines
3.2 KiB
Python
#!/usr/bin/env python3
|
|
# SPDX-License-Identifier: GPL-3.0-only
|
|
# Copyright (C) 2026 Juan Ignacio Antonucci (Juan Jiant)
|
|
"""(JIANT 0.6.83) the audio path's CPU under valgrind (tests/cpu_vg.c): instructions per sample, section by section,
|
|
against tests/cpu_baseline_vg.txt (peak/*: instructions in the worst single block of the section's rounds). callgrind's
|
|
counts are exact (the same on every run of the same build), so the
|
|
tolerance is small: a section more than TOL over its baseline fails; one far under only notes it.
|
|
python3 tests/cpu_vg.py BINARY [BASELINE] (run_tests.sh, when valgrind is there)
|
|
BUDGET_UPDATE=1 rewrites the baseline (on purpose: look at the diff)."""
|
|
import glob, os, re, subprocess, sys, tempfile
|
|
|
|
TOL = 0.08 # +8 %: a real change, never noise
|
|
SAMPLES = 256 * 32 # cpu_vg.c NB blocks of CTL samples
|
|
|
|
binary = sys.argv[1]
|
|
base_path = sys.argv[2] if len(sys.argv) > 2 else "tests/cpu_baseline_vg.txt"
|
|
out = tempfile.mkdtemp(prefix="cpu_vg_")
|
|
prefix = os.path.join(out, "cg.out")
|
|
r = subprocess.run(["valgrind", "--tool=callgrind", "--collect-atstart=yes", "--instr-atstart=no",
|
|
f"--callgrind-out-file={prefix}", binary], stdout=subprocess.DEVNULL, stderr=subprocess.PIPE, text=True)
|
|
if r.returncode:
|
|
print("cpu_vg: the run failed\n" + r.stderr[-2000:])
|
|
sys.exit(1)
|
|
now = {}
|
|
for f in glob.glob(prefix + "*"):
|
|
txt = open(f, errors="replace").read()
|
|
m = re.search(r"^desc: Trigger: Client Request: (\S+)", txt, re.M)
|
|
t = re.search(r"^(?:totals|summary): (\d+)", txt, re.M)
|
|
if m and t and m.group(1).startswith("peak/"): # (0.9.0) one block each: the worst of its rounds (.rNN)
|
|
k = re.sub(r"\.r\d+$", "", m.group(1))
|
|
now[k] = max(now.get(k, 0), int(t.group(1)))
|
|
elif m and t:
|
|
now[m.group(1)] = int(t.group(1)) / SAMPLES
|
|
if not now:
|
|
print("cpu_vg: no sections measured")
|
|
sys.exit(1)
|
|
|
|
base = {}
|
|
if os.path.exists(base_path):
|
|
for line in open(base_path):
|
|
p = line.split()
|
|
if len(p) == 2 and not line.startswith("#"):
|
|
base[p[0]] = float(p[1])
|
|
|
|
if os.environ.get("BUDGET_UPDATE"):
|
|
with open(base_path, "w") as fo:
|
|
fo.write("# JIANT audio path CPU under valgrind (tests/cpu_vg.c, tests/cpu_vg.py): instructions per sample,\n"
|
|
"# x86-64 gcc -O2. Exact counts; the check allows +8 %. Rewritten by BUDGET_UPDATE=1.\n")
|
|
for k in sorted(now):
|
|
fo.write(f"{k} {now[k]:.0f}\n")
|
|
print(f"cpu_vg: {len(now)} sections written to {base_path}")
|
|
sys.exit(0)
|
|
|
|
bad = 0
|
|
for k in sorted(now):
|
|
b = base.get(k)
|
|
if b is None:
|
|
print(f"cpu_vg: {k:12s} {now[k]:8.0f} instructions / sample no baseline (BUDGET_UPDATE=1 adds it)")
|
|
continue
|
|
d = now[k] / b - 1
|
|
state = "ok"
|
|
if d > TOL:
|
|
state = f"OVER BUDGET (+{d * 100:.1f} %, limit +{TOL * 100:.0f} %)"
|
|
bad += 1
|
|
elif d < -0.25:
|
|
state = f"ok, {-d * 100:.0f} % under (BUDGET_UPDATE=1 to keep it)"
|
|
unit = "instructions, the worst block" if k.startswith("peak/") else "instructions / sample"
|
|
print(f"cpu_vg: {k:12s} {now[k]:8.0f} {unit} (baseline {b:.0f}, {d * 100:+.1f} %) {state}")
|
|
print("cpu_vg: " + ("FAILED" if bad else "all within budget"))
|
|
sys.exit(1 if bad else 0)
|