Tasks/Transport & Logistics/Powertrain Control

Causal Gear-Shift Strategy Against the Dynamic-Programming Bound

Choose the gear every second to burn less fuel

gearshift_strategy_wltc Transport & Logistics Powertrain Control
instruction.mdthis is what the agent is given

Drive a fixed speed trace and choose, once per second, which gear is engaged. Burn as little fuel as possible.

The engine is real: a dynamometer-measured naturally-aspirated 2.0 L spark-ignition unit, 137 measured operating points plus its full-load and motoring sweeps, shipped as engine.json. The gear decides where that engine sits on its own map, so it decides the fuel. Nothing else about the drive is yours to change — the speed trace is given and must be followed exactly.

Your policy is causal. It is called once per second, in order, and is never shown the future. It does see the demand now — speed, acceleration and wheel power over the current second — because that is the driver's foot on the pedal, not knowledge of what comes next.

Your score is how far above the dynamic-programming bound you land, in percent. The bound solves the same problem under the same rules with the whole trace known in advance, so 0 % is unreachable by construction. For scale: the template shipped with this task is about 6.0 % above it, and closing most of that distance is known to be possible.

Hard Constraints

The evaluator enforces every rule itself and hands you legal_gears at each step — the gears you may select for the next second. Returning anything else simply leaves the current gear engaged; there is no penalty term, and nothing to trade fuel against.

  • Hold time. A gear must be held at least 2 s before the next discretionary shift.
  • Skip limit. One discretionary shift may cross at most 2 gears.
  • Shift budget. The whole cycle allows shift_budget discretionary shifts — about 70 % of what the regulatory shift algorithm uses on the same trace. This is the scarce resource, and it is why the problem is not a sequence of independent one-second decisions.
  • Forced shifts are exempt from all three. A shift is forced when the gear in use simply cannot be held: the demand has risen above the measured full-load curve, or the crank has left the mapped speed range. A driver in that situation has no choice.
  • Neutral is available only when the trace asks for no tractive force, and clutch action below 5 km/h is free and uncounted.

What You Have

  • powertrain.py — the trusted model: road load, gearbox, clutch slip on launch, the measured fuel map, deceleration fuel cut-off. Bit-identical to the model the verifier runs. Nothing is hidden.
  • rules.py — the driveability rules, in one place, exactly as enforced.
  • evaluator.py — the trusted evaluator, also identical to the verifier's.
  • dp.py — the exact dynamic program that defines the bound. You can run it.
  • instances_visible.json — ten instances with their frozen dp_fuel_g, the regulatory gear trace and the DP's own gear trace, so you can measure your gap locally and see what the bound actually does.
  • engine.json — the measured map.
  • methods/main/solver.py — the template described below. Edit it, or replace it wholesale.
  • selfcheck.py — runs your solver over the visible instances and prints the same numbers the verifier will compute.

The template prices every legal gear against the map each second and takes the cheapest, with a hysteresis threshold and a schedule that paces the shift budget. It is a competent answer rather than a straw man: a fixed two-threshold shift map, the same policy stripped of hysteresis and pacing, and the regulatory shift algorithm forced inside this task's shift budget all measure worse than it. Beating the template is the starting point, not the finish line.

What You Submit

methods/main/solver.py, exposing

def make_policy(instance: dict) -> callable:
    """-> policy(step: dict) -> int, the gear for [t, t+1)"""

make_policy is handed the instance before the drive starts and may compute anything it likes — it is charged to the same per-instance time budget as the drive itself. instance carries vehicle (test mass, payload, coastdown coefficients, per-gear ndv in rpm per km/h, idle speed, and a road gradient for every second), engine (the measured map), disp_scale (a displacement multiplier on that map), shift_budget and n_steps.

policy(step) then receives t, v_kmh, a_mps2, p_wheel_kw, the gear currently engaged, how long it has been held, how much of the shift budget is left, legal_gears, and whether a change now would count against the budget.

How It Is Judged

The verifier runs your policy on hidden instances it has never shown you. It holds the speed trace and streams it to your process one second at a time, so causality is structural rather than a promise: there is no future to read.

