Issue172

Title Make should compile a short/char state_var_t version
Priority feature Status resolved
Superseder Nosy List erez, malte
Assigned To erez Keywords
Optional summary

Created on 2010-12-27.14:05:28 by erez, last changed by malte.

Files
File name Uploaded Type Edit Remove
downward malte, 2010-12-29.20:44:23 application/octet-stream
Messages
msg953 (view) Author: malte Date: 2010-12-31.16:59:08
Adjusted .hgignore a bit more (added new targets for debug and profile mode) and
merged. Thanks!
msg947 (view) Author: erez Date: 2010-12-29.21:15:08
Done and pushed.
msg943 (view) Author: malte Date: 2010-12-29.20:44:23
Merged. Two things remain to be done so that Jendrik's scripts work again:

 1. Adapt build_all so that it creates all versions.

 2. Create a script called "downward" that calls the appropriate version of the
    dispatcher and has the same interface as the original downward executable
    (so that Jendrik's scripts keep working). I'm attaching one that should
    work; let me know what you think. We should then commit this and remove
    "downward" from .hgignore.
msg942 (view) Author: malte Date: 2010-12-29.20:28:53
Sorry, brain fart. Forget the previous comment. :-)
msg941 (view) Author: malte Date: 2010-12-29.20:27:54
The dispatch script looks buggy; maybe it skips over lines sometimes?
When I replace the "print 1" with "print max", I get an output of "8" on the
example I tested, but the correct value would have been "15".
msg940 (view) Author: erez Date: 2010-12-29.20:16:49
Done and pushed
msg936 (view) Author: malte Date: 2010-12-29.19:35:12
On 29.12.2010 19:24, Erez Karpas wrote:
> 
> Erez Karpas <batman@gmail.com> added the comment:
> 
> You're right.
> I'll change it to unsigned short/unsigned int,
> and adjust the gawk script.

I'd stick to unsigned short and (plain) int -- I think we assign from
state_var_t to int in many places, and assigning from unsigned int to
int can overflow. It's not an issue to have state vars limited at 2G, I
think. ;-)
msg935 (view) Author: erez Date: 2010-12-29.19:24:02
You're right.
I'll change it to unsigned short/unsigned int,
and adjust the gawk script.
msg934 (view) Author: malte Date: 2010-12-29.17:55:56
> if (max < 255) print 1; else if (max < 65524

Shouldn't the first be "<= 255"?

The second should be "<= 65535" if we used unsigned short, but since we use
short, it should be "<= 32767".
msg933 (view) Author: malte Date: 2010-12-29.17:54:05
I don't like that you removed -g from the default build options.

-g is needed for debugging, and last time I checked it didn't slow down the code
at all (since the debug info is only metadata). I'm willing to be convinced to
turn this off if any benefit can be demonstrated, but otherwise it should be
kept on.
msg931 (view) Author: erez Date: 2010-12-27.15:48:09
Pushed to my repository.
Make now accepts a STATE_VAR_BYTES parameter (1,2, or 4).
Each added .1 .2 or .4 to the objects and -1 -2 or -4 to the binary.

The ./build script should call
make STATE_VAR_BYTES=1
make STATE_VAR_BYTES=2
make STATE_VAR_BYTES=4

I also created a dispatch script, which takes the preprocessor output, and 
outputs 1 2 or 4 depending on the biggest variable domain size.
So the ./plan script should (after preprocessing) call:

/downward-`.dispatch output` OPTIONS

I did not change from -m32 to -m64 yet, but this should be done before the 
competition.
msg929 (view) Author: malte Date: 2010-12-27.14:09:39
I'd like to also have an int option in there. The translator usually doesn't
create such large domains of course, but we occasionally get them from other
sources (e.g. Jendrik's fluent merging code could generate them). Not really
needed right now, but I don't think it should be significant extra work, right?

This could be added most cleanly to the Makefile by adding another group of
suffixes like the current "-debug", "-profile" and "" (for release); e.g.
"-char", "-short", "-int" or "-1", "-2", "-4". No preferences on whether this
should come before or after the "-debug"/"-profile" suffix.
msg928 (view) Author: erez Date: 2010-12-27.14:05:28
1. Change state_var_t to unsigned char as default, with an option for short
2. Make this a compiler flag
3. Change Makefile to generate both versions
4. Write a dispatcher script
History
Date User Action Args
2010-12-31 16:59:08maltesetstatus: reviewing -> resolved
messages: + msg953
2010-12-29 21:15:08erezsetmessages: + msg947
2010-12-29 20:44:23maltesetfiles: + downward
messages: + msg943
2010-12-29 20:28:53maltesetmessages: + msg942
2010-12-29 20:27:54maltesetmessages: + msg941
2010-12-29 20:16:49erezsetmessages: + msg940
2010-12-29 19:35:12maltesetmessages: + msg936
2010-12-29 19:24:03erezsetmessages: + msg935
2010-12-29 17:55:56maltesetmessages: + msg934
2010-12-29 17:54:05maltesetmessages: + msg933
2010-12-27 15:48:09erezsetstatus: in-progress -> reviewing
messages: + msg931
2010-12-27 14:09:39maltesetmessages: + msg929
2010-12-27 14:06:10erezsetpriority: wish -> feature
2010-12-27 14:05:28erezcreate