7

Delphi with 64 bit compilation is now in Beta, but only invited beta-testers will get their hands on this version.

What should be tested by the beta testers?

latonz
  • 1,601
  • 10
  • 21
Jørn E. Angeltveit
  • 3,029
  • 3
  • 22
  • 53
  • How the heck can I make this question a community wiki? – Jørn E. Angeltveit Apr 05 '11 at 08:41
  • 1
    Edit your post 10 times, get four other people to edit it, garner 30 answers, or flag it for moderator attention. http://meta.stackexchange.com/questions/11740/what-are-community-wiki-posts – Rob Kennedy Apr 05 '11 at 09:06
  • 4
    What is the purpose of this question? You have a beta version and you want to test something for people who don't have a beta? It seems not very programming related. – The_Fox Apr 05 '11 at 11:50
  • 1
    Subjective, and not programming related. – Warren P Apr 05 '11 at 15:41
  • 2
    I really can't see why this question is marked as subjective and not programming related. IMHO it is highly objective that some areas of a 64-bit compiler needs more attention than other.  This is also programming related and possible to answer.  The purpose of this question is to highlight which 64-bit issues a programmer should know about and which pitfalls to avoid. The gain for the community is a place where missed 64-bit features can be documented and discussed and hopefully be tested thorougly before the final release. – Jørn E. Angeltveit Apr 05 '11 at 16:33
  • If you want to know what the issues are regarding 64-bit and Delphi, check this question: http://stackoverflow.com/questions/4051603/how-should-i-prepare-my-32-bit-delphi-programs-for-an-eventual-64-bit-compiler – The_Fox Apr 05 '11 at 17:52
  • It may be an objective Beta Testing question, but as a programming question, it is subjective (has no definitive programming answer) and has no relation to the art of computer programming. – Warren P Apr 06 '11 at 00:57
  • 1
    @Warren: it has a practical relation to the art of computer programming, even if not a theoretical one. This compiler's important for a lot of people! And there are objectively useful things to try out with it, surely. – David Apr 06 '11 at 03:20

4 Answers4

6

