Timing fails on Mac OS 26.1 Beta

Something about Mac OS 26.1 seems to destroy the timing. Every frame flip is missed in VBLSyncTest and DotDemo, for example. Not sure if this is Matlab specific, because my Octave version had been updated to 10.3 and PTB isn’t compatible yet.

Nothing ever goes right for any meaningful amount of time, does it?

Was it ok on macOS 26.0.x? macOS 26 is not yet tested or officially supported, my testing only goes up to macOS 15 so far. I do see though that a bunch of users have Apple Silicon machines with macOS 26.0.x running with it.

I do have Octave 10.x mex files in the development branch for the next PTB release. I would not expect such a timing problem to be specific to only Matlab and not Octave. But nobody expects the spanish inquisition… If you wanted to try anyway, you could get it via Git, or manually as a huge zip file from my development branch:
GitHub - kleinerm/Psychtoolbox-3: This is kleinerm's git repository for development of Psychtoolbox-3. Regular end users should stay away from it, unless instructed by him otherwise, and use the official Psychtoolbox-3 GitHub page or distribution system for production releases. - The green “Code” button provides the download options.

I tried the new Octave branch, and it’s the same issue. The weird thing is that each frame is exactly double in length. See attached figures from VBLSyncTest.

Does PTB utilize the “game mode” on Macs?

Keith

This is all with the very latest 3.0.22 PTB, right?

The double in length would be expected in your test case. Flipping on every video frame on a 60 Hz display ~ 16.66 msecs. One frame extra delay on each flip = 16.66 + 16.66 ~ 33.33 msecs. If you run VBLSyncTest([], 2) you might end with 3 (= 2 + 1) frames delay?

There are visual presentation timing bugs in macOS + Metal which seem to be coming and going, depending on hardware and macOS version, which depending on how our driver configures presentation either increases frequency and severity of timing glitches, or adds an extra frame of latency. Things seem to have become gradually better with the latest macOS versions, but maybe macOS 26 is the point where things turn worse again.

Some more details if you edit PsychVulkan.m and read the comments in lines 652-670. One thing to try would be to edit the if IsARM(1) in line 668 to instead be if 1 and see how timing then changes for the better or worse?

Yes I downloaded the latest version to test it on Octave 10. VBLSyncTest() yields 599/600 missed frames, whereas VBLSyncTest(,2) gives 0 missed frames. I’m happy to test whatever you’d like, or send the output you may need.

DotDemo also runs at half speed, as it’s missing every frame.

Keith

Oh right, I assume VBLSyncTest([], n) gives no skipped frames for any n >= 2, because the display server has enough time to schedule ahead even in composited mode. A performance drop for n = 1 or n = 0 - which is the same, aka “go as fast as you can, flip every video refresh”, is consistent with Metal / the display server not using DirectToDisplay mode as it should.

What is the output of running any script with issuing PsychVulkan('Verbosity', 4) first to increase verbosity to 4? I want to see if the set of supported scanout formats has changed on macOS 26.

Hi Mario, here’s the output below. Just curious whether you are using the “Game Mode” that Apple offers.

Keith

PsychVulkan(‘Verbosity’, 4)

ans = 3

octave:3> DotDemo

PsychVulkan-INFO: Onscreen window at rect [0, 0, 1710, 1107] is aligned with fullscreen exclusive output for screenId 0.

PTB-INFO: Retina display on screen 0. Using panel fitter for Retina compatibility mode. Use PsychImaging(‘AddTask’,‘General’,‘UseRetinaResolution’) for full resolution.

PTB-INFO: This is Psychtoolbox-3 for Apple macOS, under GNU/Octave 64-Bit ARM (Version 3.0.22 - Build date: Oct 26 2025).

PTB-INFO: OS support status: macOS 16 Apple Silicon is not yet tested or supported at all for this release..

PTB-INFO: For information about paid support and other commercial services, please type ‘PsychPaidSupportAndServices’.

PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT license, with some

PTB-INFO: restrictions. See file ‘License.txt’ in the Psychtoolbox root folder for the exact licensing conditions.

PTB-INFO: Psychtoolbox and its prebuilt mex files are distributed in the hope that they will be useful, but WITHOUT

PTB-INFO: ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

PTB-INFO: OpenGL-Renderer is Apple :: Apple M4 :: 2.1 Metal - 90.5

PTB-INFO: Renderer has 12124 MB of VRAM and a maximum 12124 MB of texture memory.

PTB-INFO: Screen 0 : Window 10 : VBL startline = 2214 : VBL Endline = -1

