home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c      Meh, in C you gotta define EVERYTHING      243,242 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 242,124 of 243,242   
   olcott to Mike Terry   
   Re: DD simulated by HHH and DD simulated   
   24 Nov 25 22:10:14   
   
   XPost: comp.theory   
   From: polcott333@gmail.com   
      
   On 11/24/2025 8:10 PM, Mike Terry wrote:   
   > On 24/11/2025 23:33, Mike Terry wrote:   
   >> On 24/11/2025 19:27, Kaz Kylheku wrote:   
   > <..snip..>   
   >>>   
   >>> Olcott's simulator contains abort criteria which rely on comparing   
   >>> addresses pulled from the trace buffer.   
   >>   
   >> Yep.  There are two such comparisons:   
   >> -   the addresses of the CALL instructions are compared   
   >> -   the targets of the CALL instructions are compared   
   >>   
   >>>   
   >>> That logic concludes that when two addresses are not equal, they   
   >>> represent two different functions. I.e. if CALL X  and CALL Y occur in   
   >>> the trace buffer, without any intervening conditionals in between but X   
   >>> != Y, then it is not concluded that it is a loop.   
   >>   
   >> Yep.  That's not actually a problem.  Possibly a genuine loop might be   
   >> overlooked, but the point is that if the addresses /do/ match that   
   >> could be a loop (subject to the other conditions matching).   
   >>   
   >> Hmm, maybe you're thinking that HHH/HHH1 are comparing trace addresses   
   >> against /their own/ addresses?  They don't do that.  [H/H1 do that.]   
   >> All compared addresses (whether by HHH/HHH1) are trace addresses from   
   >> the DD() simulation, which is the same whether HHH or HHH1 is doing   
   >> the emulation [up to the point HHH aborts and HHH1 carries on].  So if   
   >> you were right, the behaviour would in any case be the same for HHH/   
   >> HHH1 and couldn't account for differing HHH/HHH1 results.   
   >>   
   >>>   
   >>> That is why HHH1 and HHH show different results, even though they are   
   >>> identical.   
   >>>   
   >>> That comparison is the root cause why it matters that DD calls HHH   
   >>> and not HHH1.   
   >>   
   >> Not so, but I'll perform the test...   
   >   
   > *First test* :  HHH(DD) with 1st version of CompareFunctions()   
   >   
   > u32 CompareFunctions (u32 addr1, u32 addr2)   
   > {   
   >    u32 bRet = (addr1 == addr2);   
   >    OutputString ("CompareFunctions:");   
   >    Output ("  Addr1 = ", addr1);   
   >    Output ("  Addr2 = ", addr2);   
   >    Output ("  Returning Addr2 = ", bRet);   
   >    return bRet;   
   > }   
   >   
   > This is functionally the same as the current HHH/HHH1, because I have   
   > not tried to match HHH/HHH1 functions.  Effectively it is just adding   
   > log output for the comparisons, so we can see /what/ is currently being   
   > compared.   
   >   
   > Log output:   
   >   
   > _DD()   
   > [000025e9] 55               push ebp   
   > [000025ea] 8bec             mov ebp,esp   
   > [000025ec] 51               push ecx   
   > [000025ed] 68e9250000       push 000025e9   
   > [000025f2] e8e2f7ffff       call 00001dd9   
   > [000025f7] 83c404           add esp,+04   
   > [000025fa] 8945fc           mov [ebp-04],eax   
   > [000025fd] 837dfc00         cmp dword [ebp-04],+00   
   > [00002601] 7402             jz 00002605   
   > [00002603] ebfe             jmp 00002603   
   > [00002605] 8be5             mov esp,ebp   
   > [00002607] 5d               pop ebp   
   > [00002608] c3               ret   
   > Size in bytes:(0032) [00002608]   
   >   
   > _main()   
   > [00002609] 55               push ebp   
   > [0000260a] 8bec             mov ebp,esp   
   > [0000260c] 68e9250000       push 000025e9   
   > [00002611] e8c3f7ffff       call 00001dd9   
   > [00002616] 83c404           add esp,+04   
   > [00002619] 50               push eax   
   > [0000261a] 68e7070000       push 000007e7   
   > [0000261f] e8e5e1ffff       call 00000809   
   > [00002624] 83c408           add esp,+08   
   > [00002627] 33c0             xor eax,eax   
   > [00002629] 5d               pop ebp   
   > [0000262a] c3               ret   
   > Size in bytes:(0034) [0000262a]   
   >   
   >   S  machine   stack     stack     machine            
   assembly   
   >   I  address   address   data      code               
   language   
   >   M  (before)  (after)   (after)   
   >   =  ========  ========  ========  ===============  =============   
   >     [00002609][0010400b][00000000] 55               push ebp   
   >     [0000260a][0010400b][00000000] 8bec             mov ebp,esp   
   >     [0000260c][00104007][000025e9] 68e9250000       push 000025e9   
   >     [00002611][00104003][00002616] e8c3f7ffff       call   
   00001dd9   ; _HHH   
   >     New slave_stack at:1040af   
   >   
   > Begin Local Halt Decider Simulation   Execution Trace Stored at:1140b7   
   > [1][000025e9][001140a7][001140ab] 55               push ebp   
   > [1][000025ea][001140a7][001140ab] 8bec             mov ebp,esp   
   > [1][000025ec][001140a3][001040af] 51               push ecx   
   > [1][000025ed][0011409f][000025e9] 68e9250000       push 000025e9   
   > [1][000025f2][0011409b][000025f7] e8e2f7ffff       call 00001dd9   ;   
   _HHH   
   > [1]New slave_stack at:14ead7   
   > [2][000025e9][0015eacf][0015ead3] 55               push ebp   
   > [2][000025ea][0015eacf][0015ead3] 8bec             mov ebp,esp   
   > [2][000025ec][0015eacb][0014ead7] 51               push ecx   
   > [2][000025ed][0015eac7][000025e9] 68e9250000       push 000025e9   
   > [2][000025f2][0015eac3][000025f7] e8e2f7ffff       call 00001dd9   ;   
   _HHH   
   >     CompareFunctions:   
   >       Addr1 = 25f2   
   >       Addr2 = 25f2   
   >       Returning Addr2 = 1   
   >     CompareFunctions:   
   >       Addr1 = 1dd9   
   >       Addr2 = 1dd9   
   >       Returning Addr2 = 1   
   >     Local Halt Decider: Infinite Recursion Detected Simulation Stopped   
   >   
   >   
   >     [00002616][0010400b][00000000] 83c404           add esp,+04   
   >     [00002619][00104007][00000000] 50               push eax   
   >     [0000261a][00104003][000007e7] 68e7070000       push 000007e7   
   >     [0000261f][00104003][000007e7] e8e5e1ffff       call   
   00000809   ;   
   > VMI:  _Output   
   >     HHH(DD)     ---> 0   
   >     [00002624][0010400b][00000000] 83c408           add esp,+08   
   >     [00002627][0010400b][00000000] 33c0             xor eax,eax   
   >     [00002629][0010400f][00000018] 5d               pop ebp   
   >     [0000262a][00104013][00000000] c3               ret   
   > Number of Instructions Executed(12070) == 180 Pages   
   >   
   > Summary:   
   > HHH[0] (outer HHH called from main) detects "Infinite Recursion" and   
   > returns 0 [neverhalts].   
   >   
   > *IMPORTANT NOTE* : CompareFunctions() is only called twice, both calls   
   > from the same invocation of Needs_To_Be_Aborted_Trace_HH().  The first   
      
   [continued in next message]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca