Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3

Author Topic: 64 bit version  (Read 2503 times)

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: 64 bit version
« Reply #15 on: April 23, 2011, 02:59:42 pm »

Yes, people seem to think that 64 bit is magical and will make the game run faster or more efficiently.  Fact of the matter is that unless the game's framework was changed very significantly to take advantage of the wider data-path, it would do absolutely nothing to the game except avoid a few persistent overflow errors.

Logged
I like fortresses because they are still underground.

Kogut

  • Bay Watcher
  • Next account: Bulwersator
    • View Profile
Re: 64 bit version
« Reply #16 on: April 23, 2011, 06:53:15 pm »

And will be unable to run on 32 bit.
Logged
The worst bug - 34.11 poll
Tired of going decades without goblin sieges? Try The Fortress Defense Mod
Kogut, the Bugfixes apostle of Bay12forum. Every posts he makes he preaches about the evil of Bugs.

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: 64 bit version
« Reply #17 on: April 23, 2011, 07:32:33 pm »

Another thing to be wary of about 64-bit is memory usage. 64 bit integers take up twice the space of 32 bit ones.  While you may be able to address a higher amount of memory, you'd also be taking up a higher amount of memory.  An embark that took up 1.5 GB could easilly end up taking 3 GB due to memory storage overhead.

Something ELSE to be aware of is that although DF is a 32 bit app, much of it's data isn't necessarilly 32 bit.  So far as I can tell there are no floating points in the game, everything being done with fixed point integer maths.  These integers are not 32 bit for the most part, since they can flop signs at 32767 to -32767.  Sometimes, the bit depth is even lower.

So basically, 64 what? bit what? You're dreaming if you think that would change anything.
Logged
I like fortresses because they are still underground.

Fayrik

  • Bay Watcher
    • View Profile
Re: 64 bit version
« Reply #18 on: April 23, 2011, 07:54:21 pm »

Another thing to be wary of about 64-bit is memory usage. 64 bit integers take up twice the space of 32 bit ones.
...Whoa.
64-bit integers are a data type; a variable.
Variables are assigned in code, and when compiled do not change type (most of the time).
Changing from a 32-bit system to a 64-bit system changes your hardware and thusly the way the software needs to interact. The requirement of what the software wants to accomplish does not change.
Programs do not, will not, and have absolutely no reason, to change a 32-bit integer into a 64-bit integer when changing from a 32-bit system to a 64-bit system.

As for this:
An embark that took up 1.5 GB could easilly end up taking 3 GB due to memory storage overhead.
Even if someone with access to the source decided to go and change all the 32-bit integers to 64-bit, that embark would probably only go up to 2.0 GB, or slightly over. Most of the variables Dwarf Fortress will use will probably be booleans and arrays.

Personally, I'd love to see a 64-bit compilation of the game so that we could finally embark on full size maps without the game crashing.
The only problem... Is quite a big one. The file SDL.dll is an open source project; and I've used it outside of Dwarf Fortress. For some reason (and I'm sure they have a good one), that file is compiled in 32-bit only mode. So, to get hold of a 64-bit version of Dwarf Fortress, first, we'll need to get a 64-bit compatible version of SDL.dll. (And perhaps a few others.)
Logged
So THIS is how migrations start.
"Hey, dude, there's this crazy bastard digging in the ground for stuff. Let's go watch."

kaenneth

  • Bay Watcher
  • Catching fish
    • View Profile
    • Terrible Web Site
Re: 64 bit version
« Reply #19 on: April 23, 2011, 09:34:34 pm »

Yep, 64 bit code and pointers take up more space, making 64 bit programs average 25% larger.
Also there is library integration, do the graphics (and other) librarys have 64 bit versions?
Logged
Quote from: Karnewarrior
Jeeze. Any time I want to be sigged I may as well just post in this thread.
Quote from: Darvi
That is an application of trigonometry that never occurred to me.
Quote from: PTTG??
I'm getting cake.
Don't tell anyone that you can see their shadows. If they hear you telling anyone, if you let them know that you know of them, they will get you.

