Files
Strata/tools/test_capability_table.py
T
Niko1221 b684c64039 Windows SYCL: OS allowlist for libiomp5md.dll imports, Windows Intel column in the capability table
binary_deps.WINDOWS_OS gets wintrust.dll and imagehlp.dll: Intel's OpenMP runtime (libiomp5md.dll, bundled by the Windows SYCL packages) imports them from
System32, and package_engine --verify refused the Windows SYCL Inkling package for it. Test in test_engine_deps.py (a package whose only imports are the OS DLLs
passes, an unbundled libmmd.dll is still reported).

tools/capability_table.py maps (windows, sycl) to a new column intel_win ("Intel Arc on Windows"). docs/data/capabilities.json has the column (Qwen3.8: untested,
a package ships and no Windows run of this engine is documented; Qwen3.6: no). docs/data/release.json gets the 12 shipped packages that were missing from the
asset list: the Windows SYCL engine and Inkling packages and the ten strata-ling32 packages. docs/CAPABILITIES.md, AI_SETUP.md and AI_REFERENCE.md rebuilt with
capability_table.py --write; --check and release_manifest.py --check pass, test_capability_table.py has a test for the column.
2026-12-03 23:32:27 +01:00

76 lines
4.3 KiB
Python

"""The capability table (docs/data/capabilities.json) against the release's packages and the pages that quote it."""
import copy
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import capability_table as ct # noqa: E402
class CapabilityTable(unittest.TestCase):
def setUp(self):
self.cap = ct.read_json(ct.DATA)
self.release = ct.read_json(ct.RELEASE)
def test_pages_and_table_are_what_the_generator_writes(self):
self.assertEqual(ct.validate(self.cap, self.release), [])
self.assertEqual(ct.read(ct.OUT).replace("\r\n", "\n"), ct.page(self.cap, self.release))
for p in ct.PAGES:
text = ct.read(p)
self.assertTrue(ct.MARK_RE.search(text), p)
self.assertEqual(ct.render(self.cap, self.release, text), text, p)
def test_a_package_contradicts_a_no(self):
cap = copy.deepcopy(self.cap)
{f["id"]: f for f in cap["families"]}["qwen38"]["cells"]["mac"]["supported"] = "no"
problems = ct.validate(cap, self.release)
self.assertTrue(any("qwen38 on mac is marked 'no'" in p for p in problems), problems)
def test_a_yes_without_a_package_is_reported(self):
cap = copy.deepcopy(self.cap)
{f["id"]: f for f in cap["families"]}["qwen36"]["cells"]["intel_linux"]["supported"] = "yes"
problems = ct.validate(cap, self.release)
self.assertTrue(any("no package for it" in p for p in problems), problems)
def test_qwen36_packages_are_the_cuda_and_hip_engines_only(self):
fam = {f["id"]: f for f in self.cap["families"]}["qwen36"]
pk = ct.packages(self.release, fam)
self.assertNotIn("mac", pk)
self.assertNotIn("intel_linux", pk)
self.assertIn("nvidia_win", pk)
def test_the_windows_intel_column_exists_and_reads_the_windows_sycl_package(self):
self.assertIn("intel_win", [c["id"] for c in self.cap["columns"]])
self.assertEqual(ct.column_for("windows", "x86_64", "sycl"), "intel_win")
fam = {f["id"]: f for f in self.cap["families"]}["qwen38"]
self.assertEqual(ct.packages(self.release, fam)["intel_win"], [("sycl", "0.1.73")])
self.assertIn("strata-engine-0.1.73-windows-x86_64-sycl.tar.gz", self.release["assets"])
self.assertIn("strata-inkling-0.1.73-windows-x86_64-sycl.tar.gz", self.release["assets"])
self.assertIn("strata-ling32-0.1.73-windows-x86_64-sycl.tar.gz", self.release["assets"])
def test_the_version_line_names_carried_packages(self):
rel = {"product_version": "0.2.14", "control_version": "0.1.60", "engine_version": "0.1.60",
"assets": ["strata-engine-0.1.60-linux-x86_64-cuda-cuda13.tar.gz", "strata-engine-0.1.59-linux-x86_64-sycl.tar.gz",
"strata-control-0.1.60-windows-x86_64.zip", "strata-control-0.1.59-linux-aarch64.tar.gz",
"strata-dsv41-0.1.59-macos-arm64-metal.tar.gz", "Strata-0.2.14-macos-arm64.dmg"]}
self.assertEqual(ct.versions_line(rel), "App and Terminal 0.2.14, Control and engines 0.1.60; these packages stay at 0.1.59: "
"Control linux-aarch64; DeepSeek engines macos-arm64-metal; engines linux-x86_64-sycl. "
"App, Control and engine versions differ on purpose.")
hotfix = {"product_version": "0.2.13", "control_version": "0.1.59.1", "engine_version": "0.1.59",
"assets": ["strata-control-0.1.59.1-linux-x86_64.tar.gz", "strata-engine-0.1.59-linux-x86_64-sycl.tar.gz"]}
self.assertEqual(ct.versions_line(hotfix), "App and Terminal 0.2.13, Control and engines 0.1.59. "
"App, Control and engine versions differ on purpose.")
carried = {"product_version": "0.2.15", "control_version": "0.1.61", "engine_version": "0.1.60",
"assets": ["strata-control-0.1.61-linux-x86_64.tar.gz", "strata-engine-0.1.60-linux-x86_64-cuda-cuda13.tar.gz"]}
self.assertEqual(ct.versions_line(carried), "App and Terminal 0.2.15, Control 0.1.61, engines 0.1.60. "
"App, Control and engine versions differ on purpose.")
def test_no_page_keeps_the_old_mac_sentence(self):
for p in ct.PAGES:
self.assertNotIn("no DeepSeek yet", ct.read(p))
if __name__ == "__main__":
unittest.main()