stuartcarnie

stuartcarnie

Engineer at @influxdata doing distributed databasey things. Also known to hack on emulators, Apple (macOS, iOS), Metal

Member Since 12 years ago

InfluxData, Launceston, Tasmania

Experience Points
147
follower
Lessons Completed
86
follow
Lessons Completed
466
stars
Best Reply Awards
115
repos

219 contributions in the last year

Pinned
⚡ MIT-licensed iOS SDK for iCade and iControlPad, including sample application
⚡ Optimized functions for Go using SIMD
⚡ Commodore 64 for iPhone
⚡ Scalable datastore for metrics, events, and real-time analytics
⚡ 🕹 Retro video game emulation for macOS
⚡ Shader framework for the OpenEmu app
Activity
Dec
7
1 day ago
pull request

stuartcarnie merge to stuartcarnie/gopm

stuartcarnie
stuartcarnie

better config verification

Verify cron values when parsing; also verify depends_on relationships, meaning that we can assume later in the code that there are no cyclic dependencies to get us into recursive trouble.

Also remove the priority field from the configuration as it's of marginal use since we now have depends_on which wasn't present in the original supervisord configuration from which this is derived.

pull request

stuartcarnie merge to stuartcarnie/gopm

stuartcarnie
stuartcarnie

process: move config reconciliation logic inside process.Manager

Instead of making the supervisor logic responsible for adding, removing, and auto-starting processes, make the manager itself do that, which makes it possible to do it in a different way when refactored.

Dec
6
2 days ago
pull request

stuartcarnie merge to stuartcarnie/gopm

stuartcarnie
stuartcarnie

move shell to config

Having the shell as a command-line value that defaults to $SHELL doesn't really make sense, as the interpretation of the commands in a gopm config file shouldn't vary depending on the environment they're run in. Instead, make the shell a property of each program, defaulting to /bin/sh.

Also remove the restart-when-binary-changed functionality as it's currently somewhat broken and doesn't really make sense in general when commands are shell scripts. It can be added back later with rethought semantics.

stuartcarnie
stuartcarnie

Agree, these are great changes 👍🏻

pull request

stuartcarnie merge to stuartcarnie/gopm

stuartcarnie
stuartcarnie

process: move ForEach operations inside process manager

Moving towards a major refactor of the process package, as a first step, we move all the various operations that iterate over processes to inside the process manager, meaning that we can unexport the Process type and all its methods.

We also move the process.Stat function and its dependencies out into its own package as it has nothing to do with the rest of that package's functionality (it's only used by gopmctl, in a somewhat dubious manner that assumes that gopmctl is running on the same machine as the gopm it's talking to).

We remove the topological sorting code too, as it doesn't actually help in doing the job it's supposed to be doing.

stuartcarnie
stuartcarnie

Another nice round of simplification and cleanup 👏🏻

I like the comments in the CUE schema file 💯

Dec
5
3 days ago
pull request

stuartcarnie merge to stuartcarnie/gopm

stuartcarnie
stuartcarnie

feat: use CUE for configuration

We start to use CUE as the configuration language. We can potentially add back support for JSON and YAML configuration files later if we'd like (and support for a single file rather than a directory).

stuartcarnie
stuartcarnie
open pull request

stuartcarnie wants to merge stuartcarnie/gopm

stuartcarnie
stuartcarnie

feat: use CUE for configuration

We start to use CUE as the configuration language. We can potentially add back support for JSON and YAML configuration files later if we'd like (and support for a single file rather than a directory).

stuartcarnie
stuartcarnie
open pull request

stuartcarnie wants to merge stuartcarnie/gopm

stuartcarnie
stuartcarnie

feat: use CUE for configuration

We start to use CUE as the configuration language. We can potentially add back support for JSON and YAML configuration files later if we'd like (and support for a single file rather than a directory).

stuartcarnie
stuartcarnie
pull request

stuartcarnie merge to stuartcarnie/gopm

stuartcarnie
stuartcarnie

feat: use CUE for configuration

We start to use CUE as the configuration language. We can potentially add back support for JSON and YAML configuration files later if we'd like (and support for a single file rather than a directory).

stuartcarnie
stuartcarnie
pull request

stuartcarnie merge to stuartcarnie/gopm

stuartcarnie
stuartcarnie

chore: more config refactoring

