Repository navigation
metal2 bridge: record the instance-split counters + telemetry the bundles' libnative_metal_bridge.a was built with - #366
Merged
Conversation
…he bundles' bridge library was built with Every Metal bundle since 12 Nov links libnative_metal_bridge.a as built on the Mac mini on 12 Nov from a tree whose changes were not all here: metal2vulkan's runtime counted why a draw began a new render pass instance (INSTANCE_SPLITS in lib.rs, render.rs), and the bridge kept the runtime's first distinct messages and gave the device's work counts as text with those counters (nmb_take_message, nmb_device_work_counts_text), which the plug-in prints when /var/local/mtl2-telemetry exists. They are now patch 0103 and NativeMetalTelemetry.rs (include!d by NativeMetalObjects.rs, the code unchanged and moved to a file of its own for the size rule; NativeMetalObjects.rs's allowance goes from 2396 to 2399 for the include and the call), with the two declarations in NativeMetalObjects.h. Checked: 720ef1ce plus patches 0001-0016 and 0100-0103 gives the 12 Nov tree's metal2vulkan sources file for file. The library was not rebuilt from the repository. NOT run on a phone (the same code is on phone 1 now).
claudiusthebot
marked this pull request as ready for review
November 17, 2026 23:50
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.
Since 12 Nov, every Metal bundle has linked a
libnative_metal_bridge.athat the repository could not rebuild: metal-perf built it on the mini on 12 Nov 17:45 from a tree whose changes were never committed. This records those changes, following #353's pattern for PanVK.patches/0103-sweet-instance-split-counters.patch(metal2vulkan runtime):INSTANCE_SPLITS[12]inlib.rs, and inrender.rsa count of why a draw could not record in the current render-pass instance. The reasons are stand-in, storage, locations, reformats, shadow, shader tests, views, dispatched, barrier and ordered, plus totals for all splits and for splits that already had draws. The cost is one relaxed atomic add per new instance.NativeMetalTelemetry.rs(new;include!d byNativeMetalObjects.rs, code unchanged): kept runtime messages (nmb_take_message) and the work counts as text withnew_instance_<reason>=N(nmb_device_work_counts_text).HotMetal2.mm's telemetry (touch /var/local/mtl2-telemetry) already calls both.NativeMetalObjects.hgains the two declarations.NativeMetalObjects.rsallowance: 2396 → 2399 (the include and thekeep_messagecall).Checked: metal2vulkan 720ef1ce plus patches 0001-0016 and 0100-0103 reproduces the 12 Nov tree's metal2vulkan sources file for file (every modified file compared with
cmp, none differ). The bridge's.rs/.hmatch that tree, except that the telemetry block has moved to its own file.Not done: the library was not rebuilt from the repository and its symbols were not compared. Not run on a phone (it is the code phone 1 already runs).
🤖 Generated with Claude Code