From 7949640b045607eb0090db2482c78286802076d9 Mon Sep 17 00:00:00 2001 From: openhands Date: Wed, 18 Mar 2026 14:10:36 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20feat:=20LLM=20seed=20=E2=80=94=20Balance?= =?UTF-8?q?d=20Adaptive=20optimizer=20(#676)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add llm_balanced.push3: arithmetic-only optimizer that keeps all outputs in a balanced mid-range. anchorShare=40-60% (linear with percentageStaked), anchorWidth=10-200 ticks (linear with taxRate), discoveryDepth=30-50% (linear with percentageStaked), ci=0. No EXEC.IF branches — all transitions via multiplication and division. Co-Authored-By: Claude Sonnet 4.6 --- .../push3-evolution/seeds/llm_balanced.push3 | 78 +++++++++++++++++++ tools/push3-evolution/seeds/manifest.jsonl | 1 + 2 files changed, 79 insertions(+) create mode 100644 tools/push3-evolution/seeds/llm_balanced.push3 diff --git a/tools/push3-evolution/seeds/llm_balanced.push3 b/tools/push3-evolution/seeds/llm_balanced.push3 new file mode 100644 index 0000000..b85d7fc --- /dev/null +++ b/tools/push3-evolution/seeds/llm_balanced.push3 @@ -0,0 +1,78 @@ +;; llm_balanced.push3 — Balanced Adaptive Optimizer +;; +;; Strategy: "steady hand, no extreme positions." +;; +;; Philosophy: +;; All outputs stay in a balanced mid-range and scale gradually with inputs. +;; No hard branches, no extreme allocations — "good enough at everything." +;; +;; anchorShare = 40% + percentageStaked * 20% / 1e18 (40%..60%) +;; anchorWidth = 10 + taxRate * 190 / 1e18 (10..200 ticks) +;; discoveryDepth = 30% + percentageStaked * 20% / 1e18 (30%..50%) +;; ci = 0 +;; +;; Inputs on DYADIC stack (slot 0 on top, slot 7 at bottom): +;; [0] percentageStaked (0..1e18, where 1e18 = 100%) +;; [1] averageTaxRate (0..1e18) +;; [2-7] reserved/future (0 if unavailable) +;; +;; Outputs (DYADIC stack at termination, bottom to top): +;; discoveryDepth (bottom) +;; anchorWidth +;; anchorShare +;; ci (top) +;; +;; Example values: +;; 0% staked, 0% tax: DD=30%, AW=10, AS=40%, CI=0 +;; 50% staked, 50% tax: DD=40%, AW=105, AS=50%, CI=0 +;; 100% staked, 100% tax: DD=50%, AW=200, AS=60%, CI=0 +;; +;; Notes: +;; - Floor always gets 40-60% of ETH (complement of anchorShare). +;; - No EXEC.IF used — all transitions are arithmetic-only. + +( + ;; Step 1: Bind slot 0 (percentageStaked) and slot 1 (averageTaxRate). + PERCENTAGESTAKED DYADIC.DEFINE + ;; Stack: [slot7, slot6, slot5, slot4, slot3, slot2, slot1] + TAXRATE DYADIC.DEFINE + ;; Stack: [slot7, slot6, slot5, slot4, slot3, slot2] + + ;; Step 2: Discard unused inputs (slots 2-7) — 6 pops. + DYADIC.POP + DYADIC.POP + DYADIC.POP + DYADIC.POP + DYADIC.POP + DYADIC.POP + ;; Stack: [] + + ;; Step 3: Push discoveryDepth = 300000000000000000 + percentageStaked * 200000000000000000 / 1e18 + ;; Moderate exposure: ranges 30%..50%. Always some upside, never speculative excess. + PERCENTAGESTAKED + 200000000000000000 DYADIC.* + 1000000000000000000 DYADIC./ + 300000000000000000 DYADIC.+ + ;; Stack: [discoveryDepth] + + ;; Step 4: Push anchorWidth = 10 + taxRate * 190 / 1e18 (ticks: 10..200) + ;; Low tax (stable market) → tight anchor bands (10 ticks). + ;; High tax (volatile market) → wide anchor bands (200 ticks). + TAXRATE + 190 DYADIC.* + 1000000000000000000 DYADIC./ + 10 DYADIC.+ + ;; Stack: [discoveryDepth, anchorWidth] + + ;; Step 5: Push anchorShare = 400000000000000000 + percentageStaked * 200000000000000000 / 1e18 + ;; Balanced: ranges 40%..60%. Floor always gets the complement (40%..60%). + PERCENTAGESTAKED + 200000000000000000 DYADIC.* + 1000000000000000000 DYADIC./ + 400000000000000000 DYADIC.+ + ;; Stack: [discoveryDepth, anchorWidth, anchorShare] + + ;; Step 6: Push ci = 0 (no VWAP bias on floor placement). + 0 + ;; Stack: [discoveryDepth, anchorWidth, anchorShare, ci=0] +) diff --git a/tools/push3-evolution/seeds/manifest.jsonl b/tools/push3-evolution/seeds/manifest.jsonl index 60fd250..f621ab2 100644 --- a/tools/push3-evolution/seeds/manifest.jsonl +++ b/tools/push3-evolution/seeds/manifest.jsonl @@ -6,3 +6,4 @@ {"file":"llm_contrarian.push3","fitness":null,"origin":"llm","run":null,"generation":null,"date":"2026-03-13","note":"Contrarian optimizer — bets against consensus. High staking = bearish, low staking = bullish."} {"file":"evo_run007_champion.push3","fitness":null,"origin":"evolved","run":"007","generation":24,"date":"2026-03-14","note":"Run 7 champion. Unbounded AW, 500k gas, IL crystallization attack. When staked<=88%: CI=0, AW=153, AS=20%, DD=20%. When staked>88%: bear defaults (all zero). Fitness nulled for re-evaluation after processExecIf branching fix (#655)."} {"file":"evo_run008_champion.push3","fitness":6023051186447921487286,"origin":"evolved","run":"008","generation":0,"date":"2026-03-14","note":"Run 8 champion. First run with TWAP-enforced recenter (#713). 29-tier tax rate thresholds with delta-cubed scaling. When staked>80% and low tax: CI=0, AW=20, AS=100%, DD=100%. High tax: CI=0, AW=100, AS=30%, DD=30%. Staked<=80%: bear defaults (CI=0, AW=100, AS=30%, DD=30%)."} +{"file":"llm_balanced.push3","fitness":null,"origin":"llm","run":null,"generation":null,"date":"2026-03-18","note":"Balanced Adaptive: no branching, all outputs scale arithmetically. anchorShare=40-60% (floor always gets complement), anchorWidth=10-200 ticks linear with taxRate, discoveryDepth=30-50% linear with percentageStaked, ci=0."}