What Happened to Minecraft Xbox Series X Ray Tracing?

D

Deleted member 13

Guest
Really? That's pretty crazy. What are the benefits for doing hand-written assembly then? I know there still have to be some.
Not that I know of. And I've interviewed with many game company developers. I don't hear it anymore. They may do some low-level assembly for the CPU though. Things like fast sqrt and stuff like that inlined within C++ code.

Some graphics devs can compile the shaders and then make sure they are good but shaders are so monolithic right now that it would be a disaster trying to interpret every single line of Assembly code. Compilers are just that good now.
 
OP
OP
ethomaz

ethomaz

Rebolation!
21 Jun 2022
8,590
7,280
Brasil 🇧🇷
PSN ID
ethomaz
Not that I know of. And I've interviewed with many game company developers. I don't hear it anymore. They may do some low-level assembly for the CPU though. Things like fast sqrt and stuff like that inlined within C++ code.

Some graphics devs can compile the shaders and then make sure they are good but shaders are so monolithic right now that it would be a disaster trying to interpret every single line of Assembly code. Compilers are just that good now.
I believe Embedded Systems still rely a lot in Assembly.

Actually in 2017 it has a interview because the grow in Assembly job opportunities and it was said:

“The only reasonable explanation for this is that the number of very small devices that are only able to run assembly code is increasing. Even your tooth brush or coffee machine are running assembly code nowadays.”

Ohhhh driver writing uses a lot of Assembly… I’m sure AMD and nVidia use it in their drivers too.
OS like Windows, Linux, MacOS, etc uses assembly at core.

Compilers (yes GCC for example) uses assembly too.

This is a year ago video that says why assembly is still used in niche high performance tasks.


No high level language compiler can beat direct assembly code in performance terms because there is overhead for the function and variable for all high level language.
 
  • thisistheway
Reactions: Alabtrosmyster
D

Deleted member 13

Guest
I believe Embedded Systems still rely a lot in Assembly.

Actually in 2017 it has a interview because the grow in Assembly job opportunities and it was said:

“The only reasonable explanation for this is that the number of very small devices that are only able to run assembly code is increasing. Even your tooth brush or coffee machine are running assembly code nowadays.”

Ohhhh driver writing uses a lot of Assembly… I’m sure AMD and nVidia use it in their drivers too.
OS like Windows, Linux, MacOS, etc uses assembly at core.

Compilers (yes GCC for example) uses assembly too.

This is a year ago video that says why assembly is still used in niche high performance tasks.


No high level language compiler can beat direct assembly code in performance terms because there is overhead for the function and variable for all high level language.
@ethomaz - C++ gets compiled out to assembly language. What I'm saying is that the compiled assembly code is as fast and efficient as someone trying to write it themselves.
 
OP
OP
ethomaz

ethomaz

Rebolation!
21 Jun 2022
8,590
7,280
Brasil 🇧🇷
PSN ID
ethomaz
@ethomaz - C++ gets compiled out to assembly language. What I'm saying is that the compiled assembly code is as fast and efficient as someone trying to write it themselves.
Are you talking to compile to assembly... you mean using the -s option in the compiler flags to generate an asm file?
Because compilers doesn't compile out to assembly language... most don't even have the option.
GCC has the -s flag so it can generate an asm file is you want.

Some compilers should use assembly as intermediate language but these are so few and most use AST to machine code (the executable) or it other intermediate languages.
GCC for example uses GENERIC, GIMPLE, and RTL as intermediate language but that depends of the frontend (the frontend can use others intermediate languages).

And a well coded assembly code will always be faster than C++ compiled code because there is no overhead of the fuction calls, variables, classes (if you are using), etc... the only language that will as fast as assembly will be the ones are the same level.

There is a reason in key (and very niche) high performance path it is used assembly instead anything else.
And of course machines that no OS and just code execution that we call Embedded Systems, enter in these most common machines in daily use, are coded in Assembly because there are simple instruction, that needs instantaneous response and the machines doesn't have a environment/hardware to run machine code from high level languages... most don't even have space to hold a compiled machine code form a high level language.

Of coruse Smart Machines that uses Android or others custom OS are different and use more high level language compiled machine code but these are still the very small part of the machines sold for daily use.... most coffee machines are coded via assembly... yeap these Nesspress you guys have at home.

You can make the test.
Create an assembly code to do the math 1 + 1
Create an C++ code to do the math 1 + 1

Assemble the assembly code to run in the CPU and use some tool to count the CPU cycles used.
Compile the C++ to machine code (executable) and run it and use the same tool to count the CPU Cycles used.

