Match Jimmy controller arithmetic and facing to original probes

This commit is contained in:
UnixNight committed 2026-11-05 09:47:28 -05:00
1 parent 42ea2b8cd5
commit 0e2f426d42
60 files changed
+6027 -48

No files matched your search

@@ -0,0 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup><OutputType>Exe</OutputType><TargetFramework>net10.0</TargetFramework><ImplicitUsings>enable</ImplicitUsings><Nullable>enable</Nullable><EnableDefaultCompileItems>false</EnableDefaultCompileItems></PropertyGroup>
<ItemGroup><Compile Include="Program.cs"/><Compile Include="../../src/GamePort/Game/JimmyOrientation.cs"/><Compile Include="../../src/GamePort/Game/RocketOrientation.cs"/>
<None Include="original-orientation-reference.json" CopyToOutputDirectory="PreserveNewest"/>
</ItemGroup>
</Project>
@@ -0,0 +1,24 @@
using System.Numerics;
using System.Text.Json;
using GamePort.Game;
using var doc=JsonDocument.Parse(File.ReadAllText(Path.Combine(AppContext.BaseDirectory,"original-orientation-reference.json")));
int count=0;
foreach(var c in doc.RootElement.GetProperty("cases").EnumerateArray())
{
var p=c.GetProperty("input").EnumerateArray().Select(x=>x.GetSingle()).ToArray();
var o=c.GetProperty("observed").EnumerateArray().Select(x=>x.GetSingle()).ToArray();
var current=new Vector3(p[0],p[1],p[2]);var target=new Vector3(p[3],p[4],p[5]);
bool dirty=p[9]!=0;
for(int i=0;i<(int)p[7];i++)
{
var before=current;current=JimmyOrientation.Step(current,target,p[6],p[8]!=0,dirty);
if(p[8]!=0&&dirty)dirty=before!=target;
}
Check(Vector3.Distance(current,new(o[0],o[1],o[2]))<.001f,$"{c.GetProperty("name").GetString()}: {current} != {o[0]},{o[1]},{o[2]}");count++;
}
Check(count==16,"all original orientation cases");
Console.WriteLine("PASS16 copied-original Jimmy facing observations: shortest arcs,180 boundaries, negative normalization, gate retention and repeated settling");
var retained=new Vector3(0,10,0);JimmyOrientation.Step(new(350),retained,1f/60);
Check(retained==new Vector3(0,10,0),"step does not mutate destination state");
Console.WriteLine("PASS retained target state remains independent of current Euler");
static void Check(bool ok,string name){if(!ok)throw new Exception(name);}
@@ -0,0 +1,374 @@
{
"source_sha256": "f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8",
"ranges": [
{
"va": "0x43a420",
"file_offset": "0x3a420",
"length": 431,
"sha256": "e052ee855e625d03a3317dcc7d507081c7519576381afa5741572157e5ffb988"
},
{
"va": "0x458f90",
"file_offset": "0x58f90",
"length": 38,
"sha256": "7f014c2a630c2e257513df09ab56595ad0fdcf892ea623d483148c002c6931c2"
},
{
"va": "0x472480",
"file_offset": "0x72480",
"length": 240,
"sha256": "406c3904538abe07d88ca440e39ca56c00765d0871943991ba7b792da4803c16"
}
],
"constants": {
"0x4afcf0": 3.7,
"0x4afd38": 4.5
},
"scope": "Copied43A420/458F90/472480, synthetic enabled/dirty actor; no original AI/body/game entrypoint.",
"rea_evidence": "ev_0d64cc58fa8f5573fc8e61e0f2c20e36288099212bd2257d3a3121361fd6c904",
"files": {
"tools/binary/jimmy_orientation.py": "3dab00935c844af6b8792d87923294ae3eb660e4a0a1744836b02e9e81152964",
"tools/binary/jimmy_orientation_probe.c": "b3c194090e58665fbd071e0515a93221057a8a385b0f34e76e57ee5a9274e241",
"tools/binary/grappler_scalar_probe.c": "c51cc1ecefaf7a90e69a40624fd0e8cd7e01500359c4e67aee6213bb36f4a810",
"artifacts/jimmy-orientation-audit/jimmy_orientation_probe.exe": "b58b0f9bf54c9201abd911a6da75375f9d14422378f3bbf48ff25676b398fc78",
"artifacts/jimmy-orientation-audit/probe/wine.log": "9bc970a46ac7bed33507d4f1388680d478f306667fda3256041fbcdc4f2354b4"
},
"cases": [
{
"name": "ordinary",
"input": [
10.0,
20.0,
30.0,
0.0,
30.0,
0.0,
0.100000001,
1.0,
1.0,
1.0
],
"observed": [
5.5,
23.7000008,
16.5,
1.0
]
},
{
"name": "level",
"input": [
338.0,
90.0,
338.0,
0.0,
90.0,
0.0,
0.0166666675,
1.0,
1.0,
1.0
],
"observed": [
339.649994,
90.0,
339.649994,
1.0
]
},
{
"name": "seam",
"input": [
359.0,
359.0,
359.0,
1.0,
1.0,
1.0,
0.100000001,
1.0,
1.0,
1.0
],
"observed": [
359.899994,
359.73999,
359.899994,
1.0
]
},
{
"name": "opposite_seam",
"input": [
1.0,
1.0,
1.0,
359.0,
359.0,
359.0,
0.100000001,
1.0,
1.0,
1.0
],
"observed": [
0.0999999642,
0.25999999,
0.0999999642,
1.0
]
},
{
"name": "negative",
"input": [
-20.0,
-10.0,
-30.0,
0.0,
20.0,
0.0,
0.100000001,
1.0,
1.0,
1.0
],
"observed": [
349.0,
1.10000038,
344.0,
1.0
]
},
{
"name": "equal180",
"input": [
180.0,
180.0,
180.0,
0.0,
0.0,
0.0,
0.100000001,
1.0,
1.0,
1.0
],
"observed": [
99.0,
113.400002,
99.0,
1.0
]
},
{
"name": "positive180",
"input": [
0.0,
0.0,
0.0,
180.0,
180.0,
180.0,
0.100000001,
1.0,
1.0,
1.0
],
"observed": [
81.0,
66.5999985,
81.0,
1.0
]
},
{
"name": "over180",
"input": [
181.0,
181.0,
181.0,
0.0,
0.0,
0.0,
0.100000001,
1.0,
1.0,
1.0
],
"observed": [
261.549988,
247.230011,
261.549988,
1.0
]
},
{
"name": "canonical360",
"input": [
360.0,
360.0,
360.0,
0.0,
0.0,
0.0,
0.100000001,
1.0,
1.0,
1.0
],
"observed": [
360.0,
360.0,
360.0,
1.0
]
},
{
"name": "fractional",
"input": [
0.00100000005,
359.998993,
0.00100000005,
359.998993,
0.00100000005,
359.998993,
0.370000005,
1.0,
1.0,
1.0
],
"observed": [
360.0,
0.00175030529,
360.0,
1.0
]
},
{
"name": "tiny",
"input": [
0.00999999978,
0.00999999978,
0.00999999978,
0.0,
0.0,
0.0,
0.0166666675,
1.0,
1.0,
1.0
],
"observed": [
0.00925000012,
0.00938333292,
0.00925000012,
1.0
]
},
{
"name": "settle",
"input": [
338.0,
359.0,
338.0,
0.0,
1.0,
0.0,
0.0166666675,
120.0,
1.0,
1.0
],
"observed": [
359.998077,
0.999036431,
359.998077,
1.0
]
},
{
"name": "upright",
"input": [
0.0,
90.0,
0.0,
0.0,
90.0,
0.0,
0.100000001,
1.0,
1.0,
1.0
],
"observed": [
0.0,
90.0,
0.0,
0.0
]
},
{
"name": "disabled",
"input": [
20.0,
90.0,
30.0,
0.0,
0.0,
0.0,
0.100000001,
1.0,
0.0,
1.0
],
"observed": [
20.0,
90.0,
30.0,
1.0
]
},
{
"name": "clean",
"input": [
20.0,
90.0,
30.0,
0.0,
0.0,
0.0,
0.100000001,
1.0,
1.0,
0.0
],
"observed": [
20.0,
90.0,
30.0,
0.0
]
},
{
"name": "zero_dt",
"input": [
20.0,
90.0,
30.0,
0.0,
0.0,
0.0,
0.0,
1.0,
1.0,
1.0
],
"observed": [
20.0,
90.0,
30.0,
1.0
]
}
]
}