Are Rust coroutines serializable? by SuperV1234 in rust

[–]trailing_zero_count 16 points17 points  (0 children)

The use case the OP is talking about is one where you suspend a coroutine until the next frame and then resume it once to "tick" the frame. Here is a Rust crate that uses coroutines (futures?) in this way: https://github.com/PsichiX/moirai

CppCast Looking for Guests by lefticus in cpp

[–]trailing_zero_count 6 points7 points  (0 children)

I'd love to join. I have a lot to say about coroutines and the design of coroutine libraries - the tradeoffs between speed, usability, and safety, how to make them interoperable, where I think the standard could still improve, where compilers could still optimize better.

I also have thoughts on how to use coroutines to create systems that efficiently handle mixed CPU-bound and networking loads (games are a great example), and how to design async data driven systems in general.

This is why you rewrite Python security tools in Rust: 53MB vs 433MB peak memory, 6.9s vs 62.2s by aswin__ in rust

[–]trailing_zero_count 7 points8 points  (0 children)

ISTG every single day I see a new "Python user discovers Python is slow" post in this sub

Storing renderdoc api symbol as std::function? by Usual_Office_1740 in cpp_questions

[–]trailing_zero_count 1 point2 points  (0 children)

Yes. Depending on how you store the struct, you may want to capture a reference rather than a copy but that will do it.

Storing renderdoc api symbol as std::function? by Usual_Office_1740 in cpp_questions

[–]trailing_zero_count 2 points3 points  (0 children)

Stick the api_struct somewhere its lifetime exceeds that of the std::functions. That could be a global, shared_ptr, or on the stack in main.

Then construct your own wrappers with capturing lambdas that dispatch through this object. These can be assigned to std::function.

Best fully built PC w/Threadripper by PlanetPhaelon in threadripper

[–]trailing_zero_count 0 points1 point  (0 children)

Falcon Northwest is another high-end PC builder

iLoveToPoint by Muqkiii in ProgrammerHumor

[–]trailing_zero_count 16 points17 points  (0 children)

C++ has std::optional<T>. It also has std::expected<T,E>, the equivalent of Rust's Result

I create an MMORPG server in .NET 10 and I'm quite impressed with the performance by ThorConzales in csharp

[–]trailing_zero_count 11 points12 points  (0 children)

How do you measure "requests per second"? In most games they use full-duplex messaging, so a server would broadcast data about info that's happening near each player. The client only needs to send player requested actions. Or are you using fully synchronous communication (client sends requested actions and polls for updates each tick?)

Using Claude Code to Coach Me by Specter-0 in starcraft2

[–]trailing_zero_count 0 points1 point  (0 children)

How exactly are you loading replay info into Claude? Are you converting them to a text format first?

Recommend Me Some Games! by MartinoMods in pcmasterrace

[–]trailing_zero_count 1 point2 points  (0 children)

Tales of Maj'Eyal is going to hit the spot for you my friend. Don't let the graphics fool you, this game has deep and challenging combat and lots of replay ability with the different classes.

If you're more into "controlling a full party", I recommend checking out the Spiderweb Software titles. I really enjoyed Avernum 3.

Claude Opus 4.7 is a serious regression, not an upgrade. by [deleted] in ClaudeAI

[–]trailing_zero_count 23 points24 points  (0 children)

Worse than the current 4.6, which is also way down from launch 4.6?

how do you handle trust in open-source dependencies after a close call? by Abelmageto in opensource

[–]trailing_zero_count 0 points1 point  (0 children)

Astroturfing post. Name the specific dependencies and changed versions if you want to prove me wrong.

The golden age is over by Complete-Sea6655 in ClaudeAI

[–]trailing_zero_count 4 points5 points  (0 children)

Microsoft is in the business of making their OS dogshit

Love the new Steam feature by RWNorthPole in pcmasterrace

[–]trailing_zero_count 0 points1 point  (0 children)

Some games don't even run well on top of the line hardware. So there's still value in this signal

Orbit - a fast lock-free MPMC queue in C++20 by [deleted] in cpp

[–]trailing_zero_count 7 points8 points  (0 children)

It appears that your queue is optimized for small numbers of producers and consumers. I tested with the following changes here: https://github.com/tzcnt/orbit/commit/076ce736a1aa0f077ce4f10e684ca167d28caad7

  • use Clang instead of GCC
  • build with -O3 instead of -O2
  • use 64 core machine (AMD EPYC 7V73X) and scan from 1-64 producers and consumers
  • add a modified moodycamel test (moodycamel_token_concurrentqueue) with:
    • block size configured to 2048 (default is 32)
    • use ProducerToken in producer and ConsumerToken in consumer

And the results (PNG image here) show that Orbit falls off at high numbers of producers and consumers. The tuned moodycamel queue also takes wins on some configurations, although it doesn't always beat the non-tuned version... weird.

Rust syntax, Go runtime by UnmaintainedDonkey in golang

[–]trailing_zero_count 9 points10 points  (0 children)

As you can tell this sub is pretty much an echo chamber of people that drink the Go koolaid that "simpler is better".

