cartpole-swingup: the draft controller against the accepted one

Scenario s1: pole hanging at 180 degrees, half-length 0.5 m, cart mass 1.0 kg, force clamped to 20 N. Both runs come from the built plimsoll/sandbox-sim image through the project API; the fingerprints below are the SHA-256 of each trajectory as recorded from that image.

The simulator is written in C, compiled to WebAssembly and shipped in that image: its source, EXTERNAL · source repo ↗. A controller is a separate program that reads the simulator's observations each tick and sets its input. This page runs two hand-written controllers against it: a draft that makes a plausible mistake and fails, and an accepted one that passes the environment's scoring program. Published: the accepted controller's law (the same fingerprints), EXTERNAL · source repo ↗; its C port, EXTERNAL · source repo ↗; and all four scenarios with their fingerprints, EXTERNAL · source repo ↗. The draft controller and the scoring program are not published. Every simulator in the image, EXTERNAL · source repo ↗.

Work in progress. These charts show two hand-written reference controllers. No AI-generated controller is plotted for this environment yet.

Draft controlleroff trackt up none, off track at 0.51, max abs x 3632.603
Accepted controllerscore 0.879t up 2.41, off track at none, max abs x 2.085
Draft controllerAccepted controllerhard limit
Pole angle from upright -180-90090180 05101520 seconds degrees upright, cos theta above 0.98 Cart position track ends at 2.4 m -3-2.402.43 05101520 seconds metres
Table view (100 rows)
secondsdraft x_mdraft v_m_per_sdraft theta_rad_from_upright_unwrappeddraft omega_rad_per_sdraft actionaccepted x_maccepted v_m_per_saccepted theta_rad_from_upright_unwrappedaccepted omega_rad_per_saccepted action
00.00000.00003.14160.0000125.66360.00000.00003.14160.0000-20.0000
0.20.38543.83283.68705.0464176.9315-0.3854-3.83132.5962-5.0445-16.8785
0.41.49657.25754.78434.8198224.2248-1.2911-4.82611.6566-3.5623-2.2012
0.63.305410.91005.3031-0.0365226.1572-1.9992-1.74611.1691-1.742820.0000
0.85.856714.55994.7751-4.8836187.0029-2.02841.06810.8456-1.44518.6742
19.105317.98323.6691-5.0631148.5352-1.70232.01480.6382-0.53182.8706
1.213.079821.82063.12250.0527160.0652-1.31911.39140.72731.9642-5.1247
1.417.829625.65523.68375.1447216.5548-1.10450.90681.41064.8610-1.6167
1.623.304429.07244.79834.8808268.7109-0.90511.08872.66727.4804-1.8027
1.829.476432.72845.3224-0.0436274.8807-0.70370.91784.13466.52961.5227
236.391936.38094.7866-4.9533239.4721-0.54560.50235.16483.8270-2.3350
2.244.004039.79713.6630-5.1543204.5511-0.47410.28295.72761.9327-0.5918
2.452.341443.63693.10310.0131220.1675-0.4770-0.40026.07151.7827-0.4329
2.661.455047.47763.66395.1931281.4545-0.51300.21996.33080.66854.9548
2.871.294250.89054.79674.9958339.0327-0.38380.98906.3582-0.25592.3257
381.829354.54445.34190.0405350.2525-0.16221.13086.2870-0.3477-0.6172
3.293.108858.20544.8144-4.9684319.04980.04530.92266.2410-0.1040-1.2392
3.4105.085161.61103.6740-5.2988287.16320.20920.73476.23770.0415-0.6692
3.6117.784965.44883.0837-0.1255305.95220.34700.65716.24730.0382-0.2416
3.8131.261469.29963.62665.1838371.54360.47470.62016.2504-0.0051-0.2403
4145.465872.71254.77795.1666435.12710.59370.56426.2472-0.0217-0.3898
4.2160.364176.35755.36090.2229452.27300.69880.48426.2435-0.0135-0.4736
4.4176.007480.03334.8593-4.9200425.81470.78700.39676.2420-0.0020-0.4744
4.6192.348883.42543.7042-5.4951396.46830.85780.31226.24220.0035-0.4507
4.8209.410287.25593.0657-0.3701417.44160.91220.23176.24310.0049-0.4354
5227.248991.12023.57115.1031486.72860.95070.15336.24420.0060-0.4267
5.2245.819394.53954.73935.3905556.88210.97370.07666.24560.0081-0.4140
5.4265.080798.16755.37750.5104580.89920.98160.00296.24740.0105-0.3933
5.6285.0876101.86394.9215-4.7941559.84030.9752-0.06656.24970.0125-0.3664
5.8305.7951105.24203.7565-5.7343532.62370.9554-0.13066.25240.0141-0.3360
6327.2175109.05793.0517-0.7273554.70870.9234-0.18896.25530.0152-0.3033
6.2349.4175112.93753.49774.9311626.91940.8803-0.24126.25850.0161-0.2686
6.4372.3546116.37324.67775.6587704.12980.8274-0.28696.26180.0168-0.2321
6.6395.9793119.97415.38830.9095736.03400.7661-0.32596.26520.0172-0.1944
6.8420.3492123.69575.0000-4.5727721.18230.6976-0.35796.26860.0173-0.1562
7445.4240127.06333.8340-5.9986695.85370.6234-0.38306.27210.0172-0.1182
7.2471.2071130.85463.0460-1.2030717.88740.5449-0.40136.27550.0168-0.0807
7.4497.7670134.74923.40804.6434792.05200.4633-0.41286.27880.0162-0.0444
7.6525.0713138.21574.58965.9542876.64020.3802-0.41786.28200.0155-0.0096
7.8553.0600141.77765.38881.4249917.51360.2967-0.41666.28500.01450.0233
8581.7922145.52635.0928-4.2341909.85850.2139-0.40966.28770.01340.0538
8.2611.2356148.89303.9403-6.2583886.44930.1332-0.39736.29030.01220.0818
8.4641.3791152.64563.0542-1.8015907.18470.0553-0.38026.29260.01090.1070
8.6672.2977156.55263.30524.2133982.1239-0.0186-0.35876.29470.00950.1291
8.8703.9692160.06874.47106.24851074.1187-0.0879-0.33356.29640.00810.1482
9736.3230163.57905.37252.05831125.0935-0.1518-0.30506.29790.00660.1640
9.2769.4164167.35225.1956-3.75471125.8204-0.2098-0.27406.29910.00510.1765
9.4803.2294170.73564.0784-6.47011104.7511-0.2614-0.24106.29990.00370.1858
9.6837.7339174.43083.0838-2.52391122.8964-0.3062-0.20666.30050.00220.1920
9.8873.0098178.34593.19503.61701197.2403-0.3440-0.17136.30080.00090.1951
10909.0477181.93244.31856.49781296.2087-0.3747-0.13576.3009-0.00040.1952
10.2945.7685185.38065.33132.80601358.4323-0.3983-0.10046.3007-0.00160.1926
10.4983.2219189.16975.3022-3.11231368.9179-0.4149-0.06576.3002-0.00280.1875
10.61021.4051192.59474.2499-6.57771351.1067-0.4247-0.03226.2996-0.00380.1800
10.81060.2719196.21063.1442-3.36431365.4298-0.4279-0.00026.2987-0.00470.1704
111099.9038200.12873.08592.83831437.6591-0.42490.02996.2977-0.00550.1590
11.21140.3062203.80304.13046.63701542.5089-0.41620.05776.2966-0.00610.1461
11.41181.3965207.18715.25553.65391617.0731-0.40200.08316.2953-0.00660.1318
11.61223.2090210.97545.4031-2.28951638.8616-0.38310.10586.2939-0.00700.1166
11.81265.7618214.47054.4536-6.51621625.7962-0.35990.12566.2925-0.00730.1007
121308.9937217.98743.2466-4.30101635.3405-0.33310.14256.2910-0.00750.0842
12.21352.9802221.90222.98931.87211703.8145-0.30320.15646.2895-0.00750.0676
12.41397.7441225.67053.90816.57661812.6226-0.27080.16726.2880-0.00750.0510
12.61443.2071229.00625.13394.57121900.4255-0.23650.17516.2865-0.00730.0347
12.81489.3782232.76785.4859-1.27791935.1931-0.20090.18006.2851-0.00710.0189
131536.2985236.35654.6844-6.21831928.9394-0.16470.18216.2837-0.00670.0037
13.21583.8996239.76823.4029-5.28001933.3846-0.12820.18156.2824-0.0063-0.0106
13.41632.2397243.66832.91970.72201996.3068-0.09220.17846.2812-0.0058-0.0238
13.61681.3613247.51833.65916.20852106.2876-0.05700.17306.2800-0.0053-0.0360
13.81731.1996250.84954.95535.49942207.7582-0.02310.16556.2790-0.0047-0.0469
141781.7301254.54805.5348-0.07902257.27400.00900.15616.2782-0.0041-0.0566
14.21833.0145258.23794.9314-5.62152260.40210.03920.14506.2774-0.0035-0.0648
14.41884.9897261.56913.6237-6.19132260.54860.06700.13266.2768-0.0029-0.0716
14.61937.6830265.42782.8947-0.60542315.87300.09220.11906.2763-0.0022-0.0771
14.81991.1584269.33003.39915.43812423.64140.11450.10466.2759-0.0016-0.0811
152045.3725272.72874.71036.34192538.22420.13400.08966.2756-0.0010-0.0837
15.22100.2656276.32065.53071.29442604.28830.15040.07426.2755-0.0004-0.0850
15.42155.9097280.09565.1772-4.67802619.70230.16370.05876.27550.0002-0.0851
15.62212.2629283.41363.9135-6.85942617.91970.17390.04336.27560.0007-0.0839
15.82269.3110287.17912.9350-2.10212663.37990.18100.02826.27580.0012-0.0816
162327.1372291.10163.15254.23792765.52800.18520.01366.27600.0017-0.0783
16.22385.7237294.64494.39536.95072890.93220.1865-0.00036.27640.0020-0.0742
16.42444.9852298.09575.45222.81252975.23020.1852-0.01346.27690.0024-0.0692
16.62504.9850301.91525.3969-3.37193005.91600.1813-0.02556.27740.0027-0.0635
16.82565.7165305.31634.2657-7.08463006.23820.1751-0.03656.27790.0029-0.0573
172627.1249308.92123.0642-3.74123039.90990.1668-0.04646.27850.0031-0.0506
17.22689.2998312.84622.95042.66803133.50360.1566-0.05506.27920.0032-0.0437
17.42752.2507316.57124.01787.10893265.07620.1449-0.06236.27980.0033-0.0365
17.62815.8890319.89335.27624.40313368.84710.1318-0.06836.28050.0033-0.0293
17.82880.2425323.69535.5596-1.73283417.65970.1176-0.07306.28110.0033-0.0220
182945.3471327.25714.6582-6.71733425.34490.1027-0.07646.28180.0032-0.0149
18.23011.1258330.66653.3066-5.41103447.00070.0871-0.07856.28240.0031-0.0080
18.43077.6479334.58092.82650.82243529.40160.0713-0.07946.28300.0029-0.0014
18.63144.9532338.44823.60566.54613660.35490.0555-0.07916.28360.00270.0048
18.83212.9752341.74694.98355.90923783.60790.0398-0.07776.28410.00250.0106
193281.6845345.44805.63050.17883853.24670.0244-0.07536.28460.00230.0158
19.23351.1525349.17785.0531-5.68463874.02990.0097-0.07206.28500.00210.0206
19.43421.3132352.46183.6768-6.80063886.8452-0.0043-0.06796.28540.00180.0248
19.63492.1828356.31002.8158-1.24123954.9203-0.0174-0.06316.28570.00150.0283
19.83563.8350360.23203.21195.11794078.1316-0.0295-0.05766.28600.00120.0313

Fingerprints, scenario s1 (3.14159, 0.5, 1)

draft: 1fff6ac98cb75a2b220b2e781d08c098a30d8508c1e3f084bf1cd96d855dc341

accepted: d536a067c8cb2ec987d031fab4561d06c8453aa39a1cda2f60b91bcb0d198829