From a496d8d3ce83c0d9898fe788096026e11ddad98c Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 16 Jun 2026 01:16:31 +0000 Subject: [PATCH] fix(infra): Q16_SCALE int not float, add missing Path/sys imports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Q16_SCALE: float → int in lib/q16.py (int // float returns float, breaking Q16_16 integer contract in gccl_waveprobe, vcn_famm_transport) - qr_spatial_hash.py: sys → _sys (only _sys was imported) - Add missing 'from pathlib import Path' to 7 files that use Path() without importing it: test_fpga, compare_tier1_vs_tier2, generate_avm_gold_trace, burgers_triad_core, hot_path_cold_path, sabotage_prevention, generate_diat_tables - hot_path_cold_path.py: also add missing 'import sys' Co-Authored-By: Allaun Silverfox --- 4-Infrastructure/hardware/test_fpga.py | 1 + 4-Infrastructure/lib/q16.py | 2 +- 4-Infrastructure/shim/compare_tier1_vs_tier2.py | 1 + 4-Infrastructure/shim/qr_spatial_hash.py | 2 +- 5-Applications/scripts/generate_avm_gold_trace.py | 3 ++- 5-Applications/scripts/gsp/burgers_triad_core.py | 3 ++- 5-Applications/scripts/hot_path_cold_path.py | 3 +++ 5-Applications/scripts/sabotage_prevention.py | 2 ++ 5-Applications/tools-scripts/utils/generate_diat_tables.py | 3 ++- 9 files changed, 15 insertions(+), 5 deletions(-) diff --git a/4-Infrastructure/hardware/test_fpga.py b/4-Infrastructure/hardware/test_fpga.py index cd2a55a2..74324e0f 100644 --- a/4-Infrastructure/hardware/test_fpga.py +++ b/4-Infrastructure/hardware/test_fpga.py @@ -11,6 +11,7 @@ import serial import struct import time import sys +from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "4-Infrastructure")) from lib.q16 import Q16_ONE, Q16_SCALE, to_q16 diff --git a/4-Infrastructure/lib/q16.py b/4-Infrastructure/lib/q16.py index 651ab4a7..e38ad388 100644 --- a/4-Infrastructure/lib/q16.py +++ b/4-Infrastructure/lib/q16.py @@ -9,7 +9,7 @@ from __future__ import annotations Q16_ONE: int = 0x00010000 # 65536 Q16_HALF: int = 0x00008000 -Q16_SCALE: float = 65536.0 +Q16_SCALE: int = 65536 def to_q16(value: float) -> int: diff --git a/4-Infrastructure/shim/compare_tier1_vs_tier2.py b/4-Infrastructure/shim/compare_tier1_vs_tier2.py index f896e920..9546bf3e 100644 --- a/4-Infrastructure/shim/compare_tier1_vs_tier2.py +++ b/4-Infrastructure/shim/compare_tier1_vs_tier2.py @@ -6,6 +6,7 @@ import os import sys from collections import Counter, defaultdict from math import sqrt +from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "4-Infrastructure")) from lib.jsonl import load_jsonl diff --git a/4-Infrastructure/shim/qr_spatial_hash.py b/4-Infrastructure/shim/qr_spatial_hash.py index c1c1530e..fdfb4f71 100644 --- a/4-Infrastructure/shim/qr_spatial_hash.py +++ b/4-Infrastructure/shim/qr_spatial_hash.py @@ -17,7 +17,7 @@ from pathlib import Path import sys as _sys _sys.path.insert(0, str(Path(__file__).resolve().parent)) -sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "4-Infrastructure")) +_sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "4-Infrastructure")) from lib.q16 import Q16_SCALE, to_q16 diff --git a/5-Applications/scripts/generate_avm_gold_trace.py b/5-Applications/scripts/generate_avm_gold_trace.py index c916e074..3f53fdf5 100644 --- a/5-Applications/scripts/generate_avm_gold_trace.py +++ b/5-Applications/scripts/generate_avm_gold_trace.py @@ -1,6 +1,7 @@ import json - import sys +from pathlib import Path + sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "4-Infrastructure")) from lib.q16 import to_q16 diff --git a/5-Applications/scripts/gsp/burgers_triad_core.py b/5-Applications/scripts/gsp/burgers_triad_core.py index a924330a..d35b5d27 100644 --- a/5-Applications/scripts/gsp/burgers_triad_core.py +++ b/5-Applications/scripts/gsp/burgers_triad_core.py @@ -1,6 +1,7 @@ import numpy as np - import sys +from pathlib import Path + sys.path.insert(0, str(Path(__file__).resolve().parents[3] / "4-Infrastructure")) from lib.q16 import Q16_ONE, q16_mul diff --git a/5-Applications/scripts/hot_path_cold_path.py b/5-Applications/scripts/hot_path_cold_path.py index 0bb4de69..6f3d88ef 100644 --- a/5-Applications/scripts/hot_path_cold_path.py +++ b/5-Applications/scripts/hot_path_cold_path.py @@ -25,6 +25,9 @@ from dataclasses import dataclass from enum import Enum from collections import deque +import sys +from pathlib import Path + try: from sluq_triage import SLUQTriageSystem, StochasticTrajectory, TriageDecision _HAS_SLUQ_TRIAGE = True diff --git a/5-Applications/scripts/sabotage_prevention.py b/5-Applications/scripts/sabotage_prevention.py index d8d988f9..492a3cff 100644 --- a/5-Applications/scripts/sabotage_prevention.py +++ b/5-Applications/scripts/sabotage_prevention.py @@ -28,6 +28,8 @@ from enum import Enum from collections import defaultdict, deque import sys +from pathlib import Path + sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "4-Infrastructure")) from lib.q16 import Q16_ONE, Q16_SCALE, from_q16, q16_add, q16_ge, q16_gt, q16_sub, to_q16 diff --git a/5-Applications/tools-scripts/utils/generate_diat_tables.py b/5-Applications/tools-scripts/utils/generate_diat_tables.py index ded62f19..8d9fb4e5 100644 --- a/5-Applications/tools-scripts/utils/generate_diat_tables.py +++ b/5-Applications/tools-scripts/utils/generate_diat_tables.py @@ -1,6 +1,7 @@ import math - import sys +from pathlib import Path + sys.path.insert(0, str(Path(__file__).resolve().parents[3] / "4-Infrastructure")) from lib.q16 import to_q16