Per instance the score is 100 * (F - F_DP) / F_DP, where F_DP is that instance's dynamic-programming optimum; the reported score is the mean over the hidden instances, lower being better. The shipped template establishes the floor of what counts as progress, and the bound itself — 0 % — is the ceiling no causal policy can reach. How your number maps to a score is not yours to see, and you do not need it: on this metric lower is unambiguously better everywhere.

The hidden instances also differ from the visible ones in every way the generator can vary: they use a disjoint pool of vehicle bodies, and they stretch the ranges of displacement, payload and road gradient. Constants fitted to the visible cars will not transfer.

Metric

mean % by which fuel exceeds the DP bound, hidden instances · lower is better

Per instance 100*(F - F_DP)/F_DP against that instance's dynamic-programming optimum; mean over 10 sealed instances.

anchorvisible setheld-outreward
Bshipped template4.9293 %6.0019 %0.00
Rhuman reference method3.4222 %4.6189 %0.30
Sbest expert round observed0.9019 %1.7220 %0.60
Udynamic-programming bound0 %0 %1.00
normalisation
m >= B0
B > m >= R0.3 * (B - m) / (B - R)
R > m >= S0.3 + 0.3 * (R - m) / (R - S)
S > m > U0.6 + 0.4 * (S - m) / (S - U)
m <= U1

m = this run's held-out metric  ·  B = shipped template  ·  R = human reference method  ·  S = best expert round observed  ·  U = dynamic-programming bound

Linear in the percentage, not in log. Instances are averaged first, then the mean is mapped once. An unusable instance books 100 %.

Rollouts

