Pivoting (or rather missing pivot)

Gary E. Miller gem at rellim.com
Fri Apr 28 08:09:36 UTC 2017


Yo Hal!

On Thu, 27 Apr 2017 13:07:58 -0700
Hal Murray <hmurray at megapathdsl.net> wrote:

> >> Which problem do you think we are discussing?  
> > The bad reversion is what I am discussing.   
>  OK.

And yet your next comment is out of that scope.

> >> step_system works as you describe it.  The problem is that it is
> >> being fed bad data.  
> > Really?  Can you detail your assertion?   
> 
> How about an example?
> 
> System time is 1970.  Server time is 2037, which gets truncated and
> turns into 1901
> Subtract gives an offset of -69

Yes, but that happens way before step_systime() and local_loop(),
thus out of scope for this discussion: the bad reversion.

> > No.  It thinks it does a pivot, but you never pivot an offset, only
> > a timestaamp.   
> 
> Get the currect system time.  Add the offset.  Now you have a
> timestamp for the new system time.  Pivot that.

That is what step_systime() does, minus the pivot.  Best not to pivot
in step_systime() because it is passed an offset, not an l_fp, and
the offset may have been calculated from GPS that never saw an NTP_EPOCH.


> Using the above example, the new time would be 1901 which is before
> the build date so add 136 years to get 2037, the server time that we
> want.

Which is why the pivot should have happened long before local_loop)(
got called.

> >                    When you subtract one timestamp (with the
> > implicit term NTP_EPOCH) from another timestamp (with th eimplicit
> > NTP_EPOCH) then you have removed the term NTP_EPOCH.   
> 
> Right.  But in the l_fp case, one or both of the timestamps may have
> been truncated.

And since you don't know one or both, or none, that has to be done
where that knowledge still exists.  Before local_loop().

> The nasty cases are one truncation and no overflow or overflow with
> no truncation.

Yes, nasty, so need to be taken care of, in the proper place.  Before
local_loop().

> > See above.  No pivot needed.  Subtracting one timestamp from
> > another removes any constant that is in both terms.   
> 
> Right.  But it doesn't magically fix unmatched truncations or
> overflows in the subtract.


Not did I ever claim it did, I claim that should be handled before
local_loop() which is before step_systime().

We'll have to table this for a week, I'm now at Penguicon...

I'm giving up that we can intellectualize this, people can't stay
focused on one issue, we keepp going around in circles.  We need to
figure out a way to wrap local_loop() and what it calls, so tests
can be run.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20170428/d7864786/attachment.bin>


More information about the devel mailing list