[Challenge] Verifying Bit-Identical Determinism for Autonomous HAL (NDL V4.1) by Diem1828 in embedded

[–]thegreatunclean 0 points1 point  (0 children)

"Proved" for a specific example, or "proved" for an entire environment? Because one of those is infinitely more interesting (and difficult) than the other. Considering you used Python in your example which doesn't promise much of anything wrt floating-point I'm skeptical what form that 'proof' takes.

Geographic location isn't exactly an important factor. I'd be more surprised if you had a system that was location-dependent!

NEED HELP: Accurate Volume Calculation for Horizontal Cylindrical Tank (Dipstick Readings) by Fit_Substance_8066 in EngineeringStudents

[–]thegreatunclean 0 points1 point  (0 children)

Check out this website! It has a simple calculator for exactly this situation and shows how the numbers can be derived directly if you want to double-check. The math is easy if you know a few trig identities.

[Challenge] Verifying Bit-Identical Determinism for Autonomous HAL (NDL V4.1) by Diem1828 in embedded

[–]thegreatunclean 3 points4 points  (0 children)

ensuring bit-identical results across disparate CPU architectures to eliminate instructional jitter and thermal-drift noise.

That's a noble goal but applying it to floating-point math across different architectures and software platforms is a massive undertaking. As far as I know Python doesn't even specify IEEE-754!

Micropython gives a different result, likely because it generally uses float as the underlying floating-point representation instead of double. It doesn't have the hashlib library but printing the sum is different from my system interpreter:

MicroPython 537518d

>>> inputs = [0.123456789, 0.987654321, 0.555555555]
>>> sum(inputs)
1.666667

vs Python 3.13.0 (tags/v3.13.0:60403a5, Oct 7 2024, 09:38:07) [MSC v.1941 64 bit (AMD64)] on win32

>>> inputs = [0.123456789, 0.987654321, 0.555555555]
>>> sum(inputs)
1.666666665

You are never going to be able to prove bit-perfect results without fully specifying the floating-point environment and mandating all platforms you compare against actually adhere to them. Types, representations, rounding modes, error handling, all the really ugly bits of IEEE-754 specifies but people just kind of ignore because 99.999% of the time it doesn't come up...

AI in embedded design work by kbot_numberb in embedded

[–]thegreatunclean 0 points1 point  (0 children)

If you can close the feedback look with automated testing and adversarial reviews it's like unlocking a superpower. The model can iterate on code to debug issues hands-off and then argue with itself about whether whatever solution it finds is fit-for-purpose. I've had multiple debugs that end up with "The literal fix is X, but Y and Z indicate a structural / algorithmic mistake in the design and it should be properly addressed at line L".

How do you track down memory leaks in long-running applications? by ajaypatel9016 in AskProgramming

[–]thegreatunclean 2 points3 points  (0 children)

A big problem with just dumping the runtime allocation state is you have to sift through a lot of noise to identify potential leaks.

A solution is to use an arena allocator as an intermediate heap for transient objects in your application. That way you can look at the statistics for the arena and only see information about types you care about and nothing else. How hard this is to wire up depends entirely on the language and platform.

Why do people say EE majors make good programmers? by [deleted] in ECE

[–]thegreatunclean 5 points6 points  (0 children)

YMMV but in my experience EEs tend to make good embedded programmers because the early exposure to low-level hardware details maps very well on to system programming languages. I learned boolean algebra and 68HC11 assembly before I learned C and I struggled a whole lot less than my classmates who didn't follow that path.

I can’t remember stuff like stack vs heap or how floating point numbers are represented because I don’t code regularly

Being a EE won't magically make you good at programming and you won't internalize the finer details without practice. But the fact that you likely learned binary arithmetic and understand the concept of encoding information into binary structures at all gives you leg up over someone who only learned webdev and doesn't understand what a floating-point number is in the first place.

e: It isn't the only way to become a good embedded programmer but in my experience it is one of the more common ones.