The use of memdb makes everything unnecessarily complex. Avoid it and just do the diff ourselves with less code and less dependencies.

Also remove the unused GetVersion RPC call.

[Note: this PR also includes #30 currently; the changes mentioned above are in the most recent commit]

stuartcarnie
stuartcarnie

I like the test improvements and the refactoring of gopmctlcmd 👍🏻

pull request

stuartcarnie merge to stuartcarnie/gopm

stuartcarnie
stuartcarnie

move towards end-to-end testing

We'd like to be able to have tests that give assurance that gopm works as advertised, so this is a start in that direction. It uses testscript to run end-to-end tests without significantly disrupting the existing logic in the main packages.

Also:

  • remove the "group" functionality that's not implemented currently anyway,
  • avoid printing ANSI escape codes when TERM=dumb or the output isn't to a terminal.
  • avoid using an external diff package when reflect.DeepEqual will do just as well.
  • support different networks for the gRPC connection, including unix-domain sockets, which we can use in the tests to avoid awkwardness about choosing a network port without potential name clashes.

I have no idea why the rpc/javascript/package-lock.json file grew so much when I ran make webgui/js/bundle.js to regenerate the JS when removing the unused SignalProcessGroup call from the gRPC API.

Dec
2
6 days ago
pull request

stuartcarnie merge to stuartcarnie/gopm

stuartcarnie
stuartcarnie

more code consolidation

Remove some unneeded packages and code and merge others that seem like they don't justify themselves as separate packages.

stuartcarnie
stuartcarnie

👋🏻 to more code. Good stuff, @rogpeppe!

Dec
1
1 week ago
started
started time in 6 days ago
pull request

stuartcarnie merge to stuartcarnie/gopm

stuartcarnie
stuartcarnie

config: simplify config package

Simplify the config package's API in preparation for refactoring.

  • move the types defined by the model package into config and unexport them.
  • remove unused functionality
  • unexport types and functions when possible
  • move the process sorting algorithm into the process package.

In passing, apply a fix to the YAML duration unmarshaling, which fails if the duration is quoted. We're going to moving to JSON unmarshaling soon, so don't bother with a test.

stuartcarnie
stuartcarnie

Great cleanup here! 💯!

Nov
29
1 week ago
Activity icon
issue

stuartcarnie issue comment ocornut/imgui

stuartcarnie
stuartcarnie

fix: OSX backend improvements

This PR makes changes to the macOS backend and the Apple example that uses the macOS backend.

Firstly, the PR addresses some issues and shortcomings of in imgui_impl_osx.mm as follows

  • Fixed keyboard support using kVK_ codes and keyboard modifier handling.
    • Keyboard navigation now works correctly for features such as navigating windows
  • Added complete gamepad support via GameController framework

Secondly, the example_apple_metal.mm example has addressed the unhandled key event chimes, which adds a keyDown: handler.

This PR does not touch the core of IMGUI.

NOTE:

There is a single breaking change to the ImGui_ImplOSX_Init API, which now takes the same NSView being used by the ImGui_ImplOSX_NewFrame. This NSView is used to attach an NSTextInputClient to the responder chain to process key presses using the same approach as GLFW and SDL. This approach ensures the macOS ImGui backend us macOS APIs for determining characters that should be accepted as text input.

stuartcarnie
stuartcarnie

👋🏻 hey @ocornut, I've updated this PR and expanded the description to reflect the recent changes. The OSX backend should now be ready for another review.

push

stuartcarnie push stuartcarnie/imgui

stuartcarnie
stuartcarnie

Fix: IM_DEBUG_BREAK macro on ARM GCC (#4767)

stuartcarnie
stuartcarnie

Backends: WebGPU: Passing explicit buffer sizes as validation layers appears to not do what the in-flux specs says. (#4766

stuartcarnie
stuartcarnie

Inputtext, Nav: fixed using SetKeyboardFocusHere() on InputTextMultiline(). (#4761)

stuartcarnie
stuartcarnie

fix: OSX backend improvements

  • Fixed keyboard support using kVK_ codes
  • Added gamepad support via GameController framework
  • Updated example_apple_metal and example_apple_opengl2 projects

NOTE: ImGui_ImplOSX_Init now requires the view that our keyboard responder will be attached to. In doing so, the macOS backend input behaves similarly to GLFW and SDL2

stuartcarnie
stuartcarnie

fix: Calling [NSCurser set] unconditionally is expensive

commit sha: 4fdbf46698fee23994c1797c19b6be43ada04cc3

push time in 1 week ago
pull request

stuartcarnie merge to stuartcarnie/gopm

stuartcarnie
stuartcarnie

simplify configuration

This is intended as preparatory work before refactoring the way that configuration is done.

Note: this leaves the code in a non-working state.

Activity icon
issue

stuartcarnie issue comment stuartcarnie/gopm

stuartcarnie
stuartcarnie

race conditions in process/process.go

By inspection there are multiple potential race conditions inside the Process code.

A couple of examples:

A loop reading the field state without any synchronization around that field: https://github.com/stuartcarnie/gopm/blob/dcf77fd2c158a5c0d00a74b731e024dd0945a5ea/process/process.go#L807-L814

Calling p.isRunning (which inspects the value of the field cmd which can change asynchronously) without obtaining the mutex: https://github.com/stuartcarnie/gopm/blob/dcf77fd2c158a5c0d00a74b731e024dd0945a5ea/process/process.go#L190

In general the code is hard to understand and reason about. I suspect that a more disciplined approach with a single goroutine that's responsible for managing any running process would pay dividends. There are multiple places that repeatedly poll where they could wait on a channel instead which would be both more efficient and easier to reason about. For example: https://github.com/stuartcarnie/gopm/blob/dcf77fd2c158a5c0d00a74b731e024dd0945a5ea/process/process.go#L614-L618

stuartcarnie
stuartcarnie

process.go from the https://github.com/ochinchina/supervisord repo is different enough now that we should implement the fixes ourselves.

Activity icon
issue

stuartcarnie issue comment stuartcarnie/gopm

stuartcarnie
stuartcarnie

race conditions in process/process.go

By inspection there are multiple potential race conditions inside the Process code.

A couple of examples:

A loop reading the field state without any synchronization around that field: https://github.com/stuartcarnie/gopm/blob/dcf77fd2c158a5c0d00a74b731e024dd0945a5ea/process/process.go#L807-L814

Calling p.isRunning (which inspects the value of the field cmd which can change asynchronously) without obtaining the mutex: https://github.com/stuartcarnie/gopm/blob/dcf77fd2c158a5c0d00a74b731e024dd0945a5ea/process/process.go#L190

In general the code is hard to understand and reason about. I suspect that a more disciplined approach with a single goroutine that's responsible for managing any running process would pay dividends. There are multiple places that repeatedly poll where they could wait on a channel instead which would be both more efficient and easier to reason about. For example: https://github.com/stuartcarnie/gopm/blob/dcf77fd2c158a5c0d00a74b731e024dd0945a5ea/process/process.go#L614-L618

stuartcarnie
stuartcarnie

I will take a look at the original upstream that this was hard forked from to see if the Process type has any of these improvements, otherwise we can implement the changes ourselves.

Nov
26
1 week ago
started
started time in 1 week ago
push

stuartcarnie push stuartcarnie/imgui

stuartcarnie
stuartcarnie

InputText: fixed ReadOnly flag preventing callbacks from receiving the text buffer. (#4762)

stuartcarnie
stuartcarnie

InputText: Internals: moved "apply_new_text" application code to reduce noise in a future commit (will be for #4714) + removed unused fields.

The move would ideally be no-op. technically we now clear state->Flags before calling ResizeCallback but those are unrelated. The 2 unused fields were incorrectly added by 24ff25981.

stuartcarnie
stuartcarnie

fix: OSX backend improvements

  • Fixed keyboard support using kVK_ codes
  • Added gamepad support via GameController framework
  • Updated example_apple_metal and example_apple_opengl2 projects

NOTE: ImGui_ImplOSX_Init now requires the view that our keyboard responder will be attached to. In doing so, the macOS backend input behaves similarly to GLFW and SDL2

commit sha: 9a680ebc65e80fd719b5c264de2f0e4beec2e420

push time in 1 week ago
Nov
24
2 weeks ago
open pull request

stuartcarnie wants to merge ocornut/imgui

stuartcarnie
stuartcarnie

fix: OSX backend improvements

This PR makes changes to the macOS backend and the Apple example that uses the macOS backend.

Firstly, the PR addresses some issues and shortcomings of in imgui_impl_osx.mm as follows

  • Fixed keyboard support using kVK_ codes and keyboard modifier handling.
    • Keyboard navigation now works correctly for features such as navigating windows
  • Added complete gamepad support via GameController framework

Secondly, the example_apple_metal.mm example has addressed the unhandled key event chimes, which adds a keyDown: handler.

This PR does not touch the core of IMGUI.

pull request

stuartcarnie merge to ocornut/imgui

stuartcarnie
stuartcarnie

fix: OSX backend improvements

This PR makes changes to the macOS backend and the Apple example that uses the macOS backend.

Firstly, the PR addresses some issues and shortcomings of in imgui_impl_osx.mm as follows

  • Fixed keyboard support using kVK_ codes and keyboard modifier handling.
    • Keyboard navigation now works correctly for features such as navigating windows
  • Added complete gamepad support via GameController framework

Secondly, the example_apple_metal.mm example has addressed the unhandled key event chimes, which adds a keyDown: handler.

This PR does not touch the core of IMGUI.

push

stuartcarnie push stuartcarnie/imgui

stuartcarnie
stuartcarnie

fix: OSX backend improvements

  • Fixed keyboard support using kVK_ codes
  • Added gamepad support via GameController framework
  • Updated example_apple_metal and example_apple_opengl2 projects

NOTE: ImGui_ImplOSX_Init now requires the view that our keyboard responder will be attached to. In doing so, the macOS backend input behaves similarly to GLFW and SDL2

commit sha: 28c32a6c105441eb7557a3c58f9d3d3b69fedc38

push time in 1 week ago
open pull request

stuartcarnie wants to merge ocornut/imgui

stuartcarnie
stuartcarnie

fix: OSX backend improvements

This PR makes changes to the macOS backend and the Apple example that uses the macOS backend.

Firstly, the PR addresses some issues and shortcomings of in imgui_impl_osx.mm as follows

  • Fixed keyboard support using kVK_ codes and keyboard modifier handling.
    • Keyboard navigation now works correctly for features such as navigating windows
  • Added complete gamepad support via GameController framework

Secondly, the example_apple_metal.mm example has addressed the unhandled key event chimes, which adds a keyDown: handler.

This PR does not touch the core of IMGUI.

stuartcarnie
stuartcarnie

Ahh, sorry. I will provide a fix for this.

I will also resolve the OpenGL build

pull request

stuartcarnie merge to ocornut/imgui

stuartcarnie
stuartcarnie

fix: OSX backend improvements

This PR makes changes to the macOS backend and the Apple example that uses the macOS backend.

Firstly, the PR addresses some issues and shortcomings of in imgui_impl_osx.mm as follows

  • Fixed keyboard support using kVK_ codes and keyboard modifier handling.
    • Keyboard navigation now works correctly for features such as navigating windows
  • Added complete gamepad support via GameController framework

Secondly, the example_apple_metal.mm example has addressed the unhandled key event chimes, which adds a keyDown: handler.

This PR does not touch the core of IMGUI.

pull request

stuartcarnie pull request ocornut/imgui

stuartcarnie
stuartcarnie

fix: OSX backend improvements

This PR makes changes to the macOS backend and the Apple example that uses the macOS backend.

Firstly, the PR addresses some issues and shortcomings of in imgui_impl_osx.mm as follows

  • Fixed keyboard support using kVK_ codes and to correctly handle keyboard modifies
    • Keyboard navigation now works correctly for features such as navigating windows
  • Added complete gamepad support via GameController framework

Secondly, the example_apple_metal.mm example has addressed the unhandled key event chimes, which adds a keyDown: handler.

This PR does not touch the core of IMGUI.

Activity icon
created branch

stuartcarnie in stuartcarnie/imgui create branch sgc/fix_osx

createdAt 1 week ago
push

stuartcarnie push stuartcarnie/imgui

stuartcarnie
stuartcarnie

Changelog, tweak OpenGL3 backends. (#3061), update Gallery thread links.

stuartcarnie
stuartcarnie

Added IMGUI_USE_WCHAR32 instead of "#32" to faclitate C-binding. (#2538, #2541, #2815)

stuartcarnie
stuartcarnie

Alter definition of IM_UNICODE_ defines to faclitate C-binding. (#2538, #2541, #2815)

stuartcarnie
stuartcarnie

Selectable: Removed seemingly ineffective text clipping offset in SpanAllColumns handling path + tweaks.

made max_x absolutely to reduce confusion. amend cf481e1

stuartcarnie
stuartcarnie

Selectable: Fixed honoring style.SelectableTextAlign with unspecified size. (#2347, #2601)

stuartcarnie
stuartcarnie

Selectable: Clarifying the code around use of ImGuiSelectableFlags_DrawFillAvailWidth (with intent of trying to remove it).

Amend old 6251d379, 2bcafc86

stuartcarnie
stuartcarnie

Selectable: Removed extraneous WindowPadding.x worth of width when auto-sized selectable label goes off available width (would not be noticeable) + Renamed ImGuiSelectableFlags_DrawFillAvailWidth to ImGuiSelectableFlags_SpanAvailWidth.

stuartcarnie
stuartcarnie

Selectable: Allow using ImGuiSelectableFlags_SpanAllColumns in other columns than first. Comments. (#125)

stuartcarnie
stuartcarnie

TreeNode: Made clicking on arrow with _OpenOnArrow toggle the open state on the Mouse Down event rather than the Mouse Down+Up sequence (this is rather standard behavior).

stuartcarnie
stuartcarnie

Nav: Store key mods associated to a nav request (for range_select) + use io.KeyMods.

  • renamed NavScoringRectScreen > NavScoringRect
stuartcarnie
stuartcarnie

Nav: Disabled clipping g.NavId and fixed interactions with ImGuiListClipper. (#787)

stuartcarnie
stuartcarnie

Columns: undid the change in 1.75 were Columns()/BeginColumns() were preemptively limited to 64 columns with an assert. (#3037, #125)

Essentially reverting 9d444062f974b21f1fc09b7e85479fff3e0789c2.

stuartcarnie
stuartcarnie

Update docs, FAQ, comments (mainly related to io.WantCaptureMouse / WantCaptureKeyboard flags).

stuartcarnie
stuartcarnie

Misc: Added an explicit compile-time test for non-scoped IM_ASSERT() macros to redirect users to a solution + fixed our stb wrappers.

  • Nav: Use nav layer enum, comments.
stuartcarnie
stuartcarnie

Metrics: Made Tools section more prominent, added options, made mesh viewer more accessible.

stuartcarnie
stuartcarnie

Backends: Include imgui.h in implementation headers. (#3105)

Currently, the implementation headers don't include the imgui.h header. Which means that the compilation will fail if the implementation header was included before the imgui.h header in the compilation unit. For instance, a compilation unit with the following will work:

#3.h"

But a compilation unit with the following will fail because IMGUI_IMPL_API and possibly other symbols will not be defined:

#3.h" #include "imgui.h"

This patch includes imgui.h in the implementation headers to make inclusions order-invariant, which is a recommended practice.

stuartcarnie
stuartcarnie

Backends: Comments next to include, misc minor comments/tweaks, fix imgui_impl_osx.h using IMGUI_API instead of IMGUI_IMPL_API. (#3105)

stuartcarnie
stuartcarnie

Regretfully moved .gitignore file from examples/ into root directory because OSX keeps pooping its DS_Store/ artifacts everywhere. (#3088)

stuartcarnie
stuartcarnie

Plot: Internals: Added hovered index to PlotEx() function. (#2670)

commit sha: 4d9a3b19d5e348fafa5f680ffe1e49167b149aa0

push time in 1 week ago
Nov
22
2 weeks ago
Activity icon
issue

stuartcarnie issue comment influxdata/influxdb

stuartcarnie
stuartcarnie

Multi-Account Support - find areas where OrgID must be added to filter criteria

IDPE code was written with an assumption that every user belonged to one and only one organization. For users that belong to more than one organizaion there places where the responses need to be filtered by organization id, else the caller will get objects that belong to more organization. Relying on the UI to always have a "org scoped" request does not control for non-UI users getting data that is not scoped to the org represented by their token

stuartcarnie
stuartcarnie

The process for autogenerating a bucket and DB/RP is documented in this original issue under the section Autogenerating Buckets:

https://github.com/influxdata/idpe/issues/6948

Note specifically that the feature does not account for a user that is a member of multiple organisations. Can a user specify their default organisation? If not, how with this workflow choose a default org that a bucket and DB/RP is created for? Does the auth token contain authorisation to access multiple organisations or just a single?

Previous