Skip to content

Revert "Fix measurement lifecycle reviews and preserve sampler batchi… - #3

Closed
prematurely wants to merge 1 commit into
mainfrom
revert-2-codex/review-fixes-20261110
Closed

prematurely wants to merge 1 commit into
mainfrom
revert-2-codex/review-fixes-20261110

Conversation

@prematurely

Copy link
Copy Markdown
Owner

…ng (#2)"

This reverts commit 0d5680c.

Copilot AI balanced review requested due to automatic review settings November 11, 2026 17:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T17:10:01.180350Z e6a347a PR opened
🔒 Security Review ✅ Completed 2026-11-11T17:10:09.743276Z e6a347a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e6a347a953

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 747 to 749
void D3D9DeviceEx::NotifyBridge(D3D9BridgeEvent event, HRESULT result,
D3DPRESENT_PARAMETERS* params, const D3D9BridgePresentArgs* present) {
// Reset already owns the device lock. Present and final release must use
// the same device -> observer order: callbacks may reenter device APIs.
D3D9DeviceLock deviceLock = LockDevice();
std::lock_guard<std::recursive_mutex> lock(m_bridgeObserverMutex);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore device-before-observer lock ordering

On a multithreaded device, concurrent Present and Reset can now deadlock: PresentEx enters this function without the device lock and holds m_bridgeObserverMutex while invoking the observer, whereas Reset holds the device lock before calling NotifyBridge. If the Present observer reenters a device API, each thread waits for the other's lock. This occurs in the production measurement observer, where OnUnwrappedDeviceEvent calls RuntimePresent, which can call diagnostics methods such as GetAudit that acquire the device lock. Restore the device-before-observer ordering before invoking callbacks.

Useful? React with 👍 / 👎.

Comment on lines 754 to +756
if (!g_owner) g_owner = GetCurrentThreadId();
g_controller.SetAvailable(g_config.cpu, g_config.journal || g_diagnostics != nullptr);
if (g_owner != GetCurrentThreadId()) return;
if (g_device != device || g_owner != GetCurrentThreadId()) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject secondary devices before assigning the capture owner

If RuntimePrepareDevice selects one device and another device Presents first on a different thread, this assignment lets the secondary device claim g_owner before the device-identity check rejects its Present. Subsequent Presents from the selected device then fail the owner-thread check indefinitely, so F7/F8 captures and live statistics stop working until the selected device is cleared. Check g_device == device before assigning g_owner, as the previous implementation did.

Useful? React with 👍 / 👎.

module.path.resize(utf8Length);
if (utf8Length) WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS,
entry.szExePath, pathLength, module.path.data(), utf8Length, nullptr, nullptr);
module.path = entry.szExePath;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve UTF-8 encoding for enumerated module paths

On Windows systems whose active code page is not UTF-8, a backend installed under a non-ASCII directory now supplies an ANSI-encoded or lossy module path. The bridge projects use CharacterSet=MultiByte, but MeasurementSymbolResolver::LoadModule and LoadExports interpret these strings through std::filesystem::u8path. Consequently, CPU captures cannot open the actual binary or its .rsym sidecar and lose function-level attribution even when matching symbols exist. Keep the wide Toolhelp enumeration and explicit UTF-8 conversion.

Useful? React with 👍 / 👎.

Comment on lines 21 to +23
for (UINT i = 0; i < m_snapshot.LineCount; ++i) {
position.y += 16;
renderer.drawText(16, position, i ? 0xffffffffu : 0xffc0ff00u, m_renderLines[i]);
renderer.drawText(16, position, i ? 0xffffffffu : 0xffc0ff00u, m_lines[i]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore overflow handling for the measurement HUD

With DXVK_HUD=full at 1280×720 and default scale, the eight-line measurement block now continues below the existing statistics column instead of moving to the right, causing it to overlap the bottom-left frame-time graph and potentially extend beyond the viewport. In the inspected HUD wiring, d3d9_swapchain.cpp appends HudRenderStack after the standard statistics items, while HudFrameTimeItem::render independently anchors its graph near the bottom of the screen; neither performs collision avoidance for this block. Restore the available-height check and alternate-column placement so capture statistics remain readable with the full HUD enabled.

Useful? React with 👍 / 👎.

@prematurely
prematurely deleted the revert-2-codex/review-fixes-20261110 branch November 11, 2026 17:15
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.

2 participants