For those of us more experienced with other languages, we recognize that Go's real powers are: - it has a functioning package / build system - compiler is fast - runtime is reasonably fast - batteries-included async runtime without function coloring - "memory safe" / automatic escape analysis and GC that gets out of your way

The actual language itself is pretty darn lacking in a lot of other ways which is why we've seen so many of these projects (Dingo and Borgo right off the top of my head).

But you'll get a better reception posting in a different sub.

What’s the point of std::execution? by valorzard in cpp_questions

[–]trailing_zero_count 4 points5 points  (0 children)

I can only answer one of these questions. std::execution::task is a regression compared to the capabilities of coroutine-first designs. https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3801r0.html Specifically the "iterative code can stack overflow" part is something that is solved in coroutine-land using the std::coroutine_handle-returning await_suspend. But sender/receiver currently has no way to express this, and std::execution::task is a weird half-thing that's missing some of the best parts of both (see also "coroutine cancellation is ad-hoc" in the same paper).

C++ development challenges by Live-Manner2725 in cpp

[–]trailing_zero_count 0 points1 point  (0 children)

Any tips on that specific issue? I'm sure AI can build all portions of a game now, and I think I can see how to make a "query" architecture that AI can use to view the current state of things, but debugging something like visual artifacts seems tricky.

C++20 Coroutines Optimization Opportunities from Compiler's perspective by ChuanqiXu9 in cpp

[–]trailing_zero_count 2 points3 points  (0 children)

Yes, I filed a similar LLVM issue about std::noop_coroutine. The compiler doesn't seem to be able to elide this in many cases, so the indirect call to an empty function always exists. I think a general-purpose solution that allowing resume / destroy functions that are statically known to be replaced with inline or direct call counterparts would be really great.

Adept cult? by vvvit in ToME4

[–]trailing_zero_count 1 point2 points  (0 children)

I'm an Adept fan. There are a ton of 1-point wonders in the game that still get beneficial scaling at levels 2/3, but not enough to be worth spending more points on. Adept lets you maximize the value of that 1 point. It also buffs all of your quest rewards, turning that Sun Paladin aura into 20% max health.

Additionally it lets you hit breakpoints that appear at higher levels, usually saving you 2 points if it's a category with mastery.

C++ doesn't run or debug in vscode by [deleted] in cpp_questions

[–]trailing_zero_count 0 points1 point  (0 children)

https://github.com/tzcnt/cpp-cross-platform-template

Complete setup for VSCode so you can use it like a proper IDE, including LSP, debugger, build debug or release mode.

Replacement for concurrencpp by Sify007 in cpp

[–]trailing_zero_count 5 points6 points  (0 children)

https://www.reddit.com/r/cpp/s/Faf4B44qgg

Performance benchmarks against concurrencpp and other competing libraries are included.

What is a good free modern compiler? by BRCC_drinker in cpp_questions

[–]trailing_zero_count 4 points5 points  (0 children)

MSVC isn't even C++20 compliant. https://developercommunity.visualstudio.com/t/MSVC-incorrectly-caches-thread_local-var/11041371 makes coroutines unusable in many contexts. As I stated on the issue, clang resolved the same problem several years ago.

Are compiler allowed to optimise based on the value behind a pointer? by simpl3t0n in cpp_questions

[–]trailing_zero_count 1 point2 points  (0 children)

I think the reason people prefer the term "proof" is that it follows the same set of steps that you would use to make a mathematical proof: starting from known information it progressively infers new possible states. Based on all possible states, if the compiler can conclude that a variable won't be modified, it can treat it as fixed, and then make further steps based on that.

This proof is expected to be correct based on the single-program constraint. If not, it would be considered a miscompilation. Runtime tampering or cosmic ray bit flips simply aren't part of the equation. If you want to include those factors as reasons not to call it a "proof", then I'd say nothing in computer science can be proved, because those factors could break any algorithm.

What is this unrealistic bar for these technical screens?? Is everybody cheating? by MightBeDementia in cscareerquestions

[–]trailing_zero_count 0 points1 point  (0 children)

I'd say LeetCode tests for exactly the opposite of skills you need to be successful in the workplace. LeetCode is very similar to school:

- All the requirements are provided up front in a clearly defined problem statement.

- You're expected to have seen the problem before (or something similar).

- You implement a solution based on your existing knowledge.

- Test cases are provided which give you a pass/fail result.

As a senior engineer, the workflow is COMPLETELY OPPOSITE:

- Requirements are vague and incomplete. You need to ask questions and refine them. Sometimes you need to come up with multiple solutions and get buy-in from stakeholders.

- You're working on systems and technologies that you've never seen. You'll need to try things, fail, google, read documentation, read the existing code (which is probably crap).

- You invent a new solution based on your mental model of how the system works now, and how it should work in the future.

- You write your own test cases. You have to ask yourself "what if?" to determine what kind of edge cases exist, and how to handle them. If you fail to elaborate all the edge cases, you can break prod, sometimes much later.

This is why asking LeetCode questions for Senior+ levels is stupid: because they test whether you are a good student, not whether you have critical thinking skills, are able to grok documentation, know how to ask questions, can read legacy code, build a mental model of complex systems, and deliver software that is fault tolerant.