Ignoring feedback as the root of most modern problems

December 9th, 2022

I might sound as a sidekick to Captain Obvious but some things are needed to be said again and again.

Life in its entirety is built on a feedback loop: if you react on external conditions to maximise positive output you’ll survive; it’s not just evolution, individual organism also would die if they don’t search for food when they’re hungry and don’t flee from danger. But when you have large systems with some resilience, some of the feedback may be ignored for some time. And sometimes all of the feedback gets ignored permanently and that is the start of that system downfall. It has happened before the humanity (dinosaur extinction most likely happened because they were unable to adapt to the changing conditions—because they could ignore the changes until it was too late so they were mostly replaced by more agile animals) but here we’ll review human-made systems (mostly social and political) and failures of those.

Essentially, the cycle works like this: at first a system emerges (or is created) to fulfil some purpose, it grows large, then it starts getting optimised for a target different from the initial one, and when the differences between its initial purpose and the goal it serves grow large enough for that system to face an uneasy choice—get reformed or get eliminated. This happens because the feedback from the wrong decisions at stage three (optimising for a different target) get ignored. So let’s start with reviewing how this happens.

You probably have heard about Goodhart’s law (and if not, it’s a shame) which essentially says that if you optimise something only for a certain metric, that metric will stop mattering. To give a technical example from the area I know: there are various ways to calculate how close lossy-encoded video is to the source and the higher the value of such metric the better video should look to human eye. So far so good, right? But every metric can be manipulated and some researches found that by applying some preprocessing the popular VMAF metric can be improved while the picture quality may feel degraded (it’s not purely theoretical, here in AV1 encoder source there’s some code based on their earlier ideas). Also I heard an anecdote about Korean researchers making an AAC encoder based on neural networks that gave excellent PSNR while sounding like garbage to human ear. Now that you have an idea on how it works, let’s move to less quantifiable things.

I can’t say I understand modern economics well, but essentially in the old days companies were supposed to bring profit by providing a product or service better than the competition (in the best case by being a monopoly). Then the companies became too large to be owned by one guy or family (there are exceptions of course) so the goal became to increase the worth of the stock that shareholders possess—by increasing its market value. Again, initially such stock prices were tied to the easily quantifiable things like assets, income and profit; now it’s more about expectations of growth. Somebody from the past simply would not understand how a company having losses for years still has its stock growing. My cynical view is that it works as long as there are enough people willing to believe that it works (which is also the case with modern economics in general IMO).

Now let’s look at the forms of government. Usually there are no clear goals in either of the systems and people often can’t predict the consequences of their actions (and when they can, they’re not willing to). And there is the usual human tendency to make things better for oneself no matter what consequences it bears for the others. Thus in order to keep system vital you need to get feedback from the people (even if it’s just to know where to send forces to squash rebellion like in today Iran). That’s why China keeps several systems (party members, state security and the state news agency) to report stuff from the regions to the centre. That’s why Winston Churchill said that “democracy is the worst form of government except for all those other forms that have been tried from time to time”. Voting in sane(r) countries is a way to keep the authorities informed about what people want (even if the results of the voting are ignored afterwards). IMO the system could be improved by having a test on the basics (e.g. what parties are out there, what are their governing principles and key points of the programs—just to make sure you make a conscious vote) and account votes of those who passed the test and not separately (in order to do what the concise people voted for and if they’re indecisive—do what the majority wants). But of course such system can be exploited (plus it’s somewhat harder to implement) and we have Gresham’s law in action here (a voter is a voter and any populist would prefer a thousand people voting for him out of tradition to ten people voting because he served their interests but who might not vote for him the next time). The cases of what happens when feedback is ignored will be reviewed a bit later.

Now let’s have a look at social networks. From what I see, originally they were created to attract people by connecting them based on some feature (and make money off them of course). With the time though the goal has mutated to attracting advertisers and selling them audience based on some features. I’m not going to describe what tricks are used to make users behave in the way advertisers like the best but it seems to turn users off those platforms.

As we got to the point where not taking feedback into account has led us to a crisis, there are three possible outcomes: keep ignoring the feedback (aka Soviet Army approach), try to manipulate the metric in hope that it will improve things (shamanism) or do something to the reality to make it conform to the metric (Froogle approach). If you think that taking feedback into account is a possible option too you are an incurable optimist.

Ignoring feedback altogether is a rather simple thing to do. If you don’t like something just call it fake news or enemy propaganda and be done with it. Why I called it Soviet Army approach? Because for me it’s associated with the tradition that was common for the commanders in russian empire, USSR and current russia: keep doing what’s ordered no matter how pointless it is. There are jokes about e.g. painting grass green and asphalt in dark grey to conform the rules, but considering all the variations of it I’ve read in the memoirs and heard from people who served in Soviet Army I doubt it’s merely jokes. Similarly we can see how in this war russians are attacking Bakhmut (or Sieverodonetsk earlier) and how they made Chornobaivka a legend. Denying reality just prolongs the inevitable.