You will see the C++ complied executable to use more cycles (overhead) than the assembled code.
 
Last edited:
  • Like
Reactions: Alabtrosmyster
D

Deleted member 13

Guest
Are you talking to compile to assembly... you mean using the -s option in the compiler flags to generate an asm file?
Because compilers doesn't compile out to assembly language... most don't even have the option.
GCC has the -s flag so it can generate an asm file is you want.

Some compilers should use assembly as intermediate language but these are so few and most use AST to machine code (the executable) or it other intermediate languages.
GCC for example uses GENERIC, GIMPLE, and RTL as intermediate language but that depends of the frontend (the frontend can use others intermediate languages).

And a well coded assembly code will always be faster than C++ compiled code because there is no overhead of the fuction calls, variables, classes (if you are using), etc... the only language that will as fast as assembly will be the ones are the same level.

There is a reason in key (and very niche) high performance path it is used assembly instead anything else.
And of course machines that no OS and just code execution that we call Embedded Systems, enter in these most common machines in daily use, are coded in Assembly because there are simple instruction, that needs instantaneous response and the machines doesn't have a environment/hardware to run machine code from high level languages... most don't even have space to hold a compiled machine code form a high level language.

Of coruse Smart Machines that uses Android or others custom OS are different and use more high level language compiled machine code but these are still the very small part of the machines sold for daily use.... most coffee machines are coded via assembly... yeap these Nesspress you guys have at home.

You can make the test.
Create an assembly code to do the math 1 + 1
Create an C++ code to do the math 1 + 1

Assemble the assembly code to run in the CPU and use some tool to count the CPU cycles used.
Compile the C++ to machine code (executable) and run it and use the same tool to count the CPU Cycles used.

You will see the C++ complied executable to use more cycles (overhead) than the assembled code.
I admire your enthusiasm and knowledge here but my point still stands.

A compiled piece of code where it was C++ is going to be as fast as an assembly language compiled code.

And again, I state that no developer is making large codebases like shaders in assembly language. That's just not happening. Take a look at the source code for Unity or UE to verify my claim.
 
OP
OP
ethomaz

ethomaz

Rebolation!
21 Jun 2022
8,590
7,280
Brasil 🇧🇷
PSN ID
ethomaz
I admire your enthusiasm and knowledge here but my point still stands.

A compiled piece of code where it was C++ is going to be as fast as an assembly language compiled code.

And again, I state that no developer is making large codebases like shaders in assembly language. That's just not happening.
You don't compile Assembly code... you assemble it... it is not a compiled language.

And not... an assembled ASM code into machine code will run faster than a compiled C++ code into machine code.

And again, I state that no developer is making large codebases like shaders in assembly language. That's just not happening.
That is fine and I never disputed that.
People use Java or .NET even with all the performance and overhead issues compared with C or others languages because a reason... it is easier to code... you have classes prebuild, a lot of things easy made just calling a function... the memory management in not in your hand and the garbage collector do all the job to free up.
While in C/C++ and old languages you need to work with pointers, do manual memory management (well C++ allow you to use String as a classe without need to deal with pointers) and clean up everything after you are done with your code.

It is a way different way of do things where the coder have more time to work in complex things than losing time with simple things.

I mean that is Assembly:

Code:
; Exemplo de um Hello World em Assembly
; ld -m elf_i386 -s -o hello hello.o
section .text align=0

global _start

mensagem db 'Hello world', 0x0a

len equ $ - mensagem

_start:
    mov eax, 4 ;SYS_write
    mov ebx, 1 ;Número do file descriptor (1=stdout)
    mov ecx, mensagem ;Ponteiro para a string.
    mov edx, len ; tamanho da mensagem
    int 0x80

    mov eax, 1
    int 0x8

vs C++:

C++:
// Your First C++ Program

#include <iostream>

int main() {
    std::cout << "Hello World!";
    return 0;
}
 
Last edited:
D

Deleted member 13

Guest
You don't compile Assembly code... you assemble it... it is not a compiled language.
You are being a nitpick at this point. I've programmed in ASM before. You still have to have an assembler to break down that code.

And not... an assembled ASM code into machine code will run faster than a compiled C++ code into machine code.
No it will not in every case. Prove it.
 
OP
OP
ethomaz

ethomaz

Rebolation!
21 Jun 2022
8,590
7,280
Brasil 🇧🇷
PSN ID
ethomaz
You are being a nitpick at this point. I've programmed in ASM before. You still have to have an assembler to break down that code.


