ChanServ changed the topic of #rust-embedded to: Welcome to the Rust Embedded IRC channel! Bridged to #rust-embedded:matrix.org and logged at https://libera.irclog.whitequark.org/rust-embedded, code of conduct at https://www.rust-lang.org/conduct.html
<re_irc> < (@jamesmunns:beeper.com)> https://rust.godbolt.org/z/9GdYcrG1j
<re_irc> < (@jamesmunns:beeper.com)> it doesn't _look_ like CM0+ targets suffer from the _exact_ same repro case
<re_irc> < (@jamesmunns:beeper.com)> looking at the asm, they are using something that looks like it is properly adding the result
<re_irc> < (@jamesmunns:beeper.com)> interestingly - the cm4/7 output ONLY repros with LTO
<re_irc> < (@jamesmunns:beeper.com)> lol jk, I moved some stuff around and it repros w/o lto
<re_irc> < (@jamesmunns:beeper.com)> it does the same "lsl the bool" trick, but uses an "adds" instead of "orr.w" to do it
<re_irc> < (@jamesmunns:beeper.com)> doesn't mean there couldn't be another, unrelated repro case tho
<re_irc> < (@jamesmunns:beeper.com)> (I guess cm0+ don't have "orr.w"?)
<re_irc> < (@dirbaio:matrix.org)> isn't "orr.w" v7+ only?
<re_irc> < (@jamesmunns:beeper.com)> yeah I dunno
<re_irc> < (@adamgreig:matrix.org)> yea, "orr.w" is a T2 encoding only
<re_irc> < (@jamesmunns:beeper.com)> makes sense
<re_irc> < (@adamgreig:matrix.org)> though it's only needed here for the optional shift parameter, "ORRS" in T1 is "ORRS Rdn Rm" while T2 has "ORR.W Rd Rn Rm <shift>"
<re_irc> < (@jamesmunns:beeper.com)> yeah, that seems integral to the "problematic opt"
<re_irc> < (@adamgreig:matrix.org)> yea
<re_irc> < (@adamgreig:matrix.org)> ".W" is for wiiiiide instructions
<re_irc> < (@jamesmunns:beeper.com)> or at least - one "known problematic opt". can't rule out others existing.
<re_irc> < (@jamesmunns:beeper.com)> yeah, I guess the ".n" for narrow instructions is implicit?
<re_irc> < (@adamgreig:matrix.org)> I think you can put it to enforce narrow or error if not possible
<re_irc> < (@adamgreig:matrix.org)> ah, if 16 and 32 bit are both available it must pick the 16, so...
fabic_ has joined #rust-embedded
<re_irc> < (@peter9477:matrix.org)> : We didn't try without LTO, but recall (if you ever heard) that our stuff worked fine on nightly until 2023-02-05, so I think this is definitely a case where moving things around, or minor unrelated changes in the compiler, are likely to make the latent issue come and go. After all, the code probably would have worked fine even with the misaligned stack if the compiler/linker just happened to make...
<re_irc> ... that 2-element u32 array be positioned 4 bytes off from where it was.
<re_irc> < (@adamgreig:matrix.org)> yea, all my repros were with LTO enabled
<re_irc> < (@adamgreig:matrix.org)> I wonder if the compiler deliberately makes it 8-byte aligned to allow this trick, though...
<re_irc> < (@9names:matrix.org)> I had some repros with LTO, some without, depending on compiler version etc. Getting optimisations to consistently apply to code is hard.
brazuca has quit [Quit: Client closed]
starblue has quit [Ping timeout: 255 seconds]
starblue has joined #rust-embedded
cr1901_ has joined #rust-embedded
cr1901 has quit [Ping timeout: 248 seconds]
lehmrob has joined #rust-embedded
lehmrob has quit [Ping timeout: 248 seconds]
emerent has quit [Remote host closed the connection]
emerent has joined #rust-embedded
dc740 has joined #rust-embedded
<re_irc> < (@korken89:matrix.org)> Has anyone seen something similar to a pub/sub communication bus that's designed for use within an async (PC) application? I'm looking for stuff in that domain, and I expect that there should be no need for serde so more like something that just sends "Arc<T>" to all "subscribers"
<re_irc> < (@korken89:matrix.org)> I think one can orchestrate this with "tokio::sync::mpsc" and a macro the generates the bus, but it feels like I'm not the first one to want this
<re_irc> < (@korken89:matrix.org)> * One
fabic_ has quit [Ping timeout: 255 seconds]
fabic_ has joined #rust-embedded
<re_irc> < (@barafael:matrix.org)> So, like a `tokio::sync::mpsc`?
<re_irc> < (@barafael:matrix.org)> * `tokio::sync::broadcast`?
<re_irc> < (@lulf_:matrix.org)> : Something more generic also is https://github.com/streambed/streambed-rs
<re_irc> < (@lulf_:matrix.org)> by
<re_irc> < (@korken89:matrix.org)> : Like that but with known topics
<re_irc> < (@korken89:matrix.org)> : Thanks, I'll give it a look!
<re_irc> < (@korken89:matrix.org)> I think a thin wrapper on "broadcast" will get me like 95% there
<re_irc> < (@barafael:matrix.org)> Are the topics only known at runtime? That's interesting, I usually get away with enums...
<re_irc> < (@barafael:matrix.org)> -That's interesting, I usually get away with enums...
<re_irc> < (@korken89:matrix.org)> Compile time
<re_irc> < (@korken89:matrix.org)> "topic" means any identifier here
<re_irc> < (@korken89:matrix.org)> It could be an enum
dc740 has quit [Remote host closed the connection]
<re_irc> < (@barafael:matrix.org)> It's somewhat clumsy to send data to everybody and let them decide if they case about it, but actually maybe not that bad
<re_irc> < (@barafael:matrix.org)> * care
<re_irc> < (@korken89:matrix.org)> That's the thing, I only want to send to "subscribed" tasks
<re_irc> < (@korken89:matrix.org)> So I think broadcast should do it well
<re_irc> < (@korken89:matrix.org)> As only the ones wanting it will ".subscribe()"
<re_irc> < (@barafael:matrix.org)> Ah, so one broadcast channel per topic?
<re_irc> < (@korken89:matrix.org)> Yeah I was thinking like that
<re_irc> < (@korken89:matrix.org)> Hmm, I'll give it a try
<re_irc> < (@korken89:matrix.org)> It will be loads better than serializing everything to JSON, shipping in on MQTT, have the same att read the MQTT, deserialize and act :P
<re_irc> < (@korken89:matrix.org)> * app
<re_irc> < (@korken89:matrix.org)> I think the overhead of an "Arc<T>" might be lower ;)
<re_irc> < (@lulf_:matrix.org)> If you don't need persistence, no need to use an mqtt broker for sure.
fabic_ has quit [Ping timeout: 255 seconds]
lehmrob has joined #rust-embedded
<re_irc> < (@barafael:matrix.org)> Just do mqtt with raw pointers then :)
<re_irc> < (@jamesmunns:beeper.com)> I was gonna say "arc mutex hashmap <String, BroadcastChannel>" for "subscribing" :p
<re_irc> < (@jamesmunns:beeper.com)> So a mutex when you're adding/looking up a "topic"
<re_irc> < (@jamesmunns:beeper.com)> Ah, unless messages have different types
<re_irc> < (@huntc:matrix.org)> : It’s a commit log. We also use channel and broadcast. The IoT example may help.
<re_irc> Thanks for mentioning !
<re_irc> < (@jamesmunns:beeper.com)> They might be trickier :p
<re_irc> < (@korken89:matrix.org)> : Hmm, I'm not sure if I'm looking in the right place
<re_irc> < (@korken89:matrix.org)> You mean this one right? https://github.com/streambed/streambed-rs/blob/main/examples/iot-service/src/main.rs
IlPalazzo-ojiisa has joined #rust-embedded
<re_irc> < (@korken89:matrix.org)> Just to get my head itch out, this is more or less what I want: https://github.com/korken89/async-bus/blob/master/src/main.rs
<re_irc> < (@korken89:matrix.org)> I have just not made the macro
<re_irc> < (@korken89:matrix.org)> Though it is a trivial macro that even can me a macro_rules! one
<re_irc> < (@korken89:matrix.org)> Skip the enum
<re_irc> < (@korken89:matrix.org)> Though it is a trivial macro that even can be a macro_rules! one
<re_irc> < (@jamesmunns:beeper.com)> by the way, I have a _really_ cursed way of type erasing a bunch of channels into a single data structure like a hash map, where you have to ask for the "right" type you expect on the channel
<re_irc> < (@jamesmunns:beeper.com)> I can find that for you if you want to go down that route.
<re_irc> < (@korken89:matrix.org)> Sure, love to have a look
<re_irc> < (@jamesmunns:beeper.com)> lemme see if I can find it. I have poc somewhere, then I integrated it into mnemos' driver discovery service
<re_irc> < (@jamesmunns:beeper.com)> https://github.com/jamesmunns/typeid-poc
<re_irc> - heap allocations are always pointer sized
<re_irc> < (@jamesmunns:beeper.com)> basically uses the fact that:
<re_irc> - you can use the type id
<re_irc> < (@jamesmunns:beeper.com)> so you do something like:
<re_irc> map.get_channel::<ExpectedValue>("key")
<re_irc> < (@jamesmunns:beeper.com)> which only gives you back the channel for "key" if "ExpectedValue" was the type that was used when registering the channel
<re_irc> < (@jamesmunns:beeper.com)> there's a bit more in that poc, because I send serialized data (for format/abi stability reasons), but you don't have to do that, you could just use the type erasure bits.
<re_irc> < (@jamesmunns:beeper.com)> (this is very C "void*" brained, tho with at least a _little_ type safety via using "TypeId" to validate the expected type of the received object)
<re_irc> < (@jamesmunns:beeper.com)> (tho I'm a _little_ proud of the _map_deser_ function, which monomorphizes to a bare function you can use as a deserializer for any type - you probably don't need that like I do for mnemos)
<re_irc> < (@jamesmunns:beeper.com)> ^
starblue has quit [Ping timeout: 268 seconds]
starblue has joined #rust-embedded
rardiol has quit [Ping timeout: 248 seconds]
fabic_ has joined #rust-embedded
rardiol has joined #rust-embedded
<re_irc> < (@korken89:matrix.org)> : πŸš€
dc740 has joined #rust-embedded
fabic_ has quit [Ping timeout: 255 seconds]
Foxyloxy has quit [Quit: Textual IRC Client: www.textualapp.com]
Foxyloxy has joined #rust-embedded
fabic_ has joined #rust-embedded
brazuca has joined #rust-embedded
sauce has quit [Quit: sauce]
sauce has joined #rust-embedded
lehmrob has quit [Quit: Konversation terminated!]
dc740 has quit [Remote host closed the connection]
dc740 has joined #rust-embedded
dc740 has quit [Remote host closed the connection]
dc740 has joined #rust-embedded
cr1901_ is now known as cr1901
<cr1901> jamesmunns: I need this commit https://github.com/jamesmunns/postcard/commit/003f3f03177b36449164f7252f0f9ce16065e846 any chance you'd be willing to do a point release?
<re_irc> < (@jamesmunns:beeper.com)> Sure, can do later tonight
<cr1901> Thanks, I'll update cargo .config.toml for the time being. The commits I have now just won't compile on any other machines for now- what a shame/loss :P
<cr1901> (joke)
fabic_ has quit [Ping timeout: 246 seconds]
<cr1901> Ugh, semver depends on alloc even in no_std envs
emerent has quit [Ping timeout: 246 seconds]
emerent has joined #rust-embedded
<re_irc> <knickish> Just got basic compile-time linear algebra working, and thought people here might be interested. I can't find anything similar that exists already, but not 100% sure. https://github.com/knickish/constgebra
<re_irc> <knickish> * working (no stdlib used),
<re_irc> < (@jamesmunns:beeper.com)> I made something for you: https://gist.github.com/jamesmunns/8468c298114c860b1d413962517c5235
loki_val has quit [Quit: No Ping reply in 180 seconds.]
crabbedhaloablut has joined #rust-embedded
<cr1901> Yea I am not paid enough for this lmao... embedded_semver exists, but depends on bitvec, which depends on radium 0.7, which is broke on msp430/16-bit targets lmao
<cr1901> Or _is_ it broke? Hmmm...
brazuca has quit [Quit: Client closed]
rardiol has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
prioritize has joined #rust-embedded
rardiol has joined #rust-embedded
rardiol has quit [Ping timeout: 252 seconds]
<re_irc> < (@jamesmunns:beeper.com)> πŸ“£ postcard v1.0.3 is now released! Check out the changelog (https://github.com/jamesmunns/postcard/blob/main/CHANGELOG.md#102---103) for what's new, lots of good little improvements.
<re_irc> < (@jamesmunns:beeper.com)> Reminder, if you've ever wanted postcard to have a schema, or a story around forwards/backwards compat, or other related topics, I'd love to hear from you in https://github.com/jamesmunns/postcard/issues/92 !
dc740 has quit [Remote host closed the connection]
dc740 has joined #rust-embedded
dc740 has quit [Remote host closed the connection]
dc740 has joined #rust-embedded
dc740 has quit [Remote host closed the connection]
rardiol has joined #rust-embedded
<re_irc> < (@jamesmunns:beeper.com)> (and now 1.0.4 because there was a bugfix PR I forgot to merge first πŸ˜…)
fabic_ has joined #rust-embedded
<cr1901> jamesmunns: Appreciated. Now only two more outstanding issues now I realized semver _also_ depends on alloc
<cr1901> https://github.com/cr1901/postcard-infomem/commit/a36272057d2486ea278d81afb9166c66d048b04f This was not fun to implement. Obligatory "Deserialize is a PITA to implement on your own"
rardiol has quit [Ping timeout: 252 seconds]
<re_irc> < (@jamesmunns:beeper.com)> my $0.02: that embedded semver crate looks way overblown
<re_irc> < (@jamesmunns:beeper.com)> like, you already get byte compression in postcard via varints, so "0.0.10" is only going to be 3 bytes anyway
<cr1901> mmm, yea. This doesn't spark joy. I'll use my own borrowed wrapper around semver
<cr1901> I just thought the bitpacking was cool and saved a few bytes
<cr1901> I may also use build.rs to hardcode the version info to avoid https://github.com/rodrimati1992/const_panic/issues/7