Manipulating metrics is another step, where you hope that by cooking the books and rigging the process you’ll get the desired outcome. As Richard Feynman said, nature cannot be fooled—but what about people? Maybe if we report that the majority supports us the majority will think they’re supporting us because everybody else does? This starts with rigging elections and ends with russia where the only feedback taken into account is what the führer wants to hear, so the election results are always falsified to have the ruling party get the “convincing” majority of votes, opinion polls are treated by population as “the authorities sent me to ask if you’re satisfied with everything, yes or yes?” and it is widely speculated that only good news about the war get to the führer-in-the-bunker (unless they’re too hard to hide, then they’re greatly delayed as it happened with their cruiser, fleeing Kharkiv region or Kherson). In theory this approach may work in some cases where you act in a system powered mostly by human beliefs and you have factual information yourself, otherwise it causes more damage than the previous case.

And finally we have the case where you not merely reject feedback from reality but rather try to force reality to give the feedback you want. I called it Froogle approach after one story (sorry, can’t find the link): when this search service for products on sale was still in development, the team encountered a case where a certain irrelevant product (a garden gnome) was showing up in the results for completely different things. No matter how they tuned their algorithms, it kept showing up—until one day one guy from the team went and bought it thus removing it from the search results. This is also reminding me of the final chapter of The History of One Town by Saltykov-Shchedrin where a satirical depiction of Arakcheyev sees a river on plains that does not fit into his world view and decides to remove it by filling it with rubble from the demolished town (he wanted to build a military-agricultural colony on its place anyway). As you can imagine, it worked for about one day and then the river found its way again. The famous whipping the sea by Xerxes the Great probably belongs here as well. Depending on the resources you have (and against what you fight) it may work out or not—but it’s fun to watch from afar (from close distance though it’s a horror).


We learn from the mistakes (preferably not made by us) and feedback is a very important part of that learning. Pain tells you that what you’re doing is hurting you and you’d better stop doing it, that’s how children learn not to grab hot objects and pointy things. Sadly nowadays in many cases you don’t suffer from the consequences of your mistakes (because the society values individuals a bit too much to allow that) and in some cases it leads to tragic results. Even worse when it happens to the whole countries (because Wesphalian sovereignty is an international counterpart to humanism).

In 2008 russia started a war on Georgia and what was the reaction? The famous EU report that stated essentially that the conflict happened and they don’t know the reasons behind it and can’t verify the claims of participating parties. A year later Obama government started with resetting the relationships. As the result it empowered the aggressor to do more of the same in the future (1938 called and sent its greetings from Munich).

In 2014 russia started essentially the Third World War (I wrote on this opinion of mine) by occupying Crimea and fighting in the East Ukraine using puppet “people republics” (like soviet russia did in 1917-1922). What was the reaction? Essentially it boiled down to “bad russia, don’t do it again—and you, Ukraine, should reconcile” (plus a couple of rather formal sanctions to show some concern). And in the same time russia tried to use its gas as a leverage (not for the first time though and not for the last). Baltic states took the hint and made their systems independent from russia: there were LNG terminals built and new legislation for controlling gas suppliers was passed (like requiring minimum storage fill level). Germany did nothing and as the result it met the second phase of war with near-empty storages (belonging to russia) and no means to transport gas but the pipelines from russia (mostly owned by guess which country)—all against the Directive 2009/73/EC. To me this alone is enough to start investigating Merkel (and preceding) government for high treason, but we all know this is unlikely. The lack of punishment for acting against national interests and in favour of another country will encourage others to do the same (see Scholz and China). And there’s still an issue of Hungary and its well-paid affection to russia…

The situation in the USA is not much better as both parties do not want to recognize that people might have a reason to vote for their opponents and it’s not just russia/China/big tech meddling with the elections. And instead of thinking what can be done to win more voters the parties mostly pass the blame and try to turn their views into a small religion. Also I find the calls to disregard the laws because the other party “cheated” rather disturbing. Thanks to this other countries see America as a laughing stock and, more importantly, withering power and expect to occupy Ukraine, Taiwan or Syria without repercussions.

I want to end this rant with a passage from Going Postal that resonates with me:

You see, I believe in freedom, Mr Lipwig. Not many people do, although they will of course protest otherwise. And no practical definition of freedom would be complete without the freedom to take the consequences. Indeed, it is the freedom upon which all the others are based.

Looking again at LSVX

November 29th, 2022

Recently Paul B. Mahol asked me to take a look at LSVX codec (aka Lightning Strike Video Codec from Espre). Since the guy is working on Bink2 decoder for all of us, he deserves some respect. So here’s what I found.

Previously I took a glance on it, found that it’s based on tmndec 3.0, kinda the reference decoder for H.263 and concluded it is an ordinary H.263 rip-off and hadn’t looked further. It turned out to be more interesting though.

