@simplexai/localmodels-win32-x64 0.1.0-dev.66 → 0.1.0-dev.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bootstrap.identity +1 -1
- package/bootstrap.sha256 +22 -22
- package/modules/localmodels/__init__.py +1 -1
- package/modules/localmodels/bifrost_config.py +11 -6
- package/modules/localmodels/catalog.json +9 -9
- package/modules/localmodels/engines-strata-poly-0.2.20-poly.7.json +94 -0
- package/modules/localmodels/gateway_bifrost.py +2 -1
- package/modules/localmodels/library_serve.py +38 -7
- package/modules/localmodels/pi_profile.py +1 -1
- package/modules/localmodels/process_identity.py +73 -10
- package/modules/localmodels/runtime_io.py +1 -0
- package/modules/localmodels/runtime_windows_acl.py +47 -17
- package/modules/localmodels/speech_jobs.py +2 -0
- package/modules/localmodels/speech_workers.py +6 -5
- package/modules/localmodels/{strata-poly-serve-0.2.20-poly.6.txt → strata-poly-serve-0.2.20-poly.7.txt} +1 -1
- package/modules/{simplex_localmodels-0.1.0.dev66.dist-info → simplex_localmodels-0.1.0.dev69.dist-info}/METADATA +1 -1
- package/modules/{simplex_localmodels-0.1.0.dev66.dist-info → simplex_localmodels-0.1.0.dev69.dist-info}/RECORD +19 -19
- package/package.json +1 -1
- package/tool.json +1 -1
- package/modules/localmodels/engines-strata-poly-0.2.20-poly.6.json +0 -94
- /package/modules/{simplex_localmodels-0.1.0.dev66.dist-info → simplex_localmodels-0.1.0.dev69.dist-info}/WHEEL +0 -0
- /package/modules/{simplex_localmodels-0.1.0.dev66.dist-info → simplex_localmodels-0.1.0.dev69.dist-info}/entry_points.txt +0 -0
- /package/modules/{simplex_localmodels-0.1.0.dev66.dist-info → simplex_localmodels-0.1.0.dev69.dist-info}/licenses/NOTICE +0 -0
- /package/modules/{simplex_localmodels-0.1.0.dev66.dist-info → simplex_localmodels-0.1.0.dev69.dist-info}/licenses/localmodels/HERMES-LICENSE +0 -0
package/bootstrap.identity
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
win32-x64
|
|
1
|
+
win32-x64 f69bcb5a0a60dff7cb835daa561c109cab251181 0.1.0.dev69 python/python.exe modules
|
package/bootstrap.sha256
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
0d524ff86494cc8521afe5ed5a4f0c3a108644d4874d7b574c602406557010d1 bootstrap.identity
|
|
2
2
|
15f49306ae54bb208f5a65763f59522a9193d5b01b31279c9bab116bba7ffe5c kit.py
|
|
3
3
|
821556e6336796450ab852d375117b48a4887e71d255794fd6318d99982a5ab6 modules/localmodels/HERMES-LICENSE
|
|
4
|
-
|
|
4
|
+
921a89b6889a15968809a45bebf88269a6c7bc85a3211ef1cd2ca0ddb1e08bf3 modules/localmodels/__init__.py
|
|
5
5
|
f30f1699b88743ff573f0808dda1349a72d3727112fda4dfeff6592ce09a9798 modules/localmodels/__main__.py
|
|
6
6
|
de3e4d8388603c95329a1c4c14a8862effe7c4cb3a9c965fe9a6c769585983c4 modules/localmodels/app.py
|
|
7
7
|
57a4799a2a94ce5af4d8834e1d35b599ab5de8ab1ab168c38ffcc3662e76f9db modules/localmodels/apple_sensors.py
|
|
@@ -14,11 +14,11 @@ e44db2b6aded3230c57c3b16b0b36dce83ac5e8c11335b09798942a032ef1f41 modules/localm
|
|
|
14
14
|
6323d9ed265223879e085613467c0e8f623eb78e0d90a657cb8440dd6bfbd69e modules/localmodels/bifrost_admin.py
|
|
15
15
|
4b7918963c8bd6d312f1650b9c299949c258c35a2815c311551bcb7d2420bae9 modules/localmodels/bifrost_checks.py
|
|
16
16
|
b2ad1b0e796aed912d5787b13250d2b66c41b890a8ac5e3da8e97f8edd519f03 modules/localmodels/bifrost_clients.py
|
|
17
|
-
|
|
17
|
+
316e28079f88f66b8399a190ba682d7741edabecf31ddec37f8bf9e543def001 modules/localmodels/bifrost_config.py
|
|
18
18
|
3b2090c9e7a8257ee8942d161c9e5c86070aabea825106401c30b26198886cd9 modules/localmodels/bifrost_log.py
|
|
19
19
|
c4d05193b87f70b085f5b18c28cb2c679a0d8fa84ffcfcea41d12f4694df2d5d modules/localmodels/bifrost_models.py
|
|
20
20
|
4232189e364689c23fd5cdb28bd930d47af4cccc50b2e22376670c33da8882bd modules/localmodels/bifrost_pi.py
|
|
21
|
-
|
|
21
|
+
5f3662981664153a5788ea8e5a525c4aa3951c374259ba9fad5cd5f2af7a0522 modules/localmodels/catalog.json
|
|
22
22
|
aadf169f7a7472c31978ca9e8bbf7f169936387dcb11a00d78195bb1e2010e8f modules/localmodels/catalog.py
|
|
23
23
|
93982a57a4116a73d3c8b4ec41f962a025ab33b774d2c070ea31dccd47f40ec1 modules/localmodels/catalog_add.py
|
|
24
24
|
29861972b5b72f33f9218430c240bfcf68cf2a2f86996a3027c42b361ca3ff11 modules/localmodels/catalog_license.py
|
|
@@ -61,7 +61,7 @@ c231f74b276785186e45836d019e59b20d5db4caa71857f523e160d1bca0f130 modules/localm
|
|
|
61
61
|
5263e150b61e1246d9655354fe55067b4dcae31410be6c1b241e64c27dbf307b modules/localmodels/engines-strata-0.1.49.2.json
|
|
62
62
|
a1530ce73b5f93dd2f4a031897518f404d43bc33abc1fff54706b4a408f52fb8 modules/localmodels/engines-strata-0.1.59.1.json
|
|
63
63
|
970143361bcc272a3e5547f947f3f5588878dce4262582b3b4a242a16fafd9e6 modules/localmodels/engines-strata-poly-0.2.20-poly.1.json
|
|
64
|
-
|
|
64
|
+
c48452695a02354eb3296b11bf1ccbe4bcaf4c4d23142eaf3620232828102380 modules/localmodels/engines-strata-poly-0.2.20-poly.7.json
|
|
65
65
|
309a42f9d8123c210c5899738593ea05e42960d2bbdae45ed5ea535b563adbc9 modules/localmodels/engines-whisper-b5454.json
|
|
66
66
|
5fa9430bd869937c6c9d527e7e561fd46cf77aa55bd8c9e171625cb9c37f1e51 modules/localmodels/engines.json
|
|
67
67
|
654d4e6083ca93aecd72f89a0e3d0f7f7043f38b8fef1e61b8328966db595e0b modules/localmodels/engines.py
|
|
@@ -73,7 +73,7 @@ a1530ce73b5f93dd2f4a031897518f404d43bc33abc1fff54706b4a408f52fb8 modules/localm
|
|
|
73
73
|
bbbca403a04582c20be419366416b95f18a35a77c4725ff30081e9635f4b569c modules/localmodels/gateway_accept.py
|
|
74
74
|
977a5a05dd792a61b81b2a12326257d9b83d3fe4355fa5cffbae3dd756ff81c4 modules/localmodels/gateway_admin.py
|
|
75
75
|
5eb7cdc5d568b8998b487149f9532f8bf1d136e8cdd6f40ac5d7034bd66dca3e modules/localmodels/gateway_app_bifrost.py
|
|
76
|
-
|
|
76
|
+
bace8e6885847d407cc1459541d1864b547e43062ece4252670131f65a79eda3 modules/localmodels/gateway_bifrost.py
|
|
77
77
|
6d3a8439f0439cf39b2ee2d62a81a47d6860dcfc10da0570e1cdb185e8028e75 modules/localmodels/gateway_cli.py
|
|
78
78
|
7f6fc2855eda4d6114191ada465efffc6de7d353f4aed410900c8f8079916029 modules/localmodels/gateway_clients.py
|
|
79
79
|
382d7410df8d09f69172c362478efeef5bacb079b7cd5ccd0371650c08fafc51 modules/localmodels/gateway_foundations.py
|
|
@@ -111,7 +111,7 @@ ba382cb785dbf7a500a306e27676e39e0b3d87a2801417e60d679677ebe74503 modules/localm
|
|
|
111
111
|
fad25e187058d5e99649aea2e893586a4bd148a389da895374ec988c35b93840 modules/localmodels/library_order.py
|
|
112
112
|
b2dc09af76c3cf3bd19e233f0f0858b0f2a50672d2d7605865e2b6d945b31580 modules/localmodels/library_poly.py
|
|
113
113
|
df766545426572e9abcdae30dd097c00c1a5930a58991812f24bad17318af235 modules/localmodels/library_pricing.py
|
|
114
|
-
|
|
114
|
+
e0b5f1fd241b959225532b3886f998036569824644901457065741f604356e1d modules/localmodels/library_serve.py
|
|
115
115
|
00c0f73c08f4656f04793d33fa1d54752bf2fb66c7132a1191b1b57928f884d2 modules/localmodels/library_smoke.py
|
|
116
116
|
a28afddf43feb844b9bf7b940dd940dedf03452c70257f19e6b7493da5f63bd8 modules/localmodels/library_state.py
|
|
117
117
|
06c5aabce1782d274414cd5db9b41155f03b210bfaca1adbb06a08f1eb00ddc9 modules/localmodels/library_status.py
|
|
@@ -129,7 +129,7 @@ b054849c733e1f9aca64a2890a5de0080130e1aaa5181336d6837d9a56784b11 modules/localm
|
|
|
129
129
|
fe6eafed91bb351280df5def32d1111ef4c6033ab39da2739c8a6e2430403542 modules/localmodels/npm_transport.py
|
|
130
130
|
eb1830907551bd89894629a5fd85984550b5525731be12f4f8efd8d0fab763aa modules/localmodels/nvml_ctypes.py
|
|
131
131
|
3753b974acf513922a0fcb68531bc2ec49933d40f18b3dcef0d45e4163783a35 modules/localmodels/openapi.yaml
|
|
132
|
-
|
|
132
|
+
830caf1ecad11795c77277ea27ca79d4e8a1c762951496ff2f36cc65641d25ba modules/localmodels/pi_profile.py
|
|
133
133
|
36dfa59d1a16e85bf4e470dc43e3a1abb39939b93b6ac90ad01dda69c4b14651 modules/localmodels/plan_envelope.py
|
|
134
134
|
8ad5780cc8d5763fb1809eb7753cfcf057b82920f86f1fae7fa5955987a650ea modules/localmodels/planning/__init__.py
|
|
135
135
|
53e388bbff600904379bb95b8b3eaffb4a4c0153f0388e97b5aa6a1b50fa83a8 modules/localmodels/planning/budget.py
|
|
@@ -142,7 +142,7 @@ a3308bd747cd61cc58e52f3bac3a95f7a7bcb5dca4dd954c5054148e56bd8d38 modules/localm
|
|
|
142
142
|
4b10583c45a7e0882ea1e36dcd5e86536afdfcfc44ca22b355b3a5f745680472 modules/localmodels/privacy.py
|
|
143
143
|
0aee52c415e2e7fd246d8ae94bb4b1012ff2a71ebf17e33f2f53e08e2526e396 modules/localmodels/privacy_acceptance.py
|
|
144
144
|
c19a15f8678ed180a11454826017ccac8636a12571bd2459a6724b12479a8ac4 modules/localmodels/probe.py
|
|
145
|
-
|
|
145
|
+
f86fc073a37c81174858f9bfa3d2e7d0d04e3f16aeaaad327ae104016368eb35 modules/localmodels/process_identity.py
|
|
146
146
|
26cb67704ebe22eee93e41c025b1a2f70226ca271dcb8d946b2fa6ab7efe5d31 modules/localmodels/process_identity_darwin.py
|
|
147
147
|
cd041b75d772f6280433dc493346310f69cc0a522e5e94a1037728994b8dfb8c modules/localmodels/process_identity_linux.py
|
|
148
148
|
3fd467c97d644b24f7c60a93341dcf324fe60d6f11209bc8219ef95157ce7fe0 modules/localmodels/process_windows.py
|
|
@@ -172,11 +172,11 @@ e8a3b838e04ee722befc110cd83e793ed3142a34130900128c7ee55941df49d1 modules/localm
|
|
|
172
172
|
d3c7ec5b10fd4418a6c39ba96fde37b3aeb280fc1235dc4974d958e5651ada3a modules/localmodels/runtime_cli.py
|
|
173
173
|
1cde2a4e0272b8b5419ec65f31aa4196c7c09dfc66d482df25c8f596968900c3 modules/localmodels/runtime_discovery.py
|
|
174
174
|
622fb00414d3ef4f8e1f7ba553642d30ba5cfc3df8c4fa928043299e529b6abe modules/localmodels/runtime_install.py
|
|
175
|
-
|
|
175
|
+
66ffe24e30cf5660e0b6bd5cbf9306c81c15d1adb326ccc54b17b8e501c54578 modules/localmodels/runtime_io.py
|
|
176
176
|
1ddbc5b6a90b7881d56072e83c836ad4829b934aafc9842da95438f597fdb65b modules/localmodels/runtime_pi.py
|
|
177
177
|
a785412104d407392d13cbd98dc649842bf5d4af3b563a86ac3a740a83f9f7a3 modules/localmodels/runtime_process.py
|
|
178
178
|
098b2d9d9ccd62ddda0f0cb80e548ba1ea9231744a645b0cd5bf1a4fad1e8cab modules/localmodels/runtime_releases.py
|
|
179
|
-
|
|
179
|
+
053224d8e76b1354bceb8d04a230cafb7f5e16322f0b161e2fea623af1daaa80 modules/localmodels/runtime_windows_acl.py
|
|
180
180
|
a4b7df305d2c2bfb9cc323cb5f579f08d1db03c7e7d2432bdda64cc393086a53 modules/localmodels/service_autostart.py
|
|
181
181
|
63be3a5c5998f0cc638d268f9f7fdfd5e9321c74e98efb41c4218067f813cb0b modules/localmodels/service_control.py
|
|
182
182
|
e395fb5c99ad9f8fe44ee88919abcf6d62a209aa80b7604f482ed1908fb4fc90 modules/localmodels/service_deployment.py
|
|
@@ -200,13 +200,13 @@ bb9bf0e4374b5bed43afd9cf11d81ca1082282f94b7cb98f51bd52ef0bdaa673 modules/localm
|
|
|
200
200
|
6362ee6a88c61af836a4658c3ba1a8e9e09640f351e256284e305cc98b10111f modules/localmodels/speech_admission.py
|
|
201
201
|
70ec0be25263d11822cfa56b7e3c526db9234837d60c95cff469e603df545ec3 modules/localmodels/speech_catalog.py
|
|
202
202
|
04a1ccf49fa2be7ca91249f9a0bf7a8abc0d82f2879e38e3458601a08709439d modules/localmodels/speech_cli.py
|
|
203
|
-
|
|
203
|
+
c9a682854102da8eb4200810f58722df5543ca6d4b7e669d047a05518a74f54e modules/localmodels/speech_jobs.py
|
|
204
204
|
1f462e0fc820979c79c44f4a49741ce34c0f2aba2002f979daa7eff6e7d24c2a modules/localmodels/speech_model.py
|
|
205
205
|
a608636dc4983b63729d0c6f30452ac1d1deb1e88a5f3773d3bea09f79caf25b modules/localmodels/speech_serve.py
|
|
206
206
|
75be40b1775fb5294e76750a5fd2ba5d9472a0e7b8cf48cdf9297edda16ddc14 modules/localmodels/speech_server.py
|
|
207
207
|
5909d481af459a0ffa933522cf26c474f987a17d2113dc8744d08b6bcdbdfe46 modules/localmodels/speech_state.py
|
|
208
208
|
db442797ca686f7ee5169f0c70e372831f5bf1b0be5cdda6c765d600c54ed4ea modules/localmodels/speech_worker_sensevoice.py
|
|
209
|
-
|
|
209
|
+
bfff365a531e498286e175d4b04eda1609dabc708bde11853c45a4b9df8ea80d modules/localmodels/speech_workers.py
|
|
210
210
|
2d11350cff2dd207503bee5636904a6ab737f8085c540748f369c3702b74ebf6 modules/localmodels/stack.py
|
|
211
211
|
bd5e01ab0828816c38a43050058b8f3df888bed4443142f50550bcca542ad72a modules/localmodels/stack_arena.py
|
|
212
212
|
7552531dd59454e29e548a70b6c33390559b4a2000fa5814deb424ae19657de5 modules/localmodels/stack_args.py
|
|
@@ -281,7 +281,7 @@ c28a85709cf12ac9114e311703ec9e60fdbae3dd23f10eab26969ad5f56555a1 modules/localm
|
|
|
281
281
|
fe7e32dbde87f887e099564364e818851dada94c1312124ed176e7d9cd879f52 modules/localmodels/stack_whatif.py
|
|
282
282
|
aa2496ee31f531000907de70ff117909d24c07d989b7315d429a648350a97eba modules/localmodels/startlux-decide-83fe6c7d.txt
|
|
283
283
|
94158929dcf13d1e189b8e552ae3f646fc484767e4d47eecf2c37cbf47130816 modules/localmodels/strata-poly-serve-0.2.20-poly.1.txt
|
|
284
|
-
|
|
284
|
+
6786a3355e2c7ec870e2169091a0fb0173f55d049d0defe3e7479dacf5e5c5b4 modules/localmodels/strata-poly-serve-0.2.20-poly.7.txt
|
|
285
285
|
c9a84cfa4e4dfad81510fc6f111c7db76929d566cd96c49fafdc5f8e5447f5b1 modules/localmodels/strata_poly_server.py
|
|
286
286
|
6d24c24fd0eda248b30783de276b4dc9ad8d6ef472238805846c6bfdafe2dede modules/localmodels/suite.py
|
|
287
287
|
02a53037a7010566090c87c603b703bca439ed85c1700717103eaaaea995e00f modules/localmodels/telemetry_math.py
|
|
@@ -315,13 +315,13 @@ e6356d972d86a3f3fee7b31714021e50670d2be9327f1c6d1a26529fdec048a1 modules/localm
|
|
|
315
315
|
5b301ed9ff864d51669e133a1175eb4d5661db47eb857eccb2497fbc0d7f79bf modules/localmodels/web/view/view.js
|
|
316
316
|
84535ea1c54aeb68bfbfbe357b7f19e7a2d69b9ce9ff2f4f7e8b6a668f76eb3f modules/localmodels/win_probe.py
|
|
317
317
|
d3be4542d9b3f32a61bc65cc4264a74301b0eab6f302a30f43e878e9e9b228d6 modules/localmodels/windows_job.py
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
d5d0ff1a812a108c50ed59eb504c60763fde1316386f85207d1d2206518a55a7 modules/simplex_localmodels-0.1.0.
|
|
321
|
-
3a3059212ac60178113110eaaeafa6dbafe72c598d64d3616cbb498ae9c881f7 modules/simplex_localmodels-0.1.0.
|
|
322
|
-
1ac9562326e7b0a3a152f0eb670d82abd1038ea971a0574453682c68a5ee5b8e modules/simplex_localmodels-0.1.0.
|
|
323
|
-
821556e6336796450ab852d375117b48a4887e71d255794fd6318d99982a5ab6 modules/simplex_localmodels-0.1.0.
|
|
324
|
-
|
|
318
|
+
8d0beb2f8fe3927ebbe7c83173df7f8bcbcbfdee5b88e5d0db3d4af830c9c087 modules/simplex_localmodels-0.1.0.dev69.dist-info/METADATA
|
|
319
|
+
f56dd2a10136fd1f2099ec875e17327c22767b2b07effe3dc8d7828e91421643 modules/simplex_localmodels-0.1.0.dev69.dist-info/RECORD
|
|
320
|
+
d5d0ff1a812a108c50ed59eb504c60763fde1316386f85207d1d2206518a55a7 modules/simplex_localmodels-0.1.0.dev69.dist-info/WHEEL
|
|
321
|
+
3a3059212ac60178113110eaaeafa6dbafe72c598d64d3616cbb498ae9c881f7 modules/simplex_localmodels-0.1.0.dev69.dist-info/entry_points.txt
|
|
322
|
+
1ac9562326e7b0a3a152f0eb670d82abd1038ea971a0574453682c68a5ee5b8e modules/simplex_localmodels-0.1.0.dev69.dist-info/licenses/NOTICE
|
|
323
|
+
821556e6336796450ab852d375117b48a4887e71d255794fd6318d99982a5ab6 modules/simplex_localmodels-0.1.0.dev69.dist-info/licenses/localmodels/HERMES-LICENSE
|
|
324
|
+
be7b5207ac382dccbe2e6ce85899294798ec8a4242376e966019d172df93084c package.json
|
|
325
325
|
6c3570716921fd402c441c3ad8fab159f80c60fc55dd31ebb273e18d0764b2ff python/DLLs/_asyncio.pyd
|
|
326
326
|
4ce0888c64c92806abfa067ddd0a3fffa0cb0be230c2d5a6054094af343c64a7 python/DLLs/_bz2.pyd
|
|
327
327
|
0abcfe23e653e2bc6da07265dcdbe7c1f381bc97183e251db484ea4e33abfcbe python/DLLs/_ctypes.pyd
|
|
@@ -3456,4 +3456,4 @@ a039bdd83885e1256724486b16e2c25ace6927a708e446fd7dcb20af11c500de python/tcl/tk8
|
|
|
3456
3456
|
06f679a910ccf05f9daa329654bd5e27a2791f5374a19b14706c9780c1d3aa24 python/tcl/tkstub86.lib
|
|
3457
3457
|
d5e4d9a3e835fa679450145d6a7d94e36573a509317111904d9b3712c30d9066 python/vcruntime140.dll
|
|
3458
3458
|
1f2d41c4aa5db0bc33ebf7b66d72943a817d7ce6cbe880502a9403823633093f python/vcruntime140_1.dll
|
|
3459
|
-
|
|
3459
|
+
c1db8c99d5eb3bcca9491182d6a5672797087f78f6783090111403b70b0233b0 tool.json
|
|
@@ -12,7 +12,7 @@ from collections.abc import Iterable
|
|
|
12
12
|
from pathlib import Path
|
|
13
13
|
from typing import Any
|
|
14
14
|
|
|
15
|
-
from localmodels import harness_core
|
|
15
|
+
from localmodels import harness_core, runtime_io
|
|
16
16
|
from localmodels.gateway_requests import AuxEndpoint
|
|
17
17
|
from localmodels.harness_core import GatewayPlan, HarnessError
|
|
18
18
|
|
|
@@ -429,7 +429,7 @@ def _text(value: Any) -> str:
|
|
|
429
429
|
def clear_store(app: Path) -> None:
|
|
430
430
|
"""Delete Bifrost's derived SQLite config store so the next start rebuilds it from config.json."""
|
|
431
431
|
for name in STORE:
|
|
432
|
-
(app / name
|
|
432
|
+
runtime_io.unlink_with_retry(app / name, missing_ok=True)
|
|
433
433
|
|
|
434
434
|
|
|
435
435
|
def write_config(
|
|
@@ -455,10 +455,15 @@ def write_config(
|
|
|
455
455
|
app.mkdir(parents=True, exist_ok=True)
|
|
456
456
|
app.chmod(0o700)
|
|
457
457
|
tmp = path.with_name(f"{name}.tmp")
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
458
|
+
try:
|
|
459
|
+
fd = os.open(tmp, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600)
|
|
460
|
+
with os.fdopen(fd, "w", encoding="utf-8") as f:
|
|
461
|
+
f.write(text)
|
|
462
|
+
runtime_io.rename_with_retry(tmp, path, replace=True)
|
|
463
|
+
except BaseException:
|
|
464
|
+
with contextlib.suppress(OSError):
|
|
465
|
+
tmp.unlink(missing_ok=True)
|
|
466
|
+
raise
|
|
462
467
|
changed = True
|
|
463
468
|
if changed and drop_store:
|
|
464
469
|
clear_store(app)
|
|
@@ -4458,8 +4458,8 @@
|
|
|
4458
4458
|
"vision": true
|
|
4459
4459
|
}
|
|
4460
4460
|
],
|
|
4461
|
-
"engine": "strata-poly-0.2.20-poly.
|
|
4462
|
-
"venv": "strata-poly-serve-0.2.20-poly.
|
|
4461
|
+
"engine": "strata-poly-0.2.20-poly.7",
|
|
4462
|
+
"venv": "strata-poly-serve-0.2.20-poly.7.txt",
|
|
4463
4463
|
"venv_bytes": 41943040,
|
|
4464
4464
|
"alias": "inkling-2-mini-ud-q4_k_xl",
|
|
4465
4465
|
"contract": "chat",
|
|
@@ -4539,7 +4539,7 @@
|
|
|
4539
4539
|
],
|
|
4540
4540
|
"health_path": "/health",
|
|
4541
4541
|
"verify_timeout_s": 1800,
|
|
4542
|
-
"note": "Thinking Machines Inkling 2 Mini UD-Q4_K_XL (Mainline_Support inkling2_loop, 5.41 BPW) on PolyStrata v0.2.20-poly.
|
|
4542
|
+
"note": "Thinking Machines Inkling 2 Mini UD-Q4_K_XL (Mainline_Support inkling2_loop, 5.41 BPW) on PolyStrata v0.2.20-poly.7 for 24 GB+ NVIDIA CUDA 13 cards (driver >= 580) with 128K FP8 KV cache and native vision (strata-vision GPU on >= 23.5 GiB cards, CPU below). Default concurrency is 2 parallel requests (parallel: 2 -> --batch 2); --prefer concurrent still falls back to llama.cpp Inkling 2 Mini pending live concurrent benchmarks.\nMeasured on local-118 GPU0 24 GB share (2026-11-23-polystrata-inkling2-mini-local118): all 3072/3072 routed experts fit in VRAM (14.7 GiB, 0.0 GiB offloaded), strata-vision GPU 791 MiB, whole-card peak 21,601 MiB across 58.4K and 105.6K prompts (2,463 MiB below the 24 GB gate), anonymous host RAM peak 1.7 GiB, 176.4 tok/s short decode, 6,869 tok/s prefill and 138.8 tok/s decode after 58.4K prompt (needle hit, vision and tool calling passed). Promoted above same-score llama.cpp Inkling on supported CUDA 13 NVIDIA hosts by roadmap decision 66.\nLinux enables --vram-pool via card_args (INK2VP, 2026-11-30-ink2-q4xl-vrampool-lab12021, physical RTX 4090 D 24 GB, parallel=2, GPU strata-vision 1,162 MiB): without --vram-pool whole-card VRAM peaks at 23,757-23,761 MiB (~205 MiB over the 23,552 MiB gate, leaving ~803 MiB free); with --vram-pool whole-card peak stays flat at 23,035-23,057 MiB across 2,582 samples (1,507 MiB free, 0 foreign MiB, oom_kill=0) with identical 1K-120K decode 122.4->86.1 tok/s, NIAH 4/4, 2x56K/2x100K/2x120K HTTP 200, 100K prefill interference 39.85 tok/s, and agentloop 9/9. Windows runs without --vram-pool until verified on a physical 24 GB Windows card.",
|
|
4543
4543
|
"quality": {
|
|
4544
4544
|
"score": 53,
|
|
4545
4545
|
"sources": [
|
|
@@ -4608,8 +4608,8 @@
|
|
|
4608
4608
|
"vision": true
|
|
4609
4609
|
}
|
|
4610
4610
|
],
|
|
4611
|
-
"engine": "strata-poly-0.2.20-poly.
|
|
4612
|
-
"venv": "strata-poly-serve-0.2.20-poly.
|
|
4611
|
+
"engine": "strata-poly-0.2.20-poly.7",
|
|
4612
|
+
"venv": "strata-poly-serve-0.2.20-poly.7.txt",
|
|
4613
4613
|
"venv_bytes": 41943040,
|
|
4614
4614
|
"alias": "inkling-2-mini-ud-q3_k_xl",
|
|
4615
4615
|
"contract": "chat",
|
|
@@ -4691,7 +4691,7 @@
|
|
|
4691
4691
|
],
|
|
4692
4692
|
"health_path": "/health",
|
|
4693
4693
|
"verify_timeout_s": 1800,
|
|
4694
|
-
"note": "Thinking Machines Inkling 2 Mini UD-Q3_K_XL (Mainline_Support inkling2_loop, 4.18 BPW) on PolyStrata v0.2.20-poly.
|
|
4694
|
+
"note": "Thinking Machines Inkling 2 Mini UD-Q3_K_XL (Mainline_Support inkling2_loop, 4.18 BPW) on PolyStrata v0.2.20-poly.7 for 8, 12 and 16 GB NVIDIA CUDA 13 cards (driver >= 580) with >= 24 GB RAM. Uses 64K FP8 KV cache, --vram-pool (caps prefill staging and KV growth strictly inside the card budget), --ram-experts-mib 6144, --tail-skip 0, and CPU strata-vision on < 23.5 GiB cards. Default concurrency is 2 parallel requests (parallel: 2 -> --batch 2) and LoopCD-Hidden (--loopcd-hidden 0.2) is enabled by default.\nMeasured on local-118 GPU0 stand-in shares (2026-11-23-polystrata-inkling2-mini-local118, 58.4K prompt needle + vision + tool calls all passed): 16 GB share 3058/3072 experts in VRAM, peak 14,498 MiB (1,374 MiB below gate), 178.3 tok/s short / 61.1 tok/s at 58.4K; 12 GB share 1977/3072 experts, peak 10,388 MiB, 138.7 / 47.0 tok/s; 8 GB share 896/3072 experts, peak 6,292 MiB (1,388 MiB below gate), cgroup peak 8.7 GiB / anon 8.4 GiB, 65.6 / 30.3 tok/s (server-class CPU stand-in upper bound; upstream RTX 4070 Laptop 8 GB measured 56 / 42 tok/s). Promoted by roadmap decision 66.\nWindows runs without --vram-pool (card_args keeps it on Linux). PSIW (2026-11-23, RTX 4070 Laptop 8 GB, Windows 11): with it the engine claims a 13,204 MiB pool from the process budget Windows reports, larger than the card, and every request longer than about 30 tokens gets \"no VRAM for a prompt's buffers\"; stack apply failed 3 times out of 3 on the 0.2.19-poly.1 and 0.2.20-poly.1 engines. Without it, on 0.2.19-poly.1: plain text of 54 to 31,022 tokens, Chinese, the CPU picture reader, a tool call and a needle in a 54K-token prompt all pass, card peak 6,966-7,001 MiB of 8,188. PolyStrata's main fixes the engine side (5b080f37b) for its next release.",
|
|
4695
4695
|
"quality": {
|
|
4696
4696
|
"score": 53,
|
|
4697
4697
|
"sources": [
|
|
@@ -4759,8 +4759,8 @@
|
|
|
4759
4759
|
"vision": true
|
|
4760
4760
|
}
|
|
4761
4761
|
],
|
|
4762
|
-
"engine": "strata-poly-0.2.20-poly.
|
|
4763
|
-
"venv": "strata-poly-serve-0.2.20-poly.
|
|
4762
|
+
"engine": "strata-poly-0.2.20-poly.7",
|
|
4763
|
+
"venv": "strata-poly-serve-0.2.20-poly.7.txt",
|
|
4764
4764
|
"venv_bytes": 41943040,
|
|
4765
4765
|
"alias": "inkling-2-mini-ud-q2_k_xl",
|
|
4766
4766
|
"contract": "chat",
|
|
@@ -4842,7 +4842,7 @@
|
|
|
4842
4842
|
],
|
|
4843
4843
|
"health_path": "/health",
|
|
4844
4844
|
"verify_timeout_s": 1800,
|
|
4845
|
-
"note": "DEPRECATED from --llm auto and Model Library recommendations (roadmap decision 70, 2026-11-27): at 2.80 BPW (IQ1_S in blk.0-6 including loop-entry blk.6, IQ2_XXS/T42 in loop layers, Unsloth KLD 0.0595 = 5.56x Q4), paired PolyStrata v0.2.20-poly.5 evaluation (2026-11-26, local-118 GPU0 stand-in) showed BFCL v4 MT-Hard collapsing from 36.0% (72/200) to 19.0% (38/200, -17.0 pp, 95% CI [-24.0, -10.0], McNemar p=5e-6) with 30 consecutive identical tool-call loop steps (Q4: 0), 1 force-terminated infinite loop, +40% empty turns (35 vs 25), C-Eval 520 -3.08 pp (73.85% vs 76.92%, p=0.0195), Chinese-to-English flips under card sampling, and further 8 GB CPU-offload regressions (30/36 diag, extra code truncation and wrong tool call). Kept as deprecated on PolyStrata v0.2.20-poly.
|
|
4845
|
+
"note": "DEPRECATED from --llm auto and Model Library recommendations (roadmap decision 70, 2026-11-27): at 2.80 BPW (IQ1_S in blk.0-6 including loop-entry blk.6, IQ2_XXS/T42 in loop layers, Unsloth KLD 0.0595 = 5.56x Q4), paired PolyStrata v0.2.20-poly.5 evaluation (2026-11-26, local-118 GPU0 stand-in) showed BFCL v4 MT-Hard collapsing from 36.0% (72/200) to 19.0% (38/200, -17.0 pp, 95% CI [-24.0, -10.0], McNemar p=5e-6) with 30 consecutive identical tool-call loop steps (Q4: 0), 1 force-terminated infinite loop, +40% empty turns (35 vs 25), C-Eval 520 -3.08 pp (73.85% vs 76.92%, p=0.0195), Chinese-to-English flips under card sampling, and further 8 GB CPU-offload regressions (30/36 diag, extra code truncation and wrong tool call). Kept as deprecated on PolyStrata v0.2.20-poly.7 (parallel: 2, --loopcd-hidden 0.2) for explicit --llm, approved-plan resume, and on-disk library management.\nHistorical calibration (SP219, 2026-11-23-polystrata-inkling2-mini-local118, local-118 GPU0 8 GB share inside a 14 GiB cgroup): 1428/3072 experts in VRAM, whole-card peak 6,294 MiB (1,386 MiB below gate), cgroup peak 6.8 GiB / anon 6.5 GiB, 112.8 tok/s short / 3,836 tok/s prefill / 45.5 tok/s decode after 58.4K prompt (needle hit, vision and tool calls passed). Originally added by roadmap decision 66.\nWindows runs without --vram-pool (card_args keeps it on Linux). PSIW (2026-11-23, RTX 4070 Laptop 8 GB, Windows 11, engine 0.2.19-poly.1): with it the engine claims a 9,092 MiB pool from the process budget Windows reports, larger than the card, stack apply fails and every request longer than about 30 tokens gets \"no VRAM for a prompt's buffers\". Without it, plain text of 54 to 31,022 tokens, Chinese, the CPU picture reader, a tool call and a needle in a 54K-token prompt all pass, card peak 6,992-7,033 MiB of 8,188. PolyStrata's main fixes the engine side (5b080f37b) for its next release.",
|
|
4846
4846
|
"quality": {
|
|
4847
4847
|
"score": 47,
|
|
4848
4848
|
"sources": [
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "localmodels.engine-lock/v1",
|
|
3
|
+
"tag": "strata-poly-0.2.20-poly.7",
|
|
4
|
+
"commit": "v0.2.20-poly.7",
|
|
5
|
+
"source": "https://github.com/simplexai-labs/PolyStrata/releases/tag/v0.2.20-poly.7",
|
|
6
|
+
"note": "PolyStrata 0.2.20-poly.7 (MIT, commit 0d73bb2946, strata-poly engine 0.1.66) for CUDA 13 NVIDIA Linux and Windows recipes (Inkling 2 Mini). Fixes strata_pin / PIN / PIN_CUR / PIN_LOAD / GEN 0 prefill=1 compatibility with --batch (>= 2) when batch slots are idle (#393), building on 0.2.20-poly.6's LoopCD-Hidden extrapolation (--loopcd-hidden F), concise Inkling 2 reasoning_effort defaults (0.2 for Q2, 0.4 for Q3/Q4), header-time tool-call streaming (#313), faster post-prefill expert cache refill (#299), and Q8_0 / Q2_0 CUDA kernel fixes. Linux: strata-poly and strata-vision from the release archive with NVIDIA CUDA 13.0.3 runtime libraries (libcublas, libcublasLt, libcudart) reused from 0.1.45-poly.9 under NVIDIA's licence; needs NVIDIA driver for CUDA 13.0 (580 or newer), glibc 2.34, and libstdc++ 12. Windows: strata-poly.exe and strata-vision.exe (CUDA 13.0) paired with NVIDIA's cuBLAS 13.0.2.14 wheel (nvidia/cu13/bin/x86_64 on lib_dirs). On both platforms the tag archive supplies PolyStrata's Python server and tokenizer tools under terminal/ (terminal/serve/, terminal/tools/, terminal/strata_control/, terminal/strata_cli/, and LICENSE).",
|
|
7
|
+
"builds": [
|
|
8
|
+
{
|
|
9
|
+
"platform": "linux",
|
|
10
|
+
"arch": "x64",
|
|
11
|
+
"backend": "cuda",
|
|
12
|
+
"min_cuda": "13.0",
|
|
13
|
+
"min_glibc": "2.34",
|
|
14
|
+
"binary": "strata-poly",
|
|
15
|
+
"assets": [
|
|
16
|
+
{
|
|
17
|
+
"name": "strata-poly-linux-x64-cuda13-64b69cab7e073972.tar.gz",
|
|
18
|
+
"url": "https://github.com/simplexai-labs/PolyStrata/releases/download/v0.2.20-poly.7/strata-poly-linux-x64-cuda13-64b69cab7e073972.tar.gz",
|
|
19
|
+
"sha256": "dcec33d7141513518ee9a7a77ffcb54a2afa3f0e0c157844a5cfe03e287f6929",
|
|
20
|
+
"size_bytes": 81925714,
|
|
21
|
+
"npm_copy": {
|
|
22
|
+
"package": "@simplexai/engine-strata-poly-linux-x64-cuda13-64b69cab7e073972",
|
|
23
|
+
"version": "0.0.0-sha256-dcec33d714151351"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "polystrata-0.2.20-poly.7-source.tar.gz",
|
|
28
|
+
"url": "https://github.com/simplexai-labs/PolyStrata/archive/refs/tags/v0.2.20-poly.7.tar.gz",
|
|
29
|
+
"sha256": "7dd3b9b47bfab029a80df4715662f5b7cb1a0a5391698ecfd24225bb4344f1df",
|
|
30
|
+
"size_bytes": 50460862,
|
|
31
|
+
"members": [
|
|
32
|
+
"terminal/serve/",
|
|
33
|
+
"terminal/tools/",
|
|
34
|
+
"terminal/strata_control/",
|
|
35
|
+
"terminal/strata_cli/",
|
|
36
|
+
"LICENSE"
|
|
37
|
+
],
|
|
38
|
+
"npm_copy": {
|
|
39
|
+
"package": "@simplexai/engine-polystrata-0.2.20-poly.7-source",
|
|
40
|
+
"version": "0.0.0-sha256-7dd3b9b47bfab029"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "cudart-strata-poly-linux-x64-cuda13.0.3.tar.gz",
|
|
45
|
+
"url": "https://d2ikbbcl3j6jz9.cloudfront.net/cli/localmodels/engines/strata-poly/0.1.45-poly.9/cudart-strata-poly-linux-x64-cuda13.0.3.tar.gz",
|
|
46
|
+
"sha256": "189c3a9fb5fd5f87331ffcedf03d5469c2a9c91f46379299ee6ea277364f05d2",
|
|
47
|
+
"size_bytes": 422462968
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"platform": "win32",
|
|
53
|
+
"arch": "x64",
|
|
54
|
+
"backend": "cuda",
|
|
55
|
+
"min_cuda": "13.0",
|
|
56
|
+
"binary": "strata-poly.exe",
|
|
57
|
+
"assets": [
|
|
58
|
+
{
|
|
59
|
+
"name": "strata-poly-windows-x64-64b69cab7e073972.zip",
|
|
60
|
+
"url": "https://github.com/simplexai-labs/PolyStrata/releases/download/v0.2.20-poly.7/strata-poly-windows-x64-64b69cab7e073972.zip",
|
|
61
|
+
"sha256": "f7f6ab82abb2b0382bc6cb980a4951cc57be507a758e989f0ab7ea423bb987ad",
|
|
62
|
+
"size_bytes": 81194149,
|
|
63
|
+
"npm_copy": {
|
|
64
|
+
"package": "@simplexai/engine-strata-poly-windows-x64-64b69cab7e073972",
|
|
65
|
+
"version": "0.0.0-sha256-f7f6ab82abb2b038"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "polystrata-0.2.20-poly.7-source.tar.gz",
|
|
70
|
+
"url": "https://github.com/simplexai-labs/PolyStrata/archive/refs/tags/v0.2.20-poly.7.tar.gz",
|
|
71
|
+
"sha256": "7dd3b9b47bfab029a80df4715662f5b7cb1a0a5391698ecfd24225bb4344f1df",
|
|
72
|
+
"size_bytes": 50460862,
|
|
73
|
+
"members": [
|
|
74
|
+
"terminal/serve/",
|
|
75
|
+
"terminal/tools/",
|
|
76
|
+
"terminal/strata_control/",
|
|
77
|
+
"terminal/strata_cli/",
|
|
78
|
+
"LICENSE"
|
|
79
|
+
],
|
|
80
|
+
"npm_copy": {
|
|
81
|
+
"package": "@simplexai/engine-polystrata-0.2.20-poly.7-source",
|
|
82
|
+
"version": "0.0.0-sha256-7dd3b9b47bfab029"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "nvidia_cublas-13.0.2.14-py3-none-win_amd64.whl",
|
|
87
|
+
"url": "https://files.pythonhosted.org/packages/f3/91/bda39230b7a4c102bb724c21b50823efc63544490a885fea0b604911c0ab/nvidia_cublas-13.0.2.14-py3-none-win_amd64.whl",
|
|
88
|
+
"sha256": "5f7a90456b1392db60e28719547ba6e00696bfa81304b6887cf287f9edf2c1d7",
|
|
89
|
+
"size_bytes": 401887280
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
}
|
|
@@ -34,6 +34,7 @@ from localmodels import (
|
|
|
34
34
|
plan_envelope,
|
|
35
35
|
process_identity,
|
|
36
36
|
remote_ops_service,
|
|
37
|
+
runtime_io,
|
|
37
38
|
stack_clients,
|
|
38
39
|
)
|
|
39
40
|
from localmodels.bifrost_config import ADMIN_USER as ADMIN_USER
|
|
@@ -754,7 +755,7 @@ def stop(tools_dir: str = hosts.TOOLS_DIR) -> Check:
|
|
|
754
755
|
except HarnessError as exc:
|
|
755
756
|
return {"check": "bifrost", "ok": False, "detail": str(exc)}
|
|
756
757
|
for name in ("config.json", *bifrost_config.FILES, *STORE, "admin-password"):
|
|
757
|
-
(app / name
|
|
758
|
+
runtime_io.unlink_with_retry(app / name, missing_ok=True)
|
|
758
759
|
|
|
759
760
|
def forget(doc: hosts.Owned) -> None:
|
|
760
761
|
doc["gateway"].pop("bifrost", None)
|
|
@@ -362,12 +362,37 @@ def _restore_baseline_plan(record: Record) -> None:
|
|
|
362
362
|
record["plan"] = baseline
|
|
363
363
|
|
|
364
364
|
|
|
365
|
+
def _stop_after_unregister_error(
|
|
366
|
+
record: Record, run: Executor, unreg_err: LibraryError
|
|
367
|
+
) -> LibraryError:
|
|
368
|
+
"""Stop the server even when gateway unregister failed so its memory is freed, while
|
|
369
|
+
keeping the failed record and registration receipt for a subsequent unload or remove."""
|
|
370
|
+
stop_err: LibraryError | None = None
|
|
371
|
+
if record["state"] != "idle":
|
|
372
|
+
try:
|
|
373
|
+
_remove_service(record["plan"], run)
|
|
374
|
+
except LibraryError as exc:
|
|
375
|
+
stop_err = exc
|
|
376
|
+
else:
|
|
377
|
+
record.pop("load_posture", None)
|
|
378
|
+
_restore_baseline_plan(record)
|
|
379
|
+
detail = (
|
|
380
|
+
f"{unreg_err.detail}; failed to stop server ({stop_err.detail})"
|
|
381
|
+
if stop_err is not None
|
|
382
|
+
else unreg_err.detail
|
|
383
|
+
)
|
|
384
|
+
err = LibraryError(unreg_err.code, detail, failed=unreg_err.failed, **unreg_err.fields)
|
|
385
|
+
return _fail(record, err)
|
|
386
|
+
|
|
387
|
+
|
|
365
388
|
def stop(record: Record, run: Executor) -> None:
|
|
366
389
|
"""Demote a loaded record, unregister it, then stop and remove the model's server; its
|
|
367
|
-
weights stay.
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
the
|
|
390
|
+
weights stay. A loaded record is marked failed on disk before unregistering so a failed,
|
|
391
|
+
interrupted, or killed stop never leaves status or load treating an unroutable model as
|
|
392
|
+
loaded; once unregistered the registration receipt is removed before the server stops. If
|
|
393
|
+
unregistering fails with ``LibraryError``, the server is still stopped to free its memory
|
|
394
|
+
while the record stays ``failed`` with its registration receipt for the next unload."""
|
|
395
|
+
unreg_err: LibraryError | None = None
|
|
371
396
|
if registration := record.get("registration"):
|
|
372
397
|
if record["state"] == "loaded":
|
|
373
398
|
record["state"] = "failed"
|
|
@@ -376,9 +401,15 @@ def stop(record: Record, run: Executor) -> None:
|
|
|
376
401
|
"detail": "stopping the model server did not finish; unload or load it again",
|
|
377
402
|
}
|
|
378
403
|
library_state.save(record)
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
404
|
+
try:
|
|
405
|
+
library_gateway.unregister(registration)
|
|
406
|
+
except LibraryError as exc:
|
|
407
|
+
unreg_err = exc
|
|
408
|
+
else:
|
|
409
|
+
record.pop("registration")
|
|
410
|
+
library_state.save(record)
|
|
411
|
+
if unreg_err is not None:
|
|
412
|
+
raise _stop_after_unregister_error(record, run, unreg_err) from None
|
|
382
413
|
record.pop("load_posture", None)
|
|
383
414
|
if record["state"] != "idle": # loaded, failed, or starting when a load was cut short
|
|
384
415
|
_remove_service(record["plan"], run)
|
|
@@ -107,7 +107,7 @@ def write_json(path: Path, value: dict[str, Any]) -> None:
|
|
|
107
107
|
with os.fdopen(fd, "w", encoding="utf-8") as handle:
|
|
108
108
|
handle.write(json.dumps(value, ensure_ascii=False, indent=2) + "\n")
|
|
109
109
|
os.chmod(tmp, mode)
|
|
110
|
-
|
|
110
|
+
runtime_io.rename_with_retry(Path(tmp), path, replace=True)
|
|
111
111
|
except BaseException:
|
|
112
112
|
with contextlib.suppress(OSError):
|
|
113
113
|
os.unlink(tmp)
|
|
@@ -45,6 +45,8 @@ def current_uid() -> int:
|
|
|
45
45
|
|
|
46
46
|
_STILL_ACTIVE = 259
|
|
47
47
|
_QUERY_LIMITED = 0x1000 # PROCESS_QUERY_LIMITED_INFORMATION
|
|
48
|
+
_SYNCHRONIZE = 0x00100000
|
|
49
|
+
_WAIT_OBJECT_0 = 0x00000000
|
|
48
50
|
|
|
49
51
|
|
|
50
52
|
_API: list[tuple[Any, Any]] = []
|
|
@@ -64,6 +66,7 @@ def _api() -> tuple[Any, Any]:
|
|
|
64
66
|
(kernel.OpenProcess, (d, b, d), h),
|
|
65
67
|
(kernel.GetCurrentProcess, (), h),
|
|
66
68
|
(kernel.CloseHandle, (h,), b),
|
|
69
|
+
(kernel.WaitForSingleObject, (h, d), d),
|
|
67
70
|
(kernel.LocalFree, (p,), p),
|
|
68
71
|
(kernel.GetExitCodeProcess, (h, ptr(d)), b),
|
|
69
72
|
(kernel.GetProcessTimes, (h, *[ptr(wintypes.FILETIME)] * 4), b),
|
|
@@ -322,21 +325,81 @@ def stop_children(pid: int) -> int:
|
|
|
322
325
|
return len(children)
|
|
323
326
|
|
|
324
327
|
|
|
325
|
-
def
|
|
326
|
-
"""
|
|
328
|
+
def _windows_handle_identity(kernel: Any, handle: Any, pid: int) -> Identity | None:
|
|
329
|
+
"""Identity of an already-open Windows process handle, even while terminating."""
|
|
330
|
+
from ctypes import wintypes
|
|
331
|
+
|
|
332
|
+
times = [wintypes.FILETIME() for _ in range(4)]
|
|
333
|
+
if not kernel.GetProcessTimes(handle, *(ctypes.byref(t) for t in times)):
|
|
334
|
+
return None
|
|
335
|
+
created = (times[0].dwHighDateTime << 32) | times[0].dwLowDateTime
|
|
336
|
+
sid = _token_sid(handle)
|
|
337
|
+
own = _own_sid()
|
|
338
|
+
uid = 0 if sid is not None and own is not None and sid == own else -1
|
|
339
|
+
return {"pid": pid, "uid": uid, "pgid": pid, "started": str(created)}
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
def _open_verified_windows_handle(pid: int, saved: Identity) -> Any | None:
|
|
343
|
+
"""Open a SYNCHRONIZE handle to ``pid`` matching ``saved``; caller must CloseHandle."""
|
|
344
|
+
if not _windows():
|
|
345
|
+
return None
|
|
346
|
+
kernel, _ = _api()
|
|
347
|
+
handle = kernel.OpenProcess(_SYNCHRONIZE | _QUERY_LIMITED, False, pid)
|
|
348
|
+
if not handle:
|
|
349
|
+
return None
|
|
350
|
+
matched = False
|
|
351
|
+
try:
|
|
352
|
+
matched = _windows_handle_identity(kernel, handle, pid) == saved
|
|
353
|
+
except OSError:
|
|
354
|
+
matched = False
|
|
355
|
+
finally:
|
|
356
|
+
if not matched:
|
|
357
|
+
kernel.CloseHandle(handle)
|
|
358
|
+
return handle if matched else None
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
def _wait_windows_handle(handle: Any, timeout_s: float) -> bool:
|
|
362
|
+
"""Wait up to ``timeout_s`` for a Windows process handle to become signaled."""
|
|
363
|
+
kernel, _ = _api()
|
|
364
|
+
timeout_ms = 0 if timeout_s <= 0 else min(max(1, int(timeout_s * 1000)), 0xFFFFFFFE)
|
|
365
|
+
return bool(kernel.WaitForSingleObject(handle, timeout_ms) == _WAIT_OBJECT_0)
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
def _windows_exited(pid: int, saved: Identity, handle: Any | None) -> bool:
|
|
369
|
+
if handle is not None:
|
|
370
|
+
return _wait_windows_handle(handle, 0.0)
|
|
371
|
+
return _windows_inspect(pid) != saved
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
def _wait_windows_exit(pid: int, saved: Identity, handle: Any | None, timeout_s: float) -> bool:
|
|
327
375
|
import time
|
|
328
376
|
|
|
329
|
-
|
|
377
|
+
if handle is not None:
|
|
378
|
+
return _wait_windows_handle(handle, timeout_s)
|
|
379
|
+
deadline = time.monotonic() + timeout_s
|
|
380
|
+
while time.monotonic() < deadline:
|
|
330
381
|
if _windows_inspect(pid) != saved:
|
|
331
382
|
return True
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
383
|
+
time.sleep(0.2)
|
|
384
|
+
return False
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
def windows_stop_tree(pid: int, saved: Identity, grace: float) -> bool:
|
|
388
|
+
"""Stop PID and descendants via polite ``taskkill /T`` (capped at 2 s) then ``/F``."""
|
|
389
|
+
handle = _open_verified_windows_handle(pid, saved)
|
|
390
|
+
try:
|
|
391
|
+
for force in (False, True):
|
|
392
|
+
if _windows_exited(pid, saved, handle):
|
|
337
393
|
return True
|
|
338
|
-
|
|
339
|
-
|
|
394
|
+
if not _taskkill(pid, force) and not force:
|
|
395
|
+
continue
|
|
396
|
+
wait_s = min(grace, 2.0) if not force else 15.0
|
|
397
|
+
if _wait_windows_exit(pid, saved, handle, wait_s):
|
|
398
|
+
return True
|
|
399
|
+
return _windows_exited(pid, saved, handle)
|
|
400
|
+
finally:
|
|
401
|
+
if handle is not None:
|
|
402
|
+
_api()[0].CloseHandle(handle)
|
|
340
403
|
|
|
341
404
|
|
|
342
405
|
# Scheduled tasks start child services below normal (priority/memory/I/O), allowing Windows to
|
|
@@ -132,6 +132,7 @@ _windows_private = runtime_windows_acl.private_permissions
|
|
|
132
132
|
_private_dacl_entries = runtime_windows_acl.private_dacl_entries
|
|
133
133
|
_windows_sid_text = runtime_windows_acl.sid_text
|
|
134
134
|
rename_with_retry = runtime_windows_acl.rename_with_retry
|
|
135
|
+
unlink_with_retry = runtime_windows_acl.unlink_with_retry
|
|
135
136
|
|
|
136
137
|
|
|
137
138
|
def _safe_member(name: str) -> Path:
|