KASHGAR, CHINA (NYTIMES) - A God's-eye view of Kashgar, an ancient city in western China, flashed onto a wall-size screen, with colourful icons marking police stations, checkpoints and the locations of recent security incidents.
At the click of a mouse, a technician explained, the police can pull up live video from any surveillance camera or take a closer look at anyone passing through one of the thousands of checkpoints in the city.
To demonstrate, she showed how the system could retrieve the photo, home address and official identification number of a woman who had been stopped at a checkpoint on a major highway. The system sifted through billions of records, then displayed details of her education, family ties, links to an earlier case and recent visits to a hotel and an Internet cafe.
The simulation, presented at an industry fair in China, offered a rare look at a system that now peers into nearly every corner of Xinjiang, the troubled region where Kashgar is located.
This is the vision of high-tech surveillance - precise, all-seeing, infallible - that China's leaders are investing billions of dollars in every year, making Xinjiang an incubator for increasingly intrusive policing systems that could spread across the country and beyond.
It is also a vision that some of US President Donald Trump's aides have begun citing in a push for tougher action against Chinese companies in the intensifying trade war. Beyond concerns about market barriers, theft and national security, they argue that China is using technology to strengthen authoritarianism at home and abroad - and that the United States must stop it.
Developed and sold by the China Electronics Technology, a state-run defence manufacturer, the system in Kashgar is on the cutting edge of what has become a flourishing new market for technology that the government can use to monitor and subdue millions of Uighurs and members of other Muslim ethnic groups in Xinjiang.
Treating a city like a battlefield, the platform was designed to "apply the ideas of military cyber systems to civilian public security", Mr Wang Pengda, a China Electronics Technology engineer, said in an official blog post. "Looking back, it truly was an idea ahead of its time."
The system taps networks of neighbourhood informants, tracks individuals and analyses their behaviour, tries to anticipate potential crime, protest or violence, and then recommends which security forces to deploy, the company said.
On the screen during the demonstration was a slogan: "If someone exists, there will be traces, and if there are connections, there will be information."
A New York Times investigation drawing on government and company records as well as interviews with industry insiders found that China is, in effect, hardwiring Xinjiang for segregated surveillance, using an army of security personnel to compel ethnic minorities to submit to monitoring and data collection while generally ignoring the majority Han Chinese, who make up 36 per cent of Xinjiang's population.
It is a virtual cage that complements the indoctrination camps in Xinjiang where the authorities have detained one million or more Uighurs and other Muslims in a push to transform them into secular citizens who will never challenge the ruling Communist Party. The programme helps identify people to be sent to the camps or investigated, and keeps tabs on them when they are released.
The Trump administration is considering whether to blacklist one of the Chinese companies at the centre of the Xinjiang effort, Hikvision, and bar it from buying US technology.
Hikvision is a major manufacturer of video surveillance equipment, with customers around the world and across Xinjiang, where its cameras have been installed at mosques and detention camps. China Electronics Technology owns about 42 per cent of the company through subsidiaries.
"Xinjiang is, maybe, a kind of more extreme, more intrusive example of China's mass surveillance systems," said Ms Maya Wang, a China researcher for Human Rights Watch who has studied the technology in the region. "These systems are designed for a very explicit purpose - to target Muslims."
In the city of Kashgar, with a population of 720,000 - about 85 per cent of them Uighur - the China Electronics Technology platform draws on databases with 68 billion records, including those on people's movements and activities, according to the demonstration viewed by a Times reporter at the industry fair, held in the eastern city of Wuzhen in late 2017.
By comparison, the FBI's national instant criminal background check system contained about 19 million records at the end of last year.
The police in Xinjiang use a mobile app, made by China Electronics Technology for smartphones running the Android operating system, to enter information into the databases.
Human Rights Watch, which obtained and analysed the app, said it helped the authorities spot behaviour that they consider suspicious, including extended travel abroad or the use of an "unusual" amount of electricity.
The app, which the Times examined, also allows police officers to flag people they believe have stopped using a smartphone, have begun avoiding the use of the front door in coming and going from home, or have refuelled someone else's car.
The police use the app at checkpoints that serve as virtual "fences" across Xinjiang. If someone is tagged as a potential threat, the system can be set to trigger an alarm every time he or she tries to leave the neighbourhood or enter a public place, Human Rights Watch said.
The Chinese government has defended the surveillance programme, saying it has improved security in the region, and says the indoctrination camps in Xinjiang are job training centres. Hikvision has denied "any inappropriate actions in Xinjiang", and China Electronics Technology declined to comment when reached by phone.
The Communist Party, which took control of the region in 1949, has long been wary of the Uighurs, whose Turkic culture and Muslim faith have inspired demands for self-rule, and sometimes attacks on Chinese targets. State investment in surveillance took off a decade ago after anti-Chinese rioting in the regional capital, Urumqi, killed nearly 200 people.
The real bonanza of security contracts came after President Xi Jinping took the helm of the party in late 2012. Spending on internal security in Xinjiang totalled nearly US$8.4 billion (S$11.6 billion) in 2017, six times as much as in 2012, including funds for surveillance, personnel and the indoctrination camps.
Hikvision has received contracts in Xinjiang worth at least US$290 million for its cameras and facial-recognition systems. Another company tapping Xinjiang's security gold rush is Huawei, the Chinese tech giant that the US has described as a security threat. It signed an agreement last year with the region's police department to help officers analyse data.
The multilayered programme to harvest information from Uighurs and other Muslims begins on the edges of towns and cities across Xinjiang in buildings that look like toll plazas.
Instead of coins, they collect personal information.
On a recent visit to one checkpoint in Kashgar, a line of passengers and drivers, nearly all Uighur, got out of their vehicles, trudged through automated gates made by China Electronics Technology and swiped their identity cards.
"Head up," the machines chimed as they photographed the motorists and armed guards looked on.
Not everyone has to endure the inconvenience. At many checkpoints, privileged groups - Han Chinese, Uighur officials with passes, and foreign visitors - are waved through "green channels". In this way, the authorities have created separate yet overlapping worlds on the same streets - and in the online police databases - one for Muslim minorities, the other for Han Chinese.
"The goal here is instilling fear - fear that their surveillance technology can see into every corner of your life," said Chinese author Wang Lixiong, who has written about Xinjiang as well as China's surveillance state. "The amount of people and equipment used for security is part of the deterrent effect."
The authorities in Xinjiang also sometimes force residents to install an app known as "Clean Net Guard" on their phones to monitor for content that the government deems suspicious.
Kashgar and other areas of Xinjiang have, in recent years, systematically collected DNA and other biological data from residents, too, especially Muslims. Officials now collect blood, fingerprints, voice recordings, head portraits from multiple angles, and scans of irises, which can provide a unique identifier like fingerprints.
These databases are not yet completely integrated, and despite the futuristic gloss of the Xinjiang surveillance state, the authorities rely on hundreds of thousands of police officers, officials and neighbourhood monitors to gather and enter data.
"We risk understating the extent to which this high-tech police state continues to require a lot of manpower," said Mr Adrian Zenz, an independent researcher who has studied security spending in Xinjiang. "It is the combination of manpower and technology that makes the 21st-century police state so powerful."