Starver

  • Bay Watcher
    • View Profile
Re: 64 bit version
« Reply #20 on: April 23, 2011, 10:18:10 pm »

Another thing to be wary of about 64-bit is memory usage. 64 bit integers take up twice the space of 32 bit ones.
...Whoa.
64-bit integers are a data type; a variable.
Variables are assigned in code, and when compiled do not change type (most of the time).
Changing from a 32-bit system to a 64-bit system changes your hardware and thusly the way the software needs to interact. The requirement of what the software wants to accomplish does not change.
Programs do not, will not, and have absolutely no reason, to change a 32-bit integer into a 64-bit integer when changing from a 32-bit system to a 64-bit system.
As someone who already mentioned this general concept, I'd like to ask about memory pointers.  Even when the programmer doesn't explicitly use pointers, I'm betting the compiler will introduce a significant amount of its own to manage almost any complex data structure that the programmer didn't implement at assembler-level himself.  There are optimisations, but it's likely to be much the same as the case of however the programmer styles the variables, it's the compiler that has the last say.  It may either 'optimise' the data into padded 64-bit structures for easy shifting around or introduce a multi-step process (albeit that the speed hit may even be as low-level as at the microcode level, depending on what the chip architecture allows, and more efficient for all that) to pack multiple.

I'm not saying that booleans will still take up a 64-bit space in memory, and depacking them from either 32-bit or 64-bit conglomerate structures might well give nearly the same overheads (if it doesn't just XOR on the appropriate bit, but there are more and less efficient ways of doing that) but everything from ints on up do not get guaranteed improvement from being stored within a 64-bit environment.

I remember a number of arguments from the time of Win32, although that was a very different beast of change, as I recall so I won't reiterate them here  16-bit (and 8-bit before that) was probably the environment that I last seriously did large-scale (comparative to the time) assembly programming, and I tended to abandon the low-level stuff about the same time as 32s came about.  Since then I've been mostly at the mercy of compilers, although I do sometimes disassemble them to see what I derive.  Have to admit I've not tried compiling for 64-bit and disassembling that, so my main argument contains received wisdom (or otherwise) and personal speculation rather than experience through yours truly's very own eyeballs.  But it also checks out with sources I've wandered over and had a look at when my mind was drawn that way, previously.



(Although, speaking of compilers, I've also made a 2-bit environment emulator.  Two-bit.  Repeating that in words, just in case you thought I'd typoed something, there.  To be fair, it's more properly a multiple of two-bit segments, but each of the just four commands/operators/instructions with which it is blessed is defined by one of the four possible 2-bit 'instruction' states, the operands then following in a similar manner to quadword data on <64-bit systems (but is tuned to a fixed multiple of 2-bits appropriate to the size of the 'memory core' of that implementation).  And in my preferred set-up it contains a particularly interesting tweak to enable complete instructions to be an exact multiple of "2N-bit"-sized slots.  It's not a little esoteric (also very good code-fodder for a darwinian code evolver, as well as allowing self-modification of instruction as well as data), but probably could be implemented on non-IC (or very basically IC-based) circuitry, if brought out of the computer and put onto a real-world device.)
Logged

sockless

  • Bay Watcher
    • View Profile
Re: 64 bit version
« Reply #21 on: April 24, 2011, 01:36:18 am »

And will be unable to run on 32 bit.

So that's why you have both a 32 and 64 bit version.
Logged
Iv seen people who haven't had a redheaded person in their family for quite a while, and then out of nowhere two out of three of their children have red hair.
What color was the mailman's hair?

Blade Master Model 42

  • Bay Watcher
  • Edelgard did nothing wrong.
    • View Profile
Re: 64 bit version
« Reply #22 on: April 24, 2011, 02:28:20 am »

And will be unable to run on 32 bit.

So that's why you have both a 32 and 64 bit version.

That sounds like more work for the Great One. Seems to me he's got enough on his plate.

