Deliberation v3 — From LLM Heuristic to Physics-Aware Optimization Engine
10 Problems. 5 Phases. DSP Coupling Model.
True Optimization Engine — Constraint-aware Multi-Agent DSP Optimization
| # | Sev | Problem | Solution | Impl |
|---|---|---|---|---|
| 01 | 🔴 | Weighted median ≠ consensus | Constraint solver + Pareto front | ⭐⭐⭐ |
| 02 | 🔴 | No parameter interdependency modeling | DSP coupling model | ⭐⭐⭐ |
| 03 | 🟡 | Dangerous JSON parse | Robust extraction + structured output | ⭐ |
| 04 | 🟡 | Weak validation | IEEE 754 guard + constraint check | ⭐ |
| 05 | 🟡 | Confidence weighting is meaningless | Calibrated weight → track record | ⭐⭐ |
| 06 | 🟡 | Deliberation score too flat | Multi-dimensional agreement tensor | ⭐⭐ |
| 07 | 🟠 | Weak agent independence | Diverse context injection | ⭐⭐ |
| 08 | 🟡 | Too few parallel agents | Dynamic ensemble sizing | ⭐ |
| 09 | 🟡 | High LLM cost | Tiered inference + caching | ⭐⭐ |
| 10 | 🟡 | Weak fallback | Circuit breaker pattern | ⭐⭐ |
- —3-stage fallback: strip markdown fences → direct parse → greedy {…} block extraction
- —After float conversion, always check math.isnan / math.isinf — fall back to default on failure
- —Add explicit JSON-mode instruction to Anthropic calls (OpenAI json_object / Google application/json already handled)
- —Define 4 parameter groups: compressor_behavior / saturation_budget / stereo_coherence / loudness_chain
- —Assign lambda constraints per group; auto-repair violations with dedicated repair functions
- —Call validate_coupling() immediately after _weighted_median_merge() — guarantees physically impossible parameter combinations never reach the DSP engine
- —Add coupling_violations to return value — every automated correction is fully traceable
- —Same prompt + same analysis → correlated reasoning: three agents converge to the same answer
- —GRAMMATICA: show only band_ratios / detected_problems; block artistic interpretation
- —LOGICA: show only physical_sections / time_series; hide spectral detail
- —RHETORICA: show only track_identity / whole_track_metrics; hide detected_problems to remove conservative bias
- —Group-level scores (by_group): agreement rate per DSP coupling group
- —tension_map: identify parameters where spread / param_range > 0.4; record per-agent positions
- —Overall score: average of group scores — from a flat number to a multi-dimensional tensor
- —Per-provider circuit breakers (closed / open / half-open): 3 consecutive failures → 60s blackout
- —Tier selection: problems=0 AND LUFS delta < 3 → fast models; problems ≥ 3 → deep models (5+ agents)
- —Structural control of both reliability and inference cost
The current _weighted_median_merge() treats each parameter as an independent scalar. But DSP parameters have physical coupling relationships — comp_threshold ↔ comp_ratio → gain reduction amount, tape_saturation ↔ parallel_wet → total saturation, stereo_low_mono ↔ stereo_width → phase coherence. Ignoring this produces parameter sets that are physically impossible to realize.
- comp_threshold_db
- comp_ratio
- comp_attack_sec
- comp_release_sec
- Estimated gain reduction ≤ 12dB
- Attack time < Release time
- Fast attack (< 3ms) + high ratio (> 4.0) forbidden
Raise comp_threshold_db to cap GR; force attack < release
- transformer_saturation×mix
- triode_drive×mix
- tape_saturation×mix
- parallel_wet
- Total effective saturation (sum of drive×mix) ≤ 1.5
Proportionally scale down mix parameters to stay within budget
- stereo_low_mono
- stereo_high_wide
- stereo_width
- ms_side_high_gain_db
- If stereo_width > 1.2, stereo_low_mono must be > 0.7 (club mono safety)
- ms_side_high_gain_db > 2.0 AND stereo_high_wide > 1.4 forbidden
Clamp high-risk stereo combinations to prevent phase cancellation
- input_gain_db
- comp_threshold_db
- limiter_ceil_db
- input_gain + estimated compression push ≤ 18dB (headroom before hard limiter)
Reduce input_gain_db to prevent limiter clip
Same prompt + same analysis data = correlated reasoning. Three agents converge to the same answer before deliberation begins. The fix: control what each agent sees and what it cannot see.
- whole_track_metrics
- detected_problems
- band_ratios
Physical safety only. Focus: band energy ratios, True Peak, LUFS delta, harshness risk, low-frequency mono correlation. Artistic interpretation strictly forbidden.
- physical_sections
- time_series_circuit_envelopes
- formplan.macro_form
Structural coherence only. Focus: section-to-section LUFS continuity, LRA preservation, contradiction between sections, transition smoothness. Extreme EQ proposals forbidden.
- track_identity
- whole_track_metrics
- time_series_circuit_envelopes
Perceptual impact only. Focus: transient sharpness, crest factor, spatial immersion, warmth potential, genre-appropriate aesthetics. detected_problems hidden to eliminate conservative bias.
| Change | Conflicts? | Reason |
|---|---|---|
| New file dsp_constraints.py | No | New file — no existing file modified |
| coupling validation after _weighted_median_merge() | No | Merge logic unchanged — post-processing only |
| Per-agent prompt branching | No | system_prompt content is not frozen |
| Robust JSON parse | No | Internal implementation improvement |
| Circuit breaker layer | No | New infrastructure layer |
When Phase 2 lands, TRIVIUM undergoes a qualitative shift from "LLM heuristic" to "Physics-aware AI mastering".
No other AI mastering service has done this. LANDR, iZotope Ozone — they are all transformers: functions that map input to output. None of them have a consensus engine that pre-eliminates physically impossible parameter combinations via a constraint solver. That is the structural discontinuity point.