Throttle lock is a forward floor on the solve; allocation moves after the performance update

The lock stops being an intent rewrite in Ship.Update: ThrustAllocator.Allocate takes forwardFloor, which ignores the
stick, asks full forward and holds every column with y > 0 at full (ruling overdrive-forward-floor). Ship allocates in
Entity's new UpdateThrottles phase, after every item's UpdatePerformance and before the power bus and Execute, so
liveness and thrust are the ones Execute acts on (finding liveness-read-before-performance).
Tests follow in the next commits; the test project still compiles, new behaviour is untested here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-10 19:26:49 +02:00
commit 534e402fdf
3 changed files with 26 additions and 12 deletions

View file

@ -31,11 +31,18 @@ public sealed class ThrustAllocator
int _columns = -1;
float[] _a, _b, _lo, _hi, _x, _workspace;
public void Allocate(ReadOnlySpan<float3> columns, float2 move, float turn, Span<float> throttle)
/// <summary>
/// Solves the throttles for the intent. <paramref name="forwardFloor"/> is the throttle lock: every thruster whose
/// column pushes forward is bounded below at full, the stick is ignored (forward is the only translation asked, so
/// nothing fires against the floored drives), and the turn is served by what remains.
/// </summary>
public void Allocate(ReadOnlySpan<float3> columns, float2 move, float turn, Span<float> throttle, bool forwardFloor = false)
{
var n = columns.Length;
if (n != _columns) Resize(n);
for (var i = 0; i < n; i++) throttle[i] = 0;
if (forwardFloor) move = new float2(0, 1);
for (var i = 0; i < n; i++) _lo[i] = forwardFloor && columns[i].y > 0 ? 1f : 0f;
// Nothing asked, nothing fired: that is a fact about the intent, decided before the solve. The solver's warm
// start is left as the last solved point, which is where the next non-zero call resumes.