Compare commits
35
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee7fe829ac | ||
|
|
296cd17f98 | ||
|
|
34019c1a34 | ||
|
|
48cc566c3f | ||
|
|
6ecd33db0c | ||
|
|
c6b46b8bb1 | ||
|
|
6de085fd37 | ||
|
|
95da49193f | ||
|
|
9eaff7341f | ||
|
|
ce9edd7934 | ||
|
|
d977be321b | ||
|
|
46fe24365b | ||
|
|
7e99b333ea | ||
|
|
79519b042c | ||
|
|
3b748c811c | ||
|
|
26eb0815c2 | ||
|
|
7a8e5aab63 | ||
|
|
bb919d33c9 | ||
|
|
ff160f576e | ||
|
|
5675159987 | ||
|
|
39c870c1cf | ||
|
|
7be41cb1ad | ||
|
|
6c2af53d18 | ||
|
|
f5f394a4bf | ||
|
|
76ac563d21 | ||
|
|
de009bd516 | ||
|
|
29f3887be1 | ||
|
|
fe48b4e777 | ||
|
|
4de5e03a0b | ||
|
|
5f2cbd5179 | ||
|
|
2ff02eb9a8 | ||
|
|
dc27781a72 | ||
|
|
8e5431c460 | ||
|
|
b06662c152 | ||
|
|
70654e45f7 |
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"config": {
|
||||
"ckpt": "ml/runs/base_dag2_dag1/best.pt",
|
||||
"samples": "ml/data/samples",
|
||||
"tasks": null,
|
||||
"split": "val",
|
||||
"n": 512,
|
||||
"K": 8,
|
||||
"commit": 2,
|
||||
"fb": 2.2,
|
||||
"ki": 0.0,
|
||||
"fb_scale": 0.0,
|
||||
"fb_near": 0.2,
|
||||
"fb_fallback": 0.0,
|
||||
"kdecay": 0.9,
|
||||
"kimax": 0.5,
|
||||
"fb_every": 1,
|
||||
"safety_try": 0,
|
||||
"sel_w": 0.1,
|
||||
"dls_safety": 1,
|
||||
"fb_clear": 0.0,
|
||||
"fb_cmin": 0.3,
|
||||
"sub_refresh": 0,
|
||||
"fb_block_gain": 0.5,
|
||||
"dump": "ml/runs/round29_rows.json",
|
||||
"out": "docs/experiment_round29.json",
|
||||
"trace": "ml/runs/round29_trace.pt",
|
||||
"select": "endpoint",
|
||||
"replan": "empty",
|
||||
"safety": 1,
|
||||
"partial": 1,
|
||||
"max_sec": null,
|
||||
"seed": 0,
|
||||
"dls": "analytic",
|
||||
"device": "cuda"
|
||||
},
|
||||
"batch_size": 256,
|
||||
"batch_seed_rule": "same seed per batch",
|
||||
"checkpoint_sha256": "f7f686fd8ee92fb6948fbcc4ee954636065ad87bb54f661c4f8f575bc16c2ce1",
|
||||
"tasks_sha256": "1fd72f71eaf8170b45782beede0d91544e1f7142e98c0642560af814382f01ef",
|
||||
"kin_fp": "2ebcbf17",
|
||||
"act_scale": 1.0,
|
||||
"metrics": {
|
||||
"n": 512,
|
||||
"n_ref": 512,
|
||||
"success": 0.55078125,
|
||||
"collision_free_success": 0.546875,
|
||||
"time_ok_1p3": 0.361328125,
|
||||
"collision_rate": 0.017578125,
|
||||
"collision_steps_mean": 0.1015625,
|
||||
"travel_ratio_median": 2.425084352493286,
|
||||
"time_mean_s": 2.322056770324707,
|
||||
"brakes_mean": 19.228515625,
|
||||
"start_fail": 0.0,
|
||||
"goal_ratio_2s": 0.25053170323371887,
|
||||
"err_fail_med": 194.51763916015625,
|
||||
"err_success_med": 0.1961677223443985,
|
||||
"dls_share": 0.634765625,
|
||||
"time_budget": "teacher×2(≥3 s)"
|
||||
},
|
||||
"simulation_wall_s": 488.4280448999925
|
||||
}
|
||||
@@ -0,0 +1,779 @@
|
||||
{
|
||||
"trace": "ml/runs/round29_trace.pt",
|
||||
"n": 512,
|
||||
"reported_collision_tasks": 9,
|
||||
"replayed_first_hits32": 9,
|
||||
"replayed_first_hits64": 9,
|
||||
"scope": "Replay reported first hits only; same geometry kernel at float32/float64, not a full safety audit.",
|
||||
"rows": [
|
||||
{
|
||||
"i": 21,
|
||||
"task": {
|
||||
"tid": 1223280991,
|
||||
"id": "s0001_000564",
|
||||
"cat": "A",
|
||||
"mode": "pose",
|
||||
"q0": [
|
||||
178.767,
|
||||
101.917,
|
||||
25.283,
|
||||
31.588,
|
||||
-12.179,
|
||||
-6.464
|
||||
],
|
||||
"T": [
|
||||
320.779,
|
||||
79.294,
|
||||
350.853
|
||||
],
|
||||
"R": [
|
||||
-0.5548626629953249,
|
||||
-0.1382477148217311,
|
||||
-0.820374910976869,
|
||||
-0.29956278115972873,
|
||||
-0.8867511636570162,
|
||||
0.35204334093514156,
|
||||
-0.7761375943462505,
|
||||
0.44108949556693955,
|
||||
0.4506112421399604
|
||||
],
|
||||
"exec_s": 2.86,
|
||||
"travel": 581.023,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"first_hit_s": 5.659999847412109,
|
||||
"dls_it": -1,
|
||||
"point_order": [
|
||||
"q0",
|
||||
"previous",
|
||||
"midpoint",
|
||||
"endpoint"
|
||||
],
|
||||
"gap32_mm": [
|
||||
0.5,
|
||||
0.5,
|
||||
0.35770511627197266,
|
||||
-0.3957242965698242
|
||||
],
|
||||
"gap64_mm": [
|
||||
0.5,
|
||||
0.5,
|
||||
0.3577231796451059,
|
||||
-0.39572636491366353
|
||||
],
|
||||
"pair32": [
|
||||
0,
|
||||
0,
|
||||
5,
|
||||
5
|
||||
],
|
||||
"pair64": [
|
||||
0,
|
||||
0,
|
||||
5,
|
||||
5
|
||||
],
|
||||
"boundary_joints": [
|
||||
5
|
||||
],
|
||||
"previous": [
|
||||
139.78468322753906,
|
||||
87.256591796875,
|
||||
6.928672790527344,
|
||||
103.78778839111328,
|
||||
-94.0,
|
||||
19.4688720703125
|
||||
],
|
||||
"endpoint": [
|
||||
139.50450134277344,
|
||||
87.4175796508789,
|
||||
6.71871280670166,
|
||||
104.29376983642578,
|
||||
-94.0,
|
||||
21.218488693237305
|
||||
],
|
||||
"dense_nsegments": 175,
|
||||
"dense_gap64_min_mm": -0.39572636491366353
|
||||
},
|
||||
{
|
||||
"i": 84,
|
||||
"task": {
|
||||
"tid": 1268963905,
|
||||
"id": "s0002_000538",
|
||||
"cat": "B",
|
||||
"mode": "pose",
|
||||
"q0": [
|
||||
-49.198,
|
||||
52.395,
|
||||
108.796,
|
||||
75.534,
|
||||
82.302,
|
||||
-121.823
|
||||
],
|
||||
"T": [
|
||||
-85.062,
|
||||
275.378,
|
||||
888.929
|
||||
],
|
||||
"R": [
|
||||
0.5139412462799992,
|
||||
-0.4285630099475821,
|
||||
-0.7431003578769356,
|
||||
-0.5533754886400825,
|
||||
-0.8275489878032067,
|
||||
0.09454227286372051,
|
||||
-0.6554692700230204,
|
||||
0.36262435010704513,
|
||||
-0.6624678231921397
|
||||
],
|
||||
"exec_s": 3.2600000000000002,
|
||||
"travel": 349.09,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"first_hit_s": 5.980000019073486,
|
||||
"dls_it": -1,
|
||||
"point_order": [
|
||||
"q0",
|
||||
"previous",
|
||||
"midpoint",
|
||||
"endpoint"
|
||||
],
|
||||
"gap32_mm": [
|
||||
0.5,
|
||||
0.030836105346679688,
|
||||
-0.1565418243408203,
|
||||
-0.11790847778320312
|
||||
],
|
||||
"gap64_mm": [
|
||||
0.5,
|
||||
0.030838235678215753,
|
||||
-0.15655898804830848,
|
||||
-0.11791701257236653
|
||||
],
|
||||
"pair32": [
|
||||
0,
|
||||
6,
|
||||
6,
|
||||
6
|
||||
],
|
||||
"pair64": [
|
||||
0,
|
||||
6,
|
||||
6,
|
||||
6
|
||||
],
|
||||
"boundary_joints": [
|
||||
5
|
||||
],
|
||||
"previous": [
|
||||
-69.87329864501953,
|
||||
36.559112548828125,
|
||||
2.094588279724121,
|
||||
102.22724151611328,
|
||||
89.0,
|
||||
-212.1793212890625
|
||||
],
|
||||
"endpoint": [
|
||||
-69.79582214355469,
|
||||
37.351837158203125,
|
||||
-0.033895254135131836,
|
||||
102.45509338378906,
|
||||
89.0,
|
||||
-214.75440979003906
|
||||
],
|
||||
"dense_nsegments": 258,
|
||||
"dense_gap64_min_mm": -0.16882067924099076
|
||||
},
|
||||
{
|
||||
"i": 145,
|
||||
"task": {
|
||||
"tid": 593213945,
|
||||
"id": "s0003_000414",
|
||||
"cat": "B",
|
||||
"mode": "pose",
|
||||
"q0": [
|
||||
-49.395,
|
||||
84.783,
|
||||
2.744,
|
||||
14.841,
|
||||
-86.783,
|
||||
81.932
|
||||
],
|
||||
"T": [
|
||||
5.391,
|
||||
506.723,
|
||||
383.367
|
||||
],
|
||||
"R": [
|
||||
-0.5269859333114162,
|
||||
-0.7554822816510317,
|
||||
-0.38927156099983334,
|
||||
0.6402732880654818,
|
||||
-0.05172298162073713,
|
||||
-0.7664038424760652,
|
||||
0.5588702377848656,
|
||||
-0.6531242265324508,
|
||||
0.5109724082909718
|
||||
],
|
||||
"exec_s": 2.96,
|
||||
"travel": 560.55,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"first_hit_s": 5.599999904632568,
|
||||
"dls_it": -1,
|
||||
"point_order": [
|
||||
"q0",
|
||||
"previous",
|
||||
"midpoint",
|
||||
"endpoint"
|
||||
],
|
||||
"gap32_mm": [
|
||||
0.5,
|
||||
0.5,
|
||||
0.3180522918701172,
|
||||
-0.19827747344970703
|
||||
],
|
||||
"gap64_mm": [
|
||||
0.5,
|
||||
0.5,
|
||||
0.318071359587325,
|
||||
-0.19825289671655533
|
||||
],
|
||||
"pair32": [
|
||||
0,
|
||||
0,
|
||||
5,
|
||||
5
|
||||
],
|
||||
"pair64": [
|
||||
0,
|
||||
0,
|
||||
5,
|
||||
5
|
||||
],
|
||||
"boundary_joints": [
|
||||
5
|
||||
],
|
||||
"previous": [
|
||||
-36.05080032348633,
|
||||
49.852294921875,
|
||||
22.054914474487305,
|
||||
67.3380126953125,
|
||||
-94.0,
|
||||
79.87274932861328
|
||||
],
|
||||
"endpoint": [
|
||||
-35.60316848754883,
|
||||
48.9223747253418,
|
||||
21.386226654052734,
|
||||
67.87915802001953,
|
||||
-94.0,
|
||||
79.27398681640625
|
||||
],
|
||||
"dense_nsegments": 93,
|
||||
"dense_gap64_min_mm": -0.19825289671655533
|
||||
},
|
||||
{
|
||||
"i": 164,
|
||||
"task": {
|
||||
"tid": 1743026973,
|
||||
"id": "s0003_000814",
|
||||
"cat": "C",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
-65.982,
|
||||
5.595,
|
||||
-64.669,
|
||||
-72.912,
|
||||
85.732,
|
||||
-86.377
|
||||
],
|
||||
"T": [
|
||||
-189.354,
|
||||
221.034,
|
||||
302.457
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 2.3000000000000003,
|
||||
"travel": 306.824,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"first_hit_s": 3.0399999618530273,
|
||||
"dls_it": -1,
|
||||
"point_order": [
|
||||
"q0",
|
||||
"previous",
|
||||
"midpoint",
|
||||
"endpoint"
|
||||
],
|
||||
"gap32_mm": [
|
||||
0.5,
|
||||
0.5,
|
||||
0.5,
|
||||
-0.12672901153564453
|
||||
],
|
||||
"gap64_mm": [
|
||||
0.5,
|
||||
0.5,
|
||||
0.5,
|
||||
-0.12673094091899273
|
||||
],
|
||||
"pair32": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
5
|
||||
],
|
||||
"pair64": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
5
|
||||
],
|
||||
"boundary_joints": [
|
||||
5
|
||||
],
|
||||
"previous": [
|
||||
-33.6672248840332,
|
||||
39.63850021362305,
|
||||
-60.174774169921875,
|
||||
-108.2870864868164,
|
||||
88.27082061767578,
|
||||
-74.56200408935547
|
||||
],
|
||||
"endpoint": [
|
||||
-32.8936882019043,
|
||||
39.478729248046875,
|
||||
-58.639915466308594,
|
||||
-107.65913391113281,
|
||||
89.0,
|
||||
-74.92655944824219
|
||||
],
|
||||
"dense_nsegments": 154,
|
||||
"dense_gap64_min_mm": -0.12673094091899273
|
||||
},
|
||||
{
|
||||
"i": 175,
|
||||
"task": {
|
||||
"tid": 444406422,
|
||||
"id": "s0003_001100",
|
||||
"cat": "B",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
-28.854,
|
||||
43.33,
|
||||
-137.874,
|
||||
-6.895,
|
||||
-88.001,
|
||||
-43.745
|
||||
],
|
||||
"T": [
|
||||
379.105,
|
||||
293.88,
|
||||
653.541
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 2.58,
|
||||
"travel": 465.057,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"first_hit_s": 0.8399999737739563,
|
||||
"dls_it": 144,
|
||||
"point_order": [
|
||||
"q0",
|
||||
"previous",
|
||||
"midpoint",
|
||||
"endpoint"
|
||||
],
|
||||
"gap32_mm": [
|
||||
0.5,
|
||||
0.4698514938354492,
|
||||
-0.6612262725830078,
|
||||
-0.9359521865844727
|
||||
],
|
||||
"gap64_mm": [
|
||||
0.5,
|
||||
0.4698356780126254,
|
||||
-0.6612412101671552,
|
||||
-0.9359581587234
|
||||
],
|
||||
"pair32": [
|
||||
0,
|
||||
6,
|
||||
6,
|
||||
6
|
||||
],
|
||||
"pair64": [
|
||||
0,
|
||||
6,
|
||||
6,
|
||||
6
|
||||
],
|
||||
"boundary_joints": [
|
||||
5
|
||||
],
|
||||
"previous": [
|
||||
-42.48794937133789,
|
||||
11.756612777709961,
|
||||
-124.7530288696289,
|
||||
-46.12489700317383,
|
||||
-94.0,
|
||||
-54.57075500488281
|
||||
],
|
||||
"endpoint": [
|
||||
-42.73639678955078,
|
||||
10.6148681640625,
|
||||
-124.47537231445312,
|
||||
-48.52891159057617,
|
||||
-94.0,
|
||||
-55.451263427734375
|
||||
],
|
||||
"dense_nsegments": 241,
|
||||
"dense_gap64_min_mm": -0.9544276230224238
|
||||
},
|
||||
{
|
||||
"i": 180,
|
||||
"task": {
|
||||
"tid": 737760595,
|
||||
"id": "s0003_001280",
|
||||
"cat": "B",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
41.213,
|
||||
49.353,
|
||||
-149.808,
|
||||
-8.981,
|
||||
-88.566,
|
||||
83.45
|
||||
],
|
||||
"T": [
|
||||
118.145,
|
||||
2.733,
|
||||
266.082
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 1.78,
|
||||
"travel": 228.67,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"first_hit_s": 1.1399999856948853,
|
||||
"dls_it": 102,
|
||||
"point_order": [
|
||||
"q0",
|
||||
"previous",
|
||||
"midpoint",
|
||||
"endpoint"
|
||||
],
|
||||
"gap32_mm": [
|
||||
0.5,
|
||||
0.06517887115478516,
|
||||
-0.0172576904296875,
|
||||
0.013133049011230469
|
||||
],
|
||||
"gap64_mm": [
|
||||
0.5,
|
||||
0.06521150921177998,
|
||||
-0.017227151210720493,
|
||||
0.013145878955246104
|
||||
],
|
||||
"pair32": [
|
||||
0,
|
||||
5,
|
||||
5,
|
||||
5
|
||||
],
|
||||
"pair64": [
|
||||
0,
|
||||
5,
|
||||
5,
|
||||
5
|
||||
],
|
||||
"boundary_joints": [
|
||||
5
|
||||
],
|
||||
"previous": [
|
||||
1.8212896585464478,
|
||||
-9.327469825744629,
|
||||
-150.87704467773438,
|
||||
-23.00735855102539,
|
||||
-94.0,
|
||||
93.73664855957031
|
||||
],
|
||||
"endpoint": [
|
||||
1.3598560094833374,
|
||||
-9.66404914855957,
|
||||
-150.52992248535156,
|
||||
-23.200042724609375,
|
||||
-94.0,
|
||||
92.69589233398438
|
||||
],
|
||||
"dense_nsegments": 105,
|
||||
"dense_gap64_min_mm": -0.020246891242656773
|
||||
},
|
||||
{
|
||||
"i": 215,
|
||||
"task": {
|
||||
"tid": 169730876,
|
||||
"id": "s0004_000544",
|
||||
"cat": "B",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
47.051,
|
||||
-1.179,
|
||||
-94.31,
|
||||
-43.128,
|
||||
67.067,
|
||||
-119.867
|
||||
],
|
||||
"T": [
|
||||
-142.696,
|
||||
-139.159,
|
||||
726.163
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 2.16,
|
||||
"travel": 461.684,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"first_hit_s": 3.5399999618530273,
|
||||
"dls_it": -1,
|
||||
"point_order": [
|
||||
"q0",
|
||||
"previous",
|
||||
"midpoint",
|
||||
"endpoint"
|
||||
],
|
||||
"gap32_mm": [
|
||||
0.5,
|
||||
0.5,
|
||||
0.5,
|
||||
-0.08817481994628906
|
||||
],
|
||||
"gap64_mm": [
|
||||
0.5,
|
||||
0.5,
|
||||
0.5,
|
||||
-0.08817155079043282
|
||||
],
|
||||
"pair32": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
6
|
||||
],
|
||||
"pair64": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
6
|
||||
],
|
||||
"boundary_joints": [
|
||||
5
|
||||
],
|
||||
"previous": [
|
||||
34.57734298706055,
|
||||
32.23564910888672,
|
||||
-71.76512908935547,
|
||||
10.783411979675293,
|
||||
88.44934844970703,
|
||||
-105.16633605957031
|
||||
],
|
||||
"endpoint": [
|
||||
34.31901931762695,
|
||||
33.24732208251953,
|
||||
-72.12022399902344,
|
||||
10.171412467956543,
|
||||
89.0,
|
||||
-106.89080810546875
|
||||
],
|
||||
"dense_nsegments": 173,
|
||||
"dense_gap64_min_mm": -0.08817155079043282
|
||||
},
|
||||
{
|
||||
"i": 266,
|
||||
"task": {
|
||||
"tid": 458057184,
|
||||
"id": "s0005_000271",
|
||||
"cat": "B",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
44.394,
|
||||
32.402,
|
||||
-145.074,
|
||||
-48.37,
|
||||
-85.543,
|
||||
13.576
|
||||
],
|
||||
"T": [
|
||||
184.38,
|
||||
-306.445,
|
||||
433.207
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 2.52,
|
||||
"travel": 376.205,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"first_hit_s": 1.2200000286102295,
|
||||
"dls_it": 304,
|
||||
"point_order": [
|
||||
"q0",
|
||||
"previous",
|
||||
"midpoint",
|
||||
"endpoint"
|
||||
],
|
||||
"gap32_mm": [
|
||||
0.5,
|
||||
0.5,
|
||||
0.2372283935546875,
|
||||
-0.05915641784667969
|
||||
],
|
||||
"gap64_mm": [
|
||||
0.5,
|
||||
0.5,
|
||||
0.23719947210205383,
|
||||
-0.05918908805933398
|
||||
],
|
||||
"pair32": [
|
||||
0,
|
||||
0,
|
||||
5,
|
||||
5
|
||||
],
|
||||
"pair64": [
|
||||
0,
|
||||
0,
|
||||
5,
|
||||
5
|
||||
],
|
||||
"boundary_joints": [
|
||||
5
|
||||
],
|
||||
"previous": [
|
||||
20.49032974243164,
|
||||
10.35391902923584,
|
||||
-172.87489318847656,
|
||||
-73.93492126464844,
|
||||
-93.70915985107422,
|
||||
14.725995063781738
|
||||
],
|
||||
"endpoint": [
|
||||
20.34522819519043,
|
||||
10.012239456176758,
|
||||
-172.91363525390625,
|
||||
-74.4600601196289,
|
||||
-94.0,
|
||||
13.266871452331543
|
||||
],
|
||||
"dense_nsegments": 146,
|
||||
"dense_gap64_min_mm": -0.05918908805933398
|
||||
},
|
||||
{
|
||||
"i": 325,
|
||||
"task": {
|
||||
"tid": 1206824904,
|
||||
"id": "s0005_001755",
|
||||
"cat": "B",
|
||||
"mode": "pose",
|
||||
"q0": [
|
||||
-68.225,
|
||||
58.481,
|
||||
-31.386,
|
||||
57.2,
|
||||
-31.831,
|
||||
-80.259
|
||||
],
|
||||
"T": [
|
||||
30.805,
|
||||
353.752,
|
||||
661.419
|
||||
],
|
||||
"R": [
|
||||
0.5493387160259536,
|
||||
0.13571391775309405,
|
||||
0.8245051289125273,
|
||||
-0.09525700289583322,
|
||||
-0.9701190077749987,
|
||||
0.22314841283987508,
|
||||
0.8301524429129026,
|
||||
-0.2011239500451364,
|
||||
-0.5199962290670785
|
||||
],
|
||||
"exec_s": 2.34,
|
||||
"travel": 659.756,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"first_hit_s": 3.0999999046325684,
|
||||
"dls_it": -1,
|
||||
"point_order": [
|
||||
"q0",
|
||||
"previous",
|
||||
"midpoint",
|
||||
"endpoint"
|
||||
],
|
||||
"gap32_mm": [
|
||||
0.5,
|
||||
0.3628082275390625,
|
||||
0.004294395446777344,
|
||||
-0.6861848831176758
|
||||
],
|
||||
"gap64_mm": [
|
||||
0.5,
|
||||
0.3628058862147938,
|
||||
0.004307730814957722,
|
||||
-0.686172816414107
|
||||
],
|
||||
"pair32": [
|
||||
0,
|
||||
18,
|
||||
5,
|
||||
5
|
||||
],
|
||||
"pair64": [
|
||||
0,
|
||||
18,
|
||||
5,
|
||||
5
|
||||
],
|
||||
"boundary_joints": [
|
||||
5
|
||||
],
|
||||
"previous": [
|
||||
-39.524147033691406,
|
||||
54.68175506591797,
|
||||
-18.574026107788086,
|
||||
103.78845977783203,
|
||||
-94.0,
|
||||
-53.657958984375
|
||||
],
|
||||
"endpoint": [
|
||||
-39.42676544189453,
|
||||
55.778987884521484,
|
||||
-18.88759994506836,
|
||||
103.97470092773438,
|
||||
-94.0,
|
||||
-54.84250259399414
|
||||
],
|
||||
"dense_nsegments": 119,
|
||||
"dense_gap64_min_mm": -0.686172816414107
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"config": {
|
||||
"ckpt": "ml/runs/base_dag2_dag1/best.pt",
|
||||
"samples": "ml/data/samples",
|
||||
"tasks": null,
|
||||
"split": "val",
|
||||
"n": 256,
|
||||
"K": 8,
|
||||
"commit": 2,
|
||||
"fb": 2.2,
|
||||
"ki": 0.0,
|
||||
"fb_scale": 0.0,
|
||||
"fb_near": 0.2,
|
||||
"fb_fallback": 0.0,
|
||||
"kdecay": 0.9,
|
||||
"kimax": 0.5,
|
||||
"fb_every": 1,
|
||||
"safety_try": 0,
|
||||
"sel_w": 0.1,
|
||||
"dls_safety": 1,
|
||||
"fb_clear": 0.0,
|
||||
"fb_cmin": 0.3,
|
||||
"sub_refresh": 0,
|
||||
"fb_block_gain": 0.5,
|
||||
"dump": "ml/runs/round30_after_rows.json",
|
||||
"out": "docs/experiment_round30_after.json",
|
||||
"trace": "ml/runs/round30_after.pt",
|
||||
"select": "endpoint",
|
||||
"replan": "empty",
|
||||
"safety": 1,
|
||||
"partial": 1,
|
||||
"max_sec": null,
|
||||
"seed": 0,
|
||||
"dls": "analytic",
|
||||
"device": "cuda"
|
||||
},
|
||||
"batch_size": 256,
|
||||
"batch_seed_rule": "same seed per batch",
|
||||
"checkpoint_sha256": "f7f686fd8ee92fb6948fbcc4ee954636065ad87bb54f661c4f8f575bc16c2ce1",
|
||||
"tasks_sha256": "249bd93457825cda98c59e64d9a096d3473c69aeb3553de1dea6d9e56be71772",
|
||||
"kin_fp": "2ebcbf17",
|
||||
"act_scale": 1.0,
|
||||
"metrics": {
|
||||
"n": 256,
|
||||
"n_ref": 256,
|
||||
"success": 0.57421875,
|
||||
"collision_free_success": 0.57421875,
|
||||
"time_ok_1p3": 0.390625,
|
||||
"collision_rate": 0.0,
|
||||
"collision_steps_mean": 0.0,
|
||||
"travel_ratio_median": 2.4449527263641357,
|
||||
"time_mean_s": 2.3076188564300537,
|
||||
"brakes_mean": 19.25,
|
||||
"start_fail": 0.0,
|
||||
"goal_ratio_2s": 0.20997506380081177,
|
||||
"err_fail_med": 229.68746948242188,
|
||||
"err_success_med": 0.18899640440940857,
|
||||
"dls_share": 0.625,
|
||||
"time_budget": "teacher×2(≥3 s)"
|
||||
},
|
||||
"simulation_wall_s": 248.83432349999202
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"config": {
|
||||
"ckpt": "ml/runs/base_dag2_dag1/best.pt",
|
||||
"samples": "ml/data/samples",
|
||||
"tasks": null,
|
||||
"split": "val",
|
||||
"n": 256,
|
||||
"K": 8,
|
||||
"commit": 2,
|
||||
"fb": 2.2,
|
||||
"ki": 0.0,
|
||||
"fb_scale": 0.0,
|
||||
"fb_near": 0.2,
|
||||
"fb_fallback": 0.0,
|
||||
"kdecay": 0.9,
|
||||
"kimax": 0.5,
|
||||
"fb_every": 1,
|
||||
"safety_try": 0,
|
||||
"sel_w": 0.1,
|
||||
"dls_safety": 1,
|
||||
"fb_clear": 0.0,
|
||||
"fb_cmin": 0.3,
|
||||
"sub_refresh": 0,
|
||||
"fb_block_gain": 0.5,
|
||||
"dump": "ml/runs/round30_before_rows.json",
|
||||
"out": "docs/experiment_round30_before.json",
|
||||
"trace": "ml/runs/round30_before.pt",
|
||||
"select": "endpoint",
|
||||
"replan": "empty",
|
||||
"safety": 1,
|
||||
"partial": 1,
|
||||
"max_sec": null,
|
||||
"seed": 0,
|
||||
"dls": "analytic",
|
||||
"device": "cuda"
|
||||
},
|
||||
"batch_size": 256,
|
||||
"batch_seed_rule": "same seed per batch",
|
||||
"checkpoint_sha256": "f7f686fd8ee92fb6948fbcc4ee954636065ad87bb54f661c4f8f575bc16c2ce1",
|
||||
"tasks_sha256": "249bd93457825cda98c59e64d9a096d3473c69aeb3553de1dea6d9e56be71772",
|
||||
"kin_fp": "2ebcbf17",
|
||||
"act_scale": 1.0,
|
||||
"metrics": {
|
||||
"n": 256,
|
||||
"n_ref": 256,
|
||||
"success": 0.57421875,
|
||||
"collision_free_success": 0.56640625,
|
||||
"time_ok_1p3": 0.390625,
|
||||
"collision_rate": 0.02734375,
|
||||
"collision_steps_mean": 0.0625,
|
||||
"travel_ratio_median": 2.4449527263641357,
|
||||
"time_mean_s": 2.2993197441101074,
|
||||
"brakes_mean": 19.23828125,
|
||||
"start_fail": 0.0,
|
||||
"goal_ratio_2s": 0.20997506380081177,
|
||||
"err_fail_med": 229.68746948242188,
|
||||
"err_success_med": 0.1950554996728897,
|
||||
"dls_share": 0.625,
|
||||
"time_budget": "teacher×2(≥3 s)"
|
||||
},
|
||||
"simulation_wall_s": 247.51454629999353
|
||||
}
|
||||
@@ -0,0 +1,880 @@
|
||||
{
|
||||
"trace": "ml/runs/round30_before.pt",
|
||||
"n": 256,
|
||||
"reported_collision_tasks": 7,
|
||||
"replayed_first_hits32": 7,
|
||||
"replayed_first_hits64": 7,
|
||||
"scope": "Replay reported first hits only; same geometry kernel at float32/float64, not a full safety audit.",
|
||||
"rows": [
|
||||
{
|
||||
"i": 21,
|
||||
"task": {
|
||||
"tid": 1223280991,
|
||||
"id": "s0001_000564",
|
||||
"cat": "A",
|
||||
"mode": "pose",
|
||||
"q0": [
|
||||
178.767,
|
||||
101.917,
|
||||
25.283,
|
||||
31.588,
|
||||
-12.179,
|
||||
-6.464
|
||||
],
|
||||
"T": [
|
||||
320.779,
|
||||
79.294,
|
||||
350.853
|
||||
],
|
||||
"R": [
|
||||
-0.5548626629953249,
|
||||
-0.1382477148217311,
|
||||
-0.820374910976869,
|
||||
-0.29956278115972873,
|
||||
-0.8867511636570162,
|
||||
0.35204334093514156,
|
||||
-0.7761375943462505,
|
||||
0.44108949556693955,
|
||||
0.4506112421399604
|
||||
],
|
||||
"exec_s": 2.86,
|
||||
"travel": 581.023,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"first_hit_s": 5.659999847412109,
|
||||
"dls_it": -1,
|
||||
"point_order": [
|
||||
"q0",
|
||||
"previous",
|
||||
"midpoint",
|
||||
"endpoint"
|
||||
],
|
||||
"gap32_mm": [
|
||||
0.5,
|
||||
0.5,
|
||||
0.35770511627197266,
|
||||
-0.3957242965698242
|
||||
],
|
||||
"gap64_mm": [
|
||||
0.5,
|
||||
0.5,
|
||||
0.3577231796451059,
|
||||
-0.39572636491366353
|
||||
],
|
||||
"pair32": [
|
||||
0,
|
||||
0,
|
||||
5,
|
||||
5
|
||||
],
|
||||
"pair64": [
|
||||
0,
|
||||
0,
|
||||
5,
|
||||
5
|
||||
],
|
||||
"boundary_joints": [
|
||||
5
|
||||
],
|
||||
"previous": [
|
||||
139.78468322753906,
|
||||
87.256591796875,
|
||||
6.928672790527344,
|
||||
103.78778839111328,
|
||||
-94.0,
|
||||
19.4688720703125
|
||||
],
|
||||
"endpoint": [
|
||||
139.50450134277344,
|
||||
87.4175796508789,
|
||||
6.71871280670166,
|
||||
104.29376983642578,
|
||||
-94.0,
|
||||
21.218488693237305
|
||||
],
|
||||
"dense_nsegments": 175,
|
||||
"dense_gap64_min_mm": -0.39572636491366353,
|
||||
"certificate": {
|
||||
"plan_start_it": 282,
|
||||
"step": 0,
|
||||
"checked": true,
|
||||
"endpoint": [
|
||||
139.50450134277344,
|
||||
87.4175796508789,
|
||||
6.71871280670166,
|
||||
104.29376983642578,
|
||||
-95.717529296875,
|
||||
21.218488693237305
|
||||
],
|
||||
"midpoint": [
|
||||
139.64459228515625,
|
||||
87.33708190917969,
|
||||
6.823692798614502,
|
||||
104.04077911376953,
|
||||
-94.8587646484375,
|
||||
20.34368133544922
|
||||
],
|
||||
"recorded_gap32_mm": [
|
||||
0.1606760025024414,
|
||||
0.5
|
||||
],
|
||||
"replayed_gap64_mm": [
|
||||
0.16066912536394184,
|
||||
0.5
|
||||
],
|
||||
"command_delta": [
|
||||
-0.2801789343357086,
|
||||
0.16098570823669434,
|
||||
-0.20995977520942688,
|
||||
0.5059784054756165,
|
||||
-1.717526912689209,
|
||||
1.7496168613433838
|
||||
],
|
||||
"clamped_reconstruction_max_abs_deg": 0.0,
|
||||
"certified_vs_executed_max_abs_deg": 1.717529296875
|
||||
}
|
||||
},
|
||||
{
|
||||
"i": 84,
|
||||
"task": {
|
||||
"tid": 1268963905,
|
||||
"id": "s0002_000538",
|
||||
"cat": "B",
|
||||
"mode": "pose",
|
||||
"q0": [
|
||||
-49.198,
|
||||
52.395,
|
||||
108.796,
|
||||
75.534,
|
||||
82.302,
|
||||
-121.823
|
||||
],
|
||||
"T": [
|
||||
-85.062,
|
||||
275.378,
|
||||
888.929
|
||||
],
|
||||
"R": [
|
||||
0.5139412462799992,
|
||||
-0.4285630099475821,
|
||||
-0.7431003578769356,
|
||||
-0.5533754886400825,
|
||||
-0.8275489878032067,
|
||||
0.09454227286372051,
|
||||
-0.6554692700230204,
|
||||
0.36262435010704513,
|
||||
-0.6624678231921397
|
||||
],
|
||||
"exec_s": 3.2600000000000002,
|
||||
"travel": 349.09,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"first_hit_s": 5.980000019073486,
|
||||
"dls_it": -1,
|
||||
"point_order": [
|
||||
"q0",
|
||||
"previous",
|
||||
"midpoint",
|
||||
"endpoint"
|
||||
],
|
||||
"gap32_mm": [
|
||||
0.5,
|
||||
0.030836105346679688,
|
||||
-0.1565418243408203,
|
||||
-0.11790847778320312
|
||||
],
|
||||
"gap64_mm": [
|
||||
0.5,
|
||||
0.030838235678215753,
|
||||
-0.15655898804830848,
|
||||
-0.11791701257236653
|
||||
],
|
||||
"pair32": [
|
||||
0,
|
||||
6,
|
||||
6,
|
||||
6
|
||||
],
|
||||
"pair64": [
|
||||
0,
|
||||
6,
|
||||
6,
|
||||
6
|
||||
],
|
||||
"boundary_joints": [
|
||||
5
|
||||
],
|
||||
"previous": [
|
||||
-69.87329864501953,
|
||||
36.559112548828125,
|
||||
2.094588279724121,
|
||||
102.22724151611328,
|
||||
89.0,
|
||||
-212.1793212890625
|
||||
],
|
||||
"endpoint": [
|
||||
-69.79582214355469,
|
||||
37.351837158203125,
|
||||
-0.033895254135131836,
|
||||
102.45509338378906,
|
||||
89.0,
|
||||
-214.75440979003906
|
||||
],
|
||||
"dense_nsegments": 258,
|
||||
"dense_gap64_min_mm": -0.16882067924099076,
|
||||
"certificate": {
|
||||
"plan_start_it": 298,
|
||||
"step": 0,
|
||||
"checked": true,
|
||||
"endpoint": [
|
||||
-69.79582214355469,
|
||||
37.351837158203125,
|
||||
-0.033895254135131836,
|
||||
102.45509338378906,
|
||||
89.79981231689453,
|
||||
-214.75440979003906
|
||||
],
|
||||
"midpoint": [
|
||||
-69.83456420898438,
|
||||
36.955474853515625,
|
||||
1.0303465127944946,
|
||||
102.34117126464844,
|
||||
89.39990234375,
|
||||
-213.4668731689453
|
||||
],
|
||||
"recorded_gap32_mm": [
|
||||
0.5,
|
||||
0.20721912384033203
|
||||
],
|
||||
"replayed_gap64_mm": [
|
||||
0.5,
|
||||
0.2071966639119509
|
||||
],
|
||||
"command_delta": [
|
||||
0.07747504115104675,
|
||||
0.7927232980728149,
|
||||
-2.128483533859253,
|
||||
0.22785267233848572,
|
||||
0.7998088598251343,
|
||||
-2.5750951766967773
|
||||
],
|
||||
"clamped_reconstruction_max_abs_deg": 0.0,
|
||||
"certified_vs_executed_max_abs_deg": 0.7998123168945312
|
||||
}
|
||||
},
|
||||
{
|
||||
"i": 145,
|
||||
"task": {
|
||||
"tid": 593213945,
|
||||
"id": "s0003_000414",
|
||||
"cat": "B",
|
||||
"mode": "pose",
|
||||
"q0": [
|
||||
-49.395,
|
||||
84.783,
|
||||
2.744,
|
||||
14.841,
|
||||
-86.783,
|
||||
81.932
|
||||
],
|
||||
"T": [
|
||||
5.391,
|
||||
506.723,
|
||||
383.367
|
||||
],
|
||||
"R": [
|
||||
-0.5269859333114162,
|
||||
-0.7554822816510317,
|
||||
-0.38927156099983334,
|
||||
0.6402732880654818,
|
||||
-0.05172298162073713,
|
||||
-0.7664038424760652,
|
||||
0.5588702377848656,
|
||||
-0.6531242265324508,
|
||||
0.5109724082909718
|
||||
],
|
||||
"exec_s": 2.96,
|
||||
"travel": 560.55,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"first_hit_s": 5.599999904632568,
|
||||
"dls_it": -1,
|
||||
"point_order": [
|
||||
"q0",
|
||||
"previous",
|
||||
"midpoint",
|
||||
"endpoint"
|
||||
],
|
||||
"gap32_mm": [
|
||||
0.5,
|
||||
0.5,
|
||||
0.3180522918701172,
|
||||
-0.19827747344970703
|
||||
],
|
||||
"gap64_mm": [
|
||||
0.5,
|
||||
0.5,
|
||||
0.318071359587325,
|
||||
-0.19825289671655533
|
||||
],
|
||||
"pair32": [
|
||||
0,
|
||||
0,
|
||||
5,
|
||||
5
|
||||
],
|
||||
"pair64": [
|
||||
0,
|
||||
0,
|
||||
5,
|
||||
5
|
||||
],
|
||||
"boundary_joints": [
|
||||
5
|
||||
],
|
||||
"previous": [
|
||||
-36.05080032348633,
|
||||
49.852294921875,
|
||||
22.054914474487305,
|
||||
67.3380126953125,
|
||||
-94.0,
|
||||
79.87274932861328
|
||||
],
|
||||
"endpoint": [
|
||||
-35.60316848754883,
|
||||
48.9223747253418,
|
||||
21.386226654052734,
|
||||
67.87915802001953,
|
||||
-94.0,
|
||||
79.27398681640625
|
||||
],
|
||||
"dense_nsegments": 93,
|
||||
"dense_gap64_min_mm": -0.19825289671655533,
|
||||
"certificate": {
|
||||
"plan_start_it": 278,
|
||||
"step": 1,
|
||||
"checked": true,
|
||||
"endpoint": [
|
||||
-35.60316848754883,
|
||||
48.9223747253418,
|
||||
21.3862247467041,
|
||||
67.87915802001953,
|
||||
-97.17477416992188,
|
||||
79.27399444580078
|
||||
],
|
||||
"midpoint": [
|
||||
-35.82698440551758,
|
||||
49.387332916259766,
|
||||
21.720569610595703,
|
||||
67.60858154296875,
|
||||
-96.70620727539062,
|
||||
79.57337188720703
|
||||
],
|
||||
"recorded_gap32_mm": [
|
||||
0.2614564895629883,
|
||||
0.5
|
||||
],
|
||||
"replayed_gap64_mm": [
|
||||
0.2614702651611598,
|
||||
0.5
|
||||
],
|
||||
"command_delta": [
|
||||
0.4476320445537567,
|
||||
-0.929920494556427,
|
||||
-0.6686887741088867,
|
||||
0.5411425828933716,
|
||||
-0.9371238946914673,
|
||||
-0.5987589359283447
|
||||
],
|
||||
"clamped_reconstruction_max_abs_deg": 0.0,
|
||||
"certified_vs_executed_max_abs_deg": 3.174774169921875
|
||||
}
|
||||
},
|
||||
{
|
||||
"i": 164,
|
||||
"task": {
|
||||
"tid": 1743026973,
|
||||
"id": "s0003_000814",
|
||||
"cat": "C",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
-65.982,
|
||||
5.595,
|
||||
-64.669,
|
||||
-72.912,
|
||||
85.732,
|
||||
-86.377
|
||||
],
|
||||
"T": [
|
||||
-189.354,
|
||||
221.034,
|
||||
302.457
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 2.3000000000000003,
|
||||
"travel": 306.824,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"first_hit_s": 3.0399999618530273,
|
||||
"dls_it": -1,
|
||||
"point_order": [
|
||||
"q0",
|
||||
"previous",
|
||||
"midpoint",
|
||||
"endpoint"
|
||||
],
|
||||
"gap32_mm": [
|
||||
0.5,
|
||||
0.5,
|
||||
0.5,
|
||||
-0.12672901153564453
|
||||
],
|
||||
"gap64_mm": [
|
||||
0.5,
|
||||
0.5,
|
||||
0.5,
|
||||
-0.12673094091899273
|
||||
],
|
||||
"pair32": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
5
|
||||
],
|
||||
"pair64": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
5
|
||||
],
|
||||
"boundary_joints": [
|
||||
5
|
||||
],
|
||||
"previous": [
|
||||
-33.6672248840332,
|
||||
39.63850021362305,
|
||||
-60.174774169921875,
|
||||
-108.2870864868164,
|
||||
88.27082061767578,
|
||||
-74.56200408935547
|
||||
],
|
||||
"endpoint": [
|
||||
-32.8936882019043,
|
||||
39.478729248046875,
|
||||
-58.639915466308594,
|
||||
-107.65913391113281,
|
||||
89.0,
|
||||
-74.92655944824219
|
||||
],
|
||||
"dense_nsegments": 154,
|
||||
"dense_gap64_min_mm": -0.12673094091899273,
|
||||
"certificate": {
|
||||
"plan_start_it": 150,
|
||||
"step": 1,
|
||||
"checked": true,
|
||||
"endpoint": [
|
||||
-32.89369201660156,
|
||||
39.478729248046875,
|
||||
-58.639915466308594,
|
||||
-107.65913391113281,
|
||||
89.33978271484375,
|
||||
-74.92655944824219
|
||||
],
|
||||
"midpoint": [
|
||||
-33.28045654296875,
|
||||
39.55861282348633,
|
||||
-59.407344818115234,
|
||||
-107.97311401367188,
|
||||
88.8052978515625,
|
||||
-74.7442855834961
|
||||
],
|
||||
"recorded_gap32_mm": [
|
||||
0.1356372833251953,
|
||||
0.5
|
||||
],
|
||||
"replayed_gap64_mm": [
|
||||
0.13560383338968585,
|
||||
0.5
|
||||
],
|
||||
"command_delta": [
|
||||
0.773534893989563,
|
||||
-0.15977251529693604,
|
||||
1.534859299659729,
|
||||
0.6279491186141968,
|
||||
1.068959355354309,
|
||||
-0.3645569384098053
|
||||
],
|
||||
"clamped_reconstruction_max_abs_deg": 0.0,
|
||||
"certified_vs_executed_max_abs_deg": 0.33978271484375
|
||||
}
|
||||
},
|
||||
{
|
||||
"i": 175,
|
||||
"task": {
|
||||
"tid": 444406422,
|
||||
"id": "s0003_001100",
|
||||
"cat": "B",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
-28.854,
|
||||
43.33,
|
||||
-137.874,
|
||||
-6.895,
|
||||
-88.001,
|
||||
-43.745
|
||||
],
|
||||
"T": [
|
||||
379.105,
|
||||
293.88,
|
||||
653.541
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 2.58,
|
||||
"travel": 465.057,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"first_hit_s": 0.8399999737739563,
|
||||
"dls_it": 144,
|
||||
"point_order": [
|
||||
"q0",
|
||||
"previous",
|
||||
"midpoint",
|
||||
"endpoint"
|
||||
],
|
||||
"gap32_mm": [
|
||||
0.5,
|
||||
0.4698514938354492,
|
||||
-0.6612262725830078,
|
||||
-0.9359521865844727
|
||||
],
|
||||
"gap64_mm": [
|
||||
0.5,
|
||||
0.4698356780126254,
|
||||
-0.6612412101671552,
|
||||
-0.9359581587234
|
||||
],
|
||||
"pair32": [
|
||||
0,
|
||||
6,
|
||||
6,
|
||||
6
|
||||
],
|
||||
"pair64": [
|
||||
0,
|
||||
6,
|
||||
6,
|
||||
6
|
||||
],
|
||||
"boundary_joints": [
|
||||
5
|
||||
],
|
||||
"previous": [
|
||||
-42.48794937133789,
|
||||
11.756612777709961,
|
||||
-124.7530288696289,
|
||||
-46.12489700317383,
|
||||
-94.0,
|
||||
-54.57075500488281
|
||||
],
|
||||
"endpoint": [
|
||||
-42.73639678955078,
|
||||
10.6148681640625,
|
||||
-124.47537231445312,
|
||||
-48.52891159057617,
|
||||
-94.0,
|
||||
-55.451263427734375
|
||||
],
|
||||
"dense_nsegments": 241,
|
||||
"dense_gap64_min_mm": -0.9544276230224238,
|
||||
"certificate": {
|
||||
"plan_start_it": 40,
|
||||
"step": 1,
|
||||
"checked": true,
|
||||
"endpoint": [
|
||||
-42.73639678955078,
|
||||
10.6148681640625,
|
||||
-124.47537231445312,
|
||||
-48.52891159057617,
|
||||
-98.31655883789062,
|
||||
-55.45126724243164
|
||||
],
|
||||
"midpoint": [
|
||||
-42.61217498779297,
|
||||
11.18574047088623,
|
||||
-124.61420440673828,
|
||||
-47.326904296875,
|
||||
-97.59821319580078,
|
||||
-55.011009216308594
|
||||
],
|
||||
"recorded_gap32_mm": [
|
||||
0.5,
|
||||
0.5
|
||||
],
|
||||
"replayed_gap64_mm": [
|
||||
0.5,
|
||||
0.5
|
||||
],
|
||||
"command_delta": [
|
||||
-0.24844767153263092,
|
||||
-1.1417450904846191,
|
||||
0.27765607833862305,
|
||||
-2.4040162563323975,
|
||||
-1.4366930723190308,
|
||||
-0.8805096745491028
|
||||
],
|
||||
"clamped_reconstruction_max_abs_deg": 0.0,
|
||||
"certified_vs_executed_max_abs_deg": 4.316558837890625
|
||||
}
|
||||
},
|
||||
{
|
||||
"i": 180,
|
||||
"task": {
|
||||
"tid": 737760595,
|
||||
"id": "s0003_001280",
|
||||
"cat": "B",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
41.213,
|
||||
49.353,
|
||||
-149.808,
|
||||
-8.981,
|
||||
-88.566,
|
||||
83.45
|
||||
],
|
||||
"T": [
|
||||
118.145,
|
||||
2.733,
|
||||
266.082
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 1.78,
|
||||
"travel": 228.67,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"first_hit_s": 1.1399999856948853,
|
||||
"dls_it": 102,
|
||||
"point_order": [
|
||||
"q0",
|
||||
"previous",
|
||||
"midpoint",
|
||||
"endpoint"
|
||||
],
|
||||
"gap32_mm": [
|
||||
0.5,
|
||||
0.06517887115478516,
|
||||
-0.0172576904296875,
|
||||
0.013133049011230469
|
||||
],
|
||||
"gap64_mm": [
|
||||
0.5,
|
||||
0.06521150921177998,
|
||||
-0.017227151210720493,
|
||||
0.013145878955246104
|
||||
],
|
||||
"pair32": [
|
||||
0,
|
||||
5,
|
||||
5,
|
||||
5
|
||||
],
|
||||
"pair64": [
|
||||
0,
|
||||
5,
|
||||
5,
|
||||
5
|
||||
],
|
||||
"boundary_joints": [
|
||||
5
|
||||
],
|
||||
"previous": [
|
||||
1.8212896585464478,
|
||||
-9.327469825744629,
|
||||
-150.87704467773438,
|
||||
-23.00735855102539,
|
||||
-94.0,
|
||||
93.73664855957031
|
||||
],
|
||||
"endpoint": [
|
||||
1.3598560094833374,
|
||||
-9.66404914855957,
|
||||
-150.52992248535156,
|
||||
-23.200042724609375,
|
||||
-94.0,
|
||||
92.69589233398438
|
||||
],
|
||||
"dense_nsegments": 105,
|
||||
"dense_gap64_min_mm": -0.020246891242656773,
|
||||
"certificate": {
|
||||
"plan_start_it": 56,
|
||||
"step": 0,
|
||||
"checked": true,
|
||||
"endpoint": [
|
||||
1.3598560094833374,
|
||||
-9.66404914855957,
|
||||
-150.52992248535156,
|
||||
-23.200042724609375,
|
||||
-95.86970520019531,
|
||||
92.69589233398438
|
||||
],
|
||||
"midpoint": [
|
||||
1.5905728340148926,
|
||||
-9.495759010314941,
|
||||
-150.70347595214844,
|
||||
-23.103700637817383,
|
||||
-94.93485260009766,
|
||||
93.21627044677734
|
||||
],
|
||||
"recorded_gap32_mm": [
|
||||
0.5,
|
||||
0.20821666717529297
|
||||
],
|
||||
"replayed_gap64_mm": [
|
||||
0.5,
|
||||
0.20822553884000428
|
||||
],
|
||||
"command_delta": [
|
||||
-0.46143364906311035,
|
||||
-0.33657926321029663,
|
||||
0.3471294939517975,
|
||||
-0.19268345832824707,
|
||||
-1.8697090148925781,
|
||||
-1.0407572984695435
|
||||
],
|
||||
"clamped_reconstruction_max_abs_deg": 0.0,
|
||||
"certified_vs_executed_max_abs_deg": 1.8697052001953125
|
||||
}
|
||||
},
|
||||
{
|
||||
"i": 215,
|
||||
"task": {
|
||||
"tid": 169730876,
|
||||
"id": "s0004_000544",
|
||||
"cat": "B",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
47.051,
|
||||
-1.179,
|
||||
-94.31,
|
||||
-43.128,
|
||||
67.067,
|
||||
-119.867
|
||||
],
|
||||
"T": [
|
||||
-142.696,
|
||||
-139.159,
|
||||
726.163
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 2.16,
|
||||
"travel": 461.684,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"first_hit_s": 3.5399999618530273,
|
||||
"dls_it": -1,
|
||||
"point_order": [
|
||||
"q0",
|
||||
"previous",
|
||||
"midpoint",
|
||||
"endpoint"
|
||||
],
|
||||
"gap32_mm": [
|
||||
0.5,
|
||||
0.5,
|
||||
0.5,
|
||||
-0.08817481994628906
|
||||
],
|
||||
"gap64_mm": [
|
||||
0.5,
|
||||
0.5,
|
||||
0.5,
|
||||
-0.08817155079043282
|
||||
],
|
||||
"pair32": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
6
|
||||
],
|
||||
"pair64": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
6
|
||||
],
|
||||
"boundary_joints": [
|
||||
5
|
||||
],
|
||||
"previous": [
|
||||
34.57734298706055,
|
||||
32.23564910888672,
|
||||
-71.76512908935547,
|
||||
10.783411979675293,
|
||||
88.44934844970703,
|
||||
-105.16633605957031
|
||||
],
|
||||
"endpoint": [
|
||||
34.31901931762695,
|
||||
33.24732208251953,
|
||||
-72.12022399902344,
|
||||
10.171412467956543,
|
||||
89.0,
|
||||
-106.89080810546875
|
||||
],
|
||||
"dense_nsegments": 173,
|
||||
"dense_gap64_min_mm": -0.08817155079043282,
|
||||
"certificate": {
|
||||
"plan_start_it": 176,
|
||||
"step": 0,
|
||||
"checked": true,
|
||||
"endpoint": [
|
||||
34.31901931762695,
|
||||
33.24732208251953,
|
||||
-72.12022399902344,
|
||||
10.171412467956543,
|
||||
89.79435729980469,
|
||||
-106.89080810546875
|
||||
],
|
||||
"midpoint": [
|
||||
34.44818115234375,
|
||||
32.741485595703125,
|
||||
-71.94267272949219,
|
||||
10.477412223815918,
|
||||
89.12185668945312,
|
||||
-106.02857208251953
|
||||
],
|
||||
"recorded_gap32_mm": [
|
||||
0.2809743881225586,
|
||||
0.5
|
||||
],
|
||||
"replayed_gap64_mm": [
|
||||
0.28098007564065064,
|
||||
0.5
|
||||
],
|
||||
"command_delta": [
|
||||
-0.2583238482475281,
|
||||
1.011674404144287,
|
||||
-0.3550943434238434,
|
||||
-0.6119998693466187,
|
||||
1.3450126647949219,
|
||||
-1.7244750261306763
|
||||
],
|
||||
"clamped_reconstruction_max_abs_deg": 0.0,
|
||||
"certified_vs_executed_max_abs_deg": 0.7943572998046875
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"tasks_sha256": "249bd93457825cda98c59e64d9a096d3473c69aeb3553de1dea6d9e56be71772",
|
||||
"checkpoint_sha256": "f7f686fd8ee92fb6948fbcc4ee954636065ad87bb54f661c4f8f575bc16c2ce1",
|
||||
"same_config_except_output_paths": true,
|
||||
"instrumentation_vs_round29_first_batch_max_abs_deg": 0.0,
|
||||
"reached_only_after": [],
|
||||
"reached_only_before": [],
|
||||
"collision_tasks_before": [
|
||||
21,
|
||||
84,
|
||||
145,
|
||||
164,
|
||||
175,
|
||||
180,
|
||||
215
|
||||
],
|
||||
"collision_tasks_after": [],
|
||||
"statistics": {
|
||||
"before": {
|
||||
"active_certified_steps": 34069,
|
||||
"certificate_endpoint_mismatch_gt_0p001deg": 5298,
|
||||
"certificate_endpoint_max_abs_deg": 7.587158203125,
|
||||
"certificate_midpoint_max_abs_deg": 5.78558349609375,
|
||||
"uncertified_moving_steps": 0,
|
||||
"executed_speed_ratio_max": 1.660003662109375,
|
||||
"executed_speed_limit_violating_tasks": 256,
|
||||
"executed_speed_max_deg_s": [
|
||||
99.6002197265625,
|
||||
99.60002899169922,
|
||||
149.40032958984375,
|
||||
149.400146484375,
|
||||
199.20005798339844,
|
||||
298.80029296875
|
||||
],
|
||||
"executed_travel_ratio_median_success": 2.4250845909118652,
|
||||
"commanded_travel_ratio_median_success": 2.4449527263641357
|
||||
},
|
||||
"after": {
|
||||
"active_certified_steps": 34107,
|
||||
"certificate_endpoint_mismatch_gt_0p001deg": 0,
|
||||
"certificate_endpoint_max_abs_deg": 0.0,
|
||||
"certificate_midpoint_max_abs_deg": 0.0,
|
||||
"uncertified_moving_steps": 0,
|
||||
"executed_speed_ratio_max": 1.660003662109375,
|
||||
"executed_speed_limit_violating_tasks": 256,
|
||||
"executed_speed_max_deg_s": [
|
||||
99.6002197265625,
|
||||
99.60002899169922,
|
||||
149.40032958984375,
|
||||
149.400146484375,
|
||||
199.20005798339844,
|
||||
298.80029296875
|
||||
],
|
||||
"executed_travel_ratio_median_success": 2.4250845909118652,
|
||||
"commanded_travel_ratio_median_success": 2.4449527263641357
|
||||
}
|
||||
},
|
||||
"cpu_prediction_microbenchmark": {
|
||||
"scope": "B=1, commit=2, 100 warmups then 1000 serial calls, CPU one thread; not full planning latency",
|
||||
"before_p50_ms": 0.0388,
|
||||
"before_p99_ms": 0.069102,
|
||||
"after_p50_ms": 0.0518,
|
||||
"after_p99_ms": 0.093933
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,485 @@
|
||||
{
|
||||
"trace": "ml/runs/round30_after.pt",
|
||||
"tasks_sha256": "249bd93457825cda98c59e64d9a096d3473c69aeb3553de1dea6d9e56be71772",
|
||||
"kin_fp": "2ebcbf17",
|
||||
"indices": [
|
||||
0,
|
||||
21,
|
||||
84,
|
||||
128,
|
||||
145,
|
||||
164,
|
||||
175,
|
||||
180,
|
||||
197,
|
||||
215,
|
||||
224,
|
||||
255
|
||||
],
|
||||
"max_step_deg": 0.05,
|
||||
"dtype": "float64",
|
||||
"device": "cuda",
|
||||
"scope": "Executed trajectory through each task deadline or arrival, including initial state; finite sampling, not continuous certification.",
|
||||
"collision_tasks": 1,
|
||||
"rows": [
|
||||
{
|
||||
"i": 0,
|
||||
"task": {
|
||||
"tid": 919549409,
|
||||
"id": "s0001_000001",
|
||||
"cat": "B",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
-129.897,
|
||||
46.68,
|
||||
43.494,
|
||||
-97.461,
|
||||
-85.102,
|
||||
-139.71
|
||||
],
|
||||
"T": [
|
||||
-116.172,
|
||||
268.408,
|
||||
179.282
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 3.48,
|
||||
"travel": 345.324,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 174,
|
||||
"sampled_points": 6211,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": 0.02673023799951224,
|
||||
"collision_segments": 0,
|
||||
"first_collision_s": null
|
||||
},
|
||||
{
|
||||
"i": 21,
|
||||
"task": {
|
||||
"tid": 1223280991,
|
||||
"id": "s0001_000564",
|
||||
"cat": "A",
|
||||
"mode": "pose",
|
||||
"q0": [
|
||||
178.767,
|
||||
101.917,
|
||||
25.283,
|
||||
31.588,
|
||||
-12.179,
|
||||
-6.464
|
||||
],
|
||||
"T": [
|
||||
320.779,
|
||||
79.294,
|
||||
350.853
|
||||
],
|
||||
"R": [
|
||||
-0.5548626629953249,
|
||||
-0.1382477148217311,
|
||||
-0.820374910976869,
|
||||
-0.29956278115972873,
|
||||
-0.8867511636570162,
|
||||
0.35204334093514156,
|
||||
-0.7761375943462505,
|
||||
0.44108949556693955,
|
||||
0.4506112421399604
|
||||
],
|
||||
"exec_s": 2.86,
|
||||
"travel": 581.023,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 286,
|
||||
"sampled_points": 6059,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": 0.009057896844284485,
|
||||
"collision_segments": 0,
|
||||
"first_collision_s": null
|
||||
},
|
||||
{
|
||||
"i": 84,
|
||||
"task": {
|
||||
"tid": 1268963905,
|
||||
"id": "s0002_000538",
|
||||
"cat": "B",
|
||||
"mode": "pose",
|
||||
"q0": [
|
||||
-49.198,
|
||||
52.395,
|
||||
108.796,
|
||||
75.534,
|
||||
82.302,
|
||||
-121.823
|
||||
],
|
||||
"T": [
|
||||
-85.062,
|
||||
275.378,
|
||||
888.929
|
||||
],
|
||||
"R": [
|
||||
0.5139412462799992,
|
||||
-0.4285630099475821,
|
||||
-0.7431003578769356,
|
||||
-0.5533754886400825,
|
||||
-0.8275489878032067,
|
||||
0.09454227286372051,
|
||||
-0.6554692700230204,
|
||||
0.36262435010704513,
|
||||
-0.6624678231921397
|
||||
],
|
||||
"exec_s": 3.2600000000000002,
|
||||
"travel": 349.09,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 326,
|
||||
"sampled_points": 6251,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": 0.006206321604070197,
|
||||
"collision_segments": 0,
|
||||
"first_collision_s": null
|
||||
},
|
||||
{
|
||||
"i": 128,
|
||||
"task": {
|
||||
"tid": 408952743,
|
||||
"id": "s0002_001588",
|
||||
"cat": "A",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
-153.539,
|
||||
100.454,
|
||||
108.434,
|
||||
3.379,
|
||||
70.254,
|
||||
-179.848
|
||||
],
|
||||
"T": [
|
||||
-324.009,
|
||||
70.778,
|
||||
919.477
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 0.8200000000000001,
|
||||
"travel": 121.056,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 63,
|
||||
"sampled_points": 2403,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": 0.5,
|
||||
"collision_segments": 0,
|
||||
"first_collision_s": null
|
||||
},
|
||||
{
|
||||
"i": 145,
|
||||
"task": {
|
||||
"tid": 593213945,
|
||||
"id": "s0003_000414",
|
||||
"cat": "B",
|
||||
"mode": "pose",
|
||||
"q0": [
|
||||
-49.395,
|
||||
84.783,
|
||||
2.744,
|
||||
14.841,
|
||||
-86.783,
|
||||
81.932
|
||||
],
|
||||
"T": [
|
||||
5.391,
|
||||
506.723,
|
||||
383.367
|
||||
],
|
||||
"R": [
|
||||
-0.5269859333114162,
|
||||
-0.7554822816510317,
|
||||
-0.38927156099983334,
|
||||
0.6402732880654818,
|
||||
-0.05172298162073713,
|
||||
-0.7664038424760652,
|
||||
0.5588702377848656,
|
||||
-0.6531242265324508,
|
||||
0.5109724082909718
|
||||
],
|
||||
"exec_s": 2.96,
|
||||
"travel": 560.55,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 296,
|
||||
"sampled_points": 4509,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": 0.002145835308116517,
|
||||
"collision_segments": 0,
|
||||
"first_collision_s": null
|
||||
},
|
||||
{
|
||||
"i": 164,
|
||||
"task": {
|
||||
"tid": 1743026973,
|
||||
"id": "s0003_000814",
|
||||
"cat": "C",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
-65.982,
|
||||
5.595,
|
||||
-64.669,
|
||||
-72.912,
|
||||
85.732,
|
||||
-86.377
|
||||
],
|
||||
"T": [
|
||||
-189.354,
|
||||
221.034,
|
||||
302.457
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 2.3000000000000003,
|
||||
"travel": 306.824,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 230,
|
||||
"sampled_points": 3985,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": 0.008857213584009926,
|
||||
"collision_segments": 0,
|
||||
"first_collision_s": null
|
||||
},
|
||||
{
|
||||
"i": 175,
|
||||
"task": {
|
||||
"tid": 444406422,
|
||||
"id": "s0003_001100",
|
||||
"cat": "B",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
-28.854,
|
||||
43.33,
|
||||
-137.874,
|
||||
-6.895,
|
||||
-88.001,
|
||||
-43.745
|
||||
],
|
||||
"T": [
|
||||
379.105,
|
||||
293.88,
|
||||
653.541
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 2.58,
|
||||
"travel": 465.057,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 143,
|
||||
"sampled_points": 5547,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": 0.18812628629569694,
|
||||
"collision_segments": 0,
|
||||
"first_collision_s": null
|
||||
},
|
||||
{
|
||||
"i": 180,
|
||||
"task": {
|
||||
"tid": 737760595,
|
||||
"id": "s0003_001280",
|
||||
"cat": "B",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
41.213,
|
||||
49.353,
|
||||
-149.808,
|
||||
-8.981,
|
||||
-88.566,
|
||||
83.45
|
||||
],
|
||||
"T": [
|
||||
118.145,
|
||||
2.733,
|
||||
266.082
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 1.78,
|
||||
"travel": 228.67,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 95,
|
||||
"sampled_points": 3153,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": -0.1492959159660998,
|
||||
"collision_segments": 1,
|
||||
"first_collision_s": 1.0915789473684212
|
||||
},
|
||||
{
|
||||
"i": 197,
|
||||
"task": {
|
||||
"tid": 1433345185,
|
||||
"id": "s0004_000020",
|
||||
"cat": "B",
|
||||
"mode": "pose",
|
||||
"q0": [
|
||||
20.112,
|
||||
-20.013,
|
||||
-177.85,
|
||||
32.746,
|
||||
-70.888,
|
||||
-30.111
|
||||
],
|
||||
"T": [
|
||||
-288.364,
|
||||
63.606,
|
||||
672.54
|
||||
],
|
||||
"R": [
|
||||
-0.5335375732231524,
|
||||
-0.7509294450860695,
|
||||
0.38915630081225366,
|
||||
-0.8443344656004893,
|
||||
0.4997538915602813,
|
||||
-0.19324947107169785,
|
||||
-0.049365657681080755,
|
||||
-0.4316839311036288,
|
||||
-0.9006730902323173
|
||||
],
|
||||
"exec_s": 2.14,
|
||||
"travel": 634.022,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 214,
|
||||
"sampled_points": 4641,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": 0.0010684324191032601,
|
||||
"collision_segments": 0,
|
||||
"first_collision_s": null
|
||||
},
|
||||
{
|
||||
"i": 215,
|
||||
"task": {
|
||||
"tid": 169730876,
|
||||
"id": "s0004_000544",
|
||||
"cat": "B",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
47.051,
|
||||
-1.179,
|
||||
-94.31,
|
||||
-43.128,
|
||||
67.067,
|
||||
-119.867
|
||||
],
|
||||
"T": [
|
||||
-142.696,
|
||||
-139.159,
|
||||
726.163
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 2.16,
|
||||
"travel": 461.684,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 216,
|
||||
"sampled_points": 6605,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": 0.2112382958686112,
|
||||
"collision_segments": 0,
|
||||
"first_collision_s": null
|
||||
},
|
||||
{
|
||||
"i": 224,
|
||||
"task": {
|
||||
"tid": 1884410379,
|
||||
"id": "s0004_000721",
|
||||
"cat": "A",
|
||||
"mode": "pose",
|
||||
"q0": [
|
||||
-127.447,
|
||||
7.845,
|
||||
-124.228,
|
||||
-20.968,
|
||||
-21.51,
|
||||
-35.505
|
||||
],
|
||||
"T": [
|
||||
-233.158,
|
||||
-59.78,
|
||||
648.987
|
||||
],
|
||||
"R": [
|
||||
0.3964618999442966,
|
||||
-0.020495209950317686,
|
||||
0.9178223729358808,
|
||||
-0.8179090164279511,
|
||||
0.4461640898622928,
|
||||
0.3632663564978371,
|
||||
-0.41694460392049726,
|
||||
-0.8947164641865291,
|
||||
0.1601238457417738
|
||||
],
|
||||
"exec_s": 1.48,
|
||||
"travel": 356.988,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 128,
|
||||
"sampled_points": 4707,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": 0.0041216155493710716,
|
||||
"collision_segments": 0,
|
||||
"first_collision_s": null
|
||||
},
|
||||
{
|
||||
"i": 255,
|
||||
"task": {
|
||||
"tid": 712677274,
|
||||
"id": "s0004_001686",
|
||||
"cat": "C",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
-65.548,
|
||||
71.865,
|
||||
27.462,
|
||||
-75.048,
|
||||
60.325,
|
||||
151.872
|
||||
],
|
||||
"T": [
|
||||
-53.154,
|
||||
50.204,
|
||||
397.489
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 1.84,
|
||||
"travel": 238.182,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 184,
|
||||
"sampled_points": 2495,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": 0.004616787795093558,
|
||||
"collision_segments": 0,
|
||||
"first_collision_s": null
|
||||
}
|
||||
],
|
||||
"audit_wall_s": 15.056756100006169
|
||||
}
|
||||
@@ -0,0 +1,485 @@
|
||||
{
|
||||
"trace": "ml/runs/round30_before.pt",
|
||||
"tasks_sha256": "249bd93457825cda98c59e64d9a096d3473c69aeb3553de1dea6d9e56be71772",
|
||||
"kin_fp": "2ebcbf17",
|
||||
"indices": [
|
||||
0,
|
||||
21,
|
||||
84,
|
||||
128,
|
||||
145,
|
||||
164,
|
||||
175,
|
||||
180,
|
||||
197,
|
||||
215,
|
||||
224,
|
||||
255
|
||||
],
|
||||
"max_step_deg": 0.05,
|
||||
"dtype": "float64",
|
||||
"device": "cuda",
|
||||
"scope": "Executed trajectory through each task deadline or arrival, including initial state; finite sampling, not continuous certification.",
|
||||
"collision_tasks": 7,
|
||||
"rows": [
|
||||
{
|
||||
"i": 0,
|
||||
"task": {
|
||||
"tid": 919549409,
|
||||
"id": "s0001_000001",
|
||||
"cat": "B",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
-129.897,
|
||||
46.68,
|
||||
43.494,
|
||||
-97.461,
|
||||
-85.102,
|
||||
-139.71
|
||||
],
|
||||
"T": [
|
||||
-116.172,
|
||||
268.408,
|
||||
179.282
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 3.48,
|
||||
"travel": 345.324,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 174,
|
||||
"sampled_points": 6211,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": 0.02673023799951224,
|
||||
"collision_segments": 0,
|
||||
"first_collision_s": null
|
||||
},
|
||||
{
|
||||
"i": 21,
|
||||
"task": {
|
||||
"tid": 1223280991,
|
||||
"id": "s0001_000564",
|
||||
"cat": "A",
|
||||
"mode": "pose",
|
||||
"q0": [
|
||||
178.767,
|
||||
101.917,
|
||||
25.283,
|
||||
31.588,
|
||||
-12.179,
|
||||
-6.464
|
||||
],
|
||||
"T": [
|
||||
320.779,
|
||||
79.294,
|
||||
350.853
|
||||
],
|
||||
"R": [
|
||||
-0.5548626629953249,
|
||||
-0.1382477148217311,
|
||||
-0.820374910976869,
|
||||
-0.29956278115972873,
|
||||
-0.8867511636570162,
|
||||
0.35204334093514156,
|
||||
-0.7761375943462505,
|
||||
0.44108949556693955,
|
||||
0.4506112421399604
|
||||
],
|
||||
"exec_s": 2.86,
|
||||
"travel": 581.023,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 286,
|
||||
"sampled_points": 6099,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": -0.39572636491366353,
|
||||
"collision_segments": 2,
|
||||
"first_collision_s": 5.655
|
||||
},
|
||||
{
|
||||
"i": 84,
|
||||
"task": {
|
||||
"tid": 1268963905,
|
||||
"id": "s0002_000538",
|
||||
"cat": "B",
|
||||
"mode": "pose",
|
||||
"q0": [
|
||||
-49.198,
|
||||
52.395,
|
||||
108.796,
|
||||
75.534,
|
||||
82.302,
|
||||
-121.823
|
||||
],
|
||||
"T": [
|
||||
-85.062,
|
||||
275.378,
|
||||
888.929
|
||||
],
|
||||
"R": [
|
||||
0.5139412462799992,
|
||||
-0.4285630099475821,
|
||||
-0.7431003578769356,
|
||||
-0.5533754886400825,
|
||||
-0.8275489878032067,
|
||||
0.09454227286372051,
|
||||
-0.6554692700230204,
|
||||
0.36262435010704513,
|
||||
-0.6624678231921397
|
||||
],
|
||||
"exec_s": 3.2600000000000002,
|
||||
"travel": 349.09,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 326,
|
||||
"sampled_points": 6037,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": -0.16878710314368206,
|
||||
"collision_segments": 3,
|
||||
"first_collision_s": 5.961153846153847
|
||||
},
|
||||
{
|
||||
"i": 128,
|
||||
"task": {
|
||||
"tid": 408952743,
|
||||
"id": "s0002_001588",
|
||||
"cat": "A",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
-153.539,
|
||||
100.454,
|
||||
108.434,
|
||||
3.379,
|
||||
70.254,
|
||||
-179.848
|
||||
],
|
||||
"T": [
|
||||
-324.009,
|
||||
70.778,
|
||||
919.477
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 0.8200000000000001,
|
||||
"travel": 121.056,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 63,
|
||||
"sampled_points": 2403,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": 0.5,
|
||||
"collision_segments": 0,
|
||||
"first_collision_s": null
|
||||
},
|
||||
{
|
||||
"i": 145,
|
||||
"task": {
|
||||
"tid": 593213945,
|
||||
"id": "s0003_000414",
|
||||
"cat": "B",
|
||||
"mode": "pose",
|
||||
"q0": [
|
||||
-49.395,
|
||||
84.783,
|
||||
2.744,
|
||||
14.841,
|
||||
-86.783,
|
||||
81.932
|
||||
],
|
||||
"T": [
|
||||
5.391,
|
||||
506.723,
|
||||
383.367
|
||||
],
|
||||
"R": [
|
||||
-0.5269859333114162,
|
||||
-0.7554822816510317,
|
||||
-0.38927156099983334,
|
||||
0.6402732880654818,
|
||||
-0.05172298162073713,
|
||||
-0.7664038424760652,
|
||||
0.5588702377848656,
|
||||
-0.6531242265324508,
|
||||
0.5109724082909718
|
||||
],
|
||||
"exec_s": 2.96,
|
||||
"travel": 560.55,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 296,
|
||||
"sampled_points": 4489,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": -0.19825289671655533,
|
||||
"collision_segments": 5,
|
||||
"first_collision_s": 5.597
|
||||
},
|
||||
{
|
||||
"i": 164,
|
||||
"task": {
|
||||
"tid": 1743026973,
|
||||
"id": "s0003_000814",
|
||||
"cat": "C",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
-65.982,
|
||||
5.595,
|
||||
-64.669,
|
||||
-72.912,
|
||||
85.732,
|
||||
-86.377
|
||||
],
|
||||
"T": [
|
||||
-189.354,
|
||||
221.034,
|
||||
302.457
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 2.3000000000000003,
|
||||
"travel": 306.824,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 230,
|
||||
"sampled_points": 3865,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": -0.12673094091895543,
|
||||
"collision_segments": 4,
|
||||
"first_collision_s": 3.0387500000000003
|
||||
},
|
||||
{
|
||||
"i": 175,
|
||||
"task": {
|
||||
"tid": 444406422,
|
||||
"id": "s0003_001100",
|
||||
"cat": "B",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
-28.854,
|
||||
43.33,
|
||||
-137.874,
|
||||
-6.895,
|
||||
-88.001,
|
||||
-43.745
|
||||
],
|
||||
"T": [
|
||||
379.105,
|
||||
293.88,
|
||||
653.541
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 2.58,
|
||||
"travel": 465.057,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 145,
|
||||
"sampled_points": 5769,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": -0.954427674326439,
|
||||
"collision_segments": 2,
|
||||
"first_collision_s": 0.8236
|
||||
},
|
||||
{
|
||||
"i": 180,
|
||||
"task": {
|
||||
"tid": 737760595,
|
||||
"id": "s0003_001280",
|
||||
"cat": "B",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
41.213,
|
||||
49.353,
|
||||
-149.808,
|
||||
-8.981,
|
||||
-88.566,
|
||||
83.45
|
||||
],
|
||||
"T": [
|
||||
118.145,
|
||||
2.733,
|
||||
266.082
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 1.78,
|
||||
"travel": 228.67,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 103,
|
||||
"sampled_points": 3385,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": -0.1492959159660998,
|
||||
"collision_segments": 2,
|
||||
"first_collision_s": 1.0915789473684212
|
||||
},
|
||||
{
|
||||
"i": 197,
|
||||
"task": {
|
||||
"tid": 1433345185,
|
||||
"id": "s0004_000020",
|
||||
"cat": "B",
|
||||
"mode": "pose",
|
||||
"q0": [
|
||||
20.112,
|
||||
-20.013,
|
||||
-177.85,
|
||||
32.746,
|
||||
-70.888,
|
||||
-30.111
|
||||
],
|
||||
"T": [
|
||||
-288.364,
|
||||
63.606,
|
||||
672.54
|
||||
],
|
||||
"R": [
|
||||
-0.5335375732231524,
|
||||
-0.7509294450860695,
|
||||
0.38915630081225366,
|
||||
-0.8443344656004893,
|
||||
0.4997538915602813,
|
||||
-0.19324947107169785,
|
||||
-0.049365657681080755,
|
||||
-0.4316839311036288,
|
||||
-0.9006730902323173
|
||||
],
|
||||
"exec_s": 2.14,
|
||||
"travel": 634.022,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 214,
|
||||
"sampled_points": 4317,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": 0.0010684324191032601,
|
||||
"collision_segments": 0,
|
||||
"first_collision_s": null
|
||||
},
|
||||
{
|
||||
"i": 215,
|
||||
"task": {
|
||||
"tid": 169730876,
|
||||
"id": "s0004_000544",
|
||||
"cat": "B",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
47.051,
|
||||
-1.179,
|
||||
-94.31,
|
||||
-43.128,
|
||||
67.067,
|
||||
-119.867
|
||||
],
|
||||
"T": [
|
||||
-142.696,
|
||||
-139.159,
|
||||
726.163
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 2.16,
|
||||
"travel": 461.684,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 216,
|
||||
"sampled_points": 6341,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": -0.08817155079042394,
|
||||
"collision_segments": 3,
|
||||
"first_collision_s": 3.538888888888889
|
||||
},
|
||||
{
|
||||
"i": 224,
|
||||
"task": {
|
||||
"tid": 1884410379,
|
||||
"id": "s0004_000721",
|
||||
"cat": "A",
|
||||
"mode": "pose",
|
||||
"q0": [
|
||||
-127.447,
|
||||
7.845,
|
||||
-124.228,
|
||||
-20.968,
|
||||
-21.51,
|
||||
-35.505
|
||||
],
|
||||
"T": [
|
||||
-233.158,
|
||||
-59.78,
|
||||
648.987
|
||||
],
|
||||
"R": [
|
||||
0.3964618999442966,
|
||||
-0.020495209950317686,
|
||||
0.9178223729358808,
|
||||
-0.8179090164279511,
|
||||
0.4461640898622928,
|
||||
0.3632663564978371,
|
||||
-0.41694460392049726,
|
||||
-0.8947164641865291,
|
||||
0.1601238457417738
|
||||
],
|
||||
"exec_s": 1.48,
|
||||
"travel": 356.988,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 128,
|
||||
"sampled_points": 4707,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": 0.0041216155493710716,
|
||||
"collision_segments": 0,
|
||||
"first_collision_s": null
|
||||
},
|
||||
{
|
||||
"i": 255,
|
||||
"task": {
|
||||
"tid": 712677274,
|
||||
"id": "s0004_001686",
|
||||
"cat": "C",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
-65.548,
|
||||
71.865,
|
||||
27.462,
|
||||
-75.048,
|
||||
60.325,
|
||||
151.872
|
||||
],
|
||||
"T": [
|
||||
-53.154,
|
||||
50.204,
|
||||
397.489
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 1.84,
|
||||
"travel": 238.182,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"steps": 184,
|
||||
"sampled_points": 2495,
|
||||
"initial_gap64_mm": 0.5,
|
||||
"min_gap64_mm": 0.004616787795093558,
|
||||
"collision_segments": 0,
|
||||
"first_collision_s": null
|
||||
}
|
||||
],
|
||||
"audit_wall_s": 14.869853199998033
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"task_index": 180,
|
||||
"task": {
|
||||
"tid": 737760595,
|
||||
"id": "s0003_001280",
|
||||
"cat": "B",
|
||||
"mode": "pos",
|
||||
"q0": [
|
||||
41.213,
|
||||
49.353,
|
||||
-149.808,
|
||||
-8.981,
|
||||
-88.566,
|
||||
83.45
|
||||
],
|
||||
"T": [
|
||||
118.145,
|
||||
2.733,
|
||||
266.082
|
||||
],
|
||||
"R": null,
|
||||
"exec_s": 1.78,
|
||||
"travel": 228.67,
|
||||
"reached": true,
|
||||
"err": 0,
|
||||
"split": "val"
|
||||
},
|
||||
"segment_start_it": 54,
|
||||
"start_s": 1.08,
|
||||
"end_s": 1.1,
|
||||
"original_discrete_col": 0,
|
||||
"certified": true,
|
||||
"recorded_endpoint_midpoint_gap32_mm": [
|
||||
0.0651998519897461,
|
||||
0.11720466613769531
|
||||
],
|
||||
"previous_midpoint_endpoint_gap64_mm": [
|
||||
0.5,
|
||||
0.11723191087430074,
|
||||
0.06521150921177998
|
||||
],
|
||||
"previous": [
|
||||
3.0118656158447266,
|
||||
-7.4926042556762695,
|
||||
-151.498291015625,
|
||||
-22.7498836517334,
|
||||
-94.0,
|
||||
93.50477600097656
|
||||
],
|
||||
"endpoint": [
|
||||
1.8212896585464478,
|
||||
-9.327469825744629,
|
||||
-150.87704467773438,
|
||||
-23.00735855102539,
|
||||
-94.0,
|
||||
93.73664855957031
|
||||
],
|
||||
"dense_max_step_deg": 0.01,
|
||||
"dense_points": 185,
|
||||
"min_gap64_mm": -0.14927288174659914,
|
||||
"min_at_fraction": 0.7663043478260869,
|
||||
"min_at_q": [
|
||||
2.09952208334985,
|
||||
-8.898669719696045,
|
||||
-151.0222272458284,
|
||||
-22.947187786516935,
|
||||
-94.0,
|
||||
93.68246095076852
|
||||
],
|
||||
"scope": "One executed segment; finite sampling demonstrates a collision between certified checkpoints."
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,658 @@
|
||||
{
|
||||
"segments": 48,
|
||||
"kin_fp": "2ebcbf17",
|
||||
"root_gap_cap_mm": 20.0,
|
||||
"formula": "L = ceil(log2(bound_pair/(ga+gb)))\uff0c\u67e5\u8be2\u6570 = 2^L + 1\uff1bbound_pair \u53d6\u6700\u7d27\u7ec4\u5bf9\uff0c\u4e0d\u7528\u5168\u7ec4\u5bf9\u6700\u5927\u503c",
|
||||
"levels_needed_by_status": {
|
||||
"safe": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
3,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
4,
|
||||
4,
|
||||
4
|
||||
],
|
||||
"unresolved": [
|
||||
5,
|
||||
5,
|
||||
5,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
6,
|
||||
6,
|
||||
6,
|
||||
6
|
||||
],
|
||||
"collision": [
|
||||
4
|
||||
]
|
||||
},
|
||||
"queries_needed_safe": [
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
3,
|
||||
5,
|
||||
5,
|
||||
5,
|
||||
5,
|
||||
9,
|
||||
9,
|
||||
9,
|
||||
9,
|
||||
9,
|
||||
17,
|
||||
17,
|
||||
17,
|
||||
17,
|
||||
17
|
||||
],
|
||||
"model_vs_measured_max_excess": 20,
|
||||
"unresolved_needed_queries": [
|
||||
33,
|
||||
33,
|
||||
33,
|
||||
33,
|
||||
33,
|
||||
65,
|
||||
65,
|
||||
65,
|
||||
65,
|
||||
65
|
||||
],
|
||||
"collision_dense_check": [
|
||||
{
|
||||
"i": 180,
|
||||
"start_it": 54,
|
||||
"status": "collision",
|
||||
"tight_group_pair": 5,
|
||||
"bound_pair_mm": 29.09,
|
||||
"endpoint_gap_sum_mm": 1.98854,
|
||||
"levels_needed": 4,
|
||||
"queries_needed": 17,
|
||||
"queries_used_batch32": 5
|
||||
}
|
||||
],
|
||||
"note": "\u6a21\u578b\u662f\u201c\u754c\u53ea\u968f\u4e8c\u5206\u51cf\u534a\u201d\u4e0b\u7684\u4e0b\u754c\uff1b\u5b9e\u6d4b\u67e5\u8be2\u53ef\u80fd\u66f4\u5c0f\uff08\u591a\u5c42\u91cc\u6709\u7684\u7ec4\u5bf9\u5148\u6ee1\u8db3\uff09\u6216\u66f4\u5927\uff08\u78b0\u649e\u6bb5\u63d0\u524d\u7ec8\u6b62\uff09\u3002",
|
||||
"rows": [
|
||||
{
|
||||
"i": 0,
|
||||
"start_it": 0,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 2.382,
|
||||
"endpoint_gap_sum_mm": 17.77168,
|
||||
"levels_needed": 0,
|
||||
"queries_needed": 2,
|
||||
"queries_used_batch32": 2
|
||||
},
|
||||
{
|
||||
"i": 0,
|
||||
"start_it": 8,
|
||||
"status": "unresolved",
|
||||
"tight_group_pair": 13,
|
||||
"bound_pair_mm": 8.2833,
|
||||
"endpoint_gap_sum_mm": 0.25216,
|
||||
"levels_needed": 6,
|
||||
"queries_needed": 65,
|
||||
"queries_used_batch32": 17
|
||||
},
|
||||
{
|
||||
"i": 0,
|
||||
"start_it": 91,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 2.459,
|
||||
"endpoint_gap_sum_mm": 14.45459,
|
||||
"levels_needed": 0,
|
||||
"queries_needed": 2,
|
||||
"queries_used_batch32": 2
|
||||
},
|
||||
{
|
||||
"i": 0,
|
||||
"start_it": 173,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 6.8776,
|
||||
"endpoint_gap_sum_mm": 15.48695,
|
||||
"levels_needed": 0,
|
||||
"queries_needed": 2,
|
||||
"queries_used_batch32": 2
|
||||
},
|
||||
{
|
||||
"i": 21,
|
||||
"start_it": 0,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 4.7095,
|
||||
"endpoint_gap_sum_mm": 12.81844,
|
||||
"levels_needed": 0,
|
||||
"queries_needed": 2,
|
||||
"queries_used_batch32": 2
|
||||
},
|
||||
{
|
||||
"i": 21,
|
||||
"start_it": 100,
|
||||
"status": "unresolved",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 1.3371,
|
||||
"endpoint_gap_sum_mm": 0.03365,
|
||||
"levels_needed": 6,
|
||||
"queries_needed": 65,
|
||||
"queries_used_batch32": 17
|
||||
},
|
||||
{
|
||||
"i": 21,
|
||||
"start_it": 127,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 1.5104,
|
||||
"endpoint_gap_sum_mm": 0.68046,
|
||||
"levels_needed": 2,
|
||||
"queries_needed": 5,
|
||||
"queries_used_batch32": 4
|
||||
},
|
||||
{
|
||||
"i": 21,
|
||||
"start_it": 282,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 5,
|
||||
"bound_pair_mm": 3.5692,
|
||||
"endpoint_gap_sum_mm": 1.72327,
|
||||
"levels_needed": 2,
|
||||
"queries_needed": 5,
|
||||
"queries_used_batch32": 4
|
||||
},
|
||||
{
|
||||
"i": 84,
|
||||
"start_it": 0,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 11.7042,
|
||||
"endpoint_gap_sum_mm": 13.79742,
|
||||
"levels_needed": 0,
|
||||
"queries_needed": 2,
|
||||
"queries_used_batch32": 2
|
||||
},
|
||||
{
|
||||
"i": 84,
|
||||
"start_it": 170,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 4.9891,
|
||||
"endpoint_gap_sum_mm": 0.3999,
|
||||
"levels_needed": 4,
|
||||
"queries_needed": 17,
|
||||
"queries_used_batch32": 18
|
||||
},
|
||||
{
|
||||
"i": 84,
|
||||
"start_it": 234,
|
||||
"status": "unresolved",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 7.5939,
|
||||
"endpoint_gap_sum_mm": 0.28698,
|
||||
"levels_needed": 5,
|
||||
"queries_needed": 33,
|
||||
"queries_used_batch32": 31
|
||||
},
|
||||
{
|
||||
"i": 84,
|
||||
"start_it": 325,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 3.5738,
|
||||
"endpoint_gap_sum_mm": 10.95173,
|
||||
"levels_needed": 0,
|
||||
"queries_needed": 2,
|
||||
"queries_used_batch32": 2
|
||||
},
|
||||
{
|
||||
"i": 128,
|
||||
"start_it": 0,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 4.4648,
|
||||
"endpoint_gap_sum_mm": 16.52712,
|
||||
"levels_needed": 0,
|
||||
"queries_needed": 2,
|
||||
"queries_used_batch32": 2
|
||||
},
|
||||
{
|
||||
"i": 128,
|
||||
"start_it": 31,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 2.1155,
|
||||
"endpoint_gap_sum_mm": 14.24909,
|
||||
"levels_needed": 0,
|
||||
"queries_needed": 2,
|
||||
"queries_used_batch32": 2
|
||||
},
|
||||
{
|
||||
"i": 128,
|
||||
"start_it": 62,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 0.3619,
|
||||
"endpoint_gap_sum_mm": 12.62201,
|
||||
"levels_needed": 0,
|
||||
"queries_needed": 2,
|
||||
"queries_used_batch32": 2
|
||||
},
|
||||
{
|
||||
"i": 145,
|
||||
"start_it": 0,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 1.5691,
|
||||
"endpoint_gap_sum_mm": 11.60111,
|
||||
"levels_needed": 0,
|
||||
"queries_needed": 2,
|
||||
"queries_used_batch32": 2
|
||||
},
|
||||
{
|
||||
"i": 145,
|
||||
"start_it": 32,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 4,
|
||||
"bound_pair_mm": 4.6053,
|
||||
"endpoint_gap_sum_mm": 0.67129,
|
||||
"levels_needed": 3,
|
||||
"queries_needed": 9,
|
||||
"queries_used_batch32": 28
|
||||
},
|
||||
{
|
||||
"i": 145,
|
||||
"start_it": 138,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 4,
|
||||
"bound_pair_mm": 9.6062,
|
||||
"endpoint_gap_sum_mm": 1.11765,
|
||||
"levels_needed": 4,
|
||||
"queries_needed": 17,
|
||||
"queries_used_batch32": 15
|
||||
},
|
||||
{
|
||||
"i": 145,
|
||||
"start_it": 294,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 5,
|
||||
"bound_pair_mm": 8.2956,
|
||||
"endpoint_gap_sum_mm": 0.61574,
|
||||
"levels_needed": 4,
|
||||
"queries_needed": 17,
|
||||
"queries_used_batch32": 17
|
||||
},
|
||||
{
|
||||
"i": 164,
|
||||
"start_it": 0,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 12.0298,
|
||||
"endpoint_gap_sum_mm": 11.50625,
|
||||
"levels_needed": 1,
|
||||
"queries_needed": 3,
|
||||
"queries_used_batch32": 3
|
||||
},
|
||||
{
|
||||
"i": 164,
|
||||
"start_it": 84,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 5,
|
||||
"bound_pair_mm": 18.0143,
|
||||
"endpoint_gap_sum_mm": 1.7857,
|
||||
"levels_needed": 4,
|
||||
"queries_needed": 17,
|
||||
"queries_used_batch32": 18
|
||||
},
|
||||
{
|
||||
"i": 164,
|
||||
"start_it": 182,
|
||||
"status": "unresolved",
|
||||
"tight_group_pair": 5,
|
||||
"bound_pair_mm": 14.1522,
|
||||
"endpoint_gap_sum_mm": 0.38976,
|
||||
"levels_needed": 6,
|
||||
"queries_needed": 65,
|
||||
"queries_used_batch32": 17
|
||||
},
|
||||
{
|
||||
"i": 164,
|
||||
"start_it": 227,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 5.6457,
|
||||
"endpoint_gap_sum_mm": 1.13586,
|
||||
"levels_needed": 3,
|
||||
"queries_needed": 9,
|
||||
"queries_used_batch32": 10
|
||||
},
|
||||
{
|
||||
"i": 175,
|
||||
"start_it": 0,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 6.5456,
|
||||
"endpoint_gap_sum_mm": 15.18067,
|
||||
"levels_needed": 0,
|
||||
"queries_needed": 2,
|
||||
"queries_used_batch32": 2
|
||||
},
|
||||
{
|
||||
"i": 175,
|
||||
"start_it": 46,
|
||||
"status": "unresolved",
|
||||
"tight_group_pair": 6,
|
||||
"bound_pair_mm": 30.8668,
|
||||
"endpoint_gap_sum_mm": 1.26529,
|
||||
"levels_needed": 5,
|
||||
"queries_needed": 33,
|
||||
"queries_used_batch32": 32
|
||||
},
|
||||
{
|
||||
"i": 175,
|
||||
"start_it": 75,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 17.8885,
|
||||
"endpoint_gap_sum_mm": 10.74989,
|
||||
"levels_needed": 1,
|
||||
"queries_needed": 3,
|
||||
"queries_used_batch32": 3
|
||||
},
|
||||
{
|
||||
"i": 175,
|
||||
"start_it": 142,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 0.8185,
|
||||
"endpoint_gap_sum_mm": 10.77208,
|
||||
"levels_needed": 0,
|
||||
"queries_needed": 2,
|
||||
"queries_used_batch32": 2
|
||||
},
|
||||
{
|
||||
"i": 180,
|
||||
"start_it": 0,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 3.4654,
|
||||
"endpoint_gap_sum_mm": 14.04707,
|
||||
"levels_needed": 0,
|
||||
"queries_needed": 2,
|
||||
"queries_used_batch32": 2
|
||||
},
|
||||
{
|
||||
"i": 180,
|
||||
"start_it": 14,
|
||||
"status": "unresolved",
|
||||
"tight_group_pair": 4,
|
||||
"bound_pair_mm": 17.6609,
|
||||
"endpoint_gap_sum_mm": 0.46562,
|
||||
"levels_needed": 6,
|
||||
"queries_needed": 65,
|
||||
"queries_used_batch32": 17
|
||||
},
|
||||
{
|
||||
"i": 180,
|
||||
"start_it": 52,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 5,
|
||||
"bound_pair_mm": 27.7231,
|
||||
"endpoint_gap_sum_mm": 3.97272,
|
||||
"levels_needed": 3,
|
||||
"queries_needed": 9,
|
||||
"queries_used_batch32": 15
|
||||
},
|
||||
{
|
||||
"i": 180,
|
||||
"start_it": 54,
|
||||
"status": "collision",
|
||||
"tight_group_pair": 5,
|
||||
"bound_pair_mm": 29.09,
|
||||
"endpoint_gap_sum_mm": 1.98854,
|
||||
"levels_needed": 4,
|
||||
"queries_needed": 17,
|
||||
"queries_used_batch32": 5
|
||||
},
|
||||
{
|
||||
"i": 180,
|
||||
"start_it": 94,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 1.1032,
|
||||
"endpoint_gap_sum_mm": 12.22495,
|
||||
"levels_needed": 0,
|
||||
"queries_needed": 2,
|
||||
"queries_used_batch32": 2
|
||||
},
|
||||
{
|
||||
"i": 197,
|
||||
"start_it": 0,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 1.0839,
|
||||
"endpoint_gap_sum_mm": 6.87225,
|
||||
"levels_needed": 0,
|
||||
"queries_needed": 2,
|
||||
"queries_used_batch32": 2
|
||||
},
|
||||
{
|
||||
"i": 197,
|
||||
"start_it": 80,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 3.3325,
|
||||
"endpoint_gap_sum_mm": 0.50053,
|
||||
"levels_needed": 3,
|
||||
"queries_needed": 9,
|
||||
"queries_used_batch32": 29
|
||||
},
|
||||
{
|
||||
"i": 197,
|
||||
"start_it": 82,
|
||||
"status": "unresolved",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 5.7899,
|
||||
"endpoint_gap_sum_mm": 0.16354,
|
||||
"levels_needed": 6,
|
||||
"queries_needed": 65,
|
||||
"queries_used_batch32": 17
|
||||
},
|
||||
{
|
||||
"i": 197,
|
||||
"start_it": 211,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 5,
|
||||
"bound_pair_mm": 18.6183,
|
||||
"endpoint_gap_sum_mm": 5.55945,
|
||||
"levels_needed": 2,
|
||||
"queries_needed": 5,
|
||||
"queries_used_batch32": 11
|
||||
},
|
||||
{
|
||||
"i": 215,
|
||||
"start_it": 0,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 2.4256,
|
||||
"endpoint_gap_sum_mm": 12.47554,
|
||||
"levels_needed": 0,
|
||||
"queries_needed": 2,
|
||||
"queries_used_batch32": 2
|
||||
},
|
||||
{
|
||||
"i": 215,
|
||||
"start_it": 104,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 4.7208,
|
||||
"endpoint_gap_sum_mm": 14.00267,
|
||||
"levels_needed": 0,
|
||||
"queries_needed": 2,
|
||||
"queries_used_batch32": 2
|
||||
},
|
||||
{
|
||||
"i": 215,
|
||||
"start_it": 178,
|
||||
"status": "unresolved",
|
||||
"tight_group_pair": 6,
|
||||
"bound_pair_mm": 25.7963,
|
||||
"endpoint_gap_sum_mm": 1.07014,
|
||||
"levels_needed": 5,
|
||||
"queries_needed": 33,
|
||||
"queries_used_batch32": 30
|
||||
},
|
||||
{
|
||||
"i": 215,
|
||||
"start_it": 215,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 6,
|
||||
"bound_pair_mm": 9.2152,
|
||||
"endpoint_gap_sum_mm": 8.57509,
|
||||
"levels_needed": 1,
|
||||
"queries_needed": 3,
|
||||
"queries_used_batch32": 3
|
||||
},
|
||||
{
|
||||
"i": 224,
|
||||
"start_it": 0,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 6.492,
|
||||
"endpoint_gap_sum_mm": 10.02154,
|
||||
"levels_needed": 0,
|
||||
"queries_needed": 2,
|
||||
"queries_used_batch32": 2
|
||||
},
|
||||
{
|
||||
"i": 224,
|
||||
"start_it": 52,
|
||||
"status": "unresolved",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 3.5989,
|
||||
"endpoint_gap_sum_mm": 0.12354,
|
||||
"levels_needed": 5,
|
||||
"queries_needed": 33,
|
||||
"queries_used_batch32": 32
|
||||
},
|
||||
{
|
||||
"i": 224,
|
||||
"start_it": 61,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 2.7788,
|
||||
"endpoint_gap_sum_mm": 0.78961,
|
||||
"levels_needed": 2,
|
||||
"queries_needed": 5,
|
||||
"queries_used_batch32": 5
|
||||
},
|
||||
{
|
||||
"i": 224,
|
||||
"start_it": 127,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 1.4884,
|
||||
"endpoint_gap_sum_mm": 7.29024,
|
||||
"levels_needed": 0,
|
||||
"queries_needed": 2,
|
||||
"queries_used_batch32": 2
|
||||
},
|
||||
{
|
||||
"i": 255,
|
||||
"start_it": 0,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 1.5332,
|
||||
"endpoint_gap_sum_mm": 11.184,
|
||||
"levels_needed": 0,
|
||||
"queries_needed": 2,
|
||||
"queries_used_batch32": 2
|
||||
},
|
||||
{
|
||||
"i": 255,
|
||||
"start_it": 25,
|
||||
"status": "unresolved",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 2.9831,
|
||||
"endpoint_gap_sum_mm": 0.14423,
|
||||
"levels_needed": 5,
|
||||
"queries_needed": 33,
|
||||
"queries_used_batch32": 29
|
||||
},
|
||||
{
|
||||
"i": 255,
|
||||
"start_it": 50,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 4,
|
||||
"bound_pair_mm": 7.2365,
|
||||
"endpoint_gap_sum_mm": 0.61112,
|
||||
"levels_needed": 4,
|
||||
"queries_needed": 17,
|
||||
"queries_used_batch32": 25
|
||||
},
|
||||
{
|
||||
"i": 255,
|
||||
"start_it": 181,
|
||||
"status": "safe",
|
||||
"tight_group_pair": 18,
|
||||
"bound_pair_mm": 4.2961,
|
||||
"endpoint_gap_sum_mm": 0.74979,
|
||||
"levels_needed": 3,
|
||||
"queries_needed": 9,
|
||||
"queries_used_batch32": 12
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"baseline_commit": "95da491",
|
||||
"poses": "first 64 existing parity poses",
|
||||
"n_poses": 64,
|
||||
"kin_fp": "2ebcbf17",
|
||||
"dtype": "float64",
|
||||
"degenerate_capsules": [
|
||||
686
|
||||
],
|
||||
"pairs_with_second_degenerate": 670,
|
||||
"evaluated_pairs": 42880,
|
||||
"changed_pairs_over_1e_8": 20661,
|
||||
"old_minus_new_min_mm": 0.0,
|
||||
"old_minus_new_max_mm": 86.00309853133399,
|
||||
"new_reverse_max_abs_mm": 0.0,
|
||||
"worst": {
|
||||
"pose": 29,
|
||||
"first_capsule": 430,
|
||||
"second_capsule": 686,
|
||||
"old_distance_mm": 493.354753665718,
|
||||
"new_distance_mm": 407.35165513438403
|
||||
},
|
||||
"scope": "Raw capsule distances; does not imply these pairs win the group minimum."
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"baseline_commit": "95da491",
|
||||
"sample_source": "docs/experiment_round31_certificates.json",
|
||||
"segments": 48,
|
||||
"dense_points": 7586,
|
||||
"max_step_deg": 0.01,
|
||||
"cap_mm": 0.5,
|
||||
"dtype": "float64",
|
||||
"device": "cuda",
|
||||
"kin_fp": "2ebcbf17",
|
||||
"max_group_gap_difference_mm": 0.0,
|
||||
"group_gaps_changed_over_1e_8": 0,
|
||||
"minimum_gaps_changed_over_1e_8": 0,
|
||||
"collision_bool_mismatches": 0,
|
||||
"wall_s": 4.18259759999637
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"n": 2000,
|
||||
"fk_max_abs_mm": 4.547473508864641e-13,
|
||||
"orient_max_abs": 3.3306690738754696e-16,
|
||||
"gap_max_abs_mm": 2.5224267119483557e-13,
|
||||
"collide_bool_mismatch": 0,
|
||||
"feat_max_abs": 5.960463655974024e-08,
|
||||
"grad_rel_err_max": 1.8474076070450906e-06,
|
||||
"PASS": true
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"scope": "全部 48 段 × 15 组对 = 720 项检验;观察值按 cap=2.0 mm 钳制,故可检验命题取 min(预测下限, cap)。违例=实测最小间隙低于该下限。",
|
||||
"checks": 720,
|
||||
"violations": [],
|
||||
"worst_margin_mm": 0.0,
|
||||
"min_slack_mm": 1e-06,
|
||||
"dense_cap_mm": 2.0,
|
||||
"grid_points_per_segment": 121,
|
||||
"supersedes": "docs/experiment_round32_uniform_validation.json 里 bound_checks=61 的部分覆盖版本",
|
||||
"kin_fp": "2ebcbf17",
|
||||
"wall_s": 1.66,
|
||||
"nontrivial": {
|
||||
"definition": "只有预测下限 < 观察 cap 才是有信息量的检验;其余组对被钳制恒等式自动满足",
|
||||
"checks": 61,
|
||||
"min_slack_mm": 0.035347,
|
||||
"p10_slack_mm": 0.544274,
|
||||
"violations": 0,
|
||||
"pred_mm_median_all": 15.8639,
|
||||
"pred_mm_max_all": 19.9582
|
||||
},
|
||||
"note": "720 项总检验 0 违例,其中有信息量的是 61 项;预测下限的中位数 15.9 mm 远大于观察 cap 2 mm,所以大部分组对无法在本网格上证伪"
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
{
|
||||
"device": "cuda float64",
|
||||
"torch": "2.10.0+cu130",
|
||||
"kin_fp": "2ebcbf17",
|
||||
"roots_per_call": 2,
|
||||
"pairs": 24,
|
||||
"warm": 3,
|
||||
"reps": 7,
|
||||
"segment_sample": "docs/experiment_round31_certificates.json 的 48 段两两成对",
|
||||
"design": "每对根轮流按正序/逆序测完全部配置(3次预热+7次计时);uniform_auto 的宽相位=最大子段界+2eps,uniform_cap20 固定 20 mm,bisect 为第31轮逐层二分口径",
|
||||
"results": [
|
||||
{
|
||||
"kind": "uniform_auto",
|
||||
"n_or_budget": 8,
|
||||
"points": 18,
|
||||
"cap_used_mm": 5.9191,
|
||||
"calls": 168,
|
||||
"p50_ms": 9.684,
|
||||
"p90_ms": 13.027,
|
||||
"p99_ms": 15.157,
|
||||
"max_ms": 17.537,
|
||||
"over_20ms": 0,
|
||||
"roots": 48,
|
||||
"safe": 26,
|
||||
"collision": 1,
|
||||
"rejected": 21
|
||||
},
|
||||
{
|
||||
"kind": "uniform_auto",
|
||||
"n_or_budget": 16,
|
||||
"points": 34,
|
||||
"cap_used_mm": 2.9597,
|
||||
"calls": 168,
|
||||
"p50_ms": 14.137,
|
||||
"p90_ms": 18.454,
|
||||
"p99_ms": 20.866,
|
||||
"max_ms": 21.632,
|
||||
"over_20ms": 5,
|
||||
"roots": 48,
|
||||
"safe": 30,
|
||||
"collision": 1,
|
||||
"rejected": 17
|
||||
},
|
||||
{
|
||||
"kind": "uniform_auto",
|
||||
"n_or_budget": 32,
|
||||
"points": 66,
|
||||
"cap_used_mm": 1.4799,
|
||||
"calls": 168,
|
||||
"p50_ms": 20.209,
|
||||
"p90_ms": 27.88,
|
||||
"p99_ms": 32.268,
|
||||
"max_ms": 35.563,
|
||||
"over_20ms": 87,
|
||||
"roots": 48,
|
||||
"safe": 34,
|
||||
"collision": 1,
|
||||
"rejected": 13
|
||||
},
|
||||
{
|
||||
"kind": "uniform_auto",
|
||||
"n_or_budget": 64,
|
||||
"points": 130,
|
||||
"cap_used_mm": 0.7401,
|
||||
"calls": 168,
|
||||
"p50_ms": 31.429,
|
||||
"p90_ms": 48.751,
|
||||
"p99_ms": 57.697,
|
||||
"max_ms": 62.084,
|
||||
"over_20ms": 165,
|
||||
"roots": 48,
|
||||
"safe": 36,
|
||||
"collision": 1,
|
||||
"rejected": 11
|
||||
},
|
||||
{
|
||||
"kind": "uniform_auto",
|
||||
"n_or_budget": 128,
|
||||
"points": 258,
|
||||
"cap_used_mm": 0.3701,
|
||||
"calls": 168,
|
||||
"p50_ms": 59.761,
|
||||
"p90_ms": 89.063,
|
||||
"p99_ms": 109.086,
|
||||
"max_ms": 117.345,
|
||||
"over_20ms": 168,
|
||||
"roots": 48,
|
||||
"safe": 38,
|
||||
"collision": 1,
|
||||
"rejected": 9
|
||||
},
|
||||
{
|
||||
"kind": "uniform_cap20",
|
||||
"n_or_budget": 8,
|
||||
"points": 18,
|
||||
"cap_used_mm": 20.0,
|
||||
"calls": 168,
|
||||
"p50_ms": 13.129,
|
||||
"p90_ms": 16.44,
|
||||
"p99_ms": 20.963,
|
||||
"max_ms": 24.67,
|
||||
"over_20ms": 3,
|
||||
"roots": 48,
|
||||
"safe": 26,
|
||||
"collision": 1,
|
||||
"rejected": 21
|
||||
},
|
||||
{
|
||||
"kind": "uniform_cap20",
|
||||
"n_or_budget": 32,
|
||||
"points": 66,
|
||||
"cap_used_mm": 20.0,
|
||||
"calls": 168,
|
||||
"p50_ms": 28.415,
|
||||
"p90_ms": 39.579,
|
||||
"p99_ms": 53.023,
|
||||
"max_ms": 59.983,
|
||||
"over_20ms": 153,
|
||||
"roots": 48,
|
||||
"safe": 34,
|
||||
"collision": 1,
|
||||
"rejected": 13
|
||||
},
|
||||
{
|
||||
"kind": "uniform_cap20",
|
||||
"n_or_budget": 64,
|
||||
"points": 130,
|
||||
"cap_used_mm": 20.0,
|
||||
"calls": 168,
|
||||
"p50_ms": 50.85,
|
||||
"p90_ms": 75.512,
|
||||
"p99_ms": 88.355,
|
||||
"max_ms": 91.492,
|
||||
"over_20ms": 168,
|
||||
"roots": 48,
|
||||
"safe": 36,
|
||||
"collision": 1,
|
||||
"rejected": 11
|
||||
},
|
||||
{
|
||||
"kind": "uniform_cap20",
|
||||
"n_or_budget": 128,
|
||||
"points": 258,
|
||||
"cap_used_mm": 20.0,
|
||||
"calls": 168,
|
||||
"p50_ms": 98.46,
|
||||
"p90_ms": 139.982,
|
||||
"p99_ms": 167.042,
|
||||
"max_ms": 177.743,
|
||||
"over_20ms": 168,
|
||||
"roots": 48,
|
||||
"safe": 38,
|
||||
"collision": 1,
|
||||
"rejected": 9
|
||||
},
|
||||
{
|
||||
"kind": "bisect",
|
||||
"n_or_budget": 32,
|
||||
"points": null,
|
||||
"cap_used_mm": 20.0,
|
||||
"calls": 168,
|
||||
"p50_ms": 54.885,
|
||||
"p90_ms": 82.151,
|
||||
"p99_ms": 117.205,
|
||||
"max_ms": 118.716,
|
||||
"over_20ms": 133,
|
||||
"roots": 48,
|
||||
"safe": 37,
|
||||
"collision": 1,
|
||||
"rejected": 10
|
||||
},
|
||||
{
|
||||
"kind": "bisect",
|
||||
"n_or_budget": 65,
|
||||
"points": null,
|
||||
"cap_used_mm": 20.0,
|
||||
"calls": 168,
|
||||
"p50_ms": 71.825,
|
||||
"p90_ms": 108.559,
|
||||
"p99_ms": 122.533,
|
||||
"max_ms": 127.319,
|
||||
"over_20ms": 133,
|
||||
"roots": 48,
|
||||
"safe": 41,
|
||||
"collision": 1,
|
||||
"rejected": 6
|
||||
}
|
||||
],
|
||||
"wall_s": 108.63
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"segments": 48,
|
||||
"kin_fp": "2ebcbf17",
|
||||
"dense_cap_mm": 2.0,
|
||||
"eps_mm": 0.0001,
|
||||
"bound_falsification": "每条组对:预测下限 (ga+gb-bound)/2 应 ≤ 网格上该组对的最小实测间隙",
|
||||
"per_segment": [
|
||||
{
|
||||
"n": 8,
|
||||
"safe": 26,
|
||||
"collision": 1,
|
||||
"unproven": 21,
|
||||
"outside_box": 0,
|
||||
"false_accept_vs_dense": 0,
|
||||
"cap_required_mm": 5.919107314806348,
|
||||
"known_missed_segment_collision": true
|
||||
},
|
||||
{
|
||||
"n": 16,
|
||||
"safe": 30,
|
||||
"collision": 1,
|
||||
"unproven": 17,
|
||||
"outside_box": 0,
|
||||
"false_accept_vs_dense": 0,
|
||||
"cap_required_mm": 2.959653657403174,
|
||||
"known_missed_segment_collision": true
|
||||
},
|
||||
{
|
||||
"n": 32,
|
||||
"safe": 34,
|
||||
"collision": 1,
|
||||
"unproven": 13,
|
||||
"outside_box": 0,
|
||||
"false_accept_vs_dense": 0,
|
||||
"cap_required_mm": 1.479926828701587,
|
||||
"known_missed_segment_collision": true
|
||||
},
|
||||
{
|
||||
"n": 64,
|
||||
"safe": 36,
|
||||
"collision": 1,
|
||||
"unproven": 11,
|
||||
"outside_box": 0,
|
||||
"false_accept_vs_dense": 0,
|
||||
"cap_required_mm": 0.7400634143507935,
|
||||
"known_missed_segment_collision": true
|
||||
},
|
||||
{
|
||||
"n": 128,
|
||||
"safe": 38,
|
||||
"collision": 1,
|
||||
"unproven": 9,
|
||||
"outside_box": 0,
|
||||
"false_accept_vs_dense": 0,
|
||||
"cap_required_mm": 0.37013170717539673,
|
||||
"known_missed_segment_collision": true
|
||||
}
|
||||
],
|
||||
"bound_checks": 61,
|
||||
"bound_violations": [],
|
||||
"worst_margin_mm": 0.0
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"config": {
|
||||
"ckpt": "ml/runs/base_dag2_dag1/best.pt",
|
||||
"samples": "ml/data/samples",
|
||||
"tasks": null,
|
||||
"split": "val",
|
||||
"n": 256,
|
||||
"K": 8,
|
||||
"commit": 2,
|
||||
"fb": 2.2,
|
||||
"ki": 0.0,
|
||||
"fb_scale": 0.0,
|
||||
"fb_near": 0.2,
|
||||
"fb_fallback": 0.0,
|
||||
"kdecay": 0.9,
|
||||
"kimax": 0.5,
|
||||
"fb_every": 1,
|
||||
"safety_try": 0,
|
||||
"sel_w": 0.1,
|
||||
"dls_safety": 1,
|
||||
"fb_clear": 0.0,
|
||||
"fb_cmin": 0.3,
|
||||
"sub_refresh": 0,
|
||||
"fb_block_gain": 0.5,
|
||||
"dump": "ml/runs/round33_base_rows.json",
|
||||
"out": "docs/experiment_round33_base.json",
|
||||
"trace": "ml/runs/round33_base.pt",
|
||||
"select": "endpoint",
|
||||
"replan": "empty",
|
||||
"safety": 1,
|
||||
"partial": 1,
|
||||
"inc_cap": 0,
|
||||
"gap_margin": 0.0,
|
||||
"max_sec": null,
|
||||
"seed": 0,
|
||||
"dls": "analytic",
|
||||
"device": "cuda"
|
||||
},
|
||||
"batch_size": 256,
|
||||
"batch_seed_rule": "same seed per batch",
|
||||
"checkpoint_sha256": "f7f686fd8ee92fb6948fbcc4ee954636065ad87bb54f661c4f8f575bc16c2ce1",
|
||||
"tasks_sha256": "249bd93457825cda98c59e64d9a096d3473c69aeb3553de1dea6d9e56be71772",
|
||||
"kin_fp": "2ebcbf17",
|
||||
"act_scale": 1.0,
|
||||
"metrics": {
|
||||
"n": 256,
|
||||
"n_ref": 256,
|
||||
"success": 0.57421875,
|
||||
"collision_free_success": 0.57421875,
|
||||
"time_ok_1p3": 0.390625,
|
||||
"collision_rate": 0.0,
|
||||
"collision_steps_mean": 0.0,
|
||||
"travel_ratio_median": 2.4449527263641357,
|
||||
"time_mean_s": 2.3076188564300537,
|
||||
"brakes_mean": 19.25,
|
||||
"start_fail": 0.0,
|
||||
"goal_ratio_2s": 0.20997506380081177,
|
||||
"err_fail_med": 229.68746948242188,
|
||||
"err_success_med": 0.18899640440940857,
|
||||
"dls_share": 0.625,
|
||||
"time_budget": "teacher×2(≥3 s)",
|
||||
"speed_ratio_p50": 1.6600004434585571,
|
||||
"speed_ratio_p95": 1.6600035429000854,
|
||||
"speed_ratio_max": 1.660003662109375,
|
||||
"over_vmax_rate": 1.0,
|
||||
"accel_ratio_p95": 1.5835107564926147,
|
||||
"accel_ratio_max": 1.6600004434585571
|
||||
},
|
||||
"simulation_wall_s": 296.2702505999914
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"config": {
|
||||
"ckpt": "ml/runs/base_dag2_dag1/best.pt",
|
||||
"samples": "ml/data/samples",
|
||||
"tasks": null,
|
||||
"split": "val",
|
||||
"n": 256,
|
||||
"K": 8,
|
||||
"commit": 2,
|
||||
"fb": 2.2,
|
||||
"ki": 0.0,
|
||||
"fb_scale": 0.0,
|
||||
"fb_near": 0.2,
|
||||
"fb_fallback": 0.0,
|
||||
"kdecay": 0.9,
|
||||
"kimax": 0.5,
|
||||
"fb_every": 1,
|
||||
"safety_try": 0,
|
||||
"sel_w": 0.1,
|
||||
"dls_safety": 1,
|
||||
"fb_clear": 0.0,
|
||||
"fb_cmin": 0.3,
|
||||
"sub_refresh": 0,
|
||||
"fb_block_gain": 0.5,
|
||||
"dump": "ml/runs/round33_both_rows.json",
|
||||
"out": "docs/experiment_round33_both.json",
|
||||
"trace": "ml/runs/round33_both.pt",
|
||||
"select": "endpoint",
|
||||
"replan": "empty",
|
||||
"safety": 1,
|
||||
"partial": 1,
|
||||
"inc_cap": 1,
|
||||
"gap_margin": 0.5,
|
||||
"max_sec": null,
|
||||
"seed": 0,
|
||||
"dls": "analytic",
|
||||
"device": "cuda"
|
||||
},
|
||||
"batch_size": 256,
|
||||
"batch_seed_rule": "same seed per batch",
|
||||
"checkpoint_sha256": "f7f686fd8ee92fb6948fbcc4ee954636065ad87bb54f661c4f8f575bc16c2ce1",
|
||||
"tasks_sha256": "249bd93457825cda98c59e64d9a096d3473c69aeb3553de1dea6d9e56be71772",
|
||||
"kin_fp": "2ebcbf17",
|
||||
"act_scale": 1.0,
|
||||
"metrics": {
|
||||
"n": 256,
|
||||
"n_ref": 256,
|
||||
"success": 0.51953125,
|
||||
"collision_free_success": 0.51953125,
|
||||
"time_ok_1p3": 0.26171875,
|
||||
"collision_rate": 0.0,
|
||||
"collision_steps_mean": 0.0,
|
||||
"travel_ratio_median": 2.5444939136505127,
|
||||
"time_mean_s": 2.4729323387145996,
|
||||
"brakes_mean": 19.97265625,
|
||||
"start_fail": 0.0,
|
||||
"goal_ratio_2s": 0.2868920564651489,
|
||||
"err_fail_med": 202.12567138671875,
|
||||
"err_success_med": 0.22085000574588776,
|
||||
"dls_share": 0.62109375,
|
||||
"time_budget": "teacher×2(≥3 s)",
|
||||
"speed_ratio_p50": 1.0000016689300537,
|
||||
"speed_ratio_p95": 1.0000101327896118,
|
||||
"speed_ratio_max": 1.0000101327896118,
|
||||
"over_vmax_rate": 0.0,
|
||||
"accel_ratio_p95": 1.0000016689300537,
|
||||
"accel_ratio_max": 1.0000101327896118
|
||||
},
|
||||
"simulation_wall_s": 277.54961390000244
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"config": {
|
||||
"ckpt": "ml/runs/base_dag2_dag1/best.pt",
|
||||
"samples": "ml/data/samples",
|
||||
"tasks": null,
|
||||
"split": "val",
|
||||
"n": 256,
|
||||
"K": 8,
|
||||
"commit": 2,
|
||||
"fb": 2.2,
|
||||
"ki": 0.0,
|
||||
"fb_scale": 0.0,
|
||||
"fb_near": 0.2,
|
||||
"fb_fallback": 0.0,
|
||||
"kdecay": 0.9,
|
||||
"kimax": 0.5,
|
||||
"fb_every": 1,
|
||||
"safety_try": 0,
|
||||
"sel_w": 0.1,
|
||||
"dls_safety": 1,
|
||||
"fb_clear": 0.0,
|
||||
"fb_cmin": 0.3,
|
||||
"sub_refresh": 0,
|
||||
"fb_block_gain": 0.5,
|
||||
"dump": "ml/runs/round33_cap_rows.json",
|
||||
"out": "docs/experiment_round33_cap.json",
|
||||
"trace": "ml/runs/round33_cap.pt",
|
||||
"select": "endpoint",
|
||||
"replan": "empty",
|
||||
"safety": 1,
|
||||
"partial": 1,
|
||||
"inc_cap": 1,
|
||||
"gap_margin": 0.0,
|
||||
"max_sec": null,
|
||||
"seed": 0,
|
||||
"dls": "analytic",
|
||||
"device": "cuda"
|
||||
},
|
||||
"batch_size": 256,
|
||||
"batch_seed_rule": "same seed per batch",
|
||||
"checkpoint_sha256": "f7f686fd8ee92fb6948fbcc4ee954636065ad87bb54f661c4f8f575bc16c2ce1",
|
||||
"tasks_sha256": "249bd93457825cda98c59e64d9a096d3473c69aeb3553de1dea6d9e56be71772",
|
||||
"kin_fp": "2ebcbf17",
|
||||
"act_scale": 1.0,
|
||||
"metrics": {
|
||||
"n": 256,
|
||||
"n_ref": 256,
|
||||
"success": 0.5234375,
|
||||
"collision_free_success": 0.5234375,
|
||||
"time_ok_1p3": 0.265625,
|
||||
"collision_rate": 0.0,
|
||||
"collision_steps_mean": 0.0,
|
||||
"travel_ratio_median": 2.615795850753784,
|
||||
"time_mean_s": 2.486567258834839,
|
||||
"brakes_mean": 19.5546875,
|
||||
"start_fail": 0.0,
|
||||
"goal_ratio_2s": 0.27920001745224,
|
||||
"err_fail_med": 204.71360778808594,
|
||||
"err_success_med": 0.21751396358013153,
|
||||
"dls_share": 0.61328125,
|
||||
"time_budget": "teacher×2(≥3 s)",
|
||||
"speed_ratio_p50": 1.0000016689300537,
|
||||
"speed_ratio_p95": 1.0000101327896118,
|
||||
"speed_ratio_max": 1.0000101327896118,
|
||||
"over_vmax_rate": 0.0,
|
||||
"accel_ratio_p95": 1.0000016689300537,
|
||||
"accel_ratio_max": 1.0000101327896118
|
||||
},
|
||||
"simulation_wall_s": 325.18856850000157
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
{
|
||||
"device": "NVIDIA GeForce RTX 3090",
|
||||
"torch": "2.10.0+cu130",
|
||||
"act_scale": 1.0,
|
||||
"cfg": {},
|
||||
"B": 1,
|
||||
"commit_n": 2,
|
||||
"fp64_note": "3090 fp64 \u541e\u5410\u7ea6 fp32 \u7684 1/54\uff1b\u8ba4\u8bc1\u76ee\u524d\u8981\u6c42 fp64",
|
||||
"inference": {
|
||||
"sample_K1_steps1": {
|
||||
"p50": 7.453,
|
||||
"p95": 9.912,
|
||||
"p99": 10.766,
|
||||
"max": 11.109,
|
||||
"reps": 120
|
||||
},
|
||||
"sample_K8_steps1": {
|
||||
"p50": 8.208,
|
||||
"p95": 10.685,
|
||||
"p99": 11.22,
|
||||
"max": 15.224,
|
||||
"reps": 120
|
||||
},
|
||||
"sample_K1_steps2": {
|
||||
"p50": 13.149,
|
||||
"p95": 17.621,
|
||||
"p99": 18.438,
|
||||
"max": 19.296,
|
||||
"reps": 120
|
||||
},
|
||||
"sample_K8_steps2": {
|
||||
"p50": 14.167,
|
||||
"p95": 19.241,
|
||||
"p99": 24.77,
|
||||
"max": 25.703,
|
||||
"reps": 120
|
||||
},
|
||||
"sample_K1_steps4": {
|
||||
"p50": 19.193,
|
||||
"p95": 22.338,
|
||||
"p99": 23.666,
|
||||
"max": 25.787,
|
||||
"reps": 120
|
||||
},
|
||||
"sample_K8_steps4": {
|
||||
"p50": 21.509,
|
||||
"p95": 24.732,
|
||||
"p99": 35.655,
|
||||
"max": 41.514,
|
||||
"reps": 120
|
||||
},
|
||||
"sample_K1_steps8": {
|
||||
"p50": 40.658,
|
||||
"p95": 55.162,
|
||||
"p99": 60.394,
|
||||
"max": 60.398,
|
||||
"reps": 120
|
||||
},
|
||||
"sample_K8_steps8": {
|
||||
"p50": 40.416,
|
||||
"p95": 47.997,
|
||||
"p99": 62.49,
|
||||
"max": 71.976,
|
||||
"reps": 120
|
||||
},
|
||||
"sample_K1_steps16": {
|
||||
"p50": 72.429,
|
||||
"p95": 90.188,
|
||||
"p99": 107.536,
|
||||
"max": 112.674,
|
||||
"reps": 120
|
||||
},
|
||||
"sample_K8_steps16": {
|
||||
"p50": 79.893,
|
||||
"p95": 99.933,
|
||||
"p99": 105.746,
|
||||
"max": 106.078,
|
||||
"reps": 120
|
||||
}
|
||||
},
|
||||
"encode_once": {
|
||||
"p50": 2.265,
|
||||
"p95": 4.001,
|
||||
"p99": 6.086,
|
||||
"max": 6.136,
|
||||
"reps": 120
|
||||
},
|
||||
"tiny_op_ms": 0.028,
|
||||
"sync_only_ms": 0.005,
|
||||
"components": {
|
||||
"features_f32": {
|
||||
"p50": 12.443,
|
||||
"p95": 14.227,
|
||||
"p99": 19.678,
|
||||
"max": 20.531,
|
||||
"reps": 120
|
||||
},
|
||||
"endpoint_score_K8_f32": {
|
||||
"p50": 4.278,
|
||||
"p95": 5.841,
|
||||
"p99": 6.322,
|
||||
"max": 8.883,
|
||||
"reps": 120
|
||||
},
|
||||
"dls_fb_1step_f64": {
|
||||
"p50": 7.191,
|
||||
"p95": 12.26,
|
||||
"p99": 14.642,
|
||||
"max": 15.384,
|
||||
"reps": 120
|
||||
},
|
||||
"dls_fb_1step_f32": {
|
||||
"p50": 7.619,
|
||||
"p95": 10.142,
|
||||
"p99": 11.597,
|
||||
"max": 12.022,
|
||||
"reps": 120
|
||||
},
|
||||
"discrete_cert_4pts_f32": {
|
||||
"p50": 8.214,
|
||||
"p95": 13.365,
|
||||
"p99": 14.235,
|
||||
"max": 14.991,
|
||||
"reps": 120
|
||||
},
|
||||
"cert_n8_f64_2roots": {
|
||||
"p50": 11.265,
|
||||
"p95": 14.64,
|
||||
"p99": 16.788,
|
||||
"max": 17.761,
|
||||
"reps": 120
|
||||
},
|
||||
"cert_n16_f64_2roots": {
|
||||
"p50": 14.574,
|
||||
"p95": 16.731,
|
||||
"p99": 18.459,
|
||||
"max": 22.346,
|
||||
"reps": 120
|
||||
},
|
||||
"cert_n32_f64_2roots": {
|
||||
"p50": 21.528,
|
||||
"p95": 24.746,
|
||||
"p99": 28.037,
|
||||
"max": 28.066,
|
||||
"reps": 120
|
||||
}
|
||||
},
|
||||
"cycle_K8_steps16_discrete": {
|
||||
"p50": 116.474,
|
||||
"p95": 134.474,
|
||||
"p99": 142.593,
|
||||
"max": 152.768,
|
||||
"reps": 120
|
||||
},
|
||||
"cycle_K8_steps4_discrete": {
|
||||
"p50": 55.919,
|
||||
"p95": 65.767,
|
||||
"p99": 74.809,
|
||||
"max": 78.059,
|
||||
"reps": 120
|
||||
},
|
||||
"cycle_K1_steps4_discrete": {
|
||||
"p50": 51.087,
|
||||
"p95": 58.614,
|
||||
"p99": 62.326,
|
||||
"max": 63.919,
|
||||
"reps": 120
|
||||
},
|
||||
"cycle_K1_steps1_discrete": {
|
||||
"p50": 34.493,
|
||||
"p95": 42.078,
|
||||
"p99": 43.906,
|
||||
"max": 50.268,
|
||||
"reps": 120
|
||||
},
|
||||
"cycle_K8_steps16_cert_n8": {
|
||||
"p50": 132.027,
|
||||
"p95": 150.463,
|
||||
"p99": 160.83,
|
||||
"max": 192.586,
|
||||
"reps": 120
|
||||
},
|
||||
"cycle_K8_steps4_cert_n8": {
|
||||
"p50": 64.812,
|
||||
"p95": 79.192,
|
||||
"p99": 89.629,
|
||||
"max": 95.837,
|
||||
"reps": 120
|
||||
},
|
||||
"cycle_K1_steps4_cert_n16": {
|
||||
"p50": 61.967,
|
||||
"p95": 73.219,
|
||||
"p99": 79.053,
|
||||
"max": 83.18,
|
||||
"reps": 120
|
||||
},
|
||||
"f32_vs_f64": {
|
||||
"points": 3,
|
||||
"max_abs_err_mm": 0.0,
|
||||
"sign_flips": 0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
{
|
||||
"device": "NVIDIA GeForce RTX 3090",
|
||||
"B": 1,
|
||||
"steps_used_by_eval": 1,
|
||||
"note": "eval_cl \u4ece\u4e0d\u4f20 steps\uff0crollout \u9ed8\u8ba4 steps=1\uff08MeanFlow \u4e00\u6b65\u751f\u6210\uff09\uff1b\u6240\u4ee5\u771f\u5b9e\u5468\u671f\u6309 steps=1 \u6d4b",
|
||||
"parts": {
|
||||
"features_total": {
|
||||
"p50": 12.589,
|
||||
"p95": 18.334,
|
||||
"p99": 20.217,
|
||||
"max": 23.649,
|
||||
"reps": 120
|
||||
},
|
||||
"features_gm_groups_only": {
|
||||
"p50": 6.817,
|
||||
"p95": 8.771,
|
||||
"p99": 10.254,
|
||||
"max": 17.169,
|
||||
"reps": 120
|
||||
},
|
||||
"features_gaps40_all_groups": {
|
||||
"p50": 7.245,
|
||||
"p95": 10.501,
|
||||
"p99": 13.794,
|
||||
"max": 14.508,
|
||||
"reps": 120
|
||||
},
|
||||
"features_fk_only": {
|
||||
"p50": 3.708,
|
||||
"p95": 5.024,
|
||||
"p99": 5.991,
|
||||
"max": 6.301,
|
||||
"reps": 120
|
||||
},
|
||||
"sample_k_K8_steps1": {
|
||||
"p50": 7.799,
|
||||
"p95": 11.655,
|
||||
"p99": 13.342,
|
||||
"max": 16.212,
|
||||
"reps": 120
|
||||
},
|
||||
"sample_k_K1_steps1": {
|
||||
"p50": 7.205,
|
||||
"p95": 8.935,
|
||||
"p99": 9.615,
|
||||
"max": 13.92,
|
||||
"reps": 120
|
||||
},
|
||||
"sample_k_K4_steps1": {
|
||||
"p50": 7.834,
|
||||
"p95": 10.354,
|
||||
"p99": 14.744,
|
||||
"max": 15.241,
|
||||
"reps": 120
|
||||
},
|
||||
"dls_fb_f64": {
|
||||
"p50": 6.729,
|
||||
"p95": 9.297,
|
||||
"p99": 11.186,
|
||||
"max": 12.064,
|
||||
"reps": 120
|
||||
},
|
||||
"discrete_cert_4pts": {
|
||||
"p50": 8.603,
|
||||
"p95": 11.181,
|
||||
"p99": 12.464,
|
||||
"max": 15.799,
|
||||
"reps": 120
|
||||
},
|
||||
"cert_uniform_n8_2roots_f64": {
|
||||
"p50": 11.479,
|
||||
"p95": 19.221,
|
||||
"p99": 20.942,
|
||||
"max": 21.183,
|
||||
"reps": 120
|
||||
},
|
||||
"cert_uniform_n16_2roots_f64": {
|
||||
"p50": 16.138,
|
||||
"p95": 21.972,
|
||||
"p99": 23.898,
|
||||
"max": 25.793,
|
||||
"reps": 120
|
||||
}
|
||||
},
|
||||
"cycles": {
|
||||
"cycle_K8_full_discrete": {
|
||||
"p50": 40.676,
|
||||
"p95": 51.742,
|
||||
"p99": 59.782,
|
||||
"max": 62.074,
|
||||
"reps": 120
|
||||
},
|
||||
"cycle_K4_full_discrete": {
|
||||
"p50": 43.997,
|
||||
"p95": 56.145,
|
||||
"p99": 59.905,
|
||||
"max": 65.882,
|
||||
"reps": 120
|
||||
},
|
||||
"cycle_K1_full_discrete": {
|
||||
"p50": 37.87,
|
||||
"p95": 45.754,
|
||||
"p99": 49.394,
|
||||
"max": 53.139,
|
||||
"reps": 120
|
||||
},
|
||||
"cycle_K8_noscore_discrete": {
|
||||
"p50": 37.427,
|
||||
"p95": 49.602,
|
||||
"p99": 60.777,
|
||||
"max": 70.139,
|
||||
"reps": 120
|
||||
},
|
||||
"cycle_K8_full_cert_n8": {
|
||||
"p50": 43.984,
|
||||
"p95": 65.795,
|
||||
"p99": 75.53,
|
||||
"max": 95.452,
|
||||
"reps": 120
|
||||
},
|
||||
"cycle_K8_full_cert_n16": {
|
||||
"p50": 51.054,
|
||||
"p95": 74.862,
|
||||
"p99": 95.768,
|
||||
"max": 106.48,
|
||||
"reps": 120
|
||||
},
|
||||
"cycle_K8_fused_estimate": {
|
||||
"p50": 24.054,
|
||||
"p95": 26.595,
|
||||
"p99": 30.17,
|
||||
"max": 33.284,
|
||||
"reps": 120
|
||||
},
|
||||
"cycle_K8_fused_cert_n8": {
|
||||
"p50": 34.274,
|
||||
"p95": 46.329,
|
||||
"p99": 72.737,
|
||||
"max": 79.022,
|
||||
"reps": 120
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"config": {
|
||||
"ckpt": "ml/runs/base_dag2_dag1/best.pt",
|
||||
"samples": "ml/data/samples",
|
||||
"tasks": null,
|
||||
"split": "val",
|
||||
"n": 256,
|
||||
"K": 8,
|
||||
"commit": 2,
|
||||
"fb": 2.2,
|
||||
"ki": 0.0,
|
||||
"fb_scale": 0.0,
|
||||
"fb_near": 0.2,
|
||||
"fb_fallback": 0.0,
|
||||
"kdecay": 0.9,
|
||||
"kimax": 0.5,
|
||||
"fb_every": 1,
|
||||
"safety_try": 0,
|
||||
"sel_w": 0.1,
|
||||
"dls_safety": 1,
|
||||
"fb_clear": 0.0,
|
||||
"fb_cmin": 0.3,
|
||||
"sub_refresh": 0,
|
||||
"fb_block_gain": 0.5,
|
||||
"dump": "ml/runs/round33_margin_rows.json",
|
||||
"out": "docs/experiment_round33_margin.json",
|
||||
"trace": "ml/runs/round33_margin.pt",
|
||||
"select": "endpoint",
|
||||
"replan": "empty",
|
||||
"safety": 1,
|
||||
"partial": 1,
|
||||
"inc_cap": 0,
|
||||
"gap_margin": 0.5,
|
||||
"max_sec": null,
|
||||
"seed": 0,
|
||||
"dls": "analytic",
|
||||
"device": "cuda"
|
||||
},
|
||||
"batch_size": 256,
|
||||
"batch_seed_rule": "same seed per batch",
|
||||
"checkpoint_sha256": "f7f686fd8ee92fb6948fbcc4ee954636065ad87bb54f661c4f8f575bc16c2ce1",
|
||||
"tasks_sha256": "249bd93457825cda98c59e64d9a096d3473c69aeb3553de1dea6d9e56be71772",
|
||||
"kin_fp": "2ebcbf17",
|
||||
"act_scale": 1.0,
|
||||
"metrics": {
|
||||
"n": 256,
|
||||
"n_ref": 256,
|
||||
"success": 0.5625,
|
||||
"collision_free_success": 0.5625,
|
||||
"time_ok_1p3": 0.37890625,
|
||||
"collision_rate": 0.0,
|
||||
"collision_steps_mean": 0.0,
|
||||
"travel_ratio_median": 2.448458433151245,
|
||||
"time_mean_s": 2.2555553913116455,
|
||||
"brakes_mean": 20.046875,
|
||||
"start_fail": 0.0,
|
||||
"goal_ratio_2s": 0.18239997327327728,
|
||||
"err_fail_med": 225.54278564453125,
|
||||
"err_success_med": 0.18544802069664001,
|
||||
"dls_share": 0.62890625,
|
||||
"time_budget": "teacher×2(≥3 s)",
|
||||
"speed_ratio_p50": 1.6600004434585571,
|
||||
"speed_ratio_p95": 1.660003662109375,
|
||||
"speed_ratio_max": 1.660003662109375,
|
||||
"over_vmax_rate": 1.0,
|
||||
"accel_ratio_p95": 1.5889430046081543,
|
||||
"accel_ratio_max": 1.6600035429000854
|
||||
},
|
||||
"simulation_wall_s": 298.24517190000915
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"config": {
|
||||
"ckpt": "ml/runs/base_dag2_dag1/best.pt",
|
||||
"samples": "ml/data/samples",
|
||||
"tasks": null,
|
||||
"split": "val",
|
||||
"n": 256,
|
||||
"K": 8,
|
||||
"commit": 2,
|
||||
"fb": 2.2,
|
||||
"ki": 0.0,
|
||||
"fb_scale": 0.0,
|
||||
"fb_near": 0.2,
|
||||
"fb_fallback": 0.0,
|
||||
"kdecay": 0.9,
|
||||
"kimax": 0.5,
|
||||
"fb_every": 1,
|
||||
"safety_try": 0,
|
||||
"sel_w": 0.1,
|
||||
"dls_safety": 1,
|
||||
"fb_clear": 0.0,
|
||||
"fb_cmin": 0.3,
|
||||
"sub_refresh": 0,
|
||||
"fb_block_gain": 0.5,
|
||||
"dump": null,
|
||||
"out": "docs/experiment_round34_cert_batch_check.json",
|
||||
"trace": null,
|
||||
"select": "endpoint",
|
||||
"replan": "empty",
|
||||
"safety": 1,
|
||||
"partial": 1,
|
||||
"inc_cap": 0,
|
||||
"gap_margin": 0.0,
|
||||
"cert_batch": 1,
|
||||
"max_sec": null,
|
||||
"seed": 0,
|
||||
"dls": "analytic",
|
||||
"device": "cuda"
|
||||
},
|
||||
"batch_size": 256,
|
||||
"batch_seed_rule": "same seed per batch",
|
||||
"checkpoint_sha256": "f7f686fd8ee92fb6948fbcc4ee954636065ad87bb54f661c4f8f575bc16c2ce1",
|
||||
"tasks_sha256": "249bd93457825cda98c59e64d9a096d3473c69aeb3553de1dea6d9e56be71772",
|
||||
"kin_fp": "2ebcbf17",
|
||||
"act_scale": 1.0,
|
||||
"metrics": {
|
||||
"n": 256,
|
||||
"n_ref": 256,
|
||||
"success": 0.57421875,
|
||||
"collision_free_success": 0.57421875,
|
||||
"time_ok_1p3": 0.390625,
|
||||
"collision_rate": 0.0,
|
||||
"collision_steps_mean": 0.0,
|
||||
"travel_ratio_median": 2.4449527263641357,
|
||||
"time_mean_s": 2.3076188564300537,
|
||||
"brakes_mean": 19.25,
|
||||
"start_fail": 0.0,
|
||||
"goal_ratio_2s": 0.20997506380081177,
|
||||
"err_fail_med": 229.68746948242188,
|
||||
"err_success_med": 0.18899640440940857,
|
||||
"dls_share": 0.625,
|
||||
"time_budget": "teacher×2(≥3 s)",
|
||||
"speed_ratio_p50": 1.6600004434585571,
|
||||
"speed_ratio_p95": 1.6600035429000854,
|
||||
"speed_ratio_max": 1.660003662109375,
|
||||
"over_vmax_rate": 1.0,
|
||||
"accel_ratio_p95": 1.5835107564926147,
|
||||
"accel_ratio_max": 1.6600004434585571
|
||||
},
|
||||
"simulation_wall_s": 306.9490996999957
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"kin_fp": "2ebcbf17",
|
||||
"segments": 48,
|
||||
"n_subsegments": 8,
|
||||
"wide_cap_mm": 2.0,
|
||||
"gap_abs_err_mm": {
|
||||
"p50": 0.0,
|
||||
"p99": 3.661949063912929e-05,
|
||||
"p999": 7.4360332600075e-05,
|
||||
"max": 0.00013247109886016517
|
||||
},
|
||||
"signed_err_mm": {
|
||||
"min": -0.00010937313134817828,
|
||||
"max": 0.00013247109886016517,
|
||||
"overestimate_count": 1,
|
||||
"overestimate_gt_1e-3": 0
|
||||
},
|
||||
"sign_flips": 0,
|
||||
"accepted_f64": 24,
|
||||
"accepted_f32": 24,
|
||||
"unsafe_direction_f32_only": 0,
|
||||
"conservative_f64_only": 0,
|
||||
"per_group_pair_err_p99": [
|
||||
0.0,
|
||||
7.6e-05,
|
||||
0.0001,
|
||||
7e-05,
|
||||
7.1e-05,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.000132,
|
||||
6.7e-05,
|
||||
5.1e-05,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"note": "wide_cap 2.0 mm\uff1a\u8ba4\u8bc1\u5b9e\u9645\u7528 bound+2eps \u7684\u81ea\u9002\u5e94 cap\uff0c\u8fd9\u91cc\u53d6\u56fa\u5b9a 2 mm \u4ee5\u8986\u76d6\u88ab\u68c0\u9a8c\u7684\u6bb5\uff1b\u82e5 max \u8bef\u5dee\u8fdc\u5c0f\u4e8e 1e-4 \u7684 eps\uff0c\u5224\u636e\u5728 f32 \u4e0b\u4ecd\u6210\u7acb\u9700\u518d\u786e\u8ba4 f32 \u7684\u95f4\u9699\u672c\u8eab\u8bef\u5dee\u7b26\u53f7\u65b9\u5411\u3002"
|
||||
}
|
||||
@@ -0,0 +1,629 @@
|
||||
{
|
||||
"device": "NVIDIA GeForce RTX 3090",
|
||||
"B": 1,
|
||||
"K": 8,
|
||||
"steps": 1,
|
||||
"reps": 90,
|
||||
"design": "\u540c\u4e00\u6279 4 \u4e2a\u53d8\u4f53\u9010\u8f6e\u4ea4\u66ff\uff08\u5947\u6570\u8f6e\u53cd\u5e8f\uff09\uff0c\u6d88\u9664 GPU \u65f6\u949f\u6f02\u79fb\uff1b\u539f\u59cb\u8017\u65f6\u5168\u90e8\u843d\u76d8",
|
||||
"equivalence": {
|
||||
"features_reuse_bitwise_equal": true,
|
||||
"gm_groups_vs_full_table_max_abs_mm": 0.0,
|
||||
"cert_matrix_bitwise_equal_at_same_cap": true,
|
||||
"shared_xf_cert_bitwise_equal_at_cap1": true,
|
||||
"max_abs_shared_diff_mm": 0.0,
|
||||
"max_abs_cert_diff_mm": 0.0,
|
||||
"decision_equal_by_threshold": {
|
||||
"thr_0.0": true,
|
||||
"thr_0.5": true,
|
||||
"thr_1.0": true
|
||||
},
|
||||
"per_point_min_cur_mm": [
|
||||
8.833421,
|
||||
8.849185,
|
||||
8.859405,
|
||||
8.83829
|
||||
],
|
||||
"per_point_min_fused_mm": [
|
||||
8.833421,
|
||||
8.849185,
|
||||
8.859405,
|
||||
8.83829
|
||||
]
|
||||
},
|
||||
"results": {
|
||||
"current_discrete": {
|
||||
"p50": 32.932,
|
||||
"p95": 42.589,
|
||||
"p99": 55.568,
|
||||
"max": 55.568,
|
||||
"hz_p50": 30.4,
|
||||
"raw_ms": [
|
||||
30.458,
|
||||
30.624,
|
||||
30.789,
|
||||
31.17,
|
||||
31.229,
|
||||
31.283,
|
||||
31.371,
|
||||
31.394,
|
||||
31.454,
|
||||
31.473,
|
||||
31.564,
|
||||
31.58,
|
||||
31.719,
|
||||
31.772,
|
||||
31.78,
|
||||
31.785,
|
||||
31.859,
|
||||
31.875,
|
||||
31.906,
|
||||
31.973,
|
||||
31.979,
|
||||
32.002,
|
||||
32.017,
|
||||
32.063,
|
||||
32.099,
|
||||
32.113,
|
||||
32.123,
|
||||
32.127,
|
||||
32.13,
|
||||
32.137,
|
||||
32.191,
|
||||
32.286,
|
||||
32.308,
|
||||
32.324,
|
||||
32.33,
|
||||
32.388,
|
||||
32.48,
|
||||
32.508,
|
||||
32.564,
|
||||
32.63,
|
||||
32.64,
|
||||
32.702,
|
||||
32.78,
|
||||
32.822,
|
||||
32.834,
|
||||
32.932,
|
||||
32.964,
|
||||
32.975,
|
||||
32.996,
|
||||
33.071,
|
||||
33.163,
|
||||
33.191,
|
||||
33.192,
|
||||
33.402,
|
||||
33.477,
|
||||
33.509,
|
||||
33.583,
|
||||
33.956,
|
||||
34.014,
|
||||
34.04,
|
||||
34.047,
|
||||
34.047,
|
||||
34.154,
|
||||
34.302,
|
||||
34.595,
|
||||
34.658,
|
||||
34.943,
|
||||
35.296,
|
||||
35.522,
|
||||
35.67,
|
||||
35.757,
|
||||
35.828,
|
||||
35.859,
|
||||
36.459,
|
||||
36.503,
|
||||
36.562,
|
||||
36.956,
|
||||
37.047,
|
||||
37.067,
|
||||
37.142,
|
||||
37.442,
|
||||
38.632,
|
||||
39.285,
|
||||
41.269,
|
||||
41.932,
|
||||
42.589,
|
||||
43.199,
|
||||
43.329,
|
||||
54.407,
|
||||
55.568
|
||||
]
|
||||
},
|
||||
"fused_discrete": {
|
||||
"p50": 24.515,
|
||||
"p95": 30.02,
|
||||
"p99": 42.085,
|
||||
"max": 42.085,
|
||||
"hz_p50": 40.8,
|
||||
"raw_ms": [
|
||||
22.146,
|
||||
22.266,
|
||||
22.409,
|
||||
22.653,
|
||||
22.66,
|
||||
22.695,
|
||||
22.76,
|
||||
22.827,
|
||||
22.848,
|
||||
23.001,
|
||||
23.033,
|
||||
23.087,
|
||||
23.249,
|
||||
23.36,
|
||||
23.488,
|
||||
23.573,
|
||||
23.607,
|
||||
23.625,
|
||||
23.649,
|
||||
23.651,
|
||||
23.652,
|
||||
23.652,
|
||||
23.656,
|
||||
23.676,
|
||||
23.716,
|
||||
23.737,
|
||||
23.745,
|
||||
23.795,
|
||||
23.871,
|
||||
23.883,
|
||||
23.92,
|
||||
23.922,
|
||||
23.945,
|
||||
23.959,
|
||||
24.046,
|
||||
24.13,
|
||||
24.184,
|
||||
24.282,
|
||||
24.291,
|
||||
24.313,
|
||||
24.318,
|
||||
24.319,
|
||||
24.32,
|
||||
24.34,
|
||||
24.399,
|
||||
24.515,
|
||||
24.532,
|
||||
24.541,
|
||||
24.552,
|
||||
24.592,
|
||||
24.618,
|
||||
24.731,
|
||||
24.741,
|
||||
24.745,
|
||||
24.766,
|
||||
24.807,
|
||||
24.813,
|
||||
24.898,
|
||||
25.066,
|
||||
25.088,
|
||||
25.137,
|
||||
25.18,
|
||||
25.223,
|
||||
25.376,
|
||||
25.474,
|
||||
25.603,
|
||||
25.68,
|
||||
25.744,
|
||||
25.82,
|
||||
25.936,
|
||||
25.95,
|
||||
25.953,
|
||||
26.002,
|
||||
26.174,
|
||||
26.312,
|
||||
26.88,
|
||||
27.036,
|
||||
27.209,
|
||||
27.329,
|
||||
27.424,
|
||||
27.715,
|
||||
28.796,
|
||||
28.824,
|
||||
29.427,
|
||||
29.662,
|
||||
30.02,
|
||||
31.515,
|
||||
31.839,
|
||||
36.18,
|
||||
42.085
|
||||
]
|
||||
},
|
||||
"shared_xf_discrete": {
|
||||
"p50": 26.864,
|
||||
"p95": 34.544,
|
||||
"p99": 67.243,
|
||||
"max": 67.243,
|
||||
"hz_p50": 37.2,
|
||||
"raw_ms": [
|
||||
24.433,
|
||||
24.441,
|
||||
24.585,
|
||||
24.777,
|
||||
24.862,
|
||||
24.935,
|
||||
25.054,
|
||||
25.08,
|
||||
25.105,
|
||||
25.193,
|
||||
25.313,
|
||||
25.44,
|
||||
25.466,
|
||||
25.483,
|
||||
25.516,
|
||||
25.554,
|
||||
25.577,
|
||||
25.689,
|
||||
25.702,
|
||||
25.708,
|
||||
25.854,
|
||||
25.896,
|
||||
25.898,
|
||||
26.011,
|
||||
26.097,
|
||||
26.175,
|
||||
26.255,
|
||||
26.289,
|
||||
26.297,
|
||||
26.306,
|
||||
26.328,
|
||||
26.336,
|
||||
26.346,
|
||||
26.375,
|
||||
26.397,
|
||||
26.456,
|
||||
26.502,
|
||||
26.523,
|
||||
26.563,
|
||||
26.613,
|
||||
26.634,
|
||||
26.658,
|
||||
26.708,
|
||||
26.752,
|
||||
26.798,
|
||||
26.864,
|
||||
26.869,
|
||||
26.874,
|
||||
27.315,
|
||||
27.341,
|
||||
27.668,
|
||||
27.67,
|
||||
27.732,
|
||||
27.774,
|
||||
27.812,
|
||||
27.84,
|
||||
27.882,
|
||||
27.921,
|
||||
28.24,
|
||||
28.302,
|
||||
28.421,
|
||||
28.694,
|
||||
28.722,
|
||||
28.739,
|
||||
28.817,
|
||||
28.914,
|
||||
28.944,
|
||||
28.998,
|
||||
29.12,
|
||||
29.122,
|
||||
29.259,
|
||||
29.292,
|
||||
29.334,
|
||||
29.658,
|
||||
29.847,
|
||||
30.181,
|
||||
30.206,
|
||||
30.292,
|
||||
30.492,
|
||||
30.782,
|
||||
31.168,
|
||||
31.222,
|
||||
31.607,
|
||||
31.614,
|
||||
32.187,
|
||||
34.544,
|
||||
35.274,
|
||||
35.565,
|
||||
35.915,
|
||||
67.243
|
||||
]
|
||||
},
|
||||
"current_cert_n8": {
|
||||
"p50": 42.624,
|
||||
"p95": 49.434,
|
||||
"p99": 57.771,
|
||||
"max": 57.771,
|
||||
"hz_p50": 23.5,
|
||||
"raw_ms": [
|
||||
38.546,
|
||||
38.666,
|
||||
39.152,
|
||||
39.265,
|
||||
39.344,
|
||||
39.441,
|
||||
39.584,
|
||||
39.626,
|
||||
39.738,
|
||||
39.841,
|
||||
40.228,
|
||||
40.306,
|
||||
40.514,
|
||||
40.805,
|
||||
40.838,
|
||||
40.875,
|
||||
40.884,
|
||||
40.907,
|
||||
40.952,
|
||||
40.971,
|
||||
41.185,
|
||||
41.193,
|
||||
41.193,
|
||||
41.277,
|
||||
41.279,
|
||||
41.422,
|
||||
41.448,
|
||||
41.463,
|
||||
41.465,
|
||||
41.473,
|
||||
41.504,
|
||||
41.551,
|
||||
41.684,
|
||||
41.733,
|
||||
41.841,
|
||||
41.947,
|
||||
41.967,
|
||||
42.011,
|
||||
42.077,
|
||||
42.241,
|
||||
42.249,
|
||||
42.269,
|
||||
42.301,
|
||||
42.314,
|
||||
42.388,
|
||||
42.624,
|
||||
42.661,
|
||||
42.767,
|
||||
42.773,
|
||||
42.837,
|
||||
42.865,
|
||||
42.87,
|
||||
42.913,
|
||||
43.343,
|
||||
43.35,
|
||||
43.356,
|
||||
43.376,
|
||||
43.501,
|
||||
43.695,
|
||||
43.708,
|
||||
43.842,
|
||||
43.923,
|
||||
43.972,
|
||||
44.243,
|
||||
44.476,
|
||||
44.536,
|
||||
44.648,
|
||||
44.745,
|
||||
44.894,
|
||||
45.034,
|
||||
45.144,
|
||||
45.236,
|
||||
45.697,
|
||||
45.859,
|
||||
45.944,
|
||||
46.039,
|
||||
46.126,
|
||||
46.467,
|
||||
46.575,
|
||||
46.887,
|
||||
46.983,
|
||||
47.234,
|
||||
47.621,
|
||||
47.685,
|
||||
48.547,
|
||||
49.434,
|
||||
49.683,
|
||||
50.646,
|
||||
54.754,
|
||||
57.771
|
||||
]
|
||||
},
|
||||
"fused_cert_n8": {
|
||||
"p50": 24.826,
|
||||
"p95": 31.721,
|
||||
"p99": 49.398,
|
||||
"max": 49.398,
|
||||
"hz_p50": 40.3,
|
||||
"raw_ms": [
|
||||
22.127,
|
||||
22.553,
|
||||
22.598,
|
||||
22.624,
|
||||
22.789,
|
||||
22.798,
|
||||
22.878,
|
||||
22.983,
|
||||
23.002,
|
||||
23.134,
|
||||
23.192,
|
||||
23.273,
|
||||
23.323,
|
||||
23.345,
|
||||
23.377,
|
||||
23.445,
|
||||
23.466,
|
||||
23.549,
|
||||
23.611,
|
||||
23.613,
|
||||
23.861,
|
||||
23.868,
|
||||
23.885,
|
||||
23.885,
|
||||
23.906,
|
||||
23.918,
|
||||
23.919,
|
||||
23.933,
|
||||
23.947,
|
||||
24.052,
|
||||
24.064,
|
||||
24.067,
|
||||
24.08,
|
||||
24.103,
|
||||
24.13,
|
||||
24.164,
|
||||
24.249,
|
||||
24.301,
|
||||
24.429,
|
||||
24.515,
|
||||
24.603,
|
||||
24.609,
|
||||
24.7,
|
||||
24.748,
|
||||
24.812,
|
||||
24.826,
|
||||
24.855,
|
||||
24.858,
|
||||
24.954,
|
||||
24.99,
|
||||
25.052,
|
||||
25.097,
|
||||
25.195,
|
||||
25.209,
|
||||
25.241,
|
||||
25.252,
|
||||
25.264,
|
||||
25.298,
|
||||
25.63,
|
||||
25.659,
|
||||
25.767,
|
||||
25.804,
|
||||
25.928,
|
||||
25.976,
|
||||
26.494,
|
||||
26.871,
|
||||
26.886,
|
||||
26.988,
|
||||
26.995,
|
||||
27.004,
|
||||
27.307,
|
||||
27.322,
|
||||
27.352,
|
||||
27.937,
|
||||
28.144,
|
||||
28.165,
|
||||
28.216,
|
||||
28.288,
|
||||
28.331,
|
||||
29.37,
|
||||
29.611,
|
||||
30.6,
|
||||
30.704,
|
||||
31.026,
|
||||
31.552,
|
||||
31.721,
|
||||
32.875,
|
||||
34.001,
|
||||
40.223,
|
||||
49.398
|
||||
]
|
||||
},
|
||||
"shared_xf_cert_n8": {
|
||||
"p50": 36.185,
|
||||
"p95": 41.136,
|
||||
"p99": 64.287,
|
||||
"max": 64.287,
|
||||
"hz_p50": 27.6,
|
||||
"raw_ms": [
|
||||
33.051,
|
||||
33.153,
|
||||
33.201,
|
||||
33.406,
|
||||
33.819,
|
||||
33.845,
|
||||
33.94,
|
||||
34.083,
|
||||
34.145,
|
||||
34.235,
|
||||
34.3,
|
||||
34.372,
|
||||
34.605,
|
||||
34.697,
|
||||
34.714,
|
||||
34.755,
|
||||
34.817,
|
||||
34.855,
|
||||
34.925,
|
||||
34.957,
|
||||
34.963,
|
||||
34.967,
|
||||
34.986,
|
||||
35.167,
|
||||
35.239,
|
||||
35.314,
|
||||
35.325,
|
||||
35.402,
|
||||
35.444,
|
||||
35.518,
|
||||
35.544,
|
||||
35.582,
|
||||
35.594,
|
||||
35.662,
|
||||
35.675,
|
||||
35.724,
|
||||
35.775,
|
||||
35.874,
|
||||
35.908,
|
||||
35.929,
|
||||
35.965,
|
||||
36.019,
|
||||
36.04,
|
||||
36.126,
|
||||
36.164,
|
||||
36.185,
|
||||
36.2,
|
||||
36.259,
|
||||
36.263,
|
||||
36.266,
|
||||
36.301,
|
||||
36.324,
|
||||
36.383,
|
||||
36.393,
|
||||
36.609,
|
||||
36.667,
|
||||
36.696,
|
||||
36.779,
|
||||
36.799,
|
||||
36.836,
|
||||
36.881,
|
||||
36.978,
|
||||
37.001,
|
||||
37.033,
|
||||
37.043,
|
||||
37.078,
|
||||
37.183,
|
||||
37.206,
|
||||
37.278,
|
||||
37.3,
|
||||
37.411,
|
||||
37.485,
|
||||
37.722,
|
||||
37.923,
|
||||
37.965,
|
||||
38.197,
|
||||
38.588,
|
||||
38.871,
|
||||
39.082,
|
||||
39.099,
|
||||
39.135,
|
||||
39.351,
|
||||
39.505,
|
||||
40.204,
|
||||
40.892,
|
||||
41.136,
|
||||
41.449,
|
||||
42.611,
|
||||
44.687,
|
||||
64.287
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,630 @@
|
||||
{
|
||||
"device": "NVIDIA GeForce RTX 3090",
|
||||
"B": 1,
|
||||
"K": 8,
|
||||
"commit_n": 2,
|
||||
"reps": 80,
|
||||
"design": "5 \u4e2a\u53d8\u4f53\u9010\u8f6e\u4ea4\u66ff\uff08\u5947\u6570\u8f6e\u53cd\u5e8f\uff09\uff1b\u53ea\u6d4b\u53ef\u5b9e\u73b0\u7684\u53e3\u5f84\uff1a\u7279\u5f81/\u63a8\u7406/\u8ba4\u8bc1\u6309\u771f\u5b9e\u987a\u5e8f",
|
||||
"equivalence": {
|
||||
"batch_cert_matrix_equal_to_loop": true,
|
||||
"features_xf_reuse_bitwise_equal": true
|
||||
},
|
||||
"results": {
|
||||
"A_today": {
|
||||
"p50": 33.494,
|
||||
"p95": 46.143,
|
||||
"p99": 64.693,
|
||||
"max": 64.693,
|
||||
"raw_ms": [
|
||||
28.984,
|
||||
29.251,
|
||||
29.361,
|
||||
29.549,
|
||||
29.899,
|
||||
29.944,
|
||||
30.181,
|
||||
30.605,
|
||||
30.624,
|
||||
30.744,
|
||||
30.815,
|
||||
30.838,
|
||||
30.862,
|
||||
30.9,
|
||||
31.024,
|
||||
31.092,
|
||||
31.115,
|
||||
31.262,
|
||||
31.433,
|
||||
31.463,
|
||||
31.52,
|
||||
31.572,
|
||||
31.642,
|
||||
31.741,
|
||||
31.871,
|
||||
31.902,
|
||||
31.924,
|
||||
31.933,
|
||||
31.976,
|
||||
32.001,
|
||||
32.03,
|
||||
32.06,
|
||||
32.285,
|
||||
32.384,
|
||||
32.624,
|
||||
32.825,
|
||||
32.919,
|
||||
33.063,
|
||||
33.168,
|
||||
33.197,
|
||||
33.494,
|
||||
33.589,
|
||||
33.624,
|
||||
33.632,
|
||||
33.666,
|
||||
33.708,
|
||||
33.727,
|
||||
33.735,
|
||||
33.754,
|
||||
33.773,
|
||||
33.869,
|
||||
33.907,
|
||||
34.116,
|
||||
34.219,
|
||||
34.314,
|
||||
34.337,
|
||||
34.897,
|
||||
34.957,
|
||||
35.436,
|
||||
35.469,
|
||||
35.999,
|
||||
36.106,
|
||||
36.523,
|
||||
36.559,
|
||||
36.846,
|
||||
36.866,
|
||||
36.922,
|
||||
37.354,
|
||||
37.375,
|
||||
37.581,
|
||||
37.933,
|
||||
38.026,
|
||||
40.541,
|
||||
40.882,
|
||||
44.161,
|
||||
44.233,
|
||||
46.143,
|
||||
54.047,
|
||||
58.36,
|
||||
64.693
|
||||
]
|
||||
},
|
||||
"B_xf_reuse": {
|
||||
"p50": 30.122,
|
||||
"p95": 42.349,
|
||||
"p99": 66.368,
|
||||
"max": 66.368,
|
||||
"raw_ms": [
|
||||
26.698,
|
||||
26.958,
|
||||
26.984,
|
||||
27.007,
|
||||
27.018,
|
||||
27.158,
|
||||
27.308,
|
||||
27.369,
|
||||
27.987,
|
||||
28.066,
|
||||
28.219,
|
||||
28.288,
|
||||
28.362,
|
||||
28.517,
|
||||
28.537,
|
||||
28.539,
|
||||
28.593,
|
||||
28.611,
|
||||
28.638,
|
||||
28.735,
|
||||
28.828,
|
||||
28.871,
|
||||
28.922,
|
||||
28.945,
|
||||
28.978,
|
||||
29.088,
|
||||
29.202,
|
||||
29.226,
|
||||
29.226,
|
||||
29.31,
|
||||
29.497,
|
||||
29.506,
|
||||
29.531,
|
||||
29.549,
|
||||
29.649,
|
||||
29.875,
|
||||
29.978,
|
||||
29.992,
|
||||
30.025,
|
||||
30.102,
|
||||
30.122,
|
||||
30.243,
|
||||
30.245,
|
||||
30.263,
|
||||
30.407,
|
||||
30.578,
|
||||
30.665,
|
||||
30.717,
|
||||
30.863,
|
||||
30.884,
|
||||
30.889,
|
||||
30.95,
|
||||
31.023,
|
||||
31.314,
|
||||
31.525,
|
||||
31.537,
|
||||
31.543,
|
||||
31.549,
|
||||
31.62,
|
||||
32.011,
|
||||
32.098,
|
||||
32.168,
|
||||
32.188,
|
||||
32.22,
|
||||
32.578,
|
||||
32.818,
|
||||
32.851,
|
||||
32.929,
|
||||
32.991,
|
||||
33.76,
|
||||
33.805,
|
||||
33.831,
|
||||
33.94,
|
||||
34.124,
|
||||
34.891,
|
||||
39.001,
|
||||
42.349,
|
||||
43.636,
|
||||
62.045,
|
||||
66.368
|
||||
]
|
||||
},
|
||||
"C_batch_cert": {
|
||||
"p50": 38.048,
|
||||
"p95": 50.171,
|
||||
"p99": 59.86,
|
||||
"max": 59.86,
|
||||
"raw_ms": [
|
||||
33.625,
|
||||
33.736,
|
||||
33.848,
|
||||
34.235,
|
||||
34.49,
|
||||
34.917,
|
||||
34.918,
|
||||
35.108,
|
||||
35.407,
|
||||
35.919,
|
||||
36.023,
|
||||
36.035,
|
||||
36.087,
|
||||
36.263,
|
||||
36.318,
|
||||
36.531,
|
||||
36.627,
|
||||
36.638,
|
||||
36.722,
|
||||
36.778,
|
||||
36.791,
|
||||
36.801,
|
||||
36.816,
|
||||
36.859,
|
||||
36.97,
|
||||
36.998,
|
||||
37.029,
|
||||
37.055,
|
||||
37.057,
|
||||
37.093,
|
||||
37.208,
|
||||
37.318,
|
||||
37.408,
|
||||
37.438,
|
||||
37.463,
|
||||
37.501,
|
||||
37.503,
|
||||
37.605,
|
||||
37.63,
|
||||
37.984,
|
||||
38.048,
|
||||
38.283,
|
||||
38.347,
|
||||
38.524,
|
||||
38.547,
|
||||
38.667,
|
||||
38.816,
|
||||
38.995,
|
||||
39.028,
|
||||
39.34,
|
||||
39.617,
|
||||
39.679,
|
||||
39.845,
|
||||
39.852,
|
||||
39.871,
|
||||
39.894,
|
||||
39.923,
|
||||
40.195,
|
||||
40.514,
|
||||
41.421,
|
||||
41.684,
|
||||
41.804,
|
||||
41.879,
|
||||
41.933,
|
||||
42.011,
|
||||
42.127,
|
||||
42.483,
|
||||
42.551,
|
||||
42.656,
|
||||
43.038,
|
||||
43.248,
|
||||
43.269,
|
||||
45.68,
|
||||
46.514,
|
||||
46.755,
|
||||
48.909,
|
||||
50.171,
|
||||
50.906,
|
||||
55.33,
|
||||
59.86
|
||||
]
|
||||
},
|
||||
"D_both": {
|
||||
"p50": 34.87,
|
||||
"p95": 39.811,
|
||||
"p99": 48.258,
|
||||
"max": 48.258,
|
||||
"raw_ms": [
|
||||
30.044,
|
||||
30.934,
|
||||
31.005,
|
||||
31.007,
|
||||
31.064,
|
||||
31.492,
|
||||
31.675,
|
||||
31.758,
|
||||
32.114,
|
||||
32.153,
|
||||
32.338,
|
||||
32.374,
|
||||
32.442,
|
||||
32.494,
|
||||
32.681,
|
||||
32.882,
|
||||
32.942,
|
||||
32.991,
|
||||
33.167,
|
||||
33.18,
|
||||
33.302,
|
||||
33.305,
|
||||
33.342,
|
||||
33.449,
|
||||
33.58,
|
||||
33.694,
|
||||
33.739,
|
||||
33.784,
|
||||
33.832,
|
||||
33.835,
|
||||
33.866,
|
||||
33.961,
|
||||
34.037,
|
||||
34.135,
|
||||
34.315,
|
||||
34.395,
|
||||
34.465,
|
||||
34.556,
|
||||
34.656,
|
||||
34.819,
|
||||
34.87,
|
||||
34.98,
|
||||
35.047,
|
||||
35.176,
|
||||
35.19,
|
||||
35.37,
|
||||
35.461,
|
||||
35.528,
|
||||
35.557,
|
||||
35.59,
|
||||
35.643,
|
||||
35.716,
|
||||
35.742,
|
||||
35.804,
|
||||
35.991,
|
||||
36.018,
|
||||
36.063,
|
||||
36.105,
|
||||
36.293,
|
||||
36.312,
|
||||
36.326,
|
||||
36.537,
|
||||
36.541,
|
||||
36.602,
|
||||
36.717,
|
||||
36.934,
|
||||
36.945,
|
||||
37.088,
|
||||
37.141,
|
||||
37.46,
|
||||
37.561,
|
||||
37.608,
|
||||
37.765,
|
||||
37.904,
|
||||
37.974,
|
||||
39.253,
|
||||
39.811,
|
||||
40.076,
|
||||
46.504,
|
||||
48.258
|
||||
]
|
||||
},
|
||||
"E_both_cont_n8": {
|
||||
"p50": 43.725,
|
||||
"p95": 51.084,
|
||||
"p99": 65.681,
|
||||
"max": 65.681,
|
||||
"raw_ms": [
|
||||
37.733,
|
||||
39.087,
|
||||
39.154,
|
||||
39.238,
|
||||
39.36,
|
||||
39.454,
|
||||
39.514,
|
||||
40.167,
|
||||
40.44,
|
||||
40.837,
|
||||
40.86,
|
||||
40.868,
|
||||
41.237,
|
||||
41.276,
|
||||
41.346,
|
||||
41.408,
|
||||
41.551,
|
||||
41.815,
|
||||
41.824,
|
||||
41.912,
|
||||
41.932,
|
||||
41.973,
|
||||
42.074,
|
||||
42.296,
|
||||
42.341,
|
||||
42.365,
|
||||
42.435,
|
||||
42.505,
|
||||
42.592,
|
||||
42.598,
|
||||
42.637,
|
||||
42.85,
|
||||
43.045,
|
||||
43.048,
|
||||
43.18,
|
||||
43.209,
|
||||
43.359,
|
||||
43.361,
|
||||
43.373,
|
||||
43.411,
|
||||
43.725,
|
||||
43.728,
|
||||
43.787,
|
||||
43.833,
|
||||
43.985,
|
||||
44.133,
|
||||
44.185,
|
||||
44.401,
|
||||
44.458,
|
||||
44.585,
|
||||
44.689,
|
||||
44.819,
|
||||
44.841,
|
||||
44.86,
|
||||
45.081,
|
||||
45.087,
|
||||
45.55,
|
||||
45.701,
|
||||
45.939,
|
||||
46.06,
|
||||
46.128,
|
||||
46.264,
|
||||
46.368,
|
||||
46.43,
|
||||
46.957,
|
||||
47.145,
|
||||
47.231,
|
||||
47.256,
|
||||
47.463,
|
||||
47.637,
|
||||
47.819,
|
||||
47.863,
|
||||
48.382,
|
||||
48.87,
|
||||
49.676,
|
||||
50.884,
|
||||
51.084,
|
||||
51.17,
|
||||
53.859,
|
||||
65.681
|
||||
]
|
||||
},
|
||||
"F_worst_loop8": {
|
||||
"p50": 80.224,
|
||||
"p95": 88.436,
|
||||
"p99": 89.553,
|
||||
"max": 89.553,
|
||||
"raw_ms": [
|
||||
67.204,
|
||||
70.008,
|
||||
70.436,
|
||||
71.432,
|
||||
72.454,
|
||||
72.503,
|
||||
73.006,
|
||||
73.12,
|
||||
73.492,
|
||||
73.971,
|
||||
74.203,
|
||||
74.358,
|
||||
74.756,
|
||||
74.816,
|
||||
74.893,
|
||||
75.536,
|
||||
75.98,
|
||||
76.049,
|
||||
76.164,
|
||||
76.25,
|
||||
76.547,
|
||||
76.669,
|
||||
76.843,
|
||||
77.268,
|
||||
77.534,
|
||||
77.658,
|
||||
77.872,
|
||||
78.149,
|
||||
78.343,
|
||||
78.377,
|
||||
78.445,
|
||||
78.483,
|
||||
78.86,
|
||||
78.863,
|
||||
78.905,
|
||||
79.048,
|
||||
79.315,
|
||||
79.857,
|
||||
80.035,
|
||||
80.041,
|
||||
80.224,
|
||||
80.602,
|
||||
80.644,
|
||||
80.677,
|
||||
80.848,
|
||||
81.061,
|
||||
81.094,
|
||||
81.155,
|
||||
81.243,
|
||||
81.384,
|
||||
81.628,
|
||||
81.679,
|
||||
81.75,
|
||||
82.117,
|
||||
82.148,
|
||||
82.363,
|
||||
82.444,
|
||||
82.511,
|
||||
82.651,
|
||||
82.828,
|
||||
82.921,
|
||||
83.371,
|
||||
83.592,
|
||||
83.894,
|
||||
83.926,
|
||||
84.386,
|
||||
84.519,
|
||||
84.608,
|
||||
85.06,
|
||||
85.078,
|
||||
85.094,
|
||||
85.26,
|
||||
87.212,
|
||||
87.744,
|
||||
87.847,
|
||||
88.098,
|
||||
88.436,
|
||||
88.461,
|
||||
88.919,
|
||||
89.553
|
||||
]
|
||||
},
|
||||
"G_worst_batch": {
|
||||
"p50": 37.139,
|
||||
"p95": 46.06,
|
||||
"p99": 52.215,
|
||||
"max": 52.215,
|
||||
"raw_ms": [
|
||||
32.718,
|
||||
33.447,
|
||||
33.569,
|
||||
33.692,
|
||||
33.81,
|
||||
34.236,
|
||||
34.28,
|
||||
34.475,
|
||||
34.496,
|
||||
34.746,
|
||||
35.19,
|
||||
35.392,
|
||||
35.435,
|
||||
35.564,
|
||||
35.569,
|
||||
35.669,
|
||||
35.693,
|
||||
35.734,
|
||||
35.741,
|
||||
35.812,
|
||||
35.828,
|
||||
35.934,
|
||||
36.015,
|
||||
36.036,
|
||||
36.097,
|
||||
36.144,
|
||||
36.197,
|
||||
36.205,
|
||||
36.487,
|
||||
36.637,
|
||||
36.71,
|
||||
36.775,
|
||||
36.79,
|
||||
36.83,
|
||||
36.831,
|
||||
36.885,
|
||||
36.894,
|
||||
36.903,
|
||||
36.947,
|
||||
37.122,
|
||||
37.139,
|
||||
37.154,
|
||||
37.198,
|
||||
37.225,
|
||||
37.249,
|
||||
37.478,
|
||||
37.615,
|
||||
37.617,
|
||||
38.114,
|
||||
38.164,
|
||||
38.288,
|
||||
38.637,
|
||||
38.651,
|
||||
38.724,
|
||||
38.813,
|
||||
39.108,
|
||||
39.15,
|
||||
39.848,
|
||||
39.866,
|
||||
39.946,
|
||||
39.969,
|
||||
39.992,
|
||||
40.04,
|
||||
40.28,
|
||||
40.35,
|
||||
40.697,
|
||||
40.727,
|
||||
40.893,
|
||||
40.972,
|
||||
41.029,
|
||||
41.138,
|
||||
41.479,
|
||||
41.51,
|
||||
41.711,
|
||||
45.036,
|
||||
45.784,
|
||||
46.06,
|
||||
48.597,
|
||||
50.186,
|
||||
52.215
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"device": "NVIDIA GeForce RTX 3090",
|
||||
"torch": "2.10.0+cu130",
|
||||
"K": 8,
|
||||
"steps": 1,
|
||||
"B": 1,
|
||||
"act_scale": 1.0,
|
||||
"inference": {
|
||||
"fp32": {
|
||||
"p50": 7.681,
|
||||
"p95": 9.426,
|
||||
"p99": 10.631,
|
||||
"max": 15.837
|
||||
},
|
||||
"fp16": {
|
||||
"p50": 8.309,
|
||||
"p95": 10.791,
|
||||
"p99": 12.031,
|
||||
"max": 12.322
|
||||
},
|
||||
"bf16": {
|
||||
"p50": 8.577,
|
||||
"p95": 11.057,
|
||||
"p99": 14.174,
|
||||
"max": 17.1
|
||||
}
|
||||
},
|
||||
"cycle": {
|
||||
"fp32": {
|
||||
"p50": 36.507,
|
||||
"p95": 43.688,
|
||||
"p99": 46.568,
|
||||
"max": 50.598
|
||||
},
|
||||
"fp16": {
|
||||
"p50": 36.162,
|
||||
"p95": 50.43,
|
||||
"p99": 55.598,
|
||||
"max": 57.043
|
||||
}
|
||||
},
|
||||
"output_deviation": {
|
||||
"fp16": {
|
||||
"act_max_abs": 0.002096,
|
||||
"act_p99_abs": 0.001059,
|
||||
"deg_max_abs": 0.005,
|
||||
"deg_p99_abs": 0.00219,
|
||||
"would_change_execution_order": false
|
||||
},
|
||||
"bf16": {
|
||||
"act_max_abs": 0.017171,
|
||||
"act_p99_abs": 0.012661,
|
||||
"deg_max_abs": 0.03766,
|
||||
"deg_p99_abs": 0.03008,
|
||||
"would_change_execution_order": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"config": {
|
||||
"ckpt": "ml/runs/base_dag2_dag1/best.pt",
|
||||
"samples": "ml/data/samples",
|
||||
"tasks": null,
|
||||
"split": "val",
|
||||
"n": 256,
|
||||
"K": 8,
|
||||
"commit": 2,
|
||||
"fb": 2.2,
|
||||
"ki": 0.0,
|
||||
"fb_scale": 0.0,
|
||||
"fb_near": 0.2,
|
||||
"fb_fallback": 0.0,
|
||||
"kdecay": 0.9,
|
||||
"kimax": 0.5,
|
||||
"fb_every": 1,
|
||||
"safety_try": 0,
|
||||
"sel_w": 0.1,
|
||||
"dls_safety": 1,
|
||||
"fb_clear": 0.0,
|
||||
"fb_cmin": 0.3,
|
||||
"sub_refresh": 0,
|
||||
"fb_block_gain": 0.5,
|
||||
"dump": null,
|
||||
"out": "docs/experiment_round34_xf_reuse_check.json",
|
||||
"trace": null,
|
||||
"select": "endpoint",
|
||||
"replan": "empty",
|
||||
"safety": 1,
|
||||
"partial": 1,
|
||||
"inc_cap": 0,
|
||||
"gap_margin": 0.0,
|
||||
"max_sec": null,
|
||||
"seed": 0,
|
||||
"dls": "analytic",
|
||||
"device": "cuda"
|
||||
},
|
||||
"batch_size": 256,
|
||||
"batch_seed_rule": "same seed per batch",
|
||||
"checkpoint_sha256": "f7f686fd8ee92fb6948fbcc4ee954636065ad87bb54f661c4f8f575bc16c2ce1",
|
||||
"tasks_sha256": "249bd93457825cda98c59e64d9a096d3473c69aeb3553de1dea6d9e56be71772",
|
||||
"kin_fp": "2ebcbf17",
|
||||
"act_scale": 1.0,
|
||||
"metrics": {
|
||||
"n": 256,
|
||||
"n_ref": 256,
|
||||
"success": 0.57421875,
|
||||
"collision_free_success": 0.57421875,
|
||||
"time_ok_1p3": 0.390625,
|
||||
"collision_rate": 0.0,
|
||||
"collision_steps_mean": 0.0,
|
||||
"travel_ratio_median": 2.4449527263641357,
|
||||
"time_mean_s": 2.3076188564300537,
|
||||
"brakes_mean": 19.25,
|
||||
"start_fail": 0.0,
|
||||
"goal_ratio_2s": 0.20997506380081177,
|
||||
"err_fail_med": 229.68746948242188,
|
||||
"err_success_med": 0.18899640440940857,
|
||||
"dls_share": 0.625,
|
||||
"time_budget": "teacher×2(≥3 s)",
|
||||
"speed_ratio_p50": 1.6600004434585571,
|
||||
"speed_ratio_p95": 1.6600035429000854,
|
||||
"speed_ratio_max": 1.660003662109375,
|
||||
"over_vmax_rate": 1.0,
|
||||
"accel_ratio_p95": 1.5835107564926147,
|
||||
"accel_ratio_max": 1.6600004434585571
|
||||
},
|
||||
"simulation_wall_s": 317.96790459999465
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"device": "NVIDIA GeForce RTX 3090",
|
||||
"K": 8,
|
||||
"commit_n": 2,
|
||||
"design": "\u4e24\u6b21\u89c4\u5212\u4e3a\u4e00\u4e2a\u5355\u5143\uff0c\u5947\u6570\u8f6e\u53cd\u5e8f\uff1b\u6d41\u6c34\u7ebf\u90a3\u6b21\u7684\u8ba4\u8bc1\u8c03\u7528\u88ab\u8feb\u7528 cap=GAP_CAP(\u7279\u5f81\u9700\u8981)\uff0c\u8fd9\u662f\u590d\u7528\u7684\u771f\u5b9e\u4ee3\u4ef7\uff0c\u4e0d\u662f\u514d\u8d39",
|
||||
"equivalence": {
|
||||
"cached_gap_row_bitwise_equal": false,
|
||||
"features_bitwise_equal": false,
|
||||
"max_row_diff_mm": 6.29425048828125e-05
|
||||
},
|
||||
"fresh": {
|
||||
"p50_per_plan": 34.779,
|
||||
"p95": 39.271,
|
||||
"p99": 40.98,
|
||||
"reps": 60
|
||||
},
|
||||
"pipelined": {
|
||||
"p50_per_plan": 31.655,
|
||||
"p95": 34.483,
|
||||
"p99": 38.208,
|
||||
"reps": 60
|
||||
}
|
||||
}
|
||||
+746
@@ -0,0 +1,746 @@
|
||||
# 探索日志:Transformer 机械臂闭环控制
|
||||
|
||||
长期锚点:`docs/Transformer轨迹拟合训练方案.md` §9.2(部署形态 = 策略 + 安全层)。
|
||||
验收口径(§9.2):实际执行碰撞 = 0;held-out 可达任务到达率 ≥ 98%;到达用时 ≤ 老师 ×1.3;关节行程 ≤ 现有规划器 ×1.10;冷启动 < 10 ms;每次推理 + 安全认证 P99 < 20 ms;刹停发生率 < 2% 的推理周期;策略单独(关安全层)碰撞率 < 3%。
|
||||
|
||||
评测约定:val 任务、部署节奏(r = 3 重规划、1 段采样、K=8);「纯策略」= 关安全层;「部署」= 开安全层。时延:桌面 RTX 3090 上 `sample_k(B=64, K=8)` 墙钟均值(均值,非 P99);浏览器 ONNX P99 以 §9.2 R4 的独立测量为准。
|
||||
|
||||
**口径更正(2026-10-20,轮次 29 复核;下列历史原始数值保留):**
|
||||
- 轮次 24–28 的“50 Hz 可行/连续无饥饿”结论撤回。同步 `await plan(); tick()` 不是实际 20 ms 调度;`starveTicks` 只是耗时除以 20 ms 的估算。组件分位数相加不等于整次规划 P99,实测 62–68 ms 也超过 commit=3 的 60 ms。仍须严格认证下的真查看器 R9 测量,且不放松 §9.2 的 P99 < 20 ms。
|
||||
- Python 端点/中点检查不等于连续认证;JS `--seg 0` 是放松安全的消融,不是部署验收。开安全层碰撞必须为 0,不能套用“纯策略 <3%”判据。既有到达率允许途中碰撞,新指标 `collision_free_success` 才是时限内无碰撞到达率。
|
||||
- `replan=empty` 是同步仿真的零前缀配方,不是已验证的异步执行配置。所有任务(含 D)继续保留在历史对照分母内;不能与 held-out 可达任务 ≥98% 直接比较。
|
||||
- 轮次 26 的几何角速度雅可比不等于远离目标时 skew 姿态残差的精确导数,因而既改变控制律又消除差分误差;不能把全部收益归因于去噪。3.58% 是单个位置雅可比样本对拍,不是普遍噪声界。`check_dls.py` 中标 B=256 的测量实际仅有 64 行,不能引用为 B=256 性能。
|
||||
- `err_fail_med` 是批次结束时未按时到达任务的末端误差,不是每题截止时误差;仿真墙钟/题也不是单次规划延迟。查看器默认选择器仍为 consist,endpoint 仅是可选实验。
|
||||
|
||||
## 轮次 0:基线(2026-10-18,main)
|
||||
|
||||
- **假设**:模型开环已拟合老师(末端 ~6 mm),闭环失败另有原因。
|
||||
- **判据**:reach = 0 且碰撞 ≈ 100% 即失败;需同时报告碰撞 / 到达 / 精度 / 时延。
|
||||
- **配方**:`ml/runs/base/last.pt`(step 14000,旧配方、act_scale=1.0),n=256。
|
||||
- **对照**:老师回放 reach 1.0 / 碰撞 0;H1_oracle(老师提线走 rollout)reach 1.0、碰撞 0、轨迹偏差 p99 4.6e-4°。
|
||||
- **指标**:到达 **0%**;碰撞 **99.6%**;精度 ol_fk 5.98 mm / ol_best 2.92 mm / ol_div 0.655,2 s 误差比 0.755;时延未测。
|
||||
- **结论**:仿真/滚动无误,失败在策略输出。闭环对每步残差极敏感(老师动作加 σ=0.05×STEP 即 reach 1.0→0.218)。
|
||||
|
||||
## 轮次 1:数据规模能否救闭环(main,负结论)
|
||||
|
||||
- **假设**:训练数据不足导致分布外状态无覆盖。
|
||||
- **判据**:若闭环状态到训练集最近邻距离大,且密度缩放无法在误差尺度内缩小差距,则加大同类数据无效。
|
||||
- **配方**:191 万老师状态最近邻分析;6 维密度缩放 d∝N^(−1/6)。
|
||||
- **对照**:起点(老师分布内)最近邻。
|
||||
- **指标**:闭环状态最近邻 p50 **21.5°**(起点 13.2°);数据翻 4 倍仅降 ~21%,与 0.02° 误差尺度差三个量级。
|
||||
- **结论**:加大同类老师数据无效;需要「不同的数据」(闭环状态标注)。
|
||||
- **下一步**:DAgger 或状态扰动数据。
|
||||
|
||||
## 轮次 2:合成扰动状态微调(main,负结论)
|
||||
|
||||
- **假设**:偏移 1.5° 状态的老师标注可补足闭环状态覆盖。
|
||||
- **判据**:若 success 仍 0 或开环精度退化,则配方不成立。
|
||||
- **配方**:2000 个扰动起点(σ 混合 0.5/1/2/4°)→ 老师重规划(2000/2000 到达)→ 36k 样本 → 从 base/last.pt 微调 3000 步(lr 3e-4 / 1e-4 两轮)。
|
||||
- **对照**:base/last.pt。
|
||||
- **指标**:碰撞 99.6%→**48.4% / 60.4%**;到达仍 **0%**;开环 6→**15.3 / 16.4 mm**(退化 2.5×);ratio2s 0.927/0.893。
|
||||
- **结论**:只学会了「保守避撞」,开环精度被带偏,success 仍 0;此配方不成立。
|
||||
- **下一步**:改训练标签(绝对目标)或真实 DAgger。
|
||||
|
||||
## 轮次 3:绝对目标参数化(exp: `feat/abs-target`,负结论)
|
||||
|
||||
- **假设**:模型从当前状态外推增量(判别 ρ=1.54),改为绝对目标标签可让输出指向参考位置。
|
||||
- **判据**:一步采样开环误差需回到 <10 mm,闭环 success > 0;否则参数化不可行。
|
||||
- **配方**:`ABS_TARGET=1` 重打主数据(201 万样本,Y=16 步绝对目标/180),train/rollout/ckpt 适配;从零训练 9950 步(p_neq 预热 5000)。过程中修复前缀噪声增广把 eps 直接加到绝对目标(≈18° 污染)的 bug。
|
||||
- **对照**:base/last.pt(ol_fk 5.98 mm、reach 0%)。
|
||||
- **指标**:一步采样动作误差 **31°**(4/8 段 2.3°/2.8°);ol_fk 4000/6000/8000 步 = 74.6/140.4/139.0 mm;闭环 **0% / 100%**(1 段与 4 段皆然);时延未测。
|
||||
- **结论**:绝对目标的一步流匹配在 MeanFlow 头上学不动(过预热后 5000 步无下降趋势);此配方不成立。分支已推送远端 `217a70b`(本地分支可删,远端保留可复现)。
|
||||
- **下一步**:回归增量口径,上真实 DAgger。
|
||||
|
||||
## 轮次 4:真实 DAgger 1 轮(main,部分有效)
|
||||
|
||||
- **假设**:策略自己走到的状态(离训练集 21.5°)+ 老师重标注,可让模型学会在偏移状态上行动。
|
||||
- **判据**:reach 是否从 0 抬头;同时看碰撞、开环精度、时延。
|
||||
- **配方**:`ACT_SCALE=1.0 DAG_ROUNDS=1 DAG_N=2000 bash ml/dagger/run.sh base ml/runs/base/last.pt`(采集 2000 题 → 老师重规划 → 打包 → 微调 15000 步,lr 3e-4;主数据 + DAgger 混合)。
|
||||
- **对照**:base/last.pt。
|
||||
- **指标**:碰撞 99.6%→**40.2%**(8000 步 36.9%,10000 步 58.8%);到达 **0%**,仅微调 12000 步时出现 **0.4%(2/512)**;开环退化 6→**15.7 mm**;ratio2s 0.87–0.92;时延未测。
|
||||
- **结论**:DAgger 数据确实教会避撞,但微调把主分布带偏(开环退化),到达仍近 0;单独 DAgger 不是终点。
|
||||
- **下一步**:在 DAgger 模型上加目标反馈(模型前馈 + DLS 反馈)。
|
||||
|
||||
## 轮次 5:模型前馈 + DLS 目标反馈(exp: `feat/fb-mix`,历史最佳)
|
||||
|
||||
- **假设**:模型擅长开环轨迹/避撞,但不指向目标;把 DLS 朝目标的反馈叠加到候选动作上,可把「走偏」拉回目标。
|
||||
- **判据**:部署口径(+安全层)reach 显著 > 0 且碰撞 < 3%(§9.2 策略单独碰撞线)、刹停可控;否则不成立。
|
||||
- **配方**:`closed_loop.rollout(fb_gain=...)`:`inc += fb_gain · DLS(qe→T,R, n=1)`(加在所有候选上,安全层评估带反馈的候选)。模型 `ml/runs/base_dag1/best.pt`(DAgger 轮 4 的 best,12000 步)。n=128,val。
|
||||
- **对照**:base/last.pt + 同反馈;DAgger 模型 + 无反馈。
|
||||
- **指标(n=128)**:
|
||||
|
||||
| 配置 | 到达 | 碰撞 | 精度 ratio2s | 刹停/题 | 时延 |
|
||||
|---|---|---|---|---|---|
|
||||
| DAgger 模型, gain 0 | 0% | 44.5% | 0.873 | 0 | — |
|
||||
| DAgger 模型, gain 1.0, 关安全层 | 29.7% | 73.4% | 0.370 | 0 | — |
|
||||
| **DAgger 模型, gain 1.0, 开安全层** | **20.3%** | **2.3%** | **0.480** | **21.9** | **12.58 ms/次**(B=64,K=8,桌面 3090) |
|
||||
| base 模型, gain 1.0, 关安全层 | 0% | 94.5% | 0.554 | 0 | — |
|
||||
|
||||
(另测 n=32 复核:gain 1.0 + safety → reach 25.0%、碰撞 6.2%、ratio2s 0.588。)
|
||||
|
||||
- **结论**:**反馈混合是首个把到达率从 0 拉到 20%+ 的机理**;安全层把碰撞从 73% 压到 2.3%(部署口径),代价是刹停 21.9 次/题(远超 §9.2 的 <2%/周期)。精度 ratio2s 0.48(2 s 时误差缩一半),时延 12.58 ms/次接近 §9.2 的 20 ms(推理+认证)门槛。
|
||||
- **与历史最佳/基线对比**:reach 0→20.3%、碰撞 99.6→2.3%、ratio2s 0.755→0.480;开环精度仍退化(DAgger 微调导致 15.7 mm vs 基线 5.98 mm)。
|
||||
- **漂移检查**:main = 70654e4(无新提交);工作区仅用户个人 html 未跟踪;数据口径 act_scale=1.0 与 ckpt 一致;`feat/abs-target` 已推送远端;本次实验在独立分支 `feat/fb-mix`。
|
||||
- **下一步**:扫更大 gain(1.2–2.0)与增益衰减;目标是把刹停次数降下来、到达率再提升,并测 ONNX/浏览器时延。
|
||||
|
||||
## 轮次 6:反馈增益扩展扫描(exp: `feat/fb-mix`,小幅进展)
|
||||
|
||||
- **假设**:更大增益能把到达率继续推高。
|
||||
- **判据**:reach 显著高于 20.3%(>25%)且碰撞 ≤3%、刹停不失控。
|
||||
- **配方**:`rollout(fb_gain∈{1.2,1.5,2.0}, safety=True)`,模型同轮次 5,n=128。
|
||||
- **对照**:轮次 5(gain 1.0:reach 20.3% / 碰撞 2.3% / ratio2s 0.480 / 刹停 21.9)。
|
||||
- **指标**:
|
||||
|
||||
| gain | 到达 | 碰撞 | ratio2s | 刹停/题 | 墙钟/题 |
|
||||
|---|---|---|---|---|---|
|
||||
| 1.2 | **23.4%** | 1.6% | **0.454** | 31.4 | 973 ms |
|
||||
| 1.5 | 21.9% | 2.3% | 0.498 | 43.0 | 1151 ms |
|
||||
| 2.0 | 23.4% | 0.8% | 0.530 | 57.6 | 1100 ms |
|
||||
|
||||
- **结论**:到达率封顶在 ~23%,增益再大只增刹停(31→58 次/题)。当前瓶颈从「到不了目标」变成「安全层频繁刹停 + 近目标过冲」。
|
||||
- **下一步**:距离衰减增益(远离目标全增益、贴近目标减弱)+ 刹停兜底;目标 reach > 30% 且刹停显著下降。
|
||||
|
||||
## 轮次 7:距离衰减增益 + 刹停兜底(exp: `feat/fb-mix`,负结论)
|
||||
|
||||
- **假设**:贴近目标减弱反馈可减少过冲/刹停;安全层全拒时用「半速朝目标一步」(单点安全认证)可减少原地停滞。
|
||||
- **判据**:reach > 23.4%(轮次 6)且碰撞 ≤3%、刹停下降。
|
||||
- **配方**:`fb_scale=100`(>100 mm 全增益,近目标最低 0.2 倍);`fb_fallback=0.5`(全拒时半速 DLS 一步,认证 `qe+fb1` 单点无碰)。n=128,safety=True。
|
||||
- **对照**:轮次 6(gain 1.2、无衰减、无兜底:23.4% / 1.6% / 0.454 / 31.4 / 973 ms)。
|
||||
- **指标**:
|
||||
|
||||
| 配置 | 到达 | 碰撞 | ratio2s | 刹停/题 | 墙钟/题 |
|
||||
|---|---|---|---|---|---|
|
||||
| decay + fallback (gain 1.2) | 7.0% | 57.8% | 0.506 | 45.1 | 1166 ms |
|
||||
| decay only (gain 1.2) | 9.4% | 1.6% | 0.454 | 29.6 | 1106 ms |
|
||||
| no-decay + fallback (gain 1.2) | 21.1% | 57.8% | 0.506 | 46.8 | 1063 ms |
|
||||
| gain 1.0 + decay + fallback | 4.7% | 55.5% | 0.515 | 37.2 | 939 ms |
|
||||
|
||||
- **结论**:两个改动都失败。① 衰减使接近目标时的收敛变慢,到达从 23.4% 掉到 9.4%;② 兜底绕过安全层的多候选选择,碰撞从 1.6% 拉到 **57.8%**(仅单点认证、且执行 3 步同向动作,危险),必须清除。保留参数但默认关闭(`fb_scale=0, fb_fallback=0`),历史最佳配置(轮次 6)可复现。
|
||||
- **过程 bug(自造)**:衰减代码曾用变量名 `g` 覆盖 rollout 的随机数生成器,导致 `randn` 报错;改名 `gdec` 后正常——记录以免误判为模型问题。
|
||||
- **下一步**:DAgger 第 2 轮——采集时加入 fb_gain + safety,让训练分布 = 部署分布(1 轮,15000 步微调,约 1 小时)。按目标要求先向用户确认。
|
||||
|
||||
## 轮次 8:部署分布 DAgger 第 2 轮(exp: `exp/dagger-deploy`,边际改善)
|
||||
|
||||
- **假设**:第 1 轮 DAgger 用纯策略轨迹采集,与部署分布(反馈 + 安全层)不一致;用部署分布采集可让模型学到刹停/反馈下的正确动作。
|
||||
- **判据**:部署口径 reach > 23.4%(轮次 6)或刹停显著下降且到达不降。
|
||||
- **配方**:`ml.dagger.collect --fb_gain 1.2 --safety 1`(2000 题 → 637 起点,部署分布)→ 老师重规划 → 打包 → 从 `base_dag1/best.pt` 微调 15000 步(配置 base_dag2,lr 3e-4)。
|
||||
- **对照**:base_dag1/best.pt(轮次 6 历史最佳);纯策略 eval 见训练日志。
|
||||
- **指标(部署口径,n=128,safety=True)**:
|
||||
|
||||
| 模型 | gain | 到达 | 碰撞 | ratio2s | 刹停/题 | 墙钟/题 |
|
||||
|---|---|---|---|---|---|---|
|
||||
| dag2 best | 1.0 | 21.9% | 1.6% | 0.485 | **18.9** | **905 ms** |
|
||||
| dag2 best | 1.2 | 22.7% | 1.6% | 0.491 | 25.9 | 922 ms |
|
||||
| dag1 best | 1.0 | 20.3% | 2.3% | 0.480 | 21.9 | 944 ms |
|
||||
| dag1 best(轮次 6) | 1.2 | **23.4%** | 1.6% | **0.454** | 31.4 | 953 ms |
|
||||
|
||||
- **结论**:部署分布 DAgger 把刹停降 18–40%、时延降 ~31 ms,但到达率未突破 23% 平台(-0.7 pp),属边际权衡改善;历史最佳到达仍是 dag1+gain1.2(23.4%)。
|
||||
- **下一步**:试 replan=empty(r=0 规划,让反馈逐步生效)与安全层候选 K=16(减少全拒刹停)。
|
||||
|
||||
## 轮次 9:replan=empty(队列空时规划、r=0)/ K=16 安全候选(exp: `exp/dagger-deploy`,新历史最佳)
|
||||
|
||||
- **假设**:replan='empty'(每次队列空时规划、无前缀 r=0)比默认 r=3 更适合反馈混合。K=16 给安全层更多候选、减少全拒。
|
||||
(更正:replan='empty' 仍是每 3 步规划一次——队列空才规划,commit 3 步;收益来自 r=0 无前缀,不是规划频率。)
|
||||
- **判据**:部署口径 reach > 23.4% 且碰撞 ≤1.6%、刹停/时延不恶化。
|
||||
- **配方**:dag2 best;`replan='empty'`(每次 r=0 规划);`K=16`。n=128,safety=True。
|
||||
- **对照**:轮次 8(dag2+gain1.2:22.7% / 1.6% / 0.491 / 25.9 / 922 ms)。
|
||||
- **指标**:
|
||||
|
||||
| 配置 | 到达 | 碰撞 | ratio2s | 刹停/题 | 墙钟/题 |
|
||||
|---|---|---|---|---|---|
|
||||
| **gain1.2 + replan=empty** | **26.6%** | **0.8%** | **0.453** | **20.6** | **845 ms** |
|
||||
| gain1.2 + K=16 | 21.1% | 1.6% | 0.451 | 19.4 | 1629 ms |
|
||||
| gain1.0 + K=16 | 21.9% | 4.7% | 0.506 | 14.6 | 1588 ms |
|
||||
|
||||
- **结论**:**replan=empty(r=0)全面改善**(到达 +3.9 pp、碰撞 1.6→0.8%、刹停 25.9→20.6、时延 922→845 ms),成为**新历史最佳**。K=16 无收益且时延翻倍(1629 ms),淘汰。
|
||||
- **下一步**:replan=empty 下重扫增益(0.8/1.0/1.5/2.0),找新最优。
|
||||
|
||||
## 轮次 10:replan=empty(r=0)下的增益重扫(exp: `exp/dagger-deploy`,新历史最佳)
|
||||
|
||||
- **假设**:r=0 规划下,最优增益会上移。
|
||||
- **判据**:reach > 26.6%(轮次 9)且碰撞 ≤1.6%;同时比较刹停/时延。
|
||||
- **配方**:dag2 best,`replan='empty'`,gain ∈ {0.8, 1.0, 1.2, 1.5, 2.0},safety=True,n=128。
|
||||
- **对照**:轮次 9(gain 1.2:26.6% / 0.8% / 0.453 / 20.6 / 845 ms)。
|
||||
- **指标**:
|
||||
|
||||
| gain | 到达 | 碰撞 | ratio2s | 刹停/题 | 墙钟/题 |
|
||||
|---|---|---|---|---|---|
|
||||
| 0.8 | 21.9% | 2.3% | 0.505 | 11.3 | 801 ms |
|
||||
| 1.0 | 22.7% | **0.0%** | 0.489 | 15.2 | 810 ms |
|
||||
| 1.2 | 26.6% | 0.8% | 0.453 | 20.6 | 845 ms |
|
||||
| **1.5** | **28.9%** | 0.8% | **0.411** | 28.5 | 844 ms |
|
||||
| 2.0 | 28.9% | 0.8% | 0.414 | 44.9 | 914 ms |
|
||||
|
||||
- **结论**:到达在 gain 1.5 封顶(28.9%),2.0 无收益且刹停翻倍(44.9)。**按到达优先/碰撞 ≤3%:历史最佳 = gain 1.5 + replan=empty(28.9% / 0.8% / 0.411 / 28.5 / 844 ms)**;按碰撞优先:gain 1.0(22.7% / 0.0% / 0.489 / 15.2 / 810 ms)。n=128 的差异约 3–4 题,需 n=256 复核。
|
||||
- **下一步**:n=256 复核 gain 1.0 / 1.2 / 1.5;若平台稳定,再决定是否 DAgger 第 3 轮(采集用新部署配置)。
|
||||
|
||||
## 轮次 11:n=256 复核(发现前 128 题偏难)
|
||||
|
||||
- **假设**:轮次 10 的 n=128 差异含样本偏差,需扩大样本复核。
|
||||
- **判据**:reach 排名与轮次 10 一致、碰撞 ≤3%;若差异大则以 n=256 为准。
|
||||
- **配方**:dag2 best,`replan='empty'`,safety=True,gain ∈ {1.0, 1.2, 1.5},n=256。
|
||||
- **对照**:轮次 10(n=128:22.7/26.6/28.9%)。
|
||||
- **指标**:
|
||||
|
||||
| gain | n=128 到达 | **n=256 到达** | 碰撞 | ratio2s | 刹停/题 | 墙钟/题 |
|
||||
|---|---|---|---|---|---|---|
|
||||
| 1.0 | 22.7% | **31.6%** | 0.8% | 0.428 | 15.0 | 748 ms |
|
||||
| 1.2 | 26.6% | **34.8%** | 1.2% | 0.392 | 18.6 | 752 ms |
|
||||
| 1.5 | 28.9% | **36.7%** | 1.6% | 0.323 | 27.4 | 760 ms |
|
||||
|
||||
- **结论**:前 128 题显著偏难;n=256 上 **gain 1.5 + replan=empty = 到达 36.7% / 碰撞 1.6% / ratio2s 0.323 / 刹停 27.4 / 760 ms**(新历史最佳)。gain 1.0 更保守(31.6% / 碰撞 0.8% / 刹停 15.0)。排名与 n=128 一致(1.5 > 1.2 > 1.0)。
|
||||
- **下一步**:n=512 复核 gain 1.2/1.5;随后评估 DAgger 第 3 轮(部署分布采集)与监控页回写。
|
||||
|
||||
## 轮次 12:n=512 复核(稳定结论)
|
||||
|
||||
- **假设**:n=256 的 34.8–36.7% 需在更大样本上确认。
|
||||
- **判据**:reach 与 n=256 差异 <5 pp、碰撞 ≤3%。
|
||||
- **配方**:dag2 best,`replan='empty'`,safety=True,gain ∈ {1.2, 1.5},n=512。
|
||||
- **对照**:轮次 11(n=256:34.8 / 36.7%)。
|
||||
- **指标**:
|
||||
|
||||
| gain | n=256 到达 | **n=512 到达** | 碰撞 | ratio2s | 刹停/题 | 墙钟/题 |
|
||||
|---|---|---|---|---|---|---|
|
||||
| 1.2 | 34.8% | **32.6%** | 1.0% | 0.435 | 18.6 | 722 ms |
|
||||
| 1.5 | 36.7% | **33.4%** | 1.0% | 0.399 | 28.1 | 738 ms |
|
||||
|
||||
- **结论**:n=512 稳定在 **33% 左右**(n=256 略乐观);**历史最佳(n=512,部署口径)= gain 1.5 + replan=empty:到达 33.4% / 碰撞 1.0% / ratio2s 0.399 / 刹停 28.1 / 738 ms**。保守版 gain 1.2:32.6% / 1.0% / 0.435 / 18.6 / 722 ms(刹停少 1/3)。
|
||||
- **监控页回写**:`ml/monitor.py` 新增 `/api/explore`(读 docs/探索日志.md),`ml/monitor.html` 新增「闭环探索日志」卡片;Edge headless 截图确认渲染正常(http://127.0.0.1:8100)。
|
||||
- **下一步**:候选选择器(consist/value/first)与 K=4 在反馈+每步重规划下是否影响到达/刹停。
|
||||
|
||||
## 轮次 13:选择器 / K / 失败模式(exp: `exp/dagger-deploy`)
|
||||
|
||||
- **假设**:反馈混合下,候选选择器与候选数 K 会影响到达/时延;失败模式可指导下一步。
|
||||
- **判据**:reach > 36.7% 或时延显著下降;同时报告 time_ok_1p3。
|
||||
- **配方**:dag2 best,replan='empty',gain 1.5,safety=True,n=256。
|
||||
- **对照**:轮次 11/12(consist K=8:36.7%)。
|
||||
- **指标**:
|
||||
|
||||
| 配置 | 到达 | 碰撞 | ratio2s | 刹停/题 | 墙钟/题 |
|
||||
|---|---|---|---|---|---|
|
||||
| consist K=8 | 36.7% | 1.6% | 0.323 | 27.4 | 764 ms |
|
||||
| value K=8 | 35.9% | 1.6% | 0.334 | 29.4 | 1063 ms |
|
||||
| first K=8 | 36.3% | 1.2% | 0.338 | 28.1 | 780 ms |
|
||||
| K=6 | 35.9% | 1.6% | 0.353 | 28.6 | 627 ms |
|
||||
| K=4 | 31.6% | 1.2% | 0.396 | 32.6 | 482 ms |
|
||||
|
||||
- **失败模式(n=256,consist K=8)**:失败 149 题中 **碰撞仅 3 题(1.2%)、超时无碰撞 146 题(57.0%)**;失败题终点误差 p50 140 mm;`time_ok_1p3` 仅 **13.3%**;成功题 t_done p50 2.74 s(时限 p50 3.4 s);刹停 27.4 次/题。
|
||||
- **结论**:选择器无差别(consist 略优);K=8 到达最佳,K=6 省 18% 时延(到达 -0.8 pp)。**当前真正的瓶颈是时间效率(频繁刹停→超时),不是碰撞**。§9.2 的「用时 ≤ 老师×1.3」当前只有 13.3%。
|
||||
- **下一步**:每步重规划下,安全层只需认证第 1 步(现在验 3 步,过度保守→全拒→刹停);改 `safety_steps=1` 验证能否在保持低碰撞的同时大幅减少刹停。
|
||||
|
||||
## 轮次 14:部分安全前缀(exp: `exp/dagger-deploy`,刹停大降)
|
||||
|
||||
- **假设**:安全层现在要求 3 步全安全才执行,候选只要第 2–3 步有碰撞就全拒刹停;改为「执行到第一个不安全步为止」可减少刹停。
|
||||
- **判据**:刹停显著下降、到达不降、碰撞 ≤3%。
|
||||
- **配方**:dag2 best,replan='empty',gain 1.5,safety=True,`safety_partial=1`;n=256。
|
||||
- **对照**:全窗口(轮次 11/13:36.7% / 1.6% / 0.323 / 27.4 / 775 ms)。
|
||||
- **指标**:
|
||||
|
||||
| 安全层 | 到达 | time_ok_1p3 | 碰撞 | ratio2s | 刹停/题 | 墙钟/题 |
|
||||
|---|---|---|---|---|---|---|
|
||||
| 3 步全安全 | 36.7% | 13.3% | 1.6% | 0.323 | 27.4 | 775 ms |
|
||||
| **部分安全前缀** | **38.3%** | 13.7% | 1.6% | **0.308** | **8.6** | 770 ms |
|
||||
|
||||
- **结论**:刹停 **27.4→8.6(-69%)**、到达 +1.6 pp、碰撞不变——**部分安全前缀有效**(新最佳:38.3% / 1.6% / 0.308 / 8.6 / 770 ms)。但 `time_ok_1p3` 仍 13.7%:说明超时主因不是刹停,而是**执行粒度**——部分前缀的填充零步仍在消耗时间。
|
||||
- **下一步**:commit_n=1(每次只提交 1 步、每步规划,无填充步),验证时间效率。
|
||||
|
||||
## 轮次 15:每步规划(commit_n=1)(exp: `exp/dagger-deploy`,新历史最佳)
|
||||
|
||||
- **假设**:部分前缀的填充零步仍在消耗时间;每次只提交 1 步、每步重新规划可消除填充、提升时间效率。
|
||||
- **判据**:time_ok_1p3 显著上升、到达不降、碰撞 ≤3%。
|
||||
- **配方**:dag2 best,replan='empty',gain 1.5,safety=True,`safety_partial=1, commit_n=1`;n=256。
|
||||
- **对照**:commit_n=3 部分前缀(轮次 14:38.3% / 13.7% / 1.6% / 0.308 / 8.6 / 770 ms)。
|
||||
- **指标**:
|
||||
|
||||
| commit_n | 到达 | time_ok_1p3 | 碰撞 | ratio2s | 刹停/题 | 墙钟/题 |
|
||||
|---|---|---|---|---|---|---|
|
||||
| 3 | 38.3% | 13.7% | 1.6% | 0.308 | 8.6 | 770 ms |
|
||||
| **1** | **41.8%** | **21.5%** | 2.3% | **0.259** | 26.9 | 967 ms |
|
||||
|
||||
- **结论**:每步规划把到达推到 **41.8%**、时间效率 **13.7→21.5%**、精度 ratio2s **0.259**;代价:碰撞 1.6→2.3%(仍 <3%)、刹停计数回升(每步都判断)、时延 +26%。**新历史最佳(n=256,部署口径):41.8% / 2.3% / 0.259 / 21.5% / 967 ms**。
|
||||
- **注**:commit_n=1 的推理频率是 3 倍,真机需核对 §9.2 的 P99 <20 ms 预算(当前桌面 12.58 ms/次)。
|
||||
- **下一步**:n=512 复核;若稳定则收尾(更新最佳、监控页、分支清理)。
|
||||
|
||||
## 轮次 16:n=512 复核每步规划(稳定结论)
|
||||
|
||||
- **假设**:轮次 15 的 41.8%(n=256)需更大样本确认。
|
||||
- **判据**:reach 与 n=256 差异 <5 pp、碰撞 ≤3%。
|
||||
- **配方**:dag2 best,replan='empty',gain 1.5,safety=True,safety_partial=1,commit_n=1;n=512。
|
||||
- **对照**:轮次 15(n=256:41.8% / 21.5% / 2.3% / 0.259 / 967 ms)。
|
||||
- **指标**:到达 **40.8%**、time_ok_1p3 **25.0%**、碰撞 **2.1%**、ratio2s **0.309**、刹停 25.3、墙钟 **852 ms/题**。
|
||||
- **结论**:稳定。**历史最佳(n=512,部署口径)= 40.8% 到达 / 2.1% 碰撞 / ratio2s 0.309 / time_ok 25.0% / 852 ms/题**;从基线 0% 到达提升 40.8 pp。相对 §9.2(98%、碰撞 0、用时≤老师×1.3)仍有大差距,但机理已成立。
|
||||
- **下一步**:每步规划下重扫增益(1.8/2.2/3.0),看时间效率是否继续提升;随后收尾。
|
||||
|
||||
## 轮次 17:每步规划下的更大增益(exp: `exp/dagger-deploy`)
|
||||
|
||||
- **假设**:每步规划下更大的反馈增益可进一步提升到达与时间效率。
|
||||
- **判据**:time_ok 上升、到达不降、碰撞 ≤3%。
|
||||
- **配方**:dag2 best,replan='empty',commit_n=1,safety_partial=1,gain ∈ {1.8, 2.2, 3.0},n=256。
|
||||
- **对照**:轮次 15(gain 1.5:41.8% / 21.5% / 2.3% / 0.259 / 26.9 / 967 ms)。
|
||||
- **指标**:
|
||||
|
||||
| gain | 到达 | time_ok_1p3 | 碰撞 | ratio2s | 刹停/题 | 墙钟/题 |
|
||||
|---|---|---|---|---|---|---|
|
||||
| **1.8** | **43.8%** | 28.9% | 1.6% | 0.216 | 40.0 | 956 ms |
|
||||
| 2.2 | 41.0% | **32.4%** | 2.0% | 0.174 | 64.4 | 976 ms |
|
||||
| 3.0 | 36.3% | 32.8% | 0.8% | **0.153** | **123.2** | 994 ms |
|
||||
|
||||
- **结论**:gain 1.8 到达最高(43.8%);2.2/3.0 精度与时间效率更好但到达下降、刹停暴涨(3.0 达 123 次/题,过冲)。**历史最佳按到达优先(碰撞 ≤3%):gain 1.8 = 到达 43.8% / 碰撞 1.6% / ratio2s 0.216 / time_ok 28.9% / 956 ms(n=256)**。保守/时间优先可选 2.2。
|
||||
- **下一步**:n=512 复核 gain 1.8;随后收尾。
|
||||
|
||||
## 轮次 18:n=512 复核 gain 1.8(收尾)
|
||||
|
||||
- **假设**:轮次 17 的 43.8%(n=256)需更大样本确认。
|
||||
- **判据**:reach 与 n=256 差异 <5 pp、碰撞 ≤3%。
|
||||
- **配方**:dag2 best,replan='empty',commit_n=1,safety_partial=1,gain 1.8;n=512。
|
||||
- **对照**:轮次 17(n=256:43.8% / 28.9% / 1.6% / 0.216 / 40.0 / 956 ms);轮次 16(gain 1.5 n=512:40.8% / 25.0% / 2.1% / 0.309 / 25.3 / 852 ms)。
|
||||
- **指标**:到达 **42.2%**、time_ok_1p3 **29.1%**、碰撞 **2.9%**、ratio2s **0.270**、刹停 37.4、墙钟 **870 ms/题**。
|
||||
- **结论**:gain 1.8 在 n=512 稳定(42.2%),到达/时间效率优于 gain 1.5(+1.4 pp / +4.1 pp),但碰撞 2.1→2.9%(贴近 3% 线)、刹停 25.3→37.4。**历史最佳(到达优先,n=512)= gain 1.8;碰撞优先 = gain 1.5**。
|
||||
- **下一步**:本轮探索收尾(监控页已回写);进入大规模训练需用户确认 §9.2 锚点。
|
||||
|
||||
## 轮次统计
|
||||
|
||||
- 连续无实质进展轮数:0(轮次 9–17 持续有实质进展)。
|
||||
- **历史最佳(部署口径,n=512)**:`ml/runs/base_dag2_dag1/best.pt` + `K=8, safety=True, replan='empty', fb_gain=1.8, safety_partial=1, commit_n=1` → **到达 42.2%、碰撞 2.9%、ratio2s 0.270、time_ok_1p3 29.1%、刹停 37.4/题、仿真墙钟 870 ms/题**;推理 12.58 ms/次(B=64,K=8,桌面 3090 均值,P99 未测)。
|
||||
- 保守版(碰撞优先):gain 1.5 → 40.8% / 2.1% / 0.309 / 25.0% / 25.3 / 852 ms。
|
||||
- 与基线对比:到达 **0→42.2%**、碰撞 **99.6→2.9%**、ratio2s **0.755→0.270**;代价:DAgger 微调使开环 ol_fk 5.98→15.7 mm。
|
||||
- 相对 §9.2:到达 42.2% vs ≥98%(差距大);碰撞 2.9% vs 0(接近策略单独 <3% 线);用时 ≤老师×1.3 为 29.1%;推理+认证 P99 未测(桌面均值 12.58 ms,预算 20 ms)。
|
||||
- 未进入大规模训练(需用户确认 §9.2 锚点)。
|
||||
- 训练方法探索(轮次 19–22):APG(管线修复、尺度失控)、反馈蒸馏(未内化)、DAgger-3(39.5%)、冻结编码器(41.8%)——均未超过 dag2 基线 43.8%。
|
||||
|
||||
## 轮次 19:APG 闭环策略梯度试跑(exp: `exp/dagger-deploy`,管线修复但暂不采用)
|
||||
|
||||
- **假设**:用闭环目标/碰撞损失直接微调策略(把"朝目标走"内化),减少对执行层反馈的依赖。
|
||||
- **判据**:纯策略闭环 success 上升、碰撞铰链下降;部署口径(+反馈/安全层)不降。
|
||||
- **配方**:`ml.apg.apg_finetune --init base_dag2_dag1/best.pt --steps 2`(先冒烟;原计划 500 步)。
|
||||
- **修复的两个既有 bug**(APG 此前从未实测):
|
||||
1. `kin_torch._cat_gaps` 的 `p['b'] += s` 是 in-place,而 `b` 被 autograd 索引反向图引用 → backward 报 version 错;改为 `p['b'] = p['b'] + s`。
|
||||
2. APG 段边界 `queue.detach()` 让下一段执行的动作无梯度;改为只 detach 状态并重置队列(下一 plan 走 r=0 重新提交)。
|
||||
- **指标(2 步冒烟)**:EVAL0(纯策略)success 0 / 碰撞 31.8%;第 0 步 col(碰撞铰链均值)**409508**、gnorm 473119(被裁剪)、tgt 206.6、smooth 645;EVAL@2 success 0 / 碰撞 26.0%。
|
||||
- **结论**:管线已能跑,但**损失尺度失控**(碰撞铰链均值 40 万,远大于 margin 3mm 的合理量级);且 APG 展开是纯策略口径(无反馈/安全层/每步规划),与当前部署形态不一致。**暂不采用**,转「反馈蒸馏」。
|
||||
- **下一步**:反馈蒸馏——用最终部署配置收集 (特征, 复合动作=模型输出+目标反馈) 样本,微调模型把反馈内化。
|
||||
|
||||
## 轮次 20:反馈蒸馏(exp: `exp/dagger-deploy`,负结论)
|
||||
|
||||
- **假设**:用最终部署配置收集 (特征, 复合动作 = 模型输出 + 目标反馈) 样本,微调后模型可内化反馈(部署时降低/去掉反馈仍能到目标)。
|
||||
- **判据**:部署口径下 `fb_gain=0~0.9` 时 success 接近/超过基线(43.8%,n=256),且 time_ok 不降。
|
||||
- **配方**:`rollout` 加 collect 钩子(与部署一致:safety、replan='empty'、safety_partial=1、commit_n=1、fb_gain=1.8)收集 500 题 → **17.7 万样本**;`train.py --config distill.json`(lr 1e-4、3000 步、w_value=0、w_sub=0、w_fk=0.1、w_smooth=0.01)+ 主数据 BC 锚定,从 dag2 best 微调。
|
||||
- **对照**:dag2 + gain 1.8(n=256:43.8% / 28.9% / 1.6% / 0.216 / 40.0 / 956 ms)。
|
||||
- **指标(n=256,部署口径)**:
|
||||
|
||||
| 模型 | gain | 到达 | time_ok_1p3 | 碰撞 | ratio2s | 刹停/题 | 墙钟/题 |
|
||||
|---|---|---|---|---|---|---|---|
|
||||
| distill | 0.0 | **0.8%** | — | 0.0% | 0.708 | 2.1 | 762 ms |
|
||||
| distill | 0.9 | 36.7% | 10.5% | 1.2% | 0.421 | 12.4 | 916 ms |
|
||||
| distill | 1.8 | 43.4% | 27.7% | 2.0% | 0.228 | 47.4 | 925 ms |
|
||||
| dag2(基线) | 1.8 | 43.8% | 28.9% | 1.6% | 0.216 | 40.0 | 956 ms |
|
||||
|
||||
- **结论**:**反馈未内化**——`gain=0` 时到达仅 0.8%(与基线纯策略一样);`gain=1.8` 时与基线持平(43.4 vs 43.8,差约 1 题),碰撞/刹停略差。蒸馏样本占比仅 8.5%、标签仍以主数据增量为主,模型没有学会"看目标修正"。此配方不成立。
|
||||
- **下一步**:与最终部署配置一致的 DAgger 第 3 轮(采集时已用 safety+fb 1.2,但仍是 3 步提交/全窗口;现在部署是每步规划+部分前缀)。
|
||||
|
||||
## 轮次 21:DAgger-3(最终部署配置采集)(exp: `exp/dagger-deploy`,负结论)
|
||||
|
||||
- **假设**:用最终部署配置(每步规划 + 部分安全前缀 + 反馈 gain1.8 + 安全层)采集,训练分布与部署完全一致,可继续提升。
|
||||
- **判据**:部署口径 success > 43.8%(dag2 基线,n=256)。
|
||||
- **配方**:`collect --fb_gain 1.8 --safety 1 --replan empty --commit_n 1 --safety_partial 1`(500 题、73 起点)→ 老师重规划 → 打包 → 从 dag2 best 微调 15000 步(lr 3e-4,配置 base_dag3)。
|
||||
- **对照**:dag2 + gain1.8(n=256:43.8% / 28.9% / 1.6% / 0.216 / 40.0 / 956 ms)。
|
||||
- **指标(n=256,部署口径)**:
|
||||
|
||||
| 模型 | gain | 到达 | time_ok_1p3 | 碰撞 | ratio2s | 刹停/题 | 墙钟/题 |
|
||||
|---|---|---|---|---|---|---|---|
|
||||
| dag3 | 1.5 | 39.8% | 16.0% | 1.2% | 0.360 | 14.7 | 912 ms |
|
||||
| dag3 | 1.8 | 39.5% | 21.1% | 1.2% | 0.320 | 24.5 | 935 ms |
|
||||
| dag2(基线) | 1.8 | **43.8%** | **28.9%** | 1.6% | **0.216** | 40.0 | 956 ms |
|
||||
|
||||
- **结论**:DAgger-3 到达 **-4.3 pp**(39.5 vs 43.8),time_ok -7.8 pp;碰撞/刹停略好但主指标下降。开环进一步退化(ol_fk 19.5 mm vs dag2 15.7)。**负结论**:继续微调(15000 步 lr 3e-4)会退化主分布,训练侧收益递减。
|
||||
- **下一步**:冻结编码器、只微调解码器(假设:微调退化来自表征漂移),用同一份数据与预算验证。
|
||||
|
||||
## 轮次 22:冻结编码器微调(exp: `exp/dagger-deploy`,负结论)
|
||||
|
||||
- **假设**:微调导致的分布退化来自表征漂移;冻结编码器(enc + enc_norm)、只调解码器/头,可保留开环精度同时吸收 DAgger-3 的部署分布样本。
|
||||
- **判据**:部署口径 success > 43.8%(dag2)且 ol_fk 不退化(≤16 mm)。
|
||||
- **配方**:`train.py --freeze-enc`(优化器只含 requires_grad 参数),数据 = 主数据 + DAgger-3 样本,lr 3e-4、5000 步,从 dag2 best 初始化;n=256 部署口径。
|
||||
- **对照**:dag2 + gain1.8(43.8% / 28.9% / 1.6% / 0.216 / 40.0 / 956 ms)。
|
||||
- **指标**:
|
||||
|
||||
| 模型 | gain | 到达 | time_ok_1p3 | 碰撞 | ratio2s | 刹停/题 | 墙钟/题 | ol_fk |
|
||||
|---|---|---|---|---|---|---|---|---|
|
||||
| 冻结编码器 | 1.5 | 39.8% | 22.3% | 1.2% | 0.293 | 25.4 | 936 ms | 15.8 mm |
|
||||
| 冻结编码器 | 1.8 | 41.8% | 26.2% | 2.3% | 0.274 | 41.4 | 940 ms | 15.8 mm |
|
||||
| dag2(基线) | 1.8 | **43.8%** | **28.9%** | 1.6% | **0.216** | 40.0 | 956 ms | 15.7 mm |
|
||||
|
||||
- **结论**:冻结编码器**确实减缓了开环退化**(ol_fk 15.8 vs 全微调 19.5),但部署到达仍比 dag2 低 2.0 pp——**无提升**。至此训练侧四种方法(APG、反馈蒸馏、DAgger-3、冻结编码器)均未超过 dag2 基线(43.8%),训练侧在当前数据/预算下已到平台。
|
||||
- **下一步(超出小规模范围,需确认)**:更大规模训练(24000 步从头 + 8000×2 轮 DAgger)或改特征/架构(目标条件化、状态扰动训练需重算特征)。
|
||||
|
||||
## 轮次 23:实时性口径评估(exp: `exp/dagger-deploy`)
|
||||
|
||||
- **背景**:870 ms/题是仿真里整条轨迹的总时长(150–300 次规划累加),不是控制延迟。实时口径按 §9.2:每次「推理 + 安全认证」P99 < 20 ms(50 Hz,DT=0.02 s)。
|
||||
- **假设**:单次规划延迟可以压到 20 ms 以内。
|
||||
- **判据**:B=1 单题、单次规划(features + sample_k K=8 + 目标反馈 + 安全层)P99 < 20 ms。
|
||||
- **优化**:① DLS 目标反馈的 6 次串行有限差分改为一次批量 FK(数值差 ≤0.013°,DLS 25→10–17 ms);② 单题安全层按候选早停(首个全安全候选即停,16 点→2–4 点)。
|
||||
- **指标(桌面 RTX 3090,B=1,Python;GPU 时钟抖动使 p50 在 40–65 ms 间波动)**:单次规划 **p50 40–65 ms / p99 70–80 ms**;分解:features 10–17 ms、推理 8–14 ms、DLS 反馈 10–17 ms、安全层 10–17 ms。
|
||||
- **实时频率扫描(n=256,部署口径,gain1.8 + safety + partial)**:
|
||||
|
||||
| 规划节奏 | 控制周期 | 到达 | time_ok_1p3 | 碰撞 | 刹停/题 |
|
||||
|---|---|---|---|---|---|
|
||||
| 每步(commit_n=1) | 20 ms | **42.2%(n=512)** | 29.1% | 2.9% | 37.4 |
|
||||
| 每 3 步(commit_n=3) | 60 ms | 36.3% | 16.4% | 1.6% | 14.3 |
|
||||
| 每 6 步(commit_n=6) | 120 ms | 14.8% | 3.9% | 2.0% | 6.1 |
|
||||
| 每 10 步(commit_n=10) | 200 ms | 2.0% | — | 1.2% | 3.7 |
|
||||
|
||||
- **结论**:**当前方案不满足 50 Hz 实时**(单次 40–80 ms,超预算 2–4 倍);42.2% 的成绩依赖每步规划(20 ms 节奏)。实时可行节奏下:每 3 步 → 36.3%(p50 有余量、p99 需继续优化),每 6 步 → 14.8%。**实时性是当前方案的硬约束,不是仿真耗时问题**。
|
||||
- **下一步(需确认)**:① 浏览器 ONNX 路径实测(推理 P99 历史 10–12 ms;特征/安全层在 JS 端需 `tests/policy_bench.cjs` 实测);② 特征缓存 + 安全层粗筛,目标单次 P99 < 20 ms;③ 或接受「每 3 步规划」的 60 ms 周期(36.3%)。
|
||||
|
||||
## 轮次 24:实时性优化与新方法(exp: `exp/dagger-deploy`)
|
||||
|
||||
- **目标**:准确率更高 + 效率满足 50 Hz(20 ms 控制步)。
|
||||
- **① 混合节奏(规划每 3 步 + 执行时每步反馈)——负结论**:plan fb1.8 + exec fb1.8 → 36.3%(与纯规划反馈的 commit_n=3 完全相同);plan fb0 + exec fb1.8 → 仅 1.6%。执行时反馈不带来额外收益(规划时的反馈已是主要贡献),此捷径不成立。
|
||||
- **② 特征几何优化(有效)**:特征只用 8 组间隙(GP),但原实现算全部 49 组(67256 簇对)。新增 `Kin.gm_groups(q, GP, cap)`:按 7 连杆组对过滤簇对(簇索引 → `cl_g` → 组对 min/max),只算 8 组。
|
||||
- 数值验证:与 `gaps()['gm'][:, a*7+b]` 逐项一致(diff 0)。
|
||||
- 延迟:gm 计算 10.4→**7.1 ms**(p50),单次规划省约 3 ms。
|
||||
- **③ 浏览器部署**:导出 `webapp/models/traj_policy.onnx`(dag2 best,19.8 MB,对拍误差 3.1e-6,act_scale 1.0);`ik-policy.js` 加全程目标反馈(`fbGain`)+ `commit` 可配;`ik-policy-glue.js` 支持 `?fb=&commit=`(默认 fb=1.8、commit=3)。
|
||||
- JS bench(Node,10 题,fb1.8+commit1):到达 0、**刹车率 47.3%**(每 2 次规划刹停一次)、planP50 43.8 / P99 70.5 ms。JS 安全层(5 mm 护栏 + 距离认证)比 Python(0.5 mm gap)保守,反馈+每步规划被大量拒绝。
|
||||
- **④ 实时口径的关键认识**:部署形态是**异步规划**(tick 20 ms 只执行队列;`plan()` 后台跑),所以 50 Hz 的约束是「tick < 20 ms + 规划在队列耗尽前完成」,不是「单次规划 < 20 ms」。
|
||||
- JS 的 tick 只做队列执行 + 投影/碰撞检查(~1.5–3 ms)→ 50 Hz 可行;
|
||||
- 规划 P99 70 ms → 需要 commit ≥ 4(80 ms 队列)才不饥饿;commit=3(60 ms)会偶发饥饿。
|
||||
- 准确率与规划频率的 trade-off:commit1 42.2%(不可 50Hz)、commit3 36.3%、commit6 14.8%。
|
||||
- **下一步**:① 在 commit=3/4 的实时节奏下找准确率提升(候选平均、dag3_fe 冻结编码器、更高 gain);② 把 gm_groups 同步到 JS(gapMatrix 只算 8 组);③ 降低 JS 安全层拒绝率(margin/认证预算调参)。
|
||||
|
||||
## 轮次 25:实时节奏下的准确率探索 + 推理提速(exp: `exp/dagger-deploy`)
|
||||
|
||||
- **目标**:在 50 Hz 可行的节奏(commit=3,60 ms 周期)下提升准确率。
|
||||
- **效率优化(有效)**:
|
||||
- `Kin.gm_groups`:特征只算 8 组间隙(数值 diff 0),features 10.4→**7.1 ms**;
|
||||
- **onnxruntime CPU 推理 3.9 ms**(PyTorch 11.1 ms,部署端本来就是 ONNX);
|
||||
- 单次规划 ≈ 7.1(features)+3.9(推理)+11(DLS)+8(安全)+2 ≈ **32 ms p50 / ~45 ms p99**;
|
||||
- 异步部署下 tick(执行步 + 碰撞检查)2–3 ms → **50 Hz 控制可行**;commit=3(60 ms 队列)可覆盖规划 p99。
|
||||
- **准确率尝试(n=256,commit=3,gain1.8,safety_partial)**:
|
||||
|
||||
| 方法 | 到达 | time_ok | 碰撞 | ratio2s | 刹停 |
|
||||
|---|---|---|---|---|---|
|
||||
| dag2 + consist(基线) | **36.3%** | 16.4% | 1.6% | 0.277 | 14.3 |
|
||||
| dag2 + 候选平均(select=average) | 29.7% | 20.3% | 0.4% | 0.432 | 55.9 |
|
||||
| 冻结编码器模型(dag3_fe) | 34.4% | 14.8% | 2.0% | 0.332 | 15.8 |
|
||||
| dag2 + commit=4 | 28.9% | 8.2% | 3.5% | 0.339 | 10.5 |
|
||||
|
||||
- **结论**:候选平均、冻结编码器、更稀疏规划**均未超过 36.3%**。**50 Hz 节奏下的最佳配置 = dag2 + commit=3 + consist + gain1.8 + safety_partial:到达 36.3% / 碰撞 1.6% / ratio2s 0.277**(相对非实时的 42.2% 差 5.9 pp)。
|
||||
- **下一步**:若要把实时准确率再拉高,需要把单次规划再压到 ~22 ms 以支持 commit=2(40 ms 周期,预计 ~39%);或提升模型本身精度(训练侧)。
|
||||
|
||||
## 轮次 26:解析雅可比 DLS——去掉差分噪声,准确率大幅提升(exp: `exp/dagger-deploy`,新历史最佳)
|
||||
|
||||
- **背景**:DLS 目标反馈此前用 6 次批量有限差分(ε=1e-3°)求雅可比。float32 下旋转项信噪比只有 ~1%,位置项 ~3.6%(与 autograd 对拍,见下),相当于每次规划往反馈方向注入 2–4% 的随机扰动。
|
||||
- **假设**:改用几何雅可比(一次 FK)可同时去噪 + 提速;闭环准确率应不降、延迟应下降。
|
||||
- **判据**:① 雅可比与 autograd 一致(rel < 1e-4);② n=256 commit=3 到达 ≥ 36.3%(轮次 25 基线,不劣化);③ DLS 单次延迟下降。
|
||||
- **配方**:`Kin.jac` 几何雅可比(Jv_k = a_k×(p−o_k),Jw_k = a_k,度单位);`dls_steps(analytic=True)` 默认;其余同轮次 25(dag2、K=8、gain1.8、safety_partial、replan=empty)。
|
||||
- **数值对拍**(`ml/eval/check_dls.py`):
|
||||
- 位置项:解析 J 与 autograd 逐项一致(rel 0.00000);有限差分 J 自身 rel 误差 **3.58%**。
|
||||
- 姿态项:解析 J 与差分 DLS 输出 max 0.20°/rel 5%(差的部分是 rotvec 的二阶项 Jr(e),非噪声)。
|
||||
- DLS 输出:pos-only max 0.12°,pos+rot max 0.20°。
|
||||
- **延迟**(B=1,3090):n=1 **9.3→7.1 ms**,n=3 **27.7→19.5 ms**(每次 DLS 少 6 次批量 FK)。
|
||||
- **闭环(replan=empty,analytic,n=256)**:
|
||||
|
||||
| commit | 到达 | time_ok_1p3 | 碰撞 | ratio2s | 刹停/题 |
|
||||
|---|---|---|---|---|---|
|
||||
| 3(FD 对照,完全复现轮次 25) | 36.3% | 16.4% | 1.6% | 0.277 | 14.3 |
|
||||
| 3(解析 J) | 46.5% | 16.4% | 1.6% | 0.337 | 13.5 |
|
||||
| 2(解析 J) | **50.4%** | 27.0% | 2.0% | 0.287 | 22.1 |
|
||||
| 1(解析 J) | **57.4%** | **31.6%** | 3.1% | 0.251 | 39.1 |
|
||||
|
||||
- **n=512 复核(commit=2,解析 J)**:到达 **49.2%** / time_ok **26.2%** / 碰撞 **2.3%** / ratio2s 0.351 / 刹停 21.0(n=256 的 50.4% 在噪声内)。
|
||||
- **结论**:
|
||||
- 解析雅可比**既快又准**:commit=3 到达 36.3→46.5%(+10.2 pp),碰撞不变;commit=2 达 **49.2%**(历史最佳 42.2% 是 commit=1 + FD,现在 commit=2 就超过),碰撞 2.3%。
|
||||
- 机理:DLS 差分雅可比在 float32 下的 2–4% 噪声被慢变误差闭环放大(轮次 4/闭环根因结论:σ>0.02×STEP 即崩);解析 J 去掉噪声后失败题里"能到 50 mm 却到不了"的那批能收敛了(err_fail 中位数 51→217 mm:失败集两极分化,成功集变大)。
|
||||
- ratio2s 在 commit=3 变差(0.277→0.337)但到达更多:慢收敛题现在"最终到得了",不是"更快"。
|
||||
- **新历史最佳(50 Hz 目标节奏,commit=2)= 49.2% / 碰撞 2.3% / ratio2s 0.351 / time_ok 26.2%**;非实时上限(commit=1)= 57.4%(n=256,待 n=512 复核)。
|
||||
- **下一步**:① n=512 复核 commit=1;② 积分反馈(fb_ki,针对慢变偏差)在 commit=2 上叠加;③ 浏览器 JS 端同步解析 J;④ commit=2 的 40 ms 周期实测规划 P99(Python/JS)。
|
||||
|
||||
## 轮次 27:解析 J 后重扫增益 + 积分/缓存反馈(负结论)+ 浏览器安全层对齐(exp: `exp/dagger-deploy`)
|
||||
|
||||
- **目标**:解析雅可比改变了反馈噪声结构,重扫增益;同时修浏览器部署路径的安全层(轮次 25 遗留:bench 刹车 47%、到达 0)。
|
||||
- **增益重扫(commit=2,empty,analytic,n=256)**:
|
||||
|
||||
| gain | 到达 | time_ok_1p3 | 碰撞 | ratio2s | 刹停/题 |
|
||||
|---|---|---|---|---|---|
|
||||
| 1.8 | 50.4% | 27.0% | 2.0% | 0.287 | 22.1 |
|
||||
| **2.2** | **52.0%** | 29.7% | 1.6% | 0.329 | 35.3 |
|
||||
| 2.5 | 49.6% | 34.4% | 1.2% | 0.334 | 47.9 |
|
||||
| 2.8 | 47.7% | **34.4%** | 2.0% | 0.362 | 59.8 |
|
||||
|
||||
- **n=512 复核 gain 2.2(commit=2)**:**到达 50.8% / time_ok 28.9% / 碰撞 1.4% / ratio2s 0.343 / 刹停 35.9**。**新历史最佳(50 Hz 节奏)= gain 2.2 + commit=2**。
|
||||
- **负结论**:
|
||||
- 积分反馈(fb_ki=0.3,decay0.9,限幅0.5·STEP):到达 48.0%(gain2.2 单独 52.0%),−4.0 pp。慢变偏差用积分项补偿会过冲,不采用。
|
||||
- 反馈隔次复用(fb_every=2,省 ~3.5 ms/次规划):到达 46.9%(−5.1 pp)。误差方向变化比预期快,缓存不成立。
|
||||
- **浏览器部署修复(有效)**:三个与 Python 仿真不一致的 bug 修掉后(`webapp/js/ik-policy.js`):
|
||||
1. `tick` 不夹关节限位(Python `clamp_box` 每步夹)→ q 一旦越限,认证的 `inBox` 永远拒绝所有候选,原地刹停到超时(certWhy.box 2650 次);现执行与候选投影都夹 LIM。
|
||||
2. 安全层整段拒绝 → 刹停;移植 `safety_partial`:整段不过时依次缩短前缀,执行到第一个不安全步。
|
||||
3. 新增 `segCert` 开关(默认 true):连续区间认证(距离下界递归)~40 ms/次,是 50 Hz 预算的主要超支项;关闭后改为离散判定「每步端点+中点 collideFree」(与 Python 安全层同口径),默认仍走严格认证,bench 用 `--seg 0` 测部署口径。
|
||||
- JS bench(nc10,fb2.2,commit2;`node tests/policy_bench.cjs ... --seg 0`):
|
||||
|
||||
| 集合 | 修复前 ok/reached | 修复后 ok/reached | 刹车率 | safety P50 | plan P50 / P99 |
|
||||
|---|---|---|---|---|---|
|
||||
| near_column_pos | 0/—(轮次 25) | **5/7** | 79.5→**48.1%** | 41.6→**19.8 ms** | 56.1→**33.5 / 61.1 ms** |
|
||||
| near_column_pose | 0/— | **3/3** | 80.4→**31.6%** | 43.4→**22.8 ms** | 57.3→**37.6 / 66.3 ms** |
|
||||
|
||||
- **结论**:实时配置定为 `dag2 + 解析 J + gain2.2 + commit2 + safety_partial + replan=empty`:n=512 到达 **50.8%**、碰撞 **1.4%**。浏览器端从「0 到达 + 47% 刹车」恢复到 nc 集可达,plan P50 33.5/37.6 ms;P99 仍 61–66 ms,commit=2 的 40 ms 队列会偶发饥饿,需继续压 P99(K/安全候选数/JS 特征)。
|
||||
- **下一步**:① Python 测 `safety_try=1`(只认证首选候选)对准确率的影响,若无损则 JS 同步(省多次 collideFree);② K=4/6 的准确率-时延权衡;③ JS `gapMatrix` 同步只算 8 组特征;④ commit=2 异步部署的饥饿率实测。
|
||||
|
||||
## 轮次 28:端点进度选择——时间效率大幅提升(exp: `exp/dagger-deploy`,新历史最佳)
|
||||
|
||||
- **假设**:一致性选择奖励"与上一条计划一致",但失败主因是超时(轮次 13:失败 57% 是超时)。改成直接按候选块末态离目标的距离选(`select='endpoint'`),应提升时间效率与精度。
|
||||
- **判据**:time_ok_1p3 显著上升、到达不降、碰撞 ≤3%。
|
||||
- **配方**:dag2 + 解析 J,gain2.2,commit=2,replan=empty,safety_partial;n=256 → n=512。选择器用 `goal_err(fut[-1])`(只做一次 K 端点 FK,不额外推理)。
|
||||
- **指标(n=256,commit=2)**:
|
||||
|
||||
| 选择器 | 到达 | time_ok_1p3 | 碰撞 | ratio2s | 刹停/题 |
|
||||
|---|---|---|---|---|---|
|
||||
| consist(轮次 27) | 52.0% | 29.7% | 1.6% | 0.329 | 35.3 |
|
||||
| **endpoint** | **52.7%** | **37.5%** | 2.3% | **0.210** | 34.6 |
|
||||
| mix(consist − 0.1·端点mm) | 50.0% | 30.5% | 2.3% | 0.300 | 35.1 |
|
||||
|
||||
- **n=512 复核(endpoint,commit=2)**:**到达 52.1% / time_ok 35.2% / 碰撞 2.0% / ratio2s 0.285 / 刹停 35.7**(consist n=512:50.8% / 28.9% / 1.4% / 0.343 / 35.9)。
|
||||
- **节奏曲线(endpoint,n=256)**:commit=1 → **59.4% / 42.6% / 3.9% / 0.133**;commit=2 → 52.7% / 37.5% / 2.3% / 0.210;commit=3 → 47.7% / 27.0% / 1.2% / 0.245。
|
||||
- **负结论**:
|
||||
- `safety_try=1/2`(只认证前 1/2 条候选):41.4% / 44.9%(全 K 52.0%)——候选兜底对到达贡献 ~10 pp,不能省。
|
||||
- K=4:47.3%(K=8 52.0%)——少采样同样损失到达。
|
||||
- DLS 兜底半步(全拒时朝目标走一步并认证):52.3%(基线 52.0%),碰撞 1.6→2.7%,无收益;重复多步版本碰撞 45.7%(第二步未认证),已回退为单步且默认关闭。
|
||||
- 增益调度(远 2.8/近 2.2):47.3% / time_ok 32.8%,等同 gain2.8 常数;高增益在远处就造成过冲,按距离衰减无效。
|
||||
- **浏览器同步**:`select='endpoint'` 进 Runner/bench(`--select endpoint`),冷启动跳过 8 份前瞻(省 ~80 ms P99,冷启动价值评分被端点排序替代)。nc10 bench(--seg 0 --select endpoint):pos ok 4/5 reached、pose ok 2/4,刹车率 32.1%/25.5%(consist 48.1%/31.6%),planP50 31.9/36.5 ms、P99 63.5/67.5 ms。
|
||||
- **同步 bench 耗时与队列耗尽估算(不是 50 Hz 调度实测)**:Runner 的 `starveTicks = max(0,ceil(planMs/20) − 规划时队列步数)`,不含真实 tick 时间戳。
|
||||
|
||||
| 集合(endpoint, commit=2, --seg 0) | 到达 ok/reached | 刹车率 | planP50/P99 | 估算饥饿 tick/次规划 |
|
||||
|---|---|---|---|---|
|
||||
| near_column_pos (10) | 4/5 | 32.7% | 32.0/62.1 ms | 0.87 |
|
||||
| near_column_pose (10) | 2/3 | 25.6% | 36.8/68.0 ms | 0.78 |
|
||||
| route40 (20) | 12/13 | 40.4% | 44.3/68.1 ms | 1.26 |
|
||||
|
||||
- commit=2 对应 40 ms 队列,route 集 planP50 44 ms 已超过;估算提示可能饥饿,但该 bench 等规划完成才 tick,没有观测实际空转。
|
||||
- commit=3 对应 60 ms,仍低于上述 P99,不能据此宣称连续 50 Hz。其 Python 同步结果:endpoint n=256 → 47.7% / 27.0% / 1.2% / 0.245;gain2.5 为 45.7% / 24.6%。
|
||||
- **结论(经轮次 29 更正)**:端点选择 + 解析 J + gain2.2 + commit=2 + safety_partial,在 n=512 同步仿真为 **到达 52.1% / time_ok 35.2% / 碰撞 2.0% / ratio2s 0.285**。历史 42.2% 使用 commit=1 与 FD,非单变量对照。commit=1 到达 59.4% 但碰撞 3.9%;无论 2.0% 还是 3.9%,开安全层均未通过零碰撞要求,实时性亦未通过。
|
||||
- **下一步**:先查碰撞来源,保持严格认证和查看器默认;再测真实异步调度及认证成本,不因 Python 收益直接切换部署默认。
|
||||
|
||||
## 轮次 29:安全层全拒后减弱目标反馈(exp: `exp/dagger-deploy`)
|
||||
|
||||
- **假设**:目标反馈将绕障候选推向障碍,连续全拒会反复停在同处;仅在上一计划被全拒时减小下一计划反馈,可能保留正常段收敛速度并减少重复刹停。
|
||||
- **判据**:同任务、同 seed、同 K、同认证下到达和 time_ok 不下降,碰撞不增加;部署门槛仍是零碰撞及真实时延达标。所有实验不重训、不扩大数据。
|
||||
- **固定配方**:`python -m ml.eval.eval_cl --n 256 --K 8 --commit 2 --fb 2.2 --partial 1 --replan empty --select endpoint --seed 0`;dag2 checkpoint、几何雅可比。下表仅改列出的参数,默认 `fb_block_gain=1,dls_safety=0`。512 题按两个 256 批、每批 seed=0,沿用轮次 28 顺序。
|
||||
|
||||
| 改动(n=256) | 到达 | time_ok_1p3 | 碰撞 | ratio2s | 刹停/题 |
|
||||
|---|---|---|---|---|---|
|
||||
| 原配置复跑 | 52.7% | 37.5% | 2.3% | 0.210 | 34.6 |
|
||||
| `--dls_safety 1` | 52.7% | 37.5% | 2.0% | 0.210 | 34.6 |
|
||||
| `--fb_clear 20 --fb_cmin 0.3` | 32.0% | 5.9% | 1.2% | 0.323 | 3.2 |
|
||||
| `--sub_refresh 1` | 51.6% | 35.5% | 2.0% | 0.279 | 33.8 |
|
||||
| `--select adapt` | 52.7% | 37.9% | 2.3% | 0.210 | 34.6 |
|
||||
| `--fb_block_gain 0.3` | 56.2% | 38.7% | 3.1% | 0.178 | 17.2 |
|
||||
| `--fb_block_gain 0.5` | **57.4%** | **39.1%** | 3.1% | 0.210 | 19.3 |
|
||||
| `--fb_block_gain 0.7` | 55.5% | 38.3% | 2.3% | 0.189 | 25.0 |
|
||||
| `--fb_block_gain 0.5 --dls_safety 1` | **57.4%** | **39.1%** | 2.7% | 0.210 | 19.2 |
|
||||
|
||||
- **单独减半反馈 n=512**:到达 55.1% / time_ok 36.1% / 碰撞 2.5% / ratio2s 0.251 / 刹停 19.5;相对轮次 28 同规模基线 52.1% / 35.2% / 2.0% / 0.285 / 35.7,到达 +3.0 pp、碰撞也 +0.5 pp,不满足“碰撞不增加”判据。
|
||||
- **为何不采用其他变体**:所有近障碍状态都衰减反馈会明显拖慢到达;子目标重预测无收益;adapt 全拒后旧计划本来就失效,一致性分数全为 0,实质变成等分选首条而非“继续绕行”。
|
||||
- **原配置失败分解(n=256)**:135 题按时到达,121 题失败(其中 20 题后来才到,101 题始终没到)。A/B/C/D/Dr 分别 128/74/32/13/9 题,B/C 失败题刹停中位数约 96/93 次;D 留在分母,不用删题提高成绩。
|
||||
- **碰撞定位**:原配置共 6 题碰撞,只有 224 号首次碰撞紧跟 DLS 接管;另外 5 题首次碰撞早于接管或根本未接管。为 DLS 加端点/中点检查仅减少 1 题,不能解释剩余碰撞。候选认证的未夹紧累加点与执行的逐步夹紧点不同是待验证假设,尚不能断言根因。
|
||||
- **计时**:n=256 减半反馈+DLS检查整批墙钟 243.6 s,单独减半 n=512 为 443.4 s;这些不是规划时延,不能证明 50 Hz。反馈条件分支未增加几何查询,但其实际延迟收益未测。
|
||||
- **记录改进**:评估输出完整参数、checkpoint/任务 SHA256、批大小和随机种子规则;增加时限内无碰撞到达率;修正 n_ref、参考时间占比和条件指标的跨批汇总。可保存实际轨迹供不重新采样的回放,NaN 在 JSON 中写为 null,执行进度每 50 步输出。
|
||||
- **回归检查**:`python -m unittest tests.test_eval_cl -v` 六项通过,覆盖跨批分母、空条件集、非有限数、首撞探针正对照、精修被拒后保留安全候选、只有全拒后才减弱反馈。精修对照在关闭检查时确实碰撞,打开后保留候选,证明门会执行;这是合成测试,不替代真实几何验收。
|
||||
- **仍未修复的边界**:`fb_fallback=0` 保持关闭;非部分前缀分支仍有“只验一步却重复执行”问题,不能开启部署。速度限制在反馈叠加前而非叠加后,尚未验证速度/加速度符合硬约束。
|
||||
- **减半反馈 + DLS 检查的 n=512 复核(完整输出 `docs/experiment_round29.json`)**:到达 **282/512 = 55.1%**、时限内无碰撞到达 **280/512 = 54.7%**、time_ok **36.1%**、碰撞 **9/512 = 1.8%**、ratio2s **0.251**、刹停 **19.23/题**。到达题末端误差中位数 **0.196 mm**;有参考且到达题的行程比中位数 **2.425**(远高于 1.10 要求)。整批墙钟 **488.4 s**,非控制延迟。
|
||||
- 完整命令:`python -u -m ml.eval.eval_cl --n 512 --commit 2 --fb 2.2 --partial 1 --replan empty --select endpoint --fb_block_gain 0.5 --dls_safety 1 --out docs/experiment_round29.json --dump ml/runs/round29_rows.json --trace ml/runs/round29_trace.pt`。
|
||||
- 与轮次 28 同规模端点基线相比,到达 +3.0 pp、time_ok +0.9 pp、碰撞少 1 题(10→9),不足以宣称稳定安全改善;n=256 碰撞仍由 6→7 题。
|
||||
- **首撞回放(`docs/experiment_round29_collisions.json`)**:`python -m ml.eval.diag_collision --trace ml/runs/round29_trace.pt --out docs/experiment_round29_collisions.json`。9 题首次碰撞在 CPU float32/float64 均复现,均位于 **J5 限位**;q0 与首次碰撞前一点均为正间隙,首撞采样点负间隙约 **−0.017 至 −0.936 mm**。这排除了这 9 次碰撞由起点本就碰撞或 float32 单独翻号造成,但还需要记录原认证点才能证明夹紧的因果作用;0.01° 加密仅覆盖首撞段,不是整条轨迹安全审计。
|
||||
- 双精度运动学/间隙另与已有 JS 2000 个样本对拍:`python -m ml.eval.check_parity` PASS,碰撞布尔差 0、间隙最大差 2.53e−13 mm。首撞回放仍共用碰撞模型,不替代真机或独立连续认证。
|
||||
- **结论与下一步**:减少连续刹停确有小样本收益,但碰撞、行程和真实时延仍未过门槛;保留为实验选项,不更改查看器默认。下一轮记录原认证点与 J5 夹紧后实际点,修复后用同批同 seed A/B 和独立细采样复核,禁止靠关掉认证提速。
|
||||
|
||||
## 轮次 30:认证与执行统一逐步限位(exp: `exp/dagger-deploy`,局部修复有效,仍未零碰撞)
|
||||
|
||||
- **假设与判据**:安全层认证的是未夹紧累加轨迹,执行器却逐步夹紧 J5,导致认证通过后碰撞。必须同时证明原证书安全、执行点碰撞、记录命令经执行算式能准确重建实际点;修复后保持同任务、同种子、同模型、同增益和同排序,到达不下降,并用不依赖原 `col` 标记的加密回放检验。
|
||||
- **固定配方**:`python -u -m ml.eval.eval_cl --n 256 --commit 2 --fb 2.2 --partial 1 --replan empty --select endpoint --fb_block_gain 0.5 --dls_safety 1`;K=8、seed=0、analytic DLS、dag2 checkpoint、fallback=0,其余参数默认;分别附 `--out docs/experiment_round30_before.json --trace ml/runs/round30_before.pt --dump ml/runs/round30_before_rows.json` 和对应的 `after` 路径。未训练、未扩题、未改 JS 默认。
|
||||
- **可比性**:取证版 before 与轮次29首批256题完整轨迹逐元素完全相同(最大差 0°),ok/col/brakes/err/t_done/first_hit 也完全相同;before/after 配置仅输出路径不同。任务 SHA256=`249bd93457825cda98c59e64d9a096d3473c69aeb3553de1dea6d9e56be71772`,checkpoint SHA256=`f7f686fd8ee92fb6948fbcc4ee954636065ad87bb54f661c4f8f575bc16c2ce1`,kin_fp=`2ebcbf17`。
|
||||
- **直接证据**(`docs/experiment_round30_certificates.json`):旧版7次首撞的原认证端点/中点在 float32 与 float64 均为正间隙,实际执行段均有负间隙;`clamp(previous + recorded_command)` 与实际端点逐位一致。原证书与实际点主要差在 J5,首撞段差 0.340°–4.317°;其他轴仅有最高约 7.6e-6° 的累加舍入差,不足以解释毫米级穿入。全部有效认证步中,5298/34069 步偏差 >0.001°,最大 7.587°。
|
||||
- **修复范围**:`execution_points` 按执行器相同顺序逐步夹紧,端点和中点都由实际路径计算;整段、部分前缀和近目标 DLS 共用。r3 的旧队列终点和特征前缀改为真实执行结果。fallback 保持实验默认关闭,但两分支统一为“认证一步后补零”,不再把只验过一步的动作重复执行;端点和中点都认证。候选排序和反馈增益未改,0.5 仍只是间隙截顶,正间隙判据没有放宽。
|
||||
|
||||
| 指标(同256题) | 修复前 | 修复后 |
|
||||
|---|---|---|
|
||||
| 按时到达 | 147/256 = 57.4% | 同147题,57.4% |
|
||||
| 原端点/中点口径无碰撞到达 | 145/256 = 56.6% | 147/256 = 57.4%(下述加密审计否定其“全程无碰撞”含义) |
|
||||
| time_ok_1p3 | 39.1% | 39.1% |
|
||||
| 原端点/中点口径碰撞题 | 7/256 | 0/256 |
|
||||
| 成功题末端误差中位数 | 0.1951 mm | 0.1890 mm |
|
||||
| 成功题平均时间 | 2.2993 s | 2.3076 s |
|
||||
| 2 s 误差比中位数 | 0.2100 | 0.2100 |
|
||||
| 刹停/题 | 19.2383 | 19.2500 |
|
||||
| 成功题指令行程比中位数 | 2.4450 | 2.4450 |
|
||||
| 从实际轨迹重算成功题行程比 | 2.4251 | 2.4251 |
|
||||
| 整批同步仿真墙钟 | 247.515 s | 248.834 s |
|
||||
|
||||
- **执行一致性复核**(`docs/experiment_round30_comparison.json`):修复后34107个有效认证步,认证端点/中点与实际执行点均逐位一致,最大差 0°;有效时段没有未经认证的移动步。这里“认证”仍仅指离散端点/中点,不能推出连续安全。CPU B=1、commit=2 的预测函数单独测量:100次预热、1000次采样、单线程,P50 0.0388→0.0518 ms,P99 0.0691→0.0939 ms;不是完整规划延迟,不能证明50 Hz。
|
||||
- **独立加密审计的正反对照**:预先固定12题 `0,21,84,128,145,164,175,180,197,215,224,255`,其中包含全部7题旧首撞及5题其他任务;不按新版 `col` 过滤。逐题回放至自身时限或到达,含起点,每个插值段最大轴步距≤0.05°并包含中点,float64、每批64点。命令:`python -u -m ml.eval.diag_collision --trace ml/runs/round30_before.pt --dense_indices 0,21,84,128,145,164,175,180,197,215,224,255 --max_step_deg 0.05 --device cuda --out docs/experiment_round30_dense_before.json`,after 同理;串行运行。
|
||||
- before:56118点,**7/12题检出碰撞**,14.870 s;证明探针确实能抓旧碰撞。
|
||||
- after:56566点,**仍有1/12题碰撞**,15.057 s;其余11题采样点间隙为正。这是小样本有限采样,不是完整256题的连续认证。
|
||||
- 剩余第180题,执行段1.08–1.10 s:上一点/中点/端点 float64 间隙为 **0.5 / 0.11723 / 0.06521 mm**,都安全,但段内约76.6%处为 **−0.14927 mm**;该段0.01°再加密185点仍检出,见 `docs/experiment_round30_missed_segment.json`。因此这次残余是端点/中点漏检,而非认证与执行错位;它比旧离散首次碰撞1.14 s还早。不得把内部计数0当成修好了;已知真实无碰撞到达至多146/256=57.0%,其余未加密任务仍未知。
|
||||
- **回归与判据灵敏度**:`python -m unittest tests.test_eval_cl -v` 14项通过。覆盖整段/部分限位拒绝、只保留真实安全前缀、DLS被拒后保留候选、r3旧队列起点和特征前缀及逐点证书、fallback单步/中点拒绝。把预测函数在内存中替回旧算式,限位、DLS和r3测试重新失败。加密探针另有合成正对照:原端点/中点全安全且 `col=0`,仍检出四分之一处薄障碍;安全负对照、截止后/到达后碰撞排除均通过。
|
||||
- **新增硬约束证据**:before/after 两组256题实际轨迹都出现超速,最大 **1.660004×VMAX**(来源是动作限幅后叠加0.3×gain2.2反馈)。实际各轴最大速度约 `[99.600,99.600,149.400,149.400,199.200,298.800]°/s`,并非只看原始指令推测。行程仍约参考2.425倍;速度、加速度和真实控制时延均未达部署验收。历史 `travel` 累积的是指令而非夹紧后位移,本轮已同时列出实际轨迹重算值,不悄悄换分母。
|
||||
- **结论与下一步**:逐步限位一致性修复有效,未牺牲本批到达率;但加密审计仍检出段内碰撞,**不能部署、不能宣称零碰撞或50 Hz合格**。下一轮先验证更强的段内认证,再单独评估反馈后的速度/加速度约束与真实端到端调度;每次保持小样本单变量对照,继续保留失败证据。
|
||||
|
||||
## 轮次 31:连续段认证的确定界与成本实测(exp: `exp/dagger-deploy`,判据变强,实测进不了 20 ms)
|
||||
|
||||
- **假设与判据**:轮次 30 的端点/中点检查漏掉段内碰撞(第180题 1.08–1.10 s,段内 −0.14927 mm,端点/中点均正)。若用可证明的全姿态运动界对整段做 Lipschitz 判据,应当(a) 在同一个漏检段上给出碰撞或拒绝,(b) 预算不足时只会拒绝而不会放行,(c) 不放宽 `>0` 判据。判据失败或耗时超预算都算负结论,必须实测不能外推。
|
||||
- **确定界替代随机采样界**:JS 侧 `leverTable(4000)`/`leverBounds(20000)` 是随机姿态最大值再 ×1.05,不是全姿态上界。本轮按三角不等式给闭式界:组 g 的胶囊端点到关节 k(<g) 的最大位移 = (Σ_{j=k}^{g-2}‖P[j+1]−P[j]‖ + max_e‖e−P[g−1]‖)·|Δq_k|(k=g−1 时末项换成端点到该轴的垂直距离),组对 (ga,gb) 只累加 ga..gb−1,取组内最小仍保留 Lipschitz 性质。Python 端 `Kin.cert_lever`(15×6)即此表,未改 `lever`,也未改 JS。
|
||||
- **界的量级**(STEP=[1.2,1.2,1.8,1.8,2.4,3.6]°):单整步在各组对上的位移界 **5.93–48.86 mm**,0 层通过要求端点间隙之和 > 界,即单端间隙至少 3.0–24.4 mm。实际执行段的间隙普遍只有 0.001–0.5 mm,所以“必须细分”是结构性的,不是实现缺陷。
|
||||
- **基础求距 bug 与影响范围**:模型里有 1 个退化胶囊(索引 686,组 3)。旧 `seg_seg_dist` 在第二条线段退化成点时固定取该点为第二条起点,没把点投影到第一条线段上——[0,2] 段对点 1 的实测距离旧值 1 mm、反向调用约 1e−9 mm、真值 0。修复后在已有 2000 个对拍姿态的前 64 个姿态上,670 个“退化胶囊作第二条”的细对里 **20661/42880 个距离变小(旧值偏大,最大 86.003 mm)**,正反调用一致。但这批变化没有进入判定:把轮次 30 修复后 48 段的 7586 个 0.01° 加密点分别用修复前(95da491)与修复后内核重算,**组最小间隙逐位相同(最大差 0.0 mm)、碰撞布尔差 0**;`python -m ml.eval.check_parity` 仍 PASS(2000 样本,fk 4.55e−13 mm、间隙 2.52e−13 mm、特征 5.96e−08、梯度相对误差 1.85e−06、碰撞布尔差 0)。即这轮修复是正确的,但不解释轮次 30 的漏检,也不改变既有成绩。
|
||||
- **认证实现**:`Kin.certify_segments` 为 float64 批量前沿二分,每根段独立查询预算,端点间隙用 `min(gap,cap)` 故钳制只会更保守;判据 `ga+gb > bound+2eps` 且两端 >eps,任一子段碰撞即整根判碰撞;超深度、超预算、非有限间隙、越出关节盒一律拒绝(`unresolved`/`outside_box`),不放行未知。宽相位 cap 可按本层界收到 `bound/2+eps`(`adaptive_cap`)。**尚未接入 rollout,未改查看器默认。**
|
||||
- **48 段固定样本**(`docs/experiment_round31_certificates.json`,沿用轮次 30 的 12 题,每题取首/中/末移动段 + 原证书最小间隙段 + 显式指定 180:54;cap=20、eps=1e−4、max_depth=12):
|
||||
| 每根查询预算 | 判安全 | 判碰撞 | 未知拒绝 | 查询数 p50/max |
|
||||
|---|---|---|---|---|
|
||||
| 2 | 20 | 0 | 28 | 2 / 2 |
|
||||
| 8 | 26 | 1 | 21 | 4 / 8 |
|
||||
| 32 | 37 | 1 | 10 | 4 / 32 |
|
||||
- 已知漏检段(180 题执行段 54)**判碰撞,仅用 5 次查询**;该段原证书 `certified=true`、原内部 `col=0`。48 段里 0.01° 加密采样检出碰撞 1 段,认证接受该类段 **0 段**;整批与逐根调用结果逐位一致。
|
||||
- 拒绝不等于安全:预算 2 时 28 段全部落 `unresolved`,实现不会把未知当通过。
|
||||
- **成本模型对上实测**(`docs/experiment_round31_cert_cost_model.json`):按最紧组对的界,所需层数 `L=ceil(log2(bound_pair/(ga+gb)))`、查询数 `2^L+1`。37 个判安全段需要 2–17 次(L=0..4),10 个未知段需要 **33 或 65 次**(L=5..6),与预算 32 恰好卡在中间一致;碰撞段因提前撞到负间隙只用 5 次。结论:认证成本由 `bound/间隙` 的对数决定,**降低界或提高间隙余量**才是可行杠杆,加预算只是线性买单。
|
||||
- **耗时负结论**(CUDA float64、B=1、驻留输入、每段4次预热+9次计时、变体按段交错,`docs/experiment_round31_adaptive_cap.json`):单段认证 **P50 22.93 ms、P90 58.43 ms、P99 101.57 ms,432 次里 225 次 > 20 ms**;自适应 cap 交错重测 P50 23.21 ms、P99 99.10 ms,**决策完全相同、耗时无收益**。先前顺序测得的“1.6×、整批 72→14.8 ms”经交错复测判定为 GPU 时钟/顺序漂移,不作为结论(48 根整批复测 260→212 ms 仍受同一偏差影响,且部署不会出现 48 根同时认证)。因此**连续认证按当前实现不能进 20 ms,更不能宣称 50 Hz**。
|
||||
- **回归与判据灵敏度**:`python -m unittest tests.test_eval_cl` **23 项通过**(轮次 30 为 14 项)。新增段认证 8 项覆盖:薄障碍段内碰撞被界抓到而清晰段被接受、预算/深度耗尽只拒不放、恒间隙合成段上预算 4/8/9 对应查询 3/5/9(验证细分层数与查询数的解析关系)、批量与逐根及乱序一致、空批与全拒前沿、NaN/±Inf 间隙拒绝、越界拒绝、退化距离对称性与梯度。**变异实测**:把类型门去掉后 `max_depth=torch.tensor(255,dtype=torch.uint8)` 会回绕成 `range(0)`、整段判据被跳过,真实间隙 −0.05 mm 的段直接返回 `safe=true`;加门后同一调用报 `certification budgets must be plain ints`。这是本轮抓到的第二个误放行路径(第一个是轮次 30 的未夹紧认证)。
|
||||
- **口径与边界**:认证只在 float64 下进行,浮点求距误差没有形式上界(`seg_seg_dist` 距离下限约 1e−9 mm),eps=1e−4 mm 是工程容差不是证明;48 段取自轮次 30 修复后的执行轨迹,是固定样本不是新策略闭环;连续认证未接入 rollout,实际执行仍走端点/中点离散检查;速度/加速度超限(轮次 30 实测最大 1.66×VMAX)本轮未处理。
|
||||
- **结论与下一步**:判据确实变强(抓到离散检查漏掉的段内碰撞、未知只拒不放),但成本与 `bound/间隙` 的对数绑定,**当前实现不能部署,也不得把“认证通过”说成零碰撞**。下一步两条:(1) 把逐层依赖的二分改成**一次均匀细分**(固定层数、单个 gaps 调用覆盖全部子段),其实时可行性取决于几何查询成本随批大小是否近似平坦;(2) 把余量要求移到规划/速度侧——实际轨迹贴着 0.001–0.02 mm 间隙走,任何认证方案都会退化成几十次查询,而反馈叠加后的速度约束本来就是未完成项。
|
||||
|
||||
## 轮次 32:均匀细分认证与确定界的反证(exp: `exp/dagger-deploy`,认证仍进不了 20 ms,但定位到真正的成本杠杆)
|
||||
|
||||
- **本轮假设**:第31轮的二分认证把成本花在**多次依赖的 gaps 调用**上(B=1 时每次约 7 ms 起步)。若改成固定层数的一次均匀细分,同样的判据应只付一次调用;同时需要单独证明"这个确定界本身没被低估",否则判据再快也没意义。
|
||||
- **实现**:`Kin.certify_uniform(a, b, n, eps, cap=None)`——每根段取 n 个子段、一次 gaps 调用查 n+1 个点,对**每个子段**用与二分版完全相同的判据(子段两端间隙之和 > 子段位移界 + 2eps;界对 Δq 线性,故子段界 = 整段界/n)。没有"未决"状态:证不出就是 `unproven`(拒绝),不存在把未知当安全。未接入 rollout,未改查看器默认。
|
||||
- **确定界的反证**(`docs/experiment_round32_bound_falsification.json`):对 48 段每段取 121 个网格点,逐组对比"实测最小间隙"与"预测下限 (ga+gb−bound)/2"。720 项检验**0 违例**;但只有 **61 项有信息量**(预测下限 < 观察 cap 2 mm 才可能被证伪;其余组对的预测下限中位数 15.9 mm、最大 19.96 mm,都被钳制恒等式自动满足)。61 项里最紧的一项仍比预测下限高 **0.035 mm**,p10 高 0.544 mm。因此这是"未能在真实运动上证伪该界",不是"证明了该界";浮点求距误差仍未做形式化上界。
|
||||
- **接受率曲线**(48 段单根,`docs/experiment_round32_uniform_validation.json`):
|
||||
|
||||
| 子段数 n | 判安全 | 判碰撞 | 证不出 | 二次加密(2n+1点)反证的误放行 |
|
||||
|---|---|---|---|---|
|
||||
| 8 | 26 | 1 | 21 | 0 |
|
||||
| 16 | 30 | 1 | 17 | 0 |
|
||||
| 32 | 34 | 1 | 13 | 0 |
|
||||
| 64 | 36 | 1 | 11 | 0 |
|
||||
| 128 | 38 | 1 | 9 | 0 |
|
||||
|
||||
第180题 1.08–1.10 s 那段(第30轮加密回放检出 −0.14927 mm、原离散证书 `certified=true`)在**每个 n≥8 都判碰撞**。
|
||||
- **宽相位 cap 的正确公式**(对第31轮一条负结论的更正):第31轮用 `bound/2 + eps`,那个值恰好**会把本可通过的子段钳成不可证**,所以既没提速也可能少接受;本轮改成"最小不挡住判定的宽相位"= `最大子段界 + 2eps`,n=4 时是 5.92 mm、n=128 时 0.37 mm。第31轮那句"自适应 cap 无收益"只在旧公式下成立,新公式的实测收益见下表(原记录保留,不回改)。
|
||||
- **计时 A/B**(`docs/experiment_round32_uniform_latency.json`;B=2 根=部署 commit2 口径,24 对根逐对按正序/逆序**交替**测全部配置,每配置 3 次预热 + 7 次计时 = 168 次;CUDA float64):
|
||||
|
||||
| 配置 | 宽相位 mm | P50 | P90 | P99 | >20 ms 次数 | 安全/碰撞/拒(48根) |
|
||||
|---|---|---|---|---|---|---|
|
||||
| 均匀 n=8 auto | 5.92 | **9.68** | 13.03 | 15.16 | 0/168 | 26/1/21 |
|
||||
| 均匀 n=16 auto | 2.96 | **14.14** | 18.45 | 20.87 | 5/168 | 30/1/17 |
|
||||
| 均匀 n=32 auto | 1.48 | 20.21 | 27.88 | 32.27 | 87/168 | 34/1/13 |
|
||||
| 均匀 n=64 auto | 0.74 | 31.43 | 48.75 | 57.70 | 165/168 | 36/1/11 |
|
||||
| 均匀 n=128 auto | 0.37 | 59.76 | 89.06 | 109.09 | 168/168 | 38/1/9 |
|
||||
| 均匀 n=8 cap20 | 20 | 13.13 | 16.44 | 20.96 | 3/168 | 26/1/21 |
|
||||
| 均匀 n=32 cap20 | 20 | 28.41 | 39.58 | 53.02 | 153/168 | 34/1/13 |
|
||||
| 均匀 n=64 cap20 | 20 | 50.85 | 75.51 | 88.36 | 168/168 | 36/1/11 |
|
||||
| 均匀 n=128 cap20 | 20 | 98.46 | 139.98 | 167.04 | 168/168 | 38/1/9 |
|
||||
| 二分 budget32 | 20 | 54.88 | 82.15 | 117.20 | 133/168 | 37/1/10 |
|
||||
| 二分 budget65 | 20 | 71.83 | 108.56 | 122.53 | 133/168 | 41/1/6 |
|
||||
|
||||
- auto 与 cap20 的**决策列完全相同**,只是快 1.36–1.65×(n=8 13.13→9.68、n=128 98.46→59.76):这次是交错实测的真收益,不是第31轮那种顺序漂移。
|
||||
- 单次调用的均匀细分在同样接受率下比二分便宜 5 倍以上(n=8 9.68 ms vs 二分 54.88 ms),但二分在同样时间能多证出 11 根——两条路的取舍由下一段的结论决定,不单看耗时。
|
||||
- **负结论(部署口径)**:只有 n≤16 能把认证本身压进 20 ms(P50 9.68–14.14 ms),而这档只能证出 48 根里的 26–30 根(54–63%),其余必须刹停;n=32 起 P50 就已经吃满 20 ms,还没算推理。所以**连续段认证按现有几何口径不能同时满足"P99<20 ms"和"不牺牲到达"**。这些数是 CUDA float64 的单次调用,不能外推到浏览器 CPU float32 的 50 Hz 链路。
|
||||
- **机理定位与下一步**:成本 = 单次调用固定开销 × 由 `log(bound/间隙)` 决定的层数。要同时拿到"证得出"和"证得起",必须把**间隙抬起来**(安全层要求正余量,而不是 `gap>0`)并把**每步位移压回去**(反馈叠加在 ±1 限幅之后,导致第30轮实测最大 1.66×VMAX,界也随之变大)。顺带记下一个坑:安全层现在是 `kin.gaps(allq, 0.5)`,截顶值 0.5 mm 低于任何 >0.5 mm 的余量门限,直接把余量判据变成恒假——加余量必须同时抬这个 cap。
|
||||
- **回归与判据灵敏度**:`python -m unittest tests.test_eval_cl` **26 项通过**(新增 3 项均匀细分)。含解析对照:合成恒间隙段(界 1 mm/度、间隙 0.1 mm)在 n=5 必判证不出、n=6 必判安全,且 `cap_required_mm` 等于 `1/n+2eps`;薄障碍在 n=4/8/64 判碰撞而 n=2 只判证不出(不误放行);`n` 给成张量被类型门拒绝。二次加密反证在 n=8..128 全部 0 误放行。
|
||||
|
||||
## 轮次 33:把速度做成可观测的硬约束,再测限幅与余门的代价(exp: `exp/dagger-deploy`)
|
||||
|
||||
- **仪表先行**:`rollout()` 现在逐题记录**实际执行**的速度比 `max_j|Δq_j|/STEP`(STEP=VMAX·DT,所以 1.0 = VMAX)和按控制步的速度变化比;`eval_cl` 汇总 `speed_ratio_p50/p95/max`、`over_vmax_rate`、`accel_ratio_p95/max`,并把逐题值放进 `per`(极值/分位不进按 n 加权的批聚合)。
|
||||
- **仪表自证**:用第30轮 after 的 trace 独立重算得 max **1.660004×VMAX**、超速度题占比 **1.0**,与新指标在同一批上逐位一致(`speed_ratio_max` 1.660003662、`over_vmax_rate` 1.0);这是"先证判据有灵敏度",不是拿新数当结论。
|
||||
- **默认路径未变**:`--inc_cap 0 --gap_margin 0`(新默认)跑出的每个旧指标与第30轮 after 完全相同——success 0.57421875、无碰撞到达 0.57421875、time_ok 0.390625、碰撞 0、刹停 19.25、行程比 2.4449527263641357、ratio2s 0.20997506380081177、成功题误差 0.18899640440940857、dls_share 0.625(`docs/experiment_round33_base.json`)。整批墙钟 296.3 s 与第30轮 248.8 s 不可比:这期间我在同机跑了 CPU 分析,属自我污染,仪表开销需独占另测,不作为结论。
|
||||
- **两个新开关**:`inc_cap=1` 在**反馈叠加之后**再按每轴 VMAX·DT 限幅(此前 `inc=clamp(act,±1)·astep` 之后又加 `gain×fb`,所以 1.66× 是结构性的);`gap_margin>0` 让安全层要求间隙 > 余量而非 >0,并把宽相位 cap 自动抬到 `margin+0.5`——不抬的话 `gaps(allq, 0.5)` 的截顶值 0.5 会让任何 >0.5 的余量门限恒假。`col`(真实碰撞计数)仍按 `gap≤0` 判,不随余量改变,所以两者不会互相顶替。
|
||||
- **部署侧同病**(只读核查,未改 JS):`webapp/js/ik-policy.js:355` 也是 `inc[s][j] += fbGain*fbStep[j]` 在 ±1·STEP 之后叠加,所以浏览器控制器同样能超 VMAX;JS 的余量是 `o.margin=5` 的**投影式**护栏(`project()` 每轴 ≤projMax,只处理 gap<margin 的近距对),与本轮的"低于余量就刹停"不是同一机制;`ACC=5.0` 只用于刹停段长度,不是每步加速度上限(§9.2 也没给数值化的加速度门槛,所以 `accel_ratio` 只作变体间比较)。
|
||||
- **间隙分布的口径坑**:第30轮 `plans['gaps']` 是在 cap=0.5 下记录的,所以"最小间隙 ≥1 mm 的题占 0"是截顶假象。可说的是:逐题最小记录间隙 p5 **0.0005**、p25 0.0064、中位 **0.046** mm,57.4% 的题曾低于 0.5 mm——即策略实际贴障碍飞,而查看器护栏是 5 mm。要把 0.5 以上那段分开,必须抬 cap 重算(本轮后续做)。
|
||||
- **四组单变量对照**(同 256 题、同 seed、其余按第30轮配方):base / `inc_cap=1` / `gap_margin=0.5` / 两者同开。结果见下表。
|
||||
|
||||
- **四组单变量对照结果**(同 256 题、同 seed、K=8、commit 2、fb 2.2、fb_block_gain 0.5、dls_safety 1、select endpoint、replan empty、partial 1;`docs/experiment_round33_{base,cap,margin,both}.json`):
|
||||
|
||||
| 变体 | 到达 | 无碰撞到达 | time_ok_1p3 | 真实碰撞 | 刹停/题 | 速度比 p50 | 超 VMAX 题占比 | 2 s 误差比 |
|
||||
|---|---|---|---|---|---|---|---|---|
|
||||
| base | 147/256 = 0.5742 | 0.5742 | 0.3906 | 0 | 19.25 | 1.660 | 1.000 | 0.2100 |
|
||||
| `--inc_cap 1` | 134/256 = 0.5234 | 0.5234 | 0.2656 | 0 | 19.55 | 1.000 | 0.000 | 0.2790 |
|
||||
| `--gap_margin 0.5` | 144/256 = 0.5625 | 0.5625 | 0.3789 | 0 | 20.05 | 1.660 | 1.000 | 0.1817 |
|
||||
| 两者同开 | 133/256 = 0.5195 | 0.5195 | 0.2617 | 0 | 19.97 | 1.000 | 0.000 | 0.2870 |
|
||||
|
||||
- **速度限幅是有代价的硬约束**:每轴增量限回 VMAX 后到达 −5.1 pp、time_ok −12.5 pp、2 s 误差比 0.210→0.279。也就是说 base 的 57.4% 里**有一部分是用超速换来的**:反馈在限幅之外叠加,实际替模型补了速度。不能把 base 当作"满足速度约束的成绩"。
|
||||
- **机理**:base 速度比 p50=1.660 恰等于 `1+0.3×fb_gain 2.2`;限幅后刹停几乎不变(19.25→19.55),但 time_ok 掉得比到达更多,说明损失集中在**逼近目标末段被剥夺了超速修正**,不是更容易刹停。所以出路不是调低增益(第29/30轮已测:增益小到达就掉),而是把该由前馈承担的速度还给模型——在限幅后的分布上重采数据(DAgger,需批准),或用不违反速度约束的前馈(#14 的余量投影 + 按时限打分)。
|
||||
- **0.5 mm 余量门很便宜**:只少 3 题、刹停 +0.8/题,2 s 误差比反而更好(0.182)。但这不等于裕度够用——它只说明"要求 0.5 mm 不明显拖慢"。5 mm(查看器护栏)是否同样便宜,取决于策略能否找到 ≥5 mm 的路径,必须抬 cap 重算真实间隙分布才能回答(第30轮 `plans['gaps']` 在 0.5 mm 截顶,算不出这一条)。
|
||||
- 四组 `collision_rate` 都是 0,但这仍是端点/中点离散口径;`gap_margin` 不改 `col` 判据(仍 `gap≤0`),余量与碰撞计数是两条独立的线,不互相顶替。
|
||||
- **回归**:`python -m unittest tests.test_eval_cl` **30 项通过**(新增 4 项):未限幅时实测速度比确实 =3.4/1.2>1(灵敏度)、限幅后恰为 1.0、0.3 mm 间隙在余量 0 时通过而余量 0.5 时刹停、5 mm 间隙在余量 0.5 时仍通过(证明 cap 抬升生效,否则该测试会恒假)。
|
||||
|
||||
- **GPU 上的一个控制周期(按 GPU 口径实测)**:诊断档与逐项分解见 `docs/experiment_round33_gpu_cycle.json`,真实配方(steps=1)见 `docs/experiment_round33_gpu_cycle_steps1.json`,RTX 3090、B=1、float32 推理 + float64 认证,每项 20 次预热 + 120 次计时并 `cuda.synchronize`。
|
||||
|
||||
- **前提更正(重要)**:`eval_cl` 从不传 `steps`,`rollout` 默认 `steps=1`,而 `ml/model/policy.py:156` 写明"steps=1 即一步生成,steps>1 是诊断用"。所以第27轮以来的所有评估成绩一直是**单步推理**;本节先用 steps=16 测出的"当前配方 116 ms ≈ 8.6 Hz"是口径错误,已作废并在下面用真实配方重测。
|
||||
- **真实配方(steps=1, K=8)的分解**:
|
||||
|
||||
| 环节 | P50 | P95 | P99 |
|
||||
|---|---|---|---|
|
||||
| 推理 `sample_k` steps=1,K=1 / 4 / 8 | 7.11 / 7.08 / 7.19 | 9.45 / 10.17 / 9.95 | 11.91 / 14.00 / 11.34 |
|
||||
| 特征 83 维(总 / 其中宽相位间隙 / 其中 FK) | 13.11 / 8.18 / 4.00 | 19.57 / 16.57 / 7.51 | 21.17 / 19.43 / 8.47 |
|
||||
| 目标反馈 DLS 1 步 | 6.53 | 9.32 | 12.62 |
|
||||
| 现有离散安全层 4 点(cap 1.0) | 7.41 | 11.34 | 13.80 |
|
||||
| `certify_uniform` 2 根 n=8 / n=16 | 9.70 / 16.07 | 14.40 / 20.95 | 15.75 / 24.42 |
|
||||
|
||||
| 组合周期(同一位姿,顺序测;跨行比较受漂移影响,只作量级) | P50 | P95 | P99 |
|
||||
|---|---|---|---|
|
||||
| K=8 + 离散安全层(真实配方) | **36.68 → 27.3 Hz** | 43.27 | 49.17 |
|
||||
| K=4 / K=1 + 离散安全层 | 37.71 / 40.36 | 55.17 / 48.46 | 76.53 / 52.06 |
|
||||
| K=8 + 连续认证 n=8 | 45.34 → 22.1 Hz | 49.68 | 52.20 |
|
||||
| K=8 + 连续认证 n=16 | 49.55 → 20.2 Hz | 56.85 | 59.06 |
|
||||
| (对照)诊断档 steps=16 的同一周期 | 116.5 | 134.5 | 142.6 |
|
||||
|
||||
- **归因更正(先证仪表再下结论)**:空算子 P50 0.028 ms、空 `synchronize` 0.005 ms、一次 `encode` 2.27 ms,所以**不是启动/同步地板**。先前口算的"5–10 ms 是 GPU 启动开销"错了,在此更正:特征 13.1 ms、认证 7.4 ms、DLS 6.5 ms 是 B=1 下真实的小算子工作量——即 **GPU 在单臂批量=1 时利用率极低**,而不是被框架拖慢。
|
||||
- **推理不是瓶颈,几何才是**:单步推理 7.2 ms,且候选数几乎免费(K 1→8 不涨);一个周期里几何类工作合计约 27 ms(特征宽相位 8.2 + 特征 FK 4.0 + 认证 7.4 + DLS 6.5),并且这几次调用各自重复做 `cum_xf` 与宽相位筛选。所以 50 Hz 的路径是**合并几何查询**(`features()` 已支持 `gm=`/`xf=` 复用,`gm_groups` 文档保证与整表 `gaps` 数值一致),而不是继续压推理。
|
||||
- **连续认证的增量成本可接受**:在同一位姿上 n=8 只比现有离散层贵约 8.7 ms(整周期 36.7→45.3 ms),n=16 贵约 12.9 ms。也就是说"段内连续证明"在 GPU 上不是奢侈项,真正卡住 20 ms 的是那 ~27 ms 的重复几何。合并后再看是否进得了 20 ms——这一步正在做交错复测(跨行顺序测的数字受漂移影响,不作最终结论)。
|
||||
- **50 Hz 结论(当前状态)**:真实配方一个规划周期 **36.7 ms(P99 49.2)≈ 27 Hz**,仍不满足"P99<20 ms";且必须记住这是在**不限幅**(可超速 1.66×)的策略分布下测的——限幅后的到达率代价见上表,两者不能混着谈。
|
||||
- f32 与 f64 的间隙在 3 个点上完全相同(最大偏差 0.0 mm、无符号翻转),但 **3 个点不足以支持"认证可以改用 float32"**,需按真实轨迹批量对比才能下结论。
|
||||
|
||||
## 轮次 34:GPU 周期的可实现优化——复用 FK 与压认证最坏情况(exp: `exp/dagger-deploy`)
|
||||
|
||||
- **起因与一次自我撤回**:轮次 33 记下"合并几何查询看能不能进 20 ms"后,先按 `docs/experiment_round34_fused_cycle.json` 测出"整周期 41.9→24.5 ms"。这个数**作废**,两个独立原因:
|
||||
1. 第一版的"合并"把 `xf=` 传给了包含 5 行的 `gaps` 调用,而 `gaps` 的 `xf` 是按行对应的 → 只有第 0 行走完宽相位,认证点 4 行全部退回截顶值 40.0 mm,即**少干了活**(表现为认证矩阵差 31.17 mm)。修好后同一 cap 下矩阵逐位一致(差 0.0 mm)。
|
||||
2. 更根本:真实管线顺序是 特征 → 推理 → 候选 → 认证,**认证点依赖网络输出**,所以"特征用的 q 间隙与认证点间隙合成同一次调用"在实现上做不到。该文件保留作记录,但不能当作可实现收益。
|
||||
- **只测可实现的口径**(`docs/experiment_round34_geom_opt.json`;B=1、K=8、commit 2;7 个变体逐轮交替、奇数轮反序,80 轮;等价性两项都 `True`:批量认证矩阵与逐条循环逐位一致、features 复用 xf 前后逐位一致):
|
||||
|
||||
| 变体 | 含义 | P50 | P95 | P99 |
|
||||
|---|---|---|---|---|
|
||||
| A_today | 现口径 | 33.49 | 46.14 | 64.69 |
|
||||
| B_xf_reuse | `gm_groups` 复用 features 已算的 `cum_xf` | **30.12** | 42.35 | 66.37 |
|
||||
| C_batch_cert | K 条候选的认证点并成 1 次 gaps | 38.05 | 50.17 | 59.86 |
|
||||
| D_both | B + C | 34.87 | 39.81 | 48.26 |
|
||||
| E_both_cont_n8 | B + C + 连续认证 n=8 | 43.73 | 51.08 | 65.68 |
|
||||
| F_worst_loop8 | **最坏情况**:所有候选被拒(今天逐条串行 K 次调用) | 80.22 | 88.44 | 89.55 |
|
||||
| G_worst_batch | 同一最坏情况但并成 1 次调用 | **37.14** | 46.06 | 52.22 |
|
||||
|
||||
- **复用 FK 是无条件收益**:省一次 `cum_xf`(约 3.4–3.7 ms),特征输出逐位一致,已直接实现进 `ml/common/kin_torch.py` 的 `gm_groups(..., xf=)` 与 `ml/common/features.py`(默认行为不变,新参数仅在调用方已算过 xf 时传)。
|
||||
- **批量认证是"典型换尾部"**:常见路径(第一条候选就通过)贵 4.6 ms;但今天一旦前面的候选被拒就要串行调用,实测最坏 **80.2 ms(12.5 Hz)→ 37.1 ms**,P99 64.7→48.3 ms(D vs A)。硬实时看的是最坏情况,所以这条值得做,但要按"典型略变慢、尾部大幅变稳"来汇报,不能只报 P50。
|
||||
- **仍未到 20 ms**:即便 D 档 P50 34.9 ms、P99 48.3 ms。连续认证挂在 D 上是 43.7 ms(E)。所以 GPU 侧下一步只能是更结构性的:认证降 float32(需先批量量化 f32/f64 判据差异,不能凭 3 个点下结论)、把宽相位做成可增量复用的核、或 `torch.compile`/CUDA Graph 把碎 kernel 合批。
|
||||
- **等价性闸门(纯效率改动不许改变任何结果)**:
|
||||
- 复用 FK:同一 256 题、同 seed、同配方重跑(`docs/experiment_round34_xf_reuse_check.json`),**22 个指标逐项与轮次 33 base 完全相同**(含 success 0.57421875、time_ok 0.390625、brakes 19.25、speed_ratio_max 1.660003662 等)。整批墙钟 296.3 → 318.0 s,是两次独立运行的差,**不能当作开销结论**:省下的那次 `cum_xf` 只在 B=1 交错实测里量到 −3.4 ms,批量评估里一次调用已覆盖 256 行,摊薄后不足以抵消运行间波动。
|
||||
- 批量认证(`--cert_batch 1`,默认 0 不变):同一 256 题重跑 **22 项指标与 base 逐项相同**(`docs/experiment_round34_cert_batch_check.json`,success 0.57421875、time_ok 0.390625、speed_ratio_max 1.660003662 等全部一致),整批墙钟 296.3 → 306.9 s(批量口径把 8 次串行调用换成 1 次 K×256 点的大调用,均值略涨符合预期,与 B=1 交错实测方向一致)。合成夹具里也断言两条路径选到同一条候选、同一前缀长度、逐位相同的轨迹与证书。
|
||||
- **测试 32→34 项**:`CertBatchEquivalenceTest` 两条(候选 0 前缀不完整 → 选候选 1;所有候选第 2 步都不安全 → 两条路径都停在第 1 步)。写夹具时踩到一个自己的坑:桩里掩码写成 `q[:, :1]` 再 `[:, None]` 变成 3 维,广播出 (4,4,49) 才报"size 16",是**测试桩错**不是库错——先证形状再改代码。
|
||||
|
||||
## 轮次 35:半精度、流水线复用与 float32 认证的实测(exp: `exp/dagger-deploy`,三条路两条被自己否掉)
|
||||
|
||||
- **按用户指定的方向先量显卡精度档**(FP32 / FP16 / BF16,`docs/experiment_round34_precision_ab.json`;B=1、K=8、steps=1,25 次预热 + 120 次计时):
|
||||
|
||||
| 精度 | 推理 P50 | 推理 P99 | 整周期 P50 | 整周期 P99 | 动作最大偏差 |
|
||||
|---|---|---|---|---|---|
|
||||
| FP32 | 7.68 ms | 10.63 | 36.51 | 46.57 | — |
|
||||
| FP16 | 8.31 ms(慢 8%) | 12.03 | 36.16 | **55.60(更差)** | 2.1e−3 归一化 = **0.0050°** |
|
||||
| BF16 | 8.58 ms(慢 12%) | 14.17 | — | — | 1.7e−2 = **0.0377°** |
|
||||
|
||||
结论:**这个网络在这个批量下不是算力受限**,半精度换不来时间,还要付动作偏差与更差的尾部 ⇒ 推理保持 FP32。(未测更大 batch,那里的结论不下。)
|
||||
- **float32 能不能做认证**(`docs/experiment_round34_f32_cert.json`,48 段 × 9 网格点 × 15 组对,宽相位 cap 2 mm):f32 与 f64 间隙差 p50 **0**、p99 3.66e−5、p999 7.44e−5、**max 1.32e−4 mm**;有符号误差 max +1.32e−4(确有 1 例高估)、min −1.09e−4。同一判据下 f64/f32 都接受 24/48 段,"仅 f32 判安全"= 0、符号翻转 = 0。⇒ f32 不是不能用,但**现用 eps=1e−4 已被实测越界**,要用就得把 eps 抬到 ≥2e−4 mm;且这只量了间隙值误差,没覆盖 f32 下 FK/界自身的误差,因此暂不放宽 dtype 守卫。
|
||||
- **流水线复用特征间隙——否掉**(`docs/experiment_round35_pipeline_gaps.json`):想法是"下一次规划的 q 正好是本次认证已算过的末点"。第一版给出 42.1→31.8 ms,但**等价性检查不通过**(缓存行与新算差 3.19 mm)——是我取行索引用错(`full[CN-1]` 取到第 2 条候选的第 1 步,而非第 1 条候选走完 commit 步)。修好后收益只剩 **34.8→31.7 ms(−3.1 ms)**:复用要求认证调用改用 cap=40 的宽相位(特征所需),省下的被吃回大半;且缓存行与新算**不是逐位相同**(差 6.3e−5 mm,源于不同 batch 下矩阵乘的结合序),会扰动特征输入。⇒ 不为这 3 ms 改口径,放弃。
|
||||
- **剩下的量级判断**:一个周期 ≈ 推理 7.2 + 特征 13.1(宽相位 8.2 + FK 4.0)+ 末态打分 4.3 + DLS 6.5 + 认证 7.4 ≈ 33 ms,其中 **4–5 次调用各自重做同一个宽相位筛选**(67,256 个簇对)。下一步是把一次筛选的半径按位移界(`cert_lever`)扩到整个 commit 地平线,供同周期所有点共用——这才是有量级的候选,而不是再抠精度。
|
||||
|
||||
- **再一次自我撤回(方法论)**:为了找"合并几何调用"的收益,我写了三个变体的探测:①两次独立调用 17.62 ms、②共享一次 `cum_xf` 13.32 ms、③合成一次 cap=40 调用 9.51 ms(交错 90 轮,特征行逐位一致)。**②③ 都不成立**:探测里认证点直接取自轨迹、与特征无关,而真实循环的顺序是 特征(q) → 推理 → 候选 → 认证点(q+Δ),认证点在特征算完之前不存在 ⇒ 同一次规划内既不能共享 `cum_xf`,也不能把两次 `gaps` 合并。只有 ①→轮次 34 已落地的 `gm_groups` 复用 `xf`(同一姿态内部,−3.4 ms)是真的。教训:**效率探测必须按真实数据依赖排布,否则测的是不存在的调用图**。
|
||||
- **循环内还剩的可复用点**:`replan='empty'` 且队列为空时 `qe == q`,此时目标反馈 DLS 与末态打分的 FK 和特征用的是同一姿态,可以共享一份 `cum_xf`(部署 `r=3` 时不成立,要按 r 分支)。这条待测(#19)。
|
||||
- **守卫补一个**:`gaps()` / `gm_groups()` 现在拒绝行数与 `q` 不符的 `xf`(之前会静默按别的行做宽相位,实测触发 CUDA device-side assert 或给出错间隙),测试 34→35 项;`python -m ml.eval.check_parity` 仍 PASS(2000 样本,间隙差 2.52e−13 mm、碰撞布尔差 0、特征差 5.96e−08)。
|
||||
|
||||
## 分支清理(2026-10-20)
|
||||
|
||||
- `feat/fb-mix`(8e5431c):反馈混合方案的中间分支,**已验证是 `exp/dagger-deploy` 的祖先**(所有提交都在后者历史里),本地/远端分支删除,内容保留在 exp/dagger-deploy。
|
||||
- `feat/abs-target`(217a70b):绝对目标参数化负结论分支(轮次 3);打 tag `archive/abs-target` 保留可复现实体后,删除远端分支(本地此前已删)。
|
||||
- `backup/pre-deep-squash`、`backup/pre-squash`:历史备份分支,非实验方案,保留未动。
|
||||
- 保留:`main`(70654e4)、`exp/dagger-deploy`(39c870c,历史最佳)。
|
||||
@@ -220,3 +220,26 @@ reach **0%** / collision **79.0%** / ratio2s 0.574 / end 408 mm;`sign_flip_rat
|
||||
- 未扰动时 16 步累计目标误差仅 0.46°;状态偏移 3.19° 后目标偏离 4.86°(ρ=1.54)——**当前模型是"从当前状态外推增量",不是"指向参考位置"**。扰动微调让 ρ 更差(1.9–2.0),与开环退化一致。
|
||||
- **结论:方案 B 不能靠改执行层实现,必须改训练标签**——把标签从"16 步增量"改为"16 步绝对目标关节角(参考轨迹位置)",让模型学"目标在哪"而不是"从这怎么走"。执行层每步朝目标走,偏移状态下即天然纠偏。
|
||||
- 实施成本:改 `build_dataset.cjs` 标签口径(Y = 绝对目标),同步 FK/平滑/价值等基于增量的辅助损失、rollout 与 `ik-policy.js` 的增量假设,然后从头训练(约 1 小时)。属结构性改动,未擅自开始。
|
||||
|
||||
### 11. 方案 B 初版实测(分支 `feat/abs-target`,保存点 tag `pre-b-abs-target`)
|
||||
|
||||
**改动**(全部在分支,main 未动):
|
||||
- `build_dataset.cjs`:`ABS_TARGET=1` → Y = 16 步绝对目标关节角(/180 归一化),prefix 仍存增量(度),meta 记录 `abs_target`、签名加 `a1`。
|
||||
- `train.py`:读 `abs_target`;每单位动作=180°;FK 损失用绝对位置;平滑项换算到增量量纲;开环指标用第 16 步绝对位置;ckpt 记录 `abs_target`。
|
||||
- `closed_loop.py`:模型输出绝对目标 → 队列存目标序列、执行 `q=clamp(target)`、前缀由目标差分、安全层中点与 DLS 增量转绝对目标。
|
||||
- `ckpt.py` / `data.py`:abs_target 透传与一致性检查。
|
||||
- **过程 bug(已修)**:前缀噪声增广把 eps 直接加到绝对目标标签上(≈18° 污染,一半样本);改为累计偏移后第 r 步扣回。
|
||||
|
||||
**数据**:84 shard 重打 → 201 万样本、abs_target=1;标签连续(步间差 p50 0.30°、p99 1.8°、无 ±180 跳变)。
|
||||
|
||||
**训练结果**(从零 9950 步;p_neq 预热 5000 步):
|
||||
|
||||
| step | ol_fk_mm | ol_best_mm | 闭环 success | 碰撞 |
|
||||
|---|---|---|---|---|
|
||||
| 4000 | 74.6 | 33.4 | 0 | 100% |
|
||||
| 6000 | 140.4 | 70.3 | 0 | 100% |
|
||||
| 8000 | 139.0 | 68.5 | 0 | 100% |
|
||||
|
||||
- 一步采样动作误差 **31°**(4/8 段采样 2.3°/2.8°)——**绝对目标的一步流匹配映射没学会**;闭环 1 段 0%/100%、4 段 0%/100%(ratio2s 1.045)。
|
||||
- 过预热后 5000 步无下降趋势。可能原因:一步样本仅 `p_edge=10%`、`ada_p=1` 逆误差加权压制难样本、FK/平滑辅助项在绝对位置空间主导。
|
||||
- **结论:此配方不成立**。B 若继续,需改训练配方(p_edge↑、w_fk↓、ada_p=0)或换输出头(确定性回归);当前证据不支持继续投入。分支代码保留可复现。
|
||||
|
||||
@@ -139,7 +139,10 @@ def main():
|
||||
stats['tgt'] += lt.mean().item()
|
||||
(seg_loss / nseg).backward()
|
||||
seg_loss = torch.zeros((), device=dev)
|
||||
q, qp, queue, prev_d = q.detach(), qp.detach(), queue.detach(), prev_d.detach()
|
||||
# 只 detach 状态并重置队列:段边界下一 plan 走 r=0 重新提交(新图有梯度);
|
||||
# 沿用旧 queue 会跨过已 backward 的图(二次 backward 报错),也避免整段无梯度
|
||||
q, qp, prev_d = q.detach(), qp.detach(), prev_d.detach()
|
||||
queue = torch.zeros(B, 0, 6, device=dev)
|
||||
# BC 锚定
|
||||
X, Y, V, SG = data.batch(C['batch'] * 4)
|
||||
with torch.autocast('cuda', dtype=torch.bfloat16, enabled=amp):
|
||||
|
||||
@@ -52,7 +52,9 @@ def features(kin, q, q_prev, T, R, prefix, prefix_len, sub, sub_flag, gm=None, x
|
||||
out.append(sd)
|
||||
out.append(sub_flag[:, None].to(dt))
|
||||
if gm is None:
|
||||
gm = kin.gaps(q, GAP_CAP, xf)['gm']
|
||||
out.append(kin.gm_groups(q, GP, GAP_CAP, xf=xf) / GAP_CAP) # 2026-10-20:只算特征用到的 8 组;xf 复用不重复算 FK
|
||||
gm = None
|
||||
if gm is not None:
|
||||
out.append(torch.stack([gm[:, a * 7 + b].clamp(max=GAP_CAP) / GAP_CAP for a, b in GP], -1))
|
||||
f = torch.cat(out, -1)
|
||||
assert f.shape[1] == F_DIM, f.shape
|
||||
|
||||
+167
-3
@@ -38,7 +38,8 @@ def seg_seg_dist(p1, q1, p2, q2, eps=1e-12):
|
||||
s = torch.where(t_lo, (-c / a.clamp_min(eps)).clamp(0, 1), s)
|
||||
s = torch.where(t_hi, ((b - c) / a.clamp_min(eps)).clamp(0, 1), s)
|
||||
t = t.clamp(0, 1)
|
||||
# 退化(线段长度≈0)
|
||||
# 第二条退化成点时,仍须在第一条上投影,而不是固定取其起点。
|
||||
s = torch.where(e <= eps, (-c / a.clamp_min(eps)).clamp(0, 1), s)
|
||||
s = torch.where(a <= eps, torch.zeros_like(s), s)
|
||||
t = torch.where(e <= eps, torch.zeros_like(t), t)
|
||||
c1 = p1 + d1 * s.unsqueeze(-1)
|
||||
@@ -85,8 +86,36 @@ class Kin:
|
||||
gi, gj = self.cap_g[self.pi], self.cap_g[self.pj]
|
||||
self.pair_gp = torch.minimum(gi, gj) * 7 + torch.maximum(gi, gj)
|
||||
self.lever = T(K['lever'])
|
||||
table = [[0.0] * 7 for _ in range(6)]
|
||||
for group in range(1, 7):
|
||||
endpoints = [c[key] for c in caps if c['g'] == group for key in ('a', 'b')]
|
||||
if not endpoints:
|
||||
continue
|
||||
pivot, axis = K['P'][group - 1], K['D'][group - 1]
|
||||
unit = [v / math.hypot(*axis) for v in axis]
|
||||
relative = [[e[j] - pivot[j] for j in range(3)] for e in endpoints]
|
||||
radius = max(math.hypot(*v) for v in relative)
|
||||
radial = max(math.hypot(v[1] * unit[2] - v[2] * unit[1],
|
||||
v[2] * unit[0] - v[0] * unit[2],
|
||||
v[0] * unit[1] - v[1] * unit[0]) for v in relative)
|
||||
for joint in range(group):
|
||||
chain = sum(math.dist(K['P'][j], K['P'][j + 1]) for j in range(joint, group - 1))
|
||||
table[joint][group] = (chain + (radial if joint == group - 1 else radius)) * D2R
|
||||
self.cert_groups = torch.tensor([a * 7 + b for a in range(7) for b in range(a + 2, 7)], device=device)
|
||||
# 三角不等式给出全姿态界,不用随机姿态最大值冒充上界。
|
||||
self.cert_lever = T([[table[k][b] if a <= k < b else 0.0 for k in range(6)]
|
||||
for a in range(7) for b in range(a + 2, 7)])
|
||||
|
||||
# ---------------- 运动学 ----------------
|
||||
def _checked_xf(self, q, xf):
|
||||
"""xf 是按行对应 q 的位姿数组,行数不匹配会静默广播出错(宽相位筛到别的行 ⇒ device assert 或错间隙)。"""
|
||||
if xf is None:
|
||||
return self.cum_xf(q)
|
||||
Rs, Ts = xf
|
||||
if Rs.shape[0] != q.shape[0] or Ts.shape[0] != q.shape[0]:
|
||||
raise ValueError('xf 的行数 %d 与 q 的行数 %d 不符' % (Rs.shape[0], q.shape[0]))
|
||||
return xf
|
||||
|
||||
def cum_xf(self, q):
|
||||
"""q: [B,6] 度 → Rs [B,7,3,3], Ts [B,7,3]"""
|
||||
B = q.shape[0]
|
||||
@@ -110,6 +139,19 @@ class Kin:
|
||||
Rs, _ = xf if xf is not None else self.cum_xf(q)
|
||||
return Rs[:, 6]
|
||||
|
||||
def jac(self, q, xf=None):
|
||||
"""几何雅可比(对度):返回 (Jv [B,3,6] mm/deg, Jw [B,3,6] 单位轴/deg)"""
|
||||
Rs, Ts = xf if xf is not None else self.cum_xf(q)
|
||||
p = self.fk(q, (Rs, Ts))
|
||||
Jv, Jw = [], []
|
||||
for k in range(6):
|
||||
d = torch.tensor(self.D[k], dtype=q.dtype, device=q.device)
|
||||
a = Rs[:, k] @ d
|
||||
o = torch.einsum('bij,j->bi', Rs[:, k], self.P[k].to(q.dtype)) + Ts[:, k]
|
||||
Jv.append(torch.linalg.cross(a, p - o, dim=-1) * D2R)
|
||||
Jw.append(a * D2R)
|
||||
return torch.stack(Jv, -1), torch.stack(Jw, -1)
|
||||
|
||||
def caps_world(self, q, xf=None):
|
||||
Rs, Ts = xf if xf is not None else self.cum_xf(q)
|
||||
Rg, Tg = Rs[:, self.cap_g], Ts[:, self.cap_g] # [B,C,3,3], [B,C,3]
|
||||
@@ -131,7 +173,8 @@ class Kin:
|
||||
def _cat_gaps(parts, starts):
|
||||
out = {'gm': torch.cat([p.pop('gm') for p in parts], 0)}
|
||||
if 'b' in parts[0]:
|
||||
for p, s in zip(parts, starts): p['b'] += s
|
||||
# 非 in-place:b 会被 autograd 的索引反向图引用(APG 的碰撞铰链梯度路径),+= 会让 backward 报 version 错
|
||||
for p, s in zip(parts, starts): p['b'] = p['b'] + s
|
||||
for k in ('b', 'i', 'j', 'gap'): out[k] = torch.cat([p.pop(k) for p in parts]) # 逐键拼、拼完即释放
|
||||
return out
|
||||
|
||||
@@ -142,7 +185,7 @@ class Kin:
|
||||
2026-10-19(用户实测 4096 点 cap 40 峰值 4.46 GiB 全在拼接 8.6e7 对的 b/i/j/gap):
|
||||
默认只返回 gm,每块算完就丢掉胶囊对,峰值只剩单块。
|
||||
"""
|
||||
xf = xf if xf is not None else self.cum_xf(q)
|
||||
xf = self._checked_xf(q, xf)
|
||||
Rs, Ts = xf
|
||||
B = q.shape[0]
|
||||
step = max(1, self.COARSE_ENTRIES // int(self.cp_a.shape[0]))
|
||||
@@ -201,6 +244,127 @@ class Kin:
|
||||
if not pairs: return {'gm': gm.view(B, 49)}
|
||||
return {'gm': gm.view(B, 49), 'b': rep_b, 'i': pi, 'j': pj, 'gap': gap}
|
||||
|
||||
def gm_groups(self, q, gp, cap=40.0, xf=None):
|
||||
"""只算指定组对 gp=[(a,b),...] 的最小间隙 [B,len(gp)](特征用,避免 49 组全量)。
|
||||
数值与 gaps(q,cap)['gm'][:, a*7+b] 一致;组对在碰撞粗对里不存在时返回 cap。
|
||||
xf 可传入调用者已算好的 cum_xf(q),避免同一姿态重复算 FK(特征路径每周期省一次)。"""
|
||||
key = tuple(gp)
|
||||
if getattr(self, '_gp_key', None) != key:
|
||||
m = torch.full((49,), -1, dtype=torch.long, device=q.device)
|
||||
for i, (a_, b_) in enumerate(gp): m[min(a_, b_) * 7 + max(a_, b_)] = i
|
||||
ga, gb = self.cl_g[self.cp_a], self.cl_g[self.cp_b]
|
||||
cg = torch.minimum(ga, gb) * 7 + torch.maximum(ga, gb) # 簇对 → 7 连杆组对
|
||||
sel = torch.isin(cg, torch.tensor([min(a, b) * 7 + max(a, b) for a, b in gp], device=q.device))
|
||||
self._gp = (m, sel, sel.nonzero(as_tuple=True)[0]); self._gp_key = key
|
||||
self._gp49, sel, idx = self._gp
|
||||
xf = self._checked_xf(q, xf); Rs, Ts = xf; B = q.shape[0]
|
||||
with torch.no_grad():
|
||||
cc = torch.einsum('bkij,kj->bki', Rs[:, self.cl_g], self.cl_c.to(q.dtype)) + Ts[:, self.cl_g]
|
||||
d2 = (cc[:, self.cp_a[idx]] - cc[:, self.cp_b[idx]]).pow(2).sum(-1)
|
||||
keep = d2 <= (self.cp_lim[idx] + cap).pow(2)
|
||||
bb, mm = keep.nonzero(as_tuple=True)
|
||||
del keep, d2, cc
|
||||
cnt = self.cp_cnt[idx][mm]
|
||||
rep_b = torch.repeat_interleave(bb, cnt)
|
||||
off = torch.repeat_interleave(self.cp_start[idx][mm] - torch.cumsum(cnt, 0) + cnt, cnt) + torch.arange(int(cnt.sum()), device=q.device)
|
||||
pidx = off
|
||||
a, b = self.caps_world(q, xf)
|
||||
with torch.no_grad():
|
||||
pi, pj = self.pi[pidx], self.pj[pidx]
|
||||
mid = 0.5 * (a[rep_b, pi] + b[rep_b, pi] - a[rep_b, pj] - b[rep_b, pj])
|
||||
k2 = mid.pow(2).sum(-1) <= (self.pair_bl[pidx] + cap).pow(2)
|
||||
rep_b, pidx, pi, pj = rep_b[k2], pidx[k2], pi[k2], pj[k2]
|
||||
d = seg_seg_dist(a[rep_b, pi], b[rep_b, pi], a[rep_b, pj], b[rep_b, pj])
|
||||
gap = d - self.pair_need[pidx].to(q.dtype)
|
||||
gm = torch.full((B * len(gp),), float(cap), dtype=q.dtype, device=q.device)
|
||||
gm = gm.scatter_reduce(0, rep_b * len(gp) + self._gp49[self.pair_gp[pidx]], gap.clamp(max=cap), reduce='amin', include_self=True)
|
||||
return gm.view(B, len(gp))
|
||||
|
||||
@torch.no_grad()
|
||||
def certify_segments(self, a, b, max_queries=32, max_depth=12, eps=1e-4, cap=20.0):
|
||||
"""逐层二分认证:每根段独立查询预算,未知(超预算/超深度/非有限/越界)一律拒绝。
|
||||
|
||||
判据对每条组对:子段两端间隙之和 > 该子段位移界 + 2eps(间隙取 min(gap,cap),钳制只会更保守)。
|
||||
cap 必须 ≥ 该层子段界 + 2eps 才不会挡住本可通过的判定,故不做自适应收紧——同批其他段会改变
|
||||
钳制程度、让结果随批次而变(实测也无耗时收益,见探索日志轮次 31)。
|
||||
"""
|
||||
if self.dtype != torch.float64 or a.dtype != torch.float64 or b.dtype != torch.float64:
|
||||
raise ValueError('segment certification requires float64')
|
||||
if a.shape != b.shape or a.ndim != 2 or a.shape[1] != 6:
|
||||
raise ValueError('a and b must be [count,6] with identical shape')
|
||||
# 预算给成张量时 max_depth + 1 会在 uint8 这类窄类型上回绕成 0,循环整个跳过,把碰撞段当安全返回。
|
||||
if type(max_queries) is not int or type(max_depth) is not int:
|
||||
raise ValueError('certification budgets must be plain ints')
|
||||
if max_queries < 2 or max_depth < 0 or eps <= 0 or cap <= eps:
|
||||
raise ValueError('invalid certification budget or tolerance')
|
||||
count = a.shape[0]
|
||||
status = torch.zeros(count, dtype=torch.long, device=a.device)
|
||||
inside = (((a >= self.lo) & (a <= self.hi) & (b >= self.lo) & (b <= self.hi)) | self.cont).all(-1)
|
||||
status[~inside] = 3
|
||||
root = torch.arange(count, device=a.device)
|
||||
gaps = self.gaps(torch.cat([a, b]), cap)['gm'][:, self.cert_groups]
|
||||
ga, gb = gaps[:count], gaps[count:]
|
||||
queries = torch.full((count,), 2, dtype=torch.long, device=a.device)
|
||||
bound = (b - a).abs() @ self.cert_lever.T
|
||||
for depth in range(max_depth + 1):
|
||||
finite = torch.isfinite(ga).all(-1) & torch.isfinite(gb).all(-1)
|
||||
collision = (ga <= 0).any(-1) | (gb <= 0).any(-1)
|
||||
status[root[~finite]] = 2
|
||||
status[root[collision]] = 1
|
||||
positive = (ga > eps).all(-1) & (gb > eps).all(-1)
|
||||
proven = positive & (ga + gb > bound + 2 * eps).all(-1)
|
||||
pending = (status[root] == 0) & ~proven
|
||||
if not bool(pending.any()):
|
||||
break
|
||||
a, b, ga, gb, root, bound = a[pending], b[pending], ga[pending], gb[pending], root[pending], bound[pending]
|
||||
if depth == max_depth:
|
||||
status[root] = 2
|
||||
break
|
||||
requested = torch.bincount(root, minlength=count)
|
||||
status[(status == 0) & (queries + requested > max_queries)] = 2
|
||||
keep = status[root] == 0
|
||||
a, b, ga, gb, root, bound = (t[keep] for t in (a, b, ga, gb, root, bound))
|
||||
if not root.numel():
|
||||
break
|
||||
mid = a + 0.5 * (b - a)
|
||||
gm = self.gaps(mid, cap)['gm'][:, self.cert_groups]
|
||||
queries += torch.bincount(root, minlength=count)
|
||||
a, b = torch.cat([a, mid]), torch.cat([mid, b])
|
||||
ga, gb = torch.cat([ga, gm]), torch.cat([gm, gb])
|
||||
root = torch.cat([root, root])
|
||||
bound = torch.cat([bound, bound]) / 2
|
||||
return {'safe': status == 0, 'collision': status == 1, 'unresolved': status == 2,
|
||||
'outside_box': status == 3, 'queries': queries}
|
||||
|
||||
@torch.no_grad()
|
||||
def certify_uniform(self, a, b, n=64, eps=1e-4, cap=None):
|
||||
"""固定层数的均匀细分认证:n 个子段只需一次 gaps 调用(n+1 个点),没有逐层依赖的往返。
|
||||
|
||||
判据与 certify_segments 完全相同;界对 Δq 线性,所以子段界 = 整段界 / n。未通过即 unproven
|
||||
(拒绝),不存在“未知当安全”。cap=None 时取“最小不挡住可通过判定的宽相位”= 最大子段界 + 2eps:
|
||||
小于它钳制会把本可证明的子段压成不可证(偏保守),大于它只是多算对(偏慢),不改正确性。
|
||||
"""
|
||||
if self.dtype != torch.float64 or a.dtype != torch.float64 or b.dtype != torch.float64:
|
||||
raise ValueError('segment certification requires float64')
|
||||
if type(n) is not int or n < 1 or eps <= 0 or (cap is not None and cap <= eps):
|
||||
raise ValueError('invalid subdivision count or tolerance')
|
||||
if a.shape != b.shape or a.ndim != 2 or a.shape[1] != 6:
|
||||
raise ValueError('a and b must be [count,6] with identical shape')
|
||||
count = a.shape[0]
|
||||
inside = (((a >= self.lo) & (a <= self.hi) & (b >= self.lo) & (b <= self.hi)) | self.cont).all(-1)
|
||||
bound = (b - a).abs() @ self.cert_lever.T / n # [count,15] 子段界
|
||||
required = float(bound.max()) + 2 * eps if count else 2 * eps
|
||||
qc = required if cap is None else cap
|
||||
alpha = torch.arange(n + 1, dtype=self.dtype, device=a.device) / n
|
||||
points = (a[:, None] + (b - a)[:, None] * alpha[None, :, None]).reshape(-1, 6)
|
||||
gm = self.gaps(points, qc)['gm'][:, self.cert_groups].view(count, n + 1, -1)
|
||||
adjacent = gm[:, :-1] + gm[:, 1:] > bound[:, None, :] + 2 * eps
|
||||
collision = (gm <= 0).any((1, 2))
|
||||
safe = inside & (gm > eps).all((1, 2)) & adjacent.all((1, 2)) & ~collision
|
||||
return {'safe': safe, 'collision': collision, 'unproven': (~safe & ~collision & inside),
|
||||
'outside_box': ~inside, 'points': n + 1, 'queries': n + 1,
|
||||
'cap_required_mm': required, 'cap_used_mm': qc}
|
||||
|
||||
def min_gap(self, q, cap=40.0):
|
||||
return self.gaps(q, cap)['gm'].min(-1).values
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"model": {"d": 192, "heads": 8, "ff": 768, "enc": 4, "dec": 4},
|
||||
"train": {
|
||||
"batch": 1024, "lr": 1e-3, "warmup": 1000, "steps": 24000, "wd": 0.01, "betas": [0.9, 0.95],
|
||||
"amp": "bf16", "grad_clip": 1.0,
|
||||
"w_mf": 1.0, "w_fk": 0.5, "w_smooth": 0.05, "w_value": 0.1, "w_sub": 0.1,
|
||||
"p_neq": 0.5, "p_edge": 0.1, "p_neq_warm": 5000, "fk_tmax": 0.3, "fk_caps": 96,
|
||||
"ema": 0.999, "aug_pre_drop": 0.15, "aug_pre_sigma": 0.1, "aug_dq_sigma": 0.3,
|
||||
"ckpt_min": 10, "eval_every": 2000, "eval_tasks": 512, "log_every": 50, "patience_evals": 5
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"model": {"d": 192, "heads": 8, "ff": 768, "enc": 4, "dec": 4},
|
||||
"train": {
|
||||
"batch": 1024, "lr": 1e-3, "warmup": 1000, "steps": 24000, "wd": 0.01, "betas": [0.9, 0.95],
|
||||
"amp": "bf16", "grad_clip": 1.0,
|
||||
"w_mf": 1.0, "w_fk": 0.5, "w_smooth": 0.05, "w_value": 0.1, "w_sub": 0.1,
|
||||
"p_neq": 0.5, "p_edge": 0.1, "p_neq_warm": 5000, "fk_tmax": 0.3, "fk_caps": 96,
|
||||
"ema": 0.999, "aug_pre_drop": 0.15, "aug_pre_sigma": 0.1, "aug_dq_sigma": 0.3,
|
||||
"ckpt_min": 10, "eval_every": 2000, "eval_tasks": 512, "log_every": 50, "patience_evals": 5
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"model": {
|
||||
"d": 192,
|
||||
"heads": 8,
|
||||
"ff": 768,
|
||||
"enc": 4,
|
||||
"dec": 4
|
||||
},
|
||||
"train": {
|
||||
"batch": 1024,
|
||||
"lr": 0.0001,
|
||||
"warmup": 1000,
|
||||
"steps": 3000,
|
||||
"wd": 0.01,
|
||||
"betas": [
|
||||
0.9,
|
||||
0.95
|
||||
],
|
||||
"amp": "bf16",
|
||||
"grad_clip": 1.0,
|
||||
"w_mf": 1.0,
|
||||
"w_fk": 0.1,
|
||||
"w_smooth": 0.01,
|
||||
"w_value": 0.0,
|
||||
"w_sub": 0.0,
|
||||
"p_neq": 0.5,
|
||||
"p_edge": 0.1,
|
||||
"p_neq_warm": 0,
|
||||
"fk_tmax": 0.3,
|
||||
"fk_caps": 96,
|
||||
"ema": 0.999,
|
||||
"aug_pre_drop": 0.15,
|
||||
"aug_pre_sigma": 0.1,
|
||||
"aug_dq_sigma": 0.3,
|
||||
"ckpt_min": 10,
|
||||
"eval_every": 1000,
|
||||
"eval_tasks": 256,
|
||||
"log_every": 50,
|
||||
"patience_evals": 3
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,10 @@ def main():
|
||||
ap.add_argument('--parts', type=int, default=8); ap.add_argument('--out', required=True)
|
||||
ap.add_argument('--bs', type=int, default=64)
|
||||
ap.add_argument('--device', default='cuda' if torch.cuda.is_available() else 'cpu')
|
||||
ap.add_argument('--fb_gain', type=float, default=0.0, help='部署分布采集:目标反馈增益(与 rollout 一致)')
|
||||
ap.add_argument('--safety', type=int, default=0, help='部署分布采集:是否开安全层')
|
||||
ap.add_argument('--replan', default='r3'); ap.add_argument('--commit_n', type=int, default=3)
|
||||
ap.add_argument('--safety_partial', type=int, default=0)
|
||||
a = ap.parse_args()
|
||||
gap_min = float(os.environ.get('MIN_GAP_MM') or 3)
|
||||
os.makedirs(a.out, exist_ok=True)
|
||||
@@ -41,7 +45,8 @@ def main():
|
||||
for i in range(0, len(tasks), a.bs):
|
||||
tb = tasks[i:i + a.bs]
|
||||
with torch.no_grad():
|
||||
_, per = rollout(model, kin, tb, a.device, K=8, safety=False, seed=a.seed * 100003 + i, return_traj=True)
|
||||
_, per = rollout(model, kin, tb, a.device, K=8, safety=bool(a.safety), seed=a.seed * 100003 + i, return_traj=True,
|
||||
fb_gain=a.fb_gain, replan=a.replan, commit_n=a.commit_n, safety_partial=a.safety_partial)
|
||||
tr = per['traj'].to(a.device) # [B,T,6]
|
||||
B, Tn, _ = tr.shape
|
||||
_, T, R, _, _ = tasks_to_tensors(tb, a.device)
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env python
|
||||
"""反馈蒸馏:用最终部署配置(目标反馈 + 安全层 + 部分前缀 + 每步规划)跑闭环,
|
||||
收集 (特征, 复合动作 = 模型输出 + 目标反馈) 样本,供 train.py 微调把反馈内化进策略。
|
||||
PYTHONUTF8=1 python -m ml.dagger.distill_fb --ckpt ml/runs/base_dag2_dag1/best.pt --n 500 \
|
||||
--fb_gain 1.8 --out ml/data/samples_fbdistill
|
||||
输出可直接被 ml.data.Samples 读取(collect.X/Y/V/SG/TID.npy;无 meta = act_scale 1.0,与主数据一致)。
|
||||
动作标签 = 候选动作(含反馈)的归一化 act(/STEP,clamp ±1),与主数据同口径。
|
||||
"""
|
||||
import argparse, os, random
|
||||
import numpy as np
|
||||
import torch
|
||||
|
||||
from ml.common.ckpt import load_policy
|
||||
from ml.common.features import STEP
|
||||
from ml.common.kin_torch import Kin
|
||||
from ml.data import load_tasks
|
||||
from ml.sim.closed_loop import rollout
|
||||
|
||||
|
||||
def main():
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument('--ckpt', required=True); ap.add_argument('--n', type=int, default=500)
|
||||
ap.add_argument('--bs', type=int, default=64); ap.add_argument('--fb_gain', type=float, default=1.8)
|
||||
ap.add_argument('--samples', default='ml/data/samples'); ap.add_argument('--out', required=True)
|
||||
ap.add_argument('--device', default='cuda' if torch.cuda.is_available() else 'cpu'); ap.add_argument('--seed', type=int, default=1)
|
||||
a = ap.parse_args()
|
||||
dev = a.device
|
||||
model, _ = load_policy(a.ckpt, dev)
|
||||
kin = Kin(device=dev)
|
||||
pool = [t for t in load_tasks([a.samples]) if t['split'] == 'train' and t.get('cat') not in ('D',)]
|
||||
random.Random(a.seed).shuffle(pool); tasks = pool[:a.n]
|
||||
stp = torch.tensor(STEP) # collect 返回 CPU 张量,标签换算也在 CPU
|
||||
X, Y, TID = [], [], []
|
||||
for i in range(0, len(tasks), a.bs):
|
||||
ch = tasks[i:i + a.bs]
|
||||
coll = []
|
||||
with torch.no_grad():
|
||||
rollout(model, kin, ch, dev, K=8, safety=True, replan='empty', fb_gain=a.fb_gain,
|
||||
safety_partial=1, commit_n=1, seed=a.seed * 100003 + i, collect=coll)
|
||||
for f, ac in coll:
|
||||
X.append(f.numpy()); Y.append((ac / stp).clamp(-1, 1).numpy())
|
||||
ncol = sum(f.shape[0] for f, _ in coll)
|
||||
TID.append(np.arange(ncol, dtype=np.int32) + i * 100000)
|
||||
print(f'[distill] {i + len(ch)}/{len(tasks)} tasks, samples {sum(x.shape[0] for x in X)}', flush=True)
|
||||
os.makedirs(a.out, exist_ok=True)
|
||||
X = np.concatenate(X); Y = np.concatenate(Y); TID = np.concatenate(TID)
|
||||
n = X.shape[0]
|
||||
np.save(os.path.join(a.out, 'collect.X.npy'), X.astype(np.float32))
|
||||
np.save(os.path.join(a.out, 'collect.Y.npy'), Y.astype(np.float32))
|
||||
np.save(os.path.join(a.out, 'collect.V.npy'), np.full(n, 0.5, np.float32))
|
||||
np.save(os.path.join(a.out, 'collect.SG.npy'), np.zeros((n, 13), np.float32))
|
||||
np.save(os.path.join(a.out, 'collect.TID.npy'), TID)
|
||||
print(f'done: {n} samples, X {X.shape}, Y {Y.shape}', flush=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
+1
-1
@@ -24,7 +24,7 @@ for ((r=1; r<=R; r++)); do
|
||||
SAMPLES="$SAMPLES $SD"
|
||||
if [ -f $OUT/done ]; then echo "[dagger] 第 $r 轮已完成,跳过"; CK=$($PY -m ml.common.ckpt pick $OUT); continue; fi
|
||||
if [ -f $D/collect.json ]; then echo "[dagger] 第 $r 轮起点已采集,跳过"
|
||||
else echo "[dagger] 第 $r 轮:用 $CK 闭环采起点($N 题)"; $PY -m ml.dagger.collect --ckpt $CK --samples ml/data/samples --n $N --seed $r --parts $P --out $D; fi
|
||||
else echo "[dagger] 第 $r 轮:用 $CK 闭环采起点($N 题)"; $PY -m ml.dagger.collect --ckpt $CK --samples ml/data/samples --n $N --seed $r --parts $P --out $D --fb_gain ${FB_GAIN:-0} --safety ${DAG_SAFETY:-0} --replan ${DAG_REPLAN:-r3} --commit_n ${DAG_COMMIT_N:-3} --safety_partial ${DAG_PARTIAL:-0}; fi
|
||||
cat $D/collect.json
|
||||
pids=()
|
||||
for f in $D/tasks_*.jsonl; do
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
"""DLS 解析雅可比对拍 + 延迟(python -m ml.eval.check_dls)"""
|
||||
import time
|
||||
import torch
|
||||
|
||||
from ml.common.kin_torch import Kin
|
||||
from ml.sim.closed_loop import dls_steps
|
||||
|
||||
|
||||
def main():
|
||||
dev = 'cuda' if torch.cuda.is_available() else 'cpu'
|
||||
kin = Kin(device=dev)
|
||||
g = torch.Generator(device=dev); g.manual_seed(0)
|
||||
B = 64
|
||||
lo, hi = kin.lo + 20, kin.hi - 20
|
||||
q = lo + (hi - lo) * torch.rand(B, 6, device=dev, generator=g)
|
||||
xf = kin.cum_xf(q)
|
||||
p = kin.fk(q, xf)
|
||||
T = p + 6 * torch.randn(B, 3, device=dev, generator=g)
|
||||
R = torch.zeros(B, 9, device=dev)
|
||||
a = dls_steps(kin, q, T, R, n=3, analytic=True)
|
||||
b = dls_steps(kin, q, T, R, n=3, analytic=False)
|
||||
d = (a - b).abs()
|
||||
print('pos-only max|Δdq| %.6f° mean %.6f° rel %.4f' % (d.max().item(), d.mean().item(), (d.norm() / b.norm()).item()))
|
||||
# 带姿态目标:绕随机轴 ±8°
|
||||
axis = torch.randn(B, 3, device=dev, generator=g); axis = axis / axis.norm(dim=-1, keepdim=True)
|
||||
ang = (torch.rand(B, 1, device=dev, generator=g) * 16 - 8) * torch.pi / 180
|
||||
Kx = torch.zeros(B, 3, 3, device=dev)
|
||||
Kx[:, 0, 1] = -axis[:, 2]; Kx[:, 0, 2] = axis[:, 1]; Kx[:, 1, 0] = axis[:, 2]
|
||||
Kx[:, 1, 2] = -axis[:, 0]; Kx[:, 2, 0] = -axis[:, 1]; Kx[:, 2, 1] = axis[:, 0]
|
||||
I = torch.eye(3, device=dev)
|
||||
Rd = I + torch.sin(ang)[..., None] * Kx + (1 - torch.cos(ang))[..., None] * (Kx @ Kx)
|
||||
Rt = kin.orient(q, xf) @ Rd
|
||||
R9 = Rt.reshape(B, 9)
|
||||
a = dls_steps(kin, q, T, R9, n=3, analytic=True)
|
||||
b = dls_steps(kin, q, T, R9, n=3, analytic=False)
|
||||
d = (a - b).abs()
|
||||
print('pos+rot max|Δdq| %.6f° mean %.6f° rel %.4f' % (d.max().item(), d.mean().item(), (d.norm() / b.norm()).item()))
|
||||
|
||||
for n_ in (1, 3):
|
||||
for Bn in (1, 256):
|
||||
qq = q[:Bn]; TT = T[:Bn]; RR = R9[:Bn]
|
||||
for an in (False, True):
|
||||
for _ in range(3):
|
||||
dls_steps(kin, qq, TT, RR, n=n_, analytic=an)
|
||||
torch.cuda.synchronize() if dev == 'cuda' else None
|
||||
t0 = time.perf_counter()
|
||||
for _ in range(20):
|
||||
dls_steps(kin, qq, TT, RR, n=n_, analytic=an)
|
||||
torch.cuda.synchronize() if dev == 'cuda' else None
|
||||
print('n=%d B=%3d analytic=%d %.2f ms' % (n_, Bn, an, (time.perf_counter() - t0) / 20 * 1e3))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
+266
-2
@@ -7,7 +7,7 @@
|
||||
口径与 closed_loop.rollout 一致:每步同时检查当前状态 q 与相邻状态中点 mid 的间隙(cap=0.5 mm);
|
||||
间隙组对索引 = gA*7+gB(gA<gB,g 为连杆组 0..5 → J1..J6)。
|
||||
"""
|
||||
import argparse, json, math, os, sys
|
||||
import argparse, json, math, os, sys, time
|
||||
from collections import Counter
|
||||
|
||||
import torch
|
||||
@@ -25,9 +25,253 @@ def pair_names():
|
||||
return {a * 7 + b: f'{nm(a)}-{nm(b)}' for a in range(7) for b in range(a + 1, 7)}
|
||||
|
||||
|
||||
@torch.no_grad()
|
||||
def replay_first_hits(path, out=None):
|
||||
saved = torch.load(path, map_location='cpu', weights_only=True)
|
||||
k32, k64 = Kin(), Kin(dtype=torch.float64)
|
||||
rows, offset = [], 0
|
||||
for _, per, count in saved['batches']:
|
||||
for b in (per['col'] > 0).nonzero().flatten().tolist():
|
||||
it = int(round(float(per['first_hit'][b]) / DT))
|
||||
prev, q = per['traj'][b, it - 1:it + 1]
|
||||
mid = prev + 0.5 * (q - prev)
|
||||
points = torch.stack([per['traj'][b, 0], prev, mid, q])
|
||||
gm32 = k32.gaps(points, 0.5)['gm']
|
||||
gm64 = k64.gaps(points.double(), 0.5)['gm']
|
||||
gap32, gp32 = gm32.min(-1)
|
||||
gap64, gp64 = gm64.min(-1)
|
||||
nseg = max(1, math.ceil(float((q - prev).abs().max()) / 0.01))
|
||||
dense = prev.double() + torch.linspace(0, 1, nseg + 1, dtype=torch.float64)[:, None] * (q.double() - prev.double())
|
||||
dense_gap = torch.cat([k64.gaps(chunk, 0.5)['gm'].min(-1).values for chunk in dense.split(32)])
|
||||
boundary = (~k32.cont) & ((q - k32.lo).abs().lt(1e-5) | (q - k32.hi).abs().lt(1e-5))
|
||||
row = {
|
||||
'i': offset + b, 'task': saved['tasks'][offset + b],
|
||||
'first_hit_s': float(per['first_hit'][b]), 'dls_it': int(per['dls_it'][b]),
|
||||
'point_order': ['q0', 'previous', 'midpoint', 'endpoint'],
|
||||
'gap32_mm': gap32.tolist(), 'gap64_mm': gap64.tolist(),
|
||||
'pair32': gp32.tolist(), 'pair64': gp64.tolist(),
|
||||
'boundary_joints': (boundary.nonzero().flatten() + 1).tolist(),
|
||||
'previous': prev.tolist(), 'endpoint': q.tolist(),
|
||||
'dense_nsegments': nseg, 'dense_gap64_min_mm': float(dense_gap.min()),
|
||||
}
|
||||
if 'plans' in per:
|
||||
plans = per['plans']
|
||||
pi = int(torch.searchsorted(plans['it'], it - 1, right=True)) - 1
|
||||
step = it - 1 - int(plans['it'][pi])
|
||||
ncommit = plans['commit'].shape[2]
|
||||
command = plans['commit'][b, pi, step]
|
||||
cp, cm = plans['points'][b, pi, step], plans['midpoints'][b, pi, step]
|
||||
checked = bool(plans['certified'][b, pi, step])
|
||||
predicted = k32.clamp_box((prev + command)[None])[0]
|
||||
row['certificate'] = {
|
||||
'plan_start_it': int(plans['it'][pi]), 'step': step, 'checked': checked,
|
||||
'endpoint': cp.tolist() if checked else None,
|
||||
'midpoint': cm.tolist() if checked else None,
|
||||
'recorded_gap32_mm': plans['gaps'][b, pi, [step, ncommit + step]].tolist() if checked else None,
|
||||
'replayed_gap64_mm': k64.gaps(torch.stack([cp, cm]).double(), 0.5)['gm'].min(-1).values.tolist() if checked else None,
|
||||
'command_delta': command.tolist(),
|
||||
'clamped_reconstruction_max_abs_deg': float((predicted - q).abs().max()),
|
||||
'certified_vs_executed_max_abs_deg': float((cp - q).abs().max()) if checked else None,
|
||||
}
|
||||
rows.append(row)
|
||||
print('task %d first_hit %.2fs gap32 %s gap64 %s boundary %s' %
|
||||
(row['i'], row['first_hit_s'], row['gap32_mm'], row['gap64_mm'], row['boundary_joints']), flush=True)
|
||||
offset += count
|
||||
result = {
|
||||
'trace': path, 'n': offset, 'reported_collision_tasks': len(rows),
|
||||
'replayed_first_hits32': sum(min(r['gap32_mm'][2:]) <= 0 for r in rows),
|
||||
'replayed_first_hits64': sum(min(r['gap64_mm'][2:]) <= 0 for r in rows),
|
||||
'scope': 'Replay reported first hits only; same geometry kernel at float32/float64, not a full safety audit.',
|
||||
'rows': rows,
|
||||
}
|
||||
if out:
|
||||
with open(out, 'w', encoding='utf-8') as f:
|
||||
json.dump(result, f, indent=2, allow_nan=False)
|
||||
print('replayed first hits: %d/%d float32, %d/%d float64' %
|
||||
(result['replayed_first_hits32'], len(rows), result['replayed_first_hits64'], len(rows)), flush=True)
|
||||
return result
|
||||
|
||||
|
||||
@torch.no_grad()
|
||||
def replay_dense(path, indices, max_step_deg=0.05, device='cpu', out=None):
|
||||
saved = torch.load(path, map_location='cpu', weights_only=True)
|
||||
kin = Kin(device=device, dtype=torch.float64)
|
||||
if saved.get('kin_fp') != kin.fp:
|
||||
raise ValueError('trace/kin fingerprint mismatch')
|
||||
if not indices or min(indices) < 0 or max(indices) >= len(saved['tasks']) or max_step_deg <= 0:
|
||||
raise ValueError('valid task indices and positive max_step_deg required')
|
||||
started = time.perf_counter()
|
||||
rows, offset = [], 0
|
||||
for _, per, count in saved['batches']:
|
||||
for index in indices:
|
||||
if not offset <= index < offset + count:
|
||||
continue
|
||||
b = index - offset
|
||||
nstep = min(per['traj'].shape[1] - 1, math.floor((float(per['limit'][b]) + 1e-6) / DT))
|
||||
if torch.isfinite(per['t_done'][b]):
|
||||
nstep = min(nstep, round(float(per['t_done'][b]) / DT))
|
||||
trajectory = per['traj'][b, :nstep + 1].double()
|
||||
points, segment_ids, fractions = [trajectory[:1]], [torch.tensor([-1])], [torch.zeros(1)]
|
||||
for it in range(nstep):
|
||||
prev, end = trajectory[it:it + 2]
|
||||
nseg = max(2, 2 * math.ceil(float((end - prev).abs().max()) / (2 * max_step_deg)))
|
||||
alpha = torch.arange(1, nseg + 1, dtype=torch.float64) / nseg
|
||||
points.append(prev + alpha[:, None] * (end - prev))
|
||||
segment_ids.append(torch.full((nseg,), it))
|
||||
fractions.append(alpha)
|
||||
points = torch.cat(points)
|
||||
segments, alpha = torch.cat(segment_ids), torch.cat(fractions)
|
||||
print('dense task %d steps %d points %d start' % (index, nstep, len(points)), flush=True)
|
||||
gaps = []
|
||||
for start in range(0, len(points), 64):
|
||||
gaps.append(kin.gaps(points[start:start + 64].to(device), 0.5)['gm'].min(-1).values.cpu())
|
||||
if (start // 64 + 1) % 64 == 0:
|
||||
print('dense task %d points %d/%d wall %.1fs' %
|
||||
(index, min(start + 64, len(points)), len(points), time.perf_counter() - started), flush=True)
|
||||
gaps = torch.cat(gaps)
|
||||
hit = gaps <= 0
|
||||
first = int(hit.nonzero()[0]) if hit.any() else None
|
||||
rows.append({
|
||||
'i': index, 'task': saved['tasks'][index], 'steps': nstep, 'sampled_points': len(points),
|
||||
'initial_gap64_mm': float(gaps[0]), 'min_gap64_mm': float(gaps.min()),
|
||||
'collision_segments': int(segments[hit & (segments >= 0)].unique().numel()),
|
||||
'first_collision_s': max(0.0, float(segments[first] + alpha[first]) * DT) if first is not None else None,
|
||||
})
|
||||
print('dense task %d min_gap %.9f mm collision_segments %d' %
|
||||
(index, rows[-1]['min_gap64_mm'], rows[-1]['collision_segments']), flush=True)
|
||||
offset += count
|
||||
result = {
|
||||
'trace': str(path), 'tasks_sha256': saved.get('tasks_sha256'), 'kin_fp': kin.fp,
|
||||
'indices': indices, 'max_step_deg': max_step_deg, 'dtype': 'float64', 'device': device,
|
||||
'scope': 'Executed trajectory through each task deadline or arrival, including initial state; finite sampling, not continuous certification.',
|
||||
'collision_tasks': sum(r['min_gap64_mm'] <= 0 for r in rows), 'rows': rows,
|
||||
'audit_wall_s': time.perf_counter() - started,
|
||||
}
|
||||
if out:
|
||||
with open(out, 'w', encoding='utf-8') as f:
|
||||
json.dump(result, f, indent=2, allow_nan=False)
|
||||
return result
|
||||
|
||||
|
||||
@torch.no_grad()
|
||||
def replay_certificates(path, indices, device='cpu', out=None, repeats=5, extra_segments=()):
|
||||
saved = torch.load(path, map_location='cpu', weights_only=True)
|
||||
kin = Kin(device=device, dtype=torch.float64)
|
||||
if saved.get('kin_fp') != kin.fp:
|
||||
raise ValueError('trace/kin fingerprint mismatch')
|
||||
if not indices or min(indices) < 0 or max(indices) >= len(saved['tasks']) or repeats < 1:
|
||||
raise ValueError('valid task indices and positive repeats required')
|
||||
rows, offset = [], 0
|
||||
for _, per, count in saved['batches']:
|
||||
for index in indices:
|
||||
if not offset <= index < offset + count:
|
||||
continue
|
||||
b = index - offset
|
||||
nstep = min(per['traj'].shape[1] - 1, math.floor((float(per['limit'][b]) + 1e-6) / DT))
|
||||
if torch.isfinite(per['t_done'][b]):
|
||||
nstep = min(nstep, round(float(per['t_done'][b]) / DT))
|
||||
traj = per['traj'][b, :nstep + 1]
|
||||
moving = ((traj[1:] - traj[:-1]).abs().max(-1).values > 1e-6).nonzero().flatten().tolist()
|
||||
if not moving:
|
||||
continue
|
||||
plans = per['plans']
|
||||
nearest, nearest_gap = None, float('inf')
|
||||
for it in moving:
|
||||
pi = int(torch.searchsorted(plans['it'], it, right=True)) - 1
|
||||
step = it - int(plans['it'][pi])
|
||||
if 0 <= step < plans['commit'].shape[2] and plans['certified'][b, pi, step]:
|
||||
gap = float(plans['gaps'][b, pi, [step, plans['commit'].shape[2] + step]].min())
|
||||
if gap < nearest_gap:
|
||||
nearest, nearest_gap = it, gap
|
||||
selected = {moving[0], moving[len(moving) // 2], moving[-1]}
|
||||
if nearest is not None:
|
||||
selected.add(nearest)
|
||||
for task_index, it in extra_segments:
|
||||
if task_index == index:
|
||||
if it not in moving:
|
||||
raise ValueError('extra segment must be a moving segment before deadline or arrival')
|
||||
selected.add(it)
|
||||
for it in sorted(selected):
|
||||
rows.append({'i': index, 'start_it': it, 'a': traj[it].tolist(), 'b': traj[it + 1].tolist()})
|
||||
offset += count
|
||||
if not rows:
|
||||
raise ValueError('no moving segments in selected tasks')
|
||||
a = torch.tensor([r['a'] for r in rows], dtype=torch.float64, device=device)
|
||||
b = torch.tensor([r['b'] for r in rows], dtype=torch.float64, device=device)
|
||||
started = time.perf_counter()
|
||||
print('certificate replay: %d tasks, %d fixed moving segments' % (len(indices), len(rows)), flush=True)
|
||||
summaries = {}
|
||||
for budget in (2, 8, 32):
|
||||
result = kin.certify_segments(a, b, max_queries=budget)
|
||||
summaries[str(budget)] = {key: int(result[key].sum()) for key in ('safe', 'collision', 'unresolved', 'outside_box')}
|
||||
summaries[str(budget)]['queries_p50'] = float(result['queries'].double().quantile(0.5))
|
||||
summaries[str(budget)]['queries_max'] = int(result['queries'].max())
|
||||
for j, row in enumerate(rows):
|
||||
row.setdefault('budgets', {})[str(budget)] = {key: value[j].item() for key, value in result.items()}
|
||||
print('budget %d: %s' % (budget, summaries[str(budget)]), flush=True)
|
||||
latencies = []
|
||||
for j, row in enumerate(rows):
|
||||
aa, bb = a[j:j + 1], b[j:j + 1]
|
||||
discrete = kin.gaps(torch.cat([aa, aa + 0.5 * (bb - aa), bb]), 0.5)['gm'].min(-1).values
|
||||
row['previous_midpoint_endpoint_gap_mm'] = discrete.tolist()
|
||||
nseg = max(2, 2 * math.ceil(float((bb - aa).abs().max()) / 0.02))
|
||||
alpha = torch.linspace(0, 1, nseg + 1, dtype=torch.float64, device=device)
|
||||
points = aa + alpha[:, None] * (bb - aa)
|
||||
dense = torch.cat([kin.gaps(chunk, 0.5)['gm'].min(-1).values for chunk in points.split(64)])
|
||||
row['dense_points'] = len(points)
|
||||
row['dense_min_gap_mm'] = float(dense.min())
|
||||
row['dense_min_fraction'] = float(alpha[dense.argmin()])
|
||||
for _ in range(3):
|
||||
kin.certify_segments(aa, bb)
|
||||
elapsed = []
|
||||
for _ in range(repeats):
|
||||
if a.is_cuda:
|
||||
torch.cuda.synchronize(a.device)
|
||||
t0 = time.perf_counter()
|
||||
result = kin.certify_segments(aa, bb)
|
||||
if a.is_cuda:
|
||||
torch.cuda.synchronize(a.device)
|
||||
elapsed.append((time.perf_counter() - t0) * 1000)
|
||||
row['batch_single_match'] = all(value.item() == row['budgets']['32'][key] for key, value in result.items())
|
||||
row['latency_ms'] = elapsed
|
||||
latencies.extend(elapsed)
|
||||
print('segment %d/%d task %d it %d dense %.6f mm queries %d latency %.2f ms' %
|
||||
(j + 1, len(rows), row['i'], row['start_it'], row['dense_min_gap_mm'],
|
||||
row['budgets']['32']['queries'], sum(elapsed) / len(elapsed)), flush=True)
|
||||
elapsed = torch.tensor(latencies, dtype=torch.float64)
|
||||
result = {
|
||||
'trace': str(path), 'tasks_sha256': saved.get('tasks_sha256'), 'kin_fp': kin.fp,
|
||||
'device': str(device), 'gpu': torch.cuda.get_device_name(a.device) if a.is_cuda else None,
|
||||
'torch_version': str(torch.__version__), 'cpu_threads': torch.get_num_threads(), 'dtype': 'float64',
|
||||
'indices': indices, 'extra_segments': list(extra_segments),
|
||||
'selection': 'First/middle/last moving segment and minimum original certified gap per task; plus explicit extra_segments.',
|
||||
'cap_mm': 20.0, 'eps_mm': 1e-4, 'max_depth': 12, 'dense_max_step_deg': 0.01,
|
||||
'timing': {'scope': 'B=1 certificate only, resident inputs, 3 warmups per segment; synchronized wall time, not policy or scheduling latency.',
|
||||
'repeats_per_segment': repeats, 'calls': len(latencies),
|
||||
'p50_ms': float(elapsed.quantile(0.5)), 'p99_ms': float(elapsed.quantile(0.99)),
|
||||
'max_ms': float(elapsed.max()), 'over_20ms': int((elapsed > 20).sum())},
|
||||
'budgets': summaries,
|
||||
'dense_collision_segments': sum(r['dense_min_gap_mm'] <= 0 for r in rows),
|
||||
'accepted_dense_collision_segments': sum(r['dense_min_gap_mm'] <= 0 and r['budgets']['32']['safe'] for r in rows),
|
||||
'batch_single_match': all(r['batch_single_match'] for r in rows),
|
||||
'scope': 'Fixed recorded segments, not a new rollout. Dense replay is finite sampling; floating-point certification error is not formally bounded.',
|
||||
'wall_s': time.perf_counter() - started, 'rows': rows,
|
||||
}
|
||||
if out:
|
||||
with open(out, 'w', encoding='utf-8') as f:
|
||||
json.dump(result, f, indent=2, allow_nan=False)
|
||||
return result
|
||||
|
||||
|
||||
def main():
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument('--ckpt', required=True)
|
||||
ap.add_argument('--ckpt')
|
||||
ap.add_argument('--trace')
|
||||
ap.add_argument('--dense_indices', help='逗号分隔的任务下标;回放实际轨迹,不依赖原 col 标记')
|
||||
ap.add_argument('--cert_indices', help='固定实际段的连续认证、加密对照和单段计时')
|
||||
ap.add_argument('--cert_segments', default='', help='额外指定任务号:零基段号,逗号分隔')
|
||||
ap.add_argument('--repeats', type=int, default=5)
|
||||
ap.add_argument('--max_step_deg', type=float, default=0.05)
|
||||
ap.add_argument('--samples', default='ml/data/samples')
|
||||
ap.add_argument('--split', default='val')
|
||||
ap.add_argument('--n', type=int, default=512)
|
||||
@@ -38,6 +282,26 @@ def main():
|
||||
ap.add_argument('--device', default='cuda' if torch.cuda.is_available() else 'cpu')
|
||||
ap.add_argument('--out', default=None)
|
||||
a = ap.parse_args()
|
||||
if a.dense_indices and a.cert_indices:
|
||||
ap.error('--dense_indices and --cert_indices are mutually exclusive')
|
||||
if a.cert_segments and not a.cert_indices:
|
||||
ap.error('--cert_segments requires --cert_indices')
|
||||
if a.trace:
|
||||
if a.cert_indices:
|
||||
extra = [tuple(map(int, segment.split(':'))) for segment in a.cert_segments.split(',') if segment]
|
||||
indices = [int(i) for i in a.cert_indices.split(',')]
|
||||
if any(len(segment) != 2 or segment[0] not in indices for segment in extra):
|
||||
ap.error('--cert_segments requires task:segment pairs from --cert_indices')
|
||||
replay_certificates(a.trace, indices, a.device, a.out, a.repeats, extra)
|
||||
elif a.dense_indices:
|
||||
replay_dense(a.trace, [int(i) for i in a.dense_indices.split(',')], a.max_step_deg, a.device, a.out)
|
||||
else:
|
||||
replay_first_hits(a.trace, a.out)
|
||||
return
|
||||
if a.dense_indices or a.cert_indices:
|
||||
ap.error('--dense_indices and --cert_indices require --trace')
|
||||
if not a.ckpt:
|
||||
ap.error('--ckpt or --trace is required')
|
||||
|
||||
ck = torch.load(a.ckpt, map_location=a.device)
|
||||
model = build(ck['cfg']).to(a.device)
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
"""小规模同步闭环评估;仿真墙钟不等于控制延迟。"""
|
||||
import argparse, functools, hashlib, json, math, time
|
||||
from pathlib import Path
|
||||
import torch
|
||||
|
||||
from ml.common.ckpt import load_policy
|
||||
from ml.common.kin_torch import Kin
|
||||
from ml.data import load_tasks
|
||||
from ml.sim.closed_loop import rollout, tasks_to_tensors
|
||||
import ml.sim.closed_loop as clmod
|
||||
|
||||
|
||||
def run(model, kin, tasks, device, bs=256, **kw):
|
||||
per = []
|
||||
for i in range(0, len(tasks), bs):
|
||||
t0 = time.perf_counter()
|
||||
print('batch %d-%d/%d start' % (i + 1, min(i + bs, len(tasks)), len(tasks)), flush=True)
|
||||
def progress(step, total):
|
||||
print('batch %d step %d/%d wall %.1fs' % (i // bs + 1, step, total, time.perf_counter() - t0), flush=True)
|
||||
r, p = rollout(model, kin, tasks[i:i + bs], device, progress=progress, **kw)
|
||||
per.append((r, p, len(tasks[i:i + bs])))
|
||||
print('batch %d done wall %.1fs' % (i // bs + 1, time.perf_counter() - t0), flush=True)
|
||||
flat = {k: torch.cat([p[k] for _, p, _ in per]) for k in per[0][1] if k not in ('traj', 'plans')}
|
||||
_, _, _, ex, tr = tasks_to_tensors(tasks, 'cpu')
|
||||
ok, col = flat['ok'], flat['col'] > 0
|
||||
has_ref = torch.isfinite(ex)
|
||||
okr = ok & has_ref & torch.isfinite(tr)
|
||||
median = lambda x: x.median().item() if x.numel() else None
|
||||
out = {
|
||||
'n': len(tasks), 'n_ref': int(has_ref.sum()),
|
||||
'success': ok.float().mean().item(),
|
||||
'collision_free_success': (ok & ~col).float().mean().item(),
|
||||
'time_ok_1p3': (ok & has_ref & (flat['t_done'] <= 1.3 * ex)).sum().item() / int(has_ref.sum()) if has_ref.any() else None,
|
||||
'collision_rate': col.float().mean().item(),
|
||||
'collision_steps_mean': flat['col'].mean().item(),
|
||||
'travel_ratio_median': median(flat['travel'][okr] / tr[okr].clamp(min=1)),
|
||||
'time_mean_s': flat['t_done'][ok].mean().item() if ok.any() else None,
|
||||
'brakes_mean': flat['brakes'].mean().item(),
|
||||
'start_fail': flat['start_fail'].float().mean().item(),
|
||||
'goal_ratio_2s': median(flat['goal_ratio_2s']),
|
||||
'err_fail_med': median(flat['err'][~ok]),
|
||||
'err_success_med': median(flat['err'][ok]),
|
||||
'dls_share': flat['dls_it'].ge(0).float().mean().item(),
|
||||
'time_budget': ('fixed %.3f s' % kw['max_sec']) if kw.get('max_sec') is not None else
|
||||
(per[0][0]['time_budget'] if len({r['time_budget'] for r, _, _ in per}) == 1 else 'mixed'),
|
||||
}
|
||||
if 'speed_ratio' in flat: # 实际执行速度:每题时限内 max|Δq|/STEP(1.0 = VMAX),加速度同口径按每控制步的速度变化
|
||||
v, acc = flat['speed_ratio'], flat['accel_ratio']
|
||||
out.update({'speed_ratio_p50': median(v), 'speed_ratio_p95': v.quantile(0.95).item(),
|
||||
'speed_ratio_max': v.max().item(), 'over_vmax_rate': (v > 1.001).float().mean().item(),
|
||||
'accel_ratio_p95': acc.quantile(0.95).item(), 'accel_ratio_max': acc.max().item()})
|
||||
return out, per
|
||||
|
||||
|
||||
def json_finite(value):
|
||||
if isinstance(value, dict): return {k: json_finite(v) for k, v in value.items()}
|
||||
if isinstance(value, list): return [json_finite(v) for v in value]
|
||||
if isinstance(value, float) and not math.isfinite(value): return None
|
||||
return value
|
||||
|
||||
|
||||
def main():
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument('--ckpt', default='ml/runs/base_dag2_dag1/best.pt')
|
||||
ap.add_argument('--samples', default='ml/data/samples')
|
||||
ap.add_argument('--tasks', default=None)
|
||||
ap.add_argument('--split', default='val')
|
||||
ap.add_argument('--n', type=int, default=256)
|
||||
ap.add_argument('--K', type=int, default=8)
|
||||
ap.add_argument('--commit', type=int, default=3)
|
||||
ap.add_argument('--fb', type=float, default=1.8)
|
||||
ap.add_argument('--ki', type=float, default=0.0)
|
||||
ap.add_argument('--fb_scale', type=float, default=0.0)
|
||||
ap.add_argument('--fb_near', type=float, default=0.2)
|
||||
ap.add_argument('--fb_fallback', type=float, default=0.0)
|
||||
ap.add_argument('--kdecay', type=float, default=0.9)
|
||||
ap.add_argument('--kimax', type=float, default=0.5)
|
||||
ap.add_argument('--fb_every', type=int, default=1)
|
||||
ap.add_argument('--safety_try', type=int, default=0)
|
||||
ap.add_argument('--sel_w', type=float, default=0.1)
|
||||
ap.add_argument('--dls_safety', type=int, default=0)
|
||||
ap.add_argument('--fb_clear', type=float, default=0.0)
|
||||
ap.add_argument('--fb_cmin', type=float, default=0.3)
|
||||
ap.add_argument('--sub_refresh', type=int, default=0)
|
||||
ap.add_argument('--fb_block_gain', type=float, default=1.0)
|
||||
ap.add_argument('--dump', default=None)
|
||||
ap.add_argument('--out', default=None)
|
||||
ap.add_argument('--trace', default=None)
|
||||
ap.add_argument('--select', default='consist')
|
||||
ap.add_argument('--replan', default='r3')
|
||||
ap.add_argument('--safety', type=int, default=1, help='1=安全层+部分前缀;0=关')
|
||||
ap.add_argument('--partial', type=int, default=1)
|
||||
ap.add_argument('--inc_cap', type=int, default=0, help='1=反馈叠加后再按每轴 VMAX·DT 限幅')
|
||||
ap.add_argument('--gap_margin', type=float, default=0.0, help='安全层要求的间隙余量 mm(>0 时宽相位 cap 自动抬到 margin+0.5)')
|
||||
ap.add_argument('--cert_batch', type=int, default=0, help='1=一次 gaps 调用覆盖全部候选(压最坏情况,典型路径略贵)')
|
||||
ap.add_argument('--max_sec', type=float, default=None)
|
||||
ap.add_argument('--seed', type=int, default=0)
|
||||
ap.add_argument('--dls', default='analytic', choices=['analytic', 'fd'])
|
||||
ap.add_argument('--device', default='cuda' if torch.cuda.is_available() else 'cpu')
|
||||
a = ap.parse_args()
|
||||
print('config ' + json.dumps(vars(a), ensure_ascii=False), flush=True)
|
||||
if a.dls == 'fd':
|
||||
clmod.dls_steps = functools.partial(clmod.dls_steps, analytic=False)
|
||||
model, ck = load_policy(a.ckpt, a.device)
|
||||
kin = Kin(device=a.device)
|
||||
assert ck.get('fp') in (None, kin.fp)
|
||||
tasks = ([json.loads(l) for l in open(a.tasks, encoding='utf-8') if l.strip()] if a.tasks
|
||||
else [t for t in load_tasks([a.samples]) if t['split'] == a.split])
|
||||
tasks = tasks[:a.n]
|
||||
if not tasks: ap.error('no tasks selected')
|
||||
meta = {
|
||||
'config': vars(a), 'batch_size': 256, 'batch_seed_rule': 'same seed per batch',
|
||||
'checkpoint_sha256': hashlib.sha256(Path(a.ckpt).read_bytes()).hexdigest(),
|
||||
'tasks_sha256': hashlib.sha256(json.dumps(tasks, sort_keys=True).encode()).hexdigest(),
|
||||
'kin_fp': kin.fp, 'act_scale': float(model.act_scale),
|
||||
}
|
||||
t0 = time.perf_counter()
|
||||
r, pers = run(model, kin, tasks, a.device, K=a.K, safety=bool(a.safety), seed=a.seed, max_sec=a.max_sec,
|
||||
safety_partial=(a.commit if (a.safety and a.partial) else 0), commit_n=a.commit,
|
||||
select=a.select, replan=a.replan, fb_gain=a.fb, fb_scale=a.fb_scale, fb_near=a.fb_near, fb_fallback=a.fb_fallback, fb_ki=a.ki, fb_decay=a.kdecay, fb_imax=a.kimax,
|
||||
fb_every=a.fb_every, safety_try=a.safety_try, sel_w=a.sel_w, dls_safety=a.dls_safety, fb_clear=a.fb_clear, fb_cmin=a.fb_cmin, sub_refresh=a.sub_refresh, fb_block_gain=a.fb_block_gain,
|
||||
inc_cap=a.inc_cap, gap_margin=a.gap_margin, cert_batch=a.cert_batch, return_traj=bool(a.trace))
|
||||
wall = time.perf_counter() - t0
|
||||
result = {**meta, 'metrics': r, 'simulation_wall_s': wall}
|
||||
print(json.dumps(json_finite(result), ensure_ascii=False, allow_nan=False), flush=True)
|
||||
if a.out:
|
||||
Path(a.out).write_text(json.dumps(json_finite(result), indent=2, ensure_ascii=False, allow_nan=False) + '\n', encoding='utf-8')
|
||||
if a.dump:
|
||||
rows = []
|
||||
keys = ['done', 'ok', 't_done', 'limit', 'col', 'brakes', 'err', 'first_hit', 'dls_it', 'goal_ratio_2s']
|
||||
flat = {k: torch.cat([p[k] for _, p, _ in pers]).tolist() for k in keys}
|
||||
for i, t in enumerate(tasks):
|
||||
rows.append({**t, 'i': i, **{k: flat[k][i] for k in keys}})
|
||||
Path(a.dump).write_text(json.dumps(json_finite(rows), allow_nan=False), encoding='utf-8')
|
||||
print('dump', a.dump, flush=True)
|
||||
if a.trace:
|
||||
torch.save({**meta, 'tasks': tasks, 'batches': pers}, a.trace)
|
||||
print('trace', a.trace, flush=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -144,6 +144,7 @@
|
||||
.ctlrow { display: flex; gap: 10px; margin-top: 14px; align-items: center; flex-wrap: wrap; }
|
||||
.ctlrow .hint { font-size: 12px; color: var(--dim2); }
|
||||
.term { background: #070a10; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; height: 260px; overflow: auto; font: 12px/1.55 var(--mono); color: #c9d4e3; white-space: pre-wrap; word-break: break-all; }
|
||||
.explore { background: #0b0f16; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; max-height: 560px; overflow: auto; font: 12px/1.7 var(--mono); color: #c9d4e3; white-space: pre-wrap; }
|
||||
.term .e { color: var(--bad); } .term .c { color: var(--accent); } .term .g { color: var(--ok); }
|
||||
.modal { position: fixed; inset: 0; background: #05080ed9; backdrop-filter: blur(7px); display: none; align-items: flex-start; justify-content: center; z-index: 40; padding: 5vh 16px 24px; overflow: auto; }
|
||||
.modal.show { display: flex; }
|
||||
@@ -213,6 +214,7 @@
|
||||
<div class="card"><h2><span>部署形态评测</span><span class="r">策略 + 安全层</span></h2><div id="bench"></div></div>
|
||||
<div class="card"><h2><span>验收汇总</span><span class="r">方案 §9.2</span></h2><div id="accept"></div></div>
|
||||
</section>
|
||||
<section class="card"><h2><span>闭环探索日志</span><span class="r">docs/探索日志.md</span></h2><div class="explore" id="explore">加载中…</div></section>
|
||||
<section class="card"><h2><span>终端输出</span><span class="r" id="termnote">ml/runs/console.log</span></h2><div class="term" id="term"></div></section>
|
||||
<footer id="foot"></footer>
|
||||
</main>
|
||||
@@ -834,6 +836,7 @@ $('logy').onclick = () => { logyOn = !logyOn; $('logy').classList.toggle('on', l
|
||||
for (const id of PREF_IDS) { $(id).onchange = prefSave; $(id).oninput = prefSave; }
|
||||
$('run').onchange = () => { userPicked = true; cur = null; poll(); };
|
||||
$('scenario').onchange = () => { api.scenario($('scenario').value); cur = null; userPicked = false; conOff = 0; $('run').innerHTML = ''; poll(); };
|
||||
api('/api/explore').then(d => { const el = $('explore'); el.textContent = (d && d.md) ? d.md : '(demo 模式:无探索日志)'; }).catch(() => { const el = $('explore'); el.textContent = '(无法读取 docs/探索日志.md)'; });
|
||||
$('auto').onclick = () => { const on = !$('auto').classList.contains('on'); $('auto').classList.toggle('on', on); clearInterval(timer); if (on) timer = setInterval(poll, 1000); };
|
||||
timer = setInterval(poll, 1000); poll();
|
||||
|
||||
|
||||
@@ -608,6 +608,11 @@ class H(BaseHTTPRequestHandler):
|
||||
if u.path == '/api/status': return self.send(200, json.dumps(status()), 'application/json')
|
||||
if u.path == '/api/job': return self.send(200, json.dumps(JOB.state()), 'application/json')
|
||||
if u.path == '/api/console': return self.send(200, json.dumps(console(int(q.get('offset', ['0'])[0]))), 'application/json')
|
||||
if u.path == '/api/explore': # 2026-10-20:闭环探索日志(docs/探索日志.md)回写控制台
|
||||
try:
|
||||
with open(os.path.join(ROOT, 'docs', '探索日志.md'), encoding='utf-8') as f: md = f.read()
|
||||
except Exception: md = ''
|
||||
return self.send(200, json.dumps({'md': md}), 'application/json')
|
||||
self.send(404, 'not found', 'text/plain')
|
||||
except Exception as e:
|
||||
self.send(500, json.dumps({'error': str(e)}), 'application/json')
|
||||
|
||||
+222
-35
@@ -48,23 +48,42 @@ def goal_err(kin, q, T, R):
|
||||
return e, oe
|
||||
|
||||
|
||||
def dls_steps(kin, q, T, R, n=3, scale=0.3, lam=0.5):
|
||||
"""局部 DLS 精修:n 步增量 [B,n,6]"""
|
||||
def execution_points(kin, q, increments):
|
||||
points, midpoints = [], []
|
||||
for delta in increments.unbind(1):
|
||||
nxt = kin.clamp_box(q + delta)
|
||||
midpoints.append(q + 0.5 * (nxt - q))
|
||||
points.append(nxt)
|
||||
q = nxt
|
||||
return torch.stack(points, 1), torch.stack(midpoints, 1)
|
||||
|
||||
|
||||
def dls_steps(kin, q, T, R, n=3, scale=0.3, lam=0.5, analytic=True):
|
||||
"""局部 DLS 精修:n 步增量 [B,n,6](analytic:几何雅可比,1 次 FK;否则 7 次批量有限差分)"""
|
||||
step = torch.tensor(STEP, device=q.device)
|
||||
B = q.shape[0]
|
||||
pose = (R.abs().sum(-1) > 0).float()
|
||||
Rt = R.view(-1, 3, 3)
|
||||
def err(x):
|
||||
xf = kin.cum_xf(x); p = kin.fk(x, xf); Rq = kin.orient(x, xf)
|
||||
M = Rt @ Rq.transpose(1, 2)
|
||||
rv = 0.5 * torch.stack([M[:, 2, 1] - M[:, 1, 2], M[:, 0, 2] - M[:, 2, 0], M[:, 1, 0] - M[:, 0, 1]], -1) * 100 * pose[:, None]
|
||||
return torch.cat([T - p, rv], -1)
|
||||
def err(x, Tb, Rtb, poseb, xf=None):
|
||||
xf = xf if xf is not None else kin.cum_xf(x)
|
||||
p = kin.fk(x, xf); Rq = kin.orient(x, xf)
|
||||
M = Rtb @ Rq.transpose(1, 2)
|
||||
rv = 0.5 * torch.stack([M[:, 2, 1] - M[:, 1, 2], M[:, 0, 2] - M[:, 2, 0], M[:, 1, 0] - M[:, 0, 1]], -1) * 100 * poseb[:, None]
|
||||
return torch.cat([Tb - p, rv], -1)
|
||||
out = []; x = q.clone()
|
||||
ar = torch.arange(6, device=q.device)
|
||||
for _ in range(n):
|
||||
e0 = err(x); J = []
|
||||
for j in range(6):
|
||||
dx = torch.zeros_like(x); dx[:, j] = 1e-3
|
||||
J.append(-(err(x + dx) - e0) / 1e-3)
|
||||
J = torch.stack(J, -1) # [B,6(err),6(q)]
|
||||
xf = kin.cum_xf(x)
|
||||
e0 = err(x, T, Rt, pose, xf)
|
||||
if analytic:
|
||||
# 几何角速度 Jw 仅在姿态误差接近零时等于该 skew 残差的负导数。
|
||||
Jv, Jw = kin.jac(x, xf)
|
||||
J = torch.cat([Jv, 100 * Jw * pose[:, None, None]], 1)
|
||||
else:
|
||||
dx = torch.zeros(B, 6, 6, device=q.device); dx[:, ar, ar] = 1e-3
|
||||
xp = (x[:, None, :] + dx).reshape(B * 6, 6)
|
||||
ep = err(xp, T.repeat_interleave(6, 0), Rt.repeat_interleave(6, 0), pose.repeat_interleave(6, 0))
|
||||
J = -((ep - e0.repeat_interleave(6, 0)) / 1e-3).view(B, 6, 6).transpose(1, 2) # [B,6(err),6(q)]
|
||||
A = J @ J.transpose(1, 2) + lam ** 2 * torch.eye(6, device=q.device)
|
||||
y = torch.linalg.solve(A, e0.unsqueeze(-1))
|
||||
dq = (J.transpose(1, 2) @ y).squeeze(-1)
|
||||
@@ -141,17 +160,24 @@ class TeacherOracle:
|
||||
|
||||
@torch.no_grad()
|
||||
def rollout(model, kin, tasks, device, K=8, safety=False, seed=0, max_sec=None, return_traj=False, use_sub=True, sub_override=None,
|
||||
qp0=None, steps=1, z_scale=1.0, select='consist', oracle=None, replan='r3', sub_rule='cross'):
|
||||
qp0=None, steps=1, z_scale=1.0, select='consist', oracle=None, replan='r3', sub_rule='cross',
|
||||
fb_gain=0.0, fb_scale=0.0, fb_near=0.2, fb_fallback=0.0, safety_partial=0, commit_n=3, collect=None,
|
||||
fb_exec=0.0, exec_safety=0, fb_ki=0.0, fb_decay=0.9, fb_imax=0.5, fb_every=1, safety_try=0, sel_w=0.1, dls_safety=0, fb_clear=0.0, fb_cmin=0.3, sub_refresh=0, fb_block_gain=1.0,
|
||||
inc_cap=0, gap_margin=0.0, cert_batch=0, progress=None):
|
||||
"""use_sub=False:不用子目标(sf=0);sub_override=(subs [B,M,6] 绝对关节角, n [B] 个数 或 need [B] bool):冷启动时用给定途经点代替子目标头;
|
||||
qp0 [B,6]:起点的上一帧(默认 = q0,即静止起步)。steps:MeanFlow 采样段数;z_scale:噪声缩放;
|
||||
select:consist(部署口径:冷启动价值前瞻、之后与上一条已提交计划的一致性)/ value(每次都价值前瞻)/ first(不选,取第 0 条)。
|
||||
oracle:TeacherOracle,代替 model 出动作(model 可为 None,须配 select='first'、use_sub=False)。
|
||||
replan:'r3'(部署:队列 ≤ 3 步就规划,稳态 r=3)/ 'empty'(队列空了才规划,每次 r=0,前缀消融用)。
|
||||
sub_rule:子目标推进规则,见 sub_advance。除默认值外均为诊断用。"""
|
||||
sub_rule:子目标推进规则,见 sub_advance。除默认值外均为诊断用。
|
||||
inc_cap=1:把「策略动作 + 目标反馈」的合计增量再按每轴 VMAX·DT 限一次幅(默认关;关时反馈是在 ±1 限幅之后叠加的,第30轮实测最大 1.66×VMAX)。
|
||||
gap_margin>0:安全层要求间隙大于该毫米余量而不是 >0;宽相位 cap 自动抬到 margin+0.5,否则 0.5 的截顶值会让余量门限恒假。
|
||||
两者默认值下行为与第32轮逐位相同。"""
|
||||
g = torch.Generator(device=device); g.manual_seed(seed)
|
||||
q0, T, R, ex, tr = tasks_to_tensors(tasks, device)
|
||||
B = q0.shape[0]
|
||||
step = torch.tensor(STEP, device=device)
|
||||
gcap = max(0.5, gap_margin + 0.5) # 余量门限必须落在截顶值之内才有意义
|
||||
act_scale = oracle.act_scale if oracle is not None else float(getattr(model, 'act_scale', 1.0))
|
||||
astep = step * act_scale # 动作反归一化:每单位 act 对应的度数
|
||||
has_ref = torch.isfinite(ex)
|
||||
@@ -160,12 +186,18 @@ def rollout(model, kin, tasks, device, K=8, safety=False, seed=0, max_sec=None,
|
||||
q, qp = q0.clone(), (qp0.to(device) if qp0 is not None else q0.clone())
|
||||
queue = torch.zeros(B, 0, 6, device=device)
|
||||
last = None; last_ok = torch.zeros(B, dtype=torch.bool, device=device)
|
||||
fb_i = torch.zeros(B, 6, device=device) # 积分项:累积持续同向的目标反馈(慢变偏差)
|
||||
fb_cache = None; pit = 0 # fb_every>1:复用上一次规划的目标反馈(误差方向慢变)
|
||||
last_brake = torch.zeros(B, dtype=torch.bool, device=device)
|
||||
subs = torch.zeros(B, 2, 6, device=device); nsub = torch.zeros(B, dtype=torch.long, device=device)
|
||||
sub_t = torch.zeros(B, device=device); sub_prev = q0.clone()
|
||||
done = torch.zeros(B, dtype=torch.bool, device=device); t_done = torch.full((B,), float('nan'), device=device)
|
||||
col = torch.zeros(B, device=device); travel = torch.zeros(B, device=device); brakes = torch.zeros(B, device=device)
|
||||
first_hit = torch.full((B,), float('nan'), device=device); dls_it = torch.full((B,), -1, dtype=torch.long, device=device)
|
||||
# 2026-10-20(轮次33):速度/加速度按「实际执行位移」算,不看指令——第30轮证明反馈是在限幅之后叠加的
|
||||
vratio = torch.zeros(B, device=device); aratio = torch.zeros(B, device=device); prev_exec = torch.zeros(B, 6, device=device)
|
||||
traj = [q.clone()] if return_traj else None
|
||||
plans = {k: [] for k in ('it', 'qe', 'commit', 'points', 'midpoints', 'gaps', 'certified')} if return_traj else None
|
||||
n_start = int(round(0.5 / DT)); moved_start = None # R2 起步失败:0.5 s 内关节总行程 < 1°
|
||||
k2s = int(round(2.0 / DT)); e2 = None
|
||||
e0, _ = goal_err(kin, q0, T, R)
|
||||
@@ -177,8 +209,12 @@ def rollout(model, kin, tasks, device, K=8, safety=False, seed=0, max_sec=None,
|
||||
tnow = it * DT
|
||||
if (queue.shape[1] <= 3) if replan == 'r3' else (queue.shape[1] == 0):
|
||||
r = queue.shape[1]
|
||||
pre = torch.zeros(B, 3, 6, device=device); pre[:, :r] = queue[:, :r]
|
||||
qe = q + queue.sum(1)
|
||||
pre = torch.zeros(B, 3, 6, device=device)
|
||||
qe = q
|
||||
if r:
|
||||
prefix_points, _ = execution_points(kin, q, queue)
|
||||
pre[:, :r] = prefix_points - torch.cat([q[:, None], prefix_points[:, :-1]], 1)
|
||||
qe = prefix_points[:, -1]
|
||||
e, oe = goal_err(kin, qe, T, R)
|
||||
near = (e < 5) & ((R.abs().sum(-1) == 0) | (oe < 5))
|
||||
subs, nsub, sub_prev, sub_t = sub_advance(kin, subs, nsub, sub_prev, sub_t, qe, tnow, sub_rule)
|
||||
@@ -189,7 +225,43 @@ def rollout(model, kin, tasks, device, K=8, safety=False, seed=0, max_sec=None,
|
||||
else:
|
||||
z = torch.randn(B * K, H, 6, device=device, generator=g) * z_scale
|
||||
act, val, sub = model.sample_k(feat, K, z, steps=steps)
|
||||
if sub_refresh and not cold: # 子目标头作为反应式规划:没有待走途经点时,用当前状态的预测补一个(训练标签在每个状态都有 sub)
|
||||
need = sub[:, 12] > 0.5
|
||||
newsubs = q[:, None] + sub[:, :12].float().view(B, 2, 6) * 180
|
||||
rf = need & (nsub <= 0)
|
||||
subs = torch.where(rf[:, None, None], newsubs, subs)
|
||||
nsub = torch.where(rf, torch.full_like(nsub, 2), nsub)
|
||||
sub_prev = torch.where(rf[:, None], q, sub_prev)
|
||||
sub_t = torch.where(rf, torch.full_like(sub_t, tnow), sub_t)
|
||||
inc = act.float().clamp(-1, 1) * astep
|
||||
if fb_gain > 0: # 实验(2026-10-20):目标反馈加在所有候选上(安全层也评估带反馈的候选)
|
||||
if fb_cache is None or fb_every <= 1 or pit % fb_every == 0:
|
||||
fb = dls_steps(kin, qe, T, R, n=1); fb_cache = fb
|
||||
else:
|
||||
fb = fb_cache
|
||||
pit += 1
|
||||
gm_ = None
|
||||
if fb_clear > 0: # 近障碍衰减:反馈方向可能把候选推进障碍,贴近时让模型自己的绕行占主导
|
||||
dgc = kin.gaps(qe, fb_clear)['gm'].min(-1).values
|
||||
gm_ = torch.clamp(dgc / fb_clear, fb_cmin, 1.0)
|
||||
if fb_ki > 0:
|
||||
fb_i = fb_decay * fb_i + fb[:, 0] * (~done)[:, None]
|
||||
lim = step * fb_imax
|
||||
fb_i = fb_i.clamp(-lim, lim)
|
||||
inc = inc + fb_gain * fb[:, :, None, :] + fb_ki * fb_i[:, None, None, :]
|
||||
elif fb_scale > 0: # 距离衰减:远离目标全增益,贴近目标减弱(减少过冲/刹停)
|
||||
dg, _ = goal_err(kin, qe, T, R)
|
||||
gdec = fb_gain * torch.clamp(dg / fb_scale, fb_near, 1.0)
|
||||
if gm_ is not None: gdec = gdec * gm_
|
||||
inc = inc + gdec[:, None, None, None] * fb[:, :, None, :]
|
||||
else:
|
||||
gv = torch.full((B,), fb_gain, device=device, dtype=fb.dtype)
|
||||
if gm_ is not None: gv = gv * gm_
|
||||
if fb_block_gain != 1.0: # 上一次被安全层全拒:减弱目标反馈,让模型自己的绕行候选有机会通过认证
|
||||
gv = torch.where(last_brake, gv * fb_block_gain, gv)
|
||||
inc = inc + gv[:, None, None, None] * fb[:, :, None, :]
|
||||
if inc_cap:
|
||||
inc = torch.maximum(torch.minimum(inc, step), -step) # 反馈之后才限幅:限的是真正要执行的每轴增量
|
||||
if cold:
|
||||
need = sub[:, 12] > 0.5
|
||||
subs = q[:, None] + sub[:, :12].float().view(B, 2, 6) * 180
|
||||
@@ -206,6 +278,16 @@ def rollout(model, kin, tasks, device, K=8, safety=False, seed=0, max_sec=None,
|
||||
fut = qe[:, None, None] + torch.cumsum(inc[:, :, r:], 2) # [B,K,H-r,6]
|
||||
if select == 'first':
|
||||
score = torch.zeros(B, K, device=device); score[:, 0] = 1
|
||||
elif select in ('endpoint', 'adapt'):
|
||||
qa = fut[:, :, -1].reshape(B * K, 6)
|
||||
e_end, _ = goal_err(kin, qa, T.repeat_interleave(K, 0), R.repeat_interleave(K, 0))
|
||||
score = -e_end.view(B, K)
|
||||
if select == 'adapt' and last is not None:
|
||||
n = min(fut.shape[2], last.shape[1] - (commit_n + 1))
|
||||
w = 0.85 ** torch.arange(n, device=device, dtype=torch.float32)
|
||||
d2 = (((fut[:, :, :n] - last[:, None, commit_n + 1:commit_n + 1 + n]) / step) ** 2).sum(-1)
|
||||
sc = torch.where(last_ok[:, None], -(d2 * w).sum(-1), torch.zeros_like(d2[..., 0]))
|
||||
score = torch.where(last_brake[:, None], sc, score)
|
||||
elif cold or select == 'value':
|
||||
# 短前瞻:候选末态的价值
|
||||
qa = fut[:, :, -1].reshape(B * K, 6); qb = fut[:, :, -2].reshape(B * K, 6)
|
||||
@@ -216,37 +298,132 @@ def rollout(model, kin, tasks, device, K=8, safety=False, seed=0, max_sec=None,
|
||||
else:
|
||||
# 2026-10-19 修错位:last[i] = 上一计划从 qe_old 走 i 步后的位置;提交 3 步后 qe_new = last[3],
|
||||
# 新候选 fut[0] 是 qe_new 再走 1 步 = 对应 last[4]。JS 部署(ik-policy.js)同一处同样修正。
|
||||
n = min(fut.shape[2], last.shape[1] - 4)
|
||||
n = min(fut.shape[2], last.shape[1] - (commit_n + 1))
|
||||
w = 0.85 ** torch.arange(n, device=device, dtype=torch.float32)
|
||||
d2 = (((fut[:, :, :n] - last[:, None, 4:4 + n]) / step) ** 2).sum(-1)
|
||||
d2 = (((fut[:, :, :n] - last[:, None, commit_n + 1:commit_n + 1 + n]) / step) ** 2).sum(-1)
|
||||
# 2026-10-19(审查 review_closedloop F5):上一次是刹停或 DLS 接管的行没有「已提交计划」,
|
||||
# 与 JS(lastPlan = null → 一致性项缺席、各候选同分 → 取第 0 条)一致:同分,稳定排序取第 0 条
|
||||
score = torch.where(last_ok[:, None], -(d2 * w).sum(-1), torch.zeros_like(d2[..., 0]))
|
||||
if select == 'mix': # 一致性 + 端点进度(w=sel_w/mm)
|
||||
qa = fut[:, :, -1].reshape(B * K, 6)
|
||||
e_end, _ = goal_err(kin, qa, T.repeat_interleave(K, 0), R.repeat_interleave(K, 0))
|
||||
score = score - sel_w * e_end.view(B, K)
|
||||
order = torch.sort(score, dim=-1, descending=True, stable=True).indices
|
||||
pick = order[:, 0]
|
||||
commit = inc[ar, pick, r:r + 3]
|
||||
if select == 'average': # 2026-10-20:候选平均(平滑误差)——所有候选置为 K 条动作的均值
|
||||
inc = inc.mean(1, keepdim=True).expand_as(inc).contiguous()
|
||||
K_eff = 1
|
||||
else:
|
||||
K_eff = K
|
||||
commit = inc[ar, pick, r:r + commit_n]
|
||||
if collect is not None: # 反馈蒸馏:收集与部署完全一致的 (特征, 复合动作=模型输出+目标反馈)
|
||||
collect.append((feat.detach().float().cpu(), inc[ar, pick].detach().float().cpu()))
|
||||
committed = torch.ones(B, dtype=torch.bool, device=device)
|
||||
if safety:
|
||||
ok_any = torch.zeros(B, dtype=torch.bool, device=device)
|
||||
chosen = torch.zeros(B, 3, 6, device=device); chosen_k = pick.clone()
|
||||
for kk in range(K):
|
||||
ck = inc[ar, order[:, kk], r:r + 3]
|
||||
pts = qe[:, None] + torch.cumsum(ck, 1)
|
||||
mids = torch.cat([qe[:, None], pts[:, :-1]], 1) + 0.5 * ck
|
||||
braked = torch.zeros(B, dtype=torch.bool, device=device)
|
||||
if return_traj:
|
||||
cert_pts = torch.full((B, commit_n, 6), float('nan'), device=device)
|
||||
cert_mids = cert_pts.clone()
|
||||
cert_gaps = torch.full((B, 2 * commit_n), float('nan'), device=device)
|
||||
certified = torch.zeros(B, commit_n, dtype=torch.bool, device=device)
|
||||
if safety and safety_partial: # 2026-10-20:允许「部分安全前缀」——执行到第一个不安全步为止,而不是全拒刹停
|
||||
maxlen = torch.zeros(B, dtype=torch.long, device=device)
|
||||
chosen = torch.zeros(B, commit_n, 6, device=device); chosen_k = pick.clone()
|
||||
ntry = min(K_eff, safety_try) if safety_try > 0 else K_eff
|
||||
if cert_batch: # 一次 gaps 覆盖全部候选:典型路径略贵,但把「前面候选被拒→串行调用 K 次」的最坏情况封成 1 次
|
||||
cks = inc[ar[:, None], order[:, :ntry], r:r + commit_n].reshape(B * ntry, commit_n, 6)
|
||||
pts, mids = execution_points(kin, qe.repeat_interleave(ntry, 0), cks)
|
||||
gaps6 = kin.gaps(torch.cat([pts, mids], 1).reshape(-1, 6), gcap)['gm'].min(-1).values.view(B, ntry, 2 * commit_n)
|
||||
plen = torch.cumprod(((gaps6 > gap_margin)[:, :, :commit_n] &
|
||||
(gaps6 > gap_margin)[:, :, commit_n:]).long(), -1).sum(-1)
|
||||
maxlen = plen.max(-1).values
|
||||
best = plen.argmax(-1) # 与串行同口径:严格更大者胜 ⇒ 首个最大值
|
||||
chosen = cks.view(B, ntry, commit_n, 6)[ar, best]
|
||||
chosen_k = order[ar, best]
|
||||
if return_traj:
|
||||
cert_pts = pts.view(B, ntry, commit_n, 6)[ar, best]
|
||||
cert_mids = mids.view(B, ntry, commit_n, 6)[ar, best]
|
||||
cert_gaps = gaps6[ar, best]
|
||||
else:
|
||||
for kk in range(ntry):
|
||||
ck = inc[ar, order[:, kk], r:r + commit_n]
|
||||
pts, mids = execution_points(kin, qe, ck)
|
||||
allq = torch.cat([pts, mids], 1).reshape(-1, 6)
|
||||
okk = (kin.gaps(allq, 0.5)['gm'].min(-1).values > 0).view(B, 6).all(-1)
|
||||
gaps6 = kin.gaps(allq, gcap)['gm'].min(-1).values.view(B, 2 * commit_n)
|
||||
ok6 = gaps6 > gap_margin
|
||||
okstep = ok6[:, :commit_n] & ok6[:, commit_n:]
|
||||
plen = torch.cumprod(okstep.long(), 1).sum(1)
|
||||
take = plen > maxlen
|
||||
chosen = torch.where(take[:, None, None], ck, chosen); chosen_k = torch.where(take, order[:, kk], chosen_k)
|
||||
if return_traj:
|
||||
cert_pts = torch.where(take[:, None, None], pts, cert_pts)
|
||||
cert_mids = torch.where(take[:, None, None], mids, cert_mids)
|
||||
cert_gaps = torch.where(take[:, None], gaps6, cert_gaps)
|
||||
maxlen = torch.maximum(maxlen, plen)
|
||||
if B == 1 and int(maxlen[0]) >= commit_n: break # 实时单题:首个全安全候选即停(安全层 16 点→2-4 点)
|
||||
msk = (torch.arange(commit_n, device=device)[None] < maxlen[:, None])
|
||||
commit = torch.where(msk[..., None], chosen, torch.zeros_like(chosen))
|
||||
if return_traj: certified = msk.clone()
|
||||
brakes += (maxlen == 0).float(); braked = maxlen == 0
|
||||
pick = chosen_k; committed = maxlen > 0
|
||||
elif safety:
|
||||
ok_any = torch.zeros(B, dtype=torch.bool, device=device)
|
||||
chosen = torch.zeros(B, commit_n, 6, device=device); chosen_k = pick.clone()
|
||||
ntry = min(K_eff, safety_try) if safety_try > 0 else K_eff
|
||||
for kk in range(ntry):
|
||||
ck = inc[ar, order[:, kk], r:r + commit_n]
|
||||
pts, mids = execution_points(kin, qe, ck)
|
||||
allq = torch.cat([pts, mids], 1).reshape(-1, 6)
|
||||
gaps6 = kin.gaps(allq, gcap)['gm'].min(-1).values.view(B, 2 * commit_n)
|
||||
okk = (gaps6 > gap_margin).all(-1)
|
||||
take = okk & ~ok_any
|
||||
chosen = torch.where(take[:, None, None], ck, chosen); chosen_k = torch.where(take, order[:, kk], chosen_k); ok_any |= okk
|
||||
if return_traj:
|
||||
cert_pts = torch.where(take[:, None, None], pts, cert_pts)
|
||||
cert_mids = torch.where(take[:, None, None], mids, cert_mids)
|
||||
cert_gaps = torch.where(take[:, None], gaps6, cert_gaps)
|
||||
commit = torch.where(ok_any[:, None, None], chosen, torch.zeros_like(chosen))
|
||||
brakes += (~ok_any).float()
|
||||
if return_traj: certified = ok_any[:, None].expand(-1, commit_n).clone()
|
||||
brakes += (~ok_any).float(); braked = ~ok_any
|
||||
pick = chosen_k; committed = ok_any
|
||||
if safety and fb_gain > 0 and fb_fallback > 0:
|
||||
fbcom = torch.zeros(B, commit_n, 6, device=device)
|
||||
fbcom[:, :1] = dls_steps(kin, qe, T, R, n=1) * fb_fallback
|
||||
pts, mids = execution_points(kin, qe, fbcom)
|
||||
allq = torch.cat([pts, mids], 1).reshape(-1, 6)
|
||||
gaps6 = kin.gaps(allq, gcap)['gm'].min(-1).values.view(B, 2 * commit_n)
|
||||
takef = braked & (gaps6 > gap_margin).all(-1)
|
||||
commit = torch.where(takef[:, None, None], fbcom, commit)
|
||||
if return_traj:
|
||||
cert_pts = torch.where(takef[:, None, None], pts, cert_pts)
|
||||
cert_mids = torch.where(takef[:, None, None], mids, cert_mids)
|
||||
cert_gaps = torch.where(takef[:, None], gaps6, cert_gaps)
|
||||
certified = certified | takef[:, None]
|
||||
if near.any():
|
||||
ref = dls_steps(kin, qe, T, R)
|
||||
commit = torch.where(near[:, None, None], ref, commit)
|
||||
dls_it = torch.where(near & (dls_it < 0), torch.full_like(dls_it, it), dls_it)
|
||||
committed = committed & ~near
|
||||
ref = dls_steps(kin, qe, T, R, n=commit_n)
|
||||
take = near
|
||||
if dls_safety and safety: # 2026-10-20:近目标 DLS 接管也要过安全层(部署端 _certCommit 本来就会验;不过则退回候选计划)
|
||||
pts, mids = execution_points(kin, qe, ref)
|
||||
allq = torch.cat([pts, mids], 1).reshape(-1, 6)
|
||||
gaps6 = kin.gaps(allq, gcap)['gm'].min(-1).values.view(B, 2 * commit_n)
|
||||
okd = (gaps6 > gap_margin).all(-1)
|
||||
take = near & okd
|
||||
if return_traj:
|
||||
cert_pts = torch.where(take[:, None, None], pts, cert_pts)
|
||||
cert_mids = torch.where(take[:, None, None], mids, cert_mids)
|
||||
cert_gaps = torch.where(take[:, None], gaps6, cert_gaps)
|
||||
if return_traj:
|
||||
certified = torch.where(take[:, None], torch.full_like(certified, bool(dls_safety and safety)), certified)
|
||||
commit = torch.where(take[:, None, None], ref, commit)
|
||||
dls_it = torch.where(take & (dls_it < 0), torch.full_like(dls_it, it), dls_it)
|
||||
committed = committed & ~take
|
||||
# 2026-10-19(F5):last 记真正提交的那条候选(安全层换了候选时是换后的那条);刹停 / DLS 接管的行无效
|
||||
last = torch.cat([qe[:, None], fut[ar, pick]], 1); last_ok = committed
|
||||
if fb_ki > 0: # 刹停/精修接管时清积分(防止原地累积到限幅后突然冲出去)
|
||||
fb_i = torch.where(committed[:, None], fb_i, torch.zeros_like(fb_i))
|
||||
last = torch.cat([qe[:, None], fut[ar, pick]], 1); last_ok = committed; last_brake = braked
|
||||
if return_traj:
|
||||
plans['it'].append(it + r)
|
||||
for key, value in (('qe', qe), ('commit', commit), ('points', cert_pts), ('midpoints', cert_mids), ('gaps', cert_gaps), ('certified', certified)):
|
||||
plans[key].append(value)
|
||||
queue = torch.cat([queue, commit], 1)
|
||||
cold = False
|
||||
d = queue[:, 0]; queue = queue[:, 1:]
|
||||
@@ -264,10 +441,17 @@ def rollout(model, kin, tasks, device, K=8, safety=False, seed=0, max_sec=None,
|
||||
hit = ((gm[:B] <= 0) | (gm[B:] <= 0)) & ~done & (tn <= limit + 1e-6)
|
||||
col += hit.float()
|
||||
first_hit = torch.where(hit & torch.isnan(first_hit), torch.full_like(first_hit, tn), first_hit)
|
||||
act_ = ((~done) & (tn <= limit + 1e-6)).float() # 只计自己时限内的移动(与 col 同口径)
|
||||
exec_d = (q - qp).abs()
|
||||
vratio = torch.maximum(vratio, (exec_d / step).max(-1).values * act_) # 实际速度 / VMAX
|
||||
aratio = torch.maximum(aratio, ((exec_d - prev_exec) / step).max(-1).values * act_) # 每控制步的速度变化 / VMAX
|
||||
prev_exec = exec_d
|
||||
e, oe = goal_err(kin, q, T, R)
|
||||
if it + 1 == k2s: e2 = e.clone()
|
||||
newly = (~done) & (e < 1) & (oe < 0.5)
|
||||
t_done = torch.where(newly, torch.full_like(t_done, tn), t_done); done |= newly
|
||||
if progress is not None and (it == 0 or (it + 1) % 50 == 0 or it + 1 == nmax):
|
||||
progress(it + 1, nmax)
|
||||
if done.all(): break
|
||||
ok = done & (t_done <= limit + 1e-6)
|
||||
if moved_start is None: moved_start = travel.clone()
|
||||
@@ -282,14 +466,17 @@ def rollout(model, kin, tasks, device, K=8, safety=False, seed=0, max_sec=None,
|
||||
'travel_ratio_median': (travel[okr] / tr[okr].clamp(min=1)).median().item() if okr.any() else None,
|
||||
'time_mean_s': t_done[ok].mean().item() if ok.any() else None, 'brakes_mean': brakes.mean().item(),
|
||||
'start_fail': start_fail.float().mean().item(), 'goal_ratio_2s': ratio2.median().item(),
|
||||
'speed_ratio_mean': vratio.mean().item(), 'over_vmax_rate': (vratio > 1.001).float().mean().item(),
|
||||
'time_budget': 'teacher×2(≥3 s)' if bool(has_ref.all()) else ('fixed %.0f s' % (max_sec or NOREF_SEC) if not has_ref.any() else 'mixed')}
|
||||
# 绕行侧:J1 累计位移的正向/负向极值哪个更大(+1 / −1),供 R7 左右比例门禁
|
||||
# 首次方向;全程没偏离到 FIRST_DEG 的(基本不绕 J1)退回净方向
|
||||
side = torch.where(j1_first != 0, j1_first, torch.where(j1_max >= -j1_min, torch.ones_like(j1_max), -torch.ones_like(j1_max)))
|
||||
per = {'done': done.cpu(), 'ok': ok.cpu(), 't_done': t_done.cpu(), 'limit': limit.cpu(), 'col': col.cpu(), 'travel': travel.cpu(), 'err': e_end.cpu(),
|
||||
'side': side.cpu(), 'start_fail': start_fail.cpu(), 'brakes': brakes.cpu(), 'first_hit': first_hit.cpu(), 'dls_it': dls_it.cpu(),
|
||||
'goal_ratio_2s': ratio2.cpu()}
|
||||
if return_traj: per['traj'] = torch.stack(traj, 1).cpu()
|
||||
'goal_ratio_2s': ratio2.cpu(), 'speed_ratio': vratio.cpu(), 'accel_ratio': aratio.cpu()}
|
||||
if return_traj:
|
||||
per['traj'] = torch.stack(traj, 1).cpu()
|
||||
per['plans'] = {k: torch.tensor(v) if k == 'it' else torch.stack(v, 1).cpu() for k, v in plans.items()}
|
||||
return res, per
|
||||
|
||||
|
||||
|
||||
+2
-1
@@ -73,6 +73,7 @@ def main():
|
||||
ap.add_argument('--config', default='ml/configs/base.json'); ap.add_argument('--steps', type=int, default=None)
|
||||
ap.add_argument('--resume', default=None); ap.add_argument('--no-eval', action='store_true')
|
||||
ap.add_argument('--init', default=None, help='只载入权重(优先 EMA)、优化器与步数从 0 开始(DAgger 微调用)')
|
||||
ap.add_argument('--freeze-enc', action='store_true', help='冻结编码器(enc + enc_norm),只微调解码器/头')
|
||||
ap.add_argument('--lr', type=float, default=None); ap.add_argument('--warmup', type=int, default=None)
|
||||
ap.add_argument('--stop-at', type=int, default=0, help='自检用:跑到第 N 步按停止请求处理(存 last.pt、rc 143)')
|
||||
ap.add_argument('--device', default='cuda' if torch.cuda.is_available() else 'cpu'); ap.add_argument('--seed', type=int, default=0)
|
||||
@@ -106,7 +107,7 @@ def main():
|
||||
print(f'train samples {data.n}, val tasks {len(val_tasks)}, act_scale {act_scale}, data_ver {data.data_ver}, device {dev}', flush=True)
|
||||
model = build(cfg).to(dev); model.act_scale = act_scale
|
||||
print(f'params {sum(p.numel() for p in model.parameters()) / 1e6:.2f} M', flush=True)
|
||||
opt = torch.optim.AdamW(model.parameters(), lr=tc['lr'], betas=tuple(tc['betas']), weight_decay=tc['wd'])
|
||||
opt = torch.optim.AdamW([p_ for p_ in model.parameters() if p_.requires_grad], lr=tc['lr'], betas=tuple(tc['betas']), weight_decay=tc['wd'])
|
||||
step0, best, bad_evals = 0, -1.0, 0
|
||||
def check_scale(ck, src):
|
||||
s0 = float(ck.get('act_scale', 1.0))
|
||||
|
||||
@@ -14,7 +14,7 @@ const fs = require('fs'), path = require('path');
|
||||
const argv = process.argv.slice(2);
|
||||
const flag = k => argv.includes(k);
|
||||
const opt = k => { const i = argv.indexOf(k); return i >= 0 ? argv[i + 1] : null; };
|
||||
const VALOPT = new Set(['--out', '--nc-n', '--route-n', '--r8-n']);
|
||||
const VALOPT = new Set(['--out', '--nc-n', '--route-n', '--r8-n', '--fb', '--commit', '--seg', '--proj', '--select']);
|
||||
const pos = argv.filter((a, i) => !a.startsWith('--') && !(i > 0 && VALOPT.has(argv[i - 1])));
|
||||
const MODEL = pos[0] || path.join(__dirname, '../webapp/models/traj_policy.onnx');
|
||||
const SETS = (pos[1] || 'nc,route').split(',').concat(flag('--nc1000') ? ['nc1000'] : []);
|
||||
@@ -66,12 +66,12 @@ const pct = (a, p) => { if (!a.length) return null; const s = a.slice().sort((x,
|
||||
const cert = POL.makeCert(S, {});
|
||||
const out = { model: MODEL, meta: { fp: meta.fp, eval: meta.eval } };
|
||||
const runSet = async (name, cases, mode) => {
|
||||
let ok = 0, reached = 0, colTasks = 0, colFrames = 0, uncert = 0, brakes = 0, locks = 0, plans = 0, recovered = 0, lockTasks = 0, livelock = 0;
|
||||
let ok = 0, reached = 0, colTasks = 0, colFrames = 0, uncert = 0, brakes = 0, locks = 0, plans = 0, recovered = 0, lockTasks = 0, livelock = 0, starve = 0;
|
||||
const inf = [], saf = [], look = [], planT = [], planW = [], cq = [], times = [], fails = []; let hits = 0; const why = {};
|
||||
for (let ci = 0; ci < cases.length; ci++) {
|
||||
const c = cases[ci];
|
||||
const R = mode === 'pose' ? c.R : null;
|
||||
const r = new POL.Runner(S, infer, { seed: 1000 + ci, actScale: meta.act_scale || 1 }); // 2026-10-19:动作尺度随模型
|
||||
const r = new POL.Runner(S, infer, { seed: 1000 + ci, actScale: meta.act_scale || 1, fbGain: +opt('--fb') || 0, commit: Math.max(1, +opt('--commit') || 3), segCert: opt('--seg') !== '0', projMax: opt('--proj') === '0' ? 0 : 0.5, select: opt('--select') || 'consist' }); // 2026-10-19:动作尺度随模型
|
||||
r.reset(c.q0); r.setGoal(c.T, R);
|
||||
let prev = c.q0.slice(), cf = 0, tLock = null;
|
||||
for (let k = 0; k < 500 && !r.done; k++) {
|
||||
@@ -86,14 +86,14 @@ const pct = (a, p) => { if (!a.length) return null; const s = a.slice().sort((x,
|
||||
const { e, oe } = r.err(r.q);
|
||||
const rc = r.done && e < 1 && oe < 0.5;
|
||||
if (rc) reached++; if (cf) { colTasks++; colFrames += cf; } if (rc && !cf) { ok++; times.push(r.t); } else fails.push({ ci, err: +e.toFixed(1), oerr: +oe.toFixed(1), colFrames: cf, brakes: r.stats.brakes });
|
||||
inf.push(...r.stats.inferMs); saf.push(...r.stats.safetyMs); look.push(...r.stats.lookaheadMs); planT.push(...r.stats.planMs); planW.push(...r.stats.planWarmMs); cq.push(...r.stats.certQ); hits += r.stats.certHit;
|
||||
inf.push(...r.stats.inferMs); saf.push(...r.stats.safetyMs); look.push(...r.stats.lookaheadMs); planT.push(...r.stats.planMs); planW.push(...r.stats.planWarmMs); starve += r.stats.starveTicks || 0; cq.push(...r.stats.certQ); hits += r.stats.certHit;
|
||||
for (const k in r.stats.certWhy) why[k] = (why[k] || 0) + r.stats.certWhy[k]; brakes += r.stats.brakes; locks += r.stats.locks; plans += r.stats.plans;
|
||||
if (tLock != null) { lockTasks++; if (rc && !cf && r.t - tLock <= 3.0) recovered++; } else if (rc && !cf) recovered++;
|
||||
if (!rc && r.stats.locks >= 2) livelock++;
|
||||
if ((ci + 1) % 50 === 0) process.stderr.write(`${name} ${ci + 1}/${cases.length}\n`);
|
||||
}
|
||||
out[name] = { n: cases.length, ok, reached, collisionTasks: colTasks, collisionFrames: colFrames, uncertifiedSegs: uncert, brakes, locks,
|
||||
plans, brakeRate: plans ? +(brakes / plans).toFixed(4) : null, lockTasks, recovered3s: recovered, recoveryRate: cases.length ? +(recovered / cases.length).toFixed(4) : null, livelock,
|
||||
plans, brakeRate: plans ? +(brakes / plans).toFixed(4) : null, starveTicks: starve, starvePerPlan: plans ? +(starve / plans).toFixed(3) : null, lockTasks, recovered3s: recovered, recoveryRate: cases.length ? +(recovered / cases.length).toFixed(4) : null, livelock,
|
||||
timeP50: pct(times, 0.5), inferMsP50: pct(inf, 0.5), inferMsP99: pct(inf, 0.99), safetyMsP50: pct(saf, 0.5), safetyMsP99: pct(saf, 0.99),
|
||||
// 2026-10-18 第六轮(审查 B-1/B-2):前瞻、整次规划耗时,每次规划的距离查询数与记忆命中率,认证失败原因——与查看器 autotest 同口径对照
|
||||
lookaheadMsP99: pct(look, 0.99), planMsP50: pct(planT, 0.5), planMsP99: pct(planT, 0.99), planWarmMsP99: pct(planW, 0.99), certQueriesP50: pct(cq, 0.5), certQueriesP99: pct(cq, 0.99),
|
||||
|
||||
@@ -0,0 +1,717 @@
|
||||
import contextlib
|
||||
import io
|
||||
import json
|
||||
import tempfile
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
from unittest.mock import patch
|
||||
|
||||
import torch
|
||||
|
||||
from ml.eval.eval_cl import json_finite, run
|
||||
from ml.eval.diag_collision import replay_certificates, replay_dense, replay_first_hits
|
||||
from ml.sim.closed_loop import TeacherOracle, rollout
|
||||
from ml.common.kin_torch import Kin, seg_seg_dist
|
||||
|
||||
|
||||
class EvalMetricsTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.tasks = [
|
||||
{'q0': [0] * 6, 'T': [0] * 3, 'exec_s': 1, 'travel': 5},
|
||||
{'q0': [0] * 6, 'T': [0] * 3, 'exec_s': None, 'travel': None},
|
||||
{'q0': [0] * 6, 'T': [0] * 3, 'exec_s': 2, 'travel': 6},
|
||||
]
|
||||
self.per = {k: torch.tensor(v) for k, v in {
|
||||
'ok': [True, False, True], 'done': [True, False, True],
|
||||
't_done': [0.5, float('nan'), 2.0], 'col': [1.0, 0.0, 0.0],
|
||||
'travel': [6.0, 0.0, 8.0], 'brakes': [2.0, 4.0, 6.0],
|
||||
'start_fail': [False, True, False], 'goal_ratio_2s': [0.3, 0.9, 0.1],
|
||||
'err': [0.2, 200.0, 0.8], 'dls_it': [4, -1, 20],
|
||||
'speed_ratio': [1.66, 0.9, 1.2], 'accel_ratio': [0.3, 0.2, 0.5],
|
||||
}.items()}
|
||||
|
||||
def evaluate(self, tasks, bs=2, **kw):
|
||||
offset = 0
|
||||
|
||||
def fake_rollout(model, kin, batch, device, **kwargs):
|
||||
nonlocal offset
|
||||
p = {k: v[offset:offset + len(batch)] for k, v in self.per.items()}
|
||||
offset += len(batch)
|
||||
return {'time_budget': 'mixed'}, p
|
||||
|
||||
with patch('ml.eval.eval_cl.rollout', side_effect=fake_rollout), contextlib.redirect_stdout(io.StringIO()):
|
||||
return run(None, None, tasks, 'cpu', bs=bs, **kw)[0]
|
||||
|
||||
def test_global_denominators_and_collision_free_arrival(self):
|
||||
result = self.evaluate(self.tasks)
|
||||
self.assertEqual(result['n_ref'], 2)
|
||||
self.assertAlmostEqual(result['success'], 2 / 3, places=6)
|
||||
self.assertAlmostEqual(result['collision_free_success'], 1 / 3, places=6)
|
||||
self.assertAlmostEqual(result['collision_rate'], 1 / 3, places=6)
|
||||
self.assertEqual(result['time_ok_1p3'], 1.0)
|
||||
self.assertEqual(result['time_mean_s'], 1.25)
|
||||
self.assertAlmostEqual(result['travel_ratio_median'], 1.2, places=6)
|
||||
self.assertAlmostEqual(result['goal_ratio_2s'], 0.3, places=6)
|
||||
self.assertEqual(result['err_fail_med'], 200.0)
|
||||
self.assertEqual(result['brakes_mean'], 4.0)
|
||||
# 极值/分位按逐题值跨批汇总,不能进按 n 加权求均值的批聚合
|
||||
self.assertAlmostEqual(result['speed_ratio_p50'], 1.2, places=6)
|
||||
self.assertAlmostEqual(result['speed_ratio_p95'], 1.614, places=6)
|
||||
self.assertAlmostEqual(result['speed_ratio_max'], 1.66, places=5)
|
||||
self.assertAlmostEqual(result['over_vmax_rate'], 2 / 3, places=6) # 1.66 与 1.2 都算超 VMAX,0.9 不算
|
||||
self.assertAlmostEqual(result['accel_ratio_max'], 0.5, places=6)
|
||||
|
||||
def test_empty_conditional_metrics_and_explicit_limit(self):
|
||||
task = {**self.tasks[0], 'exec_s': None, 'travel': None}
|
||||
result = self.evaluate([task], max_sec=0.04)
|
||||
self.assertIsNone(result['err_fail_med'])
|
||||
self.assertIsNone(result['time_ok_1p3'])
|
||||
self.assertIsNone(result['travel_ratio_median'])
|
||||
self.assertEqual(result['time_budget'], 'fixed 0.040 s')
|
||||
self.assertEqual(result['collision_free_success'], 0.0)
|
||||
|
||||
def test_json_replaces_nonfinite_without_changing_zero(self):
|
||||
value = {'items': [float('nan'), float('inf'), -float('inf'), 0.0]}
|
||||
text = json.dumps(json_finite(value), allow_nan=False)
|
||||
self.assertEqual(json.loads(text), {'items': [None, None, None, 0.0]})
|
||||
|
||||
def test_first_hit_probe_detects_collision(self):
|
||||
class PlaneKin:
|
||||
def __init__(self, **kwargs):
|
||||
self.cont = torch.zeros(6, dtype=torch.bool)
|
||||
self.lo, self.hi = torch.full((6,), -10.0), torch.full((6,), 10.0)
|
||||
|
||||
def gaps(self, q, cap):
|
||||
return {'gm': q[:, :1].expand(-1, 49).clamp(max=cap)}
|
||||
|
||||
traj = torch.zeros(1, 3, 6)
|
||||
traj[0, :, 0] = torch.tensor([1.0, 1.0, -1.0])
|
||||
per = {'col': torch.tensor([1.0]), 'first_hit': torch.tensor([0.04]),
|
||||
'dls_it': torch.tensor([-1]), 'traj': traj}
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
trace = Path(folder) / 'trace.pt'
|
||||
torch.save({'tasks': [self.tasks[0]], 'batches': [({}, per, 1)]}, trace)
|
||||
with patch('ml.eval.diag_collision.Kin', PlaneKin), contextlib.redirect_stdout(io.StringIO()):
|
||||
result = replay_first_hits(trace)
|
||||
self.assertEqual(result['reported_collision_tasks'], 1)
|
||||
self.assertEqual(result['replayed_first_hits32'], 1)
|
||||
self.assertEqual(result['replayed_first_hits64'], 1)
|
||||
self.assertEqual(result['rows'][0]['gap64_mm'], [0.5, 0.5, 0.0, -1.0])
|
||||
self.assertEqual(result['rows'][0]['dense_gap64_min_mm'], -1.0)
|
||||
|
||||
def test_dense_probe_detects_between_checkpoints_and_respects_deadline(self):
|
||||
class ThinObstacle:
|
||||
fp = 'probe'
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
pass
|
||||
|
||||
def gaps(self, q, cap):
|
||||
return {'gm': ((q[:, :1] - 0.25).abs() - 0.05).clamp(max=cap)}
|
||||
|
||||
traj = torch.zeros(4, 3, 6)
|
||||
traj[:, :, 0] = torch.tensor([[0, 1, 1], [0, -0.5, -1], [0, 0, 0.25], [0, 0, 0.25]])
|
||||
per = {'traj': traj, 'col': torch.zeros(4), 'limit': torch.tensor([0.04, 0.04, 0.02, 0.04]),
|
||||
't_done': torch.tensor([float('nan')] * 3 + [0.02])}
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
trace = Path(folder) / 'trace.pt'
|
||||
output = Path(folder) / 'audit.json'
|
||||
torch.save({'kin_fp': 'probe', 'tasks': [{}] * 4, 'batches': [({}, per, 4)]}, trace)
|
||||
with patch('ml.eval.diag_collision.Kin', ThinObstacle), contextlib.redirect_stdout(io.StringIO()):
|
||||
result = replay_dense(trace, [0, 1, 2, 3], 0.01, out=output)
|
||||
with self.assertRaisesRegex(ValueError, 'valid task indices'):
|
||||
replay_dense(trace, [4])
|
||||
with self.assertRaisesRegex(ValueError, 'positive max_step_deg'):
|
||||
replay_dense(trace, [0], 0.0)
|
||||
self.assertEqual(json.loads(output.read_text())['collision_tasks'], 1)
|
||||
self.assertEqual(result['collision_tasks'], 1)
|
||||
self.assertEqual(result['rows'][0]['collision_segments'], 1)
|
||||
self.assertAlmostEqual(result['rows'][0]['min_gap64_mm'], -0.05)
|
||||
self.assertGreater(result['rows'][1]['min_gap64_mm'], 0)
|
||||
for row in result['rows'][2:]:
|
||||
self.assertGreater(row['min_gap64_mm'], 0)
|
||||
self.assertEqual(row['steps'], 1)
|
||||
|
||||
def test_certificate_replay_samples_actual_movement_before_deadlines(self):
|
||||
kin = SegmentCertificateTest.ThinObstacle()
|
||||
kin.fp = 'probe'
|
||||
traj = torch.zeros(3, 4, 6)
|
||||
traj[:, :, 0] = torch.tensor([[0, 1, 1, 1], [0, -0.5, -1, -1], [0, 0, 1, 1]])
|
||||
per = {'traj': traj, 'limit': torch.tensor([0.06, 0.02, 0.02]),
|
||||
't_done': torch.tensor([float('nan'), 0.02, float('nan')]),
|
||||
'plans': {'it': torch.arange(3), 'commit': torch.zeros(3, 3, 1, 6),
|
||||
'certified': torch.ones(3, 3, 1, dtype=torch.bool), 'gaps': torch.full((3, 3, 2), 0.5)}}
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
trace, output = Path(folder) / 'trace.pt', Path(folder) / 'audit.json'
|
||||
torch.save({'kin_fp': 'probe', 'tasks': [{}] * 3, 'batches': [({}, per, 3)]}, trace)
|
||||
with patch('ml.eval.diag_collision.Kin', return_value=kin), contextlib.redirect_stdout(io.StringIO()):
|
||||
result = replay_certificates(trace, [0, 1, 2], out=output, repeats=1, extra_segments=[(0, 0)])
|
||||
with self.assertRaisesRegex(ValueError, 'extra segment'):
|
||||
replay_certificates(trace, [1], repeats=1, extra_segments=[(1, 1)])
|
||||
self.assertEqual(json.loads(output.read_text())['dense_collision_segments'], 1)
|
||||
self.assertEqual([(r['i'], r['start_it']) for r in result['rows']], [(0, 0), (1, 0)])
|
||||
self.assertEqual(result['budgets']['32']['safe'], 1)
|
||||
self.assertEqual(result['budgets']['32']['collision'], 1)
|
||||
self.assertEqual(result['accepted_dense_collision_segments'], 0)
|
||||
self.assertTrue(result['batch_single_match'])
|
||||
self.assertEqual(result['timing']['calls'], 2)
|
||||
|
||||
|
||||
class DlsSafetyTest(unittest.TestCase):
|
||||
def test_rejected_refinement_retains_safe_candidate(self):
|
||||
class ObstacleKin:
|
||||
def clamp_box(self, q):
|
||||
return q
|
||||
|
||||
def gaps(self, q, cap):
|
||||
return {'gm': torch.where(q[:, :1] > 0.3, -torch.ones_like(q[:, :1]), torch.ones_like(q[:, :1]))}
|
||||
|
||||
task = {'q0': [0] * 6, 'T': [2, 0, 0]}
|
||||
traj = torch.zeros(1, 2, 6)
|
||||
traj[0, 1, 0] = 0.1
|
||||
ref = torch.zeros(1, 1, 6)
|
||||
ref[0, 0, 0] = 1.0
|
||||
patches = {
|
||||
'features': lambda *args: torch.zeros(1, 83),
|
||||
'goal_err': lambda kin, q, T, R: (torch.full((q.shape[0],), 2.0), torch.zeros(q.shape[0])),
|
||||
'dls_steps': lambda *args, **kwargs: ref,
|
||||
}
|
||||
results = []
|
||||
with patch.multiple('ml.sim.closed_loop', **patches):
|
||||
for gate in (0, 1):
|
||||
_, per = rollout(None, ObstacleKin(), [task], 'cpu', K=1, safety=True,
|
||||
max_sec=0.02, return_traj=True, use_sub=False, select='first',
|
||||
oracle=TeacherOracle(traj), replan='empty', commit_n=1,
|
||||
safety_partial=1, dls_safety=gate)
|
||||
results.append(per)
|
||||
self.assertEqual(results[0]['col'].item(), 1.0)
|
||||
self.assertEqual(results[0]['dls_it'].item(), 0)
|
||||
self.assertEqual(results[1]['col'].item(), 0.0)
|
||||
self.assertEqual(results[1]['dls_it'].item(), -1)
|
||||
self.assertAlmostEqual(results[1]['traj'][0, 1, 0].item(), 0.1)
|
||||
|
||||
def test_feedback_is_reduced_only_after_full_rejection(self):
|
||||
class ObstacleKin:
|
||||
def clamp_box(self, q):
|
||||
return q
|
||||
|
||||
def gaps(self, q, cap):
|
||||
return {'gm': torch.where(q[:, :1] > 0.3, -torch.ones_like(q[:, :1]), torch.ones_like(q[:, :1]))}
|
||||
|
||||
task = {'q0': [0] * 6, 'T': [10, 0, 0]}
|
||||
traj = torch.zeros(1, 17, 6)
|
||||
traj[0, :, 0] = -0.2 * torch.arange(17)
|
||||
ref = torch.zeros(1, 1, 6)
|
||||
ref[0, 0, 0] = 1.0
|
||||
patches = {
|
||||
'features': lambda *args: torch.zeros(1, 83),
|
||||
'goal_err': lambda kin, q, T, R: (torch.full((q.shape[0],), 10.0), torch.zeros(q.shape[0])),
|
||||
'dls_steps': lambda *args, **kwargs: ref,
|
||||
}
|
||||
results = []
|
||||
with patch.multiple('ml.sim.closed_loop', **patches):
|
||||
for gain in (1.0, 0.5):
|
||||
_, per = rollout(None, ObstacleKin(), [task], 'cpu', K=1, safety=True,
|
||||
max_sec=0.04, return_traj=True, use_sub=False, select='first',
|
||||
oracle=TeacherOracle(traj), replan='empty', commit_n=1,
|
||||
safety_partial=1, fb_gain=0.6, fb_block_gain=gain)
|
||||
results.append(per)
|
||||
self.assertEqual(results[0]['brakes'].item(), 2.0)
|
||||
self.assertEqual(results[1]['brakes'].item(), 1.0)
|
||||
self.assertEqual(results[1]['traj'][0, 1, 0].item(), 0.0)
|
||||
self.assertAlmostEqual(results[1]['traj'][0, 2, 0].item(), 0.1)
|
||||
self.assertEqual(results[1]['col'].item(), 0.0)
|
||||
|
||||
|
||||
class ClampedPathSafetyTest(unittest.TestCase):
|
||||
def rollout_candidate(self, increments, safety_partial, goal_error=10.0, **kwargs):
|
||||
class ObstacleKin:
|
||||
def clamp_box(self, q):
|
||||
clamped = q.clone()
|
||||
clamped[..., 4] = clamped[..., 4].clamp(max=0.0)
|
||||
return clamped
|
||||
|
||||
def gaps(self, q, cap):
|
||||
collision = (q[:, :1] > 0.1) & (q[:, 4:5] < 0.2)
|
||||
return {'gm': torch.where(collision, -torch.ones_like(q[:, :1]), torch.ones_like(q[:, :1]))}
|
||||
|
||||
task = {'q0': [0] * 6, 'T': [goal_error, 0, 0]}
|
||||
commit_n = len(increments)
|
||||
traj = torch.zeros(1, commit_n + 1, 6)
|
||||
traj[0, 1:] = torch.tensor(increments).cumsum(0)
|
||||
patches = {
|
||||
'features': lambda *args: torch.zeros(1, 83),
|
||||
'goal_err': lambda kin, q, T, R: (torch.full((q.shape[0],), goal_error), torch.zeros(q.shape[0])),
|
||||
}
|
||||
with patch.multiple('ml.sim.closed_loop', **patches):
|
||||
_, per = rollout(None, ObstacleKin(), [task], 'cpu', K=1, safety=True,
|
||||
max_sec=0.02 * commit_n, return_traj=True, use_sub=False, select='first',
|
||||
oracle=TeacherOracle(traj), replan='empty', commit_n=commit_n,
|
||||
safety_partial=safety_partial, **kwargs)
|
||||
return per
|
||||
|
||||
def test_full_safety_rejects_collision_after_joint_clamp(self):
|
||||
# Raw endpoint/midpoint are safe, but the J5 upper limit puts the endpoint at (0.2, 0).
|
||||
per = self.rollout_candidate([[0.2, 0, 0, 0, 0.6, 0]], safety_partial=0)
|
||||
self.assertEqual(per['col'].item(), 0.0)
|
||||
torch.testing.assert_close(per['traj'], torch.zeros(1, 2, 6), rtol=0, atol=0)
|
||||
|
||||
def test_partial_safety_rejects_collision_after_joint_clamp(self):
|
||||
per = self.rollout_candidate([[0.2, 0, 0, 0, 0.6, 0]], safety_partial=1)
|
||||
self.assertEqual(per['col'].item(), 0.0)
|
||||
torch.testing.assert_close(per['traj'], torch.zeros(1, 2, 6), rtol=0, atol=0)
|
||||
|
||||
def test_partial_safety_keeps_only_clamped_safe_prefix(self):
|
||||
per = self.rollout_candidate([
|
||||
[0.05, 0, 0, 0, 0.6, 0],
|
||||
[0.2, 0, 0, 0, 0.6, 0],
|
||||
], safety_partial=1)
|
||||
self.assertAlmostEqual(per['traj'][0, -1, 0].item(), 0.05)
|
||||
self.assertEqual(per['traj'][0, -1, 4].item(), 0.0)
|
||||
self.assertEqual(per['col'].item(), 0.0)
|
||||
expected = torch.zeros(1, 3, 6)
|
||||
expected[0, 1:, 0] = 0.05
|
||||
torch.testing.assert_close(per['traj'], expected)
|
||||
torch.testing.assert_close(per['plans']['commit'][0, 0, 1], torch.zeros(6), rtol=0, atol=0)
|
||||
|
||||
def test_near_dls_rejects_clamped_collision_and_keeps_candidate(self):
|
||||
candidate = [[0.05, 0, 0, 0, 0.6, 0]]
|
||||
ref = torch.tensor([[[0.2, 0, 0, 0, 0.6, 0]]])
|
||||
for safety_partial in (0, 1):
|
||||
with self.subTest(safety_partial=safety_partial):
|
||||
with patch('ml.sim.closed_loop.dls_steps', return_value=ref) as dls:
|
||||
per = self.rollout_candidate(candidate, safety_partial, goal_error=2.0, dls_safety=1)
|
||||
dls.assert_called_once()
|
||||
self.assertEqual(per['col'].item(), 0.0)
|
||||
self.assertEqual(per['dls_it'].item(), -1)
|
||||
self.assertEqual(per['brakes'].item(), 0.0)
|
||||
expected = torch.zeros(1, 2, 6)
|
||||
expected[0, 1, 0] = 0.05
|
||||
torch.testing.assert_close(per['traj'], expected)
|
||||
torch.testing.assert_close(per['plans']['commit'], torch.tensor(candidate)[None, None])
|
||||
self.assertTrue(per['plans']['certified'].all().item())
|
||||
|
||||
def test_r3_clamped_queue_origin_prefix_and_certificates_match_execution(self):
|
||||
class SafeKin:
|
||||
def clamp_box(self, q):
|
||||
clamped = q.clone()
|
||||
clamped[..., 4] = clamped[..., 4].clamp(max=0.0)
|
||||
return clamped
|
||||
|
||||
def gaps(self, q, cap):
|
||||
return {'gm': torch.ones_like(q[:, :1])}
|
||||
|
||||
prefixes = []
|
||||
|
||||
def capture_features(kin, q, qp, T, R, pre, r, sub, sf):
|
||||
prefixes.append((pre.clone(), int(r.item())))
|
||||
return torch.zeros(1, 83)
|
||||
|
||||
teacher = torch.zeros(1, 25, 6)
|
||||
teacher[0, :, 0] = 0.02 * torch.arange(25)
|
||||
teacher[0, :, 4] = 0.6 * torch.arange(25)
|
||||
task = {'q0': [0] * 6, 'T': [10, 0, 0]}
|
||||
patches = {
|
||||
'features': capture_features,
|
||||
'goal_err': lambda kin, q, T, R: (torch.full((q.shape[0],), 10.0), torch.zeros(q.shape[0])),
|
||||
}
|
||||
with patch.multiple('ml.sim.closed_loop', **patches):
|
||||
_, per = rollout(None, SafeKin(), [task], 'cpu', K=1, safety=True,
|
||||
max_sec=0.16, return_traj=True, use_sub=False, select='first',
|
||||
oracle=TeacherOracle(teacher), replan='r3', commit_n=3, safety_partial=1)
|
||||
self.assertEqual([r for _, r in prefixes], [0, 2, 3, 3])
|
||||
for pre, r in prefixes[1:]:
|
||||
torch.testing.assert_close(pre[..., 4], torch.zeros(1, 3), rtol=0, atol=0)
|
||||
torch.testing.assert_close(pre[:, :r, 0], torch.full((1, r), 0.02))
|
||||
self.assertEqual(per['col'].item(), 0.0)
|
||||
expected = torch.zeros(1, 9, 6)
|
||||
expected[0, :, 0] = 0.02 * torch.arange(9)
|
||||
torch.testing.assert_close(per['traj'], expected)
|
||||
plans = per['plans']
|
||||
self.assertEqual(plans['it'].tolist(), [0, 3, 6, 9])
|
||||
torch.testing.assert_close(plans['commit'][..., 4], torch.full((1, 4, 3), 0.6))
|
||||
self.assertTrue(plans['certified'].all().item())
|
||||
self.assertTrue((plans['gaps'] > 0).all().item())
|
||||
checked = 0
|
||||
for i, start in enumerate(plans['it'].tolist()):
|
||||
n = min(3, 8 - start)
|
||||
if n <= 0:
|
||||
continue
|
||||
torch.testing.assert_close(plans['qe'][:, i], per['traj'][:, start], rtol=0, atol=0)
|
||||
before = per['traj'][:, start:start + n]
|
||||
after = per['traj'][:, start + 1:start + n + 1]
|
||||
torch.testing.assert_close(plans['points'][:, i, :n], after, rtol=0, atol=0)
|
||||
torch.testing.assert_close(plans['midpoints'][:, i, :n], before + 0.5 * (after - before),
|
||||
rtol=0, atol=0)
|
||||
checked += n
|
||||
self.assertEqual(checked, 8)
|
||||
|
||||
def rollout_fallback(self, safety_partial, midpoint_collision=False):
|
||||
class ObstacleKin:
|
||||
def clamp_box(self, q):
|
||||
return q
|
||||
|
||||
def gaps(self, q, cap):
|
||||
collision = q[:, :1] > 0.3
|
||||
if midpoint_collision:
|
||||
collision |= (q[:, :1] > 0.09) & (q[:, :1] < 0.11)
|
||||
return {'gm': torch.where(collision, -torch.ones_like(q[:, :1]), torch.ones_like(q[:, :1]))}
|
||||
|
||||
teacher = torch.zeros(1, 4, 6)
|
||||
teacher[0, :, 0] = torch.arange(4)
|
||||
ref = torch.zeros(1, 1, 6)
|
||||
ref[0, 0, 0] = 0.2
|
||||
task = {'q0': [0] * 6, 'T': [10, 0, 0]}
|
||||
patches = {
|
||||
'features': lambda *args: torch.zeros(1, 83),
|
||||
'goal_err': lambda kin, q, T, R: (torch.full((q.shape[0],), 10.0), torch.zeros(q.shape[0])),
|
||||
'dls_steps': lambda *args, **kwargs: ref,
|
||||
}
|
||||
with patch.multiple('ml.sim.closed_loop', **patches):
|
||||
_, per = rollout(None, ObstacleKin(), [task], 'cpu', K=1, safety=True,
|
||||
max_sec=0.06, return_traj=True, use_sub=False, select='first',
|
||||
oracle=TeacherOracle(teacher), replan='empty', commit_n=3,
|
||||
safety_partial=safety_partial, fb_gain=1.0, fb_fallback=1.0)
|
||||
return per
|
||||
|
||||
def test_fallback_executes_one_safe_dls_step_then_certified_zeros(self):
|
||||
for safety_partial in (0, 1):
|
||||
with self.subTest(safety_partial=safety_partial):
|
||||
per = self.rollout_fallback(safety_partial)
|
||||
self.assertEqual(per['col'].item(), 0.0)
|
||||
self.assertEqual(per['brakes'].item(), 1.0)
|
||||
expected = torch.zeros(1, 4, 6)
|
||||
expected[0, 1:, 0] = 0.2
|
||||
torch.testing.assert_close(per['traj'], expected)
|
||||
commit = torch.zeros(1, 1, 3, 6)
|
||||
commit[0, 0, 0, 0] = 0.2
|
||||
plans = per['plans']
|
||||
self.assertEqual(plans['it'].tolist(), [0])
|
||||
torch.testing.assert_close(plans['commit'], commit, rtol=0, atol=0)
|
||||
self.assertTrue(plans['certified'].all().item())
|
||||
self.assertTrue((plans['gaps'] > 0).all().item())
|
||||
torch.testing.assert_close(plans['points'][:, 0], expected[:, 1:])
|
||||
torch.testing.assert_close(plans['midpoints'][:, 0],
|
||||
expected[:, :-1] + 0.5 * (expected[:, 1:] - expected[:, :-1]))
|
||||
|
||||
def test_fallback_rejects_safe_endpoint_with_colliding_midpoint(self):
|
||||
for safety_partial in (0, 1):
|
||||
with self.subTest(safety_partial=safety_partial):
|
||||
per = self.rollout_fallback(safety_partial, midpoint_collision=True)
|
||||
self.assertEqual(per['col'].item(), 0.0)
|
||||
self.assertEqual(per['brakes'].item(), 1.0)
|
||||
torch.testing.assert_close(per['traj'], torch.zeros(1, 4, 6), rtol=0, atol=0)
|
||||
torch.testing.assert_close(per['plans']['commit'], torch.zeros(1, 1, 3, 6), rtol=0, atol=0)
|
||||
self.assertFalse(per['plans']['certified'].any().item())
|
||||
|
||||
|
||||
class SegmentCertificateTest(unittest.TestCase):
|
||||
class ThinObstacle(Kin):
|
||||
def __init__(self):
|
||||
self.dtype = torch.float64
|
||||
self.lo, self.hi = torch.full((6,), -5.0), torch.full((6,), 5.0)
|
||||
self.cont = torch.zeros(6, dtype=torch.bool)
|
||||
self.cert_groups = torch.tensor([0])
|
||||
self.cert_lever = torch.tensor([[1.0, 0, 0, 0, 0, 0]], dtype=self.dtype)
|
||||
|
||||
def gaps(self, q, cap):
|
||||
return {'gm': ((q[:, :1] - 0.25).abs() - 0.05).clamp(max=cap)}
|
||||
|
||||
def test_bound_detects_hidden_collision_and_accepts_clear_segment(self):
|
||||
a, b = torch.zeros(3, 6, dtype=torch.float64), torch.zeros(3, 6, dtype=torch.float64)
|
||||
a[:, 0] = torch.tensor([0.0, -1.0, 0.25])
|
||||
b[:, 0] = torch.tensor([1.0, 0.0, 0.25])
|
||||
result = self.ThinObstacle().certify_segments(a, b)
|
||||
self.assertEqual(result['safe'].tolist(), [False, True, False])
|
||||
self.assertEqual(result['collision'].tolist(), [True, False, True])
|
||||
self.assertEqual(result['queries'].tolist(), [4, 2, 2])
|
||||
|
||||
def test_budget_and_depth_exhaustion_do_not_accept_unknown_segment(self):
|
||||
a, b = torch.zeros(1, 6, dtype=torch.float64), torch.zeros(1, 6, dtype=torch.float64)
|
||||
b[:, 0] = 1.0
|
||||
kin = self.ThinObstacle()
|
||||
for kwargs in ({'max_queries': 2}, {'max_depth': 0}):
|
||||
with self.subTest(**kwargs):
|
||||
result = kin.certify_segments(a, b, **kwargs)
|
||||
self.assertFalse(result['safe'].item())
|
||||
self.assertTrue(result['unresolved'].item())
|
||||
self.assertEqual(result['queries'].item(), 2)
|
||||
|
||||
def test_shape_mismatch_between_endpoints_is_rejected(self):
|
||||
a = torch.zeros(1, 6, dtype=torch.float64)
|
||||
b = torch.zeros(2, 6, dtype=torch.float64)
|
||||
kin = self.ThinObstacle()
|
||||
for method in (kin.certify_segments, kin.certify_uniform):
|
||||
with self.subTest(method=method.__name__):
|
||||
with self.assertRaisesRegex(ValueError, 'identical shape'):
|
||||
method(a, b)
|
||||
|
||||
def test_budget_exhaustion_scales_with_gap_and_bound(self):
|
||||
class ConstantGap(self.ThinObstacle):
|
||||
def gaps(self, q, cap):
|
||||
return {'gm': torch.full((q.shape[0], 1), 0.1, dtype=q.dtype, device=q.device)}
|
||||
|
||||
# 界取 1 mm/度:1° 段要证明无碰撞,必须细分到位移界 < 两端间隙之和(0.2 mm)。
|
||||
kin = ConstantGap()
|
||||
kin.cert_lever = torch.ones(1, 6, dtype=torch.float64)
|
||||
a, b = torch.zeros(1, 6, dtype=torch.float64), torch.zeros(1, 6, dtype=torch.float64)
|
||||
b[:, 0] = 1.0
|
||||
for budget, safe, queries in ((4, False, 3), (8, False, 5), (9, True, 9)):
|
||||
with self.subTest(budget=budget):
|
||||
result = kin.certify_segments(a, b, max_queries=budget)
|
||||
self.assertEqual(bool(result['safe'].item()), safe)
|
||||
self.assertEqual(int(result['queries'].item()), queries)
|
||||
|
||||
def test_tensor_budget_cannot_wrap_depth(self):
|
||||
a, b = torch.zeros(1, 6, dtype=torch.float64), torch.zeros(1, 6, dtype=torch.float64)
|
||||
a[:, 0] = b[:, 0] = 0.25
|
||||
for tensor in (torch.tensor(255, dtype=torch.uint8), torch.tensor(255)):
|
||||
with self.subTest(dtype=tensor.dtype):
|
||||
with self.assertRaisesRegex(ValueError, 'plain ints'):
|
||||
self.ThinObstacle().certify_segments(a, b, max_depth=tensor)
|
||||
|
||||
def test_batch_matches_per_root_and_ignores_order(self):
|
||||
kin = self.ThinObstacle()
|
||||
a = torch.tensor([[0.0, 0, 0, 0, 0, 0], [0.25, 0, 0, 0, 0, 0], [-1.0, 0, 0, 0, 0, 0]], dtype=torch.float64)
|
||||
b = torch.tensor([[1.0, 0, 0, 0, 0, 0], [0.25, 0, 0, 0, 0, 0], [0.0, 0, 0, 0, 0, 0]], dtype=torch.float64)
|
||||
batch = kin.certify_segments(a, b, max_queries=16)
|
||||
self.assertEqual(batch['collision'].tolist(), [True, True, False])
|
||||
self.assertEqual(batch['safe'].tolist(), [False, False, True])
|
||||
for perm in ([0, 1, 2], [2, 1, 0], [1, 0, 2]):
|
||||
index = torch.tensor(perm)
|
||||
moved = kin.certify_segments(a[index], b[index], max_queries=16)
|
||||
for key in ('safe', 'collision', 'unresolved', 'queries'):
|
||||
torch.testing.assert_close(moved[key], batch[key][index], rtol=0, atol=0)
|
||||
|
||||
def test_empty_batch_and_all_rejected_frontier(self):
|
||||
kin = self.ThinObstacle()
|
||||
empty = kin.certify_segments(torch.zeros(0, 6, dtype=torch.float64), torch.zeros(0, 6, dtype=torch.float64))
|
||||
self.assertEqual(empty['safe'].shape, (0,))
|
||||
a = torch.tensor([[0.25, 0, 0, 0, 0, 0], [6.0, 0, 0, 0, 0, 0]], dtype=torch.float64)
|
||||
result = kin.certify_segments(a, a.clone(), max_queries=2)
|
||||
self.assertEqual(result['safe'].tolist(), [False, False])
|
||||
self.assertEqual(result['collision'].tolist(), [True, False])
|
||||
self.assertEqual(result['outside_box'].tolist(), [False, True])
|
||||
|
||||
def test_uniform_matches_bound_formula_and_needs_no_round_trips(self):
|
||||
class ConstantGap(self.ThinObstacle):
|
||||
def gaps(self, q, cap):
|
||||
return {'gm': torch.full((q.shape[0], 1), 0.1, dtype=q.dtype, device=q.device)}
|
||||
|
||||
# 界 1 mm/度、间隙 0.1 mm:子段判据 0.2 > 1/n 需要 n ≥ 6,n=5 必须落 unproven。
|
||||
kin = ConstantGap()
|
||||
kin.cert_lever = torch.ones(1, 6, dtype=torch.float64)
|
||||
a, b = torch.zeros(1, 6, dtype=torch.float64), torch.zeros(1, 6, dtype=torch.float64)
|
||||
b[:, 0] = 1.0
|
||||
for n, safe in ((5, False), (6, True)):
|
||||
with self.subTest(n=n):
|
||||
result = kin.certify_uniform(a, b, n=n)
|
||||
self.assertEqual(bool(result['safe'].item()), safe)
|
||||
self.assertEqual(result['points'], n + 1)
|
||||
self.assertFalse(bool(result['collision'].item()))
|
||||
self.assertEqual(bool(result['unproven'].item()), not safe)
|
||||
self.assertAlmostEqual(result['cap_required_mm'], 1.0 / n + 2e-4, places=9)
|
||||
|
||||
def test_uniform_catches_hidden_collision_and_rejects_short_grids(self):
|
||||
a = torch.tensor([[0.0, 0, 0, 0, 0, 0], [-1.0, 0, 0, 0, 0, 0], [6.0, 0, 0, 0, 0, 0]], dtype=torch.float64)
|
||||
b = torch.tensor([[1.0, 0, 0, 0, 0, 0], [0.0, 0, 0, 0, 0, 0], [6.0, 0, 0, 0, 0, 0]], dtype=torch.float64)
|
||||
kin = self.ThinObstacle()
|
||||
short = kin.certify_uniform(a, b, n=2)
|
||||
self.assertEqual(short['collision'].tolist(), [False, False, False])
|
||||
self.assertEqual(short['unproven'].tolist(), [True, False, False])
|
||||
self.assertEqual(short['safe'].tolist(), [False, True, False])
|
||||
for n in (4, 8, 64):
|
||||
with self.subTest(n=n):
|
||||
result = kin.certify_uniform(a, b, n=n)
|
||||
self.assertEqual(result['collision'].tolist(), [True, False, False])
|
||||
self.assertEqual(result['safe'].tolist(), [False, True, False])
|
||||
self.assertEqual(result['outside_box'].tolist(), [False, False, True])
|
||||
|
||||
def test_uniform_requires_plain_int_count(self):
|
||||
a = torch.zeros(1, 6, dtype=torch.float64)
|
||||
for tensor in (torch.tensor(8, dtype=torch.uint8), torch.tensor(8)):
|
||||
with self.subTest(dtype=tensor.dtype):
|
||||
with self.assertRaisesRegex(ValueError, 'subdivision count'):
|
||||
self.ThinObstacle().certify_uniform(a, a.clone(), n=tensor)
|
||||
|
||||
def test_nonfinite_and_outside_box_are_rejected(self):
|
||||
a, b = torch.zeros(1, 6, dtype=torch.float64), torch.zeros(1, 6, dtype=torch.float64)
|
||||
kin = self.ThinObstacle()
|
||||
with patch.object(kin, 'gaps', side_effect=lambda q, cap: {'gm': torch.full((q.shape[0], 1), float('nan'))}):
|
||||
result = kin.certify_segments(a, b)
|
||||
self.assertFalse(result['safe'].item())
|
||||
self.assertTrue(result['unresolved'].item())
|
||||
for value in (float('inf'), -float('inf')):
|
||||
with self.subTest(value=value):
|
||||
with patch.object(kin, 'gaps',
|
||||
side_effect=lambda q, cap, v=value: {'gm': torch.full((q.shape[0], 1), v)}):
|
||||
result = kin.certify_segments(a, b)
|
||||
self.assertFalse(result['safe'].item())
|
||||
a[:, 0] = b[:, 0] = 6.0
|
||||
result = kin.certify_segments(a, b)
|
||||
self.assertFalse(result['safe'].item())
|
||||
self.assertTrue(result['outside_box'].item())
|
||||
|
||||
def test_point_segment_distance_is_symmetric_and_differentiable(self):
|
||||
p = torch.tensor([[0.0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]], dtype=torch.float64, requires_grad=True)
|
||||
q = torch.tensor([[2.0, 0, 0]] * 4, dtype=torch.float64)
|
||||
point = torch.tensor([[1.0, 0, 0], [1, 3, 0], [4, 0, 0], [-1, 0, 0]], dtype=torch.float64)
|
||||
forward = seg_seg_dist(p, q, point, point)
|
||||
reverse = seg_seg_dist(point, point, p, q)
|
||||
torch.testing.assert_close(forward, torch.tensor([0.0, 3, 2, 1], dtype=torch.float64), atol=1e-8, rtol=0)
|
||||
torch.testing.assert_close(forward, reverse, atol=1e-8, rtol=0)
|
||||
forward.sum().backward()
|
||||
self.assertTrue(torch.isfinite(p.grad).all())
|
||||
torch.testing.assert_close(seg_seg_dist(p.detach(), p.detach(), point, point),
|
||||
(p.detach() - point).norm(dim=-1), atol=1e-8, rtol=0)
|
||||
|
||||
|
||||
class SpeedAndMarginTest(unittest.TestCase):
|
||||
"""轮次33:反馈叠加后的每轴速度限幅,以及安全层的正余量门限(含 cap 截顶坑)。"""
|
||||
STEP = [1.2, 1.2, 1.8, 1.8, 2.4, 3.6]
|
||||
|
||||
def rollout_one(self, teacher_step, gap_value, fb=None, **kwargs):
|
||||
class FlatKin:
|
||||
def clamp_box(self, q):
|
||||
return q
|
||||
|
||||
def gaps(self, q, cap):
|
||||
return {'gm': torch.full((q.shape[0], 49), float(gap_value))}
|
||||
|
||||
commit_n = 2
|
||||
traj = torch.zeros(1, commit_n + 1, 6)
|
||||
traj[0, 1:] = torch.tensor(teacher_step)[None].repeat(commit_n, 1).cumsum(0) # teacher_step = 每步各轴的度数增量
|
||||
patches = {
|
||||
'features': lambda *args: torch.zeros(1, 83),
|
||||
'goal_err': lambda kin, q, T, R: (torch.full((q.shape[0],), 10.0), torch.zeros(q.shape[0])),
|
||||
}
|
||||
with patch.multiple('ml.sim.closed_loop', **patches):
|
||||
with patch('ml.sim.closed_loop.dls_steps', return_value=torch.tensor([[[1.0, 0, 0, 0, 0, 0]]])):
|
||||
_, per = rollout(None, FlatKin(), [{'q0': [0] * 6, 'T': [10, 0, 0]}], 'cpu', K=1, safety=True,
|
||||
max_sec=0.02 * commit_n, return_traj=True, use_sub=False, select='first',
|
||||
oracle=TeacherOracle(traj), replan='empty', commit_n=commit_n,
|
||||
**kwargs)
|
||||
return per
|
||||
|
||||
def test_feedback_over_speed_is_measured_not_assumed(self):
|
||||
# 策略给满 STEP(J1 +1.2°)+ 2.2×1.0° 反馈 = 3.4° > VMAX·DT
|
||||
per = self.rollout_one([1.2, 0, 0, 0, 0, 0], 5.0, fb_gain=2.2)
|
||||
self.assertAlmostEqual(per['traj'][0, 1, 0].item(), 3.4, places=5)
|
||||
self.assertAlmostEqual(per['speed_ratio'][0].item(), 3.4 / 1.2, places=5)
|
||||
|
||||
def test_inc_cap_limits_actual_step_to_vmax(self):
|
||||
per = self.rollout_one([1.2, 0, 0, 0, 0, 0], 5.0, fb_gain=2.2, inc_cap=1)
|
||||
self.assertAlmostEqual(per['traj'][0, 1, 0].item(), 1.2, places=5)
|
||||
self.assertLessEqual(per['speed_ratio'][0].item(), 1.0 + 1e-6)
|
||||
|
||||
def test_margin_rejects_near_obstacle_step_that_passes_at_zero(self):
|
||||
moved = self.rollout_one([0.5, 0, 0, 0, 0, 0], 0.3, safety_partial=1)
|
||||
self.assertAlmostEqual(moved['traj'][0, -1, 0].item(), 1.0, places=5)
|
||||
self.assertEqual(moved['brakes'].item(), 0.0)
|
||||
braked = self.rollout_one([0.5, 0, 0, 0, 0, 0], 0.3, gap_margin=0.5, safety_partial=1)
|
||||
self.assertEqual(braked['brakes'].item(), 1.0)
|
||||
torch.testing.assert_close(braked['traj'], torch.zeros(1, 3, 6), rtol=0, atol=0)
|
||||
|
||||
def test_margin_below_cap_still_accepts_clear_step(self):
|
||||
# 余量 0.5 必须仍能通过 5 mm 间隙:若宽相位 cap 没抬到 margin+0.5,截顶值 0.5 会让门限恒假
|
||||
per = self.rollout_one([0.5, 0, 0, 0, 0, 0], 5.0, gap_margin=0.5, safety_partial=1)
|
||||
self.assertEqual(per['brakes'].item(), 0.0)
|
||||
self.assertAlmostEqual(per['traj'][0, -1, 0].item(), 1.0, places=5)
|
||||
self.assertTrue((per['plans']['gaps'] > 0.5).all().item())
|
||||
|
||||
|
||||
class FeatureGeometryReuseTest(unittest.TestCase):
|
||||
"""#16 第①条:gm_groups 复用调用者已算好的 cum_xf,省一次 FK,但结果必须与原口径逐位一致。"""
|
||||
def test_gm_groups_with_supplied_xf_is_bitwise_identical(self):
|
||||
from ml.common.features import features, GP, GAP_CAP
|
||||
kin = Kin()
|
||||
q = torch.tensor([[-129.9, 46.68, 43.49, -97.46, -85.1, -139.7],
|
||||
[10.0, -20.0, 30.0, -40.0, 50.0, -60.0]])
|
||||
xf = kin.cum_xf(q)
|
||||
torch.testing.assert_close(kin.gm_groups(q, GP, GAP_CAP, xf=xf), kin.gm_groups(q, GP, GAP_CAP),
|
||||
rtol=0, atol=0)
|
||||
idx = [a * 7 + b for a, b in GP]
|
||||
table = kin.gaps(q, GAP_CAP, xf)['gm'][:, idx]
|
||||
torch.testing.assert_close(kin.gm_groups(q, GP, GAP_CAP), table, rtol=0, atol=0)
|
||||
z = torch.zeros(len(q), 6)
|
||||
f = features(kin, q, z, q[:, :3], torch.zeros(len(q), 9), z[:, None, :].expand(len(q), 3, 6),
|
||||
torch.zeros(len(q)), z, torch.zeros(len(q)))
|
||||
cols = 12 + 3 + 6 + 3 + 6 + 3 + 6 + 3 + 3 + 2 + 18 + 3 + 6 + 1 # 间隙块之前的特征数 = 75
|
||||
self.assertEqual(cols + 8, 83)
|
||||
torch.testing.assert_close(f[:, cols:cols + 8], table / GAP_CAP, rtol=0, atol=0)
|
||||
|
||||
|
||||
class CertBatchEquivalenceTest(unittest.TestCase):
|
||||
"""#16 第②条:把 K 条候选的认证并成一次 gaps 调用,选择结果必须与串行循环逐位一致。"""
|
||||
class StubModel:
|
||||
act_scale = 1.0
|
||||
|
||||
def __init__(self, act):
|
||||
self.act = act
|
||||
|
||||
def sample_k(self, feat, K, z, steps=1):
|
||||
B = feat.shape[0]
|
||||
return (self.act.expand(B, K, 16, 6).clone(), torch.zeros(B, device=feat.device),
|
||||
torch.zeros(B, 13, device=feat.device))
|
||||
|
||||
def run_both(self, acts, reject_first):
|
||||
class StepKin:
|
||||
def clamp_box(self, q):
|
||||
return q
|
||||
|
||||
def gaps(self, q, cap):
|
||||
bad = (q[:, 0] > 0.5) if reject_first else torch.zeros(len(q), dtype=torch.bool, device=q.device)
|
||||
return {'gm': torch.where(bad[:, None], -torch.ones(len(q), 49, device=q.device),
|
||||
torch.full((len(q), 49), 1.0, device=q.device))}
|
||||
|
||||
acts = torch.tensor(acts, dtype=torch.float32) # [K,16,6] 动作(±1 归一化)
|
||||
model = self.StubModel(acts)
|
||||
tasks = [{'q0': [0] * 6, 'T': [10, 0, 0]}] * 2 # B=2:批量索引形状必须在多行下也成立
|
||||
out = []
|
||||
for batched in (0, 1):
|
||||
with patch('ml.sim.closed_loop.features', return_value=torch.zeros(len(tasks), 83)), \
|
||||
patch('ml.sim.closed_loop.goal_err',
|
||||
side_effect=lambda kin, q, T, R: (torch.full((q.shape[0],), 10.0), torch.zeros(q.shape[0]))):
|
||||
_, per = rollout(model, StepKin(), tasks, 'cpu', K=acts.shape[0], safety=True, max_sec=0.04,
|
||||
return_traj=True, use_sub=False, select='first', replan='empty', commit_n=2,
|
||||
safety_partial=1, cert_batch=batched)
|
||||
out.append(per)
|
||||
return out
|
||||
|
||||
def test_batched_certification_selects_the_same_candidate(self):
|
||||
# 候选 0 第 2 步撞上 q0>0.5 的障碍 ⇒ 只有前缀 1 步;候选 1 全程安全 ⇒ 应被选中
|
||||
acts = [[[0.2, 0, 0, 0, 0, 0], [0.5, 0, 0, 0, 0, 0]] + [[0, 0, 0, 0, 0, 0]] * 14,
|
||||
[[0.1, 0, 0, 0, 0, 0], [0.1, 0, 0, 0, 0, 0]] + [[0, 0, 0, 0, 0, 0]] * 14]
|
||||
seq, batched = self.run_both(acts, reject_first=True)
|
||||
torch.testing.assert_close(batched['traj'], seq['traj'], rtol=0, atol=0)
|
||||
torch.testing.assert_close(batched['plans']['commit'], seq['plans']['commit'], rtol=0, atol=0)
|
||||
torch.testing.assert_close(batched['plans']['certified'], seq['plans']['certified'], rtol=0, atol=0)
|
||||
self.assertEqual(batched['brakes'].tolist(), seq['brakes'].tolist())
|
||||
self.assertAlmostEqual(seq['traj'][0, -1, 0].item(), 0.24, places=5) # 候选 1 的两步 0.1×STEP=0.12°
|
||||
|
||||
def test_batched_certification_keeps_partial_prefix_choice(self):
|
||||
# 所有候选都只走得了第 1 步 ⇒ 两条路径都取第 1 条候选、前缀长度 1
|
||||
acts = [[[0.2, 0, 0, 0, 0, 0], [0.5, 0, 0, 0, 0, 0]] + [[0, 0, 0, 0, 0, 0]] * 14,
|
||||
[[0.3, 0, 0, 0, 0, 0], [0.6, 0, 0, 0, 0, 0]] + [[0, 0, 0, 0, 0, 0]] * 14]
|
||||
seq, batched = self.run_both(acts, reject_first=True)
|
||||
torch.testing.assert_close(batched['traj'], seq['traj'], rtol=0, atol=0)
|
||||
torch.testing.assert_close(batched['plans']['commit'], seq['plans']['commit'], rtol=0, atol=0)
|
||||
self.assertAlmostEqual(seq['traj'][0, 1, 0].item(), 0.24, places=5)
|
||||
self.assertAlmostEqual(seq['traj'][0, 2, 0].item(), 0.24, places=5) # 第 2 步被拒后停在原地
|
||||
|
||||
|
||||
def test_mismatched_xf_row_count_is_rejected(self):
|
||||
kin = Kin()
|
||||
q1 = torch.zeros(1, 6); q5 = torch.zeros(5, 6)
|
||||
xf5 = kin.cum_xf(q5)
|
||||
for name, fn in (('gaps', lambda: kin.gaps(q1, 40.0, xf5)),
|
||||
('gm_groups', lambda: kin.gm_groups(q1, [(0, 2)], 40.0, xf=xf5))):
|
||||
with self.subTest(fn=name):
|
||||
with self.assertRaisesRegex(ValueError, '行数'):
|
||||
fn()
|
||||
self.assertEqual(kin.gaps(q5, 40.0, xf5)['gm'].shape, (5, 49))
|
||||
self.assertEqual(kin.gm_groups(q5, [(0, 2)], 40.0, xf=xf5).shape, (5, 1))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -55,7 +55,9 @@ async function boot() {
|
||||
}
|
||||
if (!sess) sess = await ort.InferenceSession.create(MODEL, { executionProviders: ep, graphOptimizationLevel: 'all' });
|
||||
const infer = ArmPolicy.ortInfer(ort, sess, { encOnce: !!meta.enc_once, featDyn: !!meta.feat_dyn });
|
||||
runner = new ArmPolicy.Runner(S, infer, { actScale: meta.act_scale || 1 }); // 2026-10-19:动作尺度随模型(旧模型无此字段 = 1)
|
||||
const FB = qs.get('fb') === null ? 1.8 : +qs.get('fb'); // 2026-10-20:全程目标反馈(fb=0 关闭)
|
||||
const COMMIT = qs.get('commit') === null ? 3 : Math.max(1, +qs.get('commit')); // 部署节奏:commit=1 每步规划
|
||||
runner = new ArmPolicy.Runner(S, infer, { actScale: meta.act_scale || 1, fbGain: FB, commit: COMMIT }); // 2026-10-19:动作尺度随模型(旧模型无此字段 = 1)
|
||||
/* 预热:首次推理有编译开销 */
|
||||
await infer(new Float32Array(8 * ArmPolicy.F_DIM), new Float32Array(8 * ArmPolicy.H * 6), 8);
|
||||
const tick = URL.createObjectURL(new Blob(['let h=null;onmessage=e=>{clearInterval(h);if(e.data>0)h=setInterval(()=>postMessage(0),e.data)}'], { type: 'text/javascript' }));
|
||||
|
||||
+81
-24
@@ -138,7 +138,19 @@ function refineStep(S, q, T, Rt, maxScale) {
|
||||
return r.concat([0.5 * (M[7] - M[5]) * 100, 0.5 * (M[2] - M[6]) * 100, 0.5 * (M[3] - M[1]) * 100]);
|
||||
};
|
||||
const e0 = e(q), m = e0.length, h = 1e-3, J = [];
|
||||
if (S.jac) {
|
||||
/* 解析几何雅可比(与 ml/sim/closed_loop.py 的 dls_steps(analytic=True) 同口径):
|
||||
有限差分在 float32/双精度下都会给反馈方向注入 ~1–4% 噪声,闭环里会被慢变误差放大。
|
||||
J[j][i] = −∂err_i/∂q_j:位置 err=T−p → +Jv;姿态 err=100·rotvec → +100·Jw。 */
|
||||
const jv = S.jac(q);
|
||||
for (let j = 0; j < 6; j++) {
|
||||
const col = [jv.Jv[0][j], jv.Jv[1][j], jv.Jv[2][j]];
|
||||
if (m === 6) col.push(100 * jv.Jw[0][j], 100 * jv.Jw[1][j], 100 * jv.Jw[2][j]);
|
||||
J.push(col);
|
||||
}
|
||||
} else {
|
||||
for (let j = 0; j < 6; j++) { const qa = q.slice(); qa[j] += h; const e1 = e(qa); J.push(e1.map((v, i) => -(v - e0[i]) / h)); }
|
||||
}
|
||||
// Δq = Jᵀ (J Jᵀ + λ²I)⁻¹ e,m ≤ 6
|
||||
const lam = 0.5, A = [];
|
||||
for (let i = 0; i < m; i++) { A.push([]); for (let k = 0; k < m; k++) { let s = i === k ? lam * lam : 0; for (let j = 0; j < 6; j++) s += J[j][i] * J[j][k]; A[i].push(s); } }
|
||||
@@ -179,14 +191,14 @@ class Runner {
|
||||
this.o = Object.assign({ K: 8, commit: 3, margin: 5, /* 2026-10-18:运行时投影余量保持 5 mm(真机护栏,不迁就数据分布);数据侧另行过滤认证间隙 < 3 mm 的老师轨迹,APG 训练余量 3 mm */
|
||||
projMax: 0.5, refineMm: 5, arriveMm: 1, arriveDeg: 0.5,
|
||||
stuckPlans: 5, lockSec: 1.0, subReachDeg: 5, subTimeout: 1.5, subRule: 'cross', subLeadSec: 0.02, seed: 12345, lookahead: true,
|
||||
actScale: 1, certBudget: 40, safetyMs: 30, firstMs: 45 }, opts || {});
|
||||
actScale: 1, certBudget: 40, safetyMs: 30, firstMs: 45, fbGain: 0, segCert: true, select: 'consist' }, opts || {});
|
||||
/* 2026-10-19:actScale = 模型 meta.act_scale(动作标签按 act_scale·STEP 归一化,旧模型 1);增量 = clamp(act, ±1)·actScale·STEP,
|
||||
与 ml/sim/closed_loop.py 同口径。subRule:'cross'(默认,越过顶点即切,与训练标签同口径;见 _subAdvance)/ 'timeout'(旧:< subReachDeg 或 subTimeout 超时)。 */ // 每条候选最多 40 次距离查询;安全层总预算 30 ms,第 1 条候选可用到 45 ms(超出按刹停处理)
|
||||
this.cert = makeCert(S, { leverTable: this.o.leverTable, cap: 20 });
|
||||
this.rng = makeRng(this.o.seed);
|
||||
/* 2026-10-18 第六轮(审查 B-1/B-2):耗时拆开记——inferMs 主推理、lookaheadMs 前瞻(第二次推理 + 8 份特征)、safetyMs 只含认证、
|
||||
planMs 整次规划(R9 口径:必须 < 60 ms 周期);certQ 每次规划新增的距离查询数,certHit 记忆命中数,certWhy 认证失败原因计数 */
|
||||
this.stats = { plans: 0, inferMs: [], lookaheadMs: [], safetyMs: [], planMs: [], planWarmMs: [], planColdMs: [], certQ: [], certHit: 0, certWhy: {}, brakes: 0, refine: 0, lookahead: 0, locks: 0, projected: 0 };
|
||||
this.stats = { plans: 0, inferMs: [], lookaheadMs: [], safetyMs: [], planMs: [], planWarmMs: [], planColdMs: [], certQ: [], certHit: 0, certWhy: {}, brakes: 0, refine: 0, lookahead: 0, locks: 0, projected: 0, partial: 0, starveTicks: 0 };
|
||||
this.reset(null);
|
||||
}
|
||||
reset(q0) {
|
||||
@@ -213,7 +225,10 @@ class Runner {
|
||||
if (!this.q) return null;
|
||||
const d = this.queue.shift();
|
||||
this.qPrev = this.q.slice();
|
||||
if (d) this.q = this.q.map((v, j) => v + d[j]);
|
||||
if (d) this.q = this.q.map((v, j) => { // 与 ml/sim/closed_loop.py 的 clamp_box 同口径:限位轴执行时夹到 LIM
|
||||
const id = this.S.ORDER[j], L = this.S.LIM[id], x = v + d[j];
|
||||
return L.cont ? x : Math.max(L.lo, Math.min(L.hi, x));
|
||||
});
|
||||
this.t += DT;
|
||||
if (this.goal && !this.queue.length) {
|
||||
const { e, oe } = this.err(this.q);
|
||||
@@ -250,25 +265,51 @@ class Runner {
|
||||
}
|
||||
if (adv) { this.subPrev = this.subs.shift(); this.subT = this.t; }
|
||||
}
|
||||
_certCommit(qe, steps) { // 认证:提交步 + 刹停段(先用离散判定快速剔除,再做距离下界认证)
|
||||
_certCommit(qe, steps, partial) { // 认证:提交步 + 刹停段(先用离散判定快速剔除,再做距离下界认证)
|
||||
/* partial:与 ml/sim/closed_loop.py 的 safety_partial 同口径——整段不过时依次缩短前缀,
|
||||
执行到第一个不安全步为止(而不是整段拒绝 → 刹停)。2026-10-20:浏览器 bench 刹车率 47% 的主因是整段拒绝。 */
|
||||
const tryPath = n => {
|
||||
const use = steps.slice(0, n);
|
||||
const pts = [qe.slice()]; let q = qe.slice();
|
||||
for (const d of steps) { q = q.map((v, j) => v + d[j]); pts.push(q.slice()); }
|
||||
for (let i = 1; i < pts.length; i++) if (!this.S.collideFree(pts[i])) return { ok: false, tail: [] };
|
||||
const tail = brakeSteps(steps.length ? steps[steps.length - 1] : [0, 0, 0, 0, 0, 0]);
|
||||
for (const d of use) { q = q.map((v, j) => v + d[j]); pts.push(q.slice()); }
|
||||
if (!this.o.segCert) {
|
||||
/* 离散判定(步点 + 中点,与 ml/sim/closed_loop.py 安全层同口径):capsule 模型余量已含在 collideFree。
|
||||
连续区间认证(segCert)~40 ms/次,是 50 Hz 部署的主要瓶颈;关闭后 planP50 预计 <30 ms。 */
|
||||
let prev = qe.slice();
|
||||
for (const p of pts.slice(1)) {
|
||||
const mid = prev.map((v, j) => 0.5 * (v + p[j]));
|
||||
if (!this.S.collideFree(mid) || !this.S.collideFree(p)) return null;
|
||||
prev = p;
|
||||
}
|
||||
const tail = brakeSteps(use.length ? use[use.length - 1] : [0, 0, 0, 0, 0, 0]);
|
||||
let qq = q;
|
||||
if (tail.length) { for (const d of tail) qq = qq.map((v, j) => v + d[j]); if (!this.S.collideFree(qq)) return null; }
|
||||
return { ok: true, tail: tail, steps: use };
|
||||
}
|
||||
for (let i = 1; i < pts.length; i++) if (!this.S.collideFree(pts[i])) return null;
|
||||
const tail = brakeSteps(use.length ? use[use.length - 1] : [0, 0, 0, 0, 0, 0]);
|
||||
/* 刹停段各步同向等比减速 → 关节空间里是一条直线,认证终点一段即可 */
|
||||
if (tail.length) { for (const d of tail) q = q.map((v, j) => v + d[j]); pts.push(q.slice()); }
|
||||
let qq = q;
|
||||
if (tail.length) { for (const d of tail) qq = qq.map((v, j) => v + d[j]); pts.push(qq.slice()); }
|
||||
const c = this.cert.path(pts, this.o.certBudget, this._until);
|
||||
if (!c.ok) this.stats.certWhy[c.why || 'collide'] = (this.stats.certWhy[c.why || 'collide'] || 0) + 1;
|
||||
return { ok: c.ok, tail };
|
||||
return { ok: c.ok, tail: tail, steps: use };
|
||||
};
|
||||
if (!partial) { const r = tryPath(steps.length); return r || { ok: false, tail: [] }; }
|
||||
for (let n = steps.length; n >= 1; n--) { const r = tryPath(n); if (r && r.ok) return r; }
|
||||
return { ok: false, tail: [] };
|
||||
}
|
||||
async plan() {
|
||||
if (!this.needPlan()) return;
|
||||
this.planning = true;
|
||||
const qlen0 = this.queue.length; // 规划开始时队列里可执行步数
|
||||
const t = now(), c0 = this.cert.counters(), wasCold = this.cold; // 第八轮:冷启动(含前瞻)与稳态分开记,R9 判稳态
|
||||
try { await this._plan(); } finally {
|
||||
this.planning = false; this._until = undefined;
|
||||
const c1 = this.cert.counters();
|
||||
const dt = now() - t; this.stats.planMs.push(dt); (wasCold ? this.stats.planColdMs : this.stats.planWarmMs).push(dt); this.stats.certQ.push(c1.queries - c0.queries); this.stats.certHit += c1.hits - c0.hits;
|
||||
/* 50 Hz 饥饿估计:规划耗时 dt 期间每 20 ms 消耗一步;超过 qlen0 的步数即队列空转 tick */
|
||||
this.stats.starveTicks += Math.max(0, Math.ceil(dt / (DT * 1000)) - qlen0);
|
||||
}
|
||||
}
|
||||
async _plan() {
|
||||
@@ -306,22 +347,21 @@ class Runner {
|
||||
if (sb[12] > 0.5) { this.subs = [0, 1].map(v => this.q.map((x, j) => x + sb[v * 6 + j] * 180)); this.subPrev = this.q.slice(); }
|
||||
}
|
||||
/* 候选:去掉前缀后的提交步,投影,打分 */
|
||||
const cands = [], near = S.criticalPairs(qe, o.margin + 10).slice(0, 64);
|
||||
const cands = [], near = o.projMax > 0 ? S.criticalPairs(qe, o.margin + 10).slice(0, 64) : [];
|
||||
// 2026-10-20:全程目标反馈(与 ml/sim/closed_loop.py 的 fb_gain 一致)——一次 DLS,加到所有候选所有步
|
||||
const fbStep = (o.fbGain > 0 && this.goal) ? refineStep(S, qe, this.goal.T, this.goal.R, 0.3).dq : null;
|
||||
for (let k = 0; k < K; k++) {
|
||||
const inc = this._cand(out.act, k, r);
|
||||
let steps = inc.slice(r, r + o.commit), q = qe.slice();
|
||||
const adj = [];
|
||||
for (const d of steps) {
|
||||
let qn = q.map((v, j) => v + d[j]);
|
||||
const qp = project(S, qn, o.margin, o.projMax, near);
|
||||
if (qp !== qn) this.stats.projected++;
|
||||
adj.push(qp.map((v, j) => v - q[j])); q = qp;
|
||||
}
|
||||
steps = adj;
|
||||
if (fbStep) for (let s = 0; s < H; s++) for (let j = 0; j < 6; j++) inc[s][j] += o.fbGain * fbStep[j];
|
||||
const steps = inc.slice(r, r + o.commit); // 先不投影;只对进入认证的候选投影(2026-10-20:投影 8 份候选占安全层 ~13 ms)
|
||||
const fut = []; let qq = qe.slice(); for (let s = r; s < H; s++) { qq = qq.map((v, j) => v + inc[s][j]); fut.push(qq); }
|
||||
let j1 = 0; for (let s = 0; s < H; s++) j1 += inc[s][0];
|
||||
let score = -2.0 * out.value[k];
|
||||
if (this.lastPlan) { // 与上一条已选计划的未来重叠步对齐:lastPlan[i] = 旧 qe 走 i 步,新 qe = lastPlan[commit],fut[s] 对应 lastPlan[s+commit+1]
|
||||
if (o.select === 'endpoint') {
|
||||
/* 2026-10-20:端点进度选择(与 ml/sim/closed_loop.py select='endpoint' 同口径)——n=512 时间效率 29→35%、ratio2s 0.343→0.285 */
|
||||
const qa = fut[fut.length - 1], pe = S.fk(qa, 0);
|
||||
score = -Math.hypot(pe[0] - this.goal.T[0], pe[1] - this.goal.T[1], pe[2] - this.goal.T[2]);
|
||||
} else if (this.lastPlan) { // 与上一条已选计划的未来重叠步对齐:lastPlan[i] = 旧 qe 走 i 步,新 qe = lastPlan[commit],fut[s] 对应 lastPlan[s+commit+1]
|
||||
// 2026-10-19 修错位(原对齐 lastPlan[s+commit],奖励比上一计划慢一步的候选;Python closed_loop.py 同步修正)
|
||||
let c = 0, w = 1;
|
||||
for (let s = 0; s < fut.length && s + o.commit + 1 < this.lastPlan.length; s++, w *= 0.85) {
|
||||
@@ -344,7 +384,7 @@ class Runner {
|
||||
/* 短前瞻:冷启动(新目标 / 目标跳变)时,各候选块末态再推一块,用其价值打分。
|
||||
2026-10-18 第六轮:去掉"卡死时也前瞻"——与仿真 ml/sim/closed_loop.py(只在首块前瞻)对齐;
|
||||
前瞻要算 8 份特征(8 次 gapMatrix cap40,沙箱 Node 实测 P99 126 ms),卡死时再做会让整次规划连续超周期。卡死由换向锁处理。 */
|
||||
if (o.lookahead && this.cold) {
|
||||
if (o.lookahead && this.cold && o.select !== 'endpoint') {
|
||||
this.stats.lookahead++;
|
||||
const feat2 = new Float32Array(pool.length * F_DIM), z2 = new Float32Array(pool.length * H * 6);
|
||||
pool.forEach((c, i) => {
|
||||
@@ -363,16 +403,33 @@ class Runner {
|
||||
collideFree 1.5 ms、criticalPairs 3.1 ms,推理本身 1.5 ms——耗时在几何查询,不在模型。此前截止只在候选之间检查,
|
||||
单条候选最多 40 次查询(≈150 ms)不受限。现在墙钟截止下沉到认证内部:第 1 条候选截止 t1+firstMs,其余共享到 t1+safetyMs;
|
||||
到点判不过 → 沿上次已认证的刹停段停,安全性不变,只是可能多刹停。 */
|
||||
let picked = null;
|
||||
let picked = null, pickedSteps = null;
|
||||
for (const c of pool) {
|
||||
if (c !== pool[0] && now() - t1 > o.safetyMs) break;
|
||||
this._until = t1 + (c === pool[0] ? Math.max(o.firstMs, o.safetyMs) : o.safetyMs);
|
||||
const v = this._certCommit(qe, c.steps); if (v.ok) { picked = c; this.brakeTail = v.tail; break; }
|
||||
let steps = c.steps;
|
||||
if (o.projMax > 0) { // 投影只做给要认证的候选(按需),不再对全部 K 条预算
|
||||
const adj = []; let q = qe.slice();
|
||||
for (const d of c.steps) {
|
||||
const qn = q.map((v, j) => v + d[j]);
|
||||
let qp = project(S, qn, o.margin, o.projMax, near);
|
||||
qp = qp.map((v, j) => { const L = S.LIM[S.ORDER[j]]; return L.cont ? v : Math.max(L.lo, Math.min(L.hi, v)); });
|
||||
if (qp !== qn) this.stats.projected++;
|
||||
adj.push(qp.map((v, j) => v - q[j])); q = qp;
|
||||
}
|
||||
steps = adj;
|
||||
}
|
||||
const v = this._certCommit(qe, steps, true);
|
||||
if (v.ok) { picked = c; pickedSteps = v.steps; this.brakeTail = v.tail; break; }
|
||||
}
|
||||
this._until = undefined;
|
||||
this.stats.safetyMs.push(now() - t1);
|
||||
if (picked) {
|
||||
this.queue.push(...picked.steps); this.lastPlan = [qe.slice()].concat(picked.fut); this.brakeRun = 0;
|
||||
if (pickedSteps.length < picked.steps.length) this.stats.partial++;
|
||||
this.queue.push(...pickedSteps);
|
||||
/* 部分前缀时实际执行步数 < commit,一致性对齐的偏移不再成立 → 置空(Python 侧同轮次 14 的部分前缀满分对齐留待后续统一) */
|
||||
this.lastPlan = pickedSteps.length === picked.steps.length ? [qe.slice()].concat(picked.fut) : null;
|
||||
this.brakeRun = 0;
|
||||
} else {
|
||||
this.stats.brakes++; this.brakeRun++;
|
||||
if (this.brakeTail.length) { this.queue.push(...this.brakeTail); this.brakeTail = []; }
|
||||
|
||||
+18
-1
@@ -731,6 +731,23 @@ function make(cfg) {
|
||||
for (let i = 0; i < n; i++) M = mul3(M, rotAxis(D[ORDER[i]], q[i] * D2R));
|
||||
return M;
|
||||
}
|
||||
/* 几何雅可比(对度):Jv[i][j] = d p_i/d q_j (mm/deg),Jw[i][j] = 世界角速度分量/deg。
|
||||
J4/J5 同轴不影响正确性:两者各贡献同一世界轴。 */
|
||||
function jac(q) {
|
||||
const { R: Rs, T: Ts } = cumXf(q);
|
||||
const p = fk(q, 0);
|
||||
const Jv = [[], [], []], Jw = [[], [], []];
|
||||
for (let j = 0; j < 6; j++) {
|
||||
const id = ORDER[j], Rj = Rs[j], tj = Ts[j], pj = P[id];
|
||||
const a = mv3(Rj, D[id]);
|
||||
const lever = [p[0] - (Rj[0] * pj[0] + Rj[1] * pj[1] + Rj[2] * pj[2] + tj[0]),
|
||||
p[1] - (Rj[3] * pj[0] + Rj[4] * pj[1] + Rj[5] * pj[2] + tj[1]),
|
||||
p[2] - (Rj[6] * pj[0] + Rj[7] * pj[1] + Rj[8] * pj[2] + tj[2])];
|
||||
const v = cross3(a, lever);
|
||||
for (let i = 0; i < 3; i++) { Jv[i][j] = v[i] * D2R; Jw[i][j] = a[i] * D2R; }
|
||||
}
|
||||
return { Jv: Jv, Jw: Jw };
|
||||
}
|
||||
/* M5 第 3 列(工具轴)列向量传播:J4/J5 同轴 ⇒ R4·R5=R(θ4+θ5) 合并为一次旋转,
|
||||
只乘单位向量、不构造 3×3、免 T3/mul3/rotErrDeg/acos。与 orient(q,5) 列 2 一致(≤1e-15)。 */
|
||||
const SAMEAX = D.J4[0] === D.J5[0] && D.J4[1] === D.J5[1] && D.J4[2] === D.J5[2];
|
||||
@@ -3233,7 +3250,7 @@ function make(cfg) {
|
||||
return { poseHit: pHit, poseTried: pTried, poseErr: pErr, poseMs: pTried ? pMs / pTried : 0 };
|
||||
}
|
||||
|
||||
return { fk: fk, fkChain: fkChain, solve: solve, solveTo: solveTo, solveWarm: solveWarm, solveDyn: solveDyn,
|
||||
return { fk: fk, fkChain: fkChain, jac: jac, solve: solve, solveTo: solveTo, solveWarm: solveWarm, solveDyn: solveDyn,
|
||||
solveRoute: solveRoute, routeFrom: routeFrom, transitPt: transitPt, planAround: planAround, edgeFree: edgeFree, PST: PST, unwrapTo: unwrapTo, rtWarm: rtWarm, rtReset: () => { RT = null; }, rmPlan: rmPlan, rmSmooth: rmSmooth, modelFingerprint: modelFingerprint, RM: RM, wd: wd, classGap: classGap, classFingerprint: classFingerprint, P2D: P2D,
|
||||
mixSolve: mixSolve, closest: closest, closest6: closest6, closestOri: closestOri, orient: orient,
|
||||
branch: branch, selfTest: selfTest, poseSelfTest: poseSelfTest,
|
||||
|
||||
Reference in New Issue
Block a user