Skip to content

Instantly share code, notes, and snippets.

View swap357's full-sized avatar

Swapnil Patel swap357

View GitHub Profile
@swap357
swap357 / gist:52e2be3cde229476ab044d1718989f36
Created September 10, 2025 07:09
tracing numba byteflow: state and untyped passes
> /root/hostpwd/numba/numba/core/byteflow.py(116)run()
-> runner.dispatch(state)
(Pdb) state.__dict__
{'_bytecode': <numba.core.bytecode.ByteCodePy312 object at 0xffff809322b0>, '_pc_initial': 0, '_pc': 2, '_nstack_initial': 0, '_stack': [], '_blockstack_initial': (), '_blockstack': [], '_temp_registers': [], '_insts': [(0, {})], '_outedges': [], '_terminated': False, '_phis': {}, '_outgoing_phis': {}, '_used_regs': set(), '_kw_names': None, '_make_func_attrs': defaultdict(<class 'dict'>, {})}
(Pdb) c
> /root/hostpwd/numba/numba/core/byteflow.py(116)run()
-> runner.dispatch(state)
(Pdb) state.__dict__
{'_bytecode': <numba.core.bytecode.ByteCodePy312 object at 0xffff809322b0>, '_pc_initial': 0, '_pc': 4, '_nstack_initial': 0, '_stack': [], '_blockstack_initial': (), '_blockstack': [], '_temp_registers': [], '_insts': [(0, {}), (2, {})], '_outedges': [], '_terminated': False, '_phis': {}, '_outgoing_phis': {}, '_used_regs': set(), '_kw_names': None, '_make_func_attrs': defaultdict(<class 'dict'>, {})}
(Pdb) c
@swap357
swap357 / gist:da2958d7f3035a095c04afbb0444aa46
Last active September 10, 2025 04:52
tracing numba byteflow - TraceRunner [#1: unsupported opcode]
(Pdb) break /root/hostpwd/numba/numba/core/dispatcher.py:443
Breakpoint 4 at /root/hostpwd/numba/numba/core/dispatcher.py:443
(Pdb) break /root/hostpwd/numba/numba/core/dispatcher.py:376
Breakpoint 5 at /root/hostpwd/numba/numba/core/dispatcher.py:376
(Pdb) break /root/hostpwd/numba/numba/core/dispatcher.py:908
Breakpoint 6 at /root/hostpwd/numba/numba/core/dispatcher.py:908
(Pdb) break /root/hostpwd/numba/numba/core/dispatcher.py:80
Breakpoint 7 at /root/hostpwd/numba/numba/core/dispatcher.py:80
(Pdb) break /root/hostpwd/numba/numba/core/dispatcher.py:94
Breakpoint 8 at /root/hostpwd/numba/numba/core/dispatcher.py:94
@swap357
swap357 / numpy_arr_init.py
Created August 11, 2025 05:08
numpy array creation cheatsheet
import numpy as np
rng = np.random.default_rng(0) # modern random
# BASIC FILLS
z = np.zeros((2,3), dtype=np.float32) # [[0.,0.,0.],[0.,0.,0.]]
o = np.ones(5, dtype=np.float32) # [1.,1.,1.,1.,1.]
full7 = np.full((2,3), 7, dtype=np.int32) # [[7,7,7],[7,7,7]]
emp = np.empty((2,3)) # uninitialized
# “LIKE” (match shape/dtype of another array)
@swap357
swap357 / 0_osx-arm64-build (3.13).txt
Created May 14, 2025 17:19
libunwind_issue_logs_osx
2025-04-22T16:18:51.5783580Z Current runner version: '2.323.0'
2025-04-22T16:18:51.5797170Z ##[group]Operating System
2025-04-22T16:18:51.5797590Z macOS
2025-04-22T16:18:51.5797870Z 14.7.4
2025-04-22T16:18:51.5798140Z 23H420
2025-04-22T16:18:51.5798420Z ##[endgroup]
2025-04-22T16:18:51.5798730Z ##[group]Runner Image
2025-04-22T16:18:51.5799050Z Image: macos-14-arm64
2025-04-22T16:18:51.5799370Z Version: 20250331.1204
2025-04-22T16:18:51.5800030Z Included Software: https://github.com/actions/runner-images/blob/macos-14-arm64/20250331.1204/images/macos/macos-14-arm64-Readme.md