John Carmack on Cheating vs Optimistations

Discussion in 'Beyond3D News' started by Dave Baumann, May 27, 2003.

  1. Dave Baumann

    Dave Baumann Gamerscore Wh...
    Moderator Legend

    Joined:
    Jan 29, 2002
    Messages:
    14,079
    Likes Received:
    648
    Location:
    O Canada!
    Echoing Tim Sweeney's comments, stated here, on the ideas being replacing Shader code within an application id's John Carmack has also poted his thoughts on the matter at Slashdot following on from this 3DMark issue:

    "Rewriting shaders behind an application's back in a way that changes the output under non-controlled circumstances is absolutely, positively wrong and indefensible.

    Rewriting a shader so that it does exactly the same thing, but in a more efficient way, is generally acceptable compiler optimization, but there is a range of defensibility from completely generic instruction scheduling that helps almost everyone, to exact shader comparisons that only help one specific application. Full shader comparisons are morally grungy, but not deeply evil.

    The significant issue that clouds current ATI / Nvidia comparisons is fragment shader precision. Nvidia can work at 12 bit integer, 16 bit float, and 32 bit float. ATI works only at 24 bit float. There isn't actually a mode where they can be exactly compared. DX9 and ARB_fragment_program assume 32 bit float operation, and ATI just converts everything to 24 bit. For just about any given set of operations, the Nvidia card operating at 16 bit float will be faster than the ATI, while the Nvidia operating at 32 bit float will be slower. When DOOM runs the NV30 specific fragment shader, it is faster than the ATI, while if they both run the ARB2 shader, the ATI is faster.

    When the output goes to a normal 32 bit framebuffer, as all current tests do, it is possible for Nvidia to analyze data flow from textures, constants, and attributes, and change many 32 bit operations to 16 or even 12 bit operations with absolutely no loss of quality or functionality. This is completely acceptable, and will benefit all applications, but will almost certainly induce hard to find bugs in the shader compiler. You can really go overboard with this -- if you wanted every last possible precision savings, you would need to examine texture dimensions and track vertex buffer data ranges for each shader binding. That would be a really poor architectural decision, but benchmark pressure pushes vendors to such lengths if they avoid outright cheating. If really aggressive compiler optimizations are implemented, I hope they include a hint or pragma for "debug mode" that skips all the optimizations.
    "

    I would, however, appear the case that John doesn't realise that the required minimum specification for DX9 full precision is FP24.
     
  2. Mephisto

    Newcomer

    Joined:
    Feb 7, 2002
    Messages:
    200
    Likes Received:
    0
    AFAIK, this is just plain wrong.

    Funny, if there is "absolutly no loss of quality of functionality", why this makes it more difficult to find bugs? 8)
     
  3. Mark

    Mark aka Ratchet
    Regular

    Joined:
    Apr 12, 2002
    Messages:
    604
    Likes Received:
    33
    Location:
    Newfoundland, Canada
    yeah, I was going to mention that as well. I always thought 24bit fp precision was the DX9 standard
     
  4. Anonymous

    Veteran

    Joined:
    May 12, 1978
    Messages:
    3,263
    Likes Received:
    0
    It is.
     
  5. andypski

    Regular

    Joined:
    May 20, 2002
    Messages:
    584
    Likes Received:
    28
    Location:
    Santa Clara
    Ooops - forgot to log in.
     
  6. Bambers

    Regular

    Joined:
    Mar 25, 2002
    Messages:
    781
    Likes Received:
    0
    Location:
    Bristol, UK
    Haven't seen a great deal of evidence for fp16 on an FX being faster than fp24 on r3x0. certainly not the nv30. :-?
     
  7. tEd

    tEd Casual Member
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    2,094
    Likes Received:
    58
    Location:
    switzerland
    As long as the shader optimizations not degrade quality, fine.But I would like to decide myself whether I want to degrade quality for speed or not and not a IHV.

    Give me the choice that's all i'm saying
     
  8. RussSchultz

    RussSchultz Professional Malcontent
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    2,855
    Likes Received:
    55
    Location:
    HTTP 404
    If you're developing in a completely black scenario, it probably doesn't.

    If you're able to do source stepping, optimization can be very frustrating. Instructions happen out of order, some code simply gets pruned entirely, etc.
     
  9. Ilfirin

    Regular

    Joined:
    Jul 29, 2002
    Messages:
    425
    Likes Received:
    0
    Location:
    NC
    I don't mean to be an ass, but is it just me or did he completely side-step the entire issue and just post a bunch of unrelated (or mildly-related) information that everyone already knew to begin with (and that he already stated before)?

    :?
     
  10. boobs

    Newcomer

    Joined:
    Jan 27, 2003
    Messages:
    66
    Likes Received:
    0
    He wants to get things done, not argue endlessly.
     
  11. RussSchultz

    RussSchultz Professional Malcontent
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    2,855
    Likes Received:
    55
    Location:
    HTTP 404
    What's the issue, in your mind?
     
  12. Ilfirin

    Regular

    Joined:
    Jul 29, 2002
    Messages:
    425
    Likes Received:
    0
    Location:
    NC
    :?: What does that have to do with what I, or John, said?

    [EDIT] This was in response to boobs post.
     
  13. BoardBonobo

    BoardBonobo My hat is white!
    Veteran

    Joined:
    May 30, 2002
    Messages:
    3,255
    Likes Received:
    153
    Location:
    SurfMonkey's Cluster...
    Where does it actually say that in the SDK docs? I can only find the reference to the scalar values that are supported (16,32,64bit floats, boolean and 32bit signed integer).
     
  14. Ilfirin

    Regular

    Joined:
    Jul 29, 2002
    Messages:
    425
    Likes Received:
    0
    Location:
    NC
    Perhaps the article that his post was in response of?

    Cheating vs optimization, nVidia accusing futuremark of intentionally trying to put nVidia's product in a bad light, what classifies as an objective benchmark, etc. You know.. the subject of the last 2 weeks of debate?

    FP16 vs FP24 vs FP32 is an old, resolved issue in my book and I fail to see its relevance to nVidia's/ATI's actions as of late. Him stating it just looks like a lot of PRish fluff and trying to put his favorite company in a better light than they should be in IMO. But I'm in a really bad mood at the moment (reading countless posts along the lines of HardOCP's will do that to you) and should probably just STFU until I get some sleep.

    and BoardBonobo, it is stated in the fragment of the DX spec that was posted on the DXDev mailing list a while ago (when all this precision nonesense was relevant) by someone from Microsoft. Technically D3D makes no assumption about precision at all, it just expects you to conform to the WHQL standard, which calls for a minimum of 24-bit.
     
  15. T2k

    T2k
    Veteran

    Joined:
    Jun 12, 2002
    Messages:
    2,004
    Likes Received:
    0
    Location:
    The Slope & TriBeCa (NYC)
    Good to hear that 24bit... I'm not stupid, I was right. :) (I was really confused at first reading...)
     
  16. T2k

    T2k
    Veteran

    Joined:
    Jun 12, 2002
    Messages:
    2,004
    Likes Received:
    0
    Location:
    The Slope & TriBeCa (NYC)
    Oh yes. :D
     
  17. Anonymous

    Veteran

    Joined:
    May 12, 1978
    Messages:
    3,263
    Likes Received:
    0
    Personally I find this hard to swallow. Otherwise.. why do we even need 32bit if the same Quality is achieved with 12 bit operations???
     
  18. Dave Baumann

    Dave Baumann Gamerscore Wh...
    Moderator Legend

    Joined:
    Jan 29, 2002
    Messages:
    14,079
    Likes Received:
    648
    Location:
    O Canada!
    While that may be cleared up in you mind, and most of the people on this forums minds as well, I think there is still a widespread misunderstanding of nuances of the shader architectures employed by both vendors, especially a lack of understanding over the precisions available in NV3x and their ramifications in terms of quality and performance (relative to the quality settings used). To a certain extent, here he is not just talking about the 3DMark issue, but also going some way towards explaining the performance differences recently seen in the Doom3 benchmark results.
     
  19. BoardBonobo

    BoardBonobo My hat is white!
    Veteran

    Joined:
    May 30, 2002
    Messages:
    3,255
    Likes Received:
    153
    Location:
    SurfMonkey's Cluster...
    OK thanx for that. But it still looks like it handles everything at 32bit internally but just calls for a minimum of 24bit for support. Not that it makes any difference though... :?
     
  20. mczak

    Veteran

    Joined:
    Oct 24, 2002
    Messages:
    3,015
    Likes Received:
    112
    And, if I'm not completely mistaken, it's also the minimum for GL_ARB_FRAGMENT_PROGRAM.
    OMC? How can that be? I just was about to build a temple to worship JC :D
     
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...