PTB-INFO: Will try to use mechanisms in the external display backend for accurate Flip timestamping.

PTB-INFO: Reported monitor refresh interval from operating system = 16.666667 ms [60.000000 Hz].

PTB-INFO: All startup display tests and calibrations disabled. Assuming a refresh interval of 60.000000 Hz.

PTB-INFO: Psychtoolbox imaging pipeline starting up for window with requested imagingmode 3179521 …

PTB-INFO: Will use 8 bits per color component framebuffer for stimulus drawing.

PTB-INFO: Enabling panel fitter. Providing virtual framebuffer of 1710 x 1107 pixels size.

PTB-INFO: Will use 8 bits per color component framebuffer for any stimulus post-processing.

PTB-INFO: Full processing needed for redirected output mode.

PsychVulkanCore-INFO: gpuIndex 1 [Apple M4] manually selected as gpu for presenting to the target surface.

PsychVulkanCore-INFO: For gpu [Apple M4] created a window Metal display surface [0x8eb075180] for display window 1

Surface minImageCount 2 - maxImageCount 3

Surface currentExtent 3420 x 2214 pixels with up to 1 view layers

Display native HDR properties as queried from monitor:

Display properties considered valid: No

Display Supports control of HDR local dimming: No

Display Gamut R: [0.000000, 0.000000]

Display Gamut G: [0.000000, 0.000000]

Display Gamut B: [0.000000, 0.000000]

Display Gamut WP: [0.000000, 0.000000]

Display minLuminance: 0.000000 nits

Display maxLuminance: 0.000000 nits

Content maxFrameAverageLightLevel: 0.000000 nits

Content maxContentLightLevel: 0.000000 nits

Surface number of supported surface colorspace + pixelformat combinations: 60

[0] For colorspace VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - [0] Swapchain format VK_FORMAT_B8G8R8A8_UNORM

[1] For colorspace VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - [1] Swapchain format VK_FORMAT_B8G8R8A8_SRGB

[2] For colorspace VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - [2] Swapchain format VK_FORMAT_R16G16B16A16_SFLOAT

[3] For colorspace VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - [3] Swapchain format VK_FORMAT_A2B10G10R10_UNORM_PACK32

[4] For colorspace VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - [4] Swapchain format VK_FORMAT_A2R10G10B10_UNORM_PACK32

[5] For colorspace VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT - [5] Swapchain format VK_FORMAT_B8G8R8A8_UNORM

[6] For colorspace VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT - [6] Swapchain format VK_FORMAT_B8G8R8A8_SRGB

[7] For colorspace VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT - [7] Swapchain format VK_FORMAT_R16G16B16A16_SFLOAT

[8] For colorspace VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT - [8] Swapchain format VK_FORMAT_A2B10G10R10_UNORM_PACK32

[9] For colorspace VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT - [9] Swapchain format VK_FORMAT_A2R10G10B10_UNORM_PACK32

[10] For colorspace VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT - [10] Swapchain format VK_FORMAT_B8G8R8A8_UNORM

[11] For colorspace VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT - [11] Swapchain format VK_FORMAT_B8G8R8A8_SRGB

[12] For colorspace VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT - [12] Swapchain format VK_FORMAT_R16G16B16A16_SFLOAT

[13] For colorspace VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT - [13] Swapchain format VK_FORMAT_A2B10G10R10_UNORM_PACK32

[14] For colorspace VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT - [14] Swapchain format VK_FORMAT_A2R10G10B10_UNORM_PACK32

[15] For colorspace VK_COLOR_SPACE_BT709_NONLINEAR_EXT - [15] Swapchain format VK_FORMAT_B8G8R8A8_UNORM

[16] For colorspace VK_COLOR_SPACE_BT709_NONLINEAR_EXT - [16] Swapchain format VK_FORMAT_B8G8R8A8_SRGB

[17] For colorspace VK_COLOR_SPACE_BT709_NONLINEAR_EXT - [17] Swapchain format VK_FORMAT_R16G16B16A16_SFLOAT

[18] For colorspace VK_COLOR_SPACE_BT709_NONLINEAR_EXT - [18] Swapchain format VK_FORMAT_A2B10G10R10_UNORM_PACK32

[19] For colorspace VK_COLOR_SPACE_BT709_NONLINEAR_EXT - [19] Swapchain format VK_FORMAT_A2R10G10B10_UNORM_PACK32

[20] For colorspace VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT - [20] Swapchain format VK_FORMAT_B8G8R8A8_UNORM

[21] For colorspace VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT - [21] Swapchain format VK_FORMAT_B8G8R8A8_SRGB

[22] For colorspace VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT - [22] Swapchain format VK_FORMAT_R16G16B16A16_SFLOAT

[23] For colorspace VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT - [23] Swapchain format VK_FORMAT_A2B10G10R10_UNORM_PACK32

[24] For colorspace VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT - [24] Swapchain format VK_FORMAT_A2R10G10B10_UNORM_PACK32

[25] For colorspace VK_COLOR_SPACE_PASS_THROUGH_EXT - [25] Swapchain format VK_FORMAT_B8G8R8A8_UNORM

[26] For colorspace VK_COLOR_SPACE_PASS_THROUGH_EXT - [26] Swapchain format VK_FORMAT_B8G8R8A8_SRGB

[27] For colorspace VK_COLOR_SPACE_PASS_THROUGH_EXT - [27] Swapchain format VK_FORMAT_R16G16B16A16_SFLOAT

[28] For colorspace VK_COLOR_SPACE_PASS_THROUGH_EXT - [28] Swapchain format VK_FORMAT_A2B10G10R10_UNORM_PACK32

[29] For colorspace VK_COLOR_SPACE_PASS_THROUGH_EXT - [29] Swapchain format VK_FORMAT_A2R10G10B10_UNORM_PACK32

[30] For colorspace VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT - [30] Swapchain format VK_FORMAT_B8G8R8A8_UNORM

[31] For colorspace VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT - [31] Swapchain format VK_FORMAT_B8G8R8A8_SRGB

[32] For colorspace VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT - [32] Swapchain format VK_FORMAT_R16G16B16A16_SFLOAT

[33] For colorspace VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT - [33] Swapchain format VK_FORMAT_A2B10G10R10_UNORM_PACK32

[34] For colorspace VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT - [34] Swapchain format VK_FORMAT_A2R10G10B10_UNORM_PACK32

[35] For colorspace VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT - [35] Swapchain format VK_FORMAT_B8G8R8A8_UNORM

[36] For colorspace VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT - [36] Swapchain format VK_FORMAT_B8G8R8A8_SRGB

[37] For colorspace VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT - [37] Swapchain format VK_FORMAT_R16G16B16A16_SFLOAT

[38] For colorspace VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT - [38] Swapchain format VK_FORMAT_A2B10G10R10_UNORM_PACK32

[39] For colorspace VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT - [39] Swapchain format VK_FORMAT_A2R10G10B10_UNORM_PACK32

[40] For colorspace VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT - [40] Swapchain format VK_FORMAT_B8G8R8A8_UNORM

[41] For colorspace VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT - [41] Swapchain format VK_FORMAT_B8G8R8A8_SRGB

[42] For colorspace VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT - [42] Swapchain format VK_FORMAT_R16G16B16A16_SFLOAT

[43] For colorspace VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT - [43] Swapchain format VK_FORMAT_A2B10G10R10_UNORM_PACK32

[44] For colorspace VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT - [44] Swapchain format VK_FORMAT_A2R10G10B10_UNORM_PACK32

[45] For colorspace VK_COLOR_SPACE_BT2020_LINEAR_EXT - [45] Swapchain format VK_FORMAT_B8G8R8A8_UNORM

[46] For colorspace VK_COLOR_SPACE_BT2020_LINEAR_EXT - [46] Swapchain format VK_FORMAT_B8G8R8A8_SRGB

[47] For colorspace VK_COLOR_SPACE_BT2020_LINEAR_EXT - [47] Swapchain format VK_FORMAT_R16G16B16A16_SFLOAT

[48] For colorspace VK_COLOR_SPACE_BT2020_LINEAR_EXT - [48] Swapchain format VK_FORMAT_A2B10G10R10_UNORM_PACK32

[49] For colorspace VK_COLOR_SPACE_BT2020_LINEAR_EXT - [49] Swapchain format VK_FORMAT_A2R10G10B10_UNORM_PACK32

[50] For colorspace VK_COLOR_SPACE_HDR10_HLG_EXT - [50] Swapchain format VK_FORMAT_B8G8R8A8_UNORM

[51] For colorspace VK_COLOR_SPACE_HDR10_HLG_EXT - [51] Swapchain format VK_FORMAT_B8G8R8A8_SRGB

[52] For colorspace VK_COLOR_SPACE_HDR10_HLG_EXT - [52] Swapchain format VK_FORMAT_R16G16B16A16_SFLOAT

[53] For colorspace VK_COLOR_SPACE_HDR10_HLG_EXT - [53] Swapchain format VK_FORMAT_A2B10G10R10_UNORM_PACK32

[54] For colorspace VK_COLOR_SPACE_HDR10_HLG_EXT - [54] Swapchain format VK_FORMAT_A2R10G10B10_UNORM_PACK32

[55] For colorspace VK_COLOR_SPACE_HDR10_ST2084_EXT - [55] Swapchain format VK_FORMAT_B8G8R8A8_UNORM

[56] For colorspace VK_COLOR_SPACE_HDR10_ST2084_EXT - [56] Swapchain format VK_FORMAT_B8G8R8A8_SRGB

[57] For colorspace VK_COLOR_SPACE_HDR10_ST2084_EXT - [57] Swapchain format VK_FORMAT_R16G16B16A16_SFLOAT

[58] For colorspace VK_COLOR_SPACE_HDR10_ST2084_EXT - [58] Swapchain format VK_FORMAT_A2B10G10R10_UNORM_PACK32

[59] For colorspace VK_COLOR_SPACE_HDR10_ST2084_EXT - [59] Swapchain format VK_FORMAT_A2R10G10B10_UNORM_PACK32

PsychVulkanCore-INFO: Using 8 bpc unorm [0; 1] range RGBA8 framebuffer.

PsychVulkanCore-INFO: PsychCreateInteropTexture: Success for window 1.

PsychVulkanCore-INFO: Vulkan reports nominal refresh rate 60.000002 Hz for display associated with window 1.

PsychVulkan-INFO: OpenGL implementation does not support OpenGL-Vulkan interop semaphores. Enabling operation without semaphores on gpu 1.

PsychVulkan-INFO: 8 bpc linear precision framebuffer will be used.

PsychVulkan-INFO: Using tiled rendering layout framebuffer for interop rendering.

PsychVulkan-WARNING: Vulkan timestamping failed. Falling back to reference timestamp 32131.460101 secs. Timing or visual stimulation might be broken.

PsychVulkanCore-ERROR: PsychPresent(1): Failed to retrieve visual stimulus onset timestamp! Timed out.

minsmooth = 1

maxsmooth = 64

^[PsychVulkanCore-INFO: Closing Vulkan window 1.

octave:4>

Thanks. Nothing in there that would point to a problem or to any relevant difference wrt. older macOS versions :confused: . What happens if you edit VBLSyncTest.m to add a PsychImaging('AddTask', 'General', 'EnableNative10BitFramebuffer'); before the ‘OpenWindow’ call, to request a 10 bit precision framebuffer instead of the 8 bit standard framebuffer?

Nope, PTB doesn’t use gamemode optimizations yet. Unlikely to help much, only macOS 14 on Apple Silicon and later, and it is not PTB that would need to be enhanced, but you’d need to modify Matlabs / Octave’s info.plist files, to mark Octave or Matlab as a whole as computer games. That would likely break their digital signatures if any (not sure if Octave has any, but I assume Matlab has), and macOS would not be happy about that. Iow. it is not clear how to do it, nor is it likely to help, given all the other optimizations. The whole mechanism and what it really does is almost completely undocumented by Apple, the best I could find is this blog post:

Here’s the output… (blank screen, nothing drawn to it during execution)

octave:1> VBLSyncTest
PTB-INFO: Psychtoolbox license is active on this machine for 133 more days until Sat Mar 28 10:18:29 2026
PTB-INFO: Up to 28 more days of offline use without internet connection, or offline reactivation, are possible until Sat Dec 13 10:03:06 2025
PTB-INFO: The support authentication token would be: d5b0a33e-e426-4998-bdc5-8e3db925738f

PTB-INFO: This is Psychtoolbox-3 for Apple macOS, under GNU/Octave 64-Bit ARM (Version 3.0.22 - Build date: Oct 26 2025).
PTB-INFO: OS support status: macOS 16 Apple Silicon is not yet tested or supported at all for this release..
PTB-INFO: For information about paid support and other commercial services, please type ‘PsychPaidSupportAndServices’.
PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT license, with some
PTB-INFO: restrictions. See file ‘License.txt’ in the Psychtoolbox root folder for the exact licensing conditions.
PTB-INFO: Psychtoolbox and its prebuilt mex files are distributed in the hope that they will be useful, but WITHOUT
PTB-INFO: ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

PTB-INFO: OpenGL-Renderer is Apple :: Apple M4 :: 2.1 Metal - 90.5
PTB-INFO: Renderer has 12124 MB of VRAM and a maximum 12124 MB of texture memory.
PTB-INFO: Screen 0 : Window 10 : VBL startline = 2214 : VBL Endline = -1
PTB-INFO: Will try to use mechanisms in the external display backend for accurate Flip timestamping.
PTB-INFO: Reported monitor refresh interval from operating system = 16.666667 ms [60.000000 Hz].
PTB-INFO: All startup display tests and calibrations disabled. Assuming a refresh interval of 60.000000 Hz.
PTB-INFO: Psychtoolbox imaging pipeline starting up for window with requested imagingmode 3146785 …
PTB-INFO: Will use 32 bits per color component floating point framebuffer for stimulus drawing.
PTB-INFO: Will use 32 bits per color component floating point framebuffer for any stimulus post-processing.
PTB-INFO: No image processing needed. Enabling zero-copy redirected output mode.
PsychVulkan-INFO: 10 bpc linear precision framebuffer will be used.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error before preflip (Preflip-I): invalid framebuffer operation.
PsychVulkan-WARNING: Vulkan timestamping failed. Falling back to reference timestamp 76484.341476 secs. Timing or visual stimulation might be broken.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.

[large number of these errors deleted]

PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error before preflip (Preflip-I): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.
The refresh interval reported by the operating system is 16.66667 ms.
Fontconfig error: Cannot load default config file: No such file: (null)
libptbdrawtext_ftgl: External ‘DrawText’ text rendering plugin initialized.
libptbdrawtext_ftgl: Maximum number of cacheable fonts is 40, minimum number of supported concurrent windows is 10.
libptbdrawtext_ftgl: This plugin uses multiple excellent free software libraries to do its work:

[links deleted because it rejects post saying that I’m a new user and can only include 2 links]

libptbdrawtext_ftgl: Thanks!

Measured refresh interval, as reported by “GetFlipInterval” is 16.66667 ms. (nsamples = 1, stddev = 0.00000 ms)
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error before preflip (Preflip-I): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.
TB-Error: The OpenGL graphics hardware encountered the following OpenGL error before preflip (Preflip-I): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.
FALLBACK (log once): Fallback to SW vertex for line stipple
FALLBACK (log once): Fallback to SW vertex processing, m_disable_code: 2000
FALLBACK (log once): Fallback to SW vertex processing in drawCore, m_disable_code: 2000
PTB missed 598 out of 600 stimulus presentation deadlines.
One missed deadline is ok and an artifact of the measurement.
PTB completed 0 stimulus presentations before the requested target time.
Have a look at the plots for more details…
octave:2>

It’s getting better and better :frowning: . This should have worked just fine, just with an unclear outcome on performance. So now they also broke 10 bit modes completely? I don’t know what the hell Apple broke here this time, not even the slightest breadcrumb of a clue in all your reported output.

Is there any difference under Matlab, wouldn’t expect it, but who knows? If you follow this proposal from a previous message: " Some more details if you edit PsychVulkan.m and read the comments in lines 652-670. One thing to try would be to edit the if IsARM(1) in line 668 to instead be if 1 and see how timing then changes for the better or worse?" Any difference?

Have to run.
-mario

Here is the output I get for VBLSync Test (macOs 26.1 (25B78)) and latest PTB. MacBook Pro M3. Just running on the single screen of the laptop.

MATLAB Version: 25.2.0.3042426 (R2025b) Update 1

Operating System: macOS Version: 26.1 Build: 25B78

>> VBLSyncTest

PTB-INFO: Psychtoolbox license is active on this machine for 143 more days until Wed Apr 8 13:58:09 2026
PTB-INFO: Up to 65 more days of offline use without internet connection, or offline reactivation, are possible until Mon Jan 19 14:25:05 2026
PTB-INFO: The support authentication token would be: b94b2078-82a8-4ca9-b664-ef8f9744ed1d

PTB-INFO: This is Psychtoolbox-3 for Apple macOS, under Matlab 64-Bit ARM (Version 3.0.22 - Build date: Jul 8 2025).
PTB-INFO: OS support status: macOS 16 Apple Silicon is not yet tested or supported at all for this release..
PTB-INFO: For information about paid support and other commercial services, please type ‘PsychPaidSupportAndServices’.
PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT license, with some
PTB-INFO: restrictions. See file ‘License.txt’ in the Psychtoolbox root folder for the exact licensing conditions.
PTB-INFO: Psychtoolbox and its prebuilt mex files are distributed in the hope that they will be useful, but WITHOUT
PTB-INFO: ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

PTB-INFO: OpenGL-Renderer is Apple :: Apple M3 Pro :: 2.1 Metal - 90.5
PTB-INFO: Renderer has 28753 MB of VRAM and a maximum 28753 MB of texture memory.
PTB-INFO: Screen 0 : Window 10 : VBL startline = 2234 : VBL Endline = -1
PTB-INFO: Will try to use mechanisms in the external display backend for accurate Flip timestamping.
PTB-INFO: Reported monitor refresh interval from operating system = 8.333333 ms [120.000000 Hz].
PTB-INFO: All startup display tests and calibrations disabled. Assuming a refresh interval of 120.000000 Hz.
PTB-INFO: Psychtoolbox imaging pipeline starting up for window with requested imagingmode 3146753 …
PTB-INFO: Will use 8 bits per color component framebuffer for stimulus drawing.
PTB-INFO: Will use 8 bits per color component framebuffer for any stimulus post-processing.
PTB-INFO: No image processing needed. Enabling zero-copy redirected output mode.

The refresh interval reported by the operating system is 8.33333 ms.

Measured refresh interval, as reported by “GetFlipInterval” is 8.33333 ms. (nsamples = 1, stddev = 0.00000 ms)

PsychVulkanCore-ERROR: PsychPresent(1): Failed to retrieve visual stimulus onset timestamp! Timed out.

PsychHID-ERROR: Could not enumerate and attach to all HID devices (HIDBuildDeviceList(0,0) failed)!
PsychHID-ERROR: One reason could be that some HID devices are already exclusively claimed by some 3rd party device drivers
PsychHID-ERROR: or applications. I will now retry to only claim control of a hopefully safe subset of devices like standard
PsychHID-ERROR: keyboards, mice, gamepads and supported USB-DAQ devices and other vendor defined devices and hope this goes better…
PsychHID-INFO: That worked. A subset of regular mouse, keyboard etc. input devices and maybe some vendor defined devices will be available at least.

PsychVulkanCore-ERROR: PsychPresent(1): Failed to retrieve visual stimulus onset timestamp! Timed out.

PTB missed 341 out of 600 stimulus presentation deadlines.
One missed deadline is ok and an artifact of the measurement.
PTB completed 0 stimulus presentations before the requested target time.
Have a look at the plots for more details…

This is the output with the 10 bit line added.

Note: for this I just got a black screen when it was running.

>> VBLSyncTest

PTB-INFO: This is Psychtoolbox-3 for Apple macOS, under Matlab 64-Bit ARM (Version 3.0.22 - Build date: Jul 8 2025).
PTB-INFO: OS support status: macOS 16 Apple Silicon is not yet tested or supported at all for this release..
PTB-INFO: For information about paid support and other commercial services, please type ‘PsychPaidSupportAndServices’.
PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT license, with some
PTB-INFO: restrictions. See file ‘License.txt’ in the Psychtoolbox root folder for the exact licensing conditions.
PTB-INFO: Psychtoolbox and its prebuilt mex files are distributed in the hope that they will be useful, but WITHOUT
PTB-INFO: ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

PTB-INFO: OpenGL-Renderer is Apple :: Apple M3 Pro :: 2.1 Metal - 90.5
PTB-INFO: Renderer has 28753 MB of VRAM and a maximum 28753 MB of texture memory.
PTB-INFO: Screen 0 : Window 10 : VBL startline = 2234 : VBL Endline = -1
PTB-INFO: Will try to use mechanisms in the external display backend for accurate Flip timestamping.
PTB-INFO: Reported monitor refresh interval from operating system = 8.333333 ms [120.000000 Hz].
PTB-INFO: All startup display tests and calibrations disabled. Assuming a refresh interval of 120.000000 Hz.
PTB-INFO: Psychtoolbox imaging pipeline starting up for window with requested imagingmode 3146785 …
PTB-INFO: Will use 32 bits per color component floating point framebuffer for stimulus drawing.
PTB-INFO: Will use 32 bits per color component floating point framebuffer for any stimulus post-processing.
PTB-INFO: No image processing needed. Enabling zero-copy redirected output mode.

PsychVulkan-INFO: 10 bpc linear precision framebuffer will be used.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error before preflip (Preflip-I): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error before preflip (Preflip-I): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.
The refresh interval reported by the operating system is 8.33333 ms.
Measured refresh interval, as reported by “GetFlipInterval” is 8.33333 ms. (nsamples = 1, stddev = 0.00000 ms)
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error before preflip (Preflip-I): invalid framebuffer operation.

PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error before preflip (Preflip-I): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error before preflip (Preflip-I): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error before preflip (Preflip-I): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error before preflip (Preflip-I): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error before preflip (Preflip-I): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error before preflip (Preflip-I): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error before preflip (Preflip-I): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error after flip (II): invalid framebuffer operation.
PTB-Error: The OpenGL graphics hardware encountered the following OpenGL error before preflip (Preflip-I): invalid framebuffer operation.

…. The above paragraph appears over and over again. Discourse will not let me upload the full output.

PTB missed 401 out of 600 stimulus presentation deadlines.
One missed deadline is ok and an artifact of the measurement.
PTB completed 0 stimulus presentations before the requested target time.
Have a look at the plots for more details…

>>

No difference changing line 668. I get a lot of these errors now:

PsychVulkan-WARNING: Vulkan timestamping failed. Falling back to reference timestamp 167444.798820 secs. Timing or visual stimulation might be broken.

So after changing the line, the timing stays as bad, but now with lots of Vulkan error messages on the M4?

I just learned of a new simple debug tool, the Metal performance HUD, which may help a bit.

If you launch octave as MTL_HUD_ENABLED=1 octave then on the first run of a PTB fullscreen script, a little heads up display should show in the top-right corner overlaid over the stimulus, with some useful info, e.g., if display happens in the desired Direct-To-Display mode (“Direct”) or in the bad for performance composited mode (“Composited”). Also info about min/max/average fps and frame intervals in msecs, and gpu time spent in Metal post-processing in msecs.

For some reason, at least on macOS 15 and with R2025b, it only works for the first script after launching octave. With Matlab in matlab -nodesktop mode launched from a terminal, it also sometimes works. With Matlab GUI, the whole Matlab freezes and needs to be force quit. Apparently the HUD is somewhat buggy, but at least it gives an easily accessible indicator if Direct display mode works.

Hypothesis so far was that Direct display mode is broken on macOS 26.1, but there could be other reasons for bad performance as well, so maybe the HUD helps to get an idea. If that would report “Direct” as presentation mode, then the problem would be elsewhere.

E.g., what if it isn’t slow flipping, but if KbCheck’s or other input functions are suddenly much slower? We had this in an earlier macOS release, Catalina i think, when Apple screwed up the infrastructure below KbCheck, making it extremely slow. I’ve optimized it as much as I could at that time, to recover speed, but if they’d done the same again in macOS 26, then a KbCheck could slow things down badly. E.g., this, at least on a second execution for some warmup…

tic; for i=1:1000, KbCheck; end; toc

… will execute 1 KbCheck in ~3.3 msecs on a M1 MacBookAir on Battery, which itself is much worse than MS-Windows or Linux. If due to some new macOS 26 inefficiencies this would double, one could get quickly into skipped frame territory.

Btw. “the black screen in 10 bit mode and lots of error messages” is for once not a new macOS bug, but a Psychtoolbox bug: A memory optimization gone wrong, which normally works well, but has an edge case that can trigger on Apple Silicon macOS in some very specific situations, like here in VBLSyncTest.m. Will be fixed properly in next PTB release. For now you could just delete line 956 of PsychVulkan.m, which reads glDeleteTextures(1, oldtex); % Get rid of now unused old texture. and 10 bit mode should work in VBLSyncTest.m

Peter, can you switch the display to fixed refresh rate, so it only runs at constant 60 Hz, instead of switching via VRR from some Hz to max 120 Hz? PTB on macOS can’t deal with macOS VRR modes, so that confounds the measurement.

But it looks as if at least for partial stretches of the test run, 120 fps are reached, which by itself is ofc. harder than reaching 60 fps on a 60 Hz display, and also would suggest Direct-To-Display mode did work on your M3. Using the Metal performance HUD as described in the reply to Keith would also give evidence if Diectmode works on your machine.

Also, a Google AI search prompt, and various Reddit posts suggest that macOS 26 is a pretty awful update, with substantially reduced battery runtime of 1 hour less compared to macOS 15, and many performance issues, e.g., the WindowServer constantly causing 90% gpu load in many cases. M4 models seem to be especially affected, with performance on M4 getting even worse when updating from 26.0 to 26.1. UI sluggishness and not reaching smooth animations is reported. Some Electron apps can make it worse, longer uptime of the machine since boot can make it worse…

So maybe you are hitting these apparently known macOS 26 bugs? The activity monitor app can show gpu load of processes and in total. VBLSyncTest.m in my repository also now has the option of measuring and plotting OpenGL gpu processing time if one sets the optional gpumeasure parameter to 1:

https://raw.githubusercontent.com/kleinerm/Psychtoolbox-3/refs/heads/master/Psychtoolbox/PsychTests/VBLSyncTest.m

VBLSyncTest([],[],[],[],[],[],[],[],[],1);

I will get to this at the Sunday / start of next week

TBH I have not noticed any bugs like this. Though I am sure there will be bugs. Possibly I am lucky? Possibly people like to rant on the internet?

P

Probably luck. This is one Reddit post with pointers to others:

But I’ve read in various credible Apple specific and general computer media about problems, especially with popular Apps that use the Electron framework as GUI toolkit. If just one such app runs, it will shred performance. The worst bugs seem to have been fixed in latest Electron releases, so it depends if all Electron apps are up to date enough to have the bug fixed. E.g., what Google search lists as troublemakers wrt. the Electron bug:

  • 1Password (v8.11.14 and later included the fix)
  • Bitwarden
  • Cursor (an AI-powered code editor)
  • Discord (since fixed)
  • Dropbox
  • Ferdium
  • GitHub Desktop (since fixed)
  • Logi Options+
  • Loom
  • MongoDB Compass
  • Notion (Mail and Calendar apps; since fixed)
  • Postman
  • Slack (since fixed)
  • Superhuman
  • Visual Studio Code (VS Code; since fixed)

And there seem to be bugs specific to specific M chip generations, some M1, especially M4, which is what Keith has on his test machine. Some of these seem to have gotten worse with the 26.1 bug fix release, the status in the 26.2 beta is unknown.

That said, I looked at our license manager to see what kind of users and machine models already run macOS 26.1 or later. There are multiple users on each M1, M2, M3, M4 model variant, and so far we don’t hear reports of trouble by any of them except Keith with his M4. Your report is inconclusive, as the 10 bit bug is actually a PTB bug, already fixed in my Git repository, and the actual timing plots from you look as if timing might be ok’ish, and the missed frames might be caused by your machine having “Pro Motion” activated for its internal display ie. the special up to 120 Hz mode that won’t work with PTB at the moment, because it is a VRR mode that PTB does not support on macOS. Iow. unrelated to what Keith reported.

If general various outlets report that on many macOS 26 setups, GUI animations feel jittery or janky to a non-trivial number of users, something that could be caused by randomly or systematically dropping frames due to WindowServer bugs reported multiple times.
The WindowServer consuming 90% of all gpu resources certainly would not go well at all for any presentation and animation timing.

If the root cause for Keith problems would be a general macOS Tahoe bug affecting many other popular use cases, applications and general user experience, that would be a good thing, because then there would be an actual incentive/pressure for Apple to fix it. If it is something only affecting niche applications like vision science toolkits, I know how Apple “deals” with that, and it would be the usual sadness.

The problem with macOS for Apple Silicon is that with switching to their own proprietary AGX gpu and DCP display engine, and various other OS level changes, and an even tighter “security” lockdown, Apple has taken away most tools I had available in the past on Intel or PowerPC Macs to diagnose / fix / work around macOS bugs and deficiencies. And the vast amount of deep knowledge relating to Intel, AMD, NVidia gpu’s doesn’t transfer due to some very peculiar (to say it friendly) design choices Apple made with their proprietary DCP display engine and firmware. E.g., the PsychtoolboxKernelDriver which was/is absolutely instrumental and crucial for both diagnosing and fixing/working around issues on Apple PowerPC and Intel Macs, is an absolute no-go for Apple Silicon, it is permanently dead and unusable on macOS for Apple Silicon.

Just as in the past, the main source of useful / helpful low level knowledge comes from the Linux community, not from Apple resources: The Asahi Linux project is a group of technically highly talented volunteers, which want to bring Linux to Apple Silicon Macs. It includes (or should I say, sadly, included) some absolute top notch graphics reverse engineering geniuses with an insane drive to make Linux on Apple Silicon happen. However, reverse engineering only includes M1 and M2 SoC’s so far, so that doesn’t help much with potential trouble specific to M3 and later.

I have been incredibly impressed by Apple Silicon. It has been an immense step up from Intel for me.

As always, it just comes down to assessing your needs and seeing if the hardware/software meets it (or appeases your ill-informed, dictatorial university IT services department - which is pretty much the number one priority of universities).

Of the apps you list, I only really use VS Code (for Python and PsychoPy) and Dropbox. I have had issues with neither.

P