Sandsifter software finds hidden instructions inside processors.
Hello, I just watched this video, it's pretty interesting and somewhat amazing, this guy find a way to find hidden instructions inside processors: https://www.youtube.com/watch?v=KrksBdWcZgQ The software which finds these hidden instructions is available too: https://github.com/xoreaxeaxeax/sandsifter Apperently it's open source python and a little bit of C. It will probably require some kind of python interpreter/executor and probably admin rights to run. I am not yet sure how to run this software it will require installing some additional capstone disassembler. I am curious what would be found on my AMD X2 3800+ from almost 12 years ago... if it will run at all... I think it will run. I would be curious to also here results of other people ! ;) So if you curious as to what secret instructions exist inside your computer give this a run. Later today or in the coming days when I have some time for this I will return to this subject. For now I may have other things to do or maybe not :P :) Bye, Skybuck =D -- https://mail.python.org/mailman/listinfo/python-list
Re: Sandsifter software finds hidden instructions inside processors.
Hi, I hope you have the following newsgroup in case you are highly interested in knowing every last detail and every thought I have on this subject matter: https://groups.google.com/forum/#!forum/alt.comp.hardware.pc-homebuilt There I have written some detailed postings. In the other newsgroups I will constrain myself to the most important matter/summary of my activities, findings and productions for your usage. The most important information I want to share with you is the following: 1. I was successfull in running SandSifter software with Linux Mint 18.2 booteable DVD, downloaded ISO from the internet and undocumented instructions have been found for AMD X2 3800+ Dual Core processor. 2. All files are available on my webdrive: www.skybuck.org/SandSifter/ Explore the "unzipped folder" to see what it's all about. 3. I have written two tutorials how you can also run this software on your computer in case you have a DVD drive and DVD disc to burn this software onto. One manual tutorial and one automatic tutorial. The automatic tutorial is the easiest one which I will post here, the automatic tutorial includes a run.sh script which I will also post here, this is to help you run this software on your machine, at the end of this posting I will discuss any possible risks to doing so in case you are worried. Automatic tutorial: Step 1. Download Linux Mint ISO (Successfully tested on Linux Mint 18.2 Sonya) https://www.linuxmint.com/ Step 2. Burn Linux Mint ISO to DVD (Windows 7: Right click on file and choose burn to disc). Step 3. Boot Linux Mint ISO from DVD (Restart computer, if needed go into bios and change boot order, or press F8 to bring up boot menu or something like that) Step 4. Start FireFox Web Browser Step 5. Download SandSifter software and extract to a folder. https://github.com/xoreaxeaxeax/sandsifter (Click "clone or download", then click "download zip", then click "open with archive manager", then click "extract" (top left icon), click "other locations", choose a harddisk or other storage medium which is persistent, click on the storage medium, click create new folder (top right icon), name for folder could be "test", click "extract", click "show the files") Enter the folder "sandsifter-master" by left clicking on it. Step 6. Download Skybuck's Flying run.sh script file Download and save the "run.sh" script file to/inside the "sandsifter-master" folder. http://www.skybuck.org/SandSifter/unzipped/run.sh Step 7. Open terminal window and resize it to make it bigger Right click in the empty space and choose "open in terminal" A window and a prompt/blinking cursor should now come up looking similar to: mint@mint /media/mint/Windows 7 System (New)/test/sandsifter-master $ Make the window bigger so that the summarize script at the end doesn't crash ! Drag and Drop the window at the bottom right corner to make it bigger (Hold the left mouse button to drag and make it bigger then let mouse button go) Step 8. Run Skybuck's Flying Bash Script to install software and run SandSifter type the following command: bash ./run.sh Step 9. Guide the software installation and upgrade process Sometimes it will ask if you want to continue ? Press the Y key. Once it's done installing SandSifter will automatically run and finally a summary will be created. Step 10. Wait for the analysis to complete Once you see instructions scrolling/flying over the screen go take a sleep and wait many hours until it is completely done. Once it is done it will show something like: "May the Force be with you ! Always !" then you know the script is done ! Step 11. Do not open the log files ! The log files (in data folder) may be to big for the Linux Mint 18.2 text and office editors to handle ! This will probably crash/hang the system ! Step 12. Go into the data folder and send the files to the e-mail address: [email protected] The run.sh script: echo "Step 1. Install standard C library software" sudo apt-get install libc6-dev echo "Step 2. Install python pip" sudo apt install python-pip echo "Step 3. Update python pip" sudo pip install --upgrade pip echo "Step 4. Install setuptools" sudo pip install setuptools echo "Step 5. Install capstone binaries" sudo apt-get install libcapstone3 echo "Step 6. Install capstone dev source" sudo apt-get install libcapstone-dev echo "Step 7. Install capstone python bindings (this will take a while)" sudo pip install capstone echo "Step 8. Make sandsifter" make echo "Step 9. Run sandsifter" sudo ./sifter.py --unk --dis --len --sync --tick -- -P1 -t echo "Step 10. Summarize" ./summarize.py data/log echo "" echo "Bash script" echo "Version 0.01 created on 22 october 2017 by Skybuck Flying" echo "To Install, Make, Run, Summarize SandSifter Software and Software Dependencies" echo "Successfully tested on Linux Mint 18.2 Sonya on AMD Dual Core X2 3800+ processor" echo "May the Force be with you ! Always ! =D" echo "Have fun anal
Re: Sandsifter software finds hidden instructions inside processors.
Question: What do the letters # v l s c Stand for in this source code ? v = not valid/valid l = length s = ? c = ? If somebody with lots of python experience could dive into this code and then tell me I'd be most gratefull ! :) # # ./sifter.py --unk --dis --len --sync --tick -- -P1 -t # ./injector -P1 -t -t -R -0 -s 4293486582 # # insn tested: 129563 # artf found: 0 # runtime: 00:00:04.23 # seed:4293486582 # arch:64 # date:2017-10-22 16:10:51 # # cpu: # processor : 0 # vendor_id : AuthenticAMD # cpu family: 15 # model : 43 # model name: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ # stepping : 1 # microcode : 0x4d # v l s c 0f0d00 1 3 5 2 (0f0d) 0f0d01 1 3 5 2 (0f0d0100) 0f0d02 1 3 5 2 (0f0d0200) 0f0d03 1 3 5 2 (0f0d0300) 0f0d0400 1 4 5 2 (0f0d0400) 0f0d0401 1 4 5 2 (0f0d0401) 0f0d0402 1 4 5 2 (0f0d0402) 0f0d0403 1 4 5 2 (0f0d0403) 0f0d0404 1 4 5 2 (0f0d0404) 0f0d0405 1 8 5 2 (0f0d0405) 0f0d04050100 1 8 5 2 (0f0d04050100) 0f0d04050200 1 8 5 2 (0f0d04050200) 0f0d04050300 1 8 5 2 (0f0d04050300) 0f0d04050400 1 8 5 2 (0f0d04050400) Bye, Skybuck. -- https://mail.python.org/mailman/listinfo/python-list
Re: Sandsifter software finds hidden instructions inside processors.
Idea of this software is basically: Generate random bytes and feed them to processor. Observe result of processor if good or bad (error codes). If good check docs. If bad adjust and retry. Somebody wrote a nice short explanation of what SandSifter does to give you an idea (it's a new algorithm to find undocumented instructions fast !): It's guessing possible X86 instructions by exploiting the Instruction Decoder via the (PF) Page Fault result code. Effectively splitting an instruction across two pages and only having one page of it executable. When the decoder fetches the instruction it notices that it's incomplete, attempts to fetch the next part that is on a new non-executable page. The decoder then throws a page fault since it's not executable. So it moves the entire instruction one to the left and tries again with various combinations until it doesn't get a page fault at which point it executes it. And thus it attempts to 'tunnel' through every possible instruction. That's the general very simplified explanation. Bye, Skybuck. -- https://mail.python.org/mailman/listinfo/python-list
Re: Sandsifter software finds hidden instructions inside processors.
On Tuesday, October 24, 2017 at 1:13:22 AM UTC+2, MRAB wrote: > On 2017-10-23 23:50, [email protected] wrote: > > Question: > > > > What do the letters > > > > # v l s c > > > > Stand for in this source code ? > > > > v = not valid/valid > > l = length > > s = ? > > c = ? > > > > If somebody with lots of python experience could dive into this code and > > then tell me I'd be most gratefull ! :) > > > > > > > > # > > # ./sifter.py --unk --dis --len --sync --tick -- -P1 -t > > # ./injector -P1 -t -t -R -0 -s 4293486582 > > # > > # insn tested: 129563 > > # artf found: 0 > > # runtime: 00:00:04.23 > > # seed:4293486582 > > # arch:64 > > # date:2017-10-22 16:10:51 > > # > > # cpu: > > # processor : 0 > > # vendor_id : AuthenticAMD > > # cpu family: 15 > > # model : 43 > > # model name: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ > > # stepping : 1 > > # microcode : 0x4d > > # v l s c > > 0f0d00 1 3 5 2 > > (0f0d) > > 0f0d01 1 3 5 2 > > (0f0d0100) > > 0f0d02 1 3 5 2 > > (0f0d0200) > > 0f0d03 1 3 5 2 > > (0f0d0300) > >0f0d0400 1 4 5 2 > > (0f0d0400) > >0f0d0401 1 4 5 2 > > (0f0d0401) > >0f0d0402 1 4 5 2 > > (0f0d0402) > >0f0d0403 1 4 5 2 > > (0f0d0403) > >0f0d0404 1 4 5 2 > > (0f0d0404) > >0f0d0405 1 8 5 2 > > (0f0d0405) > >0f0d04050100 1 8 5 2 > > (0f0d04050100) > >0f0d04050200 1 8 5 2 > > (0f0d04050200) > >0f0d04050300 1 8 5 2 > > (0f0d04050300) > >0f0d04050400 1 8 5 2 > > (0f0d04050400) > > > > Bye, > >Skybuck. > > > > v = valid > l = length > s = signum > c = sicode Thank you, at least signum seems correct, I will investigate sicode later !;) So far found this tabel describing the meaning for these values: https://people.cs.pitt.edu/~alanjawi/cs449/code/shell/UnixSignals.htm Unix Signals SIGHUP 1 ExitHangup SIGINT 2 ExitInterrupt SIGQUIT 3 CoreQuit SIGILL 4 CoreIllegal Instruction SIGTRAP 5 CoreTrace/Breakpoint Trap SIGABRT 6 CoreAbort SIGEMT 7 CoreEmulation Trap SIGFPE 8 CoreArithmetic Exception SIGKILL 9 ExitKilled SIGBUS 10 CoreBus Error SIGSEGV 11 CoreSegmentation Fault SIGSYS 12 CoreBad System Call SIGPIPE 13 ExitBroken Pipe SIGALRM 14 ExitAlarm Clock SIGTERM 15 ExitTerminated SIGUSR1 16 ExitUser Signal 1 SIGUSR2 17 ExitUser Signal 2 SIGCHLD 18 Ignore Child Status SIGPWR 19 Ignore Power Fail/Restart SIGWINCH 20 Ignore Window Size Change SIGURG 21 Ignore Urgent Socket Condition SIGPOLL 22 Ignore Socket I/O Possible SIGSTOP 23 StopStopped (signal) SIGTSTP 24 StopStopped (user) SIGCONT 25 Ignore Continued SIGTTIN 26 StopStopped (tty input) SIGTTOU 27 StopStopped (tty output) SIGVTALRM 28ExitVirtual Timer Expired SIGPROF 29 ExitProfiling Timer Expired SIGXCPU 30 CoreCPU time limit exceeded SIGXFSZ 31 CoreFile size limit exceeded SIGWAITING 32 Ignore All LWPs blocked SIGLWP 33 Ignore Virtual Interprocessor Interrupt for Threads Library SIGAIO 34 Ignore Asynch 5 is indeed trap I know that much ! ;) Bye, Skybuck. -- https://mail.python.org/mailman/listinfo/python-list
Re: Sandsifter software finds hidden instructions inside processors.
I am going to issue a warning about all of this software: SandSifter, Linux Mint 18.2 and install-apt and for windows: git For now I suspect running two instances of SandSifter at same time on Linux Mint 18.2 caused file system corruption as can be seen on these three screenshots also checkdisk log file is included in web folder: http://www.skybuck.org/SandSifter/unzipped/risks/ Possible causes of file system corruptions: 1. Running two instances of SandSifter + Linux Mint 18.2 2. Git on Windows 3. Perhaps a problem was already with file system. 4. BIOS Corruption in recent past. 5. Spark when other person connected laptop to power output... there was a spark. 6. FireFox corruption while browsing or extracting files ! Google detected cooky corruption... so FireFox is also a prime suspect ! 7. Capstone disassembler Be carefull ! I still have to investigate checkdisk log further though ! ;) Bye, Skybuck. -- https://mail.python.org/mailman/listinfo/python-list
Re: Sandsifter software finds hidden instructions inside processors.
I do remember a very rare and extreme Windows 7 system hang not so long ago. It was probably caused by having to many FireFox tabs open... and somehow a website/FireFox managed to "hang windows 7". Windows 7 might have been busy trying to write data to the harddisk and somehow during that process it hang. After waiting a bit I had no choice but to press the "reset" button. I think this is what might have caused this file system corruption. A combination of "FireFox memory hogging" and "Windows 7 writing to disk", possibly FireFox cache or cookie related. Bye, Skybuck. -- https://mail.python.org/mailman/listinfo/python-list
Best attack order for groups of numbers trying to destroy each other, given a victory chance for number to number attack.
Hello, (This problem is probably too computationally intensive to solve with Python, though Python + Cuda could be interesting, and also Python has some interesting expressive powers, so it could be interesting to see how Python programmers might be able to express this problem with Python code, so I am going to give this Python group a try... maybe it will surprise me ! :) At least now you have a nice computational problem for those boring rainy days (when the net is down?and the offline games bore you ;) LOL :)) There are two groups of numbers which try to destroy each other: Group X = 1,2,3,4 Group Y = 1,2,3,4 There is a 4 by 4 victory table which describes the chance of a number destroying another number: Victory table = 50, 3, 80, 70 90, 60, 20, 40 30, 90, 55, 65 75, 90, 98, 60 (Currently implemented as a chance by diving it by 100 and storing as floating point, but since these are subtracted only from 1.0 I guess they can be stored as integers instead, even bytes) This leads to the following computational problem as far as I am concerned: Each number has an attack order permutation as follows (factorial 4 = 1x2x3x4 = 24) 1,2,3,4// 1 1,2,4,3// 2 1,3,2,4// 3 1,3,4,2// 4 1,4,2,3// 5 1,4,3,2// 6 2,1,3,4// 7 2,1,4,3// 8 2,3,1,4// 9 2,3,4,1// 10 2,4,1,3// 11 2,4,3,1// 12 3,1,2,4// 13 3,1,4,2// 14 3,2,1,4// 15 3,2,4,1// 16 3,4,1,2// 17 3,4,2,1// 18 4,1,2,3// 19 4,1,3,2// 20 4,2,1,3// 21 4,2,3,1// 22 4,3,1,2// 23 4,3,2,1 // 24 (These attack orders can be numbered from 1 to 24 or 0 to 23 and then it's attack order/permutation can be looked up to safe memory.) Each number has it's own attack order and thus this leads to the following combinational computational problem: All combinations of permutations in which order group X can attack Group Y and vice versa: Group X = 24 x 24 x 24 x 24 Group Y = 24 x 24 x 24 x 24 So this is 24 possibility to the power of 8. Final computation complexity at the very minimum is (24 to the power of 8) multiplied by roughly 4 attacks perhaps even 5 or 6 to finally destroy a group of numbers. 24 to the power of 8 = 110.075.314.176 I have already written a computer program which can solve this, however the computer program estimates it takes 19 hours on a 2.0 gigahertz AMD Athlon X2 core. Using dual core could solve the problem over night, though I do not feel comfortable running my PC at night unattended. So now I have the idea to make this program run when my computer is idling during the day, it should also be able to store it's progress so that it can continue after it was shutdown. (Idea for now is to make it multi threaded and assign a low thread priority so it can run during the day when I use my computer and it's not doing much so it can use the reserve computational horse power). (I still have to try these "idle/reverse" ideas to see which one works best without interrupting my web browsing or music listening too much ;)) My system has 4 GB of ram, so other ideas could be to store a data structure partially which could keep some computations so that it doesn't have to be done again... Though memory lookups might be a bit slow so not sure if that makes any sense. I might also try GPU/Cuda since there seems to be lots of loops/reoccurences of the same computations that will happen over and over again... So maybe cuda can detect "same branch execution" and some "computations" and might speed it up, not sure about that. Just the 8 index loops already cost a lot of instructions. Since there are only 24 permutation it would be enough to store it in 5 bits. Perhaps a rounded floating point which increases by 1/24 might be enough to trigger the 4th bit from incrementing when it actually needs to. 2x2x2x2x2 = 32 (it should increment bit 6 when the 5 bits reach 24). So the idea here was to create 8 indexes from just 1 index being incremented to create the 8 combinations of indexes "instruction cheaply". Not sure if this will work, just an idea I might try :) Then those bits would still need to be extract and makes. So perhaps on older systems this is not efficient. The 8 indexes need at least 3 instructions, 1 index increment, 1 comparision, 1 jump. The inner loop contains some while loops to increment attack index per number. Each number has a "alive" variable which starts at 1.0 and is decreased everytime it's attacked. Once a number is dead below 0.001 it's considered dead and can no longer attack. (Since victory table was described as integers above this can also be read as: Alive starts at 100 and once it goes zero or negative it's dead). Anyway the main reason why I wrote to this/these groups is that the numbers themselfes are not that larger and can fit in a byte, even a few bits. Thus they will fit into SSE registers and such and I also know SSE has some permutations instructions. I am not expert at SSE bu
Re: Best attack order for groups of numbers trying to destroy each other, given a victory chance for number to number attack.
Hello, I received a reply from somebody on my ISP newsserver. Apperently his reply is not visible on google groups. I wonder why, maybe it's a banned troll or something, but perhaps not. Anyway... my ISP has problems accessing their newsserver. They won't offer the service to new customers or changing subscriptions and they lack software to access the server. The server currently has a technical problem. Uploading messages is not possible. Some kind of bug... this has been going on for months. Seems like the bug will be ever lasting. Just called ISP helpdesk... I forgot to ask them if they could simply reset the server... but with the little information I was giving it seems to be a "remote control problem". The server is probably remotely controlled and somehow that remote control has been lost... Either password lost, or software is not working anymore... kinda strange story... especially for such a large ISP which should have sufficient technical people to solve this... weird story isn't it... perhaps they just don't want to fix it to drop people of of it This kinda sucks for me because using usenet via google newsgroups completely sucks... and is like 1.000.000 times more difficult with this very lacking interface. But for messages that I consider worth it... like this one, I might keep on going(/presserve? gotta look that up in dictionary) for now... :) Anyway here is my reply, it might enlighting others as well to this exact problem: >So now I have the idea to make this program run when my computer is idling >during the day, it should also be able to store it's progress so that it >can >continue after it was shutdown. > " Periodic snap-shots of the running environment will likely take up a majority of the run-time. " (Since you the only one who has replied so far I will take some time to try and answer some of your questions to help you along and perhaps it will be usefull to others as well). Haven't implemented this yet, but I don't see why that would be the case. It would probably need to store very little. Only 8 indexes, and perhaps 4x24 entries so that's nothing. This could be then everything index4 increments for example, or index 3. Somewhere below in this posting I will give some pseudo code for the indexes since it seems you might be struggling with that a little bit or you are trying to solve it a different way which is interesting to see but in this case I don't think it's better so I will adjust you there, but first I reply to the rest of your posting so the pseudo code will be somewhere below... " Especially if your idea is to first generate two lists of the permutations of the inputs " The permutations were already given by me in my original post. No further permutation lists are needed. The permutation table was simple generated with some 1234 string with some Delphi code found from the internet. Generating permutations is not the real issue here, since there is code on the internet which already solves that. " then generate a list of the "combat" permutations, and you want to be able to store-off/reload all those lists. " I don't see why it would be necessary to store any lists at all, except from the permutation table as to avoid having to implement a complex permutation algorithm. Generating permutations is a topic in itself so I tried to avoid that by simply hard coding the small permutation list into the code to side step that sub problem. Generating/storing/loading any kind combination list would either not be possible because of lack of memory or would require way too much time. What should however be stored is the number of victories for each permutation. >(Idea for now is to make it multi threaded and assign a low thread priority "It's CPU-bound, so using multiple threads for the computation won't be that effective..." I disagree, the problem is pretty straight forward and can be split just fine by duplicating some simple indexes/data structures. And should be able to run on each core at nearly 100% efficiency. The results could be merged together at the very end. At least in Delphi/native code this will work nicely... "You add the system overhead of context switches between the threads, and for common Python, you run into the GIL (so even if you get subsets of processing assigned to each of multiple processor cores, the GIL will block all but one from doing any work at any moment -- say you partitioned it so core0 handles only the set where X begins [1, ...], core 1 handles [2, ...], etc.). " Your last sentence made the most sense to me... I don't know what GIL is or if Python has any multi threading issues or overhead. I would assume it would not be to bad concerning overhead and that python threads can run pretty efficient as well, if not that would surprise me a little bit. Ofcourse there would only be 2 threads since it's a dual core system. If you ment running more than 2 threads then yes there
Re: Best attack order for groups of numbers trying to destroy each other, given a victory chance for number to number attack.
Hi thanks for your (Dennis) reply, You seem to have two main questions: 1. Is the attack order sequential in time or is it positional ? The answer to this question is kinda: Both, (which is kinda funny, since you did not think of this possibility that it could be both, which you also did with the other issue, see below ;)) It indicates which object should be attacked first. And ofcourse objects have a position in the real world, so this also implies position to some degree. 2. Do the numbers mean types or instances ? Again the answer to this question is kinda: Both, (^<-which is the real funny one, because the original model where there were only 4 types and 7 instances was still too large to compute within reasonable time. So the number of instances has been brought back to the number of types to represent each type exactly once so to at least keep the model somewhat realistic and include all types which is kinda important. I am particularly interested in type 4 so it has to be in the model :) Type 4 can attack the other 3 types with easy this gives you some hint at what kind of type it might be ;)). (So there are 4 types, and 4 instances, which happen to overlap each other, so you can consider them the same thing type=instance (to simplify the program)). These were your two most important questions, however you seem to have some additional (sub) questions which I will also try and answer. 3. One of your questions was: why are the indexes called "index1,index2" and so forth. This is simply because there are 8 objects. Each object needs it's own index to create a brute force algorithm which can create all combinations of the object attack patterns. The code for this is pretty simple/straight forward so I will mention it below, I will also rename these indexes as you requested to give them more meaning, pascal style: for FriendlyIndex1 := 1 to 24 do for FriendlyIndex2 := 1 to 24 do for FriendlyIndex3 := 1 to 24 do for FriendlyIndex4 := 1 to 24 do for EnemyIndex1 := 1 to 24 do for EnemyIndex2 := 1 to 24 do for EnemyIndex3 := 1 to 24 do for EnemyIndex4 := 1 to 24 do // ComputeCombat( FriendlyIndex1,FriendlyIndex2,FriendlyIndex3,FriendlyIndex4, EnemyIndex1,EnemyIndex2,EnemyIndex3,EnemyIndex4) So these indexes are simply 8 integer variables used to generate all possible attack orders (permutation number). Each index can then be used to look up the actual permutation and used in combat... So this iteration code is a big help to make sure and produce all combinations, it's simple, it's effective, it's clear to what it's doing. ComputeCombat could be a routine or simply replaced with actual code to prevent "variable sharing issues". My suggestion in case you ever do try to write code for it is to keep everything "global" or simply inside a single routine... so that parameter hell or whatever doesn't occur... keep it as simple as possible for a first version... then later it can be enhance with nice python features. Ofcourse if you think the problem is simple enough to try using more advanced features at first you welcome to try that as well but I would find it very funny if that fails... so when it does fail... fall back to ultra-simple code :) Perhaps python doesn't even have ultra simple data structures which might actually complexify your capability of solving this problem, which would be somewhat of an interesting conclusion regarding the python language as a whole ! Consider yourself challenged by me to solve it and prove that Python is not a bad language ! LOL :) Yes little bit trollish but for good reason. Eventually I do suspect python might be of some help... at least you mentioned it can generate permutations... but that is a sub problem in this case... 4. There was one more somewhat interesting sub question, your question seems to be about the attack/victory table, you seem to wonder about symetrical/asymetrical, and why it would not be symetrical ? I think I can explain this issue for you. The reason why it's not symetrical is that tanks for example have different armor thickness depending on their angle. So let's say Tank X sneaks up on Tank Y and Tank X manages to hit the Tank X in the back... then Tank X's victory chance is much higher then if Tank X was sneaked up on by Tank Y... in that case Tank X's victory chance would be much lower. I think this is the main reason why you are seeing an asymterical victory chance table. I hope that clears it up for you ;) I think I have solved all your confusion, you should now have enough information to write a computer program that could solve the problem. Solving the problem entirely would not be necessary for you to share any possible python enhancements or pseudo code or own techniques or (computing efficiency) ideas you would have come up with it. J
Re: Best attack order for groups of numbers trying to destroy each other, given a victory chance for number to number attack.
A nice chinese-like saying might have come out of this, perhaps it even already exists: "When you confused, the answer might be fused !" :) Sounds like TZen Su ! That dude from Art of War or something like that :) I will take this chance to correct a little pretty obvious typo corrected: (*) Tank X changed to Tank Y So let's say Tank X sneaks up on Tank Y and Tank X manages to hit the (*) Tank Y in the back... then Tank X's victory chance is much higher then if Tank X was sneaked up on by Tank Y... in that case Tank X's victory chance would be much lower. -- https://mail.python.org/mailman/listinfo/python-list
Re: Best attack order for groups of numbers trying to destroy each other, given a victory chance for number to number attack.
Unless you are capable of expressing problems in numerical terms you'll have very hard luck having it computed by a computer ! ;) I did find some interesting docs about "decision trees". Exhaustive search Branch and Bound Hill Climbing Random/Best Effort Solutions and so forth. A computer programmer should be able to handle abstract descriptions as well like I gave in my initial posting. What kind of "dressing" you want to give it is up to you, the dressing won't solve it though ! :) Meanwhile I have also consider some kind of lookup table... or an intermediate table like you described... Not yet sure if that will be of any help... (I am in doubt about the dynamic nature of the battles... perhaps an intermediate table would be wrong... or maybe it might be right, dynamic deaths vs staying alive inside intermediate table and such). I also tried the static approach by multiplieing chances instead of subtracting the chances like damage done. I also experimented with "Pascal/Delphi sets" in combination with arrays... this produced a very easy/simple permutation algorithm which consisted out of multiple for loops, which is kinda the obvious way of easily creating permutations... but it was still kinda interesting. There is a problem with such loops though, also like the one you mention "for each" and "for in" and such... "under water" the compiler will loop the entire range of the type, and will use compare statements to see if it should enter the inner loop. So there is hidden overhead associated with it. Thus such "generating" of permutations on the fly might have a hidden overhead cost associated with it, even if this was not the case, such for loop constructs will definetly have overheads in certain situations and this can quickly get out of hand and could even consume more processing time then the entire program. I did also briefly considered this permutation loop, though it would require a lot of programming, 8x4=24 for loops, plus possible an additional attack loop. You do have a little point that without a clear story it might be hard to understand the exact problem. I may consider describing the problem one more time, but it might still be with number or blue berries ! LOL :) -- https://mail.python.org/mailman/listinfo/python-list
Re: Best attack order for groups of numbers trying to destroy each other, given a victory chance for number to number attack.
Specially for Dennis, a nice story: There are four little animals. The first animal is a tiger, the second animal is a deer, the third animal a parrot, the fourth animal is a fish. The animals are very angry at each other and want to EAT each other ! =D However each animal has a certain specialization. For example, the tiger has very sharp teeth, but can't hold it's breath for long under water. The parrot has the ability to drive others insane with his chilping. The fish can lure other animals into the water in hopes of drowning them. And the deer can lure them into the swamp or make them fatigued from chasing them. Fortunately for the four animals they don't need to EAT each other because another group of animals have arrived which are exactly like them. So the four animals have decided to gang UP like negros in the GETTO ! LOL. It's now GANG vs GANG. But the poor little animals have run into a problem ?! Which of the other four animals should they EAT first ?! Or should they even attack multiple at the same time ?! Should the tiger fight the tiger ? Should the fish fight the fish ? Should the parrot fight the parrot ? Should the deer fight the deer ? Or perhaps ? Should the tiger eat the fish first ? Should the fish try to drown the tiger first ? Should the tiger and the fish gang up on the tiger ? But what about the enemy fish ? What will it do ? Should all four animals attack the enemy tiger ? or another animal ? Also for the gang to achieve victory all four enemy animals must be EATEN ! Now these animals wonder to themselfes ? How should we attack the enemy ? Who should we attack first ? Every individual attack has a chance of success as given by the victory table. (A survival table could be calculated as well. Which would be the inverse of this). Many possibilities for attack exists ?! Which one do you recommend for them ?! Keep in mind that each animal is free to decide it's own attack plan. They do not need to agree with you. Imagine yourself to be one of the animals. Which attack strategy for yourself would be best to use to maximize your GANG of winning, no matter what other attack plans the animals have. An example of a possible attack: Red Tiger has his own attack plan eat in this order: Blue Tiger, Blue Fish, Blue Deer, Blue Parrot Red Deer has his own attack plan eat in this order: Blue Fish, Blue Deer, Blue Parrot, Blue Tiger Red Fish has his own attack plan eat in this order: Blue Fish, Blue Parrot, Blue Deer, Blue Tiger Red Parrot has his own attack plan eat in this order: Blue Parrot, Blue Fish, Blue Deer, Blue Tiger and vice versa for blue team ! ;) :) -- https://mail.python.org/mailman/listinfo/python-list
Re: Best attack order for groups of numbers trying to destroy each other, given a victory chance for number to number attack.
Dennis wrote: " Instead you /now/ have ONE set of R marching down FOUR sets of B RT RD RF RP <- attackers BT BF BF BP round 1 BF BD BP BF round 2 BD BP BD BD round 3 BP BT BT BT round 4 " Yes this is how the problem works. Also keep in mind that an attack is only valid if the target is still alive, otherwise the attacker would move to the next one. So pre-computing an attack plan/outcome or storing it might not be so usefull for on color, since the other color might already be dead and thus attack plan was calculated incorrectly potentially. So it's quite a difficult/complex/dynamic problem ! -- https://mail.python.org/mailman/listinfo/python-list
Re: Best attack order for groups of numbers trying to destroy each other, given a victory chance for number to number attack.
Skybuck wrote: " Also keep in mind that an attack is only valid if the target is still alive, otherwise the attacker would move to the next one. So pre-computing an attack plan/outcome or storing it might not be so usefull for on color, since the other color might already be dead and thus attack plan was calculated incorrectly potentially. " ^- Apperently this text/posting was essential/the key for Skybuck's Magical Brain to come up with a solution ! I love how Skybuck's Magical Brain comes up with solutions after some sleep ! =D Just need to input the problem before sleeping, then in the morning ! TA-TA: Solution ! =D I just woke up, thought a little bit and then came up with the following solution ! The problem with the lookup/intermediate table is ALIVE/DEATH of own object (also teammate objects), furthermore another problem is ALIVE/DEATH of enemy object(s). So now the solution is obvious ! A special lookup table as follows: (Furthermore I just had another idea to compute an enemy health reduction or perhaps enemy health outcome, both are possible ! ;) Yeah... enemy health calculation probably possible and accurate, since alive/death of enemy also known on input and thus result can be calculated/stored in table ! ;) EnemyHealth (could also be EnemyHealthReduction if that were necessary for some reason ! ;) total damages would be summed, but probably not necessary to do it that way). Enemy1Health,Enemy2Health,Enemy3Health,Enemy4Health = Friendly1AliveStatus, Friendly2AliveStatus, Friendly3AliveStatus, Friendly4AliveStatus, Object1AttackPermutations, Object2AttackPermutations, Object3AttackPermutations,Object4AttackPermutations,Enemy1AliveStatus,Enemy2AliveStatus,Enemy3AliveStatus,Enemy4AliveStatus ^ So what I just tried to describe above is an 16 dimensional array as follows: 2x2x2x2x24x24x24x24x2x2x2x2 So computational complexity added by alive/death status is only x8 which is totally great... total complexity is therefore: 24x24x24x24x8 (For each attack the lookup table can be reused so that perfect too) So the initial complexity of 24x24x24x24x24x24x24x24x4(?) has now been reduced too: 1x24x24x24x24x8 (computations) It will probably still be necessary to "compute/lookup" all possibilities just to be sure, however doing an 16 way array lookup should be way faster than computing while loops and if statements and what not... though the table is quite large so some random access may occur. 16 random access is roughly 16x100 nanoseconds. Plus some 5 minute looping overhead or so so let's calculate rough indication of new processing time. 24x24x24x24x24x24x24x24x4(?) (look ups) But first I try and calculate some kind of indicator of current per loop processing time. 24^8 = 110075314176 battles / 80.000 seconds = 1375941.4272 battles per second. The 5 minute overhead is about 300 seconds so seems minimal not going to adjust for that for now. Now let's compute new expected running time. Perhaps crazyly inaccurate calculation since it does not account for data cache hits... but just worst case scenerio or something: It will be at least 16x100 nanoseconds, then 8 branches or so to determine winner is about 8 x branch time which is roughly 15 cycle clocks of 2 gigahertz or so. Then also 8 data field fetches another 8x1 cycle, and perhaps 8 assignments or so to store healths so roughly 15+8+8 = 13 plus probably some while loop to repeat attacks until there is a winner though this was already accounted for in the branches above... so for now I'll stick with 31 cycles or so So 31 cycles of 2.000.000.000 hz machine I would guess is roughly: 0.000155 seconds, roughly 15.5 nanoseconds so worst case scenerio: 16x100 = 1600 + 15 = 1615.5 nanoseconds to compute/lookup a battle. Number of battles: 110075314176 x 1615.5 = 177826670051328 nanoseconds = 177826.670051328 seconds. According to my initial calculations it will be far worse off lol ! However the 8x dimensions could be put close together so that at least those are cached, then perhaps a lookup will only take 10 nanoseconds or something or maybe even less. So then it becomes 8x10 nanoseconds + 8*100 nanoseconds = 880 nanoseconds Seems like roughly a reduction... then I am back to square one roughly running time of 90.000 seconds. Plus ofcourse some pre-compute overhead... Though I am kinda bad at estimating running time like this... I am hopefully that the look ups will proceed much faster... Sometimes of those 8x100 nanosecond seeks there will be some L1/L2 data cache hits hopefully so that should accelerate it somewhat. What actually needs to be stored is enemy health... this can be done with one byte... 100 is near 128 bits... so at least 7 bits needed for 100, so only 1 bit could be saved so doesn't really seem worth it to save 4 bits in total ! ;) The pre-compute time for the table lookups should be quite fast... The main processing for generating the lookup is: 24^4 = 331
Re: Best attack order for groups of numbers trying to destroy each other, given a victory chance for number to number attack.
Hmmm I see that I have made an old mistake of mine ;) 2x2x2x2 is not 8, it's deceptive... it looks like 4x2 = 8 but nope ! :) This is 2x2=4x2=8x2=16. and then the next 4 = 16x2 = 32x2 = 64x2 = 128 x 2=256 so it's roughly 24^4 x 256 = 84934656 -- https://mail.python.org/mailman/listinfo/python-list
Re: Best attack order for groups of numbers trying to destroy each other, given a victory chance for number to number attack.
Hmmm now I think the lookup table cannot work... at least not for the dynamic one... where health is subtracted... The ships have a certain health... and not just an alive/dead status... The way they and the enemy attack each other will probably influence the outcome of battle... and for the next round ships will have different health status... so just dead/alive is not enough... Also pre-computing the table for all 4 or more rounds seems not possible because this again depends on what the enemy was doing... So I don't think there is a way around the full 24^8 calculations... Hmmm to bad... -- https://mail.python.org/mailman/listinfo/python-list
Re: Best attack order for groups of numbers trying to destroy each other, given a victory chance for number to number attack.
I first explored the possibility of a lookup table to speed up calculations, this possibility would probably give wrong results. I am interested in calculating all possibilities to see which one is truely best, I am also interested in trying to speed up calculations to be able to handle larger models. Many other possibilities exist for further exploration: 1. One recursive function to try and split up the work as to recycle some of it. 2. Perhaps multiple recursive functions to include different functionality at different "depths". 3. Other tree like structures to try and safe some computations by recycling results from previous visits across nodes. 4. Manually incrementing indexes (though this would probably requiring storing results in some form or another, perhaps a stack based approach might work... pushing/popping as index returns to a certain one, perhaps a stack per index might work or something. 5. Detecting when index changes and then reloading previous computations. I still believe that it should be possible somehow to save some computations. Perhaps I am fooling myself ! Not sure yet ! ;) :) 6. Healths will need to be reset I think, however another possibility is copy&pasting healths to new nodes to compute them further. Sort of like a propagation algorithm... spreading already calculated results to other nodes. One problem with all that node thinking is that the system will run out of memory, which should be fine, memory can be pre-allocated to speed stuff up, one it runs out, it will have to do full calculations. I wrote about this before but cancelled posting cause it was kinda messy... but now it makes a bit more sense, now this text a bit more clear. 7. Maybe cuda or some other SIMD solution. Still not sure if CUDA can detect that some instructions/data are being calculated... hmmm would guess not, not sure though. It's kinda fun trying out all these possibilities to see which ones work... though I am also becoming a bit curious to what the actual outcome would be. For now my heuristic for a "good enough" solution would be "object attack object with best victory chance". This seems a bit too easy/cheesy heuristic and I want to know what is really the best way... is there perhaps a team strategy/combined attack effort that might work better ? ;) I would also like to be able to change chances perhaps in feature or expand model a little bit so also speeding it up would be nice. For now multi threading is doable... and the calculate while idle seems nice... Though I am also kinda curious about cuda... these last ideas are probably easiest to implement and will give most statisfactory. One problem with that is though, once I have the problem solved/calculated I might not be interested in trying out the harder possibilities. So maybe it's best to try the hardest first... maybe I will learn something amuzing and even something usefull from it. More failures perhaps, but in the end, success will come ! LOL. -- https://mail.python.org/mailman/listinfo/python-list
Re: [OT] "Invisible posts", was: Best attack order for groups of numbers trying to destroy each other, given a victory chance for number to number attack.
On Thursday, December 15, 2016 at 1:17:10 PM UTC+1, Peter Otten wrote: > [email protected] wrote: > > > I received a reply from somebody on my ISP newsserver. Apperently his > > reply is not visible on google groups. I wonder why, maybe it's a banned > > troll or something, but perhaps not. > > No, that's Dennis Lee Bieber who doesn't want his posts to be kept, and > seems to be the only one to post here with the X-No-Archive flag set. I find this weird behaviour by google newsgroup. At least google newsgroups could show his postings for something more reasonable like 30 days or something, instead of not showing it at all... Totally weird. What's the point in posting then if software would not display it at all ? ;) -- https://mail.python.org/mailman/listinfo/python-list
>< swap operator
Hello, I just had a funny idea how to implement a swap operator for types: A >< B would mean swap A and B. Bye, Skybuck. -- https://mail.python.org/mailman/listinfo/python-list
Re: >< swap operator
On Monday, August 13, 2018 at 10:01:37 PM UTC+2, Léo El Amri wrote: > On 13/08/2018 21:54, [email protected] wrote: > > I just had a funny idea how to implement a swap operator for types: > > > > A >< B > > > > would mean swap A and B. > > I think that: > > a, b = b, a > > is pretty enough LOL. A >< B is shorter ! And PPPython is all about writing short and lazy code ! =D (>< reminds me of XOR swap ;)) Bye, Skybuck ;) -- https://mail.python.org/mailman/listinfo/python-list
Extend NTFS with "version" of file and "version" of folder, also optionally GIT integration or something like it.
As far as I know currently NTFS is missing a key feature for code development and compare: "versioning information" per file and per folder. This sucks badly. Currently I have files as follows: folder version 0.01\ some_source_code_file_version_1.pas some_other_source_code_file_version1.pas and folder version 0.02\ some_source_code_file_version_2.pas some_other_source_code_file_version2.pas Now it's impossible to "code compare" these files with "code compare" tool. It does not recgonize these files. For code compare to work it would have to be: folder version 0.01\ some_source_code_file_version_1.pas some_other_source_code_file_version1.pas and folder version 0.02\ some_source_code_file_version_1.pas some_other_source_code_file_version1.pas However losing versioning information per file is dangerous in case folders are renamed or files are moved. Encoding versioning information in project files is also highly undesired in case project files are lost or corrupted. There is a very clear and distinct need to include versioning in folders and files. I hope to see NTFS extended in the future to incorporate these changes/additional features. I also highly recommend to include some GIT like versioning system integration with windows explorer. It would be highly desireable to "view/browse" and even edit or change previous GIT versions via a windows explorer and also to be able to open different version folders/branches for code compare purposes and other editing tools. Currently this GIT integration is missing, tortuise GIT does offer some integration/icon overlays but that's about it, advanced browsing of NTFS/GIT related folder tree structure is currently not possible cause ofcourse this functionality is missing. Furthermore deep branching is desireable to allow very deep folders. Also file path and folder path lengths must be incredibly large to allow deep branching and deep versioning of source code files. GIT on top of NTFS would currently never be possible because of very limited path and folders length. A little bit of branching and it hits limits. Also for a next-generation GIT version the following features are desired: 1A. Splitting of original source code file into multiple small files. + 1B. Rebasing changes in original split file into multiple small files. Currently GIT is too limited in this and does not recgonize these changes in original to be copied/rebased into split files. A very serious GIT limitation. This is "pattern recgonition" technology that must be advanced to the next level of technology. Perhaps DEEP learning might offer some possibilities here or new algorithms to detect "movements and code changes" of 1 file into multiple files. This feature will allow: 1.1. Splitting files into multiple files, without approval of original fork maintainer by "rebel" fork maintainer. 1.2. Continueing to work on multiple files by "rebel" fork, and rebasing changes of original fork maintainer, without original fork maintainer to commit these changes (from "rebel fork"). For as long as the pattern recgonizer can handle these differences it would be nice to have. Currently GIT is limitted to splitting files by maintainer, forks cannot split files and then continue to benefit from original unsplitted source, if original source does not split. Splitting files is in my oppinion necessary to keep software projects maintainable and functioning. Compilers/Editors/Analyzers/Visualizers/Parsers these are allow limited in their technology and implementation and can handle only so much due to limitations and especially bugs. The larger the source file the more like it is to contain some weird text which bugs out these tools, especially if the large file was written by a person that does not know the tools or the language well, strange bugs will occur especially but these kinds of programmers not knowing tool limitations and bugs. Splitting off files can reduce these problems and solve them one by one better and offer more possibility for diagnosis of tool-related bugs and problems, plus possibly higher recompile times since not entire file needs to be re-compiled. Also splitting files in relation to history and changing history/rebasing works bad currently in git as already indicated, somebody did write a script to try and solve it via branching per file, but as far as I know this script did not work. In principle I am against changing history in a versioning system, though the re-base feature itself could be interesting if it works. Think of this as "applieing a change in history towards the future", like time travel or something, perhaps a different term could be used for it. "Apply change in past to future". 2. Better visualization of history/branches. Currently I cannot make sense of how branches are merged, this would be nice if this was better indicated, ofcourse visualizating history of different time-related branches is more diffi
Re: Extend NTFS with "version" of file and "version" of folder, also optionally GIT integration or something like it.
Described also as: (Versioning System Integration with Windows Explorer) Anyway Googling NTFS and GIT turned up this: https://blogs.msdn.microsoft.com/devops/2017/02/03/announcing-gvfs-git-virtual-file-system/ The objective of this project seems to be a bit different. To handle very large projects. Which in itself is great. But for small projects like mine this is perhaps somewhat overkill. But the people working on this project do have some experience integrating GIT with a file system and creating some virtual file system. I highly recommend Microsoft to expand these kinds of projects massively or to expand this project in a big way and to involve Windows Explorer programmers to get on on this action and to expand windows explorer to also work with this file system and versioning system and to perhaps provide some slight new features for windows explorer to work in tandem with such a new file system. I want something like this to be usuable for small projects too Perhaps it's already usuable not sure... would be nice if this software could be made available for windows 7, only microsoft sort out the troubles with windows 10 updates ;) I think this continous windows 10 updating approach might be a bit too much for people to handle. Perhaps it's better to have an older version and a new version, so people don't be bother with new version f*ck ups. I sure don't have to to mess with windows updates and troubles, except very urgent security fixes. Bye, Skybuck. -- https://mail.python.org/mailman/listinfo/python-list
Re: Recent Spam problem
I see two solutions: 1. We build new architecture or adept current one so it's more like a blockchain, have to calculate some hash before being able to post and upload and such. or 2. We counter-attack by installing a special tool, so we all denial of service attack the source of the message, I am not sure if the source is genuine information, what you make of it: NNTP-Posting-Host: 39.52.70.224 Now the first solution would require a lot of work. The second solution would be easy to do. My question to you is: What solution do you pick of any ? =D -- https://mail.python.org/mailman/listinfo/python-list
