azonenberg changed the topic of #scopehal to: libscopehal, libscopeprotocols, and glscopeclient development and testing | https://github.com/glscopeclient/scopehal-apps | Logs: https://libera.irclog.whitequark.org/scopehal
octorian has quit [Quit: ZNC - http://znc.sourceforge.net]
octorian has joined #scopehal
<azonenberg> ok implemented most of the history system in ngscopeclient now
<azonenberg> only thing missing is a handler to actually update waveforms when the history changes
Degi has quit [Ping timeout: 252 seconds]
Degi_ has joined #scopehal
Degi_ is now known as Degi
<azonenberg> ok and that's done. only thing that's missing is updating the selection in the history view when a new waveform comes in during normal trigger mode
<_whitenotifier-7> [scopehal-apps] azonenberg pushed 1 commit to master [+4/-0/±8] https://github.com/glscopeclient/scopehal-apps/compare/0688fe5bc765...9c03011f3cfa
<_whitenotifier-7> [scopehal-apps] azonenberg 9c03011 - Added history window to ngscopeclient
<_whitenotifier-7> [scopehal] azonenberg opened issue #700: Pico: flush any in-flight waveform from the socket buffer if trigger is stopped - https://github.com/glscopeclient/scopehal/issues/700
<_whitenotifier-7> [scopehal] azonenberg labeled issue #700: Pico: flush any in-flight waveform from the socket buffer if trigger is stopped - https://github.com/glscopeclient/scopehal/issues/700
<azonenberg> ok history is functional, only thing missing is a right click option to delete the selected waveform
<azonenberg> That will happen tomorrow
<d1b2> <azonenberg> also lain, louis: see above
<d1b2> <azonenberg> i don't know if this is related to any of your recent changes
<d1b2> <azonenberg> or if this is an existing bug in the GL shader that was ported to the vulkan shader
<d1b2> <azonenberg> but it seems like we have potential for an out of bounds read
<azonenberg> I think line 220 if(gl_GlobalInvocationID.x > windowWidth)
<azonenberg> might need to be changed to >=
<azonenberg> (testing this now)
<azonenberg> and sorry i meant out of bounds write
<azonenberg> after shader optimization it reports the line as being the read, but the descriptor it's going OOB on is the rasterized waveform
<azonenberg> $1 = {innerXoff = -133822, windowHeight = 144, windowWidth = 1918, memDepth = 1000002, offset_samples = 179641, alpha = 0.0437380299, xoff = -91.8658981, xscale = 0.00200488186, ybase = 123, yscale = 20, yoff = 0, persistScale = 0}
<azonenberg> so windowWidth = 1918, windowHeight = 144, our buffer should be 1104768 bytes in size right? 276192 float32's
<azonenberg> which... is what i am seeing in the AcceleratorBuffer
* azonenberg is confused
<azonenberg> unless it's actually an out of bounds read
<azonenberg> and not a write
<azonenberg> that would make more sense, in whic hcase the OOB write i just fixed is an unrelated bug :p
<azonenberg> because the 1000003 sounds like it's reading off the end of memDepth
<azonenberg> this whole ADDTL_NEEDED_SAMPLES bit is more complicated than i can debug when i'm already supposed to have been in bed 20 minutes ago
<azonenberg> so i'll pick up on it tomorrow
<azonenberg> ... oh ok @louis i think this is a bug you introduced wrt zero hold for digital
<azonenberg> digital is already zero hold
<azonenberg> but it looks like you don't define USE_NEXT_COORDS for digital
<azonenberg> or something to that effect
<d1b2> <louis> Oops! Ill take a look when I'm back at a computer
<azonenberg> no nvm
<azonenberg> i misread the code. that's not it. but we are somehow going out of bounds on digital waveforms by one sample
<azonenberg> i'm neck deep in the code now so gonna run with it
<azonenberg> ... *oh*
<azonenberg> ok this is more subtle
<_whitenotifier-7> [scopehal-apps] azonenberg pushed 1 commit to master [+0/-0/±2] https://github.com/glscopeclient/scopehal-apps/compare/9c03011f3cfa...467871544741
<_whitenotifier-7> [scopehal-apps] azonenberg 4678715 - Fix bounds checking bug
<azonenberg> so this is a bug we've had all along
<azonenberg> (not the one i just pushed a fix for)
<azonenberg> we pack our bool's into uint32_t[]s in order to work on platforms that don't support byte addressable SSBOs
<azonenberg> but we do not pad the SSBO up to a multiple of 4 bytes host side
<azonenberg> easiest fix is for AcceleratorBuffer<bool> to ensure it always allocates capacity rounded up to next multiple of 4 bytes regardless of requested size
<azonenberg> the padding bytes' value is unimportant as long as it's legal to read from
<_whitenotifier-7> [scopehal] azonenberg pushed 1 commit to master [+0/-0/±1] https://github.com/glscopeclient/scopehal/compare/6a582b0d69d6...10af34ee843e
<_whitenotifier-7> [scopehal] azonenberg 10af34e - AcceleratorBuffer: round digital allocations up to next multiple of 4 bytes to allow 32-bit reads from shaders
<d1b2> <ehntoo> after some particularly aggressive includes refactoring to eliminate usage of scopehal.h and scopeprotocols.h entirely within the context of the library as well as eliminating usage of Gdk::Color to minimze the places we're including gtkmm, I've got a ~22-25% speedup in ngscopeclient compile times on my mac. (~130s -> ~100s). The really long pole remaining in the tent is the FlowGraphNode.h -> Waveform.h -> AcceleratorBuffer.h ->
<d1b2> vulkan_raii.hpp include chain.
<d1b2> <ehntoo> if we can add an abstract interface in there or otherwise break the include chain so that every individual filter and protocol decoder doesn't need to include the vulkan headers, that'll be a really massive improvement
<azonenberg> yeah that would be nice but i'm not sure how viable it is. but 25% speedup is a good start already
<azonenberg> but basically, every filter ultimately has to be able to create waveforms and manipulate them
<azonenberg> and if those waveforms are allocated in vulkan memory i'm not sure how viable breaking that chain is
<d1b2> <ehntoo> yeah, I'm experimenting with a couple different changes. I definitely do not want to sacrifice any runtime performance just to get a compile time reduction.
<azonenberg> yeah. in particular AcceleratorBuffer has to mostly be in a header because it's a template
<azonenberg> and the implementations of the AcceleratorBuffer functions have to do vulkan stuff
<azonenberg> i'm not sure if it's even possible, performance aside, to avoid that
<d1b2> <ehntoo> or, it turns, out, I could just precompile the vulkan headers and get most of the speedup that I was spending a lot of time chasing. ~100s -> ~84s just by precompiling vulkan_raii.hpp. I'm going to check out a clean copy of the project and see what just precompiling the vulkan headers and gtkmm gets me without all the changes I've made.
<lain> ehntoo: nice!
<_whitenotifier-7> [scopehal] ehntoo opened pull request #701: Precompile selected headers to improve compile times - https://github.com/glscopeclient/scopehal/pull/701
<d1b2> <ehntoo> I might still clean up a local branch I've got that strips usage of scopehal.h and scopeprotocols.h to improve incremental compiles, but it's a lot lower priority after this change. 🙂
<azonenberg> ehntoo: yeah scopeprotocols.h is definitely included in way more places than it needs to be
<azonenberg> scopeprotocols.cpp with all of the module registrations is really the only thing that needs every single filter
<azonenberg> ehntoo: also i want to move away from use of gtk in scopehal. how much do we actually have using gtk in scopehal now?
<azonenberg> i feel like there isnt a lot
<azonenberg> we use sigcxx for callbacks but that's much lighter than all of gtk
<azonenberg> and something i'm willing to keep around indefinitely
<azonenberg> Benchmarking a full build of glscopeclient + ngscopeclient on my machine now
<azonenberg> before/after the PCH
<d1b2> <ehntoo> off the top of my head, there's some import/export stuff and a lot of usage of gdk::color.
<d1b2> <ehntoo> the gdk::color change is a pretty straightforward swap, though it touches a lot of files since it's part of the Filter.h interface.
<azonenberg> Yes. i want to replace gdk::color with a std::string using html color codes
<azonenberg> hex rgb color codes are straightforward to convert to Gdk::Color or ImU32
<azonenberg> on the glscopeclient or ngscopeclient side
<azonenberg> it is, like you said, an exhaustive refactoring
<azonenberg> scopeexports is all gtk code and will likely get kept as a glscopeclient-only module
<azonenberg> with new export code written as an imgui frontend in ngscopeclient for headless backend code in scopeprotocols
<azonenberg> [100%] Built target ngscopeclient
<azonenberg> real 249.61
<azonenberg> user 4750.75
<azonenberg> sys 717.92
<azonenberg> ok, this is with no PCH
<_whitenotifier-7> [scopehal] azonenberg closed pull request #701: Precompile selected headers to improve compile times - https://github.com/glscopeclient/scopehal/pull/701
<_whitenotifier-7> [scopehal] azonenberg pushed 2 commits to master [+0/-0/±2] https://github.com/glscopeclient/scopehal/compare/10af34ee843e...18726f4b6105
<_whitenotifier-7> [scopehal] ehntoo d49833c - Precompile selected headers to improve compile times Precompiling these system/library headers takes a clean build of ngscopeclient from ~100-135s to ~40-45 seconds on my macbook.
<_whitenotifier-7> [scopehal] azonenberg 18726f4 - Merge pull request #701 from ehntoo/compile-speed-improvements Precompile selected headers to improve compile times
<d1b2> <ehntoo> if there's a ticket for removing usage of Gdk::Color I can take it - I've spent enough time looking at the relevant code recently that I should be able to knock it out pretty quickly.
<azonenberg> ehntoo: let me check. it's on the list of things i want done
<azonenberg> i just dont know if there's a formal issue
<_whitenotifier-7> [scopehal] azonenberg commented on issue #257: Allow specifying start and end times for filters and measurements - https://github.com/glscopeclient/scopehal/issues/257#issuecomment-1264682197
<_whitenotifier-7> [scopehal] azonenberg assigned issue #257: Allow specifying start and end times for filters and measurements - https://github.com/glscopeclient/scopehal/issues/257
<azonenberg> that's what you are working on now
<azonenberg> also making a few fixes to your PCH to compile on linux, we have to include <memory> and a few others before the vulkan headers
<azonenberg> test building that and pushing in a minute or two
<d1b2> <ehntoo> 👍
<azonenberg> very, very interesting
<azonenberg> real 222.89
<azonenberg> user 2204.68
<azonenberg> sys 632.33
<azonenberg> it seems when you throw enough cores at the build, you end up saturating them less (under half the total cpu-sec consumed) but only getting a slight speedup in the overall build
<azonenberg> because it's bottlenecked on serial steps like linking
<azonenberg> This was with make -j64 on dual socket xeon 6144s
<azonenberg> if you have less ludicrous amounts of CPU i expect the speedup is likely significant
<_whitenotifier-7> [scopehal] azonenberg pushed 1 commit to master [+1/-0/±1] https://github.com/glscopeclient/scopehal/compare/18726f4b6105...b9da7ff3c78e
<_whitenotifier-7> [scopehal] azonenberg b9da7ff - Updated precompiled headers with some addititional stuff required by Linux
<azonenberg> i'm excited to see what this does to CI build times
<azonenberg> the github builders we are using now are likely bottlenecked on cores (they're only two vCPUs) so this should be a huge speedup
<azonenberg> even when the new hardware comes in and we move to 8ish vCPUs it'll probably still be a nice boost
<_whitenotifier-7> [scopehal-apps] azonenberg pushed 2 commits to master [+0/-0/±2] https://github.com/glscopeclient/scopehal-apps/compare/467871544741...fd65ea89c389
<_whitenotifier-7> [scopehal-apps] azonenberg 0507921 - Updated submodules
<_whitenotifier-7> [scopehal-apps] azonenberg fd65ea8 - MainWindow: removed unused variable
<d1b2> <ehntoo> yeah, if you have that many cores to throw at it, you'll have a whole bunch of cores waiting for the initial two or three files to finish so the headers will be available
<d1b2> <ehntoo> I do expect it to be a very significant win on CI.
<azonenberg> Yes exactly. because although the new vm server will be 26 cores / 52 threads, i won't be using all of them for one build
<azonenberg> this is to be shared among all of my existing virtualization workloads and a minimum of one linux and one windows ci server
<azonenberg> ehntoo: how much faster is a clean build here? pulling in a bunch of STL to the PCH too
<azonenberg> needed for linux build and might speed things on mac too
<d1b2> <ehntoo> the 60% speedup I'm seeing with clang is with 11 compile threads running.
<azonenberg> (with this vs your original PR i mean)
<d1b2> <ehntoo> one sec, I'll run a test
<azonenberg> in an hour or so we should have build feedback from the github CI runners
<azonenberg> The last push from last night took 41 min for linux and 149 min for windows
<azonenberg> to run CI
<d1b2> <ehntoo> a clean build of ngscopeclient with the additional STL inclusions is 42s, which is very well within this machine's thermal envelope variance of my initial PR time
<azonenberg> Ok so substantially no change
<azonenberg> thats about what i figured
<azonenberg> the point of putting them in the pch was mostly because linux required them to build vulkan_raii
<azonenberg> also, i was sorely tempted to name the file stdafx.h
<azonenberg> does that make me old? :p
<d1b2> <ehntoo> maybe a little. 😉 as I'm trying to tell myself as I'm starting to find an occasional gray hair, that's the experience showing. 😛
<azonenberg> to be fair, i was like 9 years old when i started writing C with a borland compiler on my dad's old 386 running win 3.1
<azonenberg> but i didn't get seriously started until around two years later when we got a box running windows ME with vc98 on it
<azonenberg> (we skipped the 95/98 era entirely)
<azonenberg> this was visual c++ '98 bought on a cd-rom in a store, in person
<d1b2> <ehntoo> I was recompiling linux kernels in middle school, but I don't think I started really programming seriously until the end of high school.
<azonenberg> I mean i wasn't exactly the best programmer around back then :p
<azonenberg> but i was learning lol
<azonenberg> ehntoo: your PCH breaks the build on windows https://github.com/glscopeclient/scopehal-apps/actions/runs/3169324812/jobs/5161155977
<azonenberg> it's looking for /yaml-cpp/ which seems to suggest ${YAML_INCLUDES} is empty?
<_whitenotifier-7> [scopehal-apps] azonenberg pushed 2 commits to master [+0/-0/±6] https://github.com/glscopeclient/scopehal-apps/compare/fd65ea89c389...8919946570d7
<_whitenotifier-7> [scopehal-apps] azonenberg f7cb7f8 - Fixed a bunch of cases where we used Text() instead of TextUnformatted()
<_whitenotifier-7> [scopehal-apps] azonenberg 8919946 - WaveformGroup: implemented middle mouse autoscale on timeline
<azonenberg> ehntoo: so there was a speedup on CI but less than I expected. 41 -> 36 minutes with the github azure instances
<azonenberg> for linux
<azonenberg> windows build got 24 minutes in (was 149 for a full build before PCH) then errored out
<_whitenotifier-7> [scopehal-waveforms-bridge] azonenberg pushed 1 commit to master [+0/-0/±1] https://github.com/glscopeclient/scopehal-waveforms-bridge/compare/00cf2c80975c...3b780f9beea2
<_whitenotifier-7> [scopehal-waveforms-bridge] azonenberg 3b780f9 - Fixed potential for stray waveform after stopping trigger
<_whitenotifier-7> [scopehal-pico-bridge] azonenberg pushed 1 commit to master [+0/-0/±1] https://github.com/glscopeclient/scopehal-pico-bridge/compare/35a54feb42b7...1baf71050ca4
<_whitenotifier-7> [scopehal-pico-bridge] azonenberg 1baf710 - Fixed potential extra waveform after trigger is stopped
<_whitenotifier-7> [scopehal] azonenberg commented on issue #700: Pico: flush any in-flight waveform from the socket buffer if trigger is stopped - https://github.com/glscopeclient/scopehal/issues/700#issuecomment-1264696841
<_whitenotifier-7> [scopehal] azonenberg closed issue #700: Pico: flush any in-flight waveform from the socket buffer if trigger is stopped - https://github.com/glscopeclient/scopehal/issues/700
<azonenberg> @louis: see https://github.com/glscopeclient/scopehal-pico-bridge/compare/35a54feb42b7...1baf71050ca4 and check if the same bug is present in your dscope bridge
<azonenberg> tl;dr it's possible to get one extra trigger if you stop in normal-trigger mode, and then get a stray waveform next time you re-arm the trigger
<azonenberg> lain: almost ready to merge the queue refactoring? what's left to do on that?
<azonenberg> ok so, next up in ngscopeclient is a few small history fixes (allowing you to change the history depth and delete old waveforms)
<azonenberg> that shouldn't take long
<d1b2> <ehntoo> Ugh, windows. I'll take a look.
<lain> azonenberg: merging master into my macos branch today so I can test everything out
<lain> or at least that's my plan. still struggling to wake up, currently
<_whitenotifier-7> [scopehal] ehntoo opened pull request #702: Hopefully fix windows build pre-compiled headers - https://github.com/glscopeclient/scopehal/pull/702
<d1b2> <ehntoo> @azonenberg I think #702 should fix the windows build.
<_whitenotifier-7> [scopehal] azonenberg closed pull request #702: Hopefully fix windows build pre-compiled headers - https://github.com/glscopeclient/scopehal/pull/702
<_whitenotifier-7> [scopehal] azonenberg pushed 2 commits to master [+0/-0/±2] https://github.com/glscopeclient/scopehal/compare/b9da7ff3c78e...460530c0a323
<_whitenotifier-7> [scopehal] ehntoo 30da18e - Hopefully fix windows build pre-compiled headers YAML_INCLUDES is not available becase we're not using FindPackage for yaml-cpp on windows. Hard-code the path to the mingw64 package's includes dir for now.
<_whitenotifier-7> [scopehal] azonenberg 460530c - Merge pull request #702 from ehntoo/fix-windows-build-pch Hopefully fix windows build pre-compiled headers
<_whitenotifier-7> [scopehal-apps] azonenberg pushed 1 commit to master [+0/-0/±2] https://github.com/glscopeclient/scopehal-apps/compare/8919946570d7...c72d292ab5ff
<_whitenotifier-7> [scopehal-apps] azonenberg c72d292 - Updated submodules. Replaced magic number with enum value.
<d1b2> <ehntoo> 🤞
<d1b2> <ehntoo> one other thing I'm noticing comparing the CI setups and my own build environment is that I'm using ninja rather than make. I wouldn't expect it to make a huge difference but maybe it's worth experimenting with?
<azonenberg> ehntoo: new build failed too
<d1b2> <ehntoo> ugh, windows failure again.
<d1b2> <ehntoo> apparently I was not fully understanding how the msys shell interacts with cmake and path specification
nelgau has quit [Remote host closed the connection]
nelgau has joined #scopehal
<_whitenotifier-7> [scopehal] ehntoo opened pull request #703: Hardcode the windows yaml-cpp path even more. - https://github.com/glscopeclient/scopehal/pull/703
<d1b2> <ehntoo> we should probably get to the bottom of why the find_package isn't working for yaml-cpp, but this'll get builds running in CI at least.
<d1b2> <ehntoo> I hope.
<azonenberg> This will break builds for anyone building locally? or does find_package work outside the CI environment? or what
<d1b2> <ehntoo> find_package should work everywhere - this hack will only work for the CI environment, though. :/
<azonenberg> So in theory it should still work
<azonenberg> it'll just add a nonexistent path to the search path
<_whitenotifier-7> [scopehal] azonenberg closed pull request #703: Hardcode the windows yaml-cpp path even more. - https://github.com/glscopeclient/scopehal/pull/703
<_whitenotifier-7> [scopehal] azonenberg pushed 2 commits to master [+0/-0/±2] https://github.com/glscopeclient/scopehal/compare/460530c0a323...a9a7a72f3dac
<_whitenotifier-7> [scopehal] ehntoo fd511f1 - Hardcode the windows yaml-cpp path even more.
<_whitenotifier-7> [scopehal] azonenberg a9a7a72 - Merge pull request #703 from ehntoo/really-fix-windows-pch-maybe Hardcode the windows yaml-cpp path even more.
<azonenberg> eh, how bad could it be
<azonenberg> build is already broken
<_whitenotifier-7> [scopehal-apps] azonenberg pushed 1 commit to master [+0/-0/±1] https://github.com/glscopeclient/scopehal-apps/compare/c72d292ab5ff...dff949af04a2
<_whitenotifier-7> [scopehal-apps] azonenberg dff949a - Update scopehal with hopefully fixed CI build?
<d1b2> <ehntoo> I'm pretty sure this'll break windows builds for anyone that doesn't have their mingw64 environment installed in D:/a/_temp - the target_include_directories adds a build target to produce the precompiled header, and cmake will bail if it can't find the yaml.h "source" file.
<azonenberg> Well, we'll at least have working CI in the mean time
<azonenberg> i want to move away from gtk and mingw as fast as possible long term
<d1b2> <ehntoo> yeah. if this doesn't work again, I think we can just conditionally not put yaml.h in the PCH on windows
<d1b2> <ehntoo> Looks like the more-recent ubuntu builds are getting a better speedup of 24m. I'll definitely take that.
<d1b2> <ehntoo> stepping away from my computer for a few hours at minimum, but if the windows CI does fail again, you can delete the "D:/a/_temp/mingw64/include/yaml-cpp/yaml.h" from line 225 of lib/scopehal/CMakeLists.txt to leave $<$<BOOL:${WIN32}>:,${YAML_INCLUDES}/yaml-cpp/yaml.h>, and that will definitely fix the windows build.
<azonenberg> i'm an idiot, yeah
<azonenberg> i was about to say why not just remove the yaml
<azonenberg> let me do that right now
<_whitenotifier-7> [scopehal] azonenberg pushed 1 commit to master [+0/-0/±1] https://github.com/glscopeclient/scopehal/compare/a9a7a72f3dac...29e7ff7a90b3
<_whitenotifier-7> [scopehal] azonenberg 29e7ff7 - Conditionally disable yaml-cpp in precompiled header on Windows
<_whitenotifier-7> [scopehal-apps] azonenberg pushed 1 commit to master [+0/-0/±1] https://github.com/glscopeclient/scopehal-apps/compare/dff949af04a2...ea9fa546c092
<_whitenotifier-7> [scopehal-apps] azonenberg ea9fa54 - Update submodules with another Windows build fix
<d1b2> <ehntoo> Well, it seems to have exploded in a new and novel way this time.
<lain> as one does
<d1b2> <ehntoo> 😆
<d1b2> <ehntoo> Looks like maybe we need to add <utility> to the other STL stuff that was needed on Linux.
<d1b2> <ehntoo> Still not quite back at a computer, but I can do a PR if no one else beats me to it.
<azonenberg> ehntoo: let me add that
<_whitenotifier-7> [scopehal] azonenberg pushed 1 commit to master [+0/-0/±1] https://github.com/glscopeclient/scopehal/compare/29e7ff7a90b3...a7bd4303f364
<_whitenotifier-7> [scopehal] azonenberg a7bd430 - Added <utility> to scopehal-pch
<_whitenotifier-7> [scopehal-apps] azonenberg pushed 1 commit to master [+0/-0/±1] https://github.com/glscopeclient/scopehal-apps/compare/ea9fa546c092...e12cf0afa9bd
<_whitenotifier-7> [scopehal-apps] azonenberg e12cf0a - Updated scopehal with <utility> added to PCH
<d1b2> <ehntoo> huzzah, it got past the header precompilation
<azonenberg> woo
bvernoux1 has quit [Quit: Leaving]
<azonenberg> did it still fail?
<d1b2> <david.rysk> going to test on macOS now
<azonenberg> i'm not watching
<azonenberg> i also just found a vulkan handle leak in WaveformPool
<azonenberg> pushing a fix shortly
<d1b2> <ehntoo> still running
<azonenberg> i was gonna say i didnt get a failure email yet
<azonenberg> so fingers crossed lol
<d1b2> <ehntoo> @david.rysk the header precompilation change was developed on a mac, so it should be ok. (and much faster)
<d1b2> <david.rysk> I still have to keep adding /opt/homebrew/opt/glslang/include to the include paths so it works on homebrew
<d1b2> <david.rysk> err: /opt/homebrew/opt/glslang/include/glslang/Include
<d1b2> <ehntoo> oh, yeah, the homebrew vulkan sdk issues. I'd forgotten that you'd mentioned hitting that. We've already got a couple search paths in there, probably not too damaging if we tack that one on as well if it's the only change you're carrying locally?
<d1b2> <david.rysk> yeah I'd suggest tacking that one on, as long as the nonexistence of it doesn't cause an issue
<d1b2> <david.rysk> the only other problem is that it can't find ffts.h even though I'm giving it a CMAKE_PREFIX_PATH
<azonenberg> well FFTS i want gone in the next few weeks
<azonenberg> so that will be a temporary nuisance
<lain> azonenberg: I got most of master merged into my macos branch locally, there's still a couple files that I'm gonna definitely need to be awake and alert to finish merging properly. assuming I get decent sleep tonight, that should get done early tomorrow and then I can hopefully get macos further along :D
<azonenberg> Great. i should have the memory leaks fixed shortly, debugging that now
<azonenberg> also fixed some bugs in history and should have that pushed by later today
<d1b2> <david.rysk> aha, the ffts issues are because a502ca55dc6fb2ce4ad8f0ca71355c9328e44d1d was prematurely added to master
<_whitenotifier-7> [scopehal-apps] ehntoo opened pull request #509: WIP: macOS GitHub actions CI runner - https://github.com/glscopeclient/scopehal-apps/pull/509
<d1b2> <david.rysk> ideally that commit would be reverted and then brought back after the dependence on FFTS is fully removed
<d1b2> <ehntoo> I don't think that commit is on master?
<d1b2> <david.rysk> oops that's my bad
<d1b2> <david.rysk> I'm on the macos branch, lemme fix that
<azonenberg> ah yeah that's lain's dev branch
<azonenberg> it's not something i'd recommend for general use
<azonenberg> (yet)
<d1b2> <ehntoo> hrm. I was hoping that github would run the macos workflow in the PR for #509. I guess I understand why they wouldn't run arbitrary actions in PRs though.
<azonenberg> I need to approve actions to run in PRs i think
<_whitenotifier-7> [scopehal-apps] ehntoo synchronize pull request #509: WIP: macOS GitHub actions CI runner - https://github.com/glscopeclient/scopehal-apps/pull/509
<azonenberg> oh yeah this is a completely new set of actions
<azonenberg> not just that you want the CI to run on the new code
<azonenberg> yeah, you'd need to configure that to run in your local fork of the repo i think
<d1b2> <ehntoo> I can do that.
<d1b2> <david.rysk> azonenberg: I'm not using BUILD_TESTING but catch2 is required
<d1b2> <david.rysk> (in latest master)
<azonenberg> it should not be required if you're not building tests
<azonenberg> feel free to PR to fix that
<_whitenotifier-7> [scopehal-apps] ehntoo synchronize pull request #509: WIP: macOS GitHub actions CI runner - https://github.com/glscopeclient/scopehal-apps/pull/509
<d1b2> <ehntoo> woo! windows build step was successful. Looks like the build step took 32m 20s compared to the previous successful run's 47m 15s. Still not fast, but it's not nothing.
<_whitenotifier-7> [scopehal] azonenberg pushed 1 commit to master [+0/-0/±5] https://github.com/glscopeclient/scopehal/compare/a7bd4303f364...264b9aa05915
<_whitenotifier-7> [scopehal] azonenberg 264b9aa - Made Rename() a virtual method of Waveform, not just derived classes. Fixed handle leak in WaveformPool.
<_whitenotifier-7> [scopehal-apps] azonenberg pushed 1 commit to master [+0/-0/±5] https://github.com/glscopeclient/scopehal-apps/compare/e12cf0afa9bd...54b930006f10
<_whitenotifier-7> [scopehal-apps] azonenberg 54b9300 - HistoryDialog now allows deleting of individual items from context menu. Pin in history actually works. Fixed handle leak caused by adding waveforms to a pool after its destructor had already been called.
<azonenberg> ehntoo: It's an improvement. i think using scopeprotocols.h less would be a big speedup all around
<azonenberg> the full list of filters really only ever needs to be used in scopeprotocols.cpp
<azonenberg> and nowhere else
<azonenberg> IMO anything else including scopeprotocols.h is a bug
<d1b2> <ehntoo> 👍 I'll take a look at that next. Now that I have CI running on my own fork can use those machines as a benchmark - some of the changes I was making were hard to measure on my local machine since the impact was low, but it'll be more significant on the slower runners.
<azonenberg> Yeah. well once the new hardware comes in hopefully me and johnsel can figure out a good provisioning architecture to get things running locally and we'll see major speedups there
<azonenberg> We'll also see big speedups by not rebuilding / installing dependencies every single commit longer term
<d1b2> <david.rysk> lol of course it crashes in the version of ffts that I compiled
<d1b2> <david.rysk> sigh ffts
<azonenberg> there's a happy medium between "build isn't reproducible because it depends on custom environment and specific dependencies magically present in the CI environment" and "recompiling every dependency from source every commit"
<azonenberg> that we're working to hit
<azonenberg> david.rysk: yeah afaik ffts on arm64 is basically just nonfunctional
<azonenberg> only the unit tests and spectrogram filter should be impacted
<azonenberg> all of our other fft-using filters will preferentially use vkFFT
<azonenberg> and should work fine on moltenvk
<_whitenotifier-7> [scopehal-apps] ehntoo synchronize pull request #509: WIP: macOS GitHub actions CI runner - https://github.com/glscopeclient/scopehal-apps/pull/509
<d1b2> <david.rysk> adding the demo scope and hitting play causes it to crash inside ffts
<azonenberg> ah yes
<azonenberg> the demo scope uses FFTS to apply some band limitign to simulate finite BW on the scope
<azonenberg> lain's dev branch i think removed that
<d1b2> <david.rysk> ohhhh yeah you mentioned that
<azonenberg> if you double click on each scope channel and go into the mode settings you can see 5 GHz LPF, 5 mV noise, both, or ideal as options
<azonenberg> select one of the options without the LPF for every channel
<azonenberg> and it should work
<azonenberg> any real scope driver should also work
<d1b2> <ehntoo> you'll need lain's changes to TestWaveformSource.cpp/.h from this commit to make the demo scope work on macos at the moment. https://github.com/glscopeclient/scopehal/commit/576eb2184413ab26ec756c7bc652bd2561655098
<azonenberg> yeah thats an option too. long term i want the demo scope to produce more plausible waveforms
<azonenberg> using s-parameter models of a real transmission line or something
<d1b2> <david.rysk> azonenberg: catch2 3.0.1 changed the header to catch_all.hpp: https://github.com/catchorg/Catch2/releases/tag/v3.0.1
<azonenberg> yeah there's also non backward compatible changes in the most recent vulkan sdk (1.3.229) i need to support
<d1b2> <david.rysk> right...
<d1b2> <ehntoo> there's a bunch of changes between catch2 v2 and v3. I've got a patch floating around my tree to update the test suite for it
<azonenberg> file a ticket and we'll work on it when we get a chance. or send a PR
<azonenberg> for now, we support catch2 actual 2
<azonenberg> not catch2-but-really-3 lol
<d1b2> <david.rysk> do you need to support both 2 and 3?
<azonenberg> As a general rule we should be able to build on debian stable with as few from-source dependencies as possible
<azonenberg> vulkan sdk is not in the debian repos but is available as a ppa or similar
<azonenberg> we're moving away from ffts
<azonenberg> we submodule vkfft and imgui
<d1b2> <david.rysk> catch2 might be something worth doing as a submodule. not sure
<azonenberg> yes, potentially worth looking into
<d1b2> <david.rysk> I've gone over this quite a bit, but debian stable is rather unworkable for a desktop for many people
<azonenberg> well it's what i use, so it has to run there :p
<d1b2> <david.rysk> since the packages are just too old for a lot of stuff to work
<azonenberg> that's not negotiable
<azonenberg> generally speaking stable, or oldstable if stable came out <6 months ago, is what i target as e.g. minimum cmake version for building, etc
<d1b2> <ehntoo> if you want it to work locally you can cherry-pick this patch. either submoduling the library or ifdef'ing it to compatibility with both should be doable as a more-permanent solution
<lain> the catch2 fix is also in my macos branch
<d1b2> <david.rysk> ehntoo: is it possible to support both 2 and 3?
<azonenberg> anything that requires a user of a stable distro to install a newer version of a package to work is a decision i make carefully and after exhausting other options
<lain> yes
<d1b2> <ehntoo> I'd just wait for lain's change to land. 🙂
<d1b2> <david.rysk> IMO, requiring users of rolling-release distros that supply current non-beta packages to install an older version is equally as bad, if not worse.
<azonenberg> So, generally i hope that the libs/tools we're using are upward compatible
<azonenberg> i'm trying to target least common denominator functionality
<d1b2> <david.rysk> stuff like gtk3 is a different story since most distros will supply 3 and 4 in parallel
<lain> that supports catch2 v2 and v3
<azonenberg> yes, exactly. (but we're also moving away from gtk)
<azonenberg> this is the kind of thing i expect when a new major version breaks compat
<azonenberg> or like python 2 and 3 for a long time
<d1b2> <david.rysk> lain's commit there would be useful to cherry-pick to master IMO
<d1b2> <ehntoo> it'll be landing soon.
<azonenberg> yeah i've been waiting the last 2-3 days for the queue allocator stuff to get merged
<azonenberg> this would make sense to include in that PR
<d1b2> <david.rysk> ok yeah finally got it working and rendering 🙂
<azonenberg> woop
<azonenberg> glscopeclient or ngscopeclient? or both?
<d1b2> <david.rysk> ngscopeclient
<d1b2> <david.rysk> seems to be using ~150% of CPU
<d1b2> <david.rysk> for the demo scope (no LPF)
<azonenberg> yes the demo scope does a lot of heavy stuff for generating waveforms and is not optimized whatsoever
<azonenberg> so high cpu and lowish framerate is not surprising
<azonenberg> lowish waveform rate
<azonenberg> on x86 PCs 20ish WFM/s is typicawl
<azonenberg> if you open up the performance stats window you should see rendering framerate right around 60
<d1b2> <david.rysk> yp, it is
<d1b2> <david.rysk> waveform rate around 27
<azonenberg> that's actually surprisingly fast but i guess not doing the fft is speeding it up
<d1b2> <david.rysk> is it possible to uncap the framerate?
<azonenberg> yes, swap the enum in VulkanWindow.cpp:314 to eEimmediate, as noted by the comment
<d1b2> <david.rysk> oh I should add, this is debug build
<azonenberg> ntoe also that we dont have unified memory optimizations in yet
<azonenberg> so you're doing redundant cpu-gpu copies a lot
<azonenberg> even though the memory is in the same place
<azonenberg> and using twice the ram you actually need to be
<azonenberg> (for vulkan objects)
<_whitenotifier-7> [scopehal-apps] ehntoo synchronize pull request #509: WIP: macOS GitHub actions CI runner - https://github.com/glscopeclient/scopehal-apps/pull/509
<d1b2> <david.rysk> right, that will hurt performance on unified memory systems
<azonenberg> yep. open ticket that is probably next on lain's plate after her current work lands
<d1b2> <david.rysk> switching to fullscreen works, but is not hidpi-aware
<azonenberg> switching to fullscreen is not hidpi aware?
<azonenberg> the app fullscreened vs maximized should look ~the same
<d1b2> <david.rysk> yeah, everything becomes tiny
<azonenberg> or is it not handling hidpi when maximized either?
<d1b2> <david.rysk> maximized is fine
<azonenberg> interesting. file a bug
<d1b2> <david.rysk> specifically when I use view menu -> fullscreen
<d1b2> <david.rysk> rather than the macos fullscreen
<d1b2> <david.rysk> which is different
<d1b2> <ehntoo> huh. I guess I haven't tried that yet.
<azonenberg> yeah
<azonenberg> well fullscreen works on windows and it didnt before
<azonenberg> so its progress :p
<azonenberg> scaling issues are not surprising and i can work on that
<azonenberg> ehntoo: btw, you should not be -mavx512f globally
<azonenberg> that will result in the generated binaries autovectorizing using avx512 everywhere and creating apps that won't run on anything without
<azonenberg> what we do instead is compile with default machine settings and then enable vectorization for specific hot loops with dynamic dispatch for *those*
<d1b2> <david.rysk> macOS has a weird way of doing fullscreen -- OS-aware fullscreen involves the app getting its own virtual desktop
<d1b2> <david.rysk> when I click the titlebar button that does that, it works fine, with no hidpi issues
<d1b2> <azonenberg> @DanielG can you confirm https://github.com/glscopeclient/scopehal/issues/688 is fixed?
<d1b2> <david.rysk> however, when I do the in-app view -> fullscreen, it seems to change my screen resolution
<d1b2> <david.rysk> okay this was fun
<d1b2> <david.rysk> I first did OS-aware fullscreen, then I did view->fullscreen
<azonenberg> lol
<d1b2> <david.rysk> and then switched back to my desktop, and now everything is tiny
<d1b2> <david.rysk> it changed the overall screen resolution for the whole system 😮
<azonenberg> would it perhaps make sense to just hide the fullscreen button / menu in the app on macos if there's already a working, OS-integrated way to do it?
<d1b2> <david.rysk> yeah
<azonenberg> Send a PR :)
<d1b2> <david.rysk> though this all leads to the question of whether it's possible to use the proper macOS menubar on macOS
<d1b2> <david.rysk> what were you using for I/O instead of SDL?
<azonenberg> glfw
<azonenberg> the menus are handled by imgui which i think does support a top level OS-integrated menu on macos
<azonenberg> iirc we just arent using that
<d1b2> <david.rysk> oh it does support that?
<azonenberg> let me check
<d1b2> <david.rysk> BeginMainMenuBar() but does this actually integrate with the OS or does it fake the menu bar
<azonenberg> I think there was a flag somewhere to say use the os integrated menu
<azonenberg> thats what i'm looking for
<d1b2> <ehntoo> hm... the -mavx512f was added to avoid ABI incompatibility warnings about "AVX vector return of type '__m512i' ... without 'avx512f' enabled changes the ABI". Does clang not support attribute((target))? I'll investigate.
<azonenberg> yeah look into it. any function that returns a vector type is using that ABI
<azonenberg> but anything else should be using a no-avx abi
<azonenberg> anyway if imgui can't do native menus on macos yet i'm sure that will come soon and not need code changes on our end
<d1b2> <david.rysk> it may, it may not
<d1b2> <david.rysk> we can live with built-in menus for now
<_whitenotifier-7> [scopehal-apps] ehntoo synchronize pull request #509: WIP: macOS GitHub actions CI runner - https://github.com/glscopeclient/scopehal-apps/pull/509
lain has quit [Remote host closed the connection]
lain has joined #scopehal
<d1b2> <ehntoo> did a little checking into menubar support while waiting to see if I found the magic incantation to fix the AVX ABI errors. It looks like it's something we'd have to support at the glfw layer with some custom platform code. https://discourse.glfw.org/t/modifying-glfw-window-menu-bar/1291
<d1b2> <ehntoo> not something I'd personally prioritize though, the in-app menubar is good enough for me.
<_whitenotifier-7> [scopehal-apps] azonenberg pushed 1 commit to master [+0/-0/±3] https://github.com/glscopeclient/scopehal-apps/compare/54b930006f10...5f8adf25d3ba
<_whitenotifier-7> [scopehal-apps] azonenberg 5f8adf2 - HistoryDialog: added depth control
<azonenberg> ehntoo: file an issue just so we have it on record
<azonenberg> but i see no reason to work on it any time soon
<azonenberg> ok so i think tonight i am going to work on markers and cursors as markers integrate with history
<azonenberg> and cursors are very similar to markers
<_whitenotifier-7> [scopehal-apps] ehntoo opened issue #510: Native Menubar Support in ngscopeclient on MacOS - https://github.com/glscopeclient/scopehal-apps/issues/510