🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
110 messages
110 total messages Page 3 of 3 Started by Liyang Hu Sat, 16 Feb 2002 01:20
Page 3 of 3 • 110 total messages
Re: [yEnc] some newbie questions
#56953
Author: Nuutti Kotivuori
Date: Wed, 27 Feb 2002 20:10
53 lines
3698 bytes
Curt Welch wrote:
> Nuutti Kotivuori <naked@iki.fi> wrote:
>> But if we, for example, use adaptive coding, the table will shape
>> itself to respect the actual distribution of bytes in the input
>> data.
> 
> No.  At least I don't see how to do that. Maybe you can teach me
> something else new?
> 
> Remeber, to use arithmetic encoding to solve the binary to base251
> translation problem, we have to use the arithmetic DEcoding
> algorithm to do our ENcoding work.  I don't see how you can use the
> skew in the binary data to any advantage when going in that
> direction.

But the thing is that we do not _need_ to use decoding to do the
algorithm work - that is only one solution. We can use a 256 character
table for the symbol table - and do our _math_ in 251 base - that is
have 251 base digits, instead of 2 base, 10 base or 16 base as
normally used. The only place where we actually need to do any maths
with these numbers is the adaptation of high and low for a symbol into
the current range. This operation can be hand coded without too much
bother. And even there it can possibly be done with just addition and
comparison, if we use a bit more advanced and approximating
implementations of arithmetic coding.

But this again is just one solution. Arithmetic encoding can be used
in a multitude of ways. Arithmetic coding is the optimal way of
representing symbols with probabilities in the least amount of digits,
just like Huffmann encoding was about the optimal way of representing
symbols with probabilities in the least amount of integral
bits. Saying that it can't be done is silly, since it's just a matter
of implementation.

> The only option I see is to simply make one pass over the data with
> any compression algorithm

> (of which adaptive coding would be a poor choice),

If we are talking about actual compression algorithms, a 0-order
adaptive arithmetic coding would be a poor choice. But adaptive coding
in itself would not. By doing 2nd and 3rd order tables with escapes
and other neat gimmics, we can actually do very good compression with
adaptive coding.

> and then use arithmetic coding to convert from binary to baseX.

But in any case, these solutions are quite elaborate compared to the
problem at hand - representing 256 base data in 251 base or whatever.

-- Naked

Re: [yEnc] some newbie questions
#56955
Author: Nuutti Kotivuori
Date: Wed, 27 Feb 2002 20:37
139 lines
7478 bytes
Curt Welch wrote:
> Nuutti Kotivuori <naked@iki.fi> wrote:
>> Curt Welch wrote:
> They are dumb you know.

Ah well, maybe you know better.

> Speaking of which, I've now gotten enought "what's this yenc stuff
> and why can't I read the files" questions that I'm going to be
> forced to add it to my code now.

My friends are bitching that just when they are getting some groups to
accept yEnc stuff, another version is coming out. And then they talk
about revering back to uuencode until it's stabilized :)

>> Jesus, arithmetic coding is what makes
>> this whole thing easily hand written from pseudocode in 5 minutes.
> 
> Yeah, but it only takes 2 minutes without it.

Well, true.

> There is such a thing as an algorithm that is simple to understand
> but very hard to code correctly.

True.

[...]

> I haven't tried to code the arithmetic coding algorithm, so I don't
> have any real experence with that.  But from what I read, it sure
> looked like another quicksort problem.  It's structure is very
> similar to quick-sort in an abstract way and it has special cases
> for almost the same reason as quick sort has.
> 
> The real-number definition of the algortham is trivial.  But when
> you map that to fixed length intergers, it generates special cases.
> The underflow problem for example.  To guarantee the precision of
> the math stays within the precision of your numbers, you have to
> deal with the underflow problem by simulating a number which is much
> larger than the precision of the intergers you are working with.  If
> you get that wrong with a simple mistake like a > instead of a >=,
> the code may "seem" to work fine but yet will fail when given just
> the right input stream to code.
>
> That sure looks just like the quick sort problem to me.  I'd be
> willing to bet that MOST newsreader authors would get it wrong if
> they tried to code it themself.  But, if you gave them pseudo code
> which was step for stop translatable into a real language, AND, you
> gave then a very good set of test data to test the special cases
> correctly, then I'd say there would be a good chance of most getting
> it right.  But the best way to do that is give them real code in a
> common language like C and let them translate that to other
> languages if need be.

Well, there's room for error everywhere. Good test streams that try to
spark errors in encoders and decoders would be a must. I think they
would be a must with any type of encoder.

