Polish and harden ACCL-Q: security, testing, code quality - #5
Merged
Conversation
MEDIUM fixes (9 issues): - Cap _pending_ops dict with purge logic to prevent OOM (feedback.py) - Cap QuantumCircuitValidator._results with deque(maxlen=10000) (emulator.py) - Wrap decoder_callback in try/except for safe error handling (feedback.py) - Wrap _trigger_action callback in try/except (feedback.py) - Fix socket leak in deployment.py shutdown() with try/finally - Replace deprecated np.random with per-instance default_rng (integrations.py) - Fix FeedbackScheduler entry_id collision with monotonic counter (feedback.py) - Add _state_lock to emulator read endpoints (api_server.py) - Guard _get_qubit_rank against ZeroDivisionError (integrations.py) LOW fixes (8+ issues): - Fix `callable` -> `Callable` type annotations (stats.py) - Initialize self._latency_budget = None in driver __init__ - Fix fragile sys.path in test_integration.py to use os.path.dirname - Fix sync: SyncMode = None -> Optional[SyncMode] = None (driver.py, 6 sigs) - Replace print() with logger.error() for alert callbacks (stats.py) - Remove unused imports (Callable, Tuple, field, time, ABC, abstractmethod) - Replace deprecated np.random calls in tests with default_rng - Fix fragile op_id string parsing in profiler.py (store op name in tuple) - Convert test functions from count-based to assertion-based (0 pytest warnings) All 73 tests pass, 29 skipped (hardware), 0 warnings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Shift from software-mediated to hardware-autonomous feedback execution, targeting <0.1% of 50us coherence time (50ns budget). Adds ULTRA_LOW_LATENCY mode with zero-copy data paths, DMA buffer pooling, BRAM LUT decoder, FPGA register interface, and hardware feedback engine with 5-phase pipeline (readout 10ns + multicast 10ns + reduce 4ns + decode 8ns + trigger 2ns = 34ns). 46 new tests across 9 test classes, all 119 tests passing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…timization feat: ACCL-Q Ultra-Low-Latency sub-50ns QEC feedback
…sts, CI, docs, demo Add ultra_low_latency mode to API server with /ull/configure, /ull/feedback, /ull/status, and /ull/disarm endpoints. Create pyproject.toml and requirements.txt for Python packaging. Add ~100 new tests covering profiler, stats, deployment, constants, and ULL latency validation (239 total passing). Add GitHub Actions CI workflow for Python 3.11/3.12. Update performance_tuning.md with ULL guide, README with architecture/API docs, and INSTALL.md with Python quickstart. Add Demo 6 showcasing ULL hardware-autonomous feedback (16x speedup). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…hensive-improvements feat: comprehensive ACCL-Q improvements
Address all 15 remaining audit findings: - Fix version mismatch (__init__.py 0.2.0 → 0.3.0) - Fix abstract method stubs (pass → raise NotImplementedError) - Replace magic numbers in driver.py with named constants - Replace print() with logging module in api_server.py - Add API rate limiting middleware (ACCLQ_RATE_LIMIT env var) - Add emulator TTL cleanup (ACCLQ_EMULATOR_TTL env var) - Make MAX_EMULATORS configurable (ACCLQ_MAX_EMULATORS env var) - Add input validation for /ull/feedback num_cycles - Add FeedbackScheduler context manager (__enter__/__exit__) - Add DMA buffer pool lazy initialization option - Vectorize _compute_syndrome with numpy - Add 25 ULL API endpoint tests (test_ull_api.py) - Add 95 integration/deployment coverage tests (test_integrations_coverage.py) - Upgrade CI to Python 3.13, add coverage reporting and ruff lint job Tests: 387 collected, 358 passed, 29 skipped (hardware), 0 failures Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes (11 files, +1,177/-30)
api_server.pydriver.py,constants.py,integrations.pyfeedback.py,hardware_accel.pyapi_server.py__init__.pytest_ull_api.py,test_integrations_coverage.pypython-tests.ymlTest plan
🤖 Generated with Claude Code