Skip to content

fix(scan): rebuild on stale engine scale; ignore minimized game window - #72

Open
DysektAI wants to merge 2 commits into
masterfrom
fix/display-scale-stale
Open

DysektAI wants to merge 2 commits into
masterfrom
fix/display-scale-stale

Conversation

@DysektAI

Copy link
Copy Markdown
Member

Why

  • The scan path rebuilt the engine only on the refresh that observed a viewport change, but RefreshGameDisplayConfiguration commits the new viewport first. If that rebuild threw, later scans saw no change and the engine kept the old scale until restart (wrong-scale template matching).
  • Name scan runs on every left click anywhere. With a windowed EFT minimized, detection fell back to Graphics.ini/monitor size, flipping the viewport and forcing a synchronous rebuild on a click, then another on restore.

What

  • Rebuild when the published engine's Scale differs from the scale for the committed viewport (GameDisplayRefreshPolicy.EngineScaleIsStale), so a failed rebuild retries next scan and DPI-only changes no longer rebuild.
  • WindowsGameDisplayService reports a minimized Tarkov window (IsIconic); scan-path refreshes keep the previous configuration (ShouldApply). Explicit refreshes from settings still apply.

Validation

  • New tests for both policies; mutating each policy fails its tests.
  • Debug and Release build; dotnet test 414/414; CodeRabbit: no findings.

Not proven

  • ⚠️ The wiring in RatScannerMain/RatConfig needs a live-game check: windowed EFT, minimize, click on the desktop, restore, then icon scan; Log.txt should show no engine.rebuild_on_scan_path.

https://claude.ai/code/session_01QFKiA2aswHyp8SnpraLxE2

The scan path rebuilt the engine only on the refresh that observed a
viewport change, but RefreshGameDisplayConfiguration commits the new
viewport first. A failed rebuild (or a concurrent scan that missed the
one-shot flag) left the engine on the old scale until restart, and a
display-DPI-only change rebuilt needlessly.

- Rebuild when the published engine's scale differs from the scale for
  the committed viewport, so failures retry on the next scan.
- Detect minimized Tarkov windows and keep the previous viewport on
  scan-path refreshes instead of flipping to the Graphics.ini/monitor
  fallback and back (each flip cost a synchronous rebuild on a click).

Claude-Session: https://claude.ai/code/session_01QFKiA2aswHyp8SnpraLxE2
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 37 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 68 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 7115ad47-ddd6-4fee-87a7-ecea47d4a763
📥 Commits

Reviewing files that changed from the base of the PR and between c15eda6 and 7836533.

📒 Files selected for processing: 5
  • src/App/Display/GameDisplayModels.cs
  • src/App/Display/WindowsGameDisplayService.cs
  • src/App/RatConfig.cs
  • src/App/RatScannerMain.cs
  • tests/RatScanner.Tests/GameDisplayConfigurationTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant