#96 region id limit

unexpected behavior
closed-invalid
Analysis (10)
7
2008-08-22
2006-12-05
Dwayne
No

There appears to be a bug in BRL-CAD which limits region ID numbers to around 32,000. The limit should fixed to facilitate mulitiple vehicles in force-on-force applications.

Discussion

  • Lee Butler

    Lee Butler - 2007-01-22

    Logged In: YES
    user_id=1179270
    Originator: NO

    Let me guess: The limit is about 32767 right? That's the size of a 16 bit signed integer.

    In the V4 database format, the regionID was limited to 16bits. So on V4 databases, you are stuck. Now on a V5 database, it is less clear. A cursory look at the code did not make it obvious if there was a hard limit in the database format. We need to dig further.

     
  • Lee Butler

    Lee Butler - 2007-01-22
    • priority: 5 --> 7
     
  • Sean Morrison

    Sean Morrison - 2007-02-08

    Logged In: YES
    user_id=785737
    Originator: NO

    dwayne, what tool were you running into the region ID limit on? mged, rt, nirt, or something else?

     
  • Cliff Yapp

    Cliff Yapp - 2008-06-30
     
  • Cliff Yapp

    Cliff Yapp - 2008-06-30

    Logged In: YES
    user_id=11463
    Originator: NO

    Wrote a proc-db to generate 33000 regions with one sphere each in them (see attached.) NIRT reports all of them, and MGED seems to be able to load, draw and raytrace (rather slowly, obviously). Dwayne, what's a good way to trigger the bug?
    File Added: stresstest.c

     
  • Cliff Yapp

    Cliff Yapp - 2008-06-30

    Logged In: YES
    user_id=11463
    Originator: NO

    Tweaked insertion to add region IDs, doesn't seem to impact MGED, nirt or rt.

    File Added: stresstest.c

     
  • Cliff Yapp

    Cliff Yapp - 2008-06-30
     
  • Cliff Yapp

    Cliff Yapp - 2008-08-22

    Logged In: YES
    user_id=11463
    Originator: NO

    reid was thought to trigger the limit, but tests out on OSX. This REALLY looks like it is a consequence of V4 database format - can anyone supply a way to trigger this with a V5 database?

     
  • Cliff Yapp

    Cliff Yapp - 2008-08-22
    • assigned_to: nobody --> starseeker
    • status: open --> closed-invalid
     
  • Cliff Yapp

    Cliff Yapp - 2008-08-22

    Logged In: YES
    user_id=11463
    Originator: NO

    After investigating the model/machine that triggered the bug report, the problem was found to be unexpected behavior of running the reid command on a tree structure with multiple references to regions in different sub-trees. The region incrementing while walking down the tree was resulting in the multiply referenced regions getting multiple increments due to reid not recognizing it had already incremented a given region in a previous reference. This caused unexpected "jumps" in region_id looking at the original tree.

    Closing this particular bug as this is not a region_id limit issue - either improving geometry arrangement or using reid on sub-trees that don't reference another high level tree will work.

     
  • Sean Morrison

    Sean Morrison - 2008-08-22

    Logged In: YES
    user_id=785737
    Originator: NO

    And as a follow-up, the behavior of reid was changed to recognize regions that are multiply referenced in a given hierarchy any only increment their region ID once so that there will not be gaps in the region IDs that get assigned. This was applied as commit r32508 and should be in the next full release of BRL-CAD.

     

Log in to post a comment.