zhiayang/mx 12
Hobby Operating System in C++
a kernel in c++
tag mkv files sanely and automatically
instruction (assembler) & disassembler, for x86.
Advent of Code solutions (2015-2019)
Tiny kernel experiment with the goal of running a precompiled 64-bit Linux ELF executable of `echo` as-is. Purely for educational purposes.
macOS menubar music player
OrionOS, Revision 4
Reference manual for Flax
push eventzhiayang/ikurabot
commit sha 96b8d5dd2b47b3aabd5394b319a9061e541721bb
makeshift hack
push time in 4 days
startedlflare/mdathome-golang
started time in 5 days
startedskiftOS/skift
started time in 13 days
push eventzhiayang/ikurabot
commit sha 500ac32bce4337e9599329d82735d8ffb2d28d7c
fix self perms on discord
push time in 14 days
push eventzhiayang/ikurabot
commit sha 9a5aaac221e725acd8865e68e15160adeade91fc
owo
push time in 14 days
push eventzhiayang/ikurabot
commit sha 4636b985fab348aad8463f90fcbe728796f1233c
add config to disable msg handlers
push time in 14 days
push eventzhiayang/ikurabot
commit sha 1ada8ac2da85cd63473ed52e5808aae627a3e5ea
fix precedence of ? operator
push time in 14 days
push eventzhiayang/ikurabot
commit sha 19fd6b02006ac8f366bbae7dbf179e4dfe5847cd
stuff
push time in 14 days
push eventzhiayang/ikurabot
commit sha 2a95e8cd162360ac2ffd7ed997452c2cf1b7e2c5
uwu
commit sha e2087b939407cbebaef2239ff77f0dc68bf4ade4
Merge branch 'master' of github.com:zhiayang/ikurabot
push time in 14 days
push eventzhiayang/ikurabot
commit sha e3d3707f42b3f11da9d7d63374135473a2d0306e
ignore run script
push time in 14 days
push eventzhiayang/ikurabot
commit sha 1905c54efa466e050dd2d40f9e31b0619c52c336
fix use of sleep_for on windows (wrap it with sleep_until)
commit sha 69a2c8d7ed90a2dddfab14d2e5b3642fe588d8a8
interp: add DotOp
commit sha 9cbc8e1aa598fc1e27cf375c45fc29b37cc8e059
add message handlers
push time in 14 days
push eventzhiayang/ikurabot
commit sha b4366fb8d3fd06fb840005c6ac88ca55952ab0cf
fix for linux
push time in 14 days
push eventzhiayang/mkvtaginator
commit sha eb7e35cba2d44116997a5ece230e6aa6643ddde0
1.1.0: add --subtitles option, fix bug re. matching art as video
push time in 14 days
push eventzhiayang/mkvtaginator
commit sha 5b9c0187f4664312b4715a30143203bb380fc479
handle comments in picojson
commit sha d090b77cce27b0b2340ea016c4d40b5049db5d15
set max_interleave_delta to 0 for muxing
push time in 17 days
startedzhiayang/nx
started time in 17 days
startedmanagarm/mlibc
started time in 18 days
push eventzhiayang/qmk_firmware
commit sha cddfe8b5379e0a43ab284cf8d9b42aa4d695509e
update iris keymap
push time in 19 days
push eventzhiayang/ztl
commit sha ee60c7bd6ce4cecd19debb101c52cb830ec2e94e
zpr: 1.2.0
push time in 20 days
push eventzhiayang/ztl
commit sha b110c00ec9a34e8a9a8397be50c4de8f5a233306
zpr: 1.1.1
push time in 20 days
push eventzhiayang/ztl
commit sha f0fc8b507c54e5d4a60df5637eb957662e3da4d3
zpr: 1.1.0
push time in 20 days
push eventzhiayang/ztl
commit sha e473a002bece4b55695669f847c60356ab8efca0
zpr: documentation update; zfu: first, 0.1.0
push time in 21 days
push eventzhiayang/sublimetext-dynamictabs
commit sha 47f980ce78a85c6170cde3ddbe532c811bb23c41
add the upward scanning functionality from the vscode plugin. maxTries is currently set to 3.
push time in 21 days
startedNils-TUD/Escape
started time in 23 days
push eventzhiayang/ikurabot
commit sha 02896ec9f58898e56b96db2b8c39138f15dbd60b
fix csrf exploit?
push time in a month
startedgeeksville/Micro-RTSP
started time in a month
push eventzhiayang/latex-commonsty
commit sha e4a4709524031955be68a0461d4c8ad0a0b79f5f
unfuck minted
push time in a month
fork zhiayang/linux
Linux kernel variant from Analog Devices; see README.md for details
https://github.com/analogdevicesinc/linux
fork in a month
push eventzhiayang/znn
commit sha 6e76a6fd77009781d09cc32cd1dcaaf80630292d
second
commit sha 2ee020ed8534687f9b6dc05d8e7e8005435eb282
third
push time in 2 months
issue commentxtensor-stack/xtensor
right, I just looked into the xt::linalg::dot implementation and it does work properly for the (a, b, c) x (c, d) case to give (a, b, d). It doesn't do the (a, b) x (b, c, d) -> (a, c, d) case (is that even a useful thing? idk, like i said I have close to 0 math background) nor the (a, b, c) x (a, c, d) -> (a, b, d) case -- or at least the output is different from that of numpy.
As for the template thing, this is what i came up with, after digging a bit into the sources:
template <typename At, typename Bt, typename R = std::common_type_t<typename At::value_type, typename Bt::value_type>>
xarray<R> matrix_mul(const xexpression<At>& aexp, const xexpression<Bt>& bexp)
more importantly, is the implementation mathematically/logically sound?
comment created time in 2 months
issue commentxtensor-stack/xtensor
neither xtensor nor xtensor-blas have implemented matmul as described here, so I implemented my own version that properly handles broadcasting; eg. you can multiply perform (2, 4, 3) x (3, 5) as well as (5, 2) x (2, 4, 6).
template <class _Tp>
xt::xarray<_Tp> matrix_mul(xt::xarray<_Tp> a, xt::xarray<_Tp> b)
{
using Arr = xt::xarray<_Tp>;
if(a.dimension() == 1 && b.dimension() == 1)
{
return xt::linalg::outer(a, b);
}
else if(a.dimension() <= 2 && b.dimension() <= 2)
{
return xt::linalg::dot(a, b);
}
else
{
if(a.dimension() == b.dimension())
{
assert(a.shape()[0] == b.shape()[0]);
size_t layers = a.shape()[0];
Arr tmp;
{
Arr a0 = xt::view(a, 0);
Arr b0 = xt::view(b, 0);
tmp = matrix_mul(std::move(a0), std::move(b0));
}
auto out_shape = tmp.shape();
out_shape.insert(out_shape.begin(), layers);
auto result = Arr::from_shape(out_shape);
xt::view(result, 0) = tmp;
for(size_t i = 1; i < layers; i++)
{
Arr ai = xt::view(a, i);
Arr bi = xt::view(b, i);
xt::view(result, i) = matrix_mul(std::move(ai), std::move(bi));
}
return result;
}
else if(a.dimension() > b.dimension())
{
size_t layers = a.shape()[0];
Arr tmp;
{
Arr a0 = xt::view(a, 0);
tmp = matrix_mul(std::move(a0), b);
}
auto out_shape = tmp.shape();
out_shape.insert(out_shape.begin(), layers);
auto result = Arr::from_shape(out_shape);
xt::view(result, 0) = std::move(tmp);
for(size_t i = 1; i < layers; i++)
{
Arr ai = xt::view(a, i);
xt::view(result, i) = matrix_mul(std::move(ai), b);
}
return result;
}
else
{
assert(a.dimension() < b.dimension());
size_t layers = b.shape().back();
Arr tmp;
{
Arr b0 = xt::strided_view(b, { xt::ellipsis(), 0 });
tmp = matrix_mul(a, std::move(b0));
}
auto out_shape = tmp.shape();
out_shape.insert(out_shape.end(), layers);
auto result = Arr::from_shape(out_shape);
xt::strided_view(result, { xt::ellipsis(), 0 }) = std::move(tmp);
for(size_t i = 1; i < layers; i++)
{
Arr bi = xt::strided_view(b, { xt::ellipsis(), i });
xt::strided_view(result, { xt::ellipsis(), i }) = matrix_mul(a, std::move(bi));
}
return result;
}
}
}
I have neither a strong math background nor a BLAS background, so idk how correct this is; it looks mathematically sound from my small tests, but I'm sure it can be made more efficient.
comment created time in 2 months
push eventzhiayang/ikurabot
commit sha dc5730f1c470dbc6ceeb48fd381ab9e5047acf5d
stuff
push time in 2 months
push eventzhiayang/ikurabot
commit sha aa4d489b3e23be40afe311a2c898f207f4e77926
owo
push time in 2 months
push eventzhiayang/ikurabot
commit sha 089ac1659275510c614c43915e90552278e045ca
discord sending
commit sha 82571c4bf0128152938d594fedca3a30a4fcd186
stuff
commit sha 65831a4cd936aba9d9bbc2062d3ee9d6415674b7
lots of stuff
commit sha 2f9deb5562a487e213ef53a46fafa84bca7bdfde
auto-update bttv and ffz emotes
commit sha bd37b042a21340f6a3022f2f193f49f59716bf3b
markov emits discord emotes properly
commit sha e240d0b23a5177716943b7d375b94be662e29883
more stuff
push time in 2 months
startedchuahou/yes
started time in 2 months
push eventzhiayang/ikurabot
commit sha e6b146aff847d7b1b3fa7ffd848b12cbef3d50cd
more work on discord
push time in 2 months
startedAndreRenaud/PDFGen
started time in 2 months
issue commenttsoding/something
are you running on a high-dpi display? or running with some kind of display scaling?
comment created time in 3 months
push eventzhiayang/ikurabot
commit sha 79e9c67f7073926c2fadcd743218455900189970
more discord stuff
push time in 3 months
pull request commentYbalrid/kissnet
looks good to me! thanks for the quick fix (:
comment created time in 3 months
push eventzhiayang/ikurabot
commit sha fbcc0de4598a7f6cee693b4038d82191d5e838f8
discord stuff
push time in 3 months
push eventzhiayang/nx
commit sha ad4dcc774ddca23ce7a51295e5a3f69ae432ffa2
kernel: fix spinlock/mutex move constructors. also, lock stuff. pendingSignalQueue is now Synchronised<>.
push time in 3 months
push eventzhiayang/nx
commit sha e4685abe84815204148c7266f5dfad5441f705a8
kernel: simplify and unify blocking (mutexes and convars) now both mutex and condvar utilise a "condition" type; a mutex inherits from it, and a condvar contains an internal member of it. the scheduler now has a unified interface: all of block(), notifyOne, and notifyAll() [previously wakeUpBlockers] operate on these 'conditions'. also, condvar is now correctly implemented. owo.
push time in 3 months
startedAndrewAPrice/Perception
started time in 3 months
push eventzhiayang/ikurabot
commit sha 2bc8255d9036ff19b1e960f334a1429cf3afb7f2
uwu
push time in 3 months
push eventzhiayang/ikurabot
commit sha 782a3c81a4b3388d3d310c73c9021759d348816c
owo
push time in 3 months
push eventzhiayang/ikurabot
commit sha d4a3f29d175c870ff36eeca74578e348e7a96e08
varargs, recursion limit
push time in 3 months
issue openedYbalrid/kissnet
Uninitialised fields when OpenSSL is enabled
The socket destructor unconditionally calls this->close(), and that checks:
if(pSSL && pContext) { SSL_xxx(...) } Unfortunately these fields are pointers that aren't initialised to a value unless you connect() the socket first. So, destructing an unconnected socket with SSL enabled will most likely result in trying to pass garbage pointers to openSSL and causing a crash.
A simple fix is just to set them to nullptr either at the declaration site or in the constructor. They also need to be set to zero when moved from, similar to this getaddrinfo_results fix.
created time in 3 months
pull request commentYbalrid/kissnet
Yep, I've applied the fixes locally in the meantime and they seem to work fine!
However, there's another issue regarding the SSL state; not sure if I should open another issue but i'll just talk about it here:
The socket destructor unconditionally calls this->close(), and that checks:
if(pSSL && pContext) {
SSL_xxx(...)
}
Unfortunately these fields are pointers that aren't initialised to a value unless you connect() the socket first. So, destructing an unconnected socket with SSL enabled will most likely result in trying to pass garbage pointers to openSSL and causing a crash.
comment created time in 3 months
startedvineyard-os/vineyard
started time in 3 months
push eventzhiayang/ikurabot
commit sha 82e838fb48e5b8b4df6c9cd3fa7219cc4e9e3607
console
push time in 3 months
push eventzhiayang/ikurabot
commit sha 6f0378d77df5eb1fe74e00929dff13c6f461d0a0
markov
commit sha 5aae12c35aa13c9ea2e18a060f16a8fac806a8ef
proper unicode handling
commit sha bb665105eaf0d2c1df245b623b669ad1d9bc43d4
stuff
commit sha 8a1da11daf2c7c4b383ac1a7637c0aa7c8afa811
stuff
commit sha 64a1b00b04ebb7778b2ff158b09c151ff5a243c5
complex
push time in 3 months
push eventzhiayang/ikurabot
commit sha 0f822cf5eff1e8232fed5aea39442a5f1829f81f
casting
commit sha bceca1bb1e2bd0642f316805c20027939cf2d1c8
pass errors out of interp via Result<T, E>
push time in 3 months
push eventzhiayang/ikurabot
commit sha f51d810aced6c28fe9e6b01cd9f0d5e08ed6f63f
bot is turing complete now
push time in 3 months
push eventzhiayang/ikurabot
commit sha 64f78a6070054915710055e602a9c58910321e2d
better type system
push time in 3 months
push eventzhiayang/ikurabot
commit sha 65e69fc0e95a9f49b6bf7986f85a9745f84cb90b
fix bugs, more command stuff
push time in 3 months
push eventzhiayang/ikurabot
commit sha 6cc0f84f9910375a734d7408235aa9031d38acfe
reorganised stuff, fix locking bugs
push time in 3 months
push eventzhiayang/ikurabot
commit sha c1b15294d696194e670061ee818ca89539a23332
parse irc properly
push time in 3 months
push eventzhiayang/ikurabot
commit sha 2060771a9b7d25ae96ea776e33d283426e691d79
comparison ops, including flax-style chained comparisons (1 < 2 < 3)
push time in 3 months
push eventzhiayang/ikurabot
commit sha db2d6249846da3fd90babfff24e023b50925ac83
simple macro expansion
commit sha ce0278392168edb56b601efb238246d001ba85b7
variables
commit sha 4345630ed40be9c2aca84bfd622ff6480a527f5c
stuff
commit sha 82d67f219ce512a0cf7a67b2676a5ddd00f09f99
stuff
commit sha 3ab93c9d4886d50227ee88d2b68e0d9c53577768
header rearragement
commit sha baf49250aa2167f7a6b31906bc0b7a3097ebaf30
rename
commit sha 149dc0ef3b444d8256ee1029d407ec2386b30bde
macros now do expressions properly
commit sha b4913096787a2c69d8434f0466fba4ac773ce4fe
more stuff
push time in 3 months
startedStrawberryHacker/strawberry
started time in 3 months
push eventzhiayang/ikurabot
commit sha 6f28545234e89e5022d50b207ac28d9f7e04fc10
overkill expressions
push time in 3 months
push eventzhiayang/ikurabot
commit sha 9858aeacc0c76764cada878b13a8a20a5e289f75
add span
push time in 3 months
push eventzhiayang/ikurabot
commit sha d534a638ff4e9c137b2aea55b1c5393ec5209ef5
reorg
commit sha 877944a5bcf5c8b01441bc85f6d81e9bf978a26d
basic commands
push time in 3 months
startedjustinian/jsix
started time in 3 months
push eventzhiayang/ikurabot
commit sha 4001c729b460c2c407521e3bf5819adeda7655cf
twitch works
push time in 3 months
push eventzhiayang/ikurabot
commit sha e03ef7b2cd1cadf6a52d9bb0e56466f3cbf24297
owo
commit sha b37bd37c536a354b58f7b6eba1585dabb068dd61
add config
commit sha ad98d7645f0c45561d1942e1ae06d633989128bb
rudimentary db
push time in 3 months
push eventzhiayang/ikurabot
commit sha c72954f2098a4790c88d51269d3e5f755d1f0bd4
add timeout for waits
push time in 3 months
push eventzhiayang/ikurabot
commit sha cf1747cf8111ec9cb6a8dcf7fb850e409e326662
add license
push time in 3 months
issue openedYbalrid/kissnet
When either the move constructor or move-assign operator is called, we do:
this->getaddrinfo_results = std::move(other.getaddrinfo_results);
unfortunately, std::move does not set the moved-from pointer (ie. other.getaddrinfo_results) to null; when the rvalue is destructed after being moved from, it will call freeaddrinfo() on the result which has been moved.
When the "real" socket is then destructed, it will call freeaddrinfo() again on the same result pointer, leading to a double-free.
created time in 3 months
issue closedzhiayang/nx
$ uname -a
Linux sagittarius 5.6.10-arch1-1 #1 SMP PREEMPT Sat, 02 May 2020 19:11:54 +0000 x86_64 GNU/Linux
Commit: 8d97c23dad63931ba0be62ec270b572d9abc5f49
./bootstrap (after successul build of gcc and binutils)
Log:
=> building libm
=> building libc
In file included from source/platform/thread_local.cpp:5:
source/platform/../../include/nx/thread_local.h:7:10: fatal error: nx/thread.h: No such file or directory
7 | #include <nx/thread.h>
| ^~~~~~~~~~~~~
compilation terminated.
make: *** [makefile:38: source/platform/thread_local.cpp.o] Error 1
!> libc compilation failed!
Tell me if you need more information.
closed time in 3 months
herrhotzenplotzpush eventzhiayang/nx
commit sha 843875594ae9bb00077477fcd27002ea0c445fc1
fix build
commit sha 66ff38f85a520beaebea53fe25f51231a3cd4421
Merge branch 'build-fixes'
push time in 3 months
push eventzhiayang/nx
commit sha e787c331b01b0e9f91a285c009faed05be1af5f9
kernel: condvars must be heap-allocated to be accessible everywhere
push time in 3 months
push eventzhiayang/nx
commit sha 768b459ad1f9865dbcdd9eb155323301b4b4aef4
misc: fix vscode workspace
commit sha 488b161c339ba4d77cddde69f1e82bd6ddcb2d23
kernel: make atomic stores return the old value
commit sha ad12b3a693df0bde29178375ca98fbee8fb564c3
kernel: .byte 0 -> nop
commit sha 7c65006733a31f19eb3f0425f75fd366fd14d8a7
kernel: remove FUCKIN_WSL_FIX_YOUR_SHIT workaround
commit sha 08acc98864c1f2da0d49d5e23147b141b256b4c1
kernel: add condition variables
commit sha 0d7a2a8c8fd5802a78b24ad36bfc73a225c36d77
kernel: add getProcessByName
commit sha f4f17fc21988b6afa7b1804a7e5a464b9b172de1
kernel: add signal-IPC to userspace, and blocking signals.
push time in 3 months
issue closedzhiayang/nx
$ uname -a
Linux sagittarius 5.6.10-arch1-1 #1 SMP PREEMPT Sat, 02 May 2020 19:11:54 +0000 x86_64 GNU/Linux
Commit: 8d97c23dad63931ba0be62ec270b572d9abc5f49
./bootstrap (after successul build of gcc and binutils)
Log:
=> building libm
=> building libc
In file included from source/platform/thread_local.cpp:5:
source/platform/../../include/nx/thread_local.h:7:10: fatal error: nx/thread.h: No such file or directory
7 | #include <nx/thread.h>
| ^~~~~~~~~~~~~
compilation terminated.
make: *** [makefile:38: source/platform/thread_local.cpp.o] Error 1
!> libc compilation failed!
Tell me if you need more information.
closed time in 3 months
herrhotzenplotzpush eventzhiayang/nx
commit sha 31c20897f3f37e67df5f722de11f9966c9925a11
kernel: move memticket code out of the syscall namespace
commit sha 8d97c23dad63931ba0be62ec270b572d9abc5f49
kernel: move some ipc stuff around
push time in 3 months
startedsigma-os/Sigma
started time in 3 months
push eventzhiayang/nx
commit sha d8dbe73646c25e2af2b13679290ee614e07db533
krt: stuff
commit sha d0afd6771c7955a936b650a442ea8382ce13c832
instrad: copy changes from upstream
commit sha 5d063cb34715d45011485c6ff8b14cec3822af9c
kernel: fix demangler
commit sha 7bdbdce2736a7b220cf37dc3ac728345268ab534
krt: fix bug in krt::string trying to deallocate the inline buffer
commit sha e86e33ebd79e04203dc426daeee816bd63a54ca8
driver/ps2: fix the bug where the controller wouldn't work
commit sha 5d3ef9d830d10ffa50ba9e58a6be35191024e25e
libinstrad: update upstream
commit sha faa5a22642ab22c6ce123912c4be6511cd2002dc
kernel: safely crash the thread when an exception happens previously we were calling scheduler::exit from the exception context, which called yield(), which does int $0xF8. this is 0% safe, since the interrupt flag will never be restored. now, we have a new crashFromException() function that will directly call the scheduler to switch away from the thread.
commit sha 5b3cf176f52ce6d24f017ff0381677ee491cfb1e
kernel: fix demangler
commit sha a8d8d8ded45e27163016e4c12a2e1688c9f25993
kernel: change disasm to at&t syntax
commit sha 947e174316fc167bd2fa9b59b82e5a57b2fddf1f
kernel: fill uninitialised and freed heap memory with patterns
push time in 3 months