LSVX frames start with 5-byte header where the second byte tells the frame type (0x01, 0x08 and 0x09 are for normal frames, 0x05 is from skip frames; additionally if the first two bytes of the header are 0x78 0x01 then the header is followed by another eight bytes, usually with “lsvxv2.0” in them). Then almost normal H.263 stream follows—at least on a prolonged glance it seems to be the standard H.263 stream without any modifications of the headers (except maybe in motion vectors decoding). But there’s a catch! Key frames may have picture type 7 (reserved code in the standard) and then they’re coded with wavelets.

The wavelet coding is rather straightforward: you have a picture split into many bands, each of them is quantised and coded with a semi-adaptive binary coder. By that I mean that it uses models with fixed probabilities but it selects different context for different bits depending on previously decoded bits and in some cases the entier sets of probabilities may be switched mid-decoding. Beside that there are no special tricks like zero tree coding or fancy coefficient prediction.

Maybe I’ll write a decoder for it after all.

Looking at KQ6 Mac videos

November 25th, 2022

The terrorist country proves that it is recognized as one and keeps targeting civilians instead of fighting a war. So nothing new but it would still be nice to see its demise soon. Meanwhile I keep doing small things to distract myself from all this.

Since I have nothing better to do, I watch reviews of various games including the ones I know well. And one of those reviews mentioned that Macintosh version of King’s Quest VI: Heir Today Gone Tomorrow had peculiar intro. Actually every version of the game has something peculiar about its intro: DOS version uses Sierra’s own RLE-based SEQ format, Windows version uses standard MS Video 1 in AVI (it was my first sample with palette change messages), Amiga version is a reimplementation by Revolution Software on their Virtual Theatre engine altogether (maybe ScummVM will support it one day for all three and a half fans waiting for that). So, what’s with Macintosh version?

First of all, the files are QuickTime movies in the original Macintosh format where frame data is stored in the data fork and movie header is stored inside the resource fork. Since not all modern OSes support such files natively (or conveniently), I’ve hacked a support for such movies in MacBinary format that keeps all forks in one file. And what do we have inside?

Inside the files are video streams packed with Cinepak. One of the peculiarities is that they have palette specified in video header in the format different from the conventional MOV color atom format, let alone the fact it should not be present at all. I understand that for Cinepak and even more for Indeo 3 (I really should write an encoder for it one day) it was common to provide a palette so they rendered their output for 256-colour mode but in that mode Cinepak simply coded palette indices and here we have YUV420 output and a palette as a recommendation.

Then there’s a fun case with tracks in KQ6Movie. I understand that they split video and coded it in several tracks so they could use different palettes (and framerates as it turns out) for different segments. And those tracks are not in order. Tracks 0 and 1 seem to be the very beginning, track 2 corresponds to a scene somewhere in the middle and track 3 is the last intro scene. Other ten tracks are not in order either. Maybe there is some information hidden in the header telling the order but I’m too lazy to find it out (let alone implement).

All in all, this was unexpectedly weird.

RV6: a blast from the past

November 8th, 2022

So while various terrorist states try to prove they have better industry than russia, here’s yet another fun distraction.

It turned out that Peter Ross for some unfathomable reason decided to take a look at RealVideo 6. RealPlayer™ has RV11 support (which is FFmpeg with wrappers for calling their proprietary encoder and decoder for RV11), he played a bit with it. And since there’s one opensource decoder for RV6 (should be obvious which one), he contacted me with a list of changes to make it work fine not just on the only sample I had. Many thanks for that!