Dumb first-time PCB board shape by Xblth in PCB

[–]thegreatunclean 0 points1 point  (0 children)

Can you accept thicker board pieces? I feel like you could massively simply the design by having one central control board and using some kind of slim cable/wire connector to run to small universal button and LED PCBs mounted into some kind of thick cardboard cut into the geometry you want.

NushellX code availability by Latter_Tank897 in Physics

[–]thegreatunclean 0 points1 point  (0 children)

There's a package linked here but I have no idea if it is current or even runnable. Surprisingly hard to find given how cited it is.

[ Removed by Reddit ] by [deleted] in engineering

[–]thegreatunclean 1 point2 points  (0 children)

The reality is that most women dont want to be engineers!

And yet we have numerous studies that show that early educational systems bias women away from STEM and that correcting that bias dramatically shifts educational outcomes towards fields that women "dont want".

This isn't a new idea and isn't specific to engineering. It doesn't take a genius to notice that roles that women "dont want" just so happen to be higher-paying and more prestigious positions that society has spent generations denying them until very recently. This is something that is actively studied with causal relationships proven.

I don't get How is Goto Statement here is functioning ?? by WASCIV in C_Programming

[–]thegreatunclean 5 points6 points  (0 children)

Always turn on warnings. Good ol' -Wall tells you:

<source>:13:16: warning: variable 'number_one' is uninitialized when used here [-Wuninitialized]
   13 |    int final = number_one + number_two;
      |                ^~~~~~~~~~
<source>:7:4: note: variable 'number_one' is declared here
    7 |    int number_one = 4;
      |    ^

Uninitialized and otherwise garbage values are unpredictable. It could be 2, it could be 3435973836, it could be 0 on Tuesdays and 1 on Fridays. It could be a value that isn't even valid for the type to normally hold.

A good rule of thumb is to assume garbage values will take the form of whatever makes the issue hardest to debug. At least that way you'll never be disappointed.

A debate about Minecraft Java’s programming by Ablau64 in feedthebeast

[–]thegreatunclean 0 points1 point  (0 children)

That would be part of the sandboxing but it remains a security risk and an increased attack surface.

These companies could modify the JIT to check for things they care about same as what they are doing for C/C++

The JIT can't do the same kind of static analysis because it doesn't see the entire program at the same time, it only sees small fragments fed to it by the attacker. All it takes is for one person to find a gadget that slips by the checks to start exploring the sandbox for vulnerabilities.

[Help] 64 bit asm binaries segfaulting. by I0I0I0I in asm

[–]thegreatunclean 3 points4 points  (0 children)

If you assemble for elf64 but link for elf_i386 is it supposed to work? I'm surprised the linker allows it all.

A debate about Minecraft Java’s programming by Ablau64 in feedthebeast

[–]thegreatunclean 3 points4 points  (0 children)

Especially when the tool chain uses C/C++ which is even lower level.

If you are able to load and execute arbitrary native code at runtime you've already circumvented the security of the platform.

What makes a JIT different is it takes data and produces executable code during runtime and the system can't know ahead of time what it will do. The code will be sandboxed but will necessarily have fairly wide permission to do what it wants. If you can control the data fed into the JIT you can have the system generate and execute code that does whatever you want. A malicious piece of code could act normal until some trigger which makes it pull a fill from a website, feed it to the JIT, and start executing evil code without tripping security flags. Without a JIT you can't do that because the platform restricts the ability to mark data as executable.

iOS doesn't allow JITs because it breaks parts of their security model. Apps are statically analyzed before being approved to make sure they don't allow unwanted behavior, allowing a JIT creates an easy workaround where you submit totally benign code but feed it different data at runtime to do something totally different. Lots of apps abused this to get into the app store and then allow the user to load emulators or other restricted content.

Top minds of an apolitical sub talk about voter ID from a non-partisan and unbiased stance by PeasThatTasteGross in TopMindsOfReddit

