Tomb Raider

Rise of the Tomb Raider (2015)
The game has shown significant improvements over its 2013 predecessor. I am very much looking forward to the sequel.
rating: 8/10
pro

  • The graphics including in-game and cutscene is perfect by 2016 standards, although it is GPU demanding as expected (On a Titan GPU at high setting, the game is at 60 fps most of the time, but a complex, large scene with massive grass or snowflakes can quickly drop it to 30~40).
  • Good map design, offers quite a number of tombs to raid (although still pretty simple to solve) and vast areas to explore.
  • New game element: Lara can receive mission request from NPCs, although all missions are simple to accomplish.

con

  • AI is simplistic.
  • The last chapter is too short. The final boss (the helicopter) is too easy to defeat.
  • The main storyline is still somewhat short.
  • The NPC dialogue system is pretty simplistic.

Tomb Raider (2013)
rating: 7/10
pro

  • The graphics is really amazing.
  • Lara is well portrayed, with a strong, real personality and an attractive appearance that stresses less on sexuality.

con

  • The game is too easy to break.
  • There are too few tombs with overly simple puzzles.
  • The story is too short.
  • Lara makes unpleasant, loud grunt when putting out the torch

Tomb Raider: Legend (2006)
rating: 5/10
pro

  • good graphics of the time
  • new (but simple) elements such as motor drive
  • the Japan level is exceptionally well designed

con

  • annoyingly buggy game control
  • occasional, horrible level design. I would have ranked the game 7/10 without those levels.
    • waterfall consecutive jump at Ghana
    • motor chase at Kazakhstan (worst of all)
    • final boss fight at Kazakhstan (the boss is unbeatable; Lara has to take to flight — seriously?)
    • final boss fight at Bolivia

Prefetch on Intel MIC coprocessor

[updated on April 6, 2016]

Software-based data prefetch on Intel MIC coprocessors is very useful for Monte Carlo transport code. It helps hide the long latency when loading microscopic cross-section data from DRAM. There are a total of 8 different types of prefetch with subtle differences. Here we tell them apart.

Cache hierarchy

A MIC has 32-KB L1 cache per core and 512 KB L2 cache per core. Here by “cache” we mean the data cache instead of instruction cache, and by “core” we mean the physical core instead of logical core. Both levels of cache implement MESI coherency protocol and have a cache line size of 64 bytes (i.e. 8 consecutive FP64 values).

Prefetch instruction

Let’s take a look at two orthogonal concepts first:

  • non-temporal hint (NTA) — informs that data will be used only once in the future and causes them to be evicted from the cache after the first use (most recently used data to be evicted).
  • exclusive hint (E) — renders the cache line on the current core in the “exclusive” state, where the cache lines on other cores are invalidated.

The combination of temporality, exclusiveness, and locality (L1 or L2) together yields 8 types of instructions supported by the present-day Knights Corner MIC. They specify how the data are expected to be uniquely handled in the cache, enumerated below.

instruction hint purpose
vprefetchnta _MM_HINT_NTA loads data to L1 and L2 cache, marks it as NTA
vprefetch0 _MM_HINT_T0 loads data to L1 and L2 cache
vprefetch1 _MM_HINT_T1 loads data to L2 cache only
vprefetch2 _MM_HINT_T2 loads data to L2 cache only, marks it as NTA This mnemonic is counter-intuitive as there is not NTA in it
vprefetchenta _MM_HINT_ENTA exclusive version of vprefetchnta
vprefetche0 _MM_HINT_ET0 exclusive version of vprefetch0
vprefetche1 _MM_HINT_ET1 exclusive version of vprefetch1
vprefetche2 _MM_HINT_ET2 exclusive version of vprefetch2

Note L2 cache of the MIC is inclusive in the sense that it has a copy of all the data in L1.

There are two ways of implementing prefetch in C — intrinsic and assembly.

// method 1: intrinsic
_mm_prefetch((const char*)addr, hint);

// method 2: assembly
asm volatile ("prefetch_inst [%0]"::"m"(addr));

Here addr is the address of the byte starting from which to prefetch, prefetch_inst is the prefetch instructions listed above, and hint is the parameter for the compiler intrinsic. We would like to emphasize again that _MM_HINT_T2 and _MM_HINT_ET2 are counter-intuitive. In fact they are misnomers as both are non-temporary. They should have been named as _MM_HINT_NTA2 and _MM_HINT_ENTA2 by Intel.

Prefetch on CPUs

So how about prefetch on Intel Xeon CPUs? Well, turn out very different! Check the list below.

instruction hint purpose
prefetchnta _MM_HINT_NTA loads data to L2 and L3 cache, marks as NTA
prefetcht0 _MM_HINT_T0 loads data to L2 and L3 cache
prefetcht1 _MM_HINT_T1 equivalent to prefetch0
prefetcht2 _MM_HINT_T2 equivalent to prefetch0
prefetchw n/a[2] exclusive version of prefetch0 [1]
prefetchwt1 n/a[3] equivalent to prefetchw [1]

[1] not confirmed
[2] icpc does not compiler _mm_prefetch((const char*)addr, _MM_HINT_ENTA);
[3] icpc does not compile _mm_prefetch((const char*)addr, _MM_HINT_ET1);
Note L3 cache of the Intel Xeon CPU is inclusive in the sense that it has a copy of all the data in L2.

Reference
[1]Intel Xeon Phi Coprocessor Instruction Set Architecture Reference Manual, 2012.
[2]Intel 64 and IA-32 Architectures Software Developer’s Manual, 2015.