366 minwall clock
$124.94spend
199.1Mtokens
92versions, 70 kept
1 2 3 4 5 $0 $30 $60 $90 $120 cumulative spend on the run visible-set mean % over DP bound, lower is better best expert round observed · visible · 0.9019 % v0 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20 v21 v22 v23 v24 v25 v26 v27 v28 v29 v30 v31 v32 v33 v34 v35 v36 v37 v38 v39 v40 v41 v42 v43 v44 v45 v46 v47 v48 v49 v50 v51 v52 v53 v54 v55 v56 v57 v58 v59 v60 v61 v62 v63 v64 v65 v66 v67 v68 v69 v70 v71 v72 v73 v74 v75 v76 v77 v78 v79 v80 v81 v82 v83 v84 v85 v86 v87 v88 v89 v90 v91
keptrevertedno scoreturning point
  1. v0Shipped template: cheapest legal gear each second, fixed hysteresis, timed pacing4.92931 min · $0.22
  2. v1Saving threshold 0.002 -> 0.020 g/s, pacing made exactly uniform4.19684 min · $0.76
  3. v2High-hysteresis plateau at 0.085 g/s, pacing lead 1.063.16326 min · $1.00
  4. v3Leaky cumulative fuel regret per alternative, plus a one-step causal forecastStop asking whether this second is cheaper and accumulate per-gear fuel regret, so a shift needs sustained evidence.2.659711 min · $1.76
  5. v4Direction-aware regret prices; pacing lead 1.80 with a decaying reservePrice the directions apart: an upshift is cheap evidence, a paid downshift must persist. Largest single gain of the run.1.427420 min · $3.42
  6. v5Forecast weight 0.075; no preemptive shift when the gear is predicted infeasible1.401526 min · $5.02
  7. v6Direction-specific evidence memory: up 0.50, paid down 0.80, neutral 0.001.383232 min · $6.51
  8. v7Forecast extended to two steps under constant-acceleration persistence1.356733 min · $7.00
  9. v8Pacing lead 1.80 -> 3.00, inside a broad 2.5-5.0 plateau1.291734 min · $7.49
  10. v9Upshift regret threshold normalized by disp_scale^21.268438 min · $8.74
  11. v10Linear disp_scale normalization on the paid-downshift regret1.268442 min · $10.12
  12. v11Normalized upshift coefficient 0.050 -> 0.0451.219143 min · $10.78
  13. v12Terminal DFSO: buy one last fuel-cut second when the budget pace allows1.103957 min · $13.08
  14. v13DFSO rule generalized to any zero-fuel lower gear under non-tractive demand1.072960 min · $13.57
  15. v14Late shadow price: double the upshift threshold when budget use runs ahead1.026976 min · $15.82
  16. v15Normalized paid-downshift regret 0.50 -> 0.40, centre of the plateau1.021876 min · $16.17
  17. v16Free and forced landings priced with 0.20 of the predicted next-second fuel1.010692 min · $19.13
  18. v17Upshift threshold discounted 8% for a legal two-gear skip1.0079100 min · $21.17
  19. v18Symmetric shadow price: halve the upshift threshold when budget use trails0.989110 min · $23.54
  20. v19On the final sample, take the instantaneous minimum over legal gears0.9888116 min · $25.88
  21. v20Exact two-step tail solve for the penultimate decision0.9843117 min · $26.43
  22. v21Budget-pressure trigger moved from progress 0.75/0.06 to 0.60/0.050.9679123 min · $28.96
  23. v22Exact fuel ties in free and forced choices broken toward the tallest gearA forced deceleration landing in the lowest zero-fuel gear throws away the free forced downshifts that would follow.0.9149130 min · $31.20
  24. v23Tallest-tie landing confined to genuinely forced changes0.9149130 min · $31.33
  25. v24Land one ratio below the tallest tie during a forced change0.994135 min · $32.12
  26. v25Neutral evidence price cut 24% only when budget use trails progress0.9021140 min · $33.02
  27. v26Blend the previous acceleration 50/50 into forced-landing demand0.91144 min · $34.06
  28. v27Slack-gated certain-DFSO regret factor 2.0 -> 0.50.9021148 min · $35.08
  29. v28Shared 0.08 spare-budget margin split into upshift, neutral and DFSO0.9021151 min · $35.91
  30. v29Neutral spare-budget margin 0.08 -> 0.040.8944158 min · $37.83
  31. v30Efficient-upshift spare margin 0.08 -> 0.0550.8851160 min · $38.64
  32. v31Late over-consumption upshift multiplier 2.0 -> 2.50.8753165 min · $40.56
  33. v32Zero-valued hook for the option value lost when a forced change picks neutral0.8753176 min · $44.25
  34. v33Forced neutral priced at 0.05 g against a geared landing0.8728178 min · $45.51
  35. v34Full one-step state propagation replaces the direct forecast comparison0.9042180 min · $46.04
  36. v35State-aware continuation blended 25% with the direct forecast0.8649180 min · $46.87
  37. v36Initial pacing lead 3 -> 4, start of the unrestricted plateau0.8722187 min · $50.02
  38. v37Forced-neutral price rescaled as 0.045*disp_scale^20.8737188 min · $50.41
  39. v38Free and forced one-step consequence weight 0.20 -> 0.500.8635193 min · $52.65
  40. v39Acceleration persistence parameterized; sweep reconfirmed 1.0, then removed0.8635193 min · $53.05
  41. v40Two-gear upshift discount widened from 8% to 50%0.8593198 min · $55.30
  42. v41Separate paid two-gear downshift discount, held at 1.0 after broad tests0.8593198 min · $55.71
  43. v42Three-second lookahead when a lower gear and the current one tie at zero fuel0.8569203 min · $56.81
  44. v43Third-second DFSO forecast gated on deceleration not relaxing0.8569206 min · $57.55
  45. v44Minimum braking-strengthening delta exposed as a zero-valued parameter0.8569209 min · $57.98
  46. v45Third-second DFSO runway requires acceleration 0.05 m/s2 more negative0.8569211 min · $58.48
  47. v46Late upshift pressure becomes a linear ramp to 2.5 at 5% overuse0.9235218 min · $59.88
  48. v47Previous-acceleration blend for next demand; every positive value lostidentical to v45219 min · $60.38
  49. v48If the top-ranked candidate is unaffordable, consider the next-ranked one0.8474221 min · $60.76
  50. v49Evidence surcharge for candidates below raw rank one, default 1.00.8474223 min · $61.54
  51. v50Fallback evidence factor set to 1.10 as an ambiguity hedge0.8447228 min · $62.91
  52. v51Action thresholds tabulated; zero-valued rank-price exponent added0.8447229 min · $63.28
  53. v52Rank-price exponent 0.25: rank raw regret partly by its opportunity price0.8419234 min · $65.03
  54. v53Fallback-rank surcharge removed, 1.10 -> 1.000.8393238 min · $66.91
  55. v54Neutral evidence price 0.25 -> 0.24 g0.8354248 min · $71.06
  56. v55Late linear release of the DFSO cushion parameterized, off by default0.8354251 min · $72.56
  57. v56Release 80% of the DFSO cushion over the final 10% of the trace0.834259 min · $76.70
  58. v57Late release for neutral's cushion; the whole sweep was bit-identicalbit-identical to v56260 min · $77.10
  59. v58Late release for the upshift spare margin parameterized, off by default0.834261 min · $77.60
  60. v59Upshift-margin release 20% over the final 10%, 0.055 -> 0.0440.8309263 min · $78.98
  61. v60Zero-weight pedal-release scenario added to forced-landing lookahead0.8309264 min · $79.40
  62. v61Blend 10% pedal-release demand into the forced landing's consequence0.8306265 min · $80.71
  63. v62Late budget-pressure deadband cut from 5% to 1% of the shift budget0.7803273 min · $83.22
  64. v63Slack-gated neutral evidence memory exposed at zero0.7803277 min · $83.89
  65. v64Past-only repeated-demand motif forecast hook, zero weight0.7803284 min · $85.55
  66. v65Accelerator-release upshift-inhibit hook at identity factor0.7803286 min · $86.28
  67. v66Pedal-release inhibit confined to the late budget-pressure regime0.7803288 min · $87.25
  68. v67Zero-weight regret accrual during the mandatory post-shift hold0.7803289 min · $87.85
  69. v68Fixed-shift-count deadband for the late pressure trigger, off0.7803291 min · $88.45
  70. v69Zero-weight power-reapplication scenario for forced landings0.7803293 min · $89.36
  71. v70Dominance guard: never pay for a zero-fuel shift before a certain forced one0.7803298 min · $91.73
  72. v71Separate price for a fuel-cut downshift one second before a forced shift0.7803300 min · $92.38
  73. v72Final-phase price hook for pre-forced fuel-cut shifts, held at 0.50.7803301 min · $92.92
  74. v73Displacement normalization for the final-phase pre-forced price, at zero0.7803304 min · $94.52
  75. v74Full late DFSO release, but 2.5 evidence for pre-forced shifts in the last 3%0.7773307 min · $96.12
  76. v75Load-driven downshift price split from the braking price0.7773308 min · $96.77
  77. v76Tractive downshift price 0.40 -> 0.35 g, braking untouched0.7773310 min · $98.19
  78. v77Separate evidence memory for tractive downshifts, at 0.800.7773311 min · $98.71
  79. v78Separate factor for direct two-gear tractive downshifts, at 1.00.7773312 min · $99.62
  80. v79Displacement exponent for the tractive downshift price, at linear0.7773312 min · $100.53
  81. v80Slack-gated neutral price factor 0.76 -> 0.73, base price unchanged0.7761326 min · $104.61
  82. v81Causal trend gate for the pedal-release scenario, cutoff inactive0.7761329 min · $106.03
  83. v82Continuation weight after a forced braking landing split out, at 0.500.7761330 min · $106.99
  84. v83Zero-valued depth price for geared forced landings under braking0.7761333 min · $108.89
  85. v84Zero-valued upshift price above a normalized full-load fraction0.7761336 min · $110.81
  86. v85Load-headroom price split between two-gear skips and one-gear upshifts0.7761340 min · $114.04
  87. v86Complementary skip weight added, isolating the single-step-only price0.7761341 min · $114.81
  88. v87One-gear upshifts above 60% of full load priced 1 + 0.5*(load - 0.60)0.7735344 min · $117.47
  89. v88Tight-budget zero-fuel braking downshift price split out, at 1.00.7735345 min · $118.13
  90. v89Inactive full-load relief for the tractive downshift price0.7735348 min · $120.39
  91. v90High-load relief split by shift distance, plus a budget-slack gate, both off0.7735351 min · $122.92
  92. v91With 10% budget surplus, relieve the tractive price above 75% full load0.7705365 min · $124.76

92 snapshots, 6.1 h, $125. The last 30 cost $42 and moved the visible mean 0.7803 -> 0.7705; most of them are behaviour-identical hooks.

On the hidden set

held-out metricreward
shipped template6.0019 %0.00
human reference method4.6189 %0.30
best expert round observed1.7220 %0.60
dynamic-programming bound0 %1.00
this run1.5734 %0.6345