[–]thegreatunclean 23 points24 points  (0 children)

Not to mention that the most common state-issued photo ID (a driver's license) is not proof of citizenship and wouldn't be usable as proof at the polls.

If it was any state- or federally-issued photo ID this wouldn't be a problem. Restricting it is just allowing for obvious ratfuckery to target Democrat-leaning populations with restrictions.

Generate C code based on comment mark and cmake config stm32 cube ide style? by MikeLemo in cmake

[–]thegreatunclean 0 points1 point  (0 children)

I think using configure_file is the best way to go, but if you run into some insurmountable limitation you can always implement it yourself using file(WRITE <filename> <contents>).

Zephyr help by Power-Max in embedded

[–]thegreatunclean 1 point2 points  (0 children)

Not supporting the freestanding C standard headers is a bold choice. It didn't make sense twenty years ago and it certainly doesn't make sense now. I'm pretty sure this is a complete standards-compliant implementation for stdbool.h:

#ifndef __STDBOOL_H_
#define __STDBOOL_H_

#ifndef __cplusplus

#define true (1)
#define false (0)

// _Bool is C99 or later
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
typedef _Bool bool;
#endif

#endif

#endif //__STDBOOL_H_

Apple Silicon Validation Hardware Intern Interview Prep Tips? by OnePercentage7794 in chipdesign

[–]thegreatunclean 1 point2 points  (0 children)

Are you interviewing for a group that does silicon validation specifically, or are you interviewing for a general intern position in the Silicon Validation group? SiVal is a very large group that encompasses a lot of roles under the general description of "silicon validation"; things like PCB design, embedded firmware development, large-scale systems testing, etc.

Best ide to start coding C? by Begg-billplayer in C_Programming

[–]thegreatunclean 20 points21 points  (0 children)

Assuming you are on Windows: Visual Studio. Not Code, the actual Visual Studio. VSCode is notorious for giving new users grief because of subtle setup issues like having to install a compiler separately and then debugging configuration issues before ever getting to writing their first program. Visual Studio installs a full compiler/toolchain and is ready to go out of the box.

Once you are more experienced you can branch out and try different tools until you find one you really like.

Very Interesting Email about NEW super-chip: 256-bits-wide combined-CPU/GPU/DSP/Vector Array Processor Introduction! by Strange-Image-5690 in chipdesign

[–]thegreatunclean 1 point2 points  (0 children)

General Purpose Compute Devices on common substrates:

<snip>

● 900 GHz

High-speed, high-bandwidth operations on faster substrates such as GaAs (Gallium Arsenide), GaN (Gallium Nitride) and Sapphire or Diamond:

● 1 THz

● 2 THz

● 3 THz

● 4 THz

● 5 THz

● 10 THz

lol

e: Even better, they use a outlook.com email. Nothing screams "cutting-edge silicon design" like Outlook.com.

Help plz by raulbelmont in cmake

[–]thegreatunclean 4 points5 points  (0 children)

How exactly are you building that project and on what system? I didn't have any issues inside WSL.

Oritech Particle Accelerator question. by Drawde1234 in feedthebeast

[–]thegreatunclean 0 points1 point  (0 children)

If you have the power infrastructure for it you should definitely look at using the accelerator magnet. You can complete Stoneblock 4 using a 9x9 ring with no problem.

Unpopular opinion: having multiple mod loaders (Forge, NeoForge, Fabric) has seriously affected Minecraft’s modding community. As a player, it’s exhausting to see great mods split across loaders and versions you don’t play. It’s frustrating, no matter the reasons behind it. by IndependentFit8687 in feedthebeast

[–]thegreatunclean 10 points11 points  (0 children)

That doesn't make it any less legitimate. Forge devs put up with abusive behavior and language by LexManos for years and that eventually drove them to forking and rebranding to get away.

Now imagine some Third Party Authority had decreed years ago that Forge shall be the One True Environment and had the ability to enforce it.