May 22 - Omni update

Discussion in 'Dev Blog' started by OmnipotentEntity, May 22, 2014.

  1. This answered my question, my thinking was dated and what I was saying seems correct.
     
  2. A1CZERO

    A1CZERO Subatomic Cosmonaut

    No idea what I'm looking at but regular updates are great regardless.
     
  3. Nice work around there, @OmnipotentEntity how is working going with servers? I'm wondering when there will be one stable push with the build where the leak was fixed.
     
  4. Fireball14

    Fireball14 Void-Bound Voyager

    Ok i been coding on C# for so long now, that i totaly forgot about C++. x))
     
  5. OmnipotentEntity

    OmnipotentEntity Code Monkey Forum Administrator

    int a = 1;
    int b = 2;

    a & b = 0b1 & 0b10 = 0

    You might mean (a && b) == 0.

    In which case, I'm willing to bet that the compiler makes the exact same assembly code.

    I'll let a profiler guide my optimization in this case. I try to write readable code first, and then only if it becomes a problem spot, I'll start doing bitwise hacks.

    I thought I had fixed the leak with the last stable. If you're still leaking, I'm going to need to seriously start raging at the compiler. The last 3 memory leaks have been compiler errors...
     
  6. Kawa

    Kawa Tiy's Beard

    And of course, "premature optimization is the root of all evil."

    Knuth said that.
     
    Jeoshua and Sakata-MC like this.
  7. Sakata-MC

    Sakata-MC Void-Bound Voyager

    Zael likes this.
  8. uman

    uman Space Hobo

    I'm quite sure there is an issue in the code:

    Code:
    Int maxInt;
    if ((a < 0) != (b < 0)) {
    maxInt = std::numeric_limits<Int>::min();
    } // no else? what's the point of doing the above if statement?
    maxInt = std::numeric_limits<Int>::max();
     
    Jeoshua, PSS and Kawa like this.
  9. extremist

    extremist Existential Complex

    I just love the fact that they post now daily, it's hard to just believe in progress if we don't hear anything about it.
     
  10. Brassqund

    Brassqund Hard-To-Destroy Reptile

    I really agree with you.
    There is a difference between knowing they working on and see what they are working on.
    It is really great. Continue your good work.
     
    Last edited: May 23, 2014
    Thundercraft and extremist like this.
  11. Toastanium

    Toastanium Void-Bound Voyager

    Shoowee! Look at all that mathing.
     
  12. Lobo

    Lobo Spaceman Spiff

    Piccolo and Zurgh like this.
  13. Sakata-MC

    Sakata-MC Void-Bound Voyager

    I agree with people thanking the devs for updating us. While we assume that work is happening, it really helps to actually see posts showing this. There have been a few projects that I was highly anticipating that suddenly became vaporware without any update to the community. So when I see actual updates from developers (and not PR monkeys) it is really nice.

    So, thanks Omni (and everyone else) for the updates, and please keep them coming!
     
    Thundercraft likes this.
  14. Archer

    Archer Spaceman Spiff

    With latest stable release you mean the Enraged Koala Update 8 from 26-04-2014 right? I didn't know it was in already
     
  15. May Carlin Hem

    May Carlin Hem Void-Bound Voyager

    You're spoiling us with the daily updates. I find myself checking the site twice / thrice a day now.

    (don't stop)
     
    Piccolo likes this.
  16. davidlolcat

    davidlolcat Subatomic Cosmonaut

    Only one update today!!??? Cmon guys, quit slacking!!! ;)
     
  17. gr4yz0n3

    gr4yz0n3 Pangalactic Porcupine

    ...Chucklefish actually posting daily news scares me am U still in Chucklefish where am I who are you
     
  18. OmnipotentEntity

    OmnipotentEntity Code Monkey Forum Administrator

    Sorry, as I mentioned in this reddit post, wordpress did a great job mangling the code as I copy pasted it, and I have no idea why. It ate my template parameters, it ate a few other things, and it ate an else block, or perhaps I revised it out as I was pasting and then fixing it on accident. I've corrected the code when I found out.

    If you're interested in poking at this, this is my test suite for this function.

    Code:
    TEST(MathTest, All) {
      {
        uint16_t a = 1;
        uint16_t b = 1;
    
        while (a != 0 || b != 0) {
          uint64_t a64 = a;
          uint64_t b64 = b;
    
          EXPECT_EQ(min<uint64_t>(a64 * b64, std::numeric_limits<uint16_t>::max()), noOverflowMult(a, b));
          if (min<uint64_t>(a64 * b64, std::numeric_limits<uint16_t>::max()) != noOverflowMult(a, b))
            coutf("failed on %s, %s\n", a, b);
    
          ++b;
          if (!b)
            ++a;
        }
      }
    
      {
        int16_t a = std::numeric_limits<int16_t>::min();
        int16_t b = std::numeric_limits<int16_t>::min();
    
        while (a != std::numeric_limits<int16_t>::max() || b != std::numeric_limits<int16_t>::max()) {
          int64_t a64 = a;
          int64_t b64 = b;
    
          EXPECT_EQ(clamp<int64_t>(a64 * b64, std::numeric_limits<int16_t>::min(), std::numeric_limits<int16_t>::max()), noOverflowMult(a, b));
          if (clamp<int64_t>(a64 * b64, std::numeric_limits<int16_t>::min(), std::numeric_limits<int16_t>::max()) != noOverflowMult(a, b))
            coutf("failed on %s, %s\n", a, b);
    
          if (b == std::numeric_limits<int16_t>::max()) {
            if (a == std::numeric_limits<int16_t>::max()) {
              break;
            } else {
              b = std::numeric_limits<int16_t>::min();
              ++a;
            }
          } else {
            ++b;
          }
        }
      }
    }
    It's using the google test suite. However, it's easy to revise to not rely on that.

    coutf is pretty much just a stringstream and safe printf that we made out of the tinyformat library. Other than that everything else is more or less completely standard.
     
    Last edited: May 23, 2014
    Zael likes this.
  19. Lord Kain

    Lord Kain Ketchup Robot

    I look forward to reading more code reports in the days to come, as I deal with code often myself.
     
  20. Genzo

    Genzo Astral Cartographer

    I think that CF must be proud of their fans. Do you see how they try to help CF making one of the best games will be on the Earth? (I don't know in other solar systems).
     

Share This Page