Stories
Slash Boxes
Comments

SoylentNews is people

Log In

Log In

Create Account  |  Retrieve Password


x86 CPU trivia

Posted by shortscreen on Saturday February 06 2016, @08:36AM (#1748)
7 Comments
Code

Recently I was reorganizing stuff in the basement and became lured into playing with some old motherboards I've been hoarding. (Speaking of old motherboards, let me just give a giant middle finger to those cursed Dallas RTC boxes (ST Micro made them too) Boo!)

I was running some memory benchmarks and a software 3D renderer. To test memory performance I used the block read, write, and copy instructions which are REP LODSD, REP STOSD, and REP MOVSD, respectively. When operating on large enough blocks, the cache(s) will miss on every line.

A bit of background...

A write-through cache only stores data that has been read. Writes always go to the bus, although the cache is updated at the same time if necessary.

A write-back cache, a.k.a. copy-back, only updates the data in the cache on a write. The data in main memory is only updated later, when the relevant cache line is going to be replaced. If a write occurs to a location which is not cached, there are two ways this can go. Either we write through (bypass the cache), or we load the data into the cache first so we can write to it there (this is called Write Allocate).

WA has the negative side effect of making block writes/copies slower, because the memory has to be read before then being overwritten. However, on modern systems with high memory bandwidth as well as high latency, writing an entire cache line in a burst is more efficient than doing a single write, so the downside of WA is mitigated. AFAIK, all x86 CPUs use WA going back to at least the Pentium II. Cache policy is configurable using MTRRs though, so that eg. video memory can be exempt.

One of the CPUs I tested is the Cyrix 6x86MX (running at 200MHz), which has non-standard MTRRs and an option to disable WA. The default setting by the BIOS, was Write Back and Write Allocate. Block writes ran at only 66MB/s. Using Write Through instead increased that to 100MB/s.

My 3D renderer, when showing a very simple model, spends most of its time on clearing the Z-buffer and frame buffer. Whereas showing a more complex model (80,000 triangles), nearly all the time is spent drawing. The rendering speed (framerate) of the simple model was faster using WT, but the complex model was conversely much faster using WB (.97fps vs .62fps). Now the interesting part... using WB *with WA disabled* caused both scenarios to acheive the higher performance.

Another important thing to note here is that I tested socket 7 boards with the VIA VP, VIA MVP3, and SIS 5582 chipsets. These support SDRAM but do NOT do write bursting. So writing 64-bits at a time is just as fast as writing a whole line. Hence a K6-3 at 400MHz has worse performance for block writes/copies than a Pentium II-400 with an Intel 440BX chipset. I think the 430VX with EDO DRAM even does a better job for block writes than those other socket 7 chipsets.

On a somewhat related note, while reading more about this topic online, I stumbled across AMD's software optimization guides for the Athlon and Athlon 64, wherein I learned a couple of tricks. Check out these two routines that do the same thing:

...
mov ecx,64
loopy:
lodsd
imul ebx
add eax,dword ptr [edi]
stosd
dec ecx
jnz loopy

...
add esi,256
add edi,256
mov ecx,-64
loopy:
mov eax,dword ptr [esi+ecx*4]
imul eax,ebx
add dword ptr [edi+ecx*4],eax
inc ecx
jnz loopy

The second one is a little faster on a Core 2 (maybe 10%), and much faster on an Athlon 64 (more than 50%)

James Reinders: Parallelism Has Crossed a Threshold

Posted by takyon on Thursday February 04 2016, @10:48PM (#1747)
5 Comments
Software

too-lazy-to-sub dept.

James Reinders: Parallelism Has Crossed a Threshold

Is the parallel everything era here? What happens when you can assume parallel cores? In the second half of our in-depth interview, Intel’s James Reinders discusses the fading out of single-core machines and the ramifications of the democratization of parallel computing, remarking “we don’t need to worry about single-core processors anymore and that’s pretty significant in the world of programming for this next decade.” Other topics covered include the intentions behind OpenHPC and trends to watch in 2016.

First half: A Conversation with James Reinders

Delayed Stories vs. Slashdot

Posted by GungnirSniper on Wednesday February 03 2016, @06:31PM (#1746)
28 Comments
Soylent

With the new ownership at the old green site looking to improve things there, I hope we have a similar discussion going on here someplace. My guess is it is happening on IRC. The underlying code seems pretty solid, so there isn't much in the mechanics I'd change.

One thing that concerns me is our delay in posting threads compared to them. It seems fairly consistent they have the first strike over 80% of the time when running similar stories. If you read both sites, and I'm assuming many still do, why would you want to re-read threads on a topic you saw earlier in the day or even a day or two before? Shouldn't our goal to be the faster, more intelligent version of a Slash-based site?

The news latest round of Yahoo layoffs broke yesterday evening, February 2nd. Slashdot posted the story this morning yet the story here is sitting waiting in the queue, and isn't going to appear on the main page until tonight. So if I want to comment, I have to either wait on it, or go post on the green site, or elsewhere. That's not what I want to do.

Progress, Of A Sort

Posted by MichaelDavidCrawford on Sunday January 31 2016, @04:24AM (#1743)
2 Comments
Career & Education

I took a shower this morning. I really needed one - I was getting pretty ripe.

Rather more significant is that I was waiting for the light rail, which was to come in eight minutes. I used that time to practice my guitar, also for a few minutes while waiting to transfer to a bus.

When I got to the homeless day center in Vancouver, a friend said that I was looking really good. I don't think it was just the shower but my entire demeanor. I go there to practice on their upright piano, but the last few times I went there, practicing just seemed like too much trouble. Not today - I practiced and I enjoyed it.

My next step is to wash my clothes and O do my clothes need washing. I'm not so bad now that I've showered but with the right wind conditions I can smell my own clothes. I have the choice to wash in the mornings in return for thirty minutes of "barter points" - typically sweeping the Portland day center floor - or in the afternoon for $1.50. It's my plan to sing on the street tomorrow, to raise the $1.50 for the laundry, also a couple bucks for coffee.

Today I feel - at long last - that my antidepressant is working to full effect.

Soylent's Fiction: The Muse

Posted by mcgrew on Friday January 29 2016, @09:52PM (#1741)
3 Comments
/dev/random

I received a strange note, made of cut up magazines pasted to paper and slipped under my door. It read “Your muse has been kidnapped. If you want her back, meet under the Facebook Street Bridge after dark. Bring your wallet, passport, and an umbrella.”
        Crap, my muse was gone? I looked, and sure enough it was missing. It's really important to me, so I got my passport, made sure my wallet was in my pocket, and took an umbrella, even though the weatherman said there was no chance of rain. I went to the bridge around sunset and waited.
        The weatherman was wrong. As I waited under the bridge it started pouring. A little after dark a black limousine pulled up, and the rear door opened. “Get in,” a woman's voice said. I did.
        A mean looking short haired blonde in the front passenger seat was pointing a very large black handgun at me. “You're not Neo,” the skinny dark haired girl in the back said accusingly.
        “Me?” I replied, scared to death. Or scared of death, maybe. “No, I'm mcgrew, I don't know any Neo. I'm missing some property and someone said to wait under this bridge and I could get it back.”
        “Oh,” said the blonde, putting the gun away. “Morpheus said to give you this,” and handed my muse to me!
        I put my muse in my jacket and started to open the door. The blonde had her gun out again. “Fifty bucks, asshole!”
        I gave her two twenties and a ten. “Why was I told to bring a passport?” I asked. The dark haired skinny girl laughed. “Morpheous was just fucking with you. Now get out!”
        I still can't figure out what that was all about...

16_02 Upgrade Musings

Posted by The Mighty Buzzard on Friday January 29 2016, @12:10PM (#1740)
19 Comments
Rehash

So, looks like the 16.02 site upgrade is mostly going to be a features upgrade rather than a bugfix upgrade, though there's some of that as well. There's one thing going in that there's an outside chance may annoy some people though: the new mobile layout. To be very clear on this, the mobile layout will be served to anyone with a horizontal screen (not browser window) resolution of 800 pixels or less. The only way you'll see it on your desktop is if you're still running 800x600 or lower resolution, in which case you really should get with the whole 21st century technology thing.

We're going to be doing the site upgrade the first weekend of February but if you want to give it a look early head over to https://dev.soylentnews.org/ and have a look around. Bear in mind we ain't foisting beta code on you lot with this, we're foisting pre-alpha code that took all of maybe half an hour to do up on you. This is not what the finished product will look like, it's just something to make life easier on mobile users while we write up something that doesn't suck. If it sucks too hard and you all bitch that you want the old layout back though, it's a matter of minutes to fix and revert until we have something worth calling a proper mobile interface.

Let me know what you think here.

Sensors, not CPUs, are the important smartphone tech

Posted by takyon on Thursday January 28 2016, @06:49PM (#1739)
9 Comments
Mobile

Sensors, not CPUs, are the tech that swings the smartphone market

Flash back a quarter of a century: I’m sourcing components for a consumer virtual reality system. An accelerometer is an absolute necessity in a head-mounted display, because it senses the motion of the head. Accelerometers exist in silicon, but priced at US$25 apiece, their only customer is the automotive industry - sensors used to trigger deployment of the airbags in a crash.

In the end, I invented my own sensor, because silicon accelerometers cost too much.

A few hundred million smartphones later, accelerometers and gyroscopes have become cheap as chips. Literally. From twenty-five dollars to less than twenty-five cents, the conjunction of Moore’s Law and Steve Jobs made these sensors cheap and abundant.

With many smartphones using high-quality accelerometer/gyroscope sensors, the groundwork had been laid for Google’s Cardboard - really no more than a cheap set of plastic lenses set at the right distance from a smartphone screen. Everything else about the Cardboard experience happened inside the smartphone - because the smartphone suddenly had the right suite of sensors to generate a head-tracking display.

Theoretically, Google’s Cardboard should give you the same smooth virtual reality experience as Samsung’s Gear VR. But it’s like chalk and cheese: Cardboard does the job, but it always feels as though you’re fighting the hardware, where Gear VR feels as comfortable as an old shoe.

The reason for that lies with the sensors built into Gear VR. Oculus CTO John Carmack worked with Samsung to specify an accelerometer/gyroscope sensor suite that could feed Samsung's flagship Galaxy S6 smartmobe with a thousand updates a second. The average sensors, on a typical smartphone - even the very powerful Galaxy S6 - won’t come anywhere near that.

Head tracking can only be as good as the sensors used to track the head. The proof of this is the difference between Galaxy S6 in Cardboard, and Galaxy S6 in Gear VR - try both and see for yourself.

This is one bleeding edge in the smartphone sensor arms race. Within the next eighteen months, every high-end smartphone will specify incredibly sensitive and fast accelerometers and gyroscopes. Smartphones work well both in the palm of your hand and when mounted over your eyes. Every major manufacturer will have their own Gear VR-like plastic case for wearing their latest top-of-the-line handset. Except at the very high end - the province of serious gamers and information designers - smartphones and VR will become entirely interchangeable.

[...] Back during the Cold War, the Soviets were caught out shining laser beams onto the windows at the White House, reading voices out of the reflections. The White House responded by pointing speakers at their windows, playing music just loud enough to drown out any other signal. We may need a new app for our smartphones, one that keeps just enough music piping out its speaker to confound anyone using our newly sensitive accelerometers against us.

I Expect to Have Housing Soon

Posted by MichaelDavidCrawford on Thursday January 28 2016, @12:23AM (#1737)
6 Comments
Career & Education

My case manager and one other mental health clinic staff member came to Portland to conduct a Housing Assessment for me. Mostly I signed forms to authorize that my psychiatric history be disclosed to the people that actually provide the housing.

It's not HUD Section 8, rather it is a branch of the same agency as funds my clinic.

I'm on the "PACT Team". I don't recall the acronym's proper title but I'm given to understand that everyone on the PACT Team is Extra Special. Most of the others I've met were pretty loopy. I've declined the housing in the past because I wanted that limited resource to go to them, as I felt the others needed it more than I.

I have the Boy Scout Wilderness Survival Merit Badge, see. My troop in Moscow, Idaho went camping once per month without any regard whatsoever for the weather. That was a little hard to take when I first moved there from California, but eventually I grew to enjoy camping in the snow.

Even so, I've been homeless for almost three years. I haven't been on the streets this whole time but when I was in a place, I was definitely a houseguest, not a resident. I figure I've given enough people my spot that I deserve a place myself.

Ironically I may be flushed for cash soon. It's not a sure thing in that it's consulting, it's not employment. If my code does not meet their written specification, then I don't get paid - I don't work through agencies.

It's not going to be easy work, but then if the job were easy, the client wouldn't need a consultant.

I was for a while stricken with terror over the difficulty of the work required. But many times I've told myself that I've done far, far more difficult work in the past.

When I was at Apple in '96 we had a "phase of the moon bug" that QA could not reproduce. The fourth time it was encountered, the bug was assigned directly to me rather than to QA. That is, I had no regression.

One week later, through Apple Developer Tech Support I advised Microsoft of the exact byte offset in Word 6's binary where their bug lay.

The old Mac OS - not really "Classic" but most people call it that, it was System 7.5.2 - didn't really have a proper concept of processes. When you called ExitToShell you could not count on certain resources being freed. Word 6 had a timer that reset itself each time it was fired. Under certain conditions, the timer was still firing after Word 6's binary was overwritten by some other data.

If I could isolate that problem then my present work should be a cakewalk.

We're not expecting my actual work to start until next week as their windows people had some problem they needed to work around. They expect I'll need to apply the same fix on OS X.

But back to housing...

They told me that six slots were opening soon, and that I was at the head of the line. I still have to wait, I don't think it will be long but those slots aren't actually open yet, also my application has to go through their process.

But both case managers were completely convinced I'm qualified.

I don't know what I do to deserve the TLC they give me, but I've had to insist that I pick up my prescriptions myself, at a regular pharmacy, rather than having them hand-delivered. I've also insisted on getting to the clinic on public transit, rather than being chauffered, despite that a long walk is required.

We've settled for them giving me a monthly bus pass. If I don't have to spend my busker tips on bus fare, then I can blow it at Starbucks while I look for work.

Finally, my depression is quite definitely getting better. Yesterday I shaved with a fresh blade. You might not think that's such a big deal but a very common symptom of my kind of mental illness is that one develops a "disheveled appearance".

I've spent a lot of time pondering my bearded, long-haired colleagues, realizing that I would look just like them soon, maybe I wouldn't be so welcome in some of the businesses I frequent. Maybe I wouldn't be able to pick up chicks. It's much harder to shave off a full beard than it is to shave off stubble.

I have a real trendy goatee though - have a look at my CNN interview on YouTube, the difference is that my hair is grey now. The goatee is a little longer than I prefer, and my hair is growing unkempt. It doesn't help to comb it, so tomorrow - if I can get myself there - I'm going to get them trimmed at the "Homeless Connect" event in Vancouver.

It's not that I'm not Aqualung, I just don't look like him.

Musings On The Quality of Discourse

Posted by NotSanguine on Wednesday January 27 2016, @08:18PM (#1736)
21 Comments
/dev/random

This topic has, perhaps, been discussed ad infinitum, ad nauseam. But I won't let that stop me. :)

I do understand that online forums aren't going to bastions of quality argument and rhetoric, especially given the temptation to go all GIFT when folks can be anonymous (or even pseudonymous). I've been guilty of that myself, from time to time.

One of the positives I've seen with Soylent (as compared with other places) is that, as a group, we tend to reward (via positive moderation) those who provide cogent, clear arguments and back them up with data to support those arguments.

AFAICT, there are a variety of motivations for submitting stories and posting comments:
An interest in discussing the topic;
An opportunity to promote their personal political bent/beliefs;
An opportunity to say things one wouldn't say in a meat-space conversation;
An opportunity to share one's sense of humor (such as it might be);
An excuse to troll (in the classical sense);
and many other motivations as well.

My focus is on the first two motivations I list. Making rational, fact-based arguments to support (or elucidate) a point of view often makes for interesting discussions which can illuminate a topic and create a positive environment for exploring a particular subject.

What's more, I suspect that expanding the pool of those who express arguments clearly and cogently could reduce the level of personal attacks and nastiness, at least among those who actually wish to engage with others.

One of the issues I've noticed with those engaged in this sort of discussion are arguments which rely upon faulty data, irrational arguments, unclear prose and poor rhetorical style.

Often, moderation causes the best arguments to rise to the top, which can elevate the discussion considerably. However, that can minimize the voices of those with useful and/or interesting things to say simply because they lack the skills to express those things effectively.

I wonder if a section on the site which contains articles, book references, discussions and other resources can help those with poor logic, writing and/or rhetorical skills to up their game?

It seems to me that while we likely wouldn't create any new Pulitzer Prize winners, we may be able to encourage those with a sincere desire to engage others in more cogent, coherent fashion.

I'm all for freewheeling discussion and am certainly not above poking fun at just about anything. At the same time, I believe it might enhance the level of discourse here by helping people to be better writers.

Am I just pissing in the wind here, or does any of this make sense to the rest of you Soylentils?

Rouhani in Europe: Italy covers nudes for Iran president

Posted by takyon on Tuesday January 26 2016, @08:29PM (#1732)
3 Comments
News

Rouhani in Europe: Italy covers nudes for Iran president

Italian hospitality for the visiting Iranian President Hassan Rouhani has stretched to covering up nude statues.

Mr Rouhani and Italian Prime Minister Matteo Renzi spoke at Rome's Capitoline Museum after Italian firms signed business deals with Iran.

But several nudes there were hidden to avoid offending the Iranian president.

Italy also chose not to serve wine at official meals, a gesture France, where Mr Rouhani travels next, has refused to copy.

An Islamic republic, Iran has strict laws governing the consumption of alcohol.

Mr Rouhani is in Europe on a five-day tour seeking to boost economic ties after the implementation of a deal on rolling back Iran's nuclear activity saw sanctions lifted.

"Iran is the safest and most stable country of the entire region," the Iranian president told Italian business leaders.

He also stressed growth would be key to combating extremism, saying "unemployment creates soldiers for terrorists".

Monday saw contracts worth around €17bn ($18.4bn; £12bn) signed between Iran and Italian companies.

On Tuesday, Mr Rouhani also met Pope Francis, who urged Iran to work with other Middle Eastern countries against terrorism and arms trafficking, the Vatican said.