Beside various small mistakes there are several things that are rather curious:

  • RMVB container version 2 supports 64-bit offsets. Now all is left is to find a person willing to create RMVB files over 4GB in size;
  • chroma motion compensation case (¾,¾) is the same as (¾,½);
  • loop filtering formula was changed from |p0-q0|*lim1 < 512 to ((|p0-q0|*lim1) & ~0x7F) <= 384. They should be equivalent (even if I can't bother to prove it) but the change is still baffling;
  • and it turns out that delta quantisers are once per CU instead once per one row. More about it below.

So what's the deal with delta quantisers? When I REd the code, the binary specification had all debug information left inside. So when you see a function named Decoder::parseBitStream_CUOneCULine() that calls decodeCUQPOffset() once before calling decodeAndReconstructCBTree() in a loop you'd presume it reads DQP once per one row of CUs yet it turned out to be one DQP per CU (also reasonable but not what you expect from the function name). The thread management code that sets various parameters for slice decoding and calls the function is too messy to figure out parameters from it (I tried and got a number of 4 CUs per call unless it's at the end of row—which is obviously wrong).

It's nice to see that RealVideo 6 keeps up the traditions of previous RealVideo versions.

Denazification, or the story my divorce from russian culture

November 4th, 2022

This is another story that I simply had to write. It may be fun to seek parallels between this and free services of a certain privacy-invading company but the only common points there are that I stopped using them out of disgust and the company helped to make the process easier. So far no matter what it did it hasn’t done even a minuscule amount of harm russia did (and does) to Ukraine and the rest of the world.

So I’m finally writing about russian culture not in general but applied to me. Short summary: I grew up in both russian and Ukrainian cultures and I didn’t hate either, yet there were always some things in russian works that rubbed me the wrong way and I had been slowly drifting from it even before russia demonstrated what a loaded deal it is.

A bit about Kharkiv

Let’s start from my birthplace. I was born and spent two thirds of my life in Kharkiv, the large cultural centre of the East Ukraine. It was founded about four hundred years ago in a territory of border Cossack forces called Slobozhanshchyna (the word comes from the word “freedom” BTW). Kharkiv grew up a large trade and industrial city. First private bank in russian empire was founded there and the best known Soviet tank (along with several others) were designed and produced there, to give just two random examples. It was equally powerful scientific and cultural centre as well—all three Ukrainian Nobel laureates studied at Kharkiv University (which is over two centuries old), and a plethora of people who made great contributions to the Ukrainian culture, from from Kvitka-Osnovianenko to the group known as Executed Renaissance to the modern ones like Serhiy Zhadan (I have actually seen him once at our Literary Museum). There were people living in Kharkiv who later moved elsewhere to make great contributions to russian culture as well (actors, singers and even the scriptwriters of the best Soviet comedies).

As you can see, my home city had a lot to offer. And I sampled a lot of it like visiting a six dozen of different theatres (half of them repeatedly) but more about it later. The main negative property of Kharkiv is being located in less than 50 kilometres from the russian border (and it shows).

My early years and language

Anyway, let’s move to my childhood. I was born in a russian-speaking family, everybody was speaking russian and we had just one topic in school taught in Ukrainian (which is, not surprisingly, was Ukrainian language itself). Side note: during that time the Ukrainian grammar was reformed to make it closer to the actual Ukrainian language instead of russian, for example the letter “ґ” was reintroduced back into Ukrainian language (it’s called “Wallachian g” and used mainly in loanwords that have a sound different from real Ukrainian ‘g’). Yet despite all that people had nothing against Ukrainian language, I used to listen to the radio station “Промінь” that had various kinds of music in Ukrainian (and some retro music in russian as well), I read children magazines in russian or Ukrainian depending on in which language an issue was available (you can guess why Ukrainian periodicals often had versions in two languages; the same applies to books). It was the same in my university years: mostly people spoke russian and we had only two subjects taught in Ukrainian (Ukrainian history and Ukrainian language for business letters). So I could observe it myself that most of the time people spoke russian but nobody was against Ukrainian language (only complaining about not mastering it). The only time I heard somebody saying that she hates Ukrainian language was in Luhansk region…

I had relatives in Luhansk region, my grandparents were from Borivske village and they lived in Lysychansk. Of course I stayed with them in summer and heard different stories about the region. For example, during German occupation in 1940s German soldiers had better attitude to the locals than collaborators (my grandmother remembered how one of them commented it in broken language—”a russian beats brother, what idiot”). My grandpa was involved in building Sieverodonetsk Azot (the large producer of nitrogen-based compounds that became infamous this spring). He said that it started as a German chemical plant that was dismantled and rebuilt in two several sites, namely Sieverodonetsk and somewhere in east russia (maybe Kemerovo but I can’t be sure). Later it was expanded using an equipment bought abroad, so my grandpa worked with prisoners who were laying bricks for the future production sites and with Japanese experts overseeing other construction works. It seems to be a common story when russian or Soviet industry is built by foreigners and prisoners (sometimes they’re the same people). And it demonstrates the problem planted by USSR: since all those large construction works in Donbas area were performed mostly by prisoners, those prisoners had to be brought from somewhere (which means russia) and they were left there afterwards, creating an alien element. That is why this region had the population that refused to speak anything but russian and well-developed criminal culture culminating in yanukovych, the fourth president of Ukraine who still had manners and jargon of an ex-con, and his cronies from Donbas who helped him to rob the country—and a bang in 2014 when Ukrainians got finally tired of this and russia showed its true colours by occupying Crimea and sending people to start an uprising in Donbas. And yes, the pretext was oppression of russian-speaking population (which is probably was a need for them to learn even a bit of Ukrainian). Mind you, that person who said that she hated Ukrainian language was not speaking the perfect russian either. This reminds me also of French language attitude but I’ll leave comparisons of France/French and russia/russians to another time.

The slow move from different kinds of russian culture

That was all mostly about the language itself, what about the other aspects of culture: books, music, plays, mass-media? I’ve written already about radio station I’ve listened to but what about the rest?

Television

As for TV, I watched mostly humour shows (in russian, Ukrainian and even surzhyk which is a mix of both). One of my favourite shows was КВН (“a club of witty and clever ones” which grew out of student sketch shows and competitions where people asked random questions and others tried to answer with a witty response), which had a lot of Ukrainian teams as strong competitors and they even were winning tournaments more than once (two of those teams had a guy who became a famous and comedian, you might’ve heard about Volodymyr Zelensky). In the mid-2000s though the show degraded as it was no longer possible to joke about politics and everything in the show now essentially belongs to the host and his family (not just a trademark, broadcasting rights and the building where the shows are performed, teams wanting to perform in the show have to sign a contract making them virtually slaves)—and considering that this guy is over 80, tries to pretend to be young and shows no desire to leave, it feels like a history of modern russia in a nutshell.

Back in the day Ukrainian TV features a lot of russian soap operas (half of them being the local version of telenovelas and another half being about cops or criminals) and a good deal of them was shot in Ukraine because it was cheaper (in the same way as iconic American movies were shot in England). Once I’ve caught a bit of it while switching channels and acting was so bad that it made me want to puke. So I haven’t missed anything good by not watching them either.

Anyway, I’ve stopped watching TV completely around 2005 out of disgust. Advertisements may be annoying but when the same programme is interrupted with advertisements in five minutes after the first time, it’s too much. So I turned TV set off and haven’t regretted that since. I suppose I should thank certain Ukrainian TV channel for that.

Music

As for the music, I prefer instrumental music that is couple of centuries old (German baroque music played on harpsichord or organ is the best). I heard enough russian composers but I didn’t like their music (except for Glinka for some reason). Ukrainian traditional music, played on bandura, kobza and dulcimer, somehow resonates with my soul though (it was performed sometimes at our philharmonic). And out of many theatres I’ve visited, the russian drama theatre was the one I liked the least (not the repertoire though but the attitude to the watchers). So I’m mostly into classics yet there’s one Ukrainian song from my home city that I know by heart (and it sounds equally good both in russian and Ukrainian).

See, I haven’t had to stop listening to russian music because I haven’t listened much to it in the first place.

Literature

It’s not that I like reading, it’s more that I can’t live without it. We had all kinds of books at home, from russian classics (including two or three complete sets of works by Pushkin) to modern science fiction (including both books by Strugatsky brothers, works by foreign authors and even some science fiction in Ukrainian by local authors). Later I learned other languages and I’ve read a couple of books in each language I know (and probably couple of hundred books in English). I value content and ideas over the presentation so I can forgive some problems to a book if it’s an interesting reading (and not written by a completely illiterate person). Books in russian are plenty and easy to get access to in electronic form for free (and not even via means of piracy) so no wonder I mostly read those. The problem is that many of those books have issues with quality and they get worse every year.

One of the main problems is declining literacy: while the books are still being written, they’re written used poor language (limited vocabulary, primitive sentences, words used at random, lack of punctuation) and the topics are not good either. And it’s increasingly hard to find decent books among the thousands of mediocre and outright bad ones (yeah, like with the information in Internet).

Here’s a short review of the most popular russian genres of fiction (the ones I’ve heard of, most of them I’d rather never touch but reading comments on such works was sometimes entertaining):

  • “ironic detectives” (it’s ironic to call them detectives)—pulp fiction oriented at women and produced in bulk (I still remember when you could rent such books for a nickel per day at some stalls). Considering that the best known author (allegedly) wrote over 250 books in two decades, you can guess how good they are. Pass;
  • “female fantasy” (again, a genre of its own). Comes in three flavours: a young woman gets to study at some magical school where she marries a dean or a prince; a woman in fantasy world gets what she wants (often marrying a prince) by chutzpah; a woman is a wealthy heiress or possess special qualities which makes several powerful males (not necessarily humans or elves, dragons are popular too) compete for her hand. Pass;
  • action—often features weapon porn (where a good deal of book is dedicated to the weapon specifications and what accessories are attached). The stories are usually primitive as it’s more about the amount of enemies killed and women courted with. Pass;
  • popadanets genre (or isekai if you prefer it)—stories about somebody from one world transported/teleported/reincarnated into another (or the same but in different time). By itself it’s a good tool to show a conflict of traditions and beliefs for somebody put into an alien environment. A Connecticut Yankee in King Arthur’s Court is still being read today and Futurama is still fun to watch. The problem is that in russia it degraded into two template stories: a Marty Stu with extraordinary abilities grows riches and harem or somebody gets into the past and does whatever needed to prevent russian empire from collapsing/taking losses in World War II/USSR dissolution. There’s even a saying that every popadanets should warn Stalin about German attack, invent intermediate cartridge and two-hatch version T-34 tank, and sing Vysotsky songs (yes, it’s that formulaic). There were some interesting books there but it’s very hard to find them among the rest;
  • alternative history. The same notion as above: something in russian history does not happen (or happens differently) which leads to russia (in either form) to grow even stronger and larger and to take revenge on real and imaginary enemies. Pass;
  • fantasy in boyar-anime stylistics. This is very alternative history with a setting involving russia staying in feudalism with boyar clans keeping power by having large magical talents (like shooting lightnings or sending storms on their opponents). You can guess from the name where they got some of the ideas. Pass;
  • various “historical” “research” books trying to convince the reader that Stalin did not plan to wage a war and the fact that Soviet Union had very large forces concentrated near its (newly created) borders in June 1941 is just a coincidence. Yuck;
  • the literary RPG genre of (sciency) fiction. The settings are usually either virtual reality MMORPGs where characters spend most of their lives (or even serve their prison sentences) or even “real-world RPGs” where something (nanomachines, son!) re-creates the system with RPG characteristics, levels and skills in the real world. Few adequate books are buried under the tons of usual Marty Stu fantasies and books mostly full of main character game logs and stat sheets printed after each update;
  • there were also series based on a predefined setting of two games, namely S.T.A.L.K.E.R. and Metro 2033 but it’s best to be left to the equivalent of Star Wars Expanded Universe fans.

I’ve missed something for sure (like books in more traditional genres) and there are exceptions but here are the reoccurring themes that turn me off even in more reasonable books:

  • jabs at other nations, sometimes not merely chauvinistic but gratuitous too—it’s one thing when a brave russian protagonist uncovers a plot by evil Britain against his country and another thing when a brave russian protagonist encounters some Ukrainians without any reason and they start insulting him, still without any reason, and when this episode ends it gives absolutely nothing to the story;
  • normalised prison traditions. I’ve written before that it seems to be the only natural part of russian culture (and the rest was invented to bind the empire together), a lot of people in russia believe that you’re not a Real Man™ unless you’ve been to prison, so of course it gets reflected in the literature. It’s not that uncommon to see protagonists enjoying speaking prison argot, to give one example;
  • resentment and revanchist feeling (just look at how many books are about fixing something with the russian past);
  • and finally, the attitude to plagiarism. For example, protagonist has some knowledge (technical or art), passes it as his (or her) own inventions/writings without having any regrets. Bonus points for having such protagonist offended when somebody else does the same with his (or her) stuff. I dropped reading one of the books in disgust after the author copied a well-known humoristic piece verbatim without giving credit.

Again, previously I could write these deficiencies off to the skewed views of individual authors. Now russia demonstrated to the whole world that chauvinism, resentment and thievery are the main virtues there. So why should I even attempt to read new russian books that cause only revulsion and disgust? Why should I read older russian books if they’re either the same or about the topics I have no interest about (i.e. russia and russians). And considering that most of the russian classics were imperialists and chauvinists why should I read them too? Fun fact: back in 1930s during Ukrainisation movement (started by Soviets to make their rule accepted by local population and cut off when it was no longer required) those classics were against their works being translated into Ukrainian (probably culminating in intelligentsia from Leningrad protesting against “traditionally russian” operas being performed in Ukrainian, including Aida). As for the foreign books translated into russian, considering the usual poor quality of the translation it’s better to find and read the originals.

Books were my main connection to russian culture, and this connection is being cut mostly without any efforts on my side. At least there’s enough good literature to replace it. If this makes you think about Nord Stream pipelines, it’s only because there might be something in common here.

Movies

russian movies suffer from the same problems as russian literature. Additionally since shooting a movie is not cheap (in general), one of the important parts of the process is securing funding and finding distributors. Because of certain peculiarities of russian political and economical system it essentially devolved into a system where a cabal formed from large studio owners (that may also act as directors and producers) “help” russian ministry of culture decide which movie to sponsor (usually one of their own). And they use their connections to advertise those movies in prime time on state media channels (or in some cases convincing that the movie should be mandatory to be watched by e.g. children from elementary schools and the orders are made at the ministry of education). The rest of the movies are usually something targeting lowbrow audience to be commercially viable.

As somebody put it, Hollywood movies are for making profit and all about the box office and russian movies are all about securing funding. Unlike Hollywood accounting where the idea is to make movie bring profit without paying taxes, here it’s like in The Producers—make a flop so nobody questions where money for production really went to. That’s why pitching the movie, actors lying how fun it was to shoot and exaggerated advertisement claims are usually the best part of those movies.

Are there exceptions? Yes, but most of those movies are either about criminals or depressing life, sometimes both. And the remaining couple of movies that are clever satire on russian reality I’m not going to re-watch because it’s still about russian reality.

Video games

I don’t play games much and when I find time for them it’s usually adventure games. I’ve made a short review of the games I’m aware of (or played myself). Some of them were actually decent (as they were made before the time when they started make and publish any garbage) but I’ve not played them for a long time and it won’t be hard not to play any them at all.

Internet media

Here the situation is rather simple: most of the sites I visit are in English and at the start of the war a lot of russian sites I visited closed in protest (some may have reopened since but I’ve learned to live without them). The main loss is a webcomic called Depth of Delusion (a deep passionate parody on popular movie franchises with toucans on top). Its author was from Chernihiv so in the best case he simply lost any desire to write it on a russian site (as he said in his last post) and in the worst case he lost his live during the initial state of the 2022 invasion.

As for the videos, I had no interest on what their bloggers can tell me about the russian lifestyle. I watch mostly the videos with humorous reviews of the movies or TV series (so I both be entertained and keep informed about what’s going on). Due to sanctions some of them went to greener pastures (i.e. video hostings that still pay money in russia), others disappeared entirely, yet another one made claims that made me stop watching them out of disgust (those claims may be either outright nationalistic or weaselly shifting the blame from russia). So the amount of channels I’m willing to watch is shrinking steadily and will reach zero eventually. Another thing is that considering the current situation I’m not eager to learn about new russian movies and how awful they are (I’ve explained above why they are) and I can find out stuff about foreign movies from native reviewers.

Meanwhile there’s a vast amount of channels in English offering content good enough for me. And there’s this catalogue for Ukrainian channels which helped me a lot.

Conclusion

There’s a phrase from Soviet times: I’ve not read Pasternak but I condemn him. My situation is opposite: I grew up in a multicultural place with a strong dominance of russian culture and have learned a lot about it. Nevertheless, I had alternatives to choose from and since I have some tastes (I’m not going to claim they’re all good, but they’re there) I don’t mindlessly consume everything but rather pick what I find interesting or entertaining and while I try something new in order to escape filter bubble, there are some things that would make me reject them immediately. And russian culture is one of the things the more you know about the more revolting it is.

As I wrote before, russian culture is an artificial thing created to bind the empire (be it called empire or USSR, doesn’t matter). Initially it was enforced by power (by both suppressing local cultures, including Ukrainian, and leaving the opportunities to work only at russian narratives), later by money (Ukraine has lower reserves of oil, so a lot of Ukrainians moved to russia to get significantly larger payments for their work as actors, singers, writers or even producers). It would be understandable but the imperialist agenda never left it (even in Soviet times they dreamed about uniting the whole world under the wise rule of The Party and praised the leading role of Soviet Russia). So it turned into a mental poison that tries to convince the whole world that Ukraine, Ukrainian language and culture do not exist.

Previously I could ignore those narratives and pick up the better bits, but in 2022 russia demonstrated that those idiocies about defending oppressed russian culture are actually their guidelines and if you do not purge it from your country there may be russian tanks and missiles coming next to “defend” it (again, it’s russian-speaking part of Ukraine that suffered and suffers the most from russian invasion). Taking all this into account, consuming russian culture is like drinking from a spring in Makiivka (this source of potable water at occupied Ukrainian territory got viral a couple of months ago after somebody took a dump into it; considering that this is a thing a russian soldier would do, it’s a very appropriate symbol indeed). Maybe I’m not so smart to cut all possible ties earlier but I can take a hint.

Visiting multimedia grave

October 31st, 2022

When people ask why I call the search division of Alphabet Inc Baidu, I answer that I do it in spite to muddle their search index and mostly because they remind me of a Chinese totalitarian company. And recent news only reaffirm such views.

As you should remember, Baidu is famous for its graveyard for the killed projects—it even has a separate alley for the messenger apps. And looks like it prepares a plot under a concrete duck for burying some multimedia formats (which makes it interesting to me).

The history of multimedia formats at Baidu essentially started with the purchase of On2 and releasing VP8 in WebMKV format. Then VP8 was mostly buried since VP9 was created (some of it remains hidden inside WebP format), VP9’s turn is near since VP10 is here to succeed it (under the name of AV1).

In the recent news though it turns out that Chrome is deprecating its support for JPEG XL, a format developed mostly at Baidu and the only one properly standardised. But as we all know, Chrome currently controls the Web and removing support for it means that the format will remain obscure. Kinda like in a Soviet joke where a foreign tourist asks in a shop why there’s no caviar and hears that there’s no demand for it—and as he observed for a whole day nobody asked for it indeed (in case it’s not obvious people in the USSR didn’t ask for caviar at the shops because they knew it would not be sold there; see also Baidu Stadia).

And because it was not enough, people spotted that WebP2 has changed its status to experimental, meaning that it won’t be supported either.

So we have, VP9 buried in favour of AV1, JPEG XL being buried in favour of AV1F, WebP2 being buried in favour of AV1F (which is AV1 still frames in MP4) and the original WebP is likely to follow the suit. Now consider that AV1 is recommended to be distributed inside MP4 instead of WebMKV and you’ll fear about the future of that container as well.

I guess now all is left for them to do is to adopt Baidu Lyra as non-experimental codec to purge Vorbis and Opus not created by them and then bury it in favour of AV1-based audio compression. That would make a nice collective grave of formats killed by Baidu to make space for AV1.

So, do you know when AV2 should arrive?

A final look at SIFF

October 29th, 2022

This is a resource format (as one could guess from its name) used by Beam Software for various resources in its games. The first time I had to deal with it was when some anonymous contributor contacted me with a REd decoder for videos in Lost Vikings 2. I adapted for FFmpeg (wow, it’s been fifteen years ago) and added sound support as well.

Recently I decided to revisit it (previously I tried to adapt decoder for 15-bit video but could not make it exactly right for some reason). So I looked at it, it turned out to be exactly the same algorithm but depending on whether palette is present in the frame (yes, 256-colour palette with RGB555 entries) pixel data is read either as byte palette indices or raw 16-bit values. I also looked at The Dame was Loaded game and its FCP format turned out to use exactly the same compression but with a different frame format (16-bit sizes, different audio/palette/video order and so on). And the game audio uses packed 12-bit PCM (two samples without low nibble are stored in three bytes) which is not something you often see.

And with that I’m done with game formats for a long time. Probably I should write a toy encoder or two now.

Looking at Talisman animations

October 27th, 2022

While the situation in Ukraine is stable bad so I keep looking at game formats instead of playing those games instead.

Apparently there’s a German adventure game from mid-1990s called Talisman and that’s about all I can tell about it. Yet it seems to have rather interesting animation format that’s worth talking about.

It turned out to be codebook-based compression with a codebook shared by a group of frames (typically 20-30) and actual codebook being created from a transmitted codebook data mixed with the static codebook (an interesting fact: unlike many other game formats, this one not merely allows seeking inside, there’s a special chunk preceding group of frames with the same codebook that contains an offset of the next such chunk). Tile operations are either copying 2×2 tile from another part of the frame (optionally updating one pixel in it) or reading it raw.

While it’s not the most complex format ever it turned out to be interesting enough. And with that I’ve probably exhausted the game video formats to look at. I’ll probably revisit SIFF but that’s about it.

A quick look at PDQ2

October 21st, 2022

So there’s this new service discmaster.textfiles.com for searching for files from some old disks and discs at archive.org and out of curiosity I took a look at what it offers.

While it’s physically impossible to check all hundreds of millions of files it indexes (even just videos), I took a look at one rather curious category called aviAudio. There are about six hundred files of such type found so I decided to check them to see what kind of beast that is.

Some files turned out to exactly AVI audio files—AVI files with single stream that turns out to be audio (I don’t know why but this happens). The rest of the files were AVIs with unrecognized video track (just what I was hoping for!). One set of the samples come from some game with IPMA codec, other sources mostly feature Motion Pixels video (which is horrible both to RE and to support so I’d rather not touch it), one sample was special “codec” for some russian erotic game (which means complete garbage even by russian game standards) that is really just obfuscated Indeo 5. And finally there was a single PDQ2 sample (from some Incredible Hulk game demo from 1997).

An interesting thing is that it’s a DOS game with built-in AVI demuxing and decoding of this codec. The codec turned out to be a lot like various lossless codecs (so its FOURCC probably stands for something like “pretty damn quick codec, version 2”). It splits video into 4×4 tiles and emits up to three streams stored one after another: tile opcode (copy previous tile, copy previous data with an arbitrary offset, skip tile, raw tile), variable offsets and tile pixels. Additionally frame data may be packed further with LZ77-based scheme. As I said, a rather familiar scheme for lossless video codecs and it makes me wonder whether it’s a codec developed specifically for the game(s) or it was borrowed from somewhere else.

Another bunch of interesting game codecs

October 17th, 2022

While Iran wages a proxy war with Ukraine (and I can easily believe they’re not against doing it to the last russian), I’m still trying to distract myself by looking at various video formats in games I have no intention to play.

Finding games with unknown formats gets harder and harder (or at least more tedious). So here are two games with an interesting approach to video compression.

Dark Earth packs frames as separate planes with 5-bit components and each plane is compressed using a peculiar modification of LZ77 scheme: depending on a bit set, it either codes a run or a forward reference in either the same or previous buffer. Additionally it codes it using non-bytealigned stream (run mode is coded in 13 bits and copy mode takes 25 bits).

There’s also Defcon 5 game (the one from the mid-1990s, do not confuse it with a game with the same name but from a previous decade). This one employs a different method I don’t remember seeing anywhere else: painting squares. Of course you’re used to various codecs splitting tiles in blocks and filling them (from older codecs using quadtrees to H.26x and its rip-offs). This one does it differently though: there is a fixed set of tile sizes selected for each video (I’ve seen only 32, 16, 8, 4, 2 set though) and frame data is essentially a list of commands telling at which offsets to paint a tile of this size with a given colour (those offsets may be completely arbitrary). It may be not the most efficient compression algorithm but it’s quite interesting. Also the container specifies palette as fixed and changing colours—first part is stored in the header and the second part is transmitted with each frame. Again, it’s not something extremely effective but I can’t easily remember any other format doing it that way.

I’ll probably try to do something different next time but I consider time spent on looking at these formats well-wasted.