But agreed, arithmetic coding has more room for errors than a simple
escaping has. But on the other hand, I think that arithmetic coding
has less room for exploits and crashers due to illegal escaping and
other malicious things.

Maybe I don't just see it from the common coders perspective. I did
get quick sort right the first time so maybe I shouldn't talk about
how other people should be able to do it as well.

>> The thing is, understanding arithmetic coding might not happen in 2
>> minutes from the newsreader authors. But understanding is not
>> required. A simple pseudocode of "add this to this" is quite enough
>> for writing the algorithm.
> 
> Maybe.  But like quicksort, I think the odds of that being "easy" is
> less than you think.  All the authors that published broken versions
> of the quick-sort algorthm though just like you are doing now.

Well I think the quick sort algorithm is more complex than this
is. And I do think that broken encoders and decoders would be caught
pretty fast, unless there is exactly one implementation of both used
at all.

>> Though ofcourse this is only my opinion.
> 
> No one is allowed to have their own opinion here.  Only my opinions
> may be used in this group. :)

Well so it seems.

>> In my opinion, being flexible is good, but the encoded form
>> produced by an encoder should be exactly equal to the encoded form
>> produced by another encoder.
> 
> Flexibility to change is normally seen as more important that
> consistency.  Even more so on Usenet.

Well flexibility is a good goal if everyone is required to implement
the full feature set. If there is room to make shortcuts, people will
usually make them and in the end, create incompatible versions of the
same specification.

>> All encoded files should behave the same - so no "oh this file
>> can't be transmitted here because it has less excludes that allowed
>> for 0.05 improvement in filesize".
> 
> No one is doing that with yEnc now are they?

I just meant that for example if '-' is allowed as an additional
escape. Then some posts possibly have that as an escape and some
don't. If that is escaped, then the file will most likely transfer
cleanly over MIME - if not, then problems might occur. This is just a
hypothesis, but I still think that the encoding should be as strict as
possible. Every flexibility adds more testcases to test for in the
implementation both the encoder and the decoder. And we don't want
implementations that are not tested for all possible combinations out
there, do we? ;)

>> We are past proof of concept already - let's just make one version
>> which works.
> 
> Are there problems with the current version not working?  I wasn't
> aware of that.  I thought we were just talking about ways to make
> life hard for everyone by "improving" it.

Oh I did not mean to say that the original version would not work. It
works - as in, it gets the job done.

What I meant was that let's just make one version of yEnc, that is
well-defined and optimal, given the circumstances - and then make sure
that that works in all the possible cases.

In actuality, I don't even know if yEnc should be changed in itself -
sure, it's not how I would've done it, but it's one solution - just
that it is specified down to the last gritty detail about character
sets and header fields and everything.

-- Naked

Re: [yEnc] some newbie questions
#56957
Author: Curt Welch
Date: Wed, 27 Feb 2002 20:49
32 lines
2623 bytes
Nuutti Kotivuori <naked@iki.fi> wrote:
> Curt Welch wrote:
> > Nuutti Kotivuori <naked@iki.fi> wrote:
> >> But if we, for example, use adaptive coding, the table will shape
> >> itself to respect the actual distribution of bytes in the input
> >> data.
> >
> > No.  At least I don't see how to do that. Maybe you can teach me
> > something else new?
> >
> > Remeber, to use arithmetic encoding to solve the binary to base251
> > translation problem, we have to use the arithmetic DEcoding
> > algorithm to do our ENcoding work.  I don't see how you can use the
> > skew in the binary data to any advantage when going in that
> > direction.
>
> But the thing is that we do not _need_ to use decoding to do the
> algorithm work - that is only one solution. We can use a 256 character
> table for the symbol table - and do our _math_ in 251 base

Ok, i see that.  But that's getting weird.  But maybe not as wierd as
it first seems. I'd have to try it to see...

> or 16 base as normally used.

And that's different from 2 how?  Do they compare and shift only in blocks
of 4 bits at a time and call that base 16?

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: [yEnc] some newbie questions
#56956
Author: Nuutti Kotivuori
Date: Wed, 27 Feb 2002 21:12
24 lines
2328 bytes
Curt Welch wrote:
> Nuutti Kotivuori <naked@iki.fi> wrote:
>> But the thing is that we do not _need_ to use decoding to do the
>> algorithm work - that is only one solution. We can use a 256
>> character table for the symbol table - and do our _math_ in 251
>> base
> 
> Ok, i see that.  But that's getting weird.  But maybe not as wierd
> as it first seems. I'd have to try it to see...
> 
>> or 16 base as normally used.
> 
> And that's different from 2 how?  Do they compare and shift only in
> blocks of 4 bits at a time and call that base 16?

Yes. Just as base10 is doing it with, well, 10 base digits. The 251
base values can be stored in char arrays for example - and everything
can shift just one 'char' out at a time. The only hard thing is
addition (and possibly, if we do it in a silly way, multiplication and
dividing) with those char arrays containing 251 base digits.

-- Naked

Re: [yEnc] some newbie questions
#56965
Author: The Archiver
Date: Thu, 28 Feb 2002 06:30
18 lines
2130 bytes
Nuutti Kotivuori <naked@iki.fi> wrote:

>My friends are bitching that just when they are getting some groups to
>accept yEnc stuff, another version is coming out. And then they talk
>about revering back to uuencode until it's stabilized :)

A complete new encoding (and even yEnc-V2 - or true binary transport) 
would be subject to a more general change for Binary Usenet.

I dont know when this will happen - but if it happens (ever) then 
this would be the next time to update all users/admin out there.
And if it would solve the remaining problems of Usenet
(completeness, growth, reposts, price) then users will love it.  :-)

-- 
Juergen

Re: [yEnc] some newbie questions
#57032
Author: those who know me have no need o...
Date: Tue, 05 Mar 2002 02:54
17 lines
1610 bytes
<04477.k22202@archiver.winews.net> divulged:
>Russ Allbery <rra@stanford.edu> wrote:

>>Compressing any of the standard binaries that you normally see on Usenet
>>will actually make them larger.
>
>Of course the yEncoder has to detect if compression makes sense.
>A compressor which is not able to detect that the result is larger
>than the source is not worth thinking about.

so the encoder will keep a couple of hundred megs around to see if, when
all is said and done the compressed+yenc'd version was reduced enough to
post?

-- 
okay, have a sig then
Re: [yEnc] some newbie questions
#57033
Author: those who know me have no need o...
Date: Tue, 05 Mar 2002 03:00
12 lines
1330 bytes
<30398.q22204@archiver.winews.net> divulged:

>First NNTP must be extended to permit true binaries.
>Then the message format can be changed to use it.

once the former is done the later is moot, 8bit mime articles would require
no content-transfer-encoding, so even the overhead of yenc could be
dispensed.

-- 
okay, have a sig then
Re: [yEnc] some newbie questions
#57034
Author: The Archiver
Date: Tue, 05 Mar 2002 07:05
27 lines
1979 bytes
those who know me have no need of my name <not-a-real-address@usa.net> wrote:

>>Of course the yEncoder has to detect if compression makes sense.
>>A compressor which is not able to detect that the result is larger
>>than the source is not worth thinking about.
>
>so the encoder will keep a couple of hundred megs around to see if, when
>all is said and done the compressed+yenc'd version was reduced enough to
>post?

I am not a writer of compression software.
But from what I've seen in third party source code every good
compressor is working on blocks of information.
And if the compressed result wuld be larger than the original source
then they save a "special token" which indicates "raw, uncompressed".

So if someone would like to use compression on a splitted yEncoded
binary then the posting program would select the data-block (100-900 kBytes) 
from the source, run the compressor on it - and then run the encoder 
on the result of the compressor. Then it is not important what the
compressor did make out of the source bytes. But they should no be
longer than the source (except of a token which indicates 'uncompressable').

-- 
Juergen

Re: [yEnc] some newbie questions
#57035
Author: A Meowbot
Date: Tue, 05 Mar 2002 07:23
29 lines
2588 bytes
those who know me have no need of my name wrote:
> <30398.q22204@archiver.winews.net> divulged:
> 
> >First NNTP must be extended to permit true binaries.
> >Then the message format can be changed to use it.
> 
> once the former is done the later is moot, 8bit mime articles would require
> no content-transfer-encoding, so even the overhead of yenc could be
> dispensed.

I know that the news community suffers from a severe case of NIH (else 
there would be no yEnc in the first place), but the reader protocol 
problems (not talking about transit here, that has very different 
requirements) being described in these threads such as separating 
content and transfer encodings, and resuming downloads, have already 
been solved in HTTP.  Wow, that was a convoluted sentence.  This most 
certainly does not require the use of HTML or browsers, just the 
protocol would be of interest.

There are nice, obvious ways to map the interesting NNTP commands onto 
GET/POST, the various state preservation problems are addressed, and the 
auth standardization problems have already been visited.

While HTML isn't what's wanted, XML does offer an interesting way to 
address the shortcomings of NNTP's various header retrieval commands.

No need to get worked up over backward compatibility, since binary 
transfers are going to utterly break that anyway.
Page 3 of 3 • 110 total messages
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads