iogpucensus

command
v0.6.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2026 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

iogpucensus

iogpucensus executes the Step 0 SPI census specified in design/iogpu-spec.md. It probes live public Metal objects on the running macOS host against the private IOGPUMetal* class hierarchy and capability Groups A–G before any x/iogpu wrapper work begins.

Usage

# Standard census table + semantic probes
go run ./examples/gpu/iogpucensus

# Verbose output: intermediate object chains, probe details, and machine-readable CENSUS lines
go run ./examples/gpu/iogpucensus -v

# Skip the _aneIOSurface probe
go run ./examples/gpu/iogpucensus -probe-ane-surface=false

What It Checks

  1. Class identity: prints the full Objective-C superclass chain for MTLDevice, MTLBuffer, MTLTexture, MTLTensor, MTLResidencySet, and MTLSharedEvent (plus intermediate views/objects under -v).
  2. Selector presence (Groups A–G): checks respondsToSelector: for every spec selector and classifies each as present, absent, wrong-class, or unavailable, alongside a deliberately absent negative control (iogpucensus_selector_absent:).
  3. Read-only semantic probes with controls:
    • Group A: AneIOSurface() repeated-call identity and two-write sentinel check (0xCAFEBABE → 0xDEADBEEF) to verify live aliasing vs copying.
    • Group B: DoesAliasResource: positive controls (self, buffer↔texture view, buffer↔tensor view) and negative controls (independent buffers).
    • Group C: device memory accounting (CurrentAllocatedSize, RecommendedMaxWorkingSetSize, SharedMemorySize, DedicatedMemorySize, HasUnifiedMemory) and IOGPUMemoryInfo class identity.
    • Group D: MTLResidencySet refcount/generation (containsAllocation:, countForAllocation:, generationForAllocation:) and resource flags (isPurgeable, isComplete, isWriteComplete).
    • Group F: WaitUntilSignaledValueTimeoutMS timeout (negative) and signaled (positive) controls.
    • Group G: MTLTensor standalone and buffer-backed backing metadata.

Process-wide mutating selectors (makeAliasable, shutdown, prune, purge, setSegmentListShmemSize:, annotateResource:) are checked for selector presence only and are never invoked.

Documentation

Overview

Command iogpucensus runs the Step 0 private/iogpu SPI census described in design/iogpu-spec.md.

For each public Metal object (MTLDevice, MTLBuffer, MTLTexture, MTLTensor, MTLResidencySet, MTLSharedEvent), it records:

  • the concrete Objective-C class and full superclass chain, verifying whether the expected IOGPUMetal* class is present (preventing wrong-class false positives);
  • selector presence across capability Groups A through G (plus a deliberately absent negative-control selector);
  • read-only semantic probes with positive and negative controls:
  • Group A: AneIOSurface() identity and live aliasing vs copy verification
  • Group B: DoesAliasResource() with aliased views and independent buffers
  • Group C: device memory accounting and IOGPUMemoryInfo class identity
  • Group D: residency set refcount/generation and resource purgeability
  • Group F: WaitUntilSignaledValueTimeoutMS() timeout and signaled controls
  • Group G: tensor backing buffer/surface metadata

Process-wide mutating SPIs (makeAliasable, shutdown, prune, purge, setSegmentListShmemSize:, annotateResource:) are checked for selector presence only and are never invoked.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL