[PR #1136] audio_config: search sparse markers efficiently (AUDIO-CONFIG-SCAN-SEARCH) #1170

Open
opened 2026-11-26 20:20:19 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1136
Author: @Taffyyy-ops
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: fix/audio-config-scan-search


📝 Commits (1)

  • 92d90a0 audio_config: search sparse markers efficiently (AUDIO-CONFIG-SCAN-SEARCH)

📊 Changes

2 files changed (+55 additions, -1 deletions)

View changed files

➕ tests/test_audio_config_scan_search.py (+51 -0)
📝 tools/audio_config.py (+4 -1)

📄 Description

Item ID: AUDIO-CONFIG-SCAN-SEARCH

Speeds up sparse audio config scanning in tools/audio_config.py:scan() by jumping directly between candidate markers with bytes.find(MARKER_1, ...) instead of slicing at every byte offset.

Changes

  • tools/audio_config.py (scan): Replaces per-byte blob[pos:pos + 2] == MARKER_1 checks with pos = blob.find(MARKER_1, pos, end + 2), preserving exact record parsing and non-matching advancement (pos += 1).
  • tests/test_audio_config_scan_search.py: Adds synthetic sparse-input work checks (ObservedBytes slice count) and parity tests comparing valid/overlapping/truncated markers against expected scan results.

Verification

  • AI-assisted; synthetic tests only, no game data (python -I scripts/check_no_game_data.py).

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1136 **Author:** [@Taffyyy-ops](https://github.com/Taffyyy-ops) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/audio-config-scan-search` --- ### 📝 Commits (1) - [`92d90a0`](https://github.com/ubiquitarianism/leonida/commit/92d90a03606e9ad090f7a34d78c9b409a44212a7) audio_config: search sparse markers efficiently (AUDIO-CONFIG-SCAN-SEARCH) ### 📊 Changes **2 files changed** (+55 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `tests/test_audio_config_scan_search.py` (+51 -0) 📝 `tools/audio_config.py` (+4 -1) </details> ### 📄 Description Item ID: `AUDIO-CONFIG-SCAN-SEARCH` Speeds up sparse audio config scanning in `tools/audio_config.py:scan()` by jumping directly between candidate markers with `bytes.find(MARKER_1, ...)` instead of slicing at every byte offset. ### Changes - **`tools/audio_config.py` (`scan`):** Replaces per-byte `blob[pos:pos + 2] == MARKER_1` checks with `pos = blob.find(MARKER_1, pos, end + 2)`, preserving exact record parsing and non-matching advancement (`pos += 1`). - **`tests/test_audio_config_scan_search.py`:** Adds synthetic sparse-input work checks (`ObservedBytes` slice count) and parity tests comparing valid/overlapping/truncated markers against expected scan results. ### Verification - AI-assisted; synthetic tests only, no game data (`python -I scripts/check_no_game_data.py`). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1170
No description provided.