sockless

  • Bay Watcher
    • View Profile
Re: 64 bit version
« Reply #23 on: April 24, 2011, 02:55:35 am »

That's true.

But to all this, how would 64 bit make DF faster?

From Wikipedia, the Free encyclopedia:

Quote
While 64-bit architectures indisputably make working with large data sets in applications such as digital video, scientific computing, and large databases   easier, there has been considerable debate as to whether they or their   32-bit compatibility modes will be faster than comparably-priced 32-bit   systems for other tasks.

Some 64-bit architectures, such as x86-64,   allow for more general purpose registers than their 32-bit   counterparts. This is a significant speed increase for tight loops since   the processor doesn't have to fetch data from the cache or main memory   if the data can fit in the available registers.

So there we go, that's one way that you can get an increase in speed from using 64 bit.
Logged
Iv seen people who haven't had a redheaded person in their family for quite a while, and then out of nowhere two out of three of their children have red hair.
What color was the mailman's hair?

devek

  • Bay Watcher
  • [KILL_EVERYTHING]
    • View Profile
Re: 64 bit version
« Reply #24 on: April 24, 2011, 10:49:11 am »

In real world scenarios, 64bit is actually slower.

The advantage of 64bit DF is that the large adaman spire map would actually be able to load instead of crashing when DF ran out of memory. On a typical basis though, I really don't want DF consuming more than 2 gigs of ram :/

Logged
"Why do people rebuild things that they know are going to be destroyed? Why do people cling to life when they know they can't live forever?"

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: 64 bit version
« Reply #25 on: April 24, 2011, 11:04:50 pm »

The advantage of a 64 bit program only comes into play when there is something that requires 64 bits to compute.  Since DF does not use anything of sufficient complexity to warrant 64 bits, it would basically do nothing except allow more memory to be addressed.  As Devek says, it would allow the Adamantine Space Elevator to be LOADED.  It does not mean that it would be playable at all.  In fact, unless DF's archetecture was drastically changed to take advantage of a 64 bit format in drastic ways, it would be less playable than it is now.
Logged
I like fortresses because they are still underground.

K.I.L.E.R

  • Bay Watcher
    • View Profile
Re: 64 bit version
« Reply #26 on: April 25, 2011, 06:10:54 am »

Modern x86_64 architectures will get double the register width and number of registers. Modern compilers will try their best to batch operations to take advantage of this. As far as performance, and this thread, is concerned this is all speculation.

If any performance is to be gained it would be through a profiler and a lot of time. I wonder if Toady would  spend one to three months doing this?
Logged

Maklak

  • Bay Watcher
    • View Profile
Re: 64 bit version
« Reply #27 on: April 25, 2011, 09:49:50 am »

A smaller step would be to build with MMX and SSE2 rather than pure 386 instruction set. You don't need x64 for vectorized instructions. Performance gain could be well worth it, but even this is a lot of work. It also needs all the libraries to be compiled with MMX and SSE2, and there is potential for some bugs and crashes that disappear without optimization.
Logged
Quote from: Omnicega
Since you seem to criticize most things harsher than concentrated acid, I'll take that as a compliment.
On mining Organics
Military guide for FoE mod.
Research: Crossbow with axe and shield.
Dropbox referral

Uristocrat

  • Bay Watcher
  • Dwarven Railgunner
    • View Profile
    • DF Wiki User Page
Re: 64 bit version
« Reply #28 on: April 26, 2011, 03:38:02 am »

A smaller step would be to build with MMX and SSE2 rather than pure 386 instruction set.

Doesn't Toady do that already?
Logged
You could have berries on the rocks and the dwarves would say it was "berry gneiss."
You should die horribly for this. And I mean that in the nicest possible way.

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: 64 bit version
« Reply #29 on: April 26, 2011, 12:31:41 pm »

"Toady" doesn't do that.

"Toady's compiler" does.
Logged
I like fortresses because they are still underground.
Pages: 1 [2] 3