No it will not in every case. Prove it.
Run the two codes I got by exemple and use some tool that give you the CPU cycles used.
That is your proof.
 
D

Deleted member 13

Guest
Run the two codes I got by exemple and use some tool that give you the CPU cycles used.
That is your proof.
If the performance is negligible, it's not enough to be talked about. Assembly programming isn't the language of choice these days - and I mean ANYWHERE. So not sure why you are pushing that agenda.
 
OP
OP
ethomaz

ethomaz

Rebolation!
21 Jun 2022
8,590
7,280
Brasil 🇧🇷
PSN ID
ethomaz
If the performance is negligible, it's not enough to be talked about. Assembly programming isn't the language of choice these days - and I mean ANYWHERE. So not sure why you are pushing that agenda.
It never was.
Pushing agenda?
I don’t like Assembly at all.
 

Alabtrosmyster

Veteran
26 Jun 2022
3,218
2,837
No it will not in every case. Prove it.
You are the one that makes a definite statement.

Is doesn't seem hard to conceptualize, the extra generalization of higher languages could in some situations, especially as the project becomes more complex and the compiler has to work harder.

I don't work with five at that level, but at every other levels when push comes to shove a good human programmer will improve upon machine generated code from a higher level of abstraction... I don't think compilers have become magic simply because the machine doesn't know the exact context and intent behind each line of code, si any higher level language needs to add something to cover different possible cases.

Now C is not that high
 
D

Deleted member 13

Guest
You are the one that makes a definite statement.
Yes, because I've programmed in both before. Assembly not for production code but training. I also know the industry for the most part (where they are with regards to programming languages, etc.).

Is doesn't seem hard to conceptualize, the extra generalization of higher languages could in some situations, especially as the project becomes more complex and the compiler has to work harder.
Sure, but it's nowhere near as an important "need to have" as @ethomaz is making it out to be. I have talked to some game developers at MS and some of the workflow may include looking at shader compiled code and seeing if they can make "some" optimizations to it but for the most part, they are better off doing simple things like baking the shaders down from using if-statements, using smaller sized data structures, and things like that.

I don't work with five at that level, but at every other levels when push comes to shove a good human programmer will improve upon machine generated code from a higher level of abstraction... I don't think compilers have become magic simply because the machine doesn't know the exact context and intent behind each line of code, si any higher level language needs to add something to cover different possible cases.

Now C is not that high
And I'm not saying they are but based on my dealings with many software developers from all walks of life in realtime industry - making a function or block of code in assembly is not something that is going to save several ms of frametime. So from my view, it's not important and certainly less used otherwise I would be doing it myself.
 
  • brain
Reactions: Deleted member 51
OP
OP
ethomaz

ethomaz

Rebolation!
21 Jun 2022
8,590
7,280
Brasil 🇧🇷
PSN ID
ethomaz
Yes, because I've programmed in both before. Assembly not for production code but training. I also know the industry for the most part (where they are with regards to programming languages, etc.).


Sure, but it's nowhere near as an important "need to have" as @ethomaz is making it out to be. I have talked to some game developers at MS and some of the workflow may include looking at shader compiled code and seeing if they can make "some" optimizations to it but for the most part, they are better off doing simple things like baking the shaders down from using if-statements, using smaller sized data structures, and things like that.


And I'm not saying they are but based on my dealings with many software developers from all walks of life in realtime industry - making a function or block of code in assembly is not something that is going to save several ms of frametime. So from my view, it's not important and certainly less used otherwise I would be doing it myself.
Again you make a false claim.

The industry does use Assembly yet and I listed several cases… either because it is only option or because they need in some very specific case better performance.

This is a 2022 article.

“Suppose you need events on output pins to be .00000055 seconds (.55µs, or 550ns), ±10%, apart. This might be irrelevant to most web, desktop, and other human-I/O-oriented programming, but not to controlling circuitry on the workbench, or in industrial environments, or in other embedded systems whose raison d'être is something other than human I/O. If the processor is fast enough and a compiler for it produces efficient code, you may have plenty of speed to do it; but you will not have control of the exact amount of time taken with an HLL. For that, you need assembly language. (Again, that's not to say the entire application needs to be written in assembly. Often it takes only a little assembly to meet the requirements, and the rest can be in a higher-level language.)”

That is exactly why I corrected you… Embedded Systems uses Assembly (that simple calc machine you use for example) and in very specifics (yes it is niche) case you need that very best performance you use Assembly.

You not using it doesn’t change anything I said.


Then why are you talking about it as if it's some untapped power that developers need to harness?
Because you made a false claim.
It does perform better than high level language and have it use (niche? Yes but it is still have it importante in 2022 and probably forever).

Well you know COBOL is yet used a lot? The backend of most financial institutions in the world still use Mainframes coded in COBOL… they couldn’t migrate to more modern techs because it is either too expensive to the impractical point or the solutions they tried could not processed the billions of data that is processed at mid night using COBOL.

For example the Java everybody wants to use nowdays tanks in performance doing the same job and could not process the actual data needed between 12AM and 6AM (the window they have).
 
Last edited:
D

Deleted member 13

Guest
Again you make a false claim.
What claim am I making that's false?

The industry does use Assembly yet and I listed several cases… either because it is only option or because they need in some very specific case better performance.
You never listed a case at all. You tried to show an example of a very basic hello world to prove what?

It does perform better than high level language.
Both have to be compiled to machine code. Assembly is closer to machine code than C++ but it's NOT machine code. There is no OOP in Assembly which is absolutely the norm for game code. Again, you are talking about one-offs for specific functions like a fast sqrt or computing a dot product with less adds/mults and even then it's CPU related and not GPU related. I gave you an example on how it can be used for a GPU by pre-compiling the shader and then examining the byte-code to see if there is anything that can be optimized. BUT I told you then that it wasn't going to be like someone would extract out 50% gains in frametime by "correcting" the compiled code.

If you add up all the C++ code and assembly code in a game, I can bet it wouldn't even be 1% assembly code vs. C++/Python/Java code.
 
OP
OP
ethomaz

ethomaz

Rebolation!
21 Jun 2022
8,590
7,280
Brasil 🇧🇷
PSN ID
ethomaz
What claim am I making that's false?


You never listed a case at all. You tried to show an example of a very basic hello world to prove what?


Both have to be compiled to machine code. Assembly is closer to machine code than C++ but it's NOT machine code. There is no OOP in Assembly which is absolutely the norm for game code. Again, you are talking about one-offs for specific functions like a fast sqrt or computing a dot product with less adds/mults and even then it's CPU related and not GPU related. I gave you an example on how it can be used for a GPU by pre-compiling the shader and then examining the byte-code to see if there is anything that can be optimized. BUT I told you then that it wasn't going to be like someone would extract out 50% gains in frametime by "correcting" the compiled code.

If you add up all the C++ code and assembly code in a game, I can bet it wouldn't even be 1% assembly code vs. C++/Python/Java code.
You really have a hard time admitting you were wrong.

Man I listed several examples of cases you need Assembly but you keep asking for proof.

Man… majority of embedded system cant be coded without Assembly… that is is a clear case… the article I posted there are others but you keep not reading and keeping the mantra “nobody uses”, “there is no need”, “HLL compiled nowdays are faster than Assembly” lol

You know there are job listing for Assembly (way less of course) and it pay more than HLL.
 
D

Deleted member 13

Guest
You really have a hard time admitting you were wrong.
I have no problem admitting when I'm wrong dude. I disagree with your claim that Assembly is needed to make a game perform well. Period.
Man… majority of embedded system cant be coded without Assembly…
Yes, at Lockheed we deal with embedded systems all the time for our rockets and we use C for it. Some assembly for the rockets but mostly C. We aren't talking about general practice. We are talking about games and using it to optimize framerates. There is nothing you have provided for that case.

Let's just drop it. It's not going anywhere.
 
OP
OP
ethomaz

ethomaz

Rebolation!
21 Jun 2022
8,590
7,280
Brasil 🇧🇷
PSN ID
ethomaz
I have no problem admitting when I'm wrong dude. I disagree with your claim that Assembly is needed to make a game perform well. Period.

Yes, at Lockheed we deal with embedded systems all the time for our rockets and we use C for it. Some assembly for the rockets but mostly C. We aren't talking about general practice. We are talking about games and using it to optimize framerates. There is nothing you have provided for that case.

Let's just drop it. It's not going anywhere.
Wut?

When I said Assembly is needed for games? C’mon.
 

yewles1

Active member
21 Jun 2022
158
235
41
Indianapolis, IN, USA
PSN ID
yewyew1
Lower level coding will always be needed for precise optimization, otherwise for example, PS4 and 5 could've kept Cell and engineers could've used updated compilers for SPE's without ever needing to complain about ever having to optimize for it.
 
  • Like
Reactions: Alabtrosmyster