Build opt-in KAR PLE CUDA profile on Gitea

This commit is contained in:
Pavlo Ratushnyi
2026-10-07 16:03:43 +02:00
parent fef5fca6fd
commit 5cc41008eb
11 changed files with 422 additions and 14 deletions
+22
View File
@@ -35,6 +35,28 @@ class PackageTests(unittest.TestCase):
with self.assertRaises(ValueError):
pkg.snapshot(source, self.root / pin, pin)
def test_build_feature_receipt_is_pinned_strict_and_linkage_safe(self):
revision = 'a' * 40
features = {'schema_version': 1, 'source_revision': revision,
'cuda_architectures': '120',
'features': {'cuda': True, 'cuda_static_runtime': True, 'cxx_static_runtime': True, 'kar_ple': True,
'kar_experts': False, 'ple_trace': False}}
path = self.root / 'BUILD-FEATURES.json'
path.write_text(json.dumps(features, sort_keys=True, indent=2) + '\n')
parsed, digest = pkg.build_features(path, revision)
self.assertEqual(parsed, features)
self.assertEqual(digest, hashlib.sha256(path.read_bytes()).hexdigest())
with self.assertRaisesRegex(ValueError, 'source-mismatched'):
pkg.build_features(path, 'b' * 40)
features['features']['kar_experts'] = True
path.write_text(json.dumps(features, sort_keys=True, indent=2) + '\n')
with self.assertRaisesRegex(ValueError, 'contract'):
pkg.build_features(path, revision)
path.unlink()
path.symlink_to('/dev/null')
with self.assertRaises(OSError):
pkg.build_features(path, revision)
def test_snapshot_rejects_oversize_and_nonregular_without_block(self):
source = self.root / 'engine'
source.write_bytes(b'over limit')