Embarcadero will probably provide a tester's guide for the beta testers. But, here are some ideas:

  • Memory allocation, alignment, heap and stack. 32-bit could use up to 4GB (well, 3.5) of address space on a 64-bit version of Windows with the /LARGEADDRESSAWARE switch: Delphi64 should be able to use much more. Try allocating 8, 16, and 32 GB. (Even if you have less RAM, the allocation should work since it's a virtual address space.) Now read and write values into it a certain spots: check your allocation and pointers all work. Have a look at what Process Explorer reports for the app. Inspect your stack: it runs top-down, unlike the heap - what does it looks like, what addresses is it using? What does the 16-byte alignment look like? Is that alignment kept for all internal Pascal functions, or only those that call external code? In the 32-bit VCL, there were some bits of code that weren't safe for addresses larger than 2GB. Have those been fixed? Does anything break when it's allocated in, say, the 53rd GB of your program's address space? (Try allocating a huge amount, and then dynamically creating forms, controls etc - they'll probably be created with high addresses.) Does the memory manager fragment? How fast are memory moves and copies?

  • Compiler warnings. (This one is important.) Upgrade your programs - compile them without changes, and see what warnings / errors you get; fix any; and then fix bugs that occur even though you weren't warned. What issues did you encounter? Should the compiler have warned you, but didn't? Do you get warnings when truncating a pointer when casting to an integer? What about more complex issues: if you use the Single floating-point type, what happens? Warning, or is it silently represented as a double? What if you pass in a parameter to a method that's a different size - for example, PostMessage and you pass in a 32-bit-sized value to the handle parameter - will the compiler be smart enough to guess that if the size is wrong, your code might be wrong, even though it's often valid to pass a smaller type to a larger parameter? Under what circumstances should it do so? (Another thing: what if you pass a 64-bit pointer to a 32-bit type in a method expecting a pointer to a 64-bit type - the type safety should yell loudly, but does it? A use case for that is reading blocks from a binary file, something that could easily cause problems with the wrong-sized types.) ...etc.

    Compiler warnings are probably one of the most useful tools for people who upgrade, so the compiler should produce as many as possible, in as many situations as possible, with as few false positives as possible. Remember Delphi is used by a wide range of programmers - you may know what a warning means or recognize bad code even if the compiler is silent, but anything that will help novices (or good programmers having a bad day) is important.

  • Custom controls & WinAPI. You probably have a few customs controls or bits of code that make heavy use of Windows APIs instead of the VCL. Are there any Windows API-specific issues?

  • Language compatibility. Does the old file IO code work - AssignFile, etc? RTTI? If you have an event signature with an Integer type, and an event handler is auto-created by the IDE, is it generated as Integer or a size-specific integer type depending on the platform that's currently set? What if the event is NativeInt, what then? (I've seen bugs in event handler method signature generation before, though only on the C++ side.)

  • Different types of application. We can assume GUI programs have been tested well. What about console and service applications?

  • C++Builder compatible file generation. C++Builder won't be 64-bit in XE2, but hopefully will in XE3. Delphi can produce ..hpp and .obj files for Pascal code, though. What happens in for a 64-bit platform? Can you produce those files, even though they're useless? Does the compiler generate C++-specific warnings in 64-bit mode, or does it give up and not let you do it? In 32-bit mode, is there anything you can do for 64-bit compatibility that will generate a warning building the C++ header?

  • Linker. Can you link .lib and .obj files created with other compilers? (I'd expect .lib yes, .obj no.) Does the linker use COFF or OMF for 64-bit - have they changed? This thread implies an ELF format. Has it changed for 32-bit too? Does this affect the DCU format, will we still get ultra-fast compiling / linking?

  • COM and 64-bit plugins. Are there any marshalling issues? Can you build a 64-bit plugin for Explorer now?

  • Calling conventions. Safecall's supposed to be the only 'calling convention' (if safecall counts...) that's still different - does it still work? Function and procedure pointers, and closures (object method pointers): do they work? What do they look like in the debug inspector? Given all calling conventions are now the same, if you mix calling conventions in your method declaration and your calling pointer, what happens? Is there any legacy stuff around that will break or does it transparently work? Does it now give you an (erroneous) warning that the types are incompatible?

  • Floating point math. The Delphi 64 preview said floating point would be double only. Can Delphi handle long doubles? Are there any compatibility routines for handling the old Real (48 bits, I think??) type? Does the compiler generate SSE or SSE2 code or a mix, and how good is it?

  • Performance. This is their first go at a 64-bit compiler; it will probably be refined over the next few releases. But are there any obvious performance problems, with:

    • compiling; linking; IDE insight?

    • Generated code: are your programs faster or slower? Is FP math faster or slower? Does inline work, and does it generate any unnecessary header/footer bits around inlined methods?

  • Debugging. This is probably easiest to test through the whole process of testing everything else, but how well does the 64-bit debugger work? Does it have all functionality of the 32-bit one? Do IDE debug visualiser plugins still work? What if you debug a non-Delphi 64-bit program or attach to a process, instead of running normally?

  • Misc Is Delphi itself compiled as a 64-bit program? If not, why not? (Are they "eating their own dogfood"?) Code inspect the new VCL (assuming the preview comes with VCL source.) What have they done to make the VCL 32/64 compatible? Are there any errors, or if you already know 64-bit code well from other IDEs, are there better approaches they could take instead?

...etc. I could keep typing for hours, but I think that's a good start though :)

David
  • 13,360
  • 7
  • 66
  • 130
3

I'm sure Embarcadero will provide some testing guidance. For what it's worth this is what I'd test; Mostly because it's the stuff I care about:

  • Small console application should work.
  • Allows me to allocate a 4Gb flat hunk of memory. Don't really need that, but it will be the first thing my console application tries, right after WriteLn('I''m using all 64 bits!!!!');
  • Can create 64bit DLL and the DLL can be imported and used from other environment.
  • Do some simple things and look at the generated assembler, just for kicks.
  • Can create Firebird 64bit compatible UDF's
  • I'd probably try compiling my "utility" units, because they do an fair amount of pointer manipulation, see how they work.
  • If the VCL works I'd put it through it's paces: create small form, put a button on it, ShowMessage.

Generally speaking the only thing I really need 64bit Delphi for is Firebird 64bit UDFs. That's minor and can be "fixed" using FPC. I assume the best testing will be done by people that actually need 64 bit delphi. And those people don't need testing suggestions.

Cosmin Prund
  • 25,498
  • 2
  • 60
  • 104
2

The base foundation stuff would come first, to ensure that Delphi 64 can be used for what Delphi 32 can't be used:

  • compiler correctness: first and foremost, no internal errors, no incorrect code-gen
  • ability to compile to 64bit DLLs and stability of those
  • stress the memory manager: with large objects, fragmented allocation, multi-threaded allocations, etc.
  • multi-threading: is it stable? is it efficient? does it scale? that for core RTL functions and units, and not forgetting the reference-counted types.
  • floating point: does the compiler deliver proper SSE? are the maths functions properly implemented and correct? what happens if you stress the SSE register set with complex expressions?

And as a bonus, ability to accept 64bit object files from the usual C++ compilers.

Eric Grange
  • 5,931
  • 1
  • 39
  • 61
  • Which C++ compilers do you think will spit out an obj file that Delphi can consume? My guess is that functionality won't make the first release. – David Heffernan Apr 05 '11 at 10:31
  • Given the cross platforms plans, GCC would probably have to be first, but on Windows, MSVC would be nice. If they went for a proprietary object file format, that could not make it to release indeed, but if they went for compatibility with a standard toolchain this time, everything could be possible. – Eric Grange Apr 05 '11 at 11:45
  • At the moment it's just bcc32 isn't it? One obvious problem with anything else is what to do about floating point. – David Heffernan Apr 05 '11 at 12:05
  • Yes just bcc32, which doesn't offer much value (archaic codegen, les and less supported in C projects, etc.). For the floating-point, they should standardize on the standard FPU control word value, it's already savaged by MSVC DLLs at the first opportunity anyway. – Eric Grange Apr 06 '11 at 06:59
  • for me it would be no good to use that approach with control word. For me bcc32 is fine. – David Heffernan Apr 06 '11 at 07:05
1

Non visual stuff ... I think. There is already success from some beta testers that already ported their libraries. I don't know the preview but from the information I don't have I would assume more complex non visual scenarios currently make sense. Anyone who knows it better please correct me ...

I think the preview first allows you to setup a migration strategy, this would be my intention. The VCL ... intended to work on one code base and maybe backport your code to purepascal instead of assembler.

Mike

